vendor.js 393 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _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 _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 _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;}
  11. var _toString = Object.prototype.toString;
  12. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13. function isFn(fn) {
  14. return typeof fn === 'function';
  15. }
  16. function isStr(str) {
  17. return typeof str === 'string';
  18. }
  19. function isPlainObject(obj) {
  20. return _toString.call(obj) === '[object Object]';
  21. }
  22. function hasOwn(obj, key) {
  23. return hasOwnProperty.call(obj, key);
  24. }
  25. function noop() {}
  26. /**
  27. * Create a cached version of a pure function.
  28. */
  29. function cached(fn) {
  30. var cache = Object.create(null);
  31. return function cachedFn(str) {
  32. var hit = cache[str];
  33. return hit || (cache[str] = fn(str));
  34. };
  35. }
  36. /**
  37. * Camelize a hyphen-delimited string.
  38. */
  39. var camelizeRE = /-(\w)/g;
  40. var camelize = cached(function (str) {
  41. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  42. });
  43. var HOOKS = [
  44. 'invoke',
  45. 'success',
  46. 'fail',
  47. 'complete',
  48. 'returnValue'];
  49. var globalInterceptors = {};
  50. var scopedInterceptors = {};
  51. function mergeHook(parentVal, childVal) {
  52. var res = childVal ?
  53. parentVal ?
  54. parentVal.concat(childVal) :
  55. Array.isArray(childVal) ?
  56. childVal : [childVal] :
  57. parentVal;
  58. return res ?
  59. dedupeHooks(res) :
  60. res;
  61. }
  62. function dedupeHooks(hooks) {
  63. var res = [];
  64. for (var i = 0; i < hooks.length; i++) {
  65. if (res.indexOf(hooks[i]) === -1) {
  66. res.push(hooks[i]);
  67. }
  68. }
  69. return res;
  70. }
  71. function removeHook(hooks, hook) {
  72. var index = hooks.indexOf(hook);
  73. if (index !== -1) {
  74. hooks.splice(index, 1);
  75. }
  76. }
  77. function mergeInterceptorHook(interceptor, option) {
  78. Object.keys(option).forEach(function (hook) {
  79. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  80. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  81. }
  82. });
  83. }
  84. function removeInterceptorHook(interceptor, option) {
  85. if (!interceptor || !option) {
  86. return;
  87. }
  88. Object.keys(option).forEach(function (hook) {
  89. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  90. removeHook(interceptor[hook], option[hook]);
  91. }
  92. });
  93. }
  94. function addInterceptor(method, option) {
  95. if (typeof method === 'string' && isPlainObject(option)) {
  96. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  97. } else if (isPlainObject(method)) {
  98. mergeInterceptorHook(globalInterceptors, method);
  99. }
  100. }
  101. function removeInterceptor(method, option) {
  102. if (typeof method === 'string') {
  103. if (isPlainObject(option)) {
  104. removeInterceptorHook(scopedInterceptors[method], option);
  105. } else {
  106. delete scopedInterceptors[method];
  107. }
  108. } else if (isPlainObject(method)) {
  109. removeInterceptorHook(globalInterceptors, method);
  110. }
  111. }
  112. function wrapperHook(hook) {
  113. return function (data) {
  114. return hook(data) || data;
  115. };
  116. }
  117. function isPromise(obj) {
  118. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  119. }
  120. function queue(hooks, data) {
  121. var promise = false;
  122. for (var i = 0; i < hooks.length; i++) {
  123. var hook = hooks[i];
  124. if (promise) {
  125. promise = Promise.resolve(wrapperHook(hook));
  126. } else {
  127. var res = hook(data);
  128. if (isPromise(res)) {
  129. promise = Promise.resolve(res);
  130. }
  131. if (res === false) {
  132. return {
  133. then: function then() {} };
  134. }
  135. }
  136. }
  137. return promise || {
  138. then: function then(callback) {
  139. return callback(data);
  140. } };
  141. }
  142. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  143. ['success', 'fail', 'complete'].forEach(function (name) {
  144. if (Array.isArray(interceptor[name])) {
  145. var oldCallback = options[name];
  146. options[name] = function callbackInterceptor(res) {
  147. queue(interceptor[name], res).then(function (res) {
  148. /* eslint-disable no-mixed-operators */
  149. return isFn(oldCallback) && oldCallback(res) || res;
  150. });
  151. };
  152. }
  153. });
  154. return options;
  155. }
  156. function wrapperReturnValue(method, returnValue) {
  157. var returnValueHooks = [];
  158. if (Array.isArray(globalInterceptors.returnValue)) {
  159. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  160. }
  161. var interceptor = scopedInterceptors[method];
  162. if (interceptor && Array.isArray(interceptor.returnValue)) {
  163. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  164. }
  165. returnValueHooks.forEach(function (hook) {
  166. returnValue = hook(returnValue) || returnValue;
  167. });
  168. return returnValue;
  169. }
  170. function getApiInterceptorHooks(method) {
  171. var interceptor = Object.create(null);
  172. Object.keys(globalInterceptors).forEach(function (hook) {
  173. if (hook !== 'returnValue') {
  174. interceptor[hook] = globalInterceptors[hook].slice();
  175. }
  176. });
  177. var scopedInterceptor = scopedInterceptors[method];
  178. if (scopedInterceptor) {
  179. Object.keys(scopedInterceptor).forEach(function (hook) {
  180. if (hook !== 'returnValue') {
  181. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  182. }
  183. });
  184. }
  185. return interceptor;
  186. }
  187. 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];}
  188. var interceptor = getApiInterceptorHooks(method);
  189. if (interceptor && Object.keys(interceptor).length) {
  190. if (Array.isArray(interceptor.invoke)) {
  191. var res = queue(interceptor.invoke, options);
  192. return res.then(function (options) {
  193. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  194. });
  195. } else {
  196. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  197. }
  198. }
  199. return api.apply(void 0, [options].concat(params));
  200. }
  201. var promiseInterceptor = {
  202. returnValue: function returnValue(res) {
  203. if (!isPromise(res)) {
  204. return res;
  205. }
  206. return res.then(function (res) {
  207. return res[1];
  208. }).catch(function (res) {
  209. return res[0];
  210. });
  211. } };
  212. var SYNC_API_RE =
  213. /^\$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  214. var CONTEXT_API_RE = /^create|Manager$/;
  215. // Context例外情况
  216. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  217. // 同步例外情况
  218. var ASYNC_API = ['createBLEConnection'];
  219. var CALLBACK_API_RE = /^on|^off/;
  220. function isContextApi(name) {
  221. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  222. }
  223. function isSyncApi(name) {
  224. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  225. }
  226. function isCallbackApi(name) {
  227. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  228. }
  229. function handlePromise(promise) {
  230. return promise.then(function (data) {
  231. return [null, data];
  232. }).
  233. catch(function (err) {return [err];});
  234. }
  235. function shouldPromise(name) {
  236. if (
  237. isContextApi(name) ||
  238. isSyncApi(name) ||
  239. isCallbackApi(name))
  240. {
  241. return false;
  242. }
  243. return true;
  244. }
  245. /* eslint-disable no-extend-native */
  246. if (!Promise.prototype.finally) {
  247. Promise.prototype.finally = function (callback) {
  248. var promise = this.constructor;
  249. return this.then(
  250. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  251. function (reason) {return promise.resolve(callback()).then(function () {
  252. throw reason;
  253. });});
  254. };
  255. }
  256. function promisify(name, api) {
  257. if (!shouldPromise(name)) {
  258. return api;
  259. }
  260. 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];}
  261. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  262. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  263. }
  264. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  265. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  266. success: resolve,
  267. fail: reject })].concat(
  268. params));
  269. })));
  270. };
  271. }
  272. var EPS = 1e-4;
  273. var BASE_DEVICE_WIDTH = 750;
  274. var isIOS = false;
  275. var deviceWidth = 0;
  276. var deviceDPR = 0;
  277. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  278. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  279. deviceWidth = windowWidth;
  280. deviceDPR = pixelRatio;
  281. isIOS = platform === 'ios';
  282. }
  283. function upx2px(number, newDeviceWidth) {
  284. if (deviceWidth === 0) {
  285. checkDeviceWidth();
  286. }
  287. number = Number(number);
  288. if (number === 0) {
  289. return 0;
  290. }
  291. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  292. if (result < 0) {
  293. result = -result;
  294. }
  295. result = Math.floor(result + EPS);
  296. if (result === 0) {
  297. if (deviceDPR === 1 || !isIOS) {
  298. result = 1;
  299. } else {
  300. result = 0.5;
  301. }
  302. }
  303. return number < 0 ? -result : result;
  304. }
  305. var interceptors = {
  306. promiseInterceptor: promiseInterceptor };
  307. var baseApi = /*#__PURE__*/Object.freeze({
  308. __proto__: null,
  309. upx2px: upx2px,
  310. addInterceptor: addInterceptor,
  311. removeInterceptor: removeInterceptor,
  312. interceptors: interceptors });var
  313. EventChannel = /*#__PURE__*/function () {
  314. function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel);
  315. this.id = id;
  316. this.listener = {};
  317. this.emitCache = {};
  318. if (events) {
  319. Object.keys(events).forEach(function (name) {
  320. _this.on(name, events[name]);
  321. });
  322. }
  323. }_createClass(EventChannel, [{ key: "emit", value: function emit(
  324. eventName) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  325. var fns = this.listener[eventName];
  326. if (!fns) {
  327. return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
  328. }
  329. fns.forEach(function (opt) {
  330. opt.fn.apply(opt.fn, args);
  331. });
  332. this.listener[eventName] = fns.filter(function (opt) {return opt.type !== 'once';});
  333. } }, { key: "on", value: function on(
  334. eventName, fn) {
  335. this._addListener(eventName, 'on', fn);
  336. this._clearCache(eventName);
  337. } }, { key: "once", value: function once(
  338. eventName, fn) {
  339. this._addListener(eventName, 'once', fn);
  340. this._clearCache(eventName);
  341. } }, { key: "off", value: function off(
  342. eventName, fn) {
  343. var fns = this.listener[eventName];
  344. if (!fns) {
  345. return;
  346. }
  347. if (fn) {
  348. for (var i = 0; i < fns.length;) {
  349. if (fns[i].fn === fn) {
  350. fns.splice(i, 1);
  351. i--;
  352. }
  353. i++;
  354. }
  355. } else {
  356. delete this.listener[eventName];
  357. }
  358. } }, { key: "_clearCache", value: function _clearCache(
  359. eventName) {
  360. var cacheArgs = this.emitCache[eventName];
  361. if (cacheArgs) {
  362. for (; cacheArgs.length > 0;) {
  363. this.emit.apply(this, [eventName].concat(cacheArgs.shift()));
  364. }
  365. }
  366. } }, { key: "_addListener", value: function _addListener(
  367. eventName, type, fn) {
  368. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  369. fn: fn,
  370. type: type });
  371. } }]);return EventChannel;}();
  372. var eventChannels = {};
  373. var eventChannelStack = [];
  374. var id = 0;
  375. function initEventChannel(events) {var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  376. id++;
  377. var eventChannel = new EventChannel(id, events);
  378. if (cache) {
  379. eventChannels[id] = eventChannel;
  380. eventChannelStack.push(eventChannel);
  381. }
  382. return eventChannel;
  383. }
  384. function getEventChannel(id) {
  385. if (id) {
  386. var eventChannel = eventChannels[id];
  387. delete eventChannels[id];
  388. return eventChannel;
  389. }
  390. return eventChannelStack.shift();
  391. }
  392. var navigateTo = {
  393. args: function args(fromArgs, toArgs) {
  394. var id = initEventChannel(fromArgs.events).id;
  395. if (fromArgs.url) {
  396. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
  397. }
  398. },
  399. returnValue: function returnValue(fromRes, toRes) {
  400. fromRes.eventChannel = getEventChannel();
  401. } };
  402. function findExistsPageIndex(url) {
  403. var pages = getCurrentPages();
  404. var len = pages.length;
  405. while (len--) {
  406. var page = pages[len];
  407. if (page.$page && page.$page.fullPath === url) {
  408. return len;
  409. }
  410. }
  411. return -1;
  412. }
  413. var redirectTo = {
  414. name: function name(fromArgs) {
  415. if (fromArgs.exists === 'back' && fromArgs.delta) {
  416. return 'navigateBack';
  417. }
  418. return 'redirectTo';
  419. },
  420. args: function args(fromArgs) {
  421. if (fromArgs.exists === 'back' && fromArgs.url) {
  422. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  423. if (existsPageIndex !== -1) {
  424. var delta = getCurrentPages().length - 1 - existsPageIndex;
  425. if (delta > 0) {
  426. fromArgs.delta = delta;
  427. }
  428. }
  429. }
  430. } };
  431. var previewImage = {
  432. args: function args(fromArgs) {
  433. var currentIndex = parseInt(fromArgs.current);
  434. if (isNaN(currentIndex)) {
  435. return;
  436. }
  437. var urls = fromArgs.urls;
  438. if (!Array.isArray(urls)) {
  439. return;
  440. }
  441. var len = urls.length;
  442. if (!len) {
  443. return;
  444. }
  445. if (currentIndex < 0) {
  446. currentIndex = 0;
  447. } else if (currentIndex >= len) {
  448. currentIndex = len - 1;
  449. }
  450. if (currentIndex > 0) {
  451. fromArgs.current = urls[currentIndex];
  452. fromArgs.urls = urls.filter(
  453. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  454. } else {
  455. fromArgs.current = urls[0];
  456. }
  457. return {
  458. indicator: false,
  459. loop: false };
  460. } };
  461. function addSafeAreaInsets(result) {
  462. if (result.safeArea) {
  463. var safeArea = result.safeArea;
  464. result.safeAreaInsets = {
  465. top: safeArea.top,
  466. left: safeArea.left,
  467. right: result.windowWidth - safeArea.right,
  468. bottom: result.windowHeight - safeArea.bottom };
  469. }
  470. }
  471. var protocols = {
  472. redirectTo: redirectTo,
  473. navigateTo: navigateTo,
  474. previewImage: previewImage,
  475. getSystemInfo: {
  476. returnValue: addSafeAreaInsets },
  477. getSystemInfoSync: {
  478. returnValue: addSafeAreaInsets } };
  479. var todos = [
  480. 'vibrate',
  481. 'preloadPage',
  482. 'unPreloadPage',
  483. 'loadSubPackage'];
  484. var canIUses = [];
  485. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  486. function processCallback(methodName, method, returnValue) {
  487. return function (res) {
  488. return method(processReturnValue(methodName, res, returnValue));
  489. };
  490. }
  491. 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;
  492. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  493. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  494. if (isFn(argsOption)) {
  495. argsOption = argsOption(fromArgs, toArgs) || {};
  496. }
  497. for (var key in fromArgs) {
  498. if (hasOwn(argsOption, key)) {
  499. var keyOption = argsOption[key];
  500. if (isFn(keyOption)) {
  501. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  502. }
  503. if (!keyOption) {// 不支持的参数
  504. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  505. } else if (isStr(keyOption)) {// 重写参数 key
  506. toArgs[keyOption] = fromArgs[key];
  507. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  508. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  509. }
  510. } else if (CALLBACKS.indexOf(key) !== -1) {
  511. if (isFn(fromArgs[key])) {
  512. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  513. }
  514. } else {
  515. if (!keepFromArgs) {
  516. toArgs[key] = fromArgs[key];
  517. }
  518. }
  519. }
  520. return toArgs;
  521. } else if (isFn(fromArgs)) {
  522. fromArgs = processCallback(methodName, fromArgs, returnValue);
  523. }
  524. return fromArgs;
  525. }
  526. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  527. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  528. res = protocols.returnValue(methodName, res);
  529. }
  530. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  531. }
  532. function wrapper(methodName, method) {
  533. if (hasOwn(protocols, methodName)) {
  534. var protocol = protocols[methodName];
  535. if (!protocol) {// 暂不支持的 api
  536. return function () {
  537. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  538. };
  539. }
  540. return function (arg1, arg2) {// 目前 api 最多两个参数
  541. var options = protocol;
  542. if (isFn(protocol)) {
  543. options = protocol(arg1);
  544. }
  545. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  546. var args = [arg1];
  547. if (typeof arg2 !== 'undefined') {
  548. args.push(arg2);
  549. }
  550. if (isFn(options.name)) {
  551. methodName = options.name(arg1);
  552. } else if (isStr(options.name)) {
  553. methodName = options.name;
  554. }
  555. var returnValue = wx[methodName].apply(wx, args);
  556. if (isSyncApi(methodName)) {// 同步 api
  557. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  558. }
  559. return returnValue;
  560. };
  561. }
  562. return method;
  563. }
  564. var todoApis = Object.create(null);
  565. var TODOS = [
  566. 'onTabBarMidButtonTap',
  567. 'subscribePush',
  568. 'unsubscribePush',
  569. 'onPush',
  570. 'offPush',
  571. 'share'];
  572. function createTodoApi(name) {
  573. return function todoApi(_ref)
  574. {var fail = _ref.fail,complete = _ref.complete;
  575. var res = {
  576. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  577. isFn(fail) && fail(res);
  578. isFn(complete) && complete(res);
  579. };
  580. }
  581. TODOS.forEach(function (name) {
  582. todoApis[name] = createTodoApi(name);
  583. });
  584. var providers = {
  585. oauth: ['weixin'],
  586. share: ['weixin'],
  587. payment: ['wxpay'],
  588. push: ['weixin'] };
  589. function getProvider(_ref2)
  590. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  591. var res = false;
  592. if (providers[service]) {
  593. res = {
  594. errMsg: 'getProvider:ok',
  595. service: service,
  596. provider: providers[service] };
  597. isFn(success) && success(res);
  598. } else {
  599. res = {
  600. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  601. isFn(fail) && fail(res);
  602. }
  603. isFn(complete) && complete(res);
  604. }
  605. var extraApi = /*#__PURE__*/Object.freeze({
  606. __proto__: null,
  607. getProvider: getProvider });
  608. var getEmitter = function () {
  609. var Emitter;
  610. return function getUniEmitter() {
  611. if (!Emitter) {
  612. Emitter = new _vue.default();
  613. }
  614. return Emitter;
  615. };
  616. }();
  617. function apply(ctx, method, args) {
  618. return ctx[method].apply(ctx, args);
  619. }
  620. function $on() {
  621. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  622. }
  623. function $off() {
  624. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  625. }
  626. function $once() {
  627. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  628. }
  629. function $emit() {
  630. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  631. }
  632. var eventApi = /*#__PURE__*/Object.freeze({
  633. __proto__: null,
  634. $on: $on,
  635. $off: $off,
  636. $once: $once,
  637. $emit: $emit });
  638. var api = /*#__PURE__*/Object.freeze({
  639. __proto__: null });
  640. var MPPage = Page;
  641. var MPComponent = Component;
  642. var customizeRE = /:/g;
  643. var customize = cached(function (str) {
  644. return camelize(str.replace(customizeRE, '-'));
  645. });
  646. function initTriggerEvent(mpInstance) {
  647. {
  648. if (!wx.canIUse('nextTick')) {
  649. return;
  650. }
  651. }
  652. var oldTriggerEvent = mpInstance.triggerEvent;
  653. mpInstance.triggerEvent = function (event) {for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {args[_key4 - 1] = arguments[_key4];}
  654. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  655. };
  656. }
  657. function initHook(name, options) {
  658. var oldHook = options[name];
  659. if (!oldHook) {
  660. options[name] = function () {
  661. initTriggerEvent(this);
  662. };
  663. } else {
  664. options[name] = function () {
  665. initTriggerEvent(this);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  666. return oldHook.apply(this, args);
  667. };
  668. }
  669. }
  670. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  671. initHook('onLoad', options);
  672. return MPPage(options);
  673. };
  674. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  675. initHook('created', options);
  676. return MPComponent(options);
  677. };
  678. var PAGE_EVENT_HOOKS = [
  679. 'onPullDownRefresh',
  680. 'onReachBottom',
  681. 'onAddToFavorites',
  682. 'onShareTimeline',
  683. 'onShareAppMessage',
  684. 'onPageScroll',
  685. 'onResize',
  686. 'onTabItemTap'];
  687. function initMocks(vm, mocks) {
  688. var mpInstance = vm.$mp[vm.mpType];
  689. mocks.forEach(function (mock) {
  690. if (hasOwn(mpInstance, mock)) {
  691. vm[mock] = mpInstance[mock];
  692. }
  693. });
  694. }
  695. function hasHook(hook, vueOptions) {
  696. if (!vueOptions) {
  697. return true;
  698. }
  699. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  700. return true;
  701. }
  702. vueOptions = vueOptions.default || vueOptions;
  703. if (isFn(vueOptions)) {
  704. if (isFn(vueOptions.extendOptions[hook])) {
  705. return true;
  706. }
  707. if (vueOptions.super &&
  708. vueOptions.super.options &&
  709. Array.isArray(vueOptions.super.options[hook])) {
  710. return true;
  711. }
  712. return false;
  713. }
  714. if (isFn(vueOptions[hook])) {
  715. return true;
  716. }
  717. var mixins = vueOptions.mixins;
  718. if (Array.isArray(mixins)) {
  719. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  720. }
  721. }
  722. function initHooks(mpOptions, hooks, vueOptions) {
  723. hooks.forEach(function (hook) {
  724. if (hasHook(hook, vueOptions)) {
  725. mpOptions[hook] = function (args) {
  726. return this.$vm && this.$vm.__call_hook(hook, args);
  727. };
  728. }
  729. });
  730. }
  731. function initVueComponent(Vue, vueOptions) {
  732. vueOptions = vueOptions.default || vueOptions;
  733. var VueComponent;
  734. if (isFn(vueOptions)) {
  735. VueComponent = vueOptions;
  736. } else {
  737. VueComponent = Vue.extend(vueOptions);
  738. }
  739. vueOptions = VueComponent.options;
  740. return [VueComponent, vueOptions];
  741. }
  742. function initSlots(vm, vueSlots) {
  743. if (Array.isArray(vueSlots) && vueSlots.length) {
  744. var $slots = Object.create(null);
  745. vueSlots.forEach(function (slotName) {
  746. $slots[slotName] = true;
  747. });
  748. vm.$scopedSlots = vm.$slots = $slots;
  749. }
  750. }
  751. function initVueIds(vueIds, mpInstance) {
  752. vueIds = (vueIds || '').split(',');
  753. var len = vueIds.length;
  754. if (len === 1) {
  755. mpInstance._$vueId = vueIds[0];
  756. } else if (len === 2) {
  757. mpInstance._$vueId = vueIds[0];
  758. mpInstance._$vuePid = vueIds[1];
  759. }
  760. }
  761. function initData(vueOptions, context) {
  762. var data = vueOptions.data || {};
  763. var methods = vueOptions.methods || {};
  764. if (typeof data === 'function') {
  765. try {
  766. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  767. } catch (e) {
  768. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"cqcarbonwxapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  769. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  770. }
  771. }
  772. } else {
  773. try {
  774. // 对 data 格式化
  775. data = JSON.parse(JSON.stringify(data));
  776. } catch (e) {}
  777. }
  778. if (!isPlainObject(data)) {
  779. data = {};
  780. }
  781. Object.keys(methods).forEach(function (methodName) {
  782. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  783. data[methodName] = methods[methodName];
  784. }
  785. });
  786. return data;
  787. }
  788. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  789. function createObserver(name) {
  790. return function observer(newVal, oldVal) {
  791. if (this.$vm) {
  792. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  793. }
  794. };
  795. }
  796. function initBehaviors(vueOptions, initBehavior) {
  797. var vueBehaviors = vueOptions.behaviors;
  798. var vueExtends = vueOptions.extends;
  799. var vueMixins = vueOptions.mixins;
  800. var vueProps = vueOptions.props;
  801. if (!vueProps) {
  802. vueOptions.props = vueProps = [];
  803. }
  804. var behaviors = [];
  805. if (Array.isArray(vueBehaviors)) {
  806. vueBehaviors.forEach(function (behavior) {
  807. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  808. if (behavior === 'uni://form-field') {
  809. if (Array.isArray(vueProps)) {
  810. vueProps.push('name');
  811. vueProps.push('value');
  812. } else {
  813. vueProps.name = {
  814. type: String,
  815. default: '' };
  816. vueProps.value = {
  817. type: [String, Number, Boolean, Array, Object, Date],
  818. default: '' };
  819. }
  820. }
  821. });
  822. }
  823. if (isPlainObject(vueExtends) && vueExtends.props) {
  824. behaviors.push(
  825. initBehavior({
  826. properties: initProperties(vueExtends.props, true) }));
  827. }
  828. if (Array.isArray(vueMixins)) {
  829. vueMixins.forEach(function (vueMixin) {
  830. if (isPlainObject(vueMixin) && vueMixin.props) {
  831. behaviors.push(
  832. initBehavior({
  833. properties: initProperties(vueMixin.props, true) }));
  834. }
  835. });
  836. }
  837. return behaviors;
  838. }
  839. function parsePropType(key, type, defaultValue, file) {
  840. // [String]=>String
  841. if (Array.isArray(type) && type.length === 1) {
  842. return type[0];
  843. }
  844. return type;
  845. }
  846. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  847. var properties = {};
  848. if (!isBehavior) {
  849. properties.vueId = {
  850. type: String,
  851. value: '' };
  852. // 用于字节跳动小程序模拟抽象节点
  853. properties.generic = {
  854. type: Object,
  855. value: null };
  856. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  857. type: null,
  858. value: [],
  859. observer: function observer(newVal, oldVal) {
  860. var $slots = Object.create(null);
  861. newVal.forEach(function (slotName) {
  862. $slots[slotName] = true;
  863. });
  864. this.setData({
  865. $slots: $slots });
  866. } };
  867. }
  868. if (Array.isArray(props)) {// ['title']
  869. props.forEach(function (key) {
  870. properties[key] = {
  871. type: null,
  872. observer: createObserver(key) };
  873. });
  874. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  875. Object.keys(props).forEach(function (key) {
  876. var opts = props[key];
  877. if (isPlainObject(opts)) {// title:{type:String,default:''}
  878. var value = opts.default;
  879. if (isFn(value)) {
  880. value = value();
  881. }
  882. opts.type = parsePropType(key, opts.type);
  883. properties[key] = {
  884. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  885. value: value,
  886. observer: createObserver(key) };
  887. } else {// content:String
  888. var type = parsePropType(key, opts);
  889. properties[key] = {
  890. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  891. observer: createObserver(key) };
  892. }
  893. });
  894. }
  895. return properties;
  896. }
  897. function wrapper$1(event) {
  898. // TODO 又得兼容 mpvue 的 mp 对象
  899. try {
  900. event.mp = JSON.parse(JSON.stringify(event));
  901. } catch (e) {}
  902. event.stopPropagation = noop;
  903. event.preventDefault = noop;
  904. event.target = event.target || {};
  905. if (!hasOwn(event, 'detail')) {
  906. event.detail = {};
  907. }
  908. if (hasOwn(event, 'markerId')) {
  909. event.detail = typeof event.detail === 'object' ? event.detail : {};
  910. event.detail.markerId = event.markerId;
  911. }
  912. if (isPlainObject(event.detail)) {
  913. event.target = Object.assign({}, event.target, event.detail);
  914. }
  915. return event;
  916. }
  917. function getExtraValue(vm, dataPathsArray) {
  918. var context = vm;
  919. dataPathsArray.forEach(function (dataPathArray) {
  920. var dataPath = dataPathArray[0];
  921. var value = dataPathArray[2];
  922. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  923. var propPath = dataPathArray[1];
  924. var valuePath = dataPathArray[3];
  925. var vFor;
  926. if (Number.isInteger(dataPath)) {
  927. vFor = dataPath;
  928. } else if (!dataPath) {
  929. vFor = context;
  930. } else if (typeof dataPath === 'string' && dataPath) {
  931. if (dataPath.indexOf('#s#') === 0) {
  932. vFor = dataPath.substr(3);
  933. } else {
  934. vFor = vm.__get_value(dataPath, context);
  935. }
  936. }
  937. if (Number.isInteger(vFor)) {
  938. context = value;
  939. } else if (!propPath) {
  940. context = vFor[value];
  941. } else {
  942. if (Array.isArray(vFor)) {
  943. context = vFor.find(function (vForItem) {
  944. return vm.__get_value(propPath, vForItem) === value;
  945. });
  946. } else if (isPlainObject(vFor)) {
  947. context = Object.keys(vFor).find(function (vForKey) {
  948. return vm.__get_value(propPath, vFor[vForKey]) === value;
  949. });
  950. } else {
  951. console.error('v-for 暂不支持循环数据:', vFor);
  952. }
  953. }
  954. if (valuePath) {
  955. context = vm.__get_value(valuePath, context);
  956. }
  957. }
  958. });
  959. return context;
  960. }
  961. function processEventExtra(vm, extra, event) {
  962. var extraObj = {};
  963. if (Array.isArray(extra) && extra.length) {
  964. /**
  965. *[
  966. * ['data.items', 'data.id', item.data.id],
  967. * ['metas', 'id', meta.id]
  968. *],
  969. *[
  970. * ['data.items', 'data.id', item.data.id],
  971. * ['metas', 'id', meta.id]
  972. *],
  973. *'test'
  974. */
  975. extra.forEach(function (dataPath, index) {
  976. if (typeof dataPath === 'string') {
  977. if (!dataPath) {// model,prop.sync
  978. extraObj['$' + index] = vm;
  979. } else {
  980. if (dataPath === '$event') {// $event
  981. extraObj['$' + index] = event;
  982. } else if (dataPath === 'arguments') {
  983. if (event.detail && event.detail.__args__) {
  984. extraObj['$' + index] = event.detail.__args__;
  985. } else {
  986. extraObj['$' + index] = [event];
  987. }
  988. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  989. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  990. } else {
  991. extraObj['$' + index] = vm.__get_value(dataPath);
  992. }
  993. }
  994. } else {
  995. extraObj['$' + index] = getExtraValue(vm, dataPath);
  996. }
  997. });
  998. }
  999. return extraObj;
  1000. }
  1001. function getObjByArray(arr) {
  1002. var obj = {};
  1003. for (var i = 1; i < arr.length; i++) {
  1004. var element = arr[i];
  1005. obj[element[0]] = element[1];
  1006. }
  1007. return obj;
  1008. }
  1009. 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;
  1010. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1011. if (isCustom) {// 自定义事件
  1012. isCustomMPEvent = event.currentTarget &&
  1013. event.currentTarget.dataset &&
  1014. event.currentTarget.dataset.comType === 'wx';
  1015. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1016. if (isCustomMPEvent) {
  1017. return [event];
  1018. }
  1019. return event.detail.__args__ || event.detail;
  1020. }
  1021. }
  1022. var extraObj = processEventExtra(vm, extra, event);
  1023. var ret = [];
  1024. args.forEach(function (arg) {
  1025. if (arg === '$event') {
  1026. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1027. ret.push(event.target.value);
  1028. } else {
  1029. if (isCustom && !isCustomMPEvent) {
  1030. ret.push(event.detail.__args__[0]);
  1031. } else {// wxcomponent 组件或内置组件
  1032. ret.push(event);
  1033. }
  1034. }
  1035. } else {
  1036. if (Array.isArray(arg) && arg[0] === 'o') {
  1037. ret.push(getObjByArray(arg));
  1038. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1039. ret.push(extraObj[arg]);
  1040. } else {
  1041. ret.push(arg);
  1042. }
  1043. }
  1044. });
  1045. return ret;
  1046. }
  1047. var ONCE = '~';
  1048. var CUSTOM = '^';
  1049. function isMatchEventType(eventType, optType) {
  1050. return eventType === optType ||
  1051. optType === 'regionchange' && (
  1052. eventType === 'begin' ||
  1053. eventType === 'end');
  1054. }
  1055. function getContextVm(vm) {
  1056. var $parent = vm.$parent;
  1057. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1058. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1059. $parent = $parent.$parent;
  1060. }
  1061. return $parent && $parent.$parent;
  1062. }
  1063. function handleEvent(event) {var _this2 = this;
  1064. event = wrapper$1(event);
  1065. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1066. var dataset = (event.currentTarget || event.target).dataset;
  1067. if (!dataset) {
  1068. return console.warn('事件信息不存在');
  1069. }
  1070. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1071. if (!eventOpts) {
  1072. return console.warn('事件信息不存在');
  1073. }
  1074. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1075. var eventType = event.type;
  1076. var ret = [];
  1077. eventOpts.forEach(function (eventOpt) {
  1078. var type = eventOpt[0];
  1079. var eventsArray = eventOpt[1];
  1080. var isCustom = type.charAt(0) === CUSTOM;
  1081. type = isCustom ? type.slice(1) : type;
  1082. var isOnce = type.charAt(0) === ONCE;
  1083. type = isOnce ? type.slice(1) : type;
  1084. if (eventsArray && isMatchEventType(eventType, type)) {
  1085. eventsArray.forEach(function (eventArray) {
  1086. var methodName = eventArray[0];
  1087. if (methodName) {
  1088. var handlerCtx = _this2.$vm;
  1089. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1090. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1091. }
  1092. if (methodName === '$emit') {
  1093. handlerCtx.$emit.apply(handlerCtx,
  1094. processEventArgs(
  1095. _this2.$vm,
  1096. event,
  1097. eventArray[1],
  1098. eventArray[2],
  1099. isCustom,
  1100. methodName));
  1101. return;
  1102. }
  1103. var handler = handlerCtx[methodName];
  1104. if (!isFn(handler)) {
  1105. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1106. }
  1107. if (isOnce) {
  1108. if (handler.once) {
  1109. return;
  1110. }
  1111. handler.once = true;
  1112. }
  1113. var params = processEventArgs(
  1114. _this2.$vm,
  1115. event,
  1116. eventArray[1],
  1117. eventArray[2],
  1118. isCustom,
  1119. methodName);
  1120. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1121. // eslint-disable-next-line no-sparse-arrays
  1122. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  1123. }
  1124. });
  1125. }
  1126. });
  1127. if (
  1128. eventType === 'input' &&
  1129. ret.length === 1 &&
  1130. typeof ret[0] !== 'undefined')
  1131. {
  1132. return ret[0];
  1133. }
  1134. }
  1135. var hooks = [
  1136. 'onShow',
  1137. 'onHide',
  1138. 'onError',
  1139. 'onPageNotFound',
  1140. 'onThemeChange',
  1141. 'onUnhandledRejection'];
  1142. function parseBaseApp(vm, _ref3)
  1143. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1144. if (vm.$options.store) {
  1145. _vue.default.prototype.$store = vm.$options.store;
  1146. }
  1147. _vue.default.prototype.mpHost = "mp-weixin";
  1148. _vue.default.mixin({
  1149. beforeCreate: function beforeCreate() {
  1150. if (!this.$options.mpType) {
  1151. return;
  1152. }
  1153. this.mpType = this.$options.mpType;
  1154. this.$mp = _defineProperty({
  1155. data: {} },
  1156. this.mpType, this.$options.mpInstance);
  1157. this.$scope = this.$options.mpInstance;
  1158. delete this.$options.mpType;
  1159. delete this.$options.mpInstance;
  1160. if (this.mpType !== 'app') {
  1161. initRefs(this);
  1162. initMocks(this, mocks);
  1163. }
  1164. } });
  1165. var appOptions = {
  1166. onLaunch: function onLaunch(args) {
  1167. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1168. return;
  1169. }
  1170. {
  1171. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1172. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1173. }
  1174. }
  1175. this.$vm = vm;
  1176. this.$vm.$mp = {
  1177. app: this };
  1178. this.$vm.$scope = this;
  1179. // vm 上也挂载 globalData
  1180. this.$vm.globalData = this.globalData;
  1181. this.$vm._isMounted = true;
  1182. this.$vm.__call_hook('mounted', args);
  1183. this.$vm.__call_hook('onLaunch', args);
  1184. } };
  1185. // 兼容旧版本 globalData
  1186. appOptions.globalData = vm.$options.globalData || {};
  1187. // 将 methods 中的方法挂在 getApp() 中
  1188. var methods = vm.$options.methods;
  1189. if (methods) {
  1190. Object.keys(methods).forEach(function (name) {
  1191. appOptions[name] = methods[name];
  1192. });
  1193. }
  1194. initHooks(appOptions, hooks);
  1195. return appOptions;
  1196. }
  1197. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1198. function findVmByVueId(vm, vuePid) {
  1199. var $children = vm.$children;
  1200. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1201. for (var i = $children.length - 1; i >= 0; i--) {
  1202. var childVm = $children[i];
  1203. if (childVm.$scope._$vueId === vuePid) {
  1204. return childVm;
  1205. }
  1206. }
  1207. // 反向递归查找
  1208. var parentVm;
  1209. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1210. parentVm = findVmByVueId($children[_i], vuePid);
  1211. if (parentVm) {
  1212. return parentVm;
  1213. }
  1214. }
  1215. }
  1216. function initBehavior(options) {
  1217. return Behavior(options);
  1218. }
  1219. function isPage() {
  1220. return !!this.route;
  1221. }
  1222. function initRelation(detail) {
  1223. this.triggerEvent('__l', detail);
  1224. }
  1225. function initRefs(vm) {
  1226. var mpInstance = vm.$scope;
  1227. Object.defineProperty(vm, '$refs', {
  1228. get: function get() {
  1229. var $refs = {};
  1230. var components = mpInstance.selectAllComponents('.vue-ref');
  1231. components.forEach(function (component) {
  1232. var ref = component.dataset.ref;
  1233. $refs[ref] = component.$vm || component;
  1234. });
  1235. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1236. forComponents.forEach(function (component) {
  1237. var ref = component.dataset.ref;
  1238. if (!$refs[ref]) {
  1239. $refs[ref] = [];
  1240. }
  1241. $refs[ref].push(component.$vm || component);
  1242. });
  1243. return $refs;
  1244. } });
  1245. }
  1246. function handleLink(event) {var _ref4 =
  1247. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1248. var parentVm;
  1249. if (vuePid) {
  1250. parentVm = findVmByVueId(this.$vm, vuePid);
  1251. }
  1252. if (!parentVm) {
  1253. parentVm = this.$vm;
  1254. }
  1255. vueOptions.parent = parentVm;
  1256. }
  1257. function parseApp(vm) {
  1258. return parseBaseApp(vm, {
  1259. mocks: mocks,
  1260. initRefs: initRefs });
  1261. }
  1262. function createApp(vm) {
  1263. _vue.default.prototype.getOpenerEventChannel = function () {
  1264. if (!this.__eventChannel__) {
  1265. this.__eventChannel__ = new EventChannel();
  1266. }
  1267. return this.__eventChannel__;
  1268. };
  1269. var callHook = _vue.default.prototype.__call_hook;
  1270. _vue.default.prototype.__call_hook = function (hook, args) {
  1271. if (hook === 'onLoad' && args && args.__id__) {
  1272. this.__eventChannel__ = getEventChannel(args.__id__);
  1273. delete args.__id__;
  1274. }
  1275. return callHook.call(this, hook, args);
  1276. };
  1277. App(parseApp(vm));
  1278. return vm;
  1279. }
  1280. var encodeReserveRE = /[!'()*]/g;
  1281. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1282. var commaRE = /%2C/g;
  1283. // fixed encodeURIComponent which is more conformant to RFC3986:
  1284. // - escapes [!'()*]
  1285. // - preserve commas
  1286. var encode = function encode(str) {return encodeURIComponent(str).
  1287. replace(encodeReserveRE, encodeReserveReplacer).
  1288. replace(commaRE, ',');};
  1289. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1290. var res = obj ? Object.keys(obj).map(function (key) {
  1291. var val = obj[key];
  1292. if (val === undefined) {
  1293. return '';
  1294. }
  1295. if (val === null) {
  1296. return encodeStr(key);
  1297. }
  1298. if (Array.isArray(val)) {
  1299. var result = [];
  1300. val.forEach(function (val2) {
  1301. if (val2 === undefined) {
  1302. return;
  1303. }
  1304. if (val2 === null) {
  1305. result.push(encodeStr(key));
  1306. } else {
  1307. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1308. }
  1309. });
  1310. return result.join('&');
  1311. }
  1312. return encodeStr(key) + '=' + encodeStr(val);
  1313. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1314. return res ? "?".concat(res) : '';
  1315. }
  1316. function parseBaseComponent(vueComponentOptions)
  1317. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1318. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1319. var options = _objectSpread({
  1320. multipleSlots: true,
  1321. addGlobalClass: true },
  1322. vueOptions.options || {});
  1323. {
  1324. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1325. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1326. Object.assign(options, vueOptions['mp-weixin'].options);
  1327. }
  1328. }
  1329. var componentOptions = {
  1330. options: options,
  1331. data: initData(vueOptions, _vue.default.prototype),
  1332. behaviors: initBehaviors(vueOptions, initBehavior),
  1333. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1334. lifetimes: {
  1335. attached: function attached() {
  1336. var properties = this.properties;
  1337. var options = {
  1338. mpType: isPage.call(this) ? 'page' : 'component',
  1339. mpInstance: this,
  1340. propsData: properties };
  1341. initVueIds(properties.vueId, this);
  1342. // 处理父子关系
  1343. initRelation.call(this, {
  1344. vuePid: this._$vuePid,
  1345. vueOptions: options });
  1346. // 初始化 vue 实例
  1347. this.$vm = new VueComponent(options);
  1348. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1349. initSlots(this.$vm, properties.vueSlots);
  1350. // 触发首次 setData
  1351. this.$vm.$mount();
  1352. },
  1353. ready: function ready() {
  1354. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1355. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1356. if (this.$vm) {
  1357. this.$vm._isMounted = true;
  1358. this.$vm.__call_hook('mounted');
  1359. this.$vm.__call_hook('onReady');
  1360. }
  1361. },
  1362. detached: function detached() {
  1363. this.$vm && this.$vm.$destroy();
  1364. } },
  1365. pageLifetimes: {
  1366. show: function show(args) {
  1367. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1368. },
  1369. hide: function hide() {
  1370. this.$vm && this.$vm.__call_hook('onPageHide');
  1371. },
  1372. resize: function resize(size) {
  1373. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1374. } },
  1375. methods: {
  1376. __l: handleLink,
  1377. __e: handleEvent } };
  1378. // externalClasses
  1379. if (vueOptions.externalClasses) {
  1380. componentOptions.externalClasses = vueOptions.externalClasses;
  1381. }
  1382. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1383. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1384. componentOptions.methods[callMethod] = function (args) {
  1385. return this.$vm[callMethod](args);
  1386. };
  1387. });
  1388. }
  1389. if (isPage) {
  1390. return componentOptions;
  1391. }
  1392. return [componentOptions, VueComponent];
  1393. }
  1394. function parseComponent(vueComponentOptions) {
  1395. return parseBaseComponent(vueComponentOptions, {
  1396. isPage: isPage,
  1397. initRelation: initRelation });
  1398. }
  1399. var hooks$1 = [
  1400. 'onShow',
  1401. 'onHide',
  1402. 'onUnload'];
  1403. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1404. function parseBasePage(vuePageOptions, _ref6)
  1405. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1406. var pageOptions = parseComponent(vuePageOptions);
  1407. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1408. pageOptions.methods.onLoad = function (query) {
  1409. this.options = query;
  1410. var copyQuery = Object.assign({}, query);
  1411. delete copyQuery.__id__;
  1412. this.$page = {
  1413. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1414. this.$vm.$mp.query = query; // 兼容 mpvue
  1415. this.$vm.__call_hook('onLoad', query);
  1416. };
  1417. return pageOptions;
  1418. }
  1419. function parsePage(vuePageOptions) {
  1420. return parseBasePage(vuePageOptions, {
  1421. isPage: isPage,
  1422. initRelation: initRelation });
  1423. }
  1424. function createPage(vuePageOptions) {
  1425. {
  1426. return Component(parsePage(vuePageOptions));
  1427. }
  1428. }
  1429. function createComponent(vueOptions) {
  1430. {
  1431. return Component(parseComponent(vueOptions));
  1432. }
  1433. }
  1434. todos.forEach(function (todoApi) {
  1435. protocols[todoApi] = false;
  1436. });
  1437. canIUses.forEach(function (canIUseApi) {
  1438. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1439. canIUseApi;
  1440. if (!wx.canIUse(apiName)) {
  1441. protocols[canIUseApi] = false;
  1442. }
  1443. });
  1444. var uni = {};
  1445. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1446. uni = new Proxy({}, {
  1447. get: function get(target, name) {
  1448. if (hasOwn(target, name)) {
  1449. return target[name];
  1450. }
  1451. if (baseApi[name]) {
  1452. return baseApi[name];
  1453. }
  1454. if (api[name]) {
  1455. return promisify(name, api[name]);
  1456. }
  1457. {
  1458. if (extraApi[name]) {
  1459. return promisify(name, extraApi[name]);
  1460. }
  1461. if (todoApis[name]) {
  1462. return promisify(name, todoApis[name]);
  1463. }
  1464. }
  1465. if (eventApi[name]) {
  1466. return eventApi[name];
  1467. }
  1468. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1469. return;
  1470. }
  1471. return promisify(name, wrapper(name, wx[name]));
  1472. },
  1473. set: function set(target, name, value) {
  1474. target[name] = value;
  1475. return true;
  1476. } });
  1477. } else {
  1478. Object.keys(baseApi).forEach(function (name) {
  1479. uni[name] = baseApi[name];
  1480. });
  1481. {
  1482. Object.keys(todoApis).forEach(function (name) {
  1483. uni[name] = promisify(name, todoApis[name]);
  1484. });
  1485. Object.keys(extraApi).forEach(function (name) {
  1486. uni[name] = promisify(name, todoApis[name]);
  1487. });
  1488. }
  1489. Object.keys(eventApi).forEach(function (name) {
  1490. uni[name] = eventApi[name];
  1491. });
  1492. Object.keys(api).forEach(function (name) {
  1493. uni[name] = promisify(name, api[name]);
  1494. });
  1495. Object.keys(wx).forEach(function (name) {
  1496. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1497. uni[name] = promisify(name, wrapper(name, wx[name]));
  1498. }
  1499. });
  1500. }
  1501. wx.createApp = createApp;
  1502. wx.createPage = createPage;
  1503. wx.createComponent = createComponent;
  1504. var uni$1 = uni;var _default =
  1505. uni$1;exports.default = _default;
  1506. /***/ }),
  1507. /* 2 */
  1508. /*!******************************************************************************************!*\
  1509. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1510. \******************************************************************************************/
  1511. /*! exports provided: default */
  1512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1513. "use strict";
  1514. __webpack_require__.r(__webpack_exports__);
  1515. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1516. * Vue.js v2.6.11
  1517. * (c) 2014-2020 Evan You
  1518. * Released under the MIT License.
  1519. */
  1520. /* */
  1521. var emptyObject = Object.freeze({});
  1522. // These helpers produce better VM code in JS engines due to their
  1523. // explicitness and function inlining.
  1524. function isUndef (v) {
  1525. return v === undefined || v === null
  1526. }
  1527. function isDef (v) {
  1528. return v !== undefined && v !== null
  1529. }
  1530. function isTrue (v) {
  1531. return v === true
  1532. }
  1533. function isFalse (v) {
  1534. return v === false
  1535. }
  1536. /**
  1537. * Check if value is primitive.
  1538. */
  1539. function isPrimitive (value) {
  1540. return (
  1541. typeof value === 'string' ||
  1542. typeof value === 'number' ||
  1543. // $flow-disable-line
  1544. typeof value === 'symbol' ||
  1545. typeof value === 'boolean'
  1546. )
  1547. }
  1548. /**
  1549. * Quick object check - this is primarily used to tell
  1550. * Objects from primitive values when we know the value
  1551. * is a JSON-compliant type.
  1552. */
  1553. function isObject (obj) {
  1554. return obj !== null && typeof obj === 'object'
  1555. }
  1556. /**
  1557. * Get the raw type string of a value, e.g., [object Object].
  1558. */
  1559. var _toString = Object.prototype.toString;
  1560. function toRawType (value) {
  1561. return _toString.call(value).slice(8, -1)
  1562. }
  1563. /**
  1564. * Strict object type check. Only returns true
  1565. * for plain JavaScript objects.
  1566. */
  1567. function isPlainObject (obj) {
  1568. return _toString.call(obj) === '[object Object]'
  1569. }
  1570. function isRegExp (v) {
  1571. return _toString.call(v) === '[object RegExp]'
  1572. }
  1573. /**
  1574. * Check if val is a valid array index.
  1575. */
  1576. function isValidArrayIndex (val) {
  1577. var n = parseFloat(String(val));
  1578. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1579. }
  1580. function isPromise (val) {
  1581. return (
  1582. isDef(val) &&
  1583. typeof val.then === 'function' &&
  1584. typeof val.catch === 'function'
  1585. )
  1586. }
  1587. /**
  1588. * Convert a value to a string that is actually rendered.
  1589. */
  1590. function toString (val) {
  1591. return val == null
  1592. ? ''
  1593. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1594. ? JSON.stringify(val, null, 2)
  1595. : String(val)
  1596. }
  1597. /**
  1598. * Convert an input value to a number for persistence.
  1599. * If the conversion fails, return original string.
  1600. */
  1601. function toNumber (val) {
  1602. var n = parseFloat(val);
  1603. return isNaN(n) ? val : n
  1604. }
  1605. /**
  1606. * Make a map and return a function for checking if a key
  1607. * is in that map.
  1608. */
  1609. function makeMap (
  1610. str,
  1611. expectsLowerCase
  1612. ) {
  1613. var map = Object.create(null);
  1614. var list = str.split(',');
  1615. for (var i = 0; i < list.length; i++) {
  1616. map[list[i]] = true;
  1617. }
  1618. return expectsLowerCase
  1619. ? function (val) { return map[val.toLowerCase()]; }
  1620. : function (val) { return map[val]; }
  1621. }
  1622. /**
  1623. * Check if a tag is a built-in tag.
  1624. */
  1625. var isBuiltInTag = makeMap('slot,component', true);
  1626. /**
  1627. * Check if an attribute is a reserved attribute.
  1628. */
  1629. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1630. /**
  1631. * Remove an item from an array.
  1632. */
  1633. function remove (arr, item) {
  1634. if (arr.length) {
  1635. var index = arr.indexOf(item);
  1636. if (index > -1) {
  1637. return arr.splice(index, 1)
  1638. }
  1639. }
  1640. }
  1641. /**
  1642. * Check whether an object has the property.
  1643. */
  1644. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1645. function hasOwn (obj, key) {
  1646. return hasOwnProperty.call(obj, key)
  1647. }
  1648. /**
  1649. * Create a cached version of a pure function.
  1650. */
  1651. function cached (fn) {
  1652. var cache = Object.create(null);
  1653. return (function cachedFn (str) {
  1654. var hit = cache[str];
  1655. return hit || (cache[str] = fn(str))
  1656. })
  1657. }
  1658. /**
  1659. * Camelize a hyphen-delimited string.
  1660. */
  1661. var camelizeRE = /-(\w)/g;
  1662. var camelize = cached(function (str) {
  1663. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1664. });
  1665. /**
  1666. * Capitalize a string.
  1667. */
  1668. var capitalize = cached(function (str) {
  1669. return str.charAt(0).toUpperCase() + str.slice(1)
  1670. });
  1671. /**
  1672. * Hyphenate a camelCase string.
  1673. */
  1674. var hyphenateRE = /\B([A-Z])/g;
  1675. var hyphenate = cached(function (str) {
  1676. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1677. });
  1678. /**
  1679. * Simple bind polyfill for environments that do not support it,
  1680. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1681. * since native bind is now performant enough in most browsers.
  1682. * But removing it would mean breaking code that was able to run in
  1683. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1684. */
  1685. /* istanbul ignore next */
  1686. function polyfillBind (fn, ctx) {
  1687. function boundFn (a) {
  1688. var l = arguments.length;
  1689. return l
  1690. ? l > 1
  1691. ? fn.apply(ctx, arguments)
  1692. : fn.call(ctx, a)
  1693. : fn.call(ctx)
  1694. }
  1695. boundFn._length = fn.length;
  1696. return boundFn
  1697. }
  1698. function nativeBind (fn, ctx) {
  1699. return fn.bind(ctx)
  1700. }
  1701. var bind = Function.prototype.bind
  1702. ? nativeBind
  1703. : polyfillBind;
  1704. /**
  1705. * Convert an Array-like object to a real Array.
  1706. */
  1707. function toArray (list, start) {
  1708. start = start || 0;
  1709. var i = list.length - start;
  1710. var ret = new Array(i);
  1711. while (i--) {
  1712. ret[i] = list[i + start];
  1713. }
  1714. return ret
  1715. }
  1716. /**
  1717. * Mix properties into target object.
  1718. */
  1719. function extend (to, _from) {
  1720. for (var key in _from) {
  1721. to[key] = _from[key];
  1722. }
  1723. return to
  1724. }
  1725. /**
  1726. * Merge an Array of Objects into a single Object.
  1727. */
  1728. function toObject (arr) {
  1729. var res = {};
  1730. for (var i = 0; i < arr.length; i++) {
  1731. if (arr[i]) {
  1732. extend(res, arr[i]);
  1733. }
  1734. }
  1735. return res
  1736. }
  1737. /* eslint-disable no-unused-vars */
  1738. /**
  1739. * Perform no operation.
  1740. * Stubbing args to make Flow happy without leaving useless transpiled code
  1741. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1742. */
  1743. function noop (a, b, c) {}
  1744. /**
  1745. * Always return false.
  1746. */
  1747. var no = function (a, b, c) { return false; };
  1748. /* eslint-enable no-unused-vars */
  1749. /**
  1750. * Return the same value.
  1751. */
  1752. var identity = function (_) { return _; };
  1753. /**
  1754. * Check if two values are loosely equal - that is,
  1755. * if they are plain objects, do they have the same shape?
  1756. */
  1757. function looseEqual (a, b) {
  1758. if (a === b) { return true }
  1759. var isObjectA = isObject(a);
  1760. var isObjectB = isObject(b);
  1761. if (isObjectA && isObjectB) {
  1762. try {
  1763. var isArrayA = Array.isArray(a);
  1764. var isArrayB = Array.isArray(b);
  1765. if (isArrayA && isArrayB) {
  1766. return a.length === b.length && a.every(function (e, i) {
  1767. return looseEqual(e, b[i])
  1768. })
  1769. } else if (a instanceof Date && b instanceof Date) {
  1770. return a.getTime() === b.getTime()
  1771. } else if (!isArrayA && !isArrayB) {
  1772. var keysA = Object.keys(a);
  1773. var keysB = Object.keys(b);
  1774. return keysA.length === keysB.length && keysA.every(function (key) {
  1775. return looseEqual(a[key], b[key])
  1776. })
  1777. } else {
  1778. /* istanbul ignore next */
  1779. return false
  1780. }
  1781. } catch (e) {
  1782. /* istanbul ignore next */
  1783. return false
  1784. }
  1785. } else if (!isObjectA && !isObjectB) {
  1786. return String(a) === String(b)
  1787. } else {
  1788. return false
  1789. }
  1790. }
  1791. /**
  1792. * Return the first index at which a loosely equal value can be
  1793. * found in the array (if value is a plain object, the array must
  1794. * contain an object of the same shape), or -1 if it is not present.
  1795. */
  1796. function looseIndexOf (arr, val) {
  1797. for (var i = 0; i < arr.length; i++) {
  1798. if (looseEqual(arr[i], val)) { return i }
  1799. }
  1800. return -1
  1801. }
  1802. /**
  1803. * Ensure a function is called only once.
  1804. */
  1805. function once (fn) {
  1806. var called = false;
  1807. return function () {
  1808. if (!called) {
  1809. called = true;
  1810. fn.apply(this, arguments);
  1811. }
  1812. }
  1813. }
  1814. var ASSET_TYPES = [
  1815. 'component',
  1816. 'directive',
  1817. 'filter'
  1818. ];
  1819. var LIFECYCLE_HOOKS = [
  1820. 'beforeCreate',
  1821. 'created',
  1822. 'beforeMount',
  1823. 'mounted',
  1824. 'beforeUpdate',
  1825. 'updated',
  1826. 'beforeDestroy',
  1827. 'destroyed',
  1828. 'activated',
  1829. 'deactivated',
  1830. 'errorCaptured',
  1831. 'serverPrefetch'
  1832. ];
  1833. /* */
  1834. var config = ({
  1835. /**
  1836. * Option merge strategies (used in core/util/options)
  1837. */
  1838. // $flow-disable-line
  1839. optionMergeStrategies: Object.create(null),
  1840. /**
  1841. * Whether to suppress warnings.
  1842. */
  1843. silent: false,
  1844. /**
  1845. * Show production mode tip message on boot?
  1846. */
  1847. productionTip: "development" !== 'production',
  1848. /**
  1849. * Whether to enable devtools
  1850. */
  1851. devtools: "development" !== 'production',
  1852. /**
  1853. * Whether to record perf
  1854. */
  1855. performance: false,
  1856. /**
  1857. * Error handler for watcher errors
  1858. */
  1859. errorHandler: null,
  1860. /**
  1861. * Warn handler for watcher warns
  1862. */
  1863. warnHandler: null,
  1864. /**
  1865. * Ignore certain custom elements
  1866. */
  1867. ignoredElements: [],
  1868. /**
  1869. * Custom user key aliases for v-on
  1870. */
  1871. // $flow-disable-line
  1872. keyCodes: Object.create(null),
  1873. /**
  1874. * Check if a tag is reserved so that it cannot be registered as a
  1875. * component. This is platform-dependent and may be overwritten.
  1876. */
  1877. isReservedTag: no,
  1878. /**
  1879. * Check if an attribute is reserved so that it cannot be used as a component
  1880. * prop. This is platform-dependent and may be overwritten.
  1881. */
  1882. isReservedAttr: no,
  1883. /**
  1884. * Check if a tag is an unknown element.
  1885. * Platform-dependent.
  1886. */
  1887. isUnknownElement: no,
  1888. /**
  1889. * Get the namespace of an element
  1890. */
  1891. getTagNamespace: noop,
  1892. /**
  1893. * Parse the real tag name for the specific platform.
  1894. */
  1895. parsePlatformTagName: identity,
  1896. /**
  1897. * Check if an attribute must be bound using property, e.g. value
  1898. * Platform-dependent.
  1899. */
  1900. mustUseProp: no,
  1901. /**
  1902. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1903. * This will significantly reduce performance if set to false.
  1904. */
  1905. async: true,
  1906. /**
  1907. * Exposed for legacy reasons
  1908. */
  1909. _lifecycleHooks: LIFECYCLE_HOOKS
  1910. });
  1911. /* */
  1912. /**
  1913. * unicode letters used for parsing html tags, component names and property paths.
  1914. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1915. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1916. */
  1917. 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/;
  1918. /**
  1919. * Check if a string starts with $ or _
  1920. */
  1921. function isReserved (str) {
  1922. var c = (str + '').charCodeAt(0);
  1923. return c === 0x24 || c === 0x5F
  1924. }
  1925. /**
  1926. * Define a property.
  1927. */
  1928. function def (obj, key, val, enumerable) {
  1929. Object.defineProperty(obj, key, {
  1930. value: val,
  1931. enumerable: !!enumerable,
  1932. writable: true,
  1933. configurable: true
  1934. });
  1935. }
  1936. /**
  1937. * Parse simple path.
  1938. */
  1939. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  1940. function parsePath (path) {
  1941. if (bailRE.test(path)) {
  1942. return
  1943. }
  1944. var segments = path.split('.');
  1945. return function (obj) {
  1946. for (var i = 0; i < segments.length; i++) {
  1947. if (!obj) { return }
  1948. obj = obj[segments[i]];
  1949. }
  1950. return obj
  1951. }
  1952. }
  1953. /* */
  1954. // can we use __proto__?
  1955. var hasProto = '__proto__' in {};
  1956. // Browser environment sniffing
  1957. var inBrowser = typeof window !== 'undefined';
  1958. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  1959. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  1960. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1961. var isIE = UA && /msie|trident/.test(UA);
  1962. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1963. var isEdge = UA && UA.indexOf('edge/') > 0;
  1964. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  1965. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  1966. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  1967. var isPhantomJS = UA && /phantomjs/.test(UA);
  1968. var isFF = UA && UA.match(/firefox\/(\d+)/);
  1969. // Firefox has a "watch" function on Object.prototype...
  1970. var nativeWatch = ({}).watch;
  1971. if (inBrowser) {
  1972. try {
  1973. var opts = {};
  1974. Object.defineProperty(opts, 'passive', ({
  1975. get: function get () {
  1976. }
  1977. })); // https://github.com/facebook/flow/issues/285
  1978. window.addEventListener('test-passive', null, opts);
  1979. } catch (e) {}
  1980. }
  1981. // this needs to be lazy-evaled because vue may be required before
  1982. // vue-server-renderer can set VUE_ENV
  1983. var _isServer;
  1984. var isServerRendering = function () {
  1985. if (_isServer === undefined) {
  1986. /* istanbul ignore if */
  1987. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  1988. // detect presence of vue-server-renderer and avoid
  1989. // Webpack shimming the process
  1990. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  1991. } else {
  1992. _isServer = false;
  1993. }
  1994. }
  1995. return _isServer
  1996. };
  1997. // detect devtools
  1998. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1999. /* istanbul ignore next */
  2000. function isNative (Ctor) {
  2001. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2002. }
  2003. var hasSymbol =
  2004. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2005. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2006. var _Set;
  2007. /* istanbul ignore if */ // $flow-disable-line
  2008. if (typeof Set !== 'undefined' && isNative(Set)) {
  2009. // use native Set when available.
  2010. _Set = Set;
  2011. } else {
  2012. // a non-standard Set polyfill that only works with primitive keys.
  2013. _Set = /*@__PURE__*/(function () {
  2014. function Set () {
  2015. this.set = Object.create(null);
  2016. }
  2017. Set.prototype.has = function has (key) {
  2018. return this.set[key] === true
  2019. };
  2020. Set.prototype.add = function add (key) {
  2021. this.set[key] = true;
  2022. };
  2023. Set.prototype.clear = function clear () {
  2024. this.set = Object.create(null);
  2025. };
  2026. return Set;
  2027. }());
  2028. }
  2029. /* */
  2030. var warn = noop;
  2031. var tip = noop;
  2032. var generateComponentTrace = (noop); // work around flow check
  2033. var formatComponentName = (noop);
  2034. if (true) {
  2035. var hasConsole = typeof console !== 'undefined';
  2036. var classifyRE = /(?:^|[-_])(\w)/g;
  2037. var classify = function (str) { return str
  2038. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2039. .replace(/[-_]/g, ''); };
  2040. warn = function (msg, vm) {
  2041. var trace = vm ? generateComponentTrace(vm) : '';
  2042. if (config.warnHandler) {
  2043. config.warnHandler.call(null, msg, vm, trace);
  2044. } else if (hasConsole && (!config.silent)) {
  2045. console.error(("[Vue warn]: " + msg + trace));
  2046. }
  2047. };
  2048. tip = function (msg, vm) {
  2049. if (hasConsole && (!config.silent)) {
  2050. console.warn("[Vue tip]: " + msg + (
  2051. vm ? generateComponentTrace(vm) : ''
  2052. ));
  2053. }
  2054. };
  2055. formatComponentName = function (vm, includeFile) {
  2056. if (vm.$root === vm) {
  2057. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2058. return ('') + vm.$options.__file
  2059. }
  2060. return '<Root>'
  2061. }
  2062. var options = typeof vm === 'function' && vm.cid != null
  2063. ? vm.options
  2064. : vm._isVue
  2065. ? vm.$options || vm.constructor.options
  2066. : vm;
  2067. var name = options.name || options._componentTag;
  2068. var file = options.__file;
  2069. if (!name && file) {
  2070. var match = file.match(/([^/\\]+)\.vue$/);
  2071. name = match && match[1];
  2072. }
  2073. return (
  2074. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2075. (file && includeFile !== false ? (" at " + file) : '')
  2076. )
  2077. };
  2078. var repeat = function (str, n) {
  2079. var res = '';
  2080. while (n) {
  2081. if (n % 2 === 1) { res += str; }
  2082. if (n > 1) { str += str; }
  2083. n >>= 1;
  2084. }
  2085. return res
  2086. };
  2087. generateComponentTrace = function (vm) {
  2088. if (vm._isVue && vm.$parent) {
  2089. var tree = [];
  2090. var currentRecursiveSequence = 0;
  2091. while (vm && vm.$options.name !== 'PageBody') {
  2092. if (tree.length > 0) {
  2093. var last = tree[tree.length - 1];
  2094. if (last.constructor === vm.constructor) {
  2095. currentRecursiveSequence++;
  2096. vm = vm.$parent;
  2097. continue
  2098. } else if (currentRecursiveSequence > 0) {
  2099. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2100. currentRecursiveSequence = 0;
  2101. }
  2102. }
  2103. !vm.$options.isReserved && tree.push(vm);
  2104. vm = vm.$parent;
  2105. }
  2106. return '\n\nfound in\n\n' + tree
  2107. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2108. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2109. : formatComponentName(vm))); })
  2110. .join('\n')
  2111. } else {
  2112. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2113. }
  2114. };
  2115. }
  2116. /* */
  2117. var uid = 0;
  2118. /**
  2119. * A dep is an observable that can have multiple
  2120. * directives subscribing to it.
  2121. */
  2122. var Dep = function Dep () {
  2123. this.id = uid++;
  2124. this.subs = [];
  2125. };
  2126. Dep.prototype.addSub = function addSub (sub) {
  2127. this.subs.push(sub);
  2128. };
  2129. Dep.prototype.removeSub = function removeSub (sub) {
  2130. remove(this.subs, sub);
  2131. };
  2132. Dep.prototype.depend = function depend () {
  2133. if (Dep.SharedObject.target) {
  2134. Dep.SharedObject.target.addDep(this);
  2135. }
  2136. };
  2137. Dep.prototype.notify = function notify () {
  2138. // stabilize the subscriber list first
  2139. var subs = this.subs.slice();
  2140. if ( true && !config.async) {
  2141. // subs aren't sorted in scheduler if not running async
  2142. // we need to sort them now to make sure they fire in correct
  2143. // order
  2144. subs.sort(function (a, b) { return a.id - b.id; });
  2145. }
  2146. for (var i = 0, l = subs.length; i < l; i++) {
  2147. subs[i].update();
  2148. }
  2149. };
  2150. // The current target watcher being evaluated.
  2151. // This is globally unique because only one watcher
  2152. // can be evaluated at a time.
  2153. // fixed by xxxxxx (nvue shared vuex)
  2154. /* eslint-disable no-undef */
  2155. Dep.SharedObject = {};
  2156. Dep.SharedObject.target = null;
  2157. Dep.SharedObject.targetStack = [];
  2158. function pushTarget (target) {
  2159. Dep.SharedObject.targetStack.push(target);
  2160. Dep.SharedObject.target = target;
  2161. Dep.target = target;
  2162. }
  2163. function popTarget () {
  2164. Dep.SharedObject.targetStack.pop();
  2165. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2166. Dep.target = Dep.SharedObject.target;
  2167. }
  2168. /* */
  2169. var VNode = function VNode (
  2170. tag,
  2171. data,
  2172. children,
  2173. text,
  2174. elm,
  2175. context,
  2176. componentOptions,
  2177. asyncFactory
  2178. ) {
  2179. this.tag = tag;
  2180. this.data = data;
  2181. this.children = children;
  2182. this.text = text;
  2183. this.elm = elm;
  2184. this.ns = undefined;
  2185. this.context = context;
  2186. this.fnContext = undefined;
  2187. this.fnOptions = undefined;
  2188. this.fnScopeId = undefined;
  2189. this.key = data && data.key;
  2190. this.componentOptions = componentOptions;
  2191. this.componentInstance = undefined;
  2192. this.parent = undefined;
  2193. this.raw = false;
  2194. this.isStatic = false;
  2195. this.isRootInsert = true;
  2196. this.isComment = false;
  2197. this.isCloned = false;
  2198. this.isOnce = false;
  2199. this.asyncFactory = asyncFactory;
  2200. this.asyncMeta = undefined;
  2201. this.isAsyncPlaceholder = false;
  2202. };
  2203. var prototypeAccessors = { child: { configurable: true } };
  2204. // DEPRECATED: alias for componentInstance for backwards compat.
  2205. /* istanbul ignore next */
  2206. prototypeAccessors.child.get = function () {
  2207. return this.componentInstance
  2208. };
  2209. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2210. var createEmptyVNode = function (text) {
  2211. if ( text === void 0 ) text = '';
  2212. var node = new VNode();
  2213. node.text = text;
  2214. node.isComment = true;
  2215. return node
  2216. };
  2217. function createTextVNode (val) {
  2218. return new VNode(undefined, undefined, undefined, String(val))
  2219. }
  2220. // optimized shallow clone
  2221. // used for static nodes and slot nodes because they may be reused across
  2222. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2223. // on their elm reference.
  2224. function cloneVNode (vnode) {
  2225. var cloned = new VNode(
  2226. vnode.tag,
  2227. vnode.data,
  2228. // #7975
  2229. // clone children array to avoid mutating original in case of cloning
  2230. // a child.
  2231. vnode.children && vnode.children.slice(),
  2232. vnode.text,
  2233. vnode.elm,
  2234. vnode.context,
  2235. vnode.componentOptions,
  2236. vnode.asyncFactory
  2237. );
  2238. cloned.ns = vnode.ns;
  2239. cloned.isStatic = vnode.isStatic;
  2240. cloned.key = vnode.key;
  2241. cloned.isComment = vnode.isComment;
  2242. cloned.fnContext = vnode.fnContext;
  2243. cloned.fnOptions = vnode.fnOptions;
  2244. cloned.fnScopeId = vnode.fnScopeId;
  2245. cloned.asyncMeta = vnode.asyncMeta;
  2246. cloned.isCloned = true;
  2247. return cloned
  2248. }
  2249. /*
  2250. * not type checking this file because flow doesn't play well with
  2251. * dynamically accessing methods on Array prototype
  2252. */
  2253. var arrayProto = Array.prototype;
  2254. var arrayMethods = Object.create(arrayProto);
  2255. var methodsToPatch = [
  2256. 'push',
  2257. 'pop',
  2258. 'shift',
  2259. 'unshift',
  2260. 'splice',
  2261. 'sort',
  2262. 'reverse'
  2263. ];
  2264. /**
  2265. * Intercept mutating methods and emit events
  2266. */
  2267. methodsToPatch.forEach(function (method) {
  2268. // cache original method
  2269. var original = arrayProto[method];
  2270. def(arrayMethods, method, function mutator () {
  2271. var args = [], len = arguments.length;
  2272. while ( len-- ) args[ len ] = arguments[ len ];
  2273. var result = original.apply(this, args);
  2274. var ob = this.__ob__;
  2275. var inserted;
  2276. switch (method) {
  2277. case 'push':
  2278. case 'unshift':
  2279. inserted = args;
  2280. break
  2281. case 'splice':
  2282. inserted = args.slice(2);
  2283. break
  2284. }
  2285. if (inserted) { ob.observeArray(inserted); }
  2286. // notify change
  2287. ob.dep.notify();
  2288. return result
  2289. });
  2290. });
  2291. /* */
  2292. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2293. /**
  2294. * In some cases we may want to disable observation inside a component's
  2295. * update computation.
  2296. */
  2297. var shouldObserve = true;
  2298. function toggleObserving (value) {
  2299. shouldObserve = value;
  2300. }
  2301. /**
  2302. * Observer class that is attached to each observed
  2303. * object. Once attached, the observer converts the target
  2304. * object's property keys into getter/setters that
  2305. * collect dependencies and dispatch updates.
  2306. */
  2307. var Observer = function Observer (value) {
  2308. this.value = value;
  2309. this.dep = new Dep();
  2310. this.vmCount = 0;
  2311. def(value, '__ob__', this);
  2312. if (Array.isArray(value)) {
  2313. if (hasProto) {
  2314. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2315. if(value.push !== value.__proto__.push){
  2316. copyAugment(value, arrayMethods, arrayKeys);
  2317. } else {
  2318. protoAugment(value, arrayMethods);
  2319. }
  2320. }
  2321. } else {
  2322. copyAugment(value, arrayMethods, arrayKeys);
  2323. }
  2324. this.observeArray(value);
  2325. } else {
  2326. this.walk(value);
  2327. }
  2328. };
  2329. /**
  2330. * Walk through all properties and convert them into
  2331. * getter/setters. This method should only be called when
  2332. * value type is Object.
  2333. */
  2334. Observer.prototype.walk = function walk (obj) {
  2335. var keys = Object.keys(obj);
  2336. for (var i = 0; i < keys.length; i++) {
  2337. defineReactive$$1(obj, keys[i]);
  2338. }
  2339. };
  2340. /**
  2341. * Observe a list of Array items.
  2342. */
  2343. Observer.prototype.observeArray = function observeArray (items) {
  2344. for (var i = 0, l = items.length; i < l; i++) {
  2345. observe(items[i]);
  2346. }
  2347. };
  2348. // helpers
  2349. /**
  2350. * Augment a target Object or Array by intercepting
  2351. * the prototype chain using __proto__
  2352. */
  2353. function protoAugment (target, src) {
  2354. /* eslint-disable no-proto */
  2355. target.__proto__ = src;
  2356. /* eslint-enable no-proto */
  2357. }
  2358. /**
  2359. * Augment a target Object or Array by defining
  2360. * hidden properties.
  2361. */
  2362. /* istanbul ignore next */
  2363. function copyAugment (target, src, keys) {
  2364. for (var i = 0, l = keys.length; i < l; i++) {
  2365. var key = keys[i];
  2366. def(target, key, src[key]);
  2367. }
  2368. }
  2369. /**
  2370. * Attempt to create an observer instance for a value,
  2371. * returns the new observer if successfully observed,
  2372. * or the existing observer if the value already has one.
  2373. */
  2374. function observe (value, asRootData) {
  2375. if (!isObject(value) || value instanceof VNode) {
  2376. return
  2377. }
  2378. var ob;
  2379. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2380. ob = value.__ob__;
  2381. } else if (
  2382. shouldObserve &&
  2383. !isServerRendering() &&
  2384. (Array.isArray(value) || isPlainObject(value)) &&
  2385. Object.isExtensible(value) &&
  2386. !value._isVue
  2387. ) {
  2388. ob = new Observer(value);
  2389. }
  2390. if (asRootData && ob) {
  2391. ob.vmCount++;
  2392. }
  2393. return ob
  2394. }
  2395. /**
  2396. * Define a reactive property on an Object.
  2397. */
  2398. function defineReactive$$1 (
  2399. obj,
  2400. key,
  2401. val,
  2402. customSetter,
  2403. shallow
  2404. ) {
  2405. var dep = new Dep();
  2406. var property = Object.getOwnPropertyDescriptor(obj, key);
  2407. if (property && property.configurable === false) {
  2408. return
  2409. }
  2410. // cater for pre-defined getter/setters
  2411. var getter = property && property.get;
  2412. var setter = property && property.set;
  2413. if ((!getter || setter) && arguments.length === 2) {
  2414. val = obj[key];
  2415. }
  2416. var childOb = !shallow && observe(val);
  2417. Object.defineProperty(obj, key, {
  2418. enumerable: true,
  2419. configurable: true,
  2420. get: function reactiveGetter () {
  2421. var value = getter ? getter.call(obj) : val;
  2422. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2423. dep.depend();
  2424. if (childOb) {
  2425. childOb.dep.depend();
  2426. if (Array.isArray(value)) {
  2427. dependArray(value);
  2428. }
  2429. }
  2430. }
  2431. return value
  2432. },
  2433. set: function reactiveSetter (newVal) {
  2434. var value = getter ? getter.call(obj) : val;
  2435. /* eslint-disable no-self-compare */
  2436. if (newVal === value || (newVal !== newVal && value !== value)) {
  2437. return
  2438. }
  2439. /* eslint-enable no-self-compare */
  2440. if ( true && customSetter) {
  2441. customSetter();
  2442. }
  2443. // #7981: for accessor properties without setter
  2444. if (getter && !setter) { return }
  2445. if (setter) {
  2446. setter.call(obj, newVal);
  2447. } else {
  2448. val = newVal;
  2449. }
  2450. childOb = !shallow && observe(newVal);
  2451. dep.notify();
  2452. }
  2453. });
  2454. }
  2455. /**
  2456. * Set a property on an object. Adds the new property and
  2457. * triggers change notification if the property doesn't
  2458. * already exist.
  2459. */
  2460. function set (target, key, val) {
  2461. if ( true &&
  2462. (isUndef(target) || isPrimitive(target))
  2463. ) {
  2464. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2465. }
  2466. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2467. target.length = Math.max(target.length, key);
  2468. target.splice(key, 1, val);
  2469. return val
  2470. }
  2471. if (key in target && !(key in Object.prototype)) {
  2472. target[key] = val;
  2473. return val
  2474. }
  2475. var ob = (target).__ob__;
  2476. if (target._isVue || (ob && ob.vmCount)) {
  2477. true && warn(
  2478. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2479. 'at runtime - declare it upfront in the data option.'
  2480. );
  2481. return val
  2482. }
  2483. if (!ob) {
  2484. target[key] = val;
  2485. return val
  2486. }
  2487. defineReactive$$1(ob.value, key, val);
  2488. ob.dep.notify();
  2489. return val
  2490. }
  2491. /**
  2492. * Delete a property and trigger change if necessary.
  2493. */
  2494. function del (target, key) {
  2495. if ( true &&
  2496. (isUndef(target) || isPrimitive(target))
  2497. ) {
  2498. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2499. }
  2500. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2501. target.splice(key, 1);
  2502. return
  2503. }
  2504. var ob = (target).__ob__;
  2505. if (target._isVue || (ob && ob.vmCount)) {
  2506. true && warn(
  2507. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2508. '- just set it to null.'
  2509. );
  2510. return
  2511. }
  2512. if (!hasOwn(target, key)) {
  2513. return
  2514. }
  2515. delete target[key];
  2516. if (!ob) {
  2517. return
  2518. }
  2519. ob.dep.notify();
  2520. }
  2521. /**
  2522. * Collect dependencies on array elements when the array is touched, since
  2523. * we cannot intercept array element access like property getters.
  2524. */
  2525. function dependArray (value) {
  2526. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2527. e = value[i];
  2528. e && e.__ob__ && e.__ob__.dep.depend();
  2529. if (Array.isArray(e)) {
  2530. dependArray(e);
  2531. }
  2532. }
  2533. }
  2534. /* */
  2535. /**
  2536. * Option overwriting strategies are functions that handle
  2537. * how to merge a parent option value and a child option
  2538. * value into the final value.
  2539. */
  2540. var strats = config.optionMergeStrategies;
  2541. /**
  2542. * Options with restrictions
  2543. */
  2544. if (true) {
  2545. strats.el = strats.propsData = function (parent, child, vm, key) {
  2546. if (!vm) {
  2547. warn(
  2548. "option \"" + key + "\" can only be used during instance " +
  2549. 'creation with the `new` keyword.'
  2550. );
  2551. }
  2552. return defaultStrat(parent, child)
  2553. };
  2554. }
  2555. /**
  2556. * Helper that recursively merges two data objects together.
  2557. */
  2558. function mergeData (to, from) {
  2559. if (!from) { return to }
  2560. var key, toVal, fromVal;
  2561. var keys = hasSymbol
  2562. ? Reflect.ownKeys(from)
  2563. : Object.keys(from);
  2564. for (var i = 0; i < keys.length; i++) {
  2565. key = keys[i];
  2566. // in case the object is already observed...
  2567. if (key === '__ob__') { continue }
  2568. toVal = to[key];
  2569. fromVal = from[key];
  2570. if (!hasOwn(to, key)) {
  2571. set(to, key, fromVal);
  2572. } else if (
  2573. toVal !== fromVal &&
  2574. isPlainObject(toVal) &&
  2575. isPlainObject(fromVal)
  2576. ) {
  2577. mergeData(toVal, fromVal);
  2578. }
  2579. }
  2580. return to
  2581. }
  2582. /**
  2583. * Data
  2584. */
  2585. function mergeDataOrFn (
  2586. parentVal,
  2587. childVal,
  2588. vm
  2589. ) {
  2590. if (!vm) {
  2591. // in a Vue.extend merge, both should be functions
  2592. if (!childVal) {
  2593. return parentVal
  2594. }
  2595. if (!parentVal) {
  2596. return childVal
  2597. }
  2598. // when parentVal & childVal are both present,
  2599. // we need to return a function that returns the
  2600. // merged result of both functions... no need to
  2601. // check if parentVal is a function here because
  2602. // it has to be a function to pass previous merges.
  2603. return function mergedDataFn () {
  2604. return mergeData(
  2605. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2606. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2607. )
  2608. }
  2609. } else {
  2610. return function mergedInstanceDataFn () {
  2611. // instance merge
  2612. var instanceData = typeof childVal === 'function'
  2613. ? childVal.call(vm, vm)
  2614. : childVal;
  2615. var defaultData = typeof parentVal === 'function'
  2616. ? parentVal.call(vm, vm)
  2617. : parentVal;
  2618. if (instanceData) {
  2619. return mergeData(instanceData, defaultData)
  2620. } else {
  2621. return defaultData
  2622. }
  2623. }
  2624. }
  2625. }
  2626. strats.data = function (
  2627. parentVal,
  2628. childVal,
  2629. vm
  2630. ) {
  2631. if (!vm) {
  2632. if (childVal && typeof childVal !== 'function') {
  2633. true && warn(
  2634. 'The "data" option should be a function ' +
  2635. 'that returns a per-instance value in component ' +
  2636. 'definitions.',
  2637. vm
  2638. );
  2639. return parentVal
  2640. }
  2641. return mergeDataOrFn(parentVal, childVal)
  2642. }
  2643. return mergeDataOrFn(parentVal, childVal, vm)
  2644. };
  2645. /**
  2646. * Hooks and props are merged as arrays.
  2647. */
  2648. function mergeHook (
  2649. parentVal,
  2650. childVal
  2651. ) {
  2652. var res = childVal
  2653. ? parentVal
  2654. ? parentVal.concat(childVal)
  2655. : Array.isArray(childVal)
  2656. ? childVal
  2657. : [childVal]
  2658. : parentVal;
  2659. return res
  2660. ? dedupeHooks(res)
  2661. : res
  2662. }
  2663. function dedupeHooks (hooks) {
  2664. var res = [];
  2665. for (var i = 0; i < hooks.length; i++) {
  2666. if (res.indexOf(hooks[i]) === -1) {
  2667. res.push(hooks[i]);
  2668. }
  2669. }
  2670. return res
  2671. }
  2672. LIFECYCLE_HOOKS.forEach(function (hook) {
  2673. strats[hook] = mergeHook;
  2674. });
  2675. /**
  2676. * Assets
  2677. *
  2678. * When a vm is present (instance creation), we need to do
  2679. * a three-way merge between constructor options, instance
  2680. * options and parent options.
  2681. */
  2682. function mergeAssets (
  2683. parentVal,
  2684. childVal,
  2685. vm,
  2686. key
  2687. ) {
  2688. var res = Object.create(parentVal || null);
  2689. if (childVal) {
  2690. true && assertObjectType(key, childVal, vm);
  2691. return extend(res, childVal)
  2692. } else {
  2693. return res
  2694. }
  2695. }
  2696. ASSET_TYPES.forEach(function (type) {
  2697. strats[type + 's'] = mergeAssets;
  2698. });
  2699. /**
  2700. * Watchers.
  2701. *
  2702. * Watchers hashes should not overwrite one
  2703. * another, so we merge them as arrays.
  2704. */
  2705. strats.watch = function (
  2706. parentVal,
  2707. childVal,
  2708. vm,
  2709. key
  2710. ) {
  2711. // work around Firefox's Object.prototype.watch...
  2712. if (parentVal === nativeWatch) { parentVal = undefined; }
  2713. if (childVal === nativeWatch) { childVal = undefined; }
  2714. /* istanbul ignore if */
  2715. if (!childVal) { return Object.create(parentVal || null) }
  2716. if (true) {
  2717. assertObjectType(key, childVal, vm);
  2718. }
  2719. if (!parentVal) { return childVal }
  2720. var ret = {};
  2721. extend(ret, parentVal);
  2722. for (var key$1 in childVal) {
  2723. var parent = ret[key$1];
  2724. var child = childVal[key$1];
  2725. if (parent && !Array.isArray(parent)) {
  2726. parent = [parent];
  2727. }
  2728. ret[key$1] = parent
  2729. ? parent.concat(child)
  2730. : Array.isArray(child) ? child : [child];
  2731. }
  2732. return ret
  2733. };
  2734. /**
  2735. * Other object hashes.
  2736. */
  2737. strats.props =
  2738. strats.methods =
  2739. strats.inject =
  2740. strats.computed = function (
  2741. parentVal,
  2742. childVal,
  2743. vm,
  2744. key
  2745. ) {
  2746. if (childVal && "development" !== 'production') {
  2747. assertObjectType(key, childVal, vm);
  2748. }
  2749. if (!parentVal) { return childVal }
  2750. var ret = Object.create(null);
  2751. extend(ret, parentVal);
  2752. if (childVal) { extend(ret, childVal); }
  2753. return ret
  2754. };
  2755. strats.provide = mergeDataOrFn;
  2756. /**
  2757. * Default strategy.
  2758. */
  2759. var defaultStrat = function (parentVal, childVal) {
  2760. return childVal === undefined
  2761. ? parentVal
  2762. : childVal
  2763. };
  2764. /**
  2765. * Validate component names
  2766. */
  2767. function checkComponents (options) {
  2768. for (var key in options.components) {
  2769. validateComponentName(key);
  2770. }
  2771. }
  2772. function validateComponentName (name) {
  2773. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2774. warn(
  2775. 'Invalid component name: "' + name + '". Component names ' +
  2776. 'should conform to valid custom element name in html5 specification.'
  2777. );
  2778. }
  2779. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2780. warn(
  2781. 'Do not use built-in or reserved HTML elements as component ' +
  2782. 'id: ' + name
  2783. );
  2784. }
  2785. }
  2786. /**
  2787. * Ensure all props option syntax are normalized into the
  2788. * Object-based format.
  2789. */
  2790. function normalizeProps (options, vm) {
  2791. var props = options.props;
  2792. if (!props) { return }
  2793. var res = {};
  2794. var i, val, name;
  2795. if (Array.isArray(props)) {
  2796. i = props.length;
  2797. while (i--) {
  2798. val = props[i];
  2799. if (typeof val === 'string') {
  2800. name = camelize(val);
  2801. res[name] = { type: null };
  2802. } else if (true) {
  2803. warn('props must be strings when using array syntax.');
  2804. }
  2805. }
  2806. } else if (isPlainObject(props)) {
  2807. for (var key in props) {
  2808. val = props[key];
  2809. name = camelize(key);
  2810. res[name] = isPlainObject(val)
  2811. ? val
  2812. : { type: val };
  2813. }
  2814. } else if (true) {
  2815. warn(
  2816. "Invalid value for option \"props\": expected an Array or an Object, " +
  2817. "but got " + (toRawType(props)) + ".",
  2818. vm
  2819. );
  2820. }
  2821. options.props = res;
  2822. }
  2823. /**
  2824. * Normalize all injections into Object-based format
  2825. */
  2826. function normalizeInject (options, vm) {
  2827. var inject = options.inject;
  2828. if (!inject) { return }
  2829. var normalized = options.inject = {};
  2830. if (Array.isArray(inject)) {
  2831. for (var i = 0; i < inject.length; i++) {
  2832. normalized[inject[i]] = { from: inject[i] };
  2833. }
  2834. } else if (isPlainObject(inject)) {
  2835. for (var key in inject) {
  2836. var val = inject[key];
  2837. normalized[key] = isPlainObject(val)
  2838. ? extend({ from: key }, val)
  2839. : { from: val };
  2840. }
  2841. } else if (true) {
  2842. warn(
  2843. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2844. "but got " + (toRawType(inject)) + ".",
  2845. vm
  2846. );
  2847. }
  2848. }
  2849. /**
  2850. * Normalize raw function directives into object format.
  2851. */
  2852. function normalizeDirectives (options) {
  2853. var dirs = options.directives;
  2854. if (dirs) {
  2855. for (var key in dirs) {
  2856. var def$$1 = dirs[key];
  2857. if (typeof def$$1 === 'function') {
  2858. dirs[key] = { bind: def$$1, update: def$$1 };
  2859. }
  2860. }
  2861. }
  2862. }
  2863. function assertObjectType (name, value, vm) {
  2864. if (!isPlainObject(value)) {
  2865. warn(
  2866. "Invalid value for option \"" + name + "\": expected an Object, " +
  2867. "but got " + (toRawType(value)) + ".",
  2868. vm
  2869. );
  2870. }
  2871. }
  2872. /**
  2873. * Merge two option objects into a new one.
  2874. * Core utility used in both instantiation and inheritance.
  2875. */
  2876. function mergeOptions (
  2877. parent,
  2878. child,
  2879. vm
  2880. ) {
  2881. if (true) {
  2882. checkComponents(child);
  2883. }
  2884. if (typeof child === 'function') {
  2885. child = child.options;
  2886. }
  2887. normalizeProps(child, vm);
  2888. normalizeInject(child, vm);
  2889. normalizeDirectives(child);
  2890. // Apply extends and mixins on the child options,
  2891. // but only if it is a raw options object that isn't
  2892. // the result of another mergeOptions call.
  2893. // Only merged options has the _base property.
  2894. if (!child._base) {
  2895. if (child.extends) {
  2896. parent = mergeOptions(parent, child.extends, vm);
  2897. }
  2898. if (child.mixins) {
  2899. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2900. parent = mergeOptions(parent, child.mixins[i], vm);
  2901. }
  2902. }
  2903. }
  2904. var options = {};
  2905. var key;
  2906. for (key in parent) {
  2907. mergeField(key);
  2908. }
  2909. for (key in child) {
  2910. if (!hasOwn(parent, key)) {
  2911. mergeField(key);
  2912. }
  2913. }
  2914. function mergeField (key) {
  2915. var strat = strats[key] || defaultStrat;
  2916. options[key] = strat(parent[key], child[key], vm, key);
  2917. }
  2918. return options
  2919. }
  2920. /**
  2921. * Resolve an asset.
  2922. * This function is used because child instances need access
  2923. * to assets defined in its ancestor chain.
  2924. */
  2925. function resolveAsset (
  2926. options,
  2927. type,
  2928. id,
  2929. warnMissing
  2930. ) {
  2931. /* istanbul ignore if */
  2932. if (typeof id !== 'string') {
  2933. return
  2934. }
  2935. var assets = options[type];
  2936. // check local registration variations first
  2937. if (hasOwn(assets, id)) { return assets[id] }
  2938. var camelizedId = camelize(id);
  2939. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2940. var PascalCaseId = capitalize(camelizedId);
  2941. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  2942. // fallback to prototype chain
  2943. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  2944. if ( true && warnMissing && !res) {
  2945. warn(
  2946. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  2947. options
  2948. );
  2949. }
  2950. return res
  2951. }
  2952. /* */
  2953. function validateProp (
  2954. key,
  2955. propOptions,
  2956. propsData,
  2957. vm
  2958. ) {
  2959. var prop = propOptions[key];
  2960. var absent = !hasOwn(propsData, key);
  2961. var value = propsData[key];
  2962. // boolean casting
  2963. var booleanIndex = getTypeIndex(Boolean, prop.type);
  2964. if (booleanIndex > -1) {
  2965. if (absent && !hasOwn(prop, 'default')) {
  2966. value = false;
  2967. } else if (value === '' || value === hyphenate(key)) {
  2968. // only cast empty string / same name to boolean if
  2969. // boolean has higher priority
  2970. var stringIndex = getTypeIndex(String, prop.type);
  2971. if (stringIndex < 0 || booleanIndex < stringIndex) {
  2972. value = true;
  2973. }
  2974. }
  2975. }
  2976. // check default value
  2977. if (value === undefined) {
  2978. value = getPropDefaultValue(vm, prop, key);
  2979. // since the default value is a fresh copy,
  2980. // make sure to observe it.
  2981. var prevShouldObserve = shouldObserve;
  2982. toggleObserving(true);
  2983. observe(value);
  2984. toggleObserving(prevShouldObserve);
  2985. }
  2986. if (
  2987. true
  2988. ) {
  2989. assertProp(prop, key, value, vm, absent);
  2990. }
  2991. return value
  2992. }
  2993. /**
  2994. * Get the default value of a prop.
  2995. */
  2996. function getPropDefaultValue (vm, prop, key) {
  2997. // no default, return undefined
  2998. if (!hasOwn(prop, 'default')) {
  2999. return undefined
  3000. }
  3001. var def = prop.default;
  3002. // warn against non-factory defaults for Object & Array
  3003. if ( true && isObject(def)) {
  3004. warn(
  3005. 'Invalid default value for prop "' + key + '": ' +
  3006. 'Props with type Object/Array must use a factory function ' +
  3007. 'to return the default value.',
  3008. vm
  3009. );
  3010. }
  3011. // the raw prop value was also undefined from previous render,
  3012. // return previous default value to avoid unnecessary watcher trigger
  3013. if (vm && vm.$options.propsData &&
  3014. vm.$options.propsData[key] === undefined &&
  3015. vm._props[key] !== undefined
  3016. ) {
  3017. return vm._props[key]
  3018. }
  3019. // call factory function for non-Function types
  3020. // a value is Function if its prototype is function even across different execution context
  3021. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3022. ? def.call(vm)
  3023. : def
  3024. }
  3025. /**
  3026. * Assert whether a prop is valid.
  3027. */
  3028. function assertProp (
  3029. prop,
  3030. name,
  3031. value,
  3032. vm,
  3033. absent
  3034. ) {
  3035. if (prop.required && absent) {
  3036. warn(
  3037. 'Missing required prop: "' + name + '"',
  3038. vm
  3039. );
  3040. return
  3041. }
  3042. if (value == null && !prop.required) {
  3043. return
  3044. }
  3045. var type = prop.type;
  3046. var valid = !type || type === true;
  3047. var expectedTypes = [];
  3048. if (type) {
  3049. if (!Array.isArray(type)) {
  3050. type = [type];
  3051. }
  3052. for (var i = 0; i < type.length && !valid; i++) {
  3053. var assertedType = assertType(value, type[i]);
  3054. expectedTypes.push(assertedType.expectedType || '');
  3055. valid = assertedType.valid;
  3056. }
  3057. }
  3058. if (!valid) {
  3059. warn(
  3060. getInvalidTypeMessage(name, value, expectedTypes),
  3061. vm
  3062. );
  3063. return
  3064. }
  3065. var validator = prop.validator;
  3066. if (validator) {
  3067. if (!validator(value)) {
  3068. warn(
  3069. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3070. vm
  3071. );
  3072. }
  3073. }
  3074. }
  3075. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3076. function assertType (value, type) {
  3077. var valid;
  3078. var expectedType = getType(type);
  3079. if (simpleCheckRE.test(expectedType)) {
  3080. var t = typeof value;
  3081. valid = t === expectedType.toLowerCase();
  3082. // for primitive wrapper objects
  3083. if (!valid && t === 'object') {
  3084. valid = value instanceof type;
  3085. }
  3086. } else if (expectedType === 'Object') {
  3087. valid = isPlainObject(value);
  3088. } else if (expectedType === 'Array') {
  3089. valid = Array.isArray(value);
  3090. } else {
  3091. valid = value instanceof type;
  3092. }
  3093. return {
  3094. valid: valid,
  3095. expectedType: expectedType
  3096. }
  3097. }
  3098. /**
  3099. * Use function string name to check built-in types,
  3100. * because a simple equality check will fail when running
  3101. * across different vms / iframes.
  3102. */
  3103. function getType (fn) {
  3104. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3105. return match ? match[1] : ''
  3106. }
  3107. function isSameType (a, b) {
  3108. return getType(a) === getType(b)
  3109. }
  3110. function getTypeIndex (type, expectedTypes) {
  3111. if (!Array.isArray(expectedTypes)) {
  3112. return isSameType(expectedTypes, type) ? 0 : -1
  3113. }
  3114. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3115. if (isSameType(expectedTypes[i], type)) {
  3116. return i
  3117. }
  3118. }
  3119. return -1
  3120. }
  3121. function getInvalidTypeMessage (name, value, expectedTypes) {
  3122. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3123. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3124. var expectedType = expectedTypes[0];
  3125. var receivedType = toRawType(value);
  3126. var expectedValue = styleValue(value, expectedType);
  3127. var receivedValue = styleValue(value, receivedType);
  3128. // check if we need to specify expected value
  3129. if (expectedTypes.length === 1 &&
  3130. isExplicable(expectedType) &&
  3131. !isBoolean(expectedType, receivedType)) {
  3132. message += " with value " + expectedValue;
  3133. }
  3134. message += ", got " + receivedType + " ";
  3135. // check if we need to specify received value
  3136. if (isExplicable(receivedType)) {
  3137. message += "with value " + receivedValue + ".";
  3138. }
  3139. return message
  3140. }
  3141. function styleValue (value, type) {
  3142. if (type === 'String') {
  3143. return ("\"" + value + "\"")
  3144. } else if (type === 'Number') {
  3145. return ("" + (Number(value)))
  3146. } else {
  3147. return ("" + value)
  3148. }
  3149. }
  3150. function isExplicable (value) {
  3151. var explicitTypes = ['string', 'number', 'boolean'];
  3152. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3153. }
  3154. function isBoolean () {
  3155. var args = [], len = arguments.length;
  3156. while ( len-- ) args[ len ] = arguments[ len ];
  3157. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3158. }
  3159. /* */
  3160. function handleError (err, vm, info) {
  3161. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3162. // See: https://github.com/vuejs/vuex/issues/1505
  3163. pushTarget();
  3164. try {
  3165. if (vm) {
  3166. var cur = vm;
  3167. while ((cur = cur.$parent)) {
  3168. var hooks = cur.$options.errorCaptured;
  3169. if (hooks) {
  3170. for (var i = 0; i < hooks.length; i++) {
  3171. try {
  3172. var capture = hooks[i].call(cur, err, vm, info) === false;
  3173. if (capture) { return }
  3174. } catch (e) {
  3175. globalHandleError(e, cur, 'errorCaptured hook');
  3176. }
  3177. }
  3178. }
  3179. }
  3180. }
  3181. globalHandleError(err, vm, info);
  3182. } finally {
  3183. popTarget();
  3184. }
  3185. }
  3186. function invokeWithErrorHandling (
  3187. handler,
  3188. context,
  3189. args,
  3190. vm,
  3191. info
  3192. ) {
  3193. var res;
  3194. try {
  3195. res = args ? handler.apply(context, args) : handler.call(context);
  3196. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3197. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3198. // issue #9511
  3199. // avoid catch triggering multiple times when nested calls
  3200. res._handled = true;
  3201. }
  3202. } catch (e) {
  3203. handleError(e, vm, info);
  3204. }
  3205. return res
  3206. }
  3207. function globalHandleError (err, vm, info) {
  3208. if (config.errorHandler) {
  3209. try {
  3210. return config.errorHandler.call(null, err, vm, info)
  3211. } catch (e) {
  3212. // if the user intentionally throws the original error in the handler,
  3213. // do not log it twice
  3214. if (e !== err) {
  3215. logError(e, null, 'config.errorHandler');
  3216. }
  3217. }
  3218. }
  3219. logError(err, vm, info);
  3220. }
  3221. function logError (err, vm, info) {
  3222. if (true) {
  3223. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3224. }
  3225. /* istanbul ignore else */
  3226. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3227. console.error(err);
  3228. } else {
  3229. throw err
  3230. }
  3231. }
  3232. /* */
  3233. var callbacks = [];
  3234. var pending = false;
  3235. function flushCallbacks () {
  3236. pending = false;
  3237. var copies = callbacks.slice(0);
  3238. callbacks.length = 0;
  3239. for (var i = 0; i < copies.length; i++) {
  3240. copies[i]();
  3241. }
  3242. }
  3243. // Here we have async deferring wrappers using microtasks.
  3244. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3245. // However, it has subtle problems when state is changed right before repaint
  3246. // (e.g. #6813, out-in transitions).
  3247. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3248. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3249. // So we now use microtasks everywhere, again.
  3250. // A major drawback of this tradeoff is that there are some scenarios
  3251. // where microtasks have too high a priority and fire in between supposedly
  3252. // sequential events (e.g. #4521, #6690, which have workarounds)
  3253. // or even between bubbling of the same event (#6566).
  3254. var timerFunc;
  3255. // The nextTick behavior leverages the microtask queue, which can be accessed
  3256. // via either native Promise.then or MutationObserver.
  3257. // MutationObserver has wider support, however it is seriously bugged in
  3258. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3259. // completely stops working after triggering a few times... so, if native
  3260. // Promise is available, we will use it:
  3261. /* istanbul ignore next, $flow-disable-line */
  3262. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3263. var p = Promise.resolve();
  3264. timerFunc = function () {
  3265. p.then(flushCallbacks);
  3266. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3267. // it can get stuck in a weird state where callbacks are pushed into the
  3268. // microtask queue but the queue isn't being flushed, until the browser
  3269. // needs to do some other work, e.g. handle a timer. Therefore we can
  3270. // "force" the microtask queue to be flushed by adding an empty timer.
  3271. if (isIOS) { setTimeout(noop); }
  3272. };
  3273. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3274. isNative(MutationObserver) ||
  3275. // PhantomJS and iOS 7.x
  3276. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3277. )) {
  3278. // Use MutationObserver where native Promise is not available,
  3279. // e.g. PhantomJS, iOS7, Android 4.4
  3280. // (#6466 MutationObserver is unreliable in IE11)
  3281. var counter = 1;
  3282. var observer = new MutationObserver(flushCallbacks);
  3283. var textNode = document.createTextNode(String(counter));
  3284. observer.observe(textNode, {
  3285. characterData: true
  3286. });
  3287. timerFunc = function () {
  3288. counter = (counter + 1) % 2;
  3289. textNode.data = String(counter);
  3290. };
  3291. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3292. // Fallback to setImmediate.
  3293. // Technically it leverages the (macro) task queue,
  3294. // but it is still a better choice than setTimeout.
  3295. timerFunc = function () {
  3296. setImmediate(flushCallbacks);
  3297. };
  3298. } else {
  3299. // Fallback to setTimeout.
  3300. timerFunc = function () {
  3301. setTimeout(flushCallbacks, 0);
  3302. };
  3303. }
  3304. function nextTick (cb, ctx) {
  3305. var _resolve;
  3306. callbacks.push(function () {
  3307. if (cb) {
  3308. try {
  3309. cb.call(ctx);
  3310. } catch (e) {
  3311. handleError(e, ctx, 'nextTick');
  3312. }
  3313. } else if (_resolve) {
  3314. _resolve(ctx);
  3315. }
  3316. });
  3317. if (!pending) {
  3318. pending = true;
  3319. timerFunc();
  3320. }
  3321. // $flow-disable-line
  3322. if (!cb && typeof Promise !== 'undefined') {
  3323. return new Promise(function (resolve) {
  3324. _resolve = resolve;
  3325. })
  3326. }
  3327. }
  3328. /* */
  3329. /* not type checking this file because flow doesn't play well with Proxy */
  3330. var initProxy;
  3331. if (true) {
  3332. var allowedGlobals = makeMap(
  3333. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3334. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3335. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3336. 'require' // for Webpack/Browserify
  3337. );
  3338. var warnNonPresent = function (target, key) {
  3339. warn(
  3340. "Property or method \"" + key + "\" is not defined on the instance but " +
  3341. 'referenced during render. Make sure that this property is reactive, ' +
  3342. 'either in the data option, or for class-based components, by ' +
  3343. 'initializing the property. ' +
  3344. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3345. target
  3346. );
  3347. };
  3348. var warnReservedPrefix = function (target, key) {
  3349. warn(
  3350. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3351. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3352. 'prevent conflicts with Vue internals. ' +
  3353. 'See: https://vuejs.org/v2/api/#data',
  3354. target
  3355. );
  3356. };
  3357. var hasProxy =
  3358. typeof Proxy !== 'undefined' && isNative(Proxy);
  3359. if (hasProxy) {
  3360. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3361. config.keyCodes = new Proxy(config.keyCodes, {
  3362. set: function set (target, key, value) {
  3363. if (isBuiltInModifier(key)) {
  3364. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3365. return false
  3366. } else {
  3367. target[key] = value;
  3368. return true
  3369. }
  3370. }
  3371. });
  3372. }
  3373. var hasHandler = {
  3374. has: function has (target, key) {
  3375. var has = key in target;
  3376. var isAllowed = allowedGlobals(key) ||
  3377. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3378. if (!has && !isAllowed) {
  3379. if (key in target.$data) { warnReservedPrefix(target, key); }
  3380. else { warnNonPresent(target, key); }
  3381. }
  3382. return has || !isAllowed
  3383. }
  3384. };
  3385. var getHandler = {
  3386. get: function get (target, key) {
  3387. if (typeof key === 'string' && !(key in target)) {
  3388. if (key in target.$data) { warnReservedPrefix(target, key); }
  3389. else { warnNonPresent(target, key); }
  3390. }
  3391. return target[key]
  3392. }
  3393. };
  3394. initProxy = function initProxy (vm) {
  3395. if (hasProxy) {
  3396. // determine which proxy handler to use
  3397. var options = vm.$options;
  3398. var handlers = options.render && options.render._withStripped
  3399. ? getHandler
  3400. : hasHandler;
  3401. vm._renderProxy = new Proxy(vm, handlers);
  3402. } else {
  3403. vm._renderProxy = vm;
  3404. }
  3405. };
  3406. }
  3407. /* */
  3408. var seenObjects = new _Set();
  3409. /**
  3410. * Recursively traverse an object to evoke all converted
  3411. * getters, so that every nested property inside the object
  3412. * is collected as a "deep" dependency.
  3413. */
  3414. function traverse (val) {
  3415. _traverse(val, seenObjects);
  3416. seenObjects.clear();
  3417. }
  3418. function _traverse (val, seen) {
  3419. var i, keys;
  3420. var isA = Array.isArray(val);
  3421. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3422. return
  3423. }
  3424. if (val.__ob__) {
  3425. var depId = val.__ob__.dep.id;
  3426. if (seen.has(depId)) {
  3427. return
  3428. }
  3429. seen.add(depId);
  3430. }
  3431. if (isA) {
  3432. i = val.length;
  3433. while (i--) { _traverse(val[i], seen); }
  3434. } else {
  3435. keys = Object.keys(val);
  3436. i = keys.length;
  3437. while (i--) { _traverse(val[keys[i]], seen); }
  3438. }
  3439. }
  3440. var mark;
  3441. var measure;
  3442. if (true) {
  3443. var perf = inBrowser && window.performance;
  3444. /* istanbul ignore if */
  3445. if (
  3446. perf &&
  3447. perf.mark &&
  3448. perf.measure &&
  3449. perf.clearMarks &&
  3450. perf.clearMeasures
  3451. ) {
  3452. mark = function (tag) { return perf.mark(tag); };
  3453. measure = function (name, startTag, endTag) {
  3454. perf.measure(name, startTag, endTag);
  3455. perf.clearMarks(startTag);
  3456. perf.clearMarks(endTag);
  3457. // perf.clearMeasures(name)
  3458. };
  3459. }
  3460. }
  3461. /* */
  3462. var normalizeEvent = cached(function (name) {
  3463. var passive = name.charAt(0) === '&';
  3464. name = passive ? name.slice(1) : name;
  3465. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3466. name = once$$1 ? name.slice(1) : name;
  3467. var capture = name.charAt(0) === '!';
  3468. name = capture ? name.slice(1) : name;
  3469. return {
  3470. name: name,
  3471. once: once$$1,
  3472. capture: capture,
  3473. passive: passive
  3474. }
  3475. });
  3476. function createFnInvoker (fns, vm) {
  3477. function invoker () {
  3478. var arguments$1 = arguments;
  3479. var fns = invoker.fns;
  3480. if (Array.isArray(fns)) {
  3481. var cloned = fns.slice();
  3482. for (var i = 0; i < cloned.length; i++) {
  3483. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3484. }
  3485. } else {
  3486. // return handler return value for single handlers
  3487. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3488. }
  3489. }
  3490. invoker.fns = fns;
  3491. return invoker
  3492. }
  3493. function updateListeners (
  3494. on,
  3495. oldOn,
  3496. add,
  3497. remove$$1,
  3498. createOnceHandler,
  3499. vm
  3500. ) {
  3501. var name, def$$1, cur, old, event;
  3502. for (name in on) {
  3503. def$$1 = cur = on[name];
  3504. old = oldOn[name];
  3505. event = normalizeEvent(name);
  3506. if (isUndef(cur)) {
  3507. true && warn(
  3508. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3509. vm
  3510. );
  3511. } else if (isUndef(old)) {
  3512. if (isUndef(cur.fns)) {
  3513. cur = on[name] = createFnInvoker(cur, vm);
  3514. }
  3515. if (isTrue(event.once)) {
  3516. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3517. }
  3518. add(event.name, cur, event.capture, event.passive, event.params);
  3519. } else if (cur !== old) {
  3520. old.fns = cur;
  3521. on[name] = old;
  3522. }
  3523. }
  3524. for (name in oldOn) {
  3525. if (isUndef(on[name])) {
  3526. event = normalizeEvent(name);
  3527. remove$$1(event.name, oldOn[name], event.capture);
  3528. }
  3529. }
  3530. }
  3531. /* */
  3532. /* */
  3533. // fixed by xxxxxx (mp properties)
  3534. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3535. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3536. if (isUndef(propOptions)) {
  3537. return res
  3538. }
  3539. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3540. var attrs = data.attrs;
  3541. var props = data.props;
  3542. if (isDef(attrs) || isDef(props)) {
  3543. for (var key in propOptions) {
  3544. var altKey = hyphenate(key);
  3545. var result = checkProp(res, props, key, altKey, true) ||
  3546. checkProp(res, attrs, key, altKey, false);
  3547. // externalClass
  3548. if (
  3549. result &&
  3550. res[key] &&
  3551. externalClasses.indexOf(altKey) !== -1 &&
  3552. context[camelize(res[key])]
  3553. ) {
  3554. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3555. res[key] = context[camelize(res[key])];
  3556. }
  3557. }
  3558. }
  3559. return res
  3560. }
  3561. function extractPropsFromVNodeData (
  3562. data,
  3563. Ctor,
  3564. tag,
  3565. context// fixed by xxxxxx
  3566. ) {
  3567. // we are only extracting raw values here.
  3568. // validation and default values are handled in the child
  3569. // component itself.
  3570. var propOptions = Ctor.options.props;
  3571. if (isUndef(propOptions)) {
  3572. // fixed by xxxxxx
  3573. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3574. }
  3575. var res = {};
  3576. var attrs = data.attrs;
  3577. var props = data.props;
  3578. if (isDef(attrs) || isDef(props)) {
  3579. for (var key in propOptions) {
  3580. var altKey = hyphenate(key);
  3581. if (true) {
  3582. var keyInLowerCase = key.toLowerCase();
  3583. if (
  3584. key !== keyInLowerCase &&
  3585. attrs && hasOwn(attrs, keyInLowerCase)
  3586. ) {
  3587. tip(
  3588. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3589. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3590. " \"" + key + "\". " +
  3591. "Note that HTML attributes are case-insensitive and camelCased " +
  3592. "props need to use their kebab-case equivalents when using in-DOM " +
  3593. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3594. );
  3595. }
  3596. }
  3597. checkProp(res, props, key, altKey, true) ||
  3598. checkProp(res, attrs, key, altKey, false);
  3599. }
  3600. }
  3601. // fixed by xxxxxx
  3602. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3603. }
  3604. function checkProp (
  3605. res,
  3606. hash,
  3607. key,
  3608. altKey,
  3609. preserve
  3610. ) {
  3611. if (isDef(hash)) {
  3612. if (hasOwn(hash, key)) {
  3613. res[key] = hash[key];
  3614. if (!preserve) {
  3615. delete hash[key];
  3616. }
  3617. return true
  3618. } else if (hasOwn(hash, altKey)) {
  3619. res[key] = hash[altKey];
  3620. if (!preserve) {
  3621. delete hash[altKey];
  3622. }
  3623. return true
  3624. }
  3625. }
  3626. return false
  3627. }
  3628. /* */
  3629. // The template compiler attempts to minimize the need for normalization by
  3630. // statically analyzing the template at compile time.
  3631. //
  3632. // For plain HTML markup, normalization can be completely skipped because the
  3633. // generated render function is guaranteed to return Array<VNode>. There are
  3634. // two cases where extra normalization is needed:
  3635. // 1. When the children contains components - because a functional component
  3636. // may return an Array instead of a single root. In this case, just a simple
  3637. // normalization is needed - if any child is an Array, we flatten the whole
  3638. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3639. // because functional components already normalize their own children.
  3640. function simpleNormalizeChildren (children) {
  3641. for (var i = 0; i < children.length; i++) {
  3642. if (Array.isArray(children[i])) {
  3643. return Array.prototype.concat.apply([], children)
  3644. }
  3645. }
  3646. return children
  3647. }
  3648. // 2. When the children contains constructs that always generated nested Arrays,
  3649. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3650. // with hand-written render functions / JSX. In such cases a full normalization
  3651. // is needed to cater to all possible types of children values.
  3652. function normalizeChildren (children) {
  3653. return isPrimitive(children)
  3654. ? [createTextVNode(children)]
  3655. : Array.isArray(children)
  3656. ? normalizeArrayChildren(children)
  3657. : undefined
  3658. }
  3659. function isTextNode (node) {
  3660. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3661. }
  3662. function normalizeArrayChildren (children, nestedIndex) {
  3663. var res = [];
  3664. var i, c, lastIndex, last;
  3665. for (i = 0; i < children.length; i++) {
  3666. c = children[i];
  3667. if (isUndef(c) || typeof c === 'boolean') { continue }
  3668. lastIndex = res.length - 1;
  3669. last = res[lastIndex];
  3670. // nested
  3671. if (Array.isArray(c)) {
  3672. if (c.length > 0) {
  3673. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3674. // merge adjacent text nodes
  3675. if (isTextNode(c[0]) && isTextNode(last)) {
  3676. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3677. c.shift();
  3678. }
  3679. res.push.apply(res, c);
  3680. }
  3681. } else if (isPrimitive(c)) {
  3682. if (isTextNode(last)) {
  3683. // merge adjacent text nodes
  3684. // this is necessary for SSR hydration because text nodes are
  3685. // essentially merged when rendered to HTML strings
  3686. res[lastIndex] = createTextVNode(last.text + c);
  3687. } else if (c !== '') {
  3688. // convert primitive to vnode
  3689. res.push(createTextVNode(c));
  3690. }
  3691. } else {
  3692. if (isTextNode(c) && isTextNode(last)) {
  3693. // merge adjacent text nodes
  3694. res[lastIndex] = createTextVNode(last.text + c.text);
  3695. } else {
  3696. // default key for nested array children (likely generated by v-for)
  3697. if (isTrue(children._isVList) &&
  3698. isDef(c.tag) &&
  3699. isUndef(c.key) &&
  3700. isDef(nestedIndex)) {
  3701. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3702. }
  3703. res.push(c);
  3704. }
  3705. }
  3706. }
  3707. return res
  3708. }
  3709. /* */
  3710. function initProvide (vm) {
  3711. var provide = vm.$options.provide;
  3712. if (provide) {
  3713. vm._provided = typeof provide === 'function'
  3714. ? provide.call(vm)
  3715. : provide;
  3716. }
  3717. }
  3718. function initInjections (vm) {
  3719. var result = resolveInject(vm.$options.inject, vm);
  3720. if (result) {
  3721. toggleObserving(false);
  3722. Object.keys(result).forEach(function (key) {
  3723. /* istanbul ignore else */
  3724. if (true) {
  3725. defineReactive$$1(vm, key, result[key], function () {
  3726. warn(
  3727. "Avoid mutating an injected value directly since the changes will be " +
  3728. "overwritten whenever the provided component re-renders. " +
  3729. "injection being mutated: \"" + key + "\"",
  3730. vm
  3731. );
  3732. });
  3733. } else {}
  3734. });
  3735. toggleObserving(true);
  3736. }
  3737. }
  3738. function resolveInject (inject, vm) {
  3739. if (inject) {
  3740. // inject is :any because flow is not smart enough to figure out cached
  3741. var result = Object.create(null);
  3742. var keys = hasSymbol
  3743. ? Reflect.ownKeys(inject)
  3744. : Object.keys(inject);
  3745. for (var i = 0; i < keys.length; i++) {
  3746. var key = keys[i];
  3747. // #6574 in case the inject object is observed...
  3748. if (key === '__ob__') { continue }
  3749. var provideKey = inject[key].from;
  3750. var source = vm;
  3751. while (source) {
  3752. if (source._provided && hasOwn(source._provided, provideKey)) {
  3753. result[key] = source._provided[provideKey];
  3754. break
  3755. }
  3756. source = source.$parent;
  3757. }
  3758. if (!source) {
  3759. if ('default' in inject[key]) {
  3760. var provideDefault = inject[key].default;
  3761. result[key] = typeof provideDefault === 'function'
  3762. ? provideDefault.call(vm)
  3763. : provideDefault;
  3764. } else if (true) {
  3765. warn(("Injection \"" + key + "\" not found"), vm);
  3766. }
  3767. }
  3768. }
  3769. return result
  3770. }
  3771. }
  3772. /* */
  3773. /**
  3774. * Runtime helper for resolving raw children VNodes into a slot object.
  3775. */
  3776. function resolveSlots (
  3777. children,
  3778. context
  3779. ) {
  3780. if (!children || !children.length) {
  3781. return {}
  3782. }
  3783. var slots = {};
  3784. for (var i = 0, l = children.length; i < l; i++) {
  3785. var child = children[i];
  3786. var data = child.data;
  3787. // remove slot attribute if the node is resolved as a Vue slot node
  3788. if (data && data.attrs && data.attrs.slot) {
  3789. delete data.attrs.slot;
  3790. }
  3791. // named slots should only be respected if the vnode was rendered in the
  3792. // same context.
  3793. if ((child.context === context || child.fnContext === context) &&
  3794. data && data.slot != null
  3795. ) {
  3796. var name = data.slot;
  3797. var slot = (slots[name] || (slots[name] = []));
  3798. if (child.tag === 'template') {
  3799. slot.push.apply(slot, child.children || []);
  3800. } else {
  3801. slot.push(child);
  3802. }
  3803. } else {
  3804. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3805. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3806. (slots['page'] || (slots['page'] = [])).push(child);
  3807. }else{
  3808. (slots.default || (slots.default = [])).push(child);
  3809. }
  3810. }
  3811. }
  3812. // ignore slots that contains only whitespace
  3813. for (var name$1 in slots) {
  3814. if (slots[name$1].every(isWhitespace)) {
  3815. delete slots[name$1];
  3816. }
  3817. }
  3818. return slots
  3819. }
  3820. function isWhitespace (node) {
  3821. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3822. }
  3823. /* */
  3824. function normalizeScopedSlots (
  3825. slots,
  3826. normalSlots,
  3827. prevSlots
  3828. ) {
  3829. var res;
  3830. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3831. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3832. var key = slots && slots.$key;
  3833. if (!slots) {
  3834. res = {};
  3835. } else if (slots._normalized) {
  3836. // fast path 1: child component re-render only, parent did not change
  3837. return slots._normalized
  3838. } else if (
  3839. isStable &&
  3840. prevSlots &&
  3841. prevSlots !== emptyObject &&
  3842. key === prevSlots.$key &&
  3843. !hasNormalSlots &&
  3844. !prevSlots.$hasNormal
  3845. ) {
  3846. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3847. // only need to normalize once
  3848. return prevSlots
  3849. } else {
  3850. res = {};
  3851. for (var key$1 in slots) {
  3852. if (slots[key$1] && key$1[0] !== '$') {
  3853. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3854. }
  3855. }
  3856. }
  3857. // expose normal slots on scopedSlots
  3858. for (var key$2 in normalSlots) {
  3859. if (!(key$2 in res)) {
  3860. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3861. }
  3862. }
  3863. // avoriaz seems to mock a non-extensible $scopedSlots object
  3864. // and when that is passed down this would cause an error
  3865. if (slots && Object.isExtensible(slots)) {
  3866. (slots)._normalized = res;
  3867. }
  3868. def(res, '$stable', isStable);
  3869. def(res, '$key', key);
  3870. def(res, '$hasNormal', hasNormalSlots);
  3871. return res
  3872. }
  3873. function normalizeScopedSlot(normalSlots, key, fn) {
  3874. var normalized = function () {
  3875. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3876. res = res && typeof res === 'object' && !Array.isArray(res)
  3877. ? [res] // single vnode
  3878. : normalizeChildren(res);
  3879. return res && (
  3880. res.length === 0 ||
  3881. (res.length === 1 && res[0].isComment) // #9658
  3882. ) ? undefined
  3883. : res
  3884. };
  3885. // this is a slot using the new v-slot syntax without scope. although it is
  3886. // compiled as a scoped slot, render fn users would expect it to be present
  3887. // on this.$slots because the usage is semantically a normal slot.
  3888. if (fn.proxy) {
  3889. Object.defineProperty(normalSlots, key, {
  3890. get: normalized,
  3891. enumerable: true,
  3892. configurable: true
  3893. });
  3894. }
  3895. return normalized
  3896. }
  3897. function proxyNormalSlot(slots, key) {
  3898. return function () { return slots[key]; }
  3899. }
  3900. /* */
  3901. /**
  3902. * Runtime helper for rendering v-for lists.
  3903. */
  3904. function renderList (
  3905. val,
  3906. render
  3907. ) {
  3908. var ret, i, l, keys, key;
  3909. if (Array.isArray(val) || typeof val === 'string') {
  3910. ret = new Array(val.length);
  3911. for (i = 0, l = val.length; i < l; i++) {
  3912. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  3913. }
  3914. } else if (typeof val === 'number') {
  3915. ret = new Array(val);
  3916. for (i = 0; i < val; i++) {
  3917. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  3918. }
  3919. } else if (isObject(val)) {
  3920. if (hasSymbol && val[Symbol.iterator]) {
  3921. ret = [];
  3922. var iterator = val[Symbol.iterator]();
  3923. var result = iterator.next();
  3924. while (!result.done) {
  3925. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  3926. result = iterator.next();
  3927. }
  3928. } else {
  3929. keys = Object.keys(val);
  3930. ret = new Array(keys.length);
  3931. for (i = 0, l = keys.length; i < l; i++) {
  3932. key = keys[i];
  3933. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  3934. }
  3935. }
  3936. }
  3937. if (!isDef(ret)) {
  3938. ret = [];
  3939. }
  3940. (ret)._isVList = true;
  3941. return ret
  3942. }
  3943. /* */
  3944. /**
  3945. * Runtime helper for rendering <slot>
  3946. */
  3947. function renderSlot (
  3948. name,
  3949. fallback,
  3950. props,
  3951. bindObject
  3952. ) {
  3953. var scopedSlotFn = this.$scopedSlots[name];
  3954. var nodes;
  3955. if (scopedSlotFn) { // scoped slot
  3956. props = props || {};
  3957. if (bindObject) {
  3958. if ( true && !isObject(bindObject)) {
  3959. warn(
  3960. 'slot v-bind without argument expects an Object',
  3961. this
  3962. );
  3963. }
  3964. props = extend(extend({}, bindObject), props);
  3965. }
  3966. // fixed by xxxxxx app-plus scopedSlot
  3967. nodes = scopedSlotFn(props, this, props._i) || fallback;
  3968. } else {
  3969. nodes = this.$slots[name] || fallback;
  3970. }
  3971. var target = props && props.slot;
  3972. if (target) {
  3973. return this.$createElement('template', { slot: target }, nodes)
  3974. } else {
  3975. return nodes
  3976. }
  3977. }
  3978. /* */
  3979. /**
  3980. * Runtime helper for resolving filters
  3981. */
  3982. function resolveFilter (id) {
  3983. return resolveAsset(this.$options, 'filters', id, true) || identity
  3984. }
  3985. /* */
  3986. function isKeyNotMatch (expect, actual) {
  3987. if (Array.isArray(expect)) {
  3988. return expect.indexOf(actual) === -1
  3989. } else {
  3990. return expect !== actual
  3991. }
  3992. }
  3993. /**
  3994. * Runtime helper for checking keyCodes from config.
  3995. * exposed as Vue.prototype._k
  3996. * passing in eventKeyName as last argument separately for backwards compat
  3997. */
  3998. function checkKeyCodes (
  3999. eventKeyCode,
  4000. key,
  4001. builtInKeyCode,
  4002. eventKeyName,
  4003. builtInKeyName
  4004. ) {
  4005. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4006. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4007. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4008. } else if (mappedKeyCode) {
  4009. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4010. } else if (eventKeyName) {
  4011. return hyphenate(eventKeyName) !== key
  4012. }
  4013. }
  4014. /* */
  4015. /**
  4016. * Runtime helper for merging v-bind="object" into a VNode's data.
  4017. */
  4018. function bindObjectProps (
  4019. data,
  4020. tag,
  4021. value,
  4022. asProp,
  4023. isSync
  4024. ) {
  4025. if (value) {
  4026. if (!isObject(value)) {
  4027. true && warn(
  4028. 'v-bind without argument expects an Object or Array value',
  4029. this
  4030. );
  4031. } else {
  4032. if (Array.isArray(value)) {
  4033. value = toObject(value);
  4034. }
  4035. var hash;
  4036. var loop = function ( key ) {
  4037. if (
  4038. key === 'class' ||
  4039. key === 'style' ||
  4040. isReservedAttribute(key)
  4041. ) {
  4042. hash = data;
  4043. } else {
  4044. var type = data.attrs && data.attrs.type;
  4045. hash = asProp || config.mustUseProp(tag, type, key)
  4046. ? data.domProps || (data.domProps = {})
  4047. : data.attrs || (data.attrs = {});
  4048. }
  4049. var camelizedKey = camelize(key);
  4050. var hyphenatedKey = hyphenate(key);
  4051. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4052. hash[key] = value[key];
  4053. if (isSync) {
  4054. var on = data.on || (data.on = {});
  4055. on[("update:" + key)] = function ($event) {
  4056. value[key] = $event;
  4057. };
  4058. }
  4059. }
  4060. };
  4061. for (var key in value) loop( key );
  4062. }
  4063. }
  4064. return data
  4065. }
  4066. /* */
  4067. /**
  4068. * Runtime helper for rendering static trees.
  4069. */
  4070. function renderStatic (
  4071. index,
  4072. isInFor
  4073. ) {
  4074. var cached = this._staticTrees || (this._staticTrees = []);
  4075. var tree = cached[index];
  4076. // if has already-rendered static tree and not inside v-for,
  4077. // we can reuse the same tree.
  4078. if (tree && !isInFor) {
  4079. return tree
  4080. }
  4081. // otherwise, render a fresh tree.
  4082. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4083. this._renderProxy,
  4084. null,
  4085. this // for render fns generated for functional component templates
  4086. );
  4087. markStatic(tree, ("__static__" + index), false);
  4088. return tree
  4089. }
  4090. /**
  4091. * Runtime helper for v-once.
  4092. * Effectively it means marking the node as static with a unique key.
  4093. */
  4094. function markOnce (
  4095. tree,
  4096. index,
  4097. key
  4098. ) {
  4099. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4100. return tree
  4101. }
  4102. function markStatic (
  4103. tree,
  4104. key,
  4105. isOnce
  4106. ) {
  4107. if (Array.isArray(tree)) {
  4108. for (var i = 0; i < tree.length; i++) {
  4109. if (tree[i] && typeof tree[i] !== 'string') {
  4110. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4111. }
  4112. }
  4113. } else {
  4114. markStaticNode(tree, key, isOnce);
  4115. }
  4116. }
  4117. function markStaticNode (node, key, isOnce) {
  4118. node.isStatic = true;
  4119. node.key = key;
  4120. node.isOnce = isOnce;
  4121. }
  4122. /* */
  4123. function bindObjectListeners (data, value) {
  4124. if (value) {
  4125. if (!isPlainObject(value)) {
  4126. true && warn(
  4127. 'v-on without argument expects an Object value',
  4128. this
  4129. );
  4130. } else {
  4131. var on = data.on = data.on ? extend({}, data.on) : {};
  4132. for (var key in value) {
  4133. var existing = on[key];
  4134. var ours = value[key];
  4135. on[key] = existing ? [].concat(existing, ours) : ours;
  4136. }
  4137. }
  4138. }
  4139. return data
  4140. }
  4141. /* */
  4142. function resolveScopedSlots (
  4143. fns, // see flow/vnode
  4144. res,
  4145. // the following are added in 2.6
  4146. hasDynamicKeys,
  4147. contentHashKey
  4148. ) {
  4149. res = res || { $stable: !hasDynamicKeys };
  4150. for (var i = 0; i < fns.length; i++) {
  4151. var slot = fns[i];
  4152. if (Array.isArray(slot)) {
  4153. resolveScopedSlots(slot, res, hasDynamicKeys);
  4154. } else if (slot) {
  4155. // marker for reverse proxying v-slot without scope on this.$slots
  4156. if (slot.proxy) {
  4157. slot.fn.proxy = true;
  4158. }
  4159. res[slot.key] = slot.fn;
  4160. }
  4161. }
  4162. if (contentHashKey) {
  4163. (res).$key = contentHashKey;
  4164. }
  4165. return res
  4166. }
  4167. /* */
  4168. function bindDynamicKeys (baseObj, values) {
  4169. for (var i = 0; i < values.length; i += 2) {
  4170. var key = values[i];
  4171. if (typeof key === 'string' && key) {
  4172. baseObj[values[i]] = values[i + 1];
  4173. } else if ( true && key !== '' && key !== null) {
  4174. // null is a special value for explicitly removing a binding
  4175. warn(
  4176. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4177. this
  4178. );
  4179. }
  4180. }
  4181. return baseObj
  4182. }
  4183. // helper to dynamically append modifier runtime markers to event names.
  4184. // ensure only append when value is already string, otherwise it will be cast
  4185. // to string and cause the type check to miss.
  4186. function prependModifier (value, symbol) {
  4187. return typeof value === 'string' ? symbol + value : value
  4188. }
  4189. /* */
  4190. function installRenderHelpers (target) {
  4191. target._o = markOnce;
  4192. target._n = toNumber;
  4193. target._s = toString;
  4194. target._l = renderList;
  4195. target._t = renderSlot;
  4196. target._q = looseEqual;
  4197. target._i = looseIndexOf;
  4198. target._m = renderStatic;
  4199. target._f = resolveFilter;
  4200. target._k = checkKeyCodes;
  4201. target._b = bindObjectProps;
  4202. target._v = createTextVNode;
  4203. target._e = createEmptyVNode;
  4204. target._u = resolveScopedSlots;
  4205. target._g = bindObjectListeners;
  4206. target._d = bindDynamicKeys;
  4207. target._p = prependModifier;
  4208. }
  4209. /* */
  4210. function FunctionalRenderContext (
  4211. data,
  4212. props,
  4213. children,
  4214. parent,
  4215. Ctor
  4216. ) {
  4217. var this$1 = this;
  4218. var options = Ctor.options;
  4219. // ensure the createElement function in functional components
  4220. // gets a unique context - this is necessary for correct named slot check
  4221. var contextVm;
  4222. if (hasOwn(parent, '_uid')) {
  4223. contextVm = Object.create(parent);
  4224. // $flow-disable-line
  4225. contextVm._original = parent;
  4226. } else {
  4227. // the context vm passed in is a functional context as well.
  4228. // in this case we want to make sure we are able to get a hold to the
  4229. // real context instance.
  4230. contextVm = parent;
  4231. // $flow-disable-line
  4232. parent = parent._original;
  4233. }
  4234. var isCompiled = isTrue(options._compiled);
  4235. var needNormalization = !isCompiled;
  4236. this.data = data;
  4237. this.props = props;
  4238. this.children = children;
  4239. this.parent = parent;
  4240. this.listeners = data.on || emptyObject;
  4241. this.injections = resolveInject(options.inject, parent);
  4242. this.slots = function () {
  4243. if (!this$1.$slots) {
  4244. normalizeScopedSlots(
  4245. data.scopedSlots,
  4246. this$1.$slots = resolveSlots(children, parent)
  4247. );
  4248. }
  4249. return this$1.$slots
  4250. };
  4251. Object.defineProperty(this, 'scopedSlots', ({
  4252. enumerable: true,
  4253. get: function get () {
  4254. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4255. }
  4256. }));
  4257. // support for compiled functional template
  4258. if (isCompiled) {
  4259. // exposing $options for renderStatic()
  4260. this.$options = options;
  4261. // pre-resolve slots for renderSlot()
  4262. this.$slots = this.slots();
  4263. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4264. }
  4265. if (options._scopeId) {
  4266. this._c = function (a, b, c, d) {
  4267. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4268. if (vnode && !Array.isArray(vnode)) {
  4269. vnode.fnScopeId = options._scopeId;
  4270. vnode.fnContext = parent;
  4271. }
  4272. return vnode
  4273. };
  4274. } else {
  4275. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4276. }
  4277. }
  4278. installRenderHelpers(FunctionalRenderContext.prototype);
  4279. function createFunctionalComponent (
  4280. Ctor,
  4281. propsData,
  4282. data,
  4283. contextVm,
  4284. children
  4285. ) {
  4286. var options = Ctor.options;
  4287. var props = {};
  4288. var propOptions = options.props;
  4289. if (isDef(propOptions)) {
  4290. for (var key in propOptions) {
  4291. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4292. }
  4293. } else {
  4294. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4295. if (isDef(data.props)) { mergeProps(props, data.props); }
  4296. }
  4297. var renderContext = new FunctionalRenderContext(
  4298. data,
  4299. props,
  4300. children,
  4301. contextVm,
  4302. Ctor
  4303. );
  4304. var vnode = options.render.call(null, renderContext._c, renderContext);
  4305. if (vnode instanceof VNode) {
  4306. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4307. } else if (Array.isArray(vnode)) {
  4308. var vnodes = normalizeChildren(vnode) || [];
  4309. var res = new Array(vnodes.length);
  4310. for (var i = 0; i < vnodes.length; i++) {
  4311. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4312. }
  4313. return res
  4314. }
  4315. }
  4316. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4317. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4318. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4319. // that should not be matched to match.
  4320. var clone = cloneVNode(vnode);
  4321. clone.fnContext = contextVm;
  4322. clone.fnOptions = options;
  4323. if (true) {
  4324. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4325. }
  4326. if (data.slot) {
  4327. (clone.data || (clone.data = {})).slot = data.slot;
  4328. }
  4329. return clone
  4330. }
  4331. function mergeProps (to, from) {
  4332. for (var key in from) {
  4333. to[camelize(key)] = from[key];
  4334. }
  4335. }
  4336. /* */
  4337. /* */
  4338. /* */
  4339. /* */
  4340. // inline hooks to be invoked on component VNodes during patch
  4341. var componentVNodeHooks = {
  4342. init: function init (vnode, hydrating) {
  4343. if (
  4344. vnode.componentInstance &&
  4345. !vnode.componentInstance._isDestroyed &&
  4346. vnode.data.keepAlive
  4347. ) {
  4348. // kept-alive components, treat as a patch
  4349. var mountedNode = vnode; // work around flow
  4350. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4351. } else {
  4352. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4353. vnode,
  4354. activeInstance
  4355. );
  4356. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4357. }
  4358. },
  4359. prepatch: function prepatch (oldVnode, vnode) {
  4360. var options = vnode.componentOptions;
  4361. var child = vnode.componentInstance = oldVnode.componentInstance;
  4362. updateChildComponent(
  4363. child,
  4364. options.propsData, // updated props
  4365. options.listeners, // updated listeners
  4366. vnode, // new parent vnode
  4367. options.children // new children
  4368. );
  4369. },
  4370. insert: function insert (vnode) {
  4371. var context = vnode.context;
  4372. var componentInstance = vnode.componentInstance;
  4373. if (!componentInstance._isMounted) {
  4374. callHook(componentInstance, 'onServiceCreated');
  4375. callHook(componentInstance, 'onServiceAttached');
  4376. componentInstance._isMounted = true;
  4377. callHook(componentInstance, 'mounted');
  4378. }
  4379. if (vnode.data.keepAlive) {
  4380. if (context._isMounted) {
  4381. // vue-router#1212
  4382. // During updates, a kept-alive component's child components may
  4383. // change, so directly walking the tree here may call activated hooks
  4384. // on incorrect children. Instead we push them into a queue which will
  4385. // be processed after the whole patch process ended.
  4386. queueActivatedComponent(componentInstance);
  4387. } else {
  4388. activateChildComponent(componentInstance, true /* direct */);
  4389. }
  4390. }
  4391. },
  4392. destroy: function destroy (vnode) {
  4393. var componentInstance = vnode.componentInstance;
  4394. if (!componentInstance._isDestroyed) {
  4395. if (!vnode.data.keepAlive) {
  4396. componentInstance.$destroy();
  4397. } else {
  4398. deactivateChildComponent(componentInstance, true /* direct */);
  4399. }
  4400. }
  4401. }
  4402. };
  4403. var hooksToMerge = Object.keys(componentVNodeHooks);
  4404. function createComponent (
  4405. Ctor,
  4406. data,
  4407. context,
  4408. children,
  4409. tag
  4410. ) {
  4411. if (isUndef(Ctor)) {
  4412. return
  4413. }
  4414. var baseCtor = context.$options._base;
  4415. // plain options object: turn it into a constructor
  4416. if (isObject(Ctor)) {
  4417. Ctor = baseCtor.extend(Ctor);
  4418. }
  4419. // if at this stage it's not a constructor or an async component factory,
  4420. // reject.
  4421. if (typeof Ctor !== 'function') {
  4422. if (true) {
  4423. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4424. }
  4425. return
  4426. }
  4427. // async component
  4428. var asyncFactory;
  4429. if (isUndef(Ctor.cid)) {
  4430. asyncFactory = Ctor;
  4431. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4432. if (Ctor === undefined) {
  4433. // return a placeholder node for async component, which is rendered
  4434. // as a comment node but preserves all the raw information for the node.
  4435. // the information will be used for async server-rendering and hydration.
  4436. return createAsyncPlaceholder(
  4437. asyncFactory,
  4438. data,
  4439. context,
  4440. children,
  4441. tag
  4442. )
  4443. }
  4444. }
  4445. data = data || {};
  4446. // resolve constructor options in case global mixins are applied after
  4447. // component constructor creation
  4448. resolveConstructorOptions(Ctor);
  4449. // transform component v-model data into props & events
  4450. if (isDef(data.model)) {
  4451. transformModel(Ctor.options, data);
  4452. }
  4453. // extract props
  4454. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4455. // functional component
  4456. if (isTrue(Ctor.options.functional)) {
  4457. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4458. }
  4459. // extract listeners, since these needs to be treated as
  4460. // child component listeners instead of DOM listeners
  4461. var listeners = data.on;
  4462. // replace with listeners with .native modifier
  4463. // so it gets processed during parent component patch.
  4464. data.on = data.nativeOn;
  4465. if (isTrue(Ctor.options.abstract)) {
  4466. // abstract components do not keep anything
  4467. // other than props & listeners & slot
  4468. // work around flow
  4469. var slot = data.slot;
  4470. data = {};
  4471. if (slot) {
  4472. data.slot = slot;
  4473. }
  4474. }
  4475. // install component management hooks onto the placeholder node
  4476. installComponentHooks(data);
  4477. // return a placeholder vnode
  4478. var name = Ctor.options.name || tag;
  4479. var vnode = new VNode(
  4480. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4481. data, undefined, undefined, undefined, context,
  4482. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4483. asyncFactory
  4484. );
  4485. return vnode
  4486. }
  4487. function createComponentInstanceForVnode (
  4488. vnode, // we know it's MountedComponentVNode but flow doesn't
  4489. parent // activeInstance in lifecycle state
  4490. ) {
  4491. var options = {
  4492. _isComponent: true,
  4493. _parentVnode: vnode,
  4494. parent: parent
  4495. };
  4496. // check inline-template render functions
  4497. var inlineTemplate = vnode.data.inlineTemplate;
  4498. if (isDef(inlineTemplate)) {
  4499. options.render = inlineTemplate.render;
  4500. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4501. }
  4502. return new vnode.componentOptions.Ctor(options)
  4503. }
  4504. function installComponentHooks (data) {
  4505. var hooks = data.hook || (data.hook = {});
  4506. for (var i = 0; i < hooksToMerge.length; i++) {
  4507. var key = hooksToMerge[i];
  4508. var existing = hooks[key];
  4509. var toMerge = componentVNodeHooks[key];
  4510. if (existing !== toMerge && !(existing && existing._merged)) {
  4511. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4512. }
  4513. }
  4514. }
  4515. function mergeHook$1 (f1, f2) {
  4516. var merged = function (a, b) {
  4517. // flow complains about extra args which is why we use any
  4518. f1(a, b);
  4519. f2(a, b);
  4520. };
  4521. merged._merged = true;
  4522. return merged
  4523. }
  4524. // transform component v-model info (value and callback) into
  4525. // prop and event handler respectively.
  4526. function transformModel (options, data) {
  4527. var prop = (options.model && options.model.prop) || 'value';
  4528. var event = (options.model && options.model.event) || 'input'
  4529. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4530. var on = data.on || (data.on = {});
  4531. var existing = on[event];
  4532. var callback = data.model.callback;
  4533. if (isDef(existing)) {
  4534. if (
  4535. Array.isArray(existing)
  4536. ? existing.indexOf(callback) === -1
  4537. : existing !== callback
  4538. ) {
  4539. on[event] = [callback].concat(existing);
  4540. }
  4541. } else {
  4542. on[event] = callback;
  4543. }
  4544. }
  4545. /* */
  4546. var SIMPLE_NORMALIZE = 1;
  4547. var ALWAYS_NORMALIZE = 2;
  4548. // wrapper function for providing a more flexible interface
  4549. // without getting yelled at by flow
  4550. function createElement (
  4551. context,
  4552. tag,
  4553. data,
  4554. children,
  4555. normalizationType,
  4556. alwaysNormalize
  4557. ) {
  4558. if (Array.isArray(data) || isPrimitive(data)) {
  4559. normalizationType = children;
  4560. children = data;
  4561. data = undefined;
  4562. }
  4563. if (isTrue(alwaysNormalize)) {
  4564. normalizationType = ALWAYS_NORMALIZE;
  4565. }
  4566. return _createElement(context, tag, data, children, normalizationType)
  4567. }
  4568. function _createElement (
  4569. context,
  4570. tag,
  4571. data,
  4572. children,
  4573. normalizationType
  4574. ) {
  4575. if (isDef(data) && isDef((data).__ob__)) {
  4576. true && warn(
  4577. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4578. 'Always create fresh vnode data objects in each render!',
  4579. context
  4580. );
  4581. return createEmptyVNode()
  4582. }
  4583. // object syntax in v-bind
  4584. if (isDef(data) && isDef(data.is)) {
  4585. tag = data.is;
  4586. }
  4587. if (!tag) {
  4588. // in case of component :is set to falsy value
  4589. return createEmptyVNode()
  4590. }
  4591. // warn against non-primitive key
  4592. if ( true &&
  4593. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4594. ) {
  4595. {
  4596. warn(
  4597. 'Avoid using non-primitive value as key, ' +
  4598. 'use string/number value instead.',
  4599. context
  4600. );
  4601. }
  4602. }
  4603. // support single function children as default scoped slot
  4604. if (Array.isArray(children) &&
  4605. typeof children[0] === 'function'
  4606. ) {
  4607. data = data || {};
  4608. data.scopedSlots = { default: children[0] };
  4609. children.length = 0;
  4610. }
  4611. if (normalizationType === ALWAYS_NORMALIZE) {
  4612. children = normalizeChildren(children);
  4613. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4614. children = simpleNormalizeChildren(children);
  4615. }
  4616. var vnode, ns;
  4617. if (typeof tag === 'string') {
  4618. var Ctor;
  4619. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4620. if (config.isReservedTag(tag)) {
  4621. // platform built-in elements
  4622. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4623. warn(
  4624. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4625. context
  4626. );
  4627. }
  4628. vnode = new VNode(
  4629. config.parsePlatformTagName(tag), data, children,
  4630. undefined, undefined, context
  4631. );
  4632. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4633. // component
  4634. vnode = createComponent(Ctor, data, context, children, tag);
  4635. } else {
  4636. // unknown or unlisted namespaced elements
  4637. // check at runtime because it may get assigned a namespace when its
  4638. // parent normalizes children
  4639. vnode = new VNode(
  4640. tag, data, children,
  4641. undefined, undefined, context
  4642. );
  4643. }
  4644. } else {
  4645. // direct component options / constructor
  4646. vnode = createComponent(tag, data, context, children);
  4647. }
  4648. if (Array.isArray(vnode)) {
  4649. return vnode
  4650. } else if (isDef(vnode)) {
  4651. if (isDef(ns)) { applyNS(vnode, ns); }
  4652. if (isDef(data)) { registerDeepBindings(data); }
  4653. return vnode
  4654. } else {
  4655. return createEmptyVNode()
  4656. }
  4657. }
  4658. function applyNS (vnode, ns, force) {
  4659. vnode.ns = ns;
  4660. if (vnode.tag === 'foreignObject') {
  4661. // use default namespace inside foreignObject
  4662. ns = undefined;
  4663. force = true;
  4664. }
  4665. if (isDef(vnode.children)) {
  4666. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4667. var child = vnode.children[i];
  4668. if (isDef(child.tag) && (
  4669. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4670. applyNS(child, ns, force);
  4671. }
  4672. }
  4673. }
  4674. }
  4675. // ref #5318
  4676. // necessary to ensure parent re-render when deep bindings like :style and
  4677. // :class are used on slot nodes
  4678. function registerDeepBindings (data) {
  4679. if (isObject(data.style)) {
  4680. traverse(data.style);
  4681. }
  4682. if (isObject(data.class)) {
  4683. traverse(data.class);
  4684. }
  4685. }
  4686. /* */
  4687. function initRender (vm) {
  4688. vm._vnode = null; // the root of the child tree
  4689. vm._staticTrees = null; // v-once cached trees
  4690. var options = vm.$options;
  4691. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4692. var renderContext = parentVnode && parentVnode.context;
  4693. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4694. vm.$scopedSlots = emptyObject;
  4695. // bind the createElement fn to this instance
  4696. // so that we get proper render context inside it.
  4697. // args order: tag, data, children, normalizationType, alwaysNormalize
  4698. // internal version is used by render functions compiled from templates
  4699. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4700. // normalization is always applied for the public version, used in
  4701. // user-written render functions.
  4702. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4703. // $attrs & $listeners are exposed for easier HOC creation.
  4704. // they need to be reactive so that HOCs using them are always updated
  4705. var parentData = parentVnode && parentVnode.data;
  4706. /* istanbul ignore else */
  4707. if (true) {
  4708. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4709. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4710. }, true);
  4711. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4712. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4713. }, true);
  4714. } else {}
  4715. }
  4716. var currentRenderingInstance = null;
  4717. function renderMixin (Vue) {
  4718. // install runtime convenience helpers
  4719. installRenderHelpers(Vue.prototype);
  4720. Vue.prototype.$nextTick = function (fn) {
  4721. return nextTick(fn, this)
  4722. };
  4723. Vue.prototype._render = function () {
  4724. var vm = this;
  4725. var ref = vm.$options;
  4726. var render = ref.render;
  4727. var _parentVnode = ref._parentVnode;
  4728. if (_parentVnode) {
  4729. vm.$scopedSlots = normalizeScopedSlots(
  4730. _parentVnode.data.scopedSlots,
  4731. vm.$slots,
  4732. vm.$scopedSlots
  4733. );
  4734. }
  4735. // set parent vnode. this allows render functions to have access
  4736. // to the data on the placeholder node.
  4737. vm.$vnode = _parentVnode;
  4738. // render self
  4739. var vnode;
  4740. try {
  4741. // There's no need to maintain a stack because all render fns are called
  4742. // separately from one another. Nested component's render fns are called
  4743. // when parent component is patched.
  4744. currentRenderingInstance = vm;
  4745. vnode = render.call(vm._renderProxy, vm.$createElement);
  4746. } catch (e) {
  4747. handleError(e, vm, "render");
  4748. // return error render result,
  4749. // or previous vnode to prevent render error causing blank component
  4750. /* istanbul ignore else */
  4751. if ( true && vm.$options.renderError) {
  4752. try {
  4753. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4754. } catch (e) {
  4755. handleError(e, vm, "renderError");
  4756. vnode = vm._vnode;
  4757. }
  4758. } else {
  4759. vnode = vm._vnode;
  4760. }
  4761. } finally {
  4762. currentRenderingInstance = null;
  4763. }
  4764. // if the returned array contains only a single node, allow it
  4765. if (Array.isArray(vnode) && vnode.length === 1) {
  4766. vnode = vnode[0];
  4767. }
  4768. // return empty vnode in case the render function errored out
  4769. if (!(vnode instanceof VNode)) {
  4770. if ( true && Array.isArray(vnode)) {
  4771. warn(
  4772. 'Multiple root nodes returned from render function. Render function ' +
  4773. 'should return a single root node.',
  4774. vm
  4775. );
  4776. }
  4777. vnode = createEmptyVNode();
  4778. }
  4779. // set parent
  4780. vnode.parent = _parentVnode;
  4781. return vnode
  4782. };
  4783. }
  4784. /* */
  4785. function ensureCtor (comp, base) {
  4786. if (
  4787. comp.__esModule ||
  4788. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4789. ) {
  4790. comp = comp.default;
  4791. }
  4792. return isObject(comp)
  4793. ? base.extend(comp)
  4794. : comp
  4795. }
  4796. function createAsyncPlaceholder (
  4797. factory,
  4798. data,
  4799. context,
  4800. children,
  4801. tag
  4802. ) {
  4803. var node = createEmptyVNode();
  4804. node.asyncFactory = factory;
  4805. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4806. return node
  4807. }
  4808. function resolveAsyncComponent (
  4809. factory,
  4810. baseCtor
  4811. ) {
  4812. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4813. return factory.errorComp
  4814. }
  4815. if (isDef(factory.resolved)) {
  4816. return factory.resolved
  4817. }
  4818. var owner = currentRenderingInstance;
  4819. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4820. // already pending
  4821. factory.owners.push(owner);
  4822. }
  4823. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4824. return factory.loadingComp
  4825. }
  4826. if (owner && !isDef(factory.owners)) {
  4827. var owners = factory.owners = [owner];
  4828. var sync = true;
  4829. var timerLoading = null;
  4830. var timerTimeout = null
  4831. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4832. var forceRender = function (renderCompleted) {
  4833. for (var i = 0, l = owners.length; i < l; i++) {
  4834. (owners[i]).$forceUpdate();
  4835. }
  4836. if (renderCompleted) {
  4837. owners.length = 0;
  4838. if (timerLoading !== null) {
  4839. clearTimeout(timerLoading);
  4840. timerLoading = null;
  4841. }
  4842. if (timerTimeout !== null) {
  4843. clearTimeout(timerTimeout);
  4844. timerTimeout = null;
  4845. }
  4846. }
  4847. };
  4848. var resolve = once(function (res) {
  4849. // cache resolved
  4850. factory.resolved = ensureCtor(res, baseCtor);
  4851. // invoke callbacks only if this is not a synchronous resolve
  4852. // (async resolves are shimmed as synchronous during SSR)
  4853. if (!sync) {
  4854. forceRender(true);
  4855. } else {
  4856. owners.length = 0;
  4857. }
  4858. });
  4859. var reject = once(function (reason) {
  4860. true && warn(
  4861. "Failed to resolve async component: " + (String(factory)) +
  4862. (reason ? ("\nReason: " + reason) : '')
  4863. );
  4864. if (isDef(factory.errorComp)) {
  4865. factory.error = true;
  4866. forceRender(true);
  4867. }
  4868. });
  4869. var res = factory(resolve, reject);
  4870. if (isObject(res)) {
  4871. if (isPromise(res)) {
  4872. // () => Promise
  4873. if (isUndef(factory.resolved)) {
  4874. res.then(resolve, reject);
  4875. }
  4876. } else if (isPromise(res.component)) {
  4877. res.component.then(resolve, reject);
  4878. if (isDef(res.error)) {
  4879. factory.errorComp = ensureCtor(res.error, baseCtor);
  4880. }
  4881. if (isDef(res.loading)) {
  4882. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4883. if (res.delay === 0) {
  4884. factory.loading = true;
  4885. } else {
  4886. timerLoading = setTimeout(function () {
  4887. timerLoading = null;
  4888. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4889. factory.loading = true;
  4890. forceRender(false);
  4891. }
  4892. }, res.delay || 200);
  4893. }
  4894. }
  4895. if (isDef(res.timeout)) {
  4896. timerTimeout = setTimeout(function () {
  4897. timerTimeout = null;
  4898. if (isUndef(factory.resolved)) {
  4899. reject(
  4900. true
  4901. ? ("timeout (" + (res.timeout) + "ms)")
  4902. : undefined
  4903. );
  4904. }
  4905. }, res.timeout);
  4906. }
  4907. }
  4908. }
  4909. sync = false;
  4910. // return in case resolved synchronously
  4911. return factory.loading
  4912. ? factory.loadingComp
  4913. : factory.resolved
  4914. }
  4915. }
  4916. /* */
  4917. function isAsyncPlaceholder (node) {
  4918. return node.isComment && node.asyncFactory
  4919. }
  4920. /* */
  4921. function getFirstComponentChild (children) {
  4922. if (Array.isArray(children)) {
  4923. for (var i = 0; i < children.length; i++) {
  4924. var c = children[i];
  4925. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4926. return c
  4927. }
  4928. }
  4929. }
  4930. }
  4931. /* */
  4932. /* */
  4933. function initEvents (vm) {
  4934. vm._events = Object.create(null);
  4935. vm._hasHookEvent = false;
  4936. // init parent attached events
  4937. var listeners = vm.$options._parentListeners;
  4938. if (listeners) {
  4939. updateComponentListeners(vm, listeners);
  4940. }
  4941. }
  4942. var target;
  4943. function add (event, fn) {
  4944. target.$on(event, fn);
  4945. }
  4946. function remove$1 (event, fn) {
  4947. target.$off(event, fn);
  4948. }
  4949. function createOnceHandler (event, fn) {
  4950. var _target = target;
  4951. return function onceHandler () {
  4952. var res = fn.apply(null, arguments);
  4953. if (res !== null) {
  4954. _target.$off(event, onceHandler);
  4955. }
  4956. }
  4957. }
  4958. function updateComponentListeners (
  4959. vm,
  4960. listeners,
  4961. oldListeners
  4962. ) {
  4963. target = vm;
  4964. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  4965. target = undefined;
  4966. }
  4967. function eventsMixin (Vue) {
  4968. var hookRE = /^hook:/;
  4969. Vue.prototype.$on = function (event, fn) {
  4970. var vm = this;
  4971. if (Array.isArray(event)) {
  4972. for (var i = 0, l = event.length; i < l; i++) {
  4973. vm.$on(event[i], fn);
  4974. }
  4975. } else {
  4976. (vm._events[event] || (vm._events[event] = [])).push(fn);
  4977. // optimize hook:event cost by using a boolean flag marked at registration
  4978. // instead of a hash lookup
  4979. if (hookRE.test(event)) {
  4980. vm._hasHookEvent = true;
  4981. }
  4982. }
  4983. return vm
  4984. };
  4985. Vue.prototype.$once = function (event, fn) {
  4986. var vm = this;
  4987. function on () {
  4988. vm.$off(event, on);
  4989. fn.apply(vm, arguments);
  4990. }
  4991. on.fn = fn;
  4992. vm.$on(event, on);
  4993. return vm
  4994. };
  4995. Vue.prototype.$off = function (event, fn) {
  4996. var vm = this;
  4997. // all
  4998. if (!arguments.length) {
  4999. vm._events = Object.create(null);
  5000. return vm
  5001. }
  5002. // array of events
  5003. if (Array.isArray(event)) {
  5004. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5005. vm.$off(event[i$1], fn);
  5006. }
  5007. return vm
  5008. }
  5009. // specific event
  5010. var cbs = vm._events[event];
  5011. if (!cbs) {
  5012. return vm
  5013. }
  5014. if (!fn) {
  5015. vm._events[event] = null;
  5016. return vm
  5017. }
  5018. // specific handler
  5019. var cb;
  5020. var i = cbs.length;
  5021. while (i--) {
  5022. cb = cbs[i];
  5023. if (cb === fn || cb.fn === fn) {
  5024. cbs.splice(i, 1);
  5025. break
  5026. }
  5027. }
  5028. return vm
  5029. };
  5030. Vue.prototype.$emit = function (event) {
  5031. var vm = this;
  5032. if (true) {
  5033. var lowerCaseEvent = event.toLowerCase();
  5034. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5035. tip(
  5036. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5037. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5038. "Note that HTML attributes are case-insensitive and you cannot use " +
  5039. "v-on to listen to camelCase events when using in-DOM templates. " +
  5040. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5041. );
  5042. }
  5043. }
  5044. var cbs = vm._events[event];
  5045. if (cbs) {
  5046. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5047. var args = toArray(arguments, 1);
  5048. var info = "event handler for \"" + event + "\"";
  5049. for (var i = 0, l = cbs.length; i < l; i++) {
  5050. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5051. }
  5052. }
  5053. return vm
  5054. };
  5055. }
  5056. /* */
  5057. var activeInstance = null;
  5058. var isUpdatingChildComponent = false;
  5059. function setActiveInstance(vm) {
  5060. var prevActiveInstance = activeInstance;
  5061. activeInstance = vm;
  5062. return function () {
  5063. activeInstance = prevActiveInstance;
  5064. }
  5065. }
  5066. function initLifecycle (vm) {
  5067. var options = vm.$options;
  5068. // locate first non-abstract parent
  5069. var parent = options.parent;
  5070. if (parent && !options.abstract) {
  5071. while (parent.$options.abstract && parent.$parent) {
  5072. parent = parent.$parent;
  5073. }
  5074. parent.$children.push(vm);
  5075. }
  5076. vm.$parent = parent;
  5077. vm.$root = parent ? parent.$root : vm;
  5078. vm.$children = [];
  5079. vm.$refs = {};
  5080. vm._watcher = null;
  5081. vm._inactive = null;
  5082. vm._directInactive = false;
  5083. vm._isMounted = false;
  5084. vm._isDestroyed = false;
  5085. vm._isBeingDestroyed = false;
  5086. }
  5087. function lifecycleMixin (Vue) {
  5088. Vue.prototype._update = function (vnode, hydrating) {
  5089. var vm = this;
  5090. var prevEl = vm.$el;
  5091. var prevVnode = vm._vnode;
  5092. var restoreActiveInstance = setActiveInstance(vm);
  5093. vm._vnode = vnode;
  5094. // Vue.prototype.__patch__ is injected in entry points
  5095. // based on the rendering backend used.
  5096. if (!prevVnode) {
  5097. // initial render
  5098. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5099. } else {
  5100. // updates
  5101. vm.$el = vm.__patch__(prevVnode, vnode);
  5102. }
  5103. restoreActiveInstance();
  5104. // update __vue__ reference
  5105. if (prevEl) {
  5106. prevEl.__vue__ = null;
  5107. }
  5108. if (vm.$el) {
  5109. vm.$el.__vue__ = vm;
  5110. }
  5111. // if parent is an HOC, update its $el as well
  5112. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5113. vm.$parent.$el = vm.$el;
  5114. }
  5115. // updated hook is called by the scheduler to ensure that children are
  5116. // updated in a parent's updated hook.
  5117. };
  5118. Vue.prototype.$forceUpdate = function () {
  5119. var vm = this;
  5120. if (vm._watcher) {
  5121. vm._watcher.update();
  5122. }
  5123. };
  5124. Vue.prototype.$destroy = function () {
  5125. var vm = this;
  5126. if (vm._isBeingDestroyed) {
  5127. return
  5128. }
  5129. callHook(vm, 'beforeDestroy');
  5130. vm._isBeingDestroyed = true;
  5131. // remove self from parent
  5132. var parent = vm.$parent;
  5133. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5134. remove(parent.$children, vm);
  5135. }
  5136. // teardown watchers
  5137. if (vm._watcher) {
  5138. vm._watcher.teardown();
  5139. }
  5140. var i = vm._watchers.length;
  5141. while (i--) {
  5142. vm._watchers[i].teardown();
  5143. }
  5144. // remove reference from data ob
  5145. // frozen object may not have observer.
  5146. if (vm._data.__ob__) {
  5147. vm._data.__ob__.vmCount--;
  5148. }
  5149. // call the last hook...
  5150. vm._isDestroyed = true;
  5151. // invoke destroy hooks on current rendered tree
  5152. vm.__patch__(vm._vnode, null);
  5153. // fire destroyed hook
  5154. callHook(vm, 'destroyed');
  5155. // turn off all instance listeners.
  5156. vm.$off();
  5157. // remove __vue__ reference
  5158. if (vm.$el) {
  5159. vm.$el.__vue__ = null;
  5160. }
  5161. // release circular reference (#6759)
  5162. if (vm.$vnode) {
  5163. vm.$vnode.parent = null;
  5164. }
  5165. };
  5166. }
  5167. function updateChildComponent (
  5168. vm,
  5169. propsData,
  5170. listeners,
  5171. parentVnode,
  5172. renderChildren
  5173. ) {
  5174. if (true) {
  5175. isUpdatingChildComponent = true;
  5176. }
  5177. // determine whether component has slot children
  5178. // we need to do this before overwriting $options._renderChildren.
  5179. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5180. // dynamic slot names). Static scoped slots compiled from template has the
  5181. // "$stable" marker.
  5182. var newScopedSlots = parentVnode.data.scopedSlots;
  5183. var oldScopedSlots = vm.$scopedSlots;
  5184. var hasDynamicScopedSlot = !!(
  5185. (newScopedSlots && !newScopedSlots.$stable) ||
  5186. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5187. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5188. );
  5189. // Any static slot children from the parent may have changed during parent's
  5190. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5191. // update is necessary to ensure correctness.
  5192. var needsForceUpdate = !!(
  5193. renderChildren || // has new static slots
  5194. vm.$options._renderChildren || // has old static slots
  5195. hasDynamicScopedSlot
  5196. );
  5197. vm.$options._parentVnode = parentVnode;
  5198. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5199. if (vm._vnode) { // update child tree's parent
  5200. vm._vnode.parent = parentVnode;
  5201. }
  5202. vm.$options._renderChildren = renderChildren;
  5203. // update $attrs and $listeners hash
  5204. // these are also reactive so they may trigger child update if the child
  5205. // used them during render
  5206. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5207. vm.$listeners = listeners || emptyObject;
  5208. // update props
  5209. if (propsData && vm.$options.props) {
  5210. toggleObserving(false);
  5211. var props = vm._props;
  5212. var propKeys = vm.$options._propKeys || [];
  5213. for (var i = 0; i < propKeys.length; i++) {
  5214. var key = propKeys[i];
  5215. var propOptions = vm.$options.props; // wtf flow?
  5216. props[key] = validateProp(key, propOptions, propsData, vm);
  5217. }
  5218. toggleObserving(true);
  5219. // keep a copy of raw propsData
  5220. vm.$options.propsData = propsData;
  5221. }
  5222. // fixed by xxxxxx update properties(mp runtime)
  5223. vm._$updateProperties && vm._$updateProperties(vm);
  5224. // update listeners
  5225. listeners = listeners || emptyObject;
  5226. var oldListeners = vm.$options._parentListeners;
  5227. vm.$options._parentListeners = listeners;
  5228. updateComponentListeners(vm, listeners, oldListeners);
  5229. // resolve slots + force update if has children
  5230. if (needsForceUpdate) {
  5231. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5232. vm.$forceUpdate();
  5233. }
  5234. if (true) {
  5235. isUpdatingChildComponent = false;
  5236. }
  5237. }
  5238. function isInInactiveTree (vm) {
  5239. while (vm && (vm = vm.$parent)) {
  5240. if (vm._inactive) { return true }
  5241. }
  5242. return false
  5243. }
  5244. function activateChildComponent (vm, direct) {
  5245. if (direct) {
  5246. vm._directInactive = false;
  5247. if (isInInactiveTree(vm)) {
  5248. return
  5249. }
  5250. } else if (vm._directInactive) {
  5251. return
  5252. }
  5253. if (vm._inactive || vm._inactive === null) {
  5254. vm._inactive = false;
  5255. for (var i = 0; i < vm.$children.length; i++) {
  5256. activateChildComponent(vm.$children[i]);
  5257. }
  5258. callHook(vm, 'activated');
  5259. }
  5260. }
  5261. function deactivateChildComponent (vm, direct) {
  5262. if (direct) {
  5263. vm._directInactive = true;
  5264. if (isInInactiveTree(vm)) {
  5265. return
  5266. }
  5267. }
  5268. if (!vm._inactive) {
  5269. vm._inactive = true;
  5270. for (var i = 0; i < vm.$children.length; i++) {
  5271. deactivateChildComponent(vm.$children[i]);
  5272. }
  5273. callHook(vm, 'deactivated');
  5274. }
  5275. }
  5276. function callHook (vm, hook) {
  5277. // #7573 disable dep collection when invoking lifecycle hooks
  5278. pushTarget();
  5279. var handlers = vm.$options[hook];
  5280. var info = hook + " hook";
  5281. if (handlers) {
  5282. for (var i = 0, j = handlers.length; i < j; i++) {
  5283. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5284. }
  5285. }
  5286. if (vm._hasHookEvent) {
  5287. vm.$emit('hook:' + hook);
  5288. }
  5289. popTarget();
  5290. }
  5291. /* */
  5292. var MAX_UPDATE_COUNT = 100;
  5293. var queue = [];
  5294. var activatedChildren = [];
  5295. var has = {};
  5296. var circular = {};
  5297. var waiting = false;
  5298. var flushing = false;
  5299. var index = 0;
  5300. /**
  5301. * Reset the scheduler's state.
  5302. */
  5303. function resetSchedulerState () {
  5304. index = queue.length = activatedChildren.length = 0;
  5305. has = {};
  5306. if (true) {
  5307. circular = {};
  5308. }
  5309. waiting = flushing = false;
  5310. }
  5311. // Async edge case #6566 requires saving the timestamp when event listeners are
  5312. // attached. However, calling performance.now() has a perf overhead especially
  5313. // if the page has thousands of event listeners. Instead, we take a timestamp
  5314. // every time the scheduler flushes and use that for all event listeners
  5315. // attached during that flush.
  5316. var currentFlushTimestamp = 0;
  5317. // Async edge case fix requires storing an event listener's attach timestamp.
  5318. var getNow = Date.now;
  5319. // Determine what event timestamp the browser is using. Annoyingly, the
  5320. // timestamp can either be hi-res (relative to page load) or low-res
  5321. // (relative to UNIX epoch), so in order to compare time we have to use the
  5322. // same timestamp type when saving the flush timestamp.
  5323. // All IE versions use low-res event timestamps, and have problematic clock
  5324. // implementations (#9632)
  5325. if (inBrowser && !isIE) {
  5326. var performance = window.performance;
  5327. if (
  5328. performance &&
  5329. typeof performance.now === 'function' &&
  5330. getNow() > document.createEvent('Event').timeStamp
  5331. ) {
  5332. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5333. // smaller than it, it means the event is using a hi-res timestamp,
  5334. // and we need to use the hi-res version for event listener timestamps as
  5335. // well.
  5336. getNow = function () { return performance.now(); };
  5337. }
  5338. }
  5339. /**
  5340. * Flush both queues and run the watchers.
  5341. */
  5342. function flushSchedulerQueue () {
  5343. currentFlushTimestamp = getNow();
  5344. flushing = true;
  5345. var watcher, id;
  5346. // Sort queue before flush.
  5347. // This ensures that:
  5348. // 1. Components are updated from parent to child. (because parent is always
  5349. // created before the child)
  5350. // 2. A component's user watchers are run before its render watcher (because
  5351. // user watchers are created before the render watcher)
  5352. // 3. If a component is destroyed during a parent component's watcher run,
  5353. // its watchers can be skipped.
  5354. queue.sort(function (a, b) { return a.id - b.id; });
  5355. // do not cache length because more watchers might be pushed
  5356. // as we run existing watchers
  5357. for (index = 0; index < queue.length; index++) {
  5358. watcher = queue[index];
  5359. if (watcher.before) {
  5360. watcher.before();
  5361. }
  5362. id = watcher.id;
  5363. has[id] = null;
  5364. watcher.run();
  5365. // in dev build, check and stop circular updates.
  5366. if ( true && has[id] != null) {
  5367. circular[id] = (circular[id] || 0) + 1;
  5368. if (circular[id] > MAX_UPDATE_COUNT) {
  5369. warn(
  5370. 'You may have an infinite update loop ' + (
  5371. watcher.user
  5372. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5373. : "in a component render function."
  5374. ),
  5375. watcher.vm
  5376. );
  5377. break
  5378. }
  5379. }
  5380. }
  5381. // keep copies of post queues before resetting state
  5382. var activatedQueue = activatedChildren.slice();
  5383. var updatedQueue = queue.slice();
  5384. resetSchedulerState();
  5385. // call component updated and activated hooks
  5386. callActivatedHooks(activatedQueue);
  5387. callUpdatedHooks(updatedQueue);
  5388. // devtool hook
  5389. /* istanbul ignore if */
  5390. if (devtools && config.devtools) {
  5391. devtools.emit('flush');
  5392. }
  5393. }
  5394. function callUpdatedHooks (queue) {
  5395. var i = queue.length;
  5396. while (i--) {
  5397. var watcher = queue[i];
  5398. var vm = watcher.vm;
  5399. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5400. callHook(vm, 'updated');
  5401. }
  5402. }
  5403. }
  5404. /**
  5405. * Queue a kept-alive component that was activated during patch.
  5406. * The queue will be processed after the entire tree has been patched.
  5407. */
  5408. function queueActivatedComponent (vm) {
  5409. // setting _inactive to false here so that a render function can
  5410. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5411. vm._inactive = false;
  5412. activatedChildren.push(vm);
  5413. }
  5414. function callActivatedHooks (queue) {
  5415. for (var i = 0; i < queue.length; i++) {
  5416. queue[i]._inactive = true;
  5417. activateChildComponent(queue[i], true /* true */);
  5418. }
  5419. }
  5420. /**
  5421. * Push a watcher into the watcher queue.
  5422. * Jobs with duplicate IDs will be skipped unless it's
  5423. * pushed when the queue is being flushed.
  5424. */
  5425. function queueWatcher (watcher) {
  5426. var id = watcher.id;
  5427. if (has[id] == null) {
  5428. has[id] = true;
  5429. if (!flushing) {
  5430. queue.push(watcher);
  5431. } else {
  5432. // if already flushing, splice the watcher based on its id
  5433. // if already past its id, it will be run next immediately.
  5434. var i = queue.length - 1;
  5435. while (i > index && queue[i].id > watcher.id) {
  5436. i--;
  5437. }
  5438. queue.splice(i + 1, 0, watcher);
  5439. }
  5440. // queue the flush
  5441. if (!waiting) {
  5442. waiting = true;
  5443. if ( true && !config.async) {
  5444. flushSchedulerQueue();
  5445. return
  5446. }
  5447. nextTick(flushSchedulerQueue);
  5448. }
  5449. }
  5450. }
  5451. /* */
  5452. var uid$2 = 0;
  5453. /**
  5454. * A watcher parses an expression, collects dependencies,
  5455. * and fires callback when the expression value changes.
  5456. * This is used for both the $watch() api and directives.
  5457. */
  5458. var Watcher = function Watcher (
  5459. vm,
  5460. expOrFn,
  5461. cb,
  5462. options,
  5463. isRenderWatcher
  5464. ) {
  5465. this.vm = vm;
  5466. if (isRenderWatcher) {
  5467. vm._watcher = this;
  5468. }
  5469. vm._watchers.push(this);
  5470. // options
  5471. if (options) {
  5472. this.deep = !!options.deep;
  5473. this.user = !!options.user;
  5474. this.lazy = !!options.lazy;
  5475. this.sync = !!options.sync;
  5476. this.before = options.before;
  5477. } else {
  5478. this.deep = this.user = this.lazy = this.sync = false;
  5479. }
  5480. this.cb = cb;
  5481. this.id = ++uid$2; // uid for batching
  5482. this.active = true;
  5483. this.dirty = this.lazy; // for lazy watchers
  5484. this.deps = [];
  5485. this.newDeps = [];
  5486. this.depIds = new _Set();
  5487. this.newDepIds = new _Set();
  5488. this.expression = true
  5489. ? expOrFn.toString()
  5490. : undefined;
  5491. // parse expression for getter
  5492. if (typeof expOrFn === 'function') {
  5493. this.getter = expOrFn;
  5494. } else {
  5495. this.getter = parsePath(expOrFn);
  5496. if (!this.getter) {
  5497. this.getter = noop;
  5498. true && warn(
  5499. "Failed watching path: \"" + expOrFn + "\" " +
  5500. 'Watcher only accepts simple dot-delimited paths. ' +
  5501. 'For full control, use a function instead.',
  5502. vm
  5503. );
  5504. }
  5505. }
  5506. this.value = this.lazy
  5507. ? undefined
  5508. : this.get();
  5509. };
  5510. /**
  5511. * Evaluate the getter, and re-collect dependencies.
  5512. */
  5513. Watcher.prototype.get = function get () {
  5514. pushTarget(this);
  5515. var value;
  5516. var vm = this.vm;
  5517. try {
  5518. value = this.getter.call(vm, vm);
  5519. } catch (e) {
  5520. if (this.user) {
  5521. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5522. } else {
  5523. throw e
  5524. }
  5525. } finally {
  5526. // "touch" every property so they are all tracked as
  5527. // dependencies for deep watching
  5528. if (this.deep) {
  5529. traverse(value);
  5530. }
  5531. popTarget();
  5532. this.cleanupDeps();
  5533. }
  5534. return value
  5535. };
  5536. /**
  5537. * Add a dependency to this directive.
  5538. */
  5539. Watcher.prototype.addDep = function addDep (dep) {
  5540. var id = dep.id;
  5541. if (!this.newDepIds.has(id)) {
  5542. this.newDepIds.add(id);
  5543. this.newDeps.push(dep);
  5544. if (!this.depIds.has(id)) {
  5545. dep.addSub(this);
  5546. }
  5547. }
  5548. };
  5549. /**
  5550. * Clean up for dependency collection.
  5551. */
  5552. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5553. var i = this.deps.length;
  5554. while (i--) {
  5555. var dep = this.deps[i];
  5556. if (!this.newDepIds.has(dep.id)) {
  5557. dep.removeSub(this);
  5558. }
  5559. }
  5560. var tmp = this.depIds;
  5561. this.depIds = this.newDepIds;
  5562. this.newDepIds = tmp;
  5563. this.newDepIds.clear();
  5564. tmp = this.deps;
  5565. this.deps = this.newDeps;
  5566. this.newDeps = tmp;
  5567. this.newDeps.length = 0;
  5568. };
  5569. /**
  5570. * Subscriber interface.
  5571. * Will be called when a dependency changes.
  5572. */
  5573. Watcher.prototype.update = function update () {
  5574. /* istanbul ignore else */
  5575. if (this.lazy) {
  5576. this.dirty = true;
  5577. } else if (this.sync) {
  5578. this.run();
  5579. } else {
  5580. queueWatcher(this);
  5581. }
  5582. };
  5583. /**
  5584. * Scheduler job interface.
  5585. * Will be called by the scheduler.
  5586. */
  5587. Watcher.prototype.run = function run () {
  5588. if (this.active) {
  5589. var value = this.get();
  5590. if (
  5591. value !== this.value ||
  5592. // Deep watchers and watchers on Object/Arrays should fire even
  5593. // when the value is the same, because the value may
  5594. // have mutated.
  5595. isObject(value) ||
  5596. this.deep
  5597. ) {
  5598. // set new value
  5599. var oldValue = this.value;
  5600. this.value = value;
  5601. if (this.user) {
  5602. try {
  5603. this.cb.call(this.vm, value, oldValue);
  5604. } catch (e) {
  5605. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5606. }
  5607. } else {
  5608. this.cb.call(this.vm, value, oldValue);
  5609. }
  5610. }
  5611. }
  5612. };
  5613. /**
  5614. * Evaluate the value of the watcher.
  5615. * This only gets called for lazy watchers.
  5616. */
  5617. Watcher.prototype.evaluate = function evaluate () {
  5618. this.value = this.get();
  5619. this.dirty = false;
  5620. };
  5621. /**
  5622. * Depend on all deps collected by this watcher.
  5623. */
  5624. Watcher.prototype.depend = function depend () {
  5625. var i = this.deps.length;
  5626. while (i--) {
  5627. this.deps[i].depend();
  5628. }
  5629. };
  5630. /**
  5631. * Remove self from all dependencies' subscriber list.
  5632. */
  5633. Watcher.prototype.teardown = function teardown () {
  5634. if (this.active) {
  5635. // remove self from vm's watcher list
  5636. // this is a somewhat expensive operation so we skip it
  5637. // if the vm is being destroyed.
  5638. if (!this.vm._isBeingDestroyed) {
  5639. remove(this.vm._watchers, this);
  5640. }
  5641. var i = this.deps.length;
  5642. while (i--) {
  5643. this.deps[i].removeSub(this);
  5644. }
  5645. this.active = false;
  5646. }
  5647. };
  5648. /* */
  5649. var sharedPropertyDefinition = {
  5650. enumerable: true,
  5651. configurable: true,
  5652. get: noop,
  5653. set: noop
  5654. };
  5655. function proxy (target, sourceKey, key) {
  5656. sharedPropertyDefinition.get = function proxyGetter () {
  5657. return this[sourceKey][key]
  5658. };
  5659. sharedPropertyDefinition.set = function proxySetter (val) {
  5660. this[sourceKey][key] = val;
  5661. };
  5662. Object.defineProperty(target, key, sharedPropertyDefinition);
  5663. }
  5664. function initState (vm) {
  5665. vm._watchers = [];
  5666. var opts = vm.$options;
  5667. if (opts.props) { initProps(vm, opts.props); }
  5668. if (opts.methods) { initMethods(vm, opts.methods); }
  5669. if (opts.data) {
  5670. initData(vm);
  5671. } else {
  5672. observe(vm._data = {}, true /* asRootData */);
  5673. }
  5674. if (opts.computed) { initComputed(vm, opts.computed); }
  5675. if (opts.watch && opts.watch !== nativeWatch) {
  5676. initWatch(vm, opts.watch);
  5677. }
  5678. }
  5679. function initProps (vm, propsOptions) {
  5680. var propsData = vm.$options.propsData || {};
  5681. var props = vm._props = {};
  5682. // cache prop keys so that future props updates can iterate using Array
  5683. // instead of dynamic object key enumeration.
  5684. var keys = vm.$options._propKeys = [];
  5685. var isRoot = !vm.$parent;
  5686. // root instance props should be converted
  5687. if (!isRoot) {
  5688. toggleObserving(false);
  5689. }
  5690. var loop = function ( key ) {
  5691. keys.push(key);
  5692. var value = validateProp(key, propsOptions, propsData, vm);
  5693. /* istanbul ignore else */
  5694. if (true) {
  5695. var hyphenatedKey = hyphenate(key);
  5696. if (isReservedAttribute(hyphenatedKey) ||
  5697. config.isReservedAttr(hyphenatedKey)) {
  5698. warn(
  5699. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5700. vm
  5701. );
  5702. }
  5703. defineReactive$$1(props, key, value, function () {
  5704. if (!isRoot && !isUpdatingChildComponent) {
  5705. {
  5706. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5707. return
  5708. }
  5709. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5710. if(
  5711. key === 'value' &&
  5712. Array.isArray(vm.$options.behaviors) &&
  5713. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5714. ){
  5715. return
  5716. }
  5717. if(vm._getFormData){
  5718. return
  5719. }
  5720. var $parent = vm.$parent;
  5721. while($parent){
  5722. if($parent.__next_tick_pending){
  5723. return
  5724. }
  5725. $parent = $parent.$parent;
  5726. }
  5727. }
  5728. warn(
  5729. "Avoid mutating a prop directly since the value will be " +
  5730. "overwritten whenever the parent component re-renders. " +
  5731. "Instead, use a data or computed property based on the prop's " +
  5732. "value. Prop being mutated: \"" + key + "\"",
  5733. vm
  5734. );
  5735. }
  5736. });
  5737. } else {}
  5738. // static props are already proxied on the component's prototype
  5739. // during Vue.extend(). We only need to proxy props defined at
  5740. // instantiation here.
  5741. if (!(key in vm)) {
  5742. proxy(vm, "_props", key);
  5743. }
  5744. };
  5745. for (var key in propsOptions) loop( key );
  5746. toggleObserving(true);
  5747. }
  5748. function initData (vm) {
  5749. var data = vm.$options.data;
  5750. data = vm._data = typeof data === 'function'
  5751. ? getData(data, vm)
  5752. : data || {};
  5753. if (!isPlainObject(data)) {
  5754. data = {};
  5755. true && warn(
  5756. 'data functions should return an object:\n' +
  5757. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5758. vm
  5759. );
  5760. }
  5761. // proxy data on instance
  5762. var keys = Object.keys(data);
  5763. var props = vm.$options.props;
  5764. var methods = vm.$options.methods;
  5765. var i = keys.length;
  5766. while (i--) {
  5767. var key = keys[i];
  5768. if (true) {
  5769. if (methods && hasOwn(methods, key)) {
  5770. warn(
  5771. ("Method \"" + key + "\" has already been defined as a data property."),
  5772. vm
  5773. );
  5774. }
  5775. }
  5776. if (props && hasOwn(props, key)) {
  5777. true && warn(
  5778. "The data property \"" + key + "\" is already declared as a prop. " +
  5779. "Use prop default value instead.",
  5780. vm
  5781. );
  5782. } else if (!isReserved(key)) {
  5783. proxy(vm, "_data", key);
  5784. }
  5785. }
  5786. // observe data
  5787. observe(data, true /* asRootData */);
  5788. }
  5789. function getData (data, vm) {
  5790. // #7573 disable dep collection when invoking data getters
  5791. pushTarget();
  5792. try {
  5793. return data.call(vm, vm)
  5794. } catch (e) {
  5795. handleError(e, vm, "data()");
  5796. return {}
  5797. } finally {
  5798. popTarget();
  5799. }
  5800. }
  5801. var computedWatcherOptions = { lazy: true };
  5802. function initComputed (vm, computed) {
  5803. // $flow-disable-line
  5804. var watchers = vm._computedWatchers = Object.create(null);
  5805. // computed properties are just getters during SSR
  5806. var isSSR = isServerRendering();
  5807. for (var key in computed) {
  5808. var userDef = computed[key];
  5809. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5810. if ( true && getter == null) {
  5811. warn(
  5812. ("Getter is missing for computed property \"" + key + "\"."),
  5813. vm
  5814. );
  5815. }
  5816. if (!isSSR) {
  5817. // create internal watcher for the computed property.
  5818. watchers[key] = new Watcher(
  5819. vm,
  5820. getter || noop,
  5821. noop,
  5822. computedWatcherOptions
  5823. );
  5824. }
  5825. // component-defined computed properties are already defined on the
  5826. // component prototype. We only need to define computed properties defined
  5827. // at instantiation here.
  5828. if (!(key in vm)) {
  5829. defineComputed(vm, key, userDef);
  5830. } else if (true) {
  5831. if (key in vm.$data) {
  5832. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5833. } else if (vm.$options.props && key in vm.$options.props) {
  5834. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5835. }
  5836. }
  5837. }
  5838. }
  5839. function defineComputed (
  5840. target,
  5841. key,
  5842. userDef
  5843. ) {
  5844. var shouldCache = !isServerRendering();
  5845. if (typeof userDef === 'function') {
  5846. sharedPropertyDefinition.get = shouldCache
  5847. ? createComputedGetter(key)
  5848. : createGetterInvoker(userDef);
  5849. sharedPropertyDefinition.set = noop;
  5850. } else {
  5851. sharedPropertyDefinition.get = userDef.get
  5852. ? shouldCache && userDef.cache !== false
  5853. ? createComputedGetter(key)
  5854. : createGetterInvoker(userDef.get)
  5855. : noop;
  5856. sharedPropertyDefinition.set = userDef.set || noop;
  5857. }
  5858. if ( true &&
  5859. sharedPropertyDefinition.set === noop) {
  5860. sharedPropertyDefinition.set = function () {
  5861. warn(
  5862. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5863. this
  5864. );
  5865. };
  5866. }
  5867. Object.defineProperty(target, key, sharedPropertyDefinition);
  5868. }
  5869. function createComputedGetter (key) {
  5870. return function computedGetter () {
  5871. var watcher = this._computedWatchers && this._computedWatchers[key];
  5872. if (watcher) {
  5873. if (watcher.dirty) {
  5874. watcher.evaluate();
  5875. }
  5876. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5877. watcher.depend();
  5878. }
  5879. return watcher.value
  5880. }
  5881. }
  5882. }
  5883. function createGetterInvoker(fn) {
  5884. return function computedGetter () {
  5885. return fn.call(this, this)
  5886. }
  5887. }
  5888. function initMethods (vm, methods) {
  5889. var props = vm.$options.props;
  5890. for (var key in methods) {
  5891. if (true) {
  5892. if (typeof methods[key] !== 'function') {
  5893. warn(
  5894. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5895. "Did you reference the function correctly?",
  5896. vm
  5897. );
  5898. }
  5899. if (props && hasOwn(props, key)) {
  5900. warn(
  5901. ("Method \"" + key + "\" has already been defined as a prop."),
  5902. vm
  5903. );
  5904. }
  5905. if ((key in vm) && isReserved(key)) {
  5906. warn(
  5907. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5908. "Avoid defining component methods that start with _ or $."
  5909. );
  5910. }
  5911. }
  5912. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5913. }
  5914. }
  5915. function initWatch (vm, watch) {
  5916. for (var key in watch) {
  5917. var handler = watch[key];
  5918. if (Array.isArray(handler)) {
  5919. for (var i = 0; i < handler.length; i++) {
  5920. createWatcher(vm, key, handler[i]);
  5921. }
  5922. } else {
  5923. createWatcher(vm, key, handler);
  5924. }
  5925. }
  5926. }
  5927. function createWatcher (
  5928. vm,
  5929. expOrFn,
  5930. handler,
  5931. options
  5932. ) {
  5933. if (isPlainObject(handler)) {
  5934. options = handler;
  5935. handler = handler.handler;
  5936. }
  5937. if (typeof handler === 'string') {
  5938. handler = vm[handler];
  5939. }
  5940. return vm.$watch(expOrFn, handler, options)
  5941. }
  5942. function stateMixin (Vue) {
  5943. // flow somehow has problems with directly declared definition object
  5944. // when using Object.defineProperty, so we have to procedurally build up
  5945. // the object here.
  5946. var dataDef = {};
  5947. dataDef.get = function () { return this._data };
  5948. var propsDef = {};
  5949. propsDef.get = function () { return this._props };
  5950. if (true) {
  5951. dataDef.set = function () {
  5952. warn(
  5953. 'Avoid replacing instance root $data. ' +
  5954. 'Use nested data properties instead.',
  5955. this
  5956. );
  5957. };
  5958. propsDef.set = function () {
  5959. warn("$props is readonly.", this);
  5960. };
  5961. }
  5962. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5963. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5964. Vue.prototype.$set = set;
  5965. Vue.prototype.$delete = del;
  5966. Vue.prototype.$watch = function (
  5967. expOrFn,
  5968. cb,
  5969. options
  5970. ) {
  5971. var vm = this;
  5972. if (isPlainObject(cb)) {
  5973. return createWatcher(vm, expOrFn, cb, options)
  5974. }
  5975. options = options || {};
  5976. options.user = true;
  5977. var watcher = new Watcher(vm, expOrFn, cb, options);
  5978. if (options.immediate) {
  5979. try {
  5980. cb.call(vm, watcher.value);
  5981. } catch (error) {
  5982. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  5983. }
  5984. }
  5985. return function unwatchFn () {
  5986. watcher.teardown();
  5987. }
  5988. };
  5989. }
  5990. /* */
  5991. var uid$3 = 0;
  5992. function initMixin (Vue) {
  5993. Vue.prototype._init = function (options) {
  5994. var vm = this;
  5995. // a uid
  5996. vm._uid = uid$3++;
  5997. var startTag, endTag;
  5998. /* istanbul ignore if */
  5999. if ( true && config.performance && mark) {
  6000. startTag = "vue-perf-start:" + (vm._uid);
  6001. endTag = "vue-perf-end:" + (vm._uid);
  6002. mark(startTag);
  6003. }
  6004. // a flag to avoid this being observed
  6005. vm._isVue = true;
  6006. // merge options
  6007. if (options && options._isComponent) {
  6008. // optimize internal component instantiation
  6009. // since dynamic options merging is pretty slow, and none of the
  6010. // internal component options needs special treatment.
  6011. initInternalComponent(vm, options);
  6012. } else {
  6013. vm.$options = mergeOptions(
  6014. resolveConstructorOptions(vm.constructor),
  6015. options || {},
  6016. vm
  6017. );
  6018. }
  6019. /* istanbul ignore else */
  6020. if (true) {
  6021. initProxy(vm);
  6022. } else {}
  6023. // expose real self
  6024. vm._self = vm;
  6025. initLifecycle(vm);
  6026. initEvents(vm);
  6027. initRender(vm);
  6028. callHook(vm, 'beforeCreate');
  6029. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6030. initState(vm);
  6031. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6032. !vm._$fallback && callHook(vm, 'created');
  6033. /* istanbul ignore if */
  6034. if ( true && config.performance && mark) {
  6035. vm._name = formatComponentName(vm, false);
  6036. mark(endTag);
  6037. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6038. }
  6039. if (vm.$options.el) {
  6040. vm.$mount(vm.$options.el);
  6041. }
  6042. };
  6043. }
  6044. function initInternalComponent (vm, options) {
  6045. var opts = vm.$options = Object.create(vm.constructor.options);
  6046. // doing this because it's faster than dynamic enumeration.
  6047. var parentVnode = options._parentVnode;
  6048. opts.parent = options.parent;
  6049. opts._parentVnode = parentVnode;
  6050. var vnodeComponentOptions = parentVnode.componentOptions;
  6051. opts.propsData = vnodeComponentOptions.propsData;
  6052. opts._parentListeners = vnodeComponentOptions.listeners;
  6053. opts._renderChildren = vnodeComponentOptions.children;
  6054. opts._componentTag = vnodeComponentOptions.tag;
  6055. if (options.render) {
  6056. opts.render = options.render;
  6057. opts.staticRenderFns = options.staticRenderFns;
  6058. }
  6059. }
  6060. function resolveConstructorOptions (Ctor) {
  6061. var options = Ctor.options;
  6062. if (Ctor.super) {
  6063. var superOptions = resolveConstructorOptions(Ctor.super);
  6064. var cachedSuperOptions = Ctor.superOptions;
  6065. if (superOptions !== cachedSuperOptions) {
  6066. // super option changed,
  6067. // need to resolve new options.
  6068. Ctor.superOptions = superOptions;
  6069. // check if there are any late-modified/attached options (#4976)
  6070. var modifiedOptions = resolveModifiedOptions(Ctor);
  6071. // update base extend options
  6072. if (modifiedOptions) {
  6073. extend(Ctor.extendOptions, modifiedOptions);
  6074. }
  6075. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6076. if (options.name) {
  6077. options.components[options.name] = Ctor;
  6078. }
  6079. }
  6080. }
  6081. return options
  6082. }
  6083. function resolveModifiedOptions (Ctor) {
  6084. var modified;
  6085. var latest = Ctor.options;
  6086. var sealed = Ctor.sealedOptions;
  6087. for (var key in latest) {
  6088. if (latest[key] !== sealed[key]) {
  6089. if (!modified) { modified = {}; }
  6090. modified[key] = latest[key];
  6091. }
  6092. }
  6093. return modified
  6094. }
  6095. function Vue (options) {
  6096. if ( true &&
  6097. !(this instanceof Vue)
  6098. ) {
  6099. warn('Vue is a constructor and should be called with the `new` keyword');
  6100. }
  6101. this._init(options);
  6102. }
  6103. initMixin(Vue);
  6104. stateMixin(Vue);
  6105. eventsMixin(Vue);
  6106. lifecycleMixin(Vue);
  6107. renderMixin(Vue);
  6108. /* */
  6109. function initUse (Vue) {
  6110. Vue.use = function (plugin) {
  6111. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6112. if (installedPlugins.indexOf(plugin) > -1) {
  6113. return this
  6114. }
  6115. // additional parameters
  6116. var args = toArray(arguments, 1);
  6117. args.unshift(this);
  6118. if (typeof plugin.install === 'function') {
  6119. plugin.install.apply(plugin, args);
  6120. } else if (typeof plugin === 'function') {
  6121. plugin.apply(null, args);
  6122. }
  6123. installedPlugins.push(plugin);
  6124. return this
  6125. };
  6126. }
  6127. /* */
  6128. function initMixin$1 (Vue) {
  6129. Vue.mixin = function (mixin) {
  6130. this.options = mergeOptions(this.options, mixin);
  6131. return this
  6132. };
  6133. }
  6134. /* */
  6135. function initExtend (Vue) {
  6136. /**
  6137. * Each instance constructor, including Vue, has a unique
  6138. * cid. This enables us to create wrapped "child
  6139. * constructors" for prototypal inheritance and cache them.
  6140. */
  6141. Vue.cid = 0;
  6142. var cid = 1;
  6143. /**
  6144. * Class inheritance
  6145. */
  6146. Vue.extend = function (extendOptions) {
  6147. extendOptions = extendOptions || {};
  6148. var Super = this;
  6149. var SuperId = Super.cid;
  6150. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6151. if (cachedCtors[SuperId]) {
  6152. return cachedCtors[SuperId]
  6153. }
  6154. var name = extendOptions.name || Super.options.name;
  6155. if ( true && name) {
  6156. validateComponentName(name);
  6157. }
  6158. var Sub = function VueComponent (options) {
  6159. this._init(options);
  6160. };
  6161. Sub.prototype = Object.create(Super.prototype);
  6162. Sub.prototype.constructor = Sub;
  6163. Sub.cid = cid++;
  6164. Sub.options = mergeOptions(
  6165. Super.options,
  6166. extendOptions
  6167. );
  6168. Sub['super'] = Super;
  6169. // For props and computed properties, we define the proxy getters on
  6170. // the Vue instances at extension time, on the extended prototype. This
  6171. // avoids Object.defineProperty calls for each instance created.
  6172. if (Sub.options.props) {
  6173. initProps$1(Sub);
  6174. }
  6175. if (Sub.options.computed) {
  6176. initComputed$1(Sub);
  6177. }
  6178. // allow further extension/mixin/plugin usage
  6179. Sub.extend = Super.extend;
  6180. Sub.mixin = Super.mixin;
  6181. Sub.use = Super.use;
  6182. // create asset registers, so extended classes
  6183. // can have their private assets too.
  6184. ASSET_TYPES.forEach(function (type) {
  6185. Sub[type] = Super[type];
  6186. });
  6187. // enable recursive self-lookup
  6188. if (name) {
  6189. Sub.options.components[name] = Sub;
  6190. }
  6191. // keep a reference to the super options at extension time.
  6192. // later at instantiation we can check if Super's options have
  6193. // been updated.
  6194. Sub.superOptions = Super.options;
  6195. Sub.extendOptions = extendOptions;
  6196. Sub.sealedOptions = extend({}, Sub.options);
  6197. // cache constructor
  6198. cachedCtors[SuperId] = Sub;
  6199. return Sub
  6200. };
  6201. }
  6202. function initProps$1 (Comp) {
  6203. var props = Comp.options.props;
  6204. for (var key in props) {
  6205. proxy(Comp.prototype, "_props", key);
  6206. }
  6207. }
  6208. function initComputed$1 (Comp) {
  6209. var computed = Comp.options.computed;
  6210. for (var key in computed) {
  6211. defineComputed(Comp.prototype, key, computed[key]);
  6212. }
  6213. }
  6214. /* */
  6215. function initAssetRegisters (Vue) {
  6216. /**
  6217. * Create asset registration methods.
  6218. */
  6219. ASSET_TYPES.forEach(function (type) {
  6220. Vue[type] = function (
  6221. id,
  6222. definition
  6223. ) {
  6224. if (!definition) {
  6225. return this.options[type + 's'][id]
  6226. } else {
  6227. /* istanbul ignore if */
  6228. if ( true && type === 'component') {
  6229. validateComponentName(id);
  6230. }
  6231. if (type === 'component' && isPlainObject(definition)) {
  6232. definition.name = definition.name || id;
  6233. definition = this.options._base.extend(definition);
  6234. }
  6235. if (type === 'directive' && typeof definition === 'function') {
  6236. definition = { bind: definition, update: definition };
  6237. }
  6238. this.options[type + 's'][id] = definition;
  6239. return definition
  6240. }
  6241. };
  6242. });
  6243. }
  6244. /* */
  6245. function getComponentName (opts) {
  6246. return opts && (opts.Ctor.options.name || opts.tag)
  6247. }
  6248. function matches (pattern, name) {
  6249. if (Array.isArray(pattern)) {
  6250. return pattern.indexOf(name) > -1
  6251. } else if (typeof pattern === 'string') {
  6252. return pattern.split(',').indexOf(name) > -1
  6253. } else if (isRegExp(pattern)) {
  6254. return pattern.test(name)
  6255. }
  6256. /* istanbul ignore next */
  6257. return false
  6258. }
  6259. function pruneCache (keepAliveInstance, filter) {
  6260. var cache = keepAliveInstance.cache;
  6261. var keys = keepAliveInstance.keys;
  6262. var _vnode = keepAliveInstance._vnode;
  6263. for (var key in cache) {
  6264. var cachedNode = cache[key];
  6265. if (cachedNode) {
  6266. var name = getComponentName(cachedNode.componentOptions);
  6267. if (name && !filter(name)) {
  6268. pruneCacheEntry(cache, key, keys, _vnode);
  6269. }
  6270. }
  6271. }
  6272. }
  6273. function pruneCacheEntry (
  6274. cache,
  6275. key,
  6276. keys,
  6277. current
  6278. ) {
  6279. var cached$$1 = cache[key];
  6280. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6281. cached$$1.componentInstance.$destroy();
  6282. }
  6283. cache[key] = null;
  6284. remove(keys, key);
  6285. }
  6286. var patternTypes = [String, RegExp, Array];
  6287. var KeepAlive = {
  6288. name: 'keep-alive',
  6289. abstract: true,
  6290. props: {
  6291. include: patternTypes,
  6292. exclude: patternTypes,
  6293. max: [String, Number]
  6294. },
  6295. created: function created () {
  6296. this.cache = Object.create(null);
  6297. this.keys = [];
  6298. },
  6299. destroyed: function destroyed () {
  6300. for (var key in this.cache) {
  6301. pruneCacheEntry(this.cache, key, this.keys);
  6302. }
  6303. },
  6304. mounted: function mounted () {
  6305. var this$1 = this;
  6306. this.$watch('include', function (val) {
  6307. pruneCache(this$1, function (name) { return matches(val, name); });
  6308. });
  6309. this.$watch('exclude', function (val) {
  6310. pruneCache(this$1, function (name) { return !matches(val, name); });
  6311. });
  6312. },
  6313. render: function render () {
  6314. var slot = this.$slots.default;
  6315. var vnode = getFirstComponentChild(slot);
  6316. var componentOptions = vnode && vnode.componentOptions;
  6317. if (componentOptions) {
  6318. // check pattern
  6319. var name = getComponentName(componentOptions);
  6320. var ref = this;
  6321. var include = ref.include;
  6322. var exclude = ref.exclude;
  6323. if (
  6324. // not included
  6325. (include && (!name || !matches(include, name))) ||
  6326. // excluded
  6327. (exclude && name && matches(exclude, name))
  6328. ) {
  6329. return vnode
  6330. }
  6331. var ref$1 = this;
  6332. var cache = ref$1.cache;
  6333. var keys = ref$1.keys;
  6334. var key = vnode.key == null
  6335. // same constructor may get registered as different local components
  6336. // so cid alone is not enough (#3269)
  6337. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6338. : vnode.key;
  6339. if (cache[key]) {
  6340. vnode.componentInstance = cache[key].componentInstance;
  6341. // make current key freshest
  6342. remove(keys, key);
  6343. keys.push(key);
  6344. } else {
  6345. cache[key] = vnode;
  6346. keys.push(key);
  6347. // prune oldest entry
  6348. if (this.max && keys.length > parseInt(this.max)) {
  6349. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6350. }
  6351. }
  6352. vnode.data.keepAlive = true;
  6353. }
  6354. return vnode || (slot && slot[0])
  6355. }
  6356. };
  6357. var builtInComponents = {
  6358. KeepAlive: KeepAlive
  6359. };
  6360. /* */
  6361. function initGlobalAPI (Vue) {
  6362. // config
  6363. var configDef = {};
  6364. configDef.get = function () { return config; };
  6365. if (true) {
  6366. configDef.set = function () {
  6367. warn(
  6368. 'Do not replace the Vue.config object, set individual fields instead.'
  6369. );
  6370. };
  6371. }
  6372. Object.defineProperty(Vue, 'config', configDef);
  6373. // exposed util methods.
  6374. // NOTE: these are not considered part of the public API - avoid relying on
  6375. // them unless you are aware of the risk.
  6376. Vue.util = {
  6377. warn: warn,
  6378. extend: extend,
  6379. mergeOptions: mergeOptions,
  6380. defineReactive: defineReactive$$1
  6381. };
  6382. Vue.set = set;
  6383. Vue.delete = del;
  6384. Vue.nextTick = nextTick;
  6385. // 2.6 explicit observable API
  6386. Vue.observable = function (obj) {
  6387. observe(obj);
  6388. return obj
  6389. };
  6390. Vue.options = Object.create(null);
  6391. ASSET_TYPES.forEach(function (type) {
  6392. Vue.options[type + 's'] = Object.create(null);
  6393. });
  6394. // this is used to identify the "base" constructor to extend all plain-object
  6395. // components with in Weex's multi-instance scenarios.
  6396. Vue.options._base = Vue;
  6397. extend(Vue.options.components, builtInComponents);
  6398. initUse(Vue);
  6399. initMixin$1(Vue);
  6400. initExtend(Vue);
  6401. initAssetRegisters(Vue);
  6402. }
  6403. initGlobalAPI(Vue);
  6404. Object.defineProperty(Vue.prototype, '$isServer', {
  6405. get: isServerRendering
  6406. });
  6407. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6408. get: function get () {
  6409. /* istanbul ignore next */
  6410. return this.$vnode && this.$vnode.ssrContext
  6411. }
  6412. });
  6413. // expose FunctionalRenderContext for ssr runtime helper installation
  6414. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6415. value: FunctionalRenderContext
  6416. });
  6417. Vue.version = '2.6.11';
  6418. /**
  6419. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6420. */
  6421. var ARRAYTYPE = '[object Array]';
  6422. var OBJECTTYPE = '[object Object]';
  6423. // const FUNCTIONTYPE = '[object Function]'
  6424. function diff(current, pre) {
  6425. var result = {};
  6426. syncKeys(current, pre);
  6427. _diff(current, pre, '', result);
  6428. return result
  6429. }
  6430. function syncKeys(current, pre) {
  6431. if (current === pre) { return }
  6432. var rootCurrentType = type(current);
  6433. var rootPreType = type(pre);
  6434. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6435. if(Object.keys(current).length >= Object.keys(pre).length){
  6436. for (var key in pre) {
  6437. var currentValue = current[key];
  6438. if (currentValue === undefined) {
  6439. current[key] = null;
  6440. } else {
  6441. syncKeys(currentValue, pre[key]);
  6442. }
  6443. }
  6444. }
  6445. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6446. if (current.length >= pre.length) {
  6447. pre.forEach(function (item, index) {
  6448. syncKeys(current[index], item);
  6449. });
  6450. }
  6451. }
  6452. }
  6453. function _diff(current, pre, path, result) {
  6454. if (current === pre) { return }
  6455. var rootCurrentType = type(current);
  6456. var rootPreType = type(pre);
  6457. if (rootCurrentType == OBJECTTYPE) {
  6458. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6459. setResult(result, path, current);
  6460. } else {
  6461. var loop = function ( key ) {
  6462. var currentValue = current[key];
  6463. var preValue = pre[key];
  6464. var currentType = type(currentValue);
  6465. var preType = type(preValue);
  6466. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6467. if (currentValue != pre[key]) {
  6468. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6469. }
  6470. } else if (currentType == ARRAYTYPE) {
  6471. if (preType != ARRAYTYPE) {
  6472. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6473. } else {
  6474. if (currentValue.length < preValue.length) {
  6475. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6476. } else {
  6477. currentValue.forEach(function (item, index) {
  6478. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6479. });
  6480. }
  6481. }
  6482. } else if (currentType == OBJECTTYPE) {
  6483. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6484. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6485. } else {
  6486. for (var subKey in currentValue) {
  6487. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6488. }
  6489. }
  6490. }
  6491. };
  6492. for (var key in current) loop( key );
  6493. }
  6494. } else if (rootCurrentType == ARRAYTYPE) {
  6495. if (rootPreType != ARRAYTYPE) {
  6496. setResult(result, path, current);
  6497. } else {
  6498. if (current.length < pre.length) {
  6499. setResult(result, path, current);
  6500. } else {
  6501. current.forEach(function (item, index) {
  6502. _diff(item, pre[index], path + '[' + index + ']', result);
  6503. });
  6504. }
  6505. }
  6506. } else {
  6507. setResult(result, path, current);
  6508. }
  6509. }
  6510. function setResult(result, k, v) {
  6511. // if (type(v) != FUNCTIONTYPE) {
  6512. result[k] = v;
  6513. // }
  6514. }
  6515. function type(obj) {
  6516. return Object.prototype.toString.call(obj)
  6517. }
  6518. /* */
  6519. function flushCallbacks$1(vm) {
  6520. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6521. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"cqcarbonwxapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6522. var mpInstance = vm.$scope;
  6523. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6524. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6525. }
  6526. var copies = vm.__next_tick_callbacks.slice(0);
  6527. vm.__next_tick_callbacks.length = 0;
  6528. for (var i = 0; i < copies.length; i++) {
  6529. copies[i]();
  6530. }
  6531. }
  6532. }
  6533. function hasRenderWatcher(vm) {
  6534. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6535. }
  6536. function nextTick$1(vm, cb) {
  6537. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6538. //2.nextTick 之前存在 render watcher
  6539. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6540. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"cqcarbonwxapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6541. var mpInstance = vm.$scope;
  6542. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6543. ']:nextVueTick');
  6544. }
  6545. return nextTick(cb, vm)
  6546. }else{
  6547. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"cqcarbonwxapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6548. var mpInstance$1 = vm.$scope;
  6549. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6550. ']:nextMPTick');
  6551. }
  6552. }
  6553. var _resolve;
  6554. if (!vm.__next_tick_callbacks) {
  6555. vm.__next_tick_callbacks = [];
  6556. }
  6557. vm.__next_tick_callbacks.push(function () {
  6558. if (cb) {
  6559. try {
  6560. cb.call(vm);
  6561. } catch (e) {
  6562. handleError(e, vm, 'nextTick');
  6563. }
  6564. } else if (_resolve) {
  6565. _resolve(vm);
  6566. }
  6567. });
  6568. // $flow-disable-line
  6569. if (!cb && typeof Promise !== 'undefined') {
  6570. return new Promise(function (resolve) {
  6571. _resolve = resolve;
  6572. })
  6573. }
  6574. }
  6575. /* */
  6576. function cloneWithData(vm) {
  6577. // 确保当前 vm 所有数据被同步
  6578. var ret = Object.create(null);
  6579. var dataKeys = [].concat(
  6580. Object.keys(vm._data || {}),
  6581. Object.keys(vm._computedWatchers || {}));
  6582. dataKeys.reduce(function(ret, key) {
  6583. ret[key] = vm[key];
  6584. return ret
  6585. }, ret);
  6586. // vue-composition-api
  6587. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6588. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6589. if (rawBindings) {
  6590. Object.keys(rawBindings).forEach(function (key) {
  6591. ret[key] = vm[key];
  6592. });
  6593. }
  6594. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6595. Object.assign(ret, vm.$mp.data || {});
  6596. if (
  6597. Array.isArray(vm.$options.behaviors) &&
  6598. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6599. ) { //form-field
  6600. ret['name'] = vm.name;
  6601. ret['value'] = vm.value;
  6602. }
  6603. return JSON.parse(JSON.stringify(ret))
  6604. }
  6605. var patch = function(oldVnode, vnode) {
  6606. var this$1 = this;
  6607. if (vnode === null) { //destroy
  6608. return
  6609. }
  6610. if (this.mpType === 'page' || this.mpType === 'component') {
  6611. var mpInstance = this.$scope;
  6612. var data = Object.create(null);
  6613. try {
  6614. data = cloneWithData(this);
  6615. } catch (err) {
  6616. console.error(err);
  6617. }
  6618. data.__webviewId__ = mpInstance.data.__webviewId__;
  6619. var mpData = Object.create(null);
  6620. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6621. mpData[key] = mpInstance.data[key];
  6622. });
  6623. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6624. if (Object.keys(diffData).length) {
  6625. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"cqcarbonwxapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6626. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6627. ']差量更新',
  6628. JSON.stringify(diffData));
  6629. }
  6630. this.__next_tick_pending = true;
  6631. mpInstance.setData(diffData, function () {
  6632. this$1.__next_tick_pending = false;
  6633. flushCallbacks$1(this$1);
  6634. });
  6635. } else {
  6636. flushCallbacks$1(this);
  6637. }
  6638. }
  6639. };
  6640. /* */
  6641. function createEmptyRender() {
  6642. }
  6643. function mountComponent$1(
  6644. vm,
  6645. el,
  6646. hydrating
  6647. ) {
  6648. if (!vm.mpType) {//main.js 中的 new Vue
  6649. return vm
  6650. }
  6651. if (vm.mpType === 'app') {
  6652. vm.$options.render = createEmptyRender;
  6653. }
  6654. if (!vm.$options.render) {
  6655. vm.$options.render = createEmptyRender;
  6656. if (true) {
  6657. /* istanbul ignore if */
  6658. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6659. vm.$options.el || el) {
  6660. warn(
  6661. 'You are using the runtime-only build of Vue where the template ' +
  6662. 'compiler is not available. Either pre-compile the templates into ' +
  6663. 'render functions, or use the compiler-included build.',
  6664. vm
  6665. );
  6666. } else {
  6667. warn(
  6668. 'Failed to mount component: template or render function not defined.',
  6669. vm
  6670. );
  6671. }
  6672. }
  6673. }
  6674. !vm._$fallback && callHook(vm, 'beforeMount');
  6675. var updateComponent = function () {
  6676. vm._update(vm._render(), hydrating);
  6677. };
  6678. // we set this to vm._watcher inside the watcher's constructor
  6679. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6680. // component's mounted hook), which relies on vm._watcher being already defined
  6681. new Watcher(vm, updateComponent, noop, {
  6682. before: function before() {
  6683. if (vm._isMounted && !vm._isDestroyed) {
  6684. callHook(vm, 'beforeUpdate');
  6685. }
  6686. }
  6687. }, true /* isRenderWatcher */);
  6688. hydrating = false;
  6689. return vm
  6690. }
  6691. /* */
  6692. function renderClass (
  6693. staticClass,
  6694. dynamicClass
  6695. ) {
  6696. if (isDef(staticClass) || isDef(dynamicClass)) {
  6697. return concat(staticClass, stringifyClass(dynamicClass))
  6698. }
  6699. /* istanbul ignore next */
  6700. return ''
  6701. }
  6702. function concat (a, b) {
  6703. return a ? b ? (a + ' ' + b) : a : (b || '')
  6704. }
  6705. function stringifyClass (value) {
  6706. if (Array.isArray(value)) {
  6707. return stringifyArray(value)
  6708. }
  6709. if (isObject(value)) {
  6710. return stringifyObject(value)
  6711. }
  6712. if (typeof value === 'string') {
  6713. return value
  6714. }
  6715. /* istanbul ignore next */
  6716. return ''
  6717. }
  6718. function stringifyArray (value) {
  6719. var res = '';
  6720. var stringified;
  6721. for (var i = 0, l = value.length; i < l; i++) {
  6722. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6723. if (res) { res += ' '; }
  6724. res += stringified;
  6725. }
  6726. }
  6727. return res
  6728. }
  6729. function stringifyObject (value) {
  6730. var res = '';
  6731. for (var key in value) {
  6732. if (value[key]) {
  6733. if (res) { res += ' '; }
  6734. res += key;
  6735. }
  6736. }
  6737. return res
  6738. }
  6739. /* */
  6740. var parseStyleText = cached(function (cssText) {
  6741. var res = {};
  6742. var listDelimiter = /;(?![^(]*\))/g;
  6743. var propertyDelimiter = /:(.+)/;
  6744. cssText.split(listDelimiter).forEach(function (item) {
  6745. if (item) {
  6746. var tmp = item.split(propertyDelimiter);
  6747. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6748. }
  6749. });
  6750. return res
  6751. });
  6752. // normalize possible array / string values into Object
  6753. function normalizeStyleBinding (bindingStyle) {
  6754. if (Array.isArray(bindingStyle)) {
  6755. return toObject(bindingStyle)
  6756. }
  6757. if (typeof bindingStyle === 'string') {
  6758. return parseStyleText(bindingStyle)
  6759. }
  6760. return bindingStyle
  6761. }
  6762. /* */
  6763. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6764. function getTarget(obj, path) {
  6765. var parts = path.split('.');
  6766. var key = parts[0];
  6767. if (key.indexOf('__$n') === 0) { //number index
  6768. key = parseInt(key.replace('__$n', ''));
  6769. }
  6770. if (parts.length === 1) {
  6771. return obj[key]
  6772. }
  6773. return getTarget(obj[key], parts.slice(1).join('.'))
  6774. }
  6775. function internalMixin(Vue) {
  6776. Vue.config.errorHandler = function(err, vm, info) {
  6777. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6778. console.error(err);
  6779. /* eslint-disable no-undef */
  6780. var app = getApp();
  6781. if (app && app.onError) {
  6782. app.onError(err);
  6783. }
  6784. };
  6785. var oldEmit = Vue.prototype.$emit;
  6786. Vue.prototype.$emit = function(event) {
  6787. if (this.$scope && event) {
  6788. this.$scope['triggerEvent'](event, {
  6789. __args__: toArray(arguments, 1)
  6790. });
  6791. }
  6792. return oldEmit.apply(this, arguments)
  6793. };
  6794. Vue.prototype.$nextTick = function(fn) {
  6795. return nextTick$1(this, fn)
  6796. };
  6797. MP_METHODS.forEach(function (method) {
  6798. Vue.prototype[method] = function(args) {
  6799. if (this.$scope && this.$scope[method]) {
  6800. return this.$scope[method](args)
  6801. }
  6802. // mp-alipay
  6803. if (typeof my === 'undefined') {
  6804. return
  6805. }
  6806. if (method === 'createSelectorQuery') {
  6807. /* eslint-disable no-undef */
  6808. return my.createSelectorQuery(args)
  6809. } else if (method === 'createIntersectionObserver') {
  6810. /* eslint-disable no-undef */
  6811. return my.createIntersectionObserver(args)
  6812. }
  6813. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6814. };
  6815. });
  6816. Vue.prototype.__init_provide = initProvide;
  6817. Vue.prototype.__init_injections = initInjections;
  6818. Vue.prototype.__call_hook = function(hook, args) {
  6819. var vm = this;
  6820. // #7573 disable dep collection when invoking lifecycle hooks
  6821. pushTarget();
  6822. var handlers = vm.$options[hook];
  6823. var info = hook + " hook";
  6824. var ret;
  6825. if (handlers) {
  6826. for (var i = 0, j = handlers.length; i < j; i++) {
  6827. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6828. }
  6829. }
  6830. if (vm._hasHookEvent) {
  6831. vm.$emit('hook:' + hook, args);
  6832. }
  6833. popTarget();
  6834. return ret
  6835. };
  6836. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6837. if (Array.isArray(modifiers)) {
  6838. if (modifiers.indexOf('trim') !== -1) {
  6839. value = value.trim();
  6840. }
  6841. if (modifiers.indexOf('number') !== -1) {
  6842. value = this._n(value);
  6843. }
  6844. }
  6845. if (!target) {
  6846. target = this;
  6847. }
  6848. target[key] = value;
  6849. };
  6850. Vue.prototype.__set_sync = function(target, key, value) {
  6851. if (!target) {
  6852. target = this;
  6853. }
  6854. target[key] = value;
  6855. };
  6856. Vue.prototype.__get_orig = function(item) {
  6857. if (isPlainObject(item)) {
  6858. return item['$orig'] || item
  6859. }
  6860. return item
  6861. };
  6862. Vue.prototype.__get_value = function(dataPath, target) {
  6863. return getTarget(target || this, dataPath)
  6864. };
  6865. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6866. return renderClass(staticClass, dynamicClass)
  6867. };
  6868. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6869. if (!dynamicStyle && !staticStyle) {
  6870. return ''
  6871. }
  6872. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6873. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6874. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6875. };
  6876. Vue.prototype.__map = function(val, iteratee) {
  6877. //TODO 暂不考虑 string
  6878. var ret, i, l, keys, key;
  6879. if (Array.isArray(val)) {
  6880. ret = new Array(val.length);
  6881. for (i = 0, l = val.length; i < l; i++) {
  6882. ret[i] = iteratee(val[i], i);
  6883. }
  6884. return ret
  6885. } else if (isObject(val)) {
  6886. keys = Object.keys(val);
  6887. ret = Object.create(null);
  6888. for (i = 0, l = keys.length; i < l; i++) {
  6889. key = keys[i];
  6890. ret[key] = iteratee(val[key], key, i);
  6891. }
  6892. return ret
  6893. } else if (typeof val === 'number') {
  6894. ret = new Array(val);
  6895. for (i = 0, l = val; i < l; i++) {
  6896. // 第一个参数暂时仍和小程序一致
  6897. ret[i] = iteratee(i, i);
  6898. }
  6899. return ret
  6900. }
  6901. return []
  6902. };
  6903. }
  6904. /* */
  6905. var LIFECYCLE_HOOKS$1 = [
  6906. //App
  6907. 'onLaunch',
  6908. 'onShow',
  6909. 'onHide',
  6910. 'onUniNViewMessage',
  6911. 'onPageNotFound',
  6912. 'onThemeChange',
  6913. 'onError',
  6914. 'onUnhandledRejection',
  6915. //Page
  6916. 'onLoad',
  6917. // 'onShow',
  6918. 'onReady',
  6919. // 'onHide',
  6920. 'onUnload',
  6921. 'onPullDownRefresh',
  6922. 'onReachBottom',
  6923. 'onTabItemTap',
  6924. 'onAddToFavorites',
  6925. 'onShareTimeline',
  6926. 'onShareAppMessage',
  6927. 'onResize',
  6928. 'onPageScroll',
  6929. 'onNavigationBarButtonTap',
  6930. 'onBackPress',
  6931. 'onNavigationBarSearchInputChanged',
  6932. 'onNavigationBarSearchInputConfirmed',
  6933. 'onNavigationBarSearchInputClicked',
  6934. //Component
  6935. // 'onReady', // 兼容旧版本,应该移除该事件
  6936. 'onPageShow',
  6937. 'onPageHide',
  6938. 'onPageResize'
  6939. ];
  6940. function lifecycleMixin$1(Vue) {
  6941. //fixed vue-class-component
  6942. var oldExtend = Vue.extend;
  6943. Vue.extend = function(extendOptions) {
  6944. extendOptions = extendOptions || {};
  6945. var methods = extendOptions.methods;
  6946. if (methods) {
  6947. Object.keys(methods).forEach(function (methodName) {
  6948. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  6949. extendOptions[methodName] = methods[methodName];
  6950. delete methods[methodName];
  6951. }
  6952. });
  6953. }
  6954. return oldExtend.call(this, extendOptions)
  6955. };
  6956. var strategies = Vue.config.optionMergeStrategies;
  6957. var mergeHook = strategies.created;
  6958. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  6959. strategies[hook] = mergeHook;
  6960. });
  6961. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  6962. }
  6963. /* */
  6964. // install platform patch function
  6965. Vue.prototype.__patch__ = patch;
  6966. // public mount method
  6967. Vue.prototype.$mount = function(
  6968. el ,
  6969. hydrating
  6970. ) {
  6971. return mountComponent$1(this, el, hydrating)
  6972. };
  6973. lifecycleMixin$1(Vue);
  6974. internalMixin(Vue);
  6975. /* */
  6976. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  6977. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  6978. /***/ }),
  6979. /* 3 */
  6980. /*!***********************************!*\
  6981. !*** (webpack)/buildin/global.js ***!
  6982. \***********************************/
  6983. /*! no static exports found */
  6984. /***/ (function(module, exports) {
  6985. var g;
  6986. // This works in non-strict mode
  6987. g = (function() {
  6988. return this;
  6989. })();
  6990. try {
  6991. // This works if eval is allowed (see CSP)
  6992. g = g || new Function("return this")();
  6993. } catch (e) {
  6994. // This works if the window reference is available
  6995. if (typeof window === "object") g = window;
  6996. }
  6997. // g can still be undefined, but nothing to do about it...
  6998. // We return undefined, instead of nothing here, so it's
  6999. // easier to handle this case. if(!global) { ...}
  7000. module.exports = g;
  7001. /***/ }),
  7002. /* 4 */
  7003. /*!*******************************************!*\
  7004. !*** D:/wwwroot/cqcarbonwxapp/pages.json ***!
  7005. \*******************************************/
  7006. /*! no static exports found */
  7007. /***/ (function(module, exports) {
  7008. /***/ }),
  7009. /* 5 */,
  7010. /* 6 */,
  7011. /* 7 */,
  7012. /* 8 */,
  7013. /* 9 */,
  7014. /* 10 */
  7015. /*!**********************************************************************************************************!*\
  7016. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  7017. \**********************************************************************************************************/
  7018. /*! exports provided: default */
  7019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7020. "use strict";
  7021. __webpack_require__.r(__webpack_exports__);
  7022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  7023. /* globals __VUE_SSR_CONTEXT__ */
  7024. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  7025. // This module is a runtime utility for cleaner component module output and will
  7026. // be included in the final webpack user bundle.
  7027. function normalizeComponent (
  7028. scriptExports,
  7029. render,
  7030. staticRenderFns,
  7031. functionalTemplate,
  7032. injectStyles,
  7033. scopeId,
  7034. moduleIdentifier, /* server only */
  7035. shadowMode, /* vue-cli only */
  7036. components, // fixed by xxxxxx auto components
  7037. renderjs // fixed by xxxxxx renderjs
  7038. ) {
  7039. // Vue.extend constructor export interop
  7040. var options = typeof scriptExports === 'function'
  7041. ? scriptExports.options
  7042. : scriptExports
  7043. // fixed by xxxxxx auto components
  7044. if (components) {
  7045. if (!options.components) {
  7046. options.components = {}
  7047. }
  7048. var hasOwn = Object.prototype.hasOwnProperty
  7049. for (var name in components) {
  7050. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  7051. options.components[name] = components[name]
  7052. }
  7053. }
  7054. }
  7055. // fixed by xxxxxx renderjs
  7056. if (renderjs) {
  7057. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  7058. this[renderjs.__module] = this
  7059. });
  7060. (options.mixins || (options.mixins = [])).push(renderjs)
  7061. }
  7062. // render functions
  7063. if (render) {
  7064. options.render = render
  7065. options.staticRenderFns = staticRenderFns
  7066. options._compiled = true
  7067. }
  7068. // functional template
  7069. if (functionalTemplate) {
  7070. options.functional = true
  7071. }
  7072. // scopedId
  7073. if (scopeId) {
  7074. options._scopeId = 'data-v-' + scopeId
  7075. }
  7076. var hook
  7077. if (moduleIdentifier) { // server build
  7078. hook = function (context) {
  7079. // 2.3 injection
  7080. context =
  7081. context || // cached call
  7082. (this.$vnode && this.$vnode.ssrContext) || // stateful
  7083. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  7084. // 2.2 with runInNewContext: true
  7085. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  7086. context = __VUE_SSR_CONTEXT__
  7087. }
  7088. // inject component styles
  7089. if (injectStyles) {
  7090. injectStyles.call(this, context)
  7091. }
  7092. // register component module identifier for async chunk inferrence
  7093. if (context && context._registeredComponents) {
  7094. context._registeredComponents.add(moduleIdentifier)
  7095. }
  7096. }
  7097. // used by ssr in case component is cached and beforeCreate
  7098. // never gets called
  7099. options._ssrRegister = hook
  7100. } else if (injectStyles) {
  7101. hook = shadowMode
  7102. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  7103. : injectStyles
  7104. }
  7105. if (hook) {
  7106. if (options.functional) {
  7107. // for template-only hot-reload because in that case the render fn doesn't
  7108. // go through the normalizer
  7109. options._injectStyles = hook
  7110. // register for functioal component in vue file
  7111. var originalRender = options.render
  7112. options.render = function renderWithStyleInjection (h, context) {
  7113. hook.call(context)
  7114. return originalRender(h, context)
  7115. }
  7116. } else {
  7117. // inject component registration as beforeCreate hook
  7118. var existing = options.beforeCreate
  7119. options.beforeCreate = existing
  7120. ? [].concat(existing, hook)
  7121. : [hook]
  7122. }
  7123. }
  7124. return {
  7125. exports: scriptExports,
  7126. options: options
  7127. }
  7128. }
  7129. /***/ }),
  7130. /* 11 */
  7131. /*!*************************************************!*\
  7132. !*** D:/wwwroot/cqcarbonwxapp/config/config.js ***!
  7133. \*************************************************/
  7134. /*! no static exports found */
  7135. /***/ (function(module, exports, __webpack_require__) {
  7136. "use strict";
  7137. Object.defineProperty(exports, "__esModule", { value: true });exports.config = void 0;var config = {
  7138. //dev
  7139. apiBaseurl: 'http://172.16.90.8:19098', //东东
  7140. // 图片占位
  7141. placeImg: 'http://placekitten.com',
  7142. loginUrl: 'http://wx.hw.hongweisoft.com/zddtest/forest-portal/wechat/h5/authorize?returnUrl=http://foresth5test.hw.hongweisoft.com/#/', //登录后跳转到测试链接 东东
  7143. testToken: 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI2NDY3NjM3NiIsImNyZWF0ZWQiOjE2MDYxMDY3NzE2MjcsImV4cCI6MTYwNjcxMTU3MX0.JP82ED8bjS8yFxjbVzsfOISrDDYyqOAouL9Z2NRjRBNcsKVmGz9ho8zouG-iWNStxuwqcvrebh_6WF3g9Ed9Vg',
  7144. //版本号:版本号升级将显示引导页
  7145. version: '1',
  7146. // 公司测试配置
  7147. // apiBaseurl:'http://forest.hw.hongweisoft.com/data/forest-portal',//测试
  7148. // loginUrl:'http://forest.hw.hongweisoft.com/data/forest-portal/wechat/h5/authorize?returnUrl=http://forest.hw.hongweisoft.com/#/',//登录后跳转到测试链接
  7149. //online 线上配置
  7150. //本地图片
  7151. imgUrl: "../../static/img/",
  7152. //耳机页面图片
  7153. innerImgUrl: "../../../static/img/" };exports.config = config;
  7154. /***/ }),
  7155. /* 12 */
  7156. /*!***********************************************!*\
  7157. !*** D:/wwwroot/cqcarbonwxapp/store/index.js ***!
  7158. \***********************************************/
  7159. /*! no static exports found */
  7160. /***/ (function(module, exports, __webpack_require__) {
  7161. "use strict";
  7162. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));
  7163. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  7164. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 16));
  7165. var _index = _interopRequireDefault(__webpack_require__(/*! @/js_sdk/luch-request/luch-request/index.js */ 17));
  7166. var _md5Min = _interopRequireDefault(__webpack_require__(/*! @/js_sdk/js-md5/md5.min.js */ 30));
  7167. var _config = __webpack_require__(/*! @/config/config.js */ 11);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}var http = new _index.default();
  7168. _vue.default.use(_vuex.default);
  7169. var userKey = (0, _md5Min.default)("userInfo");
  7170. var hPageKey = (0, _md5Min.default)('historyPage');
  7171. var sysTokenKey = (0, _md5Min.default)('accessToken');
  7172. var loginUrl = '/pages/login/loginType';
  7173. var token = uni.getStorageSync(sysTokenKey);
  7174. var thetoken = 'Bearer ' + token.accessToken;var _default =
  7175. new _vuex.default.Store({
  7176. state: {
  7177. hasLogin: false,
  7178. userInfo: {
  7179. customerCompanyInfoForm: {} },
  7180. token: '',
  7181. hPage: '' },
  7182. mutations: {
  7183. login: function login(state) {var token = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  7184. token = token instanceof Object ? token.accessToken : token;
  7185. state.token = token || uni.getStorageSync(sysTokenKey).accessToken || '';
  7186. state.hasLogin = Boolean(state.token);
  7187. //保存token
  7188. uni.setStorage({
  7189. key: sysTokenKey,
  7190. data: {
  7191. accessToken: state.token } });
  7192. },
  7193. /**
  7194. * 退出登录,传入false只更新缓存不跳转
  7195. */
  7196. logout: function logout(state) {var v = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  7197. state.hasLogin = false;
  7198. state.userInfo = {};
  7199. state.token = '';
  7200. uni.removeStorage({
  7201. key: userKey });
  7202. uni.removeStorage({
  7203. key: sysTokenKey });
  7204. //跳到登录页
  7205. // v && $api.goto(loginUrl);
  7206. },
  7207. // historyPage(state, pUrl = '') {
  7208. // if($api.alterUrl('/',pUrl) != loginUrl){
  7209. // state.hPage = pUrl || uni.getStorageSync(hPageKey).url;
  7210. // //记录历史页
  7211. // uni.setStorage({
  7212. // key: hPageKey,
  7213. // data: {
  7214. // url: state.hPage
  7215. // }
  7216. // });
  7217. // }
  7218. // },
  7219. upInfo: function upInfo(state) {var _arguments = arguments;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var provider, infoObj, then;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:provider = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : {};
  7220. //用户信息结构
  7221. infoObj = {
  7222. "guid": "",
  7223. "account": "",
  7224. "customerType": '',
  7225. "customerName": "",
  7226. "nickName": "",
  7227. "phone": "",
  7228. "sex": '',
  7229. "headImage": "",
  7230. "queryStr": '',
  7231. "carbonAmount": '',
  7232. "farmerNum": '',
  7233. "farmerPersonNum": '',
  7234. "loginType": '',
  7235. "customerCompanyInfoForm": {
  7236. "guid": "",
  7237. "fkCustomerId": "",
  7238. "companyName": "",
  7239. "principals": "",
  7240. "phone": "",
  7241. "email": "",
  7242. "companyAddress": "",
  7243. "companyImages": "",
  7244. "condition": "",
  7245. "customerType": "",
  7246. "imageList": '',
  7247. "companyType": '' },
  7248. "channelType": '' };
  7249. then = function then(res) {
  7250. console.log('222', res);
  7251. // if (res.code == 0) {
  7252. // let data = res.data instanceof Object ? res.data : infoObj;
  7253. // //处理头像连接
  7254. // // data.headImage = $api.alterUrl($api.href, data.headImage || "");
  7255. // state.userInfo = data;
  7256. // uni.setStorage({ //缓存用户登陆状态
  7257. // key: userKey,
  7258. // data
  7259. // });
  7260. // }
  7261. };
  7262. //读取本地缓存信息进行赋值
  7263. then({
  7264. code: 0,
  7265. data: Object.assign(uni.getStorageSync(userKey), provider) });
  7266. //在线更新取得用户信息
  7267. // then(await $api.$http({
  7268. // url: config.apiBaseurl + '/carbon-h5/wap/customer/getCustomerByToken'
  7269. // }));
  7270. _context.t0 = then;_context.next = 7;return (
  7271. http.get(_config.config.apiBaseurl + '/carbon-h5/wap/customer/getCustomerByToken', { header: { Authorization: thetoken } }).then(function (res) {
  7272. console.log('getCustomerByToken', res);
  7273. }).catch(function (err) {
  7274. // console.log('err', err)
  7275. }));case 7:_context.t1 = _context.sent;(0, _context.t0)(_context.t1);case 9:case "end":return _context.stop();}}}, _callee);}))();
  7276. } } });exports.default = _default;
  7277. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7278. /***/ }),
  7279. /* 13 */
  7280. /*!**********************************************************!*\
  7281. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  7282. \**********************************************************/
  7283. /*! no static exports found */
  7284. /***/ (function(module, exports, __webpack_require__) {
  7285. module.exports = __webpack_require__(/*! regenerator-runtime */ 14);
  7286. /***/ }),
  7287. /* 14 */
  7288. /*!************************************************************!*\
  7289. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  7290. \************************************************************/
  7291. /*! no static exports found */
  7292. /***/ (function(module, exports, __webpack_require__) {
  7293. /**
  7294. * Copyright (c) 2014-present, Facebook, Inc.
  7295. *
  7296. * This source code is licensed under the MIT license found in the
  7297. * LICENSE file in the root directory of this source tree.
  7298. */
  7299. // This method of obtaining a reference to the global object needs to be
  7300. // kept identical to the way it is obtained in runtime.js
  7301. var g = (function() {
  7302. return this || (typeof self === "object" && self);
  7303. })() || Function("return this")();
  7304. // Use `getOwnPropertyNames` because not all browsers support calling
  7305. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  7306. var hadRuntime = g.regeneratorRuntime &&
  7307. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  7308. // Save the old regeneratorRuntime in case it needs to be restored later.
  7309. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  7310. // Force reevalutation of runtime.js.
  7311. g.regeneratorRuntime = undefined;
  7312. module.exports = __webpack_require__(/*! ./runtime */ 15);
  7313. if (hadRuntime) {
  7314. // Restore the original runtime.
  7315. g.regeneratorRuntime = oldRuntime;
  7316. } else {
  7317. // Remove the global property added by runtime.js.
  7318. try {
  7319. delete g.regeneratorRuntime;
  7320. } catch(e) {
  7321. g.regeneratorRuntime = undefined;
  7322. }
  7323. }
  7324. /***/ }),
  7325. /* 15 */
  7326. /*!*****************************************************!*\
  7327. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  7328. \*****************************************************/
  7329. /*! no static exports found */
  7330. /***/ (function(module, exports) {
  7331. /**
  7332. * Copyright (c) 2014-present, Facebook, Inc.
  7333. *
  7334. * This source code is licensed under the MIT license found in the
  7335. * LICENSE file in the root directory of this source tree.
  7336. */
  7337. !(function(global) {
  7338. "use strict";
  7339. var Op = Object.prototype;
  7340. var hasOwn = Op.hasOwnProperty;
  7341. var undefined; // More compressible than void 0.
  7342. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  7343. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  7344. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  7345. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  7346. var inModule = typeof module === "object";
  7347. var runtime = global.regeneratorRuntime;
  7348. if (runtime) {
  7349. if (inModule) {
  7350. // If regeneratorRuntime is defined globally and we're in a module,
  7351. // make the exports object identical to regeneratorRuntime.
  7352. module.exports = runtime;
  7353. }
  7354. // Don't bother evaluating the rest of this file if the runtime was
  7355. // already defined globally.
  7356. return;
  7357. }
  7358. // Define the runtime globally (as expected by generated code) as either
  7359. // module.exports (if we're in a module) or a new, empty object.
  7360. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  7361. function wrap(innerFn, outerFn, self, tryLocsList) {
  7362. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  7363. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  7364. var generator = Object.create(protoGenerator.prototype);
  7365. var context = new Context(tryLocsList || []);
  7366. // The ._invoke method unifies the implementations of the .next,
  7367. // .throw, and .return methods.
  7368. generator._invoke = makeInvokeMethod(innerFn, self, context);
  7369. return generator;
  7370. }
  7371. runtime.wrap = wrap;
  7372. // Try/catch helper to minimize deoptimizations. Returns a completion
  7373. // record like context.tryEntries[i].completion. This interface could
  7374. // have been (and was previously) designed to take a closure to be
  7375. // invoked without arguments, but in all the cases we care about we
  7376. // already have an existing method we want to call, so there's no need
  7377. // to create a new function object. We can even get away with assuming
  7378. // the method takes exactly one argument, since that happens to be true
  7379. // in every case, so we don't have to touch the arguments object. The
  7380. // only additional allocation required is the completion record, which
  7381. // has a stable shape and so hopefully should be cheap to allocate.
  7382. function tryCatch(fn, obj, arg) {
  7383. try {
  7384. return { type: "normal", arg: fn.call(obj, arg) };
  7385. } catch (err) {
  7386. return { type: "throw", arg: err };
  7387. }
  7388. }
  7389. var GenStateSuspendedStart = "suspendedStart";
  7390. var GenStateSuspendedYield = "suspendedYield";
  7391. var GenStateExecuting = "executing";
  7392. var GenStateCompleted = "completed";
  7393. // Returning this object from the innerFn has the same effect as
  7394. // breaking out of the dispatch switch statement.
  7395. var ContinueSentinel = {};
  7396. // Dummy constructor functions that we use as the .constructor and
  7397. // .constructor.prototype properties for functions that return Generator
  7398. // objects. For full spec compliance, you may wish to configure your
  7399. // minifier not to mangle the names of these two functions.
  7400. function Generator() {}
  7401. function GeneratorFunction() {}
  7402. function GeneratorFunctionPrototype() {}
  7403. // This is a polyfill for %IteratorPrototype% for environments that
  7404. // don't natively support it.
  7405. var IteratorPrototype = {};
  7406. IteratorPrototype[iteratorSymbol] = function () {
  7407. return this;
  7408. };
  7409. var getProto = Object.getPrototypeOf;
  7410. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  7411. if (NativeIteratorPrototype &&
  7412. NativeIteratorPrototype !== Op &&
  7413. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  7414. // This environment has a native %IteratorPrototype%; use it instead
  7415. // of the polyfill.
  7416. IteratorPrototype = NativeIteratorPrototype;
  7417. }
  7418. var Gp = GeneratorFunctionPrototype.prototype =
  7419. Generator.prototype = Object.create(IteratorPrototype);
  7420. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  7421. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  7422. GeneratorFunctionPrototype[toStringTagSymbol] =
  7423. GeneratorFunction.displayName = "GeneratorFunction";
  7424. // Helper for defining the .next, .throw, and .return methods of the
  7425. // Iterator interface in terms of a single ._invoke method.
  7426. function defineIteratorMethods(prototype) {
  7427. ["next", "throw", "return"].forEach(function(method) {
  7428. prototype[method] = function(arg) {
  7429. return this._invoke(method, arg);
  7430. };
  7431. });
  7432. }
  7433. runtime.isGeneratorFunction = function(genFun) {
  7434. var ctor = typeof genFun === "function" && genFun.constructor;
  7435. return ctor
  7436. ? ctor === GeneratorFunction ||
  7437. // For the native GeneratorFunction constructor, the best we can
  7438. // do is to check its .name property.
  7439. (ctor.displayName || ctor.name) === "GeneratorFunction"
  7440. : false;
  7441. };
  7442. runtime.mark = function(genFun) {
  7443. if (Object.setPrototypeOf) {
  7444. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  7445. } else {
  7446. genFun.__proto__ = GeneratorFunctionPrototype;
  7447. if (!(toStringTagSymbol in genFun)) {
  7448. genFun[toStringTagSymbol] = "GeneratorFunction";
  7449. }
  7450. }
  7451. genFun.prototype = Object.create(Gp);
  7452. return genFun;
  7453. };
  7454. // Within the body of any async function, `await x` is transformed to
  7455. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  7456. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  7457. // meant to be awaited.
  7458. runtime.awrap = function(arg) {
  7459. return { __await: arg };
  7460. };
  7461. function AsyncIterator(generator) {
  7462. function invoke(method, arg, resolve, reject) {
  7463. var record = tryCatch(generator[method], generator, arg);
  7464. if (record.type === "throw") {
  7465. reject(record.arg);
  7466. } else {
  7467. var result = record.arg;
  7468. var value = result.value;
  7469. if (value &&
  7470. typeof value === "object" &&
  7471. hasOwn.call(value, "__await")) {
  7472. return Promise.resolve(value.__await).then(function(value) {
  7473. invoke("next", value, resolve, reject);
  7474. }, function(err) {
  7475. invoke("throw", err, resolve, reject);
  7476. });
  7477. }
  7478. return Promise.resolve(value).then(function(unwrapped) {
  7479. // When a yielded Promise is resolved, its final value becomes
  7480. // the .value of the Promise<{value,done}> result for the
  7481. // current iteration.
  7482. result.value = unwrapped;
  7483. resolve(result);
  7484. }, function(error) {
  7485. // If a rejected Promise was yielded, throw the rejection back
  7486. // into the async generator function so it can be handled there.
  7487. return invoke("throw", error, resolve, reject);
  7488. });
  7489. }
  7490. }
  7491. var previousPromise;
  7492. function enqueue(method, arg) {
  7493. function callInvokeWithMethodAndArg() {
  7494. return new Promise(function(resolve, reject) {
  7495. invoke(method, arg, resolve, reject);
  7496. });
  7497. }
  7498. return previousPromise =
  7499. // If enqueue has been called before, then we want to wait until
  7500. // all previous Promises have been resolved before calling invoke,
  7501. // so that results are always delivered in the correct order. If
  7502. // enqueue has not been called before, then it is important to
  7503. // call invoke immediately, without waiting on a callback to fire,
  7504. // so that the async generator function has the opportunity to do
  7505. // any necessary setup in a predictable way. This predictability
  7506. // is why the Promise constructor synchronously invokes its
  7507. // executor callback, and why async functions synchronously
  7508. // execute code before the first await. Since we implement simple
  7509. // async functions in terms of async generators, it is especially
  7510. // important to get this right, even though it requires care.
  7511. previousPromise ? previousPromise.then(
  7512. callInvokeWithMethodAndArg,
  7513. // Avoid propagating failures to Promises returned by later
  7514. // invocations of the iterator.
  7515. callInvokeWithMethodAndArg
  7516. ) : callInvokeWithMethodAndArg();
  7517. }
  7518. // Define the unified helper method that is used to implement .next,
  7519. // .throw, and .return (see defineIteratorMethods).
  7520. this._invoke = enqueue;
  7521. }
  7522. defineIteratorMethods(AsyncIterator.prototype);
  7523. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7524. return this;
  7525. };
  7526. runtime.AsyncIterator = AsyncIterator;
  7527. // Note that simple async functions are implemented on top of
  7528. // AsyncIterator objects; they just return a Promise for the value of
  7529. // the final result produced by the iterator.
  7530. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7531. var iter = new AsyncIterator(
  7532. wrap(innerFn, outerFn, self, tryLocsList)
  7533. );
  7534. return runtime.isGeneratorFunction(outerFn)
  7535. ? iter // If outerFn is a generator, return the full iterator.
  7536. : iter.next().then(function(result) {
  7537. return result.done ? result.value : iter.next();
  7538. });
  7539. };
  7540. function makeInvokeMethod(innerFn, self, context) {
  7541. var state = GenStateSuspendedStart;
  7542. return function invoke(method, arg) {
  7543. if (state === GenStateExecuting) {
  7544. throw new Error("Generator is already running");
  7545. }
  7546. if (state === GenStateCompleted) {
  7547. if (method === "throw") {
  7548. throw arg;
  7549. }
  7550. // Be forgiving, per 25.3.3.3.3 of the spec:
  7551. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7552. return doneResult();
  7553. }
  7554. context.method = method;
  7555. context.arg = arg;
  7556. while (true) {
  7557. var delegate = context.delegate;
  7558. if (delegate) {
  7559. var delegateResult = maybeInvokeDelegate(delegate, context);
  7560. if (delegateResult) {
  7561. if (delegateResult === ContinueSentinel) continue;
  7562. return delegateResult;
  7563. }
  7564. }
  7565. if (context.method === "next") {
  7566. // Setting context._sent for legacy support of Babel's
  7567. // function.sent implementation.
  7568. context.sent = context._sent = context.arg;
  7569. } else if (context.method === "throw") {
  7570. if (state === GenStateSuspendedStart) {
  7571. state = GenStateCompleted;
  7572. throw context.arg;
  7573. }
  7574. context.dispatchException(context.arg);
  7575. } else if (context.method === "return") {
  7576. context.abrupt("return", context.arg);
  7577. }
  7578. state = GenStateExecuting;
  7579. var record = tryCatch(innerFn, self, context);
  7580. if (record.type === "normal") {
  7581. // If an exception is thrown from innerFn, we leave state ===
  7582. // GenStateExecuting and loop back for another invocation.
  7583. state = context.done
  7584. ? GenStateCompleted
  7585. : GenStateSuspendedYield;
  7586. if (record.arg === ContinueSentinel) {
  7587. continue;
  7588. }
  7589. return {
  7590. value: record.arg,
  7591. done: context.done
  7592. };
  7593. } else if (record.type === "throw") {
  7594. state = GenStateCompleted;
  7595. // Dispatch the exception by looping back around to the
  7596. // context.dispatchException(context.arg) call above.
  7597. context.method = "throw";
  7598. context.arg = record.arg;
  7599. }
  7600. }
  7601. };
  7602. }
  7603. // Call delegate.iterator[context.method](context.arg) and handle the
  7604. // result, either by returning a { value, done } result from the
  7605. // delegate iterator, or by modifying context.method and context.arg,
  7606. // setting context.delegate to null, and returning the ContinueSentinel.
  7607. function maybeInvokeDelegate(delegate, context) {
  7608. var method = delegate.iterator[context.method];
  7609. if (method === undefined) {
  7610. // A .throw or .return when the delegate iterator has no .throw
  7611. // method always terminates the yield* loop.
  7612. context.delegate = null;
  7613. if (context.method === "throw") {
  7614. if (delegate.iterator.return) {
  7615. // If the delegate iterator has a return method, give it a
  7616. // chance to clean up.
  7617. context.method = "return";
  7618. context.arg = undefined;
  7619. maybeInvokeDelegate(delegate, context);
  7620. if (context.method === "throw") {
  7621. // If maybeInvokeDelegate(context) changed context.method from
  7622. // "return" to "throw", let that override the TypeError below.
  7623. return ContinueSentinel;
  7624. }
  7625. }
  7626. context.method = "throw";
  7627. context.arg = new TypeError(
  7628. "The iterator does not provide a 'throw' method");
  7629. }
  7630. return ContinueSentinel;
  7631. }
  7632. var record = tryCatch(method, delegate.iterator, context.arg);
  7633. if (record.type === "throw") {
  7634. context.method = "throw";
  7635. context.arg = record.arg;
  7636. context.delegate = null;
  7637. return ContinueSentinel;
  7638. }
  7639. var info = record.arg;
  7640. if (! info) {
  7641. context.method = "throw";
  7642. context.arg = new TypeError("iterator result is not an object");
  7643. context.delegate = null;
  7644. return ContinueSentinel;
  7645. }
  7646. if (info.done) {
  7647. // Assign the result of the finished delegate to the temporary
  7648. // variable specified by delegate.resultName (see delegateYield).
  7649. context[delegate.resultName] = info.value;
  7650. // Resume execution at the desired location (see delegateYield).
  7651. context.next = delegate.nextLoc;
  7652. // If context.method was "throw" but the delegate handled the
  7653. // exception, let the outer generator proceed normally. If
  7654. // context.method was "next", forget context.arg since it has been
  7655. // "consumed" by the delegate iterator. If context.method was
  7656. // "return", allow the original .return call to continue in the
  7657. // outer generator.
  7658. if (context.method !== "return") {
  7659. context.method = "next";
  7660. context.arg = undefined;
  7661. }
  7662. } else {
  7663. // Re-yield the result returned by the delegate method.
  7664. return info;
  7665. }
  7666. // The delegate iterator is finished, so forget it and continue with
  7667. // the outer generator.
  7668. context.delegate = null;
  7669. return ContinueSentinel;
  7670. }
  7671. // Define Generator.prototype.{next,throw,return} in terms of the
  7672. // unified ._invoke helper method.
  7673. defineIteratorMethods(Gp);
  7674. Gp[toStringTagSymbol] = "Generator";
  7675. // A Generator should always return itself as the iterator object when the
  7676. // @@iterator function is called on it. Some browsers' implementations of the
  7677. // iterator prototype chain incorrectly implement this, causing the Generator
  7678. // object to not be returned from this call. This ensures that doesn't happen.
  7679. // See https://github.com/facebook/regenerator/issues/274 for more details.
  7680. Gp[iteratorSymbol] = function() {
  7681. return this;
  7682. };
  7683. Gp.toString = function() {
  7684. return "[object Generator]";
  7685. };
  7686. function pushTryEntry(locs) {
  7687. var entry = { tryLoc: locs[0] };
  7688. if (1 in locs) {
  7689. entry.catchLoc = locs[1];
  7690. }
  7691. if (2 in locs) {
  7692. entry.finallyLoc = locs[2];
  7693. entry.afterLoc = locs[3];
  7694. }
  7695. this.tryEntries.push(entry);
  7696. }
  7697. function resetTryEntry(entry) {
  7698. var record = entry.completion || {};
  7699. record.type = "normal";
  7700. delete record.arg;
  7701. entry.completion = record;
  7702. }
  7703. function Context(tryLocsList) {
  7704. // The root entry object (effectively a try statement without a catch
  7705. // or a finally block) gives us a place to store values thrown from
  7706. // locations where there is no enclosing try statement.
  7707. this.tryEntries = [{ tryLoc: "root" }];
  7708. tryLocsList.forEach(pushTryEntry, this);
  7709. this.reset(true);
  7710. }
  7711. runtime.keys = function(object) {
  7712. var keys = [];
  7713. for (var key in object) {
  7714. keys.push(key);
  7715. }
  7716. keys.reverse();
  7717. // Rather than returning an object with a next method, we keep
  7718. // things simple and return the next function itself.
  7719. return function next() {
  7720. while (keys.length) {
  7721. var key = keys.pop();
  7722. if (key in object) {
  7723. next.value = key;
  7724. next.done = false;
  7725. return next;
  7726. }
  7727. }
  7728. // To avoid creating an additional object, we just hang the .value
  7729. // and .done properties off the next function object itself. This
  7730. // also ensures that the minifier will not anonymize the function.
  7731. next.done = true;
  7732. return next;
  7733. };
  7734. };
  7735. function values(iterable) {
  7736. if (iterable) {
  7737. var iteratorMethod = iterable[iteratorSymbol];
  7738. if (iteratorMethod) {
  7739. return iteratorMethod.call(iterable);
  7740. }
  7741. if (typeof iterable.next === "function") {
  7742. return iterable;
  7743. }
  7744. if (!isNaN(iterable.length)) {
  7745. var i = -1, next = function next() {
  7746. while (++i < iterable.length) {
  7747. if (hasOwn.call(iterable, i)) {
  7748. next.value = iterable[i];
  7749. next.done = false;
  7750. return next;
  7751. }
  7752. }
  7753. next.value = undefined;
  7754. next.done = true;
  7755. return next;
  7756. };
  7757. return next.next = next;
  7758. }
  7759. }
  7760. // Return an iterator with no values.
  7761. return { next: doneResult };
  7762. }
  7763. runtime.values = values;
  7764. function doneResult() {
  7765. return { value: undefined, done: true };
  7766. }
  7767. Context.prototype = {
  7768. constructor: Context,
  7769. reset: function(skipTempReset) {
  7770. this.prev = 0;
  7771. this.next = 0;
  7772. // Resetting context._sent for legacy support of Babel's
  7773. // function.sent implementation.
  7774. this.sent = this._sent = undefined;
  7775. this.done = false;
  7776. this.delegate = null;
  7777. this.method = "next";
  7778. this.arg = undefined;
  7779. this.tryEntries.forEach(resetTryEntry);
  7780. if (!skipTempReset) {
  7781. for (var name in this) {
  7782. // Not sure about the optimal order of these conditions:
  7783. if (name.charAt(0) === "t" &&
  7784. hasOwn.call(this, name) &&
  7785. !isNaN(+name.slice(1))) {
  7786. this[name] = undefined;
  7787. }
  7788. }
  7789. }
  7790. },
  7791. stop: function() {
  7792. this.done = true;
  7793. var rootEntry = this.tryEntries[0];
  7794. var rootRecord = rootEntry.completion;
  7795. if (rootRecord.type === "throw") {
  7796. throw rootRecord.arg;
  7797. }
  7798. return this.rval;
  7799. },
  7800. dispatchException: function(exception) {
  7801. if (this.done) {
  7802. throw exception;
  7803. }
  7804. var context = this;
  7805. function handle(loc, caught) {
  7806. record.type = "throw";
  7807. record.arg = exception;
  7808. context.next = loc;
  7809. if (caught) {
  7810. // If the dispatched exception was caught by a catch block,
  7811. // then let that catch block handle the exception normally.
  7812. context.method = "next";
  7813. context.arg = undefined;
  7814. }
  7815. return !! caught;
  7816. }
  7817. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7818. var entry = this.tryEntries[i];
  7819. var record = entry.completion;
  7820. if (entry.tryLoc === "root") {
  7821. // Exception thrown outside of any try block that could handle
  7822. // it, so set the completion value of the entire function to
  7823. // throw the exception.
  7824. return handle("end");
  7825. }
  7826. if (entry.tryLoc <= this.prev) {
  7827. var hasCatch = hasOwn.call(entry, "catchLoc");
  7828. var hasFinally = hasOwn.call(entry, "finallyLoc");
  7829. if (hasCatch && hasFinally) {
  7830. if (this.prev < entry.catchLoc) {
  7831. return handle(entry.catchLoc, true);
  7832. } else if (this.prev < entry.finallyLoc) {
  7833. return handle(entry.finallyLoc);
  7834. }
  7835. } else if (hasCatch) {
  7836. if (this.prev < entry.catchLoc) {
  7837. return handle(entry.catchLoc, true);
  7838. }
  7839. } else if (hasFinally) {
  7840. if (this.prev < entry.finallyLoc) {
  7841. return handle(entry.finallyLoc);
  7842. }
  7843. } else {
  7844. throw new Error("try statement without catch or finally");
  7845. }
  7846. }
  7847. }
  7848. },
  7849. abrupt: function(type, arg) {
  7850. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7851. var entry = this.tryEntries[i];
  7852. if (entry.tryLoc <= this.prev &&
  7853. hasOwn.call(entry, "finallyLoc") &&
  7854. this.prev < entry.finallyLoc) {
  7855. var finallyEntry = entry;
  7856. break;
  7857. }
  7858. }
  7859. if (finallyEntry &&
  7860. (type === "break" ||
  7861. type === "continue") &&
  7862. finallyEntry.tryLoc <= arg &&
  7863. arg <= finallyEntry.finallyLoc) {
  7864. // Ignore the finally entry if control is not jumping to a
  7865. // location outside the try/catch block.
  7866. finallyEntry = null;
  7867. }
  7868. var record = finallyEntry ? finallyEntry.completion : {};
  7869. record.type = type;
  7870. record.arg = arg;
  7871. if (finallyEntry) {
  7872. this.method = "next";
  7873. this.next = finallyEntry.finallyLoc;
  7874. return ContinueSentinel;
  7875. }
  7876. return this.complete(record);
  7877. },
  7878. complete: function(record, afterLoc) {
  7879. if (record.type === "throw") {
  7880. throw record.arg;
  7881. }
  7882. if (record.type === "break" ||
  7883. record.type === "continue") {
  7884. this.next = record.arg;
  7885. } else if (record.type === "return") {
  7886. this.rval = this.arg = record.arg;
  7887. this.method = "return";
  7888. this.next = "end";
  7889. } else if (record.type === "normal" && afterLoc) {
  7890. this.next = afterLoc;
  7891. }
  7892. return ContinueSentinel;
  7893. },
  7894. finish: function(finallyLoc) {
  7895. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7896. var entry = this.tryEntries[i];
  7897. if (entry.finallyLoc === finallyLoc) {
  7898. this.complete(entry.completion, entry.afterLoc);
  7899. resetTryEntry(entry);
  7900. return ContinueSentinel;
  7901. }
  7902. }
  7903. },
  7904. "catch": function(tryLoc) {
  7905. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7906. var entry = this.tryEntries[i];
  7907. if (entry.tryLoc === tryLoc) {
  7908. var record = entry.completion;
  7909. if (record.type === "throw") {
  7910. var thrown = record.arg;
  7911. resetTryEntry(entry);
  7912. }
  7913. return thrown;
  7914. }
  7915. }
  7916. // The context.catch method must only be called with a location
  7917. // argument that corresponds to a known catch block.
  7918. throw new Error("illegal catch attempt");
  7919. },
  7920. delegateYield: function(iterable, resultName, nextLoc) {
  7921. this.delegate = {
  7922. iterator: values(iterable),
  7923. resultName: resultName,
  7924. nextLoc: nextLoc
  7925. };
  7926. if (this.method === "next") {
  7927. // Deliberately forget the last sent value so that we don't
  7928. // accidentally pass it on to the delegate.
  7929. this.arg = undefined;
  7930. }
  7931. return ContinueSentinel;
  7932. }
  7933. };
  7934. })(
  7935. // In sloppy mode, unbound `this` refers to the global object, fallback to
  7936. // Function constructor if we're in global strict mode. That is sadly a form
  7937. // of indirect eval which violates Content Security Policy.
  7938. (function() {
  7939. return this || (typeof self === "object" && self);
  7940. })() || Function("return this")()
  7941. );
  7942. /***/ }),
  7943. /* 16 */
  7944. /*!********************************************!*\
  7945. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  7946. \********************************************/
  7947. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  7948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7949. "use strict";
  7950. __webpack_require__.r(__webpack_exports__);
  7951. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  7952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  7953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  7954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  7955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  7956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  7957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  7958. /*!
  7959. * vuex v3.4.0
  7960. * (c) 2020 Evan You
  7961. * @license MIT
  7962. */
  7963. function applyMixin (Vue) {
  7964. var version = Number(Vue.version.split('.')[0]);
  7965. if (version >= 2) {
  7966. Vue.mixin({ beforeCreate: vuexInit });
  7967. } else {
  7968. // override init and inject vuex init procedure
  7969. // for 1.x backwards compatibility.
  7970. var _init = Vue.prototype._init;
  7971. Vue.prototype._init = function (options) {
  7972. if ( options === void 0 ) options = {};
  7973. options.init = options.init
  7974. ? [vuexInit].concat(options.init)
  7975. : vuexInit;
  7976. _init.call(this, options);
  7977. };
  7978. }
  7979. /**
  7980. * Vuex init hook, injected into each instances init hooks list.
  7981. */
  7982. function vuexInit () {
  7983. var options = this.$options;
  7984. // store injection
  7985. if (options.store) {
  7986. this.$store = typeof options.store === 'function'
  7987. ? options.store()
  7988. : options.store;
  7989. } else if (options.parent && options.parent.$store) {
  7990. this.$store = options.parent.$store;
  7991. }
  7992. }
  7993. }
  7994. var target = typeof window !== 'undefined'
  7995. ? window
  7996. : typeof global !== 'undefined'
  7997. ? global
  7998. : {};
  7999. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8000. function devtoolPlugin (store) {
  8001. if (!devtoolHook) { return }
  8002. store._devtoolHook = devtoolHook;
  8003. devtoolHook.emit('vuex:init', store);
  8004. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  8005. store.replaceState(targetState);
  8006. });
  8007. store.subscribe(function (mutation, state) {
  8008. devtoolHook.emit('vuex:mutation', mutation, state);
  8009. }, { prepend: true });
  8010. store.subscribeAction(function (action, state) {
  8011. devtoolHook.emit('vuex:action', action, state);
  8012. }, { prepend: true });
  8013. }
  8014. /**
  8015. * Get the first item that pass the test
  8016. * by second argument function
  8017. *
  8018. * @param {Array} list
  8019. * @param {Function} f
  8020. * @return {*}
  8021. */
  8022. /**
  8023. * forEach for object
  8024. */
  8025. function forEachValue (obj, fn) {
  8026. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  8027. }
  8028. function isObject (obj) {
  8029. return obj !== null && typeof obj === 'object'
  8030. }
  8031. function isPromise (val) {
  8032. return val && typeof val.then === 'function'
  8033. }
  8034. function assert (condition, msg) {
  8035. if (!condition) { throw new Error(("[vuex] " + msg)) }
  8036. }
  8037. function partial (fn, arg) {
  8038. return function () {
  8039. return fn(arg)
  8040. }
  8041. }
  8042. // Base data struct for store's module, package with some attribute and method
  8043. var Module = function Module (rawModule, runtime) {
  8044. this.runtime = runtime;
  8045. // Store some children item
  8046. this._children = Object.create(null);
  8047. // Store the origin module object which passed by programmer
  8048. this._rawModule = rawModule;
  8049. var rawState = rawModule.state;
  8050. // Store the origin module's state
  8051. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  8052. };
  8053. var prototypeAccessors = { namespaced: { configurable: true } };
  8054. prototypeAccessors.namespaced.get = function () {
  8055. return !!this._rawModule.namespaced
  8056. };
  8057. Module.prototype.addChild = function addChild (key, module) {
  8058. this._children[key] = module;
  8059. };
  8060. Module.prototype.removeChild = function removeChild (key) {
  8061. delete this._children[key];
  8062. };
  8063. Module.prototype.getChild = function getChild (key) {
  8064. return this._children[key]
  8065. };
  8066. Module.prototype.hasChild = function hasChild (key) {
  8067. return key in this._children
  8068. };
  8069. Module.prototype.update = function update (rawModule) {
  8070. this._rawModule.namespaced = rawModule.namespaced;
  8071. if (rawModule.actions) {
  8072. this._rawModule.actions = rawModule.actions;
  8073. }
  8074. if (rawModule.mutations) {
  8075. this._rawModule.mutations = rawModule.mutations;
  8076. }
  8077. if (rawModule.getters) {
  8078. this._rawModule.getters = rawModule.getters;
  8079. }
  8080. };
  8081. Module.prototype.forEachChild = function forEachChild (fn) {
  8082. forEachValue(this._children, fn);
  8083. };
  8084. Module.prototype.forEachGetter = function forEachGetter (fn) {
  8085. if (this._rawModule.getters) {
  8086. forEachValue(this._rawModule.getters, fn);
  8087. }
  8088. };
  8089. Module.prototype.forEachAction = function forEachAction (fn) {
  8090. if (this._rawModule.actions) {
  8091. forEachValue(this._rawModule.actions, fn);
  8092. }
  8093. };
  8094. Module.prototype.forEachMutation = function forEachMutation (fn) {
  8095. if (this._rawModule.mutations) {
  8096. forEachValue(this._rawModule.mutations, fn);
  8097. }
  8098. };
  8099. Object.defineProperties( Module.prototype, prototypeAccessors );
  8100. var ModuleCollection = function ModuleCollection (rawRootModule) {
  8101. // register root module (Vuex.Store options)
  8102. this.register([], rawRootModule, false);
  8103. };
  8104. ModuleCollection.prototype.get = function get (path) {
  8105. return path.reduce(function (module, key) {
  8106. return module.getChild(key)
  8107. }, this.root)
  8108. };
  8109. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  8110. var module = this.root;
  8111. return path.reduce(function (namespace, key) {
  8112. module = module.getChild(key);
  8113. return namespace + (module.namespaced ? key + '/' : '')
  8114. }, '')
  8115. };
  8116. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  8117. update([], this.root, rawRootModule);
  8118. };
  8119. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  8120. var this$1 = this;
  8121. if ( runtime === void 0 ) runtime = true;
  8122. if ((true)) {
  8123. assertRawModule(path, rawModule);
  8124. }
  8125. var newModule = new Module(rawModule, runtime);
  8126. if (path.length === 0) {
  8127. this.root = newModule;
  8128. } else {
  8129. var parent = this.get(path.slice(0, -1));
  8130. parent.addChild(path[path.length - 1], newModule);
  8131. }
  8132. // register nested modules
  8133. if (rawModule.modules) {
  8134. forEachValue(rawModule.modules, function (rawChildModule, key) {
  8135. this$1.register(path.concat(key), rawChildModule, runtime);
  8136. });
  8137. }
  8138. };
  8139. ModuleCollection.prototype.unregister = function unregister (path) {
  8140. var parent = this.get(path.slice(0, -1));
  8141. var key = path[path.length - 1];
  8142. if (!parent.getChild(key).runtime) { return }
  8143. parent.removeChild(key);
  8144. };
  8145. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  8146. var parent = this.get(path.slice(0, -1));
  8147. var key = path[path.length - 1];
  8148. return parent.hasChild(key)
  8149. };
  8150. function update (path, targetModule, newModule) {
  8151. if ((true)) {
  8152. assertRawModule(path, newModule);
  8153. }
  8154. // update target module
  8155. targetModule.update(newModule);
  8156. // update nested modules
  8157. if (newModule.modules) {
  8158. for (var key in newModule.modules) {
  8159. if (!targetModule.getChild(key)) {
  8160. if ((true)) {
  8161. console.warn(
  8162. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  8163. 'manual reload is needed'
  8164. );
  8165. }
  8166. return
  8167. }
  8168. update(
  8169. path.concat(key),
  8170. targetModule.getChild(key),
  8171. newModule.modules[key]
  8172. );
  8173. }
  8174. }
  8175. }
  8176. var functionAssert = {
  8177. assert: function (value) { return typeof value === 'function'; },
  8178. expected: 'function'
  8179. };
  8180. var objectAssert = {
  8181. assert: function (value) { return typeof value === 'function' ||
  8182. (typeof value === 'object' && typeof value.handler === 'function'); },
  8183. expected: 'function or object with "handler" function'
  8184. };
  8185. var assertTypes = {
  8186. getters: functionAssert,
  8187. mutations: functionAssert,
  8188. actions: objectAssert
  8189. };
  8190. function assertRawModule (path, rawModule) {
  8191. Object.keys(assertTypes).forEach(function (key) {
  8192. if (!rawModule[key]) { return }
  8193. var assertOptions = assertTypes[key];
  8194. forEachValue(rawModule[key], function (value, type) {
  8195. assert(
  8196. assertOptions.assert(value),
  8197. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  8198. );
  8199. });
  8200. });
  8201. }
  8202. function makeAssertionMessage (path, key, type, value, expected) {
  8203. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  8204. if (path.length > 0) {
  8205. buf += " in module \"" + (path.join('.')) + "\"";
  8206. }
  8207. buf += " is " + (JSON.stringify(value)) + ".";
  8208. return buf
  8209. }
  8210. var Vue; // bind on install
  8211. var Store = function Store (options) {
  8212. var this$1 = this;
  8213. if ( options === void 0 ) options = {};
  8214. // Auto install if it is not done yet and `window` has `Vue`.
  8215. // To allow users to avoid auto-installation in some cases,
  8216. // this code should be placed here. See #731
  8217. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  8218. install(window.Vue);
  8219. }
  8220. if ((true)) {
  8221. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  8222. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  8223. assert(this instanceof Store, "store must be called with the new operator.");
  8224. }
  8225. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  8226. var strict = options.strict; if ( strict === void 0 ) strict = false;
  8227. // store internal state
  8228. this._committing = false;
  8229. this._actions = Object.create(null);
  8230. this._actionSubscribers = [];
  8231. this._mutations = Object.create(null);
  8232. this._wrappedGetters = Object.create(null);
  8233. this._modules = new ModuleCollection(options);
  8234. this._modulesNamespaceMap = Object.create(null);
  8235. this._subscribers = [];
  8236. this._watcherVM = new Vue();
  8237. this._makeLocalGettersCache = Object.create(null);
  8238. // bind commit and dispatch to self
  8239. var store = this;
  8240. var ref = this;
  8241. var dispatch = ref.dispatch;
  8242. var commit = ref.commit;
  8243. this.dispatch = function boundDispatch (type, payload) {
  8244. return dispatch.call(store, type, payload)
  8245. };
  8246. this.commit = function boundCommit (type, payload, options) {
  8247. return commit.call(store, type, payload, options)
  8248. };
  8249. // strict mode
  8250. this.strict = strict;
  8251. var state = this._modules.root.state;
  8252. // init root module.
  8253. // this also recursively registers all sub-modules
  8254. // and collects all module getters inside this._wrappedGetters
  8255. installModule(this, state, [], this._modules.root);
  8256. // initialize the store vm, which is responsible for the reactivity
  8257. // (also registers _wrappedGetters as computed properties)
  8258. resetStoreVM(this, state);
  8259. // apply plugins
  8260. plugins.forEach(function (plugin) { return plugin(this$1); });
  8261. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  8262. if (useDevtools) {
  8263. devtoolPlugin(this);
  8264. }
  8265. };
  8266. var prototypeAccessors$1 = { state: { configurable: true } };
  8267. prototypeAccessors$1.state.get = function () {
  8268. return this._vm._data.$$state
  8269. };
  8270. prototypeAccessors$1.state.set = function (v) {
  8271. if ((true)) {
  8272. assert(false, "use store.replaceState() to explicit replace store state.");
  8273. }
  8274. };
  8275. Store.prototype.commit = function commit (_type, _payload, _options) {
  8276. var this$1 = this;
  8277. // check object-style commit
  8278. var ref = unifyObjectStyle(_type, _payload, _options);
  8279. var type = ref.type;
  8280. var payload = ref.payload;
  8281. var options = ref.options;
  8282. var mutation = { type: type, payload: payload };
  8283. var entry = this._mutations[type];
  8284. if (!entry) {
  8285. if ((true)) {
  8286. console.error(("[vuex] unknown mutation type: " + type));
  8287. }
  8288. return
  8289. }
  8290. this._withCommit(function () {
  8291. entry.forEach(function commitIterator (handler) {
  8292. handler(payload);
  8293. });
  8294. });
  8295. this._subscribers
  8296. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8297. .forEach(function (sub) { return sub(mutation, this$1.state); });
  8298. if (
  8299. ( true) &&
  8300. options && options.silent
  8301. ) {
  8302. console.warn(
  8303. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  8304. 'Use the filter functionality in the vue-devtools'
  8305. );
  8306. }
  8307. };
  8308. Store.prototype.dispatch = function dispatch (_type, _payload) {
  8309. var this$1 = this;
  8310. // check object-style dispatch
  8311. var ref = unifyObjectStyle(_type, _payload);
  8312. var type = ref.type;
  8313. var payload = ref.payload;
  8314. var action = { type: type, payload: payload };
  8315. var entry = this._actions[type];
  8316. if (!entry) {
  8317. if ((true)) {
  8318. console.error(("[vuex] unknown action type: " + type));
  8319. }
  8320. return
  8321. }
  8322. try {
  8323. this._actionSubscribers
  8324. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8325. .filter(function (sub) { return sub.before; })
  8326. .forEach(function (sub) { return sub.before(action, this$1.state); });
  8327. } catch (e) {
  8328. if ((true)) {
  8329. console.warn("[vuex] error in before action subscribers: ");
  8330. console.error(e);
  8331. }
  8332. }
  8333. var result = entry.length > 1
  8334. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  8335. : entry[0](payload);
  8336. return new Promise(function (resolve, reject) {
  8337. result.then(function (res) {
  8338. try {
  8339. this$1._actionSubscribers
  8340. .filter(function (sub) { return sub.after; })
  8341. .forEach(function (sub) { return sub.after(action, this$1.state); });
  8342. } catch (e) {
  8343. if ((true)) {
  8344. console.warn("[vuex] error in after action subscribers: ");
  8345. console.error(e);
  8346. }
  8347. }
  8348. resolve(res);
  8349. }, function (error) {
  8350. try {
  8351. this$1._actionSubscribers
  8352. .filter(function (sub) { return sub.error; })
  8353. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  8354. } catch (e) {
  8355. if ((true)) {
  8356. console.warn("[vuex] error in error action subscribers: ");
  8357. console.error(e);
  8358. }
  8359. }
  8360. reject(error);
  8361. });
  8362. })
  8363. };
  8364. Store.prototype.subscribe = function subscribe (fn, options) {
  8365. return genericSubscribe(fn, this._subscribers, options)
  8366. };
  8367. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  8368. var subs = typeof fn === 'function' ? { before: fn } : fn;
  8369. return genericSubscribe(subs, this._actionSubscribers, options)
  8370. };
  8371. Store.prototype.watch = function watch (getter, cb, options) {
  8372. var this$1 = this;
  8373. if ((true)) {
  8374. assert(typeof getter === 'function', "store.watch only accepts a function.");
  8375. }
  8376. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  8377. };
  8378. Store.prototype.replaceState = function replaceState (state) {
  8379. var this$1 = this;
  8380. this._withCommit(function () {
  8381. this$1._vm._data.$$state = state;
  8382. });
  8383. };
  8384. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  8385. if ( options === void 0 ) options = {};
  8386. if (typeof path === 'string') { path = [path]; }
  8387. if ((true)) {
  8388. assert(Array.isArray(path), "module path must be a string or an Array.");
  8389. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  8390. }
  8391. this._modules.register(path, rawModule);
  8392. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  8393. // reset store to update getters...
  8394. resetStoreVM(this, this.state);
  8395. };
  8396. Store.prototype.unregisterModule = function unregisterModule (path) {
  8397. var this$1 = this;
  8398. if (typeof path === 'string') { path = [path]; }
  8399. if ((true)) {
  8400. assert(Array.isArray(path), "module path must be a string or an Array.");
  8401. }
  8402. this._modules.unregister(path);
  8403. this._withCommit(function () {
  8404. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  8405. Vue.delete(parentState, path[path.length - 1]);
  8406. });
  8407. resetStore(this);
  8408. };
  8409. Store.prototype.hasModule = function hasModule (path) {
  8410. if (typeof path === 'string') { path = [path]; }
  8411. if ((true)) {
  8412. assert(Array.isArray(path), "module path must be a string or an Array.");
  8413. }
  8414. return this._modules.isRegistered(path)
  8415. };
  8416. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  8417. this._modules.update(newOptions);
  8418. resetStore(this, true);
  8419. };
  8420. Store.prototype._withCommit = function _withCommit (fn) {
  8421. var committing = this._committing;
  8422. this._committing = true;
  8423. fn();
  8424. this._committing = committing;
  8425. };
  8426. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  8427. function genericSubscribe (fn, subs, options) {
  8428. if (subs.indexOf(fn) < 0) {
  8429. options && options.prepend
  8430. ? subs.unshift(fn)
  8431. : subs.push(fn);
  8432. }
  8433. return function () {
  8434. var i = subs.indexOf(fn);
  8435. if (i > -1) {
  8436. subs.splice(i, 1);
  8437. }
  8438. }
  8439. }
  8440. function resetStore (store, hot) {
  8441. store._actions = Object.create(null);
  8442. store._mutations = Object.create(null);
  8443. store._wrappedGetters = Object.create(null);
  8444. store._modulesNamespaceMap = Object.create(null);
  8445. var state = store.state;
  8446. // init all modules
  8447. installModule(store, state, [], store._modules.root, true);
  8448. // reset vm
  8449. resetStoreVM(store, state, hot);
  8450. }
  8451. function resetStoreVM (store, state, hot) {
  8452. var oldVm = store._vm;
  8453. // bind store public getters
  8454. store.getters = {};
  8455. // reset local getters cache
  8456. store._makeLocalGettersCache = Object.create(null);
  8457. var wrappedGetters = store._wrappedGetters;
  8458. var computed = {};
  8459. forEachValue(wrappedGetters, function (fn, key) {
  8460. // use computed to leverage its lazy-caching mechanism
  8461. // direct inline function use will lead to closure preserving oldVm.
  8462. // using partial to return function with only arguments preserved in closure environment.
  8463. computed[key] = partial(fn, store);
  8464. Object.defineProperty(store.getters, key, {
  8465. get: function () { return store._vm[key]; },
  8466. enumerable: true // for local getters
  8467. });
  8468. });
  8469. // use a Vue instance to store the state tree
  8470. // suppress warnings just in case the user has added
  8471. // some funky global mixins
  8472. var silent = Vue.config.silent;
  8473. Vue.config.silent = true;
  8474. store._vm = new Vue({
  8475. data: {
  8476. $$state: state
  8477. },
  8478. computed: computed
  8479. });
  8480. Vue.config.silent = silent;
  8481. // enable strict mode for new vm
  8482. if (store.strict) {
  8483. enableStrictMode(store);
  8484. }
  8485. if (oldVm) {
  8486. if (hot) {
  8487. // dispatch changes in all subscribed watchers
  8488. // to force getter re-evaluation for hot reloading.
  8489. store._withCommit(function () {
  8490. oldVm._data.$$state = null;
  8491. });
  8492. }
  8493. Vue.nextTick(function () { return oldVm.$destroy(); });
  8494. }
  8495. }
  8496. function installModule (store, rootState, path, module, hot) {
  8497. var isRoot = !path.length;
  8498. var namespace = store._modules.getNamespace(path);
  8499. // register in namespace map
  8500. if (module.namespaced) {
  8501. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  8502. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  8503. }
  8504. store._modulesNamespaceMap[namespace] = module;
  8505. }
  8506. // set state
  8507. if (!isRoot && !hot) {
  8508. var parentState = getNestedState(rootState, path.slice(0, -1));
  8509. var moduleName = path[path.length - 1];
  8510. store._withCommit(function () {
  8511. if ((true)) {
  8512. if (moduleName in parentState) {
  8513. console.warn(
  8514. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  8515. );
  8516. }
  8517. }
  8518. Vue.set(parentState, moduleName, module.state);
  8519. });
  8520. }
  8521. var local = module.context = makeLocalContext(store, namespace, path);
  8522. module.forEachMutation(function (mutation, key) {
  8523. var namespacedType = namespace + key;
  8524. registerMutation(store, namespacedType, mutation, local);
  8525. });
  8526. module.forEachAction(function (action, key) {
  8527. var type = action.root ? key : namespace + key;
  8528. var handler = action.handler || action;
  8529. registerAction(store, type, handler, local);
  8530. });
  8531. module.forEachGetter(function (getter, key) {
  8532. var namespacedType = namespace + key;
  8533. registerGetter(store, namespacedType, getter, local);
  8534. });
  8535. module.forEachChild(function (child, key) {
  8536. installModule(store, rootState, path.concat(key), child, hot);
  8537. });
  8538. }
  8539. /**
  8540. * make localized dispatch, commit, getters and state
  8541. * if there is no namespace, just use root ones
  8542. */
  8543. function makeLocalContext (store, namespace, path) {
  8544. var noNamespace = namespace === '';
  8545. var local = {
  8546. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  8547. var args = unifyObjectStyle(_type, _payload, _options);
  8548. var payload = args.payload;
  8549. var options = args.options;
  8550. var type = args.type;
  8551. if (!options || !options.root) {
  8552. type = namespace + type;
  8553. if (( true) && !store._actions[type]) {
  8554. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  8555. return
  8556. }
  8557. }
  8558. return store.dispatch(type, payload)
  8559. },
  8560. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  8561. var args = unifyObjectStyle(_type, _payload, _options);
  8562. var payload = args.payload;
  8563. var options = args.options;
  8564. var type = args.type;
  8565. if (!options || !options.root) {
  8566. type = namespace + type;
  8567. if (( true) && !store._mutations[type]) {
  8568. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  8569. return
  8570. }
  8571. }
  8572. store.commit(type, payload, options);
  8573. }
  8574. };
  8575. // getters and state object must be gotten lazily
  8576. // because they will be changed by vm update
  8577. Object.defineProperties(local, {
  8578. getters: {
  8579. get: noNamespace
  8580. ? function () { return store.getters; }
  8581. : function () { return makeLocalGetters(store, namespace); }
  8582. },
  8583. state: {
  8584. get: function () { return getNestedState(store.state, path); }
  8585. }
  8586. });
  8587. return local
  8588. }
  8589. function makeLocalGetters (store, namespace) {
  8590. if (!store._makeLocalGettersCache[namespace]) {
  8591. var gettersProxy = {};
  8592. var splitPos = namespace.length;
  8593. Object.keys(store.getters).forEach(function (type) {
  8594. // skip if the target getter is not match this namespace
  8595. if (type.slice(0, splitPos) !== namespace) { return }
  8596. // extract local getter type
  8597. var localType = type.slice(splitPos);
  8598. // Add a port to the getters proxy.
  8599. // Define as getter property because
  8600. // we do not want to evaluate the getters in this time.
  8601. Object.defineProperty(gettersProxy, localType, {
  8602. get: function () { return store.getters[type]; },
  8603. enumerable: true
  8604. });
  8605. });
  8606. store._makeLocalGettersCache[namespace] = gettersProxy;
  8607. }
  8608. return store._makeLocalGettersCache[namespace]
  8609. }
  8610. function registerMutation (store, type, handler, local) {
  8611. var entry = store._mutations[type] || (store._mutations[type] = []);
  8612. entry.push(function wrappedMutationHandler (payload) {
  8613. handler.call(store, local.state, payload);
  8614. });
  8615. }
  8616. function registerAction (store, type, handler, local) {
  8617. var entry = store._actions[type] || (store._actions[type] = []);
  8618. entry.push(function wrappedActionHandler (payload) {
  8619. var res = handler.call(store, {
  8620. dispatch: local.dispatch,
  8621. commit: local.commit,
  8622. getters: local.getters,
  8623. state: local.state,
  8624. rootGetters: store.getters,
  8625. rootState: store.state
  8626. }, payload);
  8627. if (!isPromise(res)) {
  8628. res = Promise.resolve(res);
  8629. }
  8630. if (store._devtoolHook) {
  8631. return res.catch(function (err) {
  8632. store._devtoolHook.emit('vuex:error', err);
  8633. throw err
  8634. })
  8635. } else {
  8636. return res
  8637. }
  8638. });
  8639. }
  8640. function registerGetter (store, type, rawGetter, local) {
  8641. if (store._wrappedGetters[type]) {
  8642. if ((true)) {
  8643. console.error(("[vuex] duplicate getter key: " + type));
  8644. }
  8645. return
  8646. }
  8647. store._wrappedGetters[type] = function wrappedGetter (store) {
  8648. return rawGetter(
  8649. local.state, // local state
  8650. local.getters, // local getters
  8651. store.state, // root state
  8652. store.getters // root getters
  8653. )
  8654. };
  8655. }
  8656. function enableStrictMode (store) {
  8657. store._vm.$watch(function () { return this._data.$$state }, function () {
  8658. if ((true)) {
  8659. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  8660. }
  8661. }, { deep: true, sync: true });
  8662. }
  8663. function getNestedState (state, path) {
  8664. return path.reduce(function (state, key) { return state[key]; }, state)
  8665. }
  8666. function unifyObjectStyle (type, payload, options) {
  8667. if (isObject(type) && type.type) {
  8668. options = payload;
  8669. payload = type;
  8670. type = type.type;
  8671. }
  8672. if ((true)) {
  8673. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  8674. }
  8675. return { type: type, payload: payload, options: options }
  8676. }
  8677. function install (_Vue) {
  8678. if (Vue && _Vue === Vue) {
  8679. if ((true)) {
  8680. console.error(
  8681. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  8682. );
  8683. }
  8684. return
  8685. }
  8686. Vue = _Vue;
  8687. applyMixin(Vue);
  8688. }
  8689. /**
  8690. * Reduce the code which written in Vue.js for getting the state.
  8691. * @param {String} [namespace] - Module's namespace
  8692. * @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.
  8693. * @param {Object}
  8694. */
  8695. var mapState = normalizeNamespace(function (namespace, states) {
  8696. var res = {};
  8697. if (( true) && !isValidMap(states)) {
  8698. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  8699. }
  8700. normalizeMap(states).forEach(function (ref) {
  8701. var key = ref.key;
  8702. var val = ref.val;
  8703. res[key] = function mappedState () {
  8704. var state = this.$store.state;
  8705. var getters = this.$store.getters;
  8706. if (namespace) {
  8707. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  8708. if (!module) {
  8709. return
  8710. }
  8711. state = module.context.state;
  8712. getters = module.context.getters;
  8713. }
  8714. return typeof val === 'function'
  8715. ? val.call(this, state, getters)
  8716. : state[val]
  8717. };
  8718. // mark vuex getter for devtools
  8719. res[key].vuex = true;
  8720. });
  8721. return res
  8722. });
  8723. /**
  8724. * Reduce the code which written in Vue.js for committing the mutation
  8725. * @param {String} [namespace] - Module's namespace
  8726. * @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.
  8727. * @return {Object}
  8728. */
  8729. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  8730. var res = {};
  8731. if (( true) && !isValidMap(mutations)) {
  8732. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  8733. }
  8734. normalizeMap(mutations).forEach(function (ref) {
  8735. var key = ref.key;
  8736. var val = ref.val;
  8737. res[key] = function mappedMutation () {
  8738. var args = [], len = arguments.length;
  8739. while ( len-- ) args[ len ] = arguments[ len ];
  8740. // Get the commit method from store
  8741. var commit = this.$store.commit;
  8742. if (namespace) {
  8743. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  8744. if (!module) {
  8745. return
  8746. }
  8747. commit = module.context.commit;
  8748. }
  8749. return typeof val === 'function'
  8750. ? val.apply(this, [commit].concat(args))
  8751. : commit.apply(this.$store, [val].concat(args))
  8752. };
  8753. });
  8754. return res
  8755. });
  8756. /**
  8757. * Reduce the code which written in Vue.js for getting the getters
  8758. * @param {String} [namespace] - Module's namespace
  8759. * @param {Object|Array} getters
  8760. * @return {Object}
  8761. */
  8762. var mapGetters = normalizeNamespace(function (namespace, getters) {
  8763. var res = {};
  8764. if (( true) && !isValidMap(getters)) {
  8765. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  8766. }
  8767. normalizeMap(getters).forEach(function (ref) {
  8768. var key = ref.key;
  8769. var val = ref.val;
  8770. // The namespace has been mutated by normalizeNamespace
  8771. val = namespace + val;
  8772. res[key] = function mappedGetter () {
  8773. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  8774. return
  8775. }
  8776. if (( true) && !(val in this.$store.getters)) {
  8777. console.error(("[vuex] unknown getter: " + val));
  8778. return
  8779. }
  8780. return this.$store.getters[val]
  8781. };
  8782. // mark vuex getter for devtools
  8783. res[key].vuex = true;
  8784. });
  8785. return res
  8786. });
  8787. /**
  8788. * Reduce the code which written in Vue.js for dispatch the action
  8789. * @param {String} [namespace] - Module's namespace
  8790. * @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.
  8791. * @return {Object}
  8792. */
  8793. var mapActions = normalizeNamespace(function (namespace, actions) {
  8794. var res = {};
  8795. if (( true) && !isValidMap(actions)) {
  8796. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  8797. }
  8798. normalizeMap(actions).forEach(function (ref) {
  8799. var key = ref.key;
  8800. var val = ref.val;
  8801. res[key] = function mappedAction () {
  8802. var args = [], len = arguments.length;
  8803. while ( len-- ) args[ len ] = arguments[ len ];
  8804. // get dispatch function from store
  8805. var dispatch = this.$store.dispatch;
  8806. if (namespace) {
  8807. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  8808. if (!module) {
  8809. return
  8810. }
  8811. dispatch = module.context.dispatch;
  8812. }
  8813. return typeof val === 'function'
  8814. ? val.apply(this, [dispatch].concat(args))
  8815. : dispatch.apply(this.$store, [val].concat(args))
  8816. };
  8817. });
  8818. return res
  8819. });
  8820. /**
  8821. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  8822. * @param {String} namespace
  8823. * @return {Object}
  8824. */
  8825. var createNamespacedHelpers = function (namespace) { return ({
  8826. mapState: mapState.bind(null, namespace),
  8827. mapGetters: mapGetters.bind(null, namespace),
  8828. mapMutations: mapMutations.bind(null, namespace),
  8829. mapActions: mapActions.bind(null, namespace)
  8830. }); };
  8831. /**
  8832. * Normalize the map
  8833. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  8834. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  8835. * @param {Array|Object} map
  8836. * @return {Object}
  8837. */
  8838. function normalizeMap (map) {
  8839. if (!isValidMap(map)) {
  8840. return []
  8841. }
  8842. return Array.isArray(map)
  8843. ? map.map(function (key) { return ({ key: key, val: key }); })
  8844. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  8845. }
  8846. /**
  8847. * Validate whether given map is valid or not
  8848. * @param {*} map
  8849. * @return {Boolean}
  8850. */
  8851. function isValidMap (map) {
  8852. return Array.isArray(map) || isObject(map)
  8853. }
  8854. /**
  8855. * 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.
  8856. * @param {Function} fn
  8857. * @return {Function}
  8858. */
  8859. function normalizeNamespace (fn) {
  8860. return function (namespace, map) {
  8861. if (typeof namespace !== 'string') {
  8862. map = namespace;
  8863. namespace = '';
  8864. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  8865. namespace += '/';
  8866. }
  8867. return fn(namespace, map)
  8868. }
  8869. }
  8870. /**
  8871. * Search a special module from store by namespace. if module not exist, print error message.
  8872. * @param {Object} store
  8873. * @param {String} helper
  8874. * @param {String} namespace
  8875. * @return {Object}
  8876. */
  8877. function getModuleByNamespace (store, helper, namespace) {
  8878. var module = store._modulesNamespaceMap[namespace];
  8879. if (( true) && !module) {
  8880. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  8881. }
  8882. return module
  8883. }
  8884. var index = {
  8885. Store: Store,
  8886. install: install,
  8887. version: '3.4.0',
  8888. mapState: mapState,
  8889. mapMutations: mapMutations,
  8890. mapGetters: mapGetters,
  8891. mapActions: mapActions,
  8892. createNamespacedHelpers: createNamespacedHelpers
  8893. };
  8894. /* harmony default export */ __webpack_exports__["default"] = (index);
  8895. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  8896. /***/ }),
  8897. /* 17 */
  8898. /*!**************************************************************************!*\
  8899. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/index.js ***!
  8900. \**************************************************************************/
  8901. /*! no static exports found */
  8902. /***/ (function(module, exports, __webpack_require__) {
  8903. "use strict";
  8904. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _Request = _interopRequireDefault(__webpack_require__(/*! ./core/Request */ 18));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  8905. _Request.default;exports.default = _default;
  8906. /***/ }),
  8907. /* 18 */
  8908. /*!*********************************************************************************!*\
  8909. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/Request.js ***!
  8910. \*********************************************************************************/
  8911. /*! no static exports found */
  8912. /***/ (function(module, exports, __webpack_require__) {
  8913. "use strict";
  8914. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  8915. var _dispatchRequest = _interopRequireDefault(__webpack_require__(/*! ./dispatchRequest */ 19));
  8916. var _InterceptorManager = _interopRequireDefault(__webpack_require__(/*! ./InterceptorManager */ 27));
  8917. var _mergeConfig = _interopRequireDefault(__webpack_require__(/*! ./mergeConfig */ 28));
  8918. var _defaults = _interopRequireDefault(__webpack_require__(/*! ./defaults */ 29));
  8919. var _utils = __webpack_require__(/*! ../utils */ 22);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 _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 _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;}var
  8920. Request = /*#__PURE__*/function () {
  8921. /**
  8922. * @param {Object} arg - 全局配置
  8923. * @param {String} arg.baseURL - 全局根路径
  8924. * @param {Object} arg.header - 全局header
  8925. * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
  8926. * @param {String} arg.dataType = [json] - 全局默认的dataType
  8927. * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。App和支付宝小程序不支持
  8928. * @param {Object} arg.custom - 全局默认的自定义参数
  8929. * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认30000。仅微信小程序(2.10.0)、支付宝小程序支持
  8930. * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
  8931. * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
  8932. * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
  8933. * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
  8934. */
  8935. function Request() {var arg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, Request);
  8936. if (!(0, _utils.isPlainObject)(arg)) {
  8937. arg = {};
  8938. console.warn('设置全局参数必须接收一个Object');
  8939. }
  8940. this.config = _objectSpread(_objectSpread({}, _defaults.default), arg);
  8941. this.interceptors = {
  8942. request: new _InterceptorManager.default(),
  8943. response: new _InterceptorManager.default() };
  8944. }
  8945. /**
  8946. * @Function
  8947. * @param {Request~setConfigCallback} f - 设置全局默认配置
  8948. */_createClass(Request, [{ key: "setConfig", value: function setConfig(
  8949. f) {
  8950. this.config = f(this.config);
  8951. } }, { key: "middleware", value: function middleware(
  8952. config) {
  8953. config = (0, _mergeConfig.default)(this.config, config);
  8954. var chain = [_dispatchRequest.default, undefined];
  8955. var promise = Promise.resolve(config);
  8956. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  8957. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  8958. });
  8959. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  8960. chain.push(interceptor.fulfilled, interceptor.rejected);
  8961. });
  8962. while (chain.length) {
  8963. promise = promise.then(chain.shift(), chain.shift());
  8964. }
  8965. return promise;
  8966. }
  8967. /**
  8968. * @Function
  8969. * @param {Object} config - 请求配置项
  8970. * @prop {String} options.url - 请求路径
  8971. * @prop {Object} options.data - 请求参数
  8972. * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
  8973. * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
  8974. * @prop {Object} [options.header = config.header] - 请求header
  8975. * @prop {Object} [options.method = config.method] - 请求方法
  8976. * @returns {Promise<unknown>}
  8977. */ }, { key: "request", value: function request()
  8978. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8979. return this.middleware(config);
  8980. } }, { key: "get", value: function get(
  8981. url) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8982. return this.middleware(_objectSpread({
  8983. url: url,
  8984. method: 'GET' },
  8985. options));
  8986. } }, { key: "post", value: function post(
  8987. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8988. return this.middleware(_objectSpread({
  8989. url: url,
  8990. data: data,
  8991. method: 'POST' },
  8992. options));
  8993. } }, { key: "put", value: function put(
  8994. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8995. return this.middleware(_objectSpread({
  8996. url: url,
  8997. data: data,
  8998. method: 'PUT' },
  8999. options));
  9000. } }, { key: "delete", value: function _delete(
  9001. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9002. return this.middleware(_objectSpread({
  9003. url: url,
  9004. data: data,
  9005. method: 'DELETE' },
  9006. options));
  9007. } }, { key: "connect", value: function connect(
  9008. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9009. return this.middleware(_objectSpread({
  9010. url: url,
  9011. data: data,
  9012. method: 'CONNECT' },
  9013. options));
  9014. } }, { key: "head", value: function head(
  9015. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9016. return this.middleware(_objectSpread({
  9017. url: url,
  9018. data: data,
  9019. method: 'HEAD' },
  9020. options));
  9021. } }, { key: "options", value: function options(
  9022. url, data) {var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9023. return this.middleware(_objectSpread({
  9024. url: url,
  9025. data: data,
  9026. method: 'OPTIONS' },
  9027. _options));
  9028. } }, { key: "trace", value: function trace(
  9029. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9030. return this.middleware(_objectSpread({
  9031. url: url,
  9032. data: data,
  9033. method: 'TRACE' },
  9034. options));
  9035. } }, { key: "upload", value: function upload(
  9036. url) {var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9037. config.url = url;
  9038. config.method = 'UPLOAD';
  9039. return this.middleware(config);
  9040. } }, { key: "download", value: function download(
  9041. url) {var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9042. config.url = url;
  9043. config.method = 'DOWNLOAD';
  9044. return this.middleware(config);
  9045. } }]);return Request;}();
  9046. /**
  9047. * setConfig回调
  9048. * @return {Object} - 返回操作后的config
  9049. * @callback Request~setConfigCallback
  9050. * @param {Object} config - 全局默认config
  9051. */exports.default = Request;
  9052. /***/ }),
  9053. /* 19 */
  9054. /*!*****************************************************************************************!*\
  9055. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/dispatchRequest.js ***!
  9056. \*****************************************************************************************/
  9057. /*! no static exports found */
  9058. /***/ (function(module, exports, __webpack_require__) {
  9059. "use strict";
  9060. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _index = _interopRequireDefault(__webpack_require__(/*! ../adapters/index */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  9061. function _default(config) {
  9062. return (0, _index.default)(config);
  9063. };exports.default = _default;
  9064. /***/ }),
  9065. /* 20 */
  9066. /*!***********************************************************************************!*\
  9067. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/adapters/index.js ***!
  9068. \***********************************************************************************/
  9069. /*! no static exports found */
  9070. /***/ (function(module, exports, __webpack_require__) {
  9071. "use strict";
  9072. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _buildURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/buildURL */ 21));
  9073. var _buildFullPath = _interopRequireDefault(__webpack_require__(/*! ../core/buildFullPath */ 23));
  9074. var _settle = _interopRequireDefault(__webpack_require__(/*! ../core/settle */ 26));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 _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;}
  9075. /**
  9076. * 返回可选值存在的配置
  9077. * @param {Array} keys - 可选值数组
  9078. * @param {Object} config2 - 配置
  9079. * @return {{}} - 存在的配置项
  9080. */
  9081. var mergeKeys = function mergeKeys(keys, config2) {
  9082. var config = {};
  9083. keys.forEach(function (prop) {
  9084. if (typeof config2[prop] !== 'undefined') {
  9085. config[prop] = config2[prop];
  9086. }
  9087. });
  9088. return config;
  9089. };var _default =
  9090. function _default(config) {
  9091. return new Promise(function (resolve, reject) {
  9092. var _config = {
  9093. url: (0, _buildURL.default)((0, _buildFullPath.default)(config.baseURL, config.url), config.params),
  9094. header: config.header,
  9095. complete: function complete(response) {
  9096. response.config = config;
  9097. try {
  9098. // 对可能字符串不是json 的情况容错
  9099. if (typeof response.data === 'string') {
  9100. response.data = JSON.parse(response.data);
  9101. }
  9102. // eslint-disable-next-line no-empty
  9103. } catch (e) {
  9104. }
  9105. (0, _settle.default)(resolve, reject, response);
  9106. } };
  9107. var requestTask;
  9108. if (config.method === 'UPLOAD') {
  9109. delete _config.header['content-type'];
  9110. delete _config.header['Content-Type'];
  9111. var otherConfig = {
  9112. filePath: config.filePath,
  9113. name: config.name };
  9114. var optionalKeys = [
  9115. 'formData'];
  9116. requestTask = uni.uploadFile(_objectSpread(_objectSpread(_objectSpread({}, _config), otherConfig), mergeKeys(optionalKeys, config)));
  9117. } else if (config.method === 'DOWNLOAD') {
  9118. requestTask = uni.downloadFile(_config);
  9119. } else {
  9120. var _optionalKeys = [
  9121. 'data',
  9122. 'method',
  9123. 'timeout',
  9124. 'dataType',
  9125. 'responseType'];
  9126. requestTask = uni.request(_objectSpread(_objectSpread({}, _config), mergeKeys(_optionalKeys, config)));
  9127. }
  9128. if (config.getTask) {
  9129. config.getTask(requestTask, config);
  9130. }
  9131. });
  9132. };exports.default = _default;
  9133. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9134. /***/ }),
  9135. /* 21 */
  9136. /*!*************************************************************************************!*\
  9137. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/helpers/buildURL.js ***!
  9138. \*************************************************************************************/
  9139. /*! no static exports found */
  9140. /***/ (function(module, exports, __webpack_require__) {
  9141. "use strict";
  9142. Object.defineProperty(exports, "__esModule", { value: true });exports.default = buildURL;
  9143. var utils = _interopRequireWildcard(__webpack_require__(/*! ./../utils */ 22));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  9144. function encode(val) {
  9145. return encodeURIComponent(val).
  9146. replace(/%40/gi, '@').
  9147. replace(/%3A/gi, ':').
  9148. replace(/%24/g, '$').
  9149. replace(/%2C/gi, ',').
  9150. replace(/%20/g, '+').
  9151. replace(/%5B/gi, '[').
  9152. replace(/%5D/gi, ']');
  9153. }
  9154. /**
  9155. * Build a URL by appending params to the end
  9156. *
  9157. * @param {string} url The base of the url (e.g., http://www.google.com)
  9158. * @param {object} [params] The params to be appended
  9159. * @returns {string} The formatted url
  9160. */
  9161. function buildURL(url, params) {
  9162. /*eslint no-param-reassign:0*/
  9163. if (!params) {
  9164. return url;
  9165. }
  9166. var serializedParams;
  9167. if (utils.isURLSearchParams(params)) {
  9168. serializedParams = params.toString();
  9169. } else {
  9170. var parts = [];
  9171. utils.forEach(params, function serialize(val, key) {
  9172. if (val === null || typeof val === 'undefined') {
  9173. return;
  9174. }
  9175. if (utils.isArray(val)) {
  9176. key = key + '[]';
  9177. } else {
  9178. val = [val];
  9179. }
  9180. utils.forEach(val, function parseValue(v) {
  9181. if (utils.isDate(v)) {
  9182. v = v.toISOString();
  9183. } else if (utils.isObject(v)) {
  9184. v = JSON.stringify(v);
  9185. }
  9186. parts.push(encode(key) + '=' + encode(v));
  9187. });
  9188. });
  9189. serializedParams = parts.join('&');
  9190. }
  9191. if (serializedParams) {
  9192. var hashmarkIndex = url.indexOf('#');
  9193. if (hashmarkIndex !== -1) {
  9194. url = url.slice(0, hashmarkIndex);
  9195. }
  9196. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  9197. }
  9198. return url;
  9199. }
  9200. /***/ }),
  9201. /* 22 */
  9202. /*!**************************************************************************!*\
  9203. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/utils.js ***!
  9204. \**************************************************************************/
  9205. /*! no static exports found */
  9206. /***/ (function(module, exports, __webpack_require__) {
  9207. "use strict";
  9208. // utils is a library of generic helper functions non-specific to axios
  9209. Object.defineProperty(exports, "__esModule", { value: true });exports.isArray = isArray;exports.isObject = isObject;exports.isDate = isDate;exports.isURLSearchParams = isURLSearchParams;exports.forEach = forEach;exports.isBoolean = isBoolean;exports.isPlainObject = isPlainObject;exports.deepMerge = deepMerge;
  9210. var toString = Object.prototype.toString;
  9211. /**
  9212. * Determine if a value is an Array
  9213. *
  9214. * @param {Object} val The value to test
  9215. * @returns {boolean} True if value is an Array, otherwise false
  9216. */
  9217. function isArray(val) {
  9218. return toString.call(val) === '[object Array]';
  9219. }
  9220. /**
  9221. * Determine if a value is an Object
  9222. *
  9223. * @param {Object} val The value to test
  9224. * @returns {boolean} True if value is an Object, otherwise false
  9225. */
  9226. function isObject(val) {
  9227. return val !== null && typeof val === 'object';
  9228. }
  9229. /**
  9230. * Determine if a value is a Date
  9231. *
  9232. * @param {Object} val The value to test
  9233. * @returns {boolean} True if value is a Date, otherwise false
  9234. */
  9235. function isDate(val) {
  9236. return toString.call(val) === '[object Date]';
  9237. }
  9238. /**
  9239. * Determine if a value is a URLSearchParams object
  9240. *
  9241. * @param {Object} val The value to test
  9242. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  9243. */
  9244. function isURLSearchParams(val) {
  9245. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  9246. }
  9247. /**
  9248. * Iterate over an Array or an Object invoking a function for each item.
  9249. *
  9250. * If `obj` is an Array callback will be called passing
  9251. * the value, index, and complete array for each item.
  9252. *
  9253. * If 'obj' is an Object callback will be called passing
  9254. * the value, key, and complete object for each property.
  9255. *
  9256. * @param {Object|Array} obj The object to iterate
  9257. * @param {Function} fn The callback to invoke for each item
  9258. */
  9259. function forEach(obj, fn) {
  9260. // Don't bother if no value provided
  9261. if (obj === null || typeof obj === 'undefined') {
  9262. return;
  9263. }
  9264. // Force an array if not already something iterable
  9265. if (typeof obj !== 'object') {
  9266. /*eslint no-param-reassign:0*/
  9267. obj = [obj];
  9268. }
  9269. if (isArray(obj)) {
  9270. // Iterate over array values
  9271. for (var i = 0, l = obj.length; i < l; i++) {
  9272. fn.call(null, obj[i], i, obj);
  9273. }
  9274. } else {
  9275. // Iterate over object keys
  9276. for (var key in obj) {
  9277. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  9278. fn.call(null, obj[key], key, obj);
  9279. }
  9280. }
  9281. }
  9282. }
  9283. /**
  9284. * 是否为boolean 值
  9285. * @param val
  9286. * @returns {boolean}
  9287. */
  9288. function isBoolean(val) {
  9289. return typeof val === 'boolean';
  9290. }
  9291. /**
  9292. * 是否为真正的对象{} new Object
  9293. * @param {any} obj - 检测的对象
  9294. * @returns {boolean}
  9295. */
  9296. function isPlainObject(obj) {
  9297. return Object.prototype.toString.call(obj) === '[object Object]';
  9298. }
  9299. /**
  9300. * Function equal to merge with the difference being that no reference
  9301. * to original objects is kept.
  9302. *
  9303. * @see merge
  9304. * @param {Object} obj1 Object to merge
  9305. * @returns {Object} Result of all merge properties
  9306. */
  9307. function deepMerge() /* obj1, obj2, obj3, ... */{
  9308. var result = {};
  9309. function assignValue(val, key) {
  9310. if (typeof result[key] === 'object' && typeof val === 'object') {
  9311. result[key] = deepMerge(result[key], val);
  9312. } else if (typeof val === 'object') {
  9313. result[key] = deepMerge({}, val);
  9314. } else {
  9315. result[key] = val;
  9316. }
  9317. }
  9318. for (var i = 0, l = arguments.length; i < l; i++) {
  9319. forEach(arguments[i], assignValue);
  9320. }
  9321. return result;
  9322. }
  9323. /***/ }),
  9324. /* 23 */
  9325. /*!***************************************************************************************!*\
  9326. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/buildFullPath.js ***!
  9327. \***************************************************************************************/
  9328. /*! no static exports found */
  9329. /***/ (function(module, exports, __webpack_require__) {
  9330. "use strict";
  9331. Object.defineProperty(exports, "__esModule", { value: true });exports.default = buildFullPath;
  9332. var _isAbsoluteURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/isAbsoluteURL */ 24));
  9333. var _combineURLs = _interopRequireDefault(__webpack_require__(/*! ../helpers/combineURLs */ 25));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9334. /**
  9335. * Creates a new URL by combining the baseURL with the requestedURL,
  9336. * only when the requestedURL is not already an absolute URL.
  9337. * If the requestURL is absolute, this function returns the requestedURL untouched.
  9338. *
  9339. * @param {string} baseURL The base URL
  9340. * @param {string} requestedURL Absolute or relative URL to combine
  9341. * @returns {string} The combined full path
  9342. */
  9343. function buildFullPath(baseURL, requestedURL) {
  9344. if (baseURL && !(0, _isAbsoluteURL.default)(requestedURL)) {
  9345. return (0, _combineURLs.default)(baseURL, requestedURL);
  9346. }
  9347. return requestedURL;
  9348. }
  9349. /***/ }),
  9350. /* 24 */
  9351. /*!******************************************************************************************!*\
  9352. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/helpers/isAbsoluteURL.js ***!
  9353. \******************************************************************************************/
  9354. /*! no static exports found */
  9355. /***/ (function(module, exports, __webpack_require__) {
  9356. "use strict";
  9357. /**
  9358. * Determines whether the specified URL is absolute
  9359. *
  9360. * @param {string} url The URL to test
  9361. * @returns {boolean} True if the specified URL is absolute, otherwise false
  9362. */Object.defineProperty(exports, "__esModule", { value: true });exports.default = isAbsoluteURL;
  9363. function isAbsoluteURL(url) {
  9364. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  9365. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  9366. // by any combination of letters, digits, plus, period, or hyphen.
  9367. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  9368. }
  9369. /***/ }),
  9370. /* 25 */
  9371. /*!****************************************************************************************!*\
  9372. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/helpers/combineURLs.js ***!
  9373. \****************************************************************************************/
  9374. /*! no static exports found */
  9375. /***/ (function(module, exports, __webpack_require__) {
  9376. "use strict";
  9377. /**
  9378. * Creates a new URL by combining the specified URLs
  9379. *
  9380. * @param {string} baseURL The base URL
  9381. * @param {string} relativeURL The relative URL
  9382. * @returns {string} The combined URL
  9383. */Object.defineProperty(exports, "__esModule", { value: true });exports.default = combineURLs;
  9384. function combineURLs(baseURL, relativeURL) {
  9385. return relativeURL ?
  9386. baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') :
  9387. baseURL;
  9388. }
  9389. /***/ }),
  9390. /* 26 */
  9391. /*!********************************************************************************!*\
  9392. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/settle.js ***!
  9393. \********************************************************************************/
  9394. /*! no static exports found */
  9395. /***/ (function(module, exports, __webpack_require__) {
  9396. "use strict";
  9397. Object.defineProperty(exports, "__esModule", { value: true });exports.default = settle; /**
  9398. * Resolve or reject a Promise based on response status.
  9399. *
  9400. * @param {Function} resolve A function that resolves the promise.
  9401. * @param {Function} reject A function that rejects the promise.
  9402. * @param {object} response The response.
  9403. */
  9404. function settle(resolve, reject, response) {
  9405. var validateStatus = response.config.validateStatus;
  9406. var status = response.statusCode;
  9407. if (status && (!validateStatus || validateStatus(status))) {
  9408. resolve(response);
  9409. } else {
  9410. reject(response);
  9411. }
  9412. }
  9413. /***/ }),
  9414. /* 27 */
  9415. /*!********************************************************************************************!*\
  9416. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/InterceptorManager.js ***!
  9417. \********************************************************************************************/
  9418. /*! no static exports found */
  9419. /***/ (function(module, exports, __webpack_require__) {
  9420. "use strict";
  9421. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  9422. function InterceptorManager() {
  9423. this.handlers = [];
  9424. }
  9425. /**
  9426. * Add a new interceptor to the stack
  9427. *
  9428. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  9429. * @param {Function} rejected The function to handle `reject` for a `Promise`
  9430. *
  9431. * @return {Number} An ID used to remove interceptor later
  9432. */
  9433. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  9434. this.handlers.push({
  9435. fulfilled: fulfilled,
  9436. rejected: rejected });
  9437. return this.handlers.length - 1;
  9438. };
  9439. /**
  9440. * Remove an interceptor from the stack
  9441. *
  9442. * @param {Number} id The ID that was returned by `use`
  9443. */
  9444. InterceptorManager.prototype.eject = function eject(id) {
  9445. if (this.handlers[id]) {
  9446. this.handlers[id] = null;
  9447. }
  9448. };
  9449. /**
  9450. * Iterate over all the registered interceptors
  9451. *
  9452. * This method is particularly useful for skipping over any
  9453. * interceptors that may have become `null` calling `eject`.
  9454. *
  9455. * @param {Function} fn The function to call for each interceptor
  9456. */
  9457. InterceptorManager.prototype.forEach = function forEach(fn) {
  9458. this.handlers.forEach(function (h) {
  9459. if (h !== null) {
  9460. fn(h);
  9461. }
  9462. });
  9463. };var _default =
  9464. InterceptorManager;exports.default = _default;
  9465. /***/ }),
  9466. /* 28 */
  9467. /*!*************************************************************************************!*\
  9468. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/mergeConfig.js ***!
  9469. \*************************************************************************************/
  9470. /*! no static exports found */
  9471. /***/ (function(module, exports, __webpack_require__) {
  9472. "use strict";
  9473. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _utils = __webpack_require__(/*! ../utils */ 22);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 _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;}
  9474. /**
  9475. * 合并局部配置优先的配置,如果局部有该配置项则用局部,如果全局有该配置项则用全局
  9476. * @param {Array} keys - 配置项
  9477. * @param {Object} globalsConfig - 当前的全局配置
  9478. * @param {Object} config2 - 局部配置
  9479. * @return {{}}
  9480. */
  9481. var mergeKeys = function mergeKeys(keys, globalsConfig, config2) {
  9482. var config = {};
  9483. keys.forEach(function (prop) {
  9484. if (typeof config2[prop] !== 'undefined') {
  9485. config[prop] = config2[prop];
  9486. } else if (typeof globalsConfig[prop] !== 'undefined') {
  9487. config[prop] = globalsConfig[prop];
  9488. }
  9489. });
  9490. return config;
  9491. };
  9492. /**
  9493. *
  9494. * @param globalsConfig - 当前实例的全局配置
  9495. * @param config2 - 当前的局部配置
  9496. * @return - 合并后的配置
  9497. */var _default =
  9498. function _default(globalsConfig) {var config2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9499. var method = config2.method || globalsConfig.method || 'GET';
  9500. var config = {
  9501. baseURL: globalsConfig.baseURL || '',
  9502. method: method,
  9503. url: config2.url || '',
  9504. params: config2.params || {},
  9505. custom: _objectSpread(_objectSpread({}, globalsConfig.custom || {}), config2.custom || {}),
  9506. header: (0, _utils.deepMerge)(globalsConfig.header || {}, config2.header || {}) };
  9507. var defaultToConfig2Keys = ['getTask', 'validateStatus'];
  9508. config = _objectSpread(_objectSpread({}, config), mergeKeys(defaultToConfig2Keys, globalsConfig, config2));
  9509. // eslint-disable-next-line no-empty
  9510. if (method === 'DOWNLOAD') {
  9511. } else if (method === 'UPLOAD') {
  9512. delete config.header['content-type'];
  9513. delete config.header['Content-Type'];
  9514. var uploadKeys = [
  9515. 'filePath',
  9516. 'name',
  9517. 'formData'];
  9518. uploadKeys.forEach(function (prop) {
  9519. if (typeof config2[prop] !== 'undefined') {
  9520. config[prop] = config2[prop];
  9521. }
  9522. });
  9523. } else {
  9524. var defaultsKeys = [
  9525. 'data',
  9526. 'timeout',
  9527. 'dataType',
  9528. 'responseType'];
  9529. config = _objectSpread(_objectSpread({}, config), mergeKeys(defaultsKeys, globalsConfig, config2));
  9530. }
  9531. return config;
  9532. };exports.default = _default;
  9533. /***/ }),
  9534. /* 29 */
  9535. /*!**********************************************************************************!*\
  9536. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/luch-request/luch-request/core/defaults.js ***!
  9537. \**********************************************************************************/
  9538. /*! no static exports found */
  9539. /***/ (function(module, exports, __webpack_require__) {
  9540. "use strict";
  9541. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9542. * 默认的全局配置
  9543. */var _default =
  9544. {
  9545. baseURL: '',
  9546. header: {},
  9547. method: 'GET',
  9548. dataType: 'json',
  9549. responseType: 'text',
  9550. custom: {},
  9551. timeout: 30000,
  9552. validateStatus: function validateStatus(status) {
  9553. return status >= 200 && status < 300;
  9554. } };exports.default = _default;
  9555. /***/ }),
  9556. /* 30 */
  9557. /*!*********************************************************!*\
  9558. !*** D:/wwwroot/cqcarbonwxapp/js_sdk/js-md5/md5.min.js ***!
  9559. \*********************************************************/
  9560. /*! no static exports found */
  9561. /***/ (function(module, exports, __webpack_require__) {
  9562. /* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  9563. * [js-md5]{@link https://github.com/emn178/js-md5}
  9564. *
  9565. * @namespace md5
  9566. * @version 0.7.3
  9567. * @author Chen, Yi-Cyuan [emn178@gmail.com]
  9568. * @copyright Chen, Yi-Cyuan 2014-2017
  9569. * @license MIT
  9570. */
  9571. !function () {"use strict";function t(t) {if (t) d[0] = d[16] = d[1] = d[2] = d[3] = d[4] = d[5] = d[6] = d[7] = d[8] = d[9] = d[10] = d[11] = d[12] = d[13] = d[14] = d[15] = 0, this.blocks = d, this.buffer8 = l;else if (a) {var r = new ArrayBuffer(68);this.buffer8 = new Uint8Array(r), this.blocks = new Uint32Array(r);} else this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0;}var r = "input is invalid type",e = "object" == typeof window,i = e ? window : {};i.JS_MD5_NO_WINDOW && (e = !1);var s = !e && "object" == typeof self,h = !i.JS_MD5_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node;h ? i = global : s && (i = self);var f = !i.JS_MD5_NO_COMMON_JS && "object" == typeof module && module.exports,o = true && __webpack_require__(/*! !webpack amd options */ 33),a = !i.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,n = "0123456789abcdef".split(""),u = [128, 32768, 8388608, -2147483648],y = [0, 8, 16, 24],c = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"],p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),d = [],l;if (a) {var A = new ArrayBuffer(68);l = new Uint8Array(A), d = new Uint32Array(A);}!i.JS_MD5_NO_NODE_JS && Array.isArray || (Array.isArray = function (t) {return "[object Array]" === Object.prototype.toString.call(t);}), !a || !i.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function (t) {return "object" == typeof t && t.buffer && t.buffer.constructor === ArrayBuffer;});var b = function b(r) {return function (e) {return new t(!0).update(e)[r]();};},v = function v() {var r = b("hex");h && (r = w(r)), r.create = function () {return new t();}, r.update = function (t) {return r.create().update(t);};for (var e = 0; e < c.length; ++e) {var i = c[e];r[i] = b(i);}return r;},w = function w(t) {var e = eval("require('crypto')"),i = eval("require('buffer').Buffer"),s = function s(_s) {if ("string" == typeof _s) return e.createHash("md5").update(_s, "utf8").digest("hex");if (null === _s || void 0 === _s) throw r;return _s.constructor === ArrayBuffer && (_s = new Uint8Array(_s)), Array.isArray(_s) || ArrayBuffer.isView(_s) || _s.constructor === i ? e.createHash("md5").update(new i(_s)).digest("hex") : t(_s);};return s;};t.prototype.update = function (t) {if (!this.finalized) {var e,i = typeof t;if ("string" !== i) {if ("object" !== i) throw r;if (null === t) throw r;if (a && t.constructor === ArrayBuffer) t = new Uint8Array(t);else if (!(Array.isArray(t) || a && ArrayBuffer.isView(t))) throw r;e = !0;}for (var s, h, f = 0, o = t.length, n = this.blocks, u = this.buffer8; f < o;) {if (this.hashed && (this.hashed = !1, n[0] = n[16], n[16] = n[1] = n[2] = n[3] = n[4] = n[5] = n[6] = n[7] = n[8] = n[9] = n[10] = n[11] = n[12] = n[13] = n[14] = n[15] = 0), e) {if (a) for (h = this.start; f < o && h < 64; ++f) {u[h++] = t[f];} else for (h = this.start; f < o && h < 64; ++f) {n[h >> 2] |= t[f] << y[3 & h++];}} else if (a) for (h = this.start; f < o && h < 64; ++f) {(s = t.charCodeAt(f)) < 128 ? u[h++] = s : s < 2048 ? (u[h++] = 192 | s >> 6, u[h++] = 128 | 63 & s) : s < 55296 || s >= 57344 ? (u[h++] = 224 | s >> 12, u[h++] = 128 | s >> 6 & 63, u[h++] = 128 | 63 & s) : (s = 65536 + ((1023 & s) << 10 | 1023 & t.charCodeAt(++f)), u[h++] = 240 | s >> 18, u[h++] = 128 | s >> 12 & 63, u[h++] = 128 | s >> 6 & 63, u[h++] = 128 | 63 & s);} else for (h = this.start; f < o && h < 64; ++f) {(s = t.charCodeAt(f)) < 128 ? n[h >> 2] |= s << y[3 & h++] : s < 2048 ? (n[h >> 2] |= (192 | s >> 6) << y[3 & h++], n[h >> 2] |= (128 | 63 & s) << y[3 & h++]) : s < 55296 || s >= 57344 ? (n[h >> 2] |= (224 | s >> 12) << y[3 & h++], n[h >> 2] |= (128 | s >> 6 & 63) << y[3 & h++], n[h >> 2] |= (128 | 63 & s) << y[3 & h++]) : (s = 65536 + ((1023 & s) << 10 | 1023 & t.charCodeAt(++f)), n[h >> 2] |= (240 | s >> 18) << y[3 & h++], n[h >> 2] |= (128 | s >> 12 & 63) << y[3 & h++], n[h >> 2] |= (128 | s >> 6 & 63) << y[3 & h++], n[h >> 2] |= (128 | 63 & s) << y[3 & h++]);}this.lastByteIndex = h, this.bytes += h - this.start, h >= 64 ? (this.start = h - 64, this.hash(), this.hashed = !0) : this.start = h;}return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;}}, t.prototype.finalize = function () {if (!this.finalized) {this.finalized = !0;var t = this.blocks,r = this.lastByteIndex;t[r >> 2] |= u[3 & r], r >= 56 && (this.hashed || this.hash(), t[0] = t[16], t[16] = t[1] = t[2] = t[3] = t[4] = t[5] = t[6] = t[7] = t[8] = t[9] = t[10] = t[11] = t[12] = t[13] = t[14] = t[15] = 0), t[14] = this.bytes << 3, t[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash();}}, t.prototype.hash = function () {var t,r,e,i,s,h,f = this.blocks;this.first ? r = ((r = ((t = ((t = f[0] - 680876937) << 7 | t >>> 25) - 271733879 << 0) ^ (e = ((e = (-271733879 ^ (i = ((i = (-1732584194 ^ 2004318071 & t) + f[1] - 117830708) << 12 | i >>> 20) + t << 0) & (-271733879 ^ t)) + f[2] - 1126478375) << 17 | e >>> 15) + i << 0) & (i ^ t)) + f[3] - 1316259209) << 22 | r >>> 10) + e << 0 : (t = this.h0, r = this.h1, e = this.h2, r = ((r += ((t = ((t += ((i = this.h3) ^ r & (e ^ i)) + f[0] - 680876936) << 7 | t >>> 25) + r << 0) ^ (e = ((e += (r ^ (i = ((i += (e ^ t & (r ^ e)) + f[1] - 389564586) << 12 | i >>> 20) + t << 0) & (t ^ r)) + f[2] + 606105819) << 17 | e >>> 15) + i << 0) & (i ^ t)) + f[3] - 1044525330) << 22 | r >>> 10) + e << 0), r = ((r += ((t = ((t += (i ^ r & (e ^ i)) + f[4] - 176418897) << 7 | t >>> 25) + r << 0) ^ (e = ((e += (r ^ (i = ((i += (e ^ t & (r ^ e)) + f[5] + 1200080426) << 12 | i >>> 20) + t << 0) & (t ^ r)) + f[6] - 1473231341) << 17 | e >>> 15) + i << 0) & (i ^ t)) + f[7] - 45705983) << 22 | r >>> 10) + e << 0, r = ((r += ((t = ((t += (i ^ r & (e ^ i)) + f[8] + 1770035416) << 7 | t >>> 25) + r << 0) ^ (e = ((e += (r ^ (i = ((i += (e ^ t & (r ^ e)) + f[9] - 1958414417) << 12 | i >>> 20) + t << 0) & (t ^ r)) + f[10] - 42063) << 17 | e >>> 15) + i << 0) & (i ^ t)) + f[11] - 1990404162) << 22 | r >>> 10) + e << 0, r = ((r += ((t = ((t += (i ^ r & (e ^ i)) + f[12] + 1804603682) << 7 | t >>> 25) + r << 0) ^ (e = ((e += (r ^ (i = ((i += (e ^ t & (r ^ e)) + f[13] - 40341101) << 12 | i >>> 20) + t << 0) & (t ^ r)) + f[14] - 1502002290) << 17 | e >>> 15) + i << 0) & (i ^ t)) + f[15] + 1236535329) << 22 | r >>> 10) + e << 0, r = ((r += ((i = ((i += (r ^ e & ((t = ((t += (e ^ i & (r ^ e)) + f[1] - 165796510) << 5 | t >>> 27) + r << 0) ^ r)) + f[6] - 1069501632) << 9 | i >>> 23) + t << 0) ^ t & ((e = ((e += (t ^ r & (i ^ t)) + f[11] + 643717713) << 14 | e >>> 18) + i << 0) ^ i)) + f[0] - 373897302) << 20 | r >>> 12) + e << 0, r = ((r += ((i = ((i += (r ^ e & ((t = ((t += (e ^ i & (r ^ e)) + f[5] - 701558691) << 5 | t >>> 27) + r << 0) ^ r)) + f[10] + 38016083) << 9 | i >>> 23) + t << 0) ^ t & ((e = ((e += (t ^ r & (i ^ t)) + f[15] - 660478335) << 14 | e >>> 18) + i << 0) ^ i)) + f[4] - 405537848) << 20 | r >>> 12) + e << 0, r = ((r += ((i = ((i += (r ^ e & ((t = ((t += (e ^ i & (r ^ e)) + f[9] + 568446438) << 5 | t >>> 27) + r << 0) ^ r)) + f[14] - 1019803690) << 9 | i >>> 23) + t << 0) ^ t & ((e = ((e += (t ^ r & (i ^ t)) + f[3] - 187363961) << 14 | e >>> 18) + i << 0) ^ i)) + f[8] + 1163531501) << 20 | r >>> 12) + e << 0, r = ((r += ((i = ((i += (r ^ e & ((t = ((t += (e ^ i & (r ^ e)) + f[13] - 1444681467) << 5 | t >>> 27) + r << 0) ^ r)) + f[2] - 51403784) << 9 | i >>> 23) + t << 0) ^ t & ((e = ((e += (t ^ r & (i ^ t)) + f[7] + 1735328473) << 14 | e >>> 18) + i << 0) ^ i)) + f[12] - 1926607734) << 20 | r >>> 12) + e << 0, r = ((r += ((h = (i = ((i += ((s = r ^ e) ^ (t = ((t += (s ^ i) + f[5] - 378558) << 4 | t >>> 28) + r << 0)) + f[8] - 2022574463) << 11 | i >>> 21) + t << 0) ^ t) ^ (e = ((e += (h ^ r) + f[11] + 1839030562) << 16 | e >>> 16) + i << 0)) + f[14] - 35309556) << 23 | r >>> 9) + e << 0, r = ((r += ((h = (i = ((i += ((s = r ^ e) ^ (t = ((t += (s ^ i) + f[1] - 1530992060) << 4 | t >>> 28) + r << 0)) + f[4] + 1272893353) << 11 | i >>> 21) + t << 0) ^ t) ^ (e = ((e += (h ^ r) + f[7] - 155497632) << 16 | e >>> 16) + i << 0)) + f[10] - 1094730640) << 23 | r >>> 9) + e << 0, r = ((r += ((h = (i = ((i += ((s = r ^ e) ^ (t = ((t += (s ^ i) + f[13] + 681279174) << 4 | t >>> 28) + r << 0)) + f[0] - 358537222) << 11 | i >>> 21) + t << 0) ^ t) ^ (e = ((e += (h ^ r) + f[3] - 722521979) << 16 | e >>> 16) + i << 0)) + f[6] + 76029189) << 23 | r >>> 9) + e << 0, r = ((r += ((h = (i = ((i += ((s = r ^ e) ^ (t = ((t += (s ^ i) + f[9] - 640364487) << 4 | t >>> 28) + r << 0)) + f[12] - 421815835) << 11 | i >>> 21) + t << 0) ^ t) ^ (e = ((e += (h ^ r) + f[15] + 530742520) << 16 | e >>> 16) + i << 0)) + f[2] - 995338651) << 23 | r >>> 9) + e << 0, r = ((r += ((i = ((i += (r ^ ((t = ((t += (e ^ (r | ~i)) + f[0] - 198630844) << 6 | t >>> 26) + r << 0) | ~e)) + f[7] + 1126891415) << 10 | i >>> 22) + t << 0) ^ ((e = ((e += (t ^ (i | ~r)) + f[14] - 1416354905) << 15 | e >>> 17) + i << 0) | ~t)) + f[5] - 57434055) << 21 | r >>> 11) + e << 0, r = ((r += ((i = ((i += (r ^ ((t = ((t += (e ^ (r | ~i)) + f[12] + 1700485571) << 6 | t >>> 26) + r << 0) | ~e)) + f[3] - 1894986606) << 10 | i >>> 22) + t << 0) ^ ((e = ((e += (t ^ (i | ~r)) + f[10] - 1051523) << 15 | e >>> 17) + i << 0) | ~t)) + f[1] - 2054922799) << 21 | r >>> 11) + e << 0, r = ((r += ((i = ((i += (r ^ ((t = ((t += (e ^ (r | ~i)) + f[8] + 1873313359) << 6 | t >>> 26) + r << 0) | ~e)) + f[15] - 30611744) << 10 | i >>> 22) + t << 0) ^ ((e = ((e += (t ^ (i | ~r)) + f[6] - 1560198380) << 15 | e >>> 17) + i << 0) | ~t)) + f[13] + 1309151649) << 21 | r >>> 11) + e << 0, r = ((r += ((i = ((i += (r ^ ((t = ((t += (e ^ (r | ~i)) + f[4] - 145523070) << 6 | t >>> 26) + r << 0) | ~e)) + f[11] - 1120210379) << 10 | i >>> 22) + t << 0) ^ ((e = ((e += (t ^ (i | ~r)) + f[2] + 718787259) << 15 | e >>> 17) + i << 0) | ~t)) + f[9] - 343485551) << 21 | r >>> 11) + e << 0, this.first ? (this.h0 = t + 1732584193 << 0, this.h1 = r - 271733879 << 0, this.h2 = e - 1732584194 << 0, this.h3 = i + 271733878 << 0, this.first = !1) : (this.h0 = this.h0 + t << 0, this.h1 = this.h1 + r << 0, this.h2 = this.h2 + e << 0, this.h3 = this.h3 + i << 0);}, t.prototype.hex = function () {this.finalize();var t = this.h0,r = this.h1,e = this.h2,i = this.h3;return n[t >> 4 & 15] + n[15 & t] + n[t >> 12 & 15] + n[t >> 8 & 15] + n[t >> 20 & 15] + n[t >> 16 & 15] + n[t >> 28 & 15] + n[t >> 24 & 15] + n[r >> 4 & 15] + n[15 & r] + n[r >> 12 & 15] + n[r >> 8 & 15] + n[r >> 20 & 15] + n[r >> 16 & 15] + n[r >> 28 & 15] + n[r >> 24 & 15] + n[e >> 4 & 15] + n[15 & e] + n[e >> 12 & 15] + n[e >> 8 & 15] + n[e >> 20 & 15] + n[e >> 16 & 15] + n[e >> 28 & 15] + n[e >> 24 & 15] + n[i >> 4 & 15] + n[15 & i] + n[i >> 12 & 15] + n[i >> 8 & 15] + n[i >> 20 & 15] + n[i >> 16 & 15] + n[i >> 28 & 15] + n[i >> 24 & 15];}, t.prototype.toString = t.prototype.hex, t.prototype.digest = function () {this.finalize();var t = this.h0,r = this.h1,e = this.h2,i = this.h3;return [255 & t, t >> 8 & 255, t >> 16 & 255, t >> 24 & 255, 255 & r, r >> 8 & 255, r >> 16 & 255, r >> 24 & 255, 255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255, 255 & i, i >> 8 & 255, i >> 16 & 255, i >> 24 & 255];}, t.prototype.array = t.prototype.digest, t.prototype.arrayBuffer = function () {this.finalize();var t = new ArrayBuffer(16),r = new Uint32Array(t);return r[0] = this.h0, r[1] = this.h1, r[2] = this.h2, r[3] = this.h3, t;}, t.prototype.buffer = t.prototype.arrayBuffer, t.prototype.base64 = function () {for (var t, r, e, i = "", s = this.array(), h = 0; h < 15;) {t = s[h++], r = s[h++], e = s[h++], i += p[t >>> 2] + p[63 & (t << 4 | r >>> 4)] + p[63 & (r << 2 | e >>> 6)] + p[63 & e];}return t = s[h], i += p[t >>> 2] + p[t << 4 & 63] + "==";};var _ = v();f ? module.exports = _ : (i.md5 = _, o && !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return _;}).call(exports, __webpack_require__, exports, module),
  9572. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)));}();
  9573. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../HBuilderX/plugins/uniapp-cli/node_modules/node-libs-browser/mock/process.js */ 31), __webpack_require__(/*! ./../../../../HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 3)))
  9574. /***/ }),
  9575. /* 31 */
  9576. /*!********************************************************!*\
  9577. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  9578. \********************************************************/
  9579. /*! no static exports found */
  9580. /***/ (function(module, exports, __webpack_require__) {
  9581. exports.nextTick = function nextTick(fn) {
  9582. var args = Array.prototype.slice.call(arguments);
  9583. args.shift();
  9584. setTimeout(function () {
  9585. fn.apply(null, args);
  9586. }, 0);
  9587. };
  9588. exports.platform = exports.arch =
  9589. exports.execPath = exports.title = 'browser';
  9590. exports.pid = 1;
  9591. exports.browser = true;
  9592. exports.env = {};
  9593. exports.argv = [];
  9594. exports.binding = function (name) {
  9595. throw new Error('No such module. (Possibly not yet loaded)')
  9596. };
  9597. (function () {
  9598. var cwd = '/';
  9599. var path;
  9600. exports.cwd = function () { return cwd };
  9601. exports.chdir = function (dir) {
  9602. if (!path) path = __webpack_require__(/*! path */ 32);
  9603. cwd = path.resolve(dir, cwd);
  9604. };
  9605. })();
  9606. exports.exit = exports.kill =
  9607. exports.umask = exports.dlopen =
  9608. exports.uptime = exports.memoryUsage =
  9609. exports.uvCounters = function() {};
  9610. exports.features = {};
  9611. /***/ }),
  9612. /* 32 */
  9613. /*!***********************************************!*\
  9614. !*** ./node_modules/path-browserify/index.js ***!
  9615. \***********************************************/
  9616. /*! no static exports found */
  9617. /***/ (function(module, exports, __webpack_require__) {
  9618. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  9619. // backported and transplited with Babel, with backwards-compat fixes
  9620. // Copyright Joyent, Inc. and other Node contributors.
  9621. //
  9622. // Permission is hereby granted, free of charge, to any person obtaining a
  9623. // copy of this software and associated documentation files (the
  9624. // "Software"), to deal in the Software without restriction, including
  9625. // without limitation the rights to use, copy, modify, merge, publish,
  9626. // distribute, sublicense, and/or sell copies of the Software, and to permit
  9627. // persons to whom the Software is furnished to do so, subject to the
  9628. // following conditions:
  9629. //
  9630. // The above copyright notice and this permission notice shall be included
  9631. // in all copies or substantial portions of the Software.
  9632. //
  9633. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  9634. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  9635. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  9636. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  9637. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  9638. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  9639. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  9640. // resolves . and .. elements in a path array with directory names there
  9641. // must be no slashes, empty elements, or device names (c:\) in the array
  9642. // (so also no leading and trailing slashes - it does not distinguish
  9643. // relative and absolute paths)
  9644. function normalizeArray(parts, allowAboveRoot) {
  9645. // if the path tries to go above the root, `up` ends up > 0
  9646. var up = 0;
  9647. for (var i = parts.length - 1; i >= 0; i--) {
  9648. var last = parts[i];
  9649. if (last === '.') {
  9650. parts.splice(i, 1);
  9651. } else if (last === '..') {
  9652. parts.splice(i, 1);
  9653. up++;
  9654. } else if (up) {
  9655. parts.splice(i, 1);
  9656. up--;
  9657. }
  9658. }
  9659. // if the path is allowed to go above the root, restore leading ..s
  9660. if (allowAboveRoot) {
  9661. for (; up--; up) {
  9662. parts.unshift('..');
  9663. }
  9664. }
  9665. return parts;
  9666. }
  9667. // path.resolve([from ...], to)
  9668. // posix version
  9669. exports.resolve = function() {
  9670. var resolvedPath = '',
  9671. resolvedAbsolute = false;
  9672. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  9673. var path = (i >= 0) ? arguments[i] : process.cwd();
  9674. // Skip empty and invalid entries
  9675. if (typeof path !== 'string') {
  9676. throw new TypeError('Arguments to path.resolve must be strings');
  9677. } else if (!path) {
  9678. continue;
  9679. }
  9680. resolvedPath = path + '/' + resolvedPath;
  9681. resolvedAbsolute = path.charAt(0) === '/';
  9682. }
  9683. // At this point the path should be resolved to a full absolute path, but
  9684. // handle relative paths to be safe (might happen when process.cwd() fails)
  9685. // Normalize the path
  9686. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  9687. return !!p;
  9688. }), !resolvedAbsolute).join('/');
  9689. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  9690. };
  9691. // path.normalize(path)
  9692. // posix version
  9693. exports.normalize = function(path) {
  9694. var isAbsolute = exports.isAbsolute(path),
  9695. trailingSlash = substr(path, -1) === '/';
  9696. // Normalize the path
  9697. path = normalizeArray(filter(path.split('/'), function(p) {
  9698. return !!p;
  9699. }), !isAbsolute).join('/');
  9700. if (!path && !isAbsolute) {
  9701. path = '.';
  9702. }
  9703. if (path && trailingSlash) {
  9704. path += '/';
  9705. }
  9706. return (isAbsolute ? '/' : '') + path;
  9707. };
  9708. // posix version
  9709. exports.isAbsolute = function(path) {
  9710. return path.charAt(0) === '/';
  9711. };
  9712. // posix version
  9713. exports.join = function() {
  9714. var paths = Array.prototype.slice.call(arguments, 0);
  9715. return exports.normalize(filter(paths, function(p, index) {
  9716. if (typeof p !== 'string') {
  9717. throw new TypeError('Arguments to path.join must be strings');
  9718. }
  9719. return p;
  9720. }).join('/'));
  9721. };
  9722. // path.relative(from, to)
  9723. // posix version
  9724. exports.relative = function(from, to) {
  9725. from = exports.resolve(from).substr(1);
  9726. to = exports.resolve(to).substr(1);
  9727. function trim(arr) {
  9728. var start = 0;
  9729. for (; start < arr.length; start++) {
  9730. if (arr[start] !== '') break;
  9731. }
  9732. var end = arr.length - 1;
  9733. for (; end >= 0; end--) {
  9734. if (arr[end] !== '') break;
  9735. }
  9736. if (start > end) return [];
  9737. return arr.slice(start, end - start + 1);
  9738. }
  9739. var fromParts = trim(from.split('/'));
  9740. var toParts = trim(to.split('/'));
  9741. var length = Math.min(fromParts.length, toParts.length);
  9742. var samePartsLength = length;
  9743. for (var i = 0; i < length; i++) {
  9744. if (fromParts[i] !== toParts[i]) {
  9745. samePartsLength = i;
  9746. break;
  9747. }
  9748. }
  9749. var outputParts = [];
  9750. for (var i = samePartsLength; i < fromParts.length; i++) {
  9751. outputParts.push('..');
  9752. }
  9753. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  9754. return outputParts.join('/');
  9755. };
  9756. exports.sep = '/';
  9757. exports.delimiter = ':';
  9758. exports.dirname = function (path) {
  9759. if (typeof path !== 'string') path = path + '';
  9760. if (path.length === 0) return '.';
  9761. var code = path.charCodeAt(0);
  9762. var hasRoot = code === 47 /*/*/;
  9763. var end = -1;
  9764. var matchedSlash = true;
  9765. for (var i = path.length - 1; i >= 1; --i) {
  9766. code = path.charCodeAt(i);
  9767. if (code === 47 /*/*/) {
  9768. if (!matchedSlash) {
  9769. end = i;
  9770. break;
  9771. }
  9772. } else {
  9773. // We saw the first non-path separator
  9774. matchedSlash = false;
  9775. }
  9776. }
  9777. if (end === -1) return hasRoot ? '/' : '.';
  9778. if (hasRoot && end === 1) {
  9779. // return '//';
  9780. // Backwards-compat fix:
  9781. return '/';
  9782. }
  9783. return path.slice(0, end);
  9784. };
  9785. function basename(path) {
  9786. if (typeof path !== 'string') path = path + '';
  9787. var start = 0;
  9788. var end = -1;
  9789. var matchedSlash = true;
  9790. var i;
  9791. for (i = path.length - 1; i >= 0; --i) {
  9792. if (path.charCodeAt(i) === 47 /*/*/) {
  9793. // If we reached a path separator that was not part of a set of path
  9794. // separators at the end of the string, stop now
  9795. if (!matchedSlash) {
  9796. start = i + 1;
  9797. break;
  9798. }
  9799. } else if (end === -1) {
  9800. // We saw the first non-path separator, mark this as the end of our
  9801. // path component
  9802. matchedSlash = false;
  9803. end = i + 1;
  9804. }
  9805. }
  9806. if (end === -1) return '';
  9807. return path.slice(start, end);
  9808. }
  9809. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  9810. // in new Node.js versions, so only basename() above is backported here
  9811. exports.basename = function (path, ext) {
  9812. var f = basename(path);
  9813. if (ext && f.substr(-1 * ext.length) === ext) {
  9814. f = f.substr(0, f.length - ext.length);
  9815. }
  9816. return f;
  9817. };
  9818. exports.extname = function (path) {
  9819. if (typeof path !== 'string') path = path + '';
  9820. var startDot = -1;
  9821. var startPart = 0;
  9822. var end = -1;
  9823. var matchedSlash = true;
  9824. // Track the state of characters (if any) we see before our first dot and
  9825. // after any path separator we find
  9826. var preDotState = 0;
  9827. for (var i = path.length - 1; i >= 0; --i) {
  9828. var code = path.charCodeAt(i);
  9829. if (code === 47 /*/*/) {
  9830. // If we reached a path separator that was not part of a set of path
  9831. // separators at the end of the string, stop now
  9832. if (!matchedSlash) {
  9833. startPart = i + 1;
  9834. break;
  9835. }
  9836. continue;
  9837. }
  9838. if (end === -1) {
  9839. // We saw the first non-path separator, mark this as the end of our
  9840. // extension
  9841. matchedSlash = false;
  9842. end = i + 1;
  9843. }
  9844. if (code === 46 /*.*/) {
  9845. // If this is our first dot, mark it as the start of our extension
  9846. if (startDot === -1)
  9847. startDot = i;
  9848. else if (preDotState !== 1)
  9849. preDotState = 1;
  9850. } else if (startDot !== -1) {
  9851. // We saw a non-dot and non-path separator before our dot, so we should
  9852. // have a good chance at having a non-empty extension
  9853. preDotState = -1;
  9854. }
  9855. }
  9856. if (startDot === -1 || end === -1 ||
  9857. // We saw a non-dot character immediately before the dot
  9858. preDotState === 0 ||
  9859. // The (right-most) trimmed path component is exactly '..'
  9860. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  9861. return '';
  9862. }
  9863. return path.slice(startDot, end);
  9864. };
  9865. function filter (xs, f) {
  9866. if (xs.filter) return xs.filter(f);
  9867. var res = [];
  9868. for (var i = 0; i < xs.length; i++) {
  9869. if (f(xs[i], i, xs)) res.push(xs[i]);
  9870. }
  9871. return res;
  9872. }
  9873. // String.prototype.substr - negative index don't work in IE8
  9874. var substr = 'ab'.substr(-1) === 'b'
  9875. ? function (str, start, len) { return str.substr(start, len) }
  9876. : function (str, start, len) {
  9877. if (start < 0) start = str.length + start;
  9878. return str.substr(start, len);
  9879. }
  9880. ;
  9881. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 31)))
  9882. /***/ }),
  9883. /* 33 */
  9884. /*!****************************************!*\
  9885. !*** (webpack)/buildin/amd-options.js ***!
  9886. \****************************************/
  9887. /*! no static exports found */
  9888. /***/ (function(module, exports) {
  9889. /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
  9890. module.exports = __webpack_amd_options__;
  9891. /* WEBPACK VAR INJECTION */}.call(this, {}))
  9892. /***/ }),
  9893. /* 34 */,
  9894. /* 35 */,
  9895. /* 36 */,
  9896. /* 37 */,
  9897. /* 38 */,
  9898. /* 39 */,
  9899. /* 40 */
  9900. /*!***************************************************************************!*\
  9901. !*** D:/wwwroot/cqcarbonwxapp/components/mescroll-uni/mescroll-mixins.js ***!
  9902. \***************************************************************************/
  9903. /*! no static exports found */
  9904. /***/ (function(module, exports, __webpack_require__) {
  9905. "use strict";
  9906. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // mescroll-body 和 mescroll-uni 通用
  9907. // import MescrollUni from "./mescroll-uni.vue";
  9908. // import MescrollBody from "./mescroll-body.vue";
  9909. var MescrollMixin = {
  9910. // components: { // 非H5端无法通过mixin注册组件, 只能在main.js中注册全局组件或具体界面中注册
  9911. // MescrollUni,
  9912. // MescrollBody
  9913. // },
  9914. data: function data() {
  9915. return {
  9916. mescroll: null //mescroll实例对象
  9917. };
  9918. },
  9919. // 注册系统自带的下拉刷新 (配置down.native为true时生效, 还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  9920. onPullDownRefresh: function onPullDownRefresh() {
  9921. this.mescroll && this.mescroll.onPullDownRefresh();
  9922. },
  9923. // 注册列表滚动事件,用于判定在顶部可下拉刷新,在指定位置可显示隐藏回到顶部按钮 (此方法为页面生命周期,无法在子组件中触发, 仅在mescroll-body生效)
  9924. onPageScroll: function onPageScroll(e) {
  9925. this.mescroll && this.mescroll.onPageScroll(e);
  9926. },
  9927. // 注册滚动到底部的事件,用于上拉加载 (此方法为页面生命周期,无法在子组件中触发, 仅在mescroll-body生效)
  9928. onReachBottom: function onReachBottom() {
  9929. this.mescroll && this.mescroll.onReachBottom();
  9930. },
  9931. methods: {
  9932. // mescroll组件初始化的回调,可获取到mescroll对象
  9933. mescrollInit: function mescrollInit(mescroll) {
  9934. this.mescroll = mescroll;
  9935. this.mescrollInitByRef(); // 兼容字节跳动小程序
  9936. },
  9937. // 以ref的方式初始化mescroll对象 (兼容字节跳动小程序)
  9938. mescrollInitByRef: function mescrollInitByRef() {
  9939. if (!this.mescroll || !this.mescroll.resetUpScroll) {
  9940. var mescrollRef = this.$refs.mescrollRef;
  9941. if (mescrollRef) this.mescroll = mescrollRef.mescroll;
  9942. }
  9943. },
  9944. // 下拉刷新的回调 (mixin默认resetUpScroll)
  9945. downCallback: function downCallback() {var _this = this;
  9946. if (this.mescroll.optUp.use) {
  9947. this.mescroll.resetUpScroll();
  9948. } else {
  9949. setTimeout(function () {
  9950. _this.mescroll.endSuccess();
  9951. }, 500);
  9952. }
  9953. },
  9954. // 上拉加载的回调
  9955. upCallback: function upCallback() {var _this2 = this;
  9956. // mixin默认延时500自动结束加载
  9957. setTimeout(function () {
  9958. _this2.mescroll.endErr();
  9959. }, 500);
  9960. } },
  9961. mounted: function mounted() {
  9962. this.mescrollInitByRef(); // 兼容字节跳动小程序, 避免未设置@init或@init此时未能取到ref的情况
  9963. } };var _default =
  9964. MescrollMixin;exports.default = _default;
  9965. /***/ }),
  9966. /* 41 */,
  9967. /* 42 */,
  9968. /* 43 */,
  9969. /* 44 */,
  9970. /* 45 */,
  9971. /* 46 */,
  9972. /* 47 */,
  9973. /* 48 */,
  9974. /* 49 */,
  9975. /* 50 */,
  9976. /* 51 */,
  9977. /* 52 */,
  9978. /* 53 */,
  9979. /* 54 */,
  9980. /* 55 */,
  9981. /* 56 */,
  9982. /* 57 */,
  9983. /* 58 */,
  9984. /* 59 */,
  9985. /* 60 */,
  9986. /* 61 */,
  9987. /* 62 */,
  9988. /* 63 */,
  9989. /* 64 */,
  9990. /* 65 */,
  9991. /* 66 */,
  9992. /* 67 */,
  9993. /* 68 */,
  9994. /* 69 */,
  9995. /* 70 */,
  9996. /* 71 */,
  9997. /* 72 */,
  9998. /* 73 */,
  9999. /* 74 */,
  10000. /* 75 */,
  10001. /* 76 */,
  10002. /* 77 */,
  10003. /* 78 */,
  10004. /* 79 */,
  10005. /* 80 */,
  10006. /* 81 */,
  10007. /* 82 */,
  10008. /* 83 */,
  10009. /* 84 */,
  10010. /* 85 */,
  10011. /* 86 */,
  10012. /* 87 */,
  10013. /* 88 */,
  10014. /* 89 */,
  10015. /* 90 */,
  10016. /* 91 */,
  10017. /* 92 */,
  10018. /* 93 */,
  10019. /* 94 */,
  10020. /* 95 */,
  10021. /* 96 */,
  10022. /* 97 */,
  10023. /* 98 */,
  10024. /* 99 */,
  10025. /* 100 */,
  10026. /* 101 */,
  10027. /* 102 */,
  10028. /* 103 */,
  10029. /* 104 */,
  10030. /* 105 */,
  10031. /* 106 */,
  10032. /* 107 */,
  10033. /* 108 */,
  10034. /* 109 */,
  10035. /* 110 */,
  10036. /* 111 */,
  10037. /* 112 */,
  10038. /* 113 */,
  10039. /* 114 */,
  10040. /* 115 */,
  10041. /* 116 */,
  10042. /* 117 */,
  10043. /* 118 */
  10044. /*!**************************************************************!*\
  10045. !*** D:/wwwroot/cqcarbonwxapp/components/uni-popup/popup.js ***!
  10046. \**************************************************************/
  10047. /*! no static exports found */
  10048. /***/ (function(module, exports, __webpack_require__) {
  10049. "use strict";
  10050. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _message = _interopRequireDefault(__webpack_require__(/*! ./message.js */ 119));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10051. // 定义 type 类型:弹出类型:top/bottom/center
  10052. var config = {
  10053. // 顶部弹出
  10054. top: 'top',
  10055. // 底部弹出
  10056. bottom: 'bottom',
  10057. // 居中弹出
  10058. center: 'center',
  10059. // 消息提示
  10060. message: 'top',
  10061. // 对话框
  10062. dialog: 'center',
  10063. // 分享
  10064. share: 'bottom' };var _default =
  10065. {
  10066. data: function data() {
  10067. return {
  10068. config: config };
  10069. },
  10070. mixins: [_message.default] };exports.default = _default;
  10071. /***/ }),
  10072. /* 119 */
  10073. /*!****************************************************************!*\
  10074. !*** D:/wwwroot/cqcarbonwxapp/components/uni-popup/message.js ***!
  10075. \****************************************************************/
  10076. /*! no static exports found */
  10077. /***/ (function(module, exports, __webpack_require__) {
  10078. "use strict";
  10079. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10080. created: function created() {
  10081. if (this.type === 'message') {
  10082. // 不显示遮罩
  10083. this.maskShow = false;
  10084. // 获取子组件对象
  10085. this.childrenMsg = null;
  10086. }
  10087. },
  10088. methods: {
  10089. customOpen: function customOpen() {
  10090. if (this.childrenMsg) {
  10091. this.childrenMsg.open();
  10092. }
  10093. },
  10094. customClose: function customClose() {
  10095. if (this.childrenMsg) {
  10096. this.childrenMsg.close();
  10097. }
  10098. } } };exports.default = _default;
  10099. /***/ }),
  10100. /* 120 */,
  10101. /* 121 */,
  10102. /* 122 */,
  10103. /* 123 */,
  10104. /* 124 */,
  10105. /* 125 */,
  10106. /* 126 */,
  10107. /* 127 */
  10108. /*!************************************************************************!*\
  10109. !*** D:/wwwroot/cqcarbonwxapp/components/mescroll-uni/mescroll-uni.js ***!
  10110. \************************************************************************/
  10111. /*! no static exports found */
  10112. /***/ (function(module, exports, __webpack_require__) {
  10113. "use strict";
  10114. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = MeScroll; /* mescroll
  10115. * version 1.3.3
  10116. * 2020-09-15 wenju
  10117. * https://www.mescroll.com
  10118. */
  10119. function MeScroll(options, isScrollBody) {
  10120. var me = this;
  10121. me.version = '1.3.3'; // mescroll版本号
  10122. me.options = options || {}; // 配置
  10123. me.isScrollBody = isScrollBody || false; // 滚动区域是否为原生页面滚动; 默认为scroll-view
  10124. me.isDownScrolling = false; // 是否在执行下拉刷新的回调
  10125. me.isUpScrolling = false; // 是否在执行上拉加载的回调
  10126. var hasDownCallback = me.options.down && me.options.down.callback; // 是否配置了down的callback
  10127. // 初始化下拉刷新
  10128. me.initDownScroll();
  10129. // 初始化上拉加载,则初始化
  10130. me.initUpScroll();
  10131. // 自动加载
  10132. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  10133. // 自动触发下拉刷新 (只有配置了down的callback才自动触发下拉刷新)
  10134. if ((me.optDown.use || me.optDown.native) && me.optDown.auto && hasDownCallback) {
  10135. if (me.optDown.autoShowLoading) {
  10136. me.triggerDownScroll(); // 显示下拉进度,执行下拉回调
  10137. } else {
  10138. me.optDown.callback && me.optDown.callback(me); // 不显示下拉进度,直接执行下拉回调
  10139. }
  10140. }
  10141. // 自动触发上拉加载
  10142. if (!me.isUpAutoLoad) {// 部分小程序(头条小程序)emit是异步, 会导致isUpAutoLoad判断有误, 先延时确保先执行down的callback,再执行up的callback
  10143. setTimeout(function () {
  10144. me.optUp.use && me.optUp.auto && !me.isUpAutoLoad && me.triggerUpScroll();
  10145. }, 100);
  10146. }
  10147. }, 30); // 需让me.optDown.inited和me.optUp.inited先执行
  10148. }
  10149. /* 配置参数:下拉刷新 */
  10150. MeScroll.prototype.extendDownScroll = function (optDown) {
  10151. // 下拉刷新的配置
  10152. MeScroll.extend(optDown, {
  10153. use: true, // 是否启用下拉刷新; 默认true
  10154. auto: true, // 是否在初始化完毕之后自动执行下拉刷新的回调; 默认true
  10155. native: false, // 是否使用系统自带的下拉刷新; 默认false; 仅mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  10156. autoShowLoading: false, // 如果设置auto=true(在初始化完毕之后自动执行下拉刷新的回调),那么是否显示下拉刷新的进度; 默认false
  10157. isLock: false, // 是否锁定下拉刷新,默认false;
  10158. offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
  10159. startTop: 100, // scroll-view快速滚动到顶部时,此时的scroll-top可能大于0, 此值用于控制最大的误差
  10160. inOffsetRate: 1, // 在列表顶部,下拉的距离小于offset时,改变下拉区域高度比例;值小于1且越接近0,高度变化越小,表现为越往下越难拉
  10161. outOffsetRate: 0.2, // 在列表顶部,下拉的距离大于offset时,改变下拉区域高度比例;值小于1且越接近0,高度变化越小,表现为越往下越难拉
  10162. bottomOffset: 20, // 当手指touchmove位置在距离body底部20px范围内的时候结束上拉刷新,避免Webview嵌套导致touchend事件不执行
  10163. minAngle: 45, // 向下滑动最少偏移的角度,取值区间 [0,90];默认45度,即向下滑动的角度大于45度则触发下拉;而小于45度,将不触发下拉,避免与左右滑动的轮播等组件冲突;
  10164. textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
  10165. textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
  10166. textLoading: '加载中 ...', // 加载中的提示文本
  10167. textSuccess: '加载成功', // 加载成功的文本
  10168. textErr: '加载失败', // 加载失败的文本
  10169. beforeEndDelay: 100, // 延时结束的时长 (显示加载成功/失败的时长)
  10170. bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorTop)
  10171. textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色)
  10172. inited: null, // 下拉刷新初始化完毕的回调
  10173. inOffset: null, // 下拉的距离进入offset范围内那一刻的回调
  10174. outOffset: null, // 下拉的距离大于offset那一刻的回调
  10175. onMoving: null, // 下拉过程中的回调,滑动过程一直在执行; rate下拉区域当前高度与指定距离的比值(inOffset: rate<1; outOffset: rate>=1); downHight当前下拉区域的高度
  10176. beforeLoading: null, // 准备触发下拉刷新的回调: 如果return true,将不触发showLoading和callback回调; 常用来完全自定义下拉刷新, 参考案例【淘宝 v6.8.0】
  10177. showLoading: null, // 显示下拉刷新进度的回调
  10178. afterLoading: null, // 显示下拉刷新进度的回调之后,马上要执行的代码 (如: 在wxs中使用)
  10179. beforeEndDownScroll: null, // 准备结束下拉的回调. 返回结束下拉的延时执行时间,默认0ms; 常用于结束下拉之前再显示另外一小段动画,才去隐藏下拉刷新的场景, 参考案例【dotJump】
  10180. endDownScroll: null, // 结束下拉刷新的回调
  10181. afterEndDownScroll: null, // 结束下拉刷新的回调,马上要执行的代码 (如: 在wxs中使用)
  10182. callback: function callback(mescroll) {
  10183. // 下拉刷新的回调;默认重置上拉加载列表为第一页
  10184. mescroll.resetUpScroll();
  10185. } });
  10186. };
  10187. /* 配置参数:上拉加载 */
  10188. MeScroll.prototype.extendUpScroll = function (optUp) {
  10189. // 上拉加载的配置
  10190. MeScroll.extend(optUp, {
  10191. use: true, // 是否启用上拉加载; 默认true
  10192. auto: true, // 是否在初始化完毕之后自动执行上拉加载的回调; 默认true
  10193. isLock: false, // 是否锁定上拉加载,默认false;
  10194. isBoth: true, // 上拉加载时,如果滑动到列表顶部是否可以同时触发下拉刷新;默认true,两者可同时触发;
  10195. callback: null, // 上拉加载的回调;function(page,mescroll){ }
  10196. page: {
  10197. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  10198. size: 10, // 每页数据的数量
  10199. time: null // 加载第一页数据服务器返回的时间; 防止用户翻页时,后台新增了数据从而导致下一页数据重复;
  10200. },
  10201. noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看
  10202. offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance )
  10203. textLoading: '加载中 ...', // 加载中的提示文本
  10204. textNoMore: '-- END --', // 没有更多数据的提示文本
  10205. bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorBottom)
  10206. textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色)
  10207. inited: null, // 初始化完毕的回调
  10208. showLoading: null, // 显示加载中的回调
  10209. showNoMore: null, // 显示无更多数据的回调
  10210. hideUpScroll: null, // 隐藏上拉加载的回调
  10211. errDistance: 60, // endErr的时候需往上滑动一段距离,使其往下滑动时再次触发onReachBottom,仅mescroll-body生效
  10212. toTop: {
  10213. // 回到顶部按钮,需配置src才显示
  10214. src: null, // 图片路径,默认null (绝对路径或网络图)
  10215. offset: 1000, // 列表滚动多少距离才显示回到顶部按钮,默认1000
  10216. duration: 300, // 回到顶部的动画时长,默认300ms (当值为0或300则使用系统自带回到顶部,更流畅; 其他值则通过step模拟,部分机型可能不够流畅,所以非特殊情况不建议修改此项)
  10217. btnClick: null, // 点击按钮的回调
  10218. onShow: null, // 是否显示的回调
  10219. zIndex: 9990, // fixed定位z-index值
  10220. left: null, // 到左边的距离, 默认null. 此项有值时,right不生效. (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  10221. right: 20, // 到右边的距离, 默认20 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  10222. bottom: 120, // 到底部的距离, 默认120 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  10223. safearea: false, // bottom的偏移量是否加上底部安全区的距离, 默认false, 需要适配iPhoneX时使用 (具体的界面如果不配置此项,则取本vue的safearea值)
  10224. width: 72, // 回到顶部图标的宽度, 默认72 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  10225. radius: "50%" // 圆角, 默认"50%" (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  10226. },
  10227. empty: {
  10228. use: true, // 是否显示空布局
  10229. icon: null, // 图标路径
  10230. tip: '~ 暂无相关数据 ~', // 提示
  10231. btnText: '', // 按钮
  10232. btnClick: null, // 点击按钮的回调
  10233. onShow: null, // 是否显示的回调
  10234. fixed: false, // 是否使用fixed定位,默认false; 配置fixed为true,以下的top和zIndex才生效 (transform会使fixed失效,最终会降级为absolute)
  10235. top: "100rpx", // fixed定位的top值 (完整的单位值,如 "10%"; "100rpx")
  10236. zIndex: 99 // fixed定位z-index值
  10237. },
  10238. onScroll: false // 是否监听滚动事件
  10239. });
  10240. };
  10241. /* 配置参数 */
  10242. MeScroll.extend = function (userOption, defaultOption) {
  10243. if (!userOption) return defaultOption;
  10244. for (var key in defaultOption) {
  10245. if (userOption[key] == null) {
  10246. var def = defaultOption[key];
  10247. if (def != null && typeof def === 'object') {
  10248. userOption[key] = MeScroll.extend({}, def); // 深度匹配
  10249. } else {
  10250. userOption[key] = def;
  10251. }
  10252. } else if (typeof userOption[key] === 'object') {
  10253. MeScroll.extend(userOption[key], defaultOption[key]); // 深度匹配
  10254. }
  10255. }
  10256. return userOption;
  10257. };
  10258. /* 简单判断是否配置了颜色 (非透明,非白色) */
  10259. MeScroll.prototype.hasColor = function (color) {
  10260. if (!color) return false;
  10261. var c = color.toLowerCase();
  10262. return c != "#fff" && c != "#ffffff" && c != "transparent" && c != "white";
  10263. };
  10264. /* -------初始化下拉刷新------- */
  10265. MeScroll.prototype.initDownScroll = function () {
  10266. var me = this;
  10267. // 配置参数
  10268. me.optDown = me.options.down || {};
  10269. if (!me.optDown.textColor && me.hasColor(me.optDown.bgColor)) me.optDown.textColor = "#fff"; // 当bgColor有值且textColor未设置,则textColor默认白色
  10270. me.extendDownScroll(me.optDown);
  10271. // 如果是mescroll-body且配置了native,则禁止自定义的下拉刷新
  10272. if (me.isScrollBody && me.optDown.native) {
  10273. me.optDown.use = false;
  10274. } else {
  10275. me.optDown.native = false; // 仅mescroll-body支持,mescroll-uni不支持
  10276. }
  10277. me.downHight = 0; // 下拉区域的高度
  10278. // 在页面中加入下拉布局
  10279. if (me.optDown.use && me.optDown.inited) {
  10280. // 初始化完毕的回调
  10281. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  10282. me.optDown.inited(me);
  10283. }, 0);
  10284. }
  10285. };
  10286. /* 列表touchstart事件 */
  10287. MeScroll.prototype.touchstartEvent = function (e) {
  10288. if (!this.optDown.use) return;
  10289. this.startPoint = this.getPoint(e); // 记录起点
  10290. this.startTop = this.getScrollTop(); // 记录此时的滚动条位置
  10291. this.startAngle = 0; // 初始角度
  10292. this.lastPoint = this.startPoint; // 重置上次move的点
  10293. this.maxTouchmoveY = this.getBodyHeight() - this.optDown.bottomOffset; // 手指触摸的最大范围(写在touchstart避免body获取高度为0的情况)
  10294. this.inTouchend = false; // 标记不是touchend
  10295. };
  10296. /* 列表touchmove事件 */
  10297. MeScroll.prototype.touchmoveEvent = function (e) {
  10298. if (!this.optDown.use) return;
  10299. var me = this;
  10300. var scrollTop = me.getScrollTop(); // 当前滚动条的距离
  10301. var curPoint = me.getPoint(e); // 当前点
  10302. var moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
  10303. // 向下拉 && 在顶部
  10304. // mescroll-body,直接判定在顶部即可
  10305. // scroll-view在滚动时不会触发touchmove,当触顶/底/左/右时,才会触发touchmove
  10306. // scroll-view滚动到顶部时,scrollTop不一定为0,也有可能大于0; 在iOS的APP中scrollTop可能为负数,不一定和startTop相等
  10307. if (moveY > 0 && (
  10308. me.isScrollBody && scrollTop <= 0 ||
  10309. !me.isScrollBody && (scrollTop <= 0 || scrollTop <= me.optDown.startTop && scrollTop === me.startTop)))
  10310. {
  10311. // 可下拉的条件
  10312. if (!me.inTouchend && !me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || me.isUpScrolling &&
  10313. me.optUp.isBoth)) {
  10314. // 下拉的初始角度是否在配置的范围内
  10315. if (!me.startAngle) me.startAngle = me.getAngle(me.lastPoint, curPoint); // 两点之间的角度,区间 [0,90]
  10316. if (me.startAngle < me.optDown.minAngle) return; // 如果小于配置的角度,则不往下执行下拉刷新
  10317. // 如果手指的位置超过配置的距离,则提前结束下拉,避免Webview嵌套导致touchend无法触发
  10318. if (me.maxTouchmoveY > 0 && curPoint.y >= me.maxTouchmoveY) {
  10319. me.inTouchend = true; // 标记执行touchend
  10320. me.touchendEvent(); // 提前触发touchend
  10321. return;
  10322. }
  10323. me.preventDefault(e); // 阻止默认事件
  10324. var diff = curPoint.y - me.lastPoint.y; // 和上次比,移动的距离 (大于0向下,小于0向上)
  10325. // 下拉距离 < 指定距离
  10326. if (me.downHight < me.optDown.offset) {
  10327. if (me.movetype !== 1) {
  10328. me.movetype = 1; // 加入标记,保证只执行一次
  10329. me.isDownEndSuccess = null; // 重置是否加载成功的状态 (wxs执行的是wxs.wxs)
  10330. me.optDown.inOffset && me.optDown.inOffset(me); // 进入指定距离范围内那一刻的回调,只执行一次
  10331. me.isMoveDown = true; // 标记下拉区域高度改变,在touchend重置回来
  10332. }
  10333. me.downHight += diff * me.optDown.inOffsetRate; // 越往下,高度变化越小
  10334. // 指定距离 <= 下拉距离
  10335. } else {
  10336. if (me.movetype !== 2) {
  10337. me.movetype = 2; // 加入标记,保证只执行一次
  10338. me.optDown.outOffset && me.optDown.outOffset(me); // 下拉超过指定距离那一刻的回调,只执行一次
  10339. me.isMoveDown = true; // 标记下拉区域高度改变,在touchend重置回来
  10340. }
  10341. if (diff > 0) {// 向下拉
  10342. me.downHight += diff * me.optDown.outOffsetRate; // 越往下,高度变化越小
  10343. } else {// 向上收
  10344. me.downHight += diff; // 向上收回高度,则向上滑多少收多少高度
  10345. }
  10346. }
  10347. me.downHight = Math.round(me.downHight); // 取整
  10348. var rate = me.downHight / me.optDown.offset; // 下拉区域当前高度与指定距离的比值
  10349. me.optDown.onMoving && me.optDown.onMoving(me, rate, me.downHight); // 下拉过程中的回调,一直在执行
  10350. }
  10351. }
  10352. me.lastPoint = curPoint; // 记录本次移动的点
  10353. };
  10354. /* 列表touchend事件 */
  10355. MeScroll.prototype.touchendEvent = function (e) {
  10356. if (!this.optDown.use) return;
  10357. // 如果下拉区域高度已改变,则需重置回来
  10358. if (this.isMoveDown) {
  10359. if (this.downHight >= this.optDown.offset) {
  10360. // 符合触发刷新的条件
  10361. this.triggerDownScroll();
  10362. } else {
  10363. // 不符合的话 则重置
  10364. this.downHight = 0;
  10365. this.endDownScrollCall(this);
  10366. }
  10367. this.movetype = 0;
  10368. this.isMoveDown = false;
  10369. } else if (!this.isScrollBody && this.getScrollTop() === this.startTop) {// scroll-view到顶/左/右/底的滑动事件
  10370. var isScrollUp = this.getPoint(e).y - this.startPoint.y < 0; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
  10371. // 上滑
  10372. if (isScrollUp) {
  10373. // 需检查滑动的角度
  10374. var angle = this.getAngle(this.getPoint(e), this.startPoint); // 两点之间的角度,区间 [0,90]
  10375. if (angle > 80) {
  10376. // 检查并触发上拉
  10377. this.triggerUpScroll(true);
  10378. }
  10379. }
  10380. }
  10381. };
  10382. /* 根据点击滑动事件获取第一个手指的坐标 */
  10383. MeScroll.prototype.getPoint = function (e) {
  10384. if (!e) {
  10385. return {
  10386. x: 0,
  10387. y: 0 };
  10388. }
  10389. if (e.touches && e.touches[0]) {
  10390. return {
  10391. x: e.touches[0].pageX,
  10392. y: e.touches[0].pageY };
  10393. } else if (e.changedTouches && e.changedTouches[0]) {
  10394. return {
  10395. x: e.changedTouches[0].pageX,
  10396. y: e.changedTouches[0].pageY };
  10397. } else {
  10398. return {
  10399. x: e.clientX,
  10400. y: e.clientY };
  10401. }
  10402. };
  10403. /* 计算两点之间的角度: 区间 [0,90]*/
  10404. MeScroll.prototype.getAngle = function (p1, p2) {
  10405. var x = Math.abs(p1.x - p2.x);
  10406. var y = Math.abs(p1.y - p2.y);
  10407. var z = Math.sqrt(x * x + y * y);
  10408. var angle = 0;
  10409. if (z !== 0) {
  10410. angle = Math.asin(y / z) / Math.PI * 180;
  10411. }
  10412. return angle;
  10413. };
  10414. /* 触发下拉刷新 */
  10415. MeScroll.prototype.triggerDownScroll = function () {
  10416. if (this.optDown.beforeLoading && this.optDown.beforeLoading(this)) {
  10417. //return true则处于完全自定义状态
  10418. } else {
  10419. this.showDownScroll(); // 下拉刷新中...
  10420. !this.optDown.native && this.optDown.callback && this.optDown.callback(this); // 执行回调,联网加载数据
  10421. }
  10422. };
  10423. /* 显示下拉进度布局 */
  10424. MeScroll.prototype.showDownScroll = function () {
  10425. this.isDownScrolling = true; // 标记下拉中
  10426. if (this.optDown.native) {
  10427. uni.startPullDownRefresh(); // 系统自带的下拉刷新
  10428. this.showDownLoadingCall(0); // 仍触发showLoading,因为上拉加载用到
  10429. } else {
  10430. this.downHight = this.optDown.offset; // 更新下拉区域高度
  10431. this.showDownLoadingCall(this.downHight); // 下拉刷新中...
  10432. }
  10433. };
  10434. MeScroll.prototype.showDownLoadingCall = function (downHight) {
  10435. this.optDown.showLoading && this.optDown.showLoading(this, downHight); // 下拉刷新中...
  10436. this.optDown.afterLoading && this.optDown.afterLoading(this, downHight); // 下拉刷新中...触发之后马上要执行的代码
  10437. };
  10438. /* 显示系统自带的下拉刷新时需要处理的业务 */
  10439. MeScroll.prototype.onPullDownRefresh = function () {
  10440. this.isDownScrolling = true; // 标记下拉中
  10441. this.showDownLoadingCall(0); // 仍触发showLoading,因为上拉加载用到
  10442. this.optDown.callback && this.optDown.callback(this); // 执行回调,联网加载数据
  10443. };
  10444. /* 结束下拉刷新 */
  10445. MeScroll.prototype.endDownScroll = function () {
  10446. if (this.optDown.native) {// 结束原生下拉刷新
  10447. this.isDownScrolling = false;
  10448. this.endDownScrollCall(this);
  10449. uni.stopPullDownRefresh();
  10450. return;
  10451. }
  10452. var me = this;
  10453. // 结束下拉刷新的方法
  10454. var endScroll = function endScroll() {
  10455. me.downHight = 0;
  10456. me.isDownScrolling = false;
  10457. me.endDownScrollCall(me);
  10458. if (!me.isScrollBody) {
  10459. me.setScrollHeight(0); // scroll-view重置滚动区域,使数据不满屏时仍可检查触发翻页
  10460. me.scrollTo(0, 0); // scroll-view需重置滚动条到顶部,避免startTop大于0时,对下拉刷新的影响
  10461. }
  10462. };
  10463. // 结束下拉刷新时的回调
  10464. var delay = 0;
  10465. if (me.optDown.beforeEndDownScroll) {
  10466. delay = me.optDown.beforeEndDownScroll(me); // 结束下拉刷新的延时,单位ms
  10467. if (me.isDownEndSuccess == null) delay = 0; // 没有执行加载中,则不延时
  10468. }
  10469. if (typeof delay === 'number' && delay > 0) {
  10470. setTimeout(endScroll, delay);
  10471. } else {
  10472. endScroll();
  10473. }
  10474. };
  10475. MeScroll.prototype.endDownScrollCall = function () {
  10476. this.optDown.endDownScroll && this.optDown.endDownScroll(this);
  10477. this.optDown.afterEndDownScroll && this.optDown.afterEndDownScroll(this);
  10478. };
  10479. /* 锁定下拉刷新:isLock=ture,null锁定;isLock=false解锁 */
  10480. MeScroll.prototype.lockDownScroll = function (isLock) {
  10481. if (isLock == null) isLock = true;
  10482. this.optDown.isLock = isLock;
  10483. };
  10484. /* 锁定上拉加载:isLock=ture,null锁定;isLock=false解锁 */
  10485. MeScroll.prototype.lockUpScroll = function (isLock) {
  10486. if (isLock == null) isLock = true;
  10487. this.optUp.isLock = isLock;
  10488. };
  10489. /* -------初始化上拉加载------- */
  10490. MeScroll.prototype.initUpScroll = function () {
  10491. var me = this;
  10492. // 配置参数
  10493. me.optUp = me.options.up || { use: false };
  10494. if (!me.optUp.textColor && me.hasColor(me.optUp.bgColor)) me.optUp.textColor = "#fff"; // 当bgColor有值且textColor未设置,则textColor默认白色
  10495. me.extendUpScroll(me.optUp);
  10496. if (me.optUp.use === false) return; // 配置不使用上拉加载时,则不初始化上拉布局
  10497. me.optUp.hasNext = true; // 如果使用上拉,则默认有下一页
  10498. me.startNum = me.optUp.page.num + 1; // 记录page开始的页码
  10499. // 初始化完毕的回调
  10500. if (me.optUp.inited) {
  10501. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  10502. me.optUp.inited(me);
  10503. }, 0);
  10504. }
  10505. };
  10506. /*滚动到底部的事件 (仅mescroll-body生效)*/
  10507. MeScroll.prototype.onReachBottom = function () {
  10508. if (this.isScrollBody && !this.isUpScrolling) {// 只能支持下拉刷新的时候同时可以触发上拉加载,否则滚动到底部就需要上滑一点才能触发onReachBottom
  10509. if (!this.optUp.isLock && this.optUp.hasNext) {
  10510. this.triggerUpScroll();
  10511. }
  10512. }
  10513. };
  10514. /*列表滚动事件 (仅mescroll-body生效)*/
  10515. MeScroll.prototype.onPageScroll = function (e) {
  10516. if (!this.isScrollBody) return;
  10517. // 更新滚动条的位置 (主要用于判断下拉刷新时,滚动条是否在顶部)
  10518. this.setScrollTop(e.scrollTop);
  10519. // 顶部按钮的显示隐藏
  10520. if (e.scrollTop >= this.optUp.toTop.offset) {
  10521. this.showTopBtn();
  10522. } else {
  10523. this.hideTopBtn();
  10524. }
  10525. };
  10526. /*列表滚动事件*/
  10527. MeScroll.prototype.scroll = function (e, onScroll) {
  10528. // 更新滚动条的位置
  10529. this.setScrollTop(e.scrollTop);
  10530. // 更新滚动内容高度
  10531. this.setScrollHeight(e.scrollHeight);
  10532. // 向上滑还是向下滑动
  10533. if (this.preScrollY == null) this.preScrollY = 0;
  10534. this.isScrollUp = e.scrollTop - this.preScrollY > 0;
  10535. this.preScrollY = e.scrollTop;
  10536. // 上滑 && 检查并触发上拉
  10537. this.isScrollUp && this.triggerUpScroll(true);
  10538. // 顶部按钮的显示隐藏
  10539. if (e.scrollTop >= this.optUp.toTop.offset) {
  10540. this.showTopBtn();
  10541. } else {
  10542. this.hideTopBtn();
  10543. }
  10544. // 滑动监听
  10545. this.optUp.onScroll && onScroll && onScroll();
  10546. };
  10547. /* 触发上拉加载 */
  10548. MeScroll.prototype.triggerUpScroll = function (isCheck) {
  10549. if (!this.isUpScrolling && this.optUp.use && this.optUp.callback) {
  10550. // 是否校验在底部; 默认不校验
  10551. if (isCheck === true) {
  10552. var canUp = false;
  10553. // 还有下一页 && 没有锁定 && 不在下拉中
  10554. if (this.optUp.hasNext && !this.optUp.isLock && !this.isDownScrolling) {
  10555. if (this.getScrollBottom() <= this.optUp.offset) {// 到底部
  10556. canUp = true; // 标记可上拉
  10557. }
  10558. }
  10559. if (canUp === false) return;
  10560. }
  10561. this.showUpScroll(); // 上拉加载中...
  10562. this.optUp.page.num++; // 预先加一页,如果失败则减回
  10563. this.isUpAutoLoad = true; // 标记上拉已经自动执行过,避免初始化时多次触发上拉回调
  10564. this.num = this.optUp.page.num; // 把最新的页数赋值在mescroll上,避免对page的影响
  10565. this.size = this.optUp.page.size; // 把最新的页码赋值在mescroll上,避免对page的影响
  10566. this.time = this.optUp.page.time; // 把最新的页码赋值在mescroll上,避免对page的影响
  10567. this.optUp.callback(this); // 执行回调,联网加载数据
  10568. }
  10569. };
  10570. /* 显示上拉加载中 */
  10571. MeScroll.prototype.showUpScroll = function () {
  10572. this.isUpScrolling = true; // 标记上拉加载中
  10573. this.optUp.showLoading && this.optUp.showLoading(this); // 回调
  10574. };
  10575. /* 显示上拉无更多数据 */
  10576. MeScroll.prototype.showNoMore = function () {
  10577. this.optUp.hasNext = false; // 标记无更多数据
  10578. this.optUp.showNoMore && this.optUp.showNoMore(this); // 回调
  10579. };
  10580. /* 隐藏上拉区域**/
  10581. MeScroll.prototype.hideUpScroll = function () {
  10582. this.optUp.hideUpScroll && this.optUp.hideUpScroll(this); // 回调
  10583. };
  10584. /* 结束上拉加载 */
  10585. MeScroll.prototype.endUpScroll = function (isShowNoMore) {
  10586. if (isShowNoMore != null) {// isShowNoMore=null,不处理下拉状态,下拉刷新的时候调用
  10587. if (isShowNoMore) {
  10588. this.showNoMore(); // isShowNoMore=true,显示无更多数据
  10589. } else {
  10590. this.hideUpScroll(); // isShowNoMore=false,隐藏上拉加载
  10591. }
  10592. }
  10593. this.isUpScrolling = false; // 标记结束上拉加载
  10594. };
  10595. /* 重置上拉加载列表为第一页
  10596. *isShowLoading 是否显示进度布局;
  10597. * 1.默认null,不传参,则显示上拉加载的进度布局
  10598. * 2.传参true, 则显示下拉刷新的进度布局
  10599. * 3.传参false,则不显示上拉和下拉的进度 (常用于静默更新列表数据)
  10600. */
  10601. MeScroll.prototype.resetUpScroll = function (isShowLoading) {
  10602. if (this.optUp && this.optUp.use) {
  10603. var page = this.optUp.page;
  10604. this.prePageNum = page.num; // 缓存重置前的页码,加载失败可退回
  10605. this.prePageTime = page.time; // 缓存重置前的时间,加载失败可退回
  10606. page.num = this.startNum; // 重置为第一页
  10607. page.time = null; // 重置时间为空
  10608. if (!this.isDownScrolling && isShowLoading !== false) {// 如果不是下拉刷新触发的resetUpScroll并且不配置列表静默更新,则显示进度;
  10609. if (isShowLoading == null) {
  10610. this.removeEmpty(); // 移除空布局
  10611. this.showUpScroll(); // 不传参,默认显示上拉加载的进度布局
  10612. } else {
  10613. this.showDownScroll(); // 传true,显示下拉刷新的进度布局,不清空列表
  10614. }
  10615. }
  10616. this.isUpAutoLoad = true; // 标记上拉已经自动执行过,避免初始化时多次触发上拉回调
  10617. this.num = page.num; // 把最新的页数赋值在mescroll上,避免对page的影响
  10618. this.size = page.size; // 把最新的页码赋值在mescroll上,避免对page的影响
  10619. this.time = page.time; // 把最新的页码赋值在mescroll上,避免对page的影响
  10620. this.optUp.callback && this.optUp.callback(this); // 执行上拉回调
  10621. }
  10622. };
  10623. /* 设置page.num的值 */
  10624. MeScroll.prototype.setPageNum = function (num) {
  10625. this.optUp.page.num = num - 1;
  10626. };
  10627. /* 设置page.size的值 */
  10628. MeScroll.prototype.setPageSize = function (size) {
  10629. this.optUp.page.size = size;
  10630. };
  10631. /* 联网回调成功,结束下拉刷新和上拉加载
  10632. * dataSize: 当前页的数据量(必传)
  10633. * totalPage: 总页数(必传)
  10634. * systime: 服务器时间 (可空)
  10635. */
  10636. MeScroll.prototype.endByPage = function (dataSize, totalPage, systime) {
  10637. var hasNext;
  10638. if (this.optUp.use && totalPage != null) hasNext = this.optUp.page.num < totalPage; // 是否还有下一页
  10639. this.endSuccess(dataSize, hasNext, systime);
  10640. };
  10641. /* 联网回调成功,结束下拉刷新和上拉加载
  10642. * dataSize: 当前页的数据量(必传)
  10643. * totalSize: 列表所有数据总数量(必传)
  10644. * systime: 服务器时间 (可空)
  10645. */
  10646. MeScroll.prototype.endBySize = function (dataSize, totalSize, systime) {
  10647. var hasNext;
  10648. if (this.optUp.use && totalSize != null) {
  10649. var loadSize = (this.optUp.page.num - 1) * this.optUp.page.size + dataSize; // 已加载的数据总数
  10650. hasNext = loadSize < totalSize; // 是否还有下一页
  10651. }
  10652. this.endSuccess(dataSize, hasNext, systime);
  10653. };
  10654. /* 联网回调成功,结束下拉刷新和上拉加载
  10655. * dataSize: 当前页的数据个数(不是所有页的数据总和),用于上拉加载判断是否还有下一页.如果不传,则会判断还有下一页
  10656. * hasNext: 是否还有下一页,布尔类型;用来解决这个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据dataSize判断,则需翻到第三页才会知道无更多数据,如果传了hasNext,则翻到第二页即可显示无更多数据.
  10657. * systime: 服务器时间(可空);用来解决这个小问题:当准备翻下一页时,数据库新增了几条记录,此时翻下一页,前面的几条数据会和上一页的重复;这里传入了systime,那么upCallback的page.time就会有值,把page.time传给服务器,让后台过滤新加入的那几条记录
  10658. */
  10659. MeScroll.prototype.endSuccess = function (dataSize, hasNext, systime) {
  10660. var me = this;
  10661. // 结束下拉刷新
  10662. if (me.isDownScrolling) {
  10663. me.isDownEndSuccess = true;
  10664. me.endDownScroll();
  10665. }
  10666. // 结束上拉加载
  10667. if (me.optUp.use) {
  10668. var isShowNoMore; // 是否已无更多数据
  10669. if (dataSize != null) {
  10670. var pageNum = me.optUp.page.num; // 当前页码
  10671. var pageSize = me.optUp.page.size; // 每页长度
  10672. // 如果是第一页
  10673. if (pageNum === 1) {
  10674. if (systime) me.optUp.page.time = systime; // 设置加载列表数据第一页的时间
  10675. }
  10676. if (dataSize < pageSize || hasNext === false) {
  10677. // 返回的数据不满一页时,则说明已无更多数据
  10678. me.optUp.hasNext = false;
  10679. if (dataSize === 0 && pageNum === 1) {
  10680. // 如果第一页无任何数据且配置了空布局
  10681. isShowNoMore = false;
  10682. me.showEmpty();
  10683. } else {
  10684. // 总列表数少于配置的数量,则不显示无更多数据
  10685. var allDataSize = (pageNum - 1) * pageSize + dataSize;
  10686. if (allDataSize < me.optUp.noMoreSize) {
  10687. isShowNoMore = false;
  10688. } else {
  10689. isShowNoMore = true;
  10690. }
  10691. me.removeEmpty(); // 移除空布局
  10692. }
  10693. } else {
  10694. // 还有下一页
  10695. isShowNoMore = false;
  10696. me.optUp.hasNext = true;
  10697. me.removeEmpty(); // 移除空布局
  10698. }
  10699. }
  10700. // 隐藏上拉
  10701. me.endUpScroll(isShowNoMore);
  10702. }
  10703. };
  10704. /* 回调失败,结束下拉刷新和上拉加载 */
  10705. MeScroll.prototype.endErr = function (errDistance) {
  10706. // 结束下拉,回调失败重置回原来的页码和时间
  10707. if (this.isDownScrolling) {
  10708. this.isDownEndSuccess = false;
  10709. var page = this.optUp.page;
  10710. if (page && this.prePageNum) {
  10711. page.num = this.prePageNum;
  10712. page.time = this.prePageTime;
  10713. }
  10714. this.endDownScroll();
  10715. }
  10716. // 结束上拉,回调失败重置回原来的页码
  10717. if (this.isUpScrolling) {
  10718. this.optUp.page.num--;
  10719. this.endUpScroll(false);
  10720. // 如果是mescroll-body,则需往回滚一定距离
  10721. if (this.isScrollBody && errDistance !== 0) {// 不处理0
  10722. if (!errDistance) errDistance = this.optUp.errDistance; // 不传,则取默认
  10723. this.scrollTo(this.getScrollTop() - errDistance, 0); // 往上回滚的距离
  10724. }
  10725. }
  10726. };
  10727. /* 显示空布局 */
  10728. MeScroll.prototype.showEmpty = function () {
  10729. this.optUp.empty.use && this.optUp.empty.onShow && this.optUp.empty.onShow(true);
  10730. };
  10731. /* 移除空布局 */
  10732. MeScroll.prototype.removeEmpty = function () {
  10733. this.optUp.empty.use && this.optUp.empty.onShow && this.optUp.empty.onShow(false);
  10734. };
  10735. /* 显示回到顶部的按钮 */
  10736. MeScroll.prototype.showTopBtn = function () {
  10737. if (!this.topBtnShow) {
  10738. this.topBtnShow = true;
  10739. this.optUp.toTop.onShow && this.optUp.toTop.onShow(true);
  10740. }
  10741. };
  10742. /* 隐藏回到顶部的按钮 */
  10743. MeScroll.prototype.hideTopBtn = function () {
  10744. if (this.topBtnShow) {
  10745. this.topBtnShow = false;
  10746. this.optUp.toTop.onShow && this.optUp.toTop.onShow(false);
  10747. }
  10748. };
  10749. /* 获取滚动条的位置 */
  10750. MeScroll.prototype.getScrollTop = function () {
  10751. return this.scrollTop || 0;
  10752. };
  10753. /* 记录滚动条的位置 */
  10754. MeScroll.prototype.setScrollTop = function (y) {
  10755. this.scrollTop = y;
  10756. };
  10757. /* 滚动到指定位置 */
  10758. MeScroll.prototype.scrollTo = function (y, t) {
  10759. this.myScrollTo && this.myScrollTo(y, t); // scrollview需自定义回到顶部方法
  10760. };
  10761. /* 自定义scrollTo */
  10762. MeScroll.prototype.resetScrollTo = function (myScrollTo) {
  10763. this.myScrollTo = myScrollTo;
  10764. };
  10765. /* 滚动条到底部的距离 */
  10766. MeScroll.prototype.getScrollBottom = function () {
  10767. return this.getScrollHeight() - this.getClientHeight() - this.getScrollTop();
  10768. };
  10769. /* 计步器
  10770. star: 开始值
  10771. end: 结束值
  10772. callback(step,timer): 回调step值,计步器timer,可自行通过window.clearInterval(timer)结束计步器;
  10773. t: 计步时长,传0则直接回调end值;不传则默认300ms
  10774. rate: 周期;不传则默认30ms计步一次
  10775. * */
  10776. MeScroll.prototype.getStep = function (star, end, callback, t, rate) {
  10777. var diff = end - star; // 差值
  10778. if (t === 0 || diff === 0) {
  10779. callback && callback(end);
  10780. return;
  10781. }
  10782. t = t || 300; // 时长 300ms
  10783. rate = rate || 30; // 周期 30ms
  10784. var count = t / rate; // 次数
  10785. var step = diff / count; // 步长
  10786. var i = 0; // 计数
  10787. var timer = setInterval(function () {
  10788. if (i < count - 1) {
  10789. star += step;
  10790. callback && callback(star, timer);
  10791. i++;
  10792. } else {
  10793. callback && callback(end, timer); // 最后一次直接设置end,避免计算误差
  10794. clearInterval(timer);
  10795. }
  10796. }, rate);
  10797. };
  10798. /* 滚动容器的高度 */
  10799. MeScroll.prototype.getClientHeight = function (isReal) {
  10800. var h = this.clientHeight || 0;
  10801. if (h === 0 && isReal !== true) {// 未获取到容器的高度,可临时取body的高度 (可能会有误差)
  10802. h = this.getBodyHeight();
  10803. }
  10804. return h;
  10805. };
  10806. MeScroll.prototype.setClientHeight = function (h) {
  10807. this.clientHeight = h;
  10808. };
  10809. /* 滚动内容的高度 */
  10810. MeScroll.prototype.getScrollHeight = function () {
  10811. return this.scrollHeight || 0;
  10812. };
  10813. MeScroll.prototype.setScrollHeight = function (h) {
  10814. this.scrollHeight = h;
  10815. };
  10816. /* body的高度 */
  10817. MeScroll.prototype.getBodyHeight = function () {
  10818. return this.bodyHeight || 0;
  10819. };
  10820. MeScroll.prototype.setBodyHeight = function (h) {
  10821. this.bodyHeight = h;
  10822. };
  10823. /* 阻止浏览器默认滚动事件 */
  10824. MeScroll.prototype.preventDefault = function (e) {
  10825. // 小程序不支持e.preventDefault, 已在wxs中禁止
  10826. // app的bounce只能通过配置pages.json的style.app-plus.bounce为"none"来禁止, 或使用renderjs禁止
  10827. // cancelable:是否可以被禁用; defaultPrevented:是否已经被禁用
  10828. if (e && e.cancelable && !e.defaultPrevented) e.preventDefault();
  10829. };
  10830. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10831. /***/ }),
  10832. /* 128 */
  10833. /*!*******************************************************************************!*\
  10834. !*** D:/wwwroot/cqcarbonwxapp/components/mescroll-uni/mescroll-uni-option.js ***!
  10835. \*******************************************************************************/
  10836. /*! no static exports found */
  10837. /***/ (function(module, exports, __webpack_require__) {
  10838. "use strict";
  10839. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 全局配置
  10840. // mescroll-body 和 mescroll-uni 通用
  10841. var GlobalOption = {
  10842. down: {
  10843. // 其他down的配置参数也可以写,这里只展示了常用的配置:
  10844. textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
  10845. textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
  10846. textLoading: '加载中 ...', // 加载中的提示文本
  10847. textSuccess: '加载成功', // 加载成功的文本
  10848. textErr: '加载失败', // 加载失败的文本
  10849. beforeEndDelay: 100, // 延时结束的时长 (显示加载成功/失败的时长)
  10850. offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
  10851. native: false // 是否使用系统自带的下拉刷新; 默认false; 仅在mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  10852. },
  10853. up: {
  10854. // 其他up的配置参数也可以写,这里只展示了常用的配置:
  10855. textLoading: '加载中 ...', // 加载中的提示文本
  10856. textNoMore: '-- END --', // 没有更多数据的提示文本
  10857. offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance )
  10858. toTop: {
  10859. // 回到顶部按钮,需配置src才显示
  10860. src: "https://www.mescroll.com/img/mescroll-totop.png", // 图片路径 (建议放入static目录, 如 /static/img/mescroll-totop.png )
  10861. offset: 1000, // 列表滚动多少距离才显示回到顶部按钮,默认1000px
  10862. right: 20, // 到右边的距离, 默认20 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  10863. bottom: 120, // 到底部的距离, 默认120 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  10864. width: 72 // 回到顶部图标的宽度, 默认72 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  10865. },
  10866. empty: {
  10867. use: true, // 是否显示空布局
  10868. icon: "https://www.mescroll.com/img/mescroll-empty.png", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
  10869. tip: '~ 空空如也 ~' // 提示
  10870. } } };var _default =
  10871. GlobalOption;exports.default = _default;
  10872. /***/ }),
  10873. /* 129 */
  10874. /*!**********************************************************************!*\
  10875. !*** D:/wwwroot/cqcarbonwxapp/components/mescroll-uni/wxs/mixins.js ***!
  10876. \**********************************************************************/
  10877. /*! no static exports found */
  10878. /***/ (function(module, exports, __webpack_require__) {
  10879. "use strict";
  10880. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 定义在wxs (含renderjs) 逻辑层的数据和方法, 与视图层相互通信
  10881. var WxsMixin = {
  10882. data: function data() {
  10883. return {
  10884. // 传入wxs视图层的数据 (响应式)
  10885. wxsProp: {
  10886. optDown: {}, // 下拉刷新的配置
  10887. scrollTop: 0, // 滚动条的距离
  10888. bodyHeight: 0, // body的高度
  10889. isDownScrolling: false, // 是否正在下拉刷新中
  10890. isUpScrolling: false, // 是否正在上拉加载中
  10891. isScrollBody: true, // 是否为mescroll-body滚动
  10892. isUpBoth: true, // 上拉加载时,是否同时可以下拉刷新
  10893. t: 0 // 数据更新的标记 (只有数据更新了,才会触发wxs的Observer)
  10894. },
  10895. // 标记调用wxs视图层的方法
  10896. callProp: {
  10897. callType: '', // 方法名
  10898. t: 0 // 数据更新的标记 (只有数据更新了,才会触发wxs的Observer)
  10899. },
  10900. // 不用wxs的平台使用此处的wxsBiz对象,抹平wxs的写法 (微信小程序和APP使用的wxsBiz对象是./wxs/wxs.wxs)
  10901. // 不用renderjs的平台使用此处的renderBiz对象,抹平renderjs的写法 (app 和 h5 使用的renderBiz对象是./wxs/renderjs.js)
  10902. renderBiz: {
  10903. propObserver: function propObserver() {} // 抹平renderjs的写法
  10904. } };
  10905. },
  10906. methods: {
  10907. // wxs视图层调用逻辑层的回调
  10908. wxsCall: function wxsCall(msg) {
  10909. if (msg.type === 'setWxsProp') {
  10910. // 更新wxsProp数据 (值改变才触发更新)
  10911. this.wxsProp = {
  10912. optDown: this.mescroll.optDown,
  10913. scrollTop: this.mescroll.getScrollTop(),
  10914. bodyHeight: this.mescroll.getBodyHeight(),
  10915. isDownScrolling: this.mescroll.isDownScrolling,
  10916. isUpScrolling: this.mescroll.isUpScrolling,
  10917. isUpBoth: this.mescroll.optUp.isBoth,
  10918. isScrollBody: this.mescroll.isScrollBody,
  10919. t: Date.now() };
  10920. } else if (msg.type === 'setLoadType') {
  10921. // 设置inOffset,outOffset的状态
  10922. this.downLoadType = msg.downLoadType;
  10923. // 状态挂载到mescroll对象, 以便在其他组件中使用, 比如<me-video>中
  10924. this.$set(this.mescroll, 'downLoadType', this.downLoadType);
  10925. // 重置是否加载成功的状态
  10926. this.$set(this.mescroll, 'isDownEndSuccess', null);
  10927. } else if (msg.type === 'triggerDownScroll') {
  10928. // 主动触发下拉刷新
  10929. this.mescroll.triggerDownScroll();
  10930. } else if (msg.type === 'endDownScroll') {
  10931. // 结束下拉刷新
  10932. this.mescroll.endDownScroll();
  10933. } else if (msg.type === 'triggerUpScroll') {
  10934. // 主动触发上拉加载
  10935. this.mescroll.triggerUpScroll(true);
  10936. }
  10937. } },
  10938. mounted: function mounted() {var _this = this;
  10939. // 配置主动触发wxs显示加载进度的回调
  10940. this.mescroll.optDown.afterLoading = function () {
  10941. _this.callProp = { callType: "showLoading", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  10942. };
  10943. // 配置主动触发wxs隐藏加载进度的回调
  10944. this.mescroll.optDown.afterEndDownScroll = function () {
  10945. _this.callProp = { callType: "endDownScroll", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  10946. var delay = 300 + (_this.mescroll.optDown.beforeEndDelay || 0);
  10947. setTimeout(function () {
  10948. if (_this.downLoadType === 4 || _this.downLoadType === 0) {
  10949. _this.callProp = { callType: "clearTransform", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  10950. }
  10951. // 状态挂载到mescroll对象, 以便在其他组件中使用, 比如<me-video>中
  10952. _this.$set(_this.mescroll, 'downLoadType', _this.downLoadType);
  10953. }, delay);
  10954. };
  10955. // 初始化wxs的数据
  10956. this.wxsCall({ type: 'setWxsProp' });
  10957. } };var _default =
  10958. WxsMixin;exports.default = _default;
  10959. /***/ })
  10960. ]]);
  10961. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map