vendor.js 319 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500
  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.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;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) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) 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) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; 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.resolve(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. /^\$|Window$|WindowStyle$|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. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. 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];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });
  312. function findExistsPageIndex(url) {
  313. var pages = getCurrentPages();
  314. var len = pages.length;
  315. while (len--) {
  316. var page = pages[len];
  317. if (page.$page && page.$page.fullPath === url) {
  318. return len;
  319. }
  320. }
  321. return -1;
  322. }
  323. var redirectTo = {
  324. name: function name(fromArgs) {
  325. if (fromArgs.exists === 'back' && fromArgs.delta) {
  326. return 'navigateBack';
  327. }
  328. return 'redirectTo';
  329. },
  330. args: function args(fromArgs) {
  331. if (fromArgs.exists === 'back' && fromArgs.url) {
  332. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  333. if (existsPageIndex !== -1) {
  334. var delta = getCurrentPages().length - 1 - existsPageIndex;
  335. if (delta > 0) {
  336. fromArgs.delta = delta;
  337. }
  338. }
  339. }
  340. } };
  341. var previewImage = {
  342. args: function args(fromArgs) {
  343. var currentIndex = parseInt(fromArgs.current);
  344. if (isNaN(currentIndex)) {
  345. return;
  346. }
  347. var urls = fromArgs.urls;
  348. if (!Array.isArray(urls)) {
  349. return;
  350. }
  351. var len = urls.length;
  352. if (!len) {
  353. return;
  354. }
  355. if (currentIndex < 0) {
  356. currentIndex = 0;
  357. } else if (currentIndex >= len) {
  358. currentIndex = len - 1;
  359. }
  360. if (currentIndex > 0) {
  361. fromArgs.current = urls[currentIndex];
  362. fromArgs.urls = urls.filter(
  363. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  364. } else {
  365. fromArgs.current = urls[0];
  366. }
  367. return {
  368. indicator: false,
  369. loop: false };
  370. } };
  371. var UUID_KEY = '__DC_STAT_UUID';
  372. var deviceId;
  373. function addUuid(result) {
  374. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  375. if (!deviceId) {
  376. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  377. wx.setStorage({
  378. key: UUID_KEY,
  379. data: deviceId });
  380. }
  381. result.deviceId = deviceId;
  382. }
  383. function addSafeAreaInsets(result) {
  384. if (result.safeArea) {
  385. var safeArea = result.safeArea;
  386. result.safeAreaInsets = {
  387. top: safeArea.top,
  388. left: safeArea.left,
  389. right: result.windowWidth - safeArea.right,
  390. bottom: result.windowHeight - safeArea.bottom };
  391. }
  392. }
  393. var getSystemInfo = {
  394. returnValue: function returnValue(result) {
  395. addUuid(result);
  396. addSafeAreaInsets(result);
  397. } };
  398. // import navigateTo from 'uni-helpers/navigate-to'
  399. var protocols = {
  400. redirectTo: redirectTo,
  401. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  402. previewImage: previewImage,
  403. getSystemInfo: getSystemInfo,
  404. getSystemInfoSync: getSystemInfo };
  405. var todos = [
  406. 'vibrate',
  407. 'preloadPage',
  408. 'unPreloadPage',
  409. 'loadSubPackage'];
  410. var canIUses = [];
  411. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  412. function processCallback(methodName, method, returnValue) {
  413. return function (res) {
  414. return method(processReturnValue(methodName, res, returnValue));
  415. };
  416. }
  417. 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;
  418. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  419. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  420. if (isFn(argsOption)) {
  421. argsOption = argsOption(fromArgs, toArgs) || {};
  422. }
  423. for (var key in fromArgs) {
  424. if (hasOwn(argsOption, key)) {
  425. var keyOption = argsOption[key];
  426. if (isFn(keyOption)) {
  427. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  428. }
  429. if (!keyOption) {// 不支持的参数
  430. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  431. } else if (isStr(keyOption)) {// 重写参数 key
  432. toArgs[keyOption] = fromArgs[key];
  433. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  434. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  435. }
  436. } else if (CALLBACKS.indexOf(key) !== -1) {
  437. if (isFn(fromArgs[key])) {
  438. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  439. }
  440. } else {
  441. if (!keepFromArgs) {
  442. toArgs[key] = fromArgs[key];
  443. }
  444. }
  445. }
  446. return toArgs;
  447. } else if (isFn(fromArgs)) {
  448. fromArgs = processCallback(methodName, fromArgs, returnValue);
  449. }
  450. return fromArgs;
  451. }
  452. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  453. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  454. res = protocols.returnValue(methodName, res);
  455. }
  456. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  457. }
  458. function wrapper(methodName, method) {
  459. if (hasOwn(protocols, methodName)) {
  460. var protocol = protocols[methodName];
  461. if (!protocol) {// 暂不支持的 api
  462. return function () {
  463. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  464. };
  465. }
  466. return function (arg1, arg2) {// 目前 api 最多两个参数
  467. var options = protocol;
  468. if (isFn(protocol)) {
  469. options = protocol(arg1);
  470. }
  471. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  472. var args = [arg1];
  473. if (typeof arg2 !== 'undefined') {
  474. args.push(arg2);
  475. }
  476. if (isFn(options.name)) {
  477. methodName = options.name(arg1);
  478. } else if (isStr(options.name)) {
  479. methodName = options.name;
  480. }
  481. var returnValue = wx[methodName].apply(wx, args);
  482. if (isSyncApi(methodName)) {// 同步 api
  483. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  484. }
  485. return returnValue;
  486. };
  487. }
  488. return method;
  489. }
  490. var todoApis = Object.create(null);
  491. var TODOS = [
  492. 'onTabBarMidButtonTap',
  493. 'subscribePush',
  494. 'unsubscribePush',
  495. 'onPush',
  496. 'offPush',
  497. 'share'];
  498. function createTodoApi(name) {
  499. return function todoApi(_ref)
  500. {var fail = _ref.fail,complete = _ref.complete;
  501. var res = {
  502. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  503. isFn(fail) && fail(res);
  504. isFn(complete) && complete(res);
  505. };
  506. }
  507. TODOS.forEach(function (name) {
  508. todoApis[name] = createTodoApi(name);
  509. });
  510. var providers = {
  511. oauth: ['weixin'],
  512. share: ['weixin'],
  513. payment: ['wxpay'],
  514. push: ['weixin'] };
  515. function getProvider(_ref2)
  516. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  517. var res = false;
  518. if (providers[service]) {
  519. res = {
  520. errMsg: 'getProvider:ok',
  521. service: service,
  522. provider: providers[service] };
  523. isFn(success) && success(res);
  524. } else {
  525. res = {
  526. errMsg: 'getProvider:fail service not found' };
  527. isFn(fail) && fail(res);
  528. }
  529. isFn(complete) && complete(res);
  530. }
  531. var extraApi = /*#__PURE__*/Object.freeze({
  532. __proto__: null,
  533. getProvider: getProvider });
  534. var getEmitter = function () {
  535. var Emitter;
  536. return function getUniEmitter() {
  537. if (!Emitter) {
  538. Emitter = new _vue.default();
  539. }
  540. return Emitter;
  541. };
  542. }();
  543. function apply(ctx, method, args) {
  544. return ctx[method].apply(ctx, args);
  545. }
  546. function $on() {
  547. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  548. }
  549. function $off() {
  550. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  551. }
  552. function $once() {
  553. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  554. }
  555. function $emit() {
  556. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  557. }
  558. var eventApi = /*#__PURE__*/Object.freeze({
  559. __proto__: null,
  560. $on: $on,
  561. $off: $off,
  562. $once: $once,
  563. $emit: $emit });
  564. var api = /*#__PURE__*/Object.freeze({
  565. __proto__: null });
  566. var MPPage = Page;
  567. var MPComponent = Component;
  568. var customizeRE = /:/g;
  569. var customize = cached(function (str) {
  570. return camelize(str.replace(customizeRE, '-'));
  571. });
  572. function initTriggerEvent(mpInstance) {
  573. {
  574. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  575. return;
  576. }
  577. }
  578. var oldTriggerEvent = mpInstance.triggerEvent;
  579. 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];}
  580. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  581. };
  582. }
  583. function initHook(name, options) {
  584. var oldHook = options[name];
  585. if (!oldHook) {
  586. options[name] = function () {
  587. initTriggerEvent(this);
  588. };
  589. } else {
  590. options[name] = function () {
  591. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  592. return oldHook.apply(this, args);
  593. };
  594. }
  595. }
  596. if (!MPPage.__$wrappered) {
  597. MPPage.__$wrappered = true;
  598. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  599. initHook('onLoad', options);
  600. return MPPage(options);
  601. };
  602. Page.after = MPPage.after;
  603. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  604. initHook('created', options);
  605. return MPComponent(options);
  606. };
  607. }
  608. var PAGE_EVENT_HOOKS = [
  609. 'onPullDownRefresh',
  610. 'onReachBottom',
  611. 'onAddToFavorites',
  612. 'onShareTimeline',
  613. 'onShareAppMessage',
  614. 'onPageScroll',
  615. 'onResize',
  616. 'onTabItemTap'];
  617. function initMocks(vm, mocks) {
  618. var mpInstance = vm.$mp[vm.mpType];
  619. mocks.forEach(function (mock) {
  620. if (hasOwn(mpInstance, mock)) {
  621. vm[mock] = mpInstance[mock];
  622. }
  623. });
  624. }
  625. function hasHook(hook, vueOptions) {
  626. if (!vueOptions) {
  627. return true;
  628. }
  629. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  630. return true;
  631. }
  632. vueOptions = vueOptions.default || vueOptions;
  633. if (isFn(vueOptions)) {
  634. if (isFn(vueOptions.extendOptions[hook])) {
  635. return true;
  636. }
  637. if (vueOptions.super &&
  638. vueOptions.super.options &&
  639. Array.isArray(vueOptions.super.options[hook])) {
  640. return true;
  641. }
  642. return false;
  643. }
  644. if (isFn(vueOptions[hook])) {
  645. return true;
  646. }
  647. var mixins = vueOptions.mixins;
  648. if (Array.isArray(mixins)) {
  649. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  650. }
  651. }
  652. function initHooks(mpOptions, hooks, vueOptions) {
  653. hooks.forEach(function (hook) {
  654. if (hasHook(hook, vueOptions)) {
  655. mpOptions[hook] = function (args) {
  656. return this.$vm && this.$vm.__call_hook(hook, args);
  657. };
  658. }
  659. });
  660. }
  661. function initVueComponent(Vue, vueOptions) {
  662. vueOptions = vueOptions.default || vueOptions;
  663. var VueComponent;
  664. if (isFn(vueOptions)) {
  665. VueComponent = vueOptions;
  666. } else {
  667. VueComponent = Vue.extend(vueOptions);
  668. }
  669. vueOptions = VueComponent.options;
  670. return [VueComponent, vueOptions];
  671. }
  672. function initSlots(vm, vueSlots) {
  673. if (Array.isArray(vueSlots) && vueSlots.length) {
  674. var $slots = Object.create(null);
  675. vueSlots.forEach(function (slotName) {
  676. $slots[slotName] = true;
  677. });
  678. vm.$scopedSlots = vm.$slots = $slots;
  679. }
  680. }
  681. function initVueIds(vueIds, mpInstance) {
  682. vueIds = (vueIds || '').split(',');
  683. var len = vueIds.length;
  684. if (len === 1) {
  685. mpInstance._$vueId = vueIds[0];
  686. } else if (len === 2) {
  687. mpInstance._$vueId = vueIds[0];
  688. mpInstance._$vuePid = vueIds[1];
  689. }
  690. }
  691. function initData(vueOptions, context) {
  692. var data = vueOptions.data || {};
  693. var methods = vueOptions.methods || {};
  694. if (typeof data === 'function') {
  695. try {
  696. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  697. } catch (e) {
  698. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  699. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  700. }
  701. }
  702. } else {
  703. try {
  704. // 对 data 格式化
  705. data = JSON.parse(JSON.stringify(data));
  706. } catch (e) {}
  707. }
  708. if (!isPlainObject(data)) {
  709. data = {};
  710. }
  711. Object.keys(methods).forEach(function (methodName) {
  712. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  713. data[methodName] = methods[methodName];
  714. }
  715. });
  716. return data;
  717. }
  718. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  719. function createObserver(name) {
  720. return function observer(newVal, oldVal) {
  721. if (this.$vm) {
  722. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  723. }
  724. };
  725. }
  726. function initBehaviors(vueOptions, initBehavior) {
  727. var vueBehaviors = vueOptions.behaviors;
  728. var vueExtends = vueOptions.extends;
  729. var vueMixins = vueOptions.mixins;
  730. var vueProps = vueOptions.props;
  731. if (!vueProps) {
  732. vueOptions.props = vueProps = [];
  733. }
  734. var behaviors = [];
  735. if (Array.isArray(vueBehaviors)) {
  736. vueBehaviors.forEach(function (behavior) {
  737. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  738. if (behavior === 'uni://form-field') {
  739. if (Array.isArray(vueProps)) {
  740. vueProps.push('name');
  741. vueProps.push('value');
  742. } else {
  743. vueProps.name = {
  744. type: String,
  745. default: '' };
  746. vueProps.value = {
  747. type: [String, Number, Boolean, Array, Object, Date],
  748. default: '' };
  749. }
  750. }
  751. });
  752. }
  753. if (isPlainObject(vueExtends) && vueExtends.props) {
  754. behaviors.push(
  755. initBehavior({
  756. properties: initProperties(vueExtends.props, true) }));
  757. }
  758. if (Array.isArray(vueMixins)) {
  759. vueMixins.forEach(function (vueMixin) {
  760. if (isPlainObject(vueMixin) && vueMixin.props) {
  761. behaviors.push(
  762. initBehavior({
  763. properties: initProperties(vueMixin.props, true) }));
  764. }
  765. });
  766. }
  767. return behaviors;
  768. }
  769. function parsePropType(key, type, defaultValue, file) {
  770. // [String]=>String
  771. if (Array.isArray(type) && type.length === 1) {
  772. return type[0];
  773. }
  774. return type;
  775. }
  776. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  777. var properties = {};
  778. if (!isBehavior) {
  779. properties.vueId = {
  780. type: String,
  781. value: '' };
  782. // 用于字节跳动小程序模拟抽象节点
  783. properties.generic = {
  784. type: Object,
  785. value: null };
  786. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  787. type: null,
  788. value: [],
  789. observer: function observer(newVal, oldVal) {
  790. var $slots = Object.create(null);
  791. newVal.forEach(function (slotName) {
  792. $slots[slotName] = true;
  793. });
  794. this.setData({
  795. $slots: $slots });
  796. } };
  797. }
  798. if (Array.isArray(props)) {// ['title']
  799. props.forEach(function (key) {
  800. properties[key] = {
  801. type: null,
  802. observer: createObserver(key) };
  803. });
  804. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  805. Object.keys(props).forEach(function (key) {
  806. var opts = props[key];
  807. if (isPlainObject(opts)) {// title:{type:String,default:''}
  808. var value = opts.default;
  809. if (isFn(value)) {
  810. value = value();
  811. }
  812. opts.type = parsePropType(key, opts.type);
  813. properties[key] = {
  814. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  815. value: value,
  816. observer: createObserver(key) };
  817. } else {// content:String
  818. var type = parsePropType(key, opts);
  819. properties[key] = {
  820. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  821. observer: createObserver(key) };
  822. }
  823. });
  824. }
  825. return properties;
  826. }
  827. function wrapper$1(event) {
  828. // TODO 又得兼容 mpvue 的 mp 对象
  829. try {
  830. event.mp = JSON.parse(JSON.stringify(event));
  831. } catch (e) {}
  832. event.stopPropagation = noop;
  833. event.preventDefault = noop;
  834. event.target = event.target || {};
  835. if (!hasOwn(event, 'detail')) {
  836. event.detail = {};
  837. }
  838. if (hasOwn(event, 'markerId')) {
  839. event.detail = typeof event.detail === 'object' ? event.detail : {};
  840. event.detail.markerId = event.markerId;
  841. }
  842. if (isPlainObject(event.detail)) {
  843. event.target = Object.assign({}, event.target, event.detail);
  844. }
  845. return event;
  846. }
  847. function getExtraValue(vm, dataPathsArray) {
  848. var context = vm;
  849. dataPathsArray.forEach(function (dataPathArray) {
  850. var dataPath = dataPathArray[0];
  851. var value = dataPathArray[2];
  852. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  853. var propPath = dataPathArray[1];
  854. var valuePath = dataPathArray[3];
  855. var vFor;
  856. if (Number.isInteger(dataPath)) {
  857. vFor = dataPath;
  858. } else if (!dataPath) {
  859. vFor = context;
  860. } else if (typeof dataPath === 'string' && dataPath) {
  861. if (dataPath.indexOf('#s#') === 0) {
  862. vFor = dataPath.substr(3);
  863. } else {
  864. vFor = vm.__get_value(dataPath, context);
  865. }
  866. }
  867. if (Number.isInteger(vFor)) {
  868. context = value;
  869. } else if (!propPath) {
  870. context = vFor[value];
  871. } else {
  872. if (Array.isArray(vFor)) {
  873. context = vFor.find(function (vForItem) {
  874. return vm.__get_value(propPath, vForItem) === value;
  875. });
  876. } else if (isPlainObject(vFor)) {
  877. context = Object.keys(vFor).find(function (vForKey) {
  878. return vm.__get_value(propPath, vFor[vForKey]) === value;
  879. });
  880. } else {
  881. console.error('v-for 暂不支持循环数据:', vFor);
  882. }
  883. }
  884. if (valuePath) {
  885. context = vm.__get_value(valuePath, context);
  886. }
  887. }
  888. });
  889. return context;
  890. }
  891. function processEventExtra(vm, extra, event) {
  892. var extraObj = {};
  893. if (Array.isArray(extra) && extra.length) {
  894. /**
  895. *[
  896. * ['data.items', 'data.id', item.data.id],
  897. * ['metas', 'id', meta.id]
  898. *],
  899. *[
  900. * ['data.items', 'data.id', item.data.id],
  901. * ['metas', 'id', meta.id]
  902. *],
  903. *'test'
  904. */
  905. extra.forEach(function (dataPath, index) {
  906. if (typeof dataPath === 'string') {
  907. if (!dataPath) {// model,prop.sync
  908. extraObj['$' + index] = vm;
  909. } else {
  910. if (dataPath === '$event') {// $event
  911. extraObj['$' + index] = event;
  912. } else if (dataPath === 'arguments') {
  913. if (event.detail && event.detail.__args__) {
  914. extraObj['$' + index] = event.detail.__args__;
  915. } else {
  916. extraObj['$' + index] = [event];
  917. }
  918. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  919. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  920. } else {
  921. extraObj['$' + index] = vm.__get_value(dataPath);
  922. }
  923. }
  924. } else {
  925. extraObj['$' + index] = getExtraValue(vm, dataPath);
  926. }
  927. });
  928. }
  929. return extraObj;
  930. }
  931. function getObjByArray(arr) {
  932. var obj = {};
  933. for (var i = 1; i < arr.length; i++) {
  934. var element = arr[i];
  935. obj[element[0]] = element[1];
  936. }
  937. return obj;
  938. }
  939. 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;
  940. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  941. if (isCustom) {// 自定义事件
  942. isCustomMPEvent = event.currentTarget &&
  943. event.currentTarget.dataset &&
  944. event.currentTarget.dataset.comType === 'wx';
  945. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  946. if (isCustomMPEvent) {
  947. return [event];
  948. }
  949. return event.detail.__args__ || event.detail;
  950. }
  951. }
  952. var extraObj = processEventExtra(vm, extra, event);
  953. var ret = [];
  954. args.forEach(function (arg) {
  955. if (arg === '$event') {
  956. if (methodName === '__set_model' && !isCustom) {// input v-model value
  957. ret.push(event.target.value);
  958. } else {
  959. if (isCustom && !isCustomMPEvent) {
  960. ret.push(event.detail.__args__[0]);
  961. } else {// wxcomponent 组件或内置组件
  962. ret.push(event);
  963. }
  964. }
  965. } else {
  966. if (Array.isArray(arg) && arg[0] === 'o') {
  967. ret.push(getObjByArray(arg));
  968. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  969. ret.push(extraObj[arg]);
  970. } else {
  971. ret.push(arg);
  972. }
  973. }
  974. });
  975. return ret;
  976. }
  977. var ONCE = '~';
  978. var CUSTOM = '^';
  979. function isMatchEventType(eventType, optType) {
  980. return eventType === optType ||
  981. optType === 'regionchange' && (
  982. eventType === 'begin' ||
  983. eventType === 'end');
  984. }
  985. function getContextVm(vm) {
  986. var $parent = vm.$parent;
  987. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  988. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  989. $parent = $parent.$parent;
  990. }
  991. return $parent && $parent.$parent;
  992. }
  993. function handleEvent(event) {var _this = this;
  994. event = wrapper$1(event);
  995. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  996. var dataset = (event.currentTarget || event.target).dataset;
  997. if (!dataset) {
  998. return console.warn('事件信息不存在');
  999. }
  1000. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1001. if (!eventOpts) {
  1002. return console.warn('事件信息不存在');
  1003. }
  1004. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1005. var eventType = event.type;
  1006. var ret = [];
  1007. eventOpts.forEach(function (eventOpt) {
  1008. var type = eventOpt[0];
  1009. var eventsArray = eventOpt[1];
  1010. var isCustom = type.charAt(0) === CUSTOM;
  1011. type = isCustom ? type.slice(1) : type;
  1012. var isOnce = type.charAt(0) === ONCE;
  1013. type = isOnce ? type.slice(1) : type;
  1014. if (eventsArray && isMatchEventType(eventType, type)) {
  1015. eventsArray.forEach(function (eventArray) {
  1016. var methodName = eventArray[0];
  1017. if (methodName) {
  1018. var handlerCtx = _this.$vm;
  1019. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1020. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1021. }
  1022. if (methodName === '$emit') {
  1023. handlerCtx.$emit.apply(handlerCtx,
  1024. processEventArgs(
  1025. _this.$vm,
  1026. event,
  1027. eventArray[1],
  1028. eventArray[2],
  1029. isCustom,
  1030. methodName));
  1031. return;
  1032. }
  1033. var handler = handlerCtx[methodName];
  1034. if (!isFn(handler)) {
  1035. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1036. }
  1037. if (isOnce) {
  1038. if (handler.once) {
  1039. return;
  1040. }
  1041. handler.once = true;
  1042. }
  1043. var params = processEventArgs(
  1044. _this.$vm,
  1045. event,
  1046. eventArray[1],
  1047. eventArray[2],
  1048. isCustom,
  1049. methodName);
  1050. params = Array.isArray(params) ? params : [];
  1051. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1052. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1053. // eslint-disable-next-line no-sparse-arrays
  1054. params = params.concat([,,,,,,,,,, event]);
  1055. }
  1056. ret.push(handler.apply(handlerCtx, params));
  1057. }
  1058. });
  1059. }
  1060. });
  1061. if (
  1062. eventType === 'input' &&
  1063. ret.length === 1 &&
  1064. typeof ret[0] !== 'undefined')
  1065. {
  1066. return ret[0];
  1067. }
  1068. }
  1069. var eventChannels = {};
  1070. var eventChannelStack = [];
  1071. function getEventChannel(id) {
  1072. if (id) {
  1073. var eventChannel = eventChannels[id];
  1074. delete eventChannels[id];
  1075. return eventChannel;
  1076. }
  1077. return eventChannelStack.shift();
  1078. }
  1079. var hooks = [
  1080. 'onShow',
  1081. 'onHide',
  1082. 'onError',
  1083. 'onPageNotFound',
  1084. 'onThemeChange',
  1085. 'onUnhandledRejection'];
  1086. function initEventChannel() {
  1087. _vue.default.prototype.getOpenerEventChannel = function () {
  1088. // 微信小程序使用自身getOpenerEventChannel
  1089. {
  1090. return this.$scope.getOpenerEventChannel();
  1091. }
  1092. };
  1093. var callHook = _vue.default.prototype.__call_hook;
  1094. _vue.default.prototype.__call_hook = function (hook, args) {
  1095. if (hook === 'onLoad' && args && args.__id__) {
  1096. this.__eventChannel__ = getEventChannel(args.__id__);
  1097. delete args.__id__;
  1098. }
  1099. return callHook.call(this, hook, args);
  1100. };
  1101. }
  1102. function initScopedSlotsParams() {
  1103. var center = {};
  1104. var parents = {};
  1105. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1106. var has = center[vueId];
  1107. if (!has) {
  1108. parents[vueId] = this;
  1109. this.$on('hook:destory', function () {
  1110. delete parents[vueId];
  1111. });
  1112. }
  1113. return has;
  1114. };
  1115. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1116. var data = center[vueId];
  1117. if (data) {
  1118. var object = data[name] || {};
  1119. return key ? object[key] : object;
  1120. } else {
  1121. parents[vueId] = this;
  1122. this.$on('hook:destory', function () {
  1123. delete parents[vueId];
  1124. });
  1125. }
  1126. };
  1127. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1128. var vueId = this.$options.propsData.vueId;
  1129. var object = center[vueId] = center[vueId] || {};
  1130. object[name] = value;
  1131. if (parents[vueId]) {
  1132. parents[vueId].$forceUpdate();
  1133. }
  1134. };
  1135. _vue.default.mixin({
  1136. destroyed: function destroyed() {
  1137. var propsData = this.$options.propsData;
  1138. var vueId = propsData && propsData.vueId;
  1139. if (vueId) {
  1140. delete center[vueId];
  1141. delete parents[vueId];
  1142. }
  1143. } });
  1144. }
  1145. function parseBaseApp(vm, _ref3)
  1146. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1147. initEventChannel();
  1148. {
  1149. initScopedSlotsParams();
  1150. }
  1151. if (vm.$options.store) {
  1152. _vue.default.prototype.$store = vm.$options.store;
  1153. }
  1154. _vue.default.prototype.mpHost = "mp-weixin";
  1155. _vue.default.mixin({
  1156. beforeCreate: function beforeCreate() {
  1157. if (!this.$options.mpType) {
  1158. return;
  1159. }
  1160. this.mpType = this.$options.mpType;
  1161. this.$mp = _defineProperty({
  1162. data: {} },
  1163. this.mpType, this.$options.mpInstance);
  1164. this.$scope = this.$options.mpInstance;
  1165. delete this.$options.mpType;
  1166. delete this.$options.mpInstance;
  1167. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1168. var app = getApp();
  1169. if (app.$vm && app.$vm.$i18n) {
  1170. this._i18n = app.$vm.$i18n;
  1171. }
  1172. }
  1173. if (this.mpType !== 'app') {
  1174. initRefs(this);
  1175. initMocks(this, mocks);
  1176. }
  1177. } });
  1178. var appOptions = {
  1179. onLaunch: function onLaunch(args) {
  1180. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1181. return;
  1182. }
  1183. {
  1184. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1185. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1186. }
  1187. }
  1188. this.$vm = vm;
  1189. this.$vm.$mp = {
  1190. app: this };
  1191. this.$vm.$scope = this;
  1192. // vm 上也挂载 globalData
  1193. this.$vm.globalData = this.globalData;
  1194. this.$vm._isMounted = true;
  1195. this.$vm.__call_hook('mounted', args);
  1196. this.$vm.__call_hook('onLaunch', args);
  1197. } };
  1198. // 兼容旧版本 globalData
  1199. appOptions.globalData = vm.$options.globalData || {};
  1200. // 将 methods 中的方法挂在 getApp() 中
  1201. var methods = vm.$options.methods;
  1202. if (methods) {
  1203. Object.keys(methods).forEach(function (name) {
  1204. appOptions[name] = methods[name];
  1205. });
  1206. }
  1207. initHooks(appOptions, hooks);
  1208. return appOptions;
  1209. }
  1210. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1211. function findVmByVueId(vm, vuePid) {
  1212. var $children = vm.$children;
  1213. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1214. for (var i = $children.length - 1; i >= 0; i--) {
  1215. var childVm = $children[i];
  1216. if (childVm.$scope._$vueId === vuePid) {
  1217. return childVm;
  1218. }
  1219. }
  1220. // 反向递归查找
  1221. var parentVm;
  1222. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1223. parentVm = findVmByVueId($children[_i], vuePid);
  1224. if (parentVm) {
  1225. return parentVm;
  1226. }
  1227. }
  1228. }
  1229. function initBehavior(options) {
  1230. return Behavior(options);
  1231. }
  1232. function isPage() {
  1233. return !!this.route;
  1234. }
  1235. function initRelation(detail) {
  1236. this.triggerEvent('__l', detail);
  1237. }
  1238. function selectAllComponents(mpInstance, selector, $refs) {
  1239. var components = mpInstance.selectAllComponents(selector);
  1240. components.forEach(function (component) {
  1241. var ref = component.dataset.ref;
  1242. $refs[ref] = component.$vm || component;
  1243. {
  1244. if (component.dataset.vueGeneric === 'scoped') {
  1245. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1246. selectAllComponents(scopedComponent, selector, $refs);
  1247. });
  1248. }
  1249. }
  1250. });
  1251. }
  1252. function initRefs(vm) {
  1253. var mpInstance = vm.$scope;
  1254. Object.defineProperty(vm, '$refs', {
  1255. get: function get() {
  1256. var $refs = {};
  1257. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1258. // TODO 暂不考虑 for 中的 scoped
  1259. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1260. forComponents.forEach(function (component) {
  1261. var ref = component.dataset.ref;
  1262. if (!$refs[ref]) {
  1263. $refs[ref] = [];
  1264. }
  1265. $refs[ref].push(component.$vm || component);
  1266. });
  1267. return $refs;
  1268. } });
  1269. }
  1270. function handleLink(event) {var _ref4 =
  1271. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1272. var parentVm;
  1273. if (vuePid) {
  1274. parentVm = findVmByVueId(this.$vm, vuePid);
  1275. }
  1276. if (!parentVm) {
  1277. parentVm = this.$vm;
  1278. }
  1279. vueOptions.parent = parentVm;
  1280. }
  1281. function parseApp(vm) {
  1282. return parseBaseApp(vm, {
  1283. mocks: mocks,
  1284. initRefs: initRefs });
  1285. }
  1286. function createApp(vm) {
  1287. App(parseApp(vm));
  1288. return vm;
  1289. }
  1290. var encodeReserveRE = /[!'()*]/g;
  1291. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1292. var commaRE = /%2C/g;
  1293. // fixed encodeURIComponent which is more conformant to RFC3986:
  1294. // - escapes [!'()*]
  1295. // - preserve commas
  1296. var encode = function encode(str) {return encodeURIComponent(str).
  1297. replace(encodeReserveRE, encodeReserveReplacer).
  1298. replace(commaRE, ',');};
  1299. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1300. var res = obj ? Object.keys(obj).map(function (key) {
  1301. var val = obj[key];
  1302. if (val === undefined) {
  1303. return '';
  1304. }
  1305. if (val === null) {
  1306. return encodeStr(key);
  1307. }
  1308. if (Array.isArray(val)) {
  1309. var result = [];
  1310. val.forEach(function (val2) {
  1311. if (val2 === undefined) {
  1312. return;
  1313. }
  1314. if (val2 === null) {
  1315. result.push(encodeStr(key));
  1316. } else {
  1317. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1318. }
  1319. });
  1320. return result.join('&');
  1321. }
  1322. return encodeStr(key) + '=' + encodeStr(val);
  1323. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1324. return res ? "?".concat(res) : '';
  1325. }
  1326. function parseBaseComponent(vueComponentOptions)
  1327. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1328. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1329. var options = _objectSpread({
  1330. multipleSlots: true,
  1331. addGlobalClass: true },
  1332. vueOptions.options || {});
  1333. {
  1334. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1335. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1336. Object.assign(options, vueOptions['mp-weixin'].options);
  1337. }
  1338. }
  1339. var componentOptions = {
  1340. options: options,
  1341. data: initData(vueOptions, _vue.default.prototype),
  1342. behaviors: initBehaviors(vueOptions, initBehavior),
  1343. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1344. lifetimes: {
  1345. attached: function attached() {
  1346. var properties = this.properties;
  1347. var options = {
  1348. mpType: isPage.call(this) ? 'page' : 'component',
  1349. mpInstance: this,
  1350. propsData: properties };
  1351. initVueIds(properties.vueId, this);
  1352. // 处理父子关系
  1353. initRelation.call(this, {
  1354. vuePid: this._$vuePid,
  1355. vueOptions: options });
  1356. // 初始化 vue 实例
  1357. this.$vm = new VueComponent(options);
  1358. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1359. initSlots(this.$vm, properties.vueSlots);
  1360. // 触发首次 setData
  1361. this.$vm.$mount();
  1362. },
  1363. ready: function ready() {
  1364. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1365. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1366. if (this.$vm) {
  1367. this.$vm._isMounted = true;
  1368. this.$vm.__call_hook('mounted');
  1369. this.$vm.__call_hook('onReady');
  1370. }
  1371. },
  1372. detached: function detached() {
  1373. this.$vm && this.$vm.$destroy();
  1374. } },
  1375. pageLifetimes: {
  1376. show: function show(args) {
  1377. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1378. },
  1379. hide: function hide() {
  1380. this.$vm && this.$vm.__call_hook('onPageHide');
  1381. },
  1382. resize: function resize(size) {
  1383. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1384. } },
  1385. methods: {
  1386. __l: handleLink,
  1387. __e: handleEvent } };
  1388. // externalClasses
  1389. if (vueOptions.externalClasses) {
  1390. componentOptions.externalClasses = vueOptions.externalClasses;
  1391. }
  1392. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1393. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1394. componentOptions.methods[callMethod] = function (args) {
  1395. return this.$vm[callMethod](args);
  1396. };
  1397. });
  1398. }
  1399. if (isPage) {
  1400. return componentOptions;
  1401. }
  1402. return [componentOptions, VueComponent];
  1403. }
  1404. function parseComponent(vueComponentOptions) {
  1405. return parseBaseComponent(vueComponentOptions, {
  1406. isPage: isPage,
  1407. initRelation: initRelation });
  1408. }
  1409. var hooks$1 = [
  1410. 'onShow',
  1411. 'onHide',
  1412. 'onUnload'];
  1413. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1414. function parseBasePage(vuePageOptions, _ref6)
  1415. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1416. var pageOptions = parseComponent(vuePageOptions);
  1417. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1418. pageOptions.methods.onLoad = function (query) {
  1419. this.options = query;
  1420. var copyQuery = Object.assign({}, query);
  1421. delete copyQuery.__id__;
  1422. this.$page = {
  1423. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1424. this.$vm.$mp.query = query; // 兼容 mpvue
  1425. this.$vm.__call_hook('onLoad', query);
  1426. };
  1427. return pageOptions;
  1428. }
  1429. function parsePage(vuePageOptions) {
  1430. return parseBasePage(vuePageOptions, {
  1431. isPage: isPage,
  1432. initRelation: initRelation });
  1433. }
  1434. function createPage(vuePageOptions) {
  1435. {
  1436. return Component(parsePage(vuePageOptions));
  1437. }
  1438. }
  1439. function createComponent(vueOptions) {
  1440. {
  1441. return Component(parseComponent(vueOptions));
  1442. }
  1443. }
  1444. function createSubpackageApp(vm) {
  1445. var appOptions = parseApp(vm);
  1446. var app = getApp({
  1447. allowDefault: true });
  1448. var globalData = app.globalData;
  1449. if (globalData) {
  1450. Object.keys(appOptions.globalData).forEach(function (name) {
  1451. if (!hasOwn(globalData, name)) {
  1452. globalData[name] = appOptions.globalData[name];
  1453. }
  1454. });
  1455. }
  1456. Object.keys(appOptions).forEach(function (name) {
  1457. if (!hasOwn(app, name)) {
  1458. app[name] = appOptions[name];
  1459. }
  1460. });
  1461. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1462. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1463. appOptions.onShow.apply(app, args);
  1464. });
  1465. }
  1466. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1467. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1468. appOptions.onHide.apply(app, args);
  1469. });
  1470. }
  1471. if (isFn(appOptions.onLaunch)) {
  1472. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1473. appOptions.onLaunch.call(app, args);
  1474. }
  1475. return vm;
  1476. }
  1477. function createPlugin(vm) {
  1478. var appOptions = parseApp(vm);
  1479. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1480. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1481. appOptions.onShow.apply(vm, args);
  1482. });
  1483. }
  1484. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1485. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1486. appOptions.onHide.apply(vm, args);
  1487. });
  1488. }
  1489. if (isFn(appOptions.onLaunch)) {
  1490. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1491. appOptions.onLaunch.call(vm, args);
  1492. }
  1493. return vm;
  1494. }
  1495. todos.forEach(function (todoApi) {
  1496. protocols[todoApi] = false;
  1497. });
  1498. canIUses.forEach(function (canIUseApi) {
  1499. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1500. canIUseApi;
  1501. if (!wx.canIUse(apiName)) {
  1502. protocols[canIUseApi] = false;
  1503. }
  1504. });
  1505. var uni = {};
  1506. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1507. uni = new Proxy({}, {
  1508. get: function get(target, name) {
  1509. if (hasOwn(target, name)) {
  1510. return target[name];
  1511. }
  1512. if (baseApi[name]) {
  1513. return baseApi[name];
  1514. }
  1515. if (api[name]) {
  1516. return promisify(name, api[name]);
  1517. }
  1518. {
  1519. if (extraApi[name]) {
  1520. return promisify(name, extraApi[name]);
  1521. }
  1522. if (todoApis[name]) {
  1523. return promisify(name, todoApis[name]);
  1524. }
  1525. }
  1526. if (eventApi[name]) {
  1527. return eventApi[name];
  1528. }
  1529. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1530. return;
  1531. }
  1532. return promisify(name, wrapper(name, wx[name]));
  1533. },
  1534. set: function set(target, name, value) {
  1535. target[name] = value;
  1536. return true;
  1537. } });
  1538. } else {
  1539. Object.keys(baseApi).forEach(function (name) {
  1540. uni[name] = baseApi[name];
  1541. });
  1542. {
  1543. Object.keys(todoApis).forEach(function (name) {
  1544. uni[name] = promisify(name, todoApis[name]);
  1545. });
  1546. Object.keys(extraApi).forEach(function (name) {
  1547. uni[name] = promisify(name, todoApis[name]);
  1548. });
  1549. }
  1550. Object.keys(eventApi).forEach(function (name) {
  1551. uni[name] = eventApi[name];
  1552. });
  1553. Object.keys(api).forEach(function (name) {
  1554. uni[name] = promisify(name, api[name]);
  1555. });
  1556. Object.keys(wx).forEach(function (name) {
  1557. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1558. uni[name] = promisify(name, wrapper(name, wx[name]));
  1559. }
  1560. });
  1561. }
  1562. wx.createApp = createApp;
  1563. wx.createPage = createPage;
  1564. wx.createComponent = createComponent;
  1565. wx.createSubpackageApp = createSubpackageApp;
  1566. wx.createPlugin = createPlugin;
  1567. var uni$1 = uni;var _default =
  1568. uni$1;exports.default = _default;
  1569. /***/ }),
  1570. /***/ 14:
  1571. /*!**********************************************************************************************************!*\
  1572. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1573. \**********************************************************************************************************/
  1574. /*! exports provided: default */
  1575. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1576. "use strict";
  1577. __webpack_require__.r(__webpack_exports__);
  1578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1579. /* globals __VUE_SSR_CONTEXT__ */
  1580. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1581. // This module is a runtime utility for cleaner component module output and will
  1582. // be included in the final webpack user bundle.
  1583. function normalizeComponent (
  1584. scriptExports,
  1585. render,
  1586. staticRenderFns,
  1587. functionalTemplate,
  1588. injectStyles,
  1589. scopeId,
  1590. moduleIdentifier, /* server only */
  1591. shadowMode, /* vue-cli only */
  1592. components, // fixed by xxxxxx auto components
  1593. renderjs // fixed by xxxxxx renderjs
  1594. ) {
  1595. // Vue.extend constructor export interop
  1596. var options = typeof scriptExports === 'function'
  1597. ? scriptExports.options
  1598. : scriptExports
  1599. // fixed by xxxxxx auto components
  1600. if (components) {
  1601. if (!options.components) {
  1602. options.components = {}
  1603. }
  1604. var hasOwn = Object.prototype.hasOwnProperty
  1605. for (var name in components) {
  1606. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1607. options.components[name] = components[name]
  1608. }
  1609. }
  1610. }
  1611. // fixed by xxxxxx renderjs
  1612. if (renderjs) {
  1613. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1614. this[renderjs.__module] = this
  1615. });
  1616. (options.mixins || (options.mixins = [])).push(renderjs)
  1617. }
  1618. // render functions
  1619. if (render) {
  1620. options.render = render
  1621. options.staticRenderFns = staticRenderFns
  1622. options._compiled = true
  1623. }
  1624. // functional template
  1625. if (functionalTemplate) {
  1626. options.functional = true
  1627. }
  1628. // scopedId
  1629. if (scopeId) {
  1630. options._scopeId = 'data-v-' + scopeId
  1631. }
  1632. var hook
  1633. if (moduleIdentifier) { // server build
  1634. hook = function (context) {
  1635. // 2.3 injection
  1636. context =
  1637. context || // cached call
  1638. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1639. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1640. // 2.2 with runInNewContext: true
  1641. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1642. context = __VUE_SSR_CONTEXT__
  1643. }
  1644. // inject component styles
  1645. if (injectStyles) {
  1646. injectStyles.call(this, context)
  1647. }
  1648. // register component module identifier for async chunk inferrence
  1649. if (context && context._registeredComponents) {
  1650. context._registeredComponents.add(moduleIdentifier)
  1651. }
  1652. }
  1653. // used by ssr in case component is cached and beforeCreate
  1654. // never gets called
  1655. options._ssrRegister = hook
  1656. } else if (injectStyles) {
  1657. hook = shadowMode
  1658. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1659. : injectStyles
  1660. }
  1661. if (hook) {
  1662. if (options.functional) {
  1663. // for template-only hot-reload because in that case the render fn doesn't
  1664. // go through the normalizer
  1665. options._injectStyles = hook
  1666. // register for functioal component in vue file
  1667. var originalRender = options.render
  1668. options.render = function renderWithStyleInjection (h, context) {
  1669. hook.call(context)
  1670. return originalRender(h, context)
  1671. }
  1672. } else {
  1673. // inject component registration as beforeCreate hook
  1674. var existing = options.beforeCreate
  1675. options.beforeCreate = existing
  1676. ? [].concat(existing, hook)
  1677. : [hook]
  1678. }
  1679. }
  1680. return {
  1681. exports: scriptExports,
  1682. options: options
  1683. }
  1684. }
  1685. /***/ }),
  1686. /***/ 15:
  1687. /*!********************************************************************!*\
  1688. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/index.js ***!
  1689. \********************************************************************/
  1690. /*! no static exports found */
  1691. /***/ (function(module, exports, __webpack_require__) {
  1692. "use strict";
  1693. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  1694. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 16));
  1695. var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 17));
  1696. var _moduleA = _interopRequireDefault(__webpack_require__(/*! @/store/modules/moduleA */ 18));
  1697. var _moduleB = _interopRequireDefault(__webpack_require__(/*! @/store/modules/moduleB */ 19));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1698. _vue.default.use(_vuex.default);var _default =
  1699. new _vuex.default.Store({
  1700. state: {
  1701. text: "我是moduleA模块下state.text的值",
  1702. appId: _settings.default.appId,
  1703. stationId: _settings.default.stationId,
  1704. phoneNumber: uni.getStorageSync('phoneNumber') || "",
  1705. countryCode: uni.getStorageSync('countryCode') || "",
  1706. purePhoneNumber: uni.getStorageSync('purePhoneNumber') || "",
  1707. openId: uni.getStorageSync('openId') || "",
  1708. unionId: uni.getStorageSync('unionId') || "",
  1709. userInfo: !uni.getStorageSync('userInfo') ? {} : JSON.parse(uni.getStorageSync('userInfo')),
  1710. orderInfo: undefined,
  1711. selectedGas: undefined },
  1712. getters: {},
  1713. mutations: {
  1714. updatePhoneNumber: function updatePhoneNumber(state, phoneNumber) {
  1715. uni.setStorageSync('phoneNumber', phoneNumber);
  1716. state.phoneNumber = phoneNumber;
  1717. },
  1718. updateCountryCode: function updateCountryCode(state, countryCode) {
  1719. uni.setStorageSync('countryCode', countryCode);
  1720. state.countryCode = countryCode;
  1721. },
  1722. updatePurePhoneNumber: function updatePurePhoneNumber(state, purePhoneNumber) {
  1723. uni.setStorageSync('phoneNumber', phoneNumber);
  1724. state.purePhoneNumber = purePhoneNumber;
  1725. },
  1726. updateOpenId: function updateOpenId(state, openId) {
  1727. uni.setStorageSync('openId', openId);
  1728. state.openId = openId;
  1729. },
  1730. updateUnionId: function updateUnionId(state, unionId) {
  1731. uni.setStorageSync('unionId', unionId);
  1732. state.unionId = unionId;
  1733. },
  1734. updateUserInfo: function updateUserInfo(state, userInfo) {
  1735. uni.setStorageSync('userInfo', JSON.stringify(userInfo));
  1736. state.userInfo = userInfo;
  1737. },
  1738. updateOrderInfo: function updateOrderInfo(state, orderInfo) {
  1739. state.orderInfo = orderInfo;
  1740. },
  1741. updateSelectedGas: function updateSelectedGas(state, selectedGas) {
  1742. state.selectedGas = selectedGas;
  1743. } },
  1744. actions: {},
  1745. modules: {
  1746. moduleA: _moduleA.default,
  1747. moduleB: _moduleB.default } });exports.default = _default;
  1748. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1749. /***/ }),
  1750. /***/ 16:
  1751. /*!********************************************!*\
  1752. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  1753. \********************************************/
  1754. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  1755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1756. "use strict";
  1757. __webpack_require__.r(__webpack_exports__);
  1758. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  1759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  1760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  1761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  1762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  1763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  1764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  1765. /*!
  1766. * vuex v3.4.0
  1767. * (c) 2020 Evan You
  1768. * @license MIT
  1769. */
  1770. function applyMixin (Vue) {
  1771. var version = Number(Vue.version.split('.')[0]);
  1772. if (version >= 2) {
  1773. Vue.mixin({ beforeCreate: vuexInit });
  1774. } else {
  1775. // override init and inject vuex init procedure
  1776. // for 1.x backwards compatibility.
  1777. var _init = Vue.prototype._init;
  1778. Vue.prototype._init = function (options) {
  1779. if ( options === void 0 ) options = {};
  1780. options.init = options.init
  1781. ? [vuexInit].concat(options.init)
  1782. : vuexInit;
  1783. _init.call(this, options);
  1784. };
  1785. }
  1786. /**
  1787. * Vuex init hook, injected into each instances init hooks list.
  1788. */
  1789. function vuexInit () {
  1790. var options = this.$options;
  1791. // store injection
  1792. if (options.store) {
  1793. this.$store = typeof options.store === 'function'
  1794. ? options.store()
  1795. : options.store;
  1796. } else if (options.parent && options.parent.$store) {
  1797. this.$store = options.parent.$store;
  1798. }
  1799. }
  1800. }
  1801. var target = typeof window !== 'undefined'
  1802. ? window
  1803. : typeof global !== 'undefined'
  1804. ? global
  1805. : {};
  1806. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1807. function devtoolPlugin (store) {
  1808. if (!devtoolHook) { return }
  1809. store._devtoolHook = devtoolHook;
  1810. devtoolHook.emit('vuex:init', store);
  1811. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  1812. store.replaceState(targetState);
  1813. });
  1814. store.subscribe(function (mutation, state) {
  1815. devtoolHook.emit('vuex:mutation', mutation, state);
  1816. }, { prepend: true });
  1817. store.subscribeAction(function (action, state) {
  1818. devtoolHook.emit('vuex:action', action, state);
  1819. }, { prepend: true });
  1820. }
  1821. /**
  1822. * Get the first item that pass the test
  1823. * by second argument function
  1824. *
  1825. * @param {Array} list
  1826. * @param {Function} f
  1827. * @return {*}
  1828. */
  1829. /**
  1830. * forEach for object
  1831. */
  1832. function forEachValue (obj, fn) {
  1833. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  1834. }
  1835. function isObject (obj) {
  1836. return obj !== null && typeof obj === 'object'
  1837. }
  1838. function isPromise (val) {
  1839. return val && typeof val.then === 'function'
  1840. }
  1841. function assert (condition, msg) {
  1842. if (!condition) { throw new Error(("[vuex] " + msg)) }
  1843. }
  1844. function partial (fn, arg) {
  1845. return function () {
  1846. return fn(arg)
  1847. }
  1848. }
  1849. // Base data struct for store's module, package with some attribute and method
  1850. var Module = function Module (rawModule, runtime) {
  1851. this.runtime = runtime;
  1852. // Store some children item
  1853. this._children = Object.create(null);
  1854. // Store the origin module object which passed by programmer
  1855. this._rawModule = rawModule;
  1856. var rawState = rawModule.state;
  1857. // Store the origin module's state
  1858. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  1859. };
  1860. var prototypeAccessors = { namespaced: { configurable: true } };
  1861. prototypeAccessors.namespaced.get = function () {
  1862. return !!this._rawModule.namespaced
  1863. };
  1864. Module.prototype.addChild = function addChild (key, module) {
  1865. this._children[key] = module;
  1866. };
  1867. Module.prototype.removeChild = function removeChild (key) {
  1868. delete this._children[key];
  1869. };
  1870. Module.prototype.getChild = function getChild (key) {
  1871. return this._children[key]
  1872. };
  1873. Module.prototype.hasChild = function hasChild (key) {
  1874. return key in this._children
  1875. };
  1876. Module.prototype.update = function update (rawModule) {
  1877. this._rawModule.namespaced = rawModule.namespaced;
  1878. if (rawModule.actions) {
  1879. this._rawModule.actions = rawModule.actions;
  1880. }
  1881. if (rawModule.mutations) {
  1882. this._rawModule.mutations = rawModule.mutations;
  1883. }
  1884. if (rawModule.getters) {
  1885. this._rawModule.getters = rawModule.getters;
  1886. }
  1887. };
  1888. Module.prototype.forEachChild = function forEachChild (fn) {
  1889. forEachValue(this._children, fn);
  1890. };
  1891. Module.prototype.forEachGetter = function forEachGetter (fn) {
  1892. if (this._rawModule.getters) {
  1893. forEachValue(this._rawModule.getters, fn);
  1894. }
  1895. };
  1896. Module.prototype.forEachAction = function forEachAction (fn) {
  1897. if (this._rawModule.actions) {
  1898. forEachValue(this._rawModule.actions, fn);
  1899. }
  1900. };
  1901. Module.prototype.forEachMutation = function forEachMutation (fn) {
  1902. if (this._rawModule.mutations) {
  1903. forEachValue(this._rawModule.mutations, fn);
  1904. }
  1905. };
  1906. Object.defineProperties( Module.prototype, prototypeAccessors );
  1907. var ModuleCollection = function ModuleCollection (rawRootModule) {
  1908. // register root module (Vuex.Store options)
  1909. this.register([], rawRootModule, false);
  1910. };
  1911. ModuleCollection.prototype.get = function get (path) {
  1912. return path.reduce(function (module, key) {
  1913. return module.getChild(key)
  1914. }, this.root)
  1915. };
  1916. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  1917. var module = this.root;
  1918. return path.reduce(function (namespace, key) {
  1919. module = module.getChild(key);
  1920. return namespace + (module.namespaced ? key + '/' : '')
  1921. }, '')
  1922. };
  1923. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  1924. update([], this.root, rawRootModule);
  1925. };
  1926. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  1927. var this$1 = this;
  1928. if ( runtime === void 0 ) runtime = true;
  1929. if ((true)) {
  1930. assertRawModule(path, rawModule);
  1931. }
  1932. var newModule = new Module(rawModule, runtime);
  1933. if (path.length === 0) {
  1934. this.root = newModule;
  1935. } else {
  1936. var parent = this.get(path.slice(0, -1));
  1937. parent.addChild(path[path.length - 1], newModule);
  1938. }
  1939. // register nested modules
  1940. if (rawModule.modules) {
  1941. forEachValue(rawModule.modules, function (rawChildModule, key) {
  1942. this$1.register(path.concat(key), rawChildModule, runtime);
  1943. });
  1944. }
  1945. };
  1946. ModuleCollection.prototype.unregister = function unregister (path) {
  1947. var parent = this.get(path.slice(0, -1));
  1948. var key = path[path.length - 1];
  1949. if (!parent.getChild(key).runtime) { return }
  1950. parent.removeChild(key);
  1951. };
  1952. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  1953. var parent = this.get(path.slice(0, -1));
  1954. var key = path[path.length - 1];
  1955. return parent.hasChild(key)
  1956. };
  1957. function update (path, targetModule, newModule) {
  1958. if ((true)) {
  1959. assertRawModule(path, newModule);
  1960. }
  1961. // update target module
  1962. targetModule.update(newModule);
  1963. // update nested modules
  1964. if (newModule.modules) {
  1965. for (var key in newModule.modules) {
  1966. if (!targetModule.getChild(key)) {
  1967. if ((true)) {
  1968. console.warn(
  1969. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  1970. 'manual reload is needed'
  1971. );
  1972. }
  1973. return
  1974. }
  1975. update(
  1976. path.concat(key),
  1977. targetModule.getChild(key),
  1978. newModule.modules[key]
  1979. );
  1980. }
  1981. }
  1982. }
  1983. var functionAssert = {
  1984. assert: function (value) { return typeof value === 'function'; },
  1985. expected: 'function'
  1986. };
  1987. var objectAssert = {
  1988. assert: function (value) { return typeof value === 'function' ||
  1989. (typeof value === 'object' && typeof value.handler === 'function'); },
  1990. expected: 'function or object with "handler" function'
  1991. };
  1992. var assertTypes = {
  1993. getters: functionAssert,
  1994. mutations: functionAssert,
  1995. actions: objectAssert
  1996. };
  1997. function assertRawModule (path, rawModule) {
  1998. Object.keys(assertTypes).forEach(function (key) {
  1999. if (!rawModule[key]) { return }
  2000. var assertOptions = assertTypes[key];
  2001. forEachValue(rawModule[key], function (value, type) {
  2002. assert(
  2003. assertOptions.assert(value),
  2004. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  2005. );
  2006. });
  2007. });
  2008. }
  2009. function makeAssertionMessage (path, key, type, value, expected) {
  2010. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  2011. if (path.length > 0) {
  2012. buf += " in module \"" + (path.join('.')) + "\"";
  2013. }
  2014. buf += " is " + (JSON.stringify(value)) + ".";
  2015. return buf
  2016. }
  2017. var Vue; // bind on install
  2018. var Store = function Store (options) {
  2019. var this$1 = this;
  2020. if ( options === void 0 ) options = {};
  2021. // Auto install if it is not done yet and `window` has `Vue`.
  2022. // To allow users to avoid auto-installation in some cases,
  2023. // this code should be placed here. See #731
  2024. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  2025. install(window.Vue);
  2026. }
  2027. if ((true)) {
  2028. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  2029. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  2030. assert(this instanceof Store, "store must be called with the new operator.");
  2031. }
  2032. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2033. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2034. // store internal state
  2035. this._committing = false;
  2036. this._actions = Object.create(null);
  2037. this._actionSubscribers = [];
  2038. this._mutations = Object.create(null);
  2039. this._wrappedGetters = Object.create(null);
  2040. this._modules = new ModuleCollection(options);
  2041. this._modulesNamespaceMap = Object.create(null);
  2042. this._subscribers = [];
  2043. this._watcherVM = new Vue();
  2044. this._makeLocalGettersCache = Object.create(null);
  2045. // bind commit and dispatch to self
  2046. var store = this;
  2047. var ref = this;
  2048. var dispatch = ref.dispatch;
  2049. var commit = ref.commit;
  2050. this.dispatch = function boundDispatch (type, payload) {
  2051. return dispatch.call(store, type, payload)
  2052. };
  2053. this.commit = function boundCommit (type, payload, options) {
  2054. return commit.call(store, type, payload, options)
  2055. };
  2056. // strict mode
  2057. this.strict = strict;
  2058. var state = this._modules.root.state;
  2059. // init root module.
  2060. // this also recursively registers all sub-modules
  2061. // and collects all module getters inside this._wrappedGetters
  2062. installModule(this, state, [], this._modules.root);
  2063. // initialize the store vm, which is responsible for the reactivity
  2064. // (also registers _wrappedGetters as computed properties)
  2065. resetStoreVM(this, state);
  2066. // apply plugins
  2067. plugins.forEach(function (plugin) { return plugin(this$1); });
  2068. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  2069. if (useDevtools) {
  2070. devtoolPlugin(this);
  2071. }
  2072. };
  2073. var prototypeAccessors$1 = { state: { configurable: true } };
  2074. prototypeAccessors$1.state.get = function () {
  2075. return this._vm._data.$$state
  2076. };
  2077. prototypeAccessors$1.state.set = function (v) {
  2078. if ((true)) {
  2079. assert(false, "use store.replaceState() to explicit replace store state.");
  2080. }
  2081. };
  2082. Store.prototype.commit = function commit (_type, _payload, _options) {
  2083. var this$1 = this;
  2084. // check object-style commit
  2085. var ref = unifyObjectStyle(_type, _payload, _options);
  2086. var type = ref.type;
  2087. var payload = ref.payload;
  2088. var options = ref.options;
  2089. var mutation = { type: type, payload: payload };
  2090. var entry = this._mutations[type];
  2091. if (!entry) {
  2092. if ((true)) {
  2093. console.error(("[vuex] unknown mutation type: " + type));
  2094. }
  2095. return
  2096. }
  2097. this._withCommit(function () {
  2098. entry.forEach(function commitIterator (handler) {
  2099. handler(payload);
  2100. });
  2101. });
  2102. this._subscribers
  2103. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2104. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2105. if (
  2106. ( true) &&
  2107. options && options.silent
  2108. ) {
  2109. console.warn(
  2110. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2111. 'Use the filter functionality in the vue-devtools'
  2112. );
  2113. }
  2114. };
  2115. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2116. var this$1 = this;
  2117. // check object-style dispatch
  2118. var ref = unifyObjectStyle(_type, _payload);
  2119. var type = ref.type;
  2120. var payload = ref.payload;
  2121. var action = { type: type, payload: payload };
  2122. var entry = this._actions[type];
  2123. if (!entry) {
  2124. if ((true)) {
  2125. console.error(("[vuex] unknown action type: " + type));
  2126. }
  2127. return
  2128. }
  2129. try {
  2130. this._actionSubscribers
  2131. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2132. .filter(function (sub) { return sub.before; })
  2133. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2134. } catch (e) {
  2135. if ((true)) {
  2136. console.warn("[vuex] error in before action subscribers: ");
  2137. console.error(e);
  2138. }
  2139. }
  2140. var result = entry.length > 1
  2141. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2142. : entry[0](payload);
  2143. return new Promise(function (resolve, reject) {
  2144. result.then(function (res) {
  2145. try {
  2146. this$1._actionSubscribers
  2147. .filter(function (sub) { return sub.after; })
  2148. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2149. } catch (e) {
  2150. if ((true)) {
  2151. console.warn("[vuex] error in after action subscribers: ");
  2152. console.error(e);
  2153. }
  2154. }
  2155. resolve(res);
  2156. }, function (error) {
  2157. try {
  2158. this$1._actionSubscribers
  2159. .filter(function (sub) { return sub.error; })
  2160. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2161. } catch (e) {
  2162. if ((true)) {
  2163. console.warn("[vuex] error in error action subscribers: ");
  2164. console.error(e);
  2165. }
  2166. }
  2167. reject(error);
  2168. });
  2169. })
  2170. };
  2171. Store.prototype.subscribe = function subscribe (fn, options) {
  2172. return genericSubscribe(fn, this._subscribers, options)
  2173. };
  2174. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2175. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2176. return genericSubscribe(subs, this._actionSubscribers, options)
  2177. };
  2178. Store.prototype.watch = function watch (getter, cb, options) {
  2179. var this$1 = this;
  2180. if ((true)) {
  2181. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2182. }
  2183. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2184. };
  2185. Store.prototype.replaceState = function replaceState (state) {
  2186. var this$1 = this;
  2187. this._withCommit(function () {
  2188. this$1._vm._data.$$state = state;
  2189. });
  2190. };
  2191. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2192. if ( options === void 0 ) options = {};
  2193. if (typeof path === 'string') { path = [path]; }
  2194. if ((true)) {
  2195. assert(Array.isArray(path), "module path must be a string or an Array.");
  2196. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2197. }
  2198. this._modules.register(path, rawModule);
  2199. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2200. // reset store to update getters...
  2201. resetStoreVM(this, this.state);
  2202. };
  2203. Store.prototype.unregisterModule = function unregisterModule (path) {
  2204. var this$1 = this;
  2205. if (typeof path === 'string') { path = [path]; }
  2206. if ((true)) {
  2207. assert(Array.isArray(path), "module path must be a string or an Array.");
  2208. }
  2209. this._modules.unregister(path);
  2210. this._withCommit(function () {
  2211. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2212. Vue.delete(parentState, path[path.length - 1]);
  2213. });
  2214. resetStore(this);
  2215. };
  2216. Store.prototype.hasModule = function hasModule (path) {
  2217. if (typeof path === 'string') { path = [path]; }
  2218. if ((true)) {
  2219. assert(Array.isArray(path), "module path must be a string or an Array.");
  2220. }
  2221. return this._modules.isRegistered(path)
  2222. };
  2223. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2224. this._modules.update(newOptions);
  2225. resetStore(this, true);
  2226. };
  2227. Store.prototype._withCommit = function _withCommit (fn) {
  2228. var committing = this._committing;
  2229. this._committing = true;
  2230. fn();
  2231. this._committing = committing;
  2232. };
  2233. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2234. function genericSubscribe (fn, subs, options) {
  2235. if (subs.indexOf(fn) < 0) {
  2236. options && options.prepend
  2237. ? subs.unshift(fn)
  2238. : subs.push(fn);
  2239. }
  2240. return function () {
  2241. var i = subs.indexOf(fn);
  2242. if (i > -1) {
  2243. subs.splice(i, 1);
  2244. }
  2245. }
  2246. }
  2247. function resetStore (store, hot) {
  2248. store._actions = Object.create(null);
  2249. store._mutations = Object.create(null);
  2250. store._wrappedGetters = Object.create(null);
  2251. store._modulesNamespaceMap = Object.create(null);
  2252. var state = store.state;
  2253. // init all modules
  2254. installModule(store, state, [], store._modules.root, true);
  2255. // reset vm
  2256. resetStoreVM(store, state, hot);
  2257. }
  2258. function resetStoreVM (store, state, hot) {
  2259. var oldVm = store._vm;
  2260. // bind store public getters
  2261. store.getters = {};
  2262. // reset local getters cache
  2263. store._makeLocalGettersCache = Object.create(null);
  2264. var wrappedGetters = store._wrappedGetters;
  2265. var computed = {};
  2266. forEachValue(wrappedGetters, function (fn, key) {
  2267. // use computed to leverage its lazy-caching mechanism
  2268. // direct inline function use will lead to closure preserving oldVm.
  2269. // using partial to return function with only arguments preserved in closure environment.
  2270. computed[key] = partial(fn, store);
  2271. Object.defineProperty(store.getters, key, {
  2272. get: function () { return store._vm[key]; },
  2273. enumerable: true // for local getters
  2274. });
  2275. });
  2276. // use a Vue instance to store the state tree
  2277. // suppress warnings just in case the user has added
  2278. // some funky global mixins
  2279. var silent = Vue.config.silent;
  2280. Vue.config.silent = true;
  2281. store._vm = new Vue({
  2282. data: {
  2283. $$state: state
  2284. },
  2285. computed: computed
  2286. });
  2287. Vue.config.silent = silent;
  2288. // enable strict mode for new vm
  2289. if (store.strict) {
  2290. enableStrictMode(store);
  2291. }
  2292. if (oldVm) {
  2293. if (hot) {
  2294. // dispatch changes in all subscribed watchers
  2295. // to force getter re-evaluation for hot reloading.
  2296. store._withCommit(function () {
  2297. oldVm._data.$$state = null;
  2298. });
  2299. }
  2300. Vue.nextTick(function () { return oldVm.$destroy(); });
  2301. }
  2302. }
  2303. function installModule (store, rootState, path, module, hot) {
  2304. var isRoot = !path.length;
  2305. var namespace = store._modules.getNamespace(path);
  2306. // register in namespace map
  2307. if (module.namespaced) {
  2308. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2309. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2310. }
  2311. store._modulesNamespaceMap[namespace] = module;
  2312. }
  2313. // set state
  2314. if (!isRoot && !hot) {
  2315. var parentState = getNestedState(rootState, path.slice(0, -1));
  2316. var moduleName = path[path.length - 1];
  2317. store._withCommit(function () {
  2318. if ((true)) {
  2319. if (moduleName in parentState) {
  2320. console.warn(
  2321. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2322. );
  2323. }
  2324. }
  2325. Vue.set(parentState, moduleName, module.state);
  2326. });
  2327. }
  2328. var local = module.context = makeLocalContext(store, namespace, path);
  2329. module.forEachMutation(function (mutation, key) {
  2330. var namespacedType = namespace + key;
  2331. registerMutation(store, namespacedType, mutation, local);
  2332. });
  2333. module.forEachAction(function (action, key) {
  2334. var type = action.root ? key : namespace + key;
  2335. var handler = action.handler || action;
  2336. registerAction(store, type, handler, local);
  2337. });
  2338. module.forEachGetter(function (getter, key) {
  2339. var namespacedType = namespace + key;
  2340. registerGetter(store, namespacedType, getter, local);
  2341. });
  2342. module.forEachChild(function (child, key) {
  2343. installModule(store, rootState, path.concat(key), child, hot);
  2344. });
  2345. }
  2346. /**
  2347. * make localized dispatch, commit, getters and state
  2348. * if there is no namespace, just use root ones
  2349. */
  2350. function makeLocalContext (store, namespace, path) {
  2351. var noNamespace = namespace === '';
  2352. var local = {
  2353. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2354. var args = unifyObjectStyle(_type, _payload, _options);
  2355. var payload = args.payload;
  2356. var options = args.options;
  2357. var type = args.type;
  2358. if (!options || !options.root) {
  2359. type = namespace + type;
  2360. if (( true) && !store._actions[type]) {
  2361. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2362. return
  2363. }
  2364. }
  2365. return store.dispatch(type, payload)
  2366. },
  2367. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2368. var args = unifyObjectStyle(_type, _payload, _options);
  2369. var payload = args.payload;
  2370. var options = args.options;
  2371. var type = args.type;
  2372. if (!options || !options.root) {
  2373. type = namespace + type;
  2374. if (( true) && !store._mutations[type]) {
  2375. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2376. return
  2377. }
  2378. }
  2379. store.commit(type, payload, options);
  2380. }
  2381. };
  2382. // getters and state object must be gotten lazily
  2383. // because they will be changed by vm update
  2384. Object.defineProperties(local, {
  2385. getters: {
  2386. get: noNamespace
  2387. ? function () { return store.getters; }
  2388. : function () { return makeLocalGetters(store, namespace); }
  2389. },
  2390. state: {
  2391. get: function () { return getNestedState(store.state, path); }
  2392. }
  2393. });
  2394. return local
  2395. }
  2396. function makeLocalGetters (store, namespace) {
  2397. if (!store._makeLocalGettersCache[namespace]) {
  2398. var gettersProxy = {};
  2399. var splitPos = namespace.length;
  2400. Object.keys(store.getters).forEach(function (type) {
  2401. // skip if the target getter is not match this namespace
  2402. if (type.slice(0, splitPos) !== namespace) { return }
  2403. // extract local getter type
  2404. var localType = type.slice(splitPos);
  2405. // Add a port to the getters proxy.
  2406. // Define as getter property because
  2407. // we do not want to evaluate the getters in this time.
  2408. Object.defineProperty(gettersProxy, localType, {
  2409. get: function () { return store.getters[type]; },
  2410. enumerable: true
  2411. });
  2412. });
  2413. store._makeLocalGettersCache[namespace] = gettersProxy;
  2414. }
  2415. return store._makeLocalGettersCache[namespace]
  2416. }
  2417. function registerMutation (store, type, handler, local) {
  2418. var entry = store._mutations[type] || (store._mutations[type] = []);
  2419. entry.push(function wrappedMutationHandler (payload) {
  2420. handler.call(store, local.state, payload);
  2421. });
  2422. }
  2423. function registerAction (store, type, handler, local) {
  2424. var entry = store._actions[type] || (store._actions[type] = []);
  2425. entry.push(function wrappedActionHandler (payload) {
  2426. var res = handler.call(store, {
  2427. dispatch: local.dispatch,
  2428. commit: local.commit,
  2429. getters: local.getters,
  2430. state: local.state,
  2431. rootGetters: store.getters,
  2432. rootState: store.state
  2433. }, payload);
  2434. if (!isPromise(res)) {
  2435. res = Promise.resolve(res);
  2436. }
  2437. if (store._devtoolHook) {
  2438. return res.catch(function (err) {
  2439. store._devtoolHook.emit('vuex:error', err);
  2440. throw err
  2441. })
  2442. } else {
  2443. return res
  2444. }
  2445. });
  2446. }
  2447. function registerGetter (store, type, rawGetter, local) {
  2448. if (store._wrappedGetters[type]) {
  2449. if ((true)) {
  2450. console.error(("[vuex] duplicate getter key: " + type));
  2451. }
  2452. return
  2453. }
  2454. store._wrappedGetters[type] = function wrappedGetter (store) {
  2455. return rawGetter(
  2456. local.state, // local state
  2457. local.getters, // local getters
  2458. store.state, // root state
  2459. store.getters // root getters
  2460. )
  2461. };
  2462. }
  2463. function enableStrictMode (store) {
  2464. store._vm.$watch(function () { return this._data.$$state }, function () {
  2465. if ((true)) {
  2466. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  2467. }
  2468. }, { deep: true, sync: true });
  2469. }
  2470. function getNestedState (state, path) {
  2471. return path.reduce(function (state, key) { return state[key]; }, state)
  2472. }
  2473. function unifyObjectStyle (type, payload, options) {
  2474. if (isObject(type) && type.type) {
  2475. options = payload;
  2476. payload = type;
  2477. type = type.type;
  2478. }
  2479. if ((true)) {
  2480. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  2481. }
  2482. return { type: type, payload: payload, options: options }
  2483. }
  2484. function install (_Vue) {
  2485. if (Vue && _Vue === Vue) {
  2486. if ((true)) {
  2487. console.error(
  2488. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2489. );
  2490. }
  2491. return
  2492. }
  2493. Vue = _Vue;
  2494. applyMixin(Vue);
  2495. }
  2496. /**
  2497. * Reduce the code which written in Vue.js for getting the state.
  2498. * @param {String} [namespace] - Module's namespace
  2499. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  2500. * @param {Object}
  2501. */
  2502. var mapState = normalizeNamespace(function (namespace, states) {
  2503. var res = {};
  2504. if (( true) && !isValidMap(states)) {
  2505. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  2506. }
  2507. normalizeMap(states).forEach(function (ref) {
  2508. var key = ref.key;
  2509. var val = ref.val;
  2510. res[key] = function mappedState () {
  2511. var state = this.$store.state;
  2512. var getters = this.$store.getters;
  2513. if (namespace) {
  2514. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  2515. if (!module) {
  2516. return
  2517. }
  2518. state = module.context.state;
  2519. getters = module.context.getters;
  2520. }
  2521. return typeof val === 'function'
  2522. ? val.call(this, state, getters)
  2523. : state[val]
  2524. };
  2525. // mark vuex getter for devtools
  2526. res[key].vuex = true;
  2527. });
  2528. return res
  2529. });
  2530. /**
  2531. * Reduce the code which written in Vue.js for committing the mutation
  2532. * @param {String} [namespace] - Module's namespace
  2533. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  2534. * @return {Object}
  2535. */
  2536. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  2537. var res = {};
  2538. if (( true) && !isValidMap(mutations)) {
  2539. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  2540. }
  2541. normalizeMap(mutations).forEach(function (ref) {
  2542. var key = ref.key;
  2543. var val = ref.val;
  2544. res[key] = function mappedMutation () {
  2545. var args = [], len = arguments.length;
  2546. while ( len-- ) args[ len ] = arguments[ len ];
  2547. // Get the commit method from store
  2548. var commit = this.$store.commit;
  2549. if (namespace) {
  2550. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  2551. if (!module) {
  2552. return
  2553. }
  2554. commit = module.context.commit;
  2555. }
  2556. return typeof val === 'function'
  2557. ? val.apply(this, [commit].concat(args))
  2558. : commit.apply(this.$store, [val].concat(args))
  2559. };
  2560. });
  2561. return res
  2562. });
  2563. /**
  2564. * Reduce the code which written in Vue.js for getting the getters
  2565. * @param {String} [namespace] - Module's namespace
  2566. * @param {Object|Array} getters
  2567. * @return {Object}
  2568. */
  2569. var mapGetters = normalizeNamespace(function (namespace, getters) {
  2570. var res = {};
  2571. if (( true) && !isValidMap(getters)) {
  2572. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  2573. }
  2574. normalizeMap(getters).forEach(function (ref) {
  2575. var key = ref.key;
  2576. var val = ref.val;
  2577. // The namespace has been mutated by normalizeNamespace
  2578. val = namespace + val;
  2579. res[key] = function mappedGetter () {
  2580. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  2581. return
  2582. }
  2583. if (( true) && !(val in this.$store.getters)) {
  2584. console.error(("[vuex] unknown getter: " + val));
  2585. return
  2586. }
  2587. return this.$store.getters[val]
  2588. };
  2589. // mark vuex getter for devtools
  2590. res[key].vuex = true;
  2591. });
  2592. return res
  2593. });
  2594. /**
  2595. * Reduce the code which written in Vue.js for dispatch the action
  2596. * @param {String} [namespace] - Module's namespace
  2597. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  2598. * @return {Object}
  2599. */
  2600. var mapActions = normalizeNamespace(function (namespace, actions) {
  2601. var res = {};
  2602. if (( true) && !isValidMap(actions)) {
  2603. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  2604. }
  2605. normalizeMap(actions).forEach(function (ref) {
  2606. var key = ref.key;
  2607. var val = ref.val;
  2608. res[key] = function mappedAction () {
  2609. var args = [], len = arguments.length;
  2610. while ( len-- ) args[ len ] = arguments[ len ];
  2611. // get dispatch function from store
  2612. var dispatch = this.$store.dispatch;
  2613. if (namespace) {
  2614. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  2615. if (!module) {
  2616. return
  2617. }
  2618. dispatch = module.context.dispatch;
  2619. }
  2620. return typeof val === 'function'
  2621. ? val.apply(this, [dispatch].concat(args))
  2622. : dispatch.apply(this.$store, [val].concat(args))
  2623. };
  2624. });
  2625. return res
  2626. });
  2627. /**
  2628. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  2629. * @param {String} namespace
  2630. * @return {Object}
  2631. */
  2632. var createNamespacedHelpers = function (namespace) { return ({
  2633. mapState: mapState.bind(null, namespace),
  2634. mapGetters: mapGetters.bind(null, namespace),
  2635. mapMutations: mapMutations.bind(null, namespace),
  2636. mapActions: mapActions.bind(null, namespace)
  2637. }); };
  2638. /**
  2639. * Normalize the map
  2640. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  2641. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  2642. * @param {Array|Object} map
  2643. * @return {Object}
  2644. */
  2645. function normalizeMap (map) {
  2646. if (!isValidMap(map)) {
  2647. return []
  2648. }
  2649. return Array.isArray(map)
  2650. ? map.map(function (key) { return ({ key: key, val: key }); })
  2651. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  2652. }
  2653. /**
  2654. * Validate whether given map is valid or not
  2655. * @param {*} map
  2656. * @return {Boolean}
  2657. */
  2658. function isValidMap (map) {
  2659. return Array.isArray(map) || isObject(map)
  2660. }
  2661. /**
  2662. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  2663. * @param {Function} fn
  2664. * @return {Function}
  2665. */
  2666. function normalizeNamespace (fn) {
  2667. return function (namespace, map) {
  2668. if (typeof namespace !== 'string') {
  2669. map = namespace;
  2670. namespace = '';
  2671. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  2672. namespace += '/';
  2673. }
  2674. return fn(namespace, map)
  2675. }
  2676. }
  2677. /**
  2678. * Search a special module from store by namespace. if module not exist, print error message.
  2679. * @param {Object} store
  2680. * @param {String} helper
  2681. * @param {String} namespace
  2682. * @return {Object}
  2683. */
  2684. function getModuleByNamespace (store, helper, namespace) {
  2685. var module = store._modulesNamespaceMap[namespace];
  2686. if (( true) && !module) {
  2687. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  2688. }
  2689. return module
  2690. }
  2691. var index = {
  2692. Store: Store,
  2693. install: install,
  2694. version: '3.4.0',
  2695. mapState: mapState,
  2696. mapMutations: mapMutations,
  2697. mapGetters: mapGetters,
  2698. mapActions: mapActions,
  2699. createNamespacedHelpers: createNamespacedHelpers
  2700. };
  2701. /* harmony default export */ __webpack_exports__["default"] = (index);
  2702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  2703. /***/ }),
  2704. /***/ 17:
  2705. /*!*****************************************************************!*\
  2706. !*** C:/Users/first/Documents/HBuilderProjects/小程序/settings.js ***!
  2707. \*****************************************************************/
  2708. /*! no static exports found */
  2709. /***/ (function(module, exports, __webpack_require__) {
  2710. "use strict";
  2711. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 接口 定义接口前缀:demo-演示版 api-正式版
  2712. // export const showIndex = false;
  2713. // export const gasupList = true;
  2714. // 是否开始
  2715. // appid
  2716. // 站点Id
  2717. // 智慧油驿站
  2718. // 山东石化879站
  2719. // export const isDemo = true;
  2720. // export const prefix='demo';
  2721. // export const appId = 'wxe1135cd390b38a54'
  2722. // export const stationId = 1
  2723. // export const isDemo = false;
  2724. // export const prefix='api';
  2725. // export const appId = 'wx5285c34adff1069d'
  2726. // export const stationId = 5;
  2727. // export const isDemo = false;
  2728. // export const prefix='demo';
  2729. // export const appId = 'wxe1135cd390b38a54'
  2730. // export const stationId = 118;
  2731. // const BASE_URL = 'http://localhost:8082'
  2732. var _default =
  2733. {
  2734. prefix: "/demo",
  2735. appId: "wxe1135cd390b38a54",
  2736. stationId: 1,
  2737. base_url: "https://www.huijy.net" };exports.default = _default;
  2738. /***/ }),
  2739. /***/ 18:
  2740. /*!******************************************************************************!*\
  2741. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/modules/moduleA.js ***!
  2742. \******************************************************************************/
  2743. /*! no static exports found */
  2744. /***/ (function(module, exports, __webpack_require__) {
  2745. "use strict";
  2746. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2747. state: {
  2748. text: "我是moduleA模块下state.text的值" },
  2749. getters: {},
  2750. mutations: {},
  2751. actions: {} };exports.default = _default;
  2752. /***/ }),
  2753. /***/ 19:
  2754. /*!******************************************************************************!*\
  2755. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/modules/moduleB.js ***!
  2756. \******************************************************************************/
  2757. /*! no static exports found */
  2758. /***/ (function(module, exports, __webpack_require__) {
  2759. "use strict";
  2760. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2761. state: {
  2762. timestamp: 1608820295 //初始时间戳
  2763. },
  2764. getters: {
  2765. timeString: function timeString(state) {//时间戳转换后的时间
  2766. var date = new Date(state.timestamp);
  2767. var year = date.getFullYear();
  2768. var mon = date.getMonth() + 1;
  2769. var day = date.getDate();
  2770. var hours = date.getHours();
  2771. var minu = date.getMinutes();
  2772. var sec = date.getSeconds();
  2773. var trMon = mon < 10 ? '0' + mon : mon;
  2774. var trDay = day < 10 ? '0' + day : day;
  2775. return year + '-' + trMon + '-' + trDay + " " + hours + ":" + minu + ":" + sec;
  2776. } },
  2777. mutations: {
  2778. updateTime: function updateTime(state) {//更新当前时间戳
  2779. state.timestamp = Date.now();
  2780. } },
  2781. actions: {} };exports.default = _default;
  2782. /***/ }),
  2783. /***/ 2:
  2784. /*!******************************************************************************************!*\
  2785. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2786. \******************************************************************************************/
  2787. /*! exports provided: default */
  2788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2789. "use strict";
  2790. __webpack_require__.r(__webpack_exports__);
  2791. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2792. * Vue.js v2.6.11
  2793. * (c) 2014-2021 Evan You
  2794. * Released under the MIT License.
  2795. */
  2796. /* */
  2797. var emptyObject = Object.freeze({});
  2798. // These helpers produce better VM code in JS engines due to their
  2799. // explicitness and function inlining.
  2800. function isUndef (v) {
  2801. return v === undefined || v === null
  2802. }
  2803. function isDef (v) {
  2804. return v !== undefined && v !== null
  2805. }
  2806. function isTrue (v) {
  2807. return v === true
  2808. }
  2809. function isFalse (v) {
  2810. return v === false
  2811. }
  2812. /**
  2813. * Check if value is primitive.
  2814. */
  2815. function isPrimitive (value) {
  2816. return (
  2817. typeof value === 'string' ||
  2818. typeof value === 'number' ||
  2819. // $flow-disable-line
  2820. typeof value === 'symbol' ||
  2821. typeof value === 'boolean'
  2822. )
  2823. }
  2824. /**
  2825. * Quick object check - this is primarily used to tell
  2826. * Objects from primitive values when we know the value
  2827. * is a JSON-compliant type.
  2828. */
  2829. function isObject (obj) {
  2830. return obj !== null && typeof obj === 'object'
  2831. }
  2832. /**
  2833. * Get the raw type string of a value, e.g., [object Object].
  2834. */
  2835. var _toString = Object.prototype.toString;
  2836. function toRawType (value) {
  2837. return _toString.call(value).slice(8, -1)
  2838. }
  2839. /**
  2840. * Strict object type check. Only returns true
  2841. * for plain JavaScript objects.
  2842. */
  2843. function isPlainObject (obj) {
  2844. return _toString.call(obj) === '[object Object]'
  2845. }
  2846. function isRegExp (v) {
  2847. return _toString.call(v) === '[object RegExp]'
  2848. }
  2849. /**
  2850. * Check if val is a valid array index.
  2851. */
  2852. function isValidArrayIndex (val) {
  2853. var n = parseFloat(String(val));
  2854. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2855. }
  2856. function isPromise (val) {
  2857. return (
  2858. isDef(val) &&
  2859. typeof val.then === 'function' &&
  2860. typeof val.catch === 'function'
  2861. )
  2862. }
  2863. /**
  2864. * Convert a value to a string that is actually rendered.
  2865. */
  2866. function toString (val) {
  2867. return val == null
  2868. ? ''
  2869. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2870. ? JSON.stringify(val, null, 2)
  2871. : String(val)
  2872. }
  2873. /**
  2874. * Convert an input value to a number for persistence.
  2875. * If the conversion fails, return original string.
  2876. */
  2877. function toNumber (val) {
  2878. var n = parseFloat(val);
  2879. return isNaN(n) ? val : n
  2880. }
  2881. /**
  2882. * Make a map and return a function for checking if a key
  2883. * is in that map.
  2884. */
  2885. function makeMap (
  2886. str,
  2887. expectsLowerCase
  2888. ) {
  2889. var map = Object.create(null);
  2890. var list = str.split(',');
  2891. for (var i = 0; i < list.length; i++) {
  2892. map[list[i]] = true;
  2893. }
  2894. return expectsLowerCase
  2895. ? function (val) { return map[val.toLowerCase()]; }
  2896. : function (val) { return map[val]; }
  2897. }
  2898. /**
  2899. * Check if a tag is a built-in tag.
  2900. */
  2901. var isBuiltInTag = makeMap('slot,component', true);
  2902. /**
  2903. * Check if an attribute is a reserved attribute.
  2904. */
  2905. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2906. /**
  2907. * Remove an item from an array.
  2908. */
  2909. function remove (arr, item) {
  2910. if (arr.length) {
  2911. var index = arr.indexOf(item);
  2912. if (index > -1) {
  2913. return arr.splice(index, 1)
  2914. }
  2915. }
  2916. }
  2917. /**
  2918. * Check whether an object has the property.
  2919. */
  2920. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2921. function hasOwn (obj, key) {
  2922. return hasOwnProperty.call(obj, key)
  2923. }
  2924. /**
  2925. * Create a cached version of a pure function.
  2926. */
  2927. function cached (fn) {
  2928. var cache = Object.create(null);
  2929. return (function cachedFn (str) {
  2930. var hit = cache[str];
  2931. return hit || (cache[str] = fn(str))
  2932. })
  2933. }
  2934. /**
  2935. * Camelize a hyphen-delimited string.
  2936. */
  2937. var camelizeRE = /-(\w)/g;
  2938. var camelize = cached(function (str) {
  2939. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2940. });
  2941. /**
  2942. * Capitalize a string.
  2943. */
  2944. var capitalize = cached(function (str) {
  2945. return str.charAt(0).toUpperCase() + str.slice(1)
  2946. });
  2947. /**
  2948. * Hyphenate a camelCase string.
  2949. */
  2950. var hyphenateRE = /\B([A-Z])/g;
  2951. var hyphenate = cached(function (str) {
  2952. return str.replace(hyphenateRE, '-$1').toLowerCase()
  2953. });
  2954. /**
  2955. * Simple bind polyfill for environments that do not support it,
  2956. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  2957. * since native bind is now performant enough in most browsers.
  2958. * But removing it would mean breaking code that was able to run in
  2959. * PhantomJS 1.x, so this must be kept for backward compatibility.
  2960. */
  2961. /* istanbul ignore next */
  2962. function polyfillBind (fn, ctx) {
  2963. function boundFn (a) {
  2964. var l = arguments.length;
  2965. return l
  2966. ? l > 1
  2967. ? fn.apply(ctx, arguments)
  2968. : fn.call(ctx, a)
  2969. : fn.call(ctx)
  2970. }
  2971. boundFn._length = fn.length;
  2972. return boundFn
  2973. }
  2974. function nativeBind (fn, ctx) {
  2975. return fn.bind(ctx)
  2976. }
  2977. var bind = Function.prototype.bind
  2978. ? nativeBind
  2979. : polyfillBind;
  2980. /**
  2981. * Convert an Array-like object to a real Array.
  2982. */
  2983. function toArray (list, start) {
  2984. start = start || 0;
  2985. var i = list.length - start;
  2986. var ret = new Array(i);
  2987. while (i--) {
  2988. ret[i] = list[i + start];
  2989. }
  2990. return ret
  2991. }
  2992. /**
  2993. * Mix properties into target object.
  2994. */
  2995. function extend (to, _from) {
  2996. for (var key in _from) {
  2997. to[key] = _from[key];
  2998. }
  2999. return to
  3000. }
  3001. /**
  3002. * Merge an Array of Objects into a single Object.
  3003. */
  3004. function toObject (arr) {
  3005. var res = {};
  3006. for (var i = 0; i < arr.length; i++) {
  3007. if (arr[i]) {
  3008. extend(res, arr[i]);
  3009. }
  3010. }
  3011. return res
  3012. }
  3013. /* eslint-disable no-unused-vars */
  3014. /**
  3015. * Perform no operation.
  3016. * Stubbing args to make Flow happy without leaving useless transpiled code
  3017. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3018. */
  3019. function noop (a, b, c) {}
  3020. /**
  3021. * Always return false.
  3022. */
  3023. var no = function (a, b, c) { return false; };
  3024. /* eslint-enable no-unused-vars */
  3025. /**
  3026. * Return the same value.
  3027. */
  3028. var identity = function (_) { return _; };
  3029. /**
  3030. * Check if two values are loosely equal - that is,
  3031. * if they are plain objects, do they have the same shape?
  3032. */
  3033. function looseEqual (a, b) {
  3034. if (a === b) { return true }
  3035. var isObjectA = isObject(a);
  3036. var isObjectB = isObject(b);
  3037. if (isObjectA && isObjectB) {
  3038. try {
  3039. var isArrayA = Array.isArray(a);
  3040. var isArrayB = Array.isArray(b);
  3041. if (isArrayA && isArrayB) {
  3042. return a.length === b.length && a.every(function (e, i) {
  3043. return looseEqual(e, b[i])
  3044. })
  3045. } else if (a instanceof Date && b instanceof Date) {
  3046. return a.getTime() === b.getTime()
  3047. } else if (!isArrayA && !isArrayB) {
  3048. var keysA = Object.keys(a);
  3049. var keysB = Object.keys(b);
  3050. return keysA.length === keysB.length && keysA.every(function (key) {
  3051. return looseEqual(a[key], b[key])
  3052. })
  3053. } else {
  3054. /* istanbul ignore next */
  3055. return false
  3056. }
  3057. } catch (e) {
  3058. /* istanbul ignore next */
  3059. return false
  3060. }
  3061. } else if (!isObjectA && !isObjectB) {
  3062. return String(a) === String(b)
  3063. } else {
  3064. return false
  3065. }
  3066. }
  3067. /**
  3068. * Return the first index at which a loosely equal value can be
  3069. * found in the array (if value is a plain object, the array must
  3070. * contain an object of the same shape), or -1 if it is not present.
  3071. */
  3072. function looseIndexOf (arr, val) {
  3073. for (var i = 0; i < arr.length; i++) {
  3074. if (looseEqual(arr[i], val)) { return i }
  3075. }
  3076. return -1
  3077. }
  3078. /**
  3079. * Ensure a function is called only once.
  3080. */
  3081. function once (fn) {
  3082. var called = false;
  3083. return function () {
  3084. if (!called) {
  3085. called = true;
  3086. fn.apply(this, arguments);
  3087. }
  3088. }
  3089. }
  3090. var ASSET_TYPES = [
  3091. 'component',
  3092. 'directive',
  3093. 'filter'
  3094. ];
  3095. var LIFECYCLE_HOOKS = [
  3096. 'beforeCreate',
  3097. 'created',
  3098. 'beforeMount',
  3099. 'mounted',
  3100. 'beforeUpdate',
  3101. 'updated',
  3102. 'beforeDestroy',
  3103. 'destroyed',
  3104. 'activated',
  3105. 'deactivated',
  3106. 'errorCaptured',
  3107. 'serverPrefetch'
  3108. ];
  3109. /* */
  3110. var config = ({
  3111. /**
  3112. * Option merge strategies (used in core/util/options)
  3113. */
  3114. // $flow-disable-line
  3115. optionMergeStrategies: Object.create(null),
  3116. /**
  3117. * Whether to suppress warnings.
  3118. */
  3119. silent: false,
  3120. /**
  3121. * Show production mode tip message on boot?
  3122. */
  3123. productionTip: "development" !== 'production',
  3124. /**
  3125. * Whether to enable devtools
  3126. */
  3127. devtools: "development" !== 'production',
  3128. /**
  3129. * Whether to record perf
  3130. */
  3131. performance: false,
  3132. /**
  3133. * Error handler for watcher errors
  3134. */
  3135. errorHandler: null,
  3136. /**
  3137. * Warn handler for watcher warns
  3138. */
  3139. warnHandler: null,
  3140. /**
  3141. * Ignore certain custom elements
  3142. */
  3143. ignoredElements: [],
  3144. /**
  3145. * Custom user key aliases for v-on
  3146. */
  3147. // $flow-disable-line
  3148. keyCodes: Object.create(null),
  3149. /**
  3150. * Check if a tag is reserved so that it cannot be registered as a
  3151. * component. This is platform-dependent and may be overwritten.
  3152. */
  3153. isReservedTag: no,
  3154. /**
  3155. * Check if an attribute is reserved so that it cannot be used as a component
  3156. * prop. This is platform-dependent and may be overwritten.
  3157. */
  3158. isReservedAttr: no,
  3159. /**
  3160. * Check if a tag is an unknown element.
  3161. * Platform-dependent.
  3162. */
  3163. isUnknownElement: no,
  3164. /**
  3165. * Get the namespace of an element
  3166. */
  3167. getTagNamespace: noop,
  3168. /**
  3169. * Parse the real tag name for the specific platform.
  3170. */
  3171. parsePlatformTagName: identity,
  3172. /**
  3173. * Check if an attribute must be bound using property, e.g. value
  3174. * Platform-dependent.
  3175. */
  3176. mustUseProp: no,
  3177. /**
  3178. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3179. * This will significantly reduce performance if set to false.
  3180. */
  3181. async: true,
  3182. /**
  3183. * Exposed for legacy reasons
  3184. */
  3185. _lifecycleHooks: LIFECYCLE_HOOKS
  3186. });
  3187. /* */
  3188. /**
  3189. * unicode letters used for parsing html tags, component names and property paths.
  3190. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3191. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3192. */
  3193. 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/;
  3194. /**
  3195. * Check if a string starts with $ or _
  3196. */
  3197. function isReserved (str) {
  3198. var c = (str + '').charCodeAt(0);
  3199. return c === 0x24 || c === 0x5F
  3200. }
  3201. /**
  3202. * Define a property.
  3203. */
  3204. function def (obj, key, val, enumerable) {
  3205. Object.defineProperty(obj, key, {
  3206. value: val,
  3207. enumerable: !!enumerable,
  3208. writable: true,
  3209. configurable: true
  3210. });
  3211. }
  3212. /**
  3213. * Parse simple path.
  3214. */
  3215. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3216. function parsePath (path) {
  3217. if (bailRE.test(path)) {
  3218. return
  3219. }
  3220. var segments = path.split('.');
  3221. return function (obj) {
  3222. for (var i = 0; i < segments.length; i++) {
  3223. if (!obj) { return }
  3224. obj = obj[segments[i]];
  3225. }
  3226. return obj
  3227. }
  3228. }
  3229. /* */
  3230. // can we use __proto__?
  3231. var hasProto = '__proto__' in {};
  3232. // Browser environment sniffing
  3233. var inBrowser = typeof window !== 'undefined';
  3234. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3235. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3236. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3237. var isIE = UA && /msie|trident/.test(UA);
  3238. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3239. var isEdge = UA && UA.indexOf('edge/') > 0;
  3240. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3241. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3242. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3243. var isPhantomJS = UA && /phantomjs/.test(UA);
  3244. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3245. // Firefox has a "watch" function on Object.prototype...
  3246. var nativeWatch = ({}).watch;
  3247. if (inBrowser) {
  3248. try {
  3249. var opts = {};
  3250. Object.defineProperty(opts, 'passive', ({
  3251. get: function get () {
  3252. }
  3253. })); // https://github.com/facebook/flow/issues/285
  3254. window.addEventListener('test-passive', null, opts);
  3255. } catch (e) {}
  3256. }
  3257. // this needs to be lazy-evaled because vue may be required before
  3258. // vue-server-renderer can set VUE_ENV
  3259. var _isServer;
  3260. var isServerRendering = function () {
  3261. if (_isServer === undefined) {
  3262. /* istanbul ignore if */
  3263. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3264. // detect presence of vue-server-renderer and avoid
  3265. // Webpack shimming the process
  3266. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3267. } else {
  3268. _isServer = false;
  3269. }
  3270. }
  3271. return _isServer
  3272. };
  3273. // detect devtools
  3274. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3275. /* istanbul ignore next */
  3276. function isNative (Ctor) {
  3277. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3278. }
  3279. var hasSymbol =
  3280. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3281. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3282. var _Set;
  3283. /* istanbul ignore if */ // $flow-disable-line
  3284. if (typeof Set !== 'undefined' && isNative(Set)) {
  3285. // use native Set when available.
  3286. _Set = Set;
  3287. } else {
  3288. // a non-standard Set polyfill that only works with primitive keys.
  3289. _Set = /*@__PURE__*/(function () {
  3290. function Set () {
  3291. this.set = Object.create(null);
  3292. }
  3293. Set.prototype.has = function has (key) {
  3294. return this.set[key] === true
  3295. };
  3296. Set.prototype.add = function add (key) {
  3297. this.set[key] = true;
  3298. };
  3299. Set.prototype.clear = function clear () {
  3300. this.set = Object.create(null);
  3301. };
  3302. return Set;
  3303. }());
  3304. }
  3305. /* */
  3306. var warn = noop;
  3307. var tip = noop;
  3308. var generateComponentTrace = (noop); // work around flow check
  3309. var formatComponentName = (noop);
  3310. if (true) {
  3311. var hasConsole = typeof console !== 'undefined';
  3312. var classifyRE = /(?:^|[-_])(\w)/g;
  3313. var classify = function (str) { return str
  3314. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3315. .replace(/[-_]/g, ''); };
  3316. warn = function (msg, vm) {
  3317. var trace = vm ? generateComponentTrace(vm) : '';
  3318. if (config.warnHandler) {
  3319. config.warnHandler.call(null, msg, vm, trace);
  3320. } else if (hasConsole && (!config.silent)) {
  3321. console.error(("[Vue warn]: " + msg + trace));
  3322. }
  3323. };
  3324. tip = function (msg, vm) {
  3325. if (hasConsole && (!config.silent)) {
  3326. console.warn("[Vue tip]: " + msg + (
  3327. vm ? generateComponentTrace(vm) : ''
  3328. ));
  3329. }
  3330. };
  3331. formatComponentName = function (vm, includeFile) {
  3332. if (vm.$root === vm) {
  3333. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3334. return ('') + vm.$options.__file
  3335. }
  3336. return '<Root>'
  3337. }
  3338. var options = typeof vm === 'function' && vm.cid != null
  3339. ? vm.options
  3340. : vm._isVue
  3341. ? vm.$options || vm.constructor.options
  3342. : vm;
  3343. var name = options.name || options._componentTag;
  3344. var file = options.__file;
  3345. if (!name && file) {
  3346. var match = file.match(/([^/\\]+)\.vue$/);
  3347. name = match && match[1];
  3348. }
  3349. return (
  3350. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3351. (file && includeFile !== false ? (" at " + file) : '')
  3352. )
  3353. };
  3354. var repeat = function (str, n) {
  3355. var res = '';
  3356. while (n) {
  3357. if (n % 2 === 1) { res += str; }
  3358. if (n > 1) { str += str; }
  3359. n >>= 1;
  3360. }
  3361. return res
  3362. };
  3363. generateComponentTrace = function (vm) {
  3364. if (vm._isVue && vm.$parent) {
  3365. var tree = [];
  3366. var currentRecursiveSequence = 0;
  3367. while (vm && vm.$options.name !== 'PageBody') {
  3368. if (tree.length > 0) {
  3369. var last = tree[tree.length - 1];
  3370. if (last.constructor === vm.constructor) {
  3371. currentRecursiveSequence++;
  3372. vm = vm.$parent;
  3373. continue
  3374. } else if (currentRecursiveSequence > 0) {
  3375. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3376. currentRecursiveSequence = 0;
  3377. }
  3378. }
  3379. !vm.$options.isReserved && tree.push(vm);
  3380. vm = vm.$parent;
  3381. }
  3382. return '\n\nfound in\n\n' + tree
  3383. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3384. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3385. : formatComponentName(vm))); })
  3386. .join('\n')
  3387. } else {
  3388. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3389. }
  3390. };
  3391. }
  3392. /* */
  3393. var uid = 0;
  3394. /**
  3395. * A dep is an observable that can have multiple
  3396. * directives subscribing to it.
  3397. */
  3398. var Dep = function Dep () {
  3399. this.id = uid++;
  3400. this.subs = [];
  3401. };
  3402. Dep.prototype.addSub = function addSub (sub) {
  3403. this.subs.push(sub);
  3404. };
  3405. Dep.prototype.removeSub = function removeSub (sub) {
  3406. remove(this.subs, sub);
  3407. };
  3408. Dep.prototype.depend = function depend () {
  3409. if (Dep.SharedObject.target) {
  3410. Dep.SharedObject.target.addDep(this);
  3411. }
  3412. };
  3413. Dep.prototype.notify = function notify () {
  3414. // stabilize the subscriber list first
  3415. var subs = this.subs.slice();
  3416. if ( true && !config.async) {
  3417. // subs aren't sorted in scheduler if not running async
  3418. // we need to sort them now to make sure they fire in correct
  3419. // order
  3420. subs.sort(function (a, b) { return a.id - b.id; });
  3421. }
  3422. for (var i = 0, l = subs.length; i < l; i++) {
  3423. subs[i].update();
  3424. }
  3425. };
  3426. // The current target watcher being evaluated.
  3427. // This is globally unique because only one watcher
  3428. // can be evaluated at a time.
  3429. // fixed by xxxxxx (nvue shared vuex)
  3430. /* eslint-disable no-undef */
  3431. Dep.SharedObject = {};
  3432. Dep.SharedObject.target = null;
  3433. Dep.SharedObject.targetStack = [];
  3434. function pushTarget (target) {
  3435. Dep.SharedObject.targetStack.push(target);
  3436. Dep.SharedObject.target = target;
  3437. Dep.target = target;
  3438. }
  3439. function popTarget () {
  3440. Dep.SharedObject.targetStack.pop();
  3441. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3442. Dep.target = Dep.SharedObject.target;
  3443. }
  3444. /* */
  3445. var VNode = function VNode (
  3446. tag,
  3447. data,
  3448. children,
  3449. text,
  3450. elm,
  3451. context,
  3452. componentOptions,
  3453. asyncFactory
  3454. ) {
  3455. this.tag = tag;
  3456. this.data = data;
  3457. this.children = children;
  3458. this.text = text;
  3459. this.elm = elm;
  3460. this.ns = undefined;
  3461. this.context = context;
  3462. this.fnContext = undefined;
  3463. this.fnOptions = undefined;
  3464. this.fnScopeId = undefined;
  3465. this.key = data && data.key;
  3466. this.componentOptions = componentOptions;
  3467. this.componentInstance = undefined;
  3468. this.parent = undefined;
  3469. this.raw = false;
  3470. this.isStatic = false;
  3471. this.isRootInsert = true;
  3472. this.isComment = false;
  3473. this.isCloned = false;
  3474. this.isOnce = false;
  3475. this.asyncFactory = asyncFactory;
  3476. this.asyncMeta = undefined;
  3477. this.isAsyncPlaceholder = false;
  3478. };
  3479. var prototypeAccessors = { child: { configurable: true } };
  3480. // DEPRECATED: alias for componentInstance for backwards compat.
  3481. /* istanbul ignore next */
  3482. prototypeAccessors.child.get = function () {
  3483. return this.componentInstance
  3484. };
  3485. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3486. var createEmptyVNode = function (text) {
  3487. if ( text === void 0 ) text = '';
  3488. var node = new VNode();
  3489. node.text = text;
  3490. node.isComment = true;
  3491. return node
  3492. };
  3493. function createTextVNode (val) {
  3494. return new VNode(undefined, undefined, undefined, String(val))
  3495. }
  3496. // optimized shallow clone
  3497. // used for static nodes and slot nodes because they may be reused across
  3498. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3499. // on their elm reference.
  3500. function cloneVNode (vnode) {
  3501. var cloned = new VNode(
  3502. vnode.tag,
  3503. vnode.data,
  3504. // #7975
  3505. // clone children array to avoid mutating original in case of cloning
  3506. // a child.
  3507. vnode.children && vnode.children.slice(),
  3508. vnode.text,
  3509. vnode.elm,
  3510. vnode.context,
  3511. vnode.componentOptions,
  3512. vnode.asyncFactory
  3513. );
  3514. cloned.ns = vnode.ns;
  3515. cloned.isStatic = vnode.isStatic;
  3516. cloned.key = vnode.key;
  3517. cloned.isComment = vnode.isComment;
  3518. cloned.fnContext = vnode.fnContext;
  3519. cloned.fnOptions = vnode.fnOptions;
  3520. cloned.fnScopeId = vnode.fnScopeId;
  3521. cloned.asyncMeta = vnode.asyncMeta;
  3522. cloned.isCloned = true;
  3523. return cloned
  3524. }
  3525. /*
  3526. * not type checking this file because flow doesn't play well with
  3527. * dynamically accessing methods on Array prototype
  3528. */
  3529. var arrayProto = Array.prototype;
  3530. var arrayMethods = Object.create(arrayProto);
  3531. var methodsToPatch = [
  3532. 'push',
  3533. 'pop',
  3534. 'shift',
  3535. 'unshift',
  3536. 'splice',
  3537. 'sort',
  3538. 'reverse'
  3539. ];
  3540. /**
  3541. * Intercept mutating methods and emit events
  3542. */
  3543. methodsToPatch.forEach(function (method) {
  3544. // cache original method
  3545. var original = arrayProto[method];
  3546. def(arrayMethods, method, function mutator () {
  3547. var args = [], len = arguments.length;
  3548. while ( len-- ) args[ len ] = arguments[ len ];
  3549. var result = original.apply(this, args);
  3550. var ob = this.__ob__;
  3551. var inserted;
  3552. switch (method) {
  3553. case 'push':
  3554. case 'unshift':
  3555. inserted = args;
  3556. break
  3557. case 'splice':
  3558. inserted = args.slice(2);
  3559. break
  3560. }
  3561. if (inserted) { ob.observeArray(inserted); }
  3562. // notify change
  3563. ob.dep.notify();
  3564. return result
  3565. });
  3566. });
  3567. /* */
  3568. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3569. /**
  3570. * In some cases we may want to disable observation inside a component's
  3571. * update computation.
  3572. */
  3573. var shouldObserve = true;
  3574. function toggleObserving (value) {
  3575. shouldObserve = value;
  3576. }
  3577. /**
  3578. * Observer class that is attached to each observed
  3579. * object. Once attached, the observer converts the target
  3580. * object's property keys into getter/setters that
  3581. * collect dependencies and dispatch updates.
  3582. */
  3583. var Observer = function Observer (value) {
  3584. this.value = value;
  3585. this.dep = new Dep();
  3586. this.vmCount = 0;
  3587. def(value, '__ob__', this);
  3588. if (Array.isArray(value)) {
  3589. if (hasProto) {
  3590. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3591. if(value.push !== value.__proto__.push){
  3592. copyAugment(value, arrayMethods, arrayKeys);
  3593. } else {
  3594. protoAugment(value, arrayMethods);
  3595. }
  3596. }
  3597. } else {
  3598. copyAugment(value, arrayMethods, arrayKeys);
  3599. }
  3600. this.observeArray(value);
  3601. } else {
  3602. this.walk(value);
  3603. }
  3604. };
  3605. /**
  3606. * Walk through all properties and convert them into
  3607. * getter/setters. This method should only be called when
  3608. * value type is Object.
  3609. */
  3610. Observer.prototype.walk = function walk (obj) {
  3611. var keys = Object.keys(obj);
  3612. for (var i = 0; i < keys.length; i++) {
  3613. defineReactive$$1(obj, keys[i]);
  3614. }
  3615. };
  3616. /**
  3617. * Observe a list of Array items.
  3618. */
  3619. Observer.prototype.observeArray = function observeArray (items) {
  3620. for (var i = 0, l = items.length; i < l; i++) {
  3621. observe(items[i]);
  3622. }
  3623. };
  3624. // helpers
  3625. /**
  3626. * Augment a target Object or Array by intercepting
  3627. * the prototype chain using __proto__
  3628. */
  3629. function protoAugment (target, src) {
  3630. /* eslint-disable no-proto */
  3631. target.__proto__ = src;
  3632. /* eslint-enable no-proto */
  3633. }
  3634. /**
  3635. * Augment a target Object or Array by defining
  3636. * hidden properties.
  3637. */
  3638. /* istanbul ignore next */
  3639. function copyAugment (target, src, keys) {
  3640. for (var i = 0, l = keys.length; i < l; i++) {
  3641. var key = keys[i];
  3642. def(target, key, src[key]);
  3643. }
  3644. }
  3645. /**
  3646. * Attempt to create an observer instance for a value,
  3647. * returns the new observer if successfully observed,
  3648. * or the existing observer if the value already has one.
  3649. */
  3650. function observe (value, asRootData) {
  3651. if (!isObject(value) || value instanceof VNode) {
  3652. return
  3653. }
  3654. var ob;
  3655. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3656. ob = value.__ob__;
  3657. } else if (
  3658. shouldObserve &&
  3659. !isServerRendering() &&
  3660. (Array.isArray(value) || isPlainObject(value)) &&
  3661. Object.isExtensible(value) &&
  3662. !value._isVue
  3663. ) {
  3664. ob = new Observer(value);
  3665. }
  3666. if (asRootData && ob) {
  3667. ob.vmCount++;
  3668. }
  3669. return ob
  3670. }
  3671. /**
  3672. * Define a reactive property on an Object.
  3673. */
  3674. function defineReactive$$1 (
  3675. obj,
  3676. key,
  3677. val,
  3678. customSetter,
  3679. shallow
  3680. ) {
  3681. var dep = new Dep();
  3682. var property = Object.getOwnPropertyDescriptor(obj, key);
  3683. if (property && property.configurable === false) {
  3684. return
  3685. }
  3686. // cater for pre-defined getter/setters
  3687. var getter = property && property.get;
  3688. var setter = property && property.set;
  3689. if ((!getter || setter) && arguments.length === 2) {
  3690. val = obj[key];
  3691. }
  3692. var childOb = !shallow && observe(val);
  3693. Object.defineProperty(obj, key, {
  3694. enumerable: true,
  3695. configurable: true,
  3696. get: function reactiveGetter () {
  3697. var value = getter ? getter.call(obj) : val;
  3698. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3699. dep.depend();
  3700. if (childOb) {
  3701. childOb.dep.depend();
  3702. if (Array.isArray(value)) {
  3703. dependArray(value);
  3704. }
  3705. }
  3706. }
  3707. return value
  3708. },
  3709. set: function reactiveSetter (newVal) {
  3710. var value = getter ? getter.call(obj) : val;
  3711. /* eslint-disable no-self-compare */
  3712. if (newVal === value || (newVal !== newVal && value !== value)) {
  3713. return
  3714. }
  3715. /* eslint-enable no-self-compare */
  3716. if ( true && customSetter) {
  3717. customSetter();
  3718. }
  3719. // #7981: for accessor properties without setter
  3720. if (getter && !setter) { return }
  3721. if (setter) {
  3722. setter.call(obj, newVal);
  3723. } else {
  3724. val = newVal;
  3725. }
  3726. childOb = !shallow && observe(newVal);
  3727. dep.notify();
  3728. }
  3729. });
  3730. }
  3731. /**
  3732. * Set a property on an object. Adds the new property and
  3733. * triggers change notification if the property doesn't
  3734. * already exist.
  3735. */
  3736. function set (target, key, val) {
  3737. if ( true &&
  3738. (isUndef(target) || isPrimitive(target))
  3739. ) {
  3740. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3741. }
  3742. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3743. target.length = Math.max(target.length, key);
  3744. target.splice(key, 1, val);
  3745. return val
  3746. }
  3747. if (key in target && !(key in Object.prototype)) {
  3748. target[key] = val;
  3749. return val
  3750. }
  3751. var ob = (target).__ob__;
  3752. if (target._isVue || (ob && ob.vmCount)) {
  3753. true && warn(
  3754. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3755. 'at runtime - declare it upfront in the data option.'
  3756. );
  3757. return val
  3758. }
  3759. if (!ob) {
  3760. target[key] = val;
  3761. return val
  3762. }
  3763. defineReactive$$1(ob.value, key, val);
  3764. ob.dep.notify();
  3765. return val
  3766. }
  3767. /**
  3768. * Delete a property and trigger change if necessary.
  3769. */
  3770. function del (target, key) {
  3771. if ( true &&
  3772. (isUndef(target) || isPrimitive(target))
  3773. ) {
  3774. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3775. }
  3776. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3777. target.splice(key, 1);
  3778. return
  3779. }
  3780. var ob = (target).__ob__;
  3781. if (target._isVue || (ob && ob.vmCount)) {
  3782. true && warn(
  3783. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3784. '- just set it to null.'
  3785. );
  3786. return
  3787. }
  3788. if (!hasOwn(target, key)) {
  3789. return
  3790. }
  3791. delete target[key];
  3792. if (!ob) {
  3793. return
  3794. }
  3795. ob.dep.notify();
  3796. }
  3797. /**
  3798. * Collect dependencies on array elements when the array is touched, since
  3799. * we cannot intercept array element access like property getters.
  3800. */
  3801. function dependArray (value) {
  3802. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3803. e = value[i];
  3804. e && e.__ob__ && e.__ob__.dep.depend();
  3805. if (Array.isArray(e)) {
  3806. dependArray(e);
  3807. }
  3808. }
  3809. }
  3810. /* */
  3811. /**
  3812. * Option overwriting strategies are functions that handle
  3813. * how to merge a parent option value and a child option
  3814. * value into the final value.
  3815. */
  3816. var strats = config.optionMergeStrategies;
  3817. /**
  3818. * Options with restrictions
  3819. */
  3820. if (true) {
  3821. strats.el = strats.propsData = function (parent, child, vm, key) {
  3822. if (!vm) {
  3823. warn(
  3824. "option \"" + key + "\" can only be used during instance " +
  3825. 'creation with the `new` keyword.'
  3826. );
  3827. }
  3828. return defaultStrat(parent, child)
  3829. };
  3830. }
  3831. /**
  3832. * Helper that recursively merges two data objects together.
  3833. */
  3834. function mergeData (to, from) {
  3835. if (!from) { return to }
  3836. var key, toVal, fromVal;
  3837. var keys = hasSymbol
  3838. ? Reflect.ownKeys(from)
  3839. : Object.keys(from);
  3840. for (var i = 0; i < keys.length; i++) {
  3841. key = keys[i];
  3842. // in case the object is already observed...
  3843. if (key === '__ob__') { continue }
  3844. toVal = to[key];
  3845. fromVal = from[key];
  3846. if (!hasOwn(to, key)) {
  3847. set(to, key, fromVal);
  3848. } else if (
  3849. toVal !== fromVal &&
  3850. isPlainObject(toVal) &&
  3851. isPlainObject(fromVal)
  3852. ) {
  3853. mergeData(toVal, fromVal);
  3854. }
  3855. }
  3856. return to
  3857. }
  3858. /**
  3859. * Data
  3860. */
  3861. function mergeDataOrFn (
  3862. parentVal,
  3863. childVal,
  3864. vm
  3865. ) {
  3866. if (!vm) {
  3867. // in a Vue.extend merge, both should be functions
  3868. if (!childVal) {
  3869. return parentVal
  3870. }
  3871. if (!parentVal) {
  3872. return childVal
  3873. }
  3874. // when parentVal & childVal are both present,
  3875. // we need to return a function that returns the
  3876. // merged result of both functions... no need to
  3877. // check if parentVal is a function here because
  3878. // it has to be a function to pass previous merges.
  3879. return function mergedDataFn () {
  3880. return mergeData(
  3881. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3882. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3883. )
  3884. }
  3885. } else {
  3886. return function mergedInstanceDataFn () {
  3887. // instance merge
  3888. var instanceData = typeof childVal === 'function'
  3889. ? childVal.call(vm, vm)
  3890. : childVal;
  3891. var defaultData = typeof parentVal === 'function'
  3892. ? parentVal.call(vm, vm)
  3893. : parentVal;
  3894. if (instanceData) {
  3895. return mergeData(instanceData, defaultData)
  3896. } else {
  3897. return defaultData
  3898. }
  3899. }
  3900. }
  3901. }
  3902. strats.data = function (
  3903. parentVal,
  3904. childVal,
  3905. vm
  3906. ) {
  3907. if (!vm) {
  3908. if (childVal && typeof childVal !== 'function') {
  3909. true && warn(
  3910. 'The "data" option should be a function ' +
  3911. 'that returns a per-instance value in component ' +
  3912. 'definitions.',
  3913. vm
  3914. );
  3915. return parentVal
  3916. }
  3917. return mergeDataOrFn(parentVal, childVal)
  3918. }
  3919. return mergeDataOrFn(parentVal, childVal, vm)
  3920. };
  3921. /**
  3922. * Hooks and props are merged as arrays.
  3923. */
  3924. function mergeHook (
  3925. parentVal,
  3926. childVal
  3927. ) {
  3928. var res = childVal
  3929. ? parentVal
  3930. ? parentVal.concat(childVal)
  3931. : Array.isArray(childVal)
  3932. ? childVal
  3933. : [childVal]
  3934. : parentVal;
  3935. return res
  3936. ? dedupeHooks(res)
  3937. : res
  3938. }
  3939. function dedupeHooks (hooks) {
  3940. var res = [];
  3941. for (var i = 0; i < hooks.length; i++) {
  3942. if (res.indexOf(hooks[i]) === -1) {
  3943. res.push(hooks[i]);
  3944. }
  3945. }
  3946. return res
  3947. }
  3948. LIFECYCLE_HOOKS.forEach(function (hook) {
  3949. strats[hook] = mergeHook;
  3950. });
  3951. /**
  3952. * Assets
  3953. *
  3954. * When a vm is present (instance creation), we need to do
  3955. * a three-way merge between constructor options, instance
  3956. * options and parent options.
  3957. */
  3958. function mergeAssets (
  3959. parentVal,
  3960. childVal,
  3961. vm,
  3962. key
  3963. ) {
  3964. var res = Object.create(parentVal || null);
  3965. if (childVal) {
  3966. true && assertObjectType(key, childVal, vm);
  3967. return extend(res, childVal)
  3968. } else {
  3969. return res
  3970. }
  3971. }
  3972. ASSET_TYPES.forEach(function (type) {
  3973. strats[type + 's'] = mergeAssets;
  3974. });
  3975. /**
  3976. * Watchers.
  3977. *
  3978. * Watchers hashes should not overwrite one
  3979. * another, so we merge them as arrays.
  3980. */
  3981. strats.watch = function (
  3982. parentVal,
  3983. childVal,
  3984. vm,
  3985. key
  3986. ) {
  3987. // work around Firefox's Object.prototype.watch...
  3988. if (parentVal === nativeWatch) { parentVal = undefined; }
  3989. if (childVal === nativeWatch) { childVal = undefined; }
  3990. /* istanbul ignore if */
  3991. if (!childVal) { return Object.create(parentVal || null) }
  3992. if (true) {
  3993. assertObjectType(key, childVal, vm);
  3994. }
  3995. if (!parentVal) { return childVal }
  3996. var ret = {};
  3997. extend(ret, parentVal);
  3998. for (var key$1 in childVal) {
  3999. var parent = ret[key$1];
  4000. var child = childVal[key$1];
  4001. if (parent && !Array.isArray(parent)) {
  4002. parent = [parent];
  4003. }
  4004. ret[key$1] = parent
  4005. ? parent.concat(child)
  4006. : Array.isArray(child) ? child : [child];
  4007. }
  4008. return ret
  4009. };
  4010. /**
  4011. * Other object hashes.
  4012. */
  4013. strats.props =
  4014. strats.methods =
  4015. strats.inject =
  4016. strats.computed = function (
  4017. parentVal,
  4018. childVal,
  4019. vm,
  4020. key
  4021. ) {
  4022. if (childVal && "development" !== 'production') {
  4023. assertObjectType(key, childVal, vm);
  4024. }
  4025. if (!parentVal) { return childVal }
  4026. var ret = Object.create(null);
  4027. extend(ret, parentVal);
  4028. if (childVal) { extend(ret, childVal); }
  4029. return ret
  4030. };
  4031. strats.provide = mergeDataOrFn;
  4032. /**
  4033. * Default strategy.
  4034. */
  4035. var defaultStrat = function (parentVal, childVal) {
  4036. return childVal === undefined
  4037. ? parentVal
  4038. : childVal
  4039. };
  4040. /**
  4041. * Validate component names
  4042. */
  4043. function checkComponents (options) {
  4044. for (var key in options.components) {
  4045. validateComponentName(key);
  4046. }
  4047. }
  4048. function validateComponentName (name) {
  4049. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4050. warn(
  4051. 'Invalid component name: "' + name + '". Component names ' +
  4052. 'should conform to valid custom element name in html5 specification.'
  4053. );
  4054. }
  4055. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4056. warn(
  4057. 'Do not use built-in or reserved HTML elements as component ' +
  4058. 'id: ' + name
  4059. );
  4060. }
  4061. }
  4062. /**
  4063. * Ensure all props option syntax are normalized into the
  4064. * Object-based format.
  4065. */
  4066. function normalizeProps (options, vm) {
  4067. var props = options.props;
  4068. if (!props) { return }
  4069. var res = {};
  4070. var i, val, name;
  4071. if (Array.isArray(props)) {
  4072. i = props.length;
  4073. while (i--) {
  4074. val = props[i];
  4075. if (typeof val === 'string') {
  4076. name = camelize(val);
  4077. res[name] = { type: null };
  4078. } else if (true) {
  4079. warn('props must be strings when using array syntax.');
  4080. }
  4081. }
  4082. } else if (isPlainObject(props)) {
  4083. for (var key in props) {
  4084. val = props[key];
  4085. name = camelize(key);
  4086. res[name] = isPlainObject(val)
  4087. ? val
  4088. : { type: val };
  4089. }
  4090. } else if (true) {
  4091. warn(
  4092. "Invalid value for option \"props\": expected an Array or an Object, " +
  4093. "but got " + (toRawType(props)) + ".",
  4094. vm
  4095. );
  4096. }
  4097. options.props = res;
  4098. }
  4099. /**
  4100. * Normalize all injections into Object-based format
  4101. */
  4102. function normalizeInject (options, vm) {
  4103. var inject = options.inject;
  4104. if (!inject) { return }
  4105. var normalized = options.inject = {};
  4106. if (Array.isArray(inject)) {
  4107. for (var i = 0; i < inject.length; i++) {
  4108. normalized[inject[i]] = { from: inject[i] };
  4109. }
  4110. } else if (isPlainObject(inject)) {
  4111. for (var key in inject) {
  4112. var val = inject[key];
  4113. normalized[key] = isPlainObject(val)
  4114. ? extend({ from: key }, val)
  4115. : { from: val };
  4116. }
  4117. } else if (true) {
  4118. warn(
  4119. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4120. "but got " + (toRawType(inject)) + ".",
  4121. vm
  4122. );
  4123. }
  4124. }
  4125. /**
  4126. * Normalize raw function directives into object format.
  4127. */
  4128. function normalizeDirectives (options) {
  4129. var dirs = options.directives;
  4130. if (dirs) {
  4131. for (var key in dirs) {
  4132. var def$$1 = dirs[key];
  4133. if (typeof def$$1 === 'function') {
  4134. dirs[key] = { bind: def$$1, update: def$$1 };
  4135. }
  4136. }
  4137. }
  4138. }
  4139. function assertObjectType (name, value, vm) {
  4140. if (!isPlainObject(value)) {
  4141. warn(
  4142. "Invalid value for option \"" + name + "\": expected an Object, " +
  4143. "but got " + (toRawType(value)) + ".",
  4144. vm
  4145. );
  4146. }
  4147. }
  4148. /**
  4149. * Merge two option objects into a new one.
  4150. * Core utility used in both instantiation and inheritance.
  4151. */
  4152. function mergeOptions (
  4153. parent,
  4154. child,
  4155. vm
  4156. ) {
  4157. if (true) {
  4158. checkComponents(child);
  4159. }
  4160. if (typeof child === 'function') {
  4161. child = child.options;
  4162. }
  4163. normalizeProps(child, vm);
  4164. normalizeInject(child, vm);
  4165. normalizeDirectives(child);
  4166. // Apply extends and mixins on the child options,
  4167. // but only if it is a raw options object that isn't
  4168. // the result of another mergeOptions call.
  4169. // Only merged options has the _base property.
  4170. if (!child._base) {
  4171. if (child.extends) {
  4172. parent = mergeOptions(parent, child.extends, vm);
  4173. }
  4174. if (child.mixins) {
  4175. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4176. parent = mergeOptions(parent, child.mixins[i], vm);
  4177. }
  4178. }
  4179. }
  4180. var options = {};
  4181. var key;
  4182. for (key in parent) {
  4183. mergeField(key);
  4184. }
  4185. for (key in child) {
  4186. if (!hasOwn(parent, key)) {
  4187. mergeField(key);
  4188. }
  4189. }
  4190. function mergeField (key) {
  4191. var strat = strats[key] || defaultStrat;
  4192. options[key] = strat(parent[key], child[key], vm, key);
  4193. }
  4194. return options
  4195. }
  4196. /**
  4197. * Resolve an asset.
  4198. * This function is used because child instances need access
  4199. * to assets defined in its ancestor chain.
  4200. */
  4201. function resolveAsset (
  4202. options,
  4203. type,
  4204. id,
  4205. warnMissing
  4206. ) {
  4207. /* istanbul ignore if */
  4208. if (typeof id !== 'string') {
  4209. return
  4210. }
  4211. var assets = options[type];
  4212. // check local registration variations first
  4213. if (hasOwn(assets, id)) { return assets[id] }
  4214. var camelizedId = camelize(id);
  4215. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4216. var PascalCaseId = capitalize(camelizedId);
  4217. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4218. // fallback to prototype chain
  4219. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4220. if ( true && warnMissing && !res) {
  4221. warn(
  4222. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4223. options
  4224. );
  4225. }
  4226. return res
  4227. }
  4228. /* */
  4229. function validateProp (
  4230. key,
  4231. propOptions,
  4232. propsData,
  4233. vm
  4234. ) {
  4235. var prop = propOptions[key];
  4236. var absent = !hasOwn(propsData, key);
  4237. var value = propsData[key];
  4238. // boolean casting
  4239. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4240. if (booleanIndex > -1) {
  4241. if (absent && !hasOwn(prop, 'default')) {
  4242. value = false;
  4243. } else if (value === '' || value === hyphenate(key)) {
  4244. // only cast empty string / same name to boolean if
  4245. // boolean has higher priority
  4246. var stringIndex = getTypeIndex(String, prop.type);
  4247. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4248. value = true;
  4249. }
  4250. }
  4251. }
  4252. // check default value
  4253. if (value === undefined) {
  4254. value = getPropDefaultValue(vm, prop, key);
  4255. // since the default value is a fresh copy,
  4256. // make sure to observe it.
  4257. var prevShouldObserve = shouldObserve;
  4258. toggleObserving(true);
  4259. observe(value);
  4260. toggleObserving(prevShouldObserve);
  4261. }
  4262. if (
  4263. true
  4264. ) {
  4265. assertProp(prop, key, value, vm, absent);
  4266. }
  4267. return value
  4268. }
  4269. /**
  4270. * Get the default value of a prop.
  4271. */
  4272. function getPropDefaultValue (vm, prop, key) {
  4273. // no default, return undefined
  4274. if (!hasOwn(prop, 'default')) {
  4275. return undefined
  4276. }
  4277. var def = prop.default;
  4278. // warn against non-factory defaults for Object & Array
  4279. if ( true && isObject(def)) {
  4280. warn(
  4281. 'Invalid default value for prop "' + key + '": ' +
  4282. 'Props with type Object/Array must use a factory function ' +
  4283. 'to return the default value.',
  4284. vm
  4285. );
  4286. }
  4287. // the raw prop value was also undefined from previous render,
  4288. // return previous default value to avoid unnecessary watcher trigger
  4289. if (vm && vm.$options.propsData &&
  4290. vm.$options.propsData[key] === undefined &&
  4291. vm._props[key] !== undefined
  4292. ) {
  4293. return vm._props[key]
  4294. }
  4295. // call factory function for non-Function types
  4296. // a value is Function if its prototype is function even across different execution context
  4297. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4298. ? def.call(vm)
  4299. : def
  4300. }
  4301. /**
  4302. * Assert whether a prop is valid.
  4303. */
  4304. function assertProp (
  4305. prop,
  4306. name,
  4307. value,
  4308. vm,
  4309. absent
  4310. ) {
  4311. if (prop.required && absent) {
  4312. warn(
  4313. 'Missing required prop: "' + name + '"',
  4314. vm
  4315. );
  4316. return
  4317. }
  4318. if (value == null && !prop.required) {
  4319. return
  4320. }
  4321. var type = prop.type;
  4322. var valid = !type || type === true;
  4323. var expectedTypes = [];
  4324. if (type) {
  4325. if (!Array.isArray(type)) {
  4326. type = [type];
  4327. }
  4328. for (var i = 0; i < type.length && !valid; i++) {
  4329. var assertedType = assertType(value, type[i]);
  4330. expectedTypes.push(assertedType.expectedType || '');
  4331. valid = assertedType.valid;
  4332. }
  4333. }
  4334. if (!valid) {
  4335. warn(
  4336. getInvalidTypeMessage(name, value, expectedTypes),
  4337. vm
  4338. );
  4339. return
  4340. }
  4341. var validator = prop.validator;
  4342. if (validator) {
  4343. if (!validator(value)) {
  4344. warn(
  4345. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4346. vm
  4347. );
  4348. }
  4349. }
  4350. }
  4351. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4352. function assertType (value, type) {
  4353. var valid;
  4354. var expectedType = getType(type);
  4355. if (simpleCheckRE.test(expectedType)) {
  4356. var t = typeof value;
  4357. valid = t === expectedType.toLowerCase();
  4358. // for primitive wrapper objects
  4359. if (!valid && t === 'object') {
  4360. valid = value instanceof type;
  4361. }
  4362. } else if (expectedType === 'Object') {
  4363. valid = isPlainObject(value);
  4364. } else if (expectedType === 'Array') {
  4365. valid = Array.isArray(value);
  4366. } else {
  4367. valid = value instanceof type;
  4368. }
  4369. return {
  4370. valid: valid,
  4371. expectedType: expectedType
  4372. }
  4373. }
  4374. /**
  4375. * Use function string name to check built-in types,
  4376. * because a simple equality check will fail when running
  4377. * across different vms / iframes.
  4378. */
  4379. function getType (fn) {
  4380. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4381. return match ? match[1] : ''
  4382. }
  4383. function isSameType (a, b) {
  4384. return getType(a) === getType(b)
  4385. }
  4386. function getTypeIndex (type, expectedTypes) {
  4387. if (!Array.isArray(expectedTypes)) {
  4388. return isSameType(expectedTypes, type) ? 0 : -1
  4389. }
  4390. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4391. if (isSameType(expectedTypes[i], type)) {
  4392. return i
  4393. }
  4394. }
  4395. return -1
  4396. }
  4397. function getInvalidTypeMessage (name, value, expectedTypes) {
  4398. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4399. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4400. var expectedType = expectedTypes[0];
  4401. var receivedType = toRawType(value);
  4402. var expectedValue = styleValue(value, expectedType);
  4403. var receivedValue = styleValue(value, receivedType);
  4404. // check if we need to specify expected value
  4405. if (expectedTypes.length === 1 &&
  4406. isExplicable(expectedType) &&
  4407. !isBoolean(expectedType, receivedType)) {
  4408. message += " with value " + expectedValue;
  4409. }
  4410. message += ", got " + receivedType + " ";
  4411. // check if we need to specify received value
  4412. if (isExplicable(receivedType)) {
  4413. message += "with value " + receivedValue + ".";
  4414. }
  4415. return message
  4416. }
  4417. function styleValue (value, type) {
  4418. if (type === 'String') {
  4419. return ("\"" + value + "\"")
  4420. } else if (type === 'Number') {
  4421. return ("" + (Number(value)))
  4422. } else {
  4423. return ("" + value)
  4424. }
  4425. }
  4426. function isExplicable (value) {
  4427. var explicitTypes = ['string', 'number', 'boolean'];
  4428. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4429. }
  4430. function isBoolean () {
  4431. var args = [], len = arguments.length;
  4432. while ( len-- ) args[ len ] = arguments[ len ];
  4433. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4434. }
  4435. /* */
  4436. function handleError (err, vm, info) {
  4437. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4438. // See: https://github.com/vuejs/vuex/issues/1505
  4439. pushTarget();
  4440. try {
  4441. if (vm) {
  4442. var cur = vm;
  4443. while ((cur = cur.$parent)) {
  4444. var hooks = cur.$options.errorCaptured;
  4445. if (hooks) {
  4446. for (var i = 0; i < hooks.length; i++) {
  4447. try {
  4448. var capture = hooks[i].call(cur, err, vm, info) === false;
  4449. if (capture) { return }
  4450. } catch (e) {
  4451. globalHandleError(e, cur, 'errorCaptured hook');
  4452. }
  4453. }
  4454. }
  4455. }
  4456. }
  4457. globalHandleError(err, vm, info);
  4458. } finally {
  4459. popTarget();
  4460. }
  4461. }
  4462. function invokeWithErrorHandling (
  4463. handler,
  4464. context,
  4465. args,
  4466. vm,
  4467. info
  4468. ) {
  4469. var res;
  4470. try {
  4471. res = args ? handler.apply(context, args) : handler.call(context);
  4472. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4473. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4474. // issue #9511
  4475. // avoid catch triggering multiple times when nested calls
  4476. res._handled = true;
  4477. }
  4478. } catch (e) {
  4479. handleError(e, vm, info);
  4480. }
  4481. return res
  4482. }
  4483. function globalHandleError (err, vm, info) {
  4484. if (config.errorHandler) {
  4485. try {
  4486. return config.errorHandler.call(null, err, vm, info)
  4487. } catch (e) {
  4488. // if the user intentionally throws the original error in the handler,
  4489. // do not log it twice
  4490. if (e !== err) {
  4491. logError(e, null, 'config.errorHandler');
  4492. }
  4493. }
  4494. }
  4495. logError(err, vm, info);
  4496. }
  4497. function logError (err, vm, info) {
  4498. if (true) {
  4499. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4500. }
  4501. /* istanbul ignore else */
  4502. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4503. console.error(err);
  4504. } else {
  4505. throw err
  4506. }
  4507. }
  4508. /* */
  4509. var callbacks = [];
  4510. var pending = false;
  4511. function flushCallbacks () {
  4512. pending = false;
  4513. var copies = callbacks.slice(0);
  4514. callbacks.length = 0;
  4515. for (var i = 0; i < copies.length; i++) {
  4516. copies[i]();
  4517. }
  4518. }
  4519. // Here we have async deferring wrappers using microtasks.
  4520. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4521. // However, it has subtle problems when state is changed right before repaint
  4522. // (e.g. #6813, out-in transitions).
  4523. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4524. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4525. // So we now use microtasks everywhere, again.
  4526. // A major drawback of this tradeoff is that there are some scenarios
  4527. // where microtasks have too high a priority and fire in between supposedly
  4528. // sequential events (e.g. #4521, #6690, which have workarounds)
  4529. // or even between bubbling of the same event (#6566).
  4530. var timerFunc;
  4531. // The nextTick behavior leverages the microtask queue, which can be accessed
  4532. // via either native Promise.then or MutationObserver.
  4533. // MutationObserver has wider support, however it is seriously bugged in
  4534. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4535. // completely stops working after triggering a few times... so, if native
  4536. // Promise is available, we will use it:
  4537. /* istanbul ignore next, $flow-disable-line */
  4538. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4539. var p = Promise.resolve();
  4540. timerFunc = function () {
  4541. p.then(flushCallbacks);
  4542. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4543. // it can get stuck in a weird state where callbacks are pushed into the
  4544. // microtask queue but the queue isn't being flushed, until the browser
  4545. // needs to do some other work, e.g. handle a timer. Therefore we can
  4546. // "force" the microtask queue to be flushed by adding an empty timer.
  4547. if (isIOS) { setTimeout(noop); }
  4548. };
  4549. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4550. isNative(MutationObserver) ||
  4551. // PhantomJS and iOS 7.x
  4552. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4553. )) {
  4554. // Use MutationObserver where native Promise is not available,
  4555. // e.g. PhantomJS, iOS7, Android 4.4
  4556. // (#6466 MutationObserver is unreliable in IE11)
  4557. var counter = 1;
  4558. var observer = new MutationObserver(flushCallbacks);
  4559. var textNode = document.createTextNode(String(counter));
  4560. observer.observe(textNode, {
  4561. characterData: true
  4562. });
  4563. timerFunc = function () {
  4564. counter = (counter + 1) % 2;
  4565. textNode.data = String(counter);
  4566. };
  4567. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4568. // Fallback to setImmediate.
  4569. // Technically it leverages the (macro) task queue,
  4570. // but it is still a better choice than setTimeout.
  4571. timerFunc = function () {
  4572. setImmediate(flushCallbacks);
  4573. };
  4574. } else {
  4575. // Fallback to setTimeout.
  4576. timerFunc = function () {
  4577. setTimeout(flushCallbacks, 0);
  4578. };
  4579. }
  4580. function nextTick (cb, ctx) {
  4581. var _resolve;
  4582. callbacks.push(function () {
  4583. if (cb) {
  4584. try {
  4585. cb.call(ctx);
  4586. } catch (e) {
  4587. handleError(e, ctx, 'nextTick');
  4588. }
  4589. } else if (_resolve) {
  4590. _resolve(ctx);
  4591. }
  4592. });
  4593. if (!pending) {
  4594. pending = true;
  4595. timerFunc();
  4596. }
  4597. // $flow-disable-line
  4598. if (!cb && typeof Promise !== 'undefined') {
  4599. return new Promise(function (resolve) {
  4600. _resolve = resolve;
  4601. })
  4602. }
  4603. }
  4604. /* */
  4605. /* not type checking this file because flow doesn't play well with Proxy */
  4606. var initProxy;
  4607. if (true) {
  4608. var allowedGlobals = makeMap(
  4609. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4610. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4611. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4612. 'require' // for Webpack/Browserify
  4613. );
  4614. var warnNonPresent = function (target, key) {
  4615. warn(
  4616. "Property or method \"" + key + "\" is not defined on the instance but " +
  4617. 'referenced during render. Make sure that this property is reactive, ' +
  4618. 'either in the data option, or for class-based components, by ' +
  4619. 'initializing the property. ' +
  4620. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4621. target
  4622. );
  4623. };
  4624. var warnReservedPrefix = function (target, key) {
  4625. warn(
  4626. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4627. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4628. 'prevent conflicts with Vue internals. ' +
  4629. 'See: https://vuejs.org/v2/api/#data',
  4630. target
  4631. );
  4632. };
  4633. var hasProxy =
  4634. typeof Proxy !== 'undefined' && isNative(Proxy);
  4635. if (hasProxy) {
  4636. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4637. config.keyCodes = new Proxy(config.keyCodes, {
  4638. set: function set (target, key, value) {
  4639. if (isBuiltInModifier(key)) {
  4640. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4641. return false
  4642. } else {
  4643. target[key] = value;
  4644. return true
  4645. }
  4646. }
  4647. });
  4648. }
  4649. var hasHandler = {
  4650. has: function has (target, key) {
  4651. var has = key in target;
  4652. var isAllowed = allowedGlobals(key) ||
  4653. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4654. if (!has && !isAllowed) {
  4655. if (key in target.$data) { warnReservedPrefix(target, key); }
  4656. else { warnNonPresent(target, key); }
  4657. }
  4658. return has || !isAllowed
  4659. }
  4660. };
  4661. var getHandler = {
  4662. get: function get (target, key) {
  4663. if (typeof key === 'string' && !(key in target)) {
  4664. if (key in target.$data) { warnReservedPrefix(target, key); }
  4665. else { warnNonPresent(target, key); }
  4666. }
  4667. return target[key]
  4668. }
  4669. };
  4670. initProxy = function initProxy (vm) {
  4671. if (hasProxy) {
  4672. // determine which proxy handler to use
  4673. var options = vm.$options;
  4674. var handlers = options.render && options.render._withStripped
  4675. ? getHandler
  4676. : hasHandler;
  4677. vm._renderProxy = new Proxy(vm, handlers);
  4678. } else {
  4679. vm._renderProxy = vm;
  4680. }
  4681. };
  4682. }
  4683. /* */
  4684. var seenObjects = new _Set();
  4685. /**
  4686. * Recursively traverse an object to evoke all converted
  4687. * getters, so that every nested property inside the object
  4688. * is collected as a "deep" dependency.
  4689. */
  4690. function traverse (val) {
  4691. _traverse(val, seenObjects);
  4692. seenObjects.clear();
  4693. }
  4694. function _traverse (val, seen) {
  4695. var i, keys;
  4696. var isA = Array.isArray(val);
  4697. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4698. return
  4699. }
  4700. if (val.__ob__) {
  4701. var depId = val.__ob__.dep.id;
  4702. if (seen.has(depId)) {
  4703. return
  4704. }
  4705. seen.add(depId);
  4706. }
  4707. if (isA) {
  4708. i = val.length;
  4709. while (i--) { _traverse(val[i], seen); }
  4710. } else {
  4711. keys = Object.keys(val);
  4712. i = keys.length;
  4713. while (i--) { _traverse(val[keys[i]], seen); }
  4714. }
  4715. }
  4716. var mark;
  4717. var measure;
  4718. if (true) {
  4719. var perf = inBrowser && window.performance;
  4720. /* istanbul ignore if */
  4721. if (
  4722. perf &&
  4723. perf.mark &&
  4724. perf.measure &&
  4725. perf.clearMarks &&
  4726. perf.clearMeasures
  4727. ) {
  4728. mark = function (tag) { return perf.mark(tag); };
  4729. measure = function (name, startTag, endTag) {
  4730. perf.measure(name, startTag, endTag);
  4731. perf.clearMarks(startTag);
  4732. perf.clearMarks(endTag);
  4733. // perf.clearMeasures(name)
  4734. };
  4735. }
  4736. }
  4737. /* */
  4738. var normalizeEvent = cached(function (name) {
  4739. var passive = name.charAt(0) === '&';
  4740. name = passive ? name.slice(1) : name;
  4741. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4742. name = once$$1 ? name.slice(1) : name;
  4743. var capture = name.charAt(0) === '!';
  4744. name = capture ? name.slice(1) : name;
  4745. return {
  4746. name: name,
  4747. once: once$$1,
  4748. capture: capture,
  4749. passive: passive
  4750. }
  4751. });
  4752. function createFnInvoker (fns, vm) {
  4753. function invoker () {
  4754. var arguments$1 = arguments;
  4755. var fns = invoker.fns;
  4756. if (Array.isArray(fns)) {
  4757. var cloned = fns.slice();
  4758. for (var i = 0; i < cloned.length; i++) {
  4759. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4760. }
  4761. } else {
  4762. // return handler return value for single handlers
  4763. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4764. }
  4765. }
  4766. invoker.fns = fns;
  4767. return invoker
  4768. }
  4769. function updateListeners (
  4770. on,
  4771. oldOn,
  4772. add,
  4773. remove$$1,
  4774. createOnceHandler,
  4775. vm
  4776. ) {
  4777. var name, def$$1, cur, old, event;
  4778. for (name in on) {
  4779. def$$1 = cur = on[name];
  4780. old = oldOn[name];
  4781. event = normalizeEvent(name);
  4782. if (isUndef(cur)) {
  4783. true && warn(
  4784. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4785. vm
  4786. );
  4787. } else if (isUndef(old)) {
  4788. if (isUndef(cur.fns)) {
  4789. cur = on[name] = createFnInvoker(cur, vm);
  4790. }
  4791. if (isTrue(event.once)) {
  4792. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4793. }
  4794. add(event.name, cur, event.capture, event.passive, event.params);
  4795. } else if (cur !== old) {
  4796. old.fns = cur;
  4797. on[name] = old;
  4798. }
  4799. }
  4800. for (name in oldOn) {
  4801. if (isUndef(on[name])) {
  4802. event = normalizeEvent(name);
  4803. remove$$1(event.name, oldOn[name], event.capture);
  4804. }
  4805. }
  4806. }
  4807. /* */
  4808. /* */
  4809. // fixed by xxxxxx (mp properties)
  4810. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4811. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4812. if (isUndef(propOptions)) {
  4813. return res
  4814. }
  4815. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4816. var attrs = data.attrs;
  4817. var props = data.props;
  4818. if (isDef(attrs) || isDef(props)) {
  4819. for (var key in propOptions) {
  4820. var altKey = hyphenate(key);
  4821. var result = checkProp(res, props, key, altKey, true) ||
  4822. checkProp(res, attrs, key, altKey, false);
  4823. // externalClass
  4824. if (
  4825. result &&
  4826. res[key] &&
  4827. externalClasses.indexOf(altKey) !== -1 &&
  4828. context[camelize(res[key])]
  4829. ) {
  4830. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4831. res[key] = context[camelize(res[key])];
  4832. }
  4833. }
  4834. }
  4835. return res
  4836. }
  4837. function extractPropsFromVNodeData (
  4838. data,
  4839. Ctor,
  4840. tag,
  4841. context// fixed by xxxxxx
  4842. ) {
  4843. // we are only extracting raw values here.
  4844. // validation and default values are handled in the child
  4845. // component itself.
  4846. var propOptions = Ctor.options.props;
  4847. if (isUndef(propOptions)) {
  4848. // fixed by xxxxxx
  4849. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4850. }
  4851. var res = {};
  4852. var attrs = data.attrs;
  4853. var props = data.props;
  4854. if (isDef(attrs) || isDef(props)) {
  4855. for (var key in propOptions) {
  4856. var altKey = hyphenate(key);
  4857. if (true) {
  4858. var keyInLowerCase = key.toLowerCase();
  4859. if (
  4860. key !== keyInLowerCase &&
  4861. attrs && hasOwn(attrs, keyInLowerCase)
  4862. ) {
  4863. tip(
  4864. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4865. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4866. " \"" + key + "\". " +
  4867. "Note that HTML attributes are case-insensitive and camelCased " +
  4868. "props need to use their kebab-case equivalents when using in-DOM " +
  4869. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4870. );
  4871. }
  4872. }
  4873. checkProp(res, props, key, altKey, true) ||
  4874. checkProp(res, attrs, key, altKey, false);
  4875. }
  4876. }
  4877. // fixed by xxxxxx
  4878. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4879. }
  4880. function checkProp (
  4881. res,
  4882. hash,
  4883. key,
  4884. altKey,
  4885. preserve
  4886. ) {
  4887. if (isDef(hash)) {
  4888. if (hasOwn(hash, key)) {
  4889. res[key] = hash[key];
  4890. if (!preserve) {
  4891. delete hash[key];
  4892. }
  4893. return true
  4894. } else if (hasOwn(hash, altKey)) {
  4895. res[key] = hash[altKey];
  4896. if (!preserve) {
  4897. delete hash[altKey];
  4898. }
  4899. return true
  4900. }
  4901. }
  4902. return false
  4903. }
  4904. /* */
  4905. // The template compiler attempts to minimize the need for normalization by
  4906. // statically analyzing the template at compile time.
  4907. //
  4908. // For plain HTML markup, normalization can be completely skipped because the
  4909. // generated render function is guaranteed to return Array<VNode>. There are
  4910. // two cases where extra normalization is needed:
  4911. // 1. When the children contains components - because a functional component
  4912. // may return an Array instead of a single root. In this case, just a simple
  4913. // normalization is needed - if any child is an Array, we flatten the whole
  4914. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4915. // because functional components already normalize their own children.
  4916. function simpleNormalizeChildren (children) {
  4917. for (var i = 0; i < children.length; i++) {
  4918. if (Array.isArray(children[i])) {
  4919. return Array.prototype.concat.apply([], children)
  4920. }
  4921. }
  4922. return children
  4923. }
  4924. // 2. When the children contains constructs that always generated nested Arrays,
  4925. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4926. // with hand-written render functions / JSX. In such cases a full normalization
  4927. // is needed to cater to all possible types of children values.
  4928. function normalizeChildren (children) {
  4929. return isPrimitive(children)
  4930. ? [createTextVNode(children)]
  4931. : Array.isArray(children)
  4932. ? normalizeArrayChildren(children)
  4933. : undefined
  4934. }
  4935. function isTextNode (node) {
  4936. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4937. }
  4938. function normalizeArrayChildren (children, nestedIndex) {
  4939. var res = [];
  4940. var i, c, lastIndex, last;
  4941. for (i = 0; i < children.length; i++) {
  4942. c = children[i];
  4943. if (isUndef(c) || typeof c === 'boolean') { continue }
  4944. lastIndex = res.length - 1;
  4945. last = res[lastIndex];
  4946. // nested
  4947. if (Array.isArray(c)) {
  4948. if (c.length > 0) {
  4949. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4950. // merge adjacent text nodes
  4951. if (isTextNode(c[0]) && isTextNode(last)) {
  4952. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  4953. c.shift();
  4954. }
  4955. res.push.apply(res, c);
  4956. }
  4957. } else if (isPrimitive(c)) {
  4958. if (isTextNode(last)) {
  4959. // merge adjacent text nodes
  4960. // this is necessary for SSR hydration because text nodes are
  4961. // essentially merged when rendered to HTML strings
  4962. res[lastIndex] = createTextVNode(last.text + c);
  4963. } else if (c !== '') {
  4964. // convert primitive to vnode
  4965. res.push(createTextVNode(c));
  4966. }
  4967. } else {
  4968. if (isTextNode(c) && isTextNode(last)) {
  4969. // merge adjacent text nodes
  4970. res[lastIndex] = createTextVNode(last.text + c.text);
  4971. } else {
  4972. // default key for nested array children (likely generated by v-for)
  4973. if (isTrue(children._isVList) &&
  4974. isDef(c.tag) &&
  4975. isUndef(c.key) &&
  4976. isDef(nestedIndex)) {
  4977. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  4978. }
  4979. res.push(c);
  4980. }
  4981. }
  4982. }
  4983. return res
  4984. }
  4985. /* */
  4986. function initProvide (vm) {
  4987. var provide = vm.$options.provide;
  4988. if (provide) {
  4989. vm._provided = typeof provide === 'function'
  4990. ? provide.call(vm)
  4991. : provide;
  4992. }
  4993. }
  4994. function initInjections (vm) {
  4995. var result = resolveInject(vm.$options.inject, vm);
  4996. if (result) {
  4997. toggleObserving(false);
  4998. Object.keys(result).forEach(function (key) {
  4999. /* istanbul ignore else */
  5000. if (true) {
  5001. defineReactive$$1(vm, key, result[key], function () {
  5002. warn(
  5003. "Avoid mutating an injected value directly since the changes will be " +
  5004. "overwritten whenever the provided component re-renders. " +
  5005. "injection being mutated: \"" + key + "\"",
  5006. vm
  5007. );
  5008. });
  5009. } else {}
  5010. });
  5011. toggleObserving(true);
  5012. }
  5013. }
  5014. function resolveInject (inject, vm) {
  5015. if (inject) {
  5016. // inject is :any because flow is not smart enough to figure out cached
  5017. var result = Object.create(null);
  5018. var keys = hasSymbol
  5019. ? Reflect.ownKeys(inject)
  5020. : Object.keys(inject);
  5021. for (var i = 0; i < keys.length; i++) {
  5022. var key = keys[i];
  5023. // #6574 in case the inject object is observed...
  5024. if (key === '__ob__') { continue }
  5025. var provideKey = inject[key].from;
  5026. var source = vm;
  5027. while (source) {
  5028. if (source._provided && hasOwn(source._provided, provideKey)) {
  5029. result[key] = source._provided[provideKey];
  5030. break
  5031. }
  5032. source = source.$parent;
  5033. }
  5034. if (!source) {
  5035. if ('default' in inject[key]) {
  5036. var provideDefault = inject[key].default;
  5037. result[key] = typeof provideDefault === 'function'
  5038. ? provideDefault.call(vm)
  5039. : provideDefault;
  5040. } else if (true) {
  5041. warn(("Injection \"" + key + "\" not found"), vm);
  5042. }
  5043. }
  5044. }
  5045. return result
  5046. }
  5047. }
  5048. /* */
  5049. /**
  5050. * Runtime helper for resolving raw children VNodes into a slot object.
  5051. */
  5052. function resolveSlots (
  5053. children,
  5054. context
  5055. ) {
  5056. if (!children || !children.length) {
  5057. return {}
  5058. }
  5059. var slots = {};
  5060. for (var i = 0, l = children.length; i < l; i++) {
  5061. var child = children[i];
  5062. var data = child.data;
  5063. // remove slot attribute if the node is resolved as a Vue slot node
  5064. if (data && data.attrs && data.attrs.slot) {
  5065. delete data.attrs.slot;
  5066. }
  5067. // named slots should only be respected if the vnode was rendered in the
  5068. // same context.
  5069. if ((child.context === context || child.fnContext === context) &&
  5070. data && data.slot != null
  5071. ) {
  5072. var name = data.slot;
  5073. var slot = (slots[name] || (slots[name] = []));
  5074. if (child.tag === 'template') {
  5075. slot.push.apply(slot, child.children || []);
  5076. } else {
  5077. slot.push(child);
  5078. }
  5079. } else {
  5080. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5081. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5082. (slots['page'] || (slots['page'] = [])).push(child);
  5083. }else{
  5084. (slots.default || (slots.default = [])).push(child);
  5085. }
  5086. }
  5087. }
  5088. // ignore slots that contains only whitespace
  5089. for (var name$1 in slots) {
  5090. if (slots[name$1].every(isWhitespace)) {
  5091. delete slots[name$1];
  5092. }
  5093. }
  5094. return slots
  5095. }
  5096. function isWhitespace (node) {
  5097. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5098. }
  5099. /* */
  5100. function normalizeScopedSlots (
  5101. slots,
  5102. normalSlots,
  5103. prevSlots
  5104. ) {
  5105. var res;
  5106. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5107. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5108. var key = slots && slots.$key;
  5109. if (!slots) {
  5110. res = {};
  5111. } else if (slots._normalized) {
  5112. // fast path 1: child component re-render only, parent did not change
  5113. return slots._normalized
  5114. } else if (
  5115. isStable &&
  5116. prevSlots &&
  5117. prevSlots !== emptyObject &&
  5118. key === prevSlots.$key &&
  5119. !hasNormalSlots &&
  5120. !prevSlots.$hasNormal
  5121. ) {
  5122. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5123. // only need to normalize once
  5124. return prevSlots
  5125. } else {
  5126. res = {};
  5127. for (var key$1 in slots) {
  5128. if (slots[key$1] && key$1[0] !== '$') {
  5129. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5130. }
  5131. }
  5132. }
  5133. // expose normal slots on scopedSlots
  5134. for (var key$2 in normalSlots) {
  5135. if (!(key$2 in res)) {
  5136. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5137. }
  5138. }
  5139. // avoriaz seems to mock a non-extensible $scopedSlots object
  5140. // and when that is passed down this would cause an error
  5141. if (slots && Object.isExtensible(slots)) {
  5142. (slots)._normalized = res;
  5143. }
  5144. def(res, '$stable', isStable);
  5145. def(res, '$key', key);
  5146. def(res, '$hasNormal', hasNormalSlots);
  5147. return res
  5148. }
  5149. function normalizeScopedSlot(normalSlots, key, fn) {
  5150. var normalized = function () {
  5151. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5152. res = res && typeof res === 'object' && !Array.isArray(res)
  5153. ? [res] // single vnode
  5154. : normalizeChildren(res);
  5155. return res && (
  5156. res.length === 0 ||
  5157. (res.length === 1 && res[0].isComment) // #9658
  5158. ) ? undefined
  5159. : res
  5160. };
  5161. // this is a slot using the new v-slot syntax without scope. although it is
  5162. // compiled as a scoped slot, render fn users would expect it to be present
  5163. // on this.$slots because the usage is semantically a normal slot.
  5164. if (fn.proxy) {
  5165. Object.defineProperty(normalSlots, key, {
  5166. get: normalized,
  5167. enumerable: true,
  5168. configurable: true
  5169. });
  5170. }
  5171. return normalized
  5172. }
  5173. function proxyNormalSlot(slots, key) {
  5174. return function () { return slots[key]; }
  5175. }
  5176. /* */
  5177. /**
  5178. * Runtime helper for rendering v-for lists.
  5179. */
  5180. function renderList (
  5181. val,
  5182. render
  5183. ) {
  5184. var ret, i, l, keys, key;
  5185. if (Array.isArray(val) || typeof val === 'string') {
  5186. ret = new Array(val.length);
  5187. for (i = 0, l = val.length; i < l; i++) {
  5188. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5189. }
  5190. } else if (typeof val === 'number') {
  5191. ret = new Array(val);
  5192. for (i = 0; i < val; i++) {
  5193. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5194. }
  5195. } else if (isObject(val)) {
  5196. if (hasSymbol && val[Symbol.iterator]) {
  5197. ret = [];
  5198. var iterator = val[Symbol.iterator]();
  5199. var result = iterator.next();
  5200. while (!result.done) {
  5201. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5202. result = iterator.next();
  5203. }
  5204. } else {
  5205. keys = Object.keys(val);
  5206. ret = new Array(keys.length);
  5207. for (i = 0, l = keys.length; i < l; i++) {
  5208. key = keys[i];
  5209. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5210. }
  5211. }
  5212. }
  5213. if (!isDef(ret)) {
  5214. ret = [];
  5215. }
  5216. (ret)._isVList = true;
  5217. return ret
  5218. }
  5219. /* */
  5220. /**
  5221. * Runtime helper for rendering <slot>
  5222. */
  5223. function renderSlot (
  5224. name,
  5225. fallback,
  5226. props,
  5227. bindObject
  5228. ) {
  5229. var scopedSlotFn = this.$scopedSlots[name];
  5230. var nodes;
  5231. if (scopedSlotFn) { // scoped slot
  5232. props = props || {};
  5233. if (bindObject) {
  5234. if ( true && !isObject(bindObject)) {
  5235. warn(
  5236. 'slot v-bind without argument expects an Object',
  5237. this
  5238. );
  5239. }
  5240. props = extend(extend({}, bindObject), props);
  5241. }
  5242. // fixed by xxxxxx app-plus scopedSlot
  5243. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5244. } else {
  5245. nodes = this.$slots[name] || fallback;
  5246. }
  5247. var target = props && props.slot;
  5248. if (target) {
  5249. return this.$createElement('template', { slot: target }, nodes)
  5250. } else {
  5251. return nodes
  5252. }
  5253. }
  5254. /* */
  5255. /**
  5256. * Runtime helper for resolving filters
  5257. */
  5258. function resolveFilter (id) {
  5259. return resolveAsset(this.$options, 'filters', id, true) || identity
  5260. }
  5261. /* */
  5262. function isKeyNotMatch (expect, actual) {
  5263. if (Array.isArray(expect)) {
  5264. return expect.indexOf(actual) === -1
  5265. } else {
  5266. return expect !== actual
  5267. }
  5268. }
  5269. /**
  5270. * Runtime helper for checking keyCodes from config.
  5271. * exposed as Vue.prototype._k
  5272. * passing in eventKeyName as last argument separately for backwards compat
  5273. */
  5274. function checkKeyCodes (
  5275. eventKeyCode,
  5276. key,
  5277. builtInKeyCode,
  5278. eventKeyName,
  5279. builtInKeyName
  5280. ) {
  5281. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5282. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5283. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5284. } else if (mappedKeyCode) {
  5285. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5286. } else if (eventKeyName) {
  5287. return hyphenate(eventKeyName) !== key
  5288. }
  5289. }
  5290. /* */
  5291. /**
  5292. * Runtime helper for merging v-bind="object" into a VNode's data.
  5293. */
  5294. function bindObjectProps (
  5295. data,
  5296. tag,
  5297. value,
  5298. asProp,
  5299. isSync
  5300. ) {
  5301. if (value) {
  5302. if (!isObject(value)) {
  5303. true && warn(
  5304. 'v-bind without argument expects an Object or Array value',
  5305. this
  5306. );
  5307. } else {
  5308. if (Array.isArray(value)) {
  5309. value = toObject(value);
  5310. }
  5311. var hash;
  5312. var loop = function ( key ) {
  5313. if (
  5314. key === 'class' ||
  5315. key === 'style' ||
  5316. isReservedAttribute(key)
  5317. ) {
  5318. hash = data;
  5319. } else {
  5320. var type = data.attrs && data.attrs.type;
  5321. hash = asProp || config.mustUseProp(tag, type, key)
  5322. ? data.domProps || (data.domProps = {})
  5323. : data.attrs || (data.attrs = {});
  5324. }
  5325. var camelizedKey = camelize(key);
  5326. var hyphenatedKey = hyphenate(key);
  5327. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5328. hash[key] = value[key];
  5329. if (isSync) {
  5330. var on = data.on || (data.on = {});
  5331. on[("update:" + key)] = function ($event) {
  5332. value[key] = $event;
  5333. };
  5334. }
  5335. }
  5336. };
  5337. for (var key in value) loop( key );
  5338. }
  5339. }
  5340. return data
  5341. }
  5342. /* */
  5343. /**
  5344. * Runtime helper for rendering static trees.
  5345. */
  5346. function renderStatic (
  5347. index,
  5348. isInFor
  5349. ) {
  5350. var cached = this._staticTrees || (this._staticTrees = []);
  5351. var tree = cached[index];
  5352. // if has already-rendered static tree and not inside v-for,
  5353. // we can reuse the same tree.
  5354. if (tree && !isInFor) {
  5355. return tree
  5356. }
  5357. // otherwise, render a fresh tree.
  5358. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5359. this._renderProxy,
  5360. null,
  5361. this // for render fns generated for functional component templates
  5362. );
  5363. markStatic(tree, ("__static__" + index), false);
  5364. return tree
  5365. }
  5366. /**
  5367. * Runtime helper for v-once.
  5368. * Effectively it means marking the node as static with a unique key.
  5369. */
  5370. function markOnce (
  5371. tree,
  5372. index,
  5373. key
  5374. ) {
  5375. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5376. return tree
  5377. }
  5378. function markStatic (
  5379. tree,
  5380. key,
  5381. isOnce
  5382. ) {
  5383. if (Array.isArray(tree)) {
  5384. for (var i = 0; i < tree.length; i++) {
  5385. if (tree[i] && typeof tree[i] !== 'string') {
  5386. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5387. }
  5388. }
  5389. } else {
  5390. markStaticNode(tree, key, isOnce);
  5391. }
  5392. }
  5393. function markStaticNode (node, key, isOnce) {
  5394. node.isStatic = true;
  5395. node.key = key;
  5396. node.isOnce = isOnce;
  5397. }
  5398. /* */
  5399. function bindObjectListeners (data, value) {
  5400. if (value) {
  5401. if (!isPlainObject(value)) {
  5402. true && warn(
  5403. 'v-on without argument expects an Object value',
  5404. this
  5405. );
  5406. } else {
  5407. var on = data.on = data.on ? extend({}, data.on) : {};
  5408. for (var key in value) {
  5409. var existing = on[key];
  5410. var ours = value[key];
  5411. on[key] = existing ? [].concat(existing, ours) : ours;
  5412. }
  5413. }
  5414. }
  5415. return data
  5416. }
  5417. /* */
  5418. function resolveScopedSlots (
  5419. fns, // see flow/vnode
  5420. res,
  5421. // the following are added in 2.6
  5422. hasDynamicKeys,
  5423. contentHashKey
  5424. ) {
  5425. res = res || { $stable: !hasDynamicKeys };
  5426. for (var i = 0; i < fns.length; i++) {
  5427. var slot = fns[i];
  5428. if (Array.isArray(slot)) {
  5429. resolveScopedSlots(slot, res, hasDynamicKeys);
  5430. } else if (slot) {
  5431. // marker for reverse proxying v-slot without scope on this.$slots
  5432. if (slot.proxy) {
  5433. slot.fn.proxy = true;
  5434. }
  5435. res[slot.key] = slot.fn;
  5436. }
  5437. }
  5438. if (contentHashKey) {
  5439. (res).$key = contentHashKey;
  5440. }
  5441. return res
  5442. }
  5443. /* */
  5444. function bindDynamicKeys (baseObj, values) {
  5445. for (var i = 0; i < values.length; i += 2) {
  5446. var key = values[i];
  5447. if (typeof key === 'string' && key) {
  5448. baseObj[values[i]] = values[i + 1];
  5449. } else if ( true && key !== '' && key !== null) {
  5450. // null is a special value for explicitly removing a binding
  5451. warn(
  5452. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5453. this
  5454. );
  5455. }
  5456. }
  5457. return baseObj
  5458. }
  5459. // helper to dynamically append modifier runtime markers to event names.
  5460. // ensure only append when value is already string, otherwise it will be cast
  5461. // to string and cause the type check to miss.
  5462. function prependModifier (value, symbol) {
  5463. return typeof value === 'string' ? symbol + value : value
  5464. }
  5465. /* */
  5466. function installRenderHelpers (target) {
  5467. target._o = markOnce;
  5468. target._n = toNumber;
  5469. target._s = toString;
  5470. target._l = renderList;
  5471. target._t = renderSlot;
  5472. target._q = looseEqual;
  5473. target._i = looseIndexOf;
  5474. target._m = renderStatic;
  5475. target._f = resolveFilter;
  5476. target._k = checkKeyCodes;
  5477. target._b = bindObjectProps;
  5478. target._v = createTextVNode;
  5479. target._e = createEmptyVNode;
  5480. target._u = resolveScopedSlots;
  5481. target._g = bindObjectListeners;
  5482. target._d = bindDynamicKeys;
  5483. target._p = prependModifier;
  5484. }
  5485. /* */
  5486. function FunctionalRenderContext (
  5487. data,
  5488. props,
  5489. children,
  5490. parent,
  5491. Ctor
  5492. ) {
  5493. var this$1 = this;
  5494. var options = Ctor.options;
  5495. // ensure the createElement function in functional components
  5496. // gets a unique context - this is necessary for correct named slot check
  5497. var contextVm;
  5498. if (hasOwn(parent, '_uid')) {
  5499. contextVm = Object.create(parent);
  5500. // $flow-disable-line
  5501. contextVm._original = parent;
  5502. } else {
  5503. // the context vm passed in is a functional context as well.
  5504. // in this case we want to make sure we are able to get a hold to the
  5505. // real context instance.
  5506. contextVm = parent;
  5507. // $flow-disable-line
  5508. parent = parent._original;
  5509. }
  5510. var isCompiled = isTrue(options._compiled);
  5511. var needNormalization = !isCompiled;
  5512. this.data = data;
  5513. this.props = props;
  5514. this.children = children;
  5515. this.parent = parent;
  5516. this.listeners = data.on || emptyObject;
  5517. this.injections = resolveInject(options.inject, parent);
  5518. this.slots = function () {
  5519. if (!this$1.$slots) {
  5520. normalizeScopedSlots(
  5521. data.scopedSlots,
  5522. this$1.$slots = resolveSlots(children, parent)
  5523. );
  5524. }
  5525. return this$1.$slots
  5526. };
  5527. Object.defineProperty(this, 'scopedSlots', ({
  5528. enumerable: true,
  5529. get: function get () {
  5530. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5531. }
  5532. }));
  5533. // support for compiled functional template
  5534. if (isCompiled) {
  5535. // exposing $options for renderStatic()
  5536. this.$options = options;
  5537. // pre-resolve slots for renderSlot()
  5538. this.$slots = this.slots();
  5539. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5540. }
  5541. if (options._scopeId) {
  5542. this._c = function (a, b, c, d) {
  5543. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5544. if (vnode && !Array.isArray(vnode)) {
  5545. vnode.fnScopeId = options._scopeId;
  5546. vnode.fnContext = parent;
  5547. }
  5548. return vnode
  5549. };
  5550. } else {
  5551. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5552. }
  5553. }
  5554. installRenderHelpers(FunctionalRenderContext.prototype);
  5555. function createFunctionalComponent (
  5556. Ctor,
  5557. propsData,
  5558. data,
  5559. contextVm,
  5560. children
  5561. ) {
  5562. var options = Ctor.options;
  5563. var props = {};
  5564. var propOptions = options.props;
  5565. if (isDef(propOptions)) {
  5566. for (var key in propOptions) {
  5567. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5568. }
  5569. } else {
  5570. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5571. if (isDef(data.props)) { mergeProps(props, data.props); }
  5572. }
  5573. var renderContext = new FunctionalRenderContext(
  5574. data,
  5575. props,
  5576. children,
  5577. contextVm,
  5578. Ctor
  5579. );
  5580. var vnode = options.render.call(null, renderContext._c, renderContext);
  5581. if (vnode instanceof VNode) {
  5582. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5583. } else if (Array.isArray(vnode)) {
  5584. var vnodes = normalizeChildren(vnode) || [];
  5585. var res = new Array(vnodes.length);
  5586. for (var i = 0; i < vnodes.length; i++) {
  5587. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5588. }
  5589. return res
  5590. }
  5591. }
  5592. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5593. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5594. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5595. // that should not be matched to match.
  5596. var clone = cloneVNode(vnode);
  5597. clone.fnContext = contextVm;
  5598. clone.fnOptions = options;
  5599. if (true) {
  5600. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5601. }
  5602. if (data.slot) {
  5603. (clone.data || (clone.data = {})).slot = data.slot;
  5604. }
  5605. return clone
  5606. }
  5607. function mergeProps (to, from) {
  5608. for (var key in from) {
  5609. to[camelize(key)] = from[key];
  5610. }
  5611. }
  5612. /* */
  5613. /* */
  5614. /* */
  5615. /* */
  5616. // inline hooks to be invoked on component VNodes during patch
  5617. var componentVNodeHooks = {
  5618. init: function init (vnode, hydrating) {
  5619. if (
  5620. vnode.componentInstance &&
  5621. !vnode.componentInstance._isDestroyed &&
  5622. vnode.data.keepAlive
  5623. ) {
  5624. // kept-alive components, treat as a patch
  5625. var mountedNode = vnode; // work around flow
  5626. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5627. } else {
  5628. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5629. vnode,
  5630. activeInstance
  5631. );
  5632. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5633. }
  5634. },
  5635. prepatch: function prepatch (oldVnode, vnode) {
  5636. var options = vnode.componentOptions;
  5637. var child = vnode.componentInstance = oldVnode.componentInstance;
  5638. updateChildComponent(
  5639. child,
  5640. options.propsData, // updated props
  5641. options.listeners, // updated listeners
  5642. vnode, // new parent vnode
  5643. options.children // new children
  5644. );
  5645. },
  5646. insert: function insert (vnode) {
  5647. var context = vnode.context;
  5648. var componentInstance = vnode.componentInstance;
  5649. if (!componentInstance._isMounted) {
  5650. callHook(componentInstance, 'onServiceCreated');
  5651. callHook(componentInstance, 'onServiceAttached');
  5652. componentInstance._isMounted = true;
  5653. callHook(componentInstance, 'mounted');
  5654. }
  5655. if (vnode.data.keepAlive) {
  5656. if (context._isMounted) {
  5657. // vue-router#1212
  5658. // During updates, a kept-alive component's child components may
  5659. // change, so directly walking the tree here may call activated hooks
  5660. // on incorrect children. Instead we push them into a queue which will
  5661. // be processed after the whole patch process ended.
  5662. queueActivatedComponent(componentInstance);
  5663. } else {
  5664. activateChildComponent(componentInstance, true /* direct */);
  5665. }
  5666. }
  5667. },
  5668. destroy: function destroy (vnode) {
  5669. var componentInstance = vnode.componentInstance;
  5670. if (!componentInstance._isDestroyed) {
  5671. if (!vnode.data.keepAlive) {
  5672. componentInstance.$destroy();
  5673. } else {
  5674. deactivateChildComponent(componentInstance, true /* direct */);
  5675. }
  5676. }
  5677. }
  5678. };
  5679. var hooksToMerge = Object.keys(componentVNodeHooks);
  5680. function createComponent (
  5681. Ctor,
  5682. data,
  5683. context,
  5684. children,
  5685. tag
  5686. ) {
  5687. if (isUndef(Ctor)) {
  5688. return
  5689. }
  5690. var baseCtor = context.$options._base;
  5691. // plain options object: turn it into a constructor
  5692. if (isObject(Ctor)) {
  5693. Ctor = baseCtor.extend(Ctor);
  5694. }
  5695. // if at this stage it's not a constructor or an async component factory,
  5696. // reject.
  5697. if (typeof Ctor !== 'function') {
  5698. if (true) {
  5699. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5700. }
  5701. return
  5702. }
  5703. // async component
  5704. var asyncFactory;
  5705. if (isUndef(Ctor.cid)) {
  5706. asyncFactory = Ctor;
  5707. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5708. if (Ctor === undefined) {
  5709. // return a placeholder node for async component, which is rendered
  5710. // as a comment node but preserves all the raw information for the node.
  5711. // the information will be used for async server-rendering and hydration.
  5712. return createAsyncPlaceholder(
  5713. asyncFactory,
  5714. data,
  5715. context,
  5716. children,
  5717. tag
  5718. )
  5719. }
  5720. }
  5721. data = data || {};
  5722. // resolve constructor options in case global mixins are applied after
  5723. // component constructor creation
  5724. resolveConstructorOptions(Ctor);
  5725. // transform component v-model data into props & events
  5726. if (isDef(data.model)) {
  5727. transformModel(Ctor.options, data);
  5728. }
  5729. // extract props
  5730. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5731. // functional component
  5732. if (isTrue(Ctor.options.functional)) {
  5733. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5734. }
  5735. // extract listeners, since these needs to be treated as
  5736. // child component listeners instead of DOM listeners
  5737. var listeners = data.on;
  5738. // replace with listeners with .native modifier
  5739. // so it gets processed during parent component patch.
  5740. data.on = data.nativeOn;
  5741. if (isTrue(Ctor.options.abstract)) {
  5742. // abstract components do not keep anything
  5743. // other than props & listeners & slot
  5744. // work around flow
  5745. var slot = data.slot;
  5746. data = {};
  5747. if (slot) {
  5748. data.slot = slot;
  5749. }
  5750. }
  5751. // install component management hooks onto the placeholder node
  5752. installComponentHooks(data);
  5753. // return a placeholder vnode
  5754. var name = Ctor.options.name || tag;
  5755. var vnode = new VNode(
  5756. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5757. data, undefined, undefined, undefined, context,
  5758. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5759. asyncFactory
  5760. );
  5761. return vnode
  5762. }
  5763. function createComponentInstanceForVnode (
  5764. vnode, // we know it's MountedComponentVNode but flow doesn't
  5765. parent // activeInstance in lifecycle state
  5766. ) {
  5767. var options = {
  5768. _isComponent: true,
  5769. _parentVnode: vnode,
  5770. parent: parent
  5771. };
  5772. // check inline-template render functions
  5773. var inlineTemplate = vnode.data.inlineTemplate;
  5774. if (isDef(inlineTemplate)) {
  5775. options.render = inlineTemplate.render;
  5776. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5777. }
  5778. return new vnode.componentOptions.Ctor(options)
  5779. }
  5780. function installComponentHooks (data) {
  5781. var hooks = data.hook || (data.hook = {});
  5782. for (var i = 0; i < hooksToMerge.length; i++) {
  5783. var key = hooksToMerge[i];
  5784. var existing = hooks[key];
  5785. var toMerge = componentVNodeHooks[key];
  5786. if (existing !== toMerge && !(existing && existing._merged)) {
  5787. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5788. }
  5789. }
  5790. }
  5791. function mergeHook$1 (f1, f2) {
  5792. var merged = function (a, b) {
  5793. // flow complains about extra args which is why we use any
  5794. f1(a, b);
  5795. f2(a, b);
  5796. };
  5797. merged._merged = true;
  5798. return merged
  5799. }
  5800. // transform component v-model info (value and callback) into
  5801. // prop and event handler respectively.
  5802. function transformModel (options, data) {
  5803. var prop = (options.model && options.model.prop) || 'value';
  5804. var event = (options.model && options.model.event) || 'input'
  5805. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5806. var on = data.on || (data.on = {});
  5807. var existing = on[event];
  5808. var callback = data.model.callback;
  5809. if (isDef(existing)) {
  5810. if (
  5811. Array.isArray(existing)
  5812. ? existing.indexOf(callback) === -1
  5813. : existing !== callback
  5814. ) {
  5815. on[event] = [callback].concat(existing);
  5816. }
  5817. } else {
  5818. on[event] = callback;
  5819. }
  5820. }
  5821. /* */
  5822. var SIMPLE_NORMALIZE = 1;
  5823. var ALWAYS_NORMALIZE = 2;
  5824. // wrapper function for providing a more flexible interface
  5825. // without getting yelled at by flow
  5826. function createElement (
  5827. context,
  5828. tag,
  5829. data,
  5830. children,
  5831. normalizationType,
  5832. alwaysNormalize
  5833. ) {
  5834. if (Array.isArray(data) || isPrimitive(data)) {
  5835. normalizationType = children;
  5836. children = data;
  5837. data = undefined;
  5838. }
  5839. if (isTrue(alwaysNormalize)) {
  5840. normalizationType = ALWAYS_NORMALIZE;
  5841. }
  5842. return _createElement(context, tag, data, children, normalizationType)
  5843. }
  5844. function _createElement (
  5845. context,
  5846. tag,
  5847. data,
  5848. children,
  5849. normalizationType
  5850. ) {
  5851. if (isDef(data) && isDef((data).__ob__)) {
  5852. true && warn(
  5853. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5854. 'Always create fresh vnode data objects in each render!',
  5855. context
  5856. );
  5857. return createEmptyVNode()
  5858. }
  5859. // object syntax in v-bind
  5860. if (isDef(data) && isDef(data.is)) {
  5861. tag = data.is;
  5862. }
  5863. if (!tag) {
  5864. // in case of component :is set to falsy value
  5865. return createEmptyVNode()
  5866. }
  5867. // warn against non-primitive key
  5868. if ( true &&
  5869. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5870. ) {
  5871. {
  5872. warn(
  5873. 'Avoid using non-primitive value as key, ' +
  5874. 'use string/number value instead.',
  5875. context
  5876. );
  5877. }
  5878. }
  5879. // support single function children as default scoped slot
  5880. if (Array.isArray(children) &&
  5881. typeof children[0] === 'function'
  5882. ) {
  5883. data = data || {};
  5884. data.scopedSlots = { default: children[0] };
  5885. children.length = 0;
  5886. }
  5887. if (normalizationType === ALWAYS_NORMALIZE) {
  5888. children = normalizeChildren(children);
  5889. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5890. children = simpleNormalizeChildren(children);
  5891. }
  5892. var vnode, ns;
  5893. if (typeof tag === 'string') {
  5894. var Ctor;
  5895. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5896. if (config.isReservedTag(tag)) {
  5897. // platform built-in elements
  5898. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5899. warn(
  5900. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5901. context
  5902. );
  5903. }
  5904. vnode = new VNode(
  5905. config.parsePlatformTagName(tag), data, children,
  5906. undefined, undefined, context
  5907. );
  5908. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5909. // component
  5910. vnode = createComponent(Ctor, data, context, children, tag);
  5911. } else {
  5912. // unknown or unlisted namespaced elements
  5913. // check at runtime because it may get assigned a namespace when its
  5914. // parent normalizes children
  5915. vnode = new VNode(
  5916. tag, data, children,
  5917. undefined, undefined, context
  5918. );
  5919. }
  5920. } else {
  5921. // direct component options / constructor
  5922. vnode = createComponent(tag, data, context, children);
  5923. }
  5924. if (Array.isArray(vnode)) {
  5925. return vnode
  5926. } else if (isDef(vnode)) {
  5927. if (isDef(ns)) { applyNS(vnode, ns); }
  5928. if (isDef(data)) { registerDeepBindings(data); }
  5929. return vnode
  5930. } else {
  5931. return createEmptyVNode()
  5932. }
  5933. }
  5934. function applyNS (vnode, ns, force) {
  5935. vnode.ns = ns;
  5936. if (vnode.tag === 'foreignObject') {
  5937. // use default namespace inside foreignObject
  5938. ns = undefined;
  5939. force = true;
  5940. }
  5941. if (isDef(vnode.children)) {
  5942. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5943. var child = vnode.children[i];
  5944. if (isDef(child.tag) && (
  5945. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5946. applyNS(child, ns, force);
  5947. }
  5948. }
  5949. }
  5950. }
  5951. // ref #5318
  5952. // necessary to ensure parent re-render when deep bindings like :style and
  5953. // :class are used on slot nodes
  5954. function registerDeepBindings (data) {
  5955. if (isObject(data.style)) {
  5956. traverse(data.style);
  5957. }
  5958. if (isObject(data.class)) {
  5959. traverse(data.class);
  5960. }
  5961. }
  5962. /* */
  5963. function initRender (vm) {
  5964. vm._vnode = null; // the root of the child tree
  5965. vm._staticTrees = null; // v-once cached trees
  5966. var options = vm.$options;
  5967. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  5968. var renderContext = parentVnode && parentVnode.context;
  5969. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  5970. vm.$scopedSlots = emptyObject;
  5971. // bind the createElement fn to this instance
  5972. // so that we get proper render context inside it.
  5973. // args order: tag, data, children, normalizationType, alwaysNormalize
  5974. // internal version is used by render functions compiled from templates
  5975. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  5976. // normalization is always applied for the public version, used in
  5977. // user-written render functions.
  5978. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  5979. // $attrs & $listeners are exposed for easier HOC creation.
  5980. // they need to be reactive so that HOCs using them are always updated
  5981. var parentData = parentVnode && parentVnode.data;
  5982. /* istanbul ignore else */
  5983. if (true) {
  5984. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  5985. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  5986. }, true);
  5987. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  5988. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  5989. }, true);
  5990. } else {}
  5991. }
  5992. var currentRenderingInstance = null;
  5993. function renderMixin (Vue) {
  5994. // install runtime convenience helpers
  5995. installRenderHelpers(Vue.prototype);
  5996. Vue.prototype.$nextTick = function (fn) {
  5997. return nextTick(fn, this)
  5998. };
  5999. Vue.prototype._render = function () {
  6000. var vm = this;
  6001. var ref = vm.$options;
  6002. var render = ref.render;
  6003. var _parentVnode = ref._parentVnode;
  6004. if (_parentVnode) {
  6005. vm.$scopedSlots = normalizeScopedSlots(
  6006. _parentVnode.data.scopedSlots,
  6007. vm.$slots,
  6008. vm.$scopedSlots
  6009. );
  6010. }
  6011. // set parent vnode. this allows render functions to have access
  6012. // to the data on the placeholder node.
  6013. vm.$vnode = _parentVnode;
  6014. // render self
  6015. var vnode;
  6016. try {
  6017. // There's no need to maintain a stack because all render fns are called
  6018. // separately from one another. Nested component's render fns are called
  6019. // when parent component is patched.
  6020. currentRenderingInstance = vm;
  6021. vnode = render.call(vm._renderProxy, vm.$createElement);
  6022. } catch (e) {
  6023. handleError(e, vm, "render");
  6024. // return error render result,
  6025. // or previous vnode to prevent render error causing blank component
  6026. /* istanbul ignore else */
  6027. if ( true && vm.$options.renderError) {
  6028. try {
  6029. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6030. } catch (e) {
  6031. handleError(e, vm, "renderError");
  6032. vnode = vm._vnode;
  6033. }
  6034. } else {
  6035. vnode = vm._vnode;
  6036. }
  6037. } finally {
  6038. currentRenderingInstance = null;
  6039. }
  6040. // if the returned array contains only a single node, allow it
  6041. if (Array.isArray(vnode) && vnode.length === 1) {
  6042. vnode = vnode[0];
  6043. }
  6044. // return empty vnode in case the render function errored out
  6045. if (!(vnode instanceof VNode)) {
  6046. if ( true && Array.isArray(vnode)) {
  6047. warn(
  6048. 'Multiple root nodes returned from render function. Render function ' +
  6049. 'should return a single root node.',
  6050. vm
  6051. );
  6052. }
  6053. vnode = createEmptyVNode();
  6054. }
  6055. // set parent
  6056. vnode.parent = _parentVnode;
  6057. return vnode
  6058. };
  6059. }
  6060. /* */
  6061. function ensureCtor (comp, base) {
  6062. if (
  6063. comp.__esModule ||
  6064. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6065. ) {
  6066. comp = comp.default;
  6067. }
  6068. return isObject(comp)
  6069. ? base.extend(comp)
  6070. : comp
  6071. }
  6072. function createAsyncPlaceholder (
  6073. factory,
  6074. data,
  6075. context,
  6076. children,
  6077. tag
  6078. ) {
  6079. var node = createEmptyVNode();
  6080. node.asyncFactory = factory;
  6081. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6082. return node
  6083. }
  6084. function resolveAsyncComponent (
  6085. factory,
  6086. baseCtor
  6087. ) {
  6088. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6089. return factory.errorComp
  6090. }
  6091. if (isDef(factory.resolved)) {
  6092. return factory.resolved
  6093. }
  6094. var owner = currentRenderingInstance;
  6095. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6096. // already pending
  6097. factory.owners.push(owner);
  6098. }
  6099. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6100. return factory.loadingComp
  6101. }
  6102. if (owner && !isDef(factory.owners)) {
  6103. var owners = factory.owners = [owner];
  6104. var sync = true;
  6105. var timerLoading = null;
  6106. var timerTimeout = null
  6107. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6108. var forceRender = function (renderCompleted) {
  6109. for (var i = 0, l = owners.length; i < l; i++) {
  6110. (owners[i]).$forceUpdate();
  6111. }
  6112. if (renderCompleted) {
  6113. owners.length = 0;
  6114. if (timerLoading !== null) {
  6115. clearTimeout(timerLoading);
  6116. timerLoading = null;
  6117. }
  6118. if (timerTimeout !== null) {
  6119. clearTimeout(timerTimeout);
  6120. timerTimeout = null;
  6121. }
  6122. }
  6123. };
  6124. var resolve = once(function (res) {
  6125. // cache resolved
  6126. factory.resolved = ensureCtor(res, baseCtor);
  6127. // invoke callbacks only if this is not a synchronous resolve
  6128. // (async resolves are shimmed as synchronous during SSR)
  6129. if (!sync) {
  6130. forceRender(true);
  6131. } else {
  6132. owners.length = 0;
  6133. }
  6134. });
  6135. var reject = once(function (reason) {
  6136. true && warn(
  6137. "Failed to resolve async component: " + (String(factory)) +
  6138. (reason ? ("\nReason: " + reason) : '')
  6139. );
  6140. if (isDef(factory.errorComp)) {
  6141. factory.error = true;
  6142. forceRender(true);
  6143. }
  6144. });
  6145. var res = factory(resolve, reject);
  6146. if (isObject(res)) {
  6147. if (isPromise(res)) {
  6148. // () => Promise
  6149. if (isUndef(factory.resolved)) {
  6150. res.then(resolve, reject);
  6151. }
  6152. } else if (isPromise(res.component)) {
  6153. res.component.then(resolve, reject);
  6154. if (isDef(res.error)) {
  6155. factory.errorComp = ensureCtor(res.error, baseCtor);
  6156. }
  6157. if (isDef(res.loading)) {
  6158. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6159. if (res.delay === 0) {
  6160. factory.loading = true;
  6161. } else {
  6162. timerLoading = setTimeout(function () {
  6163. timerLoading = null;
  6164. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6165. factory.loading = true;
  6166. forceRender(false);
  6167. }
  6168. }, res.delay || 200);
  6169. }
  6170. }
  6171. if (isDef(res.timeout)) {
  6172. timerTimeout = setTimeout(function () {
  6173. timerTimeout = null;
  6174. if (isUndef(factory.resolved)) {
  6175. reject(
  6176. true
  6177. ? ("timeout (" + (res.timeout) + "ms)")
  6178. : undefined
  6179. );
  6180. }
  6181. }, res.timeout);
  6182. }
  6183. }
  6184. }
  6185. sync = false;
  6186. // return in case resolved synchronously
  6187. return factory.loading
  6188. ? factory.loadingComp
  6189. : factory.resolved
  6190. }
  6191. }
  6192. /* */
  6193. function isAsyncPlaceholder (node) {
  6194. return node.isComment && node.asyncFactory
  6195. }
  6196. /* */
  6197. function getFirstComponentChild (children) {
  6198. if (Array.isArray(children)) {
  6199. for (var i = 0; i < children.length; i++) {
  6200. var c = children[i];
  6201. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6202. return c
  6203. }
  6204. }
  6205. }
  6206. }
  6207. /* */
  6208. /* */
  6209. function initEvents (vm) {
  6210. vm._events = Object.create(null);
  6211. vm._hasHookEvent = false;
  6212. // init parent attached events
  6213. var listeners = vm.$options._parentListeners;
  6214. if (listeners) {
  6215. updateComponentListeners(vm, listeners);
  6216. }
  6217. }
  6218. var target;
  6219. function add (event, fn) {
  6220. target.$on(event, fn);
  6221. }
  6222. function remove$1 (event, fn) {
  6223. target.$off(event, fn);
  6224. }
  6225. function createOnceHandler (event, fn) {
  6226. var _target = target;
  6227. return function onceHandler () {
  6228. var res = fn.apply(null, arguments);
  6229. if (res !== null) {
  6230. _target.$off(event, onceHandler);
  6231. }
  6232. }
  6233. }
  6234. function updateComponentListeners (
  6235. vm,
  6236. listeners,
  6237. oldListeners
  6238. ) {
  6239. target = vm;
  6240. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6241. target = undefined;
  6242. }
  6243. function eventsMixin (Vue) {
  6244. var hookRE = /^hook:/;
  6245. Vue.prototype.$on = function (event, fn) {
  6246. var vm = this;
  6247. if (Array.isArray(event)) {
  6248. for (var i = 0, l = event.length; i < l; i++) {
  6249. vm.$on(event[i], fn);
  6250. }
  6251. } else {
  6252. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6253. // optimize hook:event cost by using a boolean flag marked at registration
  6254. // instead of a hash lookup
  6255. if (hookRE.test(event)) {
  6256. vm._hasHookEvent = true;
  6257. }
  6258. }
  6259. return vm
  6260. };
  6261. Vue.prototype.$once = function (event, fn) {
  6262. var vm = this;
  6263. function on () {
  6264. vm.$off(event, on);
  6265. fn.apply(vm, arguments);
  6266. }
  6267. on.fn = fn;
  6268. vm.$on(event, on);
  6269. return vm
  6270. };
  6271. Vue.prototype.$off = function (event, fn) {
  6272. var vm = this;
  6273. // all
  6274. if (!arguments.length) {
  6275. vm._events = Object.create(null);
  6276. return vm
  6277. }
  6278. // array of events
  6279. if (Array.isArray(event)) {
  6280. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6281. vm.$off(event[i$1], fn);
  6282. }
  6283. return vm
  6284. }
  6285. // specific event
  6286. var cbs = vm._events[event];
  6287. if (!cbs) {
  6288. return vm
  6289. }
  6290. if (!fn) {
  6291. vm._events[event] = null;
  6292. return vm
  6293. }
  6294. // specific handler
  6295. var cb;
  6296. var i = cbs.length;
  6297. while (i--) {
  6298. cb = cbs[i];
  6299. if (cb === fn || cb.fn === fn) {
  6300. cbs.splice(i, 1);
  6301. break
  6302. }
  6303. }
  6304. return vm
  6305. };
  6306. Vue.prototype.$emit = function (event) {
  6307. var vm = this;
  6308. if (true) {
  6309. var lowerCaseEvent = event.toLowerCase();
  6310. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6311. tip(
  6312. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6313. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6314. "Note that HTML attributes are case-insensitive and you cannot use " +
  6315. "v-on to listen to camelCase events when using in-DOM templates. " +
  6316. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6317. );
  6318. }
  6319. }
  6320. var cbs = vm._events[event];
  6321. if (cbs) {
  6322. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6323. var args = toArray(arguments, 1);
  6324. var info = "event handler for \"" + event + "\"";
  6325. for (var i = 0, l = cbs.length; i < l; i++) {
  6326. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6327. }
  6328. }
  6329. return vm
  6330. };
  6331. }
  6332. /* */
  6333. var activeInstance = null;
  6334. var isUpdatingChildComponent = false;
  6335. function setActiveInstance(vm) {
  6336. var prevActiveInstance = activeInstance;
  6337. activeInstance = vm;
  6338. return function () {
  6339. activeInstance = prevActiveInstance;
  6340. }
  6341. }
  6342. function initLifecycle (vm) {
  6343. var options = vm.$options;
  6344. // locate first non-abstract parent
  6345. var parent = options.parent;
  6346. if (parent && !options.abstract) {
  6347. while (parent.$options.abstract && parent.$parent) {
  6348. parent = parent.$parent;
  6349. }
  6350. parent.$children.push(vm);
  6351. }
  6352. vm.$parent = parent;
  6353. vm.$root = parent ? parent.$root : vm;
  6354. vm.$children = [];
  6355. vm.$refs = {};
  6356. vm._watcher = null;
  6357. vm._inactive = null;
  6358. vm._directInactive = false;
  6359. vm._isMounted = false;
  6360. vm._isDestroyed = false;
  6361. vm._isBeingDestroyed = false;
  6362. }
  6363. function lifecycleMixin (Vue) {
  6364. Vue.prototype._update = function (vnode, hydrating) {
  6365. var vm = this;
  6366. var prevEl = vm.$el;
  6367. var prevVnode = vm._vnode;
  6368. var restoreActiveInstance = setActiveInstance(vm);
  6369. vm._vnode = vnode;
  6370. // Vue.prototype.__patch__ is injected in entry points
  6371. // based on the rendering backend used.
  6372. if (!prevVnode) {
  6373. // initial render
  6374. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6375. } else {
  6376. // updates
  6377. vm.$el = vm.__patch__(prevVnode, vnode);
  6378. }
  6379. restoreActiveInstance();
  6380. // update __vue__ reference
  6381. if (prevEl) {
  6382. prevEl.__vue__ = null;
  6383. }
  6384. if (vm.$el) {
  6385. vm.$el.__vue__ = vm;
  6386. }
  6387. // if parent is an HOC, update its $el as well
  6388. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6389. vm.$parent.$el = vm.$el;
  6390. }
  6391. // updated hook is called by the scheduler to ensure that children are
  6392. // updated in a parent's updated hook.
  6393. };
  6394. Vue.prototype.$forceUpdate = function () {
  6395. var vm = this;
  6396. if (vm._watcher) {
  6397. vm._watcher.update();
  6398. }
  6399. };
  6400. Vue.prototype.$destroy = function () {
  6401. var vm = this;
  6402. if (vm._isBeingDestroyed) {
  6403. return
  6404. }
  6405. callHook(vm, 'beforeDestroy');
  6406. vm._isBeingDestroyed = true;
  6407. // remove self from parent
  6408. var parent = vm.$parent;
  6409. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6410. remove(parent.$children, vm);
  6411. }
  6412. // teardown watchers
  6413. if (vm._watcher) {
  6414. vm._watcher.teardown();
  6415. }
  6416. var i = vm._watchers.length;
  6417. while (i--) {
  6418. vm._watchers[i].teardown();
  6419. }
  6420. // remove reference from data ob
  6421. // frozen object may not have observer.
  6422. if (vm._data.__ob__) {
  6423. vm._data.__ob__.vmCount--;
  6424. }
  6425. // call the last hook...
  6426. vm._isDestroyed = true;
  6427. // invoke destroy hooks on current rendered tree
  6428. vm.__patch__(vm._vnode, null);
  6429. // fire destroyed hook
  6430. callHook(vm, 'destroyed');
  6431. // turn off all instance listeners.
  6432. vm.$off();
  6433. // remove __vue__ reference
  6434. if (vm.$el) {
  6435. vm.$el.__vue__ = null;
  6436. }
  6437. // release circular reference (#6759)
  6438. if (vm.$vnode) {
  6439. vm.$vnode.parent = null;
  6440. }
  6441. };
  6442. }
  6443. function updateChildComponent (
  6444. vm,
  6445. propsData,
  6446. listeners,
  6447. parentVnode,
  6448. renderChildren
  6449. ) {
  6450. if (true) {
  6451. isUpdatingChildComponent = true;
  6452. }
  6453. // determine whether component has slot children
  6454. // we need to do this before overwriting $options._renderChildren.
  6455. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6456. // dynamic slot names). Static scoped slots compiled from template has the
  6457. // "$stable" marker.
  6458. var newScopedSlots = parentVnode.data.scopedSlots;
  6459. var oldScopedSlots = vm.$scopedSlots;
  6460. var hasDynamicScopedSlot = !!(
  6461. (newScopedSlots && !newScopedSlots.$stable) ||
  6462. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6463. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6464. );
  6465. // Any static slot children from the parent may have changed during parent's
  6466. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6467. // update is necessary to ensure correctness.
  6468. var needsForceUpdate = !!(
  6469. renderChildren || // has new static slots
  6470. vm.$options._renderChildren || // has old static slots
  6471. hasDynamicScopedSlot
  6472. );
  6473. vm.$options._parentVnode = parentVnode;
  6474. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6475. if (vm._vnode) { // update child tree's parent
  6476. vm._vnode.parent = parentVnode;
  6477. }
  6478. vm.$options._renderChildren = renderChildren;
  6479. // update $attrs and $listeners hash
  6480. // these are also reactive so they may trigger child update if the child
  6481. // used them during render
  6482. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6483. vm.$listeners = listeners || emptyObject;
  6484. // update props
  6485. if (propsData && vm.$options.props) {
  6486. toggleObserving(false);
  6487. var props = vm._props;
  6488. var propKeys = vm.$options._propKeys || [];
  6489. for (var i = 0; i < propKeys.length; i++) {
  6490. var key = propKeys[i];
  6491. var propOptions = vm.$options.props; // wtf flow?
  6492. props[key] = validateProp(key, propOptions, propsData, vm);
  6493. }
  6494. toggleObserving(true);
  6495. // keep a copy of raw propsData
  6496. vm.$options.propsData = propsData;
  6497. }
  6498. // fixed by xxxxxx update properties(mp runtime)
  6499. vm._$updateProperties && vm._$updateProperties(vm);
  6500. // update listeners
  6501. listeners = listeners || emptyObject;
  6502. var oldListeners = vm.$options._parentListeners;
  6503. vm.$options._parentListeners = listeners;
  6504. updateComponentListeners(vm, listeners, oldListeners);
  6505. // resolve slots + force update if has children
  6506. if (needsForceUpdate) {
  6507. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6508. vm.$forceUpdate();
  6509. }
  6510. if (true) {
  6511. isUpdatingChildComponent = false;
  6512. }
  6513. }
  6514. function isInInactiveTree (vm) {
  6515. while (vm && (vm = vm.$parent)) {
  6516. if (vm._inactive) { return true }
  6517. }
  6518. return false
  6519. }
  6520. function activateChildComponent (vm, direct) {
  6521. if (direct) {
  6522. vm._directInactive = false;
  6523. if (isInInactiveTree(vm)) {
  6524. return
  6525. }
  6526. } else if (vm._directInactive) {
  6527. return
  6528. }
  6529. if (vm._inactive || vm._inactive === null) {
  6530. vm._inactive = false;
  6531. for (var i = 0; i < vm.$children.length; i++) {
  6532. activateChildComponent(vm.$children[i]);
  6533. }
  6534. callHook(vm, 'activated');
  6535. }
  6536. }
  6537. function deactivateChildComponent (vm, direct) {
  6538. if (direct) {
  6539. vm._directInactive = true;
  6540. if (isInInactiveTree(vm)) {
  6541. return
  6542. }
  6543. }
  6544. if (!vm._inactive) {
  6545. vm._inactive = true;
  6546. for (var i = 0; i < vm.$children.length; i++) {
  6547. deactivateChildComponent(vm.$children[i]);
  6548. }
  6549. callHook(vm, 'deactivated');
  6550. }
  6551. }
  6552. function callHook (vm, hook) {
  6553. // #7573 disable dep collection when invoking lifecycle hooks
  6554. pushTarget();
  6555. var handlers = vm.$options[hook];
  6556. var info = hook + " hook";
  6557. if (handlers) {
  6558. for (var i = 0, j = handlers.length; i < j; i++) {
  6559. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6560. }
  6561. }
  6562. if (vm._hasHookEvent) {
  6563. vm.$emit('hook:' + hook);
  6564. }
  6565. popTarget();
  6566. }
  6567. /* */
  6568. var MAX_UPDATE_COUNT = 100;
  6569. var queue = [];
  6570. var activatedChildren = [];
  6571. var has = {};
  6572. var circular = {};
  6573. var waiting = false;
  6574. var flushing = false;
  6575. var index = 0;
  6576. /**
  6577. * Reset the scheduler's state.
  6578. */
  6579. function resetSchedulerState () {
  6580. index = queue.length = activatedChildren.length = 0;
  6581. has = {};
  6582. if (true) {
  6583. circular = {};
  6584. }
  6585. waiting = flushing = false;
  6586. }
  6587. // Async edge case #6566 requires saving the timestamp when event listeners are
  6588. // attached. However, calling performance.now() has a perf overhead especially
  6589. // if the page has thousands of event listeners. Instead, we take a timestamp
  6590. // every time the scheduler flushes and use that for all event listeners
  6591. // attached during that flush.
  6592. var currentFlushTimestamp = 0;
  6593. // Async edge case fix requires storing an event listener's attach timestamp.
  6594. var getNow = Date.now;
  6595. // Determine what event timestamp the browser is using. Annoyingly, the
  6596. // timestamp can either be hi-res (relative to page load) or low-res
  6597. // (relative to UNIX epoch), so in order to compare time we have to use the
  6598. // same timestamp type when saving the flush timestamp.
  6599. // All IE versions use low-res event timestamps, and have problematic clock
  6600. // implementations (#9632)
  6601. if (inBrowser && !isIE) {
  6602. var performance = window.performance;
  6603. if (
  6604. performance &&
  6605. typeof performance.now === 'function' &&
  6606. getNow() > document.createEvent('Event').timeStamp
  6607. ) {
  6608. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6609. // smaller than it, it means the event is using a hi-res timestamp,
  6610. // and we need to use the hi-res version for event listener timestamps as
  6611. // well.
  6612. getNow = function () { return performance.now(); };
  6613. }
  6614. }
  6615. /**
  6616. * Flush both queues and run the watchers.
  6617. */
  6618. function flushSchedulerQueue () {
  6619. currentFlushTimestamp = getNow();
  6620. flushing = true;
  6621. var watcher, id;
  6622. // Sort queue before flush.
  6623. // This ensures that:
  6624. // 1. Components are updated from parent to child. (because parent is always
  6625. // created before the child)
  6626. // 2. A component's user watchers are run before its render watcher (because
  6627. // user watchers are created before the render watcher)
  6628. // 3. If a component is destroyed during a parent component's watcher run,
  6629. // its watchers can be skipped.
  6630. queue.sort(function (a, b) { return a.id - b.id; });
  6631. // do not cache length because more watchers might be pushed
  6632. // as we run existing watchers
  6633. for (index = 0; index < queue.length; index++) {
  6634. watcher = queue[index];
  6635. if (watcher.before) {
  6636. watcher.before();
  6637. }
  6638. id = watcher.id;
  6639. has[id] = null;
  6640. watcher.run();
  6641. // in dev build, check and stop circular updates.
  6642. if ( true && has[id] != null) {
  6643. circular[id] = (circular[id] || 0) + 1;
  6644. if (circular[id] > MAX_UPDATE_COUNT) {
  6645. warn(
  6646. 'You may have an infinite update loop ' + (
  6647. watcher.user
  6648. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6649. : "in a component render function."
  6650. ),
  6651. watcher.vm
  6652. );
  6653. break
  6654. }
  6655. }
  6656. }
  6657. // keep copies of post queues before resetting state
  6658. var activatedQueue = activatedChildren.slice();
  6659. var updatedQueue = queue.slice();
  6660. resetSchedulerState();
  6661. // call component updated and activated hooks
  6662. callActivatedHooks(activatedQueue);
  6663. callUpdatedHooks(updatedQueue);
  6664. // devtool hook
  6665. /* istanbul ignore if */
  6666. if (devtools && config.devtools) {
  6667. devtools.emit('flush');
  6668. }
  6669. }
  6670. function callUpdatedHooks (queue) {
  6671. var i = queue.length;
  6672. while (i--) {
  6673. var watcher = queue[i];
  6674. var vm = watcher.vm;
  6675. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6676. callHook(vm, 'updated');
  6677. }
  6678. }
  6679. }
  6680. /**
  6681. * Queue a kept-alive component that was activated during patch.
  6682. * The queue will be processed after the entire tree has been patched.
  6683. */
  6684. function queueActivatedComponent (vm) {
  6685. // setting _inactive to false here so that a render function can
  6686. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6687. vm._inactive = false;
  6688. activatedChildren.push(vm);
  6689. }
  6690. function callActivatedHooks (queue) {
  6691. for (var i = 0; i < queue.length; i++) {
  6692. queue[i]._inactive = true;
  6693. activateChildComponent(queue[i], true /* true */);
  6694. }
  6695. }
  6696. /**
  6697. * Push a watcher into the watcher queue.
  6698. * Jobs with duplicate IDs will be skipped unless it's
  6699. * pushed when the queue is being flushed.
  6700. */
  6701. function queueWatcher (watcher) {
  6702. var id = watcher.id;
  6703. if (has[id] == null) {
  6704. has[id] = true;
  6705. if (!flushing) {
  6706. queue.push(watcher);
  6707. } else {
  6708. // if already flushing, splice the watcher based on its id
  6709. // if already past its id, it will be run next immediately.
  6710. var i = queue.length - 1;
  6711. while (i > index && queue[i].id > watcher.id) {
  6712. i--;
  6713. }
  6714. queue.splice(i + 1, 0, watcher);
  6715. }
  6716. // queue the flush
  6717. if (!waiting) {
  6718. waiting = true;
  6719. if ( true && !config.async) {
  6720. flushSchedulerQueue();
  6721. return
  6722. }
  6723. nextTick(flushSchedulerQueue);
  6724. }
  6725. }
  6726. }
  6727. /* */
  6728. var uid$2 = 0;
  6729. /**
  6730. * A watcher parses an expression, collects dependencies,
  6731. * and fires callback when the expression value changes.
  6732. * This is used for both the $watch() api and directives.
  6733. */
  6734. var Watcher = function Watcher (
  6735. vm,
  6736. expOrFn,
  6737. cb,
  6738. options,
  6739. isRenderWatcher
  6740. ) {
  6741. this.vm = vm;
  6742. if (isRenderWatcher) {
  6743. vm._watcher = this;
  6744. }
  6745. vm._watchers.push(this);
  6746. // options
  6747. if (options) {
  6748. this.deep = !!options.deep;
  6749. this.user = !!options.user;
  6750. this.lazy = !!options.lazy;
  6751. this.sync = !!options.sync;
  6752. this.before = options.before;
  6753. } else {
  6754. this.deep = this.user = this.lazy = this.sync = false;
  6755. }
  6756. this.cb = cb;
  6757. this.id = ++uid$2; // uid for batching
  6758. this.active = true;
  6759. this.dirty = this.lazy; // for lazy watchers
  6760. this.deps = [];
  6761. this.newDeps = [];
  6762. this.depIds = new _Set();
  6763. this.newDepIds = new _Set();
  6764. this.expression = true
  6765. ? expOrFn.toString()
  6766. : undefined;
  6767. // parse expression for getter
  6768. if (typeof expOrFn === 'function') {
  6769. this.getter = expOrFn;
  6770. } else {
  6771. this.getter = parsePath(expOrFn);
  6772. if (!this.getter) {
  6773. this.getter = noop;
  6774. true && warn(
  6775. "Failed watching path: \"" + expOrFn + "\" " +
  6776. 'Watcher only accepts simple dot-delimited paths. ' +
  6777. 'For full control, use a function instead.',
  6778. vm
  6779. );
  6780. }
  6781. }
  6782. this.value = this.lazy
  6783. ? undefined
  6784. : this.get();
  6785. };
  6786. /**
  6787. * Evaluate the getter, and re-collect dependencies.
  6788. */
  6789. Watcher.prototype.get = function get () {
  6790. pushTarget(this);
  6791. var value;
  6792. var vm = this.vm;
  6793. try {
  6794. value = this.getter.call(vm, vm);
  6795. } catch (e) {
  6796. if (this.user) {
  6797. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6798. } else {
  6799. throw e
  6800. }
  6801. } finally {
  6802. // "touch" every property so they are all tracked as
  6803. // dependencies for deep watching
  6804. if (this.deep) {
  6805. traverse(value);
  6806. }
  6807. popTarget();
  6808. this.cleanupDeps();
  6809. }
  6810. return value
  6811. };
  6812. /**
  6813. * Add a dependency to this directive.
  6814. */
  6815. Watcher.prototype.addDep = function addDep (dep) {
  6816. var id = dep.id;
  6817. if (!this.newDepIds.has(id)) {
  6818. this.newDepIds.add(id);
  6819. this.newDeps.push(dep);
  6820. if (!this.depIds.has(id)) {
  6821. dep.addSub(this);
  6822. }
  6823. }
  6824. };
  6825. /**
  6826. * Clean up for dependency collection.
  6827. */
  6828. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6829. var i = this.deps.length;
  6830. while (i--) {
  6831. var dep = this.deps[i];
  6832. if (!this.newDepIds.has(dep.id)) {
  6833. dep.removeSub(this);
  6834. }
  6835. }
  6836. var tmp = this.depIds;
  6837. this.depIds = this.newDepIds;
  6838. this.newDepIds = tmp;
  6839. this.newDepIds.clear();
  6840. tmp = this.deps;
  6841. this.deps = this.newDeps;
  6842. this.newDeps = tmp;
  6843. this.newDeps.length = 0;
  6844. };
  6845. /**
  6846. * Subscriber interface.
  6847. * Will be called when a dependency changes.
  6848. */
  6849. Watcher.prototype.update = function update () {
  6850. /* istanbul ignore else */
  6851. if (this.lazy) {
  6852. this.dirty = true;
  6853. } else if (this.sync) {
  6854. this.run();
  6855. } else {
  6856. queueWatcher(this);
  6857. }
  6858. };
  6859. /**
  6860. * Scheduler job interface.
  6861. * Will be called by the scheduler.
  6862. */
  6863. Watcher.prototype.run = function run () {
  6864. if (this.active) {
  6865. var value = this.get();
  6866. if (
  6867. value !== this.value ||
  6868. // Deep watchers and watchers on Object/Arrays should fire even
  6869. // when the value is the same, because the value may
  6870. // have mutated.
  6871. isObject(value) ||
  6872. this.deep
  6873. ) {
  6874. // set new value
  6875. var oldValue = this.value;
  6876. this.value = value;
  6877. if (this.user) {
  6878. try {
  6879. this.cb.call(this.vm, value, oldValue);
  6880. } catch (e) {
  6881. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6882. }
  6883. } else {
  6884. this.cb.call(this.vm, value, oldValue);
  6885. }
  6886. }
  6887. }
  6888. };
  6889. /**
  6890. * Evaluate the value of the watcher.
  6891. * This only gets called for lazy watchers.
  6892. */
  6893. Watcher.prototype.evaluate = function evaluate () {
  6894. this.value = this.get();
  6895. this.dirty = false;
  6896. };
  6897. /**
  6898. * Depend on all deps collected by this watcher.
  6899. */
  6900. Watcher.prototype.depend = function depend () {
  6901. var i = this.deps.length;
  6902. while (i--) {
  6903. this.deps[i].depend();
  6904. }
  6905. };
  6906. /**
  6907. * Remove self from all dependencies' subscriber list.
  6908. */
  6909. Watcher.prototype.teardown = function teardown () {
  6910. if (this.active) {
  6911. // remove self from vm's watcher list
  6912. // this is a somewhat expensive operation so we skip it
  6913. // if the vm is being destroyed.
  6914. if (!this.vm._isBeingDestroyed) {
  6915. remove(this.vm._watchers, this);
  6916. }
  6917. var i = this.deps.length;
  6918. while (i--) {
  6919. this.deps[i].removeSub(this);
  6920. }
  6921. this.active = false;
  6922. }
  6923. };
  6924. /* */
  6925. var sharedPropertyDefinition = {
  6926. enumerable: true,
  6927. configurable: true,
  6928. get: noop,
  6929. set: noop
  6930. };
  6931. function proxy (target, sourceKey, key) {
  6932. sharedPropertyDefinition.get = function proxyGetter () {
  6933. return this[sourceKey][key]
  6934. };
  6935. sharedPropertyDefinition.set = function proxySetter (val) {
  6936. this[sourceKey][key] = val;
  6937. };
  6938. Object.defineProperty(target, key, sharedPropertyDefinition);
  6939. }
  6940. function initState (vm) {
  6941. vm._watchers = [];
  6942. var opts = vm.$options;
  6943. if (opts.props) { initProps(vm, opts.props); }
  6944. if (opts.methods) { initMethods(vm, opts.methods); }
  6945. if (opts.data) {
  6946. initData(vm);
  6947. } else {
  6948. observe(vm._data = {}, true /* asRootData */);
  6949. }
  6950. if (opts.computed) { initComputed(vm, opts.computed); }
  6951. if (opts.watch && opts.watch !== nativeWatch) {
  6952. initWatch(vm, opts.watch);
  6953. }
  6954. }
  6955. function initProps (vm, propsOptions) {
  6956. var propsData = vm.$options.propsData || {};
  6957. var props = vm._props = {};
  6958. // cache prop keys so that future props updates can iterate using Array
  6959. // instead of dynamic object key enumeration.
  6960. var keys = vm.$options._propKeys = [];
  6961. var isRoot = !vm.$parent;
  6962. // root instance props should be converted
  6963. if (!isRoot) {
  6964. toggleObserving(false);
  6965. }
  6966. var loop = function ( key ) {
  6967. keys.push(key);
  6968. var value = validateProp(key, propsOptions, propsData, vm);
  6969. /* istanbul ignore else */
  6970. if (true) {
  6971. var hyphenatedKey = hyphenate(key);
  6972. if (isReservedAttribute(hyphenatedKey) ||
  6973. config.isReservedAttr(hyphenatedKey)) {
  6974. warn(
  6975. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  6976. vm
  6977. );
  6978. }
  6979. defineReactive$$1(props, key, value, function () {
  6980. if (!isRoot && !isUpdatingChildComponent) {
  6981. {
  6982. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  6983. return
  6984. }
  6985. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  6986. if(
  6987. key === 'value' &&
  6988. Array.isArray(vm.$options.behaviors) &&
  6989. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6990. ){
  6991. return
  6992. }
  6993. if(vm._getFormData){
  6994. return
  6995. }
  6996. var $parent = vm.$parent;
  6997. while($parent){
  6998. if($parent.__next_tick_pending){
  6999. return
  7000. }
  7001. $parent = $parent.$parent;
  7002. }
  7003. }
  7004. warn(
  7005. "Avoid mutating a prop directly since the value will be " +
  7006. "overwritten whenever the parent component re-renders. " +
  7007. "Instead, use a data or computed property based on the prop's " +
  7008. "value. Prop being mutated: \"" + key + "\"",
  7009. vm
  7010. );
  7011. }
  7012. });
  7013. } else {}
  7014. // static props are already proxied on the component's prototype
  7015. // during Vue.extend(). We only need to proxy props defined at
  7016. // instantiation here.
  7017. if (!(key in vm)) {
  7018. proxy(vm, "_props", key);
  7019. }
  7020. };
  7021. for (var key in propsOptions) loop( key );
  7022. toggleObserving(true);
  7023. }
  7024. function initData (vm) {
  7025. var data = vm.$options.data;
  7026. data = vm._data = typeof data === 'function'
  7027. ? getData(data, vm)
  7028. : data || {};
  7029. if (!isPlainObject(data)) {
  7030. data = {};
  7031. true && warn(
  7032. 'data functions should return an object:\n' +
  7033. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7034. vm
  7035. );
  7036. }
  7037. // proxy data on instance
  7038. var keys = Object.keys(data);
  7039. var props = vm.$options.props;
  7040. var methods = vm.$options.methods;
  7041. var i = keys.length;
  7042. while (i--) {
  7043. var key = keys[i];
  7044. if (true) {
  7045. if (methods && hasOwn(methods, key)) {
  7046. warn(
  7047. ("Method \"" + key + "\" has already been defined as a data property."),
  7048. vm
  7049. );
  7050. }
  7051. }
  7052. if (props && hasOwn(props, key)) {
  7053. true && warn(
  7054. "The data property \"" + key + "\" is already declared as a prop. " +
  7055. "Use prop default value instead.",
  7056. vm
  7057. );
  7058. } else if (!isReserved(key)) {
  7059. proxy(vm, "_data", key);
  7060. }
  7061. }
  7062. // observe data
  7063. observe(data, true /* asRootData */);
  7064. }
  7065. function getData (data, vm) {
  7066. // #7573 disable dep collection when invoking data getters
  7067. pushTarget();
  7068. try {
  7069. return data.call(vm, vm)
  7070. } catch (e) {
  7071. handleError(e, vm, "data()");
  7072. return {}
  7073. } finally {
  7074. popTarget();
  7075. }
  7076. }
  7077. var computedWatcherOptions = { lazy: true };
  7078. function initComputed (vm, computed) {
  7079. // $flow-disable-line
  7080. var watchers = vm._computedWatchers = Object.create(null);
  7081. // computed properties are just getters during SSR
  7082. var isSSR = isServerRendering();
  7083. for (var key in computed) {
  7084. var userDef = computed[key];
  7085. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7086. if ( true && getter == null) {
  7087. warn(
  7088. ("Getter is missing for computed property \"" + key + "\"."),
  7089. vm
  7090. );
  7091. }
  7092. if (!isSSR) {
  7093. // create internal watcher for the computed property.
  7094. watchers[key] = new Watcher(
  7095. vm,
  7096. getter || noop,
  7097. noop,
  7098. computedWatcherOptions
  7099. );
  7100. }
  7101. // component-defined computed properties are already defined on the
  7102. // component prototype. We only need to define computed properties defined
  7103. // at instantiation here.
  7104. if (!(key in vm)) {
  7105. defineComputed(vm, key, userDef);
  7106. } else if (true) {
  7107. if (key in vm.$data) {
  7108. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7109. } else if (vm.$options.props && key in vm.$options.props) {
  7110. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7111. }
  7112. }
  7113. }
  7114. }
  7115. function defineComputed (
  7116. target,
  7117. key,
  7118. userDef
  7119. ) {
  7120. var shouldCache = !isServerRendering();
  7121. if (typeof userDef === 'function') {
  7122. sharedPropertyDefinition.get = shouldCache
  7123. ? createComputedGetter(key)
  7124. : createGetterInvoker(userDef);
  7125. sharedPropertyDefinition.set = noop;
  7126. } else {
  7127. sharedPropertyDefinition.get = userDef.get
  7128. ? shouldCache && userDef.cache !== false
  7129. ? createComputedGetter(key)
  7130. : createGetterInvoker(userDef.get)
  7131. : noop;
  7132. sharedPropertyDefinition.set = userDef.set || noop;
  7133. }
  7134. if ( true &&
  7135. sharedPropertyDefinition.set === noop) {
  7136. sharedPropertyDefinition.set = function () {
  7137. warn(
  7138. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7139. this
  7140. );
  7141. };
  7142. }
  7143. Object.defineProperty(target, key, sharedPropertyDefinition);
  7144. }
  7145. function createComputedGetter (key) {
  7146. return function computedGetter () {
  7147. var watcher = this._computedWatchers && this._computedWatchers[key];
  7148. if (watcher) {
  7149. if (watcher.dirty) {
  7150. watcher.evaluate();
  7151. }
  7152. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7153. watcher.depend();
  7154. }
  7155. return watcher.value
  7156. }
  7157. }
  7158. }
  7159. function createGetterInvoker(fn) {
  7160. return function computedGetter () {
  7161. return fn.call(this, this)
  7162. }
  7163. }
  7164. function initMethods (vm, methods) {
  7165. var props = vm.$options.props;
  7166. for (var key in methods) {
  7167. if (true) {
  7168. if (typeof methods[key] !== 'function') {
  7169. warn(
  7170. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7171. "Did you reference the function correctly?",
  7172. vm
  7173. );
  7174. }
  7175. if (props && hasOwn(props, key)) {
  7176. warn(
  7177. ("Method \"" + key + "\" has already been defined as a prop."),
  7178. vm
  7179. );
  7180. }
  7181. if ((key in vm) && isReserved(key)) {
  7182. warn(
  7183. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7184. "Avoid defining component methods that start with _ or $."
  7185. );
  7186. }
  7187. }
  7188. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7189. }
  7190. }
  7191. function initWatch (vm, watch) {
  7192. for (var key in watch) {
  7193. var handler = watch[key];
  7194. if (Array.isArray(handler)) {
  7195. for (var i = 0; i < handler.length; i++) {
  7196. createWatcher(vm, key, handler[i]);
  7197. }
  7198. } else {
  7199. createWatcher(vm, key, handler);
  7200. }
  7201. }
  7202. }
  7203. function createWatcher (
  7204. vm,
  7205. expOrFn,
  7206. handler,
  7207. options
  7208. ) {
  7209. if (isPlainObject(handler)) {
  7210. options = handler;
  7211. handler = handler.handler;
  7212. }
  7213. if (typeof handler === 'string') {
  7214. handler = vm[handler];
  7215. }
  7216. return vm.$watch(expOrFn, handler, options)
  7217. }
  7218. function stateMixin (Vue) {
  7219. // flow somehow has problems with directly declared definition object
  7220. // when using Object.defineProperty, so we have to procedurally build up
  7221. // the object here.
  7222. var dataDef = {};
  7223. dataDef.get = function () { return this._data };
  7224. var propsDef = {};
  7225. propsDef.get = function () { return this._props };
  7226. if (true) {
  7227. dataDef.set = function () {
  7228. warn(
  7229. 'Avoid replacing instance root $data. ' +
  7230. 'Use nested data properties instead.',
  7231. this
  7232. );
  7233. };
  7234. propsDef.set = function () {
  7235. warn("$props is readonly.", this);
  7236. };
  7237. }
  7238. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7239. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7240. Vue.prototype.$set = set;
  7241. Vue.prototype.$delete = del;
  7242. Vue.prototype.$watch = function (
  7243. expOrFn,
  7244. cb,
  7245. options
  7246. ) {
  7247. var vm = this;
  7248. if (isPlainObject(cb)) {
  7249. return createWatcher(vm, expOrFn, cb, options)
  7250. }
  7251. options = options || {};
  7252. options.user = true;
  7253. var watcher = new Watcher(vm, expOrFn, cb, options);
  7254. if (options.immediate) {
  7255. try {
  7256. cb.call(vm, watcher.value);
  7257. } catch (error) {
  7258. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7259. }
  7260. }
  7261. return function unwatchFn () {
  7262. watcher.teardown();
  7263. }
  7264. };
  7265. }
  7266. /* */
  7267. var uid$3 = 0;
  7268. function initMixin (Vue) {
  7269. Vue.prototype._init = function (options) {
  7270. var vm = this;
  7271. // a uid
  7272. vm._uid = uid$3++;
  7273. var startTag, endTag;
  7274. /* istanbul ignore if */
  7275. if ( true && config.performance && mark) {
  7276. startTag = "vue-perf-start:" + (vm._uid);
  7277. endTag = "vue-perf-end:" + (vm._uid);
  7278. mark(startTag);
  7279. }
  7280. // a flag to avoid this being observed
  7281. vm._isVue = true;
  7282. // merge options
  7283. if (options && options._isComponent) {
  7284. // optimize internal component instantiation
  7285. // since dynamic options merging is pretty slow, and none of the
  7286. // internal component options needs special treatment.
  7287. initInternalComponent(vm, options);
  7288. } else {
  7289. vm.$options = mergeOptions(
  7290. resolveConstructorOptions(vm.constructor),
  7291. options || {},
  7292. vm
  7293. );
  7294. }
  7295. /* istanbul ignore else */
  7296. if (true) {
  7297. initProxy(vm);
  7298. } else {}
  7299. // expose real self
  7300. vm._self = vm;
  7301. initLifecycle(vm);
  7302. initEvents(vm);
  7303. initRender(vm);
  7304. callHook(vm, 'beforeCreate');
  7305. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7306. initState(vm);
  7307. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7308. !vm._$fallback && callHook(vm, 'created');
  7309. /* istanbul ignore if */
  7310. if ( true && config.performance && mark) {
  7311. vm._name = formatComponentName(vm, false);
  7312. mark(endTag);
  7313. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7314. }
  7315. if (vm.$options.el) {
  7316. vm.$mount(vm.$options.el);
  7317. }
  7318. };
  7319. }
  7320. function initInternalComponent (vm, options) {
  7321. var opts = vm.$options = Object.create(vm.constructor.options);
  7322. // doing this because it's faster than dynamic enumeration.
  7323. var parentVnode = options._parentVnode;
  7324. opts.parent = options.parent;
  7325. opts._parentVnode = parentVnode;
  7326. var vnodeComponentOptions = parentVnode.componentOptions;
  7327. opts.propsData = vnodeComponentOptions.propsData;
  7328. opts._parentListeners = vnodeComponentOptions.listeners;
  7329. opts._renderChildren = vnodeComponentOptions.children;
  7330. opts._componentTag = vnodeComponentOptions.tag;
  7331. if (options.render) {
  7332. opts.render = options.render;
  7333. opts.staticRenderFns = options.staticRenderFns;
  7334. }
  7335. }
  7336. function resolveConstructorOptions (Ctor) {
  7337. var options = Ctor.options;
  7338. if (Ctor.super) {
  7339. var superOptions = resolveConstructorOptions(Ctor.super);
  7340. var cachedSuperOptions = Ctor.superOptions;
  7341. if (superOptions !== cachedSuperOptions) {
  7342. // super option changed,
  7343. // need to resolve new options.
  7344. Ctor.superOptions = superOptions;
  7345. // check if there are any late-modified/attached options (#4976)
  7346. var modifiedOptions = resolveModifiedOptions(Ctor);
  7347. // update base extend options
  7348. if (modifiedOptions) {
  7349. extend(Ctor.extendOptions, modifiedOptions);
  7350. }
  7351. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7352. if (options.name) {
  7353. options.components[options.name] = Ctor;
  7354. }
  7355. }
  7356. }
  7357. return options
  7358. }
  7359. function resolveModifiedOptions (Ctor) {
  7360. var modified;
  7361. var latest = Ctor.options;
  7362. var sealed = Ctor.sealedOptions;
  7363. for (var key in latest) {
  7364. if (latest[key] !== sealed[key]) {
  7365. if (!modified) { modified = {}; }
  7366. modified[key] = latest[key];
  7367. }
  7368. }
  7369. return modified
  7370. }
  7371. function Vue (options) {
  7372. if ( true &&
  7373. !(this instanceof Vue)
  7374. ) {
  7375. warn('Vue is a constructor and should be called with the `new` keyword');
  7376. }
  7377. this._init(options);
  7378. }
  7379. initMixin(Vue);
  7380. stateMixin(Vue);
  7381. eventsMixin(Vue);
  7382. lifecycleMixin(Vue);
  7383. renderMixin(Vue);
  7384. /* */
  7385. function initUse (Vue) {
  7386. Vue.use = function (plugin) {
  7387. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7388. if (installedPlugins.indexOf(plugin) > -1) {
  7389. return this
  7390. }
  7391. // additional parameters
  7392. var args = toArray(arguments, 1);
  7393. args.unshift(this);
  7394. if (typeof plugin.install === 'function') {
  7395. plugin.install.apply(plugin, args);
  7396. } else if (typeof plugin === 'function') {
  7397. plugin.apply(null, args);
  7398. }
  7399. installedPlugins.push(plugin);
  7400. return this
  7401. };
  7402. }
  7403. /* */
  7404. function initMixin$1 (Vue) {
  7405. Vue.mixin = function (mixin) {
  7406. this.options = mergeOptions(this.options, mixin);
  7407. return this
  7408. };
  7409. }
  7410. /* */
  7411. function initExtend (Vue) {
  7412. /**
  7413. * Each instance constructor, including Vue, has a unique
  7414. * cid. This enables us to create wrapped "child
  7415. * constructors" for prototypal inheritance and cache them.
  7416. */
  7417. Vue.cid = 0;
  7418. var cid = 1;
  7419. /**
  7420. * Class inheritance
  7421. */
  7422. Vue.extend = function (extendOptions) {
  7423. extendOptions = extendOptions || {};
  7424. var Super = this;
  7425. var SuperId = Super.cid;
  7426. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7427. if (cachedCtors[SuperId]) {
  7428. return cachedCtors[SuperId]
  7429. }
  7430. var name = extendOptions.name || Super.options.name;
  7431. if ( true && name) {
  7432. validateComponentName(name);
  7433. }
  7434. var Sub = function VueComponent (options) {
  7435. this._init(options);
  7436. };
  7437. Sub.prototype = Object.create(Super.prototype);
  7438. Sub.prototype.constructor = Sub;
  7439. Sub.cid = cid++;
  7440. Sub.options = mergeOptions(
  7441. Super.options,
  7442. extendOptions
  7443. );
  7444. Sub['super'] = Super;
  7445. // For props and computed properties, we define the proxy getters on
  7446. // the Vue instances at extension time, on the extended prototype. This
  7447. // avoids Object.defineProperty calls for each instance created.
  7448. if (Sub.options.props) {
  7449. initProps$1(Sub);
  7450. }
  7451. if (Sub.options.computed) {
  7452. initComputed$1(Sub);
  7453. }
  7454. // allow further extension/mixin/plugin usage
  7455. Sub.extend = Super.extend;
  7456. Sub.mixin = Super.mixin;
  7457. Sub.use = Super.use;
  7458. // create asset registers, so extended classes
  7459. // can have their private assets too.
  7460. ASSET_TYPES.forEach(function (type) {
  7461. Sub[type] = Super[type];
  7462. });
  7463. // enable recursive self-lookup
  7464. if (name) {
  7465. Sub.options.components[name] = Sub;
  7466. }
  7467. // keep a reference to the super options at extension time.
  7468. // later at instantiation we can check if Super's options have
  7469. // been updated.
  7470. Sub.superOptions = Super.options;
  7471. Sub.extendOptions = extendOptions;
  7472. Sub.sealedOptions = extend({}, Sub.options);
  7473. // cache constructor
  7474. cachedCtors[SuperId] = Sub;
  7475. return Sub
  7476. };
  7477. }
  7478. function initProps$1 (Comp) {
  7479. var props = Comp.options.props;
  7480. for (var key in props) {
  7481. proxy(Comp.prototype, "_props", key);
  7482. }
  7483. }
  7484. function initComputed$1 (Comp) {
  7485. var computed = Comp.options.computed;
  7486. for (var key in computed) {
  7487. defineComputed(Comp.prototype, key, computed[key]);
  7488. }
  7489. }
  7490. /* */
  7491. function initAssetRegisters (Vue) {
  7492. /**
  7493. * Create asset registration methods.
  7494. */
  7495. ASSET_TYPES.forEach(function (type) {
  7496. Vue[type] = function (
  7497. id,
  7498. definition
  7499. ) {
  7500. if (!definition) {
  7501. return this.options[type + 's'][id]
  7502. } else {
  7503. /* istanbul ignore if */
  7504. if ( true && type === 'component') {
  7505. validateComponentName(id);
  7506. }
  7507. if (type === 'component' && isPlainObject(definition)) {
  7508. definition.name = definition.name || id;
  7509. definition = this.options._base.extend(definition);
  7510. }
  7511. if (type === 'directive' && typeof definition === 'function') {
  7512. definition = { bind: definition, update: definition };
  7513. }
  7514. this.options[type + 's'][id] = definition;
  7515. return definition
  7516. }
  7517. };
  7518. });
  7519. }
  7520. /* */
  7521. function getComponentName (opts) {
  7522. return opts && (opts.Ctor.options.name || opts.tag)
  7523. }
  7524. function matches (pattern, name) {
  7525. if (Array.isArray(pattern)) {
  7526. return pattern.indexOf(name) > -1
  7527. } else if (typeof pattern === 'string') {
  7528. return pattern.split(',').indexOf(name) > -1
  7529. } else if (isRegExp(pattern)) {
  7530. return pattern.test(name)
  7531. }
  7532. /* istanbul ignore next */
  7533. return false
  7534. }
  7535. function pruneCache (keepAliveInstance, filter) {
  7536. var cache = keepAliveInstance.cache;
  7537. var keys = keepAliveInstance.keys;
  7538. var _vnode = keepAliveInstance._vnode;
  7539. for (var key in cache) {
  7540. var cachedNode = cache[key];
  7541. if (cachedNode) {
  7542. var name = getComponentName(cachedNode.componentOptions);
  7543. if (name && !filter(name)) {
  7544. pruneCacheEntry(cache, key, keys, _vnode);
  7545. }
  7546. }
  7547. }
  7548. }
  7549. function pruneCacheEntry (
  7550. cache,
  7551. key,
  7552. keys,
  7553. current
  7554. ) {
  7555. var cached$$1 = cache[key];
  7556. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7557. cached$$1.componentInstance.$destroy();
  7558. }
  7559. cache[key] = null;
  7560. remove(keys, key);
  7561. }
  7562. var patternTypes = [String, RegExp, Array];
  7563. var KeepAlive = {
  7564. name: 'keep-alive',
  7565. abstract: true,
  7566. props: {
  7567. include: patternTypes,
  7568. exclude: patternTypes,
  7569. max: [String, Number]
  7570. },
  7571. created: function created () {
  7572. this.cache = Object.create(null);
  7573. this.keys = [];
  7574. },
  7575. destroyed: function destroyed () {
  7576. for (var key in this.cache) {
  7577. pruneCacheEntry(this.cache, key, this.keys);
  7578. }
  7579. },
  7580. mounted: function mounted () {
  7581. var this$1 = this;
  7582. this.$watch('include', function (val) {
  7583. pruneCache(this$1, function (name) { return matches(val, name); });
  7584. });
  7585. this.$watch('exclude', function (val) {
  7586. pruneCache(this$1, function (name) { return !matches(val, name); });
  7587. });
  7588. },
  7589. render: function render () {
  7590. var slot = this.$slots.default;
  7591. var vnode = getFirstComponentChild(slot);
  7592. var componentOptions = vnode && vnode.componentOptions;
  7593. if (componentOptions) {
  7594. // check pattern
  7595. var name = getComponentName(componentOptions);
  7596. var ref = this;
  7597. var include = ref.include;
  7598. var exclude = ref.exclude;
  7599. if (
  7600. // not included
  7601. (include && (!name || !matches(include, name))) ||
  7602. // excluded
  7603. (exclude && name && matches(exclude, name))
  7604. ) {
  7605. return vnode
  7606. }
  7607. var ref$1 = this;
  7608. var cache = ref$1.cache;
  7609. var keys = ref$1.keys;
  7610. var key = vnode.key == null
  7611. // same constructor may get registered as different local components
  7612. // so cid alone is not enough (#3269)
  7613. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7614. : vnode.key;
  7615. if (cache[key]) {
  7616. vnode.componentInstance = cache[key].componentInstance;
  7617. // make current key freshest
  7618. remove(keys, key);
  7619. keys.push(key);
  7620. } else {
  7621. cache[key] = vnode;
  7622. keys.push(key);
  7623. // prune oldest entry
  7624. if (this.max && keys.length > parseInt(this.max)) {
  7625. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7626. }
  7627. }
  7628. vnode.data.keepAlive = true;
  7629. }
  7630. return vnode || (slot && slot[0])
  7631. }
  7632. };
  7633. var builtInComponents = {
  7634. KeepAlive: KeepAlive
  7635. };
  7636. /* */
  7637. function initGlobalAPI (Vue) {
  7638. // config
  7639. var configDef = {};
  7640. configDef.get = function () { return config; };
  7641. if (true) {
  7642. configDef.set = function () {
  7643. warn(
  7644. 'Do not replace the Vue.config object, set individual fields instead.'
  7645. );
  7646. };
  7647. }
  7648. Object.defineProperty(Vue, 'config', configDef);
  7649. // exposed util methods.
  7650. // NOTE: these are not considered part of the public API - avoid relying on
  7651. // them unless you are aware of the risk.
  7652. Vue.util = {
  7653. warn: warn,
  7654. extend: extend,
  7655. mergeOptions: mergeOptions,
  7656. defineReactive: defineReactive$$1
  7657. };
  7658. Vue.set = set;
  7659. Vue.delete = del;
  7660. Vue.nextTick = nextTick;
  7661. // 2.6 explicit observable API
  7662. Vue.observable = function (obj) {
  7663. observe(obj);
  7664. return obj
  7665. };
  7666. Vue.options = Object.create(null);
  7667. ASSET_TYPES.forEach(function (type) {
  7668. Vue.options[type + 's'] = Object.create(null);
  7669. });
  7670. // this is used to identify the "base" constructor to extend all plain-object
  7671. // components with in Weex's multi-instance scenarios.
  7672. Vue.options._base = Vue;
  7673. extend(Vue.options.components, builtInComponents);
  7674. initUse(Vue);
  7675. initMixin$1(Vue);
  7676. initExtend(Vue);
  7677. initAssetRegisters(Vue);
  7678. }
  7679. initGlobalAPI(Vue);
  7680. Object.defineProperty(Vue.prototype, '$isServer', {
  7681. get: isServerRendering
  7682. });
  7683. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7684. get: function get () {
  7685. /* istanbul ignore next */
  7686. return this.$vnode && this.$vnode.ssrContext
  7687. }
  7688. });
  7689. // expose FunctionalRenderContext for ssr runtime helper installation
  7690. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7691. value: FunctionalRenderContext
  7692. });
  7693. Vue.version = '2.6.11';
  7694. /**
  7695. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7696. */
  7697. var ARRAYTYPE = '[object Array]';
  7698. var OBJECTTYPE = '[object Object]';
  7699. // const FUNCTIONTYPE = '[object Function]'
  7700. function diff(current, pre) {
  7701. var result = {};
  7702. syncKeys(current, pre);
  7703. _diff(current, pre, '', result);
  7704. return result
  7705. }
  7706. function syncKeys(current, pre) {
  7707. if (current === pre) { return }
  7708. var rootCurrentType = type(current);
  7709. var rootPreType = type(pre);
  7710. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7711. if(Object.keys(current).length >= Object.keys(pre).length){
  7712. for (var key in pre) {
  7713. var currentValue = current[key];
  7714. if (currentValue === undefined) {
  7715. current[key] = null;
  7716. } else {
  7717. syncKeys(currentValue, pre[key]);
  7718. }
  7719. }
  7720. }
  7721. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7722. if (current.length >= pre.length) {
  7723. pre.forEach(function (item, index) {
  7724. syncKeys(current[index], item);
  7725. });
  7726. }
  7727. }
  7728. }
  7729. function _diff(current, pre, path, result) {
  7730. if (current === pre) { return }
  7731. var rootCurrentType = type(current);
  7732. var rootPreType = type(pre);
  7733. if (rootCurrentType == OBJECTTYPE) {
  7734. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7735. setResult(result, path, current);
  7736. } else {
  7737. var loop = function ( key ) {
  7738. var currentValue = current[key];
  7739. var preValue = pre[key];
  7740. var currentType = type(currentValue);
  7741. var preType = type(preValue);
  7742. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7743. if (currentValue != pre[key]) {
  7744. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7745. }
  7746. } else if (currentType == ARRAYTYPE) {
  7747. if (preType != ARRAYTYPE) {
  7748. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7749. } else {
  7750. if (currentValue.length < preValue.length) {
  7751. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7752. } else {
  7753. currentValue.forEach(function (item, index) {
  7754. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7755. });
  7756. }
  7757. }
  7758. } else if (currentType == OBJECTTYPE) {
  7759. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7760. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7761. } else {
  7762. for (var subKey in currentValue) {
  7763. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7764. }
  7765. }
  7766. }
  7767. };
  7768. for (var key in current) loop( key );
  7769. }
  7770. } else if (rootCurrentType == ARRAYTYPE) {
  7771. if (rootPreType != ARRAYTYPE) {
  7772. setResult(result, path, current);
  7773. } else {
  7774. if (current.length < pre.length) {
  7775. setResult(result, path, current);
  7776. } else {
  7777. current.forEach(function (item, index) {
  7778. _diff(item, pre[index], path + '[' + index + ']', result);
  7779. });
  7780. }
  7781. }
  7782. } else {
  7783. setResult(result, path, current);
  7784. }
  7785. }
  7786. function setResult(result, k, v) {
  7787. // if (type(v) != FUNCTIONTYPE) {
  7788. result[k] = v;
  7789. // }
  7790. }
  7791. function type(obj) {
  7792. return Object.prototype.toString.call(obj)
  7793. }
  7794. /* */
  7795. function flushCallbacks$1(vm) {
  7796. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7797. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7798. var mpInstance = vm.$scope;
  7799. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7800. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7801. }
  7802. var copies = vm.__next_tick_callbacks.slice(0);
  7803. vm.__next_tick_callbacks.length = 0;
  7804. for (var i = 0; i < copies.length; i++) {
  7805. copies[i]();
  7806. }
  7807. }
  7808. }
  7809. function hasRenderWatcher(vm) {
  7810. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7811. }
  7812. function nextTick$1(vm, cb) {
  7813. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7814. //2.nextTick 之前存在 render watcher
  7815. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7816. if(Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7817. var mpInstance = vm.$scope;
  7818. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7819. ']:nextVueTick');
  7820. }
  7821. return nextTick(cb, vm)
  7822. }else{
  7823. if(Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7824. var mpInstance$1 = vm.$scope;
  7825. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7826. ']:nextMPTick');
  7827. }
  7828. }
  7829. var _resolve;
  7830. if (!vm.__next_tick_callbacks) {
  7831. vm.__next_tick_callbacks = [];
  7832. }
  7833. vm.__next_tick_callbacks.push(function () {
  7834. if (cb) {
  7835. try {
  7836. cb.call(vm);
  7837. } catch (e) {
  7838. handleError(e, vm, 'nextTick');
  7839. }
  7840. } else if (_resolve) {
  7841. _resolve(vm);
  7842. }
  7843. });
  7844. // $flow-disable-line
  7845. if (!cb && typeof Promise !== 'undefined') {
  7846. return new Promise(function (resolve) {
  7847. _resolve = resolve;
  7848. })
  7849. }
  7850. }
  7851. /* */
  7852. function cloneWithData(vm) {
  7853. // 确保当前 vm 所有数据被同步
  7854. var ret = Object.create(null);
  7855. var dataKeys = [].concat(
  7856. Object.keys(vm._data || {}),
  7857. Object.keys(vm._computedWatchers || {}));
  7858. dataKeys.reduce(function(ret, key) {
  7859. ret[key] = vm[key];
  7860. return ret
  7861. }, ret);
  7862. // vue-composition-api
  7863. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  7864. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  7865. if (rawBindings) {
  7866. Object.keys(rawBindings).forEach(function (key) {
  7867. ret[key] = vm[key];
  7868. });
  7869. }
  7870. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7871. Object.assign(ret, vm.$mp.data || {});
  7872. if (
  7873. Array.isArray(vm.$options.behaviors) &&
  7874. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7875. ) { //form-field
  7876. ret['name'] = vm.name;
  7877. ret['value'] = vm.value;
  7878. }
  7879. return JSON.parse(JSON.stringify(ret))
  7880. }
  7881. var patch = function(oldVnode, vnode) {
  7882. var this$1 = this;
  7883. if (vnode === null) { //destroy
  7884. return
  7885. }
  7886. if (this.mpType === 'page' || this.mpType === 'component') {
  7887. var mpInstance = this.$scope;
  7888. var data = Object.create(null);
  7889. try {
  7890. data = cloneWithData(this);
  7891. } catch (err) {
  7892. console.error(err);
  7893. }
  7894. data.__webviewId__ = mpInstance.data.__webviewId__;
  7895. var mpData = Object.create(null);
  7896. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7897. mpData[key] = mpInstance.data[key];
  7898. });
  7899. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7900. if (Object.keys(diffData).length) {
  7901. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7902. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7903. ']差量更新',
  7904. JSON.stringify(diffData));
  7905. }
  7906. this.__next_tick_pending = true;
  7907. mpInstance.setData(diffData, function () {
  7908. this$1.__next_tick_pending = false;
  7909. flushCallbacks$1(this$1);
  7910. });
  7911. } else {
  7912. flushCallbacks$1(this);
  7913. }
  7914. }
  7915. };
  7916. /* */
  7917. function createEmptyRender() {
  7918. }
  7919. function mountComponent$1(
  7920. vm,
  7921. el,
  7922. hydrating
  7923. ) {
  7924. if (!vm.mpType) {//main.js 中的 new Vue
  7925. return vm
  7926. }
  7927. if (vm.mpType === 'app') {
  7928. vm.$options.render = createEmptyRender;
  7929. }
  7930. if (!vm.$options.render) {
  7931. vm.$options.render = createEmptyRender;
  7932. if (true) {
  7933. /* istanbul ignore if */
  7934. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7935. vm.$options.el || el) {
  7936. warn(
  7937. 'You are using the runtime-only build of Vue where the template ' +
  7938. 'compiler is not available. Either pre-compile the templates into ' +
  7939. 'render functions, or use the compiler-included build.',
  7940. vm
  7941. );
  7942. } else {
  7943. warn(
  7944. 'Failed to mount component: template or render function not defined.',
  7945. vm
  7946. );
  7947. }
  7948. }
  7949. }
  7950. !vm._$fallback && callHook(vm, 'beforeMount');
  7951. var updateComponent = function () {
  7952. vm._update(vm._render(), hydrating);
  7953. };
  7954. // we set this to vm._watcher inside the watcher's constructor
  7955. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  7956. // component's mounted hook), which relies on vm._watcher being already defined
  7957. new Watcher(vm, updateComponent, noop, {
  7958. before: function before() {
  7959. if (vm._isMounted && !vm._isDestroyed) {
  7960. callHook(vm, 'beforeUpdate');
  7961. }
  7962. }
  7963. }, true /* isRenderWatcher */);
  7964. hydrating = false;
  7965. return vm
  7966. }
  7967. /* */
  7968. function renderClass (
  7969. staticClass,
  7970. dynamicClass
  7971. ) {
  7972. if (isDef(staticClass) || isDef(dynamicClass)) {
  7973. return concat(staticClass, stringifyClass(dynamicClass))
  7974. }
  7975. /* istanbul ignore next */
  7976. return ''
  7977. }
  7978. function concat (a, b) {
  7979. return a ? b ? (a + ' ' + b) : a : (b || '')
  7980. }
  7981. function stringifyClass (value) {
  7982. if (Array.isArray(value)) {
  7983. return stringifyArray(value)
  7984. }
  7985. if (isObject(value)) {
  7986. return stringifyObject(value)
  7987. }
  7988. if (typeof value === 'string') {
  7989. return value
  7990. }
  7991. /* istanbul ignore next */
  7992. return ''
  7993. }
  7994. function stringifyArray (value) {
  7995. var res = '';
  7996. var stringified;
  7997. for (var i = 0, l = value.length; i < l; i++) {
  7998. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7999. if (res) { res += ' '; }
  8000. res += stringified;
  8001. }
  8002. }
  8003. return res
  8004. }
  8005. function stringifyObject (value) {
  8006. var res = '';
  8007. for (var key in value) {
  8008. if (value[key]) {
  8009. if (res) { res += ' '; }
  8010. res += key;
  8011. }
  8012. }
  8013. return res
  8014. }
  8015. /* */
  8016. var parseStyleText = cached(function (cssText) {
  8017. var res = {};
  8018. var listDelimiter = /;(?![^(]*\))/g;
  8019. var propertyDelimiter = /:(.+)/;
  8020. cssText.split(listDelimiter).forEach(function (item) {
  8021. if (item) {
  8022. var tmp = item.split(propertyDelimiter);
  8023. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8024. }
  8025. });
  8026. return res
  8027. });
  8028. // normalize possible array / string values into Object
  8029. function normalizeStyleBinding (bindingStyle) {
  8030. if (Array.isArray(bindingStyle)) {
  8031. return toObject(bindingStyle)
  8032. }
  8033. if (typeof bindingStyle === 'string') {
  8034. return parseStyleText(bindingStyle)
  8035. }
  8036. return bindingStyle
  8037. }
  8038. /* */
  8039. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8040. function getTarget(obj, path) {
  8041. var parts = path.split('.');
  8042. var key = parts[0];
  8043. if (key.indexOf('__$n') === 0) { //number index
  8044. key = parseInt(key.replace('__$n', ''));
  8045. }
  8046. if (parts.length === 1) {
  8047. return obj[key]
  8048. }
  8049. return getTarget(obj[key], parts.slice(1).join('.'))
  8050. }
  8051. function internalMixin(Vue) {
  8052. Vue.config.errorHandler = function(err, vm, info) {
  8053. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8054. console.error(err);
  8055. /* eslint-disable no-undef */
  8056. var app = typeof getApp === 'function' && getApp();
  8057. if (app && app.onError) {
  8058. app.onError(err);
  8059. }
  8060. };
  8061. var oldEmit = Vue.prototype.$emit;
  8062. Vue.prototype.$emit = function(event) {
  8063. if (this.$scope && event) {
  8064. this.$scope['triggerEvent'](event, {
  8065. __args__: toArray(arguments, 1)
  8066. });
  8067. }
  8068. return oldEmit.apply(this, arguments)
  8069. };
  8070. Vue.prototype.$nextTick = function(fn) {
  8071. return nextTick$1(this, fn)
  8072. };
  8073. MP_METHODS.forEach(function (method) {
  8074. Vue.prototype[method] = function(args) {
  8075. if (this.$scope && this.$scope[method]) {
  8076. return this.$scope[method](args)
  8077. }
  8078. // mp-alipay
  8079. if (typeof my === 'undefined') {
  8080. return
  8081. }
  8082. if (method === 'createSelectorQuery') {
  8083. /* eslint-disable no-undef */
  8084. return my.createSelectorQuery(args)
  8085. } else if (method === 'createIntersectionObserver') {
  8086. /* eslint-disable no-undef */
  8087. return my.createIntersectionObserver(args)
  8088. }
  8089. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8090. };
  8091. });
  8092. Vue.prototype.__init_provide = initProvide;
  8093. Vue.prototype.__init_injections = initInjections;
  8094. Vue.prototype.__call_hook = function(hook, args) {
  8095. var vm = this;
  8096. // #7573 disable dep collection when invoking lifecycle hooks
  8097. pushTarget();
  8098. var handlers = vm.$options[hook];
  8099. var info = hook + " hook";
  8100. var ret;
  8101. if (handlers) {
  8102. for (var i = 0, j = handlers.length; i < j; i++) {
  8103. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8104. }
  8105. }
  8106. if (vm._hasHookEvent) {
  8107. vm.$emit('hook:' + hook, args);
  8108. }
  8109. popTarget();
  8110. return ret
  8111. };
  8112. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8113. if (Array.isArray(modifiers)) {
  8114. if (modifiers.indexOf('trim') !== -1) {
  8115. value = value.trim();
  8116. }
  8117. if (modifiers.indexOf('number') !== -1) {
  8118. value = this._n(value);
  8119. }
  8120. }
  8121. if (!target) {
  8122. target = this;
  8123. }
  8124. target[key] = value;
  8125. };
  8126. Vue.prototype.__set_sync = function(target, key, value) {
  8127. if (!target) {
  8128. target = this;
  8129. }
  8130. target[key] = value;
  8131. };
  8132. Vue.prototype.__get_orig = function(item) {
  8133. if (isPlainObject(item)) {
  8134. return item['$orig'] || item
  8135. }
  8136. return item
  8137. };
  8138. Vue.prototype.__get_value = function(dataPath, target) {
  8139. return getTarget(target || this, dataPath)
  8140. };
  8141. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8142. return renderClass(staticClass, dynamicClass)
  8143. };
  8144. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8145. if (!dynamicStyle && !staticStyle) {
  8146. return ''
  8147. }
  8148. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8149. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8150. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8151. };
  8152. Vue.prototype.__map = function(val, iteratee) {
  8153. //TODO 暂不考虑 string
  8154. var ret, i, l, keys, key;
  8155. if (Array.isArray(val)) {
  8156. ret = new Array(val.length);
  8157. for (i = 0, l = val.length; i < l; i++) {
  8158. ret[i] = iteratee(val[i], i);
  8159. }
  8160. return ret
  8161. } else if (isObject(val)) {
  8162. keys = Object.keys(val);
  8163. ret = Object.create(null);
  8164. for (i = 0, l = keys.length; i < l; i++) {
  8165. key = keys[i];
  8166. ret[key] = iteratee(val[key], key, i);
  8167. }
  8168. return ret
  8169. } else if (typeof val === 'number') {
  8170. ret = new Array(val);
  8171. for (i = 0, l = val; i < l; i++) {
  8172. // 第一个参数暂时仍和小程序一致
  8173. ret[i] = iteratee(i, i);
  8174. }
  8175. return ret
  8176. }
  8177. return []
  8178. };
  8179. }
  8180. /* */
  8181. var LIFECYCLE_HOOKS$1 = [
  8182. //App
  8183. 'onLaunch',
  8184. 'onShow',
  8185. 'onHide',
  8186. 'onUniNViewMessage',
  8187. 'onPageNotFound',
  8188. 'onThemeChange',
  8189. 'onError',
  8190. 'onUnhandledRejection',
  8191. //Page
  8192. 'onInit',
  8193. 'onLoad',
  8194. // 'onShow',
  8195. 'onReady',
  8196. // 'onHide',
  8197. 'onUnload',
  8198. 'onPullDownRefresh',
  8199. 'onReachBottom',
  8200. 'onTabItemTap',
  8201. 'onAddToFavorites',
  8202. 'onShareTimeline',
  8203. 'onShareAppMessage',
  8204. 'onResize',
  8205. 'onPageScroll',
  8206. 'onNavigationBarButtonTap',
  8207. 'onBackPress',
  8208. 'onNavigationBarSearchInputChanged',
  8209. 'onNavigationBarSearchInputConfirmed',
  8210. 'onNavigationBarSearchInputClicked',
  8211. //Component
  8212. // 'onReady', // 兼容旧版本,应该移除该事件
  8213. 'onPageShow',
  8214. 'onPageHide',
  8215. 'onPageResize'
  8216. ];
  8217. function lifecycleMixin$1(Vue) {
  8218. //fixed vue-class-component
  8219. var oldExtend = Vue.extend;
  8220. Vue.extend = function(extendOptions) {
  8221. extendOptions = extendOptions || {};
  8222. var methods = extendOptions.methods;
  8223. if (methods) {
  8224. Object.keys(methods).forEach(function (methodName) {
  8225. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8226. extendOptions[methodName] = methods[methodName];
  8227. delete methods[methodName];
  8228. }
  8229. });
  8230. }
  8231. return oldExtend.call(this, extendOptions)
  8232. };
  8233. var strategies = Vue.config.optionMergeStrategies;
  8234. var mergeHook = strategies.created;
  8235. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8236. strategies[hook] = mergeHook;
  8237. });
  8238. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8239. }
  8240. /* */
  8241. // install platform patch function
  8242. Vue.prototype.__patch__ = patch;
  8243. // public mount method
  8244. Vue.prototype.$mount = function(
  8245. el ,
  8246. hydrating
  8247. ) {
  8248. return mountComponent$1(this, el, hydrating)
  8249. };
  8250. lifecycleMixin$1(Vue);
  8251. internalMixin(Vue);
  8252. /* */
  8253. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8254. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8255. /***/ }),
  8256. /***/ 20:
  8257. /*!*****************************************************************!*\
  8258. !*** C:/Users/first/Documents/HBuilderProjects/小程序/util/api.js ***!
  8259. \*****************************************************************/
  8260. /*! no static exports found */
  8261. /***/ (function(module, exports, __webpack_require__) {
  8262. "use strict";
  8263. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.myRequest = void 0;var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8264. var myRequest = function myRequest(options) {
  8265. return new Promise(function (resolve, reject) {
  8266. uni.request({
  8267. url: _settings.default.base_url + "/" + _settings.default.prefix + options.url,
  8268. method: options.method || 'GET',
  8269. data: options.data || {},
  8270. success: function success(res) {
  8271. if (res.statusCode !== 200) {
  8272. return uni.showToast({
  8273. title: '获取数据失败' });
  8274. }
  8275. resolve(res.data);
  8276. },
  8277. fail: function fail(err) {
  8278. uni.showToast({
  8279. title: '请求接口失败' });
  8280. reject(err);
  8281. } });
  8282. });
  8283. };exports.myRequest = myRequest;
  8284. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8285. /***/ }),
  8286. /***/ 27:
  8287. /*!************************************************************************!*\
  8288. !*** C:/Users/first/Documents/HBuilderProjects/小程序/util/permission.js ***!
  8289. \************************************************************************/
  8290. /*! no static exports found */
  8291. /***/ (function(module, exports, __webpack_require__) {
  8292. "use strict";
  8293. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = _default;var _index = _interopRequireDefault(__webpack_require__(/*! ../store/index.js */ 15));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8294. function _default() {
  8295. if (_index.default.state.userInfo.nickName === undefined) {
  8296. uni.navigateTo({
  8297. url: "/pages/authen/identity" });
  8298. return false;
  8299. }
  8300. if (_index.default.state.phoneNumber === '' || _index.default.state.openId === '' || _index.default.state.unionId === '') {
  8301. uni.navigateTo({
  8302. url: "/pages/authen/login" });
  8303. return false;
  8304. }
  8305. return true;
  8306. }
  8307. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8308. /***/ }),
  8309. /***/ 3:
  8310. /*!***********************************!*\
  8311. !*** (webpack)/buildin/global.js ***!
  8312. \***********************************/
  8313. /*! no static exports found */
  8314. /***/ (function(module, exports) {
  8315. var g;
  8316. // This works in non-strict mode
  8317. g = (function() {
  8318. return this;
  8319. })();
  8320. try {
  8321. // This works if eval is allowed (see CSP)
  8322. g = g || new Function("return this")();
  8323. } catch (e) {
  8324. // This works if the window reference is available
  8325. if (typeof window === "object") g = window;
  8326. }
  8327. // g can still be undefined, but nothing to do about it...
  8328. // We return undefined, instead of nothing here, so it's
  8329. // easier to handle this case. if(!global) { ...}
  8330. module.exports = g;
  8331. /***/ }),
  8332. /***/ 36:
  8333. /*!**********************************************************!*\
  8334. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8335. \**********************************************************/
  8336. /*! no static exports found */
  8337. /***/ (function(module, exports, __webpack_require__) {
  8338. module.exports = __webpack_require__(/*! regenerator-runtime */ 37);
  8339. /***/ }),
  8340. /***/ 37:
  8341. /*!************************************************************!*\
  8342. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8343. \************************************************************/
  8344. /*! no static exports found */
  8345. /***/ (function(module, exports, __webpack_require__) {
  8346. /**
  8347. * Copyright (c) 2014-present, Facebook, Inc.
  8348. *
  8349. * This source code is licensed under the MIT license found in the
  8350. * LICENSE file in the root directory of this source tree.
  8351. */
  8352. // This method of obtaining a reference to the global object needs to be
  8353. // kept identical to the way it is obtained in runtime.js
  8354. var g = (function() {
  8355. return this || (typeof self === "object" && self);
  8356. })() || Function("return this")();
  8357. // Use `getOwnPropertyNames` because not all browsers support calling
  8358. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8359. var hadRuntime = g.regeneratorRuntime &&
  8360. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8361. // Save the old regeneratorRuntime in case it needs to be restored later.
  8362. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8363. // Force reevalutation of runtime.js.
  8364. g.regeneratorRuntime = undefined;
  8365. module.exports = __webpack_require__(/*! ./runtime */ 38);
  8366. if (hadRuntime) {
  8367. // Restore the original runtime.
  8368. g.regeneratorRuntime = oldRuntime;
  8369. } else {
  8370. // Remove the global property added by runtime.js.
  8371. try {
  8372. delete g.regeneratorRuntime;
  8373. } catch(e) {
  8374. g.regeneratorRuntime = undefined;
  8375. }
  8376. }
  8377. /***/ }),
  8378. /***/ 38:
  8379. /*!*****************************************************!*\
  8380. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8381. \*****************************************************/
  8382. /*! no static exports found */
  8383. /***/ (function(module, exports) {
  8384. /**
  8385. * Copyright (c) 2014-present, Facebook, Inc.
  8386. *
  8387. * This source code is licensed under the MIT license found in the
  8388. * LICENSE file in the root directory of this source tree.
  8389. */
  8390. !(function(global) {
  8391. "use strict";
  8392. var Op = Object.prototype;
  8393. var hasOwn = Op.hasOwnProperty;
  8394. var undefined; // More compressible than void 0.
  8395. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8396. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8397. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8398. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8399. var inModule = typeof module === "object";
  8400. var runtime = global.regeneratorRuntime;
  8401. if (runtime) {
  8402. if (inModule) {
  8403. // If regeneratorRuntime is defined globally and we're in a module,
  8404. // make the exports object identical to regeneratorRuntime.
  8405. module.exports = runtime;
  8406. }
  8407. // Don't bother evaluating the rest of this file if the runtime was
  8408. // already defined globally.
  8409. return;
  8410. }
  8411. // Define the runtime globally (as expected by generated code) as either
  8412. // module.exports (if we're in a module) or a new, empty object.
  8413. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  8414. function wrap(innerFn, outerFn, self, tryLocsList) {
  8415. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  8416. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  8417. var generator = Object.create(protoGenerator.prototype);
  8418. var context = new Context(tryLocsList || []);
  8419. // The ._invoke method unifies the implementations of the .next,
  8420. // .throw, and .return methods.
  8421. generator._invoke = makeInvokeMethod(innerFn, self, context);
  8422. return generator;
  8423. }
  8424. runtime.wrap = wrap;
  8425. // Try/catch helper to minimize deoptimizations. Returns a completion
  8426. // record like context.tryEntries[i].completion. This interface could
  8427. // have been (and was previously) designed to take a closure to be
  8428. // invoked without arguments, but in all the cases we care about we
  8429. // already have an existing method we want to call, so there's no need
  8430. // to create a new function object. We can even get away with assuming
  8431. // the method takes exactly one argument, since that happens to be true
  8432. // in every case, so we don't have to touch the arguments object. The
  8433. // only additional allocation required is the completion record, which
  8434. // has a stable shape and so hopefully should be cheap to allocate.
  8435. function tryCatch(fn, obj, arg) {
  8436. try {
  8437. return { type: "normal", arg: fn.call(obj, arg) };
  8438. } catch (err) {
  8439. return { type: "throw", arg: err };
  8440. }
  8441. }
  8442. var GenStateSuspendedStart = "suspendedStart";
  8443. var GenStateSuspendedYield = "suspendedYield";
  8444. var GenStateExecuting = "executing";
  8445. var GenStateCompleted = "completed";
  8446. // Returning this object from the innerFn has the same effect as
  8447. // breaking out of the dispatch switch statement.
  8448. var ContinueSentinel = {};
  8449. // Dummy constructor functions that we use as the .constructor and
  8450. // .constructor.prototype properties for functions that return Generator
  8451. // objects. For full spec compliance, you may wish to configure your
  8452. // minifier not to mangle the names of these two functions.
  8453. function Generator() {}
  8454. function GeneratorFunction() {}
  8455. function GeneratorFunctionPrototype() {}
  8456. // This is a polyfill for %IteratorPrototype% for environments that
  8457. // don't natively support it.
  8458. var IteratorPrototype = {};
  8459. IteratorPrototype[iteratorSymbol] = function () {
  8460. return this;
  8461. };
  8462. var getProto = Object.getPrototypeOf;
  8463. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8464. if (NativeIteratorPrototype &&
  8465. NativeIteratorPrototype !== Op &&
  8466. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8467. // This environment has a native %IteratorPrototype%; use it instead
  8468. // of the polyfill.
  8469. IteratorPrototype = NativeIteratorPrototype;
  8470. }
  8471. var Gp = GeneratorFunctionPrototype.prototype =
  8472. Generator.prototype = Object.create(IteratorPrototype);
  8473. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8474. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8475. GeneratorFunctionPrototype[toStringTagSymbol] =
  8476. GeneratorFunction.displayName = "GeneratorFunction";
  8477. // Helper for defining the .next, .throw, and .return methods of the
  8478. // Iterator interface in terms of a single ._invoke method.
  8479. function defineIteratorMethods(prototype) {
  8480. ["next", "throw", "return"].forEach(function(method) {
  8481. prototype[method] = function(arg) {
  8482. return this._invoke(method, arg);
  8483. };
  8484. });
  8485. }
  8486. runtime.isGeneratorFunction = function(genFun) {
  8487. var ctor = typeof genFun === "function" && genFun.constructor;
  8488. return ctor
  8489. ? ctor === GeneratorFunction ||
  8490. // For the native GeneratorFunction constructor, the best we can
  8491. // do is to check its .name property.
  8492. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8493. : false;
  8494. };
  8495. runtime.mark = function(genFun) {
  8496. if (Object.setPrototypeOf) {
  8497. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8498. } else {
  8499. genFun.__proto__ = GeneratorFunctionPrototype;
  8500. if (!(toStringTagSymbol in genFun)) {
  8501. genFun[toStringTagSymbol] = "GeneratorFunction";
  8502. }
  8503. }
  8504. genFun.prototype = Object.create(Gp);
  8505. return genFun;
  8506. };
  8507. // Within the body of any async function, `await x` is transformed to
  8508. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8509. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8510. // meant to be awaited.
  8511. runtime.awrap = function(arg) {
  8512. return { __await: arg };
  8513. };
  8514. function AsyncIterator(generator) {
  8515. function invoke(method, arg, resolve, reject) {
  8516. var record = tryCatch(generator[method], generator, arg);
  8517. if (record.type === "throw") {
  8518. reject(record.arg);
  8519. } else {
  8520. var result = record.arg;
  8521. var value = result.value;
  8522. if (value &&
  8523. typeof value === "object" &&
  8524. hasOwn.call(value, "__await")) {
  8525. return Promise.resolve(value.__await).then(function(value) {
  8526. invoke("next", value, resolve, reject);
  8527. }, function(err) {
  8528. invoke("throw", err, resolve, reject);
  8529. });
  8530. }
  8531. return Promise.resolve(value).then(function(unwrapped) {
  8532. // When a yielded Promise is resolved, its final value becomes
  8533. // the .value of the Promise<{value,done}> result for the
  8534. // current iteration.
  8535. result.value = unwrapped;
  8536. resolve(result);
  8537. }, function(error) {
  8538. // If a rejected Promise was yielded, throw the rejection back
  8539. // into the async generator function so it can be handled there.
  8540. return invoke("throw", error, resolve, reject);
  8541. });
  8542. }
  8543. }
  8544. var previousPromise;
  8545. function enqueue(method, arg) {
  8546. function callInvokeWithMethodAndArg() {
  8547. return new Promise(function(resolve, reject) {
  8548. invoke(method, arg, resolve, reject);
  8549. });
  8550. }
  8551. return previousPromise =
  8552. // If enqueue has been called before, then we want to wait until
  8553. // all previous Promises have been resolved before calling invoke,
  8554. // so that results are always delivered in the correct order. If
  8555. // enqueue has not been called before, then it is important to
  8556. // call invoke immediately, without waiting on a callback to fire,
  8557. // so that the async generator function has the opportunity to do
  8558. // any necessary setup in a predictable way. This predictability
  8559. // is why the Promise constructor synchronously invokes its
  8560. // executor callback, and why async functions synchronously
  8561. // execute code before the first await. Since we implement simple
  8562. // async functions in terms of async generators, it is especially
  8563. // important to get this right, even though it requires care.
  8564. previousPromise ? previousPromise.then(
  8565. callInvokeWithMethodAndArg,
  8566. // Avoid propagating failures to Promises returned by later
  8567. // invocations of the iterator.
  8568. callInvokeWithMethodAndArg
  8569. ) : callInvokeWithMethodAndArg();
  8570. }
  8571. // Define the unified helper method that is used to implement .next,
  8572. // .throw, and .return (see defineIteratorMethods).
  8573. this._invoke = enqueue;
  8574. }
  8575. defineIteratorMethods(AsyncIterator.prototype);
  8576. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8577. return this;
  8578. };
  8579. runtime.AsyncIterator = AsyncIterator;
  8580. // Note that simple async functions are implemented on top of
  8581. // AsyncIterator objects; they just return a Promise for the value of
  8582. // the final result produced by the iterator.
  8583. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  8584. var iter = new AsyncIterator(
  8585. wrap(innerFn, outerFn, self, tryLocsList)
  8586. );
  8587. return runtime.isGeneratorFunction(outerFn)
  8588. ? iter // If outerFn is a generator, return the full iterator.
  8589. : iter.next().then(function(result) {
  8590. return result.done ? result.value : iter.next();
  8591. });
  8592. };
  8593. function makeInvokeMethod(innerFn, self, context) {
  8594. var state = GenStateSuspendedStart;
  8595. return function invoke(method, arg) {
  8596. if (state === GenStateExecuting) {
  8597. throw new Error("Generator is already running");
  8598. }
  8599. if (state === GenStateCompleted) {
  8600. if (method === "throw") {
  8601. throw arg;
  8602. }
  8603. // Be forgiving, per 25.3.3.3.3 of the spec:
  8604. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8605. return doneResult();
  8606. }
  8607. context.method = method;
  8608. context.arg = arg;
  8609. while (true) {
  8610. var delegate = context.delegate;
  8611. if (delegate) {
  8612. var delegateResult = maybeInvokeDelegate(delegate, context);
  8613. if (delegateResult) {
  8614. if (delegateResult === ContinueSentinel) continue;
  8615. return delegateResult;
  8616. }
  8617. }
  8618. if (context.method === "next") {
  8619. // Setting context._sent for legacy support of Babel's
  8620. // function.sent implementation.
  8621. context.sent = context._sent = context.arg;
  8622. } else if (context.method === "throw") {
  8623. if (state === GenStateSuspendedStart) {
  8624. state = GenStateCompleted;
  8625. throw context.arg;
  8626. }
  8627. context.dispatchException(context.arg);
  8628. } else if (context.method === "return") {
  8629. context.abrupt("return", context.arg);
  8630. }
  8631. state = GenStateExecuting;
  8632. var record = tryCatch(innerFn, self, context);
  8633. if (record.type === "normal") {
  8634. // If an exception is thrown from innerFn, we leave state ===
  8635. // GenStateExecuting and loop back for another invocation.
  8636. state = context.done
  8637. ? GenStateCompleted
  8638. : GenStateSuspendedYield;
  8639. if (record.arg === ContinueSentinel) {
  8640. continue;
  8641. }
  8642. return {
  8643. value: record.arg,
  8644. done: context.done
  8645. };
  8646. } else if (record.type === "throw") {
  8647. state = GenStateCompleted;
  8648. // Dispatch the exception by looping back around to the
  8649. // context.dispatchException(context.arg) call above.
  8650. context.method = "throw";
  8651. context.arg = record.arg;
  8652. }
  8653. }
  8654. };
  8655. }
  8656. // Call delegate.iterator[context.method](context.arg) and handle the
  8657. // result, either by returning a { value, done } result from the
  8658. // delegate iterator, or by modifying context.method and context.arg,
  8659. // setting context.delegate to null, and returning the ContinueSentinel.
  8660. function maybeInvokeDelegate(delegate, context) {
  8661. var method = delegate.iterator[context.method];
  8662. if (method === undefined) {
  8663. // A .throw or .return when the delegate iterator has no .throw
  8664. // method always terminates the yield* loop.
  8665. context.delegate = null;
  8666. if (context.method === "throw") {
  8667. if (delegate.iterator.return) {
  8668. // If the delegate iterator has a return method, give it a
  8669. // chance to clean up.
  8670. context.method = "return";
  8671. context.arg = undefined;
  8672. maybeInvokeDelegate(delegate, context);
  8673. if (context.method === "throw") {
  8674. // If maybeInvokeDelegate(context) changed context.method from
  8675. // "return" to "throw", let that override the TypeError below.
  8676. return ContinueSentinel;
  8677. }
  8678. }
  8679. context.method = "throw";
  8680. context.arg = new TypeError(
  8681. "The iterator does not provide a 'throw' method");
  8682. }
  8683. return ContinueSentinel;
  8684. }
  8685. var record = tryCatch(method, delegate.iterator, context.arg);
  8686. if (record.type === "throw") {
  8687. context.method = "throw";
  8688. context.arg = record.arg;
  8689. context.delegate = null;
  8690. return ContinueSentinel;
  8691. }
  8692. var info = record.arg;
  8693. if (! info) {
  8694. context.method = "throw";
  8695. context.arg = new TypeError("iterator result is not an object");
  8696. context.delegate = null;
  8697. return ContinueSentinel;
  8698. }
  8699. if (info.done) {
  8700. // Assign the result of the finished delegate to the temporary
  8701. // variable specified by delegate.resultName (see delegateYield).
  8702. context[delegate.resultName] = info.value;
  8703. // Resume execution at the desired location (see delegateYield).
  8704. context.next = delegate.nextLoc;
  8705. // If context.method was "throw" but the delegate handled the
  8706. // exception, let the outer generator proceed normally. If
  8707. // context.method was "next", forget context.arg since it has been
  8708. // "consumed" by the delegate iterator. If context.method was
  8709. // "return", allow the original .return call to continue in the
  8710. // outer generator.
  8711. if (context.method !== "return") {
  8712. context.method = "next";
  8713. context.arg = undefined;
  8714. }
  8715. } else {
  8716. // Re-yield the result returned by the delegate method.
  8717. return info;
  8718. }
  8719. // The delegate iterator is finished, so forget it and continue with
  8720. // the outer generator.
  8721. context.delegate = null;
  8722. return ContinueSentinel;
  8723. }
  8724. // Define Generator.prototype.{next,throw,return} in terms of the
  8725. // unified ._invoke helper method.
  8726. defineIteratorMethods(Gp);
  8727. Gp[toStringTagSymbol] = "Generator";
  8728. // A Generator should always return itself as the iterator object when the
  8729. // @@iterator function is called on it. Some browsers' implementations of the
  8730. // iterator prototype chain incorrectly implement this, causing the Generator
  8731. // object to not be returned from this call. This ensures that doesn't happen.
  8732. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8733. Gp[iteratorSymbol] = function() {
  8734. return this;
  8735. };
  8736. Gp.toString = function() {
  8737. return "[object Generator]";
  8738. };
  8739. function pushTryEntry(locs) {
  8740. var entry = { tryLoc: locs[0] };
  8741. if (1 in locs) {
  8742. entry.catchLoc = locs[1];
  8743. }
  8744. if (2 in locs) {
  8745. entry.finallyLoc = locs[2];
  8746. entry.afterLoc = locs[3];
  8747. }
  8748. this.tryEntries.push(entry);
  8749. }
  8750. function resetTryEntry(entry) {
  8751. var record = entry.completion || {};
  8752. record.type = "normal";
  8753. delete record.arg;
  8754. entry.completion = record;
  8755. }
  8756. function Context(tryLocsList) {
  8757. // The root entry object (effectively a try statement without a catch
  8758. // or a finally block) gives us a place to store values thrown from
  8759. // locations where there is no enclosing try statement.
  8760. this.tryEntries = [{ tryLoc: "root" }];
  8761. tryLocsList.forEach(pushTryEntry, this);
  8762. this.reset(true);
  8763. }
  8764. runtime.keys = function(object) {
  8765. var keys = [];
  8766. for (var key in object) {
  8767. keys.push(key);
  8768. }
  8769. keys.reverse();
  8770. // Rather than returning an object with a next method, we keep
  8771. // things simple and return the next function itself.
  8772. return function next() {
  8773. while (keys.length) {
  8774. var key = keys.pop();
  8775. if (key in object) {
  8776. next.value = key;
  8777. next.done = false;
  8778. return next;
  8779. }
  8780. }
  8781. // To avoid creating an additional object, we just hang the .value
  8782. // and .done properties off the next function object itself. This
  8783. // also ensures that the minifier will not anonymize the function.
  8784. next.done = true;
  8785. return next;
  8786. };
  8787. };
  8788. function values(iterable) {
  8789. if (iterable) {
  8790. var iteratorMethod = iterable[iteratorSymbol];
  8791. if (iteratorMethod) {
  8792. return iteratorMethod.call(iterable);
  8793. }
  8794. if (typeof iterable.next === "function") {
  8795. return iterable;
  8796. }
  8797. if (!isNaN(iterable.length)) {
  8798. var i = -1, next = function next() {
  8799. while (++i < iterable.length) {
  8800. if (hasOwn.call(iterable, i)) {
  8801. next.value = iterable[i];
  8802. next.done = false;
  8803. return next;
  8804. }
  8805. }
  8806. next.value = undefined;
  8807. next.done = true;
  8808. return next;
  8809. };
  8810. return next.next = next;
  8811. }
  8812. }
  8813. // Return an iterator with no values.
  8814. return { next: doneResult };
  8815. }
  8816. runtime.values = values;
  8817. function doneResult() {
  8818. return { value: undefined, done: true };
  8819. }
  8820. Context.prototype = {
  8821. constructor: Context,
  8822. reset: function(skipTempReset) {
  8823. this.prev = 0;
  8824. this.next = 0;
  8825. // Resetting context._sent for legacy support of Babel's
  8826. // function.sent implementation.
  8827. this.sent = this._sent = undefined;
  8828. this.done = false;
  8829. this.delegate = null;
  8830. this.method = "next";
  8831. this.arg = undefined;
  8832. this.tryEntries.forEach(resetTryEntry);
  8833. if (!skipTempReset) {
  8834. for (var name in this) {
  8835. // Not sure about the optimal order of these conditions:
  8836. if (name.charAt(0) === "t" &&
  8837. hasOwn.call(this, name) &&
  8838. !isNaN(+name.slice(1))) {
  8839. this[name] = undefined;
  8840. }
  8841. }
  8842. }
  8843. },
  8844. stop: function() {
  8845. this.done = true;
  8846. var rootEntry = this.tryEntries[0];
  8847. var rootRecord = rootEntry.completion;
  8848. if (rootRecord.type === "throw") {
  8849. throw rootRecord.arg;
  8850. }
  8851. return this.rval;
  8852. },
  8853. dispatchException: function(exception) {
  8854. if (this.done) {
  8855. throw exception;
  8856. }
  8857. var context = this;
  8858. function handle(loc, caught) {
  8859. record.type = "throw";
  8860. record.arg = exception;
  8861. context.next = loc;
  8862. if (caught) {
  8863. // If the dispatched exception was caught by a catch block,
  8864. // then let that catch block handle the exception normally.
  8865. context.method = "next";
  8866. context.arg = undefined;
  8867. }
  8868. return !! caught;
  8869. }
  8870. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8871. var entry = this.tryEntries[i];
  8872. var record = entry.completion;
  8873. if (entry.tryLoc === "root") {
  8874. // Exception thrown outside of any try block that could handle
  8875. // it, so set the completion value of the entire function to
  8876. // throw the exception.
  8877. return handle("end");
  8878. }
  8879. if (entry.tryLoc <= this.prev) {
  8880. var hasCatch = hasOwn.call(entry, "catchLoc");
  8881. var hasFinally = hasOwn.call(entry, "finallyLoc");
  8882. if (hasCatch && hasFinally) {
  8883. if (this.prev < entry.catchLoc) {
  8884. return handle(entry.catchLoc, true);
  8885. } else if (this.prev < entry.finallyLoc) {
  8886. return handle(entry.finallyLoc);
  8887. }
  8888. } else if (hasCatch) {
  8889. if (this.prev < entry.catchLoc) {
  8890. return handle(entry.catchLoc, true);
  8891. }
  8892. } else if (hasFinally) {
  8893. if (this.prev < entry.finallyLoc) {
  8894. return handle(entry.finallyLoc);
  8895. }
  8896. } else {
  8897. throw new Error("try statement without catch or finally");
  8898. }
  8899. }
  8900. }
  8901. },
  8902. abrupt: function(type, arg) {
  8903. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8904. var entry = this.tryEntries[i];
  8905. if (entry.tryLoc <= this.prev &&
  8906. hasOwn.call(entry, "finallyLoc") &&
  8907. this.prev < entry.finallyLoc) {
  8908. var finallyEntry = entry;
  8909. break;
  8910. }
  8911. }
  8912. if (finallyEntry &&
  8913. (type === "break" ||
  8914. type === "continue") &&
  8915. finallyEntry.tryLoc <= arg &&
  8916. arg <= finallyEntry.finallyLoc) {
  8917. // Ignore the finally entry if control is not jumping to a
  8918. // location outside the try/catch block.
  8919. finallyEntry = null;
  8920. }
  8921. var record = finallyEntry ? finallyEntry.completion : {};
  8922. record.type = type;
  8923. record.arg = arg;
  8924. if (finallyEntry) {
  8925. this.method = "next";
  8926. this.next = finallyEntry.finallyLoc;
  8927. return ContinueSentinel;
  8928. }
  8929. return this.complete(record);
  8930. },
  8931. complete: function(record, afterLoc) {
  8932. if (record.type === "throw") {
  8933. throw record.arg;
  8934. }
  8935. if (record.type === "break" ||
  8936. record.type === "continue") {
  8937. this.next = record.arg;
  8938. } else if (record.type === "return") {
  8939. this.rval = this.arg = record.arg;
  8940. this.method = "return";
  8941. this.next = "end";
  8942. } else if (record.type === "normal" && afterLoc) {
  8943. this.next = afterLoc;
  8944. }
  8945. return ContinueSentinel;
  8946. },
  8947. finish: function(finallyLoc) {
  8948. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8949. var entry = this.tryEntries[i];
  8950. if (entry.finallyLoc === finallyLoc) {
  8951. this.complete(entry.completion, entry.afterLoc);
  8952. resetTryEntry(entry);
  8953. return ContinueSentinel;
  8954. }
  8955. }
  8956. },
  8957. "catch": function(tryLoc) {
  8958. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8959. var entry = this.tryEntries[i];
  8960. if (entry.tryLoc === tryLoc) {
  8961. var record = entry.completion;
  8962. if (record.type === "throw") {
  8963. var thrown = record.arg;
  8964. resetTryEntry(entry);
  8965. }
  8966. return thrown;
  8967. }
  8968. }
  8969. // The context.catch method must only be called with a location
  8970. // argument that corresponds to a known catch block.
  8971. throw new Error("illegal catch attempt");
  8972. },
  8973. delegateYield: function(iterable, resultName, nextLoc) {
  8974. this.delegate = {
  8975. iterator: values(iterable),
  8976. resultName: resultName,
  8977. nextLoc: nextLoc
  8978. };
  8979. if (this.method === "next") {
  8980. // Deliberately forget the last sent value so that we don't
  8981. // accidentally pass it on to the delegate.
  8982. this.arg = undefined;
  8983. }
  8984. return ContinueSentinel;
  8985. }
  8986. };
  8987. })(
  8988. // In sloppy mode, unbound `this` refers to the global object, fallback to
  8989. // Function constructor if we're in global strict mode. That is sadly a form
  8990. // of indirect eval which violates Content Security Policy.
  8991. (function() {
  8992. return this || (typeof self === "object" && self);
  8993. })() || Function("return this")()
  8994. );
  8995. /***/ }),
  8996. /***/ 4:
  8997. /*!****************************************************************!*\
  8998. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json ***!
  8999. \****************************************************************/
  9000. /*! no static exports found */
  9001. /***/ (function(module, exports) {
  9002. /***/ }),
  9003. /***/ 5:
  9004. /*!*******************************************************!*\
  9005. !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
  9006. \*******************************************************/
  9007. /*! no static exports found */
  9008. /***/ (function(module, exports, __webpack_require__) {
  9009. "use strict";
  9010. /* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 6);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 _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}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 _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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;}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;}
  9011. var STAT_VERSION = _package.version;
  9012. var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
  9013. var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
  9014. var PAGE_PVER_TIME = 1800;
  9015. var APP_PVER_TIME = 300;
  9016. var OPERATING_TIME = 10;
  9017. var DIFF_TIME = 60 * 1000 * 60 * 24;
  9018. var statConfig = __webpack_require__(/*! uni-stat-config */ 7).default || __webpack_require__(/*! uni-stat-config */ 7);
  9019. var UUID_KEY = '__DC_STAT_UUID';
  9020. var UUID_VALUE = '__DC_UUID_VALUE';
  9021. function getUuid() {
  9022. var uuid = '';
  9023. if (getPlatformName() === 'n') {
  9024. try {
  9025. uuid = plus.runtime.getDCloudId();
  9026. } catch (e) {
  9027. uuid = '';
  9028. }
  9029. return uuid;
  9030. }
  9031. try {
  9032. uuid = uni.getStorageSync(UUID_KEY);
  9033. } catch (e) {
  9034. uuid = UUID_VALUE;
  9035. }
  9036. if (!uuid) {
  9037. uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
  9038. try {
  9039. uni.setStorageSync(UUID_KEY, uuid);
  9040. } catch (e) {
  9041. uni.setStorageSync(UUID_KEY, UUID_VALUE);
  9042. }
  9043. }
  9044. return uuid;
  9045. }
  9046. var getSgin = function getSgin(statData) {
  9047. var arr = Object.keys(statData);
  9048. var sortArr = arr.sort();
  9049. var sgin = {};
  9050. var sginStr = '';
  9051. for (var i in sortArr) {
  9052. sgin[sortArr[i]] = statData[sortArr[i]];
  9053. sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
  9054. }
  9055. // const options = sginStr.substr(0, sginStr.length - 1)
  9056. // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
  9057. // const si = crypto.createHash('md5').update(sginStr).digest('hex');
  9058. return {
  9059. sign: '',
  9060. options: sginStr.substr(0, sginStr.length - 1) };
  9061. };
  9062. var getSplicing = function getSplicing(data) {
  9063. var str = '';
  9064. for (var i in data) {
  9065. str += i + '=' + data[i] + '&';
  9066. }
  9067. return str.substr(0, str.length - 1);
  9068. };
  9069. var getTime = function getTime() {
  9070. return parseInt(new Date().getTime() / 1000);
  9071. };
  9072. var getPlatformName = function getPlatformName() {var _platformList;
  9073. var aliArr = ['y', 'a', 'p', 'mp-ali'];
  9074. var platformList = (_platformList = {
  9075. 'app-plus': 'n',
  9076. 'h5': 'h5',
  9077. 'mp-weixin': 'wx' }, _defineProperty(_platformList,
  9078. aliArr.reverse().join(''), 'ali'), _defineProperty(_platformList,
  9079. 'mp-baidu', 'bd'), _defineProperty(_platformList,
  9080. 'mp-toutiao', 'tt'), _defineProperty(_platformList,
  9081. 'mp-qq', 'qq'), _defineProperty(_platformList,
  9082. 'quickapp-native', 'qn'), _defineProperty(_platformList,
  9083. 'mp-kuaishou', 'ks'), _platformList);
  9084. return platformList["mp-weixin"];
  9085. };
  9086. var getPackName = function getPackName() {
  9087. var packName = '';
  9088. if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
  9089. // 兼容微信小程序低版本基础库
  9090. if (uni.canIUse('getAccountInfoSync')) {
  9091. packName = uni.getAccountInfoSync().miniProgram.appId || '';
  9092. }
  9093. }
  9094. return packName;
  9095. };
  9096. var getVersion = function getVersion() {
  9097. return getPlatformName() === 'n' ? plus.runtime.version : '';
  9098. };
  9099. var getChannel = function getChannel() {
  9100. var platformName = getPlatformName();
  9101. var channel = '';
  9102. if (platformName === 'n') {
  9103. channel = plus.runtime.channel;
  9104. }
  9105. return channel;
  9106. };
  9107. var getScene = function getScene(options) {
  9108. var platformName = getPlatformName();
  9109. var scene = '';
  9110. if (options) {
  9111. return options;
  9112. }
  9113. if (platformName === 'wx') {
  9114. scene = uni.getLaunchOptionsSync().scene;
  9115. }
  9116. return scene;
  9117. };
  9118. var First__Visit__Time__KEY = 'First__Visit__Time';
  9119. var Last__Visit__Time__KEY = 'Last__Visit__Time';
  9120. var getFirstVisitTime = function getFirstVisitTime() {
  9121. var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
  9122. var time = 0;
  9123. if (timeStorge) {
  9124. time = timeStorge;
  9125. } else {
  9126. time = getTime();
  9127. uni.setStorageSync(First__Visit__Time__KEY, time);
  9128. uni.removeStorageSync(Last__Visit__Time__KEY);
  9129. }
  9130. return time;
  9131. };
  9132. var getLastVisitTime = function getLastVisitTime() {
  9133. var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
  9134. var time = 0;
  9135. if (timeStorge) {
  9136. time = timeStorge;
  9137. } else {
  9138. time = '';
  9139. }
  9140. uni.setStorageSync(Last__Visit__Time__KEY, getTime());
  9141. return time;
  9142. };
  9143. var PAGE_RESIDENCE_TIME = '__page__residence__time';
  9144. var First_Page_residence_time = 0;
  9145. var Last_Page_residence_time = 0;
  9146. var setPageResidenceTime = function setPageResidenceTime() {
  9147. First_Page_residence_time = getTime();
  9148. if (getPlatformName() === 'n') {
  9149. uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
  9150. }
  9151. return First_Page_residence_time;
  9152. };
  9153. var getPageResidenceTime = function getPageResidenceTime() {
  9154. Last_Page_residence_time = getTime();
  9155. if (getPlatformName() === 'n') {
  9156. First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
  9157. }
  9158. return Last_Page_residence_time - First_Page_residence_time;
  9159. };
  9160. var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
  9161. var getTotalVisitCount = function getTotalVisitCount() {
  9162. var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
  9163. var count = 1;
  9164. if (timeStorge) {
  9165. count = timeStorge;
  9166. count++;
  9167. }
  9168. uni.setStorageSync(TOTAL__VISIT__COUNT, count);
  9169. return count;
  9170. };
  9171. var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
  9172. var data = {};
  9173. for (var prop in statData) {
  9174. data[prop] = encodeURIComponent(statData[prop]);
  9175. }
  9176. return data;
  9177. };
  9178. var Set__First__Time = 0;
  9179. var Set__Last__Time = 0;
  9180. var getFirstTime = function getFirstTime() {
  9181. var time = new Date().getTime();
  9182. Set__First__Time = time;
  9183. Set__Last__Time = 0;
  9184. return time;
  9185. };
  9186. var getLastTime = function getLastTime() {
  9187. var time = new Date().getTime();
  9188. Set__Last__Time = time;
  9189. return time;
  9190. };
  9191. var getResidenceTime = function getResidenceTime(type) {
  9192. var residenceTime = 0;
  9193. if (Set__First__Time !== 0) {
  9194. residenceTime = Set__Last__Time - Set__First__Time;
  9195. }
  9196. residenceTime = parseInt(residenceTime / 1000);
  9197. residenceTime = residenceTime < 1 ? 1 : residenceTime;
  9198. if (type === 'app') {
  9199. var overtime = residenceTime > APP_PVER_TIME ? true : false;
  9200. return {
  9201. residenceTime: residenceTime,
  9202. overtime: overtime };
  9203. }
  9204. if (type === 'page') {
  9205. var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
  9206. return {
  9207. residenceTime: residenceTime,
  9208. overtime: _overtime };
  9209. }
  9210. return {
  9211. residenceTime: residenceTime };
  9212. };
  9213. var getRoute = function getRoute() {
  9214. var pages = getCurrentPages();
  9215. var page = pages[pages.length - 1];
  9216. if (!page) return '';
  9217. var _self = page.$vm;
  9218. if (getPlatformName() === 'bd') {
  9219. return _self.$mp && _self.$mp.page.is;
  9220. } else {
  9221. return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
  9222. }
  9223. };
  9224. var getPageRoute = function getPageRoute(self) {
  9225. var pages = getCurrentPages();
  9226. var page = pages[pages.length - 1];
  9227. if (!page) return '';
  9228. var _self = page.$vm;
  9229. var query = self._query;
  9230. var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
  9231. // clear
  9232. self._query = '';
  9233. if (getPlatformName() === 'bd') {
  9234. return _self.$mp && _self.$mp.page.is + str;
  9235. } else {
  9236. return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
  9237. }
  9238. };
  9239. var getPageTypes = function getPageTypes(self) {
  9240. if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
  9241. return true;
  9242. }
  9243. return false;
  9244. };
  9245. var calibration = function calibration(eventName, options) {
  9246. // login 、 share 、pay_success 、pay_fail 、register 、title
  9247. if (!eventName) {
  9248. console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
  9249. return true;
  9250. }
  9251. if (typeof eventName !== 'string') {
  9252. console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
  9253. return true;
  9254. }
  9255. if (eventName.length > 255) {
  9256. console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  9257. return true;
  9258. }
  9259. if (typeof options !== 'string' && typeof options !== 'object') {
  9260. console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
  9261. return true;
  9262. }
  9263. if (typeof options === 'string' && options.length > 255) {
  9264. console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  9265. return true;
  9266. }
  9267. if (eventName === 'title' && typeof options !== 'string') {
  9268. console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
  9269. return true;
  9270. }
  9271. };
  9272. var Report_Data_Time = 'Report_Data_Time';
  9273. var Report_Status = 'Report_Status';
  9274. var isReportData = function isReportData() {
  9275. return new Promise(function (resolve, reject) {
  9276. var start_time = '';
  9277. var end_time = new Date().getTime();
  9278. var diff_time = DIFF_TIME;
  9279. var report_status = 1;
  9280. try {
  9281. start_time = uni.getStorageSync(Report_Data_Time);
  9282. report_status = uni.getStorageSync(Report_Status);
  9283. } catch (e) {
  9284. start_time = '';
  9285. report_status = 1;
  9286. }
  9287. if (report_status === '') {
  9288. requestData(function (_ref)
  9289. {var enable = _ref.enable;
  9290. uni.setStorageSync(Report_Data_Time, end_time);
  9291. uni.setStorageSync(Report_Status, enable);
  9292. if (enable === 1) {
  9293. resolve();
  9294. }
  9295. });
  9296. return;
  9297. }
  9298. if (report_status === 1) {
  9299. resolve();
  9300. }
  9301. if (!start_time) {
  9302. uni.setStorageSync(Report_Data_Time, end_time);
  9303. start_time = end_time;
  9304. }
  9305. if (end_time - start_time > diff_time) {
  9306. requestData(function (_ref2)
  9307. {var enable = _ref2.enable;
  9308. uni.setStorageSync(Report_Data_Time, end_time);
  9309. uni.setStorageSync(Report_Status, enable);
  9310. });
  9311. }
  9312. });
  9313. };
  9314. var requestData = function requestData(done) {
  9315. var formData = {
  9316. usv: STAT_VERSION,
  9317. conf: JSON.stringify({
  9318. ak: statConfig.appid }) };
  9319. uni.request({
  9320. url: STAT_URL,
  9321. method: 'GET',
  9322. data: formData,
  9323. success: function success(res) {var
  9324. data =
  9325. res.data;
  9326. if (data.ret === 0) {
  9327. typeof done === 'function' && done({
  9328. enable: data.enable });
  9329. }
  9330. },
  9331. fail: function fail(e) {
  9332. var report_status_code = 1;
  9333. try {
  9334. report_status_code = uni.getStorageSync(Report_Status);
  9335. } catch (e) {
  9336. report_status_code = 1;
  9337. }
  9338. if (report_status_code === '') {
  9339. report_status_code = 1;
  9340. }
  9341. typeof done === 'function' && done({
  9342. enable: report_status_code });
  9343. } });
  9344. };
  9345. var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 8).default;
  9346. var statConfig$1 = __webpack_require__(/*! uni-stat-config */ 7).default || __webpack_require__(/*! uni-stat-config */ 7);
  9347. var resultOptions = uni.getSystemInfoSync();var
  9348. Util = /*#__PURE__*/function () {
  9349. function Util() {_classCallCheck(this, Util);
  9350. this.self = '';
  9351. this._retry = 0;
  9352. this._platform = '';
  9353. this._query = {};
  9354. this._navigationBarTitle = {
  9355. config: '',
  9356. page: '',
  9357. report: '',
  9358. lt: '' };
  9359. this._operatingTime = 0;
  9360. this._reportingRequestData = {
  9361. '1': [],
  9362. '11': [] };
  9363. this.__prevent_triggering = false;
  9364. this.__licationHide = false;
  9365. this.__licationShow = false;
  9366. this._lastPageRoute = '';
  9367. this.statData = {
  9368. uuid: getUuid(),
  9369. ut: getPlatformName(),
  9370. mpn: getPackName(),
  9371. ak: statConfig$1.appid,
  9372. usv: STAT_VERSION,
  9373. v: getVersion(),
  9374. ch: getChannel(),
  9375. cn: '',
  9376. pn: '',
  9377. ct: '',
  9378. t: getTime(),
  9379. tt: '',
  9380. p: resultOptions.platform === 'android' ? 'a' : 'i',
  9381. brand: resultOptions.brand || '',
  9382. md: resultOptions.model,
  9383. sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
  9384. mpsdk: resultOptions.SDKVersion || '',
  9385. mpv: resultOptions.version || '',
  9386. lang: resultOptions.language,
  9387. pr: resultOptions.pixelRatio,
  9388. ww: resultOptions.windowWidth,
  9389. wh: resultOptions.windowHeight,
  9390. sw: resultOptions.screenWidth,
  9391. sh: resultOptions.screenHeight };
  9392. }_createClass(Util, [{ key: "getIsReportData", value: function getIsReportData()
  9393. {
  9394. return isReportData();
  9395. } }, { key: "_applicationShow", value: function _applicationShow()
  9396. {
  9397. if (this.__licationHide) {
  9398. getLastTime();
  9399. var time = getResidenceTime('app');
  9400. if (time.overtime) {
  9401. var options = {
  9402. path: this._lastPageRoute,
  9403. scene: this.statData.sc };
  9404. this._sendReportRequest(options);
  9405. }
  9406. this.__licationHide = false;
  9407. }
  9408. } }, { key: "_applicationHide", value: function _applicationHide(
  9409. self, type) {
  9410. this.__licationHide = true;
  9411. getLastTime();
  9412. var time = getResidenceTime();
  9413. getFirstTime();
  9414. var route = getPageRoute(this);
  9415. this._sendHideRequest({
  9416. urlref: route,
  9417. urlref_ts: time.residenceTime },
  9418. type);
  9419. } }, { key: "_pageShow", value: function _pageShow()
  9420. {
  9421. var route = getPageRoute(this);
  9422. var routepath = getRoute();
  9423. this._navigationBarTitle.config = PagesJson &&
  9424. PagesJson.pages[routepath] &&
  9425. PagesJson.pages[routepath].titleNView &&
  9426. PagesJson.pages[routepath].titleNView.titleText ||
  9427. PagesJson &&
  9428. PagesJson.pages[routepath] &&
  9429. PagesJson.pages[routepath].navigationBarTitleText || '';
  9430. if (this.__licationShow) {
  9431. getFirstTime();
  9432. this.__licationShow = false;
  9433. // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
  9434. this._lastPageRoute = route;
  9435. return;
  9436. }
  9437. getLastTime();
  9438. this._lastPageRoute = route;
  9439. var time = getResidenceTime('page');
  9440. if (time.overtime) {
  9441. var options = {
  9442. path: this._lastPageRoute,
  9443. scene: this.statData.sc };
  9444. this._sendReportRequest(options);
  9445. }
  9446. getFirstTime();
  9447. } }, { key: "_pageHide", value: function _pageHide()
  9448. {
  9449. if (!this.__licationHide) {
  9450. getLastTime();
  9451. var time = getResidenceTime('page');
  9452. this._sendPageRequest({
  9453. url: this._lastPageRoute,
  9454. urlref: this._lastPageRoute,
  9455. urlref_ts: time.residenceTime });
  9456. this._navigationBarTitle = {
  9457. config: '',
  9458. page: '',
  9459. report: '',
  9460. lt: '' };
  9461. return;
  9462. }
  9463. } }, { key: "_login", value: function _login()
  9464. {
  9465. this._sendEventRequest({
  9466. key: 'login' },
  9467. 0);
  9468. } }, { key: "_share", value: function _share()
  9469. {
  9470. this._sendEventRequest({
  9471. key: 'share' },
  9472. 0);
  9473. } }, { key: "_payment", value: function _payment(
  9474. key) {
  9475. this._sendEventRequest({
  9476. key: key },
  9477. 0);
  9478. } }, { key: "_sendReportRequest", value: function _sendReportRequest(
  9479. options) {
  9480. this._navigationBarTitle.lt = '1';
  9481. var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
  9482. this.statData.lt = '1';
  9483. this.statData.url = options.path + query || '';
  9484. this.statData.t = getTime();
  9485. this.statData.sc = getScene(options.scene);
  9486. this.statData.fvts = getFirstVisitTime();
  9487. this.statData.lvts = getLastVisitTime();
  9488. this.statData.tvc = getTotalVisitCount();
  9489. if (getPlatformName() === 'n') {
  9490. this.getProperty();
  9491. } else {
  9492. this.getNetworkInfo();
  9493. }
  9494. } }, { key: "_sendPageRequest", value: function _sendPageRequest(
  9495. opt) {var
  9496. url =
  9497. opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
  9498. this._navigationBarTitle.lt = '11';
  9499. var options = {
  9500. ak: this.statData.ak,
  9501. uuid: this.statData.uuid,
  9502. lt: '11',
  9503. ut: this.statData.ut,
  9504. url: url,
  9505. tt: this.statData.tt,
  9506. urlref: urlref,
  9507. urlref_ts: urlref_ts,
  9508. ch: this.statData.ch,
  9509. usv: this.statData.usv,
  9510. t: getTime(),
  9511. p: this.statData.p };
  9512. this.request(options);
  9513. } }, { key: "_sendHideRequest", value: function _sendHideRequest(
  9514. opt, type) {var
  9515. urlref =
  9516. opt.urlref,urlref_ts = opt.urlref_ts;
  9517. var options = {
  9518. ak: this.statData.ak,
  9519. uuid: this.statData.uuid,
  9520. lt: '3',
  9521. ut: this.statData.ut,
  9522. urlref: urlref,
  9523. urlref_ts: urlref_ts,
  9524. ch: this.statData.ch,
  9525. usv: this.statData.usv,
  9526. t: getTime(),
  9527. p: this.statData.p };
  9528. this.request(options, type);
  9529. } }, { key: "_sendEventRequest", value: function _sendEventRequest()
  9530. {var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref3$key = _ref3.key,key = _ref3$key === void 0 ? '' : _ref3$key,_ref3$value = _ref3.value,value = _ref3$value === void 0 ? "" : _ref3$value;
  9531. var route = this._lastPageRoute;
  9532. var options = {
  9533. ak: this.statData.ak,
  9534. uuid: this.statData.uuid,
  9535. lt: '21',
  9536. ut: this.statData.ut,
  9537. url: route,
  9538. ch: this.statData.ch,
  9539. e_n: key,
  9540. e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
  9541. usv: this.statData.usv,
  9542. t: getTime(),
  9543. p: this.statData.p };
  9544. this.request(options);
  9545. } }, { key: "getNetworkInfo", value: function getNetworkInfo()
  9546. {var _this = this;
  9547. uni.getNetworkType({
  9548. success: function success(result) {
  9549. _this.statData.net = result.networkType;
  9550. _this.getLocation();
  9551. } });
  9552. } }, { key: "getProperty", value: function getProperty()
  9553. {var _this2 = this;
  9554. plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
  9555. _this2.statData.v = wgtinfo.version || '';
  9556. _this2.getNetworkInfo();
  9557. });
  9558. } }, { key: "getLocation", value: function getLocation()
  9559. {var _this3 = this;
  9560. if (statConfig$1.getLocation) {
  9561. uni.getLocation({
  9562. type: 'wgs84',
  9563. geocode: true,
  9564. success: function success(result) {
  9565. if (result.address) {
  9566. _this3.statData.cn = result.address.country;
  9567. _this3.statData.pn = result.address.province;
  9568. _this3.statData.ct = result.address.city;
  9569. }
  9570. _this3.statData.lat = result.latitude;
  9571. _this3.statData.lng = result.longitude;
  9572. _this3.request(_this3.statData);
  9573. } });
  9574. } else {
  9575. this.statData.lat = 0;
  9576. this.statData.lng = 0;
  9577. this.request(this.statData);
  9578. }
  9579. } }, { key: "request", value: function request(
  9580. data, type) {var _this4 = this;
  9581. var time = getTime();
  9582. var title = this._navigationBarTitle;
  9583. data.ttn = title.page;
  9584. data.ttpj = title.config;
  9585. data.ttc = title.report;
  9586. var requestData = this._reportingRequestData;
  9587. if (getPlatformName() === 'n') {
  9588. requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
  9589. }
  9590. if (!requestData[data.lt]) {
  9591. requestData[data.lt] = [];
  9592. }
  9593. requestData[data.lt].push(data);
  9594. if (getPlatformName() === 'n') {
  9595. uni.setStorageSync('__UNI__STAT__DATA', requestData);
  9596. }
  9597. if (getPageResidenceTime() < OPERATING_TIME && !type) {
  9598. return;
  9599. }
  9600. var uniStatData = this._reportingRequestData;
  9601. if (getPlatformName() === 'n') {
  9602. uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
  9603. }
  9604. // 时间超过,重新获取时间戳
  9605. setPageResidenceTime();
  9606. var firstArr = [];
  9607. var contentArr = [];
  9608. var lastArr = [];var _loop = function _loop(
  9609. i) {
  9610. var rd = uniStatData[i];
  9611. rd.forEach(function (elm) {
  9612. var newData = getSplicing(elm);
  9613. if (i === 0) {
  9614. firstArr.push(newData);
  9615. } else if (i === 3) {
  9616. lastArr.push(newData);
  9617. } else {
  9618. contentArr.push(newData);
  9619. }
  9620. });};for (var i in uniStatData) {_loop(i);
  9621. }
  9622. firstArr.push.apply(firstArr, contentArr.concat(lastArr));
  9623. var optionsData = {
  9624. usv: STAT_VERSION, //统计 SDK 版本号
  9625. t: time, //发送请求时的时间戮
  9626. requests: JSON.stringify(firstArr) };
  9627. this._reportingRequestData = {};
  9628. if (getPlatformName() === 'n') {
  9629. uni.removeStorageSync('__UNI__STAT__DATA');
  9630. }
  9631. if (data.ut === 'h5') {
  9632. this.imageRequest(optionsData);
  9633. return;
  9634. }
  9635. if (getPlatformName() === 'n' && this.statData.p === 'a') {
  9636. setTimeout(function () {
  9637. _this4._sendRequest(optionsData);
  9638. }, 200);
  9639. return;
  9640. }
  9641. this._sendRequest(optionsData);
  9642. } }, { key: "_sendRequest", value: function _sendRequest(
  9643. optionsData) {var _this5 = this;
  9644. this.getIsReportData().then(function () {
  9645. uni.request({
  9646. url: STAT_URL,
  9647. method: 'POST',
  9648. // header: {
  9649. // 'content-type': 'application/json' // 默认值
  9650. // },
  9651. data: optionsData,
  9652. success: function success() {
  9653. // if (process.env.NODE_ENV === 'development') {
  9654. // console.log('stat request success');
  9655. // }
  9656. },
  9657. fail: function fail(e) {
  9658. if (++_this5._retry < 3) {
  9659. setTimeout(function () {
  9660. _this5._sendRequest(optionsData);
  9661. }, 1000);
  9662. }
  9663. } });
  9664. });
  9665. }
  9666. /**
  9667. * h5 请求
  9668. */ }, { key: "imageRequest", value: function imageRequest(
  9669. data) {
  9670. this.getIsReportData().then(function () {
  9671. var image = new Image();
  9672. var options = getSgin(GetEncodeURIComponentOptions(data)).options;
  9673. image.src = STAT_H5_URL + '?' + options;
  9674. });
  9675. } }, { key: "sendEvent", value: function sendEvent(
  9676. key, value) {
  9677. // 校验 type 参数
  9678. if (calibration(key, value)) return;
  9679. if (key === 'title') {
  9680. this._navigationBarTitle.report = value;
  9681. return;
  9682. }
  9683. this._sendEventRequest({
  9684. key: key,
  9685. value: typeof value === 'object' ? JSON.stringify(value) : value },
  9686. 1);
  9687. } }]);return Util;}();var
  9688. Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);var _super = _createSuper(Stat);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
  9689. {
  9690. if (!this.instance) {
  9691. this.instance = new Stat();
  9692. }
  9693. return this.instance;
  9694. } }]);
  9695. function Stat() {var _this6;_classCallCheck(this, Stat);
  9696. _this6 = _super.call(this);
  9697. _this6.instance = null;
  9698. // 注册拦截器
  9699. if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
  9700. _this6.addInterceptorInit();
  9701. _this6.interceptLogin();
  9702. _this6.interceptShare(true);
  9703. _this6.interceptRequestPayment();
  9704. }return _this6;
  9705. }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
  9706. {
  9707. var self = this;
  9708. uni.addInterceptor('setNavigationBarTitle', {
  9709. invoke: function invoke(args) {
  9710. self._navigationBarTitle.page = args.title;
  9711. } });
  9712. } }, { key: "interceptLogin", value: function interceptLogin()
  9713. {
  9714. var self = this;
  9715. uni.addInterceptor('login', {
  9716. complete: function complete() {
  9717. self._login();
  9718. } });
  9719. } }, { key: "interceptShare", value: function interceptShare(
  9720. type) {
  9721. var self = this;
  9722. if (!type) {
  9723. self._share();
  9724. return;
  9725. }
  9726. uni.addInterceptor('share', {
  9727. success: function success() {
  9728. self._share();
  9729. },
  9730. fail: function fail() {
  9731. self._share();
  9732. } });
  9733. } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
  9734. {
  9735. var self = this;
  9736. uni.addInterceptor('requestPayment', {
  9737. success: function success() {
  9738. self._payment('pay_success');
  9739. },
  9740. fail: function fail() {
  9741. self._payment('pay_fail');
  9742. } });
  9743. } }, { key: "report", value: function report(
  9744. options, self) {
  9745. this.self = self;
  9746. // if (process.env.NODE_ENV === 'development') {
  9747. // console.log('report init');
  9748. // }
  9749. setPageResidenceTime();
  9750. this.__licationShow = true;
  9751. this._sendReportRequest(options, true);
  9752. } }, { key: "load", value: function load(
  9753. options, self) {
  9754. if (!self.$scope && !self.$mp) {
  9755. var page = getCurrentPages();
  9756. self.$scope = page[page.length - 1];
  9757. }
  9758. this.self = self;
  9759. this._query = options;
  9760. } }, { key: "show", value: function show(
  9761. self) {
  9762. this.self = self;
  9763. if (getPageTypes(self)) {
  9764. this._pageShow(self);
  9765. } else {
  9766. this._applicationShow(self);
  9767. }
  9768. } }, { key: "ready", value: function ready(
  9769. self) {
  9770. // this.self = self;
  9771. // if (getPageTypes(self)) {
  9772. // this._pageShow(self);
  9773. // }
  9774. } }, { key: "hide", value: function hide(
  9775. self) {
  9776. this.self = self;
  9777. if (getPageTypes(self)) {
  9778. this._pageHide(self);
  9779. } else {
  9780. this._applicationHide(self, true);
  9781. }
  9782. } }, { key: "error", value: function error(
  9783. em) {
  9784. if (this._platform === 'devtools') {
  9785. if (true) {
  9786. console.info('当前运行环境为开发者工具,不上报数据。');
  9787. }
  9788. // return;
  9789. }
  9790. var emVal = '';
  9791. if (!em.message) {
  9792. emVal = JSON.stringify(em);
  9793. } else {
  9794. emVal = em.stack;
  9795. }
  9796. var options = {
  9797. ak: this.statData.ak,
  9798. uuid: this.statData.uuid,
  9799. lt: '31',
  9800. ut: this.statData.ut,
  9801. ch: this.statData.ch,
  9802. mpsdk: this.statData.mpsdk,
  9803. mpv: this.statData.mpv,
  9804. v: this.statData.v,
  9805. em: emVal,
  9806. usv: this.statData.usv,
  9807. t: getTime(),
  9808. p: this.statData.p };
  9809. this.request(options);
  9810. } }]);return Stat;}(Util);
  9811. var stat = Stat.getInstance();
  9812. var isHide = false;
  9813. var lifecycle = {
  9814. onLaunch: function onLaunch(options) {
  9815. stat.report(options, this);
  9816. },
  9817. onReady: function onReady() {
  9818. stat.ready(this);
  9819. },
  9820. onLoad: function onLoad(options) {
  9821. stat.load(options, this);
  9822. // 重写分享,获取分享上报事件
  9823. if (this.$scope && this.$scope.onShareAppMessage) {
  9824. var oldShareAppMessage = this.$scope.onShareAppMessage;
  9825. this.$scope.onShareAppMessage = function (options) {
  9826. stat.interceptShare(false);
  9827. return oldShareAppMessage.call(this, options);
  9828. };
  9829. }
  9830. },
  9831. onShow: function onShow() {
  9832. isHide = false;
  9833. stat.show(this);
  9834. },
  9835. onHide: function onHide() {
  9836. isHide = true;
  9837. stat.hide(this);
  9838. },
  9839. onUnload: function onUnload() {
  9840. if (isHide) {
  9841. isHide = false;
  9842. return;
  9843. }
  9844. stat.hide(this);
  9845. },
  9846. onError: function onError(e) {
  9847. stat.error(e);
  9848. } };
  9849. function main() {
  9850. if (true) {
  9851. uni.report = function (type, options) {};
  9852. } else { var Vue; }
  9853. }
  9854. main();
  9855. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9856. /***/ }),
  9857. /***/ 6:
  9858. /*!******************************************************!*\
  9859. !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
  9860. \******************************************************/
  9861. /*! 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 */
  9862. /***/ (function(module) {
  9863. module.exports = JSON.parse("{\"_from\":\"@dcloudio/uni-stat@next\",\"_id\":\"@dcloudio/uni-stat@2.0.0-31920210427001\",\"_inBundle\":false,\"_integrity\":\"sha512-45M5z4VUOBpLHbcJeeOE+piZ4tTnkcALy/7k+QPr2qWYxetNuSsfW+cENErL1HZDu83uex+HkiVawP/W2vavUw==\",\"_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-31920210427001.tgz\",\"_shasum\":\"86dc1d4965f220ef205c1dbfdd1926f9f5e0585a\",\"_spec\":\"@dcloudio/uni-stat@next\",\"_where\":\"/Users/guoshengqiang/Documents/dcloud-plugins-new/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\":\"7d6b2ba93591e997c1f3254248375fe341719198\",\"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-31920210427001\"}");
  9864. /***/ }),
  9865. /***/ 7:
  9866. /*!********************************************************************************!*\
  9867. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json?{"type":"stat"} ***!
  9868. \********************************************************************************/
  9869. /*! no static exports found */
  9870. /***/ (function(module, exports, __webpack_require__) {
  9871. "use strict";
  9872. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__BAF74FD" };exports.default = _default;
  9873. /***/ }),
  9874. /***/ 8:
  9875. /*!*********************************************************************************!*\
  9876. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json?{"type":"style"} ***!
  9877. \*********************************************************************************/
  9878. /*! no static exports found */
  9879. /***/ (function(module, exports, __webpack_require__) {
  9880. "use strict";
  9881. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/index/index": { "navigationBarTitleText": "一键加油" }, "pages/test/test": { "navigationBarTitleText": "测试页", "enablePullDownRefresh": false }, "pages/succeed/succeed": { "navigationBarTitleText": "支付成功", "enablePullDownRefresh": false }, "pages/authen/identity": { "navigationBarTitleText": "请求授权", "enablePullDownRefresh": false }, "pages/authen/login": { "navigationBarTitleText": "登录", "enablePullDownRefresh": false }, "pages/confirm/confirm": { "navigationBarTitleText": "订单确认", "enablePullDownRefresh": false } }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } };exports.default = _default;
  9882. /***/ }),
  9883. /***/ 85:
  9884. /*!*********************************************************************************************************!*\
  9885. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  9886. \*********************************************************************************************************/
  9887. /*! no static exports found */
  9888. /***/ (function(module, exports, __webpack_require__) {
  9889. "use strict";
  9890. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _message = _interopRequireDefault(__webpack_require__(/*! ./message.js */ 86));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9891. // 定义 type 类型:弹出类型:top/bottom/center
  9892. var config = {
  9893. // 顶部弹出
  9894. top: 'top',
  9895. // 底部弹出
  9896. bottom: 'bottom',
  9897. // 居中弹出
  9898. center: 'center',
  9899. // 消息提示
  9900. message: 'top',
  9901. // 对话框
  9902. dialog: 'center',
  9903. // 分享
  9904. share: 'bottom' };var _default =
  9905. {
  9906. data: function data() {
  9907. return {
  9908. config: config,
  9909. popupWidth: 0,
  9910. popupHeight: 0 };
  9911. },
  9912. mixins: [_message.default],
  9913. computed: {
  9914. isDesktop: function isDesktop() {
  9915. return this.popupWidth >= 500 && this.popupHeight >= 500;
  9916. } },
  9917. mounted: function mounted() {var _this = this;
  9918. var fixSize = function fixSize() {var _uni$getSystemInfoSyn =
  9919. uni.getSystemInfoSync(),windowWidth = _uni$getSystemInfoSyn.windowWidth,windowHeight = _uni$getSystemInfoSyn.windowHeight,windowTop = _uni$getSystemInfoSyn.windowTop;
  9920. _this.popupWidth = windowWidth;
  9921. _this.popupHeight = windowHeight + windowTop;
  9922. };
  9923. fixSize();
  9924. } };exports.default = _default;
  9925. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9926. /***/ }),
  9927. /***/ 86:
  9928. /*!***********************************************************************************************************!*\
  9929. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-popup/components/uni-popup/message.js ***!
  9930. \***********************************************************************************************************/
  9931. /*! no static exports found */
  9932. /***/ (function(module, exports, __webpack_require__) {
  9933. "use strict";
  9934. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  9935. created: function created() {
  9936. if (this.type === 'message') {
  9937. // 不显示遮罩
  9938. this.maskShow = false;
  9939. // 获取子组件对象
  9940. this.childrenMsg = null;
  9941. }
  9942. },
  9943. methods: {
  9944. customOpen: function customOpen() {
  9945. if (this.childrenMsg) {
  9946. this.childrenMsg.open();
  9947. }
  9948. },
  9949. customClose: function customClose() {
  9950. if (this.childrenMsg) {
  9951. this.childrenMsg.close();
  9952. }
  9953. } } };exports.default = _default;
  9954. /***/ }),
  9955. /***/ 94:
  9956. /*!*********************************************************************************************************!*\
  9957. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  9958. \*********************************************************************************************************/
  9959. /*! no static exports found */
  9960. /***/ (function(module, exports, __webpack_require__) {
  9961. "use strict";
  9962. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  9963. "pulldown": "\uE588",
  9964. "refreshempty": "\uE461",
  9965. "back": "\uE471",
  9966. "forward": "\uE470",
  9967. "more": "\uE507",
  9968. "more-filled": "\uE537",
  9969. "scan": "\uE612",
  9970. "qq": "\uE264",
  9971. "weibo": "\uE260",
  9972. "weixin": "\uE261",
  9973. "pengyouquan": "\uE262",
  9974. "loop": "\uE565",
  9975. "refresh": "\uE407",
  9976. "refresh-filled": "\uE437",
  9977. "arrowthindown": "\uE585",
  9978. "arrowthinleft": "\uE586",
  9979. "arrowthinright": "\uE587",
  9980. "arrowthinup": "\uE584",
  9981. "undo-filled": "\uE7D6",
  9982. "undo": "\uE406",
  9983. "redo": "\uE405",
  9984. "redo-filled": "\uE7D9",
  9985. "bars": "\uE563",
  9986. "chatboxes": "\uE203",
  9987. "camera": "\uE301",
  9988. "chatboxes-filled": "\uE233",
  9989. "camera-filled": "\uE7EF",
  9990. "cart-filled": "\uE7F4",
  9991. "cart": "\uE7F5",
  9992. "checkbox-filled": "\uE442",
  9993. "checkbox": "\uE7FA",
  9994. "arrowleft": "\uE582",
  9995. "arrowdown": "\uE581",
  9996. "arrowright": "\uE583",
  9997. "smallcircle-filled": "\uE801",
  9998. "arrowup": "\uE580",
  9999. "circle": "\uE411",
  10000. "eye-filled": "\uE568",
  10001. "eye-slash-filled": "\uE822",
  10002. "eye-slash": "\uE823",
  10003. "eye": "\uE824",
  10004. "flag-filled": "\uE825",
  10005. "flag": "\uE508",
  10006. "gear-filled": "\uE532",
  10007. "reload": "\uE462",
  10008. "gear": "\uE502",
  10009. "hand-thumbsdown-filled": "\uE83B",
  10010. "hand-thumbsdown": "\uE83C",
  10011. "hand-thumbsup-filled": "\uE83D",
  10012. "heart-filled": "\uE83E",
  10013. "hand-thumbsup": "\uE83F",
  10014. "heart": "\uE840",
  10015. "home": "\uE500",
  10016. "info": "\uE504",
  10017. "home-filled": "\uE530",
  10018. "info-filled": "\uE534",
  10019. "circle-filled": "\uE441",
  10020. "chat-filled": "\uE847",
  10021. "chat": "\uE263",
  10022. "mail-open-filled": "\uE84D",
  10023. "email-filled": "\uE231",
  10024. "mail-open": "\uE84E",
  10025. "email": "\uE201",
  10026. "checkmarkempty": "\uE472",
  10027. "list": "\uE562",
  10028. "locked-filled": "\uE856",
  10029. "locked": "\uE506",
  10030. "map-filled": "\uE85C",
  10031. "map-pin": "\uE85E",
  10032. "map-pin-ellipse": "\uE864",
  10033. "map": "\uE364",
  10034. "minus-filled": "\uE440",
  10035. "mic-filled": "\uE332",
  10036. "minus": "\uE410",
  10037. "micoff": "\uE360",
  10038. "mic": "\uE302",
  10039. "clear": "\uE434",
  10040. "smallcircle": "\uE868",
  10041. "close": "\uE404",
  10042. "closeempty": "\uE460",
  10043. "paperclip": "\uE567",
  10044. "paperplane": "\uE503",
  10045. "paperplane-filled": "\uE86E",
  10046. "person-filled": "\uE131",
  10047. "contact-filled": "\uE130",
  10048. "person": "\uE101",
  10049. "contact": "\uE100",
  10050. "images-filled": "\uE87A",
  10051. "phone": "\uE200",
  10052. "images": "\uE87B",
  10053. "image": "\uE363",
  10054. "image-filled": "\uE877",
  10055. "location-filled": "\uE333",
  10056. "location": "\uE303",
  10057. "plus-filled": "\uE439",
  10058. "plus": "\uE409",
  10059. "plusempty": "\uE468",
  10060. "help-filled": "\uE535",
  10061. "help": "\uE505",
  10062. "navigate-filled": "\uE884",
  10063. "navigate": "\uE501",
  10064. "mic-slash-filled": "\uE892",
  10065. "search": "\uE466",
  10066. "settings": "\uE560",
  10067. "sound": "\uE590",
  10068. "sound-filled": "\uE8A1",
  10069. "spinner-cycle": "\uE465",
  10070. "download-filled": "\uE8A4",
  10071. "personadd-filled": "\uE132",
  10072. "videocam-filled": "\uE8AF",
  10073. "personadd": "\uE102",
  10074. "upload": "\uE402",
  10075. "upload-filled": "\uE8B1",
  10076. "starhalf": "\uE463",
  10077. "star-filled": "\uE438",
  10078. "star": "\uE408",
  10079. "trash": "\uE401",
  10080. "phone-filled": "\uE230",
  10081. "compose": "\uE400",
  10082. "videocam": "\uE300",
  10083. "trash-filled": "\uE8DC",
  10084. "download": "\uE403",
  10085. "chatbubble-filled": "\uE232",
  10086. "chatbubble": "\uE202",
  10087. "cloud-download": "\uE8E4",
  10088. "cloud-upload-filled": "\uE8E5",
  10089. "cloud-upload": "\uE8E6",
  10090. "cloud-download-filled": "\uE8E9",
  10091. "headphones": "\uE8BF",
  10092. "shop": "\uE609" };exports.default = _default;
  10093. /***/ })
  10094. }]);
  10095. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map