vendor.js 418 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });
  312. function findExistsPageIndex(url) {
  313. var pages = getCurrentPages();
  314. var len = pages.length;
  315. while (len--) {
  316. var page = pages[len];
  317. if (page.$page && page.$page.fullPath === url) {
  318. return len;
  319. }
  320. }
  321. return -1;
  322. }
  323. var redirectTo = {
  324. name: function name(fromArgs) {
  325. if (fromArgs.exists === 'back' && fromArgs.delta) {
  326. return 'navigateBack';
  327. }
  328. return 'redirectTo';
  329. },
  330. args: function args(fromArgs) {
  331. if (fromArgs.exists === 'back' && fromArgs.url) {
  332. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  333. if (existsPageIndex !== -1) {
  334. var delta = getCurrentPages().length - 1 - existsPageIndex;
  335. if (delta > 0) {
  336. fromArgs.delta = delta;
  337. }
  338. }
  339. }
  340. } };
  341. var previewImage = {
  342. args: function args(fromArgs) {
  343. var currentIndex = parseInt(fromArgs.current);
  344. if (isNaN(currentIndex)) {
  345. return;
  346. }
  347. var urls = fromArgs.urls;
  348. if (!Array.isArray(urls)) {
  349. return;
  350. }
  351. var len = urls.length;
  352. if (!len) {
  353. return;
  354. }
  355. if (currentIndex < 0) {
  356. currentIndex = 0;
  357. } else if (currentIndex >= len) {
  358. currentIndex = len - 1;
  359. }
  360. if (currentIndex > 0) {
  361. fromArgs.current = urls[currentIndex];
  362. fromArgs.urls = urls.filter(
  363. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  364. } else {
  365. fromArgs.current = urls[0];
  366. }
  367. return {
  368. indicator: false,
  369. loop: false };
  370. } };
  371. var UUID_KEY = '__DC_STAT_UUID';
  372. var deviceId;
  373. function addUuid(result) {
  374. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  375. if (!deviceId) {
  376. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  377. wx.setStorage({
  378. key: UUID_KEY,
  379. data: deviceId });
  380. }
  381. result.deviceId = deviceId;
  382. }
  383. function addSafeAreaInsets(result) {
  384. if (result.safeArea) {
  385. var safeArea = result.safeArea;
  386. result.safeAreaInsets = {
  387. top: safeArea.top,
  388. left: safeArea.left,
  389. right: result.windowWidth - safeArea.right,
  390. bottom: result.windowHeight - safeArea.bottom };
  391. }
  392. }
  393. var getSystemInfo = {
  394. returnValue: function returnValue(result) {
  395. addUuid(result);
  396. addSafeAreaInsets(result);
  397. } };
  398. // import navigateTo from 'uni-helpers/navigate-to'
  399. var protocols = {
  400. redirectTo: redirectTo,
  401. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  402. previewImage: previewImage,
  403. getSystemInfo: getSystemInfo,
  404. getSystemInfoSync: getSystemInfo };
  405. var todos = [
  406. 'vibrate',
  407. 'preloadPage',
  408. 'unPreloadPage',
  409. 'loadSubPackage'];
  410. var canIUses = [];
  411. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  412. function processCallback(methodName, method, returnValue) {
  413. return function (res) {
  414. return method(processReturnValue(methodName, res, returnValue));
  415. };
  416. }
  417. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  418. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  419. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  420. if (isFn(argsOption)) {
  421. argsOption = argsOption(fromArgs, toArgs) || {};
  422. }
  423. for (var key in fromArgs) {
  424. if (hasOwn(argsOption, key)) {
  425. var keyOption = argsOption[key];
  426. if (isFn(keyOption)) {
  427. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  428. }
  429. if (!keyOption) {// 不支持的参数
  430. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  431. } else if (isStr(keyOption)) {// 重写参数 key
  432. toArgs[keyOption] = fromArgs[key];
  433. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  434. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  435. }
  436. } else if (CALLBACKS.indexOf(key) !== -1) {
  437. if (isFn(fromArgs[key])) {
  438. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  439. }
  440. } else {
  441. if (!keepFromArgs) {
  442. toArgs[key] = fromArgs[key];
  443. }
  444. }
  445. }
  446. return toArgs;
  447. } else if (isFn(fromArgs)) {
  448. fromArgs = processCallback(methodName, fromArgs, returnValue);
  449. }
  450. return fromArgs;
  451. }
  452. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  453. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  454. res = protocols.returnValue(methodName, res);
  455. }
  456. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  457. }
  458. function wrapper(methodName, method) {
  459. if (hasOwn(protocols, methodName)) {
  460. var protocol = protocols[methodName];
  461. if (!protocol) {// 暂不支持的 api
  462. return function () {
  463. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  464. };
  465. }
  466. return function (arg1, arg2) {// 目前 api 最多两个参数
  467. var options = protocol;
  468. if (isFn(protocol)) {
  469. options = protocol(arg1);
  470. }
  471. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  472. var args = [arg1];
  473. if (typeof arg2 !== 'undefined') {
  474. args.push(arg2);
  475. }
  476. if (isFn(options.name)) {
  477. methodName = options.name(arg1);
  478. } else if (isStr(options.name)) {
  479. methodName = options.name;
  480. }
  481. var returnValue = wx[methodName].apply(wx, args);
  482. if (isSyncApi(methodName)) {// 同步 api
  483. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  484. }
  485. return returnValue;
  486. };
  487. }
  488. return method;
  489. }
  490. var todoApis = Object.create(null);
  491. var TODOS = [
  492. 'onTabBarMidButtonTap',
  493. 'subscribePush',
  494. 'unsubscribePush',
  495. 'onPush',
  496. 'offPush',
  497. 'share'];
  498. function createTodoApi(name) {
  499. return function todoApi(_ref)
  500. {var fail = _ref.fail,complete = _ref.complete;
  501. var res = {
  502. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  503. isFn(fail) && fail(res);
  504. isFn(complete) && complete(res);
  505. };
  506. }
  507. TODOS.forEach(function (name) {
  508. todoApis[name] = createTodoApi(name);
  509. });
  510. var providers = {
  511. oauth: ['weixin'],
  512. share: ['weixin'],
  513. payment: ['wxpay'],
  514. push: ['weixin'] };
  515. function getProvider(_ref2)
  516. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  517. var res = false;
  518. if (providers[service]) {
  519. res = {
  520. errMsg: 'getProvider:ok',
  521. service: service,
  522. provider: providers[service] };
  523. isFn(success) && success(res);
  524. } else {
  525. res = {
  526. errMsg: 'getProvider:fail service not found' };
  527. isFn(fail) && fail(res);
  528. }
  529. isFn(complete) && complete(res);
  530. }
  531. var extraApi = /*#__PURE__*/Object.freeze({
  532. __proto__: null,
  533. getProvider: getProvider });
  534. var getEmitter = function () {
  535. var Emitter;
  536. return function getUniEmitter() {
  537. if (!Emitter) {
  538. Emitter = new _vue.default();
  539. }
  540. return Emitter;
  541. };
  542. }();
  543. function apply(ctx, method, args) {
  544. return ctx[method].apply(ctx, args);
  545. }
  546. function $on() {
  547. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  548. }
  549. function $off() {
  550. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  551. }
  552. function $once() {
  553. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  554. }
  555. function $emit() {
  556. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  557. }
  558. var eventApi = /*#__PURE__*/Object.freeze({
  559. __proto__: null,
  560. $on: $on,
  561. $off: $off,
  562. $once: $once,
  563. $emit: $emit });
  564. var api = /*#__PURE__*/Object.freeze({
  565. __proto__: null });
  566. var MPPage = Page;
  567. var MPComponent = Component;
  568. var customizeRE = /:/g;
  569. var customize = cached(function (str) {
  570. return camelize(str.replace(customizeRE, '-'));
  571. });
  572. function initTriggerEvent(mpInstance) {
  573. {
  574. if (!wx.canIUse('nextTick')) {
  575. return;
  576. }
  577. }
  578. var oldTriggerEvent = mpInstance.triggerEvent;
  579. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  580. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  581. };
  582. }
  583. function initHook(name, options) {
  584. var oldHook = options[name];
  585. if (!oldHook) {
  586. options[name] = function () {
  587. initTriggerEvent(this);
  588. };
  589. } else {
  590. options[name] = function () {
  591. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  592. return oldHook.apply(this, args);
  593. };
  594. }
  595. }
  596. if (!MPPage.__$wrappered) {
  597. MPPage.__$wrappered = true;
  598. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  599. initHook('onLoad', options);
  600. return MPPage(options);
  601. };
  602. Page.after = MPPage.after;
  603. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  604. initHook('created', options);
  605. return MPComponent(options);
  606. };
  607. }
  608. var PAGE_EVENT_HOOKS = [
  609. 'onPullDownRefresh',
  610. 'onReachBottom',
  611. 'onAddToFavorites',
  612. 'onShareTimeline',
  613. 'onShareAppMessage',
  614. 'onPageScroll',
  615. 'onResize',
  616. 'onTabItemTap'];
  617. function initMocks(vm, mocks) {
  618. var mpInstance = vm.$mp[vm.mpType];
  619. mocks.forEach(function (mock) {
  620. if (hasOwn(mpInstance, mock)) {
  621. vm[mock] = mpInstance[mock];
  622. }
  623. });
  624. }
  625. function hasHook(hook, vueOptions) {
  626. if (!vueOptions) {
  627. return true;
  628. }
  629. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  630. return true;
  631. }
  632. vueOptions = vueOptions.default || vueOptions;
  633. if (isFn(vueOptions)) {
  634. if (isFn(vueOptions.extendOptions[hook])) {
  635. return true;
  636. }
  637. if (vueOptions.super &&
  638. vueOptions.super.options &&
  639. Array.isArray(vueOptions.super.options[hook])) {
  640. return true;
  641. }
  642. return false;
  643. }
  644. if (isFn(vueOptions[hook])) {
  645. return true;
  646. }
  647. var mixins = vueOptions.mixins;
  648. if (Array.isArray(mixins)) {
  649. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  650. }
  651. }
  652. function initHooks(mpOptions, hooks, vueOptions) {
  653. hooks.forEach(function (hook) {
  654. if (hasHook(hook, vueOptions)) {
  655. mpOptions[hook] = function (args) {
  656. return this.$vm && this.$vm.__call_hook(hook, args);
  657. };
  658. }
  659. });
  660. }
  661. function initVueComponent(Vue, vueOptions) {
  662. vueOptions = vueOptions.default || vueOptions;
  663. var VueComponent;
  664. if (isFn(vueOptions)) {
  665. VueComponent = vueOptions;
  666. } else {
  667. VueComponent = Vue.extend(vueOptions);
  668. }
  669. vueOptions = VueComponent.options;
  670. return [VueComponent, vueOptions];
  671. }
  672. function initSlots(vm, vueSlots) {
  673. if (Array.isArray(vueSlots) && vueSlots.length) {
  674. var $slots = Object.create(null);
  675. vueSlots.forEach(function (slotName) {
  676. $slots[slotName] = true;
  677. });
  678. vm.$scopedSlots = vm.$slots = $slots;
  679. }
  680. }
  681. function initVueIds(vueIds, mpInstance) {
  682. vueIds = (vueIds || '').split(',');
  683. var len = vueIds.length;
  684. if (len === 1) {
  685. mpInstance._$vueId = vueIds[0];
  686. } else if (len === 2) {
  687. mpInstance._$vueId = vueIds[0];
  688. mpInstance._$vuePid = vueIds[1];
  689. }
  690. }
  691. function initData(vueOptions, context) {
  692. var data = vueOptions.data || {};
  693. var methods = vueOptions.methods || {};
  694. if (typeof data === 'function') {
  695. try {
  696. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  697. } catch (e) {
  698. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"crmeb","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  699. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  700. }
  701. }
  702. } else {
  703. try {
  704. // 对 data 格式化
  705. data = JSON.parse(JSON.stringify(data));
  706. } catch (e) {}
  707. }
  708. if (!isPlainObject(data)) {
  709. data = {};
  710. }
  711. Object.keys(methods).forEach(function (methodName) {
  712. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  713. data[methodName] = methods[methodName];
  714. }
  715. });
  716. return data;
  717. }
  718. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  719. function createObserver(name) {
  720. return function observer(newVal, oldVal) {
  721. if (this.$vm) {
  722. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  723. }
  724. };
  725. }
  726. function initBehaviors(vueOptions, initBehavior) {
  727. var vueBehaviors = vueOptions.behaviors;
  728. var vueExtends = vueOptions.extends;
  729. var vueMixins = vueOptions.mixins;
  730. var vueProps = vueOptions.props;
  731. if (!vueProps) {
  732. vueOptions.props = vueProps = [];
  733. }
  734. var behaviors = [];
  735. if (Array.isArray(vueBehaviors)) {
  736. vueBehaviors.forEach(function (behavior) {
  737. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  738. if (behavior === 'uni://form-field') {
  739. if (Array.isArray(vueProps)) {
  740. vueProps.push('name');
  741. vueProps.push('value');
  742. } else {
  743. vueProps.name = {
  744. type: String,
  745. default: '' };
  746. vueProps.value = {
  747. type: [String, Number, Boolean, Array, Object, Date],
  748. default: '' };
  749. }
  750. }
  751. });
  752. }
  753. if (isPlainObject(vueExtends) && vueExtends.props) {
  754. behaviors.push(
  755. initBehavior({
  756. properties: initProperties(vueExtends.props, true) }));
  757. }
  758. if (Array.isArray(vueMixins)) {
  759. vueMixins.forEach(function (vueMixin) {
  760. if (isPlainObject(vueMixin) && vueMixin.props) {
  761. behaviors.push(
  762. initBehavior({
  763. properties: initProperties(vueMixin.props, true) }));
  764. }
  765. });
  766. }
  767. return behaviors;
  768. }
  769. function parsePropType(key, type, defaultValue, file) {
  770. // [String]=>String
  771. if (Array.isArray(type) && type.length === 1) {
  772. return type[0];
  773. }
  774. return type;
  775. }
  776. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  777. var properties = {};
  778. if (!isBehavior) {
  779. properties.vueId = {
  780. type: String,
  781. value: '' };
  782. // 用于字节跳动小程序模拟抽象节点
  783. properties.generic = {
  784. type: Object,
  785. value: null };
  786. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  787. type: null,
  788. value: [],
  789. observer: function observer(newVal, oldVal) {
  790. var $slots = Object.create(null);
  791. newVal.forEach(function (slotName) {
  792. $slots[slotName] = true;
  793. });
  794. this.setData({
  795. $slots: $slots });
  796. } };
  797. }
  798. if (Array.isArray(props)) {// ['title']
  799. props.forEach(function (key) {
  800. properties[key] = {
  801. type: null,
  802. observer: createObserver(key) };
  803. });
  804. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  805. Object.keys(props).forEach(function (key) {
  806. var opts = props[key];
  807. if (isPlainObject(opts)) {// title:{type:String,default:''}
  808. var value = opts.default;
  809. if (isFn(value)) {
  810. value = value();
  811. }
  812. opts.type = parsePropType(key, opts.type);
  813. properties[key] = {
  814. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  815. value: value,
  816. observer: createObserver(key) };
  817. } else {// content:String
  818. var type = parsePropType(key, opts);
  819. properties[key] = {
  820. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  821. observer: createObserver(key) };
  822. }
  823. });
  824. }
  825. return properties;
  826. }
  827. function wrapper$1(event) {
  828. // TODO 又得兼容 mpvue 的 mp 对象
  829. try {
  830. event.mp = JSON.parse(JSON.stringify(event));
  831. } catch (e) {}
  832. event.stopPropagation = noop;
  833. event.preventDefault = noop;
  834. event.target = event.target || {};
  835. if (!hasOwn(event, 'detail')) {
  836. event.detail = {};
  837. }
  838. if (hasOwn(event, 'markerId')) {
  839. event.detail = typeof event.detail === 'object' ? event.detail : {};
  840. event.detail.markerId = event.markerId;
  841. }
  842. if (isPlainObject(event.detail)) {
  843. event.target = Object.assign({}, event.target, event.detail);
  844. }
  845. return event;
  846. }
  847. function getExtraValue(vm, dataPathsArray) {
  848. var context = vm;
  849. dataPathsArray.forEach(function (dataPathArray) {
  850. var dataPath = dataPathArray[0];
  851. var value = dataPathArray[2];
  852. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  853. var propPath = dataPathArray[1];
  854. var valuePath = dataPathArray[3];
  855. var vFor;
  856. if (Number.isInteger(dataPath)) {
  857. vFor = dataPath;
  858. } else if (!dataPath) {
  859. vFor = context;
  860. } else if (typeof dataPath === 'string' && dataPath) {
  861. if (dataPath.indexOf('#s#') === 0) {
  862. vFor = dataPath.substr(3);
  863. } else {
  864. vFor = vm.__get_value(dataPath, context);
  865. }
  866. }
  867. if (Number.isInteger(vFor)) {
  868. context = value;
  869. } else if (!propPath) {
  870. context = vFor[value];
  871. } else {
  872. if (Array.isArray(vFor)) {
  873. context = vFor.find(function (vForItem) {
  874. return vm.__get_value(propPath, vForItem) === value;
  875. });
  876. } else if (isPlainObject(vFor)) {
  877. context = Object.keys(vFor).find(function (vForKey) {
  878. return vm.__get_value(propPath, vFor[vForKey]) === value;
  879. });
  880. } else {
  881. console.error('v-for 暂不支持循环数据:', vFor);
  882. }
  883. }
  884. if (valuePath) {
  885. context = vm.__get_value(valuePath, context);
  886. }
  887. }
  888. });
  889. return context;
  890. }
  891. function processEventExtra(vm, extra, event) {
  892. var extraObj = {};
  893. if (Array.isArray(extra) && extra.length) {
  894. /**
  895. *[
  896. * ['data.items', 'data.id', item.data.id],
  897. * ['metas', 'id', meta.id]
  898. *],
  899. *[
  900. * ['data.items', 'data.id', item.data.id],
  901. * ['metas', 'id', meta.id]
  902. *],
  903. *'test'
  904. */
  905. extra.forEach(function (dataPath, index) {
  906. if (typeof dataPath === 'string') {
  907. if (!dataPath) {// model,prop.sync
  908. extraObj['$' + index] = vm;
  909. } else {
  910. if (dataPath === '$event') {// $event
  911. extraObj['$' + index] = event;
  912. } else if (dataPath === 'arguments') {
  913. if (event.detail && event.detail.__args__) {
  914. extraObj['$' + index] = event.detail.__args__;
  915. } else {
  916. extraObj['$' + index] = [event];
  917. }
  918. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  919. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  920. } else {
  921. extraObj['$' + index] = vm.__get_value(dataPath);
  922. }
  923. }
  924. } else {
  925. extraObj['$' + index] = getExtraValue(vm, dataPath);
  926. }
  927. });
  928. }
  929. return extraObj;
  930. }
  931. function getObjByArray(arr) {
  932. var obj = {};
  933. for (var i = 1; i < arr.length; i++) {
  934. var element = arr[i];
  935. obj[element[0]] = element[1];
  936. }
  937. return obj;
  938. }
  939. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  940. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  941. if (isCustom) {// 自定义事件
  942. isCustomMPEvent = event.currentTarget &&
  943. event.currentTarget.dataset &&
  944. event.currentTarget.dataset.comType === 'wx';
  945. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  946. if (isCustomMPEvent) {
  947. return [event];
  948. }
  949. return event.detail.__args__ || event.detail;
  950. }
  951. }
  952. var extraObj = processEventExtra(vm, extra, event);
  953. var ret = [];
  954. args.forEach(function (arg) {
  955. if (arg === '$event') {
  956. if (methodName === '__set_model' && !isCustom) {// input v-model value
  957. ret.push(event.target.value);
  958. } else {
  959. if (isCustom && !isCustomMPEvent) {
  960. ret.push(event.detail.__args__[0]);
  961. } else {// wxcomponent 组件或内置组件
  962. ret.push(event);
  963. }
  964. }
  965. } else {
  966. if (Array.isArray(arg) && arg[0] === 'o') {
  967. ret.push(getObjByArray(arg));
  968. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  969. ret.push(extraObj[arg]);
  970. } else {
  971. ret.push(arg);
  972. }
  973. }
  974. });
  975. return ret;
  976. }
  977. var ONCE = '~';
  978. var CUSTOM = '^';
  979. function isMatchEventType(eventType, optType) {
  980. return eventType === optType ||
  981. optType === 'regionchange' && (
  982. eventType === 'begin' ||
  983. eventType === 'end');
  984. }
  985. function getContextVm(vm) {
  986. var $parent = vm.$parent;
  987. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  988. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  989. $parent = $parent.$parent;
  990. }
  991. return $parent && $parent.$parent;
  992. }
  993. function handleEvent(event) {var _this = this;
  994. event = wrapper$1(event);
  995. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  996. var dataset = (event.currentTarget || event.target).dataset;
  997. if (!dataset) {
  998. return console.warn('事件信息不存在');
  999. }
  1000. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1001. if (!eventOpts) {
  1002. return console.warn('事件信息不存在');
  1003. }
  1004. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1005. var eventType = event.type;
  1006. var ret = [];
  1007. eventOpts.forEach(function (eventOpt) {
  1008. var type = eventOpt[0];
  1009. var eventsArray = eventOpt[1];
  1010. var isCustom = type.charAt(0) === CUSTOM;
  1011. type = isCustom ? type.slice(1) : type;
  1012. var isOnce = type.charAt(0) === ONCE;
  1013. type = isOnce ? type.slice(1) : type;
  1014. if (eventsArray && isMatchEventType(eventType, type)) {
  1015. eventsArray.forEach(function (eventArray) {
  1016. var methodName = eventArray[0];
  1017. if (methodName) {
  1018. var handlerCtx = _this.$vm;
  1019. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1020. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1021. }
  1022. if (methodName === '$emit') {
  1023. handlerCtx.$emit.apply(handlerCtx,
  1024. processEventArgs(
  1025. _this.$vm,
  1026. event,
  1027. eventArray[1],
  1028. eventArray[2],
  1029. isCustom,
  1030. methodName));
  1031. return;
  1032. }
  1033. var handler = handlerCtx[methodName];
  1034. if (!isFn(handler)) {
  1035. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1036. }
  1037. if (isOnce) {
  1038. if (handler.once) {
  1039. return;
  1040. }
  1041. handler.once = true;
  1042. }
  1043. var params = processEventArgs(
  1044. _this.$vm,
  1045. event,
  1046. eventArray[1],
  1047. eventArray[2],
  1048. isCustom,
  1049. methodName);
  1050. params = Array.isArray(params) ? params : [];
  1051. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1052. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1053. // eslint-disable-next-line no-sparse-arrays
  1054. params = params.concat([,,,,,,,,,, event]);
  1055. }
  1056. ret.push(handler.apply(handlerCtx, params));
  1057. }
  1058. });
  1059. }
  1060. });
  1061. if (
  1062. eventType === 'input' &&
  1063. ret.length === 1 &&
  1064. typeof ret[0] !== 'undefined')
  1065. {
  1066. return ret[0];
  1067. }
  1068. }
  1069. var eventChannels = {};
  1070. var eventChannelStack = [];
  1071. function getEventChannel(id) {
  1072. if (id) {
  1073. var eventChannel = eventChannels[id];
  1074. delete eventChannels[id];
  1075. return eventChannel;
  1076. }
  1077. return eventChannelStack.shift();
  1078. }
  1079. var hooks = [
  1080. 'onShow',
  1081. 'onHide',
  1082. 'onError',
  1083. 'onPageNotFound',
  1084. 'onThemeChange',
  1085. 'onUnhandledRejection'];
  1086. function initEventChannel() {
  1087. _vue.default.prototype.getOpenerEventChannel = function () {
  1088. // 微信小程序使用自身getOpenerEventChannel
  1089. {
  1090. return this.$scope.getOpenerEventChannel();
  1091. }
  1092. };
  1093. var callHook = _vue.default.prototype.__call_hook;
  1094. _vue.default.prototype.__call_hook = function (hook, args) {
  1095. if (hook === 'onLoad' && args && args.__id__) {
  1096. this.__eventChannel__ = getEventChannel(args.__id__);
  1097. delete args.__id__;
  1098. }
  1099. return callHook.call(this, hook, args);
  1100. };
  1101. }
  1102. function parseBaseApp(vm, _ref3)
  1103. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1104. initEventChannel();
  1105. if (vm.$options.store) {
  1106. _vue.default.prototype.$store = vm.$options.store;
  1107. }
  1108. _vue.default.prototype.mpHost = "mp-weixin";
  1109. _vue.default.mixin({
  1110. beforeCreate: function beforeCreate() {
  1111. if (!this.$options.mpType) {
  1112. return;
  1113. }
  1114. this.mpType = this.$options.mpType;
  1115. this.$mp = _defineProperty({
  1116. data: {} },
  1117. this.mpType, this.$options.mpInstance);
  1118. this.$scope = this.$options.mpInstance;
  1119. delete this.$options.mpType;
  1120. delete this.$options.mpInstance;
  1121. if (this.mpType === 'page') {// hack vue-i18n
  1122. var app = getApp();
  1123. if (app.$vm && app.$vm.$i18n) {
  1124. this._i18n = app.$vm.$i18n;
  1125. }
  1126. }
  1127. if (this.mpType !== 'app') {
  1128. initRefs(this);
  1129. initMocks(this, mocks);
  1130. }
  1131. } });
  1132. var appOptions = {
  1133. onLaunch: function onLaunch(args) {
  1134. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1135. return;
  1136. }
  1137. {
  1138. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1139. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1140. }
  1141. }
  1142. this.$vm = vm;
  1143. this.$vm.$mp = {
  1144. app: this };
  1145. this.$vm.$scope = this;
  1146. // vm 上也挂载 globalData
  1147. this.$vm.globalData = this.globalData;
  1148. this.$vm._isMounted = true;
  1149. this.$vm.__call_hook('mounted', args);
  1150. this.$vm.__call_hook('onLaunch', args);
  1151. } };
  1152. // 兼容旧版本 globalData
  1153. appOptions.globalData = vm.$options.globalData || {};
  1154. // 将 methods 中的方法挂在 getApp() 中
  1155. var methods = vm.$options.methods;
  1156. if (methods) {
  1157. Object.keys(methods).forEach(function (name) {
  1158. appOptions[name] = methods[name];
  1159. });
  1160. }
  1161. initHooks(appOptions, hooks);
  1162. return appOptions;
  1163. }
  1164. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1165. function findVmByVueId(vm, vuePid) {
  1166. var $children = vm.$children;
  1167. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1168. for (var i = $children.length - 1; i >= 0; i--) {
  1169. var childVm = $children[i];
  1170. if (childVm.$scope._$vueId === vuePid) {
  1171. return childVm;
  1172. }
  1173. }
  1174. // 反向递归查找
  1175. var parentVm;
  1176. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1177. parentVm = findVmByVueId($children[_i], vuePid);
  1178. if (parentVm) {
  1179. return parentVm;
  1180. }
  1181. }
  1182. }
  1183. function initBehavior(options) {
  1184. return Behavior(options);
  1185. }
  1186. function isPage() {
  1187. return !!this.route;
  1188. }
  1189. function initRelation(detail) {
  1190. this.triggerEvent('__l', detail);
  1191. }
  1192. function selectAllComponents(mpInstance, selector, $refs) {
  1193. var components = mpInstance.selectAllComponents(selector);
  1194. components.forEach(function (component) {
  1195. var ref = component.dataset.ref;
  1196. $refs[ref] = component.$vm || component;
  1197. {
  1198. if (component.dataset.vueGeneric === 'scoped') {
  1199. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1200. selectAllComponents(scopedComponent, selector, $refs);
  1201. });
  1202. }
  1203. }
  1204. });
  1205. }
  1206. function initRefs(vm) {
  1207. var mpInstance = vm.$scope;
  1208. Object.defineProperty(vm, '$refs', {
  1209. get: function get() {
  1210. var $refs = {};
  1211. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1212. // TODO 暂不考虑 for 中的 scoped
  1213. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1214. forComponents.forEach(function (component) {
  1215. var ref = component.dataset.ref;
  1216. if (!$refs[ref]) {
  1217. $refs[ref] = [];
  1218. }
  1219. $refs[ref].push(component.$vm || component);
  1220. });
  1221. return $refs;
  1222. } });
  1223. }
  1224. function handleLink(event) {var _ref4 =
  1225. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1226. var parentVm;
  1227. if (vuePid) {
  1228. parentVm = findVmByVueId(this.$vm, vuePid);
  1229. }
  1230. if (!parentVm) {
  1231. parentVm = this.$vm;
  1232. }
  1233. vueOptions.parent = parentVm;
  1234. }
  1235. function parseApp(vm) {
  1236. return parseBaseApp(vm, {
  1237. mocks: mocks,
  1238. initRefs: initRefs });
  1239. }
  1240. function createApp(vm) {
  1241. App(parseApp(vm));
  1242. return vm;
  1243. }
  1244. var encodeReserveRE = /[!'()*]/g;
  1245. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1246. var commaRE = /%2C/g;
  1247. // fixed encodeURIComponent which is more conformant to RFC3986:
  1248. // - escapes [!'()*]
  1249. // - preserve commas
  1250. var encode = function encode(str) {return encodeURIComponent(str).
  1251. replace(encodeReserveRE, encodeReserveReplacer).
  1252. replace(commaRE, ',');};
  1253. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1254. var res = obj ? Object.keys(obj).map(function (key) {
  1255. var val = obj[key];
  1256. if (val === undefined) {
  1257. return '';
  1258. }
  1259. if (val === null) {
  1260. return encodeStr(key);
  1261. }
  1262. if (Array.isArray(val)) {
  1263. var result = [];
  1264. val.forEach(function (val2) {
  1265. if (val2 === undefined) {
  1266. return;
  1267. }
  1268. if (val2 === null) {
  1269. result.push(encodeStr(key));
  1270. } else {
  1271. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1272. }
  1273. });
  1274. return result.join('&');
  1275. }
  1276. return encodeStr(key) + '=' + encodeStr(val);
  1277. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1278. return res ? "?".concat(res) : '';
  1279. }
  1280. function parseBaseComponent(vueComponentOptions)
  1281. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1282. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1283. var options = _objectSpread({
  1284. multipleSlots: true,
  1285. addGlobalClass: true },
  1286. vueOptions.options || {});
  1287. {
  1288. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1289. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1290. Object.assign(options, vueOptions['mp-weixin'].options);
  1291. }
  1292. }
  1293. var componentOptions = {
  1294. options: options,
  1295. data: initData(vueOptions, _vue.default.prototype),
  1296. behaviors: initBehaviors(vueOptions, initBehavior),
  1297. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1298. lifetimes: {
  1299. attached: function attached() {
  1300. var properties = this.properties;
  1301. var options = {
  1302. mpType: isPage.call(this) ? 'page' : 'component',
  1303. mpInstance: this,
  1304. propsData: properties };
  1305. initVueIds(properties.vueId, this);
  1306. // 处理父子关系
  1307. initRelation.call(this, {
  1308. vuePid: this._$vuePid,
  1309. vueOptions: options });
  1310. // 初始化 vue 实例
  1311. this.$vm = new VueComponent(options);
  1312. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1313. initSlots(this.$vm, properties.vueSlots);
  1314. // 触发首次 setData
  1315. this.$vm.$mount();
  1316. },
  1317. ready: function ready() {
  1318. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1319. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1320. if (this.$vm) {
  1321. this.$vm._isMounted = true;
  1322. this.$vm.__call_hook('mounted');
  1323. this.$vm.__call_hook('onReady');
  1324. }
  1325. },
  1326. detached: function detached() {
  1327. this.$vm && this.$vm.$destroy();
  1328. } },
  1329. pageLifetimes: {
  1330. show: function show(args) {
  1331. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1332. },
  1333. hide: function hide() {
  1334. this.$vm && this.$vm.__call_hook('onPageHide');
  1335. },
  1336. resize: function resize(size) {
  1337. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1338. } },
  1339. methods: {
  1340. __l: handleLink,
  1341. __e: handleEvent } };
  1342. // externalClasses
  1343. if (vueOptions.externalClasses) {
  1344. componentOptions.externalClasses = vueOptions.externalClasses;
  1345. }
  1346. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1347. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1348. componentOptions.methods[callMethod] = function (args) {
  1349. return this.$vm[callMethod](args);
  1350. };
  1351. });
  1352. }
  1353. if (isPage) {
  1354. return componentOptions;
  1355. }
  1356. return [componentOptions, VueComponent];
  1357. }
  1358. function parseComponent(vueComponentOptions) {
  1359. return parseBaseComponent(vueComponentOptions, {
  1360. isPage: isPage,
  1361. initRelation: initRelation });
  1362. }
  1363. var hooks$1 = [
  1364. 'onShow',
  1365. 'onHide',
  1366. 'onUnload'];
  1367. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1368. function parseBasePage(vuePageOptions, _ref6)
  1369. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1370. var pageOptions = parseComponent(vuePageOptions);
  1371. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1372. pageOptions.methods.onLoad = function (query) {
  1373. this.options = query;
  1374. var copyQuery = Object.assign({}, query);
  1375. delete copyQuery.__id__;
  1376. this.$page = {
  1377. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1378. this.$vm.$mp.query = query; // 兼容 mpvue
  1379. this.$vm.__call_hook('onLoad', query);
  1380. };
  1381. return pageOptions;
  1382. }
  1383. function parsePage(vuePageOptions) {
  1384. return parseBasePage(vuePageOptions, {
  1385. isPage: isPage,
  1386. initRelation: initRelation });
  1387. }
  1388. function createPage(vuePageOptions) {
  1389. {
  1390. return Component(parsePage(vuePageOptions));
  1391. }
  1392. }
  1393. function createComponent(vueOptions) {
  1394. {
  1395. return Component(parseComponent(vueOptions));
  1396. }
  1397. }
  1398. function createSubpackageApp(vm) {
  1399. var appOptions = parseApp(vm);
  1400. var app = getApp({
  1401. allowDefault: true });
  1402. var globalData = app.globalData;
  1403. if (globalData) {
  1404. Object.keys(appOptions.globalData).forEach(function (name) {
  1405. if (!hasOwn(globalData, name)) {
  1406. globalData[name] = appOptions.globalData[name];
  1407. }
  1408. });
  1409. }
  1410. Object.keys(appOptions).forEach(function (name) {
  1411. if (!hasOwn(app, name)) {
  1412. app[name] = appOptions[name];
  1413. }
  1414. });
  1415. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1416. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1417. appOptions.onShow.apply(app, args);
  1418. });
  1419. }
  1420. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1421. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1422. appOptions.onHide.apply(app, args);
  1423. });
  1424. }
  1425. if (isFn(appOptions.onLaunch)) {
  1426. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1427. appOptions.onLaunch.call(app, args);
  1428. }
  1429. return vm;
  1430. }
  1431. todos.forEach(function (todoApi) {
  1432. protocols[todoApi] = false;
  1433. });
  1434. canIUses.forEach(function (canIUseApi) {
  1435. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1436. canIUseApi;
  1437. if (!wx.canIUse(apiName)) {
  1438. protocols[canIUseApi] = false;
  1439. }
  1440. });
  1441. var uni = {};
  1442. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1443. uni = new Proxy({}, {
  1444. get: function get(target, name) {
  1445. if (hasOwn(target, name)) {
  1446. return target[name];
  1447. }
  1448. if (baseApi[name]) {
  1449. return baseApi[name];
  1450. }
  1451. if (api[name]) {
  1452. return promisify(name, api[name]);
  1453. }
  1454. {
  1455. if (extraApi[name]) {
  1456. return promisify(name, extraApi[name]);
  1457. }
  1458. if (todoApis[name]) {
  1459. return promisify(name, todoApis[name]);
  1460. }
  1461. }
  1462. if (eventApi[name]) {
  1463. return eventApi[name];
  1464. }
  1465. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1466. return;
  1467. }
  1468. return promisify(name, wrapper(name, wx[name]));
  1469. },
  1470. set: function set(target, name, value) {
  1471. target[name] = value;
  1472. return true;
  1473. } });
  1474. } else {
  1475. Object.keys(baseApi).forEach(function (name) {
  1476. uni[name] = baseApi[name];
  1477. });
  1478. {
  1479. Object.keys(todoApis).forEach(function (name) {
  1480. uni[name] = promisify(name, todoApis[name]);
  1481. });
  1482. Object.keys(extraApi).forEach(function (name) {
  1483. uni[name] = promisify(name, todoApis[name]);
  1484. });
  1485. }
  1486. Object.keys(eventApi).forEach(function (name) {
  1487. uni[name] = eventApi[name];
  1488. });
  1489. Object.keys(api).forEach(function (name) {
  1490. uni[name] = promisify(name, api[name]);
  1491. });
  1492. Object.keys(wx).forEach(function (name) {
  1493. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1494. uni[name] = promisify(name, wrapper(name, wx[name]));
  1495. }
  1496. });
  1497. }
  1498. wx.createApp = createApp;
  1499. wx.createPage = createPage;
  1500. wx.createComponent = createComponent;
  1501. wx.createSubpackageApp = createSubpackageApp;
  1502. var uni$1 = uni;var _default =
  1503. uni$1;exports.default = _default;
  1504. /***/ }),
  1505. /***/ 10:
  1506. /*!********************************************!*\
  1507. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  1508. \********************************************/
  1509. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  1510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1511. "use strict";
  1512. __webpack_require__.r(__webpack_exports__);
  1513. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  1514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  1515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  1516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  1517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  1518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  1519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  1520. /*!
  1521. * vuex v3.4.0
  1522. * (c) 2020 Evan You
  1523. * @license MIT
  1524. */
  1525. function applyMixin (Vue) {
  1526. var version = Number(Vue.version.split('.')[0]);
  1527. if (version >= 2) {
  1528. Vue.mixin({ beforeCreate: vuexInit });
  1529. } else {
  1530. // override init and inject vuex init procedure
  1531. // for 1.x backwards compatibility.
  1532. var _init = Vue.prototype._init;
  1533. Vue.prototype._init = function (options) {
  1534. if ( options === void 0 ) options = {};
  1535. options.init = options.init
  1536. ? [vuexInit].concat(options.init)
  1537. : vuexInit;
  1538. _init.call(this, options);
  1539. };
  1540. }
  1541. /**
  1542. * Vuex init hook, injected into each instances init hooks list.
  1543. */
  1544. function vuexInit () {
  1545. var options = this.$options;
  1546. // store injection
  1547. if (options.store) {
  1548. this.$store = typeof options.store === 'function'
  1549. ? options.store()
  1550. : options.store;
  1551. } else if (options.parent && options.parent.$store) {
  1552. this.$store = options.parent.$store;
  1553. }
  1554. }
  1555. }
  1556. var target = typeof window !== 'undefined'
  1557. ? window
  1558. : typeof global !== 'undefined'
  1559. ? global
  1560. : {};
  1561. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1562. function devtoolPlugin (store) {
  1563. if (!devtoolHook) { return }
  1564. store._devtoolHook = devtoolHook;
  1565. devtoolHook.emit('vuex:init', store);
  1566. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  1567. store.replaceState(targetState);
  1568. });
  1569. store.subscribe(function (mutation, state) {
  1570. devtoolHook.emit('vuex:mutation', mutation, state);
  1571. }, { prepend: true });
  1572. store.subscribeAction(function (action, state) {
  1573. devtoolHook.emit('vuex:action', action, state);
  1574. }, { prepend: true });
  1575. }
  1576. /**
  1577. * Get the first item that pass the test
  1578. * by second argument function
  1579. *
  1580. * @param {Array} list
  1581. * @param {Function} f
  1582. * @return {*}
  1583. */
  1584. /**
  1585. * forEach for object
  1586. */
  1587. function forEachValue (obj, fn) {
  1588. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  1589. }
  1590. function isObject (obj) {
  1591. return obj !== null && typeof obj === 'object'
  1592. }
  1593. function isPromise (val) {
  1594. return val && typeof val.then === 'function'
  1595. }
  1596. function assert (condition, msg) {
  1597. if (!condition) { throw new Error(("[vuex] " + msg)) }
  1598. }
  1599. function partial (fn, arg) {
  1600. return function () {
  1601. return fn(arg)
  1602. }
  1603. }
  1604. // Base data struct for store's module, package with some attribute and method
  1605. var Module = function Module (rawModule, runtime) {
  1606. this.runtime = runtime;
  1607. // Store some children item
  1608. this._children = Object.create(null);
  1609. // Store the origin module object which passed by programmer
  1610. this._rawModule = rawModule;
  1611. var rawState = rawModule.state;
  1612. // Store the origin module's state
  1613. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  1614. };
  1615. var prototypeAccessors = { namespaced: { configurable: true } };
  1616. prototypeAccessors.namespaced.get = function () {
  1617. return !!this._rawModule.namespaced
  1618. };
  1619. Module.prototype.addChild = function addChild (key, module) {
  1620. this._children[key] = module;
  1621. };
  1622. Module.prototype.removeChild = function removeChild (key) {
  1623. delete this._children[key];
  1624. };
  1625. Module.prototype.getChild = function getChild (key) {
  1626. return this._children[key]
  1627. };
  1628. Module.prototype.hasChild = function hasChild (key) {
  1629. return key in this._children
  1630. };
  1631. Module.prototype.update = function update (rawModule) {
  1632. this._rawModule.namespaced = rawModule.namespaced;
  1633. if (rawModule.actions) {
  1634. this._rawModule.actions = rawModule.actions;
  1635. }
  1636. if (rawModule.mutations) {
  1637. this._rawModule.mutations = rawModule.mutations;
  1638. }
  1639. if (rawModule.getters) {
  1640. this._rawModule.getters = rawModule.getters;
  1641. }
  1642. };
  1643. Module.prototype.forEachChild = function forEachChild (fn) {
  1644. forEachValue(this._children, fn);
  1645. };
  1646. Module.prototype.forEachGetter = function forEachGetter (fn) {
  1647. if (this._rawModule.getters) {
  1648. forEachValue(this._rawModule.getters, fn);
  1649. }
  1650. };
  1651. Module.prototype.forEachAction = function forEachAction (fn) {
  1652. if (this._rawModule.actions) {
  1653. forEachValue(this._rawModule.actions, fn);
  1654. }
  1655. };
  1656. Module.prototype.forEachMutation = function forEachMutation (fn) {
  1657. if (this._rawModule.mutations) {
  1658. forEachValue(this._rawModule.mutations, fn);
  1659. }
  1660. };
  1661. Object.defineProperties( Module.prototype, prototypeAccessors );
  1662. var ModuleCollection = function ModuleCollection (rawRootModule) {
  1663. // register root module (Vuex.Store options)
  1664. this.register([], rawRootModule, false);
  1665. };
  1666. ModuleCollection.prototype.get = function get (path) {
  1667. return path.reduce(function (module, key) {
  1668. return module.getChild(key)
  1669. }, this.root)
  1670. };
  1671. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  1672. var module = this.root;
  1673. return path.reduce(function (namespace, key) {
  1674. module = module.getChild(key);
  1675. return namespace + (module.namespaced ? key + '/' : '')
  1676. }, '')
  1677. };
  1678. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  1679. update([], this.root, rawRootModule);
  1680. };
  1681. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  1682. var this$1 = this;
  1683. if ( runtime === void 0 ) runtime = true;
  1684. if ((true)) {
  1685. assertRawModule(path, rawModule);
  1686. }
  1687. var newModule = new Module(rawModule, runtime);
  1688. if (path.length === 0) {
  1689. this.root = newModule;
  1690. } else {
  1691. var parent = this.get(path.slice(0, -1));
  1692. parent.addChild(path[path.length - 1], newModule);
  1693. }
  1694. // register nested modules
  1695. if (rawModule.modules) {
  1696. forEachValue(rawModule.modules, function (rawChildModule, key) {
  1697. this$1.register(path.concat(key), rawChildModule, runtime);
  1698. });
  1699. }
  1700. };
  1701. ModuleCollection.prototype.unregister = function unregister (path) {
  1702. var parent = this.get(path.slice(0, -1));
  1703. var key = path[path.length - 1];
  1704. if (!parent.getChild(key).runtime) { return }
  1705. parent.removeChild(key);
  1706. };
  1707. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  1708. var parent = this.get(path.slice(0, -1));
  1709. var key = path[path.length - 1];
  1710. return parent.hasChild(key)
  1711. };
  1712. function update (path, targetModule, newModule) {
  1713. if ((true)) {
  1714. assertRawModule(path, newModule);
  1715. }
  1716. // update target module
  1717. targetModule.update(newModule);
  1718. // update nested modules
  1719. if (newModule.modules) {
  1720. for (var key in newModule.modules) {
  1721. if (!targetModule.getChild(key)) {
  1722. if ((true)) {
  1723. console.warn(
  1724. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  1725. 'manual reload is needed'
  1726. );
  1727. }
  1728. return
  1729. }
  1730. update(
  1731. path.concat(key),
  1732. targetModule.getChild(key),
  1733. newModule.modules[key]
  1734. );
  1735. }
  1736. }
  1737. }
  1738. var functionAssert = {
  1739. assert: function (value) { return typeof value === 'function'; },
  1740. expected: 'function'
  1741. };
  1742. var objectAssert = {
  1743. assert: function (value) { return typeof value === 'function' ||
  1744. (typeof value === 'object' && typeof value.handler === 'function'); },
  1745. expected: 'function or object with "handler" function'
  1746. };
  1747. var assertTypes = {
  1748. getters: functionAssert,
  1749. mutations: functionAssert,
  1750. actions: objectAssert
  1751. };
  1752. function assertRawModule (path, rawModule) {
  1753. Object.keys(assertTypes).forEach(function (key) {
  1754. if (!rawModule[key]) { return }
  1755. var assertOptions = assertTypes[key];
  1756. forEachValue(rawModule[key], function (value, type) {
  1757. assert(
  1758. assertOptions.assert(value),
  1759. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  1760. );
  1761. });
  1762. });
  1763. }
  1764. function makeAssertionMessage (path, key, type, value, expected) {
  1765. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  1766. if (path.length > 0) {
  1767. buf += " in module \"" + (path.join('.')) + "\"";
  1768. }
  1769. buf += " is " + (JSON.stringify(value)) + ".";
  1770. return buf
  1771. }
  1772. var Vue; // bind on install
  1773. var Store = function Store (options) {
  1774. var this$1 = this;
  1775. if ( options === void 0 ) options = {};
  1776. // Auto install if it is not done yet and `window` has `Vue`.
  1777. // To allow users to avoid auto-installation in some cases,
  1778. // this code should be placed here. See #731
  1779. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  1780. install(window.Vue);
  1781. }
  1782. if ((true)) {
  1783. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  1784. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  1785. assert(this instanceof Store, "store must be called with the new operator.");
  1786. }
  1787. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  1788. var strict = options.strict; if ( strict === void 0 ) strict = false;
  1789. // store internal state
  1790. this._committing = false;
  1791. this._actions = Object.create(null);
  1792. this._actionSubscribers = [];
  1793. this._mutations = Object.create(null);
  1794. this._wrappedGetters = Object.create(null);
  1795. this._modules = new ModuleCollection(options);
  1796. this._modulesNamespaceMap = Object.create(null);
  1797. this._subscribers = [];
  1798. this._watcherVM = new Vue();
  1799. this._makeLocalGettersCache = Object.create(null);
  1800. // bind commit and dispatch to self
  1801. var store = this;
  1802. var ref = this;
  1803. var dispatch = ref.dispatch;
  1804. var commit = ref.commit;
  1805. this.dispatch = function boundDispatch (type, payload) {
  1806. return dispatch.call(store, type, payload)
  1807. };
  1808. this.commit = function boundCommit (type, payload, options) {
  1809. return commit.call(store, type, payload, options)
  1810. };
  1811. // strict mode
  1812. this.strict = strict;
  1813. var state = this._modules.root.state;
  1814. // init root module.
  1815. // this also recursively registers all sub-modules
  1816. // and collects all module getters inside this._wrappedGetters
  1817. installModule(this, state, [], this._modules.root);
  1818. // initialize the store vm, which is responsible for the reactivity
  1819. // (also registers _wrappedGetters as computed properties)
  1820. resetStoreVM(this, state);
  1821. // apply plugins
  1822. plugins.forEach(function (plugin) { return plugin(this$1); });
  1823. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  1824. if (useDevtools) {
  1825. devtoolPlugin(this);
  1826. }
  1827. };
  1828. var prototypeAccessors$1 = { state: { configurable: true } };
  1829. prototypeAccessors$1.state.get = function () {
  1830. return this._vm._data.$$state
  1831. };
  1832. prototypeAccessors$1.state.set = function (v) {
  1833. if ((true)) {
  1834. assert(false, "use store.replaceState() to explicit replace store state.");
  1835. }
  1836. };
  1837. Store.prototype.commit = function commit (_type, _payload, _options) {
  1838. var this$1 = this;
  1839. // check object-style commit
  1840. var ref = unifyObjectStyle(_type, _payload, _options);
  1841. var type = ref.type;
  1842. var payload = ref.payload;
  1843. var options = ref.options;
  1844. var mutation = { type: type, payload: payload };
  1845. var entry = this._mutations[type];
  1846. if (!entry) {
  1847. if ((true)) {
  1848. console.error(("[vuex] unknown mutation type: " + type));
  1849. }
  1850. return
  1851. }
  1852. this._withCommit(function () {
  1853. entry.forEach(function commitIterator (handler) {
  1854. handler(payload);
  1855. });
  1856. });
  1857. this._subscribers
  1858. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  1859. .forEach(function (sub) { return sub(mutation, this$1.state); });
  1860. if (
  1861. ( true) &&
  1862. options && options.silent
  1863. ) {
  1864. console.warn(
  1865. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  1866. 'Use the filter functionality in the vue-devtools'
  1867. );
  1868. }
  1869. };
  1870. Store.prototype.dispatch = function dispatch (_type, _payload) {
  1871. var this$1 = this;
  1872. // check object-style dispatch
  1873. var ref = unifyObjectStyle(_type, _payload);
  1874. var type = ref.type;
  1875. var payload = ref.payload;
  1876. var action = { type: type, payload: payload };
  1877. var entry = this._actions[type];
  1878. if (!entry) {
  1879. if ((true)) {
  1880. console.error(("[vuex] unknown action type: " + type));
  1881. }
  1882. return
  1883. }
  1884. try {
  1885. this._actionSubscribers
  1886. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  1887. .filter(function (sub) { return sub.before; })
  1888. .forEach(function (sub) { return sub.before(action, this$1.state); });
  1889. } catch (e) {
  1890. if ((true)) {
  1891. console.warn("[vuex] error in before action subscribers: ");
  1892. console.error(e);
  1893. }
  1894. }
  1895. var result = entry.length > 1
  1896. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  1897. : entry[0](payload);
  1898. return new Promise(function (resolve, reject) {
  1899. result.then(function (res) {
  1900. try {
  1901. this$1._actionSubscribers
  1902. .filter(function (sub) { return sub.after; })
  1903. .forEach(function (sub) { return sub.after(action, this$1.state); });
  1904. } catch (e) {
  1905. if ((true)) {
  1906. console.warn("[vuex] error in after action subscribers: ");
  1907. console.error(e);
  1908. }
  1909. }
  1910. resolve(res);
  1911. }, function (error) {
  1912. try {
  1913. this$1._actionSubscribers
  1914. .filter(function (sub) { return sub.error; })
  1915. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  1916. } catch (e) {
  1917. if ((true)) {
  1918. console.warn("[vuex] error in error action subscribers: ");
  1919. console.error(e);
  1920. }
  1921. }
  1922. reject(error);
  1923. });
  1924. })
  1925. };
  1926. Store.prototype.subscribe = function subscribe (fn, options) {
  1927. return genericSubscribe(fn, this._subscribers, options)
  1928. };
  1929. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  1930. var subs = typeof fn === 'function' ? { before: fn } : fn;
  1931. return genericSubscribe(subs, this._actionSubscribers, options)
  1932. };
  1933. Store.prototype.watch = function watch (getter, cb, options) {
  1934. var this$1 = this;
  1935. if ((true)) {
  1936. assert(typeof getter === 'function', "store.watch only accepts a function.");
  1937. }
  1938. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  1939. };
  1940. Store.prototype.replaceState = function replaceState (state) {
  1941. var this$1 = this;
  1942. this._withCommit(function () {
  1943. this$1._vm._data.$$state = state;
  1944. });
  1945. };
  1946. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  1947. if ( options === void 0 ) options = {};
  1948. if (typeof path === 'string') { path = [path]; }
  1949. if ((true)) {
  1950. assert(Array.isArray(path), "module path must be a string or an Array.");
  1951. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  1952. }
  1953. this._modules.register(path, rawModule);
  1954. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  1955. // reset store to update getters...
  1956. resetStoreVM(this, this.state);
  1957. };
  1958. Store.prototype.unregisterModule = function unregisterModule (path) {
  1959. var this$1 = this;
  1960. if (typeof path === 'string') { path = [path]; }
  1961. if ((true)) {
  1962. assert(Array.isArray(path), "module path must be a string or an Array.");
  1963. }
  1964. this._modules.unregister(path);
  1965. this._withCommit(function () {
  1966. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  1967. Vue.delete(parentState, path[path.length - 1]);
  1968. });
  1969. resetStore(this);
  1970. };
  1971. Store.prototype.hasModule = function hasModule (path) {
  1972. if (typeof path === 'string') { path = [path]; }
  1973. if ((true)) {
  1974. assert(Array.isArray(path), "module path must be a string or an Array.");
  1975. }
  1976. return this._modules.isRegistered(path)
  1977. };
  1978. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  1979. this._modules.update(newOptions);
  1980. resetStore(this, true);
  1981. };
  1982. Store.prototype._withCommit = function _withCommit (fn) {
  1983. var committing = this._committing;
  1984. this._committing = true;
  1985. fn();
  1986. this._committing = committing;
  1987. };
  1988. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  1989. function genericSubscribe (fn, subs, options) {
  1990. if (subs.indexOf(fn) < 0) {
  1991. options && options.prepend
  1992. ? subs.unshift(fn)
  1993. : subs.push(fn);
  1994. }
  1995. return function () {
  1996. var i = subs.indexOf(fn);
  1997. if (i > -1) {
  1998. subs.splice(i, 1);
  1999. }
  2000. }
  2001. }
  2002. function resetStore (store, hot) {
  2003. store._actions = Object.create(null);
  2004. store._mutations = Object.create(null);
  2005. store._wrappedGetters = Object.create(null);
  2006. store._modulesNamespaceMap = Object.create(null);
  2007. var state = store.state;
  2008. // init all modules
  2009. installModule(store, state, [], store._modules.root, true);
  2010. // reset vm
  2011. resetStoreVM(store, state, hot);
  2012. }
  2013. function resetStoreVM (store, state, hot) {
  2014. var oldVm = store._vm;
  2015. // bind store public getters
  2016. store.getters = {};
  2017. // reset local getters cache
  2018. store._makeLocalGettersCache = Object.create(null);
  2019. var wrappedGetters = store._wrappedGetters;
  2020. var computed = {};
  2021. forEachValue(wrappedGetters, function (fn, key) {
  2022. // use computed to leverage its lazy-caching mechanism
  2023. // direct inline function use will lead to closure preserving oldVm.
  2024. // using partial to return function with only arguments preserved in closure environment.
  2025. computed[key] = partial(fn, store);
  2026. Object.defineProperty(store.getters, key, {
  2027. get: function () { return store._vm[key]; },
  2028. enumerable: true // for local getters
  2029. });
  2030. });
  2031. // use a Vue instance to store the state tree
  2032. // suppress warnings just in case the user has added
  2033. // some funky global mixins
  2034. var silent = Vue.config.silent;
  2035. Vue.config.silent = true;
  2036. store._vm = new Vue({
  2037. data: {
  2038. $$state: state
  2039. },
  2040. computed: computed
  2041. });
  2042. Vue.config.silent = silent;
  2043. // enable strict mode for new vm
  2044. if (store.strict) {
  2045. enableStrictMode(store);
  2046. }
  2047. if (oldVm) {
  2048. if (hot) {
  2049. // dispatch changes in all subscribed watchers
  2050. // to force getter re-evaluation for hot reloading.
  2051. store._withCommit(function () {
  2052. oldVm._data.$$state = null;
  2053. });
  2054. }
  2055. Vue.nextTick(function () { return oldVm.$destroy(); });
  2056. }
  2057. }
  2058. function installModule (store, rootState, path, module, hot) {
  2059. var isRoot = !path.length;
  2060. var namespace = store._modules.getNamespace(path);
  2061. // register in namespace map
  2062. if (module.namespaced) {
  2063. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2064. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2065. }
  2066. store._modulesNamespaceMap[namespace] = module;
  2067. }
  2068. // set state
  2069. if (!isRoot && !hot) {
  2070. var parentState = getNestedState(rootState, path.slice(0, -1));
  2071. var moduleName = path[path.length - 1];
  2072. store._withCommit(function () {
  2073. if ((true)) {
  2074. if (moduleName in parentState) {
  2075. console.warn(
  2076. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2077. );
  2078. }
  2079. }
  2080. Vue.set(parentState, moduleName, module.state);
  2081. });
  2082. }
  2083. var local = module.context = makeLocalContext(store, namespace, path);
  2084. module.forEachMutation(function (mutation, key) {
  2085. var namespacedType = namespace + key;
  2086. registerMutation(store, namespacedType, mutation, local);
  2087. });
  2088. module.forEachAction(function (action, key) {
  2089. var type = action.root ? key : namespace + key;
  2090. var handler = action.handler || action;
  2091. registerAction(store, type, handler, local);
  2092. });
  2093. module.forEachGetter(function (getter, key) {
  2094. var namespacedType = namespace + key;
  2095. registerGetter(store, namespacedType, getter, local);
  2096. });
  2097. module.forEachChild(function (child, key) {
  2098. installModule(store, rootState, path.concat(key), child, hot);
  2099. });
  2100. }
  2101. /**
  2102. * make localized dispatch, commit, getters and state
  2103. * if there is no namespace, just use root ones
  2104. */
  2105. function makeLocalContext (store, namespace, path) {
  2106. var noNamespace = namespace === '';
  2107. var local = {
  2108. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2109. var args = unifyObjectStyle(_type, _payload, _options);
  2110. var payload = args.payload;
  2111. var options = args.options;
  2112. var type = args.type;
  2113. if (!options || !options.root) {
  2114. type = namespace + type;
  2115. if (( true) && !store._actions[type]) {
  2116. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2117. return
  2118. }
  2119. }
  2120. return store.dispatch(type, payload)
  2121. },
  2122. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2123. var args = unifyObjectStyle(_type, _payload, _options);
  2124. var payload = args.payload;
  2125. var options = args.options;
  2126. var type = args.type;
  2127. if (!options || !options.root) {
  2128. type = namespace + type;
  2129. if (( true) && !store._mutations[type]) {
  2130. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2131. return
  2132. }
  2133. }
  2134. store.commit(type, payload, options);
  2135. }
  2136. };
  2137. // getters and state object must be gotten lazily
  2138. // because they will be changed by vm update
  2139. Object.defineProperties(local, {
  2140. getters: {
  2141. get: noNamespace
  2142. ? function () { return store.getters; }
  2143. : function () { return makeLocalGetters(store, namespace); }
  2144. },
  2145. state: {
  2146. get: function () { return getNestedState(store.state, path); }
  2147. }
  2148. });
  2149. return local
  2150. }
  2151. function makeLocalGetters (store, namespace) {
  2152. if (!store._makeLocalGettersCache[namespace]) {
  2153. var gettersProxy = {};
  2154. var splitPos = namespace.length;
  2155. Object.keys(store.getters).forEach(function (type) {
  2156. // skip if the target getter is not match this namespace
  2157. if (type.slice(0, splitPos) !== namespace) { return }
  2158. // extract local getter type
  2159. var localType = type.slice(splitPos);
  2160. // Add a port to the getters proxy.
  2161. // Define as getter property because
  2162. // we do not want to evaluate the getters in this time.
  2163. Object.defineProperty(gettersProxy, localType, {
  2164. get: function () { return store.getters[type]; },
  2165. enumerable: true
  2166. });
  2167. });
  2168. store._makeLocalGettersCache[namespace] = gettersProxy;
  2169. }
  2170. return store._makeLocalGettersCache[namespace]
  2171. }
  2172. function registerMutation (store, type, handler, local) {
  2173. var entry = store._mutations[type] || (store._mutations[type] = []);
  2174. entry.push(function wrappedMutationHandler (payload) {
  2175. handler.call(store, local.state, payload);
  2176. });
  2177. }
  2178. function registerAction (store, type, handler, local) {
  2179. var entry = store._actions[type] || (store._actions[type] = []);
  2180. entry.push(function wrappedActionHandler (payload) {
  2181. var res = handler.call(store, {
  2182. dispatch: local.dispatch,
  2183. commit: local.commit,
  2184. getters: local.getters,
  2185. state: local.state,
  2186. rootGetters: store.getters,
  2187. rootState: store.state
  2188. }, payload);
  2189. if (!isPromise(res)) {
  2190. res = Promise.resolve(res);
  2191. }
  2192. if (store._devtoolHook) {
  2193. return res.catch(function (err) {
  2194. store._devtoolHook.emit('vuex:error', err);
  2195. throw err
  2196. })
  2197. } else {
  2198. return res
  2199. }
  2200. });
  2201. }
  2202. function registerGetter (store, type, rawGetter, local) {
  2203. if (store._wrappedGetters[type]) {
  2204. if ((true)) {
  2205. console.error(("[vuex] duplicate getter key: " + type));
  2206. }
  2207. return
  2208. }
  2209. store._wrappedGetters[type] = function wrappedGetter (store) {
  2210. return rawGetter(
  2211. local.state, // local state
  2212. local.getters, // local getters
  2213. store.state, // root state
  2214. store.getters // root getters
  2215. )
  2216. };
  2217. }
  2218. function enableStrictMode (store) {
  2219. store._vm.$watch(function () { return this._data.$$state }, function () {
  2220. if ((true)) {
  2221. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  2222. }
  2223. }, { deep: true, sync: true });
  2224. }
  2225. function getNestedState (state, path) {
  2226. return path.reduce(function (state, key) { return state[key]; }, state)
  2227. }
  2228. function unifyObjectStyle (type, payload, options) {
  2229. if (isObject(type) && type.type) {
  2230. options = payload;
  2231. payload = type;
  2232. type = type.type;
  2233. }
  2234. if ((true)) {
  2235. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  2236. }
  2237. return { type: type, payload: payload, options: options }
  2238. }
  2239. function install (_Vue) {
  2240. if (Vue && _Vue === Vue) {
  2241. if ((true)) {
  2242. console.error(
  2243. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2244. );
  2245. }
  2246. return
  2247. }
  2248. Vue = _Vue;
  2249. applyMixin(Vue);
  2250. }
  2251. /**
  2252. * Reduce the code which written in Vue.js for getting the state.
  2253. * @param {String} [namespace] - Module's namespace
  2254. * @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.
  2255. * @param {Object}
  2256. */
  2257. var mapState = normalizeNamespace(function (namespace, states) {
  2258. var res = {};
  2259. if (( true) && !isValidMap(states)) {
  2260. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  2261. }
  2262. normalizeMap(states).forEach(function (ref) {
  2263. var key = ref.key;
  2264. var val = ref.val;
  2265. res[key] = function mappedState () {
  2266. var state = this.$store.state;
  2267. var getters = this.$store.getters;
  2268. if (namespace) {
  2269. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  2270. if (!module) {
  2271. return
  2272. }
  2273. state = module.context.state;
  2274. getters = module.context.getters;
  2275. }
  2276. return typeof val === 'function'
  2277. ? val.call(this, state, getters)
  2278. : state[val]
  2279. };
  2280. // mark vuex getter for devtools
  2281. res[key].vuex = true;
  2282. });
  2283. return res
  2284. });
  2285. /**
  2286. * Reduce the code which written in Vue.js for committing the mutation
  2287. * @param {String} [namespace] - Module's namespace
  2288. * @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.
  2289. * @return {Object}
  2290. */
  2291. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  2292. var res = {};
  2293. if (( true) && !isValidMap(mutations)) {
  2294. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  2295. }
  2296. normalizeMap(mutations).forEach(function (ref) {
  2297. var key = ref.key;
  2298. var val = ref.val;
  2299. res[key] = function mappedMutation () {
  2300. var args = [], len = arguments.length;
  2301. while ( len-- ) args[ len ] = arguments[ len ];
  2302. // Get the commit method from store
  2303. var commit = this.$store.commit;
  2304. if (namespace) {
  2305. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  2306. if (!module) {
  2307. return
  2308. }
  2309. commit = module.context.commit;
  2310. }
  2311. return typeof val === 'function'
  2312. ? val.apply(this, [commit].concat(args))
  2313. : commit.apply(this.$store, [val].concat(args))
  2314. };
  2315. });
  2316. return res
  2317. });
  2318. /**
  2319. * Reduce the code which written in Vue.js for getting the getters
  2320. * @param {String} [namespace] - Module's namespace
  2321. * @param {Object|Array} getters
  2322. * @return {Object}
  2323. */
  2324. var mapGetters = normalizeNamespace(function (namespace, getters) {
  2325. var res = {};
  2326. if (( true) && !isValidMap(getters)) {
  2327. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  2328. }
  2329. normalizeMap(getters).forEach(function (ref) {
  2330. var key = ref.key;
  2331. var val = ref.val;
  2332. // The namespace has been mutated by normalizeNamespace
  2333. val = namespace + val;
  2334. res[key] = function mappedGetter () {
  2335. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  2336. return
  2337. }
  2338. if (( true) && !(val in this.$store.getters)) {
  2339. console.error(("[vuex] unknown getter: " + val));
  2340. return
  2341. }
  2342. return this.$store.getters[val]
  2343. };
  2344. // mark vuex getter for devtools
  2345. res[key].vuex = true;
  2346. });
  2347. return res
  2348. });
  2349. /**
  2350. * Reduce the code which written in Vue.js for dispatch the action
  2351. * @param {String} [namespace] - Module's namespace
  2352. * @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.
  2353. * @return {Object}
  2354. */
  2355. var mapActions = normalizeNamespace(function (namespace, actions) {
  2356. var res = {};
  2357. if (( true) && !isValidMap(actions)) {
  2358. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  2359. }
  2360. normalizeMap(actions).forEach(function (ref) {
  2361. var key = ref.key;
  2362. var val = ref.val;
  2363. res[key] = function mappedAction () {
  2364. var args = [], len = arguments.length;
  2365. while ( len-- ) args[ len ] = arguments[ len ];
  2366. // get dispatch function from store
  2367. var dispatch = this.$store.dispatch;
  2368. if (namespace) {
  2369. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  2370. if (!module) {
  2371. return
  2372. }
  2373. dispatch = module.context.dispatch;
  2374. }
  2375. return typeof val === 'function'
  2376. ? val.apply(this, [dispatch].concat(args))
  2377. : dispatch.apply(this.$store, [val].concat(args))
  2378. };
  2379. });
  2380. return res
  2381. });
  2382. /**
  2383. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  2384. * @param {String} namespace
  2385. * @return {Object}
  2386. */
  2387. var createNamespacedHelpers = function (namespace) { return ({
  2388. mapState: mapState.bind(null, namespace),
  2389. mapGetters: mapGetters.bind(null, namespace),
  2390. mapMutations: mapMutations.bind(null, namespace),
  2391. mapActions: mapActions.bind(null, namespace)
  2392. }); };
  2393. /**
  2394. * Normalize the map
  2395. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  2396. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  2397. * @param {Array|Object} map
  2398. * @return {Object}
  2399. */
  2400. function normalizeMap (map) {
  2401. if (!isValidMap(map)) {
  2402. return []
  2403. }
  2404. return Array.isArray(map)
  2405. ? map.map(function (key) { return ({ key: key, val: key }); })
  2406. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  2407. }
  2408. /**
  2409. * Validate whether given map is valid or not
  2410. * @param {*} map
  2411. * @return {Boolean}
  2412. */
  2413. function isValidMap (map) {
  2414. return Array.isArray(map) || isObject(map)
  2415. }
  2416. /**
  2417. * 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.
  2418. * @param {Function} fn
  2419. * @return {Function}
  2420. */
  2421. function normalizeNamespace (fn) {
  2422. return function (namespace, map) {
  2423. if (typeof namespace !== 'string') {
  2424. map = namespace;
  2425. namespace = '';
  2426. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  2427. namespace += '/';
  2428. }
  2429. return fn(namespace, map)
  2430. }
  2431. }
  2432. /**
  2433. * Search a special module from store by namespace. if module not exist, print error message.
  2434. * @param {Object} store
  2435. * @param {String} helper
  2436. * @param {String} namespace
  2437. * @return {Object}
  2438. */
  2439. function getModuleByNamespace (store, helper, namespace) {
  2440. var module = store._modulesNamespaceMap[namespace];
  2441. if (( true) && !module) {
  2442. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  2443. }
  2444. return module
  2445. }
  2446. var index = {
  2447. Store: Store,
  2448. install: install,
  2449. version: '3.4.0',
  2450. mapState: mapState,
  2451. mapMutations: mapMutations,
  2452. mapGetters: mapGetters,
  2453. mapActions: mapActions,
  2454. createNamespacedHelpers: createNamespacedHelpers
  2455. };
  2456. /* harmony default export */ __webpack_exports__["default"] = (index);
  2457. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  2458. /***/ }),
  2459. /***/ 100:
  2460. /*!***************************************!*\
  2461. !*** E:/飞播代码/lipin/utils/wxqrcode.js ***!
  2462. \***************************************/
  2463. /*! no static exports found */
  2464. /***/ (function(module, exports) {
  2465. //---------------------------------------------------------------------
  2466. //
  2467. // QR Code Generator for JavaScript
  2468. //
  2469. // Copyright (c) 2009 Kazuhiko Arase
  2470. //
  2471. // URL: [url=http://www.d-project.com/]http://www.d-project.com/[/url]
  2472. //
  2473. // Licensed under the MIT license:
  2474. // [url=http://www.opensource.org/licenses/mit-license.php]http://www.opensource.org/licenses/mit-license.php[/url]
  2475. //
  2476. // The word 'QR Code' is registered trademark of
  2477. // DENSO WAVE INCORPORATED
  2478. // [url=http://www.denso-wave.com/qrcode/faqpatent-e.html]http://www.denso-wave.com/qrcode/faqpatent-e.html[/url]
  2479. //
  2480. //---------------------------------------------------------------------
  2481. //---------------------------------------------------------------------
  2482. // qrcode
  2483. //代码第1588行为补充代码
  2484. //修改人:chenxing
  2485. //2017-02-27 16:21:32
  2486. //---------------------------------------------------------------------
  2487. /**
  2488. * qrcode
  2489. * @param typeNumber 1 to 40
  2490. * @param errorCorrectLevel 'L','M','Q','H'
  2491. */
  2492. var qrcode = function qrcode(typeNumber, errorCorrectLevel) {
  2493. var PAD0 = 0xEC;
  2494. var PAD1 = 0x11;
  2495. var _typeNumber = typeNumber;
  2496. var _errorCorrectLevel = QRErrorCorrectLevel[errorCorrectLevel];
  2497. var _modules = null;
  2498. var _moduleCount = 0;
  2499. var _dataCache = null;
  2500. var _dataList = new Array();
  2501. var _this = {};
  2502. var makeImpl = function makeImpl(test, maskPattern) {
  2503. _moduleCount = _typeNumber * 4 + 17;
  2504. _modules = function (moduleCount) {
  2505. var modules = new Array(moduleCount);
  2506. for (var row = 0; row < moduleCount; row += 1) {
  2507. modules[row] = new Array(moduleCount);
  2508. for (var col = 0; col < moduleCount; col += 1) {
  2509. modules[row][col] = null;
  2510. }
  2511. }
  2512. return modules;
  2513. }(_moduleCount);
  2514. setupPositionProbePattern(0, 0);
  2515. setupPositionProbePattern(_moduleCount - 7, 0);
  2516. setupPositionProbePattern(0, _moduleCount - 7);
  2517. setupPositionAdjustPattern();
  2518. setupTimingPattern();
  2519. setupTypeInfo(test, maskPattern);
  2520. if (_typeNumber >= 7) {
  2521. setupTypeNumber(test);
  2522. }
  2523. if (_dataCache == null) {
  2524. _dataCache = createData(_typeNumber, _errorCorrectLevel, _dataList);
  2525. }
  2526. mapData(_dataCache, maskPattern);
  2527. };
  2528. var setupPositionProbePattern = function setupPositionProbePattern(row, col) {
  2529. for (var r = -1; r <= 7; r += 1) {
  2530. if (row + r <= -1 || _moduleCount <= row + r) continue;
  2531. for (var c = -1; c <= 7; c += 1) {
  2532. if (col + c <= -1 || _moduleCount <= col + c) continue;
  2533. if (0 <= r && r <= 6 && (c == 0 || c == 6) ||
  2534. 0 <= c && c <= 6 && (r == 0 || r == 6) ||
  2535. 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  2536. _modules[row + r][col + c] = true;
  2537. } else {
  2538. _modules[row + r][col + c] = false;
  2539. }
  2540. }
  2541. }
  2542. };
  2543. var getBestMaskPattern = function getBestMaskPattern() {
  2544. var minLostPoint = 0;
  2545. var pattern = 0;
  2546. for (var i = 0; i < 8; i += 1) {
  2547. makeImpl(true, i);
  2548. var lostPoint = QRUtil.getLostPoint(_this);
  2549. if (i == 0 || minLostPoint > lostPoint) {
  2550. minLostPoint = lostPoint;
  2551. pattern = i;
  2552. }
  2553. }
  2554. return pattern;
  2555. };
  2556. var setupTimingPattern = function setupTimingPattern() {
  2557. for (var r = 8; r < _moduleCount - 8; r += 1) {
  2558. if (_modules[r][6] != null) {
  2559. continue;
  2560. }
  2561. _modules[r][6] = r % 2 == 0;
  2562. }
  2563. for (var c = 8; c < _moduleCount - 8; c += 1) {
  2564. if (_modules[6][c] != null) {
  2565. continue;
  2566. }
  2567. _modules[6][c] = c % 2 == 0;
  2568. }
  2569. };
  2570. var setupPositionAdjustPattern = function setupPositionAdjustPattern() {
  2571. var pos = QRUtil.getPatternPosition(_typeNumber);
  2572. for (var i = 0; i < pos.length; i += 1) {
  2573. for (var j = 0; j < pos.length; j += 1) {
  2574. var row = pos[i];
  2575. var col = pos[j];
  2576. if (_modules[row][col] != null) {
  2577. continue;
  2578. }
  2579. for (var r = -2; r <= 2; r += 1) {
  2580. for (var c = -2; c <= 2; c += 1) {
  2581. if (r == -2 || r == 2 || c == -2 || c == 2 ||
  2582. r == 0 && c == 0) {
  2583. _modules[row + r][col + c] = true;
  2584. } else {
  2585. _modules[row + r][col + c] = false;
  2586. }
  2587. }
  2588. }
  2589. }
  2590. }
  2591. };
  2592. var setupTypeNumber = function setupTypeNumber(test) {
  2593. var bits = QRUtil.getBCHTypeNumber(_typeNumber);
  2594. for (var i = 0; i < 18; i += 1) {
  2595. var mod = !test && (bits >> i & 1) == 1;
  2596. _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
  2597. }
  2598. for (var i = 0; i < 18; i += 1) {
  2599. var mod = !test && (bits >> i & 1) == 1;
  2600. _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  2601. }
  2602. };
  2603. var setupTypeInfo = function setupTypeInfo(test, maskPattern) {
  2604. var data = _errorCorrectLevel << 3 | maskPattern;
  2605. var bits = QRUtil.getBCHTypeInfo(data);
  2606. // vertical
  2607. for (var i = 0; i < 15; i += 1) {
  2608. var mod = !test && (bits >> i & 1) == 1;
  2609. if (i < 6) {
  2610. _modules[i][8] = mod;
  2611. } else if (i < 8) {
  2612. _modules[i + 1][8] = mod;
  2613. } else {
  2614. _modules[_moduleCount - 15 + i][8] = mod;
  2615. }
  2616. }
  2617. // horizontal
  2618. for (var i = 0; i < 15; i += 1) {
  2619. var mod = !test && (bits >> i & 1) == 1;
  2620. if (i < 8) {
  2621. _modules[8][_moduleCount - i - 1] = mod;
  2622. } else if (i < 9) {
  2623. _modules[8][15 - i - 1 + 1] = mod;
  2624. } else {
  2625. _modules[8][15 - i - 1] = mod;
  2626. }
  2627. }
  2628. // fixed module
  2629. _modules[_moduleCount - 8][8] = !test;
  2630. };
  2631. var mapData = function mapData(data, maskPattern) {
  2632. var inc = -1;
  2633. var row = _moduleCount - 1;
  2634. var bitIndex = 7;
  2635. var byteIndex = 0;
  2636. var maskFunc = QRUtil.getMaskFunction(maskPattern);
  2637. for (var col = _moduleCount - 1; col > 0; col -= 2) {
  2638. if (col == 6) col -= 1;
  2639. while (true) {
  2640. for (var c = 0; c < 2; c += 1) {
  2641. if (_modules[row][col - c] == null) {
  2642. var dark = false;
  2643. if (byteIndex < data.length) {
  2644. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2645. }
  2646. var mask = maskFunc(row, col - c);
  2647. if (mask) {
  2648. dark = !dark;
  2649. }
  2650. _modules[row][col - c] = dark;
  2651. bitIndex -= 1;
  2652. if (bitIndex == -1) {
  2653. byteIndex += 1;
  2654. bitIndex = 7;
  2655. }
  2656. }
  2657. }
  2658. row += inc;
  2659. if (row < 0 || _moduleCount <= row) {
  2660. row -= inc;
  2661. inc = -inc;
  2662. break;
  2663. }
  2664. }
  2665. }
  2666. };
  2667. var createBytes = function createBytes(buffer, rsBlocks) {
  2668. var offset = 0;
  2669. var maxDcCount = 0;
  2670. var maxEcCount = 0;
  2671. var dcdata = new Array(rsBlocks.length);
  2672. var ecdata = new Array(rsBlocks.length);
  2673. for (var r = 0; r < rsBlocks.length; r += 1) {
  2674. var dcCount = rsBlocks[r].dataCount;
  2675. var ecCount = rsBlocks[r].totalCount - dcCount;
  2676. maxDcCount = Math.max(maxDcCount, dcCount);
  2677. maxEcCount = Math.max(maxEcCount, ecCount);
  2678. dcdata[r] = new Array(dcCount);
  2679. for (var i = 0; i < dcdata[r].length; i += 1) {
  2680. dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset];
  2681. }
  2682. offset += dcCount;
  2683. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  2684. var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
  2685. var modPoly = rawPoly.mod(rsPoly);
  2686. ecdata[r] = new Array(rsPoly.getLength() - 1);
  2687. for (var i = 0; i < ecdata[r].length; i += 1) {
  2688. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  2689. ecdata[r][i] = modIndex >= 0 ? modPoly.getAt(modIndex) : 0;
  2690. }
  2691. }
  2692. var totalCodeCount = 0;
  2693. for (var i = 0; i < rsBlocks.length; i += 1) {
  2694. totalCodeCount += rsBlocks[i].totalCount;
  2695. }
  2696. var data = new Array(totalCodeCount);
  2697. var index = 0;
  2698. for (var i = 0; i < maxDcCount; i += 1) {
  2699. for (var r = 0; r < rsBlocks.length; r += 1) {
  2700. if (i < dcdata[r].length) {
  2701. data[index] = dcdata[r][i];
  2702. index += 1;
  2703. }
  2704. }
  2705. }
  2706. for (var i = 0; i < maxEcCount; i += 1) {
  2707. for (var r = 0; r < rsBlocks.length; r += 1) {
  2708. if (i < ecdata[r].length) {
  2709. data[index] = ecdata[r][i];
  2710. index += 1;
  2711. }
  2712. }
  2713. }
  2714. return data;
  2715. };
  2716. var createData = function createData(typeNumber, errorCorrectLevel, dataList) {
  2717. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
  2718. var buffer = qrBitBuffer();
  2719. for (var i = 0; i < dataList.length; i += 1) {
  2720. var data = dataList[i];
  2721. buffer.put(data.getMode(), 4);
  2722. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber));
  2723. data.write(buffer);
  2724. }
  2725. // calc num max data.
  2726. var totalDataCount = 0;
  2727. for (var i = 0; i < rsBlocks.length; i += 1) {
  2728. totalDataCount += rsBlocks[i].dataCount;
  2729. }
  2730. if (buffer.getLengthInBits() > totalDataCount * 8) {
  2731. throw new Error('code length overflow. (' +
  2732. buffer.getLengthInBits() +
  2733. '>' +
  2734. totalDataCount * 8 +
  2735. ')');
  2736. }
  2737. // end code
  2738. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  2739. buffer.put(0, 4);
  2740. }
  2741. // padding
  2742. while (buffer.getLengthInBits() % 8 != 0) {
  2743. buffer.putBit(false);
  2744. }
  2745. // padding
  2746. while (true) {
  2747. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2748. break;
  2749. }
  2750. buffer.put(PAD0, 8);
  2751. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2752. break;
  2753. }
  2754. buffer.put(PAD1, 8);
  2755. }
  2756. return createBytes(buffer, rsBlocks);
  2757. };
  2758. _this.addData = function (data) {
  2759. var newData = qr8BitByte(data);
  2760. _dataList.push(newData);
  2761. _dataCache = null;
  2762. };
  2763. _this.isDark = function (row, col) {
  2764. if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
  2765. throw new Error(row + ',' + col);
  2766. }
  2767. return _modules[row][col];
  2768. };
  2769. _this.getModuleCount = function () {
  2770. return _moduleCount;
  2771. };
  2772. _this.make = function () {
  2773. makeImpl(false, getBestMaskPattern());
  2774. };
  2775. _this.createTableTag = function (cellSize, margin) {
  2776. cellSize = cellSize || 2;
  2777. margin = typeof margin == 'undefined' ? cellSize * 4 : margin;
  2778. var qrHtml = '';
  2779. qrHtml += '<table style="';
  2780. qrHtml += ' border-width: 0px; border-style: none;';
  2781. qrHtml += ' border-collapse: collapse;';
  2782. qrHtml += ' padding: 0px; margin: ' + margin + 'px;';
  2783. qrHtml += '">';
  2784. qrHtml += '<tbody>';
  2785. for (var r = 0; r < _this.getModuleCount(); r += 1) {
  2786. qrHtml += '<tr>';
  2787. for (var c = 0; c < _this.getModuleCount(); c += 1) {
  2788. qrHtml += '<td style="';
  2789. qrHtml += ' border-width: 0px; border-style: none;';
  2790. qrHtml += ' border-collapse: collapse;';
  2791. qrHtml += ' padding: 0px; margin: 0px;';
  2792. qrHtml += ' width: ' + cellSize + 'px;';
  2793. qrHtml += ' height: ' + cellSize + 'px;';
  2794. qrHtml += ' background-color: ';
  2795. qrHtml += _this.isDark(r, c) ? '#000000' : '#ffffff';
  2796. qrHtml += ';';
  2797. qrHtml += '"/>';
  2798. }
  2799. qrHtml += '</tr>';
  2800. }
  2801. qrHtml += '</tbody>';
  2802. qrHtml += '</table>';
  2803. return qrHtml;
  2804. };
  2805. _this.createImgTag = function (cellSize, margin, size) {
  2806. cellSize = cellSize || 2;
  2807. margin = typeof margin == 'undefined' ? cellSize * 4 : margin;
  2808. var min = margin;
  2809. var max = _this.getModuleCount() * cellSize + margin;
  2810. return createImgTag(size, size, function (x, y) {
  2811. if (min <= x && x < max && min <= y && y < max) {
  2812. var c = Math.floor((x - min) / cellSize);
  2813. var r = Math.floor((y - min) / cellSize);
  2814. return _this.isDark(r, c) ? 0 : 1;
  2815. } else {
  2816. return 1;
  2817. }
  2818. });
  2819. };
  2820. return _this;
  2821. };
  2822. //---------------------------------------------------------------------
  2823. // qrcode.stringToBytes
  2824. //---------------------------------------------------------------------
  2825. qrcode.stringToBytes = function (s) {
  2826. var bytes = new Array();
  2827. for (var i = 0; i < s.length; i += 1) {
  2828. var c = s.charCodeAt(i);
  2829. bytes.push(c & 0xff);
  2830. }
  2831. return bytes;
  2832. };
  2833. //---------------------------------------------------------------------
  2834. // qrcode.createStringToBytes
  2835. //---------------------------------------------------------------------
  2836. /**
  2837. * @param unicodeData base64 string of byte array.
  2838. * [16bit Unicode],[16bit Bytes], ...
  2839. * @param numChars
  2840. */
  2841. qrcode.createStringToBytes = function (unicodeData, numChars) {
  2842. // create conversion map.
  2843. var unicodeMap = function () {
  2844. var bin = base64DecodeInputStream(unicodeData);
  2845. var read = function read() {
  2846. var b = bin.read();
  2847. if (b == -1) throw new Error();
  2848. return b;
  2849. };
  2850. var count = 0;
  2851. var unicodeMap = {};
  2852. while (true) {
  2853. var b0 = bin.read();
  2854. if (b0 == -1) break;
  2855. var b1 = read();
  2856. var b2 = read();
  2857. var b3 = read();
  2858. var k = String.fromCharCode(b0 << 8 | b1);
  2859. var v = b2 << 8 | b3;
  2860. unicodeMap[k] = v;
  2861. count += 1;
  2862. }
  2863. if (count != numChars) {
  2864. throw new Error(count + ' != ' + numChars);
  2865. }
  2866. return unicodeMap;
  2867. }();
  2868. var unknownChar = '?'.charCodeAt(0);
  2869. return function (s) {
  2870. var bytes = new Array();
  2871. for (var i = 0; i < s.length; i += 1) {
  2872. var c = s.charCodeAt(i);
  2873. if (c < 128) {
  2874. bytes.push(c);
  2875. } else {
  2876. var b = unicodeMap[s.charAt(i)];
  2877. if (typeof b == 'number') {
  2878. if ((b & 0xff) == b) {
  2879. // 1byte
  2880. bytes.push(b);
  2881. } else {
  2882. // 2bytes
  2883. bytes.push(b >>> 8);
  2884. bytes.push(b & 0xff);
  2885. }
  2886. } else {
  2887. bytes.push(unknownChar);
  2888. }
  2889. }
  2890. }
  2891. return bytes;
  2892. };
  2893. };
  2894. //---------------------------------------------------------------------
  2895. // QRMode
  2896. //---------------------------------------------------------------------
  2897. var QRMode = {
  2898. MODE_NUMBER: 1 << 0,
  2899. MODE_ALPHA_NUM: 1 << 1,
  2900. MODE_8BIT_BYTE: 1 << 2,
  2901. MODE_KANJI: 1 << 3 };
  2902. //---------------------------------------------------------------------
  2903. // QRErrorCorrectLevel
  2904. //---------------------------------------------------------------------
  2905. var QRErrorCorrectLevel = {
  2906. L: 1,
  2907. M: 0,
  2908. Q: 3,
  2909. H: 2 };
  2910. //---------------------------------------------------------------------
  2911. // QRMaskPattern
  2912. //---------------------------------------------------------------------
  2913. var QRMaskPattern = {
  2914. PATTERN000: 0,
  2915. PATTERN001: 1,
  2916. PATTERN010: 2,
  2917. PATTERN011: 3,
  2918. PATTERN100: 4,
  2919. PATTERN101: 5,
  2920. PATTERN110: 6,
  2921. PATTERN111: 7 };
  2922. //---------------------------------------------------------------------
  2923. // QRUtil
  2924. //---------------------------------------------------------------------
  2925. var QRUtil = function () {
  2926. var PATTERN_POSITION_TABLE = [
  2927. [],
  2928. [6, 18],
  2929. [6, 22],
  2930. [6, 26],
  2931. [6, 30],
  2932. [6, 34],
  2933. [6, 22, 38],
  2934. [6, 24, 42],
  2935. [6, 26, 46],
  2936. [6, 28, 50],
  2937. [6, 30, 54],
  2938. [6, 32, 58],
  2939. [6, 34, 62],
  2940. [6, 26, 46, 66],
  2941. [6, 26, 48, 70],
  2942. [6, 26, 50, 74],
  2943. [6, 30, 54, 78],
  2944. [6, 30, 56, 82],
  2945. [6, 30, 58, 86],
  2946. [6, 34, 62, 90],
  2947. [6, 28, 50, 72, 94],
  2948. [6, 26, 50, 74, 98],
  2949. [6, 30, 54, 78, 102],
  2950. [6, 28, 54, 80, 106],
  2951. [6, 32, 58, 84, 110],
  2952. [6, 30, 58, 86, 114],
  2953. [6, 34, 62, 90, 118],
  2954. [6, 26, 50, 74, 98, 122],
  2955. [6, 30, 54, 78, 102, 126],
  2956. [6, 26, 52, 78, 104, 130],
  2957. [6, 30, 56, 82, 108, 134],
  2958. [6, 34, 60, 86, 112, 138],
  2959. [6, 30, 58, 86, 114, 142],
  2960. [6, 34, 62, 90, 118, 146],
  2961. [6, 30, 54, 78, 102, 126, 150],
  2962. [6, 24, 50, 76, 102, 128, 154],
  2963. [6, 28, 54, 80, 106, 132, 158],
  2964. [6, 32, 58, 84, 110, 136, 162],
  2965. [6, 26, 54, 82, 110, 138, 166],
  2966. [6, 30, 58, 86, 114, 142, 170]];
  2967. var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
  2968. var G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
  2969. var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
  2970. var _this = {};
  2971. var getBCHDigit = function getBCHDigit(data) {
  2972. var digit = 0;
  2973. while (data != 0) {
  2974. digit += 1;
  2975. data >>>= 1;
  2976. }
  2977. return digit;
  2978. };
  2979. _this.getBCHTypeInfo = function (data) {
  2980. var d = data << 10;
  2981. while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
  2982. d ^= G15 << getBCHDigit(d) - getBCHDigit(G15);
  2983. }
  2984. return (data << 10 | d) ^ G15_MASK;
  2985. };
  2986. _this.getBCHTypeNumber = function (data) {
  2987. var d = data << 12;
  2988. while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
  2989. d ^= G18 << getBCHDigit(d) - getBCHDigit(G18);
  2990. }
  2991. return data << 12 | d;
  2992. };
  2993. _this.getPatternPosition = function (typeNumber) {
  2994. return PATTERN_POSITION_TABLE[typeNumber - 1];
  2995. };
  2996. _this.getMaskFunction = function (maskPattern) {
  2997. switch (maskPattern) {
  2998. case QRMaskPattern.PATTERN000:
  2999. return function (i, j) {return (i + j) % 2 == 0;};
  3000. case QRMaskPattern.PATTERN001:
  3001. return function (i, j) {return i % 2 == 0;};
  3002. case QRMaskPattern.PATTERN010:
  3003. return function (i, j) {return j % 3 == 0;};
  3004. case QRMaskPattern.PATTERN011:
  3005. return function (i, j) {return (i + j) % 3 == 0;};
  3006. case QRMaskPattern.PATTERN100:
  3007. return function (i, j) {return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;};
  3008. case QRMaskPattern.PATTERN101:
  3009. return function (i, j) {return i * j % 2 + i * j % 3 == 0;};
  3010. case QRMaskPattern.PATTERN110:
  3011. return function (i, j) {return (i * j % 2 + i * j % 3) % 2 == 0;};
  3012. case QRMaskPattern.PATTERN111:
  3013. return function (i, j) {return (i * j % 3 + (i + j) % 2) % 2 == 0;};
  3014. default:
  3015. throw new Error('bad maskPattern:' + maskPattern);}
  3016. };
  3017. _this.getErrorCorrectPolynomial = function (errorCorrectLength) {
  3018. var a = qrPolynomial([1], 0);
  3019. for (var i = 0; i < errorCorrectLength; i += 1) {
  3020. a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0));
  3021. }
  3022. return a;
  3023. };
  3024. _this.getLengthInBits = function (mode, type) {
  3025. if (1 <= type && type < 10) {
  3026. // 1 - 9
  3027. switch (mode) {
  3028. case QRMode.MODE_NUMBER:return 10;
  3029. case QRMode.MODE_ALPHA_NUM:return 9;
  3030. case QRMode.MODE_8BIT_BYTE:return 8;
  3031. case QRMode.MODE_KANJI:return 8;
  3032. default:
  3033. throw new Error('mode:' + mode);}
  3034. } else if (type < 27) {
  3035. // 10 - 26
  3036. switch (mode) {
  3037. case QRMode.MODE_NUMBER:return 12;
  3038. case QRMode.MODE_ALPHA_NUM:return 11;
  3039. case QRMode.MODE_8BIT_BYTE:return 16;
  3040. case QRMode.MODE_KANJI:return 10;
  3041. default:
  3042. throw new Error('mode:' + mode);}
  3043. } else if (type < 41) {
  3044. // 27 - 40
  3045. switch (mode) {
  3046. case QRMode.MODE_NUMBER:return 14;
  3047. case QRMode.MODE_ALPHA_NUM:return 13;
  3048. case QRMode.MODE_8BIT_BYTE:return 16;
  3049. case QRMode.MODE_KANJI:return 12;
  3050. default:
  3051. throw new Error('mode:' + mode);}
  3052. } else {
  3053. throw new Error('type:' + type);
  3054. }
  3055. };
  3056. _this.getLostPoint = function (qrcode) {
  3057. var moduleCount = qrcode.getModuleCount();
  3058. var lostPoint = 0;
  3059. // LEVEL1
  3060. for (var row = 0; row < moduleCount; row += 1) {
  3061. for (var col = 0; col < moduleCount; col += 1) {
  3062. var sameCount = 0;
  3063. var dark = qrcode.isDark(row, col);
  3064. for (var r = -1; r <= 1; r += 1) {
  3065. if (row + r < 0 || moduleCount <= row + r) {
  3066. continue;
  3067. }
  3068. for (var c = -1; c <= 1; c += 1) {
  3069. if (col + c < 0 || moduleCount <= col + c) {
  3070. continue;
  3071. }
  3072. if (r == 0 && c == 0) {
  3073. continue;
  3074. }
  3075. if (dark == qrcode.isDark(row + r, col + c)) {
  3076. sameCount += 1;
  3077. }
  3078. }
  3079. }
  3080. if (sameCount > 5) {
  3081. lostPoint += 3 + sameCount - 5;
  3082. }
  3083. }
  3084. };
  3085. // LEVEL2
  3086. for (var row = 0; row < moduleCount - 1; row += 1) {
  3087. for (var col = 0; col < moduleCount - 1; col += 1) {
  3088. var count = 0;
  3089. if (qrcode.isDark(row, col)) count += 1;
  3090. if (qrcode.isDark(row + 1, col)) count += 1;
  3091. if (qrcode.isDark(row, col + 1)) count += 1;
  3092. if (qrcode.isDark(row + 1, col + 1)) count += 1;
  3093. if (count == 0 || count == 4) {
  3094. lostPoint += 3;
  3095. }
  3096. }
  3097. }
  3098. // LEVEL3
  3099. for (var row = 0; row < moduleCount; row += 1) {
  3100. for (var col = 0; col < moduleCount - 6; col += 1) {
  3101. if (qrcode.isDark(row, col) &&
  3102. !qrcode.isDark(row, col + 1) &&
  3103. qrcode.isDark(row, col + 2) &&
  3104. qrcode.isDark(row, col + 3) &&
  3105. qrcode.isDark(row, col + 4) &&
  3106. !qrcode.isDark(row, col + 5) &&
  3107. qrcode.isDark(row, col + 6)) {
  3108. lostPoint += 40;
  3109. }
  3110. }
  3111. }
  3112. for (var col = 0; col < moduleCount; col += 1) {
  3113. for (var row = 0; row < moduleCount - 6; row += 1) {
  3114. if (qrcode.isDark(row, col) &&
  3115. !qrcode.isDark(row + 1, col) &&
  3116. qrcode.isDark(row + 2, col) &&
  3117. qrcode.isDark(row + 3, col) &&
  3118. qrcode.isDark(row + 4, col) &&
  3119. !qrcode.isDark(row + 5, col) &&
  3120. qrcode.isDark(row + 6, col)) {
  3121. lostPoint += 40;
  3122. }
  3123. }
  3124. }
  3125. // LEVEL4
  3126. var darkCount = 0;
  3127. for (var col = 0; col < moduleCount; col += 1) {
  3128. for (var row = 0; row < moduleCount; row += 1) {
  3129. if (qrcode.isDark(row, col)) {
  3130. darkCount += 1;
  3131. }
  3132. }
  3133. }
  3134. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  3135. lostPoint += ratio * 10;
  3136. return lostPoint;
  3137. };
  3138. return _this;
  3139. }();
  3140. //---------------------------------------------------------------------
  3141. // QRMath
  3142. //---------------------------------------------------------------------
  3143. var QRMath = function () {
  3144. var EXP_TABLE = new Array(256);
  3145. var LOG_TABLE = new Array(256);
  3146. // initialize tables
  3147. for (var i = 0; i < 8; i += 1) {
  3148. EXP_TABLE[i] = 1 << i;
  3149. }
  3150. for (var i = 8; i < 256; i += 1) {
  3151. EXP_TABLE[i] = EXP_TABLE[i - 4] ^
  3152. EXP_TABLE[i - 5] ^
  3153. EXP_TABLE[i - 6] ^
  3154. EXP_TABLE[i - 8];
  3155. }
  3156. for (var i = 0; i < 255; i += 1) {
  3157. LOG_TABLE[EXP_TABLE[i]] = i;
  3158. }
  3159. var _this = {};
  3160. _this.glog = function (n) {
  3161. if (n < 1) {
  3162. throw new Error('glog(' + n + ')');
  3163. }
  3164. return LOG_TABLE[n];
  3165. };
  3166. _this.gexp = function (n) {
  3167. while (n < 0) {
  3168. n += 255;
  3169. }
  3170. while (n >= 256) {
  3171. n -= 255;
  3172. }
  3173. return EXP_TABLE[n];
  3174. };
  3175. return _this;
  3176. }();
  3177. //---------------------------------------------------------------------
  3178. // qrPolynomial
  3179. //---------------------------------------------------------------------
  3180. function qrPolynomial(num, shift) {
  3181. if (typeof num.length == 'undefined') {
  3182. throw new Error(num.length + '/' + shift);
  3183. }
  3184. var _num = function () {
  3185. var offset = 0;
  3186. while (offset < num.length && num[offset] == 0) {
  3187. offset += 1;
  3188. }
  3189. var _num = new Array(num.length - offset + shift);
  3190. for (var i = 0; i < num.length - offset; i += 1) {
  3191. _num[i] = num[i + offset];
  3192. }
  3193. return _num;
  3194. }();
  3195. var _this = {};
  3196. _this.getAt = function (index) {
  3197. return _num[index];
  3198. };
  3199. _this.getLength = function () {
  3200. return _num.length;
  3201. };
  3202. _this.multiply = function (e) {
  3203. var num = new Array(_this.getLength() + e.getLength() - 1);
  3204. for (var i = 0; i < _this.getLength(); i += 1) {
  3205. for (var j = 0; j < e.getLength(); j += 1) {
  3206. num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i)) + QRMath.glog(e.getAt(j)));
  3207. }
  3208. }
  3209. return qrPolynomial(num, 0);
  3210. };
  3211. _this.mod = function (e) {
  3212. if (_this.getLength() - e.getLength() < 0) {
  3213. return _this;
  3214. }
  3215. var ratio = QRMath.glog(_this.getAt(0)) - QRMath.glog(e.getAt(0));
  3216. var num = new Array(_this.getLength());
  3217. for (var i = 0; i < _this.getLength(); i += 1) {
  3218. num[i] = _this.getAt(i);
  3219. }
  3220. for (var i = 0; i < e.getLength(); i += 1) {
  3221. num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i)) + ratio);
  3222. }
  3223. // recursive call
  3224. return qrPolynomial(num, 0).mod(e);
  3225. };
  3226. return _this;
  3227. };
  3228. //---------------------------------------------------------------------
  3229. // QRRSBlock
  3230. //---------------------------------------------------------------------
  3231. var QRRSBlock = function () {
  3232. // [1: [L, M, Q, H], ..]
  3233. var RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  3234. var qrRSBlock = function qrRSBlock(totalCount, dataCount) {
  3235. var _this = {};
  3236. _this.totalCount = totalCount;
  3237. _this.dataCount = dataCount;
  3238. return _this;
  3239. };
  3240. var _this = {};
  3241. var getRsBlockTable = function getRsBlockTable(typeNumber, errorCorrectLevel) {
  3242. switch (errorCorrectLevel) {
  3243. case QRErrorCorrectLevel.L:
  3244. return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
  3245. case QRErrorCorrectLevel.M:
  3246. return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  3247. case QRErrorCorrectLevel.Q:
  3248. return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  3249. case QRErrorCorrectLevel.H:
  3250. return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  3251. default:
  3252. return undefined;}
  3253. };
  3254. _this.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  3255. var rsBlock = getRsBlockTable(typeNumber, errorCorrectLevel);
  3256. if (typeof rsBlock == 'undefined') {
  3257. throw new Error('bad rs block [url=home.php?mod=space&uid=5302]@[/url] typeNumber:' + typeNumber +
  3258. '/errorCorrectLevel:' + errorCorrectLevel);
  3259. }
  3260. var length = rsBlock.length / 3;
  3261. var list = new Array();
  3262. for (var i = 0; i < length; i += 1) {
  3263. var count = rsBlock[i * 3 + 0];
  3264. var totalCount = rsBlock[i * 3 + 1];
  3265. var dataCount = rsBlock[i * 3 + 2];
  3266. for (var j = 0; j < count; j += 1) {
  3267. list.push(qrRSBlock(totalCount, dataCount));
  3268. }
  3269. }
  3270. return list;
  3271. };
  3272. return _this;
  3273. }();
  3274. //---------------------------------------------------------------------
  3275. // qrBitBuffer
  3276. //---------------------------------------------------------------------
  3277. var qrBitBuffer = function qrBitBuffer() {
  3278. var _buffer = new Array();
  3279. var _length = 0;
  3280. var _this = {};
  3281. _this.getBuffer = function () {
  3282. return _buffer;
  3283. };
  3284. _this.getAt = function (index) {
  3285. var bufIndex = Math.floor(index / 8);
  3286. return (_buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  3287. };
  3288. _this.put = function (num, length) {
  3289. for (var i = 0; i < length; i += 1) {
  3290. _this.putBit((num >>> length - i - 1 & 1) == 1);
  3291. }
  3292. };
  3293. _this.getLengthInBits = function () {
  3294. return _length;
  3295. };
  3296. _this.putBit = function (bit) {
  3297. var bufIndex = Math.floor(_length / 8);
  3298. if (_buffer.length <= bufIndex) {
  3299. _buffer.push(0);
  3300. }
  3301. if (bit) {
  3302. _buffer[bufIndex] |= 0x80 >>> _length % 8;
  3303. }
  3304. _length += 1;
  3305. };
  3306. return _this;
  3307. };
  3308. //---------------------------------------------------------------------
  3309. // qr8BitByte
  3310. //---------------------------------------------------------------------
  3311. var qr8BitByte = function qr8BitByte(data) {
  3312. var _mode = QRMode.MODE_8BIT_BYTE;
  3313. var _data = data;
  3314. var _parsedData = [];
  3315. var _this = {};
  3316. // Added to support UTF-8 Characters
  3317. for (var i = 0, l = _data.length; i < l; i++) {
  3318. var byteArray = [];
  3319. var code = _data.charCodeAt(i);
  3320. if (code > 0x10000) {
  3321. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  3322. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  3323. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  3324. byteArray[3] = 0x80 | code & 0x3F;
  3325. } else if (code > 0x800) {
  3326. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  3327. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  3328. byteArray[2] = 0x80 | code & 0x3F;
  3329. } else if (code > 0x80) {
  3330. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  3331. byteArray[1] = 0x80 | code & 0x3F;
  3332. } else {
  3333. byteArray[0] = code;
  3334. }
  3335. // Fix Unicode corruption bug
  3336. _parsedData.push(byteArray);
  3337. }
  3338. _parsedData = Array.prototype.concat.apply([], _parsedData);
  3339. if (_parsedData.length != _data.length) {
  3340. _parsedData.unshift(191);
  3341. _parsedData.unshift(187);
  3342. _parsedData.unshift(239);
  3343. }
  3344. var _bytes = _parsedData;
  3345. _this.getMode = function () {
  3346. return _mode;
  3347. };
  3348. _this.getLength = function (buffer) {
  3349. return _bytes.length;
  3350. };
  3351. _this.write = function (buffer) {
  3352. for (var i = 0; i < _bytes.length; i += 1) {
  3353. buffer.put(_bytes[i], 8);
  3354. }
  3355. };
  3356. return _this;
  3357. };
  3358. //=====================================================================
  3359. // GIF Support etc.
  3360. //
  3361. //---------------------------------------------------------------------
  3362. // byteArrayOutputStream
  3363. //---------------------------------------------------------------------
  3364. var byteArrayOutputStream = function byteArrayOutputStream() {
  3365. var _bytes = new Array();
  3366. var _this = {};
  3367. _this.writeByte = function (b) {
  3368. _bytes.push(b & 0xff);
  3369. };
  3370. _this.writeShort = function (i) {
  3371. _this.writeByte(i);
  3372. _this.writeByte(i >>> 8);
  3373. };
  3374. _this.writeBytes = function (b, off, len) {
  3375. off = off || 0;
  3376. len = len || b.length;
  3377. for (var i = 0; i < len; i += 1) {
  3378. _this.writeByte(b[i + off]);
  3379. }
  3380. };
  3381. _this.writeString = function (s) {
  3382. for (var i = 0; i < s.length; i += 1) {
  3383. _this.writeByte(s.charCodeAt(i));
  3384. }
  3385. };
  3386. _this.toByteArray = function () {
  3387. return _bytes;
  3388. };
  3389. _this.toString = function () {
  3390. var s = '';
  3391. s += '[';
  3392. for (var i = 0; i < _bytes.length; i += 1) {
  3393. if (i > 0) {
  3394. s += ',';
  3395. }
  3396. s += _bytes[i];
  3397. }
  3398. s += ']';
  3399. return s;
  3400. };
  3401. return _this;
  3402. };
  3403. //---------------------------------------------------------------------
  3404. // base64EncodeOutputStream
  3405. //---------------------------------------------------------------------
  3406. var base64EncodeOutputStream = function base64EncodeOutputStream() {
  3407. var _buffer = 0;
  3408. var _buflen = 0;
  3409. var _length = 0;
  3410. var _base64 = '';
  3411. var _this = {};
  3412. var writeEncoded = function writeEncoded(b) {
  3413. _base64 += String.fromCharCode(encode(b & 0x3f));
  3414. };
  3415. var encode = function encode(n) {
  3416. if (n < 0) {
  3417. // error.
  3418. } else if (n < 26) {
  3419. return 0x41 + n;
  3420. } else if (n < 52) {
  3421. return 0x61 + (n - 26);
  3422. } else if (n < 62) {
  3423. return 0x30 + (n - 52);
  3424. } else if (n == 62) {
  3425. return 0x2b;
  3426. } else if (n == 63) {
  3427. return 0x2f;
  3428. }
  3429. throw new Error('n:' + n);
  3430. };
  3431. _this.writeByte = function (n) {
  3432. _buffer = _buffer << 8 | n & 0xff;
  3433. _buflen += 8;
  3434. _length += 1;
  3435. while (_buflen >= 6) {
  3436. writeEncoded(_buffer >>> _buflen - 6);
  3437. _buflen -= 6;
  3438. }
  3439. };
  3440. _this.flush = function () {
  3441. if (_buflen > 0) {
  3442. writeEncoded(_buffer << 6 - _buflen);
  3443. _buffer = 0;
  3444. _buflen = 0;
  3445. }
  3446. if (_length % 3 != 0) {
  3447. // padding
  3448. var padlen = 3 - _length % 3;
  3449. for (var i = 0; i < padlen; i += 1) {
  3450. _base64 += '=';
  3451. }
  3452. }
  3453. };
  3454. _this.toString = function () {
  3455. return _base64;
  3456. };
  3457. return _this;
  3458. };
  3459. //---------------------------------------------------------------------
  3460. // base64DecodeInputStream
  3461. //---------------------------------------------------------------------
  3462. var base64DecodeInputStream = function base64DecodeInputStream(str) {
  3463. var _str = str;
  3464. var _pos = 0;
  3465. var _buffer = 0;
  3466. var _buflen = 0;
  3467. var _this = {};
  3468. _this.read = function () {
  3469. while (_buflen < 8) {
  3470. if (_pos >= _str.length) {
  3471. if (_buflen == 0) {
  3472. return -1;
  3473. }
  3474. throw new Error('unexpected end of file./' + _buflen);
  3475. }
  3476. var c = _str.charAt(_pos);
  3477. _pos += 1;
  3478. if (c == '=') {
  3479. _buflen = 0;
  3480. return -1;
  3481. } else if (c.match(/^\s$/)) {
  3482. // ignore if whitespace.
  3483. continue;
  3484. }
  3485. _buffer = _buffer << 6 | decode(c.charCodeAt(0));
  3486. _buflen += 6;
  3487. }
  3488. var n = _buffer >>> _buflen - 8 & 0xff;
  3489. _buflen -= 8;
  3490. return n;
  3491. };
  3492. var decode = function decode(c) {
  3493. if (0x41 <= c && c <= 0x5a) {
  3494. return c - 0x41;
  3495. } else if (0x61 <= c && c <= 0x7a) {
  3496. return c - 0x61 + 26;
  3497. } else if (0x30 <= c && c <= 0x39) {
  3498. return c - 0x30 + 52;
  3499. } else if (c == 0x2b) {
  3500. return 62;
  3501. } else if (c == 0x2f) {
  3502. return 63;
  3503. } else {
  3504. throw new Error('c:' + c);
  3505. }
  3506. };
  3507. return _this;
  3508. };
  3509. //---------------------------------------------------------------------
  3510. // gifImage (B/W)
  3511. //---------------------------------------------------------------------
  3512. var gifImage = function gifImage(width, height) {
  3513. var _width = width;
  3514. var _height = height;
  3515. var _data = new Array(width * height);
  3516. var _this = {};
  3517. _this.setPixel = function (x, y, pixel) {
  3518. _data[y * _width + x] = pixel;
  3519. };
  3520. _this.write = function (out) {
  3521. //---------------------------------
  3522. // GIF Signature
  3523. out.writeString('GIF87a');
  3524. //---------------------------------
  3525. // Screen Descriptor
  3526. out.writeShort(_width);
  3527. out.writeShort(_height);
  3528. out.writeByte(0x80); // 2bit
  3529. out.writeByte(0);
  3530. out.writeByte(0);
  3531. //---------------------------------
  3532. // Global Color Map
  3533. // black
  3534. out.writeByte(0x00);
  3535. out.writeByte(0x00);
  3536. out.writeByte(0x00);
  3537. // white
  3538. out.writeByte(0xff);
  3539. out.writeByte(0xff);
  3540. out.writeByte(0xff);
  3541. //---------------------------------
  3542. // Image Descriptor
  3543. out.writeString(',');
  3544. out.writeShort(0);
  3545. out.writeShort(0);
  3546. out.writeShort(_width);
  3547. out.writeShort(_height);
  3548. out.writeByte(0);
  3549. //---------------------------------
  3550. // Local Color Map
  3551. //---------------------------------
  3552. // Raster Data
  3553. var lzwMinCodeSize = 2;
  3554. var raster = getLZWRaster(lzwMinCodeSize);
  3555. out.writeByte(lzwMinCodeSize);
  3556. var offset = 0;
  3557. while (raster.length - offset > 255) {
  3558. out.writeByte(255);
  3559. out.writeBytes(raster, offset, 255);
  3560. offset += 255;
  3561. }
  3562. out.writeByte(raster.length - offset);
  3563. out.writeBytes(raster, offset, raster.length - offset);
  3564. out.writeByte(0x00);
  3565. //---------------------------------
  3566. // GIF Terminator
  3567. out.writeString(';');
  3568. };
  3569. var bitOutputStream = function bitOutputStream(out) {
  3570. var _out = out;
  3571. var _bitLength = 0;
  3572. var _bitBuffer = 0;
  3573. var _this = {};
  3574. _this.write = function (data, length) {
  3575. if (data >>> length != 0) {
  3576. throw new Error('length over');
  3577. }
  3578. while (_bitLength + length >= 8) {
  3579. _out.writeByte(0xff & (data << _bitLength | _bitBuffer));
  3580. length -= 8 - _bitLength;
  3581. data >>>= 8 - _bitLength;
  3582. _bitBuffer = 0;
  3583. _bitLength = 0;
  3584. }
  3585. _bitBuffer = data << _bitLength | _bitBuffer;
  3586. _bitLength = _bitLength + length;
  3587. };
  3588. _this.flush = function () {
  3589. if (_bitLength > 0) {
  3590. _out.writeByte(_bitBuffer);
  3591. }
  3592. };
  3593. return _this;
  3594. };
  3595. var getLZWRaster = function getLZWRaster(lzwMinCodeSize) {
  3596. var clearCode = 1 << lzwMinCodeSize;
  3597. var endCode = (1 << lzwMinCodeSize) + 1;
  3598. var bitLength = lzwMinCodeSize + 1;
  3599. // Setup LZWTable
  3600. var table = lzwTable();
  3601. for (var i = 0; i < clearCode; i += 1) {
  3602. table.add(String.fromCharCode(i));
  3603. }
  3604. table.add(String.fromCharCode(clearCode));
  3605. table.add(String.fromCharCode(endCode));
  3606. var byteOut = byteArrayOutputStream();
  3607. var bitOut = bitOutputStream(byteOut);
  3608. // clear code
  3609. bitOut.write(clearCode, bitLength);
  3610. var dataIndex = 0;
  3611. var s = String.fromCharCode(_data[dataIndex]);
  3612. dataIndex += 1;
  3613. while (dataIndex < _data.length) {
  3614. var c = String.fromCharCode(_data[dataIndex]);
  3615. dataIndex += 1;
  3616. if (table.contains(s + c)) {
  3617. s = s + c;
  3618. } else {
  3619. bitOut.write(table.indexOf(s), bitLength);
  3620. if (table.size() < 0xfff) {
  3621. if (table.size() == 1 << bitLength) {
  3622. bitLength += 1;
  3623. }
  3624. table.add(s + c);
  3625. }
  3626. s = c;
  3627. }
  3628. }
  3629. bitOut.write(table.indexOf(s), bitLength);
  3630. // end code
  3631. bitOut.write(endCode, bitLength);
  3632. bitOut.flush();
  3633. return byteOut.toByteArray();
  3634. };
  3635. var lzwTable = function lzwTable() {
  3636. var _map = {};
  3637. var _size = 0;
  3638. var _this = {};
  3639. _this.add = function (key) {
  3640. if (_this.contains(key)) {
  3641. throw new Error('dup key:' + key);
  3642. }
  3643. _map[key] = _size;
  3644. _size += 1;
  3645. };
  3646. _this.size = function () {
  3647. return _size;
  3648. };
  3649. _this.indexOf = function (key) {
  3650. return _map[key];
  3651. };
  3652. _this.contains = function (key) {
  3653. return typeof _map[key] != 'undefined';
  3654. };
  3655. return _this;
  3656. };
  3657. return _this;
  3658. };
  3659. var createImgTag = function createImgTag(width, height, getPixel, alt) {
  3660. var gif = gifImage(width, height);
  3661. for (var y = 0; y < height; y += 1) {
  3662. for (var x = 0; x < width; x += 1) {
  3663. gif.setPixel(x, y, getPixel(x, y));
  3664. }
  3665. }
  3666. var b = byteArrayOutputStream();
  3667. gif.write(b);
  3668. var base64 = base64EncodeOutputStream();
  3669. var bytes = b.toByteArray();
  3670. for (var i = 0; i < bytes.length; i += 1) {
  3671. base64.writeByte(bytes[i]);
  3672. }
  3673. base64.flush();
  3674. var img = '';
  3675. img += 'data:image/gif;base64,';
  3676. img += base64;
  3677. return img;
  3678. };
  3679. //---------------------------------------------------------------------
  3680. // returns qrcode function.
  3681. var createQrCodeImg = function createQrCodeImg(text, options) {
  3682. options = options || {};
  3683. var typeNumber = options.typeNumber || 4;
  3684. var errorCorrectLevel = options.errorCorrectLevel || 'M';
  3685. var size = options.size || 500;
  3686. var qr;
  3687. try {
  3688. qr = qrcode(typeNumber, errorCorrectLevel || 'M');
  3689. qr.addData(text);
  3690. qr.make();
  3691. } catch (e) {
  3692. if (typeNumber >= 40) {
  3693. throw new Error('Text too long to encode');
  3694. } else {
  3695. return gen(text, {
  3696. size: size,
  3697. errorCorrectLevel: errorCorrectLevel,
  3698. typeNumber: typeNumber + 1 });
  3699. }
  3700. }
  3701. // calc cellsize and margin
  3702. var cellsize = parseInt(size / qr.getModuleCount());
  3703. var margin = parseInt((size - qr.getModuleCount() * cellsize) / 2);
  3704. return qr.createImgTag(cellsize, margin, size);
  3705. };
  3706. // var module = {}; 需要注释这一行,否则微信小程序无法使用
  3707. module.exports = {
  3708. createQrCodeImg: createQrCodeImg };
  3709. /***/ }),
  3710. /***/ 11:
  3711. /*!********************************************!*\
  3712. !*** E:/飞播代码/lipin/store/modules/index.js ***!
  3713. \********************************************/
  3714. /*! no static exports found */
  3715. /***/ (function(module, exports, __webpack_require__) {
  3716. "use strict";
  3717. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _app = _interopRequireDefault(__webpack_require__(/*! ./app */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  3718. {
  3719. app: _app.default };exports.default = _default;
  3720. /***/ }),
  3721. /***/ 12:
  3722. /*!******************************************!*\
  3723. !*** E:/飞播代码/lipin/store/modules/app.js ***!
  3724. \******************************************/
  3725. /*! no static exports found */
  3726. /***/ (function(module, exports, __webpack_require__) {
  3727. "use strict";
  3728. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _user = __webpack_require__(/*! ../../api/user.js */ 13);
  3729. var _cache = __webpack_require__(/*! ../../config/cache */ 16);
  3730. var _cache2 = _interopRequireDefault(__webpack_require__(/*! ../../utils/cache */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3731. var state = {
  3732. token: _cache2.default.get(_cache.LOGIN_STATUS) || null,
  3733. backgroundColor: "#fff",
  3734. userInfo: null,
  3735. uid: _cache2.default.get(_cache.UID) || null,
  3736. homeActive: false };
  3737. var mutations = {
  3738. LOGIN: function LOGIN(state, opt) {
  3739. state.token = opt.token;
  3740. _cache2.default.set(_cache.LOGIN_STATUS, opt.token, opt.time);
  3741. },
  3742. SETUID: function SETUID(state, val) {
  3743. state.uid = val;
  3744. _cache2.default.set(_cache.UID, val);
  3745. },
  3746. UPDATE_LOGIN: function UPDATE_LOGIN(state, token) {
  3747. state.token = token;
  3748. },
  3749. LOGOUT: function LOGOUT(state) {
  3750. state.token = undefined;
  3751. state.uid = undefined;
  3752. _cache2.default.clear(_cache.LOGIN_STATUS);
  3753. _cache2.default.clear(_cache.UID);
  3754. },
  3755. BACKGROUND_COLOR: function BACKGROUND_COLOR(state, color) {
  3756. state.color = color;
  3757. document.body.style.backgroundColor = color;
  3758. },
  3759. UPDATE_USERINFO: function UPDATE_USERINFO(state, userInfo) {
  3760. state.userInfo = userInfo;
  3761. },
  3762. OPEN_HOME: function OPEN_HOME(state) {
  3763. state.homeActive = true;
  3764. },
  3765. CLOSE_HOME: function CLOSE_HOME(state) {
  3766. state.homeActive = false;
  3767. } };
  3768. var actions = {
  3769. USERINFO: function USERINFO(_ref,
  3770. force) {var state = _ref.state,commit = _ref.commit;
  3771. if (state.userInfo !== null && !force)
  3772. return Promise.resolve(state.userInfo);else
  3773. return new Promise(function (reslove) {
  3774. (0, _user.getUserInfo)().then(function (res) {
  3775. commit("UPDATE_USERINFO", res.data);
  3776. _cache2.default.set(_cache.USER_INFO, res.data);
  3777. reslove(res.data);
  3778. });
  3779. }).catch(function () {
  3780. });
  3781. } };var _default =
  3782. {
  3783. state: state,
  3784. mutations: mutations,
  3785. actions: actions };exports.default = _default;
  3786. /***/ }),
  3787. /***/ 13:
  3788. /*!*********************************!*\
  3789. !*** E:/飞播代码/lipin/api/user.js ***!
  3790. \*********************************/
  3791. /*! no static exports found */
  3792. /***/ (function(module, exports, __webpack_require__) {
  3793. "use strict";
  3794. Object.defineProperty(exports, "__esModule", { value: true });exports.getUserInfo = getUserInfo;exports.userShare = userShare;exports.loginH5 = loginH5;exports.loginMobile = loginMobile;exports.getCodeApi = getCodeApi;exports.registerVerify = registerVerify;exports.register = register;exports.registerReset = registerReset;exports.getMenuList = getMenuList;exports.postSignUser = postSignUser;exports.getSignConfig = getSignConfig;exports.getSignList = getSignList;exports.setSignIntegral = setSignIntegral;exports.getSignMonthList = getSignMonthList;exports.userActivity = userActivity;exports.getCommissionInfo = getCommissionInfo;exports.getIntegralList = getIntegralList;exports.spreadBanner = spreadBanner;exports.spreadPeople = spreadPeople;exports.spreadCount = spreadCount;exports.getSpreadInfo = getSpreadInfo;exports.spreadOrder = spreadOrder;exports.getRankList = getRankList;exports.getBrokerageRank = getBrokerageRank;exports.extractCash = extractCash;exports.extractBank = extractBank;exports.userLevelGrade = userLevelGrade;exports.userLevelTask = userLevelTask;exports.userLevelDetection = userLevelDetection;exports.getAddressList = getAddressList;exports.setAddressDefault = setAddressDefault;exports.editAddress = editAddress;exports.delAddress = delAddress;exports.getAddressDetail = getAddressDetail;exports.userEdit = userEdit;exports.userUpdate = userUpdate;exports.getLogout = getLogout;exports.rechargeRoutine = rechargeRoutine;exports.rechargeWechat = rechargeWechat;exports.getAddressDefault = getAddressDefault;exports.getRechargeApi = getRechargeApi;exports.setVisit = setVisit;exports.serviceList = serviceList;exports.getChatRecord = getChatRecord;exports.spread = spread;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request.js */ 14));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;}
  3795. /**
  3796. * 获取用户信息
  3797. *
  3798. */
  3799. function getUserInfo() {
  3800. return _request.default.get('user');
  3801. }
  3802. /**
  3803. * 设置用户分享
  3804. *
  3805. */
  3806. function userShare() {
  3807. return _request.default.post('user/share');
  3808. }
  3809. /**
  3810. * h5用户登录
  3811. * @param data object 用户账号密码
  3812. */
  3813. function loginH5(data) {
  3814. return _request.default.post("/login", data, { noAuth: true });
  3815. }
  3816. /**
  3817. * h5用户手机号登录
  3818. * @param data object 用户手机号 也只能
  3819. */
  3820. function loginMobile(data) {
  3821. return _request.default.post("/login/mobile", data, { noAuth: true });
  3822. }
  3823. /**
  3824. * 验证码key
  3825. */
  3826. function getCodeApi() {
  3827. return _request.default.get("verify_code", {}, { noAuth: true });
  3828. }
  3829. /**
  3830. * h5用户发送验证码
  3831. * @param data object 用户手机号
  3832. */
  3833. function registerVerify(data) {
  3834. return _request.default.post("/register/verify", data, { noAuth: true });
  3835. }
  3836. /**
  3837. * h5用户手机号注册
  3838. * @param data object 用户手机号 验证码 密码
  3839. */
  3840. function register(data) {
  3841. return _request.default.post("/register", data, { noAuth: true });
  3842. }
  3843. /**
  3844. * 用户手机号修改密码
  3845. * @param data object 用户手机号 验证码 密码
  3846. */
  3847. function registerReset(data) {
  3848. return _request.default.post("/register/reset", data, { noAuth: true });
  3849. }
  3850. /**
  3851. * 获取用户中心菜单
  3852. *
  3853. */
  3854. function getMenuList() {
  3855. return _request.default.get("menu/user");
  3856. }
  3857. /*
  3858. * 签到用户信息
  3859. * */
  3860. function postSignUser(sign) {
  3861. return _request.default.post("sign/user", sign);
  3862. }
  3863. /**
  3864. * 获取签到配置
  3865. *
  3866. */
  3867. function getSignConfig() {
  3868. return _request.default.get('sign/config');
  3869. }
  3870. /**
  3871. * 获取签到列表
  3872. * @param object data
  3873. */
  3874. function getSignList(data) {
  3875. return _request.default.get('sign/list', data);
  3876. }
  3877. /**
  3878. * 用户签到
  3879. */
  3880. function setSignIntegral() {
  3881. return _request.default.post('sign/integral');
  3882. }
  3883. /**
  3884. * 签到列表(年月)
  3885. * @param object data
  3886. *
  3887. */
  3888. function getSignMonthList(data) {
  3889. return _request.default.get('sign/month', data);
  3890. }
  3891. /**
  3892. * 活动状态
  3893. *
  3894. */
  3895. function userActivity() {
  3896. return _request.default.get('user/activity');
  3897. }
  3898. /*
  3899. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  3900. * */
  3901. function getCommissionInfo(q, types) {
  3902. return _request.default.get("spread/commission/" + types, q);
  3903. }
  3904. /*
  3905. * 积分记录
  3906. * */
  3907. function getIntegralList(q) {
  3908. return _request.default.get("integral/list", q);
  3909. }
  3910. /**
  3911. * 获取分销海报图片
  3912. *
  3913. */
  3914. function spreadBanner() {
  3915. return _request.default.get('spread/banner', { type: 1 });
  3916. }
  3917. /**
  3918. *
  3919. * 获取推广用户一级和二级
  3920. * @param object data
  3921. */
  3922. function spreadPeople(data) {
  3923. return _request.default.post('spread/people', data);
  3924. }
  3925. /**
  3926. *
  3927. * 推广佣金/提现总和
  3928. * @param int type
  3929. */
  3930. function spreadCount(type) {
  3931. return _request.default.get('spread/count/' + type);
  3932. }
  3933. /*
  3934. * 推广数据
  3935. * */
  3936. function getSpreadInfo() {
  3937. return _request.default.get("/commission");
  3938. }
  3939. /**
  3940. *
  3941. * 推广订单
  3942. * @param object data
  3943. */
  3944. function spreadOrder(data) {
  3945. return _request.default.post('spread/order', data);
  3946. }
  3947. /*
  3948. * 获取推广人排行
  3949. * */
  3950. function getRankList(q) {
  3951. return _request.default.get("rank", q);
  3952. }
  3953. /*
  3954. * 获取佣金排名
  3955. * */
  3956. function getBrokerageRank(q) {
  3957. return _request.default.get("brokerage_rank", q);
  3958. }
  3959. /**
  3960. * 提现申请
  3961. * @param object data
  3962. */
  3963. function extractCash(data) {
  3964. return _request.default.post('extract/cash', data);
  3965. }
  3966. /**
  3967. * 提现银行/提现最低金额
  3968. *
  3969. */
  3970. function extractBank() {
  3971. return _request.default.get('extract/bank');
  3972. }
  3973. /**
  3974. * 会员等级列表
  3975. *
  3976. */
  3977. function userLevelGrade() {
  3978. return _request.default.get('user/level/grade');
  3979. }
  3980. /**
  3981. * 获取某个等级任务
  3982. * @param int id 任务id
  3983. */
  3984. function userLevelTask(id) {
  3985. return _request.default.get('user/level/task/' + id);
  3986. }
  3987. /**
  3988. * 检查用户是否可以成为会员
  3989. *
  3990. */
  3991. function userLevelDetection() {
  3992. return _request.default.get('user/level/detection');
  3993. }
  3994. /**
  3995. *
  3996. * 地址列表
  3997. * @param object data
  3998. */
  3999. function getAddressList(data) {
  4000. return _request.default.get('address/list', data);
  4001. }
  4002. /**
  4003. * 设置默认地址
  4004. * @param int id
  4005. */
  4006. function setAddressDefault(id) {
  4007. return _request.default.post('address/default/set', { id: id });
  4008. }
  4009. /**
  4010. * 修改 添加地址
  4011. * @param object data
  4012. */
  4013. function editAddress(data) {
  4014. return _request.default.post('address/edit', data);
  4015. }
  4016. /**
  4017. * 删除地址
  4018. * @param int id
  4019. *
  4020. */
  4021. function delAddress(id) {
  4022. return _request.default.post('address/del', { id: id });
  4023. }
  4024. /**
  4025. * 获取单个地址
  4026. * @param int id
  4027. */
  4028. function getAddressDetail(id) {
  4029. return _request.default.get('address/detail/' + id);
  4030. }
  4031. /**
  4032. * 修改用户信息
  4033. * @param object
  4034. */
  4035. function userEdit(data) {
  4036. return _request.default.post('user/edit', data);
  4037. }
  4038. function userUpdate(data) {
  4039. return _request.default.post('user/update', data);
  4040. }
  4041. /*
  4042. * 退出登录
  4043. * */
  4044. function getLogout() {
  4045. return _request.default.get("logout");
  4046. }
  4047. /**
  4048. * 小程序充值
  4049. *
  4050. */
  4051. function rechargeRoutine(data) {
  4052. return _request.default.post('recharge/routine', data);
  4053. }
  4054. /*
  4055. * 公众号充值
  4056. * */
  4057. function rechargeWechat(data) {
  4058. return _request.default.post("recharge/wechat", data);
  4059. }
  4060. /**
  4061. * 获取默认地址
  4062. *
  4063. */
  4064. function getAddressDefault() {
  4065. return _request.default.get('address/default');
  4066. }
  4067. /**
  4068. * 充值金额选择
  4069. */
  4070. function getRechargeApi() {
  4071. return _request.default.get("recharge/index");
  4072. }
  4073. /**
  4074. * 登陆记录
  4075. */
  4076. function setVisit(data)
  4077. {
  4078. return _request.default.post('user/set_visit', _objectSpread({}, data), { noAuth: true });
  4079. }
  4080. /**
  4081. * 客服列表
  4082. */
  4083. function serviceList() {
  4084. return _request.default.get("user/service/list");
  4085. }
  4086. /**
  4087. * 客服详情
  4088. */
  4089. function getChatRecord(to_uid, data) {
  4090. return _request.default.get("user/service/record/" + to_uid, data);
  4091. }
  4092. /**
  4093. * 静默绑定推广人
  4094. * @param {Object} puid
  4095. */
  4096. function spread(puid)
  4097. {
  4098. return _request.default.post("user/spread", { puid: puid });
  4099. }
  4100. /***/ }),
  4101. /***/ 14:
  4102. /*!**************************************!*\
  4103. !*** E:/飞播代码/lipin/utils/request.js ***!
  4104. \**************************************/
  4105. /*! no static exports found */
  4106. /***/ (function(module, exports, __webpack_require__) {
  4107. "use strict";
  4108. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _app = __webpack_require__(/*! @/config/app */ 15);
  4109. var _login = __webpack_require__(/*! ../libs/login */ 8);
  4110. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 9));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4111. /**
  4112. * 发送请求
  4113. */
  4114. function baseRequest(url, method, data, _ref)
  4115. {var _ref$noAuth = _ref.noAuth,noAuth = _ref$noAuth === void 0 ? false : _ref$noAuth,_ref$noVerify = _ref.noVerify,noVerify = _ref$noVerify === void 0 ? false : _ref$noVerify;
  4116. var Url = _app.HTTP_REQUEST_URL,header = _app.HEADER;
  4117. if (!noAuth) {
  4118. //登录过期自动登录
  4119. if (!_store.default.state.app.token && !(0, _login.checkLogin)()) {
  4120. (0, _login.toLogin)();
  4121. return Promise.reject({ msg: '未登陆' });
  4122. }
  4123. }
  4124. if (_store.default.state.app.token) header[_app.TOKENNAME] = _store.default.state.app.token;
  4125. return new Promise(function (reslove, reject) {
  4126. uni.request({
  4127. url: Url + '/api/' + url,
  4128. method: method || 'GET',
  4129. header: header,
  4130. data: data || {},
  4131. success: function success(res) {
  4132. if (noVerify)
  4133. reslove(res.data, res);else
  4134. if (res.data.status == 200 || res.data.code == 200)
  4135. reslove(res.data, res);else
  4136. if ([410000, 410001, 410002].indexOf(res.data.status) !== -1) {
  4137. (0, _login.toLogin)();
  4138. reject(res.data);
  4139. } else
  4140. reject(res.data.msg || '系统错误');
  4141. },
  4142. fail: function fail(msg) {
  4143. reject('请求失败');
  4144. } });
  4145. });
  4146. }
  4147. var request = {};
  4148. ['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach(function (method) {
  4149. request[method] = function (api, data, opt) {return baseRequest(api, method, data, opt || {});};
  4150. });var _default =
  4151. request;exports.default = _default;
  4152. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4153. /***/ }),
  4154. /***/ 15:
  4155. /*!***********************************!*\
  4156. !*** E:/飞播代码/lipin/config/app.js ***!
  4157. \***********************************/
  4158. /*! no static exports found */
  4159. /***/ (function(module, exports) {
  4160. module.exports = {
  4161. // 请求域名 格式: https://您的域名
  4162. HTTP_REQUEST_URL: 'https://api.lipinwawa.com',
  4163. HEADER: {
  4164. 'content-type': 'application/json',
  4165. 'secret-key': 'b1bd7a4b8da3e47ce58e73b9e5f656c4' },
  4166. // 回话密钥名称 请勿修改此配置
  4167. TOKENNAME: 'token',
  4168. // 缓存时间 0 永久
  4169. EXPIRE: 0 };
  4170. /***/ }),
  4171. /***/ 16:
  4172. /*!*************************************!*\
  4173. !*** E:/飞播代码/lipin/config/cache.js ***!
  4174. \*************************************/
  4175. /*! no static exports found */
  4176. /***/ (function(module, exports) {
  4177. module.exports = {
  4178. //token
  4179. LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
  4180. // uid
  4181. UID: 'UID',
  4182. //�û�
  4183. USER_INFO: 'USER_INFO',
  4184. //token�����¼�
  4185. EXPIRES_TIME: 'EXPIRES_TIME',
  4186. //�Ƿ���Ȩ
  4187. WX_AUTH: 'WX_AUTH',
  4188. //���ں���Ȩcode
  4189. STATE_KEY: 'wx_authorize_state',
  4190. //�û�����
  4191. LOGINTYPE: 'loginType',
  4192. //���ں���ת����
  4193. BACK_URL: 'login_back_url',
  4194. // ����code
  4195. STATE_R_KEY: 'roution_authorize_state',
  4196. //��ȨlogoС����
  4197. LOGO_URL: 'LOGO_URL',
  4198. //模板缓存
  4199. SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
  4200. TIPS_KEY: 'TIPS_KEY',
  4201. SPREAD: 'spread',
  4202. //缓存经度
  4203. CACHE_LONGITUDE: 'LONGITUDE',
  4204. //缓存纬度
  4205. CACHE_LATITUDE: 'LATITUDE' };
  4206. /***/ }),
  4207. /***/ 17:
  4208. /*!************************************!*\
  4209. !*** E:/飞播代码/lipin/utils/cache.js ***!
  4210. \************************************/
  4211. /*! no static exports found */
  4212. /***/ (function(module, exports, __webpack_require__) {
  4213. "use strict";
  4214. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _app = __webpack_require__(/*! ../config/app */ 15);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
  4215. Cache = /*#__PURE__*/function () {
  4216. function Cache(handler) {_classCallCheck(this, Cache);
  4217. this.cacheSetHandler = uni.setStorageSync;
  4218. this.cacheGetHandler = uni.getStorageSync;
  4219. this.cacheClearHandler = uni.removeStorageSync;
  4220. this.cacheExpire = '_expire_2019_12_17_18_44';
  4221. }
  4222. /**
  4223. * 获取当前时间戳
  4224. */_createClass(Cache, [{ key: "time", value: function time()
  4225. {
  4226. return Math.round(new Date() / 1000);
  4227. }
  4228. /**
  4229. * 设置过期时间缓存
  4230. * @param {Object} key
  4231. * @param {Object} expire
  4232. */ }, { key: "setExpireCahe", value: function setExpireCahe(
  4233. key, expire)
  4234. {
  4235. expire = expire !== undefined ? expire : _app.EXPIRE;
  4236. if (expire) {
  4237. this.cacheSetHandler(key + this.cacheExpire, this.time() + expire);
  4238. }
  4239. }
  4240. /**
  4241. * 缓存是否过期,过期自动删除
  4242. * @param {Object} key
  4243. * @param {Object} $bool true = 删除,false = 不删除
  4244. */ }, { key: "getExpireCahe", value: function getExpireCahe(
  4245. key, $bool)
  4246. {
  4247. try {
  4248. var time = this.cacheGetHandler(key + this.cacheExpire);
  4249. if (time) {
  4250. var newTime = parseInt(time);
  4251. if (time && time < this.time() && !Number.isNaN(newTime)) {
  4252. if ($bool === undefined || $bool === true) {
  4253. this.cacheClearHandler(key);
  4254. this.cacheClearHandler(key + this.cacheExpire);
  4255. }
  4256. return false;
  4257. } else
  4258. return true;
  4259. } else {
  4260. return !!this.cacheGetHandler(key);
  4261. }
  4262. } catch (e) {
  4263. return false;
  4264. }
  4265. }
  4266. /**
  4267. * 设置缓存
  4268. * @param {Object} key
  4269. * @param {Object} data
  4270. */ }, { key: "set", value: function set(
  4271. key, data, expire) {
  4272. if (typeof data === 'object')
  4273. data = JSON.stringify(data);
  4274. try {
  4275. this.setExpireCahe(key, expire);
  4276. return this.cacheSetHandler(key, data);
  4277. } catch (e) {
  4278. return false;
  4279. }
  4280. }
  4281. /**
  4282. * 检测缓存是否存在
  4283. * @param {Object} key
  4284. */ }, { key: "has", value: function has(
  4285. key)
  4286. {
  4287. return this.getExpireCahe(key);
  4288. }
  4289. /**
  4290. * 获取缓存
  4291. * @param {Object} key
  4292. * @param {Object} $default
  4293. * @param {Object} expire
  4294. */ }, { key: "get", value: function get(
  4295. key, $default, expire) {
  4296. try {
  4297. var isBe = this.getExpireCahe(key);
  4298. var data = this.cacheGetHandler(key);
  4299. if (data && isBe) {
  4300. if (typeof $default === 'boolean')
  4301. return JSON.parse(data);else
  4302. return data;
  4303. } else {
  4304. if (typeof $default === 'function') {
  4305. var value = $default();
  4306. this.set(key, value, expire);
  4307. return value;
  4308. } else {
  4309. this.set(key, $default, expire);
  4310. return $default;
  4311. }
  4312. }
  4313. } catch (e) {
  4314. return null;
  4315. }
  4316. }
  4317. /**
  4318. * 删除缓存
  4319. * @param {Object} key
  4320. */ }, { key: "clear", value: function clear(
  4321. key)
  4322. {
  4323. try {
  4324. var cahceValue = this.cacheGetHandler(key + this.cacheExpire);
  4325. if (cahceValue)
  4326. this.cacheClearHandler(key + this.cacheExpire);
  4327. return this.cacheClearHandler(key);
  4328. } catch (e) {
  4329. return false;
  4330. }
  4331. }
  4332. /**
  4333. * 清除过期缓存
  4334. */ }, { key: "clearOverdue", value: function clearOverdue()
  4335. {
  4336. // let cacheList = uni.getStorageInfoSync(),that = this;
  4337. // if (typeof cacheList.keys === 'object'){
  4338. // cacheList.keys.forEach(item=>{
  4339. // that.getExpireCahe(item);
  4340. // })
  4341. // }
  4342. } }]);return Cache;}();var _default =
  4343. new Cache();exports.default = _default;
  4344. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4345. /***/ }),
  4346. /***/ 18:
  4347. /*!**************************************!*\
  4348. !*** E:/飞播代码/lipin/store/getters.js ***!
  4349. \**************************************/
  4350. /*! no static exports found */
  4351. /***/ (function(module, exports, __webpack_require__) {
  4352. "use strict";
  4353. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  4354. token: function token(state) {return state.app.token;},
  4355. isLogin: function isLogin(state) {return !!state.app.token;},
  4356. backgroundColor: function backgroundColor(state) {return state.app.backgroundColor;},
  4357. userInfo: function userInfo(state) {return state.app.userInfo || {};},
  4358. uid: function uid(state) {return state.app.uid;},
  4359. homeActive: function homeActive(state) {return state.app.homeActive;},
  4360. home: function home(state) {return state.app.home;} };
  4361. // export default {
  4362. // token: state => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrYWlmYS5jcm1lYi5uZXQiLCJhdWQiOiJrYWlmYS5jcm1lYi5uZXQiLCJpYXQiOjE1NzcwODM1MzQsIm5iZiI6MTU3NzA4MzUzNCwiZXhwIjoxNTc3MDk0MzM0LCJqdGkiOnsiaWQiOjExMCwidHlwZSI6InVzZXIifX0.U-i1pbdRjyXI1gr79Uq2XBPZ89T8f5Ai9jwrR8woTwE',
  4363. // isLogin: state => true,
  4364. // backgroundColor: state => state.app.backgroundColor,
  4365. // userInfo: state => state.app.userInfo || {}
  4366. // };
  4367. exports.default = _default;
  4368. /***/ }),
  4369. /***/ 2:
  4370. /*!******************************************************************************************!*\
  4371. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4372. \******************************************************************************************/
  4373. /*! exports provided: default */
  4374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4375. "use strict";
  4376. __webpack_require__.r(__webpack_exports__);
  4377. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4378. * Vue.js v2.6.11
  4379. * (c) 2014-2021 Evan You
  4380. * Released under the MIT License.
  4381. */
  4382. /* */
  4383. var emptyObject = Object.freeze({});
  4384. // These helpers produce better VM code in JS engines due to their
  4385. // explicitness and function inlining.
  4386. function isUndef (v) {
  4387. return v === undefined || v === null
  4388. }
  4389. function isDef (v) {
  4390. return v !== undefined && v !== null
  4391. }
  4392. function isTrue (v) {
  4393. return v === true
  4394. }
  4395. function isFalse (v) {
  4396. return v === false
  4397. }
  4398. /**
  4399. * Check if value is primitive.
  4400. */
  4401. function isPrimitive (value) {
  4402. return (
  4403. typeof value === 'string' ||
  4404. typeof value === 'number' ||
  4405. // $flow-disable-line
  4406. typeof value === 'symbol' ||
  4407. typeof value === 'boolean'
  4408. )
  4409. }
  4410. /**
  4411. * Quick object check - this is primarily used to tell
  4412. * Objects from primitive values when we know the value
  4413. * is a JSON-compliant type.
  4414. */
  4415. function isObject (obj) {
  4416. return obj !== null && typeof obj === 'object'
  4417. }
  4418. /**
  4419. * Get the raw type string of a value, e.g., [object Object].
  4420. */
  4421. var _toString = Object.prototype.toString;
  4422. function toRawType (value) {
  4423. return _toString.call(value).slice(8, -1)
  4424. }
  4425. /**
  4426. * Strict object type check. Only returns true
  4427. * for plain JavaScript objects.
  4428. */
  4429. function isPlainObject (obj) {
  4430. return _toString.call(obj) === '[object Object]'
  4431. }
  4432. function isRegExp (v) {
  4433. return _toString.call(v) === '[object RegExp]'
  4434. }
  4435. /**
  4436. * Check if val is a valid array index.
  4437. */
  4438. function isValidArrayIndex (val) {
  4439. var n = parseFloat(String(val));
  4440. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4441. }
  4442. function isPromise (val) {
  4443. return (
  4444. isDef(val) &&
  4445. typeof val.then === 'function' &&
  4446. typeof val.catch === 'function'
  4447. )
  4448. }
  4449. /**
  4450. * Convert a value to a string that is actually rendered.
  4451. */
  4452. function toString (val) {
  4453. return val == null
  4454. ? ''
  4455. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4456. ? JSON.stringify(val, null, 2)
  4457. : String(val)
  4458. }
  4459. /**
  4460. * Convert an input value to a number for persistence.
  4461. * If the conversion fails, return original string.
  4462. */
  4463. function toNumber (val) {
  4464. var n = parseFloat(val);
  4465. return isNaN(n) ? val : n
  4466. }
  4467. /**
  4468. * Make a map and return a function for checking if a key
  4469. * is in that map.
  4470. */
  4471. function makeMap (
  4472. str,
  4473. expectsLowerCase
  4474. ) {
  4475. var map = Object.create(null);
  4476. var list = str.split(',');
  4477. for (var i = 0; i < list.length; i++) {
  4478. map[list[i]] = true;
  4479. }
  4480. return expectsLowerCase
  4481. ? function (val) { return map[val.toLowerCase()]; }
  4482. : function (val) { return map[val]; }
  4483. }
  4484. /**
  4485. * Check if a tag is a built-in tag.
  4486. */
  4487. var isBuiltInTag = makeMap('slot,component', true);
  4488. /**
  4489. * Check if an attribute is a reserved attribute.
  4490. */
  4491. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4492. /**
  4493. * Remove an item from an array.
  4494. */
  4495. function remove (arr, item) {
  4496. if (arr.length) {
  4497. var index = arr.indexOf(item);
  4498. if (index > -1) {
  4499. return arr.splice(index, 1)
  4500. }
  4501. }
  4502. }
  4503. /**
  4504. * Check whether an object has the property.
  4505. */
  4506. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4507. function hasOwn (obj, key) {
  4508. return hasOwnProperty.call(obj, key)
  4509. }
  4510. /**
  4511. * Create a cached version of a pure function.
  4512. */
  4513. function cached (fn) {
  4514. var cache = Object.create(null);
  4515. return (function cachedFn (str) {
  4516. var hit = cache[str];
  4517. return hit || (cache[str] = fn(str))
  4518. })
  4519. }
  4520. /**
  4521. * Camelize a hyphen-delimited string.
  4522. */
  4523. var camelizeRE = /-(\w)/g;
  4524. var camelize = cached(function (str) {
  4525. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4526. });
  4527. /**
  4528. * Capitalize a string.
  4529. */
  4530. var capitalize = cached(function (str) {
  4531. return str.charAt(0).toUpperCase() + str.slice(1)
  4532. });
  4533. /**
  4534. * Hyphenate a camelCase string.
  4535. */
  4536. var hyphenateRE = /\B([A-Z])/g;
  4537. var hyphenate = cached(function (str) {
  4538. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4539. });
  4540. /**
  4541. * Simple bind polyfill for environments that do not support it,
  4542. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4543. * since native bind is now performant enough in most browsers.
  4544. * But removing it would mean breaking code that was able to run in
  4545. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4546. */
  4547. /* istanbul ignore next */
  4548. function polyfillBind (fn, ctx) {
  4549. function boundFn (a) {
  4550. var l = arguments.length;
  4551. return l
  4552. ? l > 1
  4553. ? fn.apply(ctx, arguments)
  4554. : fn.call(ctx, a)
  4555. : fn.call(ctx)
  4556. }
  4557. boundFn._length = fn.length;
  4558. return boundFn
  4559. }
  4560. function nativeBind (fn, ctx) {
  4561. return fn.bind(ctx)
  4562. }
  4563. var bind = Function.prototype.bind
  4564. ? nativeBind
  4565. : polyfillBind;
  4566. /**
  4567. * Convert an Array-like object to a real Array.
  4568. */
  4569. function toArray (list, start) {
  4570. start = start || 0;
  4571. var i = list.length - start;
  4572. var ret = new Array(i);
  4573. while (i--) {
  4574. ret[i] = list[i + start];
  4575. }
  4576. return ret
  4577. }
  4578. /**
  4579. * Mix properties into target object.
  4580. */
  4581. function extend (to, _from) {
  4582. for (var key in _from) {
  4583. to[key] = _from[key];
  4584. }
  4585. return to
  4586. }
  4587. /**
  4588. * Merge an Array of Objects into a single Object.
  4589. */
  4590. function toObject (arr) {
  4591. var res = {};
  4592. for (var i = 0; i < arr.length; i++) {
  4593. if (arr[i]) {
  4594. extend(res, arr[i]);
  4595. }
  4596. }
  4597. return res
  4598. }
  4599. /* eslint-disable no-unused-vars */
  4600. /**
  4601. * Perform no operation.
  4602. * Stubbing args to make Flow happy without leaving useless transpiled code
  4603. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4604. */
  4605. function noop (a, b, c) {}
  4606. /**
  4607. * Always return false.
  4608. */
  4609. var no = function (a, b, c) { return false; };
  4610. /* eslint-enable no-unused-vars */
  4611. /**
  4612. * Return the same value.
  4613. */
  4614. var identity = function (_) { return _; };
  4615. /**
  4616. * Check if two values are loosely equal - that is,
  4617. * if they are plain objects, do they have the same shape?
  4618. */
  4619. function looseEqual (a, b) {
  4620. if (a === b) { return true }
  4621. var isObjectA = isObject(a);
  4622. var isObjectB = isObject(b);
  4623. if (isObjectA && isObjectB) {
  4624. try {
  4625. var isArrayA = Array.isArray(a);
  4626. var isArrayB = Array.isArray(b);
  4627. if (isArrayA && isArrayB) {
  4628. return a.length === b.length && a.every(function (e, i) {
  4629. return looseEqual(e, b[i])
  4630. })
  4631. } else if (a instanceof Date && b instanceof Date) {
  4632. return a.getTime() === b.getTime()
  4633. } else if (!isArrayA && !isArrayB) {
  4634. var keysA = Object.keys(a);
  4635. var keysB = Object.keys(b);
  4636. return keysA.length === keysB.length && keysA.every(function (key) {
  4637. return looseEqual(a[key], b[key])
  4638. })
  4639. } else {
  4640. /* istanbul ignore next */
  4641. return false
  4642. }
  4643. } catch (e) {
  4644. /* istanbul ignore next */
  4645. return false
  4646. }
  4647. } else if (!isObjectA && !isObjectB) {
  4648. return String(a) === String(b)
  4649. } else {
  4650. return false
  4651. }
  4652. }
  4653. /**
  4654. * Return the first index at which a loosely equal value can be
  4655. * found in the array (if value is a plain object, the array must
  4656. * contain an object of the same shape), or -1 if it is not present.
  4657. */
  4658. function looseIndexOf (arr, val) {
  4659. for (var i = 0; i < arr.length; i++) {
  4660. if (looseEqual(arr[i], val)) { return i }
  4661. }
  4662. return -1
  4663. }
  4664. /**
  4665. * Ensure a function is called only once.
  4666. */
  4667. function once (fn) {
  4668. var called = false;
  4669. return function () {
  4670. if (!called) {
  4671. called = true;
  4672. fn.apply(this, arguments);
  4673. }
  4674. }
  4675. }
  4676. var ASSET_TYPES = [
  4677. 'component',
  4678. 'directive',
  4679. 'filter'
  4680. ];
  4681. var LIFECYCLE_HOOKS = [
  4682. 'beforeCreate',
  4683. 'created',
  4684. 'beforeMount',
  4685. 'mounted',
  4686. 'beforeUpdate',
  4687. 'updated',
  4688. 'beforeDestroy',
  4689. 'destroyed',
  4690. 'activated',
  4691. 'deactivated',
  4692. 'errorCaptured',
  4693. 'serverPrefetch'
  4694. ];
  4695. /* */
  4696. var config = ({
  4697. /**
  4698. * Option merge strategies (used in core/util/options)
  4699. */
  4700. // $flow-disable-line
  4701. optionMergeStrategies: Object.create(null),
  4702. /**
  4703. * Whether to suppress warnings.
  4704. */
  4705. silent: false,
  4706. /**
  4707. * Show production mode tip message on boot?
  4708. */
  4709. productionTip: "development" !== 'production',
  4710. /**
  4711. * Whether to enable devtools
  4712. */
  4713. devtools: "development" !== 'production',
  4714. /**
  4715. * Whether to record perf
  4716. */
  4717. performance: false,
  4718. /**
  4719. * Error handler for watcher errors
  4720. */
  4721. errorHandler: null,
  4722. /**
  4723. * Warn handler for watcher warns
  4724. */
  4725. warnHandler: null,
  4726. /**
  4727. * Ignore certain custom elements
  4728. */
  4729. ignoredElements: [],
  4730. /**
  4731. * Custom user key aliases for v-on
  4732. */
  4733. // $flow-disable-line
  4734. keyCodes: Object.create(null),
  4735. /**
  4736. * Check if a tag is reserved so that it cannot be registered as a
  4737. * component. This is platform-dependent and may be overwritten.
  4738. */
  4739. isReservedTag: no,
  4740. /**
  4741. * Check if an attribute is reserved so that it cannot be used as a component
  4742. * prop. This is platform-dependent and may be overwritten.
  4743. */
  4744. isReservedAttr: no,
  4745. /**
  4746. * Check if a tag is an unknown element.
  4747. * Platform-dependent.
  4748. */
  4749. isUnknownElement: no,
  4750. /**
  4751. * Get the namespace of an element
  4752. */
  4753. getTagNamespace: noop,
  4754. /**
  4755. * Parse the real tag name for the specific platform.
  4756. */
  4757. parsePlatformTagName: identity,
  4758. /**
  4759. * Check if an attribute must be bound using property, e.g. value
  4760. * Platform-dependent.
  4761. */
  4762. mustUseProp: no,
  4763. /**
  4764. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4765. * This will significantly reduce performance if set to false.
  4766. */
  4767. async: true,
  4768. /**
  4769. * Exposed for legacy reasons
  4770. */
  4771. _lifecycleHooks: LIFECYCLE_HOOKS
  4772. });
  4773. /* */
  4774. /**
  4775. * unicode letters used for parsing html tags, component names and property paths.
  4776. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4777. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4778. */
  4779. 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/;
  4780. /**
  4781. * Check if a string starts with $ or _
  4782. */
  4783. function isReserved (str) {
  4784. var c = (str + '').charCodeAt(0);
  4785. return c === 0x24 || c === 0x5F
  4786. }
  4787. /**
  4788. * Define a property.
  4789. */
  4790. function def (obj, key, val, enumerable) {
  4791. Object.defineProperty(obj, key, {
  4792. value: val,
  4793. enumerable: !!enumerable,
  4794. writable: true,
  4795. configurable: true
  4796. });
  4797. }
  4798. /**
  4799. * Parse simple path.
  4800. */
  4801. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4802. function parsePath (path) {
  4803. if (bailRE.test(path)) {
  4804. return
  4805. }
  4806. var segments = path.split('.');
  4807. return function (obj) {
  4808. for (var i = 0; i < segments.length; i++) {
  4809. if (!obj) { return }
  4810. obj = obj[segments[i]];
  4811. }
  4812. return obj
  4813. }
  4814. }
  4815. /* */
  4816. // can we use __proto__?
  4817. var hasProto = '__proto__' in {};
  4818. // Browser environment sniffing
  4819. var inBrowser = typeof window !== 'undefined';
  4820. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4821. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4822. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4823. var isIE = UA && /msie|trident/.test(UA);
  4824. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4825. var isEdge = UA && UA.indexOf('edge/') > 0;
  4826. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4827. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4828. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4829. var isPhantomJS = UA && /phantomjs/.test(UA);
  4830. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4831. // Firefox has a "watch" function on Object.prototype...
  4832. var nativeWatch = ({}).watch;
  4833. if (inBrowser) {
  4834. try {
  4835. var opts = {};
  4836. Object.defineProperty(opts, 'passive', ({
  4837. get: function get () {
  4838. }
  4839. })); // https://github.com/facebook/flow/issues/285
  4840. window.addEventListener('test-passive', null, opts);
  4841. } catch (e) {}
  4842. }
  4843. // this needs to be lazy-evaled because vue may be required before
  4844. // vue-server-renderer can set VUE_ENV
  4845. var _isServer;
  4846. var isServerRendering = function () {
  4847. if (_isServer === undefined) {
  4848. /* istanbul ignore if */
  4849. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4850. // detect presence of vue-server-renderer and avoid
  4851. // Webpack shimming the process
  4852. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4853. } else {
  4854. _isServer = false;
  4855. }
  4856. }
  4857. return _isServer
  4858. };
  4859. // detect devtools
  4860. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4861. /* istanbul ignore next */
  4862. function isNative (Ctor) {
  4863. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4864. }
  4865. var hasSymbol =
  4866. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4867. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4868. var _Set;
  4869. /* istanbul ignore if */ // $flow-disable-line
  4870. if (typeof Set !== 'undefined' && isNative(Set)) {
  4871. // use native Set when available.
  4872. _Set = Set;
  4873. } else {
  4874. // a non-standard Set polyfill that only works with primitive keys.
  4875. _Set = /*@__PURE__*/(function () {
  4876. function Set () {
  4877. this.set = Object.create(null);
  4878. }
  4879. Set.prototype.has = function has (key) {
  4880. return this.set[key] === true
  4881. };
  4882. Set.prototype.add = function add (key) {
  4883. this.set[key] = true;
  4884. };
  4885. Set.prototype.clear = function clear () {
  4886. this.set = Object.create(null);
  4887. };
  4888. return Set;
  4889. }());
  4890. }
  4891. /* */
  4892. var warn = noop;
  4893. var tip = noop;
  4894. var generateComponentTrace = (noop); // work around flow check
  4895. var formatComponentName = (noop);
  4896. if (true) {
  4897. var hasConsole = typeof console !== 'undefined';
  4898. var classifyRE = /(?:^|[-_])(\w)/g;
  4899. var classify = function (str) { return str
  4900. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4901. .replace(/[-_]/g, ''); };
  4902. warn = function (msg, vm) {
  4903. var trace = vm ? generateComponentTrace(vm) : '';
  4904. if (config.warnHandler) {
  4905. config.warnHandler.call(null, msg, vm, trace);
  4906. } else if (hasConsole && (!config.silent)) {
  4907. console.error(("[Vue warn]: " + msg + trace));
  4908. }
  4909. };
  4910. tip = function (msg, vm) {
  4911. if (hasConsole && (!config.silent)) {
  4912. console.warn("[Vue tip]: " + msg + (
  4913. vm ? generateComponentTrace(vm) : ''
  4914. ));
  4915. }
  4916. };
  4917. formatComponentName = function (vm, includeFile) {
  4918. if (vm.$root === vm) {
  4919. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4920. return ('') + vm.$options.__file
  4921. }
  4922. return '<Root>'
  4923. }
  4924. var options = typeof vm === 'function' && vm.cid != null
  4925. ? vm.options
  4926. : vm._isVue
  4927. ? vm.$options || vm.constructor.options
  4928. : vm;
  4929. var name = options.name || options._componentTag;
  4930. var file = options.__file;
  4931. if (!name && file) {
  4932. var match = file.match(/([^/\\]+)\.vue$/);
  4933. name = match && match[1];
  4934. }
  4935. return (
  4936. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4937. (file && includeFile !== false ? (" at " + file) : '')
  4938. )
  4939. };
  4940. var repeat = function (str, n) {
  4941. var res = '';
  4942. while (n) {
  4943. if (n % 2 === 1) { res += str; }
  4944. if (n > 1) { str += str; }
  4945. n >>= 1;
  4946. }
  4947. return res
  4948. };
  4949. generateComponentTrace = function (vm) {
  4950. if (vm._isVue && vm.$parent) {
  4951. var tree = [];
  4952. var currentRecursiveSequence = 0;
  4953. while (vm && vm.$options.name !== 'PageBody') {
  4954. if (tree.length > 0) {
  4955. var last = tree[tree.length - 1];
  4956. if (last.constructor === vm.constructor) {
  4957. currentRecursiveSequence++;
  4958. vm = vm.$parent;
  4959. continue
  4960. } else if (currentRecursiveSequence > 0) {
  4961. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4962. currentRecursiveSequence = 0;
  4963. }
  4964. }
  4965. !vm.$options.isReserved && tree.push(vm);
  4966. vm = vm.$parent;
  4967. }
  4968. return '\n\nfound in\n\n' + tree
  4969. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4970. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4971. : formatComponentName(vm))); })
  4972. .join('\n')
  4973. } else {
  4974. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4975. }
  4976. };
  4977. }
  4978. /* */
  4979. var uid = 0;
  4980. /**
  4981. * A dep is an observable that can have multiple
  4982. * directives subscribing to it.
  4983. */
  4984. var Dep = function Dep () {
  4985. this.id = uid++;
  4986. this.subs = [];
  4987. };
  4988. Dep.prototype.addSub = function addSub (sub) {
  4989. this.subs.push(sub);
  4990. };
  4991. Dep.prototype.removeSub = function removeSub (sub) {
  4992. remove(this.subs, sub);
  4993. };
  4994. Dep.prototype.depend = function depend () {
  4995. if (Dep.SharedObject.target) {
  4996. Dep.SharedObject.target.addDep(this);
  4997. }
  4998. };
  4999. Dep.prototype.notify = function notify () {
  5000. // stabilize the subscriber list first
  5001. var subs = this.subs.slice();
  5002. if ( true && !config.async) {
  5003. // subs aren't sorted in scheduler if not running async
  5004. // we need to sort them now to make sure they fire in correct
  5005. // order
  5006. subs.sort(function (a, b) { return a.id - b.id; });
  5007. }
  5008. for (var i = 0, l = subs.length; i < l; i++) {
  5009. subs[i].update();
  5010. }
  5011. };
  5012. // The current target watcher being evaluated.
  5013. // This is globally unique because only one watcher
  5014. // can be evaluated at a time.
  5015. // fixed by xxxxxx (nvue shared vuex)
  5016. /* eslint-disable no-undef */
  5017. Dep.SharedObject = {};
  5018. Dep.SharedObject.target = null;
  5019. Dep.SharedObject.targetStack = [];
  5020. function pushTarget (target) {
  5021. Dep.SharedObject.targetStack.push(target);
  5022. Dep.SharedObject.target = target;
  5023. Dep.target = target;
  5024. }
  5025. function popTarget () {
  5026. Dep.SharedObject.targetStack.pop();
  5027. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5028. Dep.target = Dep.SharedObject.target;
  5029. }
  5030. /* */
  5031. var VNode = function VNode (
  5032. tag,
  5033. data,
  5034. children,
  5035. text,
  5036. elm,
  5037. context,
  5038. componentOptions,
  5039. asyncFactory
  5040. ) {
  5041. this.tag = tag;
  5042. this.data = data;
  5043. this.children = children;
  5044. this.text = text;
  5045. this.elm = elm;
  5046. this.ns = undefined;
  5047. this.context = context;
  5048. this.fnContext = undefined;
  5049. this.fnOptions = undefined;
  5050. this.fnScopeId = undefined;
  5051. this.key = data && data.key;
  5052. this.componentOptions = componentOptions;
  5053. this.componentInstance = undefined;
  5054. this.parent = undefined;
  5055. this.raw = false;
  5056. this.isStatic = false;
  5057. this.isRootInsert = true;
  5058. this.isComment = false;
  5059. this.isCloned = false;
  5060. this.isOnce = false;
  5061. this.asyncFactory = asyncFactory;
  5062. this.asyncMeta = undefined;
  5063. this.isAsyncPlaceholder = false;
  5064. };
  5065. var prototypeAccessors = { child: { configurable: true } };
  5066. // DEPRECATED: alias for componentInstance for backwards compat.
  5067. /* istanbul ignore next */
  5068. prototypeAccessors.child.get = function () {
  5069. return this.componentInstance
  5070. };
  5071. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5072. var createEmptyVNode = function (text) {
  5073. if ( text === void 0 ) text = '';
  5074. var node = new VNode();
  5075. node.text = text;
  5076. node.isComment = true;
  5077. return node
  5078. };
  5079. function createTextVNode (val) {
  5080. return new VNode(undefined, undefined, undefined, String(val))
  5081. }
  5082. // optimized shallow clone
  5083. // used for static nodes and slot nodes because they may be reused across
  5084. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5085. // on their elm reference.
  5086. function cloneVNode (vnode) {
  5087. var cloned = new VNode(
  5088. vnode.tag,
  5089. vnode.data,
  5090. // #7975
  5091. // clone children array to avoid mutating original in case of cloning
  5092. // a child.
  5093. vnode.children && vnode.children.slice(),
  5094. vnode.text,
  5095. vnode.elm,
  5096. vnode.context,
  5097. vnode.componentOptions,
  5098. vnode.asyncFactory
  5099. );
  5100. cloned.ns = vnode.ns;
  5101. cloned.isStatic = vnode.isStatic;
  5102. cloned.key = vnode.key;
  5103. cloned.isComment = vnode.isComment;
  5104. cloned.fnContext = vnode.fnContext;
  5105. cloned.fnOptions = vnode.fnOptions;
  5106. cloned.fnScopeId = vnode.fnScopeId;
  5107. cloned.asyncMeta = vnode.asyncMeta;
  5108. cloned.isCloned = true;
  5109. return cloned
  5110. }
  5111. /*
  5112. * not type checking this file because flow doesn't play well with
  5113. * dynamically accessing methods on Array prototype
  5114. */
  5115. var arrayProto = Array.prototype;
  5116. var arrayMethods = Object.create(arrayProto);
  5117. var methodsToPatch = [
  5118. 'push',
  5119. 'pop',
  5120. 'shift',
  5121. 'unshift',
  5122. 'splice',
  5123. 'sort',
  5124. 'reverse'
  5125. ];
  5126. /**
  5127. * Intercept mutating methods and emit events
  5128. */
  5129. methodsToPatch.forEach(function (method) {
  5130. // cache original method
  5131. var original = arrayProto[method];
  5132. def(arrayMethods, method, function mutator () {
  5133. var args = [], len = arguments.length;
  5134. while ( len-- ) args[ len ] = arguments[ len ];
  5135. var result = original.apply(this, args);
  5136. var ob = this.__ob__;
  5137. var inserted;
  5138. switch (method) {
  5139. case 'push':
  5140. case 'unshift':
  5141. inserted = args;
  5142. break
  5143. case 'splice':
  5144. inserted = args.slice(2);
  5145. break
  5146. }
  5147. if (inserted) { ob.observeArray(inserted); }
  5148. // notify change
  5149. ob.dep.notify();
  5150. return result
  5151. });
  5152. });
  5153. /* */
  5154. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5155. /**
  5156. * In some cases we may want to disable observation inside a component's
  5157. * update computation.
  5158. */
  5159. var shouldObserve = true;
  5160. function toggleObserving (value) {
  5161. shouldObserve = value;
  5162. }
  5163. /**
  5164. * Observer class that is attached to each observed
  5165. * object. Once attached, the observer converts the target
  5166. * object's property keys into getter/setters that
  5167. * collect dependencies and dispatch updates.
  5168. */
  5169. var Observer = function Observer (value) {
  5170. this.value = value;
  5171. this.dep = new Dep();
  5172. this.vmCount = 0;
  5173. def(value, '__ob__', this);
  5174. if (Array.isArray(value)) {
  5175. if (hasProto) {
  5176. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5177. if(value.push !== value.__proto__.push){
  5178. copyAugment(value, arrayMethods, arrayKeys);
  5179. } else {
  5180. protoAugment(value, arrayMethods);
  5181. }
  5182. }
  5183. } else {
  5184. copyAugment(value, arrayMethods, arrayKeys);
  5185. }
  5186. this.observeArray(value);
  5187. } else {
  5188. this.walk(value);
  5189. }
  5190. };
  5191. /**
  5192. * Walk through all properties and convert them into
  5193. * getter/setters. This method should only be called when
  5194. * value type is Object.
  5195. */
  5196. Observer.prototype.walk = function walk (obj) {
  5197. var keys = Object.keys(obj);
  5198. for (var i = 0; i < keys.length; i++) {
  5199. defineReactive$$1(obj, keys[i]);
  5200. }
  5201. };
  5202. /**
  5203. * Observe a list of Array items.
  5204. */
  5205. Observer.prototype.observeArray = function observeArray (items) {
  5206. for (var i = 0, l = items.length; i < l; i++) {
  5207. observe(items[i]);
  5208. }
  5209. };
  5210. // helpers
  5211. /**
  5212. * Augment a target Object or Array by intercepting
  5213. * the prototype chain using __proto__
  5214. */
  5215. function protoAugment (target, src) {
  5216. /* eslint-disable no-proto */
  5217. target.__proto__ = src;
  5218. /* eslint-enable no-proto */
  5219. }
  5220. /**
  5221. * Augment a target Object or Array by defining
  5222. * hidden properties.
  5223. */
  5224. /* istanbul ignore next */
  5225. function copyAugment (target, src, keys) {
  5226. for (var i = 0, l = keys.length; i < l; i++) {
  5227. var key = keys[i];
  5228. def(target, key, src[key]);
  5229. }
  5230. }
  5231. /**
  5232. * Attempt to create an observer instance for a value,
  5233. * returns the new observer if successfully observed,
  5234. * or the existing observer if the value already has one.
  5235. */
  5236. function observe (value, asRootData) {
  5237. if (!isObject(value) || value instanceof VNode) {
  5238. return
  5239. }
  5240. var ob;
  5241. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5242. ob = value.__ob__;
  5243. } else if (
  5244. shouldObserve &&
  5245. !isServerRendering() &&
  5246. (Array.isArray(value) || isPlainObject(value)) &&
  5247. Object.isExtensible(value) &&
  5248. !value._isVue
  5249. ) {
  5250. ob = new Observer(value);
  5251. }
  5252. if (asRootData && ob) {
  5253. ob.vmCount++;
  5254. }
  5255. return ob
  5256. }
  5257. /**
  5258. * Define a reactive property on an Object.
  5259. */
  5260. function defineReactive$$1 (
  5261. obj,
  5262. key,
  5263. val,
  5264. customSetter,
  5265. shallow
  5266. ) {
  5267. var dep = new Dep();
  5268. var property = Object.getOwnPropertyDescriptor(obj, key);
  5269. if (property && property.configurable === false) {
  5270. return
  5271. }
  5272. // cater for pre-defined getter/setters
  5273. var getter = property && property.get;
  5274. var setter = property && property.set;
  5275. if ((!getter || setter) && arguments.length === 2) {
  5276. val = obj[key];
  5277. }
  5278. var childOb = !shallow && observe(val);
  5279. Object.defineProperty(obj, key, {
  5280. enumerable: true,
  5281. configurable: true,
  5282. get: function reactiveGetter () {
  5283. var value = getter ? getter.call(obj) : val;
  5284. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5285. dep.depend();
  5286. if (childOb) {
  5287. childOb.dep.depend();
  5288. if (Array.isArray(value)) {
  5289. dependArray(value);
  5290. }
  5291. }
  5292. }
  5293. return value
  5294. },
  5295. set: function reactiveSetter (newVal) {
  5296. var value = getter ? getter.call(obj) : val;
  5297. /* eslint-disable no-self-compare */
  5298. if (newVal === value || (newVal !== newVal && value !== value)) {
  5299. return
  5300. }
  5301. /* eslint-enable no-self-compare */
  5302. if ( true && customSetter) {
  5303. customSetter();
  5304. }
  5305. // #7981: for accessor properties without setter
  5306. if (getter && !setter) { return }
  5307. if (setter) {
  5308. setter.call(obj, newVal);
  5309. } else {
  5310. val = newVal;
  5311. }
  5312. childOb = !shallow && observe(newVal);
  5313. dep.notify();
  5314. }
  5315. });
  5316. }
  5317. /**
  5318. * Set a property on an object. Adds the new property and
  5319. * triggers change notification if the property doesn't
  5320. * already exist.
  5321. */
  5322. function set (target, key, val) {
  5323. if ( true &&
  5324. (isUndef(target) || isPrimitive(target))
  5325. ) {
  5326. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5327. }
  5328. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5329. target.length = Math.max(target.length, key);
  5330. target.splice(key, 1, val);
  5331. return val
  5332. }
  5333. if (key in target && !(key in Object.prototype)) {
  5334. target[key] = val;
  5335. return val
  5336. }
  5337. var ob = (target).__ob__;
  5338. if (target._isVue || (ob && ob.vmCount)) {
  5339. true && warn(
  5340. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5341. 'at runtime - declare it upfront in the data option.'
  5342. );
  5343. return val
  5344. }
  5345. if (!ob) {
  5346. target[key] = val;
  5347. return val
  5348. }
  5349. defineReactive$$1(ob.value, key, val);
  5350. ob.dep.notify();
  5351. return val
  5352. }
  5353. /**
  5354. * Delete a property and trigger change if necessary.
  5355. */
  5356. function del (target, key) {
  5357. if ( true &&
  5358. (isUndef(target) || isPrimitive(target))
  5359. ) {
  5360. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5361. }
  5362. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5363. target.splice(key, 1);
  5364. return
  5365. }
  5366. var ob = (target).__ob__;
  5367. if (target._isVue || (ob && ob.vmCount)) {
  5368. true && warn(
  5369. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5370. '- just set it to null.'
  5371. );
  5372. return
  5373. }
  5374. if (!hasOwn(target, key)) {
  5375. return
  5376. }
  5377. delete target[key];
  5378. if (!ob) {
  5379. return
  5380. }
  5381. ob.dep.notify();
  5382. }
  5383. /**
  5384. * Collect dependencies on array elements when the array is touched, since
  5385. * we cannot intercept array element access like property getters.
  5386. */
  5387. function dependArray (value) {
  5388. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5389. e = value[i];
  5390. e && e.__ob__ && e.__ob__.dep.depend();
  5391. if (Array.isArray(e)) {
  5392. dependArray(e);
  5393. }
  5394. }
  5395. }
  5396. /* */
  5397. /**
  5398. * Option overwriting strategies are functions that handle
  5399. * how to merge a parent option value and a child option
  5400. * value into the final value.
  5401. */
  5402. var strats = config.optionMergeStrategies;
  5403. /**
  5404. * Options with restrictions
  5405. */
  5406. if (true) {
  5407. strats.el = strats.propsData = function (parent, child, vm, key) {
  5408. if (!vm) {
  5409. warn(
  5410. "option \"" + key + "\" can only be used during instance " +
  5411. 'creation with the `new` keyword.'
  5412. );
  5413. }
  5414. return defaultStrat(parent, child)
  5415. };
  5416. }
  5417. /**
  5418. * Helper that recursively merges two data objects together.
  5419. */
  5420. function mergeData (to, from) {
  5421. if (!from) { return to }
  5422. var key, toVal, fromVal;
  5423. var keys = hasSymbol
  5424. ? Reflect.ownKeys(from)
  5425. : Object.keys(from);
  5426. for (var i = 0; i < keys.length; i++) {
  5427. key = keys[i];
  5428. // in case the object is already observed...
  5429. if (key === '__ob__') { continue }
  5430. toVal = to[key];
  5431. fromVal = from[key];
  5432. if (!hasOwn(to, key)) {
  5433. set(to, key, fromVal);
  5434. } else if (
  5435. toVal !== fromVal &&
  5436. isPlainObject(toVal) &&
  5437. isPlainObject(fromVal)
  5438. ) {
  5439. mergeData(toVal, fromVal);
  5440. }
  5441. }
  5442. return to
  5443. }
  5444. /**
  5445. * Data
  5446. */
  5447. function mergeDataOrFn (
  5448. parentVal,
  5449. childVal,
  5450. vm
  5451. ) {
  5452. if (!vm) {
  5453. // in a Vue.extend merge, both should be functions
  5454. if (!childVal) {
  5455. return parentVal
  5456. }
  5457. if (!parentVal) {
  5458. return childVal
  5459. }
  5460. // when parentVal & childVal are both present,
  5461. // we need to return a function that returns the
  5462. // merged result of both functions... no need to
  5463. // check if parentVal is a function here because
  5464. // it has to be a function to pass previous merges.
  5465. return function mergedDataFn () {
  5466. return mergeData(
  5467. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5468. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5469. )
  5470. }
  5471. } else {
  5472. return function mergedInstanceDataFn () {
  5473. // instance merge
  5474. var instanceData = typeof childVal === 'function'
  5475. ? childVal.call(vm, vm)
  5476. : childVal;
  5477. var defaultData = typeof parentVal === 'function'
  5478. ? parentVal.call(vm, vm)
  5479. : parentVal;
  5480. if (instanceData) {
  5481. return mergeData(instanceData, defaultData)
  5482. } else {
  5483. return defaultData
  5484. }
  5485. }
  5486. }
  5487. }
  5488. strats.data = function (
  5489. parentVal,
  5490. childVal,
  5491. vm
  5492. ) {
  5493. if (!vm) {
  5494. if (childVal && typeof childVal !== 'function') {
  5495. true && warn(
  5496. 'The "data" option should be a function ' +
  5497. 'that returns a per-instance value in component ' +
  5498. 'definitions.',
  5499. vm
  5500. );
  5501. return parentVal
  5502. }
  5503. return mergeDataOrFn(parentVal, childVal)
  5504. }
  5505. return mergeDataOrFn(parentVal, childVal, vm)
  5506. };
  5507. /**
  5508. * Hooks and props are merged as arrays.
  5509. */
  5510. function mergeHook (
  5511. parentVal,
  5512. childVal
  5513. ) {
  5514. var res = childVal
  5515. ? parentVal
  5516. ? parentVal.concat(childVal)
  5517. : Array.isArray(childVal)
  5518. ? childVal
  5519. : [childVal]
  5520. : parentVal;
  5521. return res
  5522. ? dedupeHooks(res)
  5523. : res
  5524. }
  5525. function dedupeHooks (hooks) {
  5526. var res = [];
  5527. for (var i = 0; i < hooks.length; i++) {
  5528. if (res.indexOf(hooks[i]) === -1) {
  5529. res.push(hooks[i]);
  5530. }
  5531. }
  5532. return res
  5533. }
  5534. LIFECYCLE_HOOKS.forEach(function (hook) {
  5535. strats[hook] = mergeHook;
  5536. });
  5537. /**
  5538. * Assets
  5539. *
  5540. * When a vm is present (instance creation), we need to do
  5541. * a three-way merge between constructor options, instance
  5542. * options and parent options.
  5543. */
  5544. function mergeAssets (
  5545. parentVal,
  5546. childVal,
  5547. vm,
  5548. key
  5549. ) {
  5550. var res = Object.create(parentVal || null);
  5551. if (childVal) {
  5552. true && assertObjectType(key, childVal, vm);
  5553. return extend(res, childVal)
  5554. } else {
  5555. return res
  5556. }
  5557. }
  5558. ASSET_TYPES.forEach(function (type) {
  5559. strats[type + 's'] = mergeAssets;
  5560. });
  5561. /**
  5562. * Watchers.
  5563. *
  5564. * Watchers hashes should not overwrite one
  5565. * another, so we merge them as arrays.
  5566. */
  5567. strats.watch = function (
  5568. parentVal,
  5569. childVal,
  5570. vm,
  5571. key
  5572. ) {
  5573. // work around Firefox's Object.prototype.watch...
  5574. if (parentVal === nativeWatch) { parentVal = undefined; }
  5575. if (childVal === nativeWatch) { childVal = undefined; }
  5576. /* istanbul ignore if */
  5577. if (!childVal) { return Object.create(parentVal || null) }
  5578. if (true) {
  5579. assertObjectType(key, childVal, vm);
  5580. }
  5581. if (!parentVal) { return childVal }
  5582. var ret = {};
  5583. extend(ret, parentVal);
  5584. for (var key$1 in childVal) {
  5585. var parent = ret[key$1];
  5586. var child = childVal[key$1];
  5587. if (parent && !Array.isArray(parent)) {
  5588. parent = [parent];
  5589. }
  5590. ret[key$1] = parent
  5591. ? parent.concat(child)
  5592. : Array.isArray(child) ? child : [child];
  5593. }
  5594. return ret
  5595. };
  5596. /**
  5597. * Other object hashes.
  5598. */
  5599. strats.props =
  5600. strats.methods =
  5601. strats.inject =
  5602. strats.computed = function (
  5603. parentVal,
  5604. childVal,
  5605. vm,
  5606. key
  5607. ) {
  5608. if (childVal && "development" !== 'production') {
  5609. assertObjectType(key, childVal, vm);
  5610. }
  5611. if (!parentVal) { return childVal }
  5612. var ret = Object.create(null);
  5613. extend(ret, parentVal);
  5614. if (childVal) { extend(ret, childVal); }
  5615. return ret
  5616. };
  5617. strats.provide = mergeDataOrFn;
  5618. /**
  5619. * Default strategy.
  5620. */
  5621. var defaultStrat = function (parentVal, childVal) {
  5622. return childVal === undefined
  5623. ? parentVal
  5624. : childVal
  5625. };
  5626. /**
  5627. * Validate component names
  5628. */
  5629. function checkComponents (options) {
  5630. for (var key in options.components) {
  5631. validateComponentName(key);
  5632. }
  5633. }
  5634. function validateComponentName (name) {
  5635. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5636. warn(
  5637. 'Invalid component name: "' + name + '". Component names ' +
  5638. 'should conform to valid custom element name in html5 specification.'
  5639. );
  5640. }
  5641. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5642. warn(
  5643. 'Do not use built-in or reserved HTML elements as component ' +
  5644. 'id: ' + name
  5645. );
  5646. }
  5647. }
  5648. /**
  5649. * Ensure all props option syntax are normalized into the
  5650. * Object-based format.
  5651. */
  5652. function normalizeProps (options, vm) {
  5653. var props = options.props;
  5654. if (!props) { return }
  5655. var res = {};
  5656. var i, val, name;
  5657. if (Array.isArray(props)) {
  5658. i = props.length;
  5659. while (i--) {
  5660. val = props[i];
  5661. if (typeof val === 'string') {
  5662. name = camelize(val);
  5663. res[name] = { type: null };
  5664. } else if (true) {
  5665. warn('props must be strings when using array syntax.');
  5666. }
  5667. }
  5668. } else if (isPlainObject(props)) {
  5669. for (var key in props) {
  5670. val = props[key];
  5671. name = camelize(key);
  5672. res[name] = isPlainObject(val)
  5673. ? val
  5674. : { type: val };
  5675. }
  5676. } else if (true) {
  5677. warn(
  5678. "Invalid value for option \"props\": expected an Array or an Object, " +
  5679. "but got " + (toRawType(props)) + ".",
  5680. vm
  5681. );
  5682. }
  5683. options.props = res;
  5684. }
  5685. /**
  5686. * Normalize all injections into Object-based format
  5687. */
  5688. function normalizeInject (options, vm) {
  5689. var inject = options.inject;
  5690. if (!inject) { return }
  5691. var normalized = options.inject = {};
  5692. if (Array.isArray(inject)) {
  5693. for (var i = 0; i < inject.length; i++) {
  5694. normalized[inject[i]] = { from: inject[i] };
  5695. }
  5696. } else if (isPlainObject(inject)) {
  5697. for (var key in inject) {
  5698. var val = inject[key];
  5699. normalized[key] = isPlainObject(val)
  5700. ? extend({ from: key }, val)
  5701. : { from: val };
  5702. }
  5703. } else if (true) {
  5704. warn(
  5705. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5706. "but got " + (toRawType(inject)) + ".",
  5707. vm
  5708. );
  5709. }
  5710. }
  5711. /**
  5712. * Normalize raw function directives into object format.
  5713. */
  5714. function normalizeDirectives (options) {
  5715. var dirs = options.directives;
  5716. if (dirs) {
  5717. for (var key in dirs) {
  5718. var def$$1 = dirs[key];
  5719. if (typeof def$$1 === 'function') {
  5720. dirs[key] = { bind: def$$1, update: def$$1 };
  5721. }
  5722. }
  5723. }
  5724. }
  5725. function assertObjectType (name, value, vm) {
  5726. if (!isPlainObject(value)) {
  5727. warn(
  5728. "Invalid value for option \"" + name + "\": expected an Object, " +
  5729. "but got " + (toRawType(value)) + ".",
  5730. vm
  5731. );
  5732. }
  5733. }
  5734. /**
  5735. * Merge two option objects into a new one.
  5736. * Core utility used in both instantiation and inheritance.
  5737. */
  5738. function mergeOptions (
  5739. parent,
  5740. child,
  5741. vm
  5742. ) {
  5743. if (true) {
  5744. checkComponents(child);
  5745. }
  5746. if (typeof child === 'function') {
  5747. child = child.options;
  5748. }
  5749. normalizeProps(child, vm);
  5750. normalizeInject(child, vm);
  5751. normalizeDirectives(child);
  5752. // Apply extends and mixins on the child options,
  5753. // but only if it is a raw options object that isn't
  5754. // the result of another mergeOptions call.
  5755. // Only merged options has the _base property.
  5756. if (!child._base) {
  5757. if (child.extends) {
  5758. parent = mergeOptions(parent, child.extends, vm);
  5759. }
  5760. if (child.mixins) {
  5761. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5762. parent = mergeOptions(parent, child.mixins[i], vm);
  5763. }
  5764. }
  5765. }
  5766. var options = {};
  5767. var key;
  5768. for (key in parent) {
  5769. mergeField(key);
  5770. }
  5771. for (key in child) {
  5772. if (!hasOwn(parent, key)) {
  5773. mergeField(key);
  5774. }
  5775. }
  5776. function mergeField (key) {
  5777. var strat = strats[key] || defaultStrat;
  5778. options[key] = strat(parent[key], child[key], vm, key);
  5779. }
  5780. return options
  5781. }
  5782. /**
  5783. * Resolve an asset.
  5784. * This function is used because child instances need access
  5785. * to assets defined in its ancestor chain.
  5786. */
  5787. function resolveAsset (
  5788. options,
  5789. type,
  5790. id,
  5791. warnMissing
  5792. ) {
  5793. /* istanbul ignore if */
  5794. if (typeof id !== 'string') {
  5795. return
  5796. }
  5797. var assets = options[type];
  5798. // check local registration variations first
  5799. if (hasOwn(assets, id)) { return assets[id] }
  5800. var camelizedId = camelize(id);
  5801. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5802. var PascalCaseId = capitalize(camelizedId);
  5803. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5804. // fallback to prototype chain
  5805. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5806. if ( true && warnMissing && !res) {
  5807. warn(
  5808. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5809. options
  5810. );
  5811. }
  5812. return res
  5813. }
  5814. /* */
  5815. function validateProp (
  5816. key,
  5817. propOptions,
  5818. propsData,
  5819. vm
  5820. ) {
  5821. var prop = propOptions[key];
  5822. var absent = !hasOwn(propsData, key);
  5823. var value = propsData[key];
  5824. // boolean casting
  5825. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5826. if (booleanIndex > -1) {
  5827. if (absent && !hasOwn(prop, 'default')) {
  5828. value = false;
  5829. } else if (value === '' || value === hyphenate(key)) {
  5830. // only cast empty string / same name to boolean if
  5831. // boolean has higher priority
  5832. var stringIndex = getTypeIndex(String, prop.type);
  5833. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5834. value = true;
  5835. }
  5836. }
  5837. }
  5838. // check default value
  5839. if (value === undefined) {
  5840. value = getPropDefaultValue(vm, prop, key);
  5841. // since the default value is a fresh copy,
  5842. // make sure to observe it.
  5843. var prevShouldObserve = shouldObserve;
  5844. toggleObserving(true);
  5845. observe(value);
  5846. toggleObserving(prevShouldObserve);
  5847. }
  5848. if (
  5849. true
  5850. ) {
  5851. assertProp(prop, key, value, vm, absent);
  5852. }
  5853. return value
  5854. }
  5855. /**
  5856. * Get the default value of a prop.
  5857. */
  5858. function getPropDefaultValue (vm, prop, key) {
  5859. // no default, return undefined
  5860. if (!hasOwn(prop, 'default')) {
  5861. return undefined
  5862. }
  5863. var def = prop.default;
  5864. // warn against non-factory defaults for Object & Array
  5865. if ( true && isObject(def)) {
  5866. warn(
  5867. 'Invalid default value for prop "' + key + '": ' +
  5868. 'Props with type Object/Array must use a factory function ' +
  5869. 'to return the default value.',
  5870. vm
  5871. );
  5872. }
  5873. // the raw prop value was also undefined from previous render,
  5874. // return previous default value to avoid unnecessary watcher trigger
  5875. if (vm && vm.$options.propsData &&
  5876. vm.$options.propsData[key] === undefined &&
  5877. vm._props[key] !== undefined
  5878. ) {
  5879. return vm._props[key]
  5880. }
  5881. // call factory function for non-Function types
  5882. // a value is Function if its prototype is function even across different execution context
  5883. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5884. ? def.call(vm)
  5885. : def
  5886. }
  5887. /**
  5888. * Assert whether a prop is valid.
  5889. */
  5890. function assertProp (
  5891. prop,
  5892. name,
  5893. value,
  5894. vm,
  5895. absent
  5896. ) {
  5897. if (prop.required && absent) {
  5898. warn(
  5899. 'Missing required prop: "' + name + '"',
  5900. vm
  5901. );
  5902. return
  5903. }
  5904. if (value == null && !prop.required) {
  5905. return
  5906. }
  5907. var type = prop.type;
  5908. var valid = !type || type === true;
  5909. var expectedTypes = [];
  5910. if (type) {
  5911. if (!Array.isArray(type)) {
  5912. type = [type];
  5913. }
  5914. for (var i = 0; i < type.length && !valid; i++) {
  5915. var assertedType = assertType(value, type[i]);
  5916. expectedTypes.push(assertedType.expectedType || '');
  5917. valid = assertedType.valid;
  5918. }
  5919. }
  5920. if (!valid) {
  5921. warn(
  5922. getInvalidTypeMessage(name, value, expectedTypes),
  5923. vm
  5924. );
  5925. return
  5926. }
  5927. var validator = prop.validator;
  5928. if (validator) {
  5929. if (!validator(value)) {
  5930. warn(
  5931. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5932. vm
  5933. );
  5934. }
  5935. }
  5936. }
  5937. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5938. function assertType (value, type) {
  5939. var valid;
  5940. var expectedType = getType(type);
  5941. if (simpleCheckRE.test(expectedType)) {
  5942. var t = typeof value;
  5943. valid = t === expectedType.toLowerCase();
  5944. // for primitive wrapper objects
  5945. if (!valid && t === 'object') {
  5946. valid = value instanceof type;
  5947. }
  5948. } else if (expectedType === 'Object') {
  5949. valid = isPlainObject(value);
  5950. } else if (expectedType === 'Array') {
  5951. valid = Array.isArray(value);
  5952. } else {
  5953. valid = value instanceof type;
  5954. }
  5955. return {
  5956. valid: valid,
  5957. expectedType: expectedType
  5958. }
  5959. }
  5960. /**
  5961. * Use function string name to check built-in types,
  5962. * because a simple equality check will fail when running
  5963. * across different vms / iframes.
  5964. */
  5965. function getType (fn) {
  5966. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5967. return match ? match[1] : ''
  5968. }
  5969. function isSameType (a, b) {
  5970. return getType(a) === getType(b)
  5971. }
  5972. function getTypeIndex (type, expectedTypes) {
  5973. if (!Array.isArray(expectedTypes)) {
  5974. return isSameType(expectedTypes, type) ? 0 : -1
  5975. }
  5976. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5977. if (isSameType(expectedTypes[i], type)) {
  5978. return i
  5979. }
  5980. }
  5981. return -1
  5982. }
  5983. function getInvalidTypeMessage (name, value, expectedTypes) {
  5984. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5985. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5986. var expectedType = expectedTypes[0];
  5987. var receivedType = toRawType(value);
  5988. var expectedValue = styleValue(value, expectedType);
  5989. var receivedValue = styleValue(value, receivedType);
  5990. // check if we need to specify expected value
  5991. if (expectedTypes.length === 1 &&
  5992. isExplicable(expectedType) &&
  5993. !isBoolean(expectedType, receivedType)) {
  5994. message += " with value " + expectedValue;
  5995. }
  5996. message += ", got " + receivedType + " ";
  5997. // check if we need to specify received value
  5998. if (isExplicable(receivedType)) {
  5999. message += "with value " + receivedValue + ".";
  6000. }
  6001. return message
  6002. }
  6003. function styleValue (value, type) {
  6004. if (type === 'String') {
  6005. return ("\"" + value + "\"")
  6006. } else if (type === 'Number') {
  6007. return ("" + (Number(value)))
  6008. } else {
  6009. return ("" + value)
  6010. }
  6011. }
  6012. function isExplicable (value) {
  6013. var explicitTypes = ['string', 'number', 'boolean'];
  6014. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6015. }
  6016. function isBoolean () {
  6017. var args = [], len = arguments.length;
  6018. while ( len-- ) args[ len ] = arguments[ len ];
  6019. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6020. }
  6021. /* */
  6022. function handleError (err, vm, info) {
  6023. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6024. // See: https://github.com/vuejs/vuex/issues/1505
  6025. pushTarget();
  6026. try {
  6027. if (vm) {
  6028. var cur = vm;
  6029. while ((cur = cur.$parent)) {
  6030. var hooks = cur.$options.errorCaptured;
  6031. if (hooks) {
  6032. for (var i = 0; i < hooks.length; i++) {
  6033. try {
  6034. var capture = hooks[i].call(cur, err, vm, info) === false;
  6035. if (capture) { return }
  6036. } catch (e) {
  6037. globalHandleError(e, cur, 'errorCaptured hook');
  6038. }
  6039. }
  6040. }
  6041. }
  6042. }
  6043. globalHandleError(err, vm, info);
  6044. } finally {
  6045. popTarget();
  6046. }
  6047. }
  6048. function invokeWithErrorHandling (
  6049. handler,
  6050. context,
  6051. args,
  6052. vm,
  6053. info
  6054. ) {
  6055. var res;
  6056. try {
  6057. res = args ? handler.apply(context, args) : handler.call(context);
  6058. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6059. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6060. // issue #9511
  6061. // avoid catch triggering multiple times when nested calls
  6062. res._handled = true;
  6063. }
  6064. } catch (e) {
  6065. handleError(e, vm, info);
  6066. }
  6067. return res
  6068. }
  6069. function globalHandleError (err, vm, info) {
  6070. if (config.errorHandler) {
  6071. try {
  6072. return config.errorHandler.call(null, err, vm, info)
  6073. } catch (e) {
  6074. // if the user intentionally throws the original error in the handler,
  6075. // do not log it twice
  6076. if (e !== err) {
  6077. logError(e, null, 'config.errorHandler');
  6078. }
  6079. }
  6080. }
  6081. logError(err, vm, info);
  6082. }
  6083. function logError (err, vm, info) {
  6084. if (true) {
  6085. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6086. }
  6087. /* istanbul ignore else */
  6088. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6089. console.error(err);
  6090. } else {
  6091. throw err
  6092. }
  6093. }
  6094. /* */
  6095. var callbacks = [];
  6096. var pending = false;
  6097. function flushCallbacks () {
  6098. pending = false;
  6099. var copies = callbacks.slice(0);
  6100. callbacks.length = 0;
  6101. for (var i = 0; i < copies.length; i++) {
  6102. copies[i]();
  6103. }
  6104. }
  6105. // Here we have async deferring wrappers using microtasks.
  6106. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6107. // However, it has subtle problems when state is changed right before repaint
  6108. // (e.g. #6813, out-in transitions).
  6109. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6110. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6111. // So we now use microtasks everywhere, again.
  6112. // A major drawback of this tradeoff is that there are some scenarios
  6113. // where microtasks have too high a priority and fire in between supposedly
  6114. // sequential events (e.g. #4521, #6690, which have workarounds)
  6115. // or even between bubbling of the same event (#6566).
  6116. var timerFunc;
  6117. // The nextTick behavior leverages the microtask queue, which can be accessed
  6118. // via either native Promise.then or MutationObserver.
  6119. // MutationObserver has wider support, however it is seriously bugged in
  6120. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6121. // completely stops working after triggering a few times... so, if native
  6122. // Promise is available, we will use it:
  6123. /* istanbul ignore next, $flow-disable-line */
  6124. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6125. var p = Promise.resolve();
  6126. timerFunc = function () {
  6127. p.then(flushCallbacks);
  6128. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6129. // it can get stuck in a weird state where callbacks are pushed into the
  6130. // microtask queue but the queue isn't being flushed, until the browser
  6131. // needs to do some other work, e.g. handle a timer. Therefore we can
  6132. // "force" the microtask queue to be flushed by adding an empty timer.
  6133. if (isIOS) { setTimeout(noop); }
  6134. };
  6135. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6136. isNative(MutationObserver) ||
  6137. // PhantomJS and iOS 7.x
  6138. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6139. )) {
  6140. // Use MutationObserver where native Promise is not available,
  6141. // e.g. PhantomJS, iOS7, Android 4.4
  6142. // (#6466 MutationObserver is unreliable in IE11)
  6143. var counter = 1;
  6144. var observer = new MutationObserver(flushCallbacks);
  6145. var textNode = document.createTextNode(String(counter));
  6146. observer.observe(textNode, {
  6147. characterData: true
  6148. });
  6149. timerFunc = function () {
  6150. counter = (counter + 1) % 2;
  6151. textNode.data = String(counter);
  6152. };
  6153. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6154. // Fallback to setImmediate.
  6155. // Technically it leverages the (macro) task queue,
  6156. // but it is still a better choice than setTimeout.
  6157. timerFunc = function () {
  6158. setImmediate(flushCallbacks);
  6159. };
  6160. } else {
  6161. // Fallback to setTimeout.
  6162. timerFunc = function () {
  6163. setTimeout(flushCallbacks, 0);
  6164. };
  6165. }
  6166. function nextTick (cb, ctx) {
  6167. var _resolve;
  6168. callbacks.push(function () {
  6169. if (cb) {
  6170. try {
  6171. cb.call(ctx);
  6172. } catch (e) {
  6173. handleError(e, ctx, 'nextTick');
  6174. }
  6175. } else if (_resolve) {
  6176. _resolve(ctx);
  6177. }
  6178. });
  6179. if (!pending) {
  6180. pending = true;
  6181. timerFunc();
  6182. }
  6183. // $flow-disable-line
  6184. if (!cb && typeof Promise !== 'undefined') {
  6185. return new Promise(function (resolve) {
  6186. _resolve = resolve;
  6187. })
  6188. }
  6189. }
  6190. /* */
  6191. /* not type checking this file because flow doesn't play well with Proxy */
  6192. var initProxy;
  6193. if (true) {
  6194. var allowedGlobals = makeMap(
  6195. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6196. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6197. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  6198. 'require' // for Webpack/Browserify
  6199. );
  6200. var warnNonPresent = function (target, key) {
  6201. warn(
  6202. "Property or method \"" + key + "\" is not defined on the instance but " +
  6203. 'referenced during render. Make sure that this property is reactive, ' +
  6204. 'either in the data option, or for class-based components, by ' +
  6205. 'initializing the property. ' +
  6206. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  6207. target
  6208. );
  6209. };
  6210. var warnReservedPrefix = function (target, key) {
  6211. warn(
  6212. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  6213. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6214. 'prevent conflicts with Vue internals. ' +
  6215. 'See: https://vuejs.org/v2/api/#data',
  6216. target
  6217. );
  6218. };
  6219. var hasProxy =
  6220. typeof Proxy !== 'undefined' && isNative(Proxy);
  6221. if (hasProxy) {
  6222. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6223. config.keyCodes = new Proxy(config.keyCodes, {
  6224. set: function set (target, key, value) {
  6225. if (isBuiltInModifier(key)) {
  6226. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6227. return false
  6228. } else {
  6229. target[key] = value;
  6230. return true
  6231. }
  6232. }
  6233. });
  6234. }
  6235. var hasHandler = {
  6236. has: function has (target, key) {
  6237. var has = key in target;
  6238. var isAllowed = allowedGlobals(key) ||
  6239. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6240. if (!has && !isAllowed) {
  6241. if (key in target.$data) { warnReservedPrefix(target, key); }
  6242. else { warnNonPresent(target, key); }
  6243. }
  6244. return has || !isAllowed
  6245. }
  6246. };
  6247. var getHandler = {
  6248. get: function get (target, key) {
  6249. if (typeof key === 'string' && !(key in target)) {
  6250. if (key in target.$data) { warnReservedPrefix(target, key); }
  6251. else { warnNonPresent(target, key); }
  6252. }
  6253. return target[key]
  6254. }
  6255. };
  6256. initProxy = function initProxy (vm) {
  6257. if (hasProxy) {
  6258. // determine which proxy handler to use
  6259. var options = vm.$options;
  6260. var handlers = options.render && options.render._withStripped
  6261. ? getHandler
  6262. : hasHandler;
  6263. vm._renderProxy = new Proxy(vm, handlers);
  6264. } else {
  6265. vm._renderProxy = vm;
  6266. }
  6267. };
  6268. }
  6269. /* */
  6270. var seenObjects = new _Set();
  6271. /**
  6272. * Recursively traverse an object to evoke all converted
  6273. * getters, so that every nested property inside the object
  6274. * is collected as a "deep" dependency.
  6275. */
  6276. function traverse (val) {
  6277. _traverse(val, seenObjects);
  6278. seenObjects.clear();
  6279. }
  6280. function _traverse (val, seen) {
  6281. var i, keys;
  6282. var isA = Array.isArray(val);
  6283. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6284. return
  6285. }
  6286. if (val.__ob__) {
  6287. var depId = val.__ob__.dep.id;
  6288. if (seen.has(depId)) {
  6289. return
  6290. }
  6291. seen.add(depId);
  6292. }
  6293. if (isA) {
  6294. i = val.length;
  6295. while (i--) { _traverse(val[i], seen); }
  6296. } else {
  6297. keys = Object.keys(val);
  6298. i = keys.length;
  6299. while (i--) { _traverse(val[keys[i]], seen); }
  6300. }
  6301. }
  6302. var mark;
  6303. var measure;
  6304. if (true) {
  6305. var perf = inBrowser && window.performance;
  6306. /* istanbul ignore if */
  6307. if (
  6308. perf &&
  6309. perf.mark &&
  6310. perf.measure &&
  6311. perf.clearMarks &&
  6312. perf.clearMeasures
  6313. ) {
  6314. mark = function (tag) { return perf.mark(tag); };
  6315. measure = function (name, startTag, endTag) {
  6316. perf.measure(name, startTag, endTag);
  6317. perf.clearMarks(startTag);
  6318. perf.clearMarks(endTag);
  6319. // perf.clearMeasures(name)
  6320. };
  6321. }
  6322. }
  6323. /* */
  6324. var normalizeEvent = cached(function (name) {
  6325. var passive = name.charAt(0) === '&';
  6326. name = passive ? name.slice(1) : name;
  6327. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6328. name = once$$1 ? name.slice(1) : name;
  6329. var capture = name.charAt(0) === '!';
  6330. name = capture ? name.slice(1) : name;
  6331. return {
  6332. name: name,
  6333. once: once$$1,
  6334. capture: capture,
  6335. passive: passive
  6336. }
  6337. });
  6338. function createFnInvoker (fns, vm) {
  6339. function invoker () {
  6340. var arguments$1 = arguments;
  6341. var fns = invoker.fns;
  6342. if (Array.isArray(fns)) {
  6343. var cloned = fns.slice();
  6344. for (var i = 0; i < cloned.length; i++) {
  6345. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6346. }
  6347. } else {
  6348. // return handler return value for single handlers
  6349. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6350. }
  6351. }
  6352. invoker.fns = fns;
  6353. return invoker
  6354. }
  6355. function updateListeners (
  6356. on,
  6357. oldOn,
  6358. add,
  6359. remove$$1,
  6360. createOnceHandler,
  6361. vm
  6362. ) {
  6363. var name, def$$1, cur, old, event;
  6364. for (name in on) {
  6365. def$$1 = cur = on[name];
  6366. old = oldOn[name];
  6367. event = normalizeEvent(name);
  6368. if (isUndef(cur)) {
  6369. true && warn(
  6370. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6371. vm
  6372. );
  6373. } else if (isUndef(old)) {
  6374. if (isUndef(cur.fns)) {
  6375. cur = on[name] = createFnInvoker(cur, vm);
  6376. }
  6377. if (isTrue(event.once)) {
  6378. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6379. }
  6380. add(event.name, cur, event.capture, event.passive, event.params);
  6381. } else if (cur !== old) {
  6382. old.fns = cur;
  6383. on[name] = old;
  6384. }
  6385. }
  6386. for (name in oldOn) {
  6387. if (isUndef(on[name])) {
  6388. event = normalizeEvent(name);
  6389. remove$$1(event.name, oldOn[name], event.capture);
  6390. }
  6391. }
  6392. }
  6393. /* */
  6394. /* */
  6395. // fixed by xxxxxx (mp properties)
  6396. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6397. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6398. if (isUndef(propOptions)) {
  6399. return res
  6400. }
  6401. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6402. var attrs = data.attrs;
  6403. var props = data.props;
  6404. if (isDef(attrs) || isDef(props)) {
  6405. for (var key in propOptions) {
  6406. var altKey = hyphenate(key);
  6407. var result = checkProp(res, props, key, altKey, true) ||
  6408. checkProp(res, attrs, key, altKey, false);
  6409. // externalClass
  6410. if (
  6411. result &&
  6412. res[key] &&
  6413. externalClasses.indexOf(altKey) !== -1 &&
  6414. context[camelize(res[key])]
  6415. ) {
  6416. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6417. res[key] = context[camelize(res[key])];
  6418. }
  6419. }
  6420. }
  6421. return res
  6422. }
  6423. function extractPropsFromVNodeData (
  6424. data,
  6425. Ctor,
  6426. tag,
  6427. context// fixed by xxxxxx
  6428. ) {
  6429. // we are only extracting raw values here.
  6430. // validation and default values are handled in the child
  6431. // component itself.
  6432. var propOptions = Ctor.options.props;
  6433. if (isUndef(propOptions)) {
  6434. // fixed by xxxxxx
  6435. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6436. }
  6437. var res = {};
  6438. var attrs = data.attrs;
  6439. var props = data.props;
  6440. if (isDef(attrs) || isDef(props)) {
  6441. for (var key in propOptions) {
  6442. var altKey = hyphenate(key);
  6443. if (true) {
  6444. var keyInLowerCase = key.toLowerCase();
  6445. if (
  6446. key !== keyInLowerCase &&
  6447. attrs && hasOwn(attrs, keyInLowerCase)
  6448. ) {
  6449. tip(
  6450. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6451. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6452. " \"" + key + "\". " +
  6453. "Note that HTML attributes are case-insensitive and camelCased " +
  6454. "props need to use their kebab-case equivalents when using in-DOM " +
  6455. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6456. );
  6457. }
  6458. }
  6459. checkProp(res, props, key, altKey, true) ||
  6460. checkProp(res, attrs, key, altKey, false);
  6461. }
  6462. }
  6463. // fixed by xxxxxx
  6464. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6465. }
  6466. function checkProp (
  6467. res,
  6468. hash,
  6469. key,
  6470. altKey,
  6471. preserve
  6472. ) {
  6473. if (isDef(hash)) {
  6474. if (hasOwn(hash, key)) {
  6475. res[key] = hash[key];
  6476. if (!preserve) {
  6477. delete hash[key];
  6478. }
  6479. return true
  6480. } else if (hasOwn(hash, altKey)) {
  6481. res[key] = hash[altKey];
  6482. if (!preserve) {
  6483. delete hash[altKey];
  6484. }
  6485. return true
  6486. }
  6487. }
  6488. return false
  6489. }
  6490. /* */
  6491. // The template compiler attempts to minimize the need for normalization by
  6492. // statically analyzing the template at compile time.
  6493. //
  6494. // For plain HTML markup, normalization can be completely skipped because the
  6495. // generated render function is guaranteed to return Array<VNode>. There are
  6496. // two cases where extra normalization is needed:
  6497. // 1. When the children contains components - because a functional component
  6498. // may return an Array instead of a single root. In this case, just a simple
  6499. // normalization is needed - if any child is an Array, we flatten the whole
  6500. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6501. // because functional components already normalize their own children.
  6502. function simpleNormalizeChildren (children) {
  6503. for (var i = 0; i < children.length; i++) {
  6504. if (Array.isArray(children[i])) {
  6505. return Array.prototype.concat.apply([], children)
  6506. }
  6507. }
  6508. return children
  6509. }
  6510. // 2. When the children contains constructs that always generated nested Arrays,
  6511. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6512. // with hand-written render functions / JSX. In such cases a full normalization
  6513. // is needed to cater to all possible types of children values.
  6514. function normalizeChildren (children) {
  6515. return isPrimitive(children)
  6516. ? [createTextVNode(children)]
  6517. : Array.isArray(children)
  6518. ? normalizeArrayChildren(children)
  6519. : undefined
  6520. }
  6521. function isTextNode (node) {
  6522. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6523. }
  6524. function normalizeArrayChildren (children, nestedIndex) {
  6525. var res = [];
  6526. var i, c, lastIndex, last;
  6527. for (i = 0; i < children.length; i++) {
  6528. c = children[i];
  6529. if (isUndef(c) || typeof c === 'boolean') { continue }
  6530. lastIndex = res.length - 1;
  6531. last = res[lastIndex];
  6532. // nested
  6533. if (Array.isArray(c)) {
  6534. if (c.length > 0) {
  6535. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6536. // merge adjacent text nodes
  6537. if (isTextNode(c[0]) && isTextNode(last)) {
  6538. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6539. c.shift();
  6540. }
  6541. res.push.apply(res, c);
  6542. }
  6543. } else if (isPrimitive(c)) {
  6544. if (isTextNode(last)) {
  6545. // merge adjacent text nodes
  6546. // this is necessary for SSR hydration because text nodes are
  6547. // essentially merged when rendered to HTML strings
  6548. res[lastIndex] = createTextVNode(last.text + c);
  6549. } else if (c !== '') {
  6550. // convert primitive to vnode
  6551. res.push(createTextVNode(c));
  6552. }
  6553. } else {
  6554. if (isTextNode(c) && isTextNode(last)) {
  6555. // merge adjacent text nodes
  6556. res[lastIndex] = createTextVNode(last.text + c.text);
  6557. } else {
  6558. // default key for nested array children (likely generated by v-for)
  6559. if (isTrue(children._isVList) &&
  6560. isDef(c.tag) &&
  6561. isUndef(c.key) &&
  6562. isDef(nestedIndex)) {
  6563. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6564. }
  6565. res.push(c);
  6566. }
  6567. }
  6568. }
  6569. return res
  6570. }
  6571. /* */
  6572. function initProvide (vm) {
  6573. var provide = vm.$options.provide;
  6574. if (provide) {
  6575. vm._provided = typeof provide === 'function'
  6576. ? provide.call(vm)
  6577. : provide;
  6578. }
  6579. }
  6580. function initInjections (vm) {
  6581. var result = resolveInject(vm.$options.inject, vm);
  6582. if (result) {
  6583. toggleObserving(false);
  6584. Object.keys(result).forEach(function (key) {
  6585. /* istanbul ignore else */
  6586. if (true) {
  6587. defineReactive$$1(vm, key, result[key], function () {
  6588. warn(
  6589. "Avoid mutating an injected value directly since the changes will be " +
  6590. "overwritten whenever the provided component re-renders. " +
  6591. "injection being mutated: \"" + key + "\"",
  6592. vm
  6593. );
  6594. });
  6595. } else {}
  6596. });
  6597. toggleObserving(true);
  6598. }
  6599. }
  6600. function resolveInject (inject, vm) {
  6601. if (inject) {
  6602. // inject is :any because flow is not smart enough to figure out cached
  6603. var result = Object.create(null);
  6604. var keys = hasSymbol
  6605. ? Reflect.ownKeys(inject)
  6606. : Object.keys(inject);
  6607. for (var i = 0; i < keys.length; i++) {
  6608. var key = keys[i];
  6609. // #6574 in case the inject object is observed...
  6610. if (key === '__ob__') { continue }
  6611. var provideKey = inject[key].from;
  6612. var source = vm;
  6613. while (source) {
  6614. if (source._provided && hasOwn(source._provided, provideKey)) {
  6615. result[key] = source._provided[provideKey];
  6616. break
  6617. }
  6618. source = source.$parent;
  6619. }
  6620. if (!source) {
  6621. if ('default' in inject[key]) {
  6622. var provideDefault = inject[key].default;
  6623. result[key] = typeof provideDefault === 'function'
  6624. ? provideDefault.call(vm)
  6625. : provideDefault;
  6626. } else if (true) {
  6627. warn(("Injection \"" + key + "\" not found"), vm);
  6628. }
  6629. }
  6630. }
  6631. return result
  6632. }
  6633. }
  6634. /* */
  6635. /**
  6636. * Runtime helper for resolving raw children VNodes into a slot object.
  6637. */
  6638. function resolveSlots (
  6639. children,
  6640. context
  6641. ) {
  6642. if (!children || !children.length) {
  6643. return {}
  6644. }
  6645. var slots = {};
  6646. for (var i = 0, l = children.length; i < l; i++) {
  6647. var child = children[i];
  6648. var data = child.data;
  6649. // remove slot attribute if the node is resolved as a Vue slot node
  6650. if (data && data.attrs && data.attrs.slot) {
  6651. delete data.attrs.slot;
  6652. }
  6653. // named slots should only be respected if the vnode was rendered in the
  6654. // same context.
  6655. if ((child.context === context || child.fnContext === context) &&
  6656. data && data.slot != null
  6657. ) {
  6658. var name = data.slot;
  6659. var slot = (slots[name] || (slots[name] = []));
  6660. if (child.tag === 'template') {
  6661. slot.push.apply(slot, child.children || []);
  6662. } else {
  6663. slot.push(child);
  6664. }
  6665. } else {
  6666. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6667. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6668. (slots['page'] || (slots['page'] = [])).push(child);
  6669. }else{
  6670. (slots.default || (slots.default = [])).push(child);
  6671. }
  6672. }
  6673. }
  6674. // ignore slots that contains only whitespace
  6675. for (var name$1 in slots) {
  6676. if (slots[name$1].every(isWhitespace)) {
  6677. delete slots[name$1];
  6678. }
  6679. }
  6680. return slots
  6681. }
  6682. function isWhitespace (node) {
  6683. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6684. }
  6685. /* */
  6686. function normalizeScopedSlots (
  6687. slots,
  6688. normalSlots,
  6689. prevSlots
  6690. ) {
  6691. var res;
  6692. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6693. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6694. var key = slots && slots.$key;
  6695. if (!slots) {
  6696. res = {};
  6697. } else if (slots._normalized) {
  6698. // fast path 1: child component re-render only, parent did not change
  6699. return slots._normalized
  6700. } else if (
  6701. isStable &&
  6702. prevSlots &&
  6703. prevSlots !== emptyObject &&
  6704. key === prevSlots.$key &&
  6705. !hasNormalSlots &&
  6706. !prevSlots.$hasNormal
  6707. ) {
  6708. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6709. // only need to normalize once
  6710. return prevSlots
  6711. } else {
  6712. res = {};
  6713. for (var key$1 in slots) {
  6714. if (slots[key$1] && key$1[0] !== '$') {
  6715. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6716. }
  6717. }
  6718. }
  6719. // expose normal slots on scopedSlots
  6720. for (var key$2 in normalSlots) {
  6721. if (!(key$2 in res)) {
  6722. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6723. }
  6724. }
  6725. // avoriaz seems to mock a non-extensible $scopedSlots object
  6726. // and when that is passed down this would cause an error
  6727. if (slots && Object.isExtensible(slots)) {
  6728. (slots)._normalized = res;
  6729. }
  6730. def(res, '$stable', isStable);
  6731. def(res, '$key', key);
  6732. def(res, '$hasNormal', hasNormalSlots);
  6733. return res
  6734. }
  6735. function normalizeScopedSlot(normalSlots, key, fn) {
  6736. var normalized = function () {
  6737. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6738. res = res && typeof res === 'object' && !Array.isArray(res)
  6739. ? [res] // single vnode
  6740. : normalizeChildren(res);
  6741. return res && (
  6742. res.length === 0 ||
  6743. (res.length === 1 && res[0].isComment) // #9658
  6744. ) ? undefined
  6745. : res
  6746. };
  6747. // this is a slot using the new v-slot syntax without scope. although it is
  6748. // compiled as a scoped slot, render fn users would expect it to be present
  6749. // on this.$slots because the usage is semantically a normal slot.
  6750. if (fn.proxy) {
  6751. Object.defineProperty(normalSlots, key, {
  6752. get: normalized,
  6753. enumerable: true,
  6754. configurable: true
  6755. });
  6756. }
  6757. return normalized
  6758. }
  6759. function proxyNormalSlot(slots, key) {
  6760. return function () { return slots[key]; }
  6761. }
  6762. /* */
  6763. /**
  6764. * Runtime helper for rendering v-for lists.
  6765. */
  6766. function renderList (
  6767. val,
  6768. render
  6769. ) {
  6770. var ret, i, l, keys, key;
  6771. if (Array.isArray(val) || typeof val === 'string') {
  6772. ret = new Array(val.length);
  6773. for (i = 0, l = val.length; i < l; i++) {
  6774. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6775. }
  6776. } else if (typeof val === 'number') {
  6777. ret = new Array(val);
  6778. for (i = 0; i < val; i++) {
  6779. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6780. }
  6781. } else if (isObject(val)) {
  6782. if (hasSymbol && val[Symbol.iterator]) {
  6783. ret = [];
  6784. var iterator = val[Symbol.iterator]();
  6785. var result = iterator.next();
  6786. while (!result.done) {
  6787. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6788. result = iterator.next();
  6789. }
  6790. } else {
  6791. keys = Object.keys(val);
  6792. ret = new Array(keys.length);
  6793. for (i = 0, l = keys.length; i < l; i++) {
  6794. key = keys[i];
  6795. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6796. }
  6797. }
  6798. }
  6799. if (!isDef(ret)) {
  6800. ret = [];
  6801. }
  6802. (ret)._isVList = true;
  6803. return ret
  6804. }
  6805. /* */
  6806. /**
  6807. * Runtime helper for rendering <slot>
  6808. */
  6809. function renderSlot (
  6810. name,
  6811. fallback,
  6812. props,
  6813. bindObject
  6814. ) {
  6815. var scopedSlotFn = this.$scopedSlots[name];
  6816. var nodes;
  6817. if (scopedSlotFn) { // scoped slot
  6818. props = props || {};
  6819. if (bindObject) {
  6820. if ( true && !isObject(bindObject)) {
  6821. warn(
  6822. 'slot v-bind without argument expects an Object',
  6823. this
  6824. );
  6825. }
  6826. props = extend(extend({}, bindObject), props);
  6827. }
  6828. // fixed by xxxxxx app-plus scopedSlot
  6829. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6830. } else {
  6831. nodes = this.$slots[name] || fallback;
  6832. }
  6833. var target = props && props.slot;
  6834. if (target) {
  6835. return this.$createElement('template', { slot: target }, nodes)
  6836. } else {
  6837. return nodes
  6838. }
  6839. }
  6840. /* */
  6841. /**
  6842. * Runtime helper for resolving filters
  6843. */
  6844. function resolveFilter (id) {
  6845. return resolveAsset(this.$options, 'filters', id, true) || identity
  6846. }
  6847. /* */
  6848. function isKeyNotMatch (expect, actual) {
  6849. if (Array.isArray(expect)) {
  6850. return expect.indexOf(actual) === -1
  6851. } else {
  6852. return expect !== actual
  6853. }
  6854. }
  6855. /**
  6856. * Runtime helper for checking keyCodes from config.
  6857. * exposed as Vue.prototype._k
  6858. * passing in eventKeyName as last argument separately for backwards compat
  6859. */
  6860. function checkKeyCodes (
  6861. eventKeyCode,
  6862. key,
  6863. builtInKeyCode,
  6864. eventKeyName,
  6865. builtInKeyName
  6866. ) {
  6867. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6868. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6869. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6870. } else if (mappedKeyCode) {
  6871. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6872. } else if (eventKeyName) {
  6873. return hyphenate(eventKeyName) !== key
  6874. }
  6875. }
  6876. /* */
  6877. /**
  6878. * Runtime helper for merging v-bind="object" into a VNode's data.
  6879. */
  6880. function bindObjectProps (
  6881. data,
  6882. tag,
  6883. value,
  6884. asProp,
  6885. isSync
  6886. ) {
  6887. if (value) {
  6888. if (!isObject(value)) {
  6889. true && warn(
  6890. 'v-bind without argument expects an Object or Array value',
  6891. this
  6892. );
  6893. } else {
  6894. if (Array.isArray(value)) {
  6895. value = toObject(value);
  6896. }
  6897. var hash;
  6898. var loop = function ( key ) {
  6899. if (
  6900. key === 'class' ||
  6901. key === 'style' ||
  6902. isReservedAttribute(key)
  6903. ) {
  6904. hash = data;
  6905. } else {
  6906. var type = data.attrs && data.attrs.type;
  6907. hash = asProp || config.mustUseProp(tag, type, key)
  6908. ? data.domProps || (data.domProps = {})
  6909. : data.attrs || (data.attrs = {});
  6910. }
  6911. var camelizedKey = camelize(key);
  6912. var hyphenatedKey = hyphenate(key);
  6913. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6914. hash[key] = value[key];
  6915. if (isSync) {
  6916. var on = data.on || (data.on = {});
  6917. on[("update:" + key)] = function ($event) {
  6918. value[key] = $event;
  6919. };
  6920. }
  6921. }
  6922. };
  6923. for (var key in value) loop( key );
  6924. }
  6925. }
  6926. return data
  6927. }
  6928. /* */
  6929. /**
  6930. * Runtime helper for rendering static trees.
  6931. */
  6932. function renderStatic (
  6933. index,
  6934. isInFor
  6935. ) {
  6936. var cached = this._staticTrees || (this._staticTrees = []);
  6937. var tree = cached[index];
  6938. // if has already-rendered static tree and not inside v-for,
  6939. // we can reuse the same tree.
  6940. if (tree && !isInFor) {
  6941. return tree
  6942. }
  6943. // otherwise, render a fresh tree.
  6944. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6945. this._renderProxy,
  6946. null,
  6947. this // for render fns generated for functional component templates
  6948. );
  6949. markStatic(tree, ("__static__" + index), false);
  6950. return tree
  6951. }
  6952. /**
  6953. * Runtime helper for v-once.
  6954. * Effectively it means marking the node as static with a unique key.
  6955. */
  6956. function markOnce (
  6957. tree,
  6958. index,
  6959. key
  6960. ) {
  6961. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6962. return tree
  6963. }
  6964. function markStatic (
  6965. tree,
  6966. key,
  6967. isOnce
  6968. ) {
  6969. if (Array.isArray(tree)) {
  6970. for (var i = 0; i < tree.length; i++) {
  6971. if (tree[i] && typeof tree[i] !== 'string') {
  6972. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6973. }
  6974. }
  6975. } else {
  6976. markStaticNode(tree, key, isOnce);
  6977. }
  6978. }
  6979. function markStaticNode (node, key, isOnce) {
  6980. node.isStatic = true;
  6981. node.key = key;
  6982. node.isOnce = isOnce;
  6983. }
  6984. /* */
  6985. function bindObjectListeners (data, value) {
  6986. if (value) {
  6987. if (!isPlainObject(value)) {
  6988. true && warn(
  6989. 'v-on without argument expects an Object value',
  6990. this
  6991. );
  6992. } else {
  6993. var on = data.on = data.on ? extend({}, data.on) : {};
  6994. for (var key in value) {
  6995. var existing = on[key];
  6996. var ours = value[key];
  6997. on[key] = existing ? [].concat(existing, ours) : ours;
  6998. }
  6999. }
  7000. }
  7001. return data
  7002. }
  7003. /* */
  7004. function resolveScopedSlots (
  7005. fns, // see flow/vnode
  7006. res,
  7007. // the following are added in 2.6
  7008. hasDynamicKeys,
  7009. contentHashKey
  7010. ) {
  7011. res = res || { $stable: !hasDynamicKeys };
  7012. for (var i = 0; i < fns.length; i++) {
  7013. var slot = fns[i];
  7014. if (Array.isArray(slot)) {
  7015. resolveScopedSlots(slot, res, hasDynamicKeys);
  7016. } else if (slot) {
  7017. // marker for reverse proxying v-slot without scope on this.$slots
  7018. if (slot.proxy) {
  7019. slot.fn.proxy = true;
  7020. }
  7021. res[slot.key] = slot.fn;
  7022. }
  7023. }
  7024. if (contentHashKey) {
  7025. (res).$key = contentHashKey;
  7026. }
  7027. return res
  7028. }
  7029. /* */
  7030. function bindDynamicKeys (baseObj, values) {
  7031. for (var i = 0; i < values.length; i += 2) {
  7032. var key = values[i];
  7033. if (typeof key === 'string' && key) {
  7034. baseObj[values[i]] = values[i + 1];
  7035. } else if ( true && key !== '' && key !== null) {
  7036. // null is a special value for explicitly removing a binding
  7037. warn(
  7038. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7039. this
  7040. );
  7041. }
  7042. }
  7043. return baseObj
  7044. }
  7045. // helper to dynamically append modifier runtime markers to event names.
  7046. // ensure only append when value is already string, otherwise it will be cast
  7047. // to string and cause the type check to miss.
  7048. function prependModifier (value, symbol) {
  7049. return typeof value === 'string' ? symbol + value : value
  7050. }
  7051. /* */
  7052. function installRenderHelpers (target) {
  7053. target._o = markOnce;
  7054. target._n = toNumber;
  7055. target._s = toString;
  7056. target._l = renderList;
  7057. target._t = renderSlot;
  7058. target._q = looseEqual;
  7059. target._i = looseIndexOf;
  7060. target._m = renderStatic;
  7061. target._f = resolveFilter;
  7062. target._k = checkKeyCodes;
  7063. target._b = bindObjectProps;
  7064. target._v = createTextVNode;
  7065. target._e = createEmptyVNode;
  7066. target._u = resolveScopedSlots;
  7067. target._g = bindObjectListeners;
  7068. target._d = bindDynamicKeys;
  7069. target._p = prependModifier;
  7070. }
  7071. /* */
  7072. function FunctionalRenderContext (
  7073. data,
  7074. props,
  7075. children,
  7076. parent,
  7077. Ctor
  7078. ) {
  7079. var this$1 = this;
  7080. var options = Ctor.options;
  7081. // ensure the createElement function in functional components
  7082. // gets a unique context - this is necessary for correct named slot check
  7083. var contextVm;
  7084. if (hasOwn(parent, '_uid')) {
  7085. contextVm = Object.create(parent);
  7086. // $flow-disable-line
  7087. contextVm._original = parent;
  7088. } else {
  7089. // the context vm passed in is a functional context as well.
  7090. // in this case we want to make sure we are able to get a hold to the
  7091. // real context instance.
  7092. contextVm = parent;
  7093. // $flow-disable-line
  7094. parent = parent._original;
  7095. }
  7096. var isCompiled = isTrue(options._compiled);
  7097. var needNormalization = !isCompiled;
  7098. this.data = data;
  7099. this.props = props;
  7100. this.children = children;
  7101. this.parent = parent;
  7102. this.listeners = data.on || emptyObject;
  7103. this.injections = resolveInject(options.inject, parent);
  7104. this.slots = function () {
  7105. if (!this$1.$slots) {
  7106. normalizeScopedSlots(
  7107. data.scopedSlots,
  7108. this$1.$slots = resolveSlots(children, parent)
  7109. );
  7110. }
  7111. return this$1.$slots
  7112. };
  7113. Object.defineProperty(this, 'scopedSlots', ({
  7114. enumerable: true,
  7115. get: function get () {
  7116. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7117. }
  7118. }));
  7119. // support for compiled functional template
  7120. if (isCompiled) {
  7121. // exposing $options for renderStatic()
  7122. this.$options = options;
  7123. // pre-resolve slots for renderSlot()
  7124. this.$slots = this.slots();
  7125. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7126. }
  7127. if (options._scopeId) {
  7128. this._c = function (a, b, c, d) {
  7129. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7130. if (vnode && !Array.isArray(vnode)) {
  7131. vnode.fnScopeId = options._scopeId;
  7132. vnode.fnContext = parent;
  7133. }
  7134. return vnode
  7135. };
  7136. } else {
  7137. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7138. }
  7139. }
  7140. installRenderHelpers(FunctionalRenderContext.prototype);
  7141. function createFunctionalComponent (
  7142. Ctor,
  7143. propsData,
  7144. data,
  7145. contextVm,
  7146. children
  7147. ) {
  7148. var options = Ctor.options;
  7149. var props = {};
  7150. var propOptions = options.props;
  7151. if (isDef(propOptions)) {
  7152. for (var key in propOptions) {
  7153. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7154. }
  7155. } else {
  7156. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7157. if (isDef(data.props)) { mergeProps(props, data.props); }
  7158. }
  7159. var renderContext = new FunctionalRenderContext(
  7160. data,
  7161. props,
  7162. children,
  7163. contextVm,
  7164. Ctor
  7165. );
  7166. var vnode = options.render.call(null, renderContext._c, renderContext);
  7167. if (vnode instanceof VNode) {
  7168. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7169. } else if (Array.isArray(vnode)) {
  7170. var vnodes = normalizeChildren(vnode) || [];
  7171. var res = new Array(vnodes.length);
  7172. for (var i = 0; i < vnodes.length; i++) {
  7173. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7174. }
  7175. return res
  7176. }
  7177. }
  7178. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7179. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7180. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7181. // that should not be matched to match.
  7182. var clone = cloneVNode(vnode);
  7183. clone.fnContext = contextVm;
  7184. clone.fnOptions = options;
  7185. if (true) {
  7186. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7187. }
  7188. if (data.slot) {
  7189. (clone.data || (clone.data = {})).slot = data.slot;
  7190. }
  7191. return clone
  7192. }
  7193. function mergeProps (to, from) {
  7194. for (var key in from) {
  7195. to[camelize(key)] = from[key];
  7196. }
  7197. }
  7198. /* */
  7199. /* */
  7200. /* */
  7201. /* */
  7202. // inline hooks to be invoked on component VNodes during patch
  7203. var componentVNodeHooks = {
  7204. init: function init (vnode, hydrating) {
  7205. if (
  7206. vnode.componentInstance &&
  7207. !vnode.componentInstance._isDestroyed &&
  7208. vnode.data.keepAlive
  7209. ) {
  7210. // kept-alive components, treat as a patch
  7211. var mountedNode = vnode; // work around flow
  7212. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7213. } else {
  7214. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7215. vnode,
  7216. activeInstance
  7217. );
  7218. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7219. }
  7220. },
  7221. prepatch: function prepatch (oldVnode, vnode) {
  7222. var options = vnode.componentOptions;
  7223. var child = vnode.componentInstance = oldVnode.componentInstance;
  7224. updateChildComponent(
  7225. child,
  7226. options.propsData, // updated props
  7227. options.listeners, // updated listeners
  7228. vnode, // new parent vnode
  7229. options.children // new children
  7230. );
  7231. },
  7232. insert: function insert (vnode) {
  7233. var context = vnode.context;
  7234. var componentInstance = vnode.componentInstance;
  7235. if (!componentInstance._isMounted) {
  7236. callHook(componentInstance, 'onServiceCreated');
  7237. callHook(componentInstance, 'onServiceAttached');
  7238. componentInstance._isMounted = true;
  7239. callHook(componentInstance, 'mounted');
  7240. }
  7241. if (vnode.data.keepAlive) {
  7242. if (context._isMounted) {
  7243. // vue-router#1212
  7244. // During updates, a kept-alive component's child components may
  7245. // change, so directly walking the tree here may call activated hooks
  7246. // on incorrect children. Instead we push them into a queue which will
  7247. // be processed after the whole patch process ended.
  7248. queueActivatedComponent(componentInstance);
  7249. } else {
  7250. activateChildComponent(componentInstance, true /* direct */);
  7251. }
  7252. }
  7253. },
  7254. destroy: function destroy (vnode) {
  7255. var componentInstance = vnode.componentInstance;
  7256. if (!componentInstance._isDestroyed) {
  7257. if (!vnode.data.keepAlive) {
  7258. componentInstance.$destroy();
  7259. } else {
  7260. deactivateChildComponent(componentInstance, true /* direct */);
  7261. }
  7262. }
  7263. }
  7264. };
  7265. var hooksToMerge = Object.keys(componentVNodeHooks);
  7266. function createComponent (
  7267. Ctor,
  7268. data,
  7269. context,
  7270. children,
  7271. tag
  7272. ) {
  7273. if (isUndef(Ctor)) {
  7274. return
  7275. }
  7276. var baseCtor = context.$options._base;
  7277. // plain options object: turn it into a constructor
  7278. if (isObject(Ctor)) {
  7279. Ctor = baseCtor.extend(Ctor);
  7280. }
  7281. // if at this stage it's not a constructor or an async component factory,
  7282. // reject.
  7283. if (typeof Ctor !== 'function') {
  7284. if (true) {
  7285. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7286. }
  7287. return
  7288. }
  7289. // async component
  7290. var asyncFactory;
  7291. if (isUndef(Ctor.cid)) {
  7292. asyncFactory = Ctor;
  7293. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7294. if (Ctor === undefined) {
  7295. // return a placeholder node for async component, which is rendered
  7296. // as a comment node but preserves all the raw information for the node.
  7297. // the information will be used for async server-rendering and hydration.
  7298. return createAsyncPlaceholder(
  7299. asyncFactory,
  7300. data,
  7301. context,
  7302. children,
  7303. tag
  7304. )
  7305. }
  7306. }
  7307. data = data || {};
  7308. // resolve constructor options in case global mixins are applied after
  7309. // component constructor creation
  7310. resolveConstructorOptions(Ctor);
  7311. // transform component v-model data into props & events
  7312. if (isDef(data.model)) {
  7313. transformModel(Ctor.options, data);
  7314. }
  7315. // extract props
  7316. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7317. // functional component
  7318. if (isTrue(Ctor.options.functional)) {
  7319. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7320. }
  7321. // extract listeners, since these needs to be treated as
  7322. // child component listeners instead of DOM listeners
  7323. var listeners = data.on;
  7324. // replace with listeners with .native modifier
  7325. // so it gets processed during parent component patch.
  7326. data.on = data.nativeOn;
  7327. if (isTrue(Ctor.options.abstract)) {
  7328. // abstract components do not keep anything
  7329. // other than props & listeners & slot
  7330. // work around flow
  7331. var slot = data.slot;
  7332. data = {};
  7333. if (slot) {
  7334. data.slot = slot;
  7335. }
  7336. }
  7337. // install component management hooks onto the placeholder node
  7338. installComponentHooks(data);
  7339. // return a placeholder vnode
  7340. var name = Ctor.options.name || tag;
  7341. var vnode = new VNode(
  7342. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7343. data, undefined, undefined, undefined, context,
  7344. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7345. asyncFactory
  7346. );
  7347. return vnode
  7348. }
  7349. function createComponentInstanceForVnode (
  7350. vnode, // we know it's MountedComponentVNode but flow doesn't
  7351. parent // activeInstance in lifecycle state
  7352. ) {
  7353. var options = {
  7354. _isComponent: true,
  7355. _parentVnode: vnode,
  7356. parent: parent
  7357. };
  7358. // check inline-template render functions
  7359. var inlineTemplate = vnode.data.inlineTemplate;
  7360. if (isDef(inlineTemplate)) {
  7361. options.render = inlineTemplate.render;
  7362. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7363. }
  7364. return new vnode.componentOptions.Ctor(options)
  7365. }
  7366. function installComponentHooks (data) {
  7367. var hooks = data.hook || (data.hook = {});
  7368. for (var i = 0; i < hooksToMerge.length; i++) {
  7369. var key = hooksToMerge[i];
  7370. var existing = hooks[key];
  7371. var toMerge = componentVNodeHooks[key];
  7372. if (existing !== toMerge && !(existing && existing._merged)) {
  7373. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7374. }
  7375. }
  7376. }
  7377. function mergeHook$1 (f1, f2) {
  7378. var merged = function (a, b) {
  7379. // flow complains about extra args which is why we use any
  7380. f1(a, b);
  7381. f2(a, b);
  7382. };
  7383. merged._merged = true;
  7384. return merged
  7385. }
  7386. // transform component v-model info (value and callback) into
  7387. // prop and event handler respectively.
  7388. function transformModel (options, data) {
  7389. var prop = (options.model && options.model.prop) || 'value';
  7390. var event = (options.model && options.model.event) || 'input'
  7391. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7392. var on = data.on || (data.on = {});
  7393. var existing = on[event];
  7394. var callback = data.model.callback;
  7395. if (isDef(existing)) {
  7396. if (
  7397. Array.isArray(existing)
  7398. ? existing.indexOf(callback) === -1
  7399. : existing !== callback
  7400. ) {
  7401. on[event] = [callback].concat(existing);
  7402. }
  7403. } else {
  7404. on[event] = callback;
  7405. }
  7406. }
  7407. /* */
  7408. var SIMPLE_NORMALIZE = 1;
  7409. var ALWAYS_NORMALIZE = 2;
  7410. // wrapper function for providing a more flexible interface
  7411. // without getting yelled at by flow
  7412. function createElement (
  7413. context,
  7414. tag,
  7415. data,
  7416. children,
  7417. normalizationType,
  7418. alwaysNormalize
  7419. ) {
  7420. if (Array.isArray(data) || isPrimitive(data)) {
  7421. normalizationType = children;
  7422. children = data;
  7423. data = undefined;
  7424. }
  7425. if (isTrue(alwaysNormalize)) {
  7426. normalizationType = ALWAYS_NORMALIZE;
  7427. }
  7428. return _createElement(context, tag, data, children, normalizationType)
  7429. }
  7430. function _createElement (
  7431. context,
  7432. tag,
  7433. data,
  7434. children,
  7435. normalizationType
  7436. ) {
  7437. if (isDef(data) && isDef((data).__ob__)) {
  7438. true && warn(
  7439. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7440. 'Always create fresh vnode data objects in each render!',
  7441. context
  7442. );
  7443. return createEmptyVNode()
  7444. }
  7445. // object syntax in v-bind
  7446. if (isDef(data) && isDef(data.is)) {
  7447. tag = data.is;
  7448. }
  7449. if (!tag) {
  7450. // in case of component :is set to falsy value
  7451. return createEmptyVNode()
  7452. }
  7453. // warn against non-primitive key
  7454. if ( true &&
  7455. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7456. ) {
  7457. {
  7458. warn(
  7459. 'Avoid using non-primitive value as key, ' +
  7460. 'use string/number value instead.',
  7461. context
  7462. );
  7463. }
  7464. }
  7465. // support single function children as default scoped slot
  7466. if (Array.isArray(children) &&
  7467. typeof children[0] === 'function'
  7468. ) {
  7469. data = data || {};
  7470. data.scopedSlots = { default: children[0] };
  7471. children.length = 0;
  7472. }
  7473. if (normalizationType === ALWAYS_NORMALIZE) {
  7474. children = normalizeChildren(children);
  7475. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7476. children = simpleNormalizeChildren(children);
  7477. }
  7478. var vnode, ns;
  7479. if (typeof tag === 'string') {
  7480. var Ctor;
  7481. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7482. if (config.isReservedTag(tag)) {
  7483. // platform built-in elements
  7484. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7485. warn(
  7486. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7487. context
  7488. );
  7489. }
  7490. vnode = new VNode(
  7491. config.parsePlatformTagName(tag), data, children,
  7492. undefined, undefined, context
  7493. );
  7494. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7495. // component
  7496. vnode = createComponent(Ctor, data, context, children, tag);
  7497. } else {
  7498. // unknown or unlisted namespaced elements
  7499. // check at runtime because it may get assigned a namespace when its
  7500. // parent normalizes children
  7501. vnode = new VNode(
  7502. tag, data, children,
  7503. undefined, undefined, context
  7504. );
  7505. }
  7506. } else {
  7507. // direct component options / constructor
  7508. vnode = createComponent(tag, data, context, children);
  7509. }
  7510. if (Array.isArray(vnode)) {
  7511. return vnode
  7512. } else if (isDef(vnode)) {
  7513. if (isDef(ns)) { applyNS(vnode, ns); }
  7514. if (isDef(data)) { registerDeepBindings(data); }
  7515. return vnode
  7516. } else {
  7517. return createEmptyVNode()
  7518. }
  7519. }
  7520. function applyNS (vnode, ns, force) {
  7521. vnode.ns = ns;
  7522. if (vnode.tag === 'foreignObject') {
  7523. // use default namespace inside foreignObject
  7524. ns = undefined;
  7525. force = true;
  7526. }
  7527. if (isDef(vnode.children)) {
  7528. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7529. var child = vnode.children[i];
  7530. if (isDef(child.tag) && (
  7531. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7532. applyNS(child, ns, force);
  7533. }
  7534. }
  7535. }
  7536. }
  7537. // ref #5318
  7538. // necessary to ensure parent re-render when deep bindings like :style and
  7539. // :class are used on slot nodes
  7540. function registerDeepBindings (data) {
  7541. if (isObject(data.style)) {
  7542. traverse(data.style);
  7543. }
  7544. if (isObject(data.class)) {
  7545. traverse(data.class);
  7546. }
  7547. }
  7548. /* */
  7549. function initRender (vm) {
  7550. vm._vnode = null; // the root of the child tree
  7551. vm._staticTrees = null; // v-once cached trees
  7552. var options = vm.$options;
  7553. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7554. var renderContext = parentVnode && parentVnode.context;
  7555. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7556. vm.$scopedSlots = emptyObject;
  7557. // bind the createElement fn to this instance
  7558. // so that we get proper render context inside it.
  7559. // args order: tag, data, children, normalizationType, alwaysNormalize
  7560. // internal version is used by render functions compiled from templates
  7561. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7562. // normalization is always applied for the public version, used in
  7563. // user-written render functions.
  7564. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7565. // $attrs & $listeners are exposed for easier HOC creation.
  7566. // they need to be reactive so that HOCs using them are always updated
  7567. var parentData = parentVnode && parentVnode.data;
  7568. /* istanbul ignore else */
  7569. if (true) {
  7570. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7571. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7572. }, true);
  7573. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7574. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7575. }, true);
  7576. } else {}
  7577. }
  7578. var currentRenderingInstance = null;
  7579. function renderMixin (Vue) {
  7580. // install runtime convenience helpers
  7581. installRenderHelpers(Vue.prototype);
  7582. Vue.prototype.$nextTick = function (fn) {
  7583. return nextTick(fn, this)
  7584. };
  7585. Vue.prototype._render = function () {
  7586. var vm = this;
  7587. var ref = vm.$options;
  7588. var render = ref.render;
  7589. var _parentVnode = ref._parentVnode;
  7590. if (_parentVnode) {
  7591. vm.$scopedSlots = normalizeScopedSlots(
  7592. _parentVnode.data.scopedSlots,
  7593. vm.$slots,
  7594. vm.$scopedSlots
  7595. );
  7596. }
  7597. // set parent vnode. this allows render functions to have access
  7598. // to the data on the placeholder node.
  7599. vm.$vnode = _parentVnode;
  7600. // render self
  7601. var vnode;
  7602. try {
  7603. // There's no need to maintain a stack because all render fns are called
  7604. // separately from one another. Nested component's render fns are called
  7605. // when parent component is patched.
  7606. currentRenderingInstance = vm;
  7607. vnode = render.call(vm._renderProxy, vm.$createElement);
  7608. } catch (e) {
  7609. handleError(e, vm, "render");
  7610. // return error render result,
  7611. // or previous vnode to prevent render error causing blank component
  7612. /* istanbul ignore else */
  7613. if ( true && vm.$options.renderError) {
  7614. try {
  7615. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7616. } catch (e) {
  7617. handleError(e, vm, "renderError");
  7618. vnode = vm._vnode;
  7619. }
  7620. } else {
  7621. vnode = vm._vnode;
  7622. }
  7623. } finally {
  7624. currentRenderingInstance = null;
  7625. }
  7626. // if the returned array contains only a single node, allow it
  7627. if (Array.isArray(vnode) && vnode.length === 1) {
  7628. vnode = vnode[0];
  7629. }
  7630. // return empty vnode in case the render function errored out
  7631. if (!(vnode instanceof VNode)) {
  7632. if ( true && Array.isArray(vnode)) {
  7633. warn(
  7634. 'Multiple root nodes returned from render function. Render function ' +
  7635. 'should return a single root node.',
  7636. vm
  7637. );
  7638. }
  7639. vnode = createEmptyVNode();
  7640. }
  7641. // set parent
  7642. vnode.parent = _parentVnode;
  7643. return vnode
  7644. };
  7645. }
  7646. /* */
  7647. function ensureCtor (comp, base) {
  7648. if (
  7649. comp.__esModule ||
  7650. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7651. ) {
  7652. comp = comp.default;
  7653. }
  7654. return isObject(comp)
  7655. ? base.extend(comp)
  7656. : comp
  7657. }
  7658. function createAsyncPlaceholder (
  7659. factory,
  7660. data,
  7661. context,
  7662. children,
  7663. tag
  7664. ) {
  7665. var node = createEmptyVNode();
  7666. node.asyncFactory = factory;
  7667. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7668. return node
  7669. }
  7670. function resolveAsyncComponent (
  7671. factory,
  7672. baseCtor
  7673. ) {
  7674. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7675. return factory.errorComp
  7676. }
  7677. if (isDef(factory.resolved)) {
  7678. return factory.resolved
  7679. }
  7680. var owner = currentRenderingInstance;
  7681. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7682. // already pending
  7683. factory.owners.push(owner);
  7684. }
  7685. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7686. return factory.loadingComp
  7687. }
  7688. if (owner && !isDef(factory.owners)) {
  7689. var owners = factory.owners = [owner];
  7690. var sync = true;
  7691. var timerLoading = null;
  7692. var timerTimeout = null
  7693. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7694. var forceRender = function (renderCompleted) {
  7695. for (var i = 0, l = owners.length; i < l; i++) {
  7696. (owners[i]).$forceUpdate();
  7697. }
  7698. if (renderCompleted) {
  7699. owners.length = 0;
  7700. if (timerLoading !== null) {
  7701. clearTimeout(timerLoading);
  7702. timerLoading = null;
  7703. }
  7704. if (timerTimeout !== null) {
  7705. clearTimeout(timerTimeout);
  7706. timerTimeout = null;
  7707. }
  7708. }
  7709. };
  7710. var resolve = once(function (res) {
  7711. // cache resolved
  7712. factory.resolved = ensureCtor(res, baseCtor);
  7713. // invoke callbacks only if this is not a synchronous resolve
  7714. // (async resolves are shimmed as synchronous during SSR)
  7715. if (!sync) {
  7716. forceRender(true);
  7717. } else {
  7718. owners.length = 0;
  7719. }
  7720. });
  7721. var reject = once(function (reason) {
  7722. true && warn(
  7723. "Failed to resolve async component: " + (String(factory)) +
  7724. (reason ? ("\nReason: " + reason) : '')
  7725. );
  7726. if (isDef(factory.errorComp)) {
  7727. factory.error = true;
  7728. forceRender(true);
  7729. }
  7730. });
  7731. var res = factory(resolve, reject);
  7732. if (isObject(res)) {
  7733. if (isPromise(res)) {
  7734. // () => Promise
  7735. if (isUndef(factory.resolved)) {
  7736. res.then(resolve, reject);
  7737. }
  7738. } else if (isPromise(res.component)) {
  7739. res.component.then(resolve, reject);
  7740. if (isDef(res.error)) {
  7741. factory.errorComp = ensureCtor(res.error, baseCtor);
  7742. }
  7743. if (isDef(res.loading)) {
  7744. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7745. if (res.delay === 0) {
  7746. factory.loading = true;
  7747. } else {
  7748. timerLoading = setTimeout(function () {
  7749. timerLoading = null;
  7750. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7751. factory.loading = true;
  7752. forceRender(false);
  7753. }
  7754. }, res.delay || 200);
  7755. }
  7756. }
  7757. if (isDef(res.timeout)) {
  7758. timerTimeout = setTimeout(function () {
  7759. timerTimeout = null;
  7760. if (isUndef(factory.resolved)) {
  7761. reject(
  7762. true
  7763. ? ("timeout (" + (res.timeout) + "ms)")
  7764. : undefined
  7765. );
  7766. }
  7767. }, res.timeout);
  7768. }
  7769. }
  7770. }
  7771. sync = false;
  7772. // return in case resolved synchronously
  7773. return factory.loading
  7774. ? factory.loadingComp
  7775. : factory.resolved
  7776. }
  7777. }
  7778. /* */
  7779. function isAsyncPlaceholder (node) {
  7780. return node.isComment && node.asyncFactory
  7781. }
  7782. /* */
  7783. function getFirstComponentChild (children) {
  7784. if (Array.isArray(children)) {
  7785. for (var i = 0; i < children.length; i++) {
  7786. var c = children[i];
  7787. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7788. return c
  7789. }
  7790. }
  7791. }
  7792. }
  7793. /* */
  7794. /* */
  7795. function initEvents (vm) {
  7796. vm._events = Object.create(null);
  7797. vm._hasHookEvent = false;
  7798. // init parent attached events
  7799. var listeners = vm.$options._parentListeners;
  7800. if (listeners) {
  7801. updateComponentListeners(vm, listeners);
  7802. }
  7803. }
  7804. var target;
  7805. function add (event, fn) {
  7806. target.$on(event, fn);
  7807. }
  7808. function remove$1 (event, fn) {
  7809. target.$off(event, fn);
  7810. }
  7811. function createOnceHandler (event, fn) {
  7812. var _target = target;
  7813. return function onceHandler () {
  7814. var res = fn.apply(null, arguments);
  7815. if (res !== null) {
  7816. _target.$off(event, onceHandler);
  7817. }
  7818. }
  7819. }
  7820. function updateComponentListeners (
  7821. vm,
  7822. listeners,
  7823. oldListeners
  7824. ) {
  7825. target = vm;
  7826. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7827. target = undefined;
  7828. }
  7829. function eventsMixin (Vue) {
  7830. var hookRE = /^hook:/;
  7831. Vue.prototype.$on = function (event, fn) {
  7832. var vm = this;
  7833. if (Array.isArray(event)) {
  7834. for (var i = 0, l = event.length; i < l; i++) {
  7835. vm.$on(event[i], fn);
  7836. }
  7837. } else {
  7838. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7839. // optimize hook:event cost by using a boolean flag marked at registration
  7840. // instead of a hash lookup
  7841. if (hookRE.test(event)) {
  7842. vm._hasHookEvent = true;
  7843. }
  7844. }
  7845. return vm
  7846. };
  7847. Vue.prototype.$once = function (event, fn) {
  7848. var vm = this;
  7849. function on () {
  7850. vm.$off(event, on);
  7851. fn.apply(vm, arguments);
  7852. }
  7853. on.fn = fn;
  7854. vm.$on(event, on);
  7855. return vm
  7856. };
  7857. Vue.prototype.$off = function (event, fn) {
  7858. var vm = this;
  7859. // all
  7860. if (!arguments.length) {
  7861. vm._events = Object.create(null);
  7862. return vm
  7863. }
  7864. // array of events
  7865. if (Array.isArray(event)) {
  7866. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7867. vm.$off(event[i$1], fn);
  7868. }
  7869. return vm
  7870. }
  7871. // specific event
  7872. var cbs = vm._events[event];
  7873. if (!cbs) {
  7874. return vm
  7875. }
  7876. if (!fn) {
  7877. vm._events[event] = null;
  7878. return vm
  7879. }
  7880. // specific handler
  7881. var cb;
  7882. var i = cbs.length;
  7883. while (i--) {
  7884. cb = cbs[i];
  7885. if (cb === fn || cb.fn === fn) {
  7886. cbs.splice(i, 1);
  7887. break
  7888. }
  7889. }
  7890. return vm
  7891. };
  7892. Vue.prototype.$emit = function (event) {
  7893. var vm = this;
  7894. if (true) {
  7895. var lowerCaseEvent = event.toLowerCase();
  7896. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7897. tip(
  7898. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7899. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7900. "Note that HTML attributes are case-insensitive and you cannot use " +
  7901. "v-on to listen to camelCase events when using in-DOM templates. " +
  7902. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7903. );
  7904. }
  7905. }
  7906. var cbs = vm._events[event];
  7907. if (cbs) {
  7908. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7909. var args = toArray(arguments, 1);
  7910. var info = "event handler for \"" + event + "\"";
  7911. for (var i = 0, l = cbs.length; i < l; i++) {
  7912. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7913. }
  7914. }
  7915. return vm
  7916. };
  7917. }
  7918. /* */
  7919. var activeInstance = null;
  7920. var isUpdatingChildComponent = false;
  7921. function setActiveInstance(vm) {
  7922. var prevActiveInstance = activeInstance;
  7923. activeInstance = vm;
  7924. return function () {
  7925. activeInstance = prevActiveInstance;
  7926. }
  7927. }
  7928. function initLifecycle (vm) {
  7929. var options = vm.$options;
  7930. // locate first non-abstract parent
  7931. var parent = options.parent;
  7932. if (parent && !options.abstract) {
  7933. while (parent.$options.abstract && parent.$parent) {
  7934. parent = parent.$parent;
  7935. }
  7936. parent.$children.push(vm);
  7937. }
  7938. vm.$parent = parent;
  7939. vm.$root = parent ? parent.$root : vm;
  7940. vm.$children = [];
  7941. vm.$refs = {};
  7942. vm._watcher = null;
  7943. vm._inactive = null;
  7944. vm._directInactive = false;
  7945. vm._isMounted = false;
  7946. vm._isDestroyed = false;
  7947. vm._isBeingDestroyed = false;
  7948. }
  7949. function lifecycleMixin (Vue) {
  7950. Vue.prototype._update = function (vnode, hydrating) {
  7951. var vm = this;
  7952. var prevEl = vm.$el;
  7953. var prevVnode = vm._vnode;
  7954. var restoreActiveInstance = setActiveInstance(vm);
  7955. vm._vnode = vnode;
  7956. // Vue.prototype.__patch__ is injected in entry points
  7957. // based on the rendering backend used.
  7958. if (!prevVnode) {
  7959. // initial render
  7960. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7961. } else {
  7962. // updates
  7963. vm.$el = vm.__patch__(prevVnode, vnode);
  7964. }
  7965. restoreActiveInstance();
  7966. // update __vue__ reference
  7967. if (prevEl) {
  7968. prevEl.__vue__ = null;
  7969. }
  7970. if (vm.$el) {
  7971. vm.$el.__vue__ = vm;
  7972. }
  7973. // if parent is an HOC, update its $el as well
  7974. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7975. vm.$parent.$el = vm.$el;
  7976. }
  7977. // updated hook is called by the scheduler to ensure that children are
  7978. // updated in a parent's updated hook.
  7979. };
  7980. Vue.prototype.$forceUpdate = function () {
  7981. var vm = this;
  7982. if (vm._watcher) {
  7983. vm._watcher.update();
  7984. }
  7985. };
  7986. Vue.prototype.$destroy = function () {
  7987. var vm = this;
  7988. if (vm._isBeingDestroyed) {
  7989. return
  7990. }
  7991. callHook(vm, 'beforeDestroy');
  7992. vm._isBeingDestroyed = true;
  7993. // remove self from parent
  7994. var parent = vm.$parent;
  7995. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7996. remove(parent.$children, vm);
  7997. }
  7998. // teardown watchers
  7999. if (vm._watcher) {
  8000. vm._watcher.teardown();
  8001. }
  8002. var i = vm._watchers.length;
  8003. while (i--) {
  8004. vm._watchers[i].teardown();
  8005. }
  8006. // remove reference from data ob
  8007. // frozen object may not have observer.
  8008. if (vm._data.__ob__) {
  8009. vm._data.__ob__.vmCount--;
  8010. }
  8011. // call the last hook...
  8012. vm._isDestroyed = true;
  8013. // invoke destroy hooks on current rendered tree
  8014. vm.__patch__(vm._vnode, null);
  8015. // fire destroyed hook
  8016. callHook(vm, 'destroyed');
  8017. // turn off all instance listeners.
  8018. vm.$off();
  8019. // remove __vue__ reference
  8020. if (vm.$el) {
  8021. vm.$el.__vue__ = null;
  8022. }
  8023. // release circular reference (#6759)
  8024. if (vm.$vnode) {
  8025. vm.$vnode.parent = null;
  8026. }
  8027. };
  8028. }
  8029. function updateChildComponent (
  8030. vm,
  8031. propsData,
  8032. listeners,
  8033. parentVnode,
  8034. renderChildren
  8035. ) {
  8036. if (true) {
  8037. isUpdatingChildComponent = true;
  8038. }
  8039. // determine whether component has slot children
  8040. // we need to do this before overwriting $options._renderChildren.
  8041. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8042. // dynamic slot names). Static scoped slots compiled from template has the
  8043. // "$stable" marker.
  8044. var newScopedSlots = parentVnode.data.scopedSlots;
  8045. var oldScopedSlots = vm.$scopedSlots;
  8046. var hasDynamicScopedSlot = !!(
  8047. (newScopedSlots && !newScopedSlots.$stable) ||
  8048. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8049. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8050. );
  8051. // Any static slot children from the parent may have changed during parent's
  8052. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8053. // update is necessary to ensure correctness.
  8054. var needsForceUpdate = !!(
  8055. renderChildren || // has new static slots
  8056. vm.$options._renderChildren || // has old static slots
  8057. hasDynamicScopedSlot
  8058. );
  8059. vm.$options._parentVnode = parentVnode;
  8060. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8061. if (vm._vnode) { // update child tree's parent
  8062. vm._vnode.parent = parentVnode;
  8063. }
  8064. vm.$options._renderChildren = renderChildren;
  8065. // update $attrs and $listeners hash
  8066. // these are also reactive so they may trigger child update if the child
  8067. // used them during render
  8068. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8069. vm.$listeners = listeners || emptyObject;
  8070. // update props
  8071. if (propsData && vm.$options.props) {
  8072. toggleObserving(false);
  8073. var props = vm._props;
  8074. var propKeys = vm.$options._propKeys || [];
  8075. for (var i = 0; i < propKeys.length; i++) {
  8076. var key = propKeys[i];
  8077. var propOptions = vm.$options.props; // wtf flow?
  8078. props[key] = validateProp(key, propOptions, propsData, vm);
  8079. }
  8080. toggleObserving(true);
  8081. // keep a copy of raw propsData
  8082. vm.$options.propsData = propsData;
  8083. }
  8084. // fixed by xxxxxx update properties(mp runtime)
  8085. vm._$updateProperties && vm._$updateProperties(vm);
  8086. // update listeners
  8087. listeners = listeners || emptyObject;
  8088. var oldListeners = vm.$options._parentListeners;
  8089. vm.$options._parentListeners = listeners;
  8090. updateComponentListeners(vm, listeners, oldListeners);
  8091. // resolve slots + force update if has children
  8092. if (needsForceUpdate) {
  8093. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8094. vm.$forceUpdate();
  8095. }
  8096. if (true) {
  8097. isUpdatingChildComponent = false;
  8098. }
  8099. }
  8100. function isInInactiveTree (vm) {
  8101. while (vm && (vm = vm.$parent)) {
  8102. if (vm._inactive) { return true }
  8103. }
  8104. return false
  8105. }
  8106. function activateChildComponent (vm, direct) {
  8107. if (direct) {
  8108. vm._directInactive = false;
  8109. if (isInInactiveTree(vm)) {
  8110. return
  8111. }
  8112. } else if (vm._directInactive) {
  8113. return
  8114. }
  8115. if (vm._inactive || vm._inactive === null) {
  8116. vm._inactive = false;
  8117. for (var i = 0; i < vm.$children.length; i++) {
  8118. activateChildComponent(vm.$children[i]);
  8119. }
  8120. callHook(vm, 'activated');
  8121. }
  8122. }
  8123. function deactivateChildComponent (vm, direct) {
  8124. if (direct) {
  8125. vm._directInactive = true;
  8126. if (isInInactiveTree(vm)) {
  8127. return
  8128. }
  8129. }
  8130. if (!vm._inactive) {
  8131. vm._inactive = true;
  8132. for (var i = 0; i < vm.$children.length; i++) {
  8133. deactivateChildComponent(vm.$children[i]);
  8134. }
  8135. callHook(vm, 'deactivated');
  8136. }
  8137. }
  8138. function callHook (vm, hook) {
  8139. // #7573 disable dep collection when invoking lifecycle hooks
  8140. pushTarget();
  8141. var handlers = vm.$options[hook];
  8142. var info = hook + " hook";
  8143. if (handlers) {
  8144. for (var i = 0, j = handlers.length; i < j; i++) {
  8145. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8146. }
  8147. }
  8148. if (vm._hasHookEvent) {
  8149. vm.$emit('hook:' + hook);
  8150. }
  8151. popTarget();
  8152. }
  8153. /* */
  8154. var MAX_UPDATE_COUNT = 100;
  8155. var queue = [];
  8156. var activatedChildren = [];
  8157. var has = {};
  8158. var circular = {};
  8159. var waiting = false;
  8160. var flushing = false;
  8161. var index = 0;
  8162. /**
  8163. * Reset the scheduler's state.
  8164. */
  8165. function resetSchedulerState () {
  8166. index = queue.length = activatedChildren.length = 0;
  8167. has = {};
  8168. if (true) {
  8169. circular = {};
  8170. }
  8171. waiting = flushing = false;
  8172. }
  8173. // Async edge case #6566 requires saving the timestamp when event listeners are
  8174. // attached. However, calling performance.now() has a perf overhead especially
  8175. // if the page has thousands of event listeners. Instead, we take a timestamp
  8176. // every time the scheduler flushes and use that for all event listeners
  8177. // attached during that flush.
  8178. var currentFlushTimestamp = 0;
  8179. // Async edge case fix requires storing an event listener's attach timestamp.
  8180. var getNow = Date.now;
  8181. // Determine what event timestamp the browser is using. Annoyingly, the
  8182. // timestamp can either be hi-res (relative to page load) or low-res
  8183. // (relative to UNIX epoch), so in order to compare time we have to use the
  8184. // same timestamp type when saving the flush timestamp.
  8185. // All IE versions use low-res event timestamps, and have problematic clock
  8186. // implementations (#9632)
  8187. if (inBrowser && !isIE) {
  8188. var performance = window.performance;
  8189. if (
  8190. performance &&
  8191. typeof performance.now === 'function' &&
  8192. getNow() > document.createEvent('Event').timeStamp
  8193. ) {
  8194. // if the event timestamp, although evaluated AFTER the Date.now(), is
  8195. // smaller than it, it means the event is using a hi-res timestamp,
  8196. // and we need to use the hi-res version for event listener timestamps as
  8197. // well.
  8198. getNow = function () { return performance.now(); };
  8199. }
  8200. }
  8201. /**
  8202. * Flush both queues and run the watchers.
  8203. */
  8204. function flushSchedulerQueue () {
  8205. currentFlushTimestamp = getNow();
  8206. flushing = true;
  8207. var watcher, id;
  8208. // Sort queue before flush.
  8209. // This ensures that:
  8210. // 1. Components are updated from parent to child. (because parent is always
  8211. // created before the child)
  8212. // 2. A component's user watchers are run before its render watcher (because
  8213. // user watchers are created before the render watcher)
  8214. // 3. If a component is destroyed during a parent component's watcher run,
  8215. // its watchers can be skipped.
  8216. queue.sort(function (a, b) { return a.id - b.id; });
  8217. // do not cache length because more watchers might be pushed
  8218. // as we run existing watchers
  8219. for (index = 0; index < queue.length; index++) {
  8220. watcher = queue[index];
  8221. if (watcher.before) {
  8222. watcher.before();
  8223. }
  8224. id = watcher.id;
  8225. has[id] = null;
  8226. watcher.run();
  8227. // in dev build, check and stop circular updates.
  8228. if ( true && has[id] != null) {
  8229. circular[id] = (circular[id] || 0) + 1;
  8230. if (circular[id] > MAX_UPDATE_COUNT) {
  8231. warn(
  8232. 'You may have an infinite update loop ' + (
  8233. watcher.user
  8234. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8235. : "in a component render function."
  8236. ),
  8237. watcher.vm
  8238. );
  8239. break
  8240. }
  8241. }
  8242. }
  8243. // keep copies of post queues before resetting state
  8244. var activatedQueue = activatedChildren.slice();
  8245. var updatedQueue = queue.slice();
  8246. resetSchedulerState();
  8247. // call component updated and activated hooks
  8248. callActivatedHooks(activatedQueue);
  8249. callUpdatedHooks(updatedQueue);
  8250. // devtool hook
  8251. /* istanbul ignore if */
  8252. if (devtools && config.devtools) {
  8253. devtools.emit('flush');
  8254. }
  8255. }
  8256. function callUpdatedHooks (queue) {
  8257. var i = queue.length;
  8258. while (i--) {
  8259. var watcher = queue[i];
  8260. var vm = watcher.vm;
  8261. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8262. callHook(vm, 'updated');
  8263. }
  8264. }
  8265. }
  8266. /**
  8267. * Queue a kept-alive component that was activated during patch.
  8268. * The queue will be processed after the entire tree has been patched.
  8269. */
  8270. function queueActivatedComponent (vm) {
  8271. // setting _inactive to false here so that a render function can
  8272. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8273. vm._inactive = false;
  8274. activatedChildren.push(vm);
  8275. }
  8276. function callActivatedHooks (queue) {
  8277. for (var i = 0; i < queue.length; i++) {
  8278. queue[i]._inactive = true;
  8279. activateChildComponent(queue[i], true /* true */);
  8280. }
  8281. }
  8282. /**
  8283. * Push a watcher into the watcher queue.
  8284. * Jobs with duplicate IDs will be skipped unless it's
  8285. * pushed when the queue is being flushed.
  8286. */
  8287. function queueWatcher (watcher) {
  8288. var id = watcher.id;
  8289. if (has[id] == null) {
  8290. has[id] = true;
  8291. if (!flushing) {
  8292. queue.push(watcher);
  8293. } else {
  8294. // if already flushing, splice the watcher based on its id
  8295. // if already past its id, it will be run next immediately.
  8296. var i = queue.length - 1;
  8297. while (i > index && queue[i].id > watcher.id) {
  8298. i--;
  8299. }
  8300. queue.splice(i + 1, 0, watcher);
  8301. }
  8302. // queue the flush
  8303. if (!waiting) {
  8304. waiting = true;
  8305. if ( true && !config.async) {
  8306. flushSchedulerQueue();
  8307. return
  8308. }
  8309. nextTick(flushSchedulerQueue);
  8310. }
  8311. }
  8312. }
  8313. /* */
  8314. var uid$2 = 0;
  8315. /**
  8316. * A watcher parses an expression, collects dependencies,
  8317. * and fires callback when the expression value changes.
  8318. * This is used for both the $watch() api and directives.
  8319. */
  8320. var Watcher = function Watcher (
  8321. vm,
  8322. expOrFn,
  8323. cb,
  8324. options,
  8325. isRenderWatcher
  8326. ) {
  8327. this.vm = vm;
  8328. if (isRenderWatcher) {
  8329. vm._watcher = this;
  8330. }
  8331. vm._watchers.push(this);
  8332. // options
  8333. if (options) {
  8334. this.deep = !!options.deep;
  8335. this.user = !!options.user;
  8336. this.lazy = !!options.lazy;
  8337. this.sync = !!options.sync;
  8338. this.before = options.before;
  8339. } else {
  8340. this.deep = this.user = this.lazy = this.sync = false;
  8341. }
  8342. this.cb = cb;
  8343. this.id = ++uid$2; // uid for batching
  8344. this.active = true;
  8345. this.dirty = this.lazy; // for lazy watchers
  8346. this.deps = [];
  8347. this.newDeps = [];
  8348. this.depIds = new _Set();
  8349. this.newDepIds = new _Set();
  8350. this.expression = true
  8351. ? expOrFn.toString()
  8352. : undefined;
  8353. // parse expression for getter
  8354. if (typeof expOrFn === 'function') {
  8355. this.getter = expOrFn;
  8356. } else {
  8357. this.getter = parsePath(expOrFn);
  8358. if (!this.getter) {
  8359. this.getter = noop;
  8360. true && warn(
  8361. "Failed watching path: \"" + expOrFn + "\" " +
  8362. 'Watcher only accepts simple dot-delimited paths. ' +
  8363. 'For full control, use a function instead.',
  8364. vm
  8365. );
  8366. }
  8367. }
  8368. this.value = this.lazy
  8369. ? undefined
  8370. : this.get();
  8371. };
  8372. /**
  8373. * Evaluate the getter, and re-collect dependencies.
  8374. */
  8375. Watcher.prototype.get = function get () {
  8376. pushTarget(this);
  8377. var value;
  8378. var vm = this.vm;
  8379. try {
  8380. value = this.getter.call(vm, vm);
  8381. } catch (e) {
  8382. if (this.user) {
  8383. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8384. } else {
  8385. throw e
  8386. }
  8387. } finally {
  8388. // "touch" every property so they are all tracked as
  8389. // dependencies for deep watching
  8390. if (this.deep) {
  8391. traverse(value);
  8392. }
  8393. popTarget();
  8394. this.cleanupDeps();
  8395. }
  8396. return value
  8397. };
  8398. /**
  8399. * Add a dependency to this directive.
  8400. */
  8401. Watcher.prototype.addDep = function addDep (dep) {
  8402. var id = dep.id;
  8403. if (!this.newDepIds.has(id)) {
  8404. this.newDepIds.add(id);
  8405. this.newDeps.push(dep);
  8406. if (!this.depIds.has(id)) {
  8407. dep.addSub(this);
  8408. }
  8409. }
  8410. };
  8411. /**
  8412. * Clean up for dependency collection.
  8413. */
  8414. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8415. var i = this.deps.length;
  8416. while (i--) {
  8417. var dep = this.deps[i];
  8418. if (!this.newDepIds.has(dep.id)) {
  8419. dep.removeSub(this);
  8420. }
  8421. }
  8422. var tmp = this.depIds;
  8423. this.depIds = this.newDepIds;
  8424. this.newDepIds = tmp;
  8425. this.newDepIds.clear();
  8426. tmp = this.deps;
  8427. this.deps = this.newDeps;
  8428. this.newDeps = tmp;
  8429. this.newDeps.length = 0;
  8430. };
  8431. /**
  8432. * Subscriber interface.
  8433. * Will be called when a dependency changes.
  8434. */
  8435. Watcher.prototype.update = function update () {
  8436. /* istanbul ignore else */
  8437. if (this.lazy) {
  8438. this.dirty = true;
  8439. } else if (this.sync) {
  8440. this.run();
  8441. } else {
  8442. queueWatcher(this);
  8443. }
  8444. };
  8445. /**
  8446. * Scheduler job interface.
  8447. * Will be called by the scheduler.
  8448. */
  8449. Watcher.prototype.run = function run () {
  8450. if (this.active) {
  8451. var value = this.get();
  8452. if (
  8453. value !== this.value ||
  8454. // Deep watchers and watchers on Object/Arrays should fire even
  8455. // when the value is the same, because the value may
  8456. // have mutated.
  8457. isObject(value) ||
  8458. this.deep
  8459. ) {
  8460. // set new value
  8461. var oldValue = this.value;
  8462. this.value = value;
  8463. if (this.user) {
  8464. try {
  8465. this.cb.call(this.vm, value, oldValue);
  8466. } catch (e) {
  8467. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8468. }
  8469. } else {
  8470. this.cb.call(this.vm, value, oldValue);
  8471. }
  8472. }
  8473. }
  8474. };
  8475. /**
  8476. * Evaluate the value of the watcher.
  8477. * This only gets called for lazy watchers.
  8478. */
  8479. Watcher.prototype.evaluate = function evaluate () {
  8480. this.value = this.get();
  8481. this.dirty = false;
  8482. };
  8483. /**
  8484. * Depend on all deps collected by this watcher.
  8485. */
  8486. Watcher.prototype.depend = function depend () {
  8487. var i = this.deps.length;
  8488. while (i--) {
  8489. this.deps[i].depend();
  8490. }
  8491. };
  8492. /**
  8493. * Remove self from all dependencies' subscriber list.
  8494. */
  8495. Watcher.prototype.teardown = function teardown () {
  8496. if (this.active) {
  8497. // remove self from vm's watcher list
  8498. // this is a somewhat expensive operation so we skip it
  8499. // if the vm is being destroyed.
  8500. if (!this.vm._isBeingDestroyed) {
  8501. remove(this.vm._watchers, this);
  8502. }
  8503. var i = this.deps.length;
  8504. while (i--) {
  8505. this.deps[i].removeSub(this);
  8506. }
  8507. this.active = false;
  8508. }
  8509. };
  8510. /* */
  8511. var sharedPropertyDefinition = {
  8512. enumerable: true,
  8513. configurable: true,
  8514. get: noop,
  8515. set: noop
  8516. };
  8517. function proxy (target, sourceKey, key) {
  8518. sharedPropertyDefinition.get = function proxyGetter () {
  8519. return this[sourceKey][key]
  8520. };
  8521. sharedPropertyDefinition.set = function proxySetter (val) {
  8522. this[sourceKey][key] = val;
  8523. };
  8524. Object.defineProperty(target, key, sharedPropertyDefinition);
  8525. }
  8526. function initState (vm) {
  8527. vm._watchers = [];
  8528. var opts = vm.$options;
  8529. if (opts.props) { initProps(vm, opts.props); }
  8530. if (opts.methods) { initMethods(vm, opts.methods); }
  8531. if (opts.data) {
  8532. initData(vm);
  8533. } else {
  8534. observe(vm._data = {}, true /* asRootData */);
  8535. }
  8536. if (opts.computed) { initComputed(vm, opts.computed); }
  8537. if (opts.watch && opts.watch !== nativeWatch) {
  8538. initWatch(vm, opts.watch);
  8539. }
  8540. }
  8541. function initProps (vm, propsOptions) {
  8542. var propsData = vm.$options.propsData || {};
  8543. var props = vm._props = {};
  8544. // cache prop keys so that future props updates can iterate using Array
  8545. // instead of dynamic object key enumeration.
  8546. var keys = vm.$options._propKeys = [];
  8547. var isRoot = !vm.$parent;
  8548. // root instance props should be converted
  8549. if (!isRoot) {
  8550. toggleObserving(false);
  8551. }
  8552. var loop = function ( key ) {
  8553. keys.push(key);
  8554. var value = validateProp(key, propsOptions, propsData, vm);
  8555. /* istanbul ignore else */
  8556. if (true) {
  8557. var hyphenatedKey = hyphenate(key);
  8558. if (isReservedAttribute(hyphenatedKey) ||
  8559. config.isReservedAttr(hyphenatedKey)) {
  8560. warn(
  8561. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8562. vm
  8563. );
  8564. }
  8565. defineReactive$$1(props, key, value, function () {
  8566. if (!isRoot && !isUpdatingChildComponent) {
  8567. {
  8568. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  8569. return
  8570. }
  8571. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8572. if(
  8573. key === 'value' &&
  8574. Array.isArray(vm.$options.behaviors) &&
  8575. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8576. ){
  8577. return
  8578. }
  8579. if(vm._getFormData){
  8580. return
  8581. }
  8582. var $parent = vm.$parent;
  8583. while($parent){
  8584. if($parent.__next_tick_pending){
  8585. return
  8586. }
  8587. $parent = $parent.$parent;
  8588. }
  8589. }
  8590. warn(
  8591. "Avoid mutating a prop directly since the value will be " +
  8592. "overwritten whenever the parent component re-renders. " +
  8593. "Instead, use a data or computed property based on the prop's " +
  8594. "value. Prop being mutated: \"" + key + "\"",
  8595. vm
  8596. );
  8597. }
  8598. });
  8599. } else {}
  8600. // static props are already proxied on the component's prototype
  8601. // during Vue.extend(). We only need to proxy props defined at
  8602. // instantiation here.
  8603. if (!(key in vm)) {
  8604. proxy(vm, "_props", key);
  8605. }
  8606. };
  8607. for (var key in propsOptions) loop( key );
  8608. toggleObserving(true);
  8609. }
  8610. function initData (vm) {
  8611. var data = vm.$options.data;
  8612. data = vm._data = typeof data === 'function'
  8613. ? getData(data, vm)
  8614. : data || {};
  8615. if (!isPlainObject(data)) {
  8616. data = {};
  8617. true && warn(
  8618. 'data functions should return an object:\n' +
  8619. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8620. vm
  8621. );
  8622. }
  8623. // proxy data on instance
  8624. var keys = Object.keys(data);
  8625. var props = vm.$options.props;
  8626. var methods = vm.$options.methods;
  8627. var i = keys.length;
  8628. while (i--) {
  8629. var key = keys[i];
  8630. if (true) {
  8631. if (methods && hasOwn(methods, key)) {
  8632. warn(
  8633. ("Method \"" + key + "\" has already been defined as a data property."),
  8634. vm
  8635. );
  8636. }
  8637. }
  8638. if (props && hasOwn(props, key)) {
  8639. true && warn(
  8640. "The data property \"" + key + "\" is already declared as a prop. " +
  8641. "Use prop default value instead.",
  8642. vm
  8643. );
  8644. } else if (!isReserved(key)) {
  8645. proxy(vm, "_data", key);
  8646. }
  8647. }
  8648. // observe data
  8649. observe(data, true /* asRootData */);
  8650. }
  8651. function getData (data, vm) {
  8652. // #7573 disable dep collection when invoking data getters
  8653. pushTarget();
  8654. try {
  8655. return data.call(vm, vm)
  8656. } catch (e) {
  8657. handleError(e, vm, "data()");
  8658. return {}
  8659. } finally {
  8660. popTarget();
  8661. }
  8662. }
  8663. var computedWatcherOptions = { lazy: true };
  8664. function initComputed (vm, computed) {
  8665. // $flow-disable-line
  8666. var watchers = vm._computedWatchers = Object.create(null);
  8667. // computed properties are just getters during SSR
  8668. var isSSR = isServerRendering();
  8669. for (var key in computed) {
  8670. var userDef = computed[key];
  8671. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8672. if ( true && getter == null) {
  8673. warn(
  8674. ("Getter is missing for computed property \"" + key + "\"."),
  8675. vm
  8676. );
  8677. }
  8678. if (!isSSR) {
  8679. // create internal watcher for the computed property.
  8680. watchers[key] = new Watcher(
  8681. vm,
  8682. getter || noop,
  8683. noop,
  8684. computedWatcherOptions
  8685. );
  8686. }
  8687. // component-defined computed properties are already defined on the
  8688. // component prototype. We only need to define computed properties defined
  8689. // at instantiation here.
  8690. if (!(key in vm)) {
  8691. defineComputed(vm, key, userDef);
  8692. } else if (true) {
  8693. if (key in vm.$data) {
  8694. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8695. } else if (vm.$options.props && key in vm.$options.props) {
  8696. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8697. }
  8698. }
  8699. }
  8700. }
  8701. function defineComputed (
  8702. target,
  8703. key,
  8704. userDef
  8705. ) {
  8706. var shouldCache = !isServerRendering();
  8707. if (typeof userDef === 'function') {
  8708. sharedPropertyDefinition.get = shouldCache
  8709. ? createComputedGetter(key)
  8710. : createGetterInvoker(userDef);
  8711. sharedPropertyDefinition.set = noop;
  8712. } else {
  8713. sharedPropertyDefinition.get = userDef.get
  8714. ? shouldCache && userDef.cache !== false
  8715. ? createComputedGetter(key)
  8716. : createGetterInvoker(userDef.get)
  8717. : noop;
  8718. sharedPropertyDefinition.set = userDef.set || noop;
  8719. }
  8720. if ( true &&
  8721. sharedPropertyDefinition.set === noop) {
  8722. sharedPropertyDefinition.set = function () {
  8723. warn(
  8724. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8725. this
  8726. );
  8727. };
  8728. }
  8729. Object.defineProperty(target, key, sharedPropertyDefinition);
  8730. }
  8731. function createComputedGetter (key) {
  8732. return function computedGetter () {
  8733. var watcher = this._computedWatchers && this._computedWatchers[key];
  8734. if (watcher) {
  8735. if (watcher.dirty) {
  8736. watcher.evaluate();
  8737. }
  8738. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8739. watcher.depend();
  8740. }
  8741. return watcher.value
  8742. }
  8743. }
  8744. }
  8745. function createGetterInvoker(fn) {
  8746. return function computedGetter () {
  8747. return fn.call(this, this)
  8748. }
  8749. }
  8750. function initMethods (vm, methods) {
  8751. var props = vm.$options.props;
  8752. for (var key in methods) {
  8753. if (true) {
  8754. if (typeof methods[key] !== 'function') {
  8755. warn(
  8756. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8757. "Did you reference the function correctly?",
  8758. vm
  8759. );
  8760. }
  8761. if (props && hasOwn(props, key)) {
  8762. warn(
  8763. ("Method \"" + key + "\" has already been defined as a prop."),
  8764. vm
  8765. );
  8766. }
  8767. if ((key in vm) && isReserved(key)) {
  8768. warn(
  8769. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8770. "Avoid defining component methods that start with _ or $."
  8771. );
  8772. }
  8773. }
  8774. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8775. }
  8776. }
  8777. function initWatch (vm, watch) {
  8778. for (var key in watch) {
  8779. var handler = watch[key];
  8780. if (Array.isArray(handler)) {
  8781. for (var i = 0; i < handler.length; i++) {
  8782. createWatcher(vm, key, handler[i]);
  8783. }
  8784. } else {
  8785. createWatcher(vm, key, handler);
  8786. }
  8787. }
  8788. }
  8789. function createWatcher (
  8790. vm,
  8791. expOrFn,
  8792. handler,
  8793. options
  8794. ) {
  8795. if (isPlainObject(handler)) {
  8796. options = handler;
  8797. handler = handler.handler;
  8798. }
  8799. if (typeof handler === 'string') {
  8800. handler = vm[handler];
  8801. }
  8802. return vm.$watch(expOrFn, handler, options)
  8803. }
  8804. function stateMixin (Vue) {
  8805. // flow somehow has problems with directly declared definition object
  8806. // when using Object.defineProperty, so we have to procedurally build up
  8807. // the object here.
  8808. var dataDef = {};
  8809. dataDef.get = function () { return this._data };
  8810. var propsDef = {};
  8811. propsDef.get = function () { return this._props };
  8812. if (true) {
  8813. dataDef.set = function () {
  8814. warn(
  8815. 'Avoid replacing instance root $data. ' +
  8816. 'Use nested data properties instead.',
  8817. this
  8818. );
  8819. };
  8820. propsDef.set = function () {
  8821. warn("$props is readonly.", this);
  8822. };
  8823. }
  8824. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8825. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8826. Vue.prototype.$set = set;
  8827. Vue.prototype.$delete = del;
  8828. Vue.prototype.$watch = function (
  8829. expOrFn,
  8830. cb,
  8831. options
  8832. ) {
  8833. var vm = this;
  8834. if (isPlainObject(cb)) {
  8835. return createWatcher(vm, expOrFn, cb, options)
  8836. }
  8837. options = options || {};
  8838. options.user = true;
  8839. var watcher = new Watcher(vm, expOrFn, cb, options);
  8840. if (options.immediate) {
  8841. try {
  8842. cb.call(vm, watcher.value);
  8843. } catch (error) {
  8844. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8845. }
  8846. }
  8847. return function unwatchFn () {
  8848. watcher.teardown();
  8849. }
  8850. };
  8851. }
  8852. /* */
  8853. var uid$3 = 0;
  8854. function initMixin (Vue) {
  8855. Vue.prototype._init = function (options) {
  8856. var vm = this;
  8857. // a uid
  8858. vm._uid = uid$3++;
  8859. var startTag, endTag;
  8860. /* istanbul ignore if */
  8861. if ( true && config.performance && mark) {
  8862. startTag = "vue-perf-start:" + (vm._uid);
  8863. endTag = "vue-perf-end:" + (vm._uid);
  8864. mark(startTag);
  8865. }
  8866. // a flag to avoid this being observed
  8867. vm._isVue = true;
  8868. // merge options
  8869. if (options && options._isComponent) {
  8870. // optimize internal component instantiation
  8871. // since dynamic options merging is pretty slow, and none of the
  8872. // internal component options needs special treatment.
  8873. initInternalComponent(vm, options);
  8874. } else {
  8875. vm.$options = mergeOptions(
  8876. resolveConstructorOptions(vm.constructor),
  8877. options || {},
  8878. vm
  8879. );
  8880. }
  8881. /* istanbul ignore else */
  8882. if (true) {
  8883. initProxy(vm);
  8884. } else {}
  8885. // expose real self
  8886. vm._self = vm;
  8887. initLifecycle(vm);
  8888. initEvents(vm);
  8889. initRender(vm);
  8890. callHook(vm, 'beforeCreate');
  8891. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8892. initState(vm);
  8893. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8894. !vm._$fallback && callHook(vm, 'created');
  8895. /* istanbul ignore if */
  8896. if ( true && config.performance && mark) {
  8897. vm._name = formatComponentName(vm, false);
  8898. mark(endTag);
  8899. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8900. }
  8901. if (vm.$options.el) {
  8902. vm.$mount(vm.$options.el);
  8903. }
  8904. };
  8905. }
  8906. function initInternalComponent (vm, options) {
  8907. var opts = vm.$options = Object.create(vm.constructor.options);
  8908. // doing this because it's faster than dynamic enumeration.
  8909. var parentVnode = options._parentVnode;
  8910. opts.parent = options.parent;
  8911. opts._parentVnode = parentVnode;
  8912. var vnodeComponentOptions = parentVnode.componentOptions;
  8913. opts.propsData = vnodeComponentOptions.propsData;
  8914. opts._parentListeners = vnodeComponentOptions.listeners;
  8915. opts._renderChildren = vnodeComponentOptions.children;
  8916. opts._componentTag = vnodeComponentOptions.tag;
  8917. if (options.render) {
  8918. opts.render = options.render;
  8919. opts.staticRenderFns = options.staticRenderFns;
  8920. }
  8921. }
  8922. function resolveConstructorOptions (Ctor) {
  8923. var options = Ctor.options;
  8924. if (Ctor.super) {
  8925. var superOptions = resolveConstructorOptions(Ctor.super);
  8926. var cachedSuperOptions = Ctor.superOptions;
  8927. if (superOptions !== cachedSuperOptions) {
  8928. // super option changed,
  8929. // need to resolve new options.
  8930. Ctor.superOptions = superOptions;
  8931. // check if there are any late-modified/attached options (#4976)
  8932. var modifiedOptions = resolveModifiedOptions(Ctor);
  8933. // update base extend options
  8934. if (modifiedOptions) {
  8935. extend(Ctor.extendOptions, modifiedOptions);
  8936. }
  8937. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8938. if (options.name) {
  8939. options.components[options.name] = Ctor;
  8940. }
  8941. }
  8942. }
  8943. return options
  8944. }
  8945. function resolveModifiedOptions (Ctor) {
  8946. var modified;
  8947. var latest = Ctor.options;
  8948. var sealed = Ctor.sealedOptions;
  8949. for (var key in latest) {
  8950. if (latest[key] !== sealed[key]) {
  8951. if (!modified) { modified = {}; }
  8952. modified[key] = latest[key];
  8953. }
  8954. }
  8955. return modified
  8956. }
  8957. function Vue (options) {
  8958. if ( true &&
  8959. !(this instanceof Vue)
  8960. ) {
  8961. warn('Vue is a constructor and should be called with the `new` keyword');
  8962. }
  8963. this._init(options);
  8964. }
  8965. initMixin(Vue);
  8966. stateMixin(Vue);
  8967. eventsMixin(Vue);
  8968. lifecycleMixin(Vue);
  8969. renderMixin(Vue);
  8970. /* */
  8971. function initUse (Vue) {
  8972. Vue.use = function (plugin) {
  8973. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8974. if (installedPlugins.indexOf(plugin) > -1) {
  8975. return this
  8976. }
  8977. // additional parameters
  8978. var args = toArray(arguments, 1);
  8979. args.unshift(this);
  8980. if (typeof plugin.install === 'function') {
  8981. plugin.install.apply(plugin, args);
  8982. } else if (typeof plugin === 'function') {
  8983. plugin.apply(null, args);
  8984. }
  8985. installedPlugins.push(plugin);
  8986. return this
  8987. };
  8988. }
  8989. /* */
  8990. function initMixin$1 (Vue) {
  8991. Vue.mixin = function (mixin) {
  8992. this.options = mergeOptions(this.options, mixin);
  8993. return this
  8994. };
  8995. }
  8996. /* */
  8997. function initExtend (Vue) {
  8998. /**
  8999. * Each instance constructor, including Vue, has a unique
  9000. * cid. This enables us to create wrapped "child
  9001. * constructors" for prototypal inheritance and cache them.
  9002. */
  9003. Vue.cid = 0;
  9004. var cid = 1;
  9005. /**
  9006. * Class inheritance
  9007. */
  9008. Vue.extend = function (extendOptions) {
  9009. extendOptions = extendOptions || {};
  9010. var Super = this;
  9011. var SuperId = Super.cid;
  9012. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9013. if (cachedCtors[SuperId]) {
  9014. return cachedCtors[SuperId]
  9015. }
  9016. var name = extendOptions.name || Super.options.name;
  9017. if ( true && name) {
  9018. validateComponentName(name);
  9019. }
  9020. var Sub = function VueComponent (options) {
  9021. this._init(options);
  9022. };
  9023. Sub.prototype = Object.create(Super.prototype);
  9024. Sub.prototype.constructor = Sub;
  9025. Sub.cid = cid++;
  9026. Sub.options = mergeOptions(
  9027. Super.options,
  9028. extendOptions
  9029. );
  9030. Sub['super'] = Super;
  9031. // For props and computed properties, we define the proxy getters on
  9032. // the Vue instances at extension time, on the extended prototype. This
  9033. // avoids Object.defineProperty calls for each instance created.
  9034. if (Sub.options.props) {
  9035. initProps$1(Sub);
  9036. }
  9037. if (Sub.options.computed) {
  9038. initComputed$1(Sub);
  9039. }
  9040. // allow further extension/mixin/plugin usage
  9041. Sub.extend = Super.extend;
  9042. Sub.mixin = Super.mixin;
  9043. Sub.use = Super.use;
  9044. // create asset registers, so extended classes
  9045. // can have their private assets too.
  9046. ASSET_TYPES.forEach(function (type) {
  9047. Sub[type] = Super[type];
  9048. });
  9049. // enable recursive self-lookup
  9050. if (name) {
  9051. Sub.options.components[name] = Sub;
  9052. }
  9053. // keep a reference to the super options at extension time.
  9054. // later at instantiation we can check if Super's options have
  9055. // been updated.
  9056. Sub.superOptions = Super.options;
  9057. Sub.extendOptions = extendOptions;
  9058. Sub.sealedOptions = extend({}, Sub.options);
  9059. // cache constructor
  9060. cachedCtors[SuperId] = Sub;
  9061. return Sub
  9062. };
  9063. }
  9064. function initProps$1 (Comp) {
  9065. var props = Comp.options.props;
  9066. for (var key in props) {
  9067. proxy(Comp.prototype, "_props", key);
  9068. }
  9069. }
  9070. function initComputed$1 (Comp) {
  9071. var computed = Comp.options.computed;
  9072. for (var key in computed) {
  9073. defineComputed(Comp.prototype, key, computed[key]);
  9074. }
  9075. }
  9076. /* */
  9077. function initAssetRegisters (Vue) {
  9078. /**
  9079. * Create asset registration methods.
  9080. */
  9081. ASSET_TYPES.forEach(function (type) {
  9082. Vue[type] = function (
  9083. id,
  9084. definition
  9085. ) {
  9086. if (!definition) {
  9087. return this.options[type + 's'][id]
  9088. } else {
  9089. /* istanbul ignore if */
  9090. if ( true && type === 'component') {
  9091. validateComponentName(id);
  9092. }
  9093. if (type === 'component' && isPlainObject(definition)) {
  9094. definition.name = definition.name || id;
  9095. definition = this.options._base.extend(definition);
  9096. }
  9097. if (type === 'directive' && typeof definition === 'function') {
  9098. definition = { bind: definition, update: definition };
  9099. }
  9100. this.options[type + 's'][id] = definition;
  9101. return definition
  9102. }
  9103. };
  9104. });
  9105. }
  9106. /* */
  9107. function getComponentName (opts) {
  9108. return opts && (opts.Ctor.options.name || opts.tag)
  9109. }
  9110. function matches (pattern, name) {
  9111. if (Array.isArray(pattern)) {
  9112. return pattern.indexOf(name) > -1
  9113. } else if (typeof pattern === 'string') {
  9114. return pattern.split(',').indexOf(name) > -1
  9115. } else if (isRegExp(pattern)) {
  9116. return pattern.test(name)
  9117. }
  9118. /* istanbul ignore next */
  9119. return false
  9120. }
  9121. function pruneCache (keepAliveInstance, filter) {
  9122. var cache = keepAliveInstance.cache;
  9123. var keys = keepAliveInstance.keys;
  9124. var _vnode = keepAliveInstance._vnode;
  9125. for (var key in cache) {
  9126. var cachedNode = cache[key];
  9127. if (cachedNode) {
  9128. var name = getComponentName(cachedNode.componentOptions);
  9129. if (name && !filter(name)) {
  9130. pruneCacheEntry(cache, key, keys, _vnode);
  9131. }
  9132. }
  9133. }
  9134. }
  9135. function pruneCacheEntry (
  9136. cache,
  9137. key,
  9138. keys,
  9139. current
  9140. ) {
  9141. var cached$$1 = cache[key];
  9142. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9143. cached$$1.componentInstance.$destroy();
  9144. }
  9145. cache[key] = null;
  9146. remove(keys, key);
  9147. }
  9148. var patternTypes = [String, RegExp, Array];
  9149. var KeepAlive = {
  9150. name: 'keep-alive',
  9151. abstract: true,
  9152. props: {
  9153. include: patternTypes,
  9154. exclude: patternTypes,
  9155. max: [String, Number]
  9156. },
  9157. created: function created () {
  9158. this.cache = Object.create(null);
  9159. this.keys = [];
  9160. },
  9161. destroyed: function destroyed () {
  9162. for (var key in this.cache) {
  9163. pruneCacheEntry(this.cache, key, this.keys);
  9164. }
  9165. },
  9166. mounted: function mounted () {
  9167. var this$1 = this;
  9168. this.$watch('include', function (val) {
  9169. pruneCache(this$1, function (name) { return matches(val, name); });
  9170. });
  9171. this.$watch('exclude', function (val) {
  9172. pruneCache(this$1, function (name) { return !matches(val, name); });
  9173. });
  9174. },
  9175. render: function render () {
  9176. var slot = this.$slots.default;
  9177. var vnode = getFirstComponentChild(slot);
  9178. var componentOptions = vnode && vnode.componentOptions;
  9179. if (componentOptions) {
  9180. // check pattern
  9181. var name = getComponentName(componentOptions);
  9182. var ref = this;
  9183. var include = ref.include;
  9184. var exclude = ref.exclude;
  9185. if (
  9186. // not included
  9187. (include && (!name || !matches(include, name))) ||
  9188. // excluded
  9189. (exclude && name && matches(exclude, name))
  9190. ) {
  9191. return vnode
  9192. }
  9193. var ref$1 = this;
  9194. var cache = ref$1.cache;
  9195. var keys = ref$1.keys;
  9196. var key = vnode.key == null
  9197. // same constructor may get registered as different local components
  9198. // so cid alone is not enough (#3269)
  9199. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  9200. : vnode.key;
  9201. if (cache[key]) {
  9202. vnode.componentInstance = cache[key].componentInstance;
  9203. // make current key freshest
  9204. remove(keys, key);
  9205. keys.push(key);
  9206. } else {
  9207. cache[key] = vnode;
  9208. keys.push(key);
  9209. // prune oldest entry
  9210. if (this.max && keys.length > parseInt(this.max)) {
  9211. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  9212. }
  9213. }
  9214. vnode.data.keepAlive = true;
  9215. }
  9216. return vnode || (slot && slot[0])
  9217. }
  9218. };
  9219. var builtInComponents = {
  9220. KeepAlive: KeepAlive
  9221. };
  9222. /* */
  9223. function initGlobalAPI (Vue) {
  9224. // config
  9225. var configDef = {};
  9226. configDef.get = function () { return config; };
  9227. if (true) {
  9228. configDef.set = function () {
  9229. warn(
  9230. 'Do not replace the Vue.config object, set individual fields instead.'
  9231. );
  9232. };
  9233. }
  9234. Object.defineProperty(Vue, 'config', configDef);
  9235. // exposed util methods.
  9236. // NOTE: these are not considered part of the public API - avoid relying on
  9237. // them unless you are aware of the risk.
  9238. Vue.util = {
  9239. warn: warn,
  9240. extend: extend,
  9241. mergeOptions: mergeOptions,
  9242. defineReactive: defineReactive$$1
  9243. };
  9244. Vue.set = set;
  9245. Vue.delete = del;
  9246. Vue.nextTick = nextTick;
  9247. // 2.6 explicit observable API
  9248. Vue.observable = function (obj) {
  9249. observe(obj);
  9250. return obj
  9251. };
  9252. Vue.options = Object.create(null);
  9253. ASSET_TYPES.forEach(function (type) {
  9254. Vue.options[type + 's'] = Object.create(null);
  9255. });
  9256. // this is used to identify the "base" constructor to extend all plain-object
  9257. // components with in Weex's multi-instance scenarios.
  9258. Vue.options._base = Vue;
  9259. extend(Vue.options.components, builtInComponents);
  9260. initUse(Vue);
  9261. initMixin$1(Vue);
  9262. initExtend(Vue);
  9263. initAssetRegisters(Vue);
  9264. }
  9265. initGlobalAPI(Vue);
  9266. Object.defineProperty(Vue.prototype, '$isServer', {
  9267. get: isServerRendering
  9268. });
  9269. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9270. get: function get () {
  9271. /* istanbul ignore next */
  9272. return this.$vnode && this.$vnode.ssrContext
  9273. }
  9274. });
  9275. // expose FunctionalRenderContext for ssr runtime helper installation
  9276. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9277. value: FunctionalRenderContext
  9278. });
  9279. Vue.version = '2.6.11';
  9280. /**
  9281. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9282. */
  9283. var ARRAYTYPE = '[object Array]';
  9284. var OBJECTTYPE = '[object Object]';
  9285. // const FUNCTIONTYPE = '[object Function]'
  9286. function diff(current, pre) {
  9287. var result = {};
  9288. syncKeys(current, pre);
  9289. _diff(current, pre, '', result);
  9290. return result
  9291. }
  9292. function syncKeys(current, pre) {
  9293. if (current === pre) { return }
  9294. var rootCurrentType = type(current);
  9295. var rootPreType = type(pre);
  9296. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9297. if(Object.keys(current).length >= Object.keys(pre).length){
  9298. for (var key in pre) {
  9299. var currentValue = current[key];
  9300. if (currentValue === undefined) {
  9301. current[key] = null;
  9302. } else {
  9303. syncKeys(currentValue, pre[key]);
  9304. }
  9305. }
  9306. }
  9307. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9308. if (current.length >= pre.length) {
  9309. pre.forEach(function (item, index) {
  9310. syncKeys(current[index], item);
  9311. });
  9312. }
  9313. }
  9314. }
  9315. function _diff(current, pre, path, result) {
  9316. if (current === pre) { return }
  9317. var rootCurrentType = type(current);
  9318. var rootPreType = type(pre);
  9319. if (rootCurrentType == OBJECTTYPE) {
  9320. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9321. setResult(result, path, current);
  9322. } else {
  9323. var loop = function ( key ) {
  9324. var currentValue = current[key];
  9325. var preValue = pre[key];
  9326. var currentType = type(currentValue);
  9327. var preType = type(preValue);
  9328. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9329. if (currentValue != pre[key]) {
  9330. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9331. }
  9332. } else if (currentType == ARRAYTYPE) {
  9333. if (preType != ARRAYTYPE) {
  9334. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9335. } else {
  9336. if (currentValue.length < preValue.length) {
  9337. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9338. } else {
  9339. currentValue.forEach(function (item, index) {
  9340. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9341. });
  9342. }
  9343. }
  9344. } else if (currentType == OBJECTTYPE) {
  9345. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9346. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9347. } else {
  9348. for (var subKey in currentValue) {
  9349. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9350. }
  9351. }
  9352. }
  9353. };
  9354. for (var key in current) loop( key );
  9355. }
  9356. } else if (rootCurrentType == ARRAYTYPE) {
  9357. if (rootPreType != ARRAYTYPE) {
  9358. setResult(result, path, current);
  9359. } else {
  9360. if (current.length < pre.length) {
  9361. setResult(result, path, current);
  9362. } else {
  9363. current.forEach(function (item, index) {
  9364. _diff(item, pre[index], path + '[' + index + ']', result);
  9365. });
  9366. }
  9367. }
  9368. } else {
  9369. setResult(result, path, current);
  9370. }
  9371. }
  9372. function setResult(result, k, v) {
  9373. // if (type(v) != FUNCTIONTYPE) {
  9374. result[k] = v;
  9375. // }
  9376. }
  9377. function type(obj) {
  9378. return Object.prototype.toString.call(obj)
  9379. }
  9380. /* */
  9381. function flushCallbacks$1(vm) {
  9382. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9383. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"crmeb","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9384. var mpInstance = vm.$scope;
  9385. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9386. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9387. }
  9388. var copies = vm.__next_tick_callbacks.slice(0);
  9389. vm.__next_tick_callbacks.length = 0;
  9390. for (var i = 0; i < copies.length; i++) {
  9391. copies[i]();
  9392. }
  9393. }
  9394. }
  9395. function hasRenderWatcher(vm) {
  9396. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9397. }
  9398. function nextTick$1(vm, cb) {
  9399. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9400. //2.nextTick 之前存在 render watcher
  9401. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9402. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"crmeb","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9403. var mpInstance = vm.$scope;
  9404. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9405. ']:nextVueTick');
  9406. }
  9407. return nextTick(cb, vm)
  9408. }else{
  9409. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"crmeb","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9410. var mpInstance$1 = vm.$scope;
  9411. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9412. ']:nextMPTick');
  9413. }
  9414. }
  9415. var _resolve;
  9416. if (!vm.__next_tick_callbacks) {
  9417. vm.__next_tick_callbacks = [];
  9418. }
  9419. vm.__next_tick_callbacks.push(function () {
  9420. if (cb) {
  9421. try {
  9422. cb.call(vm);
  9423. } catch (e) {
  9424. handleError(e, vm, 'nextTick');
  9425. }
  9426. } else if (_resolve) {
  9427. _resolve(vm);
  9428. }
  9429. });
  9430. // $flow-disable-line
  9431. if (!cb && typeof Promise !== 'undefined') {
  9432. return new Promise(function (resolve) {
  9433. _resolve = resolve;
  9434. })
  9435. }
  9436. }
  9437. /* */
  9438. function cloneWithData(vm) {
  9439. // 确保当前 vm 所有数据被同步
  9440. var ret = Object.create(null);
  9441. var dataKeys = [].concat(
  9442. Object.keys(vm._data || {}),
  9443. Object.keys(vm._computedWatchers || {}));
  9444. dataKeys.reduce(function(ret, key) {
  9445. ret[key] = vm[key];
  9446. return ret
  9447. }, ret);
  9448. // vue-composition-api
  9449. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9450. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9451. if (rawBindings) {
  9452. Object.keys(rawBindings).forEach(function (key) {
  9453. ret[key] = vm[key];
  9454. });
  9455. }
  9456. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9457. Object.assign(ret, vm.$mp.data || {});
  9458. if (
  9459. Array.isArray(vm.$options.behaviors) &&
  9460. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9461. ) { //form-field
  9462. ret['name'] = vm.name;
  9463. ret['value'] = vm.value;
  9464. }
  9465. return JSON.parse(JSON.stringify(ret))
  9466. }
  9467. var patch = function(oldVnode, vnode) {
  9468. var this$1 = this;
  9469. if (vnode === null) { //destroy
  9470. return
  9471. }
  9472. if (this.mpType === 'page' || this.mpType === 'component') {
  9473. var mpInstance = this.$scope;
  9474. var data = Object.create(null);
  9475. try {
  9476. data = cloneWithData(this);
  9477. } catch (err) {
  9478. console.error(err);
  9479. }
  9480. data.__webviewId__ = mpInstance.data.__webviewId__;
  9481. var mpData = Object.create(null);
  9482. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9483. mpData[key] = mpInstance.data[key];
  9484. });
  9485. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9486. if (Object.keys(diffData).length) {
  9487. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"crmeb","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9488. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9489. ']差量更新',
  9490. JSON.stringify(diffData));
  9491. }
  9492. this.__next_tick_pending = true;
  9493. mpInstance.setData(diffData, function () {
  9494. this$1.__next_tick_pending = false;
  9495. flushCallbacks$1(this$1);
  9496. });
  9497. } else {
  9498. flushCallbacks$1(this);
  9499. }
  9500. }
  9501. };
  9502. /* */
  9503. function createEmptyRender() {
  9504. }
  9505. function mountComponent$1(
  9506. vm,
  9507. el,
  9508. hydrating
  9509. ) {
  9510. if (!vm.mpType) {//main.js 中的 new Vue
  9511. return vm
  9512. }
  9513. if (vm.mpType === 'app') {
  9514. vm.$options.render = createEmptyRender;
  9515. }
  9516. if (!vm.$options.render) {
  9517. vm.$options.render = createEmptyRender;
  9518. if (true) {
  9519. /* istanbul ignore if */
  9520. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9521. vm.$options.el || el) {
  9522. warn(
  9523. 'You are using the runtime-only build of Vue where the template ' +
  9524. 'compiler is not available. Either pre-compile the templates into ' +
  9525. 'render functions, or use the compiler-included build.',
  9526. vm
  9527. );
  9528. } else {
  9529. warn(
  9530. 'Failed to mount component: template or render function not defined.',
  9531. vm
  9532. );
  9533. }
  9534. }
  9535. }
  9536. !vm._$fallback && callHook(vm, 'beforeMount');
  9537. var updateComponent = function () {
  9538. vm._update(vm._render(), hydrating);
  9539. };
  9540. // we set this to vm._watcher inside the watcher's constructor
  9541. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9542. // component's mounted hook), which relies on vm._watcher being already defined
  9543. new Watcher(vm, updateComponent, noop, {
  9544. before: function before() {
  9545. if (vm._isMounted && !vm._isDestroyed) {
  9546. callHook(vm, 'beforeUpdate');
  9547. }
  9548. }
  9549. }, true /* isRenderWatcher */);
  9550. hydrating = false;
  9551. return vm
  9552. }
  9553. /* */
  9554. function renderClass (
  9555. staticClass,
  9556. dynamicClass
  9557. ) {
  9558. if (isDef(staticClass) || isDef(dynamicClass)) {
  9559. return concat(staticClass, stringifyClass(dynamicClass))
  9560. }
  9561. /* istanbul ignore next */
  9562. return ''
  9563. }
  9564. function concat (a, b) {
  9565. return a ? b ? (a + ' ' + b) : a : (b || '')
  9566. }
  9567. function stringifyClass (value) {
  9568. if (Array.isArray(value)) {
  9569. return stringifyArray(value)
  9570. }
  9571. if (isObject(value)) {
  9572. return stringifyObject(value)
  9573. }
  9574. if (typeof value === 'string') {
  9575. return value
  9576. }
  9577. /* istanbul ignore next */
  9578. return ''
  9579. }
  9580. function stringifyArray (value) {
  9581. var res = '';
  9582. var stringified;
  9583. for (var i = 0, l = value.length; i < l; i++) {
  9584. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9585. if (res) { res += ' '; }
  9586. res += stringified;
  9587. }
  9588. }
  9589. return res
  9590. }
  9591. function stringifyObject (value) {
  9592. var res = '';
  9593. for (var key in value) {
  9594. if (value[key]) {
  9595. if (res) { res += ' '; }
  9596. res += key;
  9597. }
  9598. }
  9599. return res
  9600. }
  9601. /* */
  9602. var parseStyleText = cached(function (cssText) {
  9603. var res = {};
  9604. var listDelimiter = /;(?![^(]*\))/g;
  9605. var propertyDelimiter = /:(.+)/;
  9606. cssText.split(listDelimiter).forEach(function (item) {
  9607. if (item) {
  9608. var tmp = item.split(propertyDelimiter);
  9609. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9610. }
  9611. });
  9612. return res
  9613. });
  9614. // normalize possible array / string values into Object
  9615. function normalizeStyleBinding (bindingStyle) {
  9616. if (Array.isArray(bindingStyle)) {
  9617. return toObject(bindingStyle)
  9618. }
  9619. if (typeof bindingStyle === 'string') {
  9620. return parseStyleText(bindingStyle)
  9621. }
  9622. return bindingStyle
  9623. }
  9624. /* */
  9625. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9626. function getTarget(obj, path) {
  9627. var parts = path.split('.');
  9628. var key = parts[0];
  9629. if (key.indexOf('__$n') === 0) { //number index
  9630. key = parseInt(key.replace('__$n', ''));
  9631. }
  9632. if (parts.length === 1) {
  9633. return obj[key]
  9634. }
  9635. return getTarget(obj[key], parts.slice(1).join('.'))
  9636. }
  9637. function internalMixin(Vue) {
  9638. Vue.config.errorHandler = function(err, vm, info) {
  9639. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9640. console.error(err);
  9641. /* eslint-disable no-undef */
  9642. var app = getApp();
  9643. if (app && app.onError) {
  9644. app.onError(err);
  9645. }
  9646. };
  9647. var oldEmit = Vue.prototype.$emit;
  9648. Vue.prototype.$emit = function(event) {
  9649. if (this.$scope && event) {
  9650. this.$scope['triggerEvent'](event, {
  9651. __args__: toArray(arguments, 1)
  9652. });
  9653. }
  9654. return oldEmit.apply(this, arguments)
  9655. };
  9656. Vue.prototype.$nextTick = function(fn) {
  9657. return nextTick$1(this, fn)
  9658. };
  9659. MP_METHODS.forEach(function (method) {
  9660. Vue.prototype[method] = function(args) {
  9661. if (this.$scope && this.$scope[method]) {
  9662. return this.$scope[method](args)
  9663. }
  9664. // mp-alipay
  9665. if (typeof my === 'undefined') {
  9666. return
  9667. }
  9668. if (method === 'createSelectorQuery') {
  9669. /* eslint-disable no-undef */
  9670. return my.createSelectorQuery(args)
  9671. } else if (method === 'createIntersectionObserver') {
  9672. /* eslint-disable no-undef */
  9673. return my.createIntersectionObserver(args)
  9674. }
  9675. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9676. };
  9677. });
  9678. Vue.prototype.__init_provide = initProvide;
  9679. Vue.prototype.__init_injections = initInjections;
  9680. Vue.prototype.__call_hook = function(hook, args) {
  9681. var vm = this;
  9682. // #7573 disable dep collection when invoking lifecycle hooks
  9683. pushTarget();
  9684. var handlers = vm.$options[hook];
  9685. var info = hook + " hook";
  9686. var ret;
  9687. if (handlers) {
  9688. for (var i = 0, j = handlers.length; i < j; i++) {
  9689. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9690. }
  9691. }
  9692. if (vm._hasHookEvent) {
  9693. vm.$emit('hook:' + hook, args);
  9694. }
  9695. popTarget();
  9696. return ret
  9697. };
  9698. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9699. if (Array.isArray(modifiers)) {
  9700. if (modifiers.indexOf('trim') !== -1) {
  9701. value = value.trim();
  9702. }
  9703. if (modifiers.indexOf('number') !== -1) {
  9704. value = this._n(value);
  9705. }
  9706. }
  9707. if (!target) {
  9708. target = this;
  9709. }
  9710. target[key] = value;
  9711. };
  9712. Vue.prototype.__set_sync = function(target, key, value) {
  9713. if (!target) {
  9714. target = this;
  9715. }
  9716. target[key] = value;
  9717. };
  9718. Vue.prototype.__get_orig = function(item) {
  9719. if (isPlainObject(item)) {
  9720. return item['$orig'] || item
  9721. }
  9722. return item
  9723. };
  9724. Vue.prototype.__get_value = function(dataPath, target) {
  9725. return getTarget(target || this, dataPath)
  9726. };
  9727. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9728. return renderClass(staticClass, dynamicClass)
  9729. };
  9730. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9731. if (!dynamicStyle && !staticStyle) {
  9732. return ''
  9733. }
  9734. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9735. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9736. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9737. };
  9738. Vue.prototype.__map = function(val, iteratee) {
  9739. //TODO 暂不考虑 string
  9740. var ret, i, l, keys, key;
  9741. if (Array.isArray(val)) {
  9742. ret = new Array(val.length);
  9743. for (i = 0, l = val.length; i < l; i++) {
  9744. ret[i] = iteratee(val[i], i);
  9745. }
  9746. return ret
  9747. } else if (isObject(val)) {
  9748. keys = Object.keys(val);
  9749. ret = Object.create(null);
  9750. for (i = 0, l = keys.length; i < l; i++) {
  9751. key = keys[i];
  9752. ret[key] = iteratee(val[key], key, i);
  9753. }
  9754. return ret
  9755. } else if (typeof val === 'number') {
  9756. ret = new Array(val);
  9757. for (i = 0, l = val; i < l; i++) {
  9758. // 第一个参数暂时仍和小程序一致
  9759. ret[i] = iteratee(i, i);
  9760. }
  9761. return ret
  9762. }
  9763. return []
  9764. };
  9765. }
  9766. /* */
  9767. var LIFECYCLE_HOOKS$1 = [
  9768. //App
  9769. 'onLaunch',
  9770. 'onShow',
  9771. 'onHide',
  9772. 'onUniNViewMessage',
  9773. 'onPageNotFound',
  9774. 'onThemeChange',
  9775. 'onError',
  9776. 'onUnhandledRejection',
  9777. //Page
  9778. 'onInit',
  9779. 'onLoad',
  9780. // 'onShow',
  9781. 'onReady',
  9782. // 'onHide',
  9783. 'onUnload',
  9784. 'onPullDownRefresh',
  9785. 'onReachBottom',
  9786. 'onTabItemTap',
  9787. 'onAddToFavorites',
  9788. 'onShareTimeline',
  9789. 'onShareAppMessage',
  9790. 'onResize',
  9791. 'onPageScroll',
  9792. 'onNavigationBarButtonTap',
  9793. 'onBackPress',
  9794. 'onNavigationBarSearchInputChanged',
  9795. 'onNavigationBarSearchInputConfirmed',
  9796. 'onNavigationBarSearchInputClicked',
  9797. //Component
  9798. // 'onReady', // 兼容旧版本,应该移除该事件
  9799. 'onPageShow',
  9800. 'onPageHide',
  9801. 'onPageResize'
  9802. ];
  9803. function lifecycleMixin$1(Vue) {
  9804. //fixed vue-class-component
  9805. var oldExtend = Vue.extend;
  9806. Vue.extend = function(extendOptions) {
  9807. extendOptions = extendOptions || {};
  9808. var methods = extendOptions.methods;
  9809. if (methods) {
  9810. Object.keys(methods).forEach(function (methodName) {
  9811. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9812. extendOptions[methodName] = methods[methodName];
  9813. delete methods[methodName];
  9814. }
  9815. });
  9816. }
  9817. return oldExtend.call(this, extendOptions)
  9818. };
  9819. var strategies = Vue.config.optionMergeStrategies;
  9820. var mergeHook = strategies.created;
  9821. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9822. strategies[hook] = mergeHook;
  9823. });
  9824. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9825. }
  9826. /* */
  9827. // install platform patch function
  9828. Vue.prototype.__patch__ = patch;
  9829. // public mount method
  9830. Vue.prototype.$mount = function(
  9831. el ,
  9832. hydrating
  9833. ) {
  9834. return mountComponent$1(this, el, hydrating)
  9835. };
  9836. lifecycleMixin$1(Vue);
  9837. internalMixin(Vue);
  9838. /* */
  9839. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9840. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9841. /***/ }),
  9842. /***/ 21:
  9843. /*!**********************************************************************************************************!*\
  9844. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9845. \**********************************************************************************************************/
  9846. /*! exports provided: default */
  9847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9848. "use strict";
  9849. __webpack_require__.r(__webpack_exports__);
  9850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9851. /* globals __VUE_SSR_CONTEXT__ */
  9852. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9853. // This module is a runtime utility for cleaner component module output and will
  9854. // be included in the final webpack user bundle.
  9855. function normalizeComponent (
  9856. scriptExports,
  9857. render,
  9858. staticRenderFns,
  9859. functionalTemplate,
  9860. injectStyles,
  9861. scopeId,
  9862. moduleIdentifier, /* server only */
  9863. shadowMode, /* vue-cli only */
  9864. components, // fixed by xxxxxx auto components
  9865. renderjs // fixed by xxxxxx renderjs
  9866. ) {
  9867. // Vue.extend constructor export interop
  9868. var options = typeof scriptExports === 'function'
  9869. ? scriptExports.options
  9870. : scriptExports
  9871. // fixed by xxxxxx auto components
  9872. if (components) {
  9873. if (!options.components) {
  9874. options.components = {}
  9875. }
  9876. var hasOwn = Object.prototype.hasOwnProperty
  9877. for (var name in components) {
  9878. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9879. options.components[name] = components[name]
  9880. }
  9881. }
  9882. }
  9883. // fixed by xxxxxx renderjs
  9884. if (renderjs) {
  9885. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9886. this[renderjs.__module] = this
  9887. });
  9888. (options.mixins || (options.mixins = [])).push(renderjs)
  9889. }
  9890. // render functions
  9891. if (render) {
  9892. options.render = render
  9893. options.staticRenderFns = staticRenderFns
  9894. options._compiled = true
  9895. }
  9896. // functional template
  9897. if (functionalTemplate) {
  9898. options.functional = true
  9899. }
  9900. // scopedId
  9901. if (scopeId) {
  9902. options._scopeId = 'data-v-' + scopeId
  9903. }
  9904. var hook
  9905. if (moduleIdentifier) { // server build
  9906. hook = function (context) {
  9907. // 2.3 injection
  9908. context =
  9909. context || // cached call
  9910. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9911. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9912. // 2.2 with runInNewContext: true
  9913. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9914. context = __VUE_SSR_CONTEXT__
  9915. }
  9916. // inject component styles
  9917. if (injectStyles) {
  9918. injectStyles.call(this, context)
  9919. }
  9920. // register component module identifier for async chunk inferrence
  9921. if (context && context._registeredComponents) {
  9922. context._registeredComponents.add(moduleIdentifier)
  9923. }
  9924. }
  9925. // used by ssr in case component is cached and beforeCreate
  9926. // never gets called
  9927. options._ssrRegister = hook
  9928. } else if (injectStyles) {
  9929. hook = shadowMode
  9930. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9931. : injectStyles
  9932. }
  9933. if (hook) {
  9934. if (options.functional) {
  9935. // for template-only hot-reload because in that case the render fn doesn't
  9936. // go through the normalizer
  9937. options._injectStyles = hook
  9938. // register for functioal component in vue file
  9939. var originalRender = options.render
  9940. options.render = function renderWithStyleInjection (h, context) {
  9941. hook.call(context)
  9942. return originalRender(h, context)
  9943. }
  9944. } else {
  9945. // inject component registration as beforeCreate hook
  9946. var existing = options.beforeCreate
  9947. options.beforeCreate = existing
  9948. ? [].concat(existing, hook)
  9949. : [hook]
  9950. }
  9951. }
  9952. return {
  9953. exports: scriptExports,
  9954. options: options
  9955. }
  9956. }
  9957. /***/ }),
  9958. /***/ 22:
  9959. /*!***********************************!*\
  9960. !*** E:/飞播代码/lipin/utils/util.js ***!
  9961. \***********************************/
  9962. /*! no static exports found */
  9963. /***/ (function(module, exports, __webpack_require__) {
  9964. "use strict";
  9965. /* 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 */ 23));var _app = __webpack_require__(/*! ../config/app.js */ 15);
  9966. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 9));
  9967. var _index = __webpack_require__(/*! @/plugin/image-tools/index.js */ 26);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);});};}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 _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 _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;}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;}var _default =
  9968. {
  9969. /**
  9970. * opt object | string
  9971. * to_url object | string
  9972. * 例:
  9973. * this.Tips('/pages/test/test'); 跳转不提示
  9974. * this.Tips({title:'提示'},'/pages/test/test'); 提示并跳转
  9975. * this.Tips({title:'提示'},{tab:1,url:'/pages/index/index'}); 提示并跳转值table上
  9976. * tab=1 一定时间后跳转至 table上
  9977. * tab=2 一定时间后跳转至非 table上
  9978. * tab=3 一定时间后返回上页面
  9979. * tab=4 关闭所有页面跳转至非table上
  9980. * tab=5 关闭当前页面跳转至table上
  9981. */
  9982. Tips: function Tips(opt, to_url) {
  9983. if (typeof opt == 'string') {
  9984. to_url = opt;
  9985. opt = {};
  9986. }
  9987. var title = opt.title || '',
  9988. icon = opt.icon || 'none',
  9989. endtime = opt.endtime || 2000,
  9990. success = opt.success;
  9991. if (title) uni.showToast({
  9992. title: title,
  9993. icon: icon,
  9994. duration: endtime,
  9995. success: success });
  9996. if (to_url != undefined) {
  9997. if (typeof to_url == 'object') {
  9998. var tab = to_url.tab || 1,
  9999. url = to_url.url || '';
  10000. switch (tab) {
  10001. case 1:
  10002. //一定时间后跳转至 table
  10003. setTimeout(function () {
  10004. uni.switchTab({
  10005. url: url });
  10006. }, endtime);
  10007. break;
  10008. case 2:
  10009. //跳转至非table页面
  10010. setTimeout(function () {
  10011. uni.navigateTo({
  10012. url: url });
  10013. }, endtime);
  10014. break;
  10015. case 3:
  10016. //返回上页面
  10017. setTimeout(function () {
  10018. uni.navigateBack({
  10019. delta: parseInt(url) });
  10020. }, endtime);
  10021. break;
  10022. case 4:
  10023. //关闭当前所有页面跳转至非table页面
  10024. setTimeout(function () {
  10025. uni.reLaunch({
  10026. url: url });
  10027. }, endtime);
  10028. break;
  10029. case 5:
  10030. //关闭当前页面跳转至非table页面
  10031. setTimeout(function () {
  10032. uni.redirectTo({
  10033. url: url });
  10034. }, endtime);
  10035. break;}
  10036. } else if (typeof to_url == 'function') {
  10037. setTimeout(function () {
  10038. to_url && to_url();
  10039. }, endtime);
  10040. } else {
  10041. //没有提示时跳转不延迟
  10042. setTimeout(function () {
  10043. uni.navigateTo({
  10044. url: to_url });
  10045. }, title ? endtime : 0);
  10046. }
  10047. }
  10048. },
  10049. /**
  10050. * 移除数组中的某个数组并组成新的数组返回
  10051. * @param array array 需要移除的数组
  10052. * @param int index 需要移除的数组的键值
  10053. * @param string | int 值
  10054. * @return array
  10055. *
  10056. */
  10057. ArrayRemove: function ArrayRemove(array, index, value) {
  10058. var valueArray = [];
  10059. if (array instanceof Array) {
  10060. for (var i = 0; i < array.length; i++) {
  10061. if (typeof index == 'number' && array[index] != i) {
  10062. valueArray.push(array[i]);
  10063. } else if (typeof index == 'string' && array[i][index] != value) {
  10064. valueArray.push(array[i]);
  10065. }
  10066. }
  10067. }
  10068. return valueArray;
  10069. },
  10070. /**
  10071. * 生成海报获取文字
  10072. * @param string text 为传入的文本
  10073. * @param int num 为单行显示的字节长度
  10074. * @return array
  10075. */
  10076. textByteLength: function textByteLength(text, num) {
  10077. var strLength = 0;
  10078. var rows = 1;
  10079. var str = 0;
  10080. var arr = [];
  10081. for (var j = 0; j < text.length; j++) {
  10082. if (text.charCodeAt(j) > 255) {
  10083. strLength += 2;
  10084. if (strLength > rows * num) {
  10085. strLength++;
  10086. arr.push(text.slice(str, j));
  10087. str = j;
  10088. rows++;
  10089. }
  10090. } else {
  10091. strLength++;
  10092. if (strLength > rows * num) {
  10093. arr.push(text.slice(str, j));
  10094. str = j;
  10095. rows++;
  10096. }
  10097. }
  10098. }
  10099. arr.push(text.slice(str, text.length));
  10100. return [strLength, arr, rows]; // [处理文字的总字节长度,每行显示内容的数组,行数]
  10101. },
  10102. /**
  10103. * 获取分享海报
  10104. * @param array arr2 海报素材
  10105. * @param string store_name 素材文字
  10106. * @param string price 价格
  10107. * @param function successFn 回调函数
  10108. *
  10109. *
  10110. */
  10111. PosterCanvas: function PosterCanvas(arr2, store_name, price, successFn) {
  10112. var that = this;
  10113. uni.showLoading({
  10114. title: '海报生成中',
  10115. mask: true });
  10116. var ctx = uni.createCanvasContext('myCanvas');
  10117. ctx.clearRect(0, 0, 0, 0);
  10118. /**
  10119. * 只能获取合法域名下的图片信息,本地调试无法获取
  10120. *
  10121. */
  10122. uni.getImageInfo({
  10123. src: arr2[0],
  10124. success: function success(res) {
  10125. console.log(res, 'getImageInfo');
  10126. var WIDTH = res.width;
  10127. var HEIGHT = res.height;
  10128. ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
  10129. ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
  10130. ctx.save();
  10131. var r = 90;
  10132. var d = r * 2;
  10133. var cx = 40;
  10134. var cy = 990;
  10135. ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
  10136. // ctx.clip();
  10137. ctx.drawImage(arr2[2], cx, cy, d, d);
  10138. ctx.restore();
  10139. var CONTENT_ROW_LENGTH = 40;var _that$textByteLength =
  10140. that.textByteLength(store_name, CONTENT_ROW_LENGTH),_that$textByteLength2 = _slicedToArray(_that$textByteLength, 3),contentLeng = _that$textByteLength2[0],contentArray = _that$textByteLength2[1],contentRows = _that$textByteLength2[2];
  10141. if (contentRows > 2) {
  10142. contentRows = 2;
  10143. var textArray = contentArray.slice(0, 2);
  10144. textArray[textArray.length - 1] += '……';
  10145. contentArray = textArray;
  10146. }
  10147. ctx.setTextAlign('center');
  10148. ctx.setFontSize(32);
  10149. var contentHh = 32 * 1.3;
  10150. for (var m = 0; m < contentArray.length; m++) {
  10151. ctx.fillText(contentArray[m], WIDTH / 2, 820 + contentHh * m);
  10152. }
  10153. ctx.setTextAlign('center');
  10154. ctx.setFontSize(48);
  10155. ctx.setFillStyle('red');
  10156. ctx.fillText('¥' + price, WIDTH / 2, 880 + contentHh);
  10157. ctx.draw(true, function () {
  10158. uni.canvasToTempFilePath({
  10159. canvasId: 'myCanvas',
  10160. fileType: 'png',
  10161. destWidth: WIDTH,
  10162. destHeight: HEIGHT,
  10163. success: function success(res) {
  10164. uni.hideLoading();
  10165. successFn && successFn(res.tempFilePath);
  10166. } });
  10167. });
  10168. },
  10169. fail: function fail(err) {
  10170. uni.hideLoading();
  10171. that.Tips({
  10172. title: '无法获取图片信息' });
  10173. } });
  10174. },
  10175. /*
  10176. * 单图上传
  10177. * @param object opt
  10178. * @param callable successCallback 成功执行方法 data
  10179. * @param callable errorCallback 失败执行方法
  10180. */
  10181. uploadImageOne: function uploadImageOne(opt, successCallback, errorCallback) {
  10182. var that = this;
  10183. if (typeof opt === 'string') {
  10184. var url = opt;
  10185. opt = {};
  10186. opt.url = url;
  10187. }
  10188. var count = opt.count || 1,
  10189. sizeType = opt.sizeType || ['compressed'],
  10190. sourceType = opt.sourceType || ['album', 'camera'],
  10191. is_load = opt.is_load || true,
  10192. uploadUrl = opt.url || '',
  10193. inputName = opt.name || 'pics';
  10194. uni.chooseImage({
  10195. count: count, //最多可以选择的图片总数
  10196. sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
  10197. sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
  10198. success: function success(res) {
  10199. console.log();
  10200. //启动上传等待中...
  10201. uni.showLoading({
  10202. title: '图片上传中' });
  10203. uni.uploadFile({
  10204. url: _app.HTTP_REQUEST_URL + '/api/' + uploadUrl,
  10205. filePath: res.tempFilePaths[0],
  10206. name: 'file',
  10207. formData: {
  10208. 'filename': inputName },
  10209. header: {
  10210. "Content-Type": "multipart/form-data",
  10211. "secret-key": "b1bd7a4b8da3e47ce58e73b9e5f656c4" },
  10212. success: function success(res) {
  10213. uni.hideLoading();
  10214. if (res.statusCode == 403) {
  10215. that.Tips({
  10216. title: res.data });
  10217. } else {
  10218. var data = res.data ? JSON.parse(res.data) : {};
  10219. if (data.code == 200) {
  10220. successCallback && successCallback(data);
  10221. } else {
  10222. errorCallback && errorCallback(data);
  10223. that.Tips({
  10224. title: data.msg });
  10225. }
  10226. }
  10227. },
  10228. fail: function fail(res) {
  10229. uni.hideLoading();
  10230. that.Tips({
  10231. title: '上传图片失败' });
  10232. } });
  10233. // pathToBase64(res.tempFilePaths[0])
  10234. // .then(imgBase64 => {
  10235. // console.log(imgBase64);
  10236. // })
  10237. // .catch(error => {
  10238. // console.error(error)
  10239. // })
  10240. } });
  10241. },
  10242. /**
  10243. * 处理服务器扫码带进来的参数
  10244. * @param string param 扫码携带参数
  10245. * @param string k 整体分割符 默认为:&
  10246. * @param string p 单个分隔符 默认为:=
  10247. * @return object
  10248. *
  10249. */
  10250. getUrlParams: function getUrlParams(param, k, p) {
  10251. if (typeof param != 'string') return {};
  10252. k = k ? k : '&'; //整体参数分隔符
  10253. p = p ? p : '='; //单个参数分隔符
  10254. var value = {};
  10255. if (param.indexOf(k) !== -1) {
  10256. param = param.split(k);
  10257. for (var val in param) {
  10258. if (param[val].indexOf(p) !== -1) {
  10259. var item = param[val].split(p);
  10260. value[item[0]] = item[1];
  10261. }
  10262. }
  10263. } else if (param.indexOf(p) !== -1) {
  10264. var item = param.split(p);
  10265. value[item[0]] = item[1];
  10266. } else {
  10267. return param;
  10268. }
  10269. return value;
  10270. },
  10271. /*
  10272. * 合并数组
  10273. */
  10274. SplitArray: function SplitArray(list, sp) {
  10275. if (typeof list != 'object') return [];
  10276. if (sp === undefined) sp = [];
  10277. for (var i = 0; i < list.length; i++) {
  10278. sp.push(list[i]);
  10279. }
  10280. return sp;
  10281. },
  10282. trim: function trim(str) {
  10283. return String.prototype.trim.call(str);
  10284. },
  10285. $h: {
  10286. //除法函数,用来得到精确的除法结果
  10287. //说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
  10288. //调用:$h.Div(arg1,arg2)
  10289. //返回值:arg1除以arg2的精确结果
  10290. Div: function Div(arg1, arg2) {
  10291. arg1 = parseFloat(arg1);
  10292. arg2 = parseFloat(arg2);
  10293. var t1 = 0,
  10294. t2 = 0,
  10295. r1,r2;
  10296. try {
  10297. t1 = arg1.toString().split(".")[1].length;
  10298. } catch (e) {}
  10299. try {
  10300. t2 = arg2.toString().split(".")[1].length;
  10301. } catch (e) {}
  10302. r1 = Number(arg1.toString().replace(".", ""));
  10303. r2 = Number(arg2.toString().replace(".", ""));
  10304. return this.Mul(r1 / r2, Math.pow(10, t2 - t1));
  10305. },
  10306. //加法函数,用来得到精确的加法结果
  10307. //说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
  10308. //调用:$h.Add(arg1,arg2)
  10309. //返回值:arg1加上arg2的精确结果
  10310. Add: function Add(arg1, arg2) {
  10311. arg2 = parseFloat(arg2);
  10312. var r1, r2, m;
  10313. try {
  10314. r1 = arg1.toString().split(".")[1].length;
  10315. } catch (e) {
  10316. r1 = 0;
  10317. }
  10318. try {
  10319. r2 = arg2.toString().split(".")[1].length;
  10320. } catch (e) {
  10321. r2 = 0;
  10322. }
  10323. m = Math.pow(100, Math.max(r1, r2));
  10324. return (this.Mul(arg1, m) + this.Mul(arg2, m)) / m;
  10325. },
  10326. //减法函数,用来得到精确的减法结果
  10327. //说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的减法结果。
  10328. //调用:$h.Sub(arg1,arg2)
  10329. //返回值:arg1减去arg2的精确结果
  10330. Sub: function Sub(arg1, arg2) {
  10331. arg1 = parseFloat(arg1);
  10332. arg2 = parseFloat(arg2);
  10333. var r1, r2, m, n;
  10334. try {
  10335. r1 = arg1.toString().split(".")[1].length;
  10336. } catch (e) {
  10337. r1 = 0;
  10338. }
  10339. try {
  10340. r2 = arg2.toString().split(".")[1].length;
  10341. } catch (e) {
  10342. r2 = 0;
  10343. }
  10344. m = Math.pow(10, Math.max(r1, r2));
  10345. //动态控制精度长度
  10346. n = r1 >= r2 ? r1 : r2;
  10347. return ((this.Mul(arg1, m) - this.Mul(arg2, m)) / m).toFixed(n);
  10348. },
  10349. //乘法函数,用来得到精确的乘法结果
  10350. //说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
  10351. //调用:$h.Mul(arg1,arg2)
  10352. //返回值:arg1乘以arg2的精确结果
  10353. Mul: function Mul(arg1, arg2) {
  10354. arg1 = parseFloat(arg1);
  10355. arg2 = parseFloat(arg2);
  10356. var m = 0,
  10357. s1 = arg1.toString(),
  10358. s2 = arg2.toString();
  10359. try {
  10360. m += s1.split(".")[1].length;
  10361. } catch (e) {}
  10362. try {
  10363. m += s2.split(".")[1].length;
  10364. } catch (e) {}
  10365. return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
  10366. } },
  10367. // 获取地理位置;
  10368. $L: {
  10369. getLocation: function getLocation() {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var status;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  10370. _this.getSetting());case 2:status = _context.sent;if (!(
  10371. status === 2)) {_context.next = 6;break;}
  10372. _this.openSetting();return _context.abrupt("return");case 6:
  10373. _this.doGetLocation();case 7:case "end":return _context.stop();}}}, _callee);}))();
  10374. },
  10375. doGetLocation: function doGetLocation() {
  10376. uni.getLocation({
  10377. success: function success(res) {
  10378. uni.removeStorageSync('CACHE_LONGITUDE');
  10379. uni.removeStorageSync('CACHE_LATITUDE');
  10380. uni.setStorageSync('CACHE_LONGITUDE', res.longitude);
  10381. uni.setStorageSync('CACHE_LATITUDE', res.latitude);
  10382. },
  10383. fail: function fail(err) {
  10384. if (err.errMsg.indexOf("auth deny") >= 0) {
  10385. uni.showToast({
  10386. title: "访问位置被拒绝" });
  10387. } else {
  10388. uni.showToast({
  10389. title: err.errMsg });
  10390. }
  10391. } });
  10392. },
  10393. getSetting: function getSetting() {
  10394. return new Promise(function (resolve, reject) {
  10395. uni.getSetting({
  10396. success: function success(res) {
  10397. if (res.authSetting['scope.userLocation'] === undefined) {
  10398. resolve(0);
  10399. return;
  10400. }
  10401. if (res.authSetting['scope.userLocation']) {
  10402. resolve(1);
  10403. } else {
  10404. resolve(2);
  10405. }
  10406. } });
  10407. });
  10408. },
  10409. openSetting: function openSetting() {var _this2 = this;
  10410. uni.openSetting({
  10411. success: function success(res) {
  10412. if (res.authSetting && res.authSetting['scope.userLocation']) {
  10413. _this2.doGetLocation();
  10414. }
  10415. },
  10416. fail: function fail(err) {} });
  10417. },
  10418. checkPermission: function checkPermission() {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var status;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:if (!
  10419. permision.isIOS) {_context2.next = 6;break;}_context2.next = 3;return permision.requestIOS('location');case 3:_context2.t0 = _context2.sent;_context2.next = 9;break;case 6:_context2.next = 8;return (
  10420. permision.requestAndroid('android.permission.ACCESS_FINE_LOCATION'));case 8:_context2.t0 = _context2.sent;case 9:status = _context2.t0;
  10421. if (status === null || status === 1) {
  10422. status = 1;
  10423. } else if (status === 2) {
  10424. uni.showModal({
  10425. content: "系统定位已关闭",
  10426. confirmText: "确定",
  10427. showCancel: false,
  10428. success: function success(res) {} });
  10429. } else if (status.code) {
  10430. uni.showModal({
  10431. content: status.message });
  10432. } else {
  10433. uni.showModal({
  10434. content: "需要定位权限",
  10435. confirmText: "设置",
  10436. success: function success(res) {
  10437. if (res.confirm) {
  10438. permision.gotoAppSetting();
  10439. }
  10440. } });
  10441. }return _context2.abrupt("return",
  10442. status);case 12:case "end":return _context2.stop();}}}, _callee2);}))();
  10443. } } };exports.default = _default;
  10444. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10445. /***/ }),
  10446. /***/ 23:
  10447. /*!**********************************************************!*\
  10448. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  10449. \**********************************************************/
  10450. /*! no static exports found */
  10451. /***/ (function(module, exports, __webpack_require__) {
  10452. module.exports = __webpack_require__(/*! regenerator-runtime */ 24);
  10453. /***/ }),
  10454. /***/ 24:
  10455. /*!************************************************************!*\
  10456. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  10457. \************************************************************/
  10458. /*! no static exports found */
  10459. /***/ (function(module, exports, __webpack_require__) {
  10460. /**
  10461. * Copyright (c) 2014-present, Facebook, Inc.
  10462. *
  10463. * This source code is licensed under the MIT license found in the
  10464. * LICENSE file in the root directory of this source tree.
  10465. */
  10466. // This method of obtaining a reference to the global object needs to be
  10467. // kept identical to the way it is obtained in runtime.js
  10468. var g = (function() {
  10469. return this || (typeof self === "object" && self);
  10470. })() || Function("return this")();
  10471. // Use `getOwnPropertyNames` because not all browsers support calling
  10472. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  10473. var hadRuntime = g.regeneratorRuntime &&
  10474. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  10475. // Save the old regeneratorRuntime in case it needs to be restored later.
  10476. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  10477. // Force reevalutation of runtime.js.
  10478. g.regeneratorRuntime = undefined;
  10479. module.exports = __webpack_require__(/*! ./runtime */ 25);
  10480. if (hadRuntime) {
  10481. // Restore the original runtime.
  10482. g.regeneratorRuntime = oldRuntime;
  10483. } else {
  10484. // Remove the global property added by runtime.js.
  10485. try {
  10486. delete g.regeneratorRuntime;
  10487. } catch(e) {
  10488. g.regeneratorRuntime = undefined;
  10489. }
  10490. }
  10491. /***/ }),
  10492. /***/ 25:
  10493. /*!*****************************************************!*\
  10494. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  10495. \*****************************************************/
  10496. /*! no static exports found */
  10497. /***/ (function(module, exports) {
  10498. /**
  10499. * Copyright (c) 2014-present, Facebook, Inc.
  10500. *
  10501. * This source code is licensed under the MIT license found in the
  10502. * LICENSE file in the root directory of this source tree.
  10503. */
  10504. !(function(global) {
  10505. "use strict";
  10506. var Op = Object.prototype;
  10507. var hasOwn = Op.hasOwnProperty;
  10508. var undefined; // More compressible than void 0.
  10509. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  10510. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  10511. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  10512. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  10513. var inModule = typeof module === "object";
  10514. var runtime = global.regeneratorRuntime;
  10515. if (runtime) {
  10516. if (inModule) {
  10517. // If regeneratorRuntime is defined globally and we're in a module,
  10518. // make the exports object identical to regeneratorRuntime.
  10519. module.exports = runtime;
  10520. }
  10521. // Don't bother evaluating the rest of this file if the runtime was
  10522. // already defined globally.
  10523. return;
  10524. }
  10525. // Define the runtime globally (as expected by generated code) as either
  10526. // module.exports (if we're in a module) or a new, empty object.
  10527. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  10528. function wrap(innerFn, outerFn, self, tryLocsList) {
  10529. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  10530. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  10531. var generator = Object.create(protoGenerator.prototype);
  10532. var context = new Context(tryLocsList || []);
  10533. // The ._invoke method unifies the implementations of the .next,
  10534. // .throw, and .return methods.
  10535. generator._invoke = makeInvokeMethod(innerFn, self, context);
  10536. return generator;
  10537. }
  10538. runtime.wrap = wrap;
  10539. // Try/catch helper to minimize deoptimizations. Returns a completion
  10540. // record like context.tryEntries[i].completion. This interface could
  10541. // have been (and was previously) designed to take a closure to be
  10542. // invoked without arguments, but in all the cases we care about we
  10543. // already have an existing method we want to call, so there's no need
  10544. // to create a new function object. We can even get away with assuming
  10545. // the method takes exactly one argument, since that happens to be true
  10546. // in every case, so we don't have to touch the arguments object. The
  10547. // only additional allocation required is the completion record, which
  10548. // has a stable shape and so hopefully should be cheap to allocate.
  10549. function tryCatch(fn, obj, arg) {
  10550. try {
  10551. return { type: "normal", arg: fn.call(obj, arg) };
  10552. } catch (err) {
  10553. return { type: "throw", arg: err };
  10554. }
  10555. }
  10556. var GenStateSuspendedStart = "suspendedStart";
  10557. var GenStateSuspendedYield = "suspendedYield";
  10558. var GenStateExecuting = "executing";
  10559. var GenStateCompleted = "completed";
  10560. // Returning this object from the innerFn has the same effect as
  10561. // breaking out of the dispatch switch statement.
  10562. var ContinueSentinel = {};
  10563. // Dummy constructor functions that we use as the .constructor and
  10564. // .constructor.prototype properties for functions that return Generator
  10565. // objects. For full spec compliance, you may wish to configure your
  10566. // minifier not to mangle the names of these two functions.
  10567. function Generator() {}
  10568. function GeneratorFunction() {}
  10569. function GeneratorFunctionPrototype() {}
  10570. // This is a polyfill for %IteratorPrototype% for environments that
  10571. // don't natively support it.
  10572. var IteratorPrototype = {};
  10573. IteratorPrototype[iteratorSymbol] = function () {
  10574. return this;
  10575. };
  10576. var getProto = Object.getPrototypeOf;
  10577. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  10578. if (NativeIteratorPrototype &&
  10579. NativeIteratorPrototype !== Op &&
  10580. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  10581. // This environment has a native %IteratorPrototype%; use it instead
  10582. // of the polyfill.
  10583. IteratorPrototype = NativeIteratorPrototype;
  10584. }
  10585. var Gp = GeneratorFunctionPrototype.prototype =
  10586. Generator.prototype = Object.create(IteratorPrototype);
  10587. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  10588. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  10589. GeneratorFunctionPrototype[toStringTagSymbol] =
  10590. GeneratorFunction.displayName = "GeneratorFunction";
  10591. // Helper for defining the .next, .throw, and .return methods of the
  10592. // Iterator interface in terms of a single ._invoke method.
  10593. function defineIteratorMethods(prototype) {
  10594. ["next", "throw", "return"].forEach(function(method) {
  10595. prototype[method] = function(arg) {
  10596. return this._invoke(method, arg);
  10597. };
  10598. });
  10599. }
  10600. runtime.isGeneratorFunction = function(genFun) {
  10601. var ctor = typeof genFun === "function" && genFun.constructor;
  10602. return ctor
  10603. ? ctor === GeneratorFunction ||
  10604. // For the native GeneratorFunction constructor, the best we can
  10605. // do is to check its .name property.
  10606. (ctor.displayName || ctor.name) === "GeneratorFunction"
  10607. : false;
  10608. };
  10609. runtime.mark = function(genFun) {
  10610. if (Object.setPrototypeOf) {
  10611. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  10612. } else {
  10613. genFun.__proto__ = GeneratorFunctionPrototype;
  10614. if (!(toStringTagSymbol in genFun)) {
  10615. genFun[toStringTagSymbol] = "GeneratorFunction";
  10616. }
  10617. }
  10618. genFun.prototype = Object.create(Gp);
  10619. return genFun;
  10620. };
  10621. // Within the body of any async function, `await x` is transformed to
  10622. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  10623. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  10624. // meant to be awaited.
  10625. runtime.awrap = function(arg) {
  10626. return { __await: arg };
  10627. };
  10628. function AsyncIterator(generator) {
  10629. function invoke(method, arg, resolve, reject) {
  10630. var record = tryCatch(generator[method], generator, arg);
  10631. if (record.type === "throw") {
  10632. reject(record.arg);
  10633. } else {
  10634. var result = record.arg;
  10635. var value = result.value;
  10636. if (value &&
  10637. typeof value === "object" &&
  10638. hasOwn.call(value, "__await")) {
  10639. return Promise.resolve(value.__await).then(function(value) {
  10640. invoke("next", value, resolve, reject);
  10641. }, function(err) {
  10642. invoke("throw", err, resolve, reject);
  10643. });
  10644. }
  10645. return Promise.resolve(value).then(function(unwrapped) {
  10646. // When a yielded Promise is resolved, its final value becomes
  10647. // the .value of the Promise<{value,done}> result for the
  10648. // current iteration.
  10649. result.value = unwrapped;
  10650. resolve(result);
  10651. }, function(error) {
  10652. // If a rejected Promise was yielded, throw the rejection back
  10653. // into the async generator function so it can be handled there.
  10654. return invoke("throw", error, resolve, reject);
  10655. });
  10656. }
  10657. }
  10658. var previousPromise;
  10659. function enqueue(method, arg) {
  10660. function callInvokeWithMethodAndArg() {
  10661. return new Promise(function(resolve, reject) {
  10662. invoke(method, arg, resolve, reject);
  10663. });
  10664. }
  10665. return previousPromise =
  10666. // If enqueue has been called before, then we want to wait until
  10667. // all previous Promises have been resolved before calling invoke,
  10668. // so that results are always delivered in the correct order. If
  10669. // enqueue has not been called before, then it is important to
  10670. // call invoke immediately, without waiting on a callback to fire,
  10671. // so that the async generator function has the opportunity to do
  10672. // any necessary setup in a predictable way. This predictability
  10673. // is why the Promise constructor synchronously invokes its
  10674. // executor callback, and why async functions synchronously
  10675. // execute code before the first await. Since we implement simple
  10676. // async functions in terms of async generators, it is especially
  10677. // important to get this right, even though it requires care.
  10678. previousPromise ? previousPromise.then(
  10679. callInvokeWithMethodAndArg,
  10680. // Avoid propagating failures to Promises returned by later
  10681. // invocations of the iterator.
  10682. callInvokeWithMethodAndArg
  10683. ) : callInvokeWithMethodAndArg();
  10684. }
  10685. // Define the unified helper method that is used to implement .next,
  10686. // .throw, and .return (see defineIteratorMethods).
  10687. this._invoke = enqueue;
  10688. }
  10689. defineIteratorMethods(AsyncIterator.prototype);
  10690. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  10691. return this;
  10692. };
  10693. runtime.AsyncIterator = AsyncIterator;
  10694. // Note that simple async functions are implemented on top of
  10695. // AsyncIterator objects; they just return a Promise for the value of
  10696. // the final result produced by the iterator.
  10697. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  10698. var iter = new AsyncIterator(
  10699. wrap(innerFn, outerFn, self, tryLocsList)
  10700. );
  10701. return runtime.isGeneratorFunction(outerFn)
  10702. ? iter // If outerFn is a generator, return the full iterator.
  10703. : iter.next().then(function(result) {
  10704. return result.done ? result.value : iter.next();
  10705. });
  10706. };
  10707. function makeInvokeMethod(innerFn, self, context) {
  10708. var state = GenStateSuspendedStart;
  10709. return function invoke(method, arg) {
  10710. if (state === GenStateExecuting) {
  10711. throw new Error("Generator is already running");
  10712. }
  10713. if (state === GenStateCompleted) {
  10714. if (method === "throw") {
  10715. throw arg;
  10716. }
  10717. // Be forgiving, per 25.3.3.3.3 of the spec:
  10718. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  10719. return doneResult();
  10720. }
  10721. context.method = method;
  10722. context.arg = arg;
  10723. while (true) {
  10724. var delegate = context.delegate;
  10725. if (delegate) {
  10726. var delegateResult = maybeInvokeDelegate(delegate, context);
  10727. if (delegateResult) {
  10728. if (delegateResult === ContinueSentinel) continue;
  10729. return delegateResult;
  10730. }
  10731. }
  10732. if (context.method === "next") {
  10733. // Setting context._sent for legacy support of Babel's
  10734. // function.sent implementation.
  10735. context.sent = context._sent = context.arg;
  10736. } else if (context.method === "throw") {
  10737. if (state === GenStateSuspendedStart) {
  10738. state = GenStateCompleted;
  10739. throw context.arg;
  10740. }
  10741. context.dispatchException(context.arg);
  10742. } else if (context.method === "return") {
  10743. context.abrupt("return", context.arg);
  10744. }
  10745. state = GenStateExecuting;
  10746. var record = tryCatch(innerFn, self, context);
  10747. if (record.type === "normal") {
  10748. // If an exception is thrown from innerFn, we leave state ===
  10749. // GenStateExecuting and loop back for another invocation.
  10750. state = context.done
  10751. ? GenStateCompleted
  10752. : GenStateSuspendedYield;
  10753. if (record.arg === ContinueSentinel) {
  10754. continue;
  10755. }
  10756. return {
  10757. value: record.arg,
  10758. done: context.done
  10759. };
  10760. } else if (record.type === "throw") {
  10761. state = GenStateCompleted;
  10762. // Dispatch the exception by looping back around to the
  10763. // context.dispatchException(context.arg) call above.
  10764. context.method = "throw";
  10765. context.arg = record.arg;
  10766. }
  10767. }
  10768. };
  10769. }
  10770. // Call delegate.iterator[context.method](context.arg) and handle the
  10771. // result, either by returning a { value, done } result from the
  10772. // delegate iterator, or by modifying context.method and context.arg,
  10773. // setting context.delegate to null, and returning the ContinueSentinel.
  10774. function maybeInvokeDelegate(delegate, context) {
  10775. var method = delegate.iterator[context.method];
  10776. if (method === undefined) {
  10777. // A .throw or .return when the delegate iterator has no .throw
  10778. // method always terminates the yield* loop.
  10779. context.delegate = null;
  10780. if (context.method === "throw") {
  10781. if (delegate.iterator.return) {
  10782. // If the delegate iterator has a return method, give it a
  10783. // chance to clean up.
  10784. context.method = "return";
  10785. context.arg = undefined;
  10786. maybeInvokeDelegate(delegate, context);
  10787. if (context.method === "throw") {
  10788. // If maybeInvokeDelegate(context) changed context.method from
  10789. // "return" to "throw", let that override the TypeError below.
  10790. return ContinueSentinel;
  10791. }
  10792. }
  10793. context.method = "throw";
  10794. context.arg = new TypeError(
  10795. "The iterator does not provide a 'throw' method");
  10796. }
  10797. return ContinueSentinel;
  10798. }
  10799. var record = tryCatch(method, delegate.iterator, context.arg);
  10800. if (record.type === "throw") {
  10801. context.method = "throw";
  10802. context.arg = record.arg;
  10803. context.delegate = null;
  10804. return ContinueSentinel;
  10805. }
  10806. var info = record.arg;
  10807. if (! info) {
  10808. context.method = "throw";
  10809. context.arg = new TypeError("iterator result is not an object");
  10810. context.delegate = null;
  10811. return ContinueSentinel;
  10812. }
  10813. if (info.done) {
  10814. // Assign the result of the finished delegate to the temporary
  10815. // variable specified by delegate.resultName (see delegateYield).
  10816. context[delegate.resultName] = info.value;
  10817. // Resume execution at the desired location (see delegateYield).
  10818. context.next = delegate.nextLoc;
  10819. // If context.method was "throw" but the delegate handled the
  10820. // exception, let the outer generator proceed normally. If
  10821. // context.method was "next", forget context.arg since it has been
  10822. // "consumed" by the delegate iterator. If context.method was
  10823. // "return", allow the original .return call to continue in the
  10824. // outer generator.
  10825. if (context.method !== "return") {
  10826. context.method = "next";
  10827. context.arg = undefined;
  10828. }
  10829. } else {
  10830. // Re-yield the result returned by the delegate method.
  10831. return info;
  10832. }
  10833. // The delegate iterator is finished, so forget it and continue with
  10834. // the outer generator.
  10835. context.delegate = null;
  10836. return ContinueSentinel;
  10837. }
  10838. // Define Generator.prototype.{next,throw,return} in terms of the
  10839. // unified ._invoke helper method.
  10840. defineIteratorMethods(Gp);
  10841. Gp[toStringTagSymbol] = "Generator";
  10842. // A Generator should always return itself as the iterator object when the
  10843. // @@iterator function is called on it. Some browsers' implementations of the
  10844. // iterator prototype chain incorrectly implement this, causing the Generator
  10845. // object to not be returned from this call. This ensures that doesn't happen.
  10846. // See https://github.com/facebook/regenerator/issues/274 for more details.
  10847. Gp[iteratorSymbol] = function() {
  10848. return this;
  10849. };
  10850. Gp.toString = function() {
  10851. return "[object Generator]";
  10852. };
  10853. function pushTryEntry(locs) {
  10854. var entry = { tryLoc: locs[0] };
  10855. if (1 in locs) {
  10856. entry.catchLoc = locs[1];
  10857. }
  10858. if (2 in locs) {
  10859. entry.finallyLoc = locs[2];
  10860. entry.afterLoc = locs[3];
  10861. }
  10862. this.tryEntries.push(entry);
  10863. }
  10864. function resetTryEntry(entry) {
  10865. var record = entry.completion || {};
  10866. record.type = "normal";
  10867. delete record.arg;
  10868. entry.completion = record;
  10869. }
  10870. function Context(tryLocsList) {
  10871. // The root entry object (effectively a try statement without a catch
  10872. // or a finally block) gives us a place to store values thrown from
  10873. // locations where there is no enclosing try statement.
  10874. this.tryEntries = [{ tryLoc: "root" }];
  10875. tryLocsList.forEach(pushTryEntry, this);
  10876. this.reset(true);
  10877. }
  10878. runtime.keys = function(object) {
  10879. var keys = [];
  10880. for (var key in object) {
  10881. keys.push(key);
  10882. }
  10883. keys.reverse();
  10884. // Rather than returning an object with a next method, we keep
  10885. // things simple and return the next function itself.
  10886. return function next() {
  10887. while (keys.length) {
  10888. var key = keys.pop();
  10889. if (key in object) {
  10890. next.value = key;
  10891. next.done = false;
  10892. return next;
  10893. }
  10894. }
  10895. // To avoid creating an additional object, we just hang the .value
  10896. // and .done properties off the next function object itself. This
  10897. // also ensures that the minifier will not anonymize the function.
  10898. next.done = true;
  10899. return next;
  10900. };
  10901. };
  10902. function values(iterable) {
  10903. if (iterable) {
  10904. var iteratorMethod = iterable[iteratorSymbol];
  10905. if (iteratorMethod) {
  10906. return iteratorMethod.call(iterable);
  10907. }
  10908. if (typeof iterable.next === "function") {
  10909. return iterable;
  10910. }
  10911. if (!isNaN(iterable.length)) {
  10912. var i = -1, next = function next() {
  10913. while (++i < iterable.length) {
  10914. if (hasOwn.call(iterable, i)) {
  10915. next.value = iterable[i];
  10916. next.done = false;
  10917. return next;
  10918. }
  10919. }
  10920. next.value = undefined;
  10921. next.done = true;
  10922. return next;
  10923. };
  10924. return next.next = next;
  10925. }
  10926. }
  10927. // Return an iterator with no values.
  10928. return { next: doneResult };
  10929. }
  10930. runtime.values = values;
  10931. function doneResult() {
  10932. return { value: undefined, done: true };
  10933. }
  10934. Context.prototype = {
  10935. constructor: Context,
  10936. reset: function(skipTempReset) {
  10937. this.prev = 0;
  10938. this.next = 0;
  10939. // Resetting context._sent for legacy support of Babel's
  10940. // function.sent implementation.
  10941. this.sent = this._sent = undefined;
  10942. this.done = false;
  10943. this.delegate = null;
  10944. this.method = "next";
  10945. this.arg = undefined;
  10946. this.tryEntries.forEach(resetTryEntry);
  10947. if (!skipTempReset) {
  10948. for (var name in this) {
  10949. // Not sure about the optimal order of these conditions:
  10950. if (name.charAt(0) === "t" &&
  10951. hasOwn.call(this, name) &&
  10952. !isNaN(+name.slice(1))) {
  10953. this[name] = undefined;
  10954. }
  10955. }
  10956. }
  10957. },
  10958. stop: function() {
  10959. this.done = true;
  10960. var rootEntry = this.tryEntries[0];
  10961. var rootRecord = rootEntry.completion;
  10962. if (rootRecord.type === "throw") {
  10963. throw rootRecord.arg;
  10964. }
  10965. return this.rval;
  10966. },
  10967. dispatchException: function(exception) {
  10968. if (this.done) {
  10969. throw exception;
  10970. }
  10971. var context = this;
  10972. function handle(loc, caught) {
  10973. record.type = "throw";
  10974. record.arg = exception;
  10975. context.next = loc;
  10976. if (caught) {
  10977. // If the dispatched exception was caught by a catch block,
  10978. // then let that catch block handle the exception normally.
  10979. context.method = "next";
  10980. context.arg = undefined;
  10981. }
  10982. return !! caught;
  10983. }
  10984. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10985. var entry = this.tryEntries[i];
  10986. var record = entry.completion;
  10987. if (entry.tryLoc === "root") {
  10988. // Exception thrown outside of any try block that could handle
  10989. // it, so set the completion value of the entire function to
  10990. // throw the exception.
  10991. return handle("end");
  10992. }
  10993. if (entry.tryLoc <= this.prev) {
  10994. var hasCatch = hasOwn.call(entry, "catchLoc");
  10995. var hasFinally = hasOwn.call(entry, "finallyLoc");
  10996. if (hasCatch && hasFinally) {
  10997. if (this.prev < entry.catchLoc) {
  10998. return handle(entry.catchLoc, true);
  10999. } else if (this.prev < entry.finallyLoc) {
  11000. return handle(entry.finallyLoc);
  11001. }
  11002. } else if (hasCatch) {
  11003. if (this.prev < entry.catchLoc) {
  11004. return handle(entry.catchLoc, true);
  11005. }
  11006. } else if (hasFinally) {
  11007. if (this.prev < entry.finallyLoc) {
  11008. return handle(entry.finallyLoc);
  11009. }
  11010. } else {
  11011. throw new Error("try statement without catch or finally");
  11012. }
  11013. }
  11014. }
  11015. },
  11016. abrupt: function(type, arg) {
  11017. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11018. var entry = this.tryEntries[i];
  11019. if (entry.tryLoc <= this.prev &&
  11020. hasOwn.call(entry, "finallyLoc") &&
  11021. this.prev < entry.finallyLoc) {
  11022. var finallyEntry = entry;
  11023. break;
  11024. }
  11025. }
  11026. if (finallyEntry &&
  11027. (type === "break" ||
  11028. type === "continue") &&
  11029. finallyEntry.tryLoc <= arg &&
  11030. arg <= finallyEntry.finallyLoc) {
  11031. // Ignore the finally entry if control is not jumping to a
  11032. // location outside the try/catch block.
  11033. finallyEntry = null;
  11034. }
  11035. var record = finallyEntry ? finallyEntry.completion : {};
  11036. record.type = type;
  11037. record.arg = arg;
  11038. if (finallyEntry) {
  11039. this.method = "next";
  11040. this.next = finallyEntry.finallyLoc;
  11041. return ContinueSentinel;
  11042. }
  11043. return this.complete(record);
  11044. },
  11045. complete: function(record, afterLoc) {
  11046. if (record.type === "throw") {
  11047. throw record.arg;
  11048. }
  11049. if (record.type === "break" ||
  11050. record.type === "continue") {
  11051. this.next = record.arg;
  11052. } else if (record.type === "return") {
  11053. this.rval = this.arg = record.arg;
  11054. this.method = "return";
  11055. this.next = "end";
  11056. } else if (record.type === "normal" && afterLoc) {
  11057. this.next = afterLoc;
  11058. }
  11059. return ContinueSentinel;
  11060. },
  11061. finish: function(finallyLoc) {
  11062. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11063. var entry = this.tryEntries[i];
  11064. if (entry.finallyLoc === finallyLoc) {
  11065. this.complete(entry.completion, entry.afterLoc);
  11066. resetTryEntry(entry);
  11067. return ContinueSentinel;
  11068. }
  11069. }
  11070. },
  11071. "catch": function(tryLoc) {
  11072. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11073. var entry = this.tryEntries[i];
  11074. if (entry.tryLoc === tryLoc) {
  11075. var record = entry.completion;
  11076. if (record.type === "throw") {
  11077. var thrown = record.arg;
  11078. resetTryEntry(entry);
  11079. }
  11080. return thrown;
  11081. }
  11082. }
  11083. // The context.catch method must only be called with a location
  11084. // argument that corresponds to a known catch block.
  11085. throw new Error("illegal catch attempt");
  11086. },
  11087. delegateYield: function(iterable, resultName, nextLoc) {
  11088. this.delegate = {
  11089. iterator: values(iterable),
  11090. resultName: resultName,
  11091. nextLoc: nextLoc
  11092. };
  11093. if (this.method === "next") {
  11094. // Deliberately forget the last sent value so that we don't
  11095. // accidentally pass it on to the delegate.
  11096. this.arg = undefined;
  11097. }
  11098. return ContinueSentinel;
  11099. }
  11100. };
  11101. })(
  11102. // In sloppy mode, unbound `this` refers to the global object, fallback to
  11103. // Function constructor if we're in global strict mode. That is sadly a form
  11104. // of indirect eval which violates Content Security Policy.
  11105. (function() {
  11106. return this || (typeof self === "object" && self);
  11107. })() || Function("return this")()
  11108. );
  11109. /***/ }),
  11110. /***/ 26:
  11111. /*!*************************************************!*\
  11112. !*** E:/飞播代码/lipin/plugin/image-tools/index.js ***!
  11113. \*************************************************/
  11114. /*! no static exports found */
  11115. /***/ (function(module, exports, __webpack_require__) {
  11116. "use strict";
  11117. Object.defineProperty(exports, "__esModule", { value: true });exports.pathToBase64 = pathToBase64;exports.base64ToPath = base64ToPath;function getLocalFilePath(path) {
  11118. if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
  11119. return path;
  11120. }
  11121. if (path.indexOf('file://') === 0) {
  11122. return path;
  11123. }
  11124. if (path.indexOf('/storage/emulated/0/') === 0) {
  11125. return path;
  11126. }
  11127. if (path.indexOf('/') === 0) {
  11128. var localFilePath = plus.io.convertAbsoluteFileSystem(path);
  11129. if (localFilePath !== path) {
  11130. return localFilePath;
  11131. } else {
  11132. path = path.substr(1);
  11133. }
  11134. }
  11135. return '_www/' + path;
  11136. }
  11137. function pathToBase64(path) {
  11138. return new Promise(function (resolve, reject) {
  11139. if (typeof window === 'object' && 'document' in window) {
  11140. if (typeof FileReader === 'function') {
  11141. var xhr = new XMLHttpRequest();
  11142. xhr.open('GET', path, true);
  11143. xhr.responseType = 'blob';
  11144. xhr.onload = function () {
  11145. if (this.status === 200) {
  11146. var fileReader = new FileReader();
  11147. fileReader.onload = function (e) {
  11148. resolve(e.target.result);
  11149. };
  11150. fileReader.onerror = reject;
  11151. fileReader.readAsDataURL(this.response);
  11152. }
  11153. };
  11154. xhr.onerror = reject;
  11155. xhr.send();
  11156. return;
  11157. }
  11158. var canvas = document.createElement('canvas');
  11159. var c2x = canvas.getContext('2d');
  11160. var img = new Image();
  11161. img.onload = function () {
  11162. canvas.width = img.width;
  11163. canvas.height = img.height;
  11164. c2x.drawImage(img, 0, 0);
  11165. resolve(canvas.toDataURL());
  11166. canvas.height = canvas.width = 0;
  11167. };
  11168. img.onerror = reject;
  11169. img.src = path;
  11170. return;
  11171. }
  11172. if (typeof plus === 'object') {
  11173. plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function (entry) {
  11174. entry.file(function (file) {
  11175. var fileReader = new plus.io.FileReader();
  11176. fileReader.onload = function (data) {
  11177. resolve(data.target.result);
  11178. };
  11179. fileReader.onerror = function (error) {
  11180. reject(error);
  11181. };
  11182. fileReader.readAsDataURL(file);
  11183. }, function (error) {
  11184. reject(error);
  11185. });
  11186. }, function (error) {
  11187. reject(error);
  11188. });
  11189. return;
  11190. }
  11191. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  11192. wx.getFileSystemManager().readFile({
  11193. filePath: path,
  11194. encoding: 'base64',
  11195. success: function success(res) {
  11196. resolve('data:image/png;base64,' + res.data);
  11197. },
  11198. fail: function fail(error) {
  11199. reject(error);
  11200. } });
  11201. return;
  11202. }
  11203. reject(new Error('not support'));
  11204. });
  11205. }
  11206. function base64ToPath(base64) {
  11207. return new Promise(function (resolve, reject) {
  11208. if (typeof window === 'object' && 'document' in window) {
  11209. base64 = base64.split(',');
  11210. var type = base64[0].match(/:(.*?);/)[1];
  11211. var str = atob(base64[1]);
  11212. var n = str.length;
  11213. var array = new Uint8Array(n);
  11214. while (n--) {
  11215. array[n] = str.charCodeAt(n);
  11216. }
  11217. return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type })));
  11218. }
  11219. var extName = base64.match(/data\:\S+\/(\S+);/);
  11220. if (extName) {
  11221. extName = extName[1];
  11222. } else {
  11223. reject(new Error('base64 error'));
  11224. }
  11225. var fileName = Date.now() + '.' + extName;
  11226. if (typeof plus === 'object') {
  11227. var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now());
  11228. bitmap.loadBase64Data(base64, function () {
  11229. var filePath = '_doc/uniapp_temp/' + fileName;
  11230. bitmap.save(filePath, {}, function () {
  11231. bitmap.clear();
  11232. resolve(filePath);
  11233. }, function (error) {
  11234. bitmap.clear();
  11235. reject(error);
  11236. });
  11237. }, function (error) {
  11238. bitmap.clear();
  11239. reject(error);
  11240. });
  11241. return;
  11242. }
  11243. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  11244. var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
  11245. wx.getFileSystemManager().writeFile({
  11246. filePath: filePath,
  11247. data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
  11248. encoding: 'base64',
  11249. success: function success() {
  11250. resolve(filePath);
  11251. },
  11252. fail: function fail(error) {
  11253. reject(error);
  11254. } });
  11255. return;
  11256. }
  11257. reject(new Error('not support'));
  11258. });
  11259. }
  11260. /***/ }),
  11261. /***/ 3:
  11262. /*!***********************************!*\
  11263. !*** (webpack)/buildin/global.js ***!
  11264. \***********************************/
  11265. /*! no static exports found */
  11266. /***/ (function(module, exports) {
  11267. var g;
  11268. // This works in non-strict mode
  11269. g = (function() {
  11270. return this;
  11271. })();
  11272. try {
  11273. // This works if eval is allowed (see CSP)
  11274. g = g || new Function("return this")();
  11275. } catch (e) {
  11276. // This works if the window reference is available
  11277. if (typeof window === "object") g = window;
  11278. }
  11279. // g can still be undefined, but nothing to do about it...
  11280. // We return undefined, instead of nothing here, so it's
  11281. // easier to handle this case. if(!global) { ...}
  11282. module.exports = g;
  11283. /***/ }),
  11284. /***/ 33:
  11285. /*!********************************!*\
  11286. !*** E:/飞播代码/lipin/api/api.js ***!
  11287. \********************************/
  11288. /*! no static exports found */
  11289. /***/ (function(module, exports, __webpack_require__) {
  11290. "use strict";
  11291. Object.defineProperty(exports, "__esModule", { value: true });exports.getIndexData = getIndexData;exports.getNotice = getNotice;exports.newsDetail = newsDetail;exports.getWarehouse = getWarehouse;exports.productList = productList;exports.productDetail = productDetail;exports.recommend = recommend;exports.registerVerify = registerVerify;exports.ApiReg1 = ApiReg1;exports.ApiReg2 = ApiReg2;exports.loginApi = loginApi;exports.getUserInfo = getUserInfo;exports.getOrder = getOrder;exports.getOrderList = getOrderList;exports.spreadLink = spreadLink;exports.platformList = platformList;exports.ApiWarehouse = ApiWarehouse;exports.submitOrder = submitOrder;exports.payOrder = payOrder;exports.balancePay = balancePay;exports.wxPay = wxPay;exports.cancelOrder = cancelOrder;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request.js */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  11292. //获取首页数据 无需授权
  11293. function getIndexData()
  11294. {
  11295. return _request.default.get("index/getIndex", {}, { noAuth: true });
  11296. }
  11297. //公告列表
  11298. function getNotice()
  11299. {
  11300. return _request.default.post("index/newsList", {}, { noAuth: true });
  11301. }
  11302. //公告详情
  11303. function newsDetail(data)
  11304. {
  11305. return _request.default.post("index/news", data, { noAuth: true });
  11306. }
  11307. //仓库列表
  11308. function getWarehouse()
  11309. {
  11310. return _request.default.get("pub/warehouse", {}, { noAuth: true });
  11311. }
  11312. //产品列表
  11313. function productList(data)
  11314. {
  11315. return _request.default.post("index/proList", data, { noAuth: true });
  11316. }
  11317. //产品详情
  11318. function productDetail(data)
  11319. {
  11320. return _request.default.post("index/proItem", data, { noAuth: true });
  11321. }
  11322. //推荐产品
  11323. function recommend()
  11324. {
  11325. return _request.default.post("index/proRand", {}, { noAuth: true });
  11326. }
  11327. //获取验证码
  11328. function registerVerify(data)
  11329. {
  11330. return _request.default.post("login/yzm", data, { noAuth: true });
  11331. }
  11332. //注册一
  11333. function ApiReg1(data)
  11334. {
  11335. return _request.default.post("login/reg1", data, { noAuth: true });
  11336. }
  11337. //注册二
  11338. function ApiReg2(data)
  11339. {
  11340. return _request.default.post("login/reg2", data, { noAuth: true });
  11341. }
  11342. //登录
  11343. function loginApi(data)
  11344. {
  11345. return _request.default.post("login/l", data, { noAuth: true });
  11346. }
  11347. //用户信息
  11348. function getUserInfo()
  11349. {
  11350. return _request.default.get("user/init");
  11351. }
  11352. //订单统计
  11353. function getOrder()
  11354. {
  11355. return _request.default.post("user/orderInit");
  11356. }
  11357. //订单列表
  11358. function getOrderList(data)
  11359. {
  11360. return _request.default.post("user/getOrderList", data);
  11361. }
  11362. //邀请链接
  11363. function spreadLink()
  11364. {
  11365. return _request.default.post("user/extension");
  11366. }
  11367. //平台列表
  11368. function platformList()
  11369. {
  11370. return _request.default.post("platform/list");
  11371. }
  11372. //购买页仓库
  11373. function ApiWarehouse()
  11374. {
  11375. return _request.default.get("user/warehouse");
  11376. }
  11377. //提交订单
  11378. function submitOrder(data)
  11379. {
  11380. return _request.default.post("user/subOrder", data);
  11381. }
  11382. //支付订单
  11383. function payOrder(data)
  11384. {
  11385. return _request.default.post("user/getPayOrder", data);
  11386. }
  11387. //余额支付
  11388. function balancePay(data)
  11389. {
  11390. return _request.default.post("user/balancePay", data);
  11391. }
  11392. //微信支付
  11393. function wxPay(data)
  11394. {
  11395. return _request.default.post("weixin/wxPay", data);
  11396. }
  11397. //取消订单
  11398. function cancelOrder(data)
  11399. {
  11400. return _request.default.post("user/cancelOrder", data);
  11401. }
  11402. /***/ }),
  11403. /***/ 4:
  11404. /*!********************************!*\
  11405. !*** E:/飞播代码/lipin/pages.json ***!
  11406. \********************************/
  11407. /*! no static exports found */
  11408. /***/ (function(module, exports) {
  11409. /***/ }),
  11410. /***/ 74:
  11411. /*!**************************************!*\
  11412. !*** E:/飞播代码/lipin/libs/CryptoJS.js ***!
  11413. \**************************************/
  11414. /*! no static exports found */
  11415. /***/ (function(module, exports, __webpack_require__) {
  11416. "use strict";
  11417. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;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;} /*
  11418. CryptoJS v3.1.2
  11419. code.google.com/p/crypto-js
  11420. (c) 2009-2013 by Jeff Mott. All rights reserved.
  11421. code.google.com/p/crypto-js/wiki/License
  11422. */
  11423. /**
  11424. * CryptoJS core components.
  11425. */
  11426. var CryptoJS = CryptoJS || function (Math, undefined) {
  11427. /**
  11428. * CryptoJS namespace.
  11429. */
  11430. var C = {};
  11431. /**
  11432. * Library namespace.
  11433. */
  11434. var C_lib = C.lib = {};
  11435. /**
  11436. * Base object for prototypal inheritance.
  11437. */
  11438. var Base = C_lib.Base = function () {
  11439. function F() {}
  11440. return {
  11441. /**
  11442. * Creates a new object that inherits from this object.
  11443. *
  11444. * @param {Object} overrides Properties to copy into the new object.
  11445. *
  11446. * @return {Object} The new object.
  11447. *
  11448. * @static
  11449. *
  11450. * @example
  11451. *
  11452. * var MyType = CryptoJS.lib.Base.extend({
  11453. * field: 'value',
  11454. *
  11455. * method: function () {
  11456. * }
  11457. * });
  11458. */
  11459. extend: function extend(overrides) {
  11460. // Spawn
  11461. F.prototype = this;
  11462. var subtype = new F();
  11463. // Augment
  11464. if (overrides) {
  11465. subtype.mixIn(overrides);
  11466. }
  11467. // Create default initializer
  11468. if (!subtype.hasOwnProperty('init')) {
  11469. subtype.init = function () {
  11470. subtype.$super.init.apply(this, arguments);
  11471. };
  11472. }
  11473. // Initializer's prototype is the subtype object
  11474. subtype.init.prototype = subtype;
  11475. // Reference supertype
  11476. subtype.$super = this;
  11477. return subtype;
  11478. },
  11479. /**
  11480. * Extends this object and runs the init method.
  11481. * Arguments to create() will be passed to init().
  11482. *
  11483. * @return {Object} The new object.
  11484. *
  11485. * @static
  11486. *
  11487. * @example
  11488. *
  11489. * var instance = MyType.create();
  11490. */
  11491. create: function create() {
  11492. var instance = this.extend();
  11493. instance.init.apply(instance, arguments);
  11494. return instance;
  11495. },
  11496. /**
  11497. * Initializes a newly created object.
  11498. * Override this method to add some logic when your objects are created.
  11499. *
  11500. * @example
  11501. *
  11502. * var MyType = CryptoJS.lib.Base.extend({
  11503. * init: function () {
  11504. * // ...
  11505. * }
  11506. * });
  11507. */
  11508. init: function init() {
  11509. },
  11510. /**
  11511. * Copies properties into this object.
  11512. *
  11513. * @param {Object} properties The properties to mix in.
  11514. *
  11515. * @example
  11516. *
  11517. * MyType.mixIn({
  11518. * field: 'value'
  11519. * });
  11520. */
  11521. mixIn: function mixIn(properties) {
  11522. for (var propertyName in properties) {
  11523. if (properties.hasOwnProperty(propertyName)) {
  11524. this[propertyName] = properties[propertyName];
  11525. }
  11526. }
  11527. // IE won't copy toString using the loop above
  11528. if (properties.hasOwnProperty('toString')) {
  11529. this.toString = properties.toString;
  11530. }
  11531. },
  11532. /**
  11533. * Creates a copy of this object.
  11534. *
  11535. * @return {Object} The clone.
  11536. *
  11537. * @example
  11538. *
  11539. * var clone = instance.clone();
  11540. */
  11541. clone: function clone() {
  11542. return this.init.prototype.extend(this);
  11543. } };
  11544. }();
  11545. /**
  11546. * An array of 32-bit words.
  11547. *
  11548. * @property {Array} words The array of 32-bit words.
  11549. * @property {number} sigBytes The number of significant bytes in this word array.
  11550. */
  11551. var WordArray = C_lib.WordArray = Base.extend({
  11552. /**
  11553. * Initializes a newly created word array.
  11554. *
  11555. * @param {Array} words (Optional) An array of 32-bit words.
  11556. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  11557. *
  11558. * @example
  11559. *
  11560. * var wordArray = CryptoJS.lib.WordArray.create();
  11561. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  11562. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  11563. */
  11564. init: function init(words, sigBytes) {
  11565. words = this.words = words || [];
  11566. if (sigBytes != undefined) {
  11567. this.sigBytes = sigBytes;
  11568. } else {
  11569. this.sigBytes = words.length * 4;
  11570. }
  11571. },
  11572. /**
  11573. * Converts this word array to a string.
  11574. *
  11575. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  11576. *
  11577. * @return {string} The stringified word array.
  11578. *
  11579. * @example
  11580. *
  11581. * var string = wordArray + '';
  11582. * var string = wordArray.toString();
  11583. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  11584. */
  11585. toString: function toString(encoder) {
  11586. return (encoder || Hex).stringify(this);
  11587. },
  11588. /**
  11589. * Concatenates a word array to this word array.
  11590. *
  11591. * @param {WordArray} wordArray The word array to append.
  11592. *
  11593. * @return {WordArray} This word array.
  11594. *
  11595. * @example
  11596. *
  11597. * wordArray1.concat(wordArray2);
  11598. */
  11599. concat: function concat(wordArray) {
  11600. // Shortcuts
  11601. var thisWords = this.words;
  11602. var thatWords = wordArray.words;
  11603. var thisSigBytes = this.sigBytes;
  11604. var thatSigBytes = wordArray.sigBytes;
  11605. // Clamp excess bits
  11606. this.clamp();
  11607. // Concat
  11608. if (thisSigBytes % 4) {
  11609. // Copy one byte at a time
  11610. for (var i = 0; i < thatSigBytes; i++) {
  11611. var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  11612. thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
  11613. }
  11614. } else if (thatWords.length > 0xffff) {
  11615. // Copy one word at a time
  11616. for (var i = 0; i < thatSigBytes; i += 4) {
  11617. thisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2];
  11618. }
  11619. } else {
  11620. // Copy all words at once
  11621. thisWords.push.apply(thisWords, thatWords);
  11622. }
  11623. this.sigBytes += thatSigBytes;
  11624. // Chainable
  11625. return this;
  11626. },
  11627. /**
  11628. * Removes insignificant bits.
  11629. *
  11630. * @example
  11631. *
  11632. * wordArray.clamp();
  11633. */
  11634. clamp: function clamp() {
  11635. // Shortcuts
  11636. var words = this.words;
  11637. var sigBytes = this.sigBytes;
  11638. // Clamp
  11639. words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;
  11640. words.length = Math.ceil(sigBytes / 4);
  11641. },
  11642. /**
  11643. * Creates a copy of this word array.
  11644. *
  11645. * @return {WordArray} The clone.
  11646. *
  11647. * @example
  11648. *
  11649. * var clone = wordArray.clone();
  11650. */
  11651. clone: function clone() {
  11652. var clone = Base.clone.call(this);
  11653. clone.words = this.words.slice(0);
  11654. return clone;
  11655. },
  11656. /**
  11657. * Creates a word array filled with random bytes.
  11658. *
  11659. * @param {number} nBytes The number of random bytes to generate.
  11660. *
  11661. * @return {WordArray} The random word array.
  11662. *
  11663. * @static
  11664. *
  11665. * @example
  11666. *
  11667. * var wordArray = CryptoJS.lib.WordArray.random(16);
  11668. */
  11669. random: function random(nBytes) {
  11670. var words = [];
  11671. for (var i = 0; i < nBytes; i += 4) {
  11672. words.push(Math.random() * 0x100000000 | 0);
  11673. }
  11674. return new WordArray.init(words, nBytes);
  11675. } });
  11676. /**
  11677. * Encoder namespace.
  11678. */
  11679. var C_enc = C.enc = {};
  11680. /**
  11681. * Hex encoding strategy.
  11682. */
  11683. var Hex = C_enc.Hex = {
  11684. /**
  11685. * Converts a word array to a hex string.
  11686. *
  11687. * @param {WordArray} wordArray The word array.
  11688. *
  11689. * @return {string} The hex string.
  11690. *
  11691. * @static
  11692. *
  11693. * @example
  11694. *
  11695. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  11696. */
  11697. stringify: function stringify(wordArray) {
  11698. // Shortcuts
  11699. var words = wordArray.words;
  11700. var sigBytes = wordArray.sigBytes;
  11701. // Convert
  11702. var hexChars = [];
  11703. for (var i = 0; i < sigBytes; i++) {
  11704. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  11705. hexChars.push((bite >>> 4).toString(16));
  11706. hexChars.push((bite & 0x0f).toString(16));
  11707. }
  11708. return hexChars.join('');
  11709. },
  11710. /**
  11711. * Converts a hex string to a word array.
  11712. *
  11713. * @param {string} hexStr The hex string.
  11714. *
  11715. * @return {WordArray} The word array.
  11716. *
  11717. * @static
  11718. *
  11719. * @example
  11720. *
  11721. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  11722. */
  11723. parse: function parse(hexStr) {
  11724. // Shortcut
  11725. var hexStrLength = hexStr.length;
  11726. // Convert
  11727. var words = [];
  11728. for (var i = 0; i < hexStrLength; i += 2) {
  11729. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
  11730. }
  11731. return new WordArray.init(words, hexStrLength / 2);
  11732. } };
  11733. /**
  11734. * Latin1 encoding strategy.
  11735. */
  11736. var Latin1 = C_enc.Latin1 = {
  11737. /**
  11738. * Converts a word array to a Latin1 string.
  11739. *
  11740. * @param {WordArray} wordArray The word array.
  11741. *
  11742. * @return {string} The Latin1 string.
  11743. *
  11744. * @static
  11745. *
  11746. * @example
  11747. *
  11748. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  11749. */
  11750. stringify: function stringify(wordArray) {
  11751. // Shortcuts
  11752. var words = wordArray.words;
  11753. var sigBytes = wordArray.sigBytes;
  11754. // Convert
  11755. var latin1Chars = [];
  11756. for (var i = 0; i < sigBytes; i++) {
  11757. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  11758. latin1Chars.push(String.fromCharCode(bite));
  11759. }
  11760. return latin1Chars.join('');
  11761. },
  11762. /**
  11763. * Converts a Latin1 string to a word array.
  11764. *
  11765. * @param {string} latin1Str The Latin1 string.
  11766. *
  11767. * @return {WordArray} The word array.
  11768. *
  11769. * @static
  11770. *
  11771. * @example
  11772. *
  11773. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  11774. */
  11775. parse: function parse(latin1Str) {
  11776. // Shortcut
  11777. var latin1StrLength = latin1Str.length;
  11778. // Convert
  11779. var words = [];
  11780. for (var i = 0; i < latin1StrLength; i++) {
  11781. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;
  11782. }
  11783. return new WordArray.init(words, latin1StrLength);
  11784. } };
  11785. /**
  11786. * UTF-8 encoding strategy.
  11787. */
  11788. var Utf8 = C_enc.Utf8 = {
  11789. /**
  11790. * Converts a word array to a UTF-8 string.
  11791. *
  11792. * @param {WordArray} wordArray The word array.
  11793. *
  11794. * @return {string} The UTF-8 string.
  11795. *
  11796. * @static
  11797. *
  11798. * @example
  11799. *
  11800. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  11801. */
  11802. stringify: function stringify(wordArray) {
  11803. try {
  11804. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  11805. } catch (e) {
  11806. throw new Error('Malformed UTF-8 data');
  11807. }
  11808. },
  11809. /**
  11810. * Converts a UTF-8 string to a word array.
  11811. *
  11812. * @param {string} utf8Str The UTF-8 string.
  11813. *
  11814. * @return {WordArray} The word array.
  11815. *
  11816. * @static
  11817. *
  11818. * @example
  11819. *
  11820. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  11821. */
  11822. parse: function parse(utf8Str) {
  11823. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  11824. } };
  11825. var u8array = C_enc.u8array = {
  11826. stringify: function stringify(wordArray) {
  11827. var words = wordArray.words;
  11828. var sigBytes = wordArray.sigBytes;
  11829. var u8 = new Uint8Array(sigBytes);
  11830. for (var i = 0; i < sigBytes; i++) {
  11831. var _byte = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  11832. u8[i] = _byte;
  11833. }
  11834. return u8;
  11835. },
  11836. parse: function parse(u8arr) {
  11837. var len = u8arr.length;
  11838. var words = [];
  11839. for (var i = 0; i < len; i++) {
  11840. words[i >>> 2] |= (u8arr[i] & 0xff) << 24 - i % 4 * 8;
  11841. }
  11842. return CryptoJS.lib.WordArray.create(words, len);
  11843. } };
  11844. /**
  11845. * Abstract buffered block algorithm template.
  11846. *
  11847. * The property blockSize must be implemented in a concrete subtype.
  11848. *
  11849. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  11850. */
  11851. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  11852. /**
  11853. * Resets this block algorithm's data buffer to its initial state.
  11854. *
  11855. * @example
  11856. *
  11857. * bufferedBlockAlgorithm.reset();
  11858. */
  11859. reset: function reset() {
  11860. // Initial values
  11861. this._data = new WordArray.init();
  11862. this._nDataBytes = 0;
  11863. },
  11864. /**
  11865. * Adds new data to this block algorithm's buffer.
  11866. *
  11867. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  11868. *
  11869. * @example
  11870. *
  11871. * bufferedBlockAlgorithm._append('data');
  11872. * bufferedBlockAlgorithm._append(wordArray);
  11873. */
  11874. _append: function _append(data) {
  11875. // Convert string to WordArray, else assume WordArray already
  11876. if (typeof data == 'string') {
  11877. data = Utf8.parse(data);
  11878. }
  11879. // Append
  11880. this._data.concat(data);
  11881. this._nDataBytes += data.sigBytes;
  11882. },
  11883. /**
  11884. * Processes available data blocks.
  11885. *
  11886. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  11887. *
  11888. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  11889. *
  11890. * @return {WordArray} The processed data.
  11891. *
  11892. * @example
  11893. *
  11894. * var processedData = bufferedBlockAlgorithm._process();
  11895. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  11896. */
  11897. _process: function _process(doFlush) {
  11898. // Shortcuts
  11899. var data = this._data;
  11900. var dataWords = data.words;
  11901. var dataSigBytes = data.sigBytes;
  11902. var blockSize = this.blockSize;
  11903. var blockSizeBytes = blockSize * 4;
  11904. // Count blocks ready
  11905. var nBlocksReady = dataSigBytes / blockSizeBytes;
  11906. if (doFlush) {
  11907. // Round up to include partial blocks
  11908. nBlocksReady = Math.ceil(nBlocksReady);
  11909. } else {
  11910. // Round down to include only full blocks,
  11911. // less the number of blocks that must remain in the buffer
  11912. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  11913. }
  11914. // Count words ready
  11915. var nWordsReady = nBlocksReady * blockSize;
  11916. // Count bytes ready
  11917. var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  11918. // Process blocks
  11919. if (nWordsReady) {
  11920. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  11921. // Perform concrete-algorithm logic
  11922. this._doProcessBlock(dataWords, offset);
  11923. }
  11924. // Remove processed words
  11925. var processedWords = dataWords.splice(0, nWordsReady);
  11926. data.sigBytes -= nBytesReady;
  11927. }
  11928. // Return processed words
  11929. return new WordArray.init(processedWords, nBytesReady);
  11930. },
  11931. /**
  11932. * Creates a copy of this object.
  11933. *
  11934. * @return {Object} The clone.
  11935. *
  11936. * @example
  11937. *
  11938. * var clone = bufferedBlockAlgorithm.clone();
  11939. */
  11940. clone: function clone() {
  11941. var clone = Base.clone.call(this);
  11942. clone._data = this._data.clone();
  11943. return clone;
  11944. },
  11945. _minBufferSize: 0 });
  11946. /**
  11947. * Abstract hasher template.
  11948. *
  11949. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  11950. */
  11951. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  11952. /**
  11953. * Configuration options.
  11954. */
  11955. cfg: Base.extend(),
  11956. /**
  11957. * Initializes a newly created hasher.
  11958. *
  11959. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  11960. *
  11961. * @example
  11962. *
  11963. * var hasher = CryptoJS.algo.SHA256.create();
  11964. */
  11965. init: function init(cfg) {
  11966. // Apply config defaults
  11967. this.cfg = this.cfg.extend(cfg);
  11968. // Set initial values
  11969. this.reset();
  11970. },
  11971. /**
  11972. * Resets this hasher to its initial state.
  11973. *
  11974. * @example
  11975. *
  11976. * hasher.reset();
  11977. */
  11978. reset: function reset() {
  11979. // Reset data buffer
  11980. BufferedBlockAlgorithm.reset.call(this);
  11981. // Perform concrete-hasher logic
  11982. this._doReset();
  11983. },
  11984. /**
  11985. * Updates this hasher with a message.
  11986. *
  11987. * @param {WordArray|string} messageUpdate The message to append.
  11988. *
  11989. * @return {Hasher} This hasher.
  11990. *
  11991. * @example
  11992. *
  11993. * hasher.update('message');
  11994. * hasher.update(wordArray);
  11995. */
  11996. update: function update(messageUpdate) {
  11997. // Append
  11998. this._append(messageUpdate);
  11999. // Update the hash
  12000. this._process();
  12001. // Chainable
  12002. return this;
  12003. },
  12004. /**
  12005. * Finalizes the hash computation.
  12006. * Note that the finalize operation is effectively a destructive, read-once operation.
  12007. *
  12008. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  12009. *
  12010. * @return {WordArray} The hash.
  12011. *
  12012. * @example
  12013. *
  12014. * var hash = hasher.finalize();
  12015. * var hash = hasher.finalize('message');
  12016. * var hash = hasher.finalize(wordArray);
  12017. */
  12018. finalize: function finalize(messageUpdate) {
  12019. // Final message update
  12020. if (messageUpdate) {
  12021. this._append(messageUpdate);
  12022. }
  12023. // Perform concrete-hasher logic
  12024. var hash = this._doFinalize();
  12025. return hash;
  12026. },
  12027. blockSize: 512 / 32,
  12028. /**
  12029. * Creates a shortcut function to a hasher's object interface.
  12030. *
  12031. * @param {Hasher} hasher The hasher to create a helper for.
  12032. *
  12033. * @return {Function} The shortcut function.
  12034. *
  12035. * @static
  12036. *
  12037. * @example
  12038. *
  12039. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  12040. */
  12041. _createHelper: function _createHelper(hasher) {
  12042. return function (message, cfg) {
  12043. return new hasher.init(cfg).finalize(message);
  12044. };
  12045. },
  12046. /**
  12047. * Creates a shortcut function to the HMAC's object interface.
  12048. *
  12049. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  12050. *
  12051. * @return {Function} The shortcut function.
  12052. *
  12053. * @static
  12054. *
  12055. * @example
  12056. *
  12057. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  12058. */
  12059. _createHmacHelper: function _createHmacHelper(hasher) {
  12060. return function (message, key) {
  12061. return new C_algo.HMAC.init(hasher, key).finalize(message);
  12062. };
  12063. } });
  12064. /**
  12065. * Algorithm namespace.
  12066. */
  12067. var C_algo = C.algo = {};
  12068. return C;
  12069. }(Math);
  12070. /*
  12071. CryptoJS v3.1.2
  12072. code.google.com/p/crypto-js
  12073. (c) 2009-2013 by Jeff Mott. All rights reserved.
  12074. code.google.com/p/crypto-js/wiki/License
  12075. */
  12076. var CryptoJS = CryptoJS || function (u, p) {
  12077. var d = {},l = d.lib = {},s = function s() {},t = l.Base = { extend: function extend(a) {s.prototype = this;var c = new s();a && c.mixIn(a);c.hasOwnProperty("init") || (c.init = function () {c.$super.init.apply(this, arguments);});c.init.prototype = c;c.$super = this;return c;}, create: function create() {var a = this.extend();a.init.apply(a, arguments);return a;}, init: function init() {}, mixIn: function mixIn(a) {for (var c in a) {a.hasOwnProperty(c) && (this[c] = a[c]);}a.hasOwnProperty("toString") && (this.toString = a.toString);}, clone: function clone() {return this.init.prototype.extend(this);} },
  12078. r = l.WordArray = t.extend({
  12079. init: function init(a, c) {a = this.words = a || [];this.sigBytes = c != p ? c : 4 * a.length;}, toString: function toString(a) {return (a || v).stringify(this);}, concat: function concat(a) {var c = this.words,e = a.words,j = this.sigBytes;a = a.sigBytes;this.clamp();if (j % 4) for (var k = 0; k < a; k++) {c[j + k >>> 2] |= (e[k >>> 2] >>> 24 - 8 * (k % 4) & 255) << 24 - 8 * ((j + k) % 4);} else if (65535 < e.length) for (k = 0; k < a; k += 4) {c[j + k >>> 2] = e[k >>> 2];} else c.push.apply(c, e);this.sigBytes += a;return this;}, clamp: function clamp() {
  12080. var a = this.words,c = this.sigBytes;a[c >>> 2] &= 4294967295 <<
  12081. 32 - 8 * (c % 4);a.length = u.ceil(c / 4);
  12082. }, clone: function clone() {var a = t.clone.call(this);a.words = this.words.slice(0);return a;}, random: function random(a) {for (var c = [], e = 0; e < a; e += 4) {c.push(4294967296 * u.random() | 0);}return new r.init(c, a);} }),
  12083. w = d.enc = {},v = w.Hex = {
  12084. stringify: function stringify(a) {var c = a.words;a = a.sigBytes;for (var e = [], j = 0; j < a; j++) {var k = c[j >>> 2] >>> 24 - 8 * (j % 4) & 255;e.push((k >>> 4).toString(16));e.push((k & 15).toString(16));}return e.join("");}, parse: function parse(a) {
  12085. for (var c = a.length, e = [], j = 0; j < c; j += 2) {e[j >>> 3] |= parseInt(a.substr(j,
  12086. 2), 16) << 24 - 4 * (j % 8);}return new r.init(e, c / 2);
  12087. } },
  12088. b = w.Latin1 = { stringify: function stringify(a) {var c = a.words;a = a.sigBytes;for (var e = [], j = 0; j < a; j++) {e.push(String.fromCharCode(c[j >>> 2] >>> 24 - 8 * (j % 4) & 255));}return e.join("");}, parse: function parse(a) {for (var c = a.length, e = [], j = 0; j < c; j++) {e[j >>> 2] |= (a.charCodeAt(j) & 255) << 24 - 8 * (j % 4);}return new r.init(e, c);} },x = w.Utf8 = { stringify: function stringify(a) {try {return decodeURIComponent(escape(b.stringify(a)));} catch (c) {throw Error("Malformed UTF-8 data");}}, parse: function parse(a) {return b.parse(unescape(encodeURIComponent(a)));} },
  12089. q = l.BufferedBlockAlgorithm = t.extend({
  12090. reset: function reset() {this._data = new r.init();this._nDataBytes = 0;}, _append: function _append(a) {"string" == typeof a && (a = x.parse(a));this._data.concat(a);this._nDataBytes += a.sigBytes;}, _process: function _process(a) {var c = this._data,e = c.words,j = c.sigBytes,k = this.blockSize,b = j / (4 * k),b = a ? u.ceil(b) : u.max((b | 0) - this._minBufferSize, 0);a = b * k;j = u.min(4 * a, j);if (a) {for (var q = 0; q < a; q += k) {this._doProcessBlock(e, q);}q = e.splice(0, a);c.sigBytes -= j;}return new r.init(q, j);}, clone: function clone() {
  12091. var a = t.clone.call(this);
  12092. a._data = this._data.clone();return a;
  12093. }, _minBufferSize: 0 });
  12094. l.Hasher = q.extend({
  12095. cfg: t.extend(), init: function init(a) {this.cfg = this.cfg.extend(a);this.reset();}, reset: function reset() {q.reset.call(this);this._doReset();}, update: function update(a) {this._append(a);this._process();return this;}, finalize: function finalize(a) {a && this._append(a);return this._doFinalize();}, blockSize: 16, _createHelper: function _createHelper(a) {return function (b, e) {return new a.init(e).finalize(b);};}, _createHmacHelper: function _createHmacHelper(a) {
  12096. return function (b, e) {
  12097. return new n.HMAC.init(a,
  12098. e).finalize(b);
  12099. };
  12100. } });
  12101. var n = d.algo = {};return d;
  12102. }(Math);
  12103. (function () {
  12104. var u = CryptoJS,p = u.lib.WordArray;u.enc.Base64 = {
  12105. stringify: function stringify(d) {var l = d.words,p = d.sigBytes,t = this._map;d.clamp();d = [];for (var r = 0; r < p; r += 3) {for (var w = (l[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (l[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | l[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, v = 0; 4 > v && r + 0.75 * v < p; v++) {d.push(t.charAt(w >>> 6 * (3 - v) & 63));}}if (l = t.charAt(64)) for (; d.length % 4;) {d.push(l);}return d.join("");}, parse: function parse(d) {
  12106. var l = d.length,s = this._map,t = s.charAt(64);t && (t = d.indexOf(t), -1 != t && (l = t));for (var t = [], r = 0, w = 0; w <
  12107. l; w++) {if (w % 4) {var v = s.indexOf(d.charAt(w - 1)) << 2 * (w % 4),b = s.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4);t[r >>> 2] |= (v | b) << 24 - 8 * (r % 4);r++;}}return p.create(t, r);
  12108. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  12109. })();
  12110. (function (u) {
  12111. function p(b, n, a, c, e, j, k) {b = b + (n & a | ~n & c) + e + k;return (b << j | b >>> 32 - j) + n;}function d(b, n, a, c, e, j, k) {b = b + (n & c | a & ~c) + e + k;return (b << j | b >>> 32 - j) + n;}function l(b, n, a, c, e, j, k) {b = b + (n ^ a ^ c) + e + k;return (b << j | b >>> 32 - j) + n;}function s(b, n, a, c, e, j, k) {b = b + (a ^ (n | ~c)) + e + k;return (b << j | b >>> 32 - j) + n;}for (var t = CryptoJS, r = t.lib, w = r.WordArray, v = r.Hasher, r = t.algo, b = [], x = 0; 64 > x; x++) {b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0;}r = r.MD5 = v.extend({
  12112. _doReset: function _doReset() {this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878]);},
  12113. _doProcessBlock: function _doProcessBlock(q, n) {
  12114. for (var a = 0; 16 > a; a++) {var c = n + a,e = q[c];q[c] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360;}var a = this._hash.words,c = q[n + 0],e = q[n + 1],j = q[n + 2],k = q[n + 3],z = q[n + 4],r = q[n + 5],t = q[n + 6],w = q[n + 7],v = q[n + 8],A = q[n + 9],B = q[n + 10],C = q[n + 11],u = q[n + 12],D = q[n + 13],E = q[n + 14],x = q[n + 15],f = a[0],m = a[1],g = a[2],h = a[3],f = p(f, m, g, h, c, 7, b[0]),h = p(h, f, m, g, e, 12, b[1]),g = p(g, h, f, m, j, 17, b[2]),m = p(m, g, h, f, k, 22, b[3]),f = p(f, m, g, h, z, 7, b[4]),h = p(h, f, m, g, r, 12, b[5]),g = p(g, h, f, m, t, 17, b[6]),m = p(m, g, h, f, w, 22, b[7]),
  12115. f = p(f, m, g, h, v, 7, b[8]),h = p(h, f, m, g, A, 12, b[9]),g = p(g, h, f, m, B, 17, b[10]),m = p(m, g, h, f, C, 22, b[11]),f = p(f, m, g, h, u, 7, b[12]),h = p(h, f, m, g, D, 12, b[13]),g = p(g, h, f, m, E, 17, b[14]),m = p(m, g, h, f, x, 22, b[15]),f = d(f, m, g, h, e, 5, b[16]),h = d(h, f, m, g, t, 9, b[17]),g = d(g, h, f, m, C, 14, b[18]),m = d(m, g, h, f, c, 20, b[19]),f = d(f, m, g, h, r, 5, b[20]),h = d(h, f, m, g, B, 9, b[21]),g = d(g, h, f, m, x, 14, b[22]),m = d(m, g, h, f, z, 20, b[23]),f = d(f, m, g, h, A, 5, b[24]),h = d(h, f, m, g, E, 9, b[25]),g = d(g, h, f, m, k, 14, b[26]),m = d(m, g, h, f, v, 20, b[27]),f = d(f, m, g, h, D, 5, b[28]),h = d(h, f,
  12116. m, g, j, 9, b[29]),g = d(g, h, f, m, w, 14, b[30]),m = d(m, g, h, f, u, 20, b[31]),f = l(f, m, g, h, r, 4, b[32]),h = l(h, f, m, g, v, 11, b[33]),g = l(g, h, f, m, C, 16, b[34]),m = l(m, g, h, f, E, 23, b[35]),f = l(f, m, g, h, e, 4, b[36]),h = l(h, f, m, g, z, 11, b[37]),g = l(g, h, f, m, w, 16, b[38]),m = l(m, g, h, f, B, 23, b[39]),f = l(f, m, g, h, D, 4, b[40]),h = l(h, f, m, g, c, 11, b[41]),g = l(g, h, f, m, k, 16, b[42]),m = l(m, g, h, f, t, 23, b[43]),f = l(f, m, g, h, A, 4, b[44]),h = l(h, f, m, g, u, 11, b[45]),g = l(g, h, f, m, x, 16, b[46]),m = l(m, g, h, f, j, 23, b[47]),f = s(f, m, g, h, c, 6, b[48]),h = s(h, f, m, g, w, 10, b[49]),g = s(g, h, f, m,
  12117. E, 15, b[50]),m = s(m, g, h, f, r, 21, b[51]),f = s(f, m, g, h, u, 6, b[52]),h = s(h, f, m, g, k, 10, b[53]),g = s(g, h, f, m, B, 15, b[54]),m = s(m, g, h, f, e, 21, b[55]),f = s(f, m, g, h, v, 6, b[56]),h = s(h, f, m, g, x, 10, b[57]),g = s(g, h, f, m, t, 15, b[58]),m = s(m, g, h, f, D, 21, b[59]),f = s(f, m, g, h, z, 6, b[60]),h = s(h, f, m, g, C, 10, b[61]),g = s(g, h, f, m, j, 15, b[62]),m = s(m, g, h, f, A, 21, b[63]);a[0] = a[0] + f | 0;a[1] = a[1] + m | 0;a[2] = a[2] + g | 0;a[3] = a[3] + h | 0;
  12118. }, _doFinalize: function _doFinalize() {
  12119. var b = this._data,n = b.words,a = 8 * this._nDataBytes,c = 8 * b.sigBytes;n[c >>> 5] |= 128 << 24 - c % 32;var e = u.floor(a /
  12120. 4294967296);n[(c + 64 >>> 9 << 4) + 15] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360;n[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360;b.sigBytes = 4 * (n.length + 1);this._process();b = this._hash;n = b.words;for (a = 0; 4 > a; a++) {c = n[a], n[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360;}return b;
  12121. }, clone: function clone() {var b = v.clone.call(this);b._hash = this._hash.clone();return b;} });
  12122. t.MD5 = v._createHelper(r);t.HmacMD5 = v._createHmacHelper(r);
  12123. })(Math);
  12124. (function () {
  12125. var u = CryptoJS,p = u.lib,d = p.Base,l = p.WordArray,p = u.algo,s = p.EvpKDF = d.extend({ cfg: d.extend({ keySize: 4, hasher: p.MD5, iterations: 1 }), init: function init(d) {this.cfg = this.cfg.extend(d);}, compute: function compute(d, r) {for (var p = this.cfg, s = p.hasher.create(), b = l.create(), u = b.words, q = p.keySize, p = p.iterations; u.length < q;) {n && s.update(n);var n = s.update(d).finalize(r);s.reset();for (var a = 1; a < p; a++) {n = s.finalize(n), s.reset();}b.concat(n);}b.sigBytes = 4 * q;return b;} });u.EvpKDF = function (d, l, p) {
  12126. return s.create(p).compute(d,
  12127. l);
  12128. };
  12129. })();
  12130. CryptoJS.lib.Cipher || function (u) {
  12131. var p = CryptoJS,d = p.lib,l = d.Base,s = d.WordArray,t = d.BufferedBlockAlgorithm,r = p.enc.Base64,w = p.algo.EvpKDF,v = d.Cipher = t.extend({
  12132. cfg: l.extend(), createEncryptor: function createEncryptor(e, a) {return this.create(this._ENC_XFORM_MODE, e, a);}, createDecryptor: function createDecryptor(e, a) {return this.create(this._DEC_XFORM_MODE, e, a);}, init: function init(e, a, b) {this.cfg = this.cfg.extend(b);this._xformMode = e;this._key = a;this.reset();}, reset: function reset() {t.reset.call(this);this._doReset();}, process: function process(e) {this._append(e);return this._process();},
  12133. finalize: function finalize(e) {e && this._append(e);return this._doFinalize();}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function _createHelper(e) {return { encrypt: function encrypt(b, k, d) {return ("string" == typeof k ? c : a).encrypt(e, b, k, d);}, decrypt: function decrypt(b, k, d) {return ("string" == typeof k ? c : a).decrypt(e, b, k, d);} };} });
  12134. d.StreamCipher = v.extend({ _doFinalize: function _doFinalize() {return this._process(!0);}, blockSize: 1 });var b = p.mode = {},x = function x(e, a, b) {
  12135. var c = this._iv;c ? this._iv = u : c = this._prevBlock;for (var d = 0; d < b; d++) {e[a + d] ^=
  12136. c[d];}
  12137. },q = (d.BlockCipherMode = l.extend({ createEncryptor: function createEncryptor(e, a) {return this.Encryptor.create(e, a);}, createDecryptor: function createDecryptor(e, a) {return this.Decryptor.create(e, a);}, init: function init(e, a) {this._cipher = e;this._iv = a;} })).extend();q.Encryptor = q.extend({ processBlock: function processBlock(e, a) {var b = this._cipher,c = b.blockSize;x.call(this, e, a, c);b.encryptBlock(e, a);this._prevBlock = e.slice(a, a + c);} });q.Decryptor = q.extend({
  12138. processBlock: function processBlock(e, a) {
  12139. var b = this._cipher,c = b.blockSize,d = e.slice(a, a + c);b.decryptBlock(e, a);x.call(this,
  12140. e, a, c);this._prevBlock = d;
  12141. } });
  12142. b = b.CBC = q;q = (p.pad = {}).Pkcs7 = { pad: function pad(a, b) {for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, l = [], n = 0; n < c; n += 4) {l.push(d);}c = s.create(l, c);a.concat(c);}, unpad: function unpad(a) {a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255;} };d.BlockCipher = v.extend({
  12143. cfg: v.cfg.extend({ mode: b, padding: q }), reset: function reset() {
  12144. v.reset.call(this);var a = this.cfg,b = a.iv,a = a.mode;if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor;else c = a.createDecryptor, this._minBufferSize = 1;this._mode = c.call(a,
  12145. this, b && b.words);
  12146. }, _doProcessBlock: function _doProcessBlock(a, b) {this._mode.processBlock(a, b);}, _doFinalize: function _doFinalize() {var a = this.cfg.padding;if (this._xformMode == this._ENC_XFORM_MODE) {a.pad(this._data, this.blockSize);var b = this._process(!0);} else b = this._process(!0), a.unpad(b);return b;}, blockSize: 4 });
  12147. var n = d.CipherParams = l.extend({ init: function init(a) {this.mixIn(a);}, toString: function toString(a) {return (a || this.formatter).stringify(this);} }),b = (p.format = {}).OpenSSL = {
  12148. stringify: function stringify(a) {
  12149. var b = a.ciphertext;a = a.salt;return (a ? s.create([1398893684,
  12150. 1701076831]).concat(a).concat(b) : b).toString(r);
  12151. }, parse: function parse(a) {a = r.parse(a);var b = a.words;if (1398893684 == b[0] && 1701076831 == b[1]) {var c = s.create(b.slice(2, 4));b.splice(0, 4);a.sigBytes -= 16;}return n.create({ ciphertext: a, salt: c });} },
  12152. a = d.SerializableCipher = l.extend({
  12153. cfg: l.extend({ format: b }), encrypt: function encrypt(a, b, c, d) {d = this.cfg.extend(d);var l = a.createEncryptor(c, d);b = l.finalize(b);l = l.cfg;return n.create({ ciphertext: b, key: c, iv: l.iv, algorithm: a, mode: l.mode, padding: l.padding, blockSize: a.blockSize, formatter: d.format });},
  12154. decrypt: function decrypt(a, b, c, d) {d = this.cfg.extend(d);b = this._parse(b, d.format);return a.createDecryptor(c, d).finalize(b.ciphertext);}, _parse: function _parse(a, b) {return "string" == typeof a ? b.parse(a, this) : a;} }),
  12155. p = (p.kdf = {}).OpenSSL = { execute: function execute(a, b, c, d) {d || (d = s.random(8));a = w.create({ keySize: b + c }).compute(a, d);c = s.create(a.words.slice(b), 4 * c);a.sigBytes = 4 * b;return n.create({ key: a, iv: c, salt: d });} },c = d.PasswordBasedCipher = a.extend({
  12156. cfg: a.cfg.extend({ kdf: p }), encrypt: function encrypt(b, c, d, l) {
  12157. l = this.cfg.extend(l);d = l.kdf.execute(d,
  12158. b.keySize, b.ivSize);l.iv = d.iv;b = a.encrypt.call(this, b, c, d.key, l);b.mixIn(d);return b;
  12159. }, decrypt: function decrypt(b, c, d, l) {l = this.cfg.extend(l);c = this._parse(c, l.format);d = l.kdf.execute(d, b.keySize, b.ivSize, c.salt);l.iv = d.iv;return a.decrypt.call(this, b, c, d.key, l);} });
  12160. }();
  12161. (function () {
  12162. for (var u = CryptoJS, p = u.lib.BlockCipher, d = u.algo, l = [], s = [], t = [], r = [], w = [], v = [], b = [], x = [], q = [], n = [], a = [], c = 0; 256 > c; c++) {a[c] = 128 > c ? c << 1 : c << 1 ^ 283;}for (var e = 0, j = 0, c = 0; 256 > c; c++) {var k = j ^ j << 1 ^ j << 2 ^ j << 3 ^ j << 4,k = k >>> 8 ^ k & 255 ^ 99;l[e] = k;s[k] = e;var z = a[e],F = a[z],G = a[F],y = 257 * a[k] ^ 16843008 * k;t[e] = y << 24 | y >>> 8;r[e] = y << 16 | y >>> 16;w[e] = y << 8 | y >>> 24;v[e] = y;y = 16843009 * G ^ 65537 * F ^ 257 * z ^ 16843008 * e;b[k] = y << 24 | y >>> 8;x[k] = y << 16 | y >>> 16;q[k] = y << 8 | y >>> 24;n[k] = y;e ? (e = z ^ a[a[a[G ^ z]]], j ^= a[a[j]]) : e = j = 1;}var H = [0, 1, 2, 4, 8,
  12163. 16, 32, 64, 128, 27, 54],d = d.AES = p.extend({
  12164. _doReset: function _doReset() {
  12165. for (var a = this._key, c = a.words, d = a.sigBytes / 4, a = 4 * ((this._nRounds = d + 6) + 1), e = this._keySchedule = [], j = 0; j < a; j++) {if (j < d) e[j] = c[j];else {var k = e[j - 1];j % d ? 6 < d && 4 == j % d && (k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255]) : (k = k << 8 | k >>> 24, k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255], k ^= H[j / d | 0] << 24);e[j] = e[j - d] ^ k;}}c = this._invKeySchedule = [];for (d = 0; d < a; d++) {j = a - d, k = d % 4 ? e[j] : e[j - 4], c[d] = 4 > d || 4 >= j ? k : b[l[k >>> 24]] ^ x[l[k >>> 16 & 255]] ^ q[l[k >>>
  12166. 8 & 255]] ^ n[l[k & 255]];}
  12167. }, encryptBlock: function encryptBlock(a, b) {this._doCryptBlock(a, b, this._keySchedule, t, r, w, v, l);}, decryptBlock: function decryptBlock(a, c) {var d = a[c + 1];a[c + 1] = a[c + 3];a[c + 3] = d;this._doCryptBlock(a, c, this._invKeySchedule, b, x, q, n, s);d = a[c + 1];a[c + 1] = a[c + 3];a[c + 3] = d;}, _doCryptBlock: function _doCryptBlock(a, b, c, d, e, j, l, f) {
  12168. for (var m = this._nRounds, g = a[b] ^ c[0], h = a[b + 1] ^ c[1], k = a[b + 2] ^ c[2], n = a[b + 3] ^ c[3], p = 4, r = 1; r < m; r++) {var q = d[g >>> 24] ^ e[h >>> 16 & 255] ^ j[k >>> 8 & 255] ^ l[n & 255] ^ c[p++],s = d[h >>> 24] ^ e[k >>> 16 & 255] ^ j[n >>> 8 & 255] ^ l[g & 255] ^ c[p++],t =
  12169. d[k >>> 24] ^ e[n >>> 16 & 255] ^ j[g >>> 8 & 255] ^ l[h & 255] ^ c[p++],n = d[n >>> 24] ^ e[g >>> 16 & 255] ^ j[h >>> 8 & 255] ^ l[k & 255] ^ c[p++],g = q,h = s,k = t;}q = (f[g >>> 24] << 24 | f[h >>> 16 & 255] << 16 | f[k >>> 8 & 255] << 8 | f[n & 255]) ^ c[p++];s = (f[h >>> 24] << 24 | f[k >>> 16 & 255] << 16 | f[n >>> 8 & 255] << 8 | f[g & 255]) ^ c[p++];t = (f[k >>> 24] << 24 | f[n >>> 16 & 255] << 16 | f[g >>> 8 & 255] << 8 | f[h & 255]) ^ c[p++];n = (f[n >>> 24] << 24 | f[g >>> 16 & 255] << 16 | f[h >>> 8 & 255] << 8 | f[k & 255]) ^ c[p++];a[b] = q;a[b + 1] = s;a[b + 2] = t;a[b + 3] = n;
  12170. }, keySize: 8 });
  12171. u.AES = p._createHelper(d);
  12172. })();
  12173. /*
  12174. CryptoJS v3.1.2
  12175. code.google.com/p/crypto-js
  12176. (c) 2009-2013 by Jeff Mott. All rights reserved.
  12177. code.google.com/p/crypto-js/wiki/License
  12178. */
  12179. (function () {
  12180. var h = CryptoJS,j = h.lib.WordArray;h.enc.Base64 = {
  12181. stringify: function stringify(b) {var e = b.words,f = b.sigBytes,c = this._map;b.clamp();b = [];for (var a = 0; a < f; a += 3) {for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++) {b.push(c.charAt(d >>> 6 * (3 - g) & 63));}}if (e = c.charAt(64)) for (; b.length % 4;) {b.push(e);}return b.join("");}, parse: function parse(b) {
  12182. var e = b.length,f = this._map,c = f.charAt(64);c && (c = b.indexOf(c), -1 != c && (e = c));for (var c = [], a = 0, d = 0; d <
  12183. e; d++) {if (d % 4) {var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4),h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4);c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4);a++;}}return j.create(c, a);
  12184. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  12185. })();var
  12186. AES = /*#__PURE__*/function () {
  12187. function AES(secret_key) {_classCallCheck(this, AES);
  12188. this.secret_key = CryptoJS.MD5(secret_key).toString();
  12189. }_createClass(AES, [{ key: "encrypt", value: function encrypt(
  12190. data) {
  12191. var key = CryptoJS.enc.Latin1.parse(this.secret_key);
  12192. var encrypted = CryptoJS.AES.encrypt(data, key, {
  12193. iv: key,
  12194. mode: CryptoJS.mode.CBC,
  12195. padding: CryptoJS.pad.Pkcs7 });
  12196. var strAr = CryptoJS.enc.u8array.stringify(encrypted.ciphertext);
  12197. var u8Ar = CryptoJS.enc.u8array.parse(strAr);
  12198. var str = u8Ar.toString(CryptoJS.enc.Base64);
  12199. // var strAr = this.stringToUint8Array(str);
  12200. return str;
  12201. }
  12202. /*
  12203. * CryptoJS AES 解密
  12204. */ }, { key: "decrypt", value: function decrypt(
  12205. data) {
  12206. // 解密key
  12207. var key = CryptoJS.enc.Latin1.parse(this.secret_key);
  12208. var decrypted = CryptoJS.AES.decrypt(data, key, {
  12209. iv: key,
  12210. mode: CryptoJS.mode.CBC,
  12211. padding: CryptoJS.pad.Pkcs7 });
  12212. var message = decrypted.toString(CryptoJS.enc.Utf8);
  12213. return message;
  12214. }
  12215. /**
  12216. * 数据toUint8Array
  12217. * @param {type} str
  12218. * @returns {Uint8Array}
  12219. */ }, { key: "stringToUint8Array", value: function stringToUint8Array(
  12220. str) {
  12221. var arr = [];
  12222. for (var i = 0, j = str.length; i < j; ++i) {
  12223. arr.push(str.charCodeAt(i));
  12224. }
  12225. var tmpUint8Array = new Uint8Array(arr);
  12226. return tmpUint8Array;
  12227. } }]);return AES;}();var _default =
  12228. {
  12229. CryptoJS: CryptoJS,
  12230. AES: AES };exports.default = _default;
  12231. /***/ }),
  12232. /***/ 75:
  12233. /*!**********************************************!*\
  12234. !*** E:/飞播代码/lipin/mixins/SendVerifyCode.js ***!
  12235. \**********************************************/
  12236. /*! no static exports found */
  12237. /***/ (function(module, exports, __webpack_require__) {
  12238. "use strict";
  12239. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  12240. data: function data() {
  12241. return {
  12242. disabled: false,
  12243. text: "获取验证码" };
  12244. },
  12245. methods: {
  12246. sendCode: function sendCode() {var _this = this;
  12247. if (this.disabled) return;
  12248. this.disabled = true;
  12249. var n = 120;
  12250. this.text = "剩余 " + n + "s";
  12251. var run = setInterval(function () {
  12252. n = n - 1;
  12253. if (n < 0) {
  12254. clearInterval(run);
  12255. }
  12256. _this.text = "剩余 " + n + "s";
  12257. if (_this.text < "剩余 " + 0 + "s") {
  12258. _this.disabled = false;
  12259. _this.text = "重新获取";
  12260. }
  12261. }, 1000);
  12262. } } };exports.default = _default;
  12263. /***/ }),
  12264. /***/ 8:
  12265. /*!***********************************!*\
  12266. !*** E:/飞播代码/lipin/libs/login.js ***!
  12267. \***********************************/
  12268. /*! no static exports found */
  12269. /***/ (function(module, exports, __webpack_require__) {
  12270. "use strict";
  12271. Object.defineProperty(exports, "__esModule", { value: true });exports.toLogin = toLogin;exports.checkLogin = checkLogin;var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 9));
  12272. var _cache = _interopRequireDefault(__webpack_require__(/*! ../utils/cache */ 17));
  12273. var _cache2 = __webpack_require__(/*! ./../config/cache */ 16);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  12274. function prePage() {
  12275. var pages = getCurrentPages();
  12276. var prePage = pages[pages.length - 2];
  12277. return prePage.$vm;
  12278. }
  12279. function toLogin(push, pathLogin) {
  12280. _store.default.commit("LOGOUT");
  12281. var path = prePage();
  12282. if (path) {
  12283. path = path.router;
  12284. if (path == undefined) {
  12285. path = location.pathname;
  12286. }
  12287. }
  12288. if (!pathLogin)
  12289. pathLogin = '/page/users/login/index';
  12290. _cache.default.set('login_back_url', path);
  12291. }
  12292. function checkLogin()
  12293. {
  12294. var token = _cache.default.get(_cache2.LOGIN_STATUS);
  12295. var expiresTime = _cache.default.get(_cache2.EXPIRES_TIME);
  12296. var newTime = Math.round(new Date() / 1000);
  12297. if (expiresTime < newTime || !token) {
  12298. _cache.default.clear(_cache2.LOGIN_STATUS);
  12299. _cache.default.clear(_cache2.EXPIRES_TIME);
  12300. _cache.default.clear(_cache2.USER_INFO);
  12301. _cache.default.clear(_cache2.STATE_R_KEY);
  12302. return false;
  12303. } else {
  12304. _store.default.commit('UPDATE_LOGIN', token);
  12305. var userInfo = _cache.default.get(_cache2.USER_INFO, true);
  12306. if (userInfo) {
  12307. _store.default.commit('UPDATE_USERINFO', userInfo);
  12308. }
  12309. return true;
  12310. }
  12311. }
  12312. /***/ }),
  12313. /***/ 9:
  12314. /*!************************************!*\
  12315. !*** E:/飞播代码/lipin/store/index.js ***!
  12316. \************************************/
  12317. /*! no static exports found */
  12318. /***/ (function(module, exports, __webpack_require__) {
  12319. "use strict";
  12320. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  12321. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 10));
  12322. var _modules = _interopRequireDefault(__webpack_require__(/*! ./modules */ 11));
  12323. var _getters = _interopRequireDefault(__webpack_require__(/*! ./getters */ 18));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  12324. _vue.default.use(_vuex.default);
  12325. var debug = "development" !== "production";var _default =
  12326. new _vuex.default.Store({
  12327. modules: _modules.default,
  12328. getters: _getters.default,
  12329. strict: debug });exports.default = _default;
  12330. /***/ })
  12331. }]);
  12332. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map