vendor.js 438 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771
  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. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);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;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. 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];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. 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];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. 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;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. {
  677. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  678. return;
  679. }
  680. }
  681. var oldTriggerEvent = mpInstance.triggerEvent;
  682. 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];}
  683. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  684. };
  685. }
  686. function initHook(name, options, isComponent) {
  687. var oldHook = options[name];
  688. if (!oldHook) {
  689. options[name] = function () {
  690. initTriggerEvent(this);
  691. };
  692. } else {
  693. options[name] = function () {
  694. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  695. return oldHook.apply(this, args);
  696. };
  697. }
  698. }
  699. if (!MPPage.__$wrappered) {
  700. MPPage.__$wrappered = true;
  701. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  702. initHook('onLoad', options);
  703. return MPPage(options);
  704. };
  705. Page.after = MPPage.after;
  706. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  707. initHook('created', options);
  708. return MPComponent(options);
  709. };
  710. }
  711. var PAGE_EVENT_HOOKS = [
  712. 'onPullDownRefresh',
  713. 'onReachBottom',
  714. 'onAddToFavorites',
  715. 'onShareTimeline',
  716. 'onShareAppMessage',
  717. 'onPageScroll',
  718. 'onResize',
  719. 'onTabItemTap'];
  720. function initMocks(vm, mocks) {
  721. var mpInstance = vm.$mp[vm.mpType];
  722. mocks.forEach(function (mock) {
  723. if (hasOwn(mpInstance, mock)) {
  724. vm[mock] = mpInstance[mock];
  725. }
  726. });
  727. }
  728. function hasHook(hook, vueOptions) {
  729. if (!vueOptions) {
  730. return true;
  731. }
  732. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  733. return true;
  734. }
  735. vueOptions = vueOptions.default || vueOptions;
  736. if (isFn(vueOptions)) {
  737. if (isFn(vueOptions.extendOptions[hook])) {
  738. return true;
  739. }
  740. if (vueOptions.super &&
  741. vueOptions.super.options &&
  742. Array.isArray(vueOptions.super.options[hook])) {
  743. return true;
  744. }
  745. return false;
  746. }
  747. if (isFn(vueOptions[hook])) {
  748. return true;
  749. }
  750. var mixins = vueOptions.mixins;
  751. if (Array.isArray(mixins)) {
  752. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  753. }
  754. }
  755. function initHooks(mpOptions, hooks, vueOptions) {
  756. hooks.forEach(function (hook) {
  757. if (hasHook(hook, vueOptions)) {
  758. mpOptions[hook] = function (args) {
  759. return this.$vm && this.$vm.__call_hook(hook, args);
  760. };
  761. }
  762. });
  763. }
  764. function initVueComponent(Vue, vueOptions) {
  765. vueOptions = vueOptions.default || vueOptions;
  766. var VueComponent;
  767. if (isFn(vueOptions)) {
  768. VueComponent = vueOptions;
  769. } else {
  770. VueComponent = Vue.extend(vueOptions);
  771. }
  772. vueOptions = VueComponent.options;
  773. return [VueComponent, vueOptions];
  774. }
  775. function initSlots(vm, vueSlots) {
  776. if (Array.isArray(vueSlots) && vueSlots.length) {
  777. var $slots = Object.create(null);
  778. vueSlots.forEach(function (slotName) {
  779. $slots[slotName] = true;
  780. });
  781. vm.$scopedSlots = vm.$slots = $slots;
  782. }
  783. }
  784. function initVueIds(vueIds, mpInstance) {
  785. vueIds = (vueIds || '').split(',');
  786. var len = vueIds.length;
  787. if (len === 1) {
  788. mpInstance._$vueId = vueIds[0];
  789. } else if (len === 2) {
  790. mpInstance._$vueId = vueIds[0];
  791. mpInstance._$vuePid = vueIds[1];
  792. }
  793. }
  794. function initData(vueOptions, context) {
  795. var data = vueOptions.data || {};
  796. var methods = vueOptions.methods || {};
  797. if (typeof data === 'function') {
  798. try {
  799. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  800. } catch (e) {
  801. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  802. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  803. }
  804. }
  805. } else {
  806. try {
  807. // 对 data 格式化
  808. data = JSON.parse(JSON.stringify(data));
  809. } catch (e) {}
  810. }
  811. if (!isPlainObject(data)) {
  812. data = {};
  813. }
  814. Object.keys(methods).forEach(function (methodName) {
  815. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  816. data[methodName] = methods[methodName];
  817. }
  818. });
  819. return data;
  820. }
  821. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  822. function createObserver(name) {
  823. return function observer(newVal, oldVal) {
  824. if (this.$vm) {
  825. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  826. }
  827. };
  828. }
  829. function initBehaviors(vueOptions, initBehavior) {
  830. var vueBehaviors = vueOptions.behaviors;
  831. var vueExtends = vueOptions.extends;
  832. var vueMixins = vueOptions.mixins;
  833. var vueProps = vueOptions.props;
  834. if (!vueProps) {
  835. vueOptions.props = vueProps = [];
  836. }
  837. var behaviors = [];
  838. if (Array.isArray(vueBehaviors)) {
  839. vueBehaviors.forEach(function (behavior) {
  840. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  841. if (behavior === 'uni://form-field') {
  842. if (Array.isArray(vueProps)) {
  843. vueProps.push('name');
  844. vueProps.push('value');
  845. } else {
  846. vueProps.name = {
  847. type: String,
  848. default: '' };
  849. vueProps.value = {
  850. type: [String, Number, Boolean, Array, Object, Date],
  851. default: '' };
  852. }
  853. }
  854. });
  855. }
  856. if (isPlainObject(vueExtends) && vueExtends.props) {
  857. behaviors.push(
  858. initBehavior({
  859. properties: initProperties(vueExtends.props, true) }));
  860. }
  861. if (Array.isArray(vueMixins)) {
  862. vueMixins.forEach(function (vueMixin) {
  863. if (isPlainObject(vueMixin) && vueMixin.props) {
  864. behaviors.push(
  865. initBehavior({
  866. properties: initProperties(vueMixin.props, true) }));
  867. }
  868. });
  869. }
  870. return behaviors;
  871. }
  872. function parsePropType(key, type, defaultValue, file) {
  873. // [String]=>String
  874. if (Array.isArray(type) && type.length === 1) {
  875. return type[0];
  876. }
  877. return type;
  878. }
  879. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  880. var properties = {};
  881. if (!isBehavior) {
  882. properties.vueId = {
  883. type: String,
  884. value: '' };
  885. // 用于字节跳动小程序模拟抽象节点
  886. properties.generic = {
  887. type: Object,
  888. value: null };
  889. // scopedSlotsCompiler auto
  890. properties.scopedSlotsCompiler = {
  891. type: String,
  892. value: '' };
  893. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  894. type: null,
  895. value: [],
  896. observer: function observer(newVal, oldVal) {
  897. var $slots = Object.create(null);
  898. newVal.forEach(function (slotName) {
  899. $slots[slotName] = true;
  900. });
  901. this.setData({
  902. $slots: $slots });
  903. } };
  904. }
  905. if (Array.isArray(props)) {// ['title']
  906. props.forEach(function (key) {
  907. properties[key] = {
  908. type: null,
  909. observer: createObserver(key) };
  910. });
  911. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  912. Object.keys(props).forEach(function (key) {
  913. var opts = props[key];
  914. if (isPlainObject(opts)) {// title:{type:String,default:''}
  915. var value = opts.default;
  916. if (isFn(value)) {
  917. value = value();
  918. }
  919. opts.type = parsePropType(key, opts.type);
  920. properties[key] = {
  921. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  922. value: value,
  923. observer: createObserver(key) };
  924. } else {// content:String
  925. var type = parsePropType(key, opts);
  926. properties[key] = {
  927. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  928. observer: createObserver(key) };
  929. }
  930. });
  931. }
  932. return properties;
  933. }
  934. function wrapper$1(event) {
  935. // TODO 又得兼容 mpvue 的 mp 对象
  936. try {
  937. event.mp = JSON.parse(JSON.stringify(event));
  938. } catch (e) {}
  939. event.stopPropagation = noop;
  940. event.preventDefault = noop;
  941. event.target = event.target || {};
  942. if (!hasOwn(event, 'detail')) {
  943. event.detail = {};
  944. }
  945. if (hasOwn(event, 'markerId')) {
  946. event.detail = typeof event.detail === 'object' ? event.detail : {};
  947. event.detail.markerId = event.markerId;
  948. }
  949. if (isPlainObject(event.detail)) {
  950. event.target = Object.assign({}, event.target, event.detail);
  951. }
  952. return event;
  953. }
  954. function getExtraValue(vm, dataPathsArray) {
  955. var context = vm;
  956. dataPathsArray.forEach(function (dataPathArray) {
  957. var dataPath = dataPathArray[0];
  958. var value = dataPathArray[2];
  959. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  960. var propPath = dataPathArray[1];
  961. var valuePath = dataPathArray[3];
  962. var vFor;
  963. if (Number.isInteger(dataPath)) {
  964. vFor = dataPath;
  965. } else if (!dataPath) {
  966. vFor = context;
  967. } else if (typeof dataPath === 'string' && dataPath) {
  968. if (dataPath.indexOf('#s#') === 0) {
  969. vFor = dataPath.substr(3);
  970. } else {
  971. vFor = vm.__get_value(dataPath, context);
  972. }
  973. }
  974. if (Number.isInteger(vFor)) {
  975. context = value;
  976. } else if (!propPath) {
  977. context = vFor[value];
  978. } else {
  979. if (Array.isArray(vFor)) {
  980. context = vFor.find(function (vForItem) {
  981. return vm.__get_value(propPath, vForItem) === value;
  982. });
  983. } else if (isPlainObject(vFor)) {
  984. context = Object.keys(vFor).find(function (vForKey) {
  985. return vm.__get_value(propPath, vFor[vForKey]) === value;
  986. });
  987. } else {
  988. console.error('v-for 暂不支持循环数据:', vFor);
  989. }
  990. }
  991. if (valuePath) {
  992. context = vm.__get_value(valuePath, context);
  993. }
  994. }
  995. });
  996. return context;
  997. }
  998. function processEventExtra(vm, extra, event) {
  999. var extraObj = {};
  1000. if (Array.isArray(extra) && extra.length) {
  1001. /**
  1002. *[
  1003. * ['data.items', 'data.id', item.data.id],
  1004. * ['metas', 'id', meta.id]
  1005. *],
  1006. *[
  1007. * ['data.items', 'data.id', item.data.id],
  1008. * ['metas', 'id', meta.id]
  1009. *],
  1010. *'test'
  1011. */
  1012. extra.forEach(function (dataPath, index) {
  1013. if (typeof dataPath === 'string') {
  1014. if (!dataPath) {// model,prop.sync
  1015. extraObj['$' + index] = vm;
  1016. } else {
  1017. if (dataPath === '$event') {// $event
  1018. extraObj['$' + index] = event;
  1019. } else if (dataPath === 'arguments') {
  1020. if (event.detail && event.detail.__args__) {
  1021. extraObj['$' + index] = event.detail.__args__;
  1022. } else {
  1023. extraObj['$' + index] = [event];
  1024. }
  1025. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1026. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1027. } else {
  1028. extraObj['$' + index] = vm.__get_value(dataPath);
  1029. }
  1030. }
  1031. } else {
  1032. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1033. }
  1034. });
  1035. }
  1036. return extraObj;
  1037. }
  1038. function getObjByArray(arr) {
  1039. var obj = {};
  1040. for (var i = 1; i < arr.length; i++) {
  1041. var element = arr[i];
  1042. obj[element[0]] = element[1];
  1043. }
  1044. return obj;
  1045. }
  1046. 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;
  1047. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1048. if (isCustom) {// 自定义事件
  1049. isCustomMPEvent = event.currentTarget &&
  1050. event.currentTarget.dataset &&
  1051. event.currentTarget.dataset.comType === 'wx';
  1052. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1053. if (isCustomMPEvent) {
  1054. return [event];
  1055. }
  1056. return event.detail.__args__ || event.detail;
  1057. }
  1058. }
  1059. var extraObj = processEventExtra(vm, extra, event);
  1060. var ret = [];
  1061. args.forEach(function (arg) {
  1062. if (arg === '$event') {
  1063. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1064. ret.push(event.target.value);
  1065. } else {
  1066. if (isCustom && !isCustomMPEvent) {
  1067. ret.push(event.detail.__args__[0]);
  1068. } else {// wxcomponent 组件或内置组件
  1069. ret.push(event);
  1070. }
  1071. }
  1072. } else {
  1073. if (Array.isArray(arg) && arg[0] === 'o') {
  1074. ret.push(getObjByArray(arg));
  1075. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1076. ret.push(extraObj[arg]);
  1077. } else {
  1078. ret.push(arg);
  1079. }
  1080. }
  1081. });
  1082. return ret;
  1083. }
  1084. var ONCE = '~';
  1085. var CUSTOM = '^';
  1086. function isMatchEventType(eventType, optType) {
  1087. return eventType === optType ||
  1088. optType === 'regionchange' && (
  1089. eventType === 'begin' ||
  1090. eventType === 'end');
  1091. }
  1092. function getContextVm(vm) {
  1093. var $parent = vm.$parent;
  1094. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1095. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1096. $parent = $parent.$parent;
  1097. }
  1098. return $parent && $parent.$parent;
  1099. }
  1100. function handleEvent(event) {var _this = this;
  1101. event = wrapper$1(event);
  1102. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1103. var dataset = (event.currentTarget || event.target).dataset;
  1104. if (!dataset) {
  1105. return console.warn('事件信息不存在');
  1106. }
  1107. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1108. if (!eventOpts) {
  1109. return console.warn('事件信息不存在');
  1110. }
  1111. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1112. var eventType = event.type;
  1113. var ret = [];
  1114. eventOpts.forEach(function (eventOpt) {
  1115. var type = eventOpt[0];
  1116. var eventsArray = eventOpt[1];
  1117. var isCustom = type.charAt(0) === CUSTOM;
  1118. type = isCustom ? type.slice(1) : type;
  1119. var isOnce = type.charAt(0) === ONCE;
  1120. type = isOnce ? type.slice(1) : type;
  1121. if (eventsArray && isMatchEventType(eventType, type)) {
  1122. eventsArray.forEach(function (eventArray) {
  1123. var methodName = eventArray[0];
  1124. if (methodName) {
  1125. var handlerCtx = _this.$vm;
  1126. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1127. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1128. }
  1129. if (methodName === '$emit') {
  1130. handlerCtx.$emit.apply(handlerCtx,
  1131. processEventArgs(
  1132. _this.$vm,
  1133. event,
  1134. eventArray[1],
  1135. eventArray[2],
  1136. isCustom,
  1137. methodName));
  1138. return;
  1139. }
  1140. var handler = handlerCtx[methodName];
  1141. if (!isFn(handler)) {
  1142. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1143. }
  1144. if (isOnce) {
  1145. if (handler.once) {
  1146. return;
  1147. }
  1148. handler.once = true;
  1149. }
  1150. var params = processEventArgs(
  1151. _this.$vm,
  1152. event,
  1153. eventArray[1],
  1154. eventArray[2],
  1155. isCustom,
  1156. methodName);
  1157. params = Array.isArray(params) ? params : [];
  1158. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1159. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1160. // eslint-disable-next-line no-sparse-arrays
  1161. params = params.concat([,,,,,,,,,, event]);
  1162. }
  1163. ret.push(handler.apply(handlerCtx, params));
  1164. }
  1165. });
  1166. }
  1167. });
  1168. if (
  1169. eventType === 'input' &&
  1170. ret.length === 1 &&
  1171. typeof ret[0] !== 'undefined')
  1172. {
  1173. return ret[0];
  1174. }
  1175. }
  1176. var locale;
  1177. {
  1178. locale = wx.getSystemInfoSync().language;
  1179. }
  1180. var i18n = (0, _uniI18n.initVueI18n)(
  1181. locale,
  1182. {});
  1183. var t = i18n.t;
  1184. var i18nMixin = i18n.mixin = {
  1185. beforeCreate: function beforeCreate() {var _this2 = this;
  1186. var unwatch = i18n.i18n.watchLocale(function () {
  1187. _this2.$forceUpdate();
  1188. });
  1189. this.$once('hook:beforeDestroy', function () {
  1190. unwatch();
  1191. });
  1192. },
  1193. methods: {
  1194. $$t: function $$t(key, values) {
  1195. return t(key, values);
  1196. } } };
  1197. var setLocale$1 = i18n.setLocale;
  1198. var getLocale$1 = i18n.getLocale;
  1199. function initAppLocale(Vue, appVm, locale) {
  1200. var state = Vue.observable({
  1201. locale: locale || i18n.getLocale() });
  1202. var localeWatchers = [];
  1203. appVm.$watchLocale = function (fn) {
  1204. localeWatchers.push(fn);
  1205. };
  1206. Object.defineProperty(appVm, '$locale', {
  1207. get: function get() {
  1208. return state.locale;
  1209. },
  1210. set: function set(v) {
  1211. state.locale = v;
  1212. localeWatchers.forEach(function (watch) {return watch(v);});
  1213. } });
  1214. }
  1215. var eventChannels = {};
  1216. var eventChannelStack = [];
  1217. function getEventChannel(id) {
  1218. if (id) {
  1219. var eventChannel = eventChannels[id];
  1220. delete eventChannels[id];
  1221. return eventChannel;
  1222. }
  1223. return eventChannelStack.shift();
  1224. }
  1225. var hooks = [
  1226. 'onShow',
  1227. 'onHide',
  1228. 'onError',
  1229. 'onPageNotFound',
  1230. 'onThemeChange',
  1231. 'onUnhandledRejection'];
  1232. function initEventChannel() {
  1233. _vue.default.prototype.getOpenerEventChannel = function () {
  1234. // 微信小程序使用自身getOpenerEventChannel
  1235. {
  1236. return this.$scope.getOpenerEventChannel();
  1237. }
  1238. };
  1239. var callHook = _vue.default.prototype.__call_hook;
  1240. _vue.default.prototype.__call_hook = function (hook, args) {
  1241. if (hook === 'onLoad' && args && args.__id__) {
  1242. this.__eventChannel__ = getEventChannel(args.__id__);
  1243. delete args.__id__;
  1244. }
  1245. return callHook.call(this, hook, args);
  1246. };
  1247. }
  1248. function initScopedSlotsParams() {
  1249. var center = {};
  1250. var parents = {};
  1251. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1252. var has = center[vueId];
  1253. if (!has) {
  1254. parents[vueId] = this;
  1255. this.$on('hook:destory', function () {
  1256. delete parents[vueId];
  1257. });
  1258. }
  1259. return has;
  1260. };
  1261. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1262. var data = center[vueId];
  1263. if (data) {
  1264. var object = data[name] || {};
  1265. return key ? object[key] : object;
  1266. } else {
  1267. parents[vueId] = this;
  1268. this.$on('hook:destory', function () {
  1269. delete parents[vueId];
  1270. });
  1271. }
  1272. };
  1273. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1274. var vueIds = this.$options.propsData.vueId;
  1275. if (vueIds) {
  1276. var vueId = vueIds.split(',')[0];
  1277. var object = center[vueId] = center[vueId] || {};
  1278. object[name] = value;
  1279. if (parents[vueId]) {
  1280. parents[vueId].$forceUpdate();
  1281. }
  1282. }
  1283. };
  1284. _vue.default.mixin({
  1285. destroyed: function destroyed() {
  1286. var propsData = this.$options.propsData;
  1287. var vueId = propsData && propsData.vueId;
  1288. if (vueId) {
  1289. delete center[vueId];
  1290. delete parents[vueId];
  1291. }
  1292. } });
  1293. }
  1294. function parseBaseApp(vm, _ref3)
  1295. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1296. initEventChannel();
  1297. {
  1298. initScopedSlotsParams();
  1299. }
  1300. if (vm.$options.store) {
  1301. _vue.default.prototype.$store = vm.$options.store;
  1302. }
  1303. uniIdMixin(_vue.default);
  1304. _vue.default.prototype.mpHost = "mp-weixin";
  1305. _vue.default.mixin({
  1306. beforeCreate: function beforeCreate() {
  1307. if (!this.$options.mpType) {
  1308. return;
  1309. }
  1310. this.mpType = this.$options.mpType;
  1311. this.$mp = _defineProperty({
  1312. data: {} },
  1313. this.mpType, this.$options.mpInstance);
  1314. this.$scope = this.$options.mpInstance;
  1315. delete this.$options.mpType;
  1316. delete this.$options.mpInstance;
  1317. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1318. var app = getApp();
  1319. if (app.$vm && app.$vm.$i18n) {
  1320. this._i18n = app.$vm.$i18n;
  1321. }
  1322. }
  1323. if (this.mpType !== 'app') {
  1324. initRefs(this);
  1325. initMocks(this, mocks);
  1326. }
  1327. } });
  1328. var appOptions = {
  1329. onLaunch: function onLaunch(args) {
  1330. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1331. return;
  1332. }
  1333. {
  1334. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1335. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1336. }
  1337. }
  1338. this.$vm = vm;
  1339. this.$vm.$mp = {
  1340. app: this };
  1341. this.$vm.$scope = this;
  1342. // vm 上也挂载 globalData
  1343. this.$vm.globalData = this.globalData;
  1344. this.$vm._isMounted = true;
  1345. this.$vm.__call_hook('mounted', args);
  1346. this.$vm.__call_hook('onLaunch', args);
  1347. } };
  1348. // 兼容旧版本 globalData
  1349. appOptions.globalData = vm.$options.globalData || {};
  1350. // 将 methods 中的方法挂在 getApp() 中
  1351. var methods = vm.$options.methods;
  1352. if (methods) {
  1353. Object.keys(methods).forEach(function (name) {
  1354. appOptions[name] = methods[name];
  1355. });
  1356. }
  1357. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1358. initHooks(appOptions, hooks);
  1359. return appOptions;
  1360. }
  1361. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1362. function findVmByVueId(vm, vuePid) {
  1363. var $children = vm.$children;
  1364. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1365. for (var i = $children.length - 1; i >= 0; i--) {
  1366. var childVm = $children[i];
  1367. if (childVm.$scope._$vueId === vuePid) {
  1368. return childVm;
  1369. }
  1370. }
  1371. // 反向递归查找
  1372. var parentVm;
  1373. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1374. parentVm = findVmByVueId($children[_i], vuePid);
  1375. if (parentVm) {
  1376. return parentVm;
  1377. }
  1378. }
  1379. }
  1380. function initBehavior(options) {
  1381. return Behavior(options);
  1382. }
  1383. function isPage() {
  1384. return !!this.route;
  1385. }
  1386. function initRelation(detail) {
  1387. this.triggerEvent('__l', detail);
  1388. }
  1389. function selectAllComponents(mpInstance, selector, $refs) {
  1390. var components = mpInstance.selectAllComponents(selector);
  1391. components.forEach(function (component) {
  1392. var ref = component.dataset.ref;
  1393. $refs[ref] = component.$vm || component;
  1394. {
  1395. if (component.dataset.vueGeneric === 'scoped') {
  1396. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1397. selectAllComponents(scopedComponent, selector, $refs);
  1398. });
  1399. }
  1400. }
  1401. });
  1402. }
  1403. function initRefs(vm) {
  1404. var mpInstance = vm.$scope;
  1405. Object.defineProperty(vm, '$refs', {
  1406. get: function get() {
  1407. var $refs = {};
  1408. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1409. // TODO 暂不考虑 for 中的 scoped
  1410. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1411. forComponents.forEach(function (component) {
  1412. var ref = component.dataset.ref;
  1413. if (!$refs[ref]) {
  1414. $refs[ref] = [];
  1415. }
  1416. $refs[ref].push(component.$vm || component);
  1417. });
  1418. return $refs;
  1419. } });
  1420. }
  1421. function handleLink(event) {var _ref4 =
  1422. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1423. var parentVm;
  1424. if (vuePid) {
  1425. parentVm = findVmByVueId(this.$vm, vuePid);
  1426. }
  1427. if (!parentVm) {
  1428. parentVm = this.$vm;
  1429. }
  1430. vueOptions.parent = parentVm;
  1431. }
  1432. function parseApp(vm) {
  1433. return parseBaseApp(vm, {
  1434. mocks: mocks,
  1435. initRefs: initRefs });
  1436. }
  1437. function createApp(vm) {
  1438. App(parseApp(vm));
  1439. return vm;
  1440. }
  1441. var encodeReserveRE = /[!'()*]/g;
  1442. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1443. var commaRE = /%2C/g;
  1444. // fixed encodeURIComponent which is more conformant to RFC3986:
  1445. // - escapes [!'()*]
  1446. // - preserve commas
  1447. var encode = function encode(str) {return encodeURIComponent(str).
  1448. replace(encodeReserveRE, encodeReserveReplacer).
  1449. replace(commaRE, ',');};
  1450. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1451. var res = obj ? Object.keys(obj).map(function (key) {
  1452. var val = obj[key];
  1453. if (val === undefined) {
  1454. return '';
  1455. }
  1456. if (val === null) {
  1457. return encodeStr(key);
  1458. }
  1459. if (Array.isArray(val)) {
  1460. var result = [];
  1461. val.forEach(function (val2) {
  1462. if (val2 === undefined) {
  1463. return;
  1464. }
  1465. if (val2 === null) {
  1466. result.push(encodeStr(key));
  1467. } else {
  1468. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1469. }
  1470. });
  1471. return result.join('&');
  1472. }
  1473. return encodeStr(key) + '=' + encodeStr(val);
  1474. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1475. return res ? "?".concat(res) : '';
  1476. }
  1477. function parseBaseComponent(vueComponentOptions)
  1478. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1479. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1480. var options = _objectSpread({
  1481. multipleSlots: true,
  1482. addGlobalClass: true },
  1483. vueOptions.options || {});
  1484. {
  1485. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1486. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1487. Object.assign(options, vueOptions['mp-weixin'].options);
  1488. }
  1489. }
  1490. var componentOptions = {
  1491. options: options,
  1492. data: initData(vueOptions, _vue.default.prototype),
  1493. behaviors: initBehaviors(vueOptions, initBehavior),
  1494. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1495. lifetimes: {
  1496. attached: function attached() {
  1497. var properties = this.properties;
  1498. var options = {
  1499. mpType: isPage.call(this) ? 'page' : 'component',
  1500. mpInstance: this,
  1501. propsData: properties };
  1502. initVueIds(properties.vueId, this);
  1503. // 处理父子关系
  1504. initRelation.call(this, {
  1505. vuePid: this._$vuePid,
  1506. vueOptions: options });
  1507. // 初始化 vue 实例
  1508. this.$vm = new VueComponent(options);
  1509. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1510. initSlots(this.$vm, properties.vueSlots);
  1511. // 触发首次 setData
  1512. this.$vm.$mount();
  1513. },
  1514. ready: function ready() {
  1515. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1516. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1517. if (this.$vm) {
  1518. this.$vm._isMounted = true;
  1519. this.$vm.__call_hook('mounted');
  1520. this.$vm.__call_hook('onReady');
  1521. }
  1522. },
  1523. detached: function detached() {
  1524. this.$vm && this.$vm.$destroy();
  1525. } },
  1526. pageLifetimes: {
  1527. show: function show(args) {
  1528. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1529. },
  1530. hide: function hide() {
  1531. this.$vm && this.$vm.__call_hook('onPageHide');
  1532. },
  1533. resize: function resize(size) {
  1534. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1535. } },
  1536. methods: {
  1537. __l: handleLink,
  1538. __e: handleEvent } };
  1539. // externalClasses
  1540. if (vueOptions.externalClasses) {
  1541. componentOptions.externalClasses = vueOptions.externalClasses;
  1542. }
  1543. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1544. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1545. componentOptions.methods[callMethod] = function (args) {
  1546. return this.$vm[callMethod](args);
  1547. };
  1548. });
  1549. }
  1550. if (isPage) {
  1551. return componentOptions;
  1552. }
  1553. return [componentOptions, VueComponent];
  1554. }
  1555. function parseComponent(vueComponentOptions) {
  1556. return parseBaseComponent(vueComponentOptions, {
  1557. isPage: isPage,
  1558. initRelation: initRelation });
  1559. }
  1560. var hooks$1 = [
  1561. 'onShow',
  1562. 'onHide',
  1563. 'onUnload'];
  1564. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1565. function parseBasePage(vuePageOptions, _ref6)
  1566. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1567. var pageOptions = parseComponent(vuePageOptions);
  1568. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1569. pageOptions.methods.onLoad = function (query) {
  1570. this.options = query;
  1571. var copyQuery = Object.assign({}, query);
  1572. delete copyQuery.__id__;
  1573. this.$page = {
  1574. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1575. this.$vm.$mp.query = query; // 兼容 mpvue
  1576. this.$vm.__call_hook('onLoad', query);
  1577. };
  1578. return pageOptions;
  1579. }
  1580. function parsePage(vuePageOptions) {
  1581. return parseBasePage(vuePageOptions, {
  1582. isPage: isPage,
  1583. initRelation: initRelation });
  1584. }
  1585. function createPage(vuePageOptions) {
  1586. {
  1587. return Component(parsePage(vuePageOptions));
  1588. }
  1589. }
  1590. function createComponent(vueOptions) {
  1591. {
  1592. return Component(parseComponent(vueOptions));
  1593. }
  1594. }
  1595. function createSubpackageApp(vm) {
  1596. var appOptions = parseApp(vm);
  1597. var app = getApp({
  1598. allowDefault: true });
  1599. vm.$scope = app;
  1600. var globalData = app.globalData;
  1601. if (globalData) {
  1602. Object.keys(appOptions.globalData).forEach(function (name) {
  1603. if (!hasOwn(globalData, name)) {
  1604. globalData[name] = appOptions.globalData[name];
  1605. }
  1606. });
  1607. }
  1608. Object.keys(appOptions).forEach(function (name) {
  1609. if (!hasOwn(app, name)) {
  1610. app[name] = appOptions[name];
  1611. }
  1612. });
  1613. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1614. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1615. vm.__call_hook('onShow', args);
  1616. });
  1617. }
  1618. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1619. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1620. vm.__call_hook('onHide', args);
  1621. });
  1622. }
  1623. if (isFn(appOptions.onLaunch)) {
  1624. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1625. vm.__call_hook('onLaunch', args);
  1626. }
  1627. return vm;
  1628. }
  1629. function createPlugin(vm) {
  1630. var appOptions = parseApp(vm);
  1631. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1632. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1633. appOptions.onShow.apply(vm, args);
  1634. });
  1635. }
  1636. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1637. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1638. appOptions.onHide.apply(vm, args);
  1639. });
  1640. }
  1641. if (isFn(appOptions.onLaunch)) {
  1642. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1643. appOptions.onLaunch.call(vm, args);
  1644. }
  1645. return vm;
  1646. }
  1647. todos.forEach(function (todoApi) {
  1648. protocols[todoApi] = false;
  1649. });
  1650. canIUses.forEach(function (canIUseApi) {
  1651. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1652. canIUseApi;
  1653. if (!wx.canIUse(apiName)) {
  1654. protocols[canIUseApi] = false;
  1655. }
  1656. });
  1657. var uni = {};
  1658. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1659. uni = new Proxy({}, {
  1660. get: function get(target, name) {
  1661. if (hasOwn(target, name)) {
  1662. return target[name];
  1663. }
  1664. if (baseApi[name]) {
  1665. return baseApi[name];
  1666. }
  1667. if (api[name]) {
  1668. return promisify(name, api[name]);
  1669. }
  1670. {
  1671. if (extraApi[name]) {
  1672. return promisify(name, extraApi[name]);
  1673. }
  1674. if (todoApis[name]) {
  1675. return promisify(name, todoApis[name]);
  1676. }
  1677. }
  1678. if (eventApi[name]) {
  1679. return eventApi[name];
  1680. }
  1681. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1682. return;
  1683. }
  1684. return promisify(name, wrapper(name, wx[name]));
  1685. },
  1686. set: function set(target, name, value) {
  1687. target[name] = value;
  1688. return true;
  1689. } });
  1690. } else {
  1691. Object.keys(baseApi).forEach(function (name) {
  1692. uni[name] = baseApi[name];
  1693. });
  1694. {
  1695. Object.keys(todoApis).forEach(function (name) {
  1696. uni[name] = promisify(name, todoApis[name]);
  1697. });
  1698. Object.keys(extraApi).forEach(function (name) {
  1699. uni[name] = promisify(name, todoApis[name]);
  1700. });
  1701. }
  1702. Object.keys(eventApi).forEach(function (name) {
  1703. uni[name] = eventApi[name];
  1704. });
  1705. Object.keys(api).forEach(function (name) {
  1706. uni[name] = promisify(name, api[name]);
  1707. });
  1708. Object.keys(wx).forEach(function (name) {
  1709. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1710. uni[name] = promisify(name, wrapper(name, wx[name]));
  1711. }
  1712. });
  1713. }
  1714. wx.createApp = createApp;
  1715. wx.createPage = createPage;
  1716. wx.createComponent = createComponent;
  1717. wx.createSubpackageApp = createSubpackageApp;
  1718. wx.createPlugin = createPlugin;
  1719. var uni$1 = uni;var _default =
  1720. uni$1;exports.default = _default;
  1721. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1722. /***/ }),
  1723. /***/ 108:
  1724. /*!***********************************************************************************************!*\
  1725. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  1726. \***********************************************************************************************/
  1727. /*! no static exports found */
  1728. /***/ (function(module, exports, __webpack_require__) {
  1729. "use strict";
  1730. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1731. "id": "2852637",
  1732. "name": "uniui图标库",
  1733. "font_family": "uniicons",
  1734. "css_prefix_text": "uniui-",
  1735. "description": "",
  1736. "glyphs": [
  1737. {
  1738. "icon_id": "25027049",
  1739. "name": "yanse",
  1740. "font_class": "color",
  1741. "unicode": "e6cf",
  1742. "unicode_decimal": 59087 },
  1743. {
  1744. "icon_id": "25027048",
  1745. "name": "wallet",
  1746. "font_class": "wallet",
  1747. "unicode": "e6b1",
  1748. "unicode_decimal": 59057 },
  1749. {
  1750. "icon_id": "25015720",
  1751. "name": "settings-filled",
  1752. "font_class": "settings-filled",
  1753. "unicode": "e6ce",
  1754. "unicode_decimal": 59086 },
  1755. {
  1756. "icon_id": "25015434",
  1757. "name": "shimingrenzheng-filled",
  1758. "font_class": "auth-filled",
  1759. "unicode": "e6cc",
  1760. "unicode_decimal": 59084 },
  1761. {
  1762. "icon_id": "24934246",
  1763. "name": "shop-filled",
  1764. "font_class": "shop-filled",
  1765. "unicode": "e6cd",
  1766. "unicode_decimal": 59085 },
  1767. {
  1768. "icon_id": "24934159",
  1769. "name": "staff-filled-01",
  1770. "font_class": "staff-filled",
  1771. "unicode": "e6cb",
  1772. "unicode_decimal": 59083 },
  1773. {
  1774. "icon_id": "24932461",
  1775. "name": "VIP-filled",
  1776. "font_class": "vip-filled",
  1777. "unicode": "e6c6",
  1778. "unicode_decimal": 59078 },
  1779. {
  1780. "icon_id": "24932462",
  1781. "name": "plus_circle_fill",
  1782. "font_class": "plus-filled",
  1783. "unicode": "e6c7",
  1784. "unicode_decimal": 59079 },
  1785. {
  1786. "icon_id": "24932463",
  1787. "name": "folder_add-filled",
  1788. "font_class": "folder-add-filled",
  1789. "unicode": "e6c8",
  1790. "unicode_decimal": 59080 },
  1791. {
  1792. "icon_id": "24932464",
  1793. "name": "yanse-filled",
  1794. "font_class": "color-filled",
  1795. "unicode": "e6c9",
  1796. "unicode_decimal": 59081 },
  1797. {
  1798. "icon_id": "24932465",
  1799. "name": "tune-filled",
  1800. "font_class": "tune-filled",
  1801. "unicode": "e6ca",
  1802. "unicode_decimal": 59082 },
  1803. {
  1804. "icon_id": "24932455",
  1805. "name": "a-rilidaka-filled",
  1806. "font_class": "calendar-filled",
  1807. "unicode": "e6c0",
  1808. "unicode_decimal": 59072 },
  1809. {
  1810. "icon_id": "24932456",
  1811. "name": "notification-filled",
  1812. "font_class": "notification-filled",
  1813. "unicode": "e6c1",
  1814. "unicode_decimal": 59073 },
  1815. {
  1816. "icon_id": "24932457",
  1817. "name": "wallet-filled",
  1818. "font_class": "wallet-filled",
  1819. "unicode": "e6c2",
  1820. "unicode_decimal": 59074 },
  1821. {
  1822. "icon_id": "24932458",
  1823. "name": "paihangbang-filled",
  1824. "font_class": "medal-filled",
  1825. "unicode": "e6c3",
  1826. "unicode_decimal": 59075 },
  1827. {
  1828. "icon_id": "24932459",
  1829. "name": "gift-filled",
  1830. "font_class": "gift-filled",
  1831. "unicode": "e6c4",
  1832. "unicode_decimal": 59076 },
  1833. {
  1834. "icon_id": "24932460",
  1835. "name": "fire-filled",
  1836. "font_class": "fire-filled",
  1837. "unicode": "e6c5",
  1838. "unicode_decimal": 59077 },
  1839. {
  1840. "icon_id": "24928001",
  1841. "name": "refreshempty",
  1842. "font_class": "refreshempty",
  1843. "unicode": "e6bf",
  1844. "unicode_decimal": 59071 },
  1845. {
  1846. "icon_id": "24926853",
  1847. "name": "location-ellipse",
  1848. "font_class": "location-filled",
  1849. "unicode": "e6af",
  1850. "unicode_decimal": 59055 },
  1851. {
  1852. "icon_id": "24926735",
  1853. "name": "person-filled",
  1854. "font_class": "person-filled",
  1855. "unicode": "e69d",
  1856. "unicode_decimal": 59037 },
  1857. {
  1858. "icon_id": "24926703",
  1859. "name": "personadd-filled",
  1860. "font_class": "personadd-filled",
  1861. "unicode": "e698",
  1862. "unicode_decimal": 59032 },
  1863. {
  1864. "icon_id": "24923351",
  1865. "name": "back",
  1866. "font_class": "back",
  1867. "unicode": "e6b9",
  1868. "unicode_decimal": 59065 },
  1869. {
  1870. "icon_id": "24923352",
  1871. "name": "forward",
  1872. "font_class": "forward",
  1873. "unicode": "e6ba",
  1874. "unicode_decimal": 59066 },
  1875. {
  1876. "icon_id": "24923353",
  1877. "name": "arrowthinright",
  1878. "font_class": "arrow-right",
  1879. "unicode": "e6bb",
  1880. "unicode_decimal": 59067 },
  1881. {
  1882. "icon_id": "24923353",
  1883. "name": "arrowthinright",
  1884. "font_class": "arrowthinright",
  1885. "unicode": "e6bb",
  1886. "unicode_decimal": 59067 },
  1887. {
  1888. "icon_id": "24923354",
  1889. "name": "arrowthinleft",
  1890. "font_class": "arrow-left",
  1891. "unicode": "e6bc",
  1892. "unicode_decimal": 59068 },
  1893. {
  1894. "icon_id": "24923354",
  1895. "name": "arrowthinleft",
  1896. "font_class": "arrowthinleft",
  1897. "unicode": "e6bc",
  1898. "unicode_decimal": 59068 },
  1899. {
  1900. "icon_id": "24923355",
  1901. "name": "arrowthinup",
  1902. "font_class": "arrow-up",
  1903. "unicode": "e6bd",
  1904. "unicode_decimal": 59069 },
  1905. {
  1906. "icon_id": "24923355",
  1907. "name": "arrowthinup",
  1908. "font_class": "arrowthinup",
  1909. "unicode": "e6bd",
  1910. "unicode_decimal": 59069 },
  1911. {
  1912. "icon_id": "24923356",
  1913. "name": "arrowthindown",
  1914. "font_class": "arrow-down",
  1915. "unicode": "e6be",
  1916. "unicode_decimal": 59070 },
  1917. {
  1918. "icon_id": "24923356",
  1919. "name": "arrowthindown",
  1920. "font_class": "arrowthindown",
  1921. "unicode": "e6be",
  1922. "unicode_decimal": 59070 },
  1923. {
  1924. "icon_id": "24923349",
  1925. "name": "arrowdown",
  1926. "font_class": "bottom",
  1927. "unicode": "e6b8",
  1928. "unicode_decimal": 59064 },
  1929. {
  1930. "icon_id": "24923349",
  1931. "name": "arrowdown",
  1932. "font_class": "arrowdown",
  1933. "unicode": "e6b8",
  1934. "unicode_decimal": 59064 },
  1935. {
  1936. "icon_id": "24923346",
  1937. "name": "arrowright",
  1938. "font_class": "right",
  1939. "unicode": "e6b5",
  1940. "unicode_decimal": 59061 },
  1941. {
  1942. "icon_id": "24923346",
  1943. "name": "arrowright",
  1944. "font_class": "arrowright",
  1945. "unicode": "e6b5",
  1946. "unicode_decimal": 59061 },
  1947. {
  1948. "icon_id": "24923347",
  1949. "name": "arrowup",
  1950. "font_class": "top",
  1951. "unicode": "e6b6",
  1952. "unicode_decimal": 59062 },
  1953. {
  1954. "icon_id": "24923347",
  1955. "name": "arrowup",
  1956. "font_class": "arrowup",
  1957. "unicode": "e6b6",
  1958. "unicode_decimal": 59062 },
  1959. {
  1960. "icon_id": "24923348",
  1961. "name": "arrowleft",
  1962. "font_class": "left",
  1963. "unicode": "e6b7",
  1964. "unicode_decimal": 59063 },
  1965. {
  1966. "icon_id": "24923348",
  1967. "name": "arrowleft",
  1968. "font_class": "arrowleft",
  1969. "unicode": "e6b7",
  1970. "unicode_decimal": 59063 },
  1971. {
  1972. "icon_id": "24923334",
  1973. "name": "eye",
  1974. "font_class": "eye",
  1975. "unicode": "e651",
  1976. "unicode_decimal": 58961 },
  1977. {
  1978. "icon_id": "24923335",
  1979. "name": "eye-filled",
  1980. "font_class": "eye-filled",
  1981. "unicode": "e66a",
  1982. "unicode_decimal": 58986 },
  1983. {
  1984. "icon_id": "24923336",
  1985. "name": "eye-slash",
  1986. "font_class": "eye-slash",
  1987. "unicode": "e6b3",
  1988. "unicode_decimal": 59059 },
  1989. {
  1990. "icon_id": "24923337",
  1991. "name": "eye-slash-filled",
  1992. "font_class": "eye-slash-filled",
  1993. "unicode": "e6b4",
  1994. "unicode_decimal": 59060 },
  1995. {
  1996. "icon_id": "24923305",
  1997. "name": "info-filled",
  1998. "font_class": "info-filled",
  1999. "unicode": "e649",
  2000. "unicode_decimal": 58953 },
  2001. {
  2002. "icon_id": "24923299",
  2003. "name": "reload-01",
  2004. "font_class": "reload",
  2005. "unicode": "e6b2",
  2006. "unicode_decimal": 59058 },
  2007. {
  2008. "icon_id": "24923195",
  2009. "name": "mic_slash_fill",
  2010. "font_class": "micoff-filled",
  2011. "unicode": "e6b0",
  2012. "unicode_decimal": 59056 },
  2013. {
  2014. "icon_id": "24923165",
  2015. "name": "map-pin-ellipse",
  2016. "font_class": "map-pin-ellipse",
  2017. "unicode": "e6ac",
  2018. "unicode_decimal": 59052 },
  2019. {
  2020. "icon_id": "24923166",
  2021. "name": "map-pin",
  2022. "font_class": "map-pin",
  2023. "unicode": "e6ad",
  2024. "unicode_decimal": 59053 },
  2025. {
  2026. "icon_id": "24923167",
  2027. "name": "location",
  2028. "font_class": "location",
  2029. "unicode": "e6ae",
  2030. "unicode_decimal": 59054 },
  2031. {
  2032. "icon_id": "24923064",
  2033. "name": "starhalf",
  2034. "font_class": "starhalf",
  2035. "unicode": "e683",
  2036. "unicode_decimal": 59011 },
  2037. {
  2038. "icon_id": "24923065",
  2039. "name": "star",
  2040. "font_class": "star",
  2041. "unicode": "e688",
  2042. "unicode_decimal": 59016 },
  2043. {
  2044. "icon_id": "24923066",
  2045. "name": "star-filled",
  2046. "font_class": "star-filled",
  2047. "unicode": "e68f",
  2048. "unicode_decimal": 59023 },
  2049. {
  2050. "icon_id": "24899646",
  2051. "name": "a-rilidaka",
  2052. "font_class": "calendar",
  2053. "unicode": "e6a0",
  2054. "unicode_decimal": 59040 },
  2055. {
  2056. "icon_id": "24899647",
  2057. "name": "fire",
  2058. "font_class": "fire",
  2059. "unicode": "e6a1",
  2060. "unicode_decimal": 59041 },
  2061. {
  2062. "icon_id": "24899648",
  2063. "name": "paihangbang",
  2064. "font_class": "medal",
  2065. "unicode": "e6a2",
  2066. "unicode_decimal": 59042 },
  2067. {
  2068. "icon_id": "24899649",
  2069. "name": "font",
  2070. "font_class": "font",
  2071. "unicode": "e6a3",
  2072. "unicode_decimal": 59043 },
  2073. {
  2074. "icon_id": "24899650",
  2075. "name": "gift",
  2076. "font_class": "gift",
  2077. "unicode": "e6a4",
  2078. "unicode_decimal": 59044 },
  2079. {
  2080. "icon_id": "24899651",
  2081. "name": "link",
  2082. "font_class": "link",
  2083. "unicode": "e6a5",
  2084. "unicode_decimal": 59045 },
  2085. {
  2086. "icon_id": "24899652",
  2087. "name": "notification",
  2088. "font_class": "notification",
  2089. "unicode": "e6a6",
  2090. "unicode_decimal": 59046 },
  2091. {
  2092. "icon_id": "24899653",
  2093. "name": "staff",
  2094. "font_class": "staff",
  2095. "unicode": "e6a7",
  2096. "unicode_decimal": 59047 },
  2097. {
  2098. "icon_id": "24899654",
  2099. "name": "VIP",
  2100. "font_class": "vip",
  2101. "unicode": "e6a8",
  2102. "unicode_decimal": 59048 },
  2103. {
  2104. "icon_id": "24899655",
  2105. "name": "folder_add",
  2106. "font_class": "folder-add",
  2107. "unicode": "e6a9",
  2108. "unicode_decimal": 59049 },
  2109. {
  2110. "icon_id": "24899656",
  2111. "name": "tune",
  2112. "font_class": "tune",
  2113. "unicode": "e6aa",
  2114. "unicode_decimal": 59050 },
  2115. {
  2116. "icon_id": "24899657",
  2117. "name": "shimingrenzheng",
  2118. "font_class": "auth",
  2119. "unicode": "e6ab",
  2120. "unicode_decimal": 59051 },
  2121. {
  2122. "icon_id": "24899565",
  2123. "name": "person",
  2124. "font_class": "person",
  2125. "unicode": "e699",
  2126. "unicode_decimal": 59033 },
  2127. {
  2128. "icon_id": "24899566",
  2129. "name": "email-filled",
  2130. "font_class": "email-filled",
  2131. "unicode": "e69a",
  2132. "unicode_decimal": 59034 },
  2133. {
  2134. "icon_id": "24899567",
  2135. "name": "phone-filled",
  2136. "font_class": "phone-filled",
  2137. "unicode": "e69b",
  2138. "unicode_decimal": 59035 },
  2139. {
  2140. "icon_id": "24899568",
  2141. "name": "phone",
  2142. "font_class": "phone",
  2143. "unicode": "e69c",
  2144. "unicode_decimal": 59036 },
  2145. {
  2146. "icon_id": "24899570",
  2147. "name": "email",
  2148. "font_class": "email",
  2149. "unicode": "e69e",
  2150. "unicode_decimal": 59038 },
  2151. {
  2152. "icon_id": "24899571",
  2153. "name": "personadd",
  2154. "font_class": "personadd",
  2155. "unicode": "e69f",
  2156. "unicode_decimal": 59039 },
  2157. {
  2158. "icon_id": "24899558",
  2159. "name": "chatboxes-filled",
  2160. "font_class": "chatboxes-filled",
  2161. "unicode": "e692",
  2162. "unicode_decimal": 59026 },
  2163. {
  2164. "icon_id": "24899559",
  2165. "name": "contact",
  2166. "font_class": "contact",
  2167. "unicode": "e693",
  2168. "unicode_decimal": 59027 },
  2169. {
  2170. "icon_id": "24899560",
  2171. "name": "chatbubble-filled",
  2172. "font_class": "chatbubble-filled",
  2173. "unicode": "e694",
  2174. "unicode_decimal": 59028 },
  2175. {
  2176. "icon_id": "24899561",
  2177. "name": "contact-filled",
  2178. "font_class": "contact-filled",
  2179. "unicode": "e695",
  2180. "unicode_decimal": 59029 },
  2181. {
  2182. "icon_id": "24899562",
  2183. "name": "chatboxes",
  2184. "font_class": "chatboxes",
  2185. "unicode": "e696",
  2186. "unicode_decimal": 59030 },
  2187. {
  2188. "icon_id": "24899563",
  2189. "name": "chatbubble",
  2190. "font_class": "chatbubble",
  2191. "unicode": "e697",
  2192. "unicode_decimal": 59031 },
  2193. {
  2194. "icon_id": "24881290",
  2195. "name": "upload-filled",
  2196. "font_class": "upload-filled",
  2197. "unicode": "e68e",
  2198. "unicode_decimal": 59022 },
  2199. {
  2200. "icon_id": "24881292",
  2201. "name": "upload",
  2202. "font_class": "upload",
  2203. "unicode": "e690",
  2204. "unicode_decimal": 59024 },
  2205. {
  2206. "icon_id": "24881293",
  2207. "name": "weixin",
  2208. "font_class": "weixin",
  2209. "unicode": "e691",
  2210. "unicode_decimal": 59025 },
  2211. {
  2212. "icon_id": "24881274",
  2213. "name": "compose",
  2214. "font_class": "compose",
  2215. "unicode": "e67f",
  2216. "unicode_decimal": 59007 },
  2217. {
  2218. "icon_id": "24881275",
  2219. "name": "qq",
  2220. "font_class": "qq",
  2221. "unicode": "e680",
  2222. "unicode_decimal": 59008 },
  2223. {
  2224. "icon_id": "24881276",
  2225. "name": "download-filled",
  2226. "font_class": "download-filled",
  2227. "unicode": "e681",
  2228. "unicode_decimal": 59009 },
  2229. {
  2230. "icon_id": "24881277",
  2231. "name": "pengyouquan",
  2232. "font_class": "pyq",
  2233. "unicode": "e682",
  2234. "unicode_decimal": 59010 },
  2235. {
  2236. "icon_id": "24881279",
  2237. "name": "sound",
  2238. "font_class": "sound",
  2239. "unicode": "e684",
  2240. "unicode_decimal": 59012 },
  2241. {
  2242. "icon_id": "24881280",
  2243. "name": "trash-filled",
  2244. "font_class": "trash-filled",
  2245. "unicode": "e685",
  2246. "unicode_decimal": 59013 },
  2247. {
  2248. "icon_id": "24881281",
  2249. "name": "sound-filled",
  2250. "font_class": "sound-filled",
  2251. "unicode": "e686",
  2252. "unicode_decimal": 59014 },
  2253. {
  2254. "icon_id": "24881282",
  2255. "name": "trash",
  2256. "font_class": "trash",
  2257. "unicode": "e687",
  2258. "unicode_decimal": 59015 },
  2259. {
  2260. "icon_id": "24881284",
  2261. "name": "videocam-filled",
  2262. "font_class": "videocam-filled",
  2263. "unicode": "e689",
  2264. "unicode_decimal": 59017 },
  2265. {
  2266. "icon_id": "24881285",
  2267. "name": "spinner-cycle",
  2268. "font_class": "spinner-cycle",
  2269. "unicode": "e68a",
  2270. "unicode_decimal": 59018 },
  2271. {
  2272. "icon_id": "24881286",
  2273. "name": "weibo",
  2274. "font_class": "weibo",
  2275. "unicode": "e68b",
  2276. "unicode_decimal": 59019 },
  2277. {
  2278. "icon_id": "24881288",
  2279. "name": "videocam",
  2280. "font_class": "videocam",
  2281. "unicode": "e68c",
  2282. "unicode_decimal": 59020 },
  2283. {
  2284. "icon_id": "24881289",
  2285. "name": "download",
  2286. "font_class": "download",
  2287. "unicode": "e68d",
  2288. "unicode_decimal": 59021 },
  2289. {
  2290. "icon_id": "24879601",
  2291. "name": "help",
  2292. "font_class": "help",
  2293. "unicode": "e679",
  2294. "unicode_decimal": 59001 },
  2295. {
  2296. "icon_id": "24879602",
  2297. "name": "navigate-filled",
  2298. "font_class": "navigate-filled",
  2299. "unicode": "e67a",
  2300. "unicode_decimal": 59002 },
  2301. {
  2302. "icon_id": "24879603",
  2303. "name": "plusempty",
  2304. "font_class": "plusempty",
  2305. "unicode": "e67b",
  2306. "unicode_decimal": 59003 },
  2307. {
  2308. "icon_id": "24879604",
  2309. "name": "smallcircle",
  2310. "font_class": "smallcircle",
  2311. "unicode": "e67c",
  2312. "unicode_decimal": 59004 },
  2313. {
  2314. "icon_id": "24879605",
  2315. "name": "minus-filled",
  2316. "font_class": "minus-filled",
  2317. "unicode": "e67d",
  2318. "unicode_decimal": 59005 },
  2319. {
  2320. "icon_id": "24879606",
  2321. "name": "micoff",
  2322. "font_class": "micoff",
  2323. "unicode": "e67e",
  2324. "unicode_decimal": 59006 },
  2325. {
  2326. "icon_id": "24879588",
  2327. "name": "closeempty",
  2328. "font_class": "closeempty",
  2329. "unicode": "e66c",
  2330. "unicode_decimal": 58988 },
  2331. {
  2332. "icon_id": "24879589",
  2333. "name": "clear",
  2334. "font_class": "clear",
  2335. "unicode": "e66d",
  2336. "unicode_decimal": 58989 },
  2337. {
  2338. "icon_id": "24879590",
  2339. "name": "navigate",
  2340. "font_class": "navigate",
  2341. "unicode": "e66e",
  2342. "unicode_decimal": 58990 },
  2343. {
  2344. "icon_id": "24879591",
  2345. "name": "minus",
  2346. "font_class": "minus",
  2347. "unicode": "e66f",
  2348. "unicode_decimal": 58991 },
  2349. {
  2350. "icon_id": "24879592",
  2351. "name": "image",
  2352. "font_class": "image",
  2353. "unicode": "e670",
  2354. "unicode_decimal": 58992 },
  2355. {
  2356. "icon_id": "24879593",
  2357. "name": "mic",
  2358. "font_class": "mic",
  2359. "unicode": "e671",
  2360. "unicode_decimal": 58993 },
  2361. {
  2362. "icon_id": "24879594",
  2363. "name": "paperplane",
  2364. "font_class": "paperplane",
  2365. "unicode": "e672",
  2366. "unicode_decimal": 58994 },
  2367. {
  2368. "icon_id": "24879595",
  2369. "name": "close",
  2370. "font_class": "close",
  2371. "unicode": "e673",
  2372. "unicode_decimal": 58995 },
  2373. {
  2374. "icon_id": "24879596",
  2375. "name": "help-filled",
  2376. "font_class": "help-filled",
  2377. "unicode": "e674",
  2378. "unicode_decimal": 58996 },
  2379. {
  2380. "icon_id": "24879597",
  2381. "name": "plus-filled",
  2382. "font_class": "paperplane-filled",
  2383. "unicode": "e675",
  2384. "unicode_decimal": 58997 },
  2385. {
  2386. "icon_id": "24879598",
  2387. "name": "plus",
  2388. "font_class": "plus",
  2389. "unicode": "e676",
  2390. "unicode_decimal": 58998 },
  2391. {
  2392. "icon_id": "24879599",
  2393. "name": "mic-filled",
  2394. "font_class": "mic-filled",
  2395. "unicode": "e677",
  2396. "unicode_decimal": 58999 },
  2397. {
  2398. "icon_id": "24879600",
  2399. "name": "image-filled",
  2400. "font_class": "image-filled",
  2401. "unicode": "e678",
  2402. "unicode_decimal": 59000 },
  2403. {
  2404. "icon_id": "24855900",
  2405. "name": "locked-filled",
  2406. "font_class": "locked-filled",
  2407. "unicode": "e668",
  2408. "unicode_decimal": 58984 },
  2409. {
  2410. "icon_id": "24855901",
  2411. "name": "info",
  2412. "font_class": "info",
  2413. "unicode": "e669",
  2414. "unicode_decimal": 58985 },
  2415. {
  2416. "icon_id": "24855903",
  2417. "name": "locked",
  2418. "font_class": "locked",
  2419. "unicode": "e66b",
  2420. "unicode_decimal": 58987 },
  2421. {
  2422. "icon_id": "24855884",
  2423. "name": "camera-filled",
  2424. "font_class": "camera-filled",
  2425. "unicode": "e658",
  2426. "unicode_decimal": 58968 },
  2427. {
  2428. "icon_id": "24855885",
  2429. "name": "chat-filled",
  2430. "font_class": "chat-filled",
  2431. "unicode": "e659",
  2432. "unicode_decimal": 58969 },
  2433. {
  2434. "icon_id": "24855886",
  2435. "name": "camera",
  2436. "font_class": "camera",
  2437. "unicode": "e65a",
  2438. "unicode_decimal": 58970 },
  2439. {
  2440. "icon_id": "24855887",
  2441. "name": "circle",
  2442. "font_class": "circle",
  2443. "unicode": "e65b",
  2444. "unicode_decimal": 58971 },
  2445. {
  2446. "icon_id": "24855888",
  2447. "name": "checkmarkempty",
  2448. "font_class": "checkmarkempty",
  2449. "unicode": "e65c",
  2450. "unicode_decimal": 58972 },
  2451. {
  2452. "icon_id": "24855889",
  2453. "name": "chat",
  2454. "font_class": "chat",
  2455. "unicode": "e65d",
  2456. "unicode_decimal": 58973 },
  2457. {
  2458. "icon_id": "24855890",
  2459. "name": "circle-filled",
  2460. "font_class": "circle-filled",
  2461. "unicode": "e65e",
  2462. "unicode_decimal": 58974 },
  2463. {
  2464. "icon_id": "24855891",
  2465. "name": "flag",
  2466. "font_class": "flag",
  2467. "unicode": "e65f",
  2468. "unicode_decimal": 58975 },
  2469. {
  2470. "icon_id": "24855892",
  2471. "name": "flag-filled",
  2472. "font_class": "flag-filled",
  2473. "unicode": "e660",
  2474. "unicode_decimal": 58976 },
  2475. {
  2476. "icon_id": "24855893",
  2477. "name": "gear-filled",
  2478. "font_class": "gear-filled",
  2479. "unicode": "e661",
  2480. "unicode_decimal": 58977 },
  2481. {
  2482. "icon_id": "24855894",
  2483. "name": "home",
  2484. "font_class": "home",
  2485. "unicode": "e662",
  2486. "unicode_decimal": 58978 },
  2487. {
  2488. "icon_id": "24855895",
  2489. "name": "home-filled",
  2490. "font_class": "home-filled",
  2491. "unicode": "e663",
  2492. "unicode_decimal": 58979 },
  2493. {
  2494. "icon_id": "24855896",
  2495. "name": "gear",
  2496. "font_class": "gear",
  2497. "unicode": "e664",
  2498. "unicode_decimal": 58980 },
  2499. {
  2500. "icon_id": "24855897",
  2501. "name": "smallcircle-filled",
  2502. "font_class": "smallcircle-filled",
  2503. "unicode": "e665",
  2504. "unicode_decimal": 58981 },
  2505. {
  2506. "icon_id": "24855898",
  2507. "name": "map-filled",
  2508. "font_class": "map-filled",
  2509. "unicode": "e666",
  2510. "unicode_decimal": 58982 },
  2511. {
  2512. "icon_id": "24855899",
  2513. "name": "map",
  2514. "font_class": "map",
  2515. "unicode": "e667",
  2516. "unicode_decimal": 58983 },
  2517. {
  2518. "icon_id": "24855825",
  2519. "name": "refresh-filled",
  2520. "font_class": "refresh-filled",
  2521. "unicode": "e656",
  2522. "unicode_decimal": 58966 },
  2523. {
  2524. "icon_id": "24855826",
  2525. "name": "refresh",
  2526. "font_class": "refresh",
  2527. "unicode": "e657",
  2528. "unicode_decimal": 58967 },
  2529. {
  2530. "icon_id": "24855808",
  2531. "name": "cloud-upload",
  2532. "font_class": "cloud-upload",
  2533. "unicode": "e645",
  2534. "unicode_decimal": 58949 },
  2535. {
  2536. "icon_id": "24855809",
  2537. "name": "cloud-download-filled",
  2538. "font_class": "cloud-download-filled",
  2539. "unicode": "e646",
  2540. "unicode_decimal": 58950 },
  2541. {
  2542. "icon_id": "24855810",
  2543. "name": "cloud-download",
  2544. "font_class": "cloud-download",
  2545. "unicode": "e647",
  2546. "unicode_decimal": 58951 },
  2547. {
  2548. "icon_id": "24855811",
  2549. "name": "cloud-upload-filled",
  2550. "font_class": "cloud-upload-filled",
  2551. "unicode": "e648",
  2552. "unicode_decimal": 58952 },
  2553. {
  2554. "icon_id": "24855813",
  2555. "name": "redo",
  2556. "font_class": "redo",
  2557. "unicode": "e64a",
  2558. "unicode_decimal": 58954 },
  2559. {
  2560. "icon_id": "24855814",
  2561. "name": "images-filled",
  2562. "font_class": "images-filled",
  2563. "unicode": "e64b",
  2564. "unicode_decimal": 58955 },
  2565. {
  2566. "icon_id": "24855815",
  2567. "name": "undo-filled",
  2568. "font_class": "undo-filled",
  2569. "unicode": "e64c",
  2570. "unicode_decimal": 58956 },
  2571. {
  2572. "icon_id": "24855816",
  2573. "name": "more",
  2574. "font_class": "more",
  2575. "unicode": "e64d",
  2576. "unicode_decimal": 58957 },
  2577. {
  2578. "icon_id": "24855817",
  2579. "name": "more-filled",
  2580. "font_class": "more-filled",
  2581. "unicode": "e64e",
  2582. "unicode_decimal": 58958 },
  2583. {
  2584. "icon_id": "24855818",
  2585. "name": "undo",
  2586. "font_class": "undo",
  2587. "unicode": "e64f",
  2588. "unicode_decimal": 58959 },
  2589. {
  2590. "icon_id": "24855819",
  2591. "name": "images",
  2592. "font_class": "images",
  2593. "unicode": "e650",
  2594. "unicode_decimal": 58960 },
  2595. {
  2596. "icon_id": "24855821",
  2597. "name": "paperclip",
  2598. "font_class": "paperclip",
  2599. "unicode": "e652",
  2600. "unicode_decimal": 58962 },
  2601. {
  2602. "icon_id": "24855822",
  2603. "name": "settings",
  2604. "font_class": "settings",
  2605. "unicode": "e653",
  2606. "unicode_decimal": 58963 },
  2607. {
  2608. "icon_id": "24855823",
  2609. "name": "search",
  2610. "font_class": "search",
  2611. "unicode": "e654",
  2612. "unicode_decimal": 58964 },
  2613. {
  2614. "icon_id": "24855824",
  2615. "name": "redo-filled",
  2616. "font_class": "redo-filled",
  2617. "unicode": "e655",
  2618. "unicode_decimal": 58965 },
  2619. {
  2620. "icon_id": "24841702",
  2621. "name": "list",
  2622. "font_class": "list",
  2623. "unicode": "e644",
  2624. "unicode_decimal": 58948 },
  2625. {
  2626. "icon_id": "24841489",
  2627. "name": "mail-open-filled",
  2628. "font_class": "mail-open-filled",
  2629. "unicode": "e63a",
  2630. "unicode_decimal": 58938 },
  2631. {
  2632. "icon_id": "24841491",
  2633. "name": "hand-thumbsdown-filled",
  2634. "font_class": "hand-down-filled",
  2635. "unicode": "e63c",
  2636. "unicode_decimal": 58940 },
  2637. {
  2638. "icon_id": "24841492",
  2639. "name": "hand-thumbsdown",
  2640. "font_class": "hand-down",
  2641. "unicode": "e63d",
  2642. "unicode_decimal": 58941 },
  2643. {
  2644. "icon_id": "24841493",
  2645. "name": "hand-thumbsup-filled",
  2646. "font_class": "hand-up-filled",
  2647. "unicode": "e63e",
  2648. "unicode_decimal": 58942 },
  2649. {
  2650. "icon_id": "24841494",
  2651. "name": "hand-thumbsup",
  2652. "font_class": "hand-up",
  2653. "unicode": "e63f",
  2654. "unicode_decimal": 58943 },
  2655. {
  2656. "icon_id": "24841496",
  2657. "name": "heart-filled",
  2658. "font_class": "heart-filled",
  2659. "unicode": "e641",
  2660. "unicode_decimal": 58945 },
  2661. {
  2662. "icon_id": "24841498",
  2663. "name": "mail-open",
  2664. "font_class": "mail-open",
  2665. "unicode": "e643",
  2666. "unicode_decimal": 58947 },
  2667. {
  2668. "icon_id": "24841488",
  2669. "name": "heart",
  2670. "font_class": "heart",
  2671. "unicode": "e639",
  2672. "unicode_decimal": 58937 },
  2673. {
  2674. "icon_id": "24839963",
  2675. "name": "loop",
  2676. "font_class": "loop",
  2677. "unicode": "e633",
  2678. "unicode_decimal": 58931 },
  2679. {
  2680. "icon_id": "24839866",
  2681. "name": "pulldown",
  2682. "font_class": "pulldown",
  2683. "unicode": "e632",
  2684. "unicode_decimal": 58930 },
  2685. {
  2686. "icon_id": "24813798",
  2687. "name": "scan",
  2688. "font_class": "scan",
  2689. "unicode": "e62a",
  2690. "unicode_decimal": 58922 },
  2691. {
  2692. "icon_id": "24813786",
  2693. "name": "bars",
  2694. "font_class": "bars",
  2695. "unicode": "e627",
  2696. "unicode_decimal": 58919 },
  2697. {
  2698. "icon_id": "24813788",
  2699. "name": "cart-filled",
  2700. "font_class": "cart-filled",
  2701. "unicode": "e629",
  2702. "unicode_decimal": 58921 },
  2703. {
  2704. "icon_id": "24813790",
  2705. "name": "checkbox",
  2706. "font_class": "checkbox",
  2707. "unicode": "e62b",
  2708. "unicode_decimal": 58923 },
  2709. {
  2710. "icon_id": "24813791",
  2711. "name": "checkbox-filled",
  2712. "font_class": "checkbox-filled",
  2713. "unicode": "e62c",
  2714. "unicode_decimal": 58924 },
  2715. {
  2716. "icon_id": "24813794",
  2717. "name": "shop",
  2718. "font_class": "shop",
  2719. "unicode": "e62f",
  2720. "unicode_decimal": 58927 },
  2721. {
  2722. "icon_id": "24813795",
  2723. "name": "headphones",
  2724. "font_class": "headphones",
  2725. "unicode": "e630",
  2726. "unicode_decimal": 58928 },
  2727. {
  2728. "icon_id": "24813796",
  2729. "name": "cart",
  2730. "font_class": "cart",
  2731. "unicode": "e631",
  2732. "unicode_decimal": 58929 }] };exports.default = _default;
  2733. /***/ }),
  2734. /***/ 11:
  2735. /*!**********************************************************************************************************!*\
  2736. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2737. \**********************************************************************************************************/
  2738. /*! exports provided: default */
  2739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2740. "use strict";
  2741. __webpack_require__.r(__webpack_exports__);
  2742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2743. /* globals __VUE_SSR_CONTEXT__ */
  2744. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2745. // This module is a runtime utility for cleaner component module output and will
  2746. // be included in the final webpack user bundle.
  2747. function normalizeComponent (
  2748. scriptExports,
  2749. render,
  2750. staticRenderFns,
  2751. functionalTemplate,
  2752. injectStyles,
  2753. scopeId,
  2754. moduleIdentifier, /* server only */
  2755. shadowMode, /* vue-cli only */
  2756. components, // fixed by xxxxxx auto components
  2757. renderjs // fixed by xxxxxx renderjs
  2758. ) {
  2759. // Vue.extend constructor export interop
  2760. var options = typeof scriptExports === 'function'
  2761. ? scriptExports.options
  2762. : scriptExports
  2763. // fixed by xxxxxx auto components
  2764. if (components) {
  2765. if (!options.components) {
  2766. options.components = {}
  2767. }
  2768. var hasOwn = Object.prototype.hasOwnProperty
  2769. for (var name in components) {
  2770. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2771. options.components[name] = components[name]
  2772. }
  2773. }
  2774. }
  2775. // fixed by xxxxxx renderjs
  2776. if (renderjs) {
  2777. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2778. this[renderjs.__module] = this
  2779. });
  2780. (options.mixins || (options.mixins = [])).push(renderjs)
  2781. }
  2782. // render functions
  2783. if (render) {
  2784. options.render = render
  2785. options.staticRenderFns = staticRenderFns
  2786. options._compiled = true
  2787. }
  2788. // functional template
  2789. if (functionalTemplate) {
  2790. options.functional = true
  2791. }
  2792. // scopedId
  2793. if (scopeId) {
  2794. options._scopeId = 'data-v-' + scopeId
  2795. }
  2796. var hook
  2797. if (moduleIdentifier) { // server build
  2798. hook = function (context) {
  2799. // 2.3 injection
  2800. context =
  2801. context || // cached call
  2802. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2803. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2804. // 2.2 with runInNewContext: true
  2805. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2806. context = __VUE_SSR_CONTEXT__
  2807. }
  2808. // inject component styles
  2809. if (injectStyles) {
  2810. injectStyles.call(this, context)
  2811. }
  2812. // register component module identifier for async chunk inferrence
  2813. if (context && context._registeredComponents) {
  2814. context._registeredComponents.add(moduleIdentifier)
  2815. }
  2816. }
  2817. // used by ssr in case component is cached and beforeCreate
  2818. // never gets called
  2819. options._ssrRegister = hook
  2820. } else if (injectStyles) {
  2821. hook = shadowMode
  2822. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2823. : injectStyles
  2824. }
  2825. if (hook) {
  2826. if (options.functional) {
  2827. // for template-only hot-reload because in that case the render fn doesn't
  2828. // go through the normalizer
  2829. options._injectStyles = hook
  2830. // register for functioal component in vue file
  2831. var originalRender = options.render
  2832. options.render = function renderWithStyleInjection (h, context) {
  2833. hook.call(context)
  2834. return originalRender(h, context)
  2835. }
  2836. } else {
  2837. // inject component registration as beforeCreate hook
  2838. var existing = options.beforeCreate
  2839. options.beforeCreate = existing
  2840. ? [].concat(existing, hook)
  2841. : [hook]
  2842. }
  2843. }
  2844. return {
  2845. exports: scriptExports,
  2846. options: options
  2847. }
  2848. }
  2849. /***/ }),
  2850. /***/ 18:
  2851. /*!**********************************************************!*\
  2852. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/utils/https.js ***!
  2853. \**********************************************************/
  2854. /*! no static exports found */
  2855. /***/ (function(module, exports, __webpack_require__) {
  2856. "use strict";
  2857. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2858. var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 19));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 区分开发环境和生产环境 接口地址
  2859. var baseUrl = _config.default.baseUrl;
  2860. // let baseUrl = 'http://60.191.110.205:19099/';
  2861. // let baseUrl = 'https://ksfdc.zjugis.com:19099/';
  2862. function https(config) {
  2863. //显示loading
  2864. wx.showLoading({
  2865. title: '正在请求中' });
  2866. //设置请求头
  2867. if (!config.header) {
  2868. config.header = {};
  2869. }
  2870. if (!config.header['content-type']) {
  2871. config.header['content-type'] = 'application/json';
  2872. }
  2873. config.url = baseUrl + config.url; // 请求地址
  2874. var promise = new Promise(function (resolve, reject) {
  2875. uni.request(config).then(function (res) {
  2876. wx.hideLoading(); //隐藏loading
  2877. if (res[0]) {
  2878. uni.showToast({
  2879. title: "数据获取失败",
  2880. icon: "none",
  2881. duration: 1500 });
  2882. reject(false);
  2883. } else {
  2884. var data = res[1].data;
  2885. if (data.code == 1) {
  2886. resolve(data);
  2887. } else {
  2888. resolve(data);
  2889. }
  2890. }
  2891. }).catch(function (error) {
  2892. wx.hideLoading(); //隐藏loading
  2893. reject(error);
  2894. });
  2895. });
  2896. return promise;
  2897. }var _default =
  2898. https;exports.default = _default;
  2899. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2900. /***/ }),
  2901. /***/ 19:
  2902. /*!***********************************************************!*\
  2903. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/utils/config.js ***!
  2904. \***********************************************************/
  2905. /*! no static exports found */
  2906. /***/ (function(module, exports, __webpack_require__) {
  2907. "use strict";
  2908. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var config = {
  2909. //发布线上需要吧login里面地址跟这里替换掉
  2910. // baseUrl: "http://10.10.9.71:7089/ysgzybz/",
  2911. // webViewUrl: "http://10.10.9.58:8083/#/",
  2912. baseUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/ybz-api/",
  2913. webViewUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view/#/",
  2914. bjdkgl: 'https://zlzd.zrzyt.zj.gov.cn/arcMapServer216/arcgis/rest/services/YSYBZ/BJ_DKGL/MapServer' };var _default =
  2915. config;exports.default = _default;
  2916. /***/ }),
  2917. /***/ 2:
  2918. /*!***********************************!*\
  2919. !*** (webpack)/buildin/global.js ***!
  2920. \***********************************/
  2921. /*! no static exports found */
  2922. /***/ (function(module, exports) {
  2923. var g;
  2924. // This works in non-strict mode
  2925. g = (function() {
  2926. return this;
  2927. })();
  2928. try {
  2929. // This works if eval is allowed (see CSP)
  2930. g = g || new Function("return this")();
  2931. } catch (e) {
  2932. // This works if the window reference is available
  2933. if (typeof window === "object") g = window;
  2934. }
  2935. // g can still be undefined, but nothing to do about it...
  2936. // We return undefined, instead of nothing here, so it's
  2937. // easier to handle this case. if(!global) { ...}
  2938. module.exports = g;
  2939. /***/ }),
  2940. /***/ 3:
  2941. /*!******************************************************************************************!*\
  2942. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2943. \******************************************************************************************/
  2944. /*! exports provided: default */
  2945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2946. "use strict";
  2947. __webpack_require__.r(__webpack_exports__);
  2948. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2949. * Vue.js v2.6.11
  2950. * (c) 2014-2021 Evan You
  2951. * Released under the MIT License.
  2952. */
  2953. /* */
  2954. var emptyObject = Object.freeze({});
  2955. // These helpers produce better VM code in JS engines due to their
  2956. // explicitness and function inlining.
  2957. function isUndef (v) {
  2958. return v === undefined || v === null
  2959. }
  2960. function isDef (v) {
  2961. return v !== undefined && v !== null
  2962. }
  2963. function isTrue (v) {
  2964. return v === true
  2965. }
  2966. function isFalse (v) {
  2967. return v === false
  2968. }
  2969. /**
  2970. * Check if value is primitive.
  2971. */
  2972. function isPrimitive (value) {
  2973. return (
  2974. typeof value === 'string' ||
  2975. typeof value === 'number' ||
  2976. // $flow-disable-line
  2977. typeof value === 'symbol' ||
  2978. typeof value === 'boolean'
  2979. )
  2980. }
  2981. /**
  2982. * Quick object check - this is primarily used to tell
  2983. * Objects from primitive values when we know the value
  2984. * is a JSON-compliant type.
  2985. */
  2986. function isObject (obj) {
  2987. return obj !== null && typeof obj === 'object'
  2988. }
  2989. /**
  2990. * Get the raw type string of a value, e.g., [object Object].
  2991. */
  2992. var _toString = Object.prototype.toString;
  2993. function toRawType (value) {
  2994. return _toString.call(value).slice(8, -1)
  2995. }
  2996. /**
  2997. * Strict object type check. Only returns true
  2998. * for plain JavaScript objects.
  2999. */
  3000. function isPlainObject (obj) {
  3001. return _toString.call(obj) === '[object Object]'
  3002. }
  3003. function isRegExp (v) {
  3004. return _toString.call(v) === '[object RegExp]'
  3005. }
  3006. /**
  3007. * Check if val is a valid array index.
  3008. */
  3009. function isValidArrayIndex (val) {
  3010. var n = parseFloat(String(val));
  3011. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3012. }
  3013. function isPromise (val) {
  3014. return (
  3015. isDef(val) &&
  3016. typeof val.then === 'function' &&
  3017. typeof val.catch === 'function'
  3018. )
  3019. }
  3020. /**
  3021. * Convert a value to a string that is actually rendered.
  3022. */
  3023. function toString (val) {
  3024. return val == null
  3025. ? ''
  3026. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3027. ? JSON.stringify(val, null, 2)
  3028. : String(val)
  3029. }
  3030. /**
  3031. * Convert an input value to a number for persistence.
  3032. * If the conversion fails, return original string.
  3033. */
  3034. function toNumber (val) {
  3035. var n = parseFloat(val);
  3036. return isNaN(n) ? val : n
  3037. }
  3038. /**
  3039. * Make a map and return a function for checking if a key
  3040. * is in that map.
  3041. */
  3042. function makeMap (
  3043. str,
  3044. expectsLowerCase
  3045. ) {
  3046. var map = Object.create(null);
  3047. var list = str.split(',');
  3048. for (var i = 0; i < list.length; i++) {
  3049. map[list[i]] = true;
  3050. }
  3051. return expectsLowerCase
  3052. ? function (val) { return map[val.toLowerCase()]; }
  3053. : function (val) { return map[val]; }
  3054. }
  3055. /**
  3056. * Check if a tag is a built-in tag.
  3057. */
  3058. var isBuiltInTag = makeMap('slot,component', true);
  3059. /**
  3060. * Check if an attribute is a reserved attribute.
  3061. */
  3062. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3063. /**
  3064. * Remove an item from an array.
  3065. */
  3066. function remove (arr, item) {
  3067. if (arr.length) {
  3068. var index = arr.indexOf(item);
  3069. if (index > -1) {
  3070. return arr.splice(index, 1)
  3071. }
  3072. }
  3073. }
  3074. /**
  3075. * Check whether an object has the property.
  3076. */
  3077. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3078. function hasOwn (obj, key) {
  3079. return hasOwnProperty.call(obj, key)
  3080. }
  3081. /**
  3082. * Create a cached version of a pure function.
  3083. */
  3084. function cached (fn) {
  3085. var cache = Object.create(null);
  3086. return (function cachedFn (str) {
  3087. var hit = cache[str];
  3088. return hit || (cache[str] = fn(str))
  3089. })
  3090. }
  3091. /**
  3092. * Camelize a hyphen-delimited string.
  3093. */
  3094. var camelizeRE = /-(\w)/g;
  3095. var camelize = cached(function (str) {
  3096. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3097. });
  3098. /**
  3099. * Capitalize a string.
  3100. */
  3101. var capitalize = cached(function (str) {
  3102. return str.charAt(0).toUpperCase() + str.slice(1)
  3103. });
  3104. /**
  3105. * Hyphenate a camelCase string.
  3106. */
  3107. var hyphenateRE = /\B([A-Z])/g;
  3108. var hyphenate = cached(function (str) {
  3109. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3110. });
  3111. /**
  3112. * Simple bind polyfill for environments that do not support it,
  3113. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3114. * since native bind is now performant enough in most browsers.
  3115. * But removing it would mean breaking code that was able to run in
  3116. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3117. */
  3118. /* istanbul ignore next */
  3119. function polyfillBind (fn, ctx) {
  3120. function boundFn (a) {
  3121. var l = arguments.length;
  3122. return l
  3123. ? l > 1
  3124. ? fn.apply(ctx, arguments)
  3125. : fn.call(ctx, a)
  3126. : fn.call(ctx)
  3127. }
  3128. boundFn._length = fn.length;
  3129. return boundFn
  3130. }
  3131. function nativeBind (fn, ctx) {
  3132. return fn.bind(ctx)
  3133. }
  3134. var bind = Function.prototype.bind
  3135. ? nativeBind
  3136. : polyfillBind;
  3137. /**
  3138. * Convert an Array-like object to a real Array.
  3139. */
  3140. function toArray (list, start) {
  3141. start = start || 0;
  3142. var i = list.length - start;
  3143. var ret = new Array(i);
  3144. while (i--) {
  3145. ret[i] = list[i + start];
  3146. }
  3147. return ret
  3148. }
  3149. /**
  3150. * Mix properties into target object.
  3151. */
  3152. function extend (to, _from) {
  3153. for (var key in _from) {
  3154. to[key] = _from[key];
  3155. }
  3156. return to
  3157. }
  3158. /**
  3159. * Merge an Array of Objects into a single Object.
  3160. */
  3161. function toObject (arr) {
  3162. var res = {};
  3163. for (var i = 0; i < arr.length; i++) {
  3164. if (arr[i]) {
  3165. extend(res, arr[i]);
  3166. }
  3167. }
  3168. return res
  3169. }
  3170. /* eslint-disable no-unused-vars */
  3171. /**
  3172. * Perform no operation.
  3173. * Stubbing args to make Flow happy without leaving useless transpiled code
  3174. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3175. */
  3176. function noop (a, b, c) {}
  3177. /**
  3178. * Always return false.
  3179. */
  3180. var no = function (a, b, c) { return false; };
  3181. /* eslint-enable no-unused-vars */
  3182. /**
  3183. * Return the same value.
  3184. */
  3185. var identity = function (_) { return _; };
  3186. /**
  3187. * Check if two values are loosely equal - that is,
  3188. * if they are plain objects, do they have the same shape?
  3189. */
  3190. function looseEqual (a, b) {
  3191. if (a === b) { return true }
  3192. var isObjectA = isObject(a);
  3193. var isObjectB = isObject(b);
  3194. if (isObjectA && isObjectB) {
  3195. try {
  3196. var isArrayA = Array.isArray(a);
  3197. var isArrayB = Array.isArray(b);
  3198. if (isArrayA && isArrayB) {
  3199. return a.length === b.length && a.every(function (e, i) {
  3200. return looseEqual(e, b[i])
  3201. })
  3202. } else if (a instanceof Date && b instanceof Date) {
  3203. return a.getTime() === b.getTime()
  3204. } else if (!isArrayA && !isArrayB) {
  3205. var keysA = Object.keys(a);
  3206. var keysB = Object.keys(b);
  3207. return keysA.length === keysB.length && keysA.every(function (key) {
  3208. return looseEqual(a[key], b[key])
  3209. })
  3210. } else {
  3211. /* istanbul ignore next */
  3212. return false
  3213. }
  3214. } catch (e) {
  3215. /* istanbul ignore next */
  3216. return false
  3217. }
  3218. } else if (!isObjectA && !isObjectB) {
  3219. return String(a) === String(b)
  3220. } else {
  3221. return false
  3222. }
  3223. }
  3224. /**
  3225. * Return the first index at which a loosely equal value can be
  3226. * found in the array (if value is a plain object, the array must
  3227. * contain an object of the same shape), or -1 if it is not present.
  3228. */
  3229. function looseIndexOf (arr, val) {
  3230. for (var i = 0; i < arr.length; i++) {
  3231. if (looseEqual(arr[i], val)) { return i }
  3232. }
  3233. return -1
  3234. }
  3235. /**
  3236. * Ensure a function is called only once.
  3237. */
  3238. function once (fn) {
  3239. var called = false;
  3240. return function () {
  3241. if (!called) {
  3242. called = true;
  3243. fn.apply(this, arguments);
  3244. }
  3245. }
  3246. }
  3247. var ASSET_TYPES = [
  3248. 'component',
  3249. 'directive',
  3250. 'filter'
  3251. ];
  3252. var LIFECYCLE_HOOKS = [
  3253. 'beforeCreate',
  3254. 'created',
  3255. 'beforeMount',
  3256. 'mounted',
  3257. 'beforeUpdate',
  3258. 'updated',
  3259. 'beforeDestroy',
  3260. 'destroyed',
  3261. 'activated',
  3262. 'deactivated',
  3263. 'errorCaptured',
  3264. 'serverPrefetch'
  3265. ];
  3266. /* */
  3267. var config = ({
  3268. /**
  3269. * Option merge strategies (used in core/util/options)
  3270. */
  3271. // $flow-disable-line
  3272. optionMergeStrategies: Object.create(null),
  3273. /**
  3274. * Whether to suppress warnings.
  3275. */
  3276. silent: false,
  3277. /**
  3278. * Show production mode tip message on boot?
  3279. */
  3280. productionTip: "development" !== 'production',
  3281. /**
  3282. * Whether to enable devtools
  3283. */
  3284. devtools: "development" !== 'production',
  3285. /**
  3286. * Whether to record perf
  3287. */
  3288. performance: false,
  3289. /**
  3290. * Error handler for watcher errors
  3291. */
  3292. errorHandler: null,
  3293. /**
  3294. * Warn handler for watcher warns
  3295. */
  3296. warnHandler: null,
  3297. /**
  3298. * Ignore certain custom elements
  3299. */
  3300. ignoredElements: [],
  3301. /**
  3302. * Custom user key aliases for v-on
  3303. */
  3304. // $flow-disable-line
  3305. keyCodes: Object.create(null),
  3306. /**
  3307. * Check if a tag is reserved so that it cannot be registered as a
  3308. * component. This is platform-dependent and may be overwritten.
  3309. */
  3310. isReservedTag: no,
  3311. /**
  3312. * Check if an attribute is reserved so that it cannot be used as a component
  3313. * prop. This is platform-dependent and may be overwritten.
  3314. */
  3315. isReservedAttr: no,
  3316. /**
  3317. * Check if a tag is an unknown element.
  3318. * Platform-dependent.
  3319. */
  3320. isUnknownElement: no,
  3321. /**
  3322. * Get the namespace of an element
  3323. */
  3324. getTagNamespace: noop,
  3325. /**
  3326. * Parse the real tag name for the specific platform.
  3327. */
  3328. parsePlatformTagName: identity,
  3329. /**
  3330. * Check if an attribute must be bound using property, e.g. value
  3331. * Platform-dependent.
  3332. */
  3333. mustUseProp: no,
  3334. /**
  3335. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3336. * This will significantly reduce performance if set to false.
  3337. */
  3338. async: true,
  3339. /**
  3340. * Exposed for legacy reasons
  3341. */
  3342. _lifecycleHooks: LIFECYCLE_HOOKS
  3343. });
  3344. /* */
  3345. /**
  3346. * unicode letters used for parsing html tags, component names and property paths.
  3347. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3348. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3349. */
  3350. 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/;
  3351. /**
  3352. * Check if a string starts with $ or _
  3353. */
  3354. function isReserved (str) {
  3355. var c = (str + '').charCodeAt(0);
  3356. return c === 0x24 || c === 0x5F
  3357. }
  3358. /**
  3359. * Define a property.
  3360. */
  3361. function def (obj, key, val, enumerable) {
  3362. Object.defineProperty(obj, key, {
  3363. value: val,
  3364. enumerable: !!enumerable,
  3365. writable: true,
  3366. configurable: true
  3367. });
  3368. }
  3369. /**
  3370. * Parse simple path.
  3371. */
  3372. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3373. function parsePath (path) {
  3374. if (bailRE.test(path)) {
  3375. return
  3376. }
  3377. var segments = path.split('.');
  3378. return function (obj) {
  3379. for (var i = 0; i < segments.length; i++) {
  3380. if (!obj) { return }
  3381. obj = obj[segments[i]];
  3382. }
  3383. return obj
  3384. }
  3385. }
  3386. /* */
  3387. // can we use __proto__?
  3388. var hasProto = '__proto__' in {};
  3389. // Browser environment sniffing
  3390. var inBrowser = typeof window !== 'undefined';
  3391. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3392. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3393. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3394. var isIE = UA && /msie|trident/.test(UA);
  3395. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3396. var isEdge = UA && UA.indexOf('edge/') > 0;
  3397. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3398. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3399. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3400. var isPhantomJS = UA && /phantomjs/.test(UA);
  3401. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3402. // Firefox has a "watch" function on Object.prototype...
  3403. var nativeWatch = ({}).watch;
  3404. if (inBrowser) {
  3405. try {
  3406. var opts = {};
  3407. Object.defineProperty(opts, 'passive', ({
  3408. get: function get () {
  3409. }
  3410. })); // https://github.com/facebook/flow/issues/285
  3411. window.addEventListener('test-passive', null, opts);
  3412. } catch (e) {}
  3413. }
  3414. // this needs to be lazy-evaled because vue may be required before
  3415. // vue-server-renderer can set VUE_ENV
  3416. var _isServer;
  3417. var isServerRendering = function () {
  3418. if (_isServer === undefined) {
  3419. /* istanbul ignore if */
  3420. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3421. // detect presence of vue-server-renderer and avoid
  3422. // Webpack shimming the process
  3423. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3424. } else {
  3425. _isServer = false;
  3426. }
  3427. }
  3428. return _isServer
  3429. };
  3430. // detect devtools
  3431. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3432. /* istanbul ignore next */
  3433. function isNative (Ctor) {
  3434. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3435. }
  3436. var hasSymbol =
  3437. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3438. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3439. var _Set;
  3440. /* istanbul ignore if */ // $flow-disable-line
  3441. if (typeof Set !== 'undefined' && isNative(Set)) {
  3442. // use native Set when available.
  3443. _Set = Set;
  3444. } else {
  3445. // a non-standard Set polyfill that only works with primitive keys.
  3446. _Set = /*@__PURE__*/(function () {
  3447. function Set () {
  3448. this.set = Object.create(null);
  3449. }
  3450. Set.prototype.has = function has (key) {
  3451. return this.set[key] === true
  3452. };
  3453. Set.prototype.add = function add (key) {
  3454. this.set[key] = true;
  3455. };
  3456. Set.prototype.clear = function clear () {
  3457. this.set = Object.create(null);
  3458. };
  3459. return Set;
  3460. }());
  3461. }
  3462. /* */
  3463. var warn = noop;
  3464. var tip = noop;
  3465. var generateComponentTrace = (noop); // work around flow check
  3466. var formatComponentName = (noop);
  3467. if (true) {
  3468. var hasConsole = typeof console !== 'undefined';
  3469. var classifyRE = /(?:^|[-_])(\w)/g;
  3470. var classify = function (str) { return str
  3471. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3472. .replace(/[-_]/g, ''); };
  3473. warn = function (msg, vm) {
  3474. var trace = vm ? generateComponentTrace(vm) : '';
  3475. if (config.warnHandler) {
  3476. config.warnHandler.call(null, msg, vm, trace);
  3477. } else if (hasConsole && (!config.silent)) {
  3478. console.error(("[Vue warn]: " + msg + trace));
  3479. }
  3480. };
  3481. tip = function (msg, vm) {
  3482. if (hasConsole && (!config.silent)) {
  3483. console.warn("[Vue tip]: " + msg + (
  3484. vm ? generateComponentTrace(vm) : ''
  3485. ));
  3486. }
  3487. };
  3488. formatComponentName = function (vm, includeFile) {
  3489. if (vm.$root === vm) {
  3490. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3491. return ('') + vm.$options.__file
  3492. }
  3493. return '<Root>'
  3494. }
  3495. var options = typeof vm === 'function' && vm.cid != null
  3496. ? vm.options
  3497. : vm._isVue
  3498. ? vm.$options || vm.constructor.options
  3499. : vm;
  3500. var name = options.name || options._componentTag;
  3501. var file = options.__file;
  3502. if (!name && file) {
  3503. var match = file.match(/([^/\\]+)\.vue$/);
  3504. name = match && match[1];
  3505. }
  3506. return (
  3507. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3508. (file && includeFile !== false ? (" at " + file) : '')
  3509. )
  3510. };
  3511. var repeat = function (str, n) {
  3512. var res = '';
  3513. while (n) {
  3514. if (n % 2 === 1) { res += str; }
  3515. if (n > 1) { str += str; }
  3516. n >>= 1;
  3517. }
  3518. return res
  3519. };
  3520. generateComponentTrace = function (vm) {
  3521. if (vm._isVue && vm.$parent) {
  3522. var tree = [];
  3523. var currentRecursiveSequence = 0;
  3524. while (vm && vm.$options.name !== 'PageBody') {
  3525. if (tree.length > 0) {
  3526. var last = tree[tree.length - 1];
  3527. if (last.constructor === vm.constructor) {
  3528. currentRecursiveSequence++;
  3529. vm = vm.$parent;
  3530. continue
  3531. } else if (currentRecursiveSequence > 0) {
  3532. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3533. currentRecursiveSequence = 0;
  3534. }
  3535. }
  3536. !vm.$options.isReserved && tree.push(vm);
  3537. vm = vm.$parent;
  3538. }
  3539. return '\n\nfound in\n\n' + tree
  3540. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3541. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3542. : formatComponentName(vm))); })
  3543. .join('\n')
  3544. } else {
  3545. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3546. }
  3547. };
  3548. }
  3549. /* */
  3550. var uid = 0;
  3551. /**
  3552. * A dep is an observable that can have multiple
  3553. * directives subscribing to it.
  3554. */
  3555. var Dep = function Dep () {
  3556. this.id = uid++;
  3557. this.subs = [];
  3558. };
  3559. Dep.prototype.addSub = function addSub (sub) {
  3560. this.subs.push(sub);
  3561. };
  3562. Dep.prototype.removeSub = function removeSub (sub) {
  3563. remove(this.subs, sub);
  3564. };
  3565. Dep.prototype.depend = function depend () {
  3566. if (Dep.SharedObject.target) {
  3567. Dep.SharedObject.target.addDep(this);
  3568. }
  3569. };
  3570. Dep.prototype.notify = function notify () {
  3571. // stabilize the subscriber list first
  3572. var subs = this.subs.slice();
  3573. if ( true && !config.async) {
  3574. // subs aren't sorted in scheduler if not running async
  3575. // we need to sort them now to make sure they fire in correct
  3576. // order
  3577. subs.sort(function (a, b) { return a.id - b.id; });
  3578. }
  3579. for (var i = 0, l = subs.length; i < l; i++) {
  3580. subs[i].update();
  3581. }
  3582. };
  3583. // The current target watcher being evaluated.
  3584. // This is globally unique because only one watcher
  3585. // can be evaluated at a time.
  3586. // fixed by xxxxxx (nvue shared vuex)
  3587. /* eslint-disable no-undef */
  3588. Dep.SharedObject = {};
  3589. Dep.SharedObject.target = null;
  3590. Dep.SharedObject.targetStack = [];
  3591. function pushTarget (target) {
  3592. Dep.SharedObject.targetStack.push(target);
  3593. Dep.SharedObject.target = target;
  3594. Dep.target = target;
  3595. }
  3596. function popTarget () {
  3597. Dep.SharedObject.targetStack.pop();
  3598. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3599. Dep.target = Dep.SharedObject.target;
  3600. }
  3601. /* */
  3602. var VNode = function VNode (
  3603. tag,
  3604. data,
  3605. children,
  3606. text,
  3607. elm,
  3608. context,
  3609. componentOptions,
  3610. asyncFactory
  3611. ) {
  3612. this.tag = tag;
  3613. this.data = data;
  3614. this.children = children;
  3615. this.text = text;
  3616. this.elm = elm;
  3617. this.ns = undefined;
  3618. this.context = context;
  3619. this.fnContext = undefined;
  3620. this.fnOptions = undefined;
  3621. this.fnScopeId = undefined;
  3622. this.key = data && data.key;
  3623. this.componentOptions = componentOptions;
  3624. this.componentInstance = undefined;
  3625. this.parent = undefined;
  3626. this.raw = false;
  3627. this.isStatic = false;
  3628. this.isRootInsert = true;
  3629. this.isComment = false;
  3630. this.isCloned = false;
  3631. this.isOnce = false;
  3632. this.asyncFactory = asyncFactory;
  3633. this.asyncMeta = undefined;
  3634. this.isAsyncPlaceholder = false;
  3635. };
  3636. var prototypeAccessors = { child: { configurable: true } };
  3637. // DEPRECATED: alias for componentInstance for backwards compat.
  3638. /* istanbul ignore next */
  3639. prototypeAccessors.child.get = function () {
  3640. return this.componentInstance
  3641. };
  3642. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3643. var createEmptyVNode = function (text) {
  3644. if ( text === void 0 ) text = '';
  3645. var node = new VNode();
  3646. node.text = text;
  3647. node.isComment = true;
  3648. return node
  3649. };
  3650. function createTextVNode (val) {
  3651. return new VNode(undefined, undefined, undefined, String(val))
  3652. }
  3653. // optimized shallow clone
  3654. // used for static nodes and slot nodes because they may be reused across
  3655. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3656. // on their elm reference.
  3657. function cloneVNode (vnode) {
  3658. var cloned = new VNode(
  3659. vnode.tag,
  3660. vnode.data,
  3661. // #7975
  3662. // clone children array to avoid mutating original in case of cloning
  3663. // a child.
  3664. vnode.children && vnode.children.slice(),
  3665. vnode.text,
  3666. vnode.elm,
  3667. vnode.context,
  3668. vnode.componentOptions,
  3669. vnode.asyncFactory
  3670. );
  3671. cloned.ns = vnode.ns;
  3672. cloned.isStatic = vnode.isStatic;
  3673. cloned.key = vnode.key;
  3674. cloned.isComment = vnode.isComment;
  3675. cloned.fnContext = vnode.fnContext;
  3676. cloned.fnOptions = vnode.fnOptions;
  3677. cloned.fnScopeId = vnode.fnScopeId;
  3678. cloned.asyncMeta = vnode.asyncMeta;
  3679. cloned.isCloned = true;
  3680. return cloned
  3681. }
  3682. /*
  3683. * not type checking this file because flow doesn't play well with
  3684. * dynamically accessing methods on Array prototype
  3685. */
  3686. var arrayProto = Array.prototype;
  3687. var arrayMethods = Object.create(arrayProto);
  3688. var methodsToPatch = [
  3689. 'push',
  3690. 'pop',
  3691. 'shift',
  3692. 'unshift',
  3693. 'splice',
  3694. 'sort',
  3695. 'reverse'
  3696. ];
  3697. /**
  3698. * Intercept mutating methods and emit events
  3699. */
  3700. methodsToPatch.forEach(function (method) {
  3701. // cache original method
  3702. var original = arrayProto[method];
  3703. def(arrayMethods, method, function mutator () {
  3704. var args = [], len = arguments.length;
  3705. while ( len-- ) args[ len ] = arguments[ len ];
  3706. var result = original.apply(this, args);
  3707. var ob = this.__ob__;
  3708. var inserted;
  3709. switch (method) {
  3710. case 'push':
  3711. case 'unshift':
  3712. inserted = args;
  3713. break
  3714. case 'splice':
  3715. inserted = args.slice(2);
  3716. break
  3717. }
  3718. if (inserted) { ob.observeArray(inserted); }
  3719. // notify change
  3720. ob.dep.notify();
  3721. return result
  3722. });
  3723. });
  3724. /* */
  3725. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3726. /**
  3727. * In some cases we may want to disable observation inside a component's
  3728. * update computation.
  3729. */
  3730. var shouldObserve = true;
  3731. function toggleObserving (value) {
  3732. shouldObserve = value;
  3733. }
  3734. /**
  3735. * Observer class that is attached to each observed
  3736. * object. Once attached, the observer converts the target
  3737. * object's property keys into getter/setters that
  3738. * collect dependencies and dispatch updates.
  3739. */
  3740. var Observer = function Observer (value) {
  3741. this.value = value;
  3742. this.dep = new Dep();
  3743. this.vmCount = 0;
  3744. def(value, '__ob__', this);
  3745. if (Array.isArray(value)) {
  3746. if (hasProto) {
  3747. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3748. if(value.push !== value.__proto__.push){
  3749. copyAugment(value, arrayMethods, arrayKeys);
  3750. } else {
  3751. protoAugment(value, arrayMethods);
  3752. }
  3753. }
  3754. } else {
  3755. copyAugment(value, arrayMethods, arrayKeys);
  3756. }
  3757. this.observeArray(value);
  3758. } else {
  3759. this.walk(value);
  3760. }
  3761. };
  3762. /**
  3763. * Walk through all properties and convert them into
  3764. * getter/setters. This method should only be called when
  3765. * value type is Object.
  3766. */
  3767. Observer.prototype.walk = function walk (obj) {
  3768. var keys = Object.keys(obj);
  3769. for (var i = 0; i < keys.length; i++) {
  3770. defineReactive$$1(obj, keys[i]);
  3771. }
  3772. };
  3773. /**
  3774. * Observe a list of Array items.
  3775. */
  3776. Observer.prototype.observeArray = function observeArray (items) {
  3777. for (var i = 0, l = items.length; i < l; i++) {
  3778. observe(items[i]);
  3779. }
  3780. };
  3781. // helpers
  3782. /**
  3783. * Augment a target Object or Array by intercepting
  3784. * the prototype chain using __proto__
  3785. */
  3786. function protoAugment (target, src) {
  3787. /* eslint-disable no-proto */
  3788. target.__proto__ = src;
  3789. /* eslint-enable no-proto */
  3790. }
  3791. /**
  3792. * Augment a target Object or Array by defining
  3793. * hidden properties.
  3794. */
  3795. /* istanbul ignore next */
  3796. function copyAugment (target, src, keys) {
  3797. for (var i = 0, l = keys.length; i < l; i++) {
  3798. var key = keys[i];
  3799. def(target, key, src[key]);
  3800. }
  3801. }
  3802. /**
  3803. * Attempt to create an observer instance for a value,
  3804. * returns the new observer if successfully observed,
  3805. * or the existing observer if the value already has one.
  3806. */
  3807. function observe (value, asRootData) {
  3808. if (!isObject(value) || value instanceof VNode) {
  3809. return
  3810. }
  3811. var ob;
  3812. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3813. ob = value.__ob__;
  3814. } else if (
  3815. shouldObserve &&
  3816. !isServerRendering() &&
  3817. (Array.isArray(value) || isPlainObject(value)) &&
  3818. Object.isExtensible(value) &&
  3819. !value._isVue
  3820. ) {
  3821. ob = new Observer(value);
  3822. }
  3823. if (asRootData && ob) {
  3824. ob.vmCount++;
  3825. }
  3826. return ob
  3827. }
  3828. /**
  3829. * Define a reactive property on an Object.
  3830. */
  3831. function defineReactive$$1 (
  3832. obj,
  3833. key,
  3834. val,
  3835. customSetter,
  3836. shallow
  3837. ) {
  3838. var dep = new Dep();
  3839. var property = Object.getOwnPropertyDescriptor(obj, key);
  3840. if (property && property.configurable === false) {
  3841. return
  3842. }
  3843. // cater for pre-defined getter/setters
  3844. var getter = property && property.get;
  3845. var setter = property && property.set;
  3846. if ((!getter || setter) && arguments.length === 2) {
  3847. val = obj[key];
  3848. }
  3849. var childOb = !shallow && observe(val);
  3850. Object.defineProperty(obj, key, {
  3851. enumerable: true,
  3852. configurable: true,
  3853. get: function reactiveGetter () {
  3854. var value = getter ? getter.call(obj) : val;
  3855. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3856. dep.depend();
  3857. if (childOb) {
  3858. childOb.dep.depend();
  3859. if (Array.isArray(value)) {
  3860. dependArray(value);
  3861. }
  3862. }
  3863. }
  3864. return value
  3865. },
  3866. set: function reactiveSetter (newVal) {
  3867. var value = getter ? getter.call(obj) : val;
  3868. /* eslint-disable no-self-compare */
  3869. if (newVal === value || (newVal !== newVal && value !== value)) {
  3870. return
  3871. }
  3872. /* eslint-enable no-self-compare */
  3873. if ( true && customSetter) {
  3874. customSetter();
  3875. }
  3876. // #7981: for accessor properties without setter
  3877. if (getter && !setter) { return }
  3878. if (setter) {
  3879. setter.call(obj, newVal);
  3880. } else {
  3881. val = newVal;
  3882. }
  3883. childOb = !shallow && observe(newVal);
  3884. dep.notify();
  3885. }
  3886. });
  3887. }
  3888. /**
  3889. * Set a property on an object. Adds the new property and
  3890. * triggers change notification if the property doesn't
  3891. * already exist.
  3892. */
  3893. function set (target, key, val) {
  3894. if ( true &&
  3895. (isUndef(target) || isPrimitive(target))
  3896. ) {
  3897. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3898. }
  3899. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3900. target.length = Math.max(target.length, key);
  3901. target.splice(key, 1, val);
  3902. return val
  3903. }
  3904. if (key in target && !(key in Object.prototype)) {
  3905. target[key] = val;
  3906. return val
  3907. }
  3908. var ob = (target).__ob__;
  3909. if (target._isVue || (ob && ob.vmCount)) {
  3910. true && warn(
  3911. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3912. 'at runtime - declare it upfront in the data option.'
  3913. );
  3914. return val
  3915. }
  3916. if (!ob) {
  3917. target[key] = val;
  3918. return val
  3919. }
  3920. defineReactive$$1(ob.value, key, val);
  3921. ob.dep.notify();
  3922. return val
  3923. }
  3924. /**
  3925. * Delete a property and trigger change if necessary.
  3926. */
  3927. function del (target, key) {
  3928. if ( true &&
  3929. (isUndef(target) || isPrimitive(target))
  3930. ) {
  3931. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3932. }
  3933. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3934. target.splice(key, 1);
  3935. return
  3936. }
  3937. var ob = (target).__ob__;
  3938. if (target._isVue || (ob && ob.vmCount)) {
  3939. true && warn(
  3940. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3941. '- just set it to null.'
  3942. );
  3943. return
  3944. }
  3945. if (!hasOwn(target, key)) {
  3946. return
  3947. }
  3948. delete target[key];
  3949. if (!ob) {
  3950. return
  3951. }
  3952. ob.dep.notify();
  3953. }
  3954. /**
  3955. * Collect dependencies on array elements when the array is touched, since
  3956. * we cannot intercept array element access like property getters.
  3957. */
  3958. function dependArray (value) {
  3959. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3960. e = value[i];
  3961. e && e.__ob__ && e.__ob__.dep.depend();
  3962. if (Array.isArray(e)) {
  3963. dependArray(e);
  3964. }
  3965. }
  3966. }
  3967. /* */
  3968. /**
  3969. * Option overwriting strategies are functions that handle
  3970. * how to merge a parent option value and a child option
  3971. * value into the final value.
  3972. */
  3973. var strats = config.optionMergeStrategies;
  3974. /**
  3975. * Options with restrictions
  3976. */
  3977. if (true) {
  3978. strats.el = strats.propsData = function (parent, child, vm, key) {
  3979. if (!vm) {
  3980. warn(
  3981. "option \"" + key + "\" can only be used during instance " +
  3982. 'creation with the `new` keyword.'
  3983. );
  3984. }
  3985. return defaultStrat(parent, child)
  3986. };
  3987. }
  3988. /**
  3989. * Helper that recursively merges two data objects together.
  3990. */
  3991. function mergeData (to, from) {
  3992. if (!from) { return to }
  3993. var key, toVal, fromVal;
  3994. var keys = hasSymbol
  3995. ? Reflect.ownKeys(from)
  3996. : Object.keys(from);
  3997. for (var i = 0; i < keys.length; i++) {
  3998. key = keys[i];
  3999. // in case the object is already observed...
  4000. if (key === '__ob__') { continue }
  4001. toVal = to[key];
  4002. fromVal = from[key];
  4003. if (!hasOwn(to, key)) {
  4004. set(to, key, fromVal);
  4005. } else if (
  4006. toVal !== fromVal &&
  4007. isPlainObject(toVal) &&
  4008. isPlainObject(fromVal)
  4009. ) {
  4010. mergeData(toVal, fromVal);
  4011. }
  4012. }
  4013. return to
  4014. }
  4015. /**
  4016. * Data
  4017. */
  4018. function mergeDataOrFn (
  4019. parentVal,
  4020. childVal,
  4021. vm
  4022. ) {
  4023. if (!vm) {
  4024. // in a Vue.extend merge, both should be functions
  4025. if (!childVal) {
  4026. return parentVal
  4027. }
  4028. if (!parentVal) {
  4029. return childVal
  4030. }
  4031. // when parentVal & childVal are both present,
  4032. // we need to return a function that returns the
  4033. // merged result of both functions... no need to
  4034. // check if parentVal is a function here because
  4035. // it has to be a function to pass previous merges.
  4036. return function mergedDataFn () {
  4037. return mergeData(
  4038. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4039. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4040. )
  4041. }
  4042. } else {
  4043. return function mergedInstanceDataFn () {
  4044. // instance merge
  4045. var instanceData = typeof childVal === 'function'
  4046. ? childVal.call(vm, vm)
  4047. : childVal;
  4048. var defaultData = typeof parentVal === 'function'
  4049. ? parentVal.call(vm, vm)
  4050. : parentVal;
  4051. if (instanceData) {
  4052. return mergeData(instanceData, defaultData)
  4053. } else {
  4054. return defaultData
  4055. }
  4056. }
  4057. }
  4058. }
  4059. strats.data = function (
  4060. parentVal,
  4061. childVal,
  4062. vm
  4063. ) {
  4064. if (!vm) {
  4065. if (childVal && typeof childVal !== 'function') {
  4066. true && warn(
  4067. 'The "data" option should be a function ' +
  4068. 'that returns a per-instance value in component ' +
  4069. 'definitions.',
  4070. vm
  4071. );
  4072. return parentVal
  4073. }
  4074. return mergeDataOrFn(parentVal, childVal)
  4075. }
  4076. return mergeDataOrFn(parentVal, childVal, vm)
  4077. };
  4078. /**
  4079. * Hooks and props are merged as arrays.
  4080. */
  4081. function mergeHook (
  4082. parentVal,
  4083. childVal
  4084. ) {
  4085. var res = childVal
  4086. ? parentVal
  4087. ? parentVal.concat(childVal)
  4088. : Array.isArray(childVal)
  4089. ? childVal
  4090. : [childVal]
  4091. : parentVal;
  4092. return res
  4093. ? dedupeHooks(res)
  4094. : res
  4095. }
  4096. function dedupeHooks (hooks) {
  4097. var res = [];
  4098. for (var i = 0; i < hooks.length; i++) {
  4099. if (res.indexOf(hooks[i]) === -1) {
  4100. res.push(hooks[i]);
  4101. }
  4102. }
  4103. return res
  4104. }
  4105. LIFECYCLE_HOOKS.forEach(function (hook) {
  4106. strats[hook] = mergeHook;
  4107. });
  4108. /**
  4109. * Assets
  4110. *
  4111. * When a vm is present (instance creation), we need to do
  4112. * a three-way merge between constructor options, instance
  4113. * options and parent options.
  4114. */
  4115. function mergeAssets (
  4116. parentVal,
  4117. childVal,
  4118. vm,
  4119. key
  4120. ) {
  4121. var res = Object.create(parentVal || null);
  4122. if (childVal) {
  4123. true && assertObjectType(key, childVal, vm);
  4124. return extend(res, childVal)
  4125. } else {
  4126. return res
  4127. }
  4128. }
  4129. ASSET_TYPES.forEach(function (type) {
  4130. strats[type + 's'] = mergeAssets;
  4131. });
  4132. /**
  4133. * Watchers.
  4134. *
  4135. * Watchers hashes should not overwrite one
  4136. * another, so we merge them as arrays.
  4137. */
  4138. strats.watch = function (
  4139. parentVal,
  4140. childVal,
  4141. vm,
  4142. key
  4143. ) {
  4144. // work around Firefox's Object.prototype.watch...
  4145. if (parentVal === nativeWatch) { parentVal = undefined; }
  4146. if (childVal === nativeWatch) { childVal = undefined; }
  4147. /* istanbul ignore if */
  4148. if (!childVal) { return Object.create(parentVal || null) }
  4149. if (true) {
  4150. assertObjectType(key, childVal, vm);
  4151. }
  4152. if (!parentVal) { return childVal }
  4153. var ret = {};
  4154. extend(ret, parentVal);
  4155. for (var key$1 in childVal) {
  4156. var parent = ret[key$1];
  4157. var child = childVal[key$1];
  4158. if (parent && !Array.isArray(parent)) {
  4159. parent = [parent];
  4160. }
  4161. ret[key$1] = parent
  4162. ? parent.concat(child)
  4163. : Array.isArray(child) ? child : [child];
  4164. }
  4165. return ret
  4166. };
  4167. /**
  4168. * Other object hashes.
  4169. */
  4170. strats.props =
  4171. strats.methods =
  4172. strats.inject =
  4173. strats.computed = function (
  4174. parentVal,
  4175. childVal,
  4176. vm,
  4177. key
  4178. ) {
  4179. if (childVal && "development" !== 'production') {
  4180. assertObjectType(key, childVal, vm);
  4181. }
  4182. if (!parentVal) { return childVal }
  4183. var ret = Object.create(null);
  4184. extend(ret, parentVal);
  4185. if (childVal) { extend(ret, childVal); }
  4186. return ret
  4187. };
  4188. strats.provide = mergeDataOrFn;
  4189. /**
  4190. * Default strategy.
  4191. */
  4192. var defaultStrat = function (parentVal, childVal) {
  4193. return childVal === undefined
  4194. ? parentVal
  4195. : childVal
  4196. };
  4197. /**
  4198. * Validate component names
  4199. */
  4200. function checkComponents (options) {
  4201. for (var key in options.components) {
  4202. validateComponentName(key);
  4203. }
  4204. }
  4205. function validateComponentName (name) {
  4206. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4207. warn(
  4208. 'Invalid component name: "' + name + '". Component names ' +
  4209. 'should conform to valid custom element name in html5 specification.'
  4210. );
  4211. }
  4212. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4213. warn(
  4214. 'Do not use built-in or reserved HTML elements as component ' +
  4215. 'id: ' + name
  4216. );
  4217. }
  4218. }
  4219. /**
  4220. * Ensure all props option syntax are normalized into the
  4221. * Object-based format.
  4222. */
  4223. function normalizeProps (options, vm) {
  4224. var props = options.props;
  4225. if (!props) { return }
  4226. var res = {};
  4227. var i, val, name;
  4228. if (Array.isArray(props)) {
  4229. i = props.length;
  4230. while (i--) {
  4231. val = props[i];
  4232. if (typeof val === 'string') {
  4233. name = camelize(val);
  4234. res[name] = { type: null };
  4235. } else if (true) {
  4236. warn('props must be strings when using array syntax.');
  4237. }
  4238. }
  4239. } else if (isPlainObject(props)) {
  4240. for (var key in props) {
  4241. val = props[key];
  4242. name = camelize(key);
  4243. res[name] = isPlainObject(val)
  4244. ? val
  4245. : { type: val };
  4246. }
  4247. } else if (true) {
  4248. warn(
  4249. "Invalid value for option \"props\": expected an Array or an Object, " +
  4250. "but got " + (toRawType(props)) + ".",
  4251. vm
  4252. );
  4253. }
  4254. options.props = res;
  4255. }
  4256. /**
  4257. * Normalize all injections into Object-based format
  4258. */
  4259. function normalizeInject (options, vm) {
  4260. var inject = options.inject;
  4261. if (!inject) { return }
  4262. var normalized = options.inject = {};
  4263. if (Array.isArray(inject)) {
  4264. for (var i = 0; i < inject.length; i++) {
  4265. normalized[inject[i]] = { from: inject[i] };
  4266. }
  4267. } else if (isPlainObject(inject)) {
  4268. for (var key in inject) {
  4269. var val = inject[key];
  4270. normalized[key] = isPlainObject(val)
  4271. ? extend({ from: key }, val)
  4272. : { from: val };
  4273. }
  4274. } else if (true) {
  4275. warn(
  4276. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4277. "but got " + (toRawType(inject)) + ".",
  4278. vm
  4279. );
  4280. }
  4281. }
  4282. /**
  4283. * Normalize raw function directives into object format.
  4284. */
  4285. function normalizeDirectives (options) {
  4286. var dirs = options.directives;
  4287. if (dirs) {
  4288. for (var key in dirs) {
  4289. var def$$1 = dirs[key];
  4290. if (typeof def$$1 === 'function') {
  4291. dirs[key] = { bind: def$$1, update: def$$1 };
  4292. }
  4293. }
  4294. }
  4295. }
  4296. function assertObjectType (name, value, vm) {
  4297. if (!isPlainObject(value)) {
  4298. warn(
  4299. "Invalid value for option \"" + name + "\": expected an Object, " +
  4300. "but got " + (toRawType(value)) + ".",
  4301. vm
  4302. );
  4303. }
  4304. }
  4305. /**
  4306. * Merge two option objects into a new one.
  4307. * Core utility used in both instantiation and inheritance.
  4308. */
  4309. function mergeOptions (
  4310. parent,
  4311. child,
  4312. vm
  4313. ) {
  4314. if (true) {
  4315. checkComponents(child);
  4316. }
  4317. if (typeof child === 'function') {
  4318. child = child.options;
  4319. }
  4320. normalizeProps(child, vm);
  4321. normalizeInject(child, vm);
  4322. normalizeDirectives(child);
  4323. // Apply extends and mixins on the child options,
  4324. // but only if it is a raw options object that isn't
  4325. // the result of another mergeOptions call.
  4326. // Only merged options has the _base property.
  4327. if (!child._base) {
  4328. if (child.extends) {
  4329. parent = mergeOptions(parent, child.extends, vm);
  4330. }
  4331. if (child.mixins) {
  4332. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4333. parent = mergeOptions(parent, child.mixins[i], vm);
  4334. }
  4335. }
  4336. }
  4337. var options = {};
  4338. var key;
  4339. for (key in parent) {
  4340. mergeField(key);
  4341. }
  4342. for (key in child) {
  4343. if (!hasOwn(parent, key)) {
  4344. mergeField(key);
  4345. }
  4346. }
  4347. function mergeField (key) {
  4348. var strat = strats[key] || defaultStrat;
  4349. options[key] = strat(parent[key], child[key], vm, key);
  4350. }
  4351. return options
  4352. }
  4353. /**
  4354. * Resolve an asset.
  4355. * This function is used because child instances need access
  4356. * to assets defined in its ancestor chain.
  4357. */
  4358. function resolveAsset (
  4359. options,
  4360. type,
  4361. id,
  4362. warnMissing
  4363. ) {
  4364. /* istanbul ignore if */
  4365. if (typeof id !== 'string') {
  4366. return
  4367. }
  4368. var assets = options[type];
  4369. // check local registration variations first
  4370. if (hasOwn(assets, id)) { return assets[id] }
  4371. var camelizedId = camelize(id);
  4372. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4373. var PascalCaseId = capitalize(camelizedId);
  4374. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4375. // fallback to prototype chain
  4376. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4377. if ( true && warnMissing && !res) {
  4378. warn(
  4379. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4380. options
  4381. );
  4382. }
  4383. return res
  4384. }
  4385. /* */
  4386. function validateProp (
  4387. key,
  4388. propOptions,
  4389. propsData,
  4390. vm
  4391. ) {
  4392. var prop = propOptions[key];
  4393. var absent = !hasOwn(propsData, key);
  4394. var value = propsData[key];
  4395. // boolean casting
  4396. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4397. if (booleanIndex > -1) {
  4398. if (absent && !hasOwn(prop, 'default')) {
  4399. value = false;
  4400. } else if (value === '' || value === hyphenate(key)) {
  4401. // only cast empty string / same name to boolean if
  4402. // boolean has higher priority
  4403. var stringIndex = getTypeIndex(String, prop.type);
  4404. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4405. value = true;
  4406. }
  4407. }
  4408. }
  4409. // check default value
  4410. if (value === undefined) {
  4411. value = getPropDefaultValue(vm, prop, key);
  4412. // since the default value is a fresh copy,
  4413. // make sure to observe it.
  4414. var prevShouldObserve = shouldObserve;
  4415. toggleObserving(true);
  4416. observe(value);
  4417. toggleObserving(prevShouldObserve);
  4418. }
  4419. if (
  4420. true
  4421. ) {
  4422. assertProp(prop, key, value, vm, absent);
  4423. }
  4424. return value
  4425. }
  4426. /**
  4427. * Get the default value of a prop.
  4428. */
  4429. function getPropDefaultValue (vm, prop, key) {
  4430. // no default, return undefined
  4431. if (!hasOwn(prop, 'default')) {
  4432. return undefined
  4433. }
  4434. var def = prop.default;
  4435. // warn against non-factory defaults for Object & Array
  4436. if ( true && isObject(def)) {
  4437. warn(
  4438. 'Invalid default value for prop "' + key + '": ' +
  4439. 'Props with type Object/Array must use a factory function ' +
  4440. 'to return the default value.',
  4441. vm
  4442. );
  4443. }
  4444. // the raw prop value was also undefined from previous render,
  4445. // return previous default value to avoid unnecessary watcher trigger
  4446. if (vm && vm.$options.propsData &&
  4447. vm.$options.propsData[key] === undefined &&
  4448. vm._props[key] !== undefined
  4449. ) {
  4450. return vm._props[key]
  4451. }
  4452. // call factory function for non-Function types
  4453. // a value is Function if its prototype is function even across different execution context
  4454. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4455. ? def.call(vm)
  4456. : def
  4457. }
  4458. /**
  4459. * Assert whether a prop is valid.
  4460. */
  4461. function assertProp (
  4462. prop,
  4463. name,
  4464. value,
  4465. vm,
  4466. absent
  4467. ) {
  4468. if (prop.required && absent) {
  4469. warn(
  4470. 'Missing required prop: "' + name + '"',
  4471. vm
  4472. );
  4473. return
  4474. }
  4475. if (value == null && !prop.required) {
  4476. return
  4477. }
  4478. var type = prop.type;
  4479. var valid = !type || type === true;
  4480. var expectedTypes = [];
  4481. if (type) {
  4482. if (!Array.isArray(type)) {
  4483. type = [type];
  4484. }
  4485. for (var i = 0; i < type.length && !valid; i++) {
  4486. var assertedType = assertType(value, type[i]);
  4487. expectedTypes.push(assertedType.expectedType || '');
  4488. valid = assertedType.valid;
  4489. }
  4490. }
  4491. if (!valid) {
  4492. warn(
  4493. getInvalidTypeMessage(name, value, expectedTypes),
  4494. vm
  4495. );
  4496. return
  4497. }
  4498. var validator = prop.validator;
  4499. if (validator) {
  4500. if (!validator(value)) {
  4501. warn(
  4502. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4503. vm
  4504. );
  4505. }
  4506. }
  4507. }
  4508. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4509. function assertType (value, type) {
  4510. var valid;
  4511. var expectedType = getType(type);
  4512. if (simpleCheckRE.test(expectedType)) {
  4513. var t = typeof value;
  4514. valid = t === expectedType.toLowerCase();
  4515. // for primitive wrapper objects
  4516. if (!valid && t === 'object') {
  4517. valid = value instanceof type;
  4518. }
  4519. } else if (expectedType === 'Object') {
  4520. valid = isPlainObject(value);
  4521. } else if (expectedType === 'Array') {
  4522. valid = Array.isArray(value);
  4523. } else {
  4524. valid = value instanceof type;
  4525. }
  4526. return {
  4527. valid: valid,
  4528. expectedType: expectedType
  4529. }
  4530. }
  4531. /**
  4532. * Use function string name to check built-in types,
  4533. * because a simple equality check will fail when running
  4534. * across different vms / iframes.
  4535. */
  4536. function getType (fn) {
  4537. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4538. return match ? match[1] : ''
  4539. }
  4540. function isSameType (a, b) {
  4541. return getType(a) === getType(b)
  4542. }
  4543. function getTypeIndex (type, expectedTypes) {
  4544. if (!Array.isArray(expectedTypes)) {
  4545. return isSameType(expectedTypes, type) ? 0 : -1
  4546. }
  4547. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4548. if (isSameType(expectedTypes[i], type)) {
  4549. return i
  4550. }
  4551. }
  4552. return -1
  4553. }
  4554. function getInvalidTypeMessage (name, value, expectedTypes) {
  4555. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4556. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4557. var expectedType = expectedTypes[0];
  4558. var receivedType = toRawType(value);
  4559. var expectedValue = styleValue(value, expectedType);
  4560. var receivedValue = styleValue(value, receivedType);
  4561. // check if we need to specify expected value
  4562. if (expectedTypes.length === 1 &&
  4563. isExplicable(expectedType) &&
  4564. !isBoolean(expectedType, receivedType)) {
  4565. message += " with value " + expectedValue;
  4566. }
  4567. message += ", got " + receivedType + " ";
  4568. // check if we need to specify received value
  4569. if (isExplicable(receivedType)) {
  4570. message += "with value " + receivedValue + ".";
  4571. }
  4572. return message
  4573. }
  4574. function styleValue (value, type) {
  4575. if (type === 'String') {
  4576. return ("\"" + value + "\"")
  4577. } else if (type === 'Number') {
  4578. return ("" + (Number(value)))
  4579. } else {
  4580. return ("" + value)
  4581. }
  4582. }
  4583. function isExplicable (value) {
  4584. var explicitTypes = ['string', 'number', 'boolean'];
  4585. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4586. }
  4587. function isBoolean () {
  4588. var args = [], len = arguments.length;
  4589. while ( len-- ) args[ len ] = arguments[ len ];
  4590. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4591. }
  4592. /* */
  4593. function handleError (err, vm, info) {
  4594. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4595. // See: https://github.com/vuejs/vuex/issues/1505
  4596. pushTarget();
  4597. try {
  4598. if (vm) {
  4599. var cur = vm;
  4600. while ((cur = cur.$parent)) {
  4601. var hooks = cur.$options.errorCaptured;
  4602. if (hooks) {
  4603. for (var i = 0; i < hooks.length; i++) {
  4604. try {
  4605. var capture = hooks[i].call(cur, err, vm, info) === false;
  4606. if (capture) { return }
  4607. } catch (e) {
  4608. globalHandleError(e, cur, 'errorCaptured hook');
  4609. }
  4610. }
  4611. }
  4612. }
  4613. }
  4614. globalHandleError(err, vm, info);
  4615. } finally {
  4616. popTarget();
  4617. }
  4618. }
  4619. function invokeWithErrorHandling (
  4620. handler,
  4621. context,
  4622. args,
  4623. vm,
  4624. info
  4625. ) {
  4626. var res;
  4627. try {
  4628. res = args ? handler.apply(context, args) : handler.call(context);
  4629. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4630. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4631. // issue #9511
  4632. // avoid catch triggering multiple times when nested calls
  4633. res._handled = true;
  4634. }
  4635. } catch (e) {
  4636. handleError(e, vm, info);
  4637. }
  4638. return res
  4639. }
  4640. function globalHandleError (err, vm, info) {
  4641. if (config.errorHandler) {
  4642. try {
  4643. return config.errorHandler.call(null, err, vm, info)
  4644. } catch (e) {
  4645. // if the user intentionally throws the original error in the handler,
  4646. // do not log it twice
  4647. if (e !== err) {
  4648. logError(e, null, 'config.errorHandler');
  4649. }
  4650. }
  4651. }
  4652. logError(err, vm, info);
  4653. }
  4654. function logError (err, vm, info) {
  4655. if (true) {
  4656. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4657. }
  4658. /* istanbul ignore else */
  4659. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4660. console.error(err);
  4661. } else {
  4662. throw err
  4663. }
  4664. }
  4665. /* */
  4666. var callbacks = [];
  4667. var pending = false;
  4668. function flushCallbacks () {
  4669. pending = false;
  4670. var copies = callbacks.slice(0);
  4671. callbacks.length = 0;
  4672. for (var i = 0; i < copies.length; i++) {
  4673. copies[i]();
  4674. }
  4675. }
  4676. // Here we have async deferring wrappers using microtasks.
  4677. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4678. // However, it has subtle problems when state is changed right before repaint
  4679. // (e.g. #6813, out-in transitions).
  4680. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4681. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4682. // So we now use microtasks everywhere, again.
  4683. // A major drawback of this tradeoff is that there are some scenarios
  4684. // where microtasks have too high a priority and fire in between supposedly
  4685. // sequential events (e.g. #4521, #6690, which have workarounds)
  4686. // or even between bubbling of the same event (#6566).
  4687. var timerFunc;
  4688. // The nextTick behavior leverages the microtask queue, which can be accessed
  4689. // via either native Promise.then or MutationObserver.
  4690. // MutationObserver has wider support, however it is seriously bugged in
  4691. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4692. // completely stops working after triggering a few times... so, if native
  4693. // Promise is available, we will use it:
  4694. /* istanbul ignore next, $flow-disable-line */
  4695. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4696. var p = Promise.resolve();
  4697. timerFunc = function () {
  4698. p.then(flushCallbacks);
  4699. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4700. // it can get stuck in a weird state where callbacks are pushed into the
  4701. // microtask queue but the queue isn't being flushed, until the browser
  4702. // needs to do some other work, e.g. handle a timer. Therefore we can
  4703. // "force" the microtask queue to be flushed by adding an empty timer.
  4704. if (isIOS) { setTimeout(noop); }
  4705. };
  4706. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4707. isNative(MutationObserver) ||
  4708. // PhantomJS and iOS 7.x
  4709. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4710. )) {
  4711. // Use MutationObserver where native Promise is not available,
  4712. // e.g. PhantomJS, iOS7, Android 4.4
  4713. // (#6466 MutationObserver is unreliable in IE11)
  4714. var counter = 1;
  4715. var observer = new MutationObserver(flushCallbacks);
  4716. var textNode = document.createTextNode(String(counter));
  4717. observer.observe(textNode, {
  4718. characterData: true
  4719. });
  4720. timerFunc = function () {
  4721. counter = (counter + 1) % 2;
  4722. textNode.data = String(counter);
  4723. };
  4724. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4725. // Fallback to setImmediate.
  4726. // Technically it leverages the (macro) task queue,
  4727. // but it is still a better choice than setTimeout.
  4728. timerFunc = function () {
  4729. setImmediate(flushCallbacks);
  4730. };
  4731. } else {
  4732. // Fallback to setTimeout.
  4733. timerFunc = function () {
  4734. setTimeout(flushCallbacks, 0);
  4735. };
  4736. }
  4737. function nextTick (cb, ctx) {
  4738. var _resolve;
  4739. callbacks.push(function () {
  4740. if (cb) {
  4741. try {
  4742. cb.call(ctx);
  4743. } catch (e) {
  4744. handleError(e, ctx, 'nextTick');
  4745. }
  4746. } else if (_resolve) {
  4747. _resolve(ctx);
  4748. }
  4749. });
  4750. if (!pending) {
  4751. pending = true;
  4752. timerFunc();
  4753. }
  4754. // $flow-disable-line
  4755. if (!cb && typeof Promise !== 'undefined') {
  4756. return new Promise(function (resolve) {
  4757. _resolve = resolve;
  4758. })
  4759. }
  4760. }
  4761. /* */
  4762. /* not type checking this file because flow doesn't play well with Proxy */
  4763. var initProxy;
  4764. if (true) {
  4765. var allowedGlobals = makeMap(
  4766. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4767. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4768. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4769. 'require' // for Webpack/Browserify
  4770. );
  4771. var warnNonPresent = function (target, key) {
  4772. warn(
  4773. "Property or method \"" + key + "\" is not defined on the instance but " +
  4774. 'referenced during render. Make sure that this property is reactive, ' +
  4775. 'either in the data option, or for class-based components, by ' +
  4776. 'initializing the property. ' +
  4777. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4778. target
  4779. );
  4780. };
  4781. var warnReservedPrefix = function (target, key) {
  4782. warn(
  4783. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4784. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4785. 'prevent conflicts with Vue internals. ' +
  4786. 'See: https://vuejs.org/v2/api/#data',
  4787. target
  4788. );
  4789. };
  4790. var hasProxy =
  4791. typeof Proxy !== 'undefined' && isNative(Proxy);
  4792. if (hasProxy) {
  4793. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4794. config.keyCodes = new Proxy(config.keyCodes, {
  4795. set: function set (target, key, value) {
  4796. if (isBuiltInModifier(key)) {
  4797. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4798. return false
  4799. } else {
  4800. target[key] = value;
  4801. return true
  4802. }
  4803. }
  4804. });
  4805. }
  4806. var hasHandler = {
  4807. has: function has (target, key) {
  4808. var has = key in target;
  4809. var isAllowed = allowedGlobals(key) ||
  4810. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4811. if (!has && !isAllowed) {
  4812. if (key in target.$data) { warnReservedPrefix(target, key); }
  4813. else { warnNonPresent(target, key); }
  4814. }
  4815. return has || !isAllowed
  4816. }
  4817. };
  4818. var getHandler = {
  4819. get: function get (target, key) {
  4820. if (typeof key === 'string' && !(key in target)) {
  4821. if (key in target.$data) { warnReservedPrefix(target, key); }
  4822. else { warnNonPresent(target, key); }
  4823. }
  4824. return target[key]
  4825. }
  4826. };
  4827. initProxy = function initProxy (vm) {
  4828. if (hasProxy) {
  4829. // determine which proxy handler to use
  4830. var options = vm.$options;
  4831. var handlers = options.render && options.render._withStripped
  4832. ? getHandler
  4833. : hasHandler;
  4834. vm._renderProxy = new Proxy(vm, handlers);
  4835. } else {
  4836. vm._renderProxy = vm;
  4837. }
  4838. };
  4839. }
  4840. /* */
  4841. var seenObjects = new _Set();
  4842. /**
  4843. * Recursively traverse an object to evoke all converted
  4844. * getters, so that every nested property inside the object
  4845. * is collected as a "deep" dependency.
  4846. */
  4847. function traverse (val) {
  4848. _traverse(val, seenObjects);
  4849. seenObjects.clear();
  4850. }
  4851. function _traverse (val, seen) {
  4852. var i, keys;
  4853. var isA = Array.isArray(val);
  4854. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4855. return
  4856. }
  4857. if (val.__ob__) {
  4858. var depId = val.__ob__.dep.id;
  4859. if (seen.has(depId)) {
  4860. return
  4861. }
  4862. seen.add(depId);
  4863. }
  4864. if (isA) {
  4865. i = val.length;
  4866. while (i--) { _traverse(val[i], seen); }
  4867. } else {
  4868. keys = Object.keys(val);
  4869. i = keys.length;
  4870. while (i--) { _traverse(val[keys[i]], seen); }
  4871. }
  4872. }
  4873. var mark;
  4874. var measure;
  4875. if (true) {
  4876. var perf = inBrowser && window.performance;
  4877. /* istanbul ignore if */
  4878. if (
  4879. perf &&
  4880. perf.mark &&
  4881. perf.measure &&
  4882. perf.clearMarks &&
  4883. perf.clearMeasures
  4884. ) {
  4885. mark = function (tag) { return perf.mark(tag); };
  4886. measure = function (name, startTag, endTag) {
  4887. perf.measure(name, startTag, endTag);
  4888. perf.clearMarks(startTag);
  4889. perf.clearMarks(endTag);
  4890. // perf.clearMeasures(name)
  4891. };
  4892. }
  4893. }
  4894. /* */
  4895. var normalizeEvent = cached(function (name) {
  4896. var passive = name.charAt(0) === '&';
  4897. name = passive ? name.slice(1) : name;
  4898. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4899. name = once$$1 ? name.slice(1) : name;
  4900. var capture = name.charAt(0) === '!';
  4901. name = capture ? name.slice(1) : name;
  4902. return {
  4903. name: name,
  4904. once: once$$1,
  4905. capture: capture,
  4906. passive: passive
  4907. }
  4908. });
  4909. function createFnInvoker (fns, vm) {
  4910. function invoker () {
  4911. var arguments$1 = arguments;
  4912. var fns = invoker.fns;
  4913. if (Array.isArray(fns)) {
  4914. var cloned = fns.slice();
  4915. for (var i = 0; i < cloned.length; i++) {
  4916. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4917. }
  4918. } else {
  4919. // return handler return value for single handlers
  4920. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4921. }
  4922. }
  4923. invoker.fns = fns;
  4924. return invoker
  4925. }
  4926. function updateListeners (
  4927. on,
  4928. oldOn,
  4929. add,
  4930. remove$$1,
  4931. createOnceHandler,
  4932. vm
  4933. ) {
  4934. var name, def$$1, cur, old, event;
  4935. for (name in on) {
  4936. def$$1 = cur = on[name];
  4937. old = oldOn[name];
  4938. event = normalizeEvent(name);
  4939. if (isUndef(cur)) {
  4940. true && warn(
  4941. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4942. vm
  4943. );
  4944. } else if (isUndef(old)) {
  4945. if (isUndef(cur.fns)) {
  4946. cur = on[name] = createFnInvoker(cur, vm);
  4947. }
  4948. if (isTrue(event.once)) {
  4949. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4950. }
  4951. add(event.name, cur, event.capture, event.passive, event.params);
  4952. } else if (cur !== old) {
  4953. old.fns = cur;
  4954. on[name] = old;
  4955. }
  4956. }
  4957. for (name in oldOn) {
  4958. if (isUndef(on[name])) {
  4959. event = normalizeEvent(name);
  4960. remove$$1(event.name, oldOn[name], event.capture);
  4961. }
  4962. }
  4963. }
  4964. /* */
  4965. /* */
  4966. // fixed by xxxxxx (mp properties)
  4967. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4968. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4969. if (isUndef(propOptions)) {
  4970. return res
  4971. }
  4972. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4973. var attrs = data.attrs;
  4974. var props = data.props;
  4975. if (isDef(attrs) || isDef(props)) {
  4976. for (var key in propOptions) {
  4977. var altKey = hyphenate(key);
  4978. var result = checkProp(res, props, key, altKey, true) ||
  4979. checkProp(res, attrs, key, altKey, false);
  4980. // externalClass
  4981. if (
  4982. result &&
  4983. res[key] &&
  4984. externalClasses.indexOf(altKey) !== -1 &&
  4985. context[camelize(res[key])]
  4986. ) {
  4987. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4988. res[key] = context[camelize(res[key])];
  4989. }
  4990. }
  4991. }
  4992. return res
  4993. }
  4994. function extractPropsFromVNodeData (
  4995. data,
  4996. Ctor,
  4997. tag,
  4998. context// fixed by xxxxxx
  4999. ) {
  5000. // we are only extracting raw values here.
  5001. // validation and default values are handled in the child
  5002. // component itself.
  5003. var propOptions = Ctor.options.props;
  5004. if (isUndef(propOptions)) {
  5005. // fixed by xxxxxx
  5006. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5007. }
  5008. var res = {};
  5009. var attrs = data.attrs;
  5010. var props = data.props;
  5011. if (isDef(attrs) || isDef(props)) {
  5012. for (var key in propOptions) {
  5013. var altKey = hyphenate(key);
  5014. if (true) {
  5015. var keyInLowerCase = key.toLowerCase();
  5016. if (
  5017. key !== keyInLowerCase &&
  5018. attrs && hasOwn(attrs, keyInLowerCase)
  5019. ) {
  5020. tip(
  5021. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5022. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5023. " \"" + key + "\". " +
  5024. "Note that HTML attributes are case-insensitive and camelCased " +
  5025. "props need to use their kebab-case equivalents when using in-DOM " +
  5026. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5027. );
  5028. }
  5029. }
  5030. checkProp(res, props, key, altKey, true) ||
  5031. checkProp(res, attrs, key, altKey, false);
  5032. }
  5033. }
  5034. // fixed by xxxxxx
  5035. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5036. }
  5037. function checkProp (
  5038. res,
  5039. hash,
  5040. key,
  5041. altKey,
  5042. preserve
  5043. ) {
  5044. if (isDef(hash)) {
  5045. if (hasOwn(hash, key)) {
  5046. res[key] = hash[key];
  5047. if (!preserve) {
  5048. delete hash[key];
  5049. }
  5050. return true
  5051. } else if (hasOwn(hash, altKey)) {
  5052. res[key] = hash[altKey];
  5053. if (!preserve) {
  5054. delete hash[altKey];
  5055. }
  5056. return true
  5057. }
  5058. }
  5059. return false
  5060. }
  5061. /* */
  5062. // The template compiler attempts to minimize the need for normalization by
  5063. // statically analyzing the template at compile time.
  5064. //
  5065. // For plain HTML markup, normalization can be completely skipped because the
  5066. // generated render function is guaranteed to return Array<VNode>. There are
  5067. // two cases where extra normalization is needed:
  5068. // 1. When the children contains components - because a functional component
  5069. // may return an Array instead of a single root. In this case, just a simple
  5070. // normalization is needed - if any child is an Array, we flatten the whole
  5071. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5072. // because functional components already normalize their own children.
  5073. function simpleNormalizeChildren (children) {
  5074. for (var i = 0; i < children.length; i++) {
  5075. if (Array.isArray(children[i])) {
  5076. return Array.prototype.concat.apply([], children)
  5077. }
  5078. }
  5079. return children
  5080. }
  5081. // 2. When the children contains constructs that always generated nested Arrays,
  5082. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5083. // with hand-written render functions / JSX. In such cases a full normalization
  5084. // is needed to cater to all possible types of children values.
  5085. function normalizeChildren (children) {
  5086. return isPrimitive(children)
  5087. ? [createTextVNode(children)]
  5088. : Array.isArray(children)
  5089. ? normalizeArrayChildren(children)
  5090. : undefined
  5091. }
  5092. function isTextNode (node) {
  5093. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5094. }
  5095. function normalizeArrayChildren (children, nestedIndex) {
  5096. var res = [];
  5097. var i, c, lastIndex, last;
  5098. for (i = 0; i < children.length; i++) {
  5099. c = children[i];
  5100. if (isUndef(c) || typeof c === 'boolean') { continue }
  5101. lastIndex = res.length - 1;
  5102. last = res[lastIndex];
  5103. // nested
  5104. if (Array.isArray(c)) {
  5105. if (c.length > 0) {
  5106. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5107. // merge adjacent text nodes
  5108. if (isTextNode(c[0]) && isTextNode(last)) {
  5109. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5110. c.shift();
  5111. }
  5112. res.push.apply(res, c);
  5113. }
  5114. } else if (isPrimitive(c)) {
  5115. if (isTextNode(last)) {
  5116. // merge adjacent text nodes
  5117. // this is necessary for SSR hydration because text nodes are
  5118. // essentially merged when rendered to HTML strings
  5119. res[lastIndex] = createTextVNode(last.text + c);
  5120. } else if (c !== '') {
  5121. // convert primitive to vnode
  5122. res.push(createTextVNode(c));
  5123. }
  5124. } else {
  5125. if (isTextNode(c) && isTextNode(last)) {
  5126. // merge adjacent text nodes
  5127. res[lastIndex] = createTextVNode(last.text + c.text);
  5128. } else {
  5129. // default key for nested array children (likely generated by v-for)
  5130. if (isTrue(children._isVList) &&
  5131. isDef(c.tag) &&
  5132. isUndef(c.key) &&
  5133. isDef(nestedIndex)) {
  5134. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5135. }
  5136. res.push(c);
  5137. }
  5138. }
  5139. }
  5140. return res
  5141. }
  5142. /* */
  5143. function initProvide (vm) {
  5144. var provide = vm.$options.provide;
  5145. if (provide) {
  5146. vm._provided = typeof provide === 'function'
  5147. ? provide.call(vm)
  5148. : provide;
  5149. }
  5150. }
  5151. function initInjections (vm) {
  5152. var result = resolveInject(vm.$options.inject, vm);
  5153. if (result) {
  5154. toggleObserving(false);
  5155. Object.keys(result).forEach(function (key) {
  5156. /* istanbul ignore else */
  5157. if (true) {
  5158. defineReactive$$1(vm, key, result[key], function () {
  5159. warn(
  5160. "Avoid mutating an injected value directly since the changes will be " +
  5161. "overwritten whenever the provided component re-renders. " +
  5162. "injection being mutated: \"" + key + "\"",
  5163. vm
  5164. );
  5165. });
  5166. } else {}
  5167. });
  5168. toggleObserving(true);
  5169. }
  5170. }
  5171. function resolveInject (inject, vm) {
  5172. if (inject) {
  5173. // inject is :any because flow is not smart enough to figure out cached
  5174. var result = Object.create(null);
  5175. var keys = hasSymbol
  5176. ? Reflect.ownKeys(inject)
  5177. : Object.keys(inject);
  5178. for (var i = 0; i < keys.length; i++) {
  5179. var key = keys[i];
  5180. // #6574 in case the inject object is observed...
  5181. if (key === '__ob__') { continue }
  5182. var provideKey = inject[key].from;
  5183. var source = vm;
  5184. while (source) {
  5185. if (source._provided && hasOwn(source._provided, provideKey)) {
  5186. result[key] = source._provided[provideKey];
  5187. break
  5188. }
  5189. source = source.$parent;
  5190. }
  5191. if (!source) {
  5192. if ('default' in inject[key]) {
  5193. var provideDefault = inject[key].default;
  5194. result[key] = typeof provideDefault === 'function'
  5195. ? provideDefault.call(vm)
  5196. : provideDefault;
  5197. } else if (true) {
  5198. warn(("Injection \"" + key + "\" not found"), vm);
  5199. }
  5200. }
  5201. }
  5202. return result
  5203. }
  5204. }
  5205. /* */
  5206. /**
  5207. * Runtime helper for resolving raw children VNodes into a slot object.
  5208. */
  5209. function resolveSlots (
  5210. children,
  5211. context
  5212. ) {
  5213. if (!children || !children.length) {
  5214. return {}
  5215. }
  5216. var slots = {};
  5217. for (var i = 0, l = children.length; i < l; i++) {
  5218. var child = children[i];
  5219. var data = child.data;
  5220. // remove slot attribute if the node is resolved as a Vue slot node
  5221. if (data && data.attrs && data.attrs.slot) {
  5222. delete data.attrs.slot;
  5223. }
  5224. // named slots should only be respected if the vnode was rendered in the
  5225. // same context.
  5226. if ((child.context === context || child.fnContext === context) &&
  5227. data && data.slot != null
  5228. ) {
  5229. var name = data.slot;
  5230. var slot = (slots[name] || (slots[name] = []));
  5231. if (child.tag === 'template') {
  5232. slot.push.apply(slot, child.children || []);
  5233. } else {
  5234. slot.push(child);
  5235. }
  5236. } else {
  5237. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5238. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5239. (slots['page'] || (slots['page'] = [])).push(child);
  5240. }else{
  5241. (slots.default || (slots.default = [])).push(child);
  5242. }
  5243. }
  5244. }
  5245. // ignore slots that contains only whitespace
  5246. for (var name$1 in slots) {
  5247. if (slots[name$1].every(isWhitespace)) {
  5248. delete slots[name$1];
  5249. }
  5250. }
  5251. return slots
  5252. }
  5253. function isWhitespace (node) {
  5254. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5255. }
  5256. /* */
  5257. function normalizeScopedSlots (
  5258. slots,
  5259. normalSlots,
  5260. prevSlots
  5261. ) {
  5262. var res;
  5263. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5264. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5265. var key = slots && slots.$key;
  5266. if (!slots) {
  5267. res = {};
  5268. } else if (slots._normalized) {
  5269. // fast path 1: child component re-render only, parent did not change
  5270. return slots._normalized
  5271. } else if (
  5272. isStable &&
  5273. prevSlots &&
  5274. prevSlots !== emptyObject &&
  5275. key === prevSlots.$key &&
  5276. !hasNormalSlots &&
  5277. !prevSlots.$hasNormal
  5278. ) {
  5279. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5280. // only need to normalize once
  5281. return prevSlots
  5282. } else {
  5283. res = {};
  5284. for (var key$1 in slots) {
  5285. if (slots[key$1] && key$1[0] !== '$') {
  5286. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5287. }
  5288. }
  5289. }
  5290. // expose normal slots on scopedSlots
  5291. for (var key$2 in normalSlots) {
  5292. if (!(key$2 in res)) {
  5293. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5294. }
  5295. }
  5296. // avoriaz seems to mock a non-extensible $scopedSlots object
  5297. // and when that is passed down this would cause an error
  5298. if (slots && Object.isExtensible(slots)) {
  5299. (slots)._normalized = res;
  5300. }
  5301. def(res, '$stable', isStable);
  5302. def(res, '$key', key);
  5303. def(res, '$hasNormal', hasNormalSlots);
  5304. return res
  5305. }
  5306. function normalizeScopedSlot(normalSlots, key, fn) {
  5307. var normalized = function () {
  5308. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5309. res = res && typeof res === 'object' && !Array.isArray(res)
  5310. ? [res] // single vnode
  5311. : normalizeChildren(res);
  5312. return res && (
  5313. res.length === 0 ||
  5314. (res.length === 1 && res[0].isComment) // #9658
  5315. ) ? undefined
  5316. : res
  5317. };
  5318. // this is a slot using the new v-slot syntax without scope. although it is
  5319. // compiled as a scoped slot, render fn users would expect it to be present
  5320. // on this.$slots because the usage is semantically a normal slot.
  5321. if (fn.proxy) {
  5322. Object.defineProperty(normalSlots, key, {
  5323. get: normalized,
  5324. enumerable: true,
  5325. configurable: true
  5326. });
  5327. }
  5328. return normalized
  5329. }
  5330. function proxyNormalSlot(slots, key) {
  5331. return function () { return slots[key]; }
  5332. }
  5333. /* */
  5334. /**
  5335. * Runtime helper for rendering v-for lists.
  5336. */
  5337. function renderList (
  5338. val,
  5339. render
  5340. ) {
  5341. var ret, i, l, keys, key;
  5342. if (Array.isArray(val) || typeof val === 'string') {
  5343. ret = new Array(val.length);
  5344. for (i = 0, l = val.length; i < l; i++) {
  5345. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5346. }
  5347. } else if (typeof val === 'number') {
  5348. ret = new Array(val);
  5349. for (i = 0; i < val; i++) {
  5350. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5351. }
  5352. } else if (isObject(val)) {
  5353. if (hasSymbol && val[Symbol.iterator]) {
  5354. ret = [];
  5355. var iterator = val[Symbol.iterator]();
  5356. var result = iterator.next();
  5357. while (!result.done) {
  5358. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5359. result = iterator.next();
  5360. }
  5361. } else {
  5362. keys = Object.keys(val);
  5363. ret = new Array(keys.length);
  5364. for (i = 0, l = keys.length; i < l; i++) {
  5365. key = keys[i];
  5366. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5367. }
  5368. }
  5369. }
  5370. if (!isDef(ret)) {
  5371. ret = [];
  5372. }
  5373. (ret)._isVList = true;
  5374. return ret
  5375. }
  5376. /* */
  5377. /**
  5378. * Runtime helper for rendering <slot>
  5379. */
  5380. function renderSlot (
  5381. name,
  5382. fallback,
  5383. props,
  5384. bindObject
  5385. ) {
  5386. var scopedSlotFn = this.$scopedSlots[name];
  5387. var nodes;
  5388. if (scopedSlotFn) { // scoped slot
  5389. props = props || {};
  5390. if (bindObject) {
  5391. if ( true && !isObject(bindObject)) {
  5392. warn(
  5393. 'slot v-bind without argument expects an Object',
  5394. this
  5395. );
  5396. }
  5397. props = extend(extend({}, bindObject), props);
  5398. }
  5399. // fixed by xxxxxx app-plus scopedSlot
  5400. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5401. } else {
  5402. nodes = this.$slots[name] || fallback;
  5403. }
  5404. var target = props && props.slot;
  5405. if (target) {
  5406. return this.$createElement('template', { slot: target }, nodes)
  5407. } else {
  5408. return nodes
  5409. }
  5410. }
  5411. /* */
  5412. /**
  5413. * Runtime helper for resolving filters
  5414. */
  5415. function resolveFilter (id) {
  5416. return resolveAsset(this.$options, 'filters', id, true) || identity
  5417. }
  5418. /* */
  5419. function isKeyNotMatch (expect, actual) {
  5420. if (Array.isArray(expect)) {
  5421. return expect.indexOf(actual) === -1
  5422. } else {
  5423. return expect !== actual
  5424. }
  5425. }
  5426. /**
  5427. * Runtime helper for checking keyCodes from config.
  5428. * exposed as Vue.prototype._k
  5429. * passing in eventKeyName as last argument separately for backwards compat
  5430. */
  5431. function checkKeyCodes (
  5432. eventKeyCode,
  5433. key,
  5434. builtInKeyCode,
  5435. eventKeyName,
  5436. builtInKeyName
  5437. ) {
  5438. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5439. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5440. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5441. } else if (mappedKeyCode) {
  5442. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5443. } else if (eventKeyName) {
  5444. return hyphenate(eventKeyName) !== key
  5445. }
  5446. }
  5447. /* */
  5448. /**
  5449. * Runtime helper for merging v-bind="object" into a VNode's data.
  5450. */
  5451. function bindObjectProps (
  5452. data,
  5453. tag,
  5454. value,
  5455. asProp,
  5456. isSync
  5457. ) {
  5458. if (value) {
  5459. if (!isObject(value)) {
  5460. true && warn(
  5461. 'v-bind without argument expects an Object or Array value',
  5462. this
  5463. );
  5464. } else {
  5465. if (Array.isArray(value)) {
  5466. value = toObject(value);
  5467. }
  5468. var hash;
  5469. var loop = function ( key ) {
  5470. if (
  5471. key === 'class' ||
  5472. key === 'style' ||
  5473. isReservedAttribute(key)
  5474. ) {
  5475. hash = data;
  5476. } else {
  5477. var type = data.attrs && data.attrs.type;
  5478. hash = asProp || config.mustUseProp(tag, type, key)
  5479. ? data.domProps || (data.domProps = {})
  5480. : data.attrs || (data.attrs = {});
  5481. }
  5482. var camelizedKey = camelize(key);
  5483. var hyphenatedKey = hyphenate(key);
  5484. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5485. hash[key] = value[key];
  5486. if (isSync) {
  5487. var on = data.on || (data.on = {});
  5488. on[("update:" + key)] = function ($event) {
  5489. value[key] = $event;
  5490. };
  5491. }
  5492. }
  5493. };
  5494. for (var key in value) loop( key );
  5495. }
  5496. }
  5497. return data
  5498. }
  5499. /* */
  5500. /**
  5501. * Runtime helper for rendering static trees.
  5502. */
  5503. function renderStatic (
  5504. index,
  5505. isInFor
  5506. ) {
  5507. var cached = this._staticTrees || (this._staticTrees = []);
  5508. var tree = cached[index];
  5509. // if has already-rendered static tree and not inside v-for,
  5510. // we can reuse the same tree.
  5511. if (tree && !isInFor) {
  5512. return tree
  5513. }
  5514. // otherwise, render a fresh tree.
  5515. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5516. this._renderProxy,
  5517. null,
  5518. this // for render fns generated for functional component templates
  5519. );
  5520. markStatic(tree, ("__static__" + index), false);
  5521. return tree
  5522. }
  5523. /**
  5524. * Runtime helper for v-once.
  5525. * Effectively it means marking the node as static with a unique key.
  5526. */
  5527. function markOnce (
  5528. tree,
  5529. index,
  5530. key
  5531. ) {
  5532. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5533. return tree
  5534. }
  5535. function markStatic (
  5536. tree,
  5537. key,
  5538. isOnce
  5539. ) {
  5540. if (Array.isArray(tree)) {
  5541. for (var i = 0; i < tree.length; i++) {
  5542. if (tree[i] && typeof tree[i] !== 'string') {
  5543. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5544. }
  5545. }
  5546. } else {
  5547. markStaticNode(tree, key, isOnce);
  5548. }
  5549. }
  5550. function markStaticNode (node, key, isOnce) {
  5551. node.isStatic = true;
  5552. node.key = key;
  5553. node.isOnce = isOnce;
  5554. }
  5555. /* */
  5556. function bindObjectListeners (data, value) {
  5557. if (value) {
  5558. if (!isPlainObject(value)) {
  5559. true && warn(
  5560. 'v-on without argument expects an Object value',
  5561. this
  5562. );
  5563. } else {
  5564. var on = data.on = data.on ? extend({}, data.on) : {};
  5565. for (var key in value) {
  5566. var existing = on[key];
  5567. var ours = value[key];
  5568. on[key] = existing ? [].concat(existing, ours) : ours;
  5569. }
  5570. }
  5571. }
  5572. return data
  5573. }
  5574. /* */
  5575. function resolveScopedSlots (
  5576. fns, // see flow/vnode
  5577. res,
  5578. // the following are added in 2.6
  5579. hasDynamicKeys,
  5580. contentHashKey
  5581. ) {
  5582. res = res || { $stable: !hasDynamicKeys };
  5583. for (var i = 0; i < fns.length; i++) {
  5584. var slot = fns[i];
  5585. if (Array.isArray(slot)) {
  5586. resolveScopedSlots(slot, res, hasDynamicKeys);
  5587. } else if (slot) {
  5588. // marker for reverse proxying v-slot without scope on this.$slots
  5589. if (slot.proxy) {
  5590. slot.fn.proxy = true;
  5591. }
  5592. res[slot.key] = slot.fn;
  5593. }
  5594. }
  5595. if (contentHashKey) {
  5596. (res).$key = contentHashKey;
  5597. }
  5598. return res
  5599. }
  5600. /* */
  5601. function bindDynamicKeys (baseObj, values) {
  5602. for (var i = 0; i < values.length; i += 2) {
  5603. var key = values[i];
  5604. if (typeof key === 'string' && key) {
  5605. baseObj[values[i]] = values[i + 1];
  5606. } else if ( true && key !== '' && key !== null) {
  5607. // null is a special value for explicitly removing a binding
  5608. warn(
  5609. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5610. this
  5611. );
  5612. }
  5613. }
  5614. return baseObj
  5615. }
  5616. // helper to dynamically append modifier runtime markers to event names.
  5617. // ensure only append when value is already string, otherwise it will be cast
  5618. // to string and cause the type check to miss.
  5619. function prependModifier (value, symbol) {
  5620. return typeof value === 'string' ? symbol + value : value
  5621. }
  5622. /* */
  5623. function installRenderHelpers (target) {
  5624. target._o = markOnce;
  5625. target._n = toNumber;
  5626. target._s = toString;
  5627. target._l = renderList;
  5628. target._t = renderSlot;
  5629. target._q = looseEqual;
  5630. target._i = looseIndexOf;
  5631. target._m = renderStatic;
  5632. target._f = resolveFilter;
  5633. target._k = checkKeyCodes;
  5634. target._b = bindObjectProps;
  5635. target._v = createTextVNode;
  5636. target._e = createEmptyVNode;
  5637. target._u = resolveScopedSlots;
  5638. target._g = bindObjectListeners;
  5639. target._d = bindDynamicKeys;
  5640. target._p = prependModifier;
  5641. }
  5642. /* */
  5643. function FunctionalRenderContext (
  5644. data,
  5645. props,
  5646. children,
  5647. parent,
  5648. Ctor
  5649. ) {
  5650. var this$1 = this;
  5651. var options = Ctor.options;
  5652. // ensure the createElement function in functional components
  5653. // gets a unique context - this is necessary for correct named slot check
  5654. var contextVm;
  5655. if (hasOwn(parent, '_uid')) {
  5656. contextVm = Object.create(parent);
  5657. // $flow-disable-line
  5658. contextVm._original = parent;
  5659. } else {
  5660. // the context vm passed in is a functional context as well.
  5661. // in this case we want to make sure we are able to get a hold to the
  5662. // real context instance.
  5663. contextVm = parent;
  5664. // $flow-disable-line
  5665. parent = parent._original;
  5666. }
  5667. var isCompiled = isTrue(options._compiled);
  5668. var needNormalization = !isCompiled;
  5669. this.data = data;
  5670. this.props = props;
  5671. this.children = children;
  5672. this.parent = parent;
  5673. this.listeners = data.on || emptyObject;
  5674. this.injections = resolveInject(options.inject, parent);
  5675. this.slots = function () {
  5676. if (!this$1.$slots) {
  5677. normalizeScopedSlots(
  5678. data.scopedSlots,
  5679. this$1.$slots = resolveSlots(children, parent)
  5680. );
  5681. }
  5682. return this$1.$slots
  5683. };
  5684. Object.defineProperty(this, 'scopedSlots', ({
  5685. enumerable: true,
  5686. get: function get () {
  5687. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5688. }
  5689. }));
  5690. // support for compiled functional template
  5691. if (isCompiled) {
  5692. // exposing $options for renderStatic()
  5693. this.$options = options;
  5694. // pre-resolve slots for renderSlot()
  5695. this.$slots = this.slots();
  5696. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5697. }
  5698. if (options._scopeId) {
  5699. this._c = function (a, b, c, d) {
  5700. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5701. if (vnode && !Array.isArray(vnode)) {
  5702. vnode.fnScopeId = options._scopeId;
  5703. vnode.fnContext = parent;
  5704. }
  5705. return vnode
  5706. };
  5707. } else {
  5708. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5709. }
  5710. }
  5711. installRenderHelpers(FunctionalRenderContext.prototype);
  5712. function createFunctionalComponent (
  5713. Ctor,
  5714. propsData,
  5715. data,
  5716. contextVm,
  5717. children
  5718. ) {
  5719. var options = Ctor.options;
  5720. var props = {};
  5721. var propOptions = options.props;
  5722. if (isDef(propOptions)) {
  5723. for (var key in propOptions) {
  5724. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5725. }
  5726. } else {
  5727. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5728. if (isDef(data.props)) { mergeProps(props, data.props); }
  5729. }
  5730. var renderContext = new FunctionalRenderContext(
  5731. data,
  5732. props,
  5733. children,
  5734. contextVm,
  5735. Ctor
  5736. );
  5737. var vnode = options.render.call(null, renderContext._c, renderContext);
  5738. if (vnode instanceof VNode) {
  5739. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5740. } else if (Array.isArray(vnode)) {
  5741. var vnodes = normalizeChildren(vnode) || [];
  5742. var res = new Array(vnodes.length);
  5743. for (var i = 0; i < vnodes.length; i++) {
  5744. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5745. }
  5746. return res
  5747. }
  5748. }
  5749. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5750. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5751. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5752. // that should not be matched to match.
  5753. var clone = cloneVNode(vnode);
  5754. clone.fnContext = contextVm;
  5755. clone.fnOptions = options;
  5756. if (true) {
  5757. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5758. }
  5759. if (data.slot) {
  5760. (clone.data || (clone.data = {})).slot = data.slot;
  5761. }
  5762. return clone
  5763. }
  5764. function mergeProps (to, from) {
  5765. for (var key in from) {
  5766. to[camelize(key)] = from[key];
  5767. }
  5768. }
  5769. /* */
  5770. /* */
  5771. /* */
  5772. /* */
  5773. // inline hooks to be invoked on component VNodes during patch
  5774. var componentVNodeHooks = {
  5775. init: function init (vnode, hydrating) {
  5776. if (
  5777. vnode.componentInstance &&
  5778. !vnode.componentInstance._isDestroyed &&
  5779. vnode.data.keepAlive
  5780. ) {
  5781. // kept-alive components, treat as a patch
  5782. var mountedNode = vnode; // work around flow
  5783. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5784. } else {
  5785. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5786. vnode,
  5787. activeInstance
  5788. );
  5789. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5790. }
  5791. },
  5792. prepatch: function prepatch (oldVnode, vnode) {
  5793. var options = vnode.componentOptions;
  5794. var child = vnode.componentInstance = oldVnode.componentInstance;
  5795. updateChildComponent(
  5796. child,
  5797. options.propsData, // updated props
  5798. options.listeners, // updated listeners
  5799. vnode, // new parent vnode
  5800. options.children // new children
  5801. );
  5802. },
  5803. insert: function insert (vnode) {
  5804. var context = vnode.context;
  5805. var componentInstance = vnode.componentInstance;
  5806. if (!componentInstance._isMounted) {
  5807. callHook(componentInstance, 'onServiceCreated');
  5808. callHook(componentInstance, 'onServiceAttached');
  5809. componentInstance._isMounted = true;
  5810. callHook(componentInstance, 'mounted');
  5811. }
  5812. if (vnode.data.keepAlive) {
  5813. if (context._isMounted) {
  5814. // vue-router#1212
  5815. // During updates, a kept-alive component's child components may
  5816. // change, so directly walking the tree here may call activated hooks
  5817. // on incorrect children. Instead we push them into a queue which will
  5818. // be processed after the whole patch process ended.
  5819. queueActivatedComponent(componentInstance);
  5820. } else {
  5821. activateChildComponent(componentInstance, true /* direct */);
  5822. }
  5823. }
  5824. },
  5825. destroy: function destroy (vnode) {
  5826. var componentInstance = vnode.componentInstance;
  5827. if (!componentInstance._isDestroyed) {
  5828. if (!vnode.data.keepAlive) {
  5829. componentInstance.$destroy();
  5830. } else {
  5831. deactivateChildComponent(componentInstance, true /* direct */);
  5832. }
  5833. }
  5834. }
  5835. };
  5836. var hooksToMerge = Object.keys(componentVNodeHooks);
  5837. function createComponent (
  5838. Ctor,
  5839. data,
  5840. context,
  5841. children,
  5842. tag
  5843. ) {
  5844. if (isUndef(Ctor)) {
  5845. return
  5846. }
  5847. var baseCtor = context.$options._base;
  5848. // plain options object: turn it into a constructor
  5849. if (isObject(Ctor)) {
  5850. Ctor = baseCtor.extend(Ctor);
  5851. }
  5852. // if at this stage it's not a constructor or an async component factory,
  5853. // reject.
  5854. if (typeof Ctor !== 'function') {
  5855. if (true) {
  5856. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5857. }
  5858. return
  5859. }
  5860. // async component
  5861. var asyncFactory;
  5862. if (isUndef(Ctor.cid)) {
  5863. asyncFactory = Ctor;
  5864. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5865. if (Ctor === undefined) {
  5866. // return a placeholder node for async component, which is rendered
  5867. // as a comment node but preserves all the raw information for the node.
  5868. // the information will be used for async server-rendering and hydration.
  5869. return createAsyncPlaceholder(
  5870. asyncFactory,
  5871. data,
  5872. context,
  5873. children,
  5874. tag
  5875. )
  5876. }
  5877. }
  5878. data = data || {};
  5879. // resolve constructor options in case global mixins are applied after
  5880. // component constructor creation
  5881. resolveConstructorOptions(Ctor);
  5882. // transform component v-model data into props & events
  5883. if (isDef(data.model)) {
  5884. transformModel(Ctor.options, data);
  5885. }
  5886. // extract props
  5887. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5888. // functional component
  5889. if (isTrue(Ctor.options.functional)) {
  5890. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5891. }
  5892. // extract listeners, since these needs to be treated as
  5893. // child component listeners instead of DOM listeners
  5894. var listeners = data.on;
  5895. // replace with listeners with .native modifier
  5896. // so it gets processed during parent component patch.
  5897. data.on = data.nativeOn;
  5898. if (isTrue(Ctor.options.abstract)) {
  5899. // abstract components do not keep anything
  5900. // other than props & listeners & slot
  5901. // work around flow
  5902. var slot = data.slot;
  5903. data = {};
  5904. if (slot) {
  5905. data.slot = slot;
  5906. }
  5907. }
  5908. // install component management hooks onto the placeholder node
  5909. installComponentHooks(data);
  5910. // return a placeholder vnode
  5911. var name = Ctor.options.name || tag;
  5912. var vnode = new VNode(
  5913. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5914. data, undefined, undefined, undefined, context,
  5915. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5916. asyncFactory
  5917. );
  5918. return vnode
  5919. }
  5920. function createComponentInstanceForVnode (
  5921. vnode, // we know it's MountedComponentVNode but flow doesn't
  5922. parent // activeInstance in lifecycle state
  5923. ) {
  5924. var options = {
  5925. _isComponent: true,
  5926. _parentVnode: vnode,
  5927. parent: parent
  5928. };
  5929. // check inline-template render functions
  5930. var inlineTemplate = vnode.data.inlineTemplate;
  5931. if (isDef(inlineTemplate)) {
  5932. options.render = inlineTemplate.render;
  5933. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5934. }
  5935. return new vnode.componentOptions.Ctor(options)
  5936. }
  5937. function installComponentHooks (data) {
  5938. var hooks = data.hook || (data.hook = {});
  5939. for (var i = 0; i < hooksToMerge.length; i++) {
  5940. var key = hooksToMerge[i];
  5941. var existing = hooks[key];
  5942. var toMerge = componentVNodeHooks[key];
  5943. if (existing !== toMerge && !(existing && existing._merged)) {
  5944. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5945. }
  5946. }
  5947. }
  5948. function mergeHook$1 (f1, f2) {
  5949. var merged = function (a, b) {
  5950. // flow complains about extra args which is why we use any
  5951. f1(a, b);
  5952. f2(a, b);
  5953. };
  5954. merged._merged = true;
  5955. return merged
  5956. }
  5957. // transform component v-model info (value and callback) into
  5958. // prop and event handler respectively.
  5959. function transformModel (options, data) {
  5960. var prop = (options.model && options.model.prop) || 'value';
  5961. var event = (options.model && options.model.event) || 'input'
  5962. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5963. var on = data.on || (data.on = {});
  5964. var existing = on[event];
  5965. var callback = data.model.callback;
  5966. if (isDef(existing)) {
  5967. if (
  5968. Array.isArray(existing)
  5969. ? existing.indexOf(callback) === -1
  5970. : existing !== callback
  5971. ) {
  5972. on[event] = [callback].concat(existing);
  5973. }
  5974. } else {
  5975. on[event] = callback;
  5976. }
  5977. }
  5978. /* */
  5979. var SIMPLE_NORMALIZE = 1;
  5980. var ALWAYS_NORMALIZE = 2;
  5981. // wrapper function for providing a more flexible interface
  5982. // without getting yelled at by flow
  5983. function createElement (
  5984. context,
  5985. tag,
  5986. data,
  5987. children,
  5988. normalizationType,
  5989. alwaysNormalize
  5990. ) {
  5991. if (Array.isArray(data) || isPrimitive(data)) {
  5992. normalizationType = children;
  5993. children = data;
  5994. data = undefined;
  5995. }
  5996. if (isTrue(alwaysNormalize)) {
  5997. normalizationType = ALWAYS_NORMALIZE;
  5998. }
  5999. return _createElement(context, tag, data, children, normalizationType)
  6000. }
  6001. function _createElement (
  6002. context,
  6003. tag,
  6004. data,
  6005. children,
  6006. normalizationType
  6007. ) {
  6008. if (isDef(data) && isDef((data).__ob__)) {
  6009. true && warn(
  6010. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6011. 'Always create fresh vnode data objects in each render!',
  6012. context
  6013. );
  6014. return createEmptyVNode()
  6015. }
  6016. // object syntax in v-bind
  6017. if (isDef(data) && isDef(data.is)) {
  6018. tag = data.is;
  6019. }
  6020. if (!tag) {
  6021. // in case of component :is set to falsy value
  6022. return createEmptyVNode()
  6023. }
  6024. // warn against non-primitive key
  6025. if ( true &&
  6026. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6027. ) {
  6028. {
  6029. warn(
  6030. 'Avoid using non-primitive value as key, ' +
  6031. 'use string/number value instead.',
  6032. context
  6033. );
  6034. }
  6035. }
  6036. // support single function children as default scoped slot
  6037. if (Array.isArray(children) &&
  6038. typeof children[0] === 'function'
  6039. ) {
  6040. data = data || {};
  6041. data.scopedSlots = { default: children[0] };
  6042. children.length = 0;
  6043. }
  6044. if (normalizationType === ALWAYS_NORMALIZE) {
  6045. children = normalizeChildren(children);
  6046. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6047. children = simpleNormalizeChildren(children);
  6048. }
  6049. var vnode, ns;
  6050. if (typeof tag === 'string') {
  6051. var Ctor;
  6052. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6053. if (config.isReservedTag(tag)) {
  6054. // platform built-in elements
  6055. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6056. warn(
  6057. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6058. context
  6059. );
  6060. }
  6061. vnode = new VNode(
  6062. config.parsePlatformTagName(tag), data, children,
  6063. undefined, undefined, context
  6064. );
  6065. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6066. // component
  6067. vnode = createComponent(Ctor, data, context, children, tag);
  6068. } else {
  6069. // unknown or unlisted namespaced elements
  6070. // check at runtime because it may get assigned a namespace when its
  6071. // parent normalizes children
  6072. vnode = new VNode(
  6073. tag, data, children,
  6074. undefined, undefined, context
  6075. );
  6076. }
  6077. } else {
  6078. // direct component options / constructor
  6079. vnode = createComponent(tag, data, context, children);
  6080. }
  6081. if (Array.isArray(vnode)) {
  6082. return vnode
  6083. } else if (isDef(vnode)) {
  6084. if (isDef(ns)) { applyNS(vnode, ns); }
  6085. if (isDef(data)) { registerDeepBindings(data); }
  6086. return vnode
  6087. } else {
  6088. return createEmptyVNode()
  6089. }
  6090. }
  6091. function applyNS (vnode, ns, force) {
  6092. vnode.ns = ns;
  6093. if (vnode.tag === 'foreignObject') {
  6094. // use default namespace inside foreignObject
  6095. ns = undefined;
  6096. force = true;
  6097. }
  6098. if (isDef(vnode.children)) {
  6099. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6100. var child = vnode.children[i];
  6101. if (isDef(child.tag) && (
  6102. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6103. applyNS(child, ns, force);
  6104. }
  6105. }
  6106. }
  6107. }
  6108. // ref #5318
  6109. // necessary to ensure parent re-render when deep bindings like :style and
  6110. // :class are used on slot nodes
  6111. function registerDeepBindings (data) {
  6112. if (isObject(data.style)) {
  6113. traverse(data.style);
  6114. }
  6115. if (isObject(data.class)) {
  6116. traverse(data.class);
  6117. }
  6118. }
  6119. /* */
  6120. function initRender (vm) {
  6121. vm._vnode = null; // the root of the child tree
  6122. vm._staticTrees = null; // v-once cached trees
  6123. var options = vm.$options;
  6124. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6125. var renderContext = parentVnode && parentVnode.context;
  6126. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6127. vm.$scopedSlots = emptyObject;
  6128. // bind the createElement fn to this instance
  6129. // so that we get proper render context inside it.
  6130. // args order: tag, data, children, normalizationType, alwaysNormalize
  6131. // internal version is used by render functions compiled from templates
  6132. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6133. // normalization is always applied for the public version, used in
  6134. // user-written render functions.
  6135. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6136. // $attrs & $listeners are exposed for easier HOC creation.
  6137. // they need to be reactive so that HOCs using them are always updated
  6138. var parentData = parentVnode && parentVnode.data;
  6139. /* istanbul ignore else */
  6140. if (true) {
  6141. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6142. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6143. }, true);
  6144. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6145. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6146. }, true);
  6147. } else {}
  6148. }
  6149. var currentRenderingInstance = null;
  6150. function renderMixin (Vue) {
  6151. // install runtime convenience helpers
  6152. installRenderHelpers(Vue.prototype);
  6153. Vue.prototype.$nextTick = function (fn) {
  6154. return nextTick(fn, this)
  6155. };
  6156. Vue.prototype._render = function () {
  6157. var vm = this;
  6158. var ref = vm.$options;
  6159. var render = ref.render;
  6160. var _parentVnode = ref._parentVnode;
  6161. if (_parentVnode) {
  6162. vm.$scopedSlots = normalizeScopedSlots(
  6163. _parentVnode.data.scopedSlots,
  6164. vm.$slots,
  6165. vm.$scopedSlots
  6166. );
  6167. }
  6168. // set parent vnode. this allows render functions to have access
  6169. // to the data on the placeholder node.
  6170. vm.$vnode = _parentVnode;
  6171. // render self
  6172. var vnode;
  6173. try {
  6174. // There's no need to maintain a stack because all render fns are called
  6175. // separately from one another. Nested component's render fns are called
  6176. // when parent component is patched.
  6177. currentRenderingInstance = vm;
  6178. vnode = render.call(vm._renderProxy, vm.$createElement);
  6179. } catch (e) {
  6180. handleError(e, vm, "render");
  6181. // return error render result,
  6182. // or previous vnode to prevent render error causing blank component
  6183. /* istanbul ignore else */
  6184. if ( true && vm.$options.renderError) {
  6185. try {
  6186. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6187. } catch (e) {
  6188. handleError(e, vm, "renderError");
  6189. vnode = vm._vnode;
  6190. }
  6191. } else {
  6192. vnode = vm._vnode;
  6193. }
  6194. } finally {
  6195. currentRenderingInstance = null;
  6196. }
  6197. // if the returned array contains only a single node, allow it
  6198. if (Array.isArray(vnode) && vnode.length === 1) {
  6199. vnode = vnode[0];
  6200. }
  6201. // return empty vnode in case the render function errored out
  6202. if (!(vnode instanceof VNode)) {
  6203. if ( true && Array.isArray(vnode)) {
  6204. warn(
  6205. 'Multiple root nodes returned from render function. Render function ' +
  6206. 'should return a single root node.',
  6207. vm
  6208. );
  6209. }
  6210. vnode = createEmptyVNode();
  6211. }
  6212. // set parent
  6213. vnode.parent = _parentVnode;
  6214. return vnode
  6215. };
  6216. }
  6217. /* */
  6218. function ensureCtor (comp, base) {
  6219. if (
  6220. comp.__esModule ||
  6221. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6222. ) {
  6223. comp = comp.default;
  6224. }
  6225. return isObject(comp)
  6226. ? base.extend(comp)
  6227. : comp
  6228. }
  6229. function createAsyncPlaceholder (
  6230. factory,
  6231. data,
  6232. context,
  6233. children,
  6234. tag
  6235. ) {
  6236. var node = createEmptyVNode();
  6237. node.asyncFactory = factory;
  6238. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6239. return node
  6240. }
  6241. function resolveAsyncComponent (
  6242. factory,
  6243. baseCtor
  6244. ) {
  6245. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6246. return factory.errorComp
  6247. }
  6248. if (isDef(factory.resolved)) {
  6249. return factory.resolved
  6250. }
  6251. var owner = currentRenderingInstance;
  6252. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6253. // already pending
  6254. factory.owners.push(owner);
  6255. }
  6256. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6257. return factory.loadingComp
  6258. }
  6259. if (owner && !isDef(factory.owners)) {
  6260. var owners = factory.owners = [owner];
  6261. var sync = true;
  6262. var timerLoading = null;
  6263. var timerTimeout = null
  6264. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6265. var forceRender = function (renderCompleted) {
  6266. for (var i = 0, l = owners.length; i < l; i++) {
  6267. (owners[i]).$forceUpdate();
  6268. }
  6269. if (renderCompleted) {
  6270. owners.length = 0;
  6271. if (timerLoading !== null) {
  6272. clearTimeout(timerLoading);
  6273. timerLoading = null;
  6274. }
  6275. if (timerTimeout !== null) {
  6276. clearTimeout(timerTimeout);
  6277. timerTimeout = null;
  6278. }
  6279. }
  6280. };
  6281. var resolve = once(function (res) {
  6282. // cache resolved
  6283. factory.resolved = ensureCtor(res, baseCtor);
  6284. // invoke callbacks only if this is not a synchronous resolve
  6285. // (async resolves are shimmed as synchronous during SSR)
  6286. if (!sync) {
  6287. forceRender(true);
  6288. } else {
  6289. owners.length = 0;
  6290. }
  6291. });
  6292. var reject = once(function (reason) {
  6293. true && warn(
  6294. "Failed to resolve async component: " + (String(factory)) +
  6295. (reason ? ("\nReason: " + reason) : '')
  6296. );
  6297. if (isDef(factory.errorComp)) {
  6298. factory.error = true;
  6299. forceRender(true);
  6300. }
  6301. });
  6302. var res = factory(resolve, reject);
  6303. if (isObject(res)) {
  6304. if (isPromise(res)) {
  6305. // () => Promise
  6306. if (isUndef(factory.resolved)) {
  6307. res.then(resolve, reject);
  6308. }
  6309. } else if (isPromise(res.component)) {
  6310. res.component.then(resolve, reject);
  6311. if (isDef(res.error)) {
  6312. factory.errorComp = ensureCtor(res.error, baseCtor);
  6313. }
  6314. if (isDef(res.loading)) {
  6315. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6316. if (res.delay === 0) {
  6317. factory.loading = true;
  6318. } else {
  6319. timerLoading = setTimeout(function () {
  6320. timerLoading = null;
  6321. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6322. factory.loading = true;
  6323. forceRender(false);
  6324. }
  6325. }, res.delay || 200);
  6326. }
  6327. }
  6328. if (isDef(res.timeout)) {
  6329. timerTimeout = setTimeout(function () {
  6330. timerTimeout = null;
  6331. if (isUndef(factory.resolved)) {
  6332. reject(
  6333. true
  6334. ? ("timeout (" + (res.timeout) + "ms)")
  6335. : undefined
  6336. );
  6337. }
  6338. }, res.timeout);
  6339. }
  6340. }
  6341. }
  6342. sync = false;
  6343. // return in case resolved synchronously
  6344. return factory.loading
  6345. ? factory.loadingComp
  6346. : factory.resolved
  6347. }
  6348. }
  6349. /* */
  6350. function isAsyncPlaceholder (node) {
  6351. return node.isComment && node.asyncFactory
  6352. }
  6353. /* */
  6354. function getFirstComponentChild (children) {
  6355. if (Array.isArray(children)) {
  6356. for (var i = 0; i < children.length; i++) {
  6357. var c = children[i];
  6358. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6359. return c
  6360. }
  6361. }
  6362. }
  6363. }
  6364. /* */
  6365. /* */
  6366. function initEvents (vm) {
  6367. vm._events = Object.create(null);
  6368. vm._hasHookEvent = false;
  6369. // init parent attached events
  6370. var listeners = vm.$options._parentListeners;
  6371. if (listeners) {
  6372. updateComponentListeners(vm, listeners);
  6373. }
  6374. }
  6375. var target;
  6376. function add (event, fn) {
  6377. target.$on(event, fn);
  6378. }
  6379. function remove$1 (event, fn) {
  6380. target.$off(event, fn);
  6381. }
  6382. function createOnceHandler (event, fn) {
  6383. var _target = target;
  6384. return function onceHandler () {
  6385. var res = fn.apply(null, arguments);
  6386. if (res !== null) {
  6387. _target.$off(event, onceHandler);
  6388. }
  6389. }
  6390. }
  6391. function updateComponentListeners (
  6392. vm,
  6393. listeners,
  6394. oldListeners
  6395. ) {
  6396. target = vm;
  6397. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6398. target = undefined;
  6399. }
  6400. function eventsMixin (Vue) {
  6401. var hookRE = /^hook:/;
  6402. Vue.prototype.$on = function (event, fn) {
  6403. var vm = this;
  6404. if (Array.isArray(event)) {
  6405. for (var i = 0, l = event.length; i < l; i++) {
  6406. vm.$on(event[i], fn);
  6407. }
  6408. } else {
  6409. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6410. // optimize hook:event cost by using a boolean flag marked at registration
  6411. // instead of a hash lookup
  6412. if (hookRE.test(event)) {
  6413. vm._hasHookEvent = true;
  6414. }
  6415. }
  6416. return vm
  6417. };
  6418. Vue.prototype.$once = function (event, fn) {
  6419. var vm = this;
  6420. function on () {
  6421. vm.$off(event, on);
  6422. fn.apply(vm, arguments);
  6423. }
  6424. on.fn = fn;
  6425. vm.$on(event, on);
  6426. return vm
  6427. };
  6428. Vue.prototype.$off = function (event, fn) {
  6429. var vm = this;
  6430. // all
  6431. if (!arguments.length) {
  6432. vm._events = Object.create(null);
  6433. return vm
  6434. }
  6435. // array of events
  6436. if (Array.isArray(event)) {
  6437. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6438. vm.$off(event[i$1], fn);
  6439. }
  6440. return vm
  6441. }
  6442. // specific event
  6443. var cbs = vm._events[event];
  6444. if (!cbs) {
  6445. return vm
  6446. }
  6447. if (!fn) {
  6448. vm._events[event] = null;
  6449. return vm
  6450. }
  6451. // specific handler
  6452. var cb;
  6453. var i = cbs.length;
  6454. while (i--) {
  6455. cb = cbs[i];
  6456. if (cb === fn || cb.fn === fn) {
  6457. cbs.splice(i, 1);
  6458. break
  6459. }
  6460. }
  6461. return vm
  6462. };
  6463. Vue.prototype.$emit = function (event) {
  6464. var vm = this;
  6465. if (true) {
  6466. var lowerCaseEvent = event.toLowerCase();
  6467. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6468. tip(
  6469. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6470. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6471. "Note that HTML attributes are case-insensitive and you cannot use " +
  6472. "v-on to listen to camelCase events when using in-DOM templates. " +
  6473. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6474. );
  6475. }
  6476. }
  6477. var cbs = vm._events[event];
  6478. if (cbs) {
  6479. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6480. var args = toArray(arguments, 1);
  6481. var info = "event handler for \"" + event + "\"";
  6482. for (var i = 0, l = cbs.length; i < l; i++) {
  6483. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6484. }
  6485. }
  6486. return vm
  6487. };
  6488. }
  6489. /* */
  6490. var activeInstance = null;
  6491. var isUpdatingChildComponent = false;
  6492. function setActiveInstance(vm) {
  6493. var prevActiveInstance = activeInstance;
  6494. activeInstance = vm;
  6495. return function () {
  6496. activeInstance = prevActiveInstance;
  6497. }
  6498. }
  6499. function initLifecycle (vm) {
  6500. var options = vm.$options;
  6501. // locate first non-abstract parent
  6502. var parent = options.parent;
  6503. if (parent && !options.abstract) {
  6504. while (parent.$options.abstract && parent.$parent) {
  6505. parent = parent.$parent;
  6506. }
  6507. parent.$children.push(vm);
  6508. }
  6509. vm.$parent = parent;
  6510. vm.$root = parent ? parent.$root : vm;
  6511. vm.$children = [];
  6512. vm.$refs = {};
  6513. vm._watcher = null;
  6514. vm._inactive = null;
  6515. vm._directInactive = false;
  6516. vm._isMounted = false;
  6517. vm._isDestroyed = false;
  6518. vm._isBeingDestroyed = false;
  6519. }
  6520. function lifecycleMixin (Vue) {
  6521. Vue.prototype._update = function (vnode, hydrating) {
  6522. var vm = this;
  6523. var prevEl = vm.$el;
  6524. var prevVnode = vm._vnode;
  6525. var restoreActiveInstance = setActiveInstance(vm);
  6526. vm._vnode = vnode;
  6527. // Vue.prototype.__patch__ is injected in entry points
  6528. // based on the rendering backend used.
  6529. if (!prevVnode) {
  6530. // initial render
  6531. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6532. } else {
  6533. // updates
  6534. vm.$el = vm.__patch__(prevVnode, vnode);
  6535. }
  6536. restoreActiveInstance();
  6537. // update __vue__ reference
  6538. if (prevEl) {
  6539. prevEl.__vue__ = null;
  6540. }
  6541. if (vm.$el) {
  6542. vm.$el.__vue__ = vm;
  6543. }
  6544. // if parent is an HOC, update its $el as well
  6545. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6546. vm.$parent.$el = vm.$el;
  6547. }
  6548. // updated hook is called by the scheduler to ensure that children are
  6549. // updated in a parent's updated hook.
  6550. };
  6551. Vue.prototype.$forceUpdate = function () {
  6552. var vm = this;
  6553. if (vm._watcher) {
  6554. vm._watcher.update();
  6555. }
  6556. };
  6557. Vue.prototype.$destroy = function () {
  6558. var vm = this;
  6559. if (vm._isBeingDestroyed) {
  6560. return
  6561. }
  6562. callHook(vm, 'beforeDestroy');
  6563. vm._isBeingDestroyed = true;
  6564. // remove self from parent
  6565. var parent = vm.$parent;
  6566. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6567. remove(parent.$children, vm);
  6568. }
  6569. // teardown watchers
  6570. if (vm._watcher) {
  6571. vm._watcher.teardown();
  6572. }
  6573. var i = vm._watchers.length;
  6574. while (i--) {
  6575. vm._watchers[i].teardown();
  6576. }
  6577. // remove reference from data ob
  6578. // frozen object may not have observer.
  6579. if (vm._data.__ob__) {
  6580. vm._data.__ob__.vmCount--;
  6581. }
  6582. // call the last hook...
  6583. vm._isDestroyed = true;
  6584. // invoke destroy hooks on current rendered tree
  6585. vm.__patch__(vm._vnode, null);
  6586. // fire destroyed hook
  6587. callHook(vm, 'destroyed');
  6588. // turn off all instance listeners.
  6589. vm.$off();
  6590. // remove __vue__ reference
  6591. if (vm.$el) {
  6592. vm.$el.__vue__ = null;
  6593. }
  6594. // release circular reference (#6759)
  6595. if (vm.$vnode) {
  6596. vm.$vnode.parent = null;
  6597. }
  6598. };
  6599. }
  6600. function updateChildComponent (
  6601. vm,
  6602. propsData,
  6603. listeners,
  6604. parentVnode,
  6605. renderChildren
  6606. ) {
  6607. if (true) {
  6608. isUpdatingChildComponent = true;
  6609. }
  6610. // determine whether component has slot children
  6611. // we need to do this before overwriting $options._renderChildren.
  6612. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6613. // dynamic slot names). Static scoped slots compiled from template has the
  6614. // "$stable" marker.
  6615. var newScopedSlots = parentVnode.data.scopedSlots;
  6616. var oldScopedSlots = vm.$scopedSlots;
  6617. var hasDynamicScopedSlot = !!(
  6618. (newScopedSlots && !newScopedSlots.$stable) ||
  6619. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6620. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6621. );
  6622. // Any static slot children from the parent may have changed during parent's
  6623. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6624. // update is necessary to ensure correctness.
  6625. var needsForceUpdate = !!(
  6626. renderChildren || // has new static slots
  6627. vm.$options._renderChildren || // has old static slots
  6628. hasDynamicScopedSlot
  6629. );
  6630. vm.$options._parentVnode = parentVnode;
  6631. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6632. if (vm._vnode) { // update child tree's parent
  6633. vm._vnode.parent = parentVnode;
  6634. }
  6635. vm.$options._renderChildren = renderChildren;
  6636. // update $attrs and $listeners hash
  6637. // these are also reactive so they may trigger child update if the child
  6638. // used them during render
  6639. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6640. vm.$listeners = listeners || emptyObject;
  6641. // update props
  6642. if (propsData && vm.$options.props) {
  6643. toggleObserving(false);
  6644. var props = vm._props;
  6645. var propKeys = vm.$options._propKeys || [];
  6646. for (var i = 0; i < propKeys.length; i++) {
  6647. var key = propKeys[i];
  6648. var propOptions = vm.$options.props; // wtf flow?
  6649. props[key] = validateProp(key, propOptions, propsData, vm);
  6650. }
  6651. toggleObserving(true);
  6652. // keep a copy of raw propsData
  6653. vm.$options.propsData = propsData;
  6654. }
  6655. // fixed by xxxxxx update properties(mp runtime)
  6656. vm._$updateProperties && vm._$updateProperties(vm);
  6657. // update listeners
  6658. listeners = listeners || emptyObject;
  6659. var oldListeners = vm.$options._parentListeners;
  6660. vm.$options._parentListeners = listeners;
  6661. updateComponentListeners(vm, listeners, oldListeners);
  6662. // resolve slots + force update if has children
  6663. if (needsForceUpdate) {
  6664. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6665. vm.$forceUpdate();
  6666. }
  6667. if (true) {
  6668. isUpdatingChildComponent = false;
  6669. }
  6670. }
  6671. function isInInactiveTree (vm) {
  6672. while (vm && (vm = vm.$parent)) {
  6673. if (vm._inactive) { return true }
  6674. }
  6675. return false
  6676. }
  6677. function activateChildComponent (vm, direct) {
  6678. if (direct) {
  6679. vm._directInactive = false;
  6680. if (isInInactiveTree(vm)) {
  6681. return
  6682. }
  6683. } else if (vm._directInactive) {
  6684. return
  6685. }
  6686. if (vm._inactive || vm._inactive === null) {
  6687. vm._inactive = false;
  6688. for (var i = 0; i < vm.$children.length; i++) {
  6689. activateChildComponent(vm.$children[i]);
  6690. }
  6691. callHook(vm, 'activated');
  6692. }
  6693. }
  6694. function deactivateChildComponent (vm, direct) {
  6695. if (direct) {
  6696. vm._directInactive = true;
  6697. if (isInInactiveTree(vm)) {
  6698. return
  6699. }
  6700. }
  6701. if (!vm._inactive) {
  6702. vm._inactive = true;
  6703. for (var i = 0; i < vm.$children.length; i++) {
  6704. deactivateChildComponent(vm.$children[i]);
  6705. }
  6706. callHook(vm, 'deactivated');
  6707. }
  6708. }
  6709. function callHook (vm, hook) {
  6710. // #7573 disable dep collection when invoking lifecycle hooks
  6711. pushTarget();
  6712. var handlers = vm.$options[hook];
  6713. var info = hook + " hook";
  6714. if (handlers) {
  6715. for (var i = 0, j = handlers.length; i < j; i++) {
  6716. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6717. }
  6718. }
  6719. if (vm._hasHookEvent) {
  6720. vm.$emit('hook:' + hook);
  6721. }
  6722. popTarget();
  6723. }
  6724. /* */
  6725. var MAX_UPDATE_COUNT = 100;
  6726. var queue = [];
  6727. var activatedChildren = [];
  6728. var has = {};
  6729. var circular = {};
  6730. var waiting = false;
  6731. var flushing = false;
  6732. var index = 0;
  6733. /**
  6734. * Reset the scheduler's state.
  6735. */
  6736. function resetSchedulerState () {
  6737. index = queue.length = activatedChildren.length = 0;
  6738. has = {};
  6739. if (true) {
  6740. circular = {};
  6741. }
  6742. waiting = flushing = false;
  6743. }
  6744. // Async edge case #6566 requires saving the timestamp when event listeners are
  6745. // attached. However, calling performance.now() has a perf overhead especially
  6746. // if the page has thousands of event listeners. Instead, we take a timestamp
  6747. // every time the scheduler flushes and use that for all event listeners
  6748. // attached during that flush.
  6749. var currentFlushTimestamp = 0;
  6750. // Async edge case fix requires storing an event listener's attach timestamp.
  6751. var getNow = Date.now;
  6752. // Determine what event timestamp the browser is using. Annoyingly, the
  6753. // timestamp can either be hi-res (relative to page load) or low-res
  6754. // (relative to UNIX epoch), so in order to compare time we have to use the
  6755. // same timestamp type when saving the flush timestamp.
  6756. // All IE versions use low-res event timestamps, and have problematic clock
  6757. // implementations (#9632)
  6758. if (inBrowser && !isIE) {
  6759. var performance = window.performance;
  6760. if (
  6761. performance &&
  6762. typeof performance.now === 'function' &&
  6763. getNow() > document.createEvent('Event').timeStamp
  6764. ) {
  6765. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6766. // smaller than it, it means the event is using a hi-res timestamp,
  6767. // and we need to use the hi-res version for event listener timestamps as
  6768. // well.
  6769. getNow = function () { return performance.now(); };
  6770. }
  6771. }
  6772. /**
  6773. * Flush both queues and run the watchers.
  6774. */
  6775. function flushSchedulerQueue () {
  6776. currentFlushTimestamp = getNow();
  6777. flushing = true;
  6778. var watcher, id;
  6779. // Sort queue before flush.
  6780. // This ensures that:
  6781. // 1. Components are updated from parent to child. (because parent is always
  6782. // created before the child)
  6783. // 2. A component's user watchers are run before its render watcher (because
  6784. // user watchers are created before the render watcher)
  6785. // 3. If a component is destroyed during a parent component's watcher run,
  6786. // its watchers can be skipped.
  6787. queue.sort(function (a, b) { return a.id - b.id; });
  6788. // do not cache length because more watchers might be pushed
  6789. // as we run existing watchers
  6790. for (index = 0; index < queue.length; index++) {
  6791. watcher = queue[index];
  6792. if (watcher.before) {
  6793. watcher.before();
  6794. }
  6795. id = watcher.id;
  6796. has[id] = null;
  6797. watcher.run();
  6798. // in dev build, check and stop circular updates.
  6799. if ( true && has[id] != null) {
  6800. circular[id] = (circular[id] || 0) + 1;
  6801. if (circular[id] > MAX_UPDATE_COUNT) {
  6802. warn(
  6803. 'You may have an infinite update loop ' + (
  6804. watcher.user
  6805. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6806. : "in a component render function."
  6807. ),
  6808. watcher.vm
  6809. );
  6810. break
  6811. }
  6812. }
  6813. }
  6814. // keep copies of post queues before resetting state
  6815. var activatedQueue = activatedChildren.slice();
  6816. var updatedQueue = queue.slice();
  6817. resetSchedulerState();
  6818. // call component updated and activated hooks
  6819. callActivatedHooks(activatedQueue);
  6820. callUpdatedHooks(updatedQueue);
  6821. // devtool hook
  6822. /* istanbul ignore if */
  6823. if (devtools && config.devtools) {
  6824. devtools.emit('flush');
  6825. }
  6826. }
  6827. function callUpdatedHooks (queue) {
  6828. var i = queue.length;
  6829. while (i--) {
  6830. var watcher = queue[i];
  6831. var vm = watcher.vm;
  6832. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6833. callHook(vm, 'updated');
  6834. }
  6835. }
  6836. }
  6837. /**
  6838. * Queue a kept-alive component that was activated during patch.
  6839. * The queue will be processed after the entire tree has been patched.
  6840. */
  6841. function queueActivatedComponent (vm) {
  6842. // setting _inactive to false here so that a render function can
  6843. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6844. vm._inactive = false;
  6845. activatedChildren.push(vm);
  6846. }
  6847. function callActivatedHooks (queue) {
  6848. for (var i = 0; i < queue.length; i++) {
  6849. queue[i]._inactive = true;
  6850. activateChildComponent(queue[i], true /* true */);
  6851. }
  6852. }
  6853. /**
  6854. * Push a watcher into the watcher queue.
  6855. * Jobs with duplicate IDs will be skipped unless it's
  6856. * pushed when the queue is being flushed.
  6857. */
  6858. function queueWatcher (watcher) {
  6859. var id = watcher.id;
  6860. if (has[id] == null) {
  6861. has[id] = true;
  6862. if (!flushing) {
  6863. queue.push(watcher);
  6864. } else {
  6865. // if already flushing, splice the watcher based on its id
  6866. // if already past its id, it will be run next immediately.
  6867. var i = queue.length - 1;
  6868. while (i > index && queue[i].id > watcher.id) {
  6869. i--;
  6870. }
  6871. queue.splice(i + 1, 0, watcher);
  6872. }
  6873. // queue the flush
  6874. if (!waiting) {
  6875. waiting = true;
  6876. if ( true && !config.async) {
  6877. flushSchedulerQueue();
  6878. return
  6879. }
  6880. nextTick(flushSchedulerQueue);
  6881. }
  6882. }
  6883. }
  6884. /* */
  6885. var uid$2 = 0;
  6886. /**
  6887. * A watcher parses an expression, collects dependencies,
  6888. * and fires callback when the expression value changes.
  6889. * This is used for both the $watch() api and directives.
  6890. */
  6891. var Watcher = function Watcher (
  6892. vm,
  6893. expOrFn,
  6894. cb,
  6895. options,
  6896. isRenderWatcher
  6897. ) {
  6898. this.vm = vm;
  6899. if (isRenderWatcher) {
  6900. vm._watcher = this;
  6901. }
  6902. vm._watchers.push(this);
  6903. // options
  6904. if (options) {
  6905. this.deep = !!options.deep;
  6906. this.user = !!options.user;
  6907. this.lazy = !!options.lazy;
  6908. this.sync = !!options.sync;
  6909. this.before = options.before;
  6910. } else {
  6911. this.deep = this.user = this.lazy = this.sync = false;
  6912. }
  6913. this.cb = cb;
  6914. this.id = ++uid$2; // uid for batching
  6915. this.active = true;
  6916. this.dirty = this.lazy; // for lazy watchers
  6917. this.deps = [];
  6918. this.newDeps = [];
  6919. this.depIds = new _Set();
  6920. this.newDepIds = new _Set();
  6921. this.expression = true
  6922. ? expOrFn.toString()
  6923. : undefined;
  6924. // parse expression for getter
  6925. if (typeof expOrFn === 'function') {
  6926. this.getter = expOrFn;
  6927. } else {
  6928. this.getter = parsePath(expOrFn);
  6929. if (!this.getter) {
  6930. this.getter = noop;
  6931. true && warn(
  6932. "Failed watching path: \"" + expOrFn + "\" " +
  6933. 'Watcher only accepts simple dot-delimited paths. ' +
  6934. 'For full control, use a function instead.',
  6935. vm
  6936. );
  6937. }
  6938. }
  6939. this.value = this.lazy
  6940. ? undefined
  6941. : this.get();
  6942. };
  6943. /**
  6944. * Evaluate the getter, and re-collect dependencies.
  6945. */
  6946. Watcher.prototype.get = function get () {
  6947. pushTarget(this);
  6948. var value;
  6949. var vm = this.vm;
  6950. try {
  6951. value = this.getter.call(vm, vm);
  6952. } catch (e) {
  6953. if (this.user) {
  6954. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6955. } else {
  6956. throw e
  6957. }
  6958. } finally {
  6959. // "touch" every property so they are all tracked as
  6960. // dependencies for deep watching
  6961. if (this.deep) {
  6962. traverse(value);
  6963. }
  6964. popTarget();
  6965. this.cleanupDeps();
  6966. }
  6967. return value
  6968. };
  6969. /**
  6970. * Add a dependency to this directive.
  6971. */
  6972. Watcher.prototype.addDep = function addDep (dep) {
  6973. var id = dep.id;
  6974. if (!this.newDepIds.has(id)) {
  6975. this.newDepIds.add(id);
  6976. this.newDeps.push(dep);
  6977. if (!this.depIds.has(id)) {
  6978. dep.addSub(this);
  6979. }
  6980. }
  6981. };
  6982. /**
  6983. * Clean up for dependency collection.
  6984. */
  6985. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6986. var i = this.deps.length;
  6987. while (i--) {
  6988. var dep = this.deps[i];
  6989. if (!this.newDepIds.has(dep.id)) {
  6990. dep.removeSub(this);
  6991. }
  6992. }
  6993. var tmp = this.depIds;
  6994. this.depIds = this.newDepIds;
  6995. this.newDepIds = tmp;
  6996. this.newDepIds.clear();
  6997. tmp = this.deps;
  6998. this.deps = this.newDeps;
  6999. this.newDeps = tmp;
  7000. this.newDeps.length = 0;
  7001. };
  7002. /**
  7003. * Subscriber interface.
  7004. * Will be called when a dependency changes.
  7005. */
  7006. Watcher.prototype.update = function update () {
  7007. /* istanbul ignore else */
  7008. if (this.lazy) {
  7009. this.dirty = true;
  7010. } else if (this.sync) {
  7011. this.run();
  7012. } else {
  7013. queueWatcher(this);
  7014. }
  7015. };
  7016. /**
  7017. * Scheduler job interface.
  7018. * Will be called by the scheduler.
  7019. */
  7020. Watcher.prototype.run = function run () {
  7021. if (this.active) {
  7022. var value = this.get();
  7023. if (
  7024. value !== this.value ||
  7025. // Deep watchers and watchers on Object/Arrays should fire even
  7026. // when the value is the same, because the value may
  7027. // have mutated.
  7028. isObject(value) ||
  7029. this.deep
  7030. ) {
  7031. // set new value
  7032. var oldValue = this.value;
  7033. this.value = value;
  7034. if (this.user) {
  7035. try {
  7036. this.cb.call(this.vm, value, oldValue);
  7037. } catch (e) {
  7038. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7039. }
  7040. } else {
  7041. this.cb.call(this.vm, value, oldValue);
  7042. }
  7043. }
  7044. }
  7045. };
  7046. /**
  7047. * Evaluate the value of the watcher.
  7048. * This only gets called for lazy watchers.
  7049. */
  7050. Watcher.prototype.evaluate = function evaluate () {
  7051. this.value = this.get();
  7052. this.dirty = false;
  7053. };
  7054. /**
  7055. * Depend on all deps collected by this watcher.
  7056. */
  7057. Watcher.prototype.depend = function depend () {
  7058. var i = this.deps.length;
  7059. while (i--) {
  7060. this.deps[i].depend();
  7061. }
  7062. };
  7063. /**
  7064. * Remove self from all dependencies' subscriber list.
  7065. */
  7066. Watcher.prototype.teardown = function teardown () {
  7067. if (this.active) {
  7068. // remove self from vm's watcher list
  7069. // this is a somewhat expensive operation so we skip it
  7070. // if the vm is being destroyed.
  7071. if (!this.vm._isBeingDestroyed) {
  7072. remove(this.vm._watchers, this);
  7073. }
  7074. var i = this.deps.length;
  7075. while (i--) {
  7076. this.deps[i].removeSub(this);
  7077. }
  7078. this.active = false;
  7079. }
  7080. };
  7081. /* */
  7082. var sharedPropertyDefinition = {
  7083. enumerable: true,
  7084. configurable: true,
  7085. get: noop,
  7086. set: noop
  7087. };
  7088. function proxy (target, sourceKey, key) {
  7089. sharedPropertyDefinition.get = function proxyGetter () {
  7090. return this[sourceKey][key]
  7091. };
  7092. sharedPropertyDefinition.set = function proxySetter (val) {
  7093. this[sourceKey][key] = val;
  7094. };
  7095. Object.defineProperty(target, key, sharedPropertyDefinition);
  7096. }
  7097. function initState (vm) {
  7098. vm._watchers = [];
  7099. var opts = vm.$options;
  7100. if (opts.props) { initProps(vm, opts.props); }
  7101. if (opts.methods) { initMethods(vm, opts.methods); }
  7102. if (opts.data) {
  7103. initData(vm);
  7104. } else {
  7105. observe(vm._data = {}, true /* asRootData */);
  7106. }
  7107. if (opts.computed) { initComputed(vm, opts.computed); }
  7108. if (opts.watch && opts.watch !== nativeWatch) {
  7109. initWatch(vm, opts.watch);
  7110. }
  7111. }
  7112. function initProps (vm, propsOptions) {
  7113. var propsData = vm.$options.propsData || {};
  7114. var props = vm._props = {};
  7115. // cache prop keys so that future props updates can iterate using Array
  7116. // instead of dynamic object key enumeration.
  7117. var keys = vm.$options._propKeys = [];
  7118. var isRoot = !vm.$parent;
  7119. // root instance props should be converted
  7120. if (!isRoot) {
  7121. toggleObserving(false);
  7122. }
  7123. var loop = function ( key ) {
  7124. keys.push(key);
  7125. var value = validateProp(key, propsOptions, propsData, vm);
  7126. /* istanbul ignore else */
  7127. if (true) {
  7128. var hyphenatedKey = hyphenate(key);
  7129. if (isReservedAttribute(hyphenatedKey) ||
  7130. config.isReservedAttr(hyphenatedKey)) {
  7131. warn(
  7132. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7133. vm
  7134. );
  7135. }
  7136. defineReactive$$1(props, key, value, function () {
  7137. if (!isRoot && !isUpdatingChildComponent) {
  7138. {
  7139. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7140. return
  7141. }
  7142. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7143. if(
  7144. key === 'value' &&
  7145. Array.isArray(vm.$options.behaviors) &&
  7146. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7147. ){
  7148. return
  7149. }
  7150. if(vm._getFormData){
  7151. return
  7152. }
  7153. var $parent = vm.$parent;
  7154. while($parent){
  7155. if($parent.__next_tick_pending){
  7156. return
  7157. }
  7158. $parent = $parent.$parent;
  7159. }
  7160. }
  7161. warn(
  7162. "Avoid mutating a prop directly since the value will be " +
  7163. "overwritten whenever the parent component re-renders. " +
  7164. "Instead, use a data or computed property based on the prop's " +
  7165. "value. Prop being mutated: \"" + key + "\"",
  7166. vm
  7167. );
  7168. }
  7169. });
  7170. } else {}
  7171. // static props are already proxied on the component's prototype
  7172. // during Vue.extend(). We only need to proxy props defined at
  7173. // instantiation here.
  7174. if (!(key in vm)) {
  7175. proxy(vm, "_props", key);
  7176. }
  7177. };
  7178. for (var key in propsOptions) loop( key );
  7179. toggleObserving(true);
  7180. }
  7181. function initData (vm) {
  7182. var data = vm.$options.data;
  7183. data = vm._data = typeof data === 'function'
  7184. ? getData(data, vm)
  7185. : data || {};
  7186. if (!isPlainObject(data)) {
  7187. data = {};
  7188. true && warn(
  7189. 'data functions should return an object:\n' +
  7190. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7191. vm
  7192. );
  7193. }
  7194. // proxy data on instance
  7195. var keys = Object.keys(data);
  7196. var props = vm.$options.props;
  7197. var methods = vm.$options.methods;
  7198. var i = keys.length;
  7199. while (i--) {
  7200. var key = keys[i];
  7201. if (true) {
  7202. if (methods && hasOwn(methods, key)) {
  7203. warn(
  7204. ("Method \"" + key + "\" has already been defined as a data property."),
  7205. vm
  7206. );
  7207. }
  7208. }
  7209. if (props && hasOwn(props, key)) {
  7210. true && warn(
  7211. "The data property \"" + key + "\" is already declared as a prop. " +
  7212. "Use prop default value instead.",
  7213. vm
  7214. );
  7215. } else if (!isReserved(key)) {
  7216. proxy(vm, "_data", key);
  7217. }
  7218. }
  7219. // observe data
  7220. observe(data, true /* asRootData */);
  7221. }
  7222. function getData (data, vm) {
  7223. // #7573 disable dep collection when invoking data getters
  7224. pushTarget();
  7225. try {
  7226. return data.call(vm, vm)
  7227. } catch (e) {
  7228. handleError(e, vm, "data()");
  7229. return {}
  7230. } finally {
  7231. popTarget();
  7232. }
  7233. }
  7234. var computedWatcherOptions = { lazy: true };
  7235. function initComputed (vm, computed) {
  7236. // $flow-disable-line
  7237. var watchers = vm._computedWatchers = Object.create(null);
  7238. // computed properties are just getters during SSR
  7239. var isSSR = isServerRendering();
  7240. for (var key in computed) {
  7241. var userDef = computed[key];
  7242. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7243. if ( true && getter == null) {
  7244. warn(
  7245. ("Getter is missing for computed property \"" + key + "\"."),
  7246. vm
  7247. );
  7248. }
  7249. if (!isSSR) {
  7250. // create internal watcher for the computed property.
  7251. watchers[key] = new Watcher(
  7252. vm,
  7253. getter || noop,
  7254. noop,
  7255. computedWatcherOptions
  7256. );
  7257. }
  7258. // component-defined computed properties are already defined on the
  7259. // component prototype. We only need to define computed properties defined
  7260. // at instantiation here.
  7261. if (!(key in vm)) {
  7262. defineComputed(vm, key, userDef);
  7263. } else if (true) {
  7264. if (key in vm.$data) {
  7265. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7266. } else if (vm.$options.props && key in vm.$options.props) {
  7267. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7268. }
  7269. }
  7270. }
  7271. }
  7272. function defineComputed (
  7273. target,
  7274. key,
  7275. userDef
  7276. ) {
  7277. var shouldCache = !isServerRendering();
  7278. if (typeof userDef === 'function') {
  7279. sharedPropertyDefinition.get = shouldCache
  7280. ? createComputedGetter(key)
  7281. : createGetterInvoker(userDef);
  7282. sharedPropertyDefinition.set = noop;
  7283. } else {
  7284. sharedPropertyDefinition.get = userDef.get
  7285. ? shouldCache && userDef.cache !== false
  7286. ? createComputedGetter(key)
  7287. : createGetterInvoker(userDef.get)
  7288. : noop;
  7289. sharedPropertyDefinition.set = userDef.set || noop;
  7290. }
  7291. if ( true &&
  7292. sharedPropertyDefinition.set === noop) {
  7293. sharedPropertyDefinition.set = function () {
  7294. warn(
  7295. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7296. this
  7297. );
  7298. };
  7299. }
  7300. Object.defineProperty(target, key, sharedPropertyDefinition);
  7301. }
  7302. function createComputedGetter (key) {
  7303. return function computedGetter () {
  7304. var watcher = this._computedWatchers && this._computedWatchers[key];
  7305. if (watcher) {
  7306. if (watcher.dirty) {
  7307. watcher.evaluate();
  7308. }
  7309. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7310. watcher.depend();
  7311. }
  7312. return watcher.value
  7313. }
  7314. }
  7315. }
  7316. function createGetterInvoker(fn) {
  7317. return function computedGetter () {
  7318. return fn.call(this, this)
  7319. }
  7320. }
  7321. function initMethods (vm, methods) {
  7322. var props = vm.$options.props;
  7323. for (var key in methods) {
  7324. if (true) {
  7325. if (typeof methods[key] !== 'function') {
  7326. warn(
  7327. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7328. "Did you reference the function correctly?",
  7329. vm
  7330. );
  7331. }
  7332. if (props && hasOwn(props, key)) {
  7333. warn(
  7334. ("Method \"" + key + "\" has already been defined as a prop."),
  7335. vm
  7336. );
  7337. }
  7338. if ((key in vm) && isReserved(key)) {
  7339. warn(
  7340. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7341. "Avoid defining component methods that start with _ or $."
  7342. );
  7343. }
  7344. }
  7345. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7346. }
  7347. }
  7348. function initWatch (vm, watch) {
  7349. for (var key in watch) {
  7350. var handler = watch[key];
  7351. if (Array.isArray(handler)) {
  7352. for (var i = 0; i < handler.length; i++) {
  7353. createWatcher(vm, key, handler[i]);
  7354. }
  7355. } else {
  7356. createWatcher(vm, key, handler);
  7357. }
  7358. }
  7359. }
  7360. function createWatcher (
  7361. vm,
  7362. expOrFn,
  7363. handler,
  7364. options
  7365. ) {
  7366. if (isPlainObject(handler)) {
  7367. options = handler;
  7368. handler = handler.handler;
  7369. }
  7370. if (typeof handler === 'string') {
  7371. handler = vm[handler];
  7372. }
  7373. return vm.$watch(expOrFn, handler, options)
  7374. }
  7375. function stateMixin (Vue) {
  7376. // flow somehow has problems with directly declared definition object
  7377. // when using Object.defineProperty, so we have to procedurally build up
  7378. // the object here.
  7379. var dataDef = {};
  7380. dataDef.get = function () { return this._data };
  7381. var propsDef = {};
  7382. propsDef.get = function () { return this._props };
  7383. if (true) {
  7384. dataDef.set = function () {
  7385. warn(
  7386. 'Avoid replacing instance root $data. ' +
  7387. 'Use nested data properties instead.',
  7388. this
  7389. );
  7390. };
  7391. propsDef.set = function () {
  7392. warn("$props is readonly.", this);
  7393. };
  7394. }
  7395. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7396. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7397. Vue.prototype.$set = set;
  7398. Vue.prototype.$delete = del;
  7399. Vue.prototype.$watch = function (
  7400. expOrFn,
  7401. cb,
  7402. options
  7403. ) {
  7404. var vm = this;
  7405. if (isPlainObject(cb)) {
  7406. return createWatcher(vm, expOrFn, cb, options)
  7407. }
  7408. options = options || {};
  7409. options.user = true;
  7410. var watcher = new Watcher(vm, expOrFn, cb, options);
  7411. if (options.immediate) {
  7412. try {
  7413. cb.call(vm, watcher.value);
  7414. } catch (error) {
  7415. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7416. }
  7417. }
  7418. return function unwatchFn () {
  7419. watcher.teardown();
  7420. }
  7421. };
  7422. }
  7423. /* */
  7424. var uid$3 = 0;
  7425. function initMixin (Vue) {
  7426. Vue.prototype._init = function (options) {
  7427. var vm = this;
  7428. // a uid
  7429. vm._uid = uid$3++;
  7430. var startTag, endTag;
  7431. /* istanbul ignore if */
  7432. if ( true && config.performance && mark) {
  7433. startTag = "vue-perf-start:" + (vm._uid);
  7434. endTag = "vue-perf-end:" + (vm._uid);
  7435. mark(startTag);
  7436. }
  7437. // a flag to avoid this being observed
  7438. vm._isVue = true;
  7439. // merge options
  7440. if (options && options._isComponent) {
  7441. // optimize internal component instantiation
  7442. // since dynamic options merging is pretty slow, and none of the
  7443. // internal component options needs special treatment.
  7444. initInternalComponent(vm, options);
  7445. } else {
  7446. vm.$options = mergeOptions(
  7447. resolveConstructorOptions(vm.constructor),
  7448. options || {},
  7449. vm
  7450. );
  7451. }
  7452. /* istanbul ignore else */
  7453. if (true) {
  7454. initProxy(vm);
  7455. } else {}
  7456. // expose real self
  7457. vm._self = vm;
  7458. initLifecycle(vm);
  7459. initEvents(vm);
  7460. initRender(vm);
  7461. callHook(vm, 'beforeCreate');
  7462. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7463. initState(vm);
  7464. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7465. !vm._$fallback && callHook(vm, 'created');
  7466. /* istanbul ignore if */
  7467. if ( true && config.performance && mark) {
  7468. vm._name = formatComponentName(vm, false);
  7469. mark(endTag);
  7470. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7471. }
  7472. if (vm.$options.el) {
  7473. vm.$mount(vm.$options.el);
  7474. }
  7475. };
  7476. }
  7477. function initInternalComponent (vm, options) {
  7478. var opts = vm.$options = Object.create(vm.constructor.options);
  7479. // doing this because it's faster than dynamic enumeration.
  7480. var parentVnode = options._parentVnode;
  7481. opts.parent = options.parent;
  7482. opts._parentVnode = parentVnode;
  7483. var vnodeComponentOptions = parentVnode.componentOptions;
  7484. opts.propsData = vnodeComponentOptions.propsData;
  7485. opts._parentListeners = vnodeComponentOptions.listeners;
  7486. opts._renderChildren = vnodeComponentOptions.children;
  7487. opts._componentTag = vnodeComponentOptions.tag;
  7488. if (options.render) {
  7489. opts.render = options.render;
  7490. opts.staticRenderFns = options.staticRenderFns;
  7491. }
  7492. }
  7493. function resolveConstructorOptions (Ctor) {
  7494. var options = Ctor.options;
  7495. if (Ctor.super) {
  7496. var superOptions = resolveConstructorOptions(Ctor.super);
  7497. var cachedSuperOptions = Ctor.superOptions;
  7498. if (superOptions !== cachedSuperOptions) {
  7499. // super option changed,
  7500. // need to resolve new options.
  7501. Ctor.superOptions = superOptions;
  7502. // check if there are any late-modified/attached options (#4976)
  7503. var modifiedOptions = resolveModifiedOptions(Ctor);
  7504. // update base extend options
  7505. if (modifiedOptions) {
  7506. extend(Ctor.extendOptions, modifiedOptions);
  7507. }
  7508. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7509. if (options.name) {
  7510. options.components[options.name] = Ctor;
  7511. }
  7512. }
  7513. }
  7514. return options
  7515. }
  7516. function resolveModifiedOptions (Ctor) {
  7517. var modified;
  7518. var latest = Ctor.options;
  7519. var sealed = Ctor.sealedOptions;
  7520. for (var key in latest) {
  7521. if (latest[key] !== sealed[key]) {
  7522. if (!modified) { modified = {}; }
  7523. modified[key] = latest[key];
  7524. }
  7525. }
  7526. return modified
  7527. }
  7528. function Vue (options) {
  7529. if ( true &&
  7530. !(this instanceof Vue)
  7531. ) {
  7532. warn('Vue is a constructor and should be called with the `new` keyword');
  7533. }
  7534. this._init(options);
  7535. }
  7536. initMixin(Vue);
  7537. stateMixin(Vue);
  7538. eventsMixin(Vue);
  7539. lifecycleMixin(Vue);
  7540. renderMixin(Vue);
  7541. /* */
  7542. function initUse (Vue) {
  7543. Vue.use = function (plugin) {
  7544. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7545. if (installedPlugins.indexOf(plugin) > -1) {
  7546. return this
  7547. }
  7548. // additional parameters
  7549. var args = toArray(arguments, 1);
  7550. args.unshift(this);
  7551. if (typeof plugin.install === 'function') {
  7552. plugin.install.apply(plugin, args);
  7553. } else if (typeof plugin === 'function') {
  7554. plugin.apply(null, args);
  7555. }
  7556. installedPlugins.push(plugin);
  7557. return this
  7558. };
  7559. }
  7560. /* */
  7561. function initMixin$1 (Vue) {
  7562. Vue.mixin = function (mixin) {
  7563. this.options = mergeOptions(this.options, mixin);
  7564. return this
  7565. };
  7566. }
  7567. /* */
  7568. function initExtend (Vue) {
  7569. /**
  7570. * Each instance constructor, including Vue, has a unique
  7571. * cid. This enables us to create wrapped "child
  7572. * constructors" for prototypal inheritance and cache them.
  7573. */
  7574. Vue.cid = 0;
  7575. var cid = 1;
  7576. /**
  7577. * Class inheritance
  7578. */
  7579. Vue.extend = function (extendOptions) {
  7580. extendOptions = extendOptions || {};
  7581. var Super = this;
  7582. var SuperId = Super.cid;
  7583. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7584. if (cachedCtors[SuperId]) {
  7585. return cachedCtors[SuperId]
  7586. }
  7587. var name = extendOptions.name || Super.options.name;
  7588. if ( true && name) {
  7589. validateComponentName(name);
  7590. }
  7591. var Sub = function VueComponent (options) {
  7592. this._init(options);
  7593. };
  7594. Sub.prototype = Object.create(Super.prototype);
  7595. Sub.prototype.constructor = Sub;
  7596. Sub.cid = cid++;
  7597. Sub.options = mergeOptions(
  7598. Super.options,
  7599. extendOptions
  7600. );
  7601. Sub['super'] = Super;
  7602. // For props and computed properties, we define the proxy getters on
  7603. // the Vue instances at extension time, on the extended prototype. This
  7604. // avoids Object.defineProperty calls for each instance created.
  7605. if (Sub.options.props) {
  7606. initProps$1(Sub);
  7607. }
  7608. if (Sub.options.computed) {
  7609. initComputed$1(Sub);
  7610. }
  7611. // allow further extension/mixin/plugin usage
  7612. Sub.extend = Super.extend;
  7613. Sub.mixin = Super.mixin;
  7614. Sub.use = Super.use;
  7615. // create asset registers, so extended classes
  7616. // can have their private assets too.
  7617. ASSET_TYPES.forEach(function (type) {
  7618. Sub[type] = Super[type];
  7619. });
  7620. // enable recursive self-lookup
  7621. if (name) {
  7622. Sub.options.components[name] = Sub;
  7623. }
  7624. // keep a reference to the super options at extension time.
  7625. // later at instantiation we can check if Super's options have
  7626. // been updated.
  7627. Sub.superOptions = Super.options;
  7628. Sub.extendOptions = extendOptions;
  7629. Sub.sealedOptions = extend({}, Sub.options);
  7630. // cache constructor
  7631. cachedCtors[SuperId] = Sub;
  7632. return Sub
  7633. };
  7634. }
  7635. function initProps$1 (Comp) {
  7636. var props = Comp.options.props;
  7637. for (var key in props) {
  7638. proxy(Comp.prototype, "_props", key);
  7639. }
  7640. }
  7641. function initComputed$1 (Comp) {
  7642. var computed = Comp.options.computed;
  7643. for (var key in computed) {
  7644. defineComputed(Comp.prototype, key, computed[key]);
  7645. }
  7646. }
  7647. /* */
  7648. function initAssetRegisters (Vue) {
  7649. /**
  7650. * Create asset registration methods.
  7651. */
  7652. ASSET_TYPES.forEach(function (type) {
  7653. Vue[type] = function (
  7654. id,
  7655. definition
  7656. ) {
  7657. if (!definition) {
  7658. return this.options[type + 's'][id]
  7659. } else {
  7660. /* istanbul ignore if */
  7661. if ( true && type === 'component') {
  7662. validateComponentName(id);
  7663. }
  7664. if (type === 'component' && isPlainObject(definition)) {
  7665. definition.name = definition.name || id;
  7666. definition = this.options._base.extend(definition);
  7667. }
  7668. if (type === 'directive' && typeof definition === 'function') {
  7669. definition = { bind: definition, update: definition };
  7670. }
  7671. this.options[type + 's'][id] = definition;
  7672. return definition
  7673. }
  7674. };
  7675. });
  7676. }
  7677. /* */
  7678. function getComponentName (opts) {
  7679. return opts && (opts.Ctor.options.name || opts.tag)
  7680. }
  7681. function matches (pattern, name) {
  7682. if (Array.isArray(pattern)) {
  7683. return pattern.indexOf(name) > -1
  7684. } else if (typeof pattern === 'string') {
  7685. return pattern.split(',').indexOf(name) > -1
  7686. } else if (isRegExp(pattern)) {
  7687. return pattern.test(name)
  7688. }
  7689. /* istanbul ignore next */
  7690. return false
  7691. }
  7692. function pruneCache (keepAliveInstance, filter) {
  7693. var cache = keepAliveInstance.cache;
  7694. var keys = keepAliveInstance.keys;
  7695. var _vnode = keepAliveInstance._vnode;
  7696. for (var key in cache) {
  7697. var cachedNode = cache[key];
  7698. if (cachedNode) {
  7699. var name = getComponentName(cachedNode.componentOptions);
  7700. if (name && !filter(name)) {
  7701. pruneCacheEntry(cache, key, keys, _vnode);
  7702. }
  7703. }
  7704. }
  7705. }
  7706. function pruneCacheEntry (
  7707. cache,
  7708. key,
  7709. keys,
  7710. current
  7711. ) {
  7712. var cached$$1 = cache[key];
  7713. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7714. cached$$1.componentInstance.$destroy();
  7715. }
  7716. cache[key] = null;
  7717. remove(keys, key);
  7718. }
  7719. var patternTypes = [String, RegExp, Array];
  7720. var KeepAlive = {
  7721. name: 'keep-alive',
  7722. abstract: true,
  7723. props: {
  7724. include: patternTypes,
  7725. exclude: patternTypes,
  7726. max: [String, Number]
  7727. },
  7728. created: function created () {
  7729. this.cache = Object.create(null);
  7730. this.keys = [];
  7731. },
  7732. destroyed: function destroyed () {
  7733. for (var key in this.cache) {
  7734. pruneCacheEntry(this.cache, key, this.keys);
  7735. }
  7736. },
  7737. mounted: function mounted () {
  7738. var this$1 = this;
  7739. this.$watch('include', function (val) {
  7740. pruneCache(this$1, function (name) { return matches(val, name); });
  7741. });
  7742. this.$watch('exclude', function (val) {
  7743. pruneCache(this$1, function (name) { return !matches(val, name); });
  7744. });
  7745. },
  7746. render: function render () {
  7747. var slot = this.$slots.default;
  7748. var vnode = getFirstComponentChild(slot);
  7749. var componentOptions = vnode && vnode.componentOptions;
  7750. if (componentOptions) {
  7751. // check pattern
  7752. var name = getComponentName(componentOptions);
  7753. var ref = this;
  7754. var include = ref.include;
  7755. var exclude = ref.exclude;
  7756. if (
  7757. // not included
  7758. (include && (!name || !matches(include, name))) ||
  7759. // excluded
  7760. (exclude && name && matches(exclude, name))
  7761. ) {
  7762. return vnode
  7763. }
  7764. var ref$1 = this;
  7765. var cache = ref$1.cache;
  7766. var keys = ref$1.keys;
  7767. var key = vnode.key == null
  7768. // same constructor may get registered as different local components
  7769. // so cid alone is not enough (#3269)
  7770. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7771. : vnode.key;
  7772. if (cache[key]) {
  7773. vnode.componentInstance = cache[key].componentInstance;
  7774. // make current key freshest
  7775. remove(keys, key);
  7776. keys.push(key);
  7777. } else {
  7778. cache[key] = vnode;
  7779. keys.push(key);
  7780. // prune oldest entry
  7781. if (this.max && keys.length > parseInt(this.max)) {
  7782. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7783. }
  7784. }
  7785. vnode.data.keepAlive = true;
  7786. }
  7787. return vnode || (slot && slot[0])
  7788. }
  7789. };
  7790. var builtInComponents = {
  7791. KeepAlive: KeepAlive
  7792. };
  7793. /* */
  7794. function initGlobalAPI (Vue) {
  7795. // config
  7796. var configDef = {};
  7797. configDef.get = function () { return config; };
  7798. if (true) {
  7799. configDef.set = function () {
  7800. warn(
  7801. 'Do not replace the Vue.config object, set individual fields instead.'
  7802. );
  7803. };
  7804. }
  7805. Object.defineProperty(Vue, 'config', configDef);
  7806. // exposed util methods.
  7807. // NOTE: these are not considered part of the public API - avoid relying on
  7808. // them unless you are aware of the risk.
  7809. Vue.util = {
  7810. warn: warn,
  7811. extend: extend,
  7812. mergeOptions: mergeOptions,
  7813. defineReactive: defineReactive$$1
  7814. };
  7815. Vue.set = set;
  7816. Vue.delete = del;
  7817. Vue.nextTick = nextTick;
  7818. // 2.6 explicit observable API
  7819. Vue.observable = function (obj) {
  7820. observe(obj);
  7821. return obj
  7822. };
  7823. Vue.options = Object.create(null);
  7824. ASSET_TYPES.forEach(function (type) {
  7825. Vue.options[type + 's'] = Object.create(null);
  7826. });
  7827. // this is used to identify the "base" constructor to extend all plain-object
  7828. // components with in Weex's multi-instance scenarios.
  7829. Vue.options._base = Vue;
  7830. extend(Vue.options.components, builtInComponents);
  7831. initUse(Vue);
  7832. initMixin$1(Vue);
  7833. initExtend(Vue);
  7834. initAssetRegisters(Vue);
  7835. }
  7836. initGlobalAPI(Vue);
  7837. Object.defineProperty(Vue.prototype, '$isServer', {
  7838. get: isServerRendering
  7839. });
  7840. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7841. get: function get () {
  7842. /* istanbul ignore next */
  7843. return this.$vnode && this.$vnode.ssrContext
  7844. }
  7845. });
  7846. // expose FunctionalRenderContext for ssr runtime helper installation
  7847. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7848. value: FunctionalRenderContext
  7849. });
  7850. Vue.version = '2.6.11';
  7851. /**
  7852. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7853. */
  7854. var ARRAYTYPE = '[object Array]';
  7855. var OBJECTTYPE = '[object Object]';
  7856. // const FUNCTIONTYPE = '[object Function]'
  7857. function diff(current, pre) {
  7858. var result = {};
  7859. syncKeys(current, pre);
  7860. _diff(current, pre, '', result);
  7861. return result
  7862. }
  7863. function syncKeys(current, pre) {
  7864. if (current === pre) { return }
  7865. var rootCurrentType = type(current);
  7866. var rootPreType = type(pre);
  7867. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7868. if(Object.keys(current).length >= Object.keys(pre).length){
  7869. for (var key in pre) {
  7870. var currentValue = current[key];
  7871. if (currentValue === undefined) {
  7872. current[key] = null;
  7873. } else {
  7874. syncKeys(currentValue, pre[key]);
  7875. }
  7876. }
  7877. }
  7878. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7879. if (current.length >= pre.length) {
  7880. pre.forEach(function (item, index) {
  7881. syncKeys(current[index], item);
  7882. });
  7883. }
  7884. }
  7885. }
  7886. function _diff(current, pre, path, result) {
  7887. if (current === pre) { return }
  7888. var rootCurrentType = type(current);
  7889. var rootPreType = type(pre);
  7890. if (rootCurrentType == OBJECTTYPE) {
  7891. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7892. setResult(result, path, current);
  7893. } else {
  7894. var loop = function ( key ) {
  7895. var currentValue = current[key];
  7896. var preValue = pre[key];
  7897. var currentType = type(currentValue);
  7898. var preType = type(preValue);
  7899. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7900. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  7901. if (currentValue !== pre[key]) {
  7902. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7903. }
  7904. } else if (currentType == ARRAYTYPE) {
  7905. if (preType != ARRAYTYPE) {
  7906. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7907. } else {
  7908. if (currentValue.length < preValue.length) {
  7909. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7910. } else {
  7911. currentValue.forEach(function (item, index) {
  7912. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7913. });
  7914. }
  7915. }
  7916. } else if (currentType == OBJECTTYPE) {
  7917. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7918. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7919. } else {
  7920. for (var subKey in currentValue) {
  7921. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7922. }
  7923. }
  7924. }
  7925. };
  7926. for (var key in current) loop( key );
  7927. }
  7928. } else if (rootCurrentType == ARRAYTYPE) {
  7929. if (rootPreType != ARRAYTYPE) {
  7930. setResult(result, path, current);
  7931. } else {
  7932. if (current.length < pre.length) {
  7933. setResult(result, path, current);
  7934. } else {
  7935. current.forEach(function (item, index) {
  7936. _diff(item, pre[index], path + '[' + index + ']', result);
  7937. });
  7938. }
  7939. }
  7940. } else {
  7941. setResult(result, path, current);
  7942. }
  7943. }
  7944. function setResult(result, k, v) {
  7945. // if (type(v) != FUNCTIONTYPE) {
  7946. result[k] = v;
  7947. // }
  7948. }
  7949. function type(obj) {
  7950. return Object.prototype.toString.call(obj)
  7951. }
  7952. /* */
  7953. function flushCallbacks$1(vm) {
  7954. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7955. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7956. var mpInstance = vm.$scope;
  7957. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7958. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7959. }
  7960. var copies = vm.__next_tick_callbacks.slice(0);
  7961. vm.__next_tick_callbacks.length = 0;
  7962. for (var i = 0; i < copies.length; i++) {
  7963. copies[i]();
  7964. }
  7965. }
  7966. }
  7967. function hasRenderWatcher(vm) {
  7968. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7969. }
  7970. function nextTick$1(vm, cb) {
  7971. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7972. //2.nextTick 之前存在 render watcher
  7973. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7974. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7975. var mpInstance = vm.$scope;
  7976. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7977. ']:nextVueTick');
  7978. }
  7979. return nextTick(cb, vm)
  7980. }else{
  7981. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7982. var mpInstance$1 = vm.$scope;
  7983. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7984. ']:nextMPTick');
  7985. }
  7986. }
  7987. var _resolve;
  7988. if (!vm.__next_tick_callbacks) {
  7989. vm.__next_tick_callbacks = [];
  7990. }
  7991. vm.__next_tick_callbacks.push(function () {
  7992. if (cb) {
  7993. try {
  7994. cb.call(vm);
  7995. } catch (e) {
  7996. handleError(e, vm, 'nextTick');
  7997. }
  7998. } else if (_resolve) {
  7999. _resolve(vm);
  8000. }
  8001. });
  8002. // $flow-disable-line
  8003. if (!cb && typeof Promise !== 'undefined') {
  8004. return new Promise(function (resolve) {
  8005. _resolve = resolve;
  8006. })
  8007. }
  8008. }
  8009. /* */
  8010. function cloneWithData(vm) {
  8011. // 确保当前 vm 所有数据被同步
  8012. var ret = Object.create(null);
  8013. var dataKeys = [].concat(
  8014. Object.keys(vm._data || {}),
  8015. Object.keys(vm._computedWatchers || {}));
  8016. dataKeys.reduce(function(ret, key) {
  8017. ret[key] = vm[key];
  8018. return ret
  8019. }, ret);
  8020. // vue-composition-api
  8021. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8022. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8023. if (rawBindings) {
  8024. Object.keys(rawBindings).forEach(function (key) {
  8025. ret[key] = vm[key];
  8026. });
  8027. }
  8028. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8029. Object.assign(ret, vm.$mp.data || {});
  8030. if (
  8031. Array.isArray(vm.$options.behaviors) &&
  8032. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8033. ) { //form-field
  8034. ret['name'] = vm.name;
  8035. ret['value'] = vm.value;
  8036. }
  8037. return JSON.parse(JSON.stringify(ret))
  8038. }
  8039. var patch = function(oldVnode, vnode) {
  8040. var this$1 = this;
  8041. if (vnode === null) { //destroy
  8042. return
  8043. }
  8044. if (this.mpType === 'page' || this.mpType === 'component') {
  8045. var mpInstance = this.$scope;
  8046. var data = Object.create(null);
  8047. try {
  8048. data = cloneWithData(this);
  8049. } catch (err) {
  8050. console.error(err);
  8051. }
  8052. data.__webviewId__ = mpInstance.data.__webviewId__;
  8053. var mpData = Object.create(null);
  8054. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8055. mpData[key] = mpInstance.data[key];
  8056. });
  8057. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8058. if (Object.keys(diffData).length) {
  8059. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8060. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8061. ']差量更新',
  8062. JSON.stringify(diffData));
  8063. }
  8064. this.__next_tick_pending = true;
  8065. mpInstance.setData(diffData, function () {
  8066. this$1.__next_tick_pending = false;
  8067. flushCallbacks$1(this$1);
  8068. });
  8069. } else {
  8070. flushCallbacks$1(this);
  8071. }
  8072. }
  8073. };
  8074. /* */
  8075. function createEmptyRender() {
  8076. }
  8077. function mountComponent$1(
  8078. vm,
  8079. el,
  8080. hydrating
  8081. ) {
  8082. if (!vm.mpType) {//main.js 中的 new Vue
  8083. return vm
  8084. }
  8085. if (vm.mpType === 'app') {
  8086. vm.$options.render = createEmptyRender;
  8087. }
  8088. if (!vm.$options.render) {
  8089. vm.$options.render = createEmptyRender;
  8090. if (true) {
  8091. /* istanbul ignore if */
  8092. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8093. vm.$options.el || el) {
  8094. warn(
  8095. 'You are using the runtime-only build of Vue where the template ' +
  8096. 'compiler is not available. Either pre-compile the templates into ' +
  8097. 'render functions, or use the compiler-included build.',
  8098. vm
  8099. );
  8100. } else {
  8101. warn(
  8102. 'Failed to mount component: template or render function not defined.',
  8103. vm
  8104. );
  8105. }
  8106. }
  8107. }
  8108. !vm._$fallback && callHook(vm, 'beforeMount');
  8109. var updateComponent = function () {
  8110. vm._update(vm._render(), hydrating);
  8111. };
  8112. // we set this to vm._watcher inside the watcher's constructor
  8113. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8114. // component's mounted hook), which relies on vm._watcher being already defined
  8115. new Watcher(vm, updateComponent, noop, {
  8116. before: function before() {
  8117. if (vm._isMounted && !vm._isDestroyed) {
  8118. callHook(vm, 'beforeUpdate');
  8119. }
  8120. }
  8121. }, true /* isRenderWatcher */);
  8122. hydrating = false;
  8123. return vm
  8124. }
  8125. /* */
  8126. function renderClass (
  8127. staticClass,
  8128. dynamicClass
  8129. ) {
  8130. if (isDef(staticClass) || isDef(dynamicClass)) {
  8131. return concat(staticClass, stringifyClass(dynamicClass))
  8132. }
  8133. /* istanbul ignore next */
  8134. return ''
  8135. }
  8136. function concat (a, b) {
  8137. return a ? b ? (a + ' ' + b) : a : (b || '')
  8138. }
  8139. function stringifyClass (value) {
  8140. if (Array.isArray(value)) {
  8141. return stringifyArray(value)
  8142. }
  8143. if (isObject(value)) {
  8144. return stringifyObject(value)
  8145. }
  8146. if (typeof value === 'string') {
  8147. return value
  8148. }
  8149. /* istanbul ignore next */
  8150. return ''
  8151. }
  8152. function stringifyArray (value) {
  8153. var res = '';
  8154. var stringified;
  8155. for (var i = 0, l = value.length; i < l; i++) {
  8156. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8157. if (res) { res += ' '; }
  8158. res += stringified;
  8159. }
  8160. }
  8161. return res
  8162. }
  8163. function stringifyObject (value) {
  8164. var res = '';
  8165. for (var key in value) {
  8166. if (value[key]) {
  8167. if (res) { res += ' '; }
  8168. res += key;
  8169. }
  8170. }
  8171. return res
  8172. }
  8173. /* */
  8174. var parseStyleText = cached(function (cssText) {
  8175. var res = {};
  8176. var listDelimiter = /;(?![^(]*\))/g;
  8177. var propertyDelimiter = /:(.+)/;
  8178. cssText.split(listDelimiter).forEach(function (item) {
  8179. if (item) {
  8180. var tmp = item.split(propertyDelimiter);
  8181. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8182. }
  8183. });
  8184. return res
  8185. });
  8186. // normalize possible array / string values into Object
  8187. function normalizeStyleBinding (bindingStyle) {
  8188. if (Array.isArray(bindingStyle)) {
  8189. return toObject(bindingStyle)
  8190. }
  8191. if (typeof bindingStyle === 'string') {
  8192. return parseStyleText(bindingStyle)
  8193. }
  8194. return bindingStyle
  8195. }
  8196. /* */
  8197. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8198. function getTarget(obj, path) {
  8199. var parts = path.split('.');
  8200. var key = parts[0];
  8201. if (key.indexOf('__$n') === 0) { //number index
  8202. key = parseInt(key.replace('__$n', ''));
  8203. }
  8204. if (parts.length === 1) {
  8205. return obj[key]
  8206. }
  8207. return getTarget(obj[key], parts.slice(1).join('.'))
  8208. }
  8209. function internalMixin(Vue) {
  8210. Vue.config.errorHandler = function(err, vm, info) {
  8211. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8212. console.error(err);
  8213. /* eslint-disable no-undef */
  8214. var app = typeof getApp === 'function' && getApp();
  8215. if (app && app.onError) {
  8216. app.onError(err);
  8217. }
  8218. };
  8219. var oldEmit = Vue.prototype.$emit;
  8220. Vue.prototype.$emit = function(event) {
  8221. if (this.$scope && event) {
  8222. this.$scope['triggerEvent'](event, {
  8223. __args__: toArray(arguments, 1)
  8224. });
  8225. }
  8226. return oldEmit.apply(this, arguments)
  8227. };
  8228. Vue.prototype.$nextTick = function(fn) {
  8229. return nextTick$1(this, fn)
  8230. };
  8231. MP_METHODS.forEach(function (method) {
  8232. Vue.prototype[method] = function(args) {
  8233. if (this.$scope && this.$scope[method]) {
  8234. return this.$scope[method](args)
  8235. }
  8236. // mp-alipay
  8237. if (typeof my === 'undefined') {
  8238. return
  8239. }
  8240. if (method === 'createSelectorQuery') {
  8241. /* eslint-disable no-undef */
  8242. return my.createSelectorQuery(args)
  8243. } else if (method === 'createIntersectionObserver') {
  8244. /* eslint-disable no-undef */
  8245. return my.createIntersectionObserver(args)
  8246. }
  8247. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8248. };
  8249. });
  8250. Vue.prototype.__init_provide = initProvide;
  8251. Vue.prototype.__init_injections = initInjections;
  8252. Vue.prototype.__call_hook = function(hook, args) {
  8253. var vm = this;
  8254. // #7573 disable dep collection when invoking lifecycle hooks
  8255. pushTarget();
  8256. var handlers = vm.$options[hook];
  8257. var info = hook + " hook";
  8258. var ret;
  8259. if (handlers) {
  8260. for (var i = 0, j = handlers.length; i < j; i++) {
  8261. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8262. }
  8263. }
  8264. if (vm._hasHookEvent) {
  8265. vm.$emit('hook:' + hook, args);
  8266. }
  8267. popTarget();
  8268. return ret
  8269. };
  8270. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8271. if (Array.isArray(modifiers)) {
  8272. if (modifiers.indexOf('trim') !== -1) {
  8273. value = value.trim();
  8274. }
  8275. if (modifiers.indexOf('number') !== -1) {
  8276. value = this._n(value);
  8277. }
  8278. }
  8279. if (!target) {
  8280. target = this;
  8281. }
  8282. target[key] = value;
  8283. };
  8284. Vue.prototype.__set_sync = function(target, key, value) {
  8285. if (!target) {
  8286. target = this;
  8287. }
  8288. target[key] = value;
  8289. };
  8290. Vue.prototype.__get_orig = function(item) {
  8291. if (isPlainObject(item)) {
  8292. return item['$orig'] || item
  8293. }
  8294. return item
  8295. };
  8296. Vue.prototype.__get_value = function(dataPath, target) {
  8297. return getTarget(target || this, dataPath)
  8298. };
  8299. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8300. return renderClass(staticClass, dynamicClass)
  8301. };
  8302. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8303. if (!dynamicStyle && !staticStyle) {
  8304. return ''
  8305. }
  8306. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8307. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8308. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8309. };
  8310. Vue.prototype.__map = function(val, iteratee) {
  8311. //TODO 暂不考虑 string
  8312. var ret, i, l, keys, key;
  8313. if (Array.isArray(val)) {
  8314. ret = new Array(val.length);
  8315. for (i = 0, l = val.length; i < l; i++) {
  8316. ret[i] = iteratee(val[i], i);
  8317. }
  8318. return ret
  8319. } else if (isObject(val)) {
  8320. keys = Object.keys(val);
  8321. ret = Object.create(null);
  8322. for (i = 0, l = keys.length; i < l; i++) {
  8323. key = keys[i];
  8324. ret[key] = iteratee(val[key], key, i);
  8325. }
  8326. return ret
  8327. } else if (typeof val === 'number') {
  8328. ret = new Array(val);
  8329. for (i = 0, l = val; i < l; i++) {
  8330. // 第一个参数暂时仍和小程序一致
  8331. ret[i] = iteratee(i, i);
  8332. }
  8333. return ret
  8334. }
  8335. return []
  8336. };
  8337. }
  8338. /* */
  8339. var LIFECYCLE_HOOKS$1 = [
  8340. //App
  8341. 'onLaunch',
  8342. 'onShow',
  8343. 'onHide',
  8344. 'onUniNViewMessage',
  8345. 'onPageNotFound',
  8346. 'onThemeChange',
  8347. 'onError',
  8348. 'onUnhandledRejection',
  8349. //Page
  8350. 'onInit',
  8351. 'onLoad',
  8352. // 'onShow',
  8353. 'onReady',
  8354. // 'onHide',
  8355. 'onUnload',
  8356. 'onPullDownRefresh',
  8357. 'onReachBottom',
  8358. 'onTabItemTap',
  8359. 'onAddToFavorites',
  8360. 'onShareTimeline',
  8361. 'onShareAppMessage',
  8362. 'onResize',
  8363. 'onPageScroll',
  8364. 'onNavigationBarButtonTap',
  8365. 'onBackPress',
  8366. 'onNavigationBarSearchInputChanged',
  8367. 'onNavigationBarSearchInputConfirmed',
  8368. 'onNavigationBarSearchInputClicked',
  8369. //Component
  8370. // 'onReady', // 兼容旧版本,应该移除该事件
  8371. 'onPageShow',
  8372. 'onPageHide',
  8373. 'onPageResize'
  8374. ];
  8375. function lifecycleMixin$1(Vue) {
  8376. //fixed vue-class-component
  8377. var oldExtend = Vue.extend;
  8378. Vue.extend = function(extendOptions) {
  8379. extendOptions = extendOptions || {};
  8380. var methods = extendOptions.methods;
  8381. if (methods) {
  8382. Object.keys(methods).forEach(function (methodName) {
  8383. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8384. extendOptions[methodName] = methods[methodName];
  8385. delete methods[methodName];
  8386. }
  8387. });
  8388. }
  8389. return oldExtend.call(this, extendOptions)
  8390. };
  8391. var strategies = Vue.config.optionMergeStrategies;
  8392. var mergeHook = strategies.created;
  8393. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8394. strategies[hook] = mergeHook;
  8395. });
  8396. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8397. }
  8398. /* */
  8399. // install platform patch function
  8400. Vue.prototype.__patch__ = patch;
  8401. // public mount method
  8402. Vue.prototype.$mount = function(
  8403. el ,
  8404. hydrating
  8405. ) {
  8406. return mountComponent$1(this, el, hydrating)
  8407. };
  8408. lifecycleMixin$1(Vue);
  8409. internalMixin(Vue);
  8410. /* */
  8411. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8412. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8413. /***/ }),
  8414. /***/ 36:
  8415. /*!******************************************************************!*\
  8416. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/mixins/CustomMixins.js ***!
  8417. \******************************************************************/
  8418. /*! no static exports found */
  8419. /***/ (function(module, exports, __webpack_require__) {
  8420. "use strict";
  8421. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8422. data: function data() {
  8423. return {
  8424. innerAudioContext: null,
  8425. address: '' };
  8426. },
  8427. methods: {
  8428. getLocationInfoByLatLnt: function getLocationInfoByLatLnt(lat, lng) {
  8429. var that = this;
  8430. var locationInfoURL = "https://apis.map.qq.com/ws/geocoder/v1/?location=".concat(lat, ",").concat(lng, "&key=G4BBZ-YSMCJ-56AFX-KD4FQ-23RQZ-S7FX3");
  8431. wx.request({
  8432. url: locationInfoURL, //仅为示例,并非真实的接口地址
  8433. success: function success(res) {
  8434. var resultData = res.data;
  8435. that.address = resultData['result'].address;
  8436. } });
  8437. },
  8438. setTabBarIndex: function setTabBarIndex(index) {
  8439. if (typeof this.$scope.getTabBar === 'function' && this.$scope.getTabBar()) {
  8440. this.$scope.getTabBar().setData({
  8441. selected: index });
  8442. }
  8443. },
  8444. getTimeFuns: function getTimeFuns(sTimeStr, eTimeStr) {
  8445. var sTime = new Date(sTimeStr);
  8446. var eTime = +new Date(eTimeStr); //返回的是用户输入时间总的毫秒数
  8447. var secondTime = (eTime - sTime) / 1000; //剩余时间总的秒数
  8448. var d = parseInt(secondTime / 60 / 60 / 24); //计算天数
  8449. var h = parseInt(secondTime / 60 / 60 % 24); //计算小时
  8450. var m = parseInt(secondTime / 60 % 60); //计算分
  8451. var s = parseInt(secondTime % 60); //计算当前秒数
  8452. return {
  8453. time: Math.abs(d) + '天' + Math.abs(h) + '时' + Math.abs(m) + '分',
  8454. time2: {
  8455. a: d,
  8456. b: h,
  8457. c: m } };
  8458. },
  8459. //播放语音
  8460. createAudio: function createAudio(srcMic) {
  8461. if (this.innerAudioContext) return;
  8462. var that = this;
  8463. //创建内部 audio 上下文 InnerAudioContext 对象。
  8464. that.innerAudioContext = wx.createInnerAudioContext();
  8465. that.innerAudioContext.onError(function (error) {
  8466. console.error("自定义报错(checkedDetail 137行):" + error);
  8467. });
  8468. that.innerAudioContext.src = srcMic; //设置音频地址
  8469. },
  8470. //播放
  8471. audioPlay: function audioPlay(srcMic) {
  8472. this.createAudio(srcMic);
  8473. this.innerAudioContext.play(); //播放音频
  8474. return this.innerAudioContext;
  8475. },
  8476. // 停止播放
  8477. audioPause: function audioPause() {
  8478. if (!this.innerAudioContext) return;
  8479. this.innerAudioContext.pause(); //播放音频
  8480. } } };exports.default = _default;
  8481. /***/ }),
  8482. /***/ 37:
  8483. /*!**********************************************************************!*\
  8484. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/formData.js ***!
  8485. \**********************************************************************/
  8486. /*! no static exports found */
  8487. /***/ (function(module, exports, __webpack_require__) {
  8488. 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;}var mimeMap = __webpack_require__(/*! ./mimeMap.js */ 38);
  8489. function FormData() {
  8490. var fileManager = wx.getFileSystemManager();
  8491. var data = {};
  8492. var files = [];
  8493. this.append = function (name, value) {
  8494. data[name] = value;
  8495. return true;
  8496. };
  8497. this.appendFile = function (name, path, fileName) {
  8498. var buffer = fileManager.readFileSync(path);
  8499. if (Object.prototype.toString.call(buffer).indexOf("ArrayBuffer") < 0) {
  8500. return false;
  8501. }
  8502. if (!fileName) {
  8503. fileName = getFileNameFromPath(path);
  8504. }
  8505. files.push({
  8506. name: name,
  8507. buffer: buffer,
  8508. fileName: fileName });
  8509. return true;
  8510. };
  8511. this.getData = function () {return convert(data, files);};
  8512. }
  8513. function getFileNameFromPath(path) {
  8514. var idx = path.lastIndexOf("/");
  8515. return path.substr(idx + 1);
  8516. }
  8517. function convert(data, files) {
  8518. var boundaryKey = 'wxmpFormBoundary' + randString(); // 数据分割符,一般是随机的字符串
  8519. var boundary = '--' + boundaryKey;
  8520. var endBoundary = boundary + '--';
  8521. var postArray = [];
  8522. //拼接参数
  8523. if (data && Object.prototype.toString.call(data) == "[object Object]") {
  8524. for (var key in data) {
  8525. postArray = postArray.concat(formDataArray(boundary, key, data[key]));
  8526. }
  8527. }
  8528. //拼接文件
  8529. if (files && Object.prototype.toString.call(files) == "[object Array]") {
  8530. for (var i in files) {
  8531. var file = files[i];
  8532. postArray = postArray.concat(formDataArray(boundary, file.name, file.buffer, file.fileName));
  8533. }
  8534. }
  8535. //结尾
  8536. var endBoundaryArray = [];
  8537. endBoundaryArray.push.apply(endBoundaryArray, _toConsumableArray(endBoundary.toUtf8Bytes()));
  8538. postArray = postArray.concat(endBoundaryArray);
  8539. return {
  8540. contentType: 'multipart/form-data; boundary=' + boundaryKey,
  8541. buffer: new Uint8Array(postArray).buffer };
  8542. }
  8543. function randString() {
  8544. var res = "";
  8545. for (var i = 0; i < 17; i++) {
  8546. var n = parseInt(Math.random() * 62);
  8547. if (n <= 9) {
  8548. res += n;
  8549. } else
  8550. if (n <= 35) {
  8551. res += String.fromCharCode(n + 55);
  8552. } else
  8553. {
  8554. res += String.fromCharCode(n + 61);
  8555. }
  8556. }
  8557. return res;
  8558. }
  8559. function formDataArray(boundary, name, value, fileName) {var _dataArray, _dataArray2, _dataArray3;
  8560. var dataString = '';
  8561. var isFile = !!fileName;
  8562. dataString += boundary + '\r\n';
  8563. dataString += 'Content-Disposition: form-data; name="' + name + '"';
  8564. if (isFile) {
  8565. dataString += '; filename="' + fileName + '"' + '\r\n';
  8566. dataString += 'Content-Type: ' + getFileMime(fileName) + '\r\n\r\n';
  8567. } else
  8568. {
  8569. dataString += '\r\n\r\n';
  8570. dataString += value;
  8571. }
  8572. var dataArray = [];
  8573. (_dataArray = dataArray).push.apply(_dataArray, _toConsumableArray(dataString.toUtf8Bytes()));
  8574. if (isFile) {
  8575. var fileArray = new Uint8Array(value);
  8576. dataArray = dataArray.concat(Array.prototype.slice.call(fileArray));
  8577. }
  8578. (_dataArray2 = dataArray).push.apply(_dataArray2, _toConsumableArray("\r".toUtf8Bytes()));
  8579. (_dataArray3 = dataArray).push.apply(_dataArray3, _toConsumableArray("\n".toUtf8Bytes()));
  8580. return dataArray;
  8581. }
  8582. function getFileMime(fileName) {
  8583. var idx = fileName.lastIndexOf(".");
  8584. var mime = mimeMap[fileName.substr(idx)];
  8585. return mime ? mime : "application/octet-stream";
  8586. }
  8587. String.prototype.toUtf8Bytes = function () {
  8588. var str = this;
  8589. var bytes = [];
  8590. for (var i = 0; i < str.length; i++) {
  8591. bytes.push.apply(bytes, _toConsumableArray(str.utf8CodeAt(i)));
  8592. if (str.codePointAt(i) > 0xffff) {
  8593. i++;
  8594. }
  8595. }
  8596. return bytes;
  8597. };
  8598. String.prototype.utf8CodeAt = function (i) {
  8599. var str = this;
  8600. var out = [],p = 0;
  8601. var c = str.charCodeAt(i);
  8602. if (c < 128) {
  8603. out[p++] = c;
  8604. } else if (c < 2048) {
  8605. out[p++] = c >> 6 | 192;
  8606. out[p++] = c & 63 | 128;
  8607. } else if (
  8608. (c & 0xFC00) == 0xD800 && i + 1 < str.length &&
  8609. (str.charCodeAt(i + 1) & 0xFC00) == 0xDC00) {
  8610. // Surrogate Pair
  8611. c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF);
  8612. out[p++] = c >> 18 | 240;
  8613. out[p++] = c >> 12 & 63 | 128;
  8614. out[p++] = c >> 6 & 63 | 128;
  8615. out[p++] = c & 63 | 128;
  8616. } else {
  8617. out[p++] = c >> 12 | 224;
  8618. out[p++] = c >> 6 & 63 | 128;
  8619. out[p++] = c & 63 | 128;
  8620. }
  8621. return out;
  8622. };
  8623. module.exports = FormData;
  8624. /***/ }),
  8625. /***/ 38:
  8626. /*!*********************************************************************!*\
  8627. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/mimeMap.js ***!
  8628. \*********************************************************************/
  8629. /*! no static exports found */
  8630. /***/ (function(module, exports) {
  8631. var _module$exports;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;}module.exports = (_module$exports = {
  8632. "0.001": "application/x-001",
  8633. "0.323": "text/h323",
  8634. "0.907": "drawing/907",
  8635. ".acp": "audio/x-mei-aac",
  8636. ".aif": "audio/aiff",
  8637. ".aiff": "audio/aiff",
  8638. ".asa": "text/asa",
  8639. ".asp": "text/asp",
  8640. ".au": "audio/basic",
  8641. ".awf": "application/vnd.adobe.workflow",
  8642. ".bmp": "application/x-bmp",
  8643. ".c4t": "application/x-c4t",
  8644. ".cal": "application/x-cals",
  8645. ".cdf": "application/x-netcdf",
  8646. ".cel": "application/x-cel",
  8647. ".cg4": "application/x-g4",
  8648. ".cit": "application/x-cit",
  8649. ".cml": "text/xml",
  8650. ".cmx": "application/x-cmx",
  8651. ".crl": "application/pkix-crl",
  8652. ".csi": "application/x-csi",
  8653. ".cut": "application/x-cut",
  8654. ".dbm": "application/x-dbm",
  8655. ".dcd": "text/xml",
  8656. ".der": "application/x-x509-ca-cert",
  8657. ".dib": "application/x-dib",
  8658. ".doc": "application/msword",
  8659. ".drw": "application/x-drw",
  8660. ".dwf": "Model/vnd.dwf",
  8661. ".dwg": "application/x-dwg",
  8662. ".dxf": "application/x-dxf",
  8663. ".emf": "application/x-emf",
  8664. ".ent": "text/xml",
  8665. ".eps": "application/x-ps",
  8666. ".etd": "application/x-ebx",
  8667. ".fax": "image/fax",
  8668. ".fif": "application/fractals",
  8669. ".frm": "application/x-frm",
  8670. ".gbr": "application/x-gbr",
  8671. ".gif": "image/gif",
  8672. ".gp4": "application/x-gp4",
  8673. ".hmr": "application/x-hmr",
  8674. ".hpl": "application/x-hpl",
  8675. ".hrf": "application/x-hrf",
  8676. ".htc": "text/x-component",
  8677. ".html": "text/html",
  8678. ".htx": "text/html",
  8679. ".ico": "image/x-icon",
  8680. ".iff": "application/x-iff",
  8681. ".igs": "application/x-igs",
  8682. ".img": "application/x-img",
  8683. ".isp": "application/x-internet-signup",
  8684. ".java": "java/*",
  8685. ".jpe": "image/jpeg",
  8686. ".jpeg": "image/jpeg",
  8687. ".jpg": "application/x-jpg",
  8688. ".jsp": "text/html",
  8689. ".lar": "application/x-laplayer-reg",
  8690. ".lavs": "audio/x-liquid-secure",
  8691. ".lmsff": "audio/x-la-lms",
  8692. ".ltr": "application/x-ltr",
  8693. ".m2v": "video/x-mpeg",
  8694. ".m4e": "video/mpeg4",
  8695. ".man": "application/x-troff-man",
  8696. ".mdb": "application/msaccess",
  8697. ".mfp": "application/x-shockwave-flash",
  8698. ".mhtml": "message/rfc822",
  8699. ".mid": "audio/mid",
  8700. ".mil": "application/x-mil",
  8701. ".mnd": "audio/x-musicnet-download",
  8702. ".mocha": "application/x-javascript",
  8703. ".mp1": "audio/mp1",
  8704. ".mp2v": "video/mpeg",
  8705. ".mp4": "video/mpeg4",
  8706. ".mpd": "application/vnd.ms-project",
  8707. ".mpeg": "video/mpg",
  8708. ".mpga": "audio/rn-mpeg",
  8709. ".mps": "video/x-mpeg",
  8710. ".mpv": "video/mpg",
  8711. ".mpw": "application/vnd.ms-project",
  8712. ".mtx": "text/xml",
  8713. ".net": "image/pnetvue",
  8714. ".nws": "message/rfc822",
  8715. ".out": "application/x-out",
  8716. ".p12": "application/x-pkcs12",
  8717. ".p7c": "application/pkcs7-mime",
  8718. ".p7r": "application/x-pkcs7-certreqresp",
  8719. ".pc5": "application/x-pc5",
  8720. ".pcl": "application/x-pcl",
  8721. ".pdf": "application/pdf",
  8722. ".pdx": "application/vnd.adobe.pdx",
  8723. ".pgl": "application/x-pgl",
  8724. ".pko": "application/vnd.ms-pki.pko",
  8725. ".plg": "text/html",
  8726. ".plt": "application/x-plt",
  8727. ".png": "application/x-png",
  8728. ".ppa": "application/vnd.ms-powerpoint",
  8729. ".pps": "application/vnd.ms-powerpoint",
  8730. ".ppt": "application/x-ppt",
  8731. ".prf": "application/pics-rules",
  8732. ".prt": "application/x-prt",
  8733. ".ps": "application/postscript",
  8734. ".pwz": "application/vnd.ms-powerpoint",
  8735. ".ra": "audio/vnd.rn-realaudio",
  8736. ".ras": "application/x-ras",
  8737. ".rdf": "text/xml",
  8738. ".red": "application/x-red",
  8739. ".rjs": "application/vnd.rn-realsystem-rjs",
  8740. ".rlc": "application/x-rlc",
  8741. ".rm": "application/vnd.rn-realmedia",
  8742. ".rmi": "audio/mid",
  8743. ".rmm": "audio/x-pn-realaudio",
  8744. ".rms": "application/vnd.rn-realmedia-secure",
  8745. ".rmx": "application/vnd.rn-realsystem-rmx",
  8746. ".rp": "image/vnd.rn-realpix",
  8747. ".rsml": "application/vnd.rn-rsml",
  8748. ".rtf": "application/msword",
  8749. ".rv": "video/vnd.rn-realvideo",
  8750. ".sat": "application/x-sat",
  8751. ".sdw": "application/x-sdw",
  8752. ".slb": "application/x-slb",
  8753. ".slk": "drawing/x-slk",
  8754. ".smil": "application/smil",
  8755. ".snd": "audio/basic",
  8756. ".sor": "text/plain",
  8757. ".spl": "application/futuresplash",
  8758. ".ssm": "application/streamingmedia",
  8759. ".stl": "application/vnd.ms-pki.stl",
  8760. ".sty": "application/x-sty",
  8761. ".swf": "application/x-shockwave-flash",
  8762. ".tg4": "application/x-tg4",
  8763. ".tif": "image/tiff",
  8764. ".tiff": "image/tiff",
  8765. ".top": "drawing/x-top",
  8766. ".tsd": "text/xml",
  8767. ".uin": "application/x-icq",
  8768. ".vcf": "text/x-vcard",
  8769. ".vdx": "application/vnd.visio",
  8770. ".vpg": "application/x-vpeg005",
  8771. ".vsd": "application/x-vsd",
  8772. ".vst": "application/vnd.visio",
  8773. ".vsw": "application/vnd.visio",
  8774. ".vtx": "application/vnd.visio",
  8775. ".wav": "audio/wav",
  8776. ".wb1": "application/x-wb1",
  8777. ".wb3": "application/x-wb3",
  8778. ".wiz": "application/msword",
  8779. ".wk4": "application/x-wk4",
  8780. ".wks": "application/x-wks",
  8781. ".wma": "audio/x-ms-wma",
  8782. ".wmf": "application/x-wmf",
  8783. ".wmv": "video/x-ms-wmv",
  8784. ".wmz": "application/x-ms-wmz",
  8785. ".wpd": "application/x-wpd",
  8786. ".wpl": "application/vnd.ms-wpl",
  8787. ".wr1": "application/x-wr1",
  8788. ".wrk": "application/x-wrk",
  8789. ".ws2": "application/x-ws",
  8790. ".wsdl": "text/xml",
  8791. ".xdp": "application/vnd.adobe.xdp",
  8792. ".xfd": "application/vnd.adobe.xfd",
  8793. ".xhtml": "text/html",
  8794. ".xls": "application/x-xls",
  8795. ".xml": "text/xml",
  8796. ".xq": "text/xml",
  8797. ".xquery": "text/xml",
  8798. ".xsl": "text/xml",
  8799. ".xwd": "application/x-xwd",
  8800. ".sis": "application/vnd.symbian.install",
  8801. ".x_t": "application/x-x_t",
  8802. ".apk": "application/vnd.android.package-archive",
  8803. "0.301": "application/x-301",
  8804. "0.906": "application/x-906",
  8805. ".a11": "application/x-a11",
  8806. ".ai": "application/postscript",
  8807. ".aifc": "audio/aiff",
  8808. ".anv": "application/x-anv",
  8809. ".asf": "video/x-ms-asf",
  8810. ".asx": "video/x-ms-asf",
  8811. ".avi": "video/avi",
  8812. ".biz": "text/xml",
  8813. ".bot": "application/x-bot",
  8814. ".c90": "application/x-c90",
  8815. ".cat": "application/vnd.ms-pki.seccat",
  8816. ".cdr": "application/x-cdr",
  8817. ".cer": "application/x-x509-ca-cert",
  8818. ".cgm": "application/x-cgm",
  8819. ".class": "java/*",
  8820. ".cmp": "application/x-cmp",
  8821. ".cot": "application/x-cot",
  8822. ".crt": "application/x-x509-ca-cert",
  8823. ".css": "text/css",
  8824. ".dbf": "application/x-dbf",
  8825. ".dbx": "application/x-dbx",
  8826. ".dcx": "application/x-dcx",
  8827. ".dgn": "application/x-dgn",
  8828. ".dll": "application/x-msdownload",
  8829. ".dot": "application/msword",
  8830. ".dtd": "text/xml" }, _defineProperty(_module$exports, ".dwf",
  8831. "application/x-dwf"), _defineProperty(_module$exports,
  8832. ".dxb", "application/x-dxb"), _defineProperty(_module$exports,
  8833. ".edn", "application/vnd.adobe.edn"), _defineProperty(_module$exports,
  8834. ".eml", "message/rfc822"), _defineProperty(_module$exports,
  8835. ".epi", "application/x-epi"), _defineProperty(_module$exports, ".eps",
  8836. "application/postscript"), _defineProperty(_module$exports,
  8837. ".exe", "application/x-msdownload"), _defineProperty(_module$exports,
  8838. ".fdf", "application/vnd.fdf"), _defineProperty(_module$exports,
  8839. ".fo", "text/xml"), _defineProperty(_module$exports,
  8840. ".g4", "application/x-g4"), _defineProperty(_module$exports, ".tif",
  8841. "image/tiff"), _defineProperty(_module$exports,
  8842. ".gl2", "application/x-gl2"), _defineProperty(_module$exports,
  8843. ".hgl", "application/x-hgl"), _defineProperty(_module$exports,
  8844. ".hpg", "application/x-hpgl"), _defineProperty(_module$exports,
  8845. ".hqx", "application/mac-binhex40"), _defineProperty(_module$exports,
  8846. ".hta", "application/hta"), _defineProperty(_module$exports,
  8847. ".htm", "text/html"), _defineProperty(_module$exports,
  8848. ".htt", "text/webviewhtml"), _defineProperty(_module$exports,
  8849. ".icb", "application/x-icb"), _defineProperty(_module$exports, ".ico",
  8850. "application/x-ico"), _defineProperty(_module$exports,
  8851. ".ig4", "application/x-g4"), _defineProperty(_module$exports,
  8852. ".iii", "application/x-iphone"), _defineProperty(_module$exports,
  8853. ".ins", "application/x-internet-signup"), _defineProperty(_module$exports,
  8854. ".IVF", "video/x-ivf"), _defineProperty(_module$exports,
  8855. ".jfif", "image/jpeg"), _defineProperty(_module$exports, ".jpe",
  8856. "application/x-jpe"), _defineProperty(_module$exports, ".jpg",
  8857. "image/jpeg"), _defineProperty(_module$exports,
  8858. ".js", "application/x-javascript"), _defineProperty(_module$exports,
  8859. ".la1", "audio/x-liquid-file"), _defineProperty(_module$exports,
  8860. ".latex", "application/x-latex"), _defineProperty(_module$exports,
  8861. ".lbm", "application/x-lbm"), _defineProperty(_module$exports,
  8862. ".ls", "application/x-javascript"), _defineProperty(_module$exports,
  8863. ".m1v", "video/x-mpeg"), _defineProperty(_module$exports,
  8864. ".m3u", "audio/mpegurl"), _defineProperty(_module$exports,
  8865. ".mac", "application/x-mac"), _defineProperty(_module$exports,
  8866. ".math", "text/xml"), _defineProperty(_module$exports, ".mdb",
  8867. "application/x-mdb"), _defineProperty(_module$exports,
  8868. ".mht", "message/rfc822"), _defineProperty(_module$exports,
  8869. ".mi", "application/x-mi"), _defineProperty(_module$exports,
  8870. ".midi", "audio/mid"), _defineProperty(_module$exports,
  8871. ".mml", "text/xml"), _defineProperty(_module$exports,
  8872. ".mns", "audio/x-musicnet-stream"), _defineProperty(_module$exports,
  8873. ".movie", "video/x-sgi-movie"), _defineProperty(_module$exports,
  8874. ".mp2", "audio/mp2"), _defineProperty(_module$exports,
  8875. ".mp3", "audio/mp3"), _defineProperty(_module$exports,
  8876. ".mpa", "video/x-mpg"), _defineProperty(_module$exports,
  8877. ".mpe", "video/x-mpeg"), _defineProperty(_module$exports,
  8878. ".mpg", "video/mpg"), _defineProperty(_module$exports,
  8879. ".mpp", "application/vnd.ms-project"), _defineProperty(_module$exports,
  8880. ".mpt", "application/vnd.ms-project"), _defineProperty(_module$exports,
  8881. ".mpv2", "video/mpeg"), _defineProperty(_module$exports,
  8882. ".mpx", "application/vnd.ms-project"), _defineProperty(_module$exports,
  8883. ".mxp", "application/x-mmxp"), _defineProperty(_module$exports,
  8884. ".nrf", "application/x-nrf"), _defineProperty(_module$exports,
  8885. ".odc", "text/x-ms-odc"), _defineProperty(_module$exports,
  8886. ".p10", "application/pkcs10"), _defineProperty(_module$exports,
  8887. ".p7b", "application/x-pkcs7-certificates"), _defineProperty(_module$exports,
  8888. ".p7m", "application/pkcs7-mime"), _defineProperty(_module$exports,
  8889. ".p7s", "application/pkcs7-signature"), _defineProperty(_module$exports,
  8890. ".pci", "application/x-pci"), _defineProperty(_module$exports,
  8891. ".pcx", "application/x-pcx"), _defineProperty(_module$exports, ".pdf",
  8892. "application/pdf"), _defineProperty(_module$exports,
  8893. ".pfx", "application/x-pkcs12"), _defineProperty(_module$exports,
  8894. ".pic", "application/x-pic"), _defineProperty(_module$exports,
  8895. ".pl", "application/x-perl"), _defineProperty(_module$exports,
  8896. ".pls", "audio/scpls"), _defineProperty(_module$exports, ".png",
  8897. "image/png"), _defineProperty(_module$exports,
  8898. ".pot", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports,
  8899. ".ppm", "application/x-ppm"), _defineProperty(_module$exports, ".ppt",
  8900. "application/vnd.ms-powerpoint"), _defineProperty(_module$exports,
  8901. ".pr", "application/x-pr"), _defineProperty(_module$exports,
  8902. ".prn", "application/x-prn"), _defineProperty(_module$exports, ".ps",
  8903. "application/x-ps"), _defineProperty(_module$exports,
  8904. ".ptn", "application/x-ptn"), _defineProperty(_module$exports,
  8905. ".r3t", "text/vnd.rn-realtext3d"), _defineProperty(_module$exports,
  8906. ".ram", "audio/x-pn-realaudio"), _defineProperty(_module$exports,
  8907. ".rat", "application/rat-file"), _defineProperty(_module$exports,
  8908. ".rec", "application/vnd.rn-recording"), _defineProperty(_module$exports,
  8909. ".rgb", "application/x-rgb"), _defineProperty(_module$exports,
  8910. ".rjt", "application/vnd.rn-realsystem-rjt"), _defineProperty(_module$exports,
  8911. ".rle", "application/x-rle"), _defineProperty(_module$exports,
  8912. ".rmf", "application/vnd.adobe.rmf"), _defineProperty(_module$exports,
  8913. ".rmj", "application/vnd.rn-realsystem-rmj"), _defineProperty(_module$exports,
  8914. ".rmp", "application/vnd.rn-rn_music_package"), _defineProperty(_module$exports,
  8915. ".rmvb", "application/vnd.rn-realmedia-vbr"), _defineProperty(_module$exports,
  8916. ".rnx", "application/vnd.rn-realplayer"), _defineProperty(_module$exports,
  8917. ".rpm", "audio/x-pn-realaudio-plugin"), _defineProperty(_module$exports,
  8918. ".rt", "text/vnd.rn-realtext"), _defineProperty(_module$exports, ".rtf",
  8919. "application/x-rtf"), _defineProperty(_module$exports,
  8920. ".sam", "application/x-sam"), _defineProperty(_module$exports,
  8921. ".sdp", "application/sdp"), _defineProperty(_module$exports,
  8922. ".sit", "application/x-stuffit"), _defineProperty(_module$exports,
  8923. ".sld", "application/x-sld"), _defineProperty(_module$exports,
  8924. ".smi", "application/smil"), _defineProperty(_module$exports,
  8925. ".smk", "application/x-smk"), _defineProperty(_module$exports,
  8926. ".sol", "text/plain"), _defineProperty(_module$exports,
  8927. ".spc", "application/x-pkcs7-certificates"), _defineProperty(_module$exports,
  8928. ".spp", "text/xml"), _defineProperty(_module$exports,
  8929. ".sst", "application/vnd.ms-pki.certstore"), _defineProperty(_module$exports,
  8930. ".stm", "text/html"), _defineProperty(_module$exports,
  8931. ".svg", "text/xml"), _defineProperty(_module$exports,
  8932. ".tdf", "application/x-tdf"), _defineProperty(_module$exports,
  8933. ".tga", "application/x-tga"), _defineProperty(_module$exports, ".tif",
  8934. "application/x-tif"), _defineProperty(_module$exports,
  8935. ".tld", "text/xml"), _defineProperty(_module$exports,
  8936. ".torrent", "application/x-bittorrent"), _defineProperty(_module$exports,
  8937. ".txt", "text/plain"), _defineProperty(_module$exports,
  8938. ".uls", "text/iuls"), _defineProperty(_module$exports,
  8939. ".vda", "application/x-vda"), _defineProperty(_module$exports,
  8940. ".vml", "text/xml"), _defineProperty(_module$exports, ".vsd",
  8941. "application/vnd.visio"), _defineProperty(_module$exports,
  8942. ".vss", "application/vnd.visio"), _defineProperty(_module$exports, ".vst",
  8943. "application/x-vst"), _defineProperty(_module$exports,
  8944. ".vsx", "application/vnd.visio"), _defineProperty(_module$exports,
  8945. ".vxml", "text/xml"), _defineProperty(_module$exports,
  8946. ".wax", "audio/x-ms-wax"), _defineProperty(_module$exports,
  8947. ".wb2", "application/x-wb2"), _defineProperty(_module$exports,
  8948. ".wbmp", "image/vnd.wap.wbmp"), _defineProperty(_module$exports,
  8949. ".wk3", "application/x-wk3"), _defineProperty(_module$exports,
  8950. ".wkq", "application/x-wkq"), _defineProperty(_module$exports,
  8951. ".wm", "video/x-ms-wm"), _defineProperty(_module$exports,
  8952. ".wmd", "application/x-ms-wmd"), _defineProperty(_module$exports,
  8953. ".wml", "text/vnd.wap.wml"), _defineProperty(_module$exports,
  8954. ".wmx", "video/x-ms-wmx"), _defineProperty(_module$exports,
  8955. ".wp6", "application/x-wp6"), _defineProperty(_module$exports,
  8956. ".wpg", "application/x-wpg"), _defineProperty(_module$exports,
  8957. ".wq1", "application/x-wq1"), _defineProperty(_module$exports,
  8958. ".wri", "application/x-wri"), _defineProperty(_module$exports,
  8959. ".ws", "application/x-ws"), _defineProperty(_module$exports,
  8960. ".wsc", "text/scriptlet"), _defineProperty(_module$exports,
  8961. ".wvx", "video/x-ms-wvx"), _defineProperty(_module$exports,
  8962. ".xdr", "text/xml"), _defineProperty(_module$exports,
  8963. ".xfdf", "application/vnd.adobe.xfdf"), _defineProperty(_module$exports, ".xls",
  8964. "application/vnd.ms-excel"), _defineProperty(_module$exports,
  8965. ".xlw", "application/x-xlw"), _defineProperty(_module$exports,
  8966. ".xpl", "audio/scpls"), _defineProperty(_module$exports,
  8967. ".xql", "text/xml"), _defineProperty(_module$exports,
  8968. ".xsd", "text/xml"), _defineProperty(_module$exports,
  8969. ".xslt", "text/xml"), _defineProperty(_module$exports,
  8970. ".x_b", "application/x-x_b"), _defineProperty(_module$exports,
  8971. ".sisx", "application/vnd.symbian.install"), _defineProperty(_module$exports,
  8972. ".ipa", "application/vnd.iphone"), _defineProperty(_module$exports,
  8973. ".xap", "application/x-silverlight-app"), _defineProperty(_module$exports,
  8974. ".zip", "application/x-zip-compressed"), _module$exports);
  8975. /***/ }),
  8976. /***/ 4:
  8977. /*!*************************************************************!*\
  8978. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  8979. \*************************************************************/
  8980. /*! no static exports found */
  8981. /***/ (function(module, exports, __webpack_require__) {
  8982. "use strict";
  8983. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;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;}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 isArray = Array.isArray;
  8984. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  8985. var defaultDelimiters = ['{', '}'];var
  8986. BaseFormatter = /*#__PURE__*/function () {
  8987. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  8988. this._caches = Object.create(null);
  8989. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  8990. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  8991. if (!values) {
  8992. return [message];
  8993. }
  8994. var tokens = this._caches[message];
  8995. if (!tokens) {
  8996. tokens = parse(message, delimiters);
  8997. this._caches[message] = tokens;
  8998. }
  8999. return compile(tokens, values);
  9000. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  9001. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  9002. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  9003. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  9004. var tokens = [];
  9005. var position = 0;
  9006. var text = '';
  9007. while (position < format.length) {
  9008. var char = format[position++];
  9009. if (char === startDelimiter) {
  9010. if (text) {
  9011. tokens.push({ type: 'text', value: text });
  9012. }
  9013. text = '';
  9014. var sub = '';
  9015. char = format[position++];
  9016. while (char !== undefined && char !== endDelimiter) {
  9017. sub += char;
  9018. char = format[position++];
  9019. }
  9020. var isClosed = char === endDelimiter;
  9021. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  9022. 'list' :
  9023. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  9024. 'named' :
  9025. 'unknown';
  9026. tokens.push({ value: sub, type: type });
  9027. }
  9028. // else if (char === '%') {
  9029. // // when found rails i18n syntax, skip text capture
  9030. // if (format[position] !== '{') {
  9031. // text += char
  9032. // }
  9033. // }
  9034. else {
  9035. text += char;
  9036. }
  9037. }
  9038. text && tokens.push({ type: 'text', value: text });
  9039. return tokens;
  9040. }
  9041. function compile(tokens, values) {
  9042. var compiled = [];
  9043. var index = 0;
  9044. var mode = isArray(values) ?
  9045. 'list' :
  9046. isObject(values) ?
  9047. 'named' :
  9048. 'unknown';
  9049. if (mode === 'unknown') {
  9050. return compiled;
  9051. }
  9052. while (index < tokens.length) {
  9053. var token = tokens[index];
  9054. switch (token.type) {
  9055. case 'text':
  9056. compiled.push(token.value);
  9057. break;
  9058. case 'list':
  9059. compiled.push(values[parseInt(token.value, 10)]);
  9060. break;
  9061. case 'named':
  9062. if (mode === 'named') {
  9063. compiled.push(values[token.value]);
  9064. } else
  9065. {
  9066. if (true) {
  9067. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  9068. }
  9069. }
  9070. break;
  9071. case 'unknown':
  9072. if (true) {
  9073. console.warn("Detect 'unknown' type of token!");
  9074. }
  9075. break;}
  9076. index++;
  9077. }
  9078. return compiled;
  9079. }
  9080. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  9081. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  9082. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  9083. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  9084. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  9085. var hasOwnProperty = Object.prototype.hasOwnProperty;
  9086. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  9087. var defaultFormatter = new BaseFormatter();
  9088. function include(str, parts) {
  9089. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  9090. }
  9091. function startsWith(str, parts) {
  9092. return parts.find(function (part) {return str.indexOf(part) === 0;});
  9093. }
  9094. function normalizeLocale(locale, messages) {
  9095. if (!locale) {
  9096. return;
  9097. }
  9098. locale = locale.trim().replace(/_/g, '-');
  9099. if (messages && messages[locale]) {
  9100. return locale;
  9101. }
  9102. locale = locale.toLowerCase();
  9103. if (locale.indexOf('zh') === 0) {
  9104. if (locale.indexOf('-hans') > -1) {
  9105. return LOCALE_ZH_HANS;
  9106. }
  9107. if (locale.indexOf('-hant') > -1) {
  9108. return LOCALE_ZH_HANT;
  9109. }
  9110. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  9111. return LOCALE_ZH_HANT;
  9112. }
  9113. return LOCALE_ZH_HANS;
  9114. }
  9115. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  9116. if (lang) {
  9117. return lang;
  9118. }
  9119. }var
  9120. I18n = /*#__PURE__*/function () {
  9121. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  9122. this.locale = LOCALE_EN;
  9123. this.fallbackLocale = LOCALE_EN;
  9124. this.message = {};
  9125. this.messages = {};
  9126. this.watchers = [];
  9127. if (fallbackLocale) {
  9128. this.fallbackLocale = fallbackLocale;
  9129. }
  9130. this.formater = formater || defaultFormatter;
  9131. this.messages = messages || {};
  9132. this.setLocale(locale || LOCALE_EN);
  9133. if (watcher) {
  9134. this.watchLocale(watcher);
  9135. }
  9136. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9137. locale) {var _this = this;
  9138. var oldLocale = this.locale;
  9139. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9140. if (!this.messages[this.locale]) {
  9141. // 可能初始化时不存在
  9142. this.messages[this.locale] = {};
  9143. }
  9144. this.message = this.messages[this.locale];
  9145. // 仅发生变化时,通知
  9146. if (oldLocale !== this.locale) {
  9147. this.watchers.forEach(function (watcher) {
  9148. watcher(_this.locale, oldLocale);
  9149. });
  9150. }
  9151. } }, { key: "getLocale", value: function getLocale()
  9152. {
  9153. return this.locale;
  9154. } }, { key: "watchLocale", value: function watchLocale(
  9155. fn) {var _this2 = this;
  9156. var index = this.watchers.push(fn) - 1;
  9157. return function () {
  9158. _this2.watchers.splice(index, 1);
  9159. };
  9160. } }, { key: "add", value: function add(
  9161. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9162. var curMessages = this.messages[locale];
  9163. if (curMessages) {
  9164. if (override) {
  9165. Object.assign(curMessages, message);
  9166. } else
  9167. {
  9168. Object.keys(message).forEach(function (key) {
  9169. if (!hasOwn(curMessages, key)) {
  9170. curMessages[key] = message[key];
  9171. }
  9172. });
  9173. }
  9174. } else
  9175. {
  9176. this.messages[locale] = message;
  9177. }
  9178. } }, { key: "f", value: function f(
  9179. message, values, delimiters) {
  9180. return this.formater.interpolate(message, values, delimiters).join('');
  9181. } }, { key: "t", value: function t(
  9182. key, locale, values) {
  9183. var message = this.message;
  9184. if (typeof locale === 'string') {
  9185. locale = normalizeLocale(locale, this.messages);
  9186. locale && (message = this.messages[locale]);
  9187. } else
  9188. {
  9189. values = locale;
  9190. }
  9191. if (!hasOwn(message, key)) {
  9192. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  9193. return key;
  9194. }
  9195. return this.formater.interpolate(message[key], values).join('');
  9196. } }]);return I18n;}();exports.I18n = I18n;
  9197. function watchAppLocale(appVm, i18n) {
  9198. // 需要保证 watch 的触发在组件渲染之前
  9199. if (appVm.$watchLocale) {
  9200. // vue2
  9201. appVm.$watchLocale(function (newLocale) {
  9202. i18n.setLocale(newLocale);
  9203. });
  9204. } else
  9205. {
  9206. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  9207. i18n.setLocale(newLocale);
  9208. });
  9209. }
  9210. }
  9211. function getDefaultLocale() {
  9212. if (typeof uni !== 'undefined' && uni.getLocale) {
  9213. return uni.getLocale();
  9214. }
  9215. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  9216. if (typeof global !== 'undefined' && global.getLocale) {
  9217. return global.getLocale();
  9218. }
  9219. return LOCALE_EN;
  9220. }
  9221. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  9222. // 兼容旧版本入参
  9223. if (typeof locale !== 'string') {var _ref4 =
  9224. [
  9225. messages,
  9226. locale];locale = _ref4[0];messages = _ref4[1];
  9227. }
  9228. if (typeof locale !== 'string') {
  9229. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  9230. locale = getDefaultLocale();
  9231. }
  9232. if (typeof fallbackLocale !== 'string') {
  9233. fallbackLocale =
  9234. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  9235. LOCALE_EN;
  9236. }
  9237. var i18n = new I18n({
  9238. locale: locale,
  9239. fallbackLocale: fallbackLocale,
  9240. messages: messages,
  9241. watcher: watcher });
  9242. var _t = function t(key, values) {
  9243. if (typeof getApp !== 'function') {
  9244. // app view
  9245. /* eslint-disable no-func-assign */
  9246. _t = function t(key, values) {
  9247. return i18n.t(key, values);
  9248. };
  9249. } else
  9250. {
  9251. var isWatchedAppLocale = false;
  9252. _t = function t(key, values) {
  9253. var appVm = getApp().$vm;
  9254. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  9255. // options: {
  9256. // type: Array,
  9257. // default () {
  9258. // return [{
  9259. // icon: 'shop',
  9260. // text: t("uni-goods-nav.options.shop"),
  9261. // }, {
  9262. // icon: 'cart',
  9263. // text: t("uni-goods-nav.options.cart")
  9264. // }]
  9265. // }
  9266. // },
  9267. if (appVm) {
  9268. // 触发响应式
  9269. appVm.$locale;
  9270. if (!isWatchedAppLocale) {
  9271. isWatchedAppLocale = true;
  9272. watchAppLocale(appVm, i18n);
  9273. }
  9274. }
  9275. return i18n.t(key, values);
  9276. };
  9277. }
  9278. return _t(key, values);
  9279. };
  9280. return {
  9281. i18n: i18n,
  9282. f: function f(message, values, delimiters) {
  9283. return i18n.f(message, values, delimiters);
  9284. },
  9285. t: function t(key, values) {
  9286. return _t(key, values);
  9287. },
  9288. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9289. return i18n.add(locale, message, override);
  9290. },
  9291. watch: function watch(fn) {
  9292. return i18n.watchLocale(fn);
  9293. },
  9294. getLocale: function getLocale() {
  9295. return i18n.getLocale();
  9296. },
  9297. setLocale: function setLocale(newLocale) {
  9298. return i18n.setLocale(newLocale);
  9299. } };
  9300. }
  9301. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  9302. var formater;
  9303. function hasI18nJson(jsonObj, delimiters) {
  9304. if (!formater) {
  9305. formater = new BaseFormatter();
  9306. }
  9307. return walkJsonObj(jsonObj, function (jsonObj, key) {
  9308. var value = jsonObj[key];
  9309. if (isString(value)) {
  9310. if (isI18nStr(value, delimiters)) {
  9311. return true;
  9312. }
  9313. } else
  9314. {
  9315. return hasI18nJson(value, delimiters);
  9316. }
  9317. });
  9318. }
  9319. function parseI18nJson(jsonObj, values, delimiters) {
  9320. if (!formater) {
  9321. formater = new BaseFormatter();
  9322. }
  9323. walkJsonObj(jsonObj, function (jsonObj, key) {
  9324. var value = jsonObj[key];
  9325. if (isString(value)) {
  9326. if (isI18nStr(value, delimiters)) {
  9327. jsonObj[key] = compileStr(value, values, delimiters);
  9328. }
  9329. } else
  9330. {
  9331. parseI18nJson(value, values, delimiters);
  9332. }
  9333. });
  9334. return jsonObj;
  9335. }
  9336. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  9337. if (!isI18nStr(jsonStr, delimiters)) {
  9338. return jsonStr;
  9339. }
  9340. if (!formater) {
  9341. formater = new BaseFormatter();
  9342. }
  9343. var localeValues = [];
  9344. Object.keys(locales).forEach(function (name) {
  9345. if (name !== locale) {
  9346. localeValues.push({
  9347. locale: name,
  9348. values: locales[name] });
  9349. }
  9350. });
  9351. localeValues.unshift({ locale: locale, values: locales[locale] });
  9352. try {
  9353. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  9354. }
  9355. catch (e) {}
  9356. return jsonStr;
  9357. }
  9358. function isI18nStr(value, delimiters) {
  9359. return value.indexOf(delimiters[0]) > -1;
  9360. }
  9361. function compileStr(value, values, delimiters) {
  9362. return formater.interpolate(value, values, delimiters).join('');
  9363. }
  9364. function compileValue(jsonObj, key, localeValues, delimiters) {
  9365. var value = jsonObj[key];
  9366. if (isString(value)) {
  9367. // 存在国际化
  9368. if (isI18nStr(value, delimiters)) {
  9369. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  9370. if (localeValues.length > 1) {
  9371. // 格式化国际化语言
  9372. var valueLocales = jsonObj[key + 'Locales'] = {};
  9373. localeValues.forEach(function (localValue) {
  9374. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  9375. });
  9376. }
  9377. }
  9378. } else
  9379. {
  9380. compileJsonObj(value, localeValues, delimiters);
  9381. }
  9382. }
  9383. function compileJsonObj(jsonObj, localeValues, delimiters) {
  9384. walkJsonObj(jsonObj, function (jsonObj, key) {
  9385. compileValue(jsonObj, key, localeValues, delimiters);
  9386. });
  9387. return jsonObj;
  9388. }
  9389. function walkJsonObj(jsonObj, walk) {
  9390. if (isArray(jsonObj)) {
  9391. for (var i = 0; i < jsonObj.length; i++) {
  9392. if (walk(jsonObj, i)) {
  9393. return true;
  9394. }
  9395. }
  9396. } else
  9397. if (isObject(jsonObj)) {
  9398. for (var key in jsonObj) {
  9399. if (walk(jsonObj, key)) {
  9400. return true;
  9401. }
  9402. }
  9403. }
  9404. return false;
  9405. }
  9406. function resolveLocale(locales) {
  9407. return function (locale) {
  9408. if (!locale) {
  9409. return locale;
  9410. }
  9411. locale = normalizeLocale(locale) || locale;
  9412. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  9413. };
  9414. }
  9415. function resolveLocaleChain(locale) {
  9416. var chain = [];
  9417. var tokens = locale.split('-');
  9418. while (tokens.length) {
  9419. chain.push(tokens.join('-'));
  9420. tokens.pop();
  9421. }
  9422. return chain;
  9423. }
  9424. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  9425. /***/ }),
  9426. /***/ 5:
  9427. /*!******************************************************!*\
  9428. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/pages.json ***!
  9429. \******************************************************/
  9430. /*! no static exports found */
  9431. /***/ (function(module, exports) {
  9432. /***/ }),
  9433. /***/ 82:
  9434. /*!************************************************************************************!*\
  9435. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  9436. \************************************************************************************/
  9437. /*! no static exports found */
  9438. /***/ (function(module, exports, __webpack_require__) {
  9439. "use strict";
  9440. /* WEBPACK VAR INJECTION */(function(global, uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 83));var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);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 ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _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 _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 _createForOfIteratorHelper(o, allowArrayLike) {var it;if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e25) {throw _e25;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = o[Symbol.iterator]();}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e26) {didErr = true;err = _e26;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}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 _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _wrapNativeSuper(Class) {var _cache = typeof Map === "function" ? new Map() : undefined;_wrapNativeSuper = function _wrapNativeSuper(Class) {if (Class === null || !_isNativeFunction(Class)) return Class;if (typeof Class !== "function") {throw new TypeError("Super expression must either be null or a function");}if (typeof _cache !== "undefined") {if (_cache.has(Class)) return _cache.get(Class);_cache.set(Class, Wrapper);}function Wrapper() {return _construct(Class, arguments, _getPrototypeOf(this).constructor);}Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });return _setPrototypeOf(Wrapper, Class);};return _wrapNativeSuper(Class);}function _construct(Parent, args, Class) {if (_isNativeReflectConstruct()) {_construct = Reflect.construct;} else {_construct = function _construct(Parent, args, Class) {var a = [null];a.push.apply(a, args);var Constructor = Function.bind.apply(Parent, a);var instance = new Constructor();if (Class) _setPrototypeOf(instance, Class.prototype);return instance;};}return _construct.apply(null, arguments);}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _isNativeFunction(fn) {return Function.toString.call(fn).indexOf("[native code]") !== -1;}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}"undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;function t(e) {return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;}function n(e, t, n) {return e(n = { path: t, exports: {}, require: function require(e, t) {return function () {throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");}(null == t && n.path);} }, n.exports), n.exports;}var s = n(function (e, t) {var n;e.exports = (n = n || function (e, t) {var n = Object.create || function () {function e() {}return function (t) {var n;return e.prototype = t, n = new e(), e.prototype = null, n;};}(),s = {},r = s.lib = {},o = r.Base = { extend: function extend(e) {var t = n(this);return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {t.$super.init.apply(this, arguments);}), t.init.prototype = t, t.$super = this, t;}, create: function create() {var e = this.extend();return e.init.apply(e, arguments), e;}, init: function init() {}, mixIn: function mixIn(e) {for (var t in e) {e.hasOwnProperty(t) && (this[t] = e[t]);}e.hasOwnProperty("toString") && (this.toString = e.toString);}, clone: function clone() {return this.init.prototype.extend(this);} },i = r.WordArray = o.extend({ init: function init(e, n) {e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;}, toString: function toString(e) {return (e || c).stringify(this);}, concat: function concat(e) {var t = this.words,n = e.words,s = this.sigBytes,r = e.sigBytes;if (this.clamp(), s % 4) for (var o = 0; o < r; o++) {var i = n[o >>> 2] >>> 24 - o % 4 * 8 & 255;t[s + o >>> 2] |= i << 24 - (s + o) % 4 * 8;} else for (o = 0; o < r; o += 4) {t[s + o >>> 2] = n[o >>> 2];}return this.sigBytes += r, this;}, clamp: function clamp() {var t = this.words,n = this.sigBytes;t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);}, clone: function clone() {var e = o.clone.call(this);return e.words = this.words.slice(0), e;}, random: function random(t) {for (var n, s = [], r = function r(t) {t = t;var n = 987654321,s = 4294967295;return function () {var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);};}, o = 0; o < t; o += 4) {var a = r(4294967296 * (n || e.random()));n = 987654071 * a(), s.push(4294967296 * a() | 0);}return new i.init(s, t);} }),a = s.enc = {},c = a.Hex = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {var o = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;s.push((o >>> 4).toString(16)), s.push((15 & o).toString(16));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s += 2) {n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;}return new i.init(n, t / 2);} },u = a.Latin1 = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {var o = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;s.push(String.fromCharCode(o));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s++) {n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;}return new i.init(n, t);} },h = a.Utf8 = { stringify: function stringify(e) {try {return decodeURIComponent(escape(u.stringify(e)));} catch (e) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(e) {return u.parse(unescape(encodeURIComponent(e)));} },l = r.BufferedBlockAlgorithm = o.extend({ reset: function reset() {this._data = new i.init(), this._nDataBytes = 0;}, _append: function _append(e) {"string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;}, _process: function _process(t) {var n = this._data,s = n.words,r = n.sigBytes,o = this.blockSize,a = r / (4 * o),c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * o,u = e.min(4 * c, r);if (c) {for (var h = 0; h < c; h += o) {this._doProcessBlock(s, h);}var l = s.splice(0, c);n.sigBytes -= u;}return new i.init(l, u);}, clone: function clone() {var e = o.clone.call(this);return e._data = this._data.clone(), e;}, _minBufferSize: 0 }),d = (r.Hasher = l.extend({ cfg: o.extend(), init: function init(e) {this.cfg = this.cfg.extend(e), this.reset();}, reset: function reset() {l.reset.call(this), this._doReset();}, update: function update(e) {return this._append(e), this._process(), this;}, finalize: function finalize(e) {return e && this._append(e), this._doFinalize();}, blockSize: 16, _createHelper: function _createHelper(e) {return function (t, n) {return new e.init(n).finalize(t);};}, _createHmacHelper: function _createHmacHelper(e) {return function (t, n) {return new d.HMAC.init(e, n).finalize(t);};} }), s.algo = {});return s;}(Math), n);}),r = (n(function (e, t) {var n;e.exports = (n = s, function (e) {var t = n,s = t.lib,r = s.WordArray,o = s.Hasher,i = t.algo,a = [];!function () {for (var t = 0; t < 64; t++) {a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;}}();var c = i.MD5 = o.extend({ _doReset: function _doReset() {this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(e, t) {for (var n = 0; n < 16; n++) {var s = t + n,r = e[s];e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);}var o = this._hash.words,i = e[t + 0],c = e[t + 1],f = e[t + 2],p = e[t + 3],g = e[t + 4],m = e[t + 5],y = e[t + 6],_ = e[t + 7],w = e[t + 8],k = e[t + 9],S = e[t + 10],v = e[t + 11],T = e[t + 12],P = e[t + 13],A = e[t + 14],I = e[t + 15],E = o[0],b = o[1],O = o[2],U = o[3];E = u(E, b, O, U, i, 7, a[0]), U = u(U, E, b, O, c, 12, a[1]), O = u(O, U, E, b, f, 17, a[2]), b = u(b, O, U, E, p, 22, a[3]), E = u(E, b, O, U, g, 7, a[4]), U = u(U, E, b, O, m, 12, a[5]), O = u(O, U, E, b, y, 17, a[6]), b = u(b, O, U, E, _, 22, a[7]), E = u(E, b, O, U, w, 7, a[8]), U = u(U, E, b, O, k, 12, a[9]), O = u(O, U, E, b, S, 17, a[10]), b = u(b, O, U, E, v, 22, a[11]), E = u(E, b, O, U, T, 7, a[12]), U = u(U, E, b, O, P, 12, a[13]), O = u(O, U, E, b, A, 17, a[14]), E = h(E, b = u(b, O, U, E, I, 22, a[15]), O, U, c, 5, a[16]), U = h(U, E, b, O, y, 9, a[17]), O = h(O, U, E, b, v, 14, a[18]), b = h(b, O, U, E, i, 20, a[19]), E = h(E, b, O, U, m, 5, a[20]), U = h(U, E, b, O, S, 9, a[21]), O = h(O, U, E, b, I, 14, a[22]), b = h(b, O, U, E, g, 20, a[23]), E = h(E, b, O, U, k, 5, a[24]), U = h(U, E, b, O, A, 9, a[25]), O = h(O, U, E, b, p, 14, a[26]), b = h(b, O, U, E, w, 20, a[27]), E = h(E, b, O, U, P, 5, a[28]), U = h(U, E, b, O, f, 9, a[29]), O = h(O, U, E, b, _, 14, a[30]), E = l(E, b = h(b, O, U, E, T, 20, a[31]), O, U, m, 4, a[32]), U = l(U, E, b, O, w, 11, a[33]), O = l(O, U, E, b, v, 16, a[34]), b = l(b, O, U, E, A, 23, a[35]), E = l(E, b, O, U, c, 4, a[36]), U = l(U, E, b, O, g, 11, a[37]), O = l(O, U, E, b, _, 16, a[38]), b = l(b, O, U, E, S, 23, a[39]), E = l(E, b, O, U, P, 4, a[40]), U = l(U, E, b, O, i, 11, a[41]), O = l(O, U, E, b, p, 16, a[42]), b = l(b, O, U, E, y, 23, a[43]), E = l(E, b, O, U, k, 4, a[44]), U = l(U, E, b, O, T, 11, a[45]), O = l(O, U, E, b, I, 16, a[46]), E = d(E, b = l(b, O, U, E, f, 23, a[47]), O, U, i, 6, a[48]), U = d(U, E, b, O, _, 10, a[49]), O = d(O, U, E, b, A, 15, a[50]), b = d(b, O, U, E, m, 21, a[51]), E = d(E, b, O, U, T, 6, a[52]), U = d(U, E, b, O, p, 10, a[53]), O = d(O, U, E, b, S, 15, a[54]), b = d(b, O, U, E, c, 21, a[55]), E = d(E, b, O, U, w, 6, a[56]), U = d(U, E, b, O, I, 10, a[57]), O = d(O, U, E, b, y, 15, a[58]), b = d(b, O, U, E, P, 21, a[59]), E = d(E, b, O, U, g, 6, a[60]), U = d(U, E, b, O, v, 10, a[61]), O = d(O, U, E, b, f, 15, a[62]), b = d(b, O, U, E, k, 21, a[63]), o[0] = o[0] + E | 0, o[1] = o[1] + b | 0, o[2] = o[2] + O | 0, o[3] = o[3] + U | 0;}, _doFinalize: function _doFinalize() {var t = this._data,n = t.words,s = 8 * this._nDataBytes,r = 8 * t.sigBytes;n[r >>> 5] |= 128 << 24 - r % 32;var o = e.floor(s / 4294967296),i = s;n[15 + (r + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), n[14 + (r + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {var h = c[u];c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);}return a;}, clone: function clone() {var e = o.clone.call(this);return e._hash = this._hash.clone(), e;} });function u(e, t, n, s, r, o, i) {var a = e + (t & n | ~t & s) + r + i;return (a << o | a >>> 32 - o) + t;}function h(e, t, n, s, r, o, i) {var a = e + (t & s | n & ~s) + r + i;return (a << o | a >>> 32 - o) + t;}function l(e, t, n, s, r, o, i) {var a = e + (t ^ n ^ s) + r + i;return (a << o | a >>> 32 - o) + t;}function d(e, t, n, s, r, o, i) {var a = e + (n ^ (t | ~s)) + r + i;return (a << o | a >>> 32 - o) + t;}t.MD5 = o._createHelper(c), t.HmacMD5 = o._createHmacHelper(c);}(Math), n.MD5);}), n(function (e, t) {var n, r, o;e.exports = (r = (n = s).lib.Base, o = n.enc.Utf8, void (n.algo.HMAC = r.extend({ init: function init(e, t) {e = this._hasher = new e.init(), "string" == typeof t && (t = o.parse(t));var n = e.blockSize,s = 4 * n;t.sigBytes > s && (t = e.finalize(t)), t.clamp();for (var r = this._oKey = t.clone(), i = this._iKey = t.clone(), a = r.words, c = i.words, u = 0; u < n; u++) {a[u] ^= 1549556828, c[u] ^= 909522486;}r.sigBytes = i.sigBytes = s, this.reset();}, reset: function reset() {var e = this._hasher;e.reset(), e.update(this._iKey);}, update: function update(e) {return this._hasher.update(e), this;}, finalize: function finalize(e) {var t = this._hasher,n = t.finalize(e);return t.reset(), t.finalize(this._oKey.clone().concat(n));} })));}), n(function (e, t) {e.exports = s.HmacMD5;}));function o(e) {return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();}function i(e) {return "object" === o(e);}var a = /*#__PURE__*/function (_Error) {_inherits(a, _Error);var _super = _createSuper(a);function a(e, t) {var _this;_classCallCheck(this, a);_this = _super.call(this, e), _this.code = t;return _this;}return a;}( /*#__PURE__*/_wrapNativeSuper(Error));function c(e) {return e && "string" == typeof e ? JSON.parse(e) : e;}var u = "development" === "development",h = "mp-weixin",l = c(undefined),d = c([]),f = true;var p = "";try {{var _e2 = __webpack_require__(/*! uni-stat-config */ 86).default || __webpack_require__(/*! uni-stat-config */ 86);p = _e2.appid;}} catch (e) {}var g = {};function m(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n, s;return n = g, s = e, Object.prototype.hasOwnProperty.call(n, s) || (g[e] = t), g[e];}"app-plus" === h && (g = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});var y = ["invoke", "success", "fail", "complete"],_ = m("_globalUniCloudInterceptor");function w(e, t) {_[e] || (_[e] = {}), i(t) && Object.keys(t).forEach(function (n) {y.indexOf(n) > -1 && function (e, t, n) {var s = _[e][t];s || (s = _[e][t] = []), -1 === s.indexOf(n) && "function" == typeof n && s.push(n);}(e, n, t[n]);});}function k(e, t) {_[e] || (_[e] = {}), i(t) ? Object.keys(t).forEach(function (n) {y.indexOf(n) > -1 && function (e, t, n) {var s = _[e][t];if (!s) return;var r = s.indexOf(n);r > -1 && s.splice(r, 1);}(e, n, t[n]);}) : delete _[e];}function S(e, t) {return e && 0 !== e.length ? e.reduce(function (e, n) {return e.then(function () {return n(t);});}, Promise.resolve()) : Promise.resolve();}function v(e, t) {return _[e] && _[e][t] || [];}function T(e, t) {return t ? function (n) {var _this2 = this;var s = "callFunction" === t && "DCloud-clientDB" === (n && n.name);var r;r = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};var o = r.then(function () {return s ? Promise.resolve() : S(v(t, "invoke"), n);}).then(function () {return e.call(_this2, n);}).then(function (e) {return s ? Promise.resolve(e) : S(v(t, "success"), e).then(function () {return S(v(t, "complete"), e);}).then(function () {return Promise.resolve(e);});}, function (e) {return s ? Promise.reject(e) : S(v(t, "fail"), e).then(function () {return S(v(t, "complete"), e);}).then(function () {return Promise.reject(e);});});if (!(n.success || n.fail || n.complete)) return o;o.then(function (e) {n.success && n.success(e), n.complete && n.complete(e);}).catch(function (e) {n.fail && n.fail(e), n.complete && n.complete(e);});} : function (t) {if (!((t = t || {}).success || t.fail || t.complete)) return e.call(this, t);e.call(this, t).then(function (e) {t.success && t.success(e), t.complete && t.complete(e);}, function (e) {t.fail && t.fail(e), t.complete && t.complete(e);});};}var P = /*#__PURE__*/function (_Error2) {_inherits(P, _Error2);var _super2 = _createSuper(P);function P(e) {var _this3;_classCallCheck(this, P);_this3 = _super2.call(this, e.message), _this3.errMsg = e.message || "", Object.defineProperties(_assertThisInitialized(_this3), { code: { get: function get() {return e.code;} }, requestId: { get: function get() {return e.requestId;} }, message: { get: function get() {return this.errMsg;}, set: function set(e) {this.errMsg = e;} } });return _this3;}return P;}( /*#__PURE__*/_wrapNativeSuper(Error));var _e3 = (0, _uniI18n.initVueI18n)({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" } }, "zh-Hans"),A = _e3.t,I = _e3.setLocale,E = _e3.getLocale;function b() {var _uni$getSystemInfoSyn = uni.getSystemInfoSync(),e = _uni$getSystemInfoSyn.deviceId,t = _uni$getSystemInfoSyn.platform;return { PLATFORM: h, OS: t, APPID: p, LOCALE: E(), DEVICEID: e, CLIENT_SDK_VERSION: "1.0.13" };}var O = { sign: function sign(e, t) {var n = "";return Object.keys(e).sort().forEach(function (t) {e[t] && (n = n + "&" + t + "=" + e[t]);}), n = n.slice(1), r(n, t).toString();}, wrappedRequest: function wrappedRequest(e, t) {return new Promise(function (n, s) {t(Object.assign(e, { complete: function complete(e) {e || (e = {}), u && "h5" === h && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];if (!e.statusCode || e.statusCode >= 400) return s(new P({ code: "SYS_ERR", message: e.errMsg || "request:fail", requestId: t }));var r = e.data;if (r.error) return s(new P({ code: r.error.code, message: r.error.message, requestId: t }));r.result = r.data, r.requestId = t, delete r.data, n(r);} }));});} };var U = { request: function request(e) {return uni.request(e);}, uploadFile: function uploadFile(e) {return uni.uploadFile(e);}, setStorageSync: function setStorageSync(e, t) {return uni.setStorageSync(e, t);}, getStorageSync: function getStorageSync(e) {return uni.getStorageSync(e);}, removeStorageSync: function removeStorageSync(e) {return uni.removeStorageSync(e);}, clearStorageSync: function clearStorageSync() {return uni.clearStorageSync();} };var C = /*#__PURE__*/function () {function C(e) {_classCallCheck(this, C);["spaceId", "clientSecret"].forEach(function (t) {if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(A("uniCloud.init.paramRequired", { param: t }));}), this.config = Object.assign({}, { endpoint: "https://api.bspapp.com" }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = U, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;}_createClass(C, [{ key: "setAccessToken", value: function setAccessToken(e) {this.accessToken = e;} }, { key: "requestWrapped", value: function requestWrapped(e) {return O.wrappedRequest(e, this.adapter.request);} }, { key: "requestAuth", value: function requestAuth(e) {return this.requestWrapped(e);} }, { key: "request", value: function request(e, t) {var _this4 = this;return Promise.resolve().then(function () {return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {return new Promise(function (e, n) {!t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();}).then(function () {return _this4.getAccessToken();}).then(function () {var t = _this4.rebuildRequest(e);return _this4.request(t, !0);});}) : _this4.getAccessToken().then(function () {var t = _this4.rebuildRequest(e);return _this4.request(t, !0);});});} }, { key: "rebuildRequest", value: function rebuildRequest(e) {var t = Object.assign({}, e);return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = O.sign(t.data, this.config.clientSecret), t;} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = O.sign(n, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: s };} }, { key: "getAccessToken", value: function getAccessToken() {var _this5 = this;if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;this._getAccessTokenPromiseStatus = "pending";return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then(function (e) {return new Promise(function (t, n) {e.result && e.result.accessToken ? (_this5.setAccessToken(e.result.accessToken), _this5._getAccessTokenPromiseStatus = "fulfilled", t(_this5.accessToken)) : (_this5._getAccessTokenPromiseStatus = "rejected", n(new P({ code: "AUTH_FAILED", message: "获取accessToken失败" })));});}, function (e) {return _this5._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);}), this._getAccessTokenPromise;} }, { key: "authorize", value: function authorize() {this.getAccessToken();} }, { key: "callFunction", value: function callFunction(e) {var t = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e.name, functionArgs: e.data || {} }) };return this.request(this.setupRequest(t));} }, { key: "getOSSUploadOptionsFromPath", value: function getOSSUploadOptionsFromPath(e) {var t = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref) {var _this6 = this;var e = _ref.url,t = _ref.formData,n = _ref.name,s = _ref.filePath,r = _ref.fileType,o = _ref.onUploadProgress;return new Promise(function (i, a) {var c = _this6.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: r, header: { "X-OSS-server-side-encrpytion": "AES256" }, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new P({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new P({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof o && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {o({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "reportOSSUpload", value: function reportOSSUpload(e) {var t = { method: "serverless.file.resource.report", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFile", value: function uploadFile(_ref2) {var _this7 = this;var e = _ref2.filePath,t = _ref2.cloudPath,_ref2$fileType = _ref2.fileType,n = _ref2$fileType === void 0 ? "image" : _ref2$fileType,s = _ref2.onUploadProgress,r = _ref2.config;if ("string" !== o(t)) throw new P({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });if (!(t = t.trim())) throw new P({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });if (/:\/\//.test(t)) throw new P({ code: "INVALID_PARAM", message: "cloudPath不合法" });var i = r && r.envType || this.config.envType;var a, c;return this.getOSSUploadOptionsFromPath({ env: i, filename: t }).then(function (t) {var r = t.result;a = r.id, c = "https://" + r.cdnDomain + "/" + r.ossPath;var o = { url: "https://" + r.host, formData: { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: r.accessKeyId, Signature: r.signature, host: r.host, id: a, key: r.ossPath, policy: r.policy, success_action_status: 200 }, fileName: "file", name: "file", filePath: e, fileType: n };return _this7.uploadFileToOSS(Object.assign({}, o, { onUploadProgress: s }));}).then(function () {return _this7.reportOSSUpload({ id: a });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: c }) : s(new P({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }, { key: "deleteFile", value: function deleteFile(_ref3) {var e = _ref3.fileList;var t = { method: "serverless.file.resource.delete", params: JSON.stringify({ id: e[0] }) };return this.request(this.setupRequest(t));} }, { key: "getTempFileURL", value: function getTempFileURL() {var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref4.fileList;return new Promise(function (t, n) {Array.isArray(e) && 0 !== e.length || n(new P({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t({ fileList: e.map(function (e) {return { fileID: e, tempFileURL: e };}) });});} }, { key: "hasAccessToken", get: function get() {return !!this.accessToken;} }]);return C;}();var x = { init: function init(e) {var t = new C(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} },D = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";var R;!function (e) {e.local = "local", e.none = "none", e.session = "session";}(R || (R = {}));var q = function q() {};var F = function F() {var e;if (!Promise) {e = function e() {}, e.promise = {};var _t = function _t() {throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.');};return Object.defineProperty(e.promise, "then", { get: _t }), Object.defineProperty(e.promise, "catch", { get: _t }), e;}var t = new Promise(function (t, n) {e = function e(_e4, s) {return _e4 ? n(_e4) : t(s);};});return e.promise = t, e;};function L(e) {return void 0 === e;}function N(e) {return "[object Null]" === Object.prototype.toString.call(e);}var M;function $(e) {var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);var n;var _iterator = _createForOfIteratorHelper(t),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var _e5 = _step.value;var _t2 = _e5.isMatch,_n = _e5.genAdapter,_s = _e5.runtime;if (_t2()) return { adapter: _n(), runtime: _s };}} catch (err) {_iterator.e(err);} finally {_iterator.f();}}!function (e) {e.WEB = "web", e.WX_MP = "wx_mp";}(M || (M = {}));var j = { adapter: null, runtime: void 0 },K = ["anonymousUuidKey"];var B = /*#__PURE__*/function (_q) {_inherits(B, _q);var _super3 = _createSuper(B);function B() {var _this8;_classCallCheck(this, B);_this8 = _super3.call(this), j.adapter.root.tcbObject || (j.adapter.root.tcbObject = {});return _this8;}_createClass(B, [{ key: "setItem", value: function setItem(e, t) {j.adapter.root.tcbObject[e] = t;} }, { key: "getItem", value: function getItem(e) {return j.adapter.root.tcbObject[e];} }, { key: "removeItem", value: function removeItem(e) {delete j.adapter.root.tcbObject[e];} }, { key: "clear", value: function clear() {delete j.adapter.root.tcbObject;} }]);return B;}(q);function H(e, t) {switch (e) {case "local":return t.localStorage || new B();case "none":return new B();default:return t.sessionStorage || new B();}}var W = /*#__PURE__*/function () {function W(e) {_classCallCheck(this, W);if (!this._storage) {this._persistence = j.adapter.primaryStorage || e.persistence, this._storage = H(this._persistence, j.adapter);var _t3 = "access_token_".concat(e.env),_n2 = "access_token_expire_".concat(e.env),_s2 = "refresh_token_".concat(e.env),_r = "anonymous_uuid_".concat(e.env),_o = "login_type_".concat(e.env),_i = "user_info_".concat(e.env);this.keys = { accessTokenKey: _t3, accessTokenExpireKey: _n2, refreshTokenKey: _s2, anonymousUuidKey: _r, loginTypeKey: _o, userInfoKey: _i };}}_createClass(W, [{ key: "updatePersistence", value: function updatePersistence(e) {if (e === this._persistence) return;var t = "local" === this._persistence;this._persistence = e;var n = H(e, j.adapter);for (var _e6 in this.keys) {var _s3 = this.keys[_e6];if (t && K.includes(_e6)) continue;var _r2 = this._storage.getItem(_s3);L(_r2) || N(_r2) || (n.setItem(_s3, _r2), this._storage.removeItem(_s3));}this._storage = n;} }, { key: "setStore", value: function setStore(e, t, n) {if (!this._storage) return;var s = { version: n || "localCachev1", content: t },r = JSON.stringify(s);try {this._storage.setItem(e, r);} catch (e) {throw e;}} }, { key: "getStore", value: function getStore(e, t) {try {if (!this._storage) return;} catch (e) {return "";}t = t || "localCachev1";var n = this._storage.getItem(e);if (!n) return "";if (n.indexOf(t) >= 0) {return JSON.parse(n).content;}return "";} }, { key: "removeStore", value: function removeStore(e) {this._storage.removeItem(e);} }]);return W;}();var z = {},V = {};function J(e) {return z[e];}var Y = function Y(e, t) {_classCallCheck(this, Y);this.data = t || null, this.name = e;};var X = /*#__PURE__*/function (_Y) {_inherits(X, _Y);var _super4 = _createSuper(X);function X(e, t) {var _this9;_classCallCheck(this, X);_this9 = _super4.call(this, "error", { error: e, data: t }), _this9.error = e;return _this9;}return X;}(Y);var G = new ( /*#__PURE__*/function () {function _class() {_classCallCheck(this, _class);this._listeners = {};}_createClass(_class, [{ key: "on", value: function on(e, t) {return function (e, t, n) {n[e] = n[e] || [], n[e].push(t);}(e, t, this._listeners), this;} }, { key: "off", value: function off(e, t) {return function (e, t, n) {if (n && n[e]) {var _s4 = n[e].indexOf(t);-1 !== _s4 && n[e].splice(_s4, 1);}}(e, t, this._listeners), this;} }, { key: "fire", value: function fire(e, t) {if (e instanceof X) return console.error(e.error), this;var n = "string" == typeof e ? new Y(e, t || {}) : e;var s = n.name;if (this._listens(s)) {n.target = this;var _e7 = this._listeners[s] ? _toConsumableArray(this._listeners[s]) : [];var _iterator2 = _createForOfIteratorHelper(_e7),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var _t4 = _step2.value;_t4.call(this, n);}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}}return this;} }, { key: "_listens", value: function _listens(e) {return this._listeners[e] && this._listeners[e].length > 0;} }]);return _class;}())();function Q(e, t) {G.on(e, t);}function Z(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};G.fire(e, t);}function ee(e, t) {G.off(e, t);}var te = "loginStateChanged",ne = "loginStateExpire",se = "loginTypeChanged",re = "anonymousConverted",oe = "refreshAccessToken";var ie;!function (e) {e.ANONYMOUS = "ANONYMOUS", e.WECHAT = "WECHAT", e.WECHAT_PUBLIC = "WECHAT-PUBLIC", e.WECHAT_OPEN = "WECHAT-OPEN", e.CUSTOM = "CUSTOM", e.EMAIL = "EMAIL", e.USERNAME = "USERNAME", e.NULL = "NULL";}(ie || (ie = {}));var ae = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],ce = { "X-SDK-Version": "1.3.5" };function ue(e, t, n) {var s = e[t];e[t] = function (t) {var r = {},o = {};n.forEach(function (n) {var _n$call = n.call(e, t),s = _n$call.data,i = _n$call.headers;Object.assign(r, s), Object.assign(o, i);});var i = t.data;return i && function () {var e;if (e = i, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, i), r);else for (var _e8 in r) {i.append(_e8, r[_e8]);}}(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), o), s.call(e, t);};}function he() {var e = Math.random().toString(16).slice(2);return { data: { seqId: e }, headers: _objectSpread(_objectSpread({}, ce), {}, { "x-seqid": e }) };}var le = /*#__PURE__*/function () {function le() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, le);var t;this.config = e, this._reqClass = new j.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"), restrictedMethods: ["post"] }), this._cache = J(this.config.env), this._localCache = (t = this.config.env, V[t]), ue(this._reqClass, "post", [he]), ue(this._reqClass, "upload", [he]), ue(this._reqClass, "download", [he]);}_createClass(le, [{ key: "post", value: function () {var _post = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return this._reqClass.post(e);case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee, this);}));function post(_x) {return _post.apply(this, arguments);}return post;}() }, { key: "upload", value: function () {var _upload = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return this._reqClass.upload(e);case 2:return _context2.abrupt("return", _context2.sent);case 3:case "end":return _context2.stop();}}}, _callee2, this);}));function upload(_x2) {return _upload.apply(this, arguments);}return upload;}() }, { key: "download", value: function () {var _download = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return this._reqClass.download(e);case 2:return _context3.abrupt("return", _context3.sent);case 3:case "end":return _context3.stop();}}}, _callee3, this);}));function download(_x3) {return _download.apply(this, arguments);}return download;}() }, { key: "refreshAccessToken", value: function () {var _refreshAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var e, t;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());_context4.prev = 1;_context4.next = 4;return this._refreshAccessTokenPromise;case 4:e = _context4.sent;_context4.next = 10;break;case 7:_context4.prev = 7;_context4.t0 = _context4["catch"](1);t = _context4.t0;case 10:if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {_context4.next = 12;break;}throw t;case 12:return _context4.abrupt("return", e);case 13:case "end":return _context4.stop();}}}, _callee4, this, [[1, 7]]);}));function refreshAccessToken() {return _refreshAccessToken2.apply(this, arguments);}return refreshAccessToken;}() }, { key: "_refreshAccessToken", value: function () {var _refreshAccessToken3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5() {var _this$_cache$keys, e, t, n, s, r, o, i, a, _e9, _e10, _t5, _s5;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:_this$_cache$keys = this._cache.keys, e = _this$_cache$keys.accessTokenKey, t = _this$_cache$keys.accessTokenExpireKey, n = _this$_cache$keys.refreshTokenKey, s = _this$_cache$keys.loginTypeKey, r = _this$_cache$keys.anonymousUuidKey;this._cache.removeStore(e), this._cache.removeStore(t);o = this._cache.getStore(n);if (o) {_context5.next = 5;break;}throw new Error("未登录CloudBase");case 5:i = { refresh_token: o };_context5.next = 8;return this.request("auth.fetchAccessTokenWithRefreshToken", i);case 8:a = _context5.sent;if (!a.data.code) {_context5.next = 21;break;}_e9 = a.data.code;if (!("SIGN_PARAM_INVALID" === _e9 || "REFRESH_TOKEN_EXPIRED" === _e9 || "INVALID_REFRESH_TOKEN" === _e9)) {_context5.next = 20;break;}if (!(this._cache.getStore(s) === ie.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e9)) {_context5.next = 19;break;}_e10 = this._cache.getStore(r);_t5 = this._cache.getStore(n);_context5.next = 17;return this.send("auth.signInAnonymously", { anonymous_uuid: _e10, refresh_token: _t5 });case 17:_s5 = _context5.sent;return _context5.abrupt("return", (this.setRefreshToken(_s5.refresh_token), this._refreshAccessToken()));case 19:Z(ne), this._cache.removeStore(n);case 20:throw new Error("\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code));case 21:if (!a.data.access_token) {_context5.next = 23;break;}return _context5.abrupt("return", (Z(oe), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), { accessToken: a.data.access_token, accessTokenExpire: a.data.access_token_expire }));case 23:a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());case 24:case "end":return _context5.stop();}}}, _callee5, this);}));function _refreshAccessToken() {return _refreshAccessToken3.apply(this, arguments);}return _refreshAccessToken;}() }, { key: "getAccessToken", value: function () {var _getAccessToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6() {var _this$_cache$keys2, e, t, n, s, r, o;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:_this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;if (this._cache.getStore(n)) {_context6.next = 3;break;}throw new Error("refresh token不存在,登录状态异常");case 3:s = this._cache.getStore(e), r = this._cache.getStore(t), o = !0;_context6.t0 = this._shouldRefreshAccessTokenHook;if (!_context6.t0) {_context6.next = 9;break;}_context6.next = 8;return this._shouldRefreshAccessTokenHook(s, r);case 8:_context6.t0 = !_context6.sent;case 9:_context6.t1 = _context6.t0;if (!_context6.t1) {_context6.next = 12;break;}o = !1;case 12:return _context6.abrupt("return", (!s || !r || r < Date.now()) && o ? this.refreshAccessToken() : { accessToken: s, accessTokenExpire: r });case 13:case "end":return _context6.stop();}}}, _callee6, this);}));function getAccessToken() {return _getAccessToken.apply(this, arguments);}return getAccessToken;}() }, { key: "request", value: function () {var _request = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(e, t, n) {var s, r, o, _e11, i, _e12, _e13, a, c, u, h, l, d, f, p, g;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:s = "x-tcb-trace_".concat(this.config.env);r = "application/x-www-form-urlencoded";o = _objectSpread({ action: e, env: this.config.env, dataVersion: "2019-08-16" }, t);if (!(-1 === ae.indexOf(e))) {_context7.next = 10;break;}_e11 = this._cache.keys.refreshTokenKey;_context7.t0 = this._cache.getStore(_e11);if (!_context7.t0) {_context7.next = 10;break;}_context7.next = 9;return this.getAccessToken();case 9:o.access_token = _context7.sent.accessToken;case 10:if ("storage.uploadFile" === e) {i = new FormData();for (_e12 in i) {i.hasOwnProperty(_e12) && void 0 !== i[_e12] && i.append(_e12, o[_e12]);}r = "multipart/form-data";} else {r = "application/json", i = {};for (_e13 in o) {void 0 !== o[_e13] && (i[_e13] = o[_e13]);}}a = { headers: { "content-type": r } };n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);c = this._localCache.getStore(s);c && (a.headers["X-TCB-Trace"] = c);u = t.parse, h = t.inQuery, l = t.search;d = { env: this.config.env };u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));f = function (e, t) {var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var s = /\?/.test(t);var r = "";for (var _e14 in n) {"" === r ? !s && (t += "?") : r += "&", r += "".concat(_e14, "=").concat(encodeURIComponent(n[_e14]));}return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);}(D, "//tcb-api.tencentcloudapi.com/web", d);l && (f += l);_context7.next = 22;return this.post(_objectSpread({ url: f, data: i }, a));case 22:p = _context7.sent;g = p.header && p.header["x-tcb-trace"];if (!(g && this._localCache.setStore(s, g), 200 !== Number(p.status) && 200 !== Number(p.statusCode) || !p.data)) {_context7.next = 26;break;}throw new Error("network request error");case 26:return _context7.abrupt("return", p);case 27:case "end":return _context7.stop();}}}, _callee7, this);}));function request(_x4, _x5, _x6) {return _request.apply(this, arguments);}return request;}() }, { key: "send", value: function () {var _send = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee8(e) {var t,n,_n3,_args8 = arguments;return _regenerator.default.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0:t = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};_context8.next = 3;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 3:n = _context8.sent;if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === ae.indexOf(e))) {_context8.next = 13;break;}_context8.next = 7;return this.refreshAccessToken();case 7:_context8.next = 9;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 9:_n3 = _context8.sent;if (!_n3.data.code) {_context8.next = 12;break;}throw new Error("[".concat(_n3.data.code, "] ").concat(_n3.data.message));case 12:return _context8.abrupt("return", _n3.data);case 13:if (!n.data.code) {_context8.next = 15;break;}throw new Error("[".concat(n.data.code, "] ").concat(n.data.message));case 15:return _context8.abrupt("return", n.data);case 16:case "end":return _context8.stop();}}}, _callee8, this);}));function send(_x7) {return _send.apply(this, arguments);}return send;}() }, { key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys3 = this._cache.keys,t = _this$_cache$keys3.accessTokenKey,n = _this$_cache$keys3.accessTokenExpireKey,s = _this$_cache$keys3.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }]);return le;}();var de = {};function fe(e) {return de[e];}var pe = /*#__PURE__*/function () {function pe(e) {_classCallCheck(this, pe);this.config = e, this._cache = J(e.env), this._request = fe(e.env);}_createClass(pe, [{ key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys4 = this._cache.keys,t = _this$_cache$keys4.accessTokenKey,n = _this$_cache$keys4.accessTokenExpireKey,s = _this$_cache$keys4.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }, { key: "setAccessToken", value: function setAccessToken(e, t) {var _this$_cache$keys5 = this._cache.keys,n = _this$_cache$keys5.accessTokenKey,s = _this$_cache$keys5.accessTokenExpireKey;this._cache.setStore(n, e), this._cache.setStore(s, t);} }, { key: "refreshUserInfo", value: function () {var _refreshUserInfo = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee9() {var _yield$this$_request$, e;return _regenerator.default.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:_context9.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$ = _context9.sent;e = _yield$this$_request$.data;return _context9.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context9.stop();}}}, _callee9, this);}));function refreshUserInfo() {return _refreshUserInfo.apply(this, arguments);}return refreshUserInfo;}() }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e);} }]);return pe;}();var ge = /*#__PURE__*/function () {function ge(e) {_classCallCheck(this, ge);if (!e) throw new Error("envId is not defined");this._envId = e, this._cache = J(this._envId), this._request = fe(this._envId), this.setUserInfo();}_createClass(ge, [{ key: "linkWithTicket", value: function linkWithTicket(e) {if ("string" != typeof e) throw new Error("ticket must be string");return this._request.send("auth.linkWithTicket", { ticket: e });} }, { key: "linkWithRedirect", value: function linkWithRedirect(e) {e.signInWithRedirect();} }, { key: "updatePassword", value: function updatePassword(e, t) {return this._request.send("auth.updatePassword", { oldPassword: t, newPassword: e });} }, { key: "updateEmail", value: function updateEmail(e) {return this._request.send("auth.updateEmail", { newEmail: e });} }, { key: "updateUsername", value: function updateUsername(e) {if ("string" != typeof e) throw new Error("username must be a string");return this._request.send("auth.updateUsername", { username: e });} }, { key: "getLinkedUidList", value: function () {var _getLinkedUidList = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee10() {var _yield$this$_request$2, e, t, n;return _regenerator.default.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:_context10.next = 2;return this._request.send("auth.getLinkedUidList", {});case 2:_yield$this$_request$2 = _context10.sent;e = _yield$this$_request$2.data;t = !1;n = e.users;return _context10.abrupt("return", (n.forEach(function (e) {e.wxOpenId && e.wxPublicId && (t = !0);}), { users: n, hasPrimaryUid: t }));case 7:case "end":return _context10.stop();}}}, _callee10, this);}));function getLinkedUidList() {return _getLinkedUidList.apply(this, arguments);}return getLinkedUidList;}() }, { key: "setPrimaryUid", value: function setPrimaryUid(e) {return this._request.send("auth.setPrimaryUid", { uid: e });} }, { key: "unlink", value: function unlink(e) {return this._request.send("auth.unlink", { platform: e });} }, { key: "update", value: function () {var _update = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {var t, n, s, r, o, i, _yield$this$_request$3, a;return _regenerator.default.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0:t = e.nickName;n = e.gender;s = e.avatarUrl;r = e.province;o = e.country;i = e.city;_context11.next = 8;return this._request.send("auth.updateUserInfo", { nickName: t, gender: n, avatarUrl: s, province: r, country: o, city: i });case 8:_yield$this$_request$3 = _context11.sent;a = _yield$this$_request$3.data;this.setLocalUserInfo(a);case 11:case "end":return _context11.stop();}}}, _callee11, this);}));function update(_x8) {return _update.apply(this, arguments);}return update;}() }, { key: "refresh", value: function () {var _refresh = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee12() {var _yield$this$_request$4, e;return _regenerator.default.wrap(function _callee12$(_context12) {while (1) {switch (_context12.prev = _context12.next) {case 0:_context12.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$4 = _context12.sent;e = _yield$this$_request$4.data;return _context12.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context12.stop();}}}, _callee12, this);}));function refresh() {return _refresh.apply(this, arguments);}return refresh;}() }, { key: "setUserInfo", value: function setUserInfo() {var _this10 = this;var e = this._cache.keys.userInfoKey,t = this._cache.getStore(e);["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {_this10[e] = t[e];}), this.location = { country: t.country, province: t.province, city: t.city };} }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e), this.setUserInfo();} }]);return ge;}();var me = /*#__PURE__*/function () {function me(e) {_classCallCheck(this, me);if (!e) throw new Error("envId is not defined");this._cache = J(e);var _this$_cache$keys6 = this._cache.keys,t = _this$_cache$keys6.refreshTokenKey,n = _this$_cache$keys6.accessTokenKey,s = _this$_cache$keys6.accessTokenExpireKey,r = this._cache.getStore(t),o = this._cache.getStore(n),i = this._cache.getStore(s);this.credential = { refreshToken: r, accessToken: o, accessTokenExpire: i }, this.user = new ge(e);}_createClass(me, [{ key: "isAnonymousAuth", get: function get() {return this.loginType === ie.ANONYMOUS;} }, { key: "isCustomAuth", get: function get() {return this.loginType === ie.CUSTOM;} }, { key: "isWeixinAuth", get: function get() {return this.loginType === ie.WECHAT || this.loginType === ie.WECHAT_OPEN || this.loginType === ie.WECHAT_PUBLIC;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return me;}();var ye = /*#__PURE__*/function (_pe) {_inherits(ye, _pe);var _super5 = _createSuper(ye);function ye() {_classCallCheck(this, ye);return _super5.apply(this, arguments);}_createClass(ye, [{ key: "signIn", value: function () {var _signIn = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee13() {var _this$_cache$keys7, e, t, n, s, r, _e15;return _regenerator.default.wrap(function _callee13$(_context13) {while (1) {switch (_context13.prev = _context13.next) {case 0:this._cache.updatePersistence("local");_this$_cache$keys7 = this._cache.keys;e = _this$_cache$keys7.anonymousUuidKey;t = _this$_cache$keys7.refreshTokenKey;n = this._cache.getStore(e) || void 0;s = this._cache.getStore(t) || void 0;_context13.next = 8;return this._request.send("auth.signInAnonymously", { anonymous_uuid: n, refresh_token: s });case 8:r = _context13.sent;if (!(r.uuid && r.refresh_token)) {_context13.next = 20;break;}this._setAnonymousUUID(r.uuid);this.setRefreshToken(r.refresh_token);_context13.next = 14;return this._request.refreshAccessToken();case 14:Z(te);Z(se, { env: this.config.env, loginType: ie.ANONYMOUS, persistence: "local" });_e15 = new me(this.config.env);_context13.next = 19;return _e15.user.refresh();case 19:return _context13.abrupt("return", _e15);case 20:throw new Error("匿名登录失败");case 21:case "end":return _context13.stop();}}}, _callee13, this);}));function signIn() {return _signIn.apply(this, arguments);}return signIn;}() }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {var _this$_cache$keys8, t, n, s, r, o;return _regenerator.default.wrap(function _callee14$(_context14) {while (1) {switch (_context14.prev = _context14.next) {case 0:_this$_cache$keys8 = this._cache.keys;t = _this$_cache$keys8.anonymousUuidKey;n = _this$_cache$keys8.refreshTokenKey;s = this._cache.getStore(t);r = this._cache.getStore(n);_context14.next = 7;return this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s, refresh_token: r, ticket: e });case 7:o = _context14.sent;if (!o.refresh_token) {_context14.next = 16;break;}this._clearAnonymousUUID();this.setRefreshToken(o.refresh_token);_context14.next = 13;return this._request.refreshAccessToken();case 13:Z(re, { env: this.config.env });Z(se, { loginType: ie.CUSTOM, persistence: "local" });return _context14.abrupt("return", { credential: { refreshToken: o.refresh_token } });case 16:throw new Error("匿名转化失败");case 17:case "end":return _context14.stop();}}}, _callee14, this);}));function linkAndRetrieveDataWithTicket(_x9) {return _linkAndRetrieveDataWithTicket.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "_setAnonymousUUID", value: function _setAnonymousUUID(e) {var _this$_cache$keys9 = this._cache.keys,t = _this$_cache$keys9.anonymousUuidKey,n = _this$_cache$keys9.loginTypeKey;this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, ie.ANONYMOUS);} }, { key: "_clearAnonymousUUID", value: function _clearAnonymousUUID() {this._cache.removeStore(this._cache.keys.anonymousUuidKey);} }]);return ye;}(pe);var _e = /*#__PURE__*/function (_pe2) {_inherits(_e, _pe2);var _super6 = _createSuper(_e);function _e() {_classCallCheck(this, _e);return _super6.apply(this, arguments);}_createClass(_e, [{ key: "signIn", value: function () {var _signIn2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee15(e) {var t, n;return _regenerator.default.wrap(function _callee15$(_context15) {while (1) {switch (_context15.prev = _context15.next) {case 0:if (!("string" != typeof e)) {_context15.next = 2;break;}throw new Error("ticket must be a string");case 2:t = this._cache.keys.refreshTokenKey;_context15.next = 5;return this._request.send("auth.signInWithTicket", { ticket: e, refresh_token: this._cache.getStore(t) || "" });case 5:n = _context15.sent;if (!n.refresh_token) {_context15.next = 15;break;}this.setRefreshToken(n.refresh_token);_context15.next = 10;return this._request.refreshAccessToken();case 10:Z(te);Z(se, { env: this.config.env, loginType: ie.CUSTOM, persistence: this.config.persistence });_context15.next = 14;return this.refreshUserInfo();case 14:return _context15.abrupt("return", new me(this.config.env));case 15:throw new Error("自定义登录失败");case 16:case "end":return _context15.stop();}}}, _callee15, this);}));function signIn(_x10) {return _signIn2.apply(this, arguments);}return signIn;}() }]);return _e;}(pe);var we = /*#__PURE__*/function (_pe3) {_inherits(we, _pe3);var _super7 = _createSuper(we);function we() {_classCallCheck(this, we);return _super7.apply(this, arguments);}_createClass(we, [{ key: "signIn", value: function () {var _signIn3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee16(e, t) {var n, s, r, o, i;return _regenerator.default.wrap(function _callee16$(_context16) {while (1) {switch (_context16.prev = _context16.next) {case 0:if (!("string" != typeof e)) {_context16.next = 2;break;}throw new Error("email must be a string");case 2:n = this._cache.keys.refreshTokenKey;_context16.next = 5;return this._request.send("auth.signIn", { loginType: "EMAIL", email: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 5:s = _context16.sent;r = s.refresh_token;o = s.access_token;i = s.access_token_expire;if (!r) {_context16.next = 22;break;}this.setRefreshToken(r);if (!(o && i)) {_context16.next = 15;break;}this.setAccessToken(o, i);_context16.next = 17;break;case 15:_context16.next = 17;return this._request.refreshAccessToken();case 17:_context16.next = 19;return this.refreshUserInfo();case 19:Z(te);Z(se, { env: this.config.env, loginType: ie.EMAIL, persistence: this.config.persistence });return _context16.abrupt("return", new me(this.config.env));case 22:throw s.code ? new Error("\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: [".concat(s.code, "] ").concat(s.message)) : new Error("邮箱登录失败");case 23:case "end":return _context16.stop();}}}, _callee16, this);}));function signIn(_x11, _x12) {return _signIn3.apply(this, arguments);}return signIn;}() }, { key: "activate", value: function () {var _activate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {return _regenerator.default.wrap(function _callee17$(_context17) {while (1) {switch (_context17.prev = _context17.next) {case 0:return _context17.abrupt("return", this._request.send("auth.activateEndUserMail", { token: e }));case 1:case "end":return _context17.stop();}}}, _callee17, this);}));function activate(_x13) {return _activate.apply(this, arguments);}return activate;}() }, { key: "resetPasswordWithToken", value: function () {var _resetPasswordWithToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {return _regenerator.default.wrap(function _callee18$(_context18) {while (1) {switch (_context18.prev = _context18.next) {case 0:return _context18.abrupt("return", this._request.send("auth.resetPasswordWithToken", { token: e, newPassword: t }));case 1:case "end":return _context18.stop();}}}, _callee18, this);}));function resetPasswordWithToken(_x14, _x15) {return _resetPasswordWithToken.apply(this, arguments);}return resetPasswordWithToken;}() }]);return we;}(pe);var ke = /*#__PURE__*/function (_pe4) {_inherits(ke, _pe4);var _super8 = _createSuper(ke);function ke() {_classCallCheck(this, ke);return _super8.apply(this, arguments);}_createClass(ke, [{ key: "signIn", value: function () {var _signIn4 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {var n, s, r, o, i;return _regenerator.default.wrap(function _callee19$(_context19) {while (1) {switch (_context19.prev = _context19.next) {case 0:if (!("string" != typeof e)) {_context19.next = 2;break;}throw new Error("username must be a string");case 2:"string" != typeof t && (t = "", console.warn("password is empty"));n = this._cache.keys.refreshTokenKey;_context19.next = 6;return this._request.send("auth.signIn", { loginType: ie.USERNAME, username: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 6:s = _context19.sent;r = s.refresh_token;o = s.access_token_expire;i = s.access_token;if (!r) {_context19.next = 23;break;}this.setRefreshToken(r);if (!(i && o)) {_context19.next = 16;break;}this.setAccessToken(i, o);_context19.next = 18;break;case 16:_context19.next = 18;return this._request.refreshAccessToken();case 18:_context19.next = 20;return this.refreshUserInfo();case 20:Z(te);Z(se, { env: this.config.env, loginType: ie.USERNAME, persistence: this.config.persistence });return _context19.abrupt("return", new me(this.config.env));case 23:throw s.code ? new Error("\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: [".concat(s.code, "] ").concat(s.message)) : new Error("用户名密码登录失败");case 24:case "end":return _context19.stop();}}}, _callee19, this);}));function signIn(_x16, _x17) {return _signIn4.apply(this, arguments);}return signIn;}() }]);return ke;}(pe);var Se = /*#__PURE__*/function () {function Se(e) {_classCallCheck(this, Se);this.config = e, this._cache = J(e.env), this._request = fe(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Q(se, this._onLoginTypeChanged);}_createClass(Se, [{ key: "anonymousAuthProvider", value: function anonymousAuthProvider() {return new ye(this.config);} }, { key: "customAuthProvider", value: function customAuthProvider() {return new _e(this.config);} }, { key: "emailAuthProvider", value: function emailAuthProvider() {return new we(this.config);} }, { key: "usernameAuthProvider", value: function usernameAuthProvider() {return new ke(this.config);} }, { key: "signInAnonymously", value: function () {var _signInAnonymously = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee20() {return _regenerator.default.wrap(function _callee20$(_context20) {while (1) {switch (_context20.prev = _context20.next) {case 0:return _context20.abrupt("return", new ye(this.config).signIn());case 1:case "end":return _context20.stop();}}}, _callee20, this);}));function signInAnonymously() {return _signInAnonymously.apply(this, arguments);}return signInAnonymously;}() }, { key: "signInWithEmailAndPassword", value: function () {var _signInWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {return _regenerator.default.wrap(function _callee21$(_context21) {while (1) {switch (_context21.prev = _context21.next) {case 0:return _context21.abrupt("return", new we(this.config).signIn(e, t));case 1:case "end":return _context21.stop();}}}, _callee21, this);}));function signInWithEmailAndPassword(_x18, _x19) {return _signInWithEmailAndPassword.apply(this, arguments);}return signInWithEmailAndPassword;}() }, { key: "signInWithUsernameAndPassword", value: function signInWithUsernameAndPassword(e, t) {return new ke(this.config).signIn(e, t);} }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee22(e) {return _regenerator.default.wrap(function _callee22$(_context22) {while (1) {switch (_context22.prev = _context22.next) {case 0:this._anonymousAuthProvider || (this._anonymousAuthProvider = new ye(this.config)), Q(re, this._onAnonymousConverted);_context22.next = 3;return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);case 3:return _context22.abrupt("return", _context22.sent);case 4:case "end":return _context22.stop();}}}, _callee22, this);}));function linkAndRetrieveDataWithTicket(_x20) {return _linkAndRetrieveDataWithTicket2.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "signOut", value: function () {var _signOut = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee23() {var _this$_cache$keys10, e, t, n, s, r;return _regenerator.default.wrap(function _callee23$(_context23) {while (1) {switch (_context23.prev = _context23.next) {case 0:if (!(this.loginType === ie.ANONYMOUS)) {_context23.next = 2;break;}throw new Error("匿名用户不支持登出操作");case 2:_this$_cache$keys10 = this._cache.keys, e = _this$_cache$keys10.refreshTokenKey, t = _this$_cache$keys10.accessTokenKey, n = _this$_cache$keys10.accessTokenExpireKey, s = this._cache.getStore(e);if (s) {_context23.next = 5;break;}return _context23.abrupt("return");case 5:_context23.next = 7;return this._request.send("auth.logout", { refresh_token: s });case 7:r = _context23.sent;return _context23.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Z(te), Z(se, { env: this.config.env, loginType: ie.NULL, persistence: this.config.persistence }), r));case 9:case "end":return _context23.stop();}}}, _callee23, this);}));function signOut() {return _signOut.apply(this, arguments);}return signOut;}() }, { key: "signUpWithEmailAndPassword", value: function () {var _signUpWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {return _regenerator.default.wrap(function _callee24$(_context24) {while (1) {switch (_context24.prev = _context24.next) {case 0:return _context24.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", { email: e, password: t }));case 1:case "end":return _context24.stop();}}}, _callee24, this);}));function signUpWithEmailAndPassword(_x21, _x22) {return _signUpWithEmailAndPassword.apply(this, arguments);}return signUpWithEmailAndPassword;}() }, { key: "sendPasswordResetEmail", value: function () {var _sendPasswordResetEmail = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {return _regenerator.default.wrap(function _callee25$(_context25) {while (1) {switch (_context25.prev = _context25.next) {case 0:return _context25.abrupt("return", this._request.send("auth.sendPasswordResetEmail", { email: e }));case 1:case "end":return _context25.stop();}}}, _callee25, this);}));function sendPasswordResetEmail(_x23) {return _sendPasswordResetEmail.apply(this, arguments);}return sendPasswordResetEmail;}() }, { key: "onLoginStateChanged", value: function onLoginStateChanged(e) {var _this11 = this;Q(te, function () {var t = _this11.hasLoginState();e.call(_this11, t);});var t = this.hasLoginState();e.call(this, t);} }, { key: "onLoginStateExpired", value: function onLoginStateExpired(e) {Q(ne, e.bind(this));} }, { key: "onAccessTokenRefreshed", value: function onAccessTokenRefreshed(e) {Q(oe, e.bind(this));} }, { key: "onAnonymousConverted", value: function onAnonymousConverted(e) {Q(re, e.bind(this));} }, { key: "onLoginTypeChanged", value: function onLoginTypeChanged(e) {var _this12 = this;Q(se, function () {var t = _this12.hasLoginState();e.call(_this12, t);});} }, { key: "getAccessToken", value: function () {var _getAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee26() {return _regenerator.default.wrap(function _callee26$(_context26) {while (1) {switch (_context26.prev = _context26.next) {case 0:_context26.next = 2;return this._request.getAccessToken();case 2:_context26.t0 = _context26.sent.accessToken;_context26.t1 = this.config.env;return _context26.abrupt("return", { accessToken: _context26.t0, env: _context26.t1 });case 5:case "end":return _context26.stop();}}}, _callee26, this);}));function getAccessToken() {return _getAccessToken2.apply(this, arguments);}return getAccessToken;}() }, { key: "hasLoginState", value: function hasLoginState() {var e = this._cache.keys.refreshTokenKey;return this._cache.getStore(e) ? new me(this.config.env) : null;} }, { key: "isUsernameRegistered", value: function () {var _isUsernameRegistered = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {var _yield$this$_request$5, t;return _regenerator.default.wrap(function _callee27$(_context27) {while (1) {switch (_context27.prev = _context27.next) {case 0:if (!("string" != typeof e)) {_context27.next = 2;break;}throw new Error("username must be a string");case 2:_context27.next = 4;return this._request.send("auth.isUsernameRegistered", { username: e });case 4:_yield$this$_request$5 = _context27.sent;t = _yield$this$_request$5.data;return _context27.abrupt("return", t && t.isRegistered);case 7:case "end":return _context27.stop();}}}, _callee27, this);}));function isUsernameRegistered(_x24) {return _isUsernameRegistered.apply(this, arguments);}return isUsernameRegistered;}() }, { key: "getLoginState", value: function getLoginState() {return Promise.resolve(this.hasLoginState());} }, { key: "signInWithTicket", value: function () {var _signInWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {return _regenerator.default.wrap(function _callee28$(_context28) {while (1) {switch (_context28.prev = _context28.next) {case 0:return _context28.abrupt("return", new _e(this.config).signIn(e));case 1:case "end":return _context28.stop();}}}, _callee28, this);}));function signInWithTicket(_x25) {return _signInWithTicket.apply(this, arguments);}return signInWithTicket;}() }, { key: "shouldRefreshAccessToken", value: function shouldRefreshAccessToken(e) {this._request._shouldRefreshAccessTokenHook = e.bind(this);} }, { key: "getUserInfo", value: function getUserInfo() {return this._request.send("auth.getUserInfo", {}).then(function (e) {return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, { requestId: e.seqId });});} }, { key: "getAuthHeader", value: function getAuthHeader() {var _this$_cache$keys11 = this._cache.keys,e = _this$_cache$keys11.refreshTokenKey,t = _this$_cache$keys11.accessTokenKey,n = this._cache.getStore(e);return { "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n };} }, { key: "_onAnonymousConverted", value: function _onAnonymousConverted(e) {var t = e.data.env;t === this.config.env && this._cache.updatePersistence(this.config.persistence);} }, { key: "_onLoginTypeChanged", value: function _onLoginTypeChanged(e) {var _e$data = e.data,t = _e$data.loginType,n = _e$data.persistence,s = _e$data.env;s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));} }, { key: "currentUser", get: function get() {var e = this.hasLoginState();return e && e.user || null;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return Se;}();var ve = function ve(e, t) {t = t || F();var n = fe(this.config.env),s = e.cloudPath,r = e.filePath,o = e.onUploadProgress,_e$fileType = e.fileType,i = _e$fileType === void 0 ? "image" : _e$fileType;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {var _e$data2 = e.data,a = _e$data2.url,c = _e$data2.authorization,u = _e$data2.token,h = _e$data2.fileId,l = _e$data2.cosFileId,d = e.requestId,f = { key: s, signature: c, "x-cos-meta-fileid": l, success_action_status: "201", "x-cos-security-token": u };n.upload({ url: a, data: f, file: r, name: s, fileType: i, onUploadProgress: o }).then(function (e) {201 === e.statusCode ? t(null, { fileID: h, requestId: d }) : t(new Error("STORAGE_REQUEST_FAIL: ".concat(e.data)));}).catch(function (e) {t(e);});}).catch(function (e) {t(e);}), t.promise;},Te = function Te(e, t) {t = t || F();var n = fe(this.config.env),s = e.cloudPath;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {t(null, e);}).catch(function (e) {t(e);}), t.promise;},Pe = function Pe(_ref5, t) {var e = _ref5.fileList;if (t = t || F(), !e || !Array.isArray(e)) return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };var _iterator3 = _createForOfIteratorHelper(e),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var _t6 = _step3.value;if (!_t6 || "string" != typeof _t6) return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };}} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}var n = { fileid_list: e };return fe(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.delete_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},Ae = function Ae(_ref6, t) {var e = _ref6.fileList;t = t || F(), e && Array.isArray(e) || t(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });var n = [];var _iterator4 = _createForOfIteratorHelper(e),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var _s6 = _step4.value;"object" == typeof _s6 ? (_s6.hasOwnProperty("fileID") && _s6.hasOwnProperty("maxAge") || t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n.push({ fileid: _s6.fileID, max_age: _s6.maxAge })) : "string" == typeof _s6 ? n.push({ fileid: _s6 }) : t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}var s = { file_list: n };return fe(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.download_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},Ie = /*#__PURE__*/function () {var _ref8 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee29(_ref7, t) {var e, n, s, r;return _regenerator.default.wrap(function _callee29$(_context29) {while (1) {switch (_context29.prev = _context29.next) {case 0:e = _ref7.fileID;_context29.next = 3;return Ae.call(this, { fileList: [{ fileID: e, maxAge: 600 }] });case 3:n = _context29.sent.fileList[0];if (!("SUCCESS" !== n.code)) {_context29.next = 6;break;}return _context29.abrupt("return", t ? t(n) : new Promise(function (e) {e(n);}));case 6:s = fe(this.config.env);r = n.download_url;if (!(r = encodeURI(r), !t)) {_context29.next = 10;break;}return _context29.abrupt("return", s.download({ url: r }));case 10:_context29.t0 = t;_context29.next = 13;return s.download({ url: r });case 13:_context29.t1 = _context29.sent;(0, _context29.t0)(_context29.t1);case 15:case "end":return _context29.stop();}}}, _callee29, this);}));return function Ie(_x26, _x27) {return _ref8.apply(this, arguments);};}(),Ee = function Ee(_ref9, o) {var e = _ref9.name,t = _ref9.data,n = _ref9.query,s = _ref9.parse,r = _ref9.search;var i = o || F();var a;try {a = t ? JSON.stringify(t) : "";} catch (e) {return Promise.reject(e);}if (!e) return Promise.reject(new Error("函数名不能为空"));var c = { inQuery: n, parse: s, search: r, function_name: e, request_data: a };return fe(this.config.env).send("functions.invokeFunction", c).then(function (e) {if (e.code) i(null, e);else {var _t7 = e.data.response_data;if (s) i(null, { result: _t7, requestId: e.requestId });else try {_t7 = JSON.parse(e.data.response_data), i(null, { result: _t7, requestId: e.requestId });} catch (e) {i(new Error("response data must be json"));}}return i.promise;}).catch(function (e) {i(e);}), i.promise;},be = { timeout: 15e3, persistence: "session" },Oe = {};var Ue = /*#__PURE__*/function () {function Ue(e) {_classCallCheck(this, Ue);this.config = e || this.config, this.authObj = void 0;}_createClass(Ue, [{ key: "init", value: function init(e) {switch (j.adapter || (this.requestClient = new j.adapter.reqClass({ timeout: e.timeout || 5e3, timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD") })), this.config = _objectSpread(_objectSpread({}, be), e), !0) {case this.config.timeout > 6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;break;case this.config.timeout < 100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;}return new Ue(this.config);} }, { key: "auth", value: function auth() {var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref10.persistence;if (this.authObj) return this.authObj;var t = e || j.adapter.primaryStorage || be.persistence;var n;return t !== this.config.persistence && (this.config.persistence = t), function (e) {var t = e.env;z[t] = new W(e), V[t] = new W(_objectSpread(_objectSpread({}, e), {}, { persistence: "local" }));}(this.config), n = this.config, de[n.env] = new le(n), this.authObj = new Se(this.config), this.authObj;} }, { key: "on", value: function on(e, t) {return Q.apply(this, [e, t]);} }, { key: "off", value: function off(e, t) {return ee.apply(this, [e, t]);} }, { key: "callFunction", value: function callFunction(e, t) {return Ee.apply(this, [e, t]);} }, { key: "deleteFile", value: function deleteFile(e, t) {return Pe.apply(this, [e, t]);} }, { key: "getTempFileURL", value: function getTempFileURL(e, t) {return Ae.apply(this, [e, t]);} }, { key: "downloadFile", value: function downloadFile(e, t) {return Ie.apply(this, [e, t]);} }, { key: "uploadFile", value: function uploadFile(e, t) {return ve.apply(this, [e, t]);} }, { key: "getUploadMetadata", value: function getUploadMetadata(e, t) {return Te.apply(this, [e, t]);} }, { key: "registerExtension", value: function registerExtension(e) {Oe[e.name] = e;} }, { key: "invokeExtension", value: function () {var _invokeExtension = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee30(e, t) {var n;return _regenerator.default.wrap(function _callee30$(_context30) {while (1) {switch (_context30.prev = _context30.next) {case 0:n = Oe[e];if (n) {_context30.next = 3;break;}throw Error("\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C"));case 3:_context30.next = 5;return n.invoke(t, this);case 5:return _context30.abrupt("return", _context30.sent);case 6:case "end":return _context30.stop();}}}, _callee30, this);}));function invokeExtension(_x28, _x29) {return _invokeExtension.apply(this, arguments);}return invokeExtension;}() }, { key: "useAdapters", value: function useAdapters(e) {var _ref11 = $(e) || {},t = _ref11.adapter,n = _ref11.runtime;t && (j.adapter = t), n && (j.runtime = n);} }]);return Ue;}();var Ce = new Ue();function xe(e, t, n) {void 0 === n && (n = {});var s = /\?/.test(t),r = "";for (var o in n) {"" === r ? !s && (t += "?") : r += "&", r += o + "=" + encodeURIComponent(n[o]);}return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;}var De = /*#__PURE__*/function () {function De() {_classCallCheck(this, De);}_createClass(De, [{ key: "post", value: function post(e) {var t = e.url,n = e.data,s = e.headers;return new Promise(function (e, r) {U.request({ url: xe("https:", t), data: n, method: "POST", header: s, success: function success(t) {e(t);}, fail: function fail(e) {r(e);} });});} }, { key: "upload", value: function upload(e) {return new Promise(function (t, n) {var s = e.url,r = e.file,o = e.data,i = e.headers,a = e.fileType,c = U.uploadFile({ url: xe("https:", s), name: "file", formData: Object.assign({}, o), filePath: r, fileType: a, header: i, success: function success(e) {var n = { statusCode: e.statusCode, data: e.data || {} };200 === e.statusCode && o.success_action_status && (n.statusCode = parseInt(o.success_action_status, 10)), t(n);}, fail: function fail(e) {u && "mp-alipay" === h && console.warn("支付宝小程序开发工具上传腾讯云时无法准确判断是否上传成功,请使用真机测试"), n(new Error(e.errMsg || "uploadFile:fail"));} });"function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {e.onUploadProgress({ loaded: t.totalBytesSent, total: t.totalBytesExpectedToSend });});});} }]);return De;}();var Re = { setItem: function setItem(e, t) {U.setStorageSync(e, t);}, getItem: function getItem(e) {return U.getStorageSync(e);}, removeItem: function removeItem(e) {U.removeStorageSync(e);}, clear: function clear() {U.clearStorageSync();} };var qe = { genAdapter: function genAdapter() {return { root: {}, reqClass: De, localStorage: Re, primaryStorage: "local" };}, isMatch: function isMatch() {return !0;}, runtime: "uni_app" };Ce.useAdapters(qe);var Fe = Ce,Le = Fe.init;function Ne() {return { token: U.getStorageSync("uni_id_token") || U.getStorageSync("uniIdToken"), tokenExpired: U.getStorageSync("uni_id_token_expired") };}function Me() {if (!u || "h5" !== h) return;uni.getStorageSync("__LAST_DCLOUD_APPID") !== p && (uni.setStorageSync("__LAST_DCLOUD_APPID", p), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), U.removeStorageSync("uni_id_token"), U.removeStorageSync("uniIdToken"), U.removeStorageSync("uni_id_token_expired"));}Fe.init = function (e) {e.env = e.spaceId;var t = Le.call(this, e);t.config.provider = "tencent", t.config.spaceId = e.spaceId;var n = t.auth;return t.auth = function (e) {var t = n.call(this, e);return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {t[e] = T(t[e]).bind(t);}), t;}, t.customAuth = t.auth, t;};var $e = /*#__PURE__*/function (_C) {_inherits($e, _C);var _super9 = _createSuper($e);function $e() {_classCallCheck(this, $e);return _super9.apply(this, arguments);}_createClass($e, [{ key: "getAccessToken", value: function getAccessToken() {var _this13 = this;return new Promise(function (e, t) {var n = "Anonymous_Access_token";_this13.setAccessToken(n), e(n);});} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };"auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = O.sign(n, this.config.clientSecret);var r = b(),o = r.APPID,i = r.PLATFORM,a = r.DEVICEID,c = r.CLIENT_SDK_VERSION;s["x-client-platform"] = i, s["x-client-appid"] = o, s["x-client-device-id"] = a, s["x-client-version"] = c;var _Ne = Ne(),u = _Ne.token;return s["x-client-token"] = u, { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: JSON.parse(JSON.stringify(s)) };} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref12) {var _this14 = this;var e = _ref12.url,t = _ref12.formData,n = _ref12.name,s = _ref12.filePath,r = _ref12.fileType,o = _ref12.onUploadProgress;return new Promise(function (i, a) {var c = _this14.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: r, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new P({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new P({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof o && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {o({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "uploadFile", value: function uploadFile(_ref13) {var _this15 = this;var e = _ref13.filePath,t = _ref13.cloudPath,_ref13$fileType = _ref13.fileType,n = _ref13$fileType === void 0 ? "image" : _ref13$fileType,s = _ref13.onUploadProgress;if (!t) throw new P({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });var r;return this.getOSSUploadOptionsFromPath({ cloudPath: t }).then(function (t) {var _t$result = t.result,o = _t$result.url,i = _t$result.formData,a = _t$result.name,c = _t$result.fileUrl;r = c;var u = { url: o, formData: i, name: a, filePath: e, fileType: n };return _this15.uploadFileToOSS(Object.assign({}, u, { onUploadProgress: s }));}).then(function () {return _this15.reportOSSUpload({ cloudPath: t });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: r }) : s(new P({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }]);return $e;}(C);var je = { init: function init(e) {var t = new $e(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} };var Ke;function Be(_ref14) {var e = _ref14.data;Ke || (Ke = b());var t = JSON.parse(JSON.stringify(e || {}));if (Object.assign(t, { clientInfo: Ke }), !t.uniIdToken) {var _Ne2 = Ne(),_e16 = _Ne2.token;_e16 && (t.uniIdToken = _e16);}return t;}function He(_ref15) {var _this16 = this;var e = _ref15.name,t = _ref15.data;var n = this.localAddress,s = this.localPort,r = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider],o = this.config.spaceId,i = "http://".concat(n, ":").concat(s, "/system/check-function"),a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);return new Promise(function (t, n) {U.request({ method: "POST", url: i, data: { name: e, platform: h, provider: r, spaceId: o }, timeout: 3e3, success: function success(e) {t(e);}, fail: function fail() {t({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });} });}).then(function () {var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref16.data;var _ref17 = e || {},t = _ref17.code,n = _ref17.message;return { code: 0 === t ? 0 : t || "SYS_ERR", message: n || "SYS_ERR" };}).then(function (_ref18) {var n = _ref18.code,s = _ref18.message;if (0 !== n) {switch (n) {case "MODULE_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "FUNCTION_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "ACTION_ENCRYPTED":console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case "NETWORK_ERROR":{var _e17 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";throw console.error(_e17), new Error(_e17);}case "SWITCH_TO_CLOUD":break;default:{var _e18 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");throw console.error(_e18), new Error(_e18);}}return _this16._originCallFunction({ name: e, data: t });}return new Promise(function (e, n) {var s = Be.call(_this16, { data: t });U.request({ method: "POST", url: a, data: { provider: r, platform: h, param: s }, success: function success() {var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},t = _ref19.statusCode,s = _ref19.data;return !t || t >= 400 ? n(new P({ code: s.code || "SYS_ERR", message: s.message || "request:fail" })) : e({ result: s });}, fail: function fail(e) {n(new P({ code: e.code || e.errCode || "SYS_ERR", message: e.message || e.errMsg || "request:fail" }));} });});});}var We = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];var ze = /[\\^$.*+?()[\]{}|]/g,Ve = RegExp(ze.source);function Je(e, t, n) {return e.replace(new RegExp((s = t) && Ve.test(s) ? s.replace(ze, "\\$&") : s, "g"), n);var s;}function Ye(_ref20) {var e = _ref20.functionName,t = _ref20.result,n = _ref20.logPvd;if (this.config.useDebugFunction && t && t.requestId) {var _s7 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e, requestId: t.requestId });console.log("[".concat(n, "-request]").concat(_s7, "[/").concat(n, "-request]"));}}function Xe(e) {var t = e.callFunction,n = function n(_n4) {var _this17 = this;var s = _n4.name;_n4.data = Be.call(e, { data: _n4.data });var r = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider];return t.call(this, _n4).then(function (e) {return Ye.call(_this17, { functionName: s, result: e, logPvd: r }), Promise.resolve(e);}, function (e) {return Ye.call(_this17, { functionName: s, result: e, logPvd: r }), e && e.message && (e.message = function () {var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref21$message = _ref21.message,e = _ref21$message === void 0 ? "" : _ref21$message,_ref21$extraInfo = _ref21.extraInfo,t = _ref21$extraInfo === void 0 ? {} : _ref21$extraInfo,_ref21$formatter = _ref21.formatter,n = _ref21$formatter === void 0 ? [] : _ref21$formatter;for (var _s8 = 0; _s8 < n.length; _s8++) {var _n$_s = n[_s8],_r3 = _n$_s.rule,_o2 = _n$_s.content,i = _n$_s.mode,_a = e.match(_r3);if (!_a) continue;var _c = _o2;for (var _e19 = 1; _e19 < _a.length; _e19++) {_c = Je(_c, "{$".concat(_e19, "}"), _a[_e19]);}for (var _e20 in t) {_c = Je(_c, "{".concat(_e20, "}"), t[_e20]);}switch (i) {case "replace":return _c;case "append":default:return e + _c;}}return e;}({ message: "[".concat(_n4.name, "]: ").concat(e.message), formatter: We, extraInfo: { functionName: s } })), Promise.reject(e);});};e.callFunction = function (t) {var s;return u && e.debugInfo && !e.debugInfo.forceRemote && d ? (e._originCallFunction || (e._originCallFunction = n), s = He.call(this, t)) : s = n.call(this, t), Object.defineProperty(s, "result", { get: function get() {return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};} }), s;};}var Ge = Symbol("CLIENT_DB_INTERNAL");function Qe(e, t) {return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Ge, e.__ob__ = void 0, new Proxy(e, { get: function get(e, n, s) {return n in e || "string" != typeof n ? e[n] : t.get(e, n, s);} });}function Ze(e) {switch (o(e)) {case "array":return e.map(function (e) {return Ze(e);});case "object":return e._internalType === Ge || Object.keys(e).forEach(function (t) {e[t] = Ze(e[t]);}), e;case "regexp":return { $regexp: { source: e.source, flags: e.flags } };case "date":return { $date: e.toISOString() };default:return e;}}function et(e) {e.database = function (t) {if (t && Object.keys(t).length > 0) return e.init(t).database();if (this._database) return this._database;var n = {};var s = {};function r(_ref22) {var t = _ref22.action,r = _ref22.command,o = _ref22.multiCommand;return S(v("database", "invoke")).then(function () {return e.callFunction({ name: "DCloud-clientDB", data: { action: t, command: r, multiCommand: o } });}).then(function (e) {var _e$result = e.result,t = _e$result.code,r = _e$result.message,o = _e$result.token,i = _e$result.tokenExpired,_e$result$systemInfo = _e$result.systemInfo,c = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;if (c) for (var _e21 = 0; _e21 < c.length; _e21++) {var _c$_e = c[_e21],_t8 = _c$_e.level,_n5 = _c$_e.message,_s9 = _c$_e.detail,_r4 = console["app-plus" === h && "warn" === _t8 ? "error" : _t8] || console.log;var _o3 = "[System Info]" + _n5;_s9 && (_o3 = "".concat(_o3, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s9)), _r4(_o3);}if (t) {var _e22 = new a(r, t);return s.error && s.error.forEach(function (t) {t(_e22);}), Promise.reject(_e22);}o && i && (!function () {var _ref23 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref23.token,t = _ref23.tokenExpired;e && U.setStorageSync("uni_id_token", e), t && U.setStorageSync("uni_id_token_expired", t);}({ token: o, tokenExpired: i }), n.refreshToken && n.refreshToken.forEach(function (e) {e({ token: o, tokenExpired: i });}), s.refreshToken && s.refreshToken.forEach(function (e) {e({ token: o, tokenExpired: i });}));var u = e.result.affectedDocs;return "number" == typeof u && Object.defineProperty(e.result, "affectedDocs", { get: function get() {return console.warn("affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"), u;} }), S(v("database", "success"), e).then(function () {return S(v("database", "complete"), e);}).then(function () {return Promise.resolve(e);});}, function (e) {var t = new a(e.message, e.code || "SYSTEM_ERROR");return s.error && s.error.forEach(function (e) {e(t);}), /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"), S(v("database", "fail"), e).then(function () {return S(v("database", "complete"), e);}).then(function () {return Promise.reject(e);});});}this.isDefault && (s = m("_globalUniCloudDatabaseCallback"));var o = /*#__PURE__*/function () {function o(e, t) {_classCallCheck(this, o);this.content = e, this.prevStage = t, this.udb = null;}_createClass(o, [{ key: "toJSON", value: function toJSON() {var e = this;var t = [e.content];for (; e.prevStage;) {e = e.prevStage, t.push(e.content);}return { $db: t.reverse().map(function (e) {return { $method: e.$method, $param: Ze(e.$param) };}) };} }, { key: "getAction", value: function getAction() {var e = this.toJSON().$db.find(function (e) {return "action" === e.$method;});return e && e.$param && e.$param[0];} }, { key: "getCommand", value: function getCommand() {return { $db: this.toJSON().$db.filter(function (e) {return "action" !== e.$method;}) };} }, { key: "get", value: function get() {return this._send("get", Array.from(arguments));} }, { key: "add", value: function add() {return this._send("add", Array.from(arguments));} }, { key: "remove", value: function remove() {return this._send("remove", Array.from(arguments));} }, { key: "update", value: function update() {return this._send("update", Array.from(arguments));} }, { key: "end", value: function end() {return this._send("end", Array.from(arguments));} }, { key: "set", value: function set() {throw new Error("clientDB禁止使用set方法");} }, { key: "_send", value: function _send(e, t) {var n = this.getAction(),s = this.getCommand();return s.$db.push({ $method: e, $param: Ze(t) }), r({ action: n, command: s });} }, { key: "useAggregate", get: function get() {var e = this,t = !1;for (; e.prevStage;) {e = e.prevStage;var _n6 = e.content.$method;if ("aggregate" === _n6 || "pipeline" === _n6) {t = !0;break;}}return t;} }, { key: "count", get: function get() {if (!this.useAggregate) return function () {return this._send("count", Array.from(arguments));};var e = this;return function () {return u({ $method: "count", $param: Ze(Array.from(arguments)) }, e);};} }, { key: "multiSend", get: function get() {} }]);return o;}();var i = ["db.Geo", "db.command", "command.aggregate"];function c(e, t) {return i.indexOf("".concat(e, ".").concat(t)) > -1;}function u(e, t) {return Qe(new o(e, t), { get: function get(e, t) {var n = "db";return e && e.content && (n = e.content.$method), c(n, t) ? u({ $method: t }, e) : function () {return u({ $method: t, $param: Ze(Array.from(arguments)) }, e);};} });}function l(_ref24) {var e = _ref24.path,t = _ref24.method;return /*#__PURE__*/function () {function _class2() {_classCallCheck(this, _class2);this.param = Array.from(arguments);}_createClass(_class2, [{ key: "toJSON", value: function toJSON() {return { $newDb: [].concat(_toConsumableArray(e.map(function (e) {return { $method: e };})), [{ $method: t, $param: this.param }]) };} }]);return _class2;}();}var d = { auth: { on: function on(e, t) {n[e] = n[e] || [], n[e].indexOf(t) > -1 || n[e].push(t);}, off: function off(e, t) {n[e] = n[e] || [];var s = n[e].indexOf(t);-1 !== s && n[e].splice(s, 1);} }, on: function on(e, t) {s[e] = s[e] || [], s[e].indexOf(t) > -1 || s[e].push(t);}, off: function off(e, t) {s[e] = s[e] || [];var n = s[e].indexOf(t);-1 !== n && s[e].splice(n, 1);}, env: Qe({}, { get: function get(e, t) {return { $env: t };} }), Geo: Qe({}, { get: function get(e, t) {return l({ path: ["Geo"], method: t });} }), getCloudEnv: function getCloudEnv(e) {if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");return { $env: e.replace("$cloudEnv_", "") };}, multiSend: function multiSend() {var e = Array.from(arguments);return r({ multiCommand: e.map(function (e) {var t = e.getAction(),n = e.getCommand();if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");return { action: t, command: n };}) }).then(function (t) {for (var _n7 = 0; _n7 < e.length; _n7++) {var _s10 = e[_n7];_s10.udb && "function" == typeof _s10.udb.setResult && _s10.udb.setResult(t.result.dataList[_n7]);}return Promise.resolve(t);}, function (t) {for (var _n8 = 0; _n8 < e.length; _n8++) {var _s11 = e[_n8];_s11.udb && "function" == typeof _s11.udb.setResult && _s11.udb.setResult(t);}return Promise.reject(t);});}, get serverDate() {return l({ path: [], method: "serverDate" });}, get RegExp() {return l({ path: [], method: "RegExp" });} },f = Qe(d, { get: function get(e, t) {return c("db", t) ? u({ $method: t }) : function () {return u({ $method: t, $param: Ze(Array.from(arguments)) });};} });return this._database = f, f;};}var tt;var nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",st = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function rt() {var e = Ne().token || "",t = e.split(".");if (!e || 3 !== t.length) return { uid: null, role: [], permission: [], tokenExpired: 0 };var n;try {n = JSON.parse((s = t[1], decodeURIComponent(tt(s).split("").map(function (e) {return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);}).join(""))));} catch (e) {throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);}var s;return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;}tt = "function" != typeof atob ? function (e) {if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !st.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e += "==".slice(2 - (3 & e.length));for (var n, s, r = "", o = 0; o < e.length;) {t = nt.indexOf(e.charAt(o++)) << 18 | nt.indexOf(e.charAt(o++)) << 12 | (n = nt.indexOf(e.charAt(o++))) << 6 | (s = nt.indexOf(e.charAt(o++))), r += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);}return r;} : atob;var ot = t(n(function (e, t) {Object.defineProperty(t, "__esModule", { value: !0 });var n = "chooseAndUploadFile:ok",s = "chooseAndUploadFile:fail";function r(e, t) {return e.tempFiles.forEach(function (e, n) {e.name || (e.name = e.path.substring(e.path.lastIndexOf("/") + 1)), t && (e.fileType = t), e.cloudPath = Date.now() + "_" + n + e.name.substring(e.name.lastIndexOf("."));}), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {return e.path;})), e;}function o(e, t, _ref25) {var s = _ref25.onChooseFile,r = _ref25.onUploadProgress;return t.then(function (e) {if (s) {var _t9 = s(e);if (void 0 !== _t9) return Promise.resolve(_t9).then(function (t) {return void 0 === t ? e : t;});}return e;}).then(function (t) {return !1 === t ? { errMsg: n, tempFilePaths: [], tempFiles: [] } : function (e, t) {var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;var r = arguments.length > 3 ? arguments[3] : undefined;(t = Object.assign({}, t)).errMsg = n;var o = t.tempFiles,i = o.length;var a = 0;return new Promise(function (n) {for (; a < s;) {c();}function c() {var s = a++;if (s >= i) return void (!o.find(function (e) {return !e.url && !e.errMsg;}) && n(t));var u = o[s];e.uploadFile({ filePath: u.path, cloudPath: u.cloudPath, fileType: u.fileType, onUploadProgress: function onUploadProgress(e) {e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);} }).then(function (e) {u.url = e.fileID, s < i && c();}).catch(function (e) {u.errMsg = e.errMsg || e.message, s < i && c();});}});}(e, t, 5, r);});}t.initChooseAndUploadFile = function (e) {return function () {var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { type: "all" };return "image" === t.type ? o(e, function (e) {var t = e.count,n = e.sizeType,_e$sourceType = e.sourceType,o = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,i = e.extension;return new Promise(function (e, a) {uni.chooseImage({ count: t, sizeType: n, sourceType: o, extension: i, success: function success(t) {e(r(t, "image"));}, fail: function fail(e) {a({ errMsg: e.errMsg.replace("chooseImage:fail", s) });} });});}(t), t) : "video" === t.type ? o(e, function (e) {var t = e.camera,n = e.compressed,o = e.maxDuration,_e$sourceType2 = e.sourceType,i = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,a = e.extension;return new Promise(function (e, c) {uni.chooseVideo({ camera: t, compressed: n, maxDuration: o, sourceType: i, extension: a, success: function success(t) {var n = t.tempFilePath,s = t.duration,o = t.size,i = t.height,a = t.width;e(r({ errMsg: "chooseVideo:ok", tempFilePaths: [n], tempFiles: [{ name: t.tempFile && t.tempFile.name || "", path: n, size: o, type: t.tempFile && t.tempFile.type || "", width: a, height: i, duration: s, fileType: "video", cloudPath: "" }] }, "video"));}, fail: function fail(e) {c({ errMsg: e.errMsg.replace("chooseVideo:fail", s) });} });});}(t), t) : o(e, function (e) {var t = e.count,n = e.extension;return new Promise(function (e, o) {var i = uni.chooseFile;if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (i = wx.chooseMessageFile), "function" != typeof i) return o({ errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });i({ type: "all", count: t, extension: n, success: function success(t) {e(r(t));}, fail: function fail(e) {o({ errMsg: e.errMsg.replace("chooseFile:fail", s) });} });});}(t), t);};};}));var it = "manual";function at(e) {return { props: { localdata: { type: Array, default: function _default() {return [];} }, options: { type: [Object, Array], default: function _default() {return {};} }, spaceInfo: { type: Object, default: function _default() {return {};} }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: !1 }, gettree: { type: [Boolean, String], default: !1 }, gettreepath: { type: [Boolean, String], default: !1 }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: !1 }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: !1 } }, data: function data() {return { mixinDatacomLoading: !1, mixinDatacomHasMore: !1, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {} };}, created: function created() {var _this18 = this;this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(function () {var e = [];return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {e.push(_this18[t]);}), e;}, function (e, t) {if (_this18.loadtime === it) return;var n = !1;var s = [];for (var _r5 = 2; _r5 < e.length; _r5++) {e[_r5] !== t[_r5] && (s.push(e[_r5]), n = !0);}e[0] !== t[0] && (_this18.mixinDatacomPage.current = _this18.pageCurrent), _this18.mixinDatacomPage.size = _this18.pageSize, _this18.onMixinDatacomPropsChange(n, s);});}, methods: { onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {}, mixinDatacomEasyGet: function mixinDatacomEasyGet() {var _this19 = this;var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref26$getone = _ref26.getone,e = _ref26$getone === void 0 ? !1 : _ref26$getone,t = _ref26.success,n = _ref26.fail;this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {_this19.mixinDatacomLoading = !1;var _n$result = n.result,s = _n$result.data,r = _n$result.count;_this19.getcount && (_this19.mixinDatacomPage.count = r), _this19.mixinDatacomHasMore = s.length < _this19.pageSize;var o = e ? s.length ? s[0] : void 0 : s;_this19.mixinDatacomResData = o, t && t(o);}).catch(function (e) {_this19.mixinDatacomLoading = !1, _this19.mixinDatacomErrorMessage = e, n && n(e);}));}, mixinDatacomGet: function mixinDatacomGet() {var _n9;var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var n = e.database(this.spaceInfo);var s = t.action || this.action;s && (n = n.action(s));var r = t.collection || this.collection;n = Array.isArray(r) ? (_n9 = n).collection.apply(_n9, _toConsumableArray(r)) : n.collection(r);var o = t.where || this.where;o && Object.keys(o).length && (n = n.where(o));var i = t.field || this.field;i && (n = n.field(i));var a = t.foreignKey || this.foreignKey;a && (n = n.foreignKey(a));var c = t.groupby || this.groupby;c && (n = n.groupBy(c));var u = t.groupField || this.groupField;u && (n = n.groupField(u));!0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());var h = t.orderby || this.orderby;h && (n = n.orderBy(h));var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,f = void 0 !== t.getcount ? t.getcount : this.getcount,p = void 0 !== t.gettree ? t.gettree : this.gettree,g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,m = { getCount: f },y = { limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel, startWith: void 0 !== t.startwith ? t.startwith : this.startwith };return p && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;} } };}function ct(_x30, _x31) {return _ct.apply(this, arguments);}function _ct() {_ct = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee32(e, t) {var n, _e27, s;return _regenerator.default.wrap(function _callee32$(_context32) {while (1) {switch (_context32.prev = _context32.next) {case 0:n = "http://".concat(e, ":").concat(t, "/system/ping");_context32.prev = 1;_context32.next = 4;return s = { url: n, timeout: 500 }, new Promise(function (e, t) {U.request(_objectSpread(_objectSpread({}, s), {}, { success: function success(t) {e(t);}, fail: function fail(e) {t(e);} }));});case 4:_e27 = _context32.sent;return _context32.abrupt("return", !(!_e27.data || 0 !== _e27.data.code));case 8:_context32.prev = 8;_context32.t0 = _context32["catch"](1);return _context32.abrupt("return", !1);case 11:case "end":return _context32.stop();}}}, _callee32, null, [[1, 8]]);}));return _ct.apply(this, arguments);}var ut = new ( /*#__PURE__*/function () {function _class3() {_classCallCheck(this, _class3);}_createClass(_class3, [{ key: "init", value: function init(e) {var t = {};var n = !1 !== e.debugFunction && u && ("h5" === h && navigator.userAgent.indexOf("HBuilderX") > 0 || "app-plus" === h);switch (e.provider) {case "tencent":t = Fe.init(Object.assign(e, { useDebugFunction: n }));break;case "aliyun":t = x.init(Object.assign(e, { useDebugFunction: n }));break;case "private":t = je.init(Object.assign(e, { useDebugFunction: n }));break;default:throw new Error("未提供正确的provider参数");}var s = l;u && s && !s.code && (t.debugInfo = s);var r = Promise.resolve();var o;o = 1, r = new Promise(function (e, t) {setTimeout(function () {e();}, o);}), t.isReady = !1, t.isDefault = !1;var i = t.auth();t.initUniCloud = r.then(function () {return i.getLoginState();}).then(function (e) {return e ? Promise.resolve() : i.signInAnonymously();}).then(function () {if (!u) return Promise.resolve();if (u && t.debugInfo) {var _t$debugInfo = t.debugInfo,_e23 = _t$debugInfo.address,_n10 = _t$debugInfo.servePort;return function () {var _ref27 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee31(e, t) {var n, _s12, _r6;return _regenerator.default.wrap(function _callee31$(_context31) {while (1) {switch (_context31.prev = _context31.next) {case 0:_s12 = 0;case 1:if (!(_s12 < e.length)) {_context31.next = 11;break;}_r6 = e[_s12];_context31.next = 5;return ct(_r6, t);case 5:if (!_context31.sent) {_context31.next = 8;break;}n = _r6;return _context31.abrupt("break", 11);case 8:_s12++;_context31.next = 1;break;case 11:return _context31.abrupt("return", { address: n, port: t });case 12:case "end":return _context31.stop();}}}, _callee31);}));return function (_x32, _x33) {return _ref27.apply(this, arguments);};}()(_e23, _n10);}}).then(function () {var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref28.address,n = _ref28.port;if (!u) return Promise.resolve();if (e) t.localAddress = e, t.localPort = n;else if (t.debugInfo) {var _e24 = console["app-plus" === h ? "error" : "warn"];var _n11 = "";"remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, _n11 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs") : _n11 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs", "h5" === h && (_n11 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), _e24(_n11);}}).then(function () {Me(), t.isReady = !0;}), Xe(t), function (e) {var t = e.uploadFile;e.uploadFile = function (e) {var _this20 = this;var n;return n = this.isReady ? Promise.resolve() : this.initUniCloud, n.then(function () {return t.call(_this20, e);});};}(t), et(t), function (e) {e.getCurrentUserInfo = rt, e.chooseAndUploadFile = ot.initChooseAndUploadFile(e), Object.assign(e, { get mixinDatacom() {return at(e);} });}(t);return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {t[e] && (t[e] = T(t[e], e));}), t.init = this.init, t;} }]);return _class3;}())();(function () {{var e = d;var t = {};if (1 === e.length) t = e[0], ut = ut.init(t), ut.isDefault = !0;else {var _t10 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo"];var _n12;_n12 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : f ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t10.forEach(function (e) {ut[e] = function () {return console.error(_n12), Promise.reject(new P({ code: "SYS_ERR", message: _n12 }));};});}Object.assign(ut, { get mixinDatacom() {return at(ut);} }), ut.addInterceptor = w, ut.removeInterceptor = k, u && "h5" === h && (window.uniCloud = ut);}})();var ht = ut;var _default2 = ht;exports.default = _default2;
  9441. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9442. /***/ }),
  9443. /***/ 83:
  9444. /*!**********************************************************!*\
  9445. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  9446. \**********************************************************/
  9447. /*! no static exports found */
  9448. /***/ (function(module, exports, __webpack_require__) {
  9449. module.exports = __webpack_require__(/*! regenerator-runtime */ 84);
  9450. /***/ }),
  9451. /***/ 84:
  9452. /*!************************************************************!*\
  9453. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  9454. \************************************************************/
  9455. /*! no static exports found */
  9456. /***/ (function(module, exports, __webpack_require__) {
  9457. /**
  9458. * Copyright (c) 2014-present, Facebook, Inc.
  9459. *
  9460. * This source code is licensed under the MIT license found in the
  9461. * LICENSE file in the root directory of this source tree.
  9462. */
  9463. // This method of obtaining a reference to the global object needs to be
  9464. // kept identical to the way it is obtained in runtime.js
  9465. var g = (function() {
  9466. return this || (typeof self === "object" && self);
  9467. })() || Function("return this")();
  9468. // Use `getOwnPropertyNames` because not all browsers support calling
  9469. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  9470. var hadRuntime = g.regeneratorRuntime &&
  9471. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  9472. // Save the old regeneratorRuntime in case it needs to be restored later.
  9473. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  9474. // Force reevalutation of runtime.js.
  9475. g.regeneratorRuntime = undefined;
  9476. module.exports = __webpack_require__(/*! ./runtime */ 85);
  9477. if (hadRuntime) {
  9478. // Restore the original runtime.
  9479. g.regeneratorRuntime = oldRuntime;
  9480. } else {
  9481. // Remove the global property added by runtime.js.
  9482. try {
  9483. delete g.regeneratorRuntime;
  9484. } catch(e) {
  9485. g.regeneratorRuntime = undefined;
  9486. }
  9487. }
  9488. /***/ }),
  9489. /***/ 85:
  9490. /*!*****************************************************!*\
  9491. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  9492. \*****************************************************/
  9493. /*! no static exports found */
  9494. /***/ (function(module, exports) {
  9495. /**
  9496. * Copyright (c) 2014-present, Facebook, Inc.
  9497. *
  9498. * This source code is licensed under the MIT license found in the
  9499. * LICENSE file in the root directory of this source tree.
  9500. */
  9501. !(function(global) {
  9502. "use strict";
  9503. var Op = Object.prototype;
  9504. var hasOwn = Op.hasOwnProperty;
  9505. var undefined; // More compressible than void 0.
  9506. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  9507. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  9508. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  9509. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9510. var inModule = typeof module === "object";
  9511. var runtime = global.regeneratorRuntime;
  9512. if (runtime) {
  9513. if (inModule) {
  9514. // If regeneratorRuntime is defined globally and we're in a module,
  9515. // make the exports object identical to regeneratorRuntime.
  9516. module.exports = runtime;
  9517. }
  9518. // Don't bother evaluating the rest of this file if the runtime was
  9519. // already defined globally.
  9520. return;
  9521. }
  9522. // Define the runtime globally (as expected by generated code) as either
  9523. // module.exports (if we're in a module) or a new, empty object.
  9524. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  9525. function wrap(innerFn, outerFn, self, tryLocsList) {
  9526. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9527. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9528. var generator = Object.create(protoGenerator.prototype);
  9529. var context = new Context(tryLocsList || []);
  9530. // The ._invoke method unifies the implementations of the .next,
  9531. // .throw, and .return methods.
  9532. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9533. return generator;
  9534. }
  9535. runtime.wrap = wrap;
  9536. // Try/catch helper to minimize deoptimizations. Returns a completion
  9537. // record like context.tryEntries[i].completion. This interface could
  9538. // have been (and was previously) designed to take a closure to be
  9539. // invoked without arguments, but in all the cases we care about we
  9540. // already have an existing method we want to call, so there's no need
  9541. // to create a new function object. We can even get away with assuming
  9542. // the method takes exactly one argument, since that happens to be true
  9543. // in every case, so we don't have to touch the arguments object. The
  9544. // only additional allocation required is the completion record, which
  9545. // has a stable shape and so hopefully should be cheap to allocate.
  9546. function tryCatch(fn, obj, arg) {
  9547. try {
  9548. return { type: "normal", arg: fn.call(obj, arg) };
  9549. } catch (err) {
  9550. return { type: "throw", arg: err };
  9551. }
  9552. }
  9553. var GenStateSuspendedStart = "suspendedStart";
  9554. var GenStateSuspendedYield = "suspendedYield";
  9555. var GenStateExecuting = "executing";
  9556. var GenStateCompleted = "completed";
  9557. // Returning this object from the innerFn has the same effect as
  9558. // breaking out of the dispatch switch statement.
  9559. var ContinueSentinel = {};
  9560. // Dummy constructor functions that we use as the .constructor and
  9561. // .constructor.prototype properties for functions that return Generator
  9562. // objects. For full spec compliance, you may wish to configure your
  9563. // minifier not to mangle the names of these two functions.
  9564. function Generator() {}
  9565. function GeneratorFunction() {}
  9566. function GeneratorFunctionPrototype() {}
  9567. // This is a polyfill for %IteratorPrototype% for environments that
  9568. // don't natively support it.
  9569. var IteratorPrototype = {};
  9570. IteratorPrototype[iteratorSymbol] = function () {
  9571. return this;
  9572. };
  9573. var getProto = Object.getPrototypeOf;
  9574. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9575. if (NativeIteratorPrototype &&
  9576. NativeIteratorPrototype !== Op &&
  9577. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9578. // This environment has a native %IteratorPrototype%; use it instead
  9579. // of the polyfill.
  9580. IteratorPrototype = NativeIteratorPrototype;
  9581. }
  9582. var Gp = GeneratorFunctionPrototype.prototype =
  9583. Generator.prototype = Object.create(IteratorPrototype);
  9584. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9585. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9586. GeneratorFunctionPrototype[toStringTagSymbol] =
  9587. GeneratorFunction.displayName = "GeneratorFunction";
  9588. // Helper for defining the .next, .throw, and .return methods of the
  9589. // Iterator interface in terms of a single ._invoke method.
  9590. function defineIteratorMethods(prototype) {
  9591. ["next", "throw", "return"].forEach(function(method) {
  9592. prototype[method] = function(arg) {
  9593. return this._invoke(method, arg);
  9594. };
  9595. });
  9596. }
  9597. runtime.isGeneratorFunction = function(genFun) {
  9598. var ctor = typeof genFun === "function" && genFun.constructor;
  9599. return ctor
  9600. ? ctor === GeneratorFunction ||
  9601. // For the native GeneratorFunction constructor, the best we can
  9602. // do is to check its .name property.
  9603. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9604. : false;
  9605. };
  9606. runtime.mark = function(genFun) {
  9607. if (Object.setPrototypeOf) {
  9608. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9609. } else {
  9610. genFun.__proto__ = GeneratorFunctionPrototype;
  9611. if (!(toStringTagSymbol in genFun)) {
  9612. genFun[toStringTagSymbol] = "GeneratorFunction";
  9613. }
  9614. }
  9615. genFun.prototype = Object.create(Gp);
  9616. return genFun;
  9617. };
  9618. // Within the body of any async function, `await x` is transformed to
  9619. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9620. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9621. // meant to be awaited.
  9622. runtime.awrap = function(arg) {
  9623. return { __await: arg };
  9624. };
  9625. function AsyncIterator(generator) {
  9626. function invoke(method, arg, resolve, reject) {
  9627. var record = tryCatch(generator[method], generator, arg);
  9628. if (record.type === "throw") {
  9629. reject(record.arg);
  9630. } else {
  9631. var result = record.arg;
  9632. var value = result.value;
  9633. if (value &&
  9634. typeof value === "object" &&
  9635. hasOwn.call(value, "__await")) {
  9636. return Promise.resolve(value.__await).then(function(value) {
  9637. invoke("next", value, resolve, reject);
  9638. }, function(err) {
  9639. invoke("throw", err, resolve, reject);
  9640. });
  9641. }
  9642. return Promise.resolve(value).then(function(unwrapped) {
  9643. // When a yielded Promise is resolved, its final value becomes
  9644. // the .value of the Promise<{value,done}> result for the
  9645. // current iteration.
  9646. result.value = unwrapped;
  9647. resolve(result);
  9648. }, function(error) {
  9649. // If a rejected Promise was yielded, throw the rejection back
  9650. // into the async generator function so it can be handled there.
  9651. return invoke("throw", error, resolve, reject);
  9652. });
  9653. }
  9654. }
  9655. var previousPromise;
  9656. function enqueue(method, arg) {
  9657. function callInvokeWithMethodAndArg() {
  9658. return new Promise(function(resolve, reject) {
  9659. invoke(method, arg, resolve, reject);
  9660. });
  9661. }
  9662. return previousPromise =
  9663. // If enqueue has been called before, then we want to wait until
  9664. // all previous Promises have been resolved before calling invoke,
  9665. // so that results are always delivered in the correct order. If
  9666. // enqueue has not been called before, then it is important to
  9667. // call invoke immediately, without waiting on a callback to fire,
  9668. // so that the async generator function has the opportunity to do
  9669. // any necessary setup in a predictable way. This predictability
  9670. // is why the Promise constructor synchronously invokes its
  9671. // executor callback, and why async functions synchronously
  9672. // execute code before the first await. Since we implement simple
  9673. // async functions in terms of async generators, it is especially
  9674. // important to get this right, even though it requires care.
  9675. previousPromise ? previousPromise.then(
  9676. callInvokeWithMethodAndArg,
  9677. // Avoid propagating failures to Promises returned by later
  9678. // invocations of the iterator.
  9679. callInvokeWithMethodAndArg
  9680. ) : callInvokeWithMethodAndArg();
  9681. }
  9682. // Define the unified helper method that is used to implement .next,
  9683. // .throw, and .return (see defineIteratorMethods).
  9684. this._invoke = enqueue;
  9685. }
  9686. defineIteratorMethods(AsyncIterator.prototype);
  9687. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9688. return this;
  9689. };
  9690. runtime.AsyncIterator = AsyncIterator;
  9691. // Note that simple async functions are implemented on top of
  9692. // AsyncIterator objects; they just return a Promise for the value of
  9693. // the final result produced by the iterator.
  9694. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9695. var iter = new AsyncIterator(
  9696. wrap(innerFn, outerFn, self, tryLocsList)
  9697. );
  9698. return runtime.isGeneratorFunction(outerFn)
  9699. ? iter // If outerFn is a generator, return the full iterator.
  9700. : iter.next().then(function(result) {
  9701. return result.done ? result.value : iter.next();
  9702. });
  9703. };
  9704. function makeInvokeMethod(innerFn, self, context) {
  9705. var state = GenStateSuspendedStart;
  9706. return function invoke(method, arg) {
  9707. if (state === GenStateExecuting) {
  9708. throw new Error("Generator is already running");
  9709. }
  9710. if (state === GenStateCompleted) {
  9711. if (method === "throw") {
  9712. throw arg;
  9713. }
  9714. // Be forgiving, per 25.3.3.3.3 of the spec:
  9715. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9716. return doneResult();
  9717. }
  9718. context.method = method;
  9719. context.arg = arg;
  9720. while (true) {
  9721. var delegate = context.delegate;
  9722. if (delegate) {
  9723. var delegateResult = maybeInvokeDelegate(delegate, context);
  9724. if (delegateResult) {
  9725. if (delegateResult === ContinueSentinel) continue;
  9726. return delegateResult;
  9727. }
  9728. }
  9729. if (context.method === "next") {
  9730. // Setting context._sent for legacy support of Babel's
  9731. // function.sent implementation.
  9732. context.sent = context._sent = context.arg;
  9733. } else if (context.method === "throw") {
  9734. if (state === GenStateSuspendedStart) {
  9735. state = GenStateCompleted;
  9736. throw context.arg;
  9737. }
  9738. context.dispatchException(context.arg);
  9739. } else if (context.method === "return") {
  9740. context.abrupt("return", context.arg);
  9741. }
  9742. state = GenStateExecuting;
  9743. var record = tryCatch(innerFn, self, context);
  9744. if (record.type === "normal") {
  9745. // If an exception is thrown from innerFn, we leave state ===
  9746. // GenStateExecuting and loop back for another invocation.
  9747. state = context.done
  9748. ? GenStateCompleted
  9749. : GenStateSuspendedYield;
  9750. if (record.arg === ContinueSentinel) {
  9751. continue;
  9752. }
  9753. return {
  9754. value: record.arg,
  9755. done: context.done
  9756. };
  9757. } else if (record.type === "throw") {
  9758. state = GenStateCompleted;
  9759. // Dispatch the exception by looping back around to the
  9760. // context.dispatchException(context.arg) call above.
  9761. context.method = "throw";
  9762. context.arg = record.arg;
  9763. }
  9764. }
  9765. };
  9766. }
  9767. // Call delegate.iterator[context.method](context.arg) and handle the
  9768. // result, either by returning a { value, done } result from the
  9769. // delegate iterator, or by modifying context.method and context.arg,
  9770. // setting context.delegate to null, and returning the ContinueSentinel.
  9771. function maybeInvokeDelegate(delegate, context) {
  9772. var method = delegate.iterator[context.method];
  9773. if (method === undefined) {
  9774. // A .throw or .return when the delegate iterator has no .throw
  9775. // method always terminates the yield* loop.
  9776. context.delegate = null;
  9777. if (context.method === "throw") {
  9778. if (delegate.iterator.return) {
  9779. // If the delegate iterator has a return method, give it a
  9780. // chance to clean up.
  9781. context.method = "return";
  9782. context.arg = undefined;
  9783. maybeInvokeDelegate(delegate, context);
  9784. if (context.method === "throw") {
  9785. // If maybeInvokeDelegate(context) changed context.method from
  9786. // "return" to "throw", let that override the TypeError below.
  9787. return ContinueSentinel;
  9788. }
  9789. }
  9790. context.method = "throw";
  9791. context.arg = new TypeError(
  9792. "The iterator does not provide a 'throw' method");
  9793. }
  9794. return ContinueSentinel;
  9795. }
  9796. var record = tryCatch(method, delegate.iterator, context.arg);
  9797. if (record.type === "throw") {
  9798. context.method = "throw";
  9799. context.arg = record.arg;
  9800. context.delegate = null;
  9801. return ContinueSentinel;
  9802. }
  9803. var info = record.arg;
  9804. if (! info) {
  9805. context.method = "throw";
  9806. context.arg = new TypeError("iterator result is not an object");
  9807. context.delegate = null;
  9808. return ContinueSentinel;
  9809. }
  9810. if (info.done) {
  9811. // Assign the result of the finished delegate to the temporary
  9812. // variable specified by delegate.resultName (see delegateYield).
  9813. context[delegate.resultName] = info.value;
  9814. // Resume execution at the desired location (see delegateYield).
  9815. context.next = delegate.nextLoc;
  9816. // If context.method was "throw" but the delegate handled the
  9817. // exception, let the outer generator proceed normally. If
  9818. // context.method was "next", forget context.arg since it has been
  9819. // "consumed" by the delegate iterator. If context.method was
  9820. // "return", allow the original .return call to continue in the
  9821. // outer generator.
  9822. if (context.method !== "return") {
  9823. context.method = "next";
  9824. context.arg = undefined;
  9825. }
  9826. } else {
  9827. // Re-yield the result returned by the delegate method.
  9828. return info;
  9829. }
  9830. // The delegate iterator is finished, so forget it and continue with
  9831. // the outer generator.
  9832. context.delegate = null;
  9833. return ContinueSentinel;
  9834. }
  9835. // Define Generator.prototype.{next,throw,return} in terms of the
  9836. // unified ._invoke helper method.
  9837. defineIteratorMethods(Gp);
  9838. Gp[toStringTagSymbol] = "Generator";
  9839. // A Generator should always return itself as the iterator object when the
  9840. // @@iterator function is called on it. Some browsers' implementations of the
  9841. // iterator prototype chain incorrectly implement this, causing the Generator
  9842. // object to not be returned from this call. This ensures that doesn't happen.
  9843. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9844. Gp[iteratorSymbol] = function() {
  9845. return this;
  9846. };
  9847. Gp.toString = function() {
  9848. return "[object Generator]";
  9849. };
  9850. function pushTryEntry(locs) {
  9851. var entry = { tryLoc: locs[0] };
  9852. if (1 in locs) {
  9853. entry.catchLoc = locs[1];
  9854. }
  9855. if (2 in locs) {
  9856. entry.finallyLoc = locs[2];
  9857. entry.afterLoc = locs[3];
  9858. }
  9859. this.tryEntries.push(entry);
  9860. }
  9861. function resetTryEntry(entry) {
  9862. var record = entry.completion || {};
  9863. record.type = "normal";
  9864. delete record.arg;
  9865. entry.completion = record;
  9866. }
  9867. function Context(tryLocsList) {
  9868. // The root entry object (effectively a try statement without a catch
  9869. // or a finally block) gives us a place to store values thrown from
  9870. // locations where there is no enclosing try statement.
  9871. this.tryEntries = [{ tryLoc: "root" }];
  9872. tryLocsList.forEach(pushTryEntry, this);
  9873. this.reset(true);
  9874. }
  9875. runtime.keys = function(object) {
  9876. var keys = [];
  9877. for (var key in object) {
  9878. keys.push(key);
  9879. }
  9880. keys.reverse();
  9881. // Rather than returning an object with a next method, we keep
  9882. // things simple and return the next function itself.
  9883. return function next() {
  9884. while (keys.length) {
  9885. var key = keys.pop();
  9886. if (key in object) {
  9887. next.value = key;
  9888. next.done = false;
  9889. return next;
  9890. }
  9891. }
  9892. // To avoid creating an additional object, we just hang the .value
  9893. // and .done properties off the next function object itself. This
  9894. // also ensures that the minifier will not anonymize the function.
  9895. next.done = true;
  9896. return next;
  9897. };
  9898. };
  9899. function values(iterable) {
  9900. if (iterable) {
  9901. var iteratorMethod = iterable[iteratorSymbol];
  9902. if (iteratorMethod) {
  9903. return iteratorMethod.call(iterable);
  9904. }
  9905. if (typeof iterable.next === "function") {
  9906. return iterable;
  9907. }
  9908. if (!isNaN(iterable.length)) {
  9909. var i = -1, next = function next() {
  9910. while (++i < iterable.length) {
  9911. if (hasOwn.call(iterable, i)) {
  9912. next.value = iterable[i];
  9913. next.done = false;
  9914. return next;
  9915. }
  9916. }
  9917. next.value = undefined;
  9918. next.done = true;
  9919. return next;
  9920. };
  9921. return next.next = next;
  9922. }
  9923. }
  9924. // Return an iterator with no values.
  9925. return { next: doneResult };
  9926. }
  9927. runtime.values = values;
  9928. function doneResult() {
  9929. return { value: undefined, done: true };
  9930. }
  9931. Context.prototype = {
  9932. constructor: Context,
  9933. reset: function(skipTempReset) {
  9934. this.prev = 0;
  9935. this.next = 0;
  9936. // Resetting context._sent for legacy support of Babel's
  9937. // function.sent implementation.
  9938. this.sent = this._sent = undefined;
  9939. this.done = false;
  9940. this.delegate = null;
  9941. this.method = "next";
  9942. this.arg = undefined;
  9943. this.tryEntries.forEach(resetTryEntry);
  9944. if (!skipTempReset) {
  9945. for (var name in this) {
  9946. // Not sure about the optimal order of these conditions:
  9947. if (name.charAt(0) === "t" &&
  9948. hasOwn.call(this, name) &&
  9949. !isNaN(+name.slice(1))) {
  9950. this[name] = undefined;
  9951. }
  9952. }
  9953. }
  9954. },
  9955. stop: function() {
  9956. this.done = true;
  9957. var rootEntry = this.tryEntries[0];
  9958. var rootRecord = rootEntry.completion;
  9959. if (rootRecord.type === "throw") {
  9960. throw rootRecord.arg;
  9961. }
  9962. return this.rval;
  9963. },
  9964. dispatchException: function(exception) {
  9965. if (this.done) {
  9966. throw exception;
  9967. }
  9968. var context = this;
  9969. function handle(loc, caught) {
  9970. record.type = "throw";
  9971. record.arg = exception;
  9972. context.next = loc;
  9973. if (caught) {
  9974. // If the dispatched exception was caught by a catch block,
  9975. // then let that catch block handle the exception normally.
  9976. context.method = "next";
  9977. context.arg = undefined;
  9978. }
  9979. return !! caught;
  9980. }
  9981. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9982. var entry = this.tryEntries[i];
  9983. var record = entry.completion;
  9984. if (entry.tryLoc === "root") {
  9985. // Exception thrown outside of any try block that could handle
  9986. // it, so set the completion value of the entire function to
  9987. // throw the exception.
  9988. return handle("end");
  9989. }
  9990. if (entry.tryLoc <= this.prev) {
  9991. var hasCatch = hasOwn.call(entry, "catchLoc");
  9992. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9993. if (hasCatch && hasFinally) {
  9994. if (this.prev < entry.catchLoc) {
  9995. return handle(entry.catchLoc, true);
  9996. } else if (this.prev < entry.finallyLoc) {
  9997. return handle(entry.finallyLoc);
  9998. }
  9999. } else if (hasCatch) {
  10000. if (this.prev < entry.catchLoc) {
  10001. return handle(entry.catchLoc, true);
  10002. }
  10003. } else if (hasFinally) {
  10004. if (this.prev < entry.finallyLoc) {
  10005. return handle(entry.finallyLoc);
  10006. }
  10007. } else {
  10008. throw new Error("try statement without catch or finally");
  10009. }
  10010. }
  10011. }
  10012. },
  10013. abrupt: function(type, arg) {
  10014. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10015. var entry = this.tryEntries[i];
  10016. if (entry.tryLoc <= this.prev &&
  10017. hasOwn.call(entry, "finallyLoc") &&
  10018. this.prev < entry.finallyLoc) {
  10019. var finallyEntry = entry;
  10020. break;
  10021. }
  10022. }
  10023. if (finallyEntry &&
  10024. (type === "break" ||
  10025. type === "continue") &&
  10026. finallyEntry.tryLoc <= arg &&
  10027. arg <= finallyEntry.finallyLoc) {
  10028. // Ignore the finally entry if control is not jumping to a
  10029. // location outside the try/catch block.
  10030. finallyEntry = null;
  10031. }
  10032. var record = finallyEntry ? finallyEntry.completion : {};
  10033. record.type = type;
  10034. record.arg = arg;
  10035. if (finallyEntry) {
  10036. this.method = "next";
  10037. this.next = finallyEntry.finallyLoc;
  10038. return ContinueSentinel;
  10039. }
  10040. return this.complete(record);
  10041. },
  10042. complete: function(record, afterLoc) {
  10043. if (record.type === "throw") {
  10044. throw record.arg;
  10045. }
  10046. if (record.type === "break" ||
  10047. record.type === "continue") {
  10048. this.next = record.arg;
  10049. } else if (record.type === "return") {
  10050. this.rval = this.arg = record.arg;
  10051. this.method = "return";
  10052. this.next = "end";
  10053. } else if (record.type === "normal" && afterLoc) {
  10054. this.next = afterLoc;
  10055. }
  10056. return ContinueSentinel;
  10057. },
  10058. finish: function(finallyLoc) {
  10059. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10060. var entry = this.tryEntries[i];
  10061. if (entry.finallyLoc === finallyLoc) {
  10062. this.complete(entry.completion, entry.afterLoc);
  10063. resetTryEntry(entry);
  10064. return ContinueSentinel;
  10065. }
  10066. }
  10067. },
  10068. "catch": function(tryLoc) {
  10069. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10070. var entry = this.tryEntries[i];
  10071. if (entry.tryLoc === tryLoc) {
  10072. var record = entry.completion;
  10073. if (record.type === "throw") {
  10074. var thrown = record.arg;
  10075. resetTryEntry(entry);
  10076. }
  10077. return thrown;
  10078. }
  10079. }
  10080. // The context.catch method must only be called with a location
  10081. // argument that corresponds to a known catch block.
  10082. throw new Error("illegal catch attempt");
  10083. },
  10084. delegateYield: function(iterable, resultName, nextLoc) {
  10085. this.delegate = {
  10086. iterator: values(iterable),
  10087. resultName: resultName,
  10088. nextLoc: nextLoc
  10089. };
  10090. if (this.method === "next") {
  10091. // Deliberately forget the last sent value so that we don't
  10092. // accidentally pass it on to the delegate.
  10093. this.arg = undefined;
  10094. }
  10095. return ContinueSentinel;
  10096. }
  10097. };
  10098. })(
  10099. // In sloppy mode, unbound `this` refers to the global object, fallback to
  10100. // Function constructor if we're in global strict mode. That is sadly a form
  10101. // of indirect eval which violates Content Security Policy.
  10102. (function() {
  10103. return this || (typeof self === "object" && self);
  10104. })() || Function("return this")()
  10105. );
  10106. /***/ }),
  10107. /***/ 86:
  10108. /*!**********************************************************************!*\
  10109. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"stat"} ***!
  10110. \**********************************************************************/
  10111. /*! no static exports found */
  10112. /***/ (function(module, exports, __webpack_require__) {
  10113. "use strict";
  10114. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__50B3EE1" };exports.default = _default;
  10115. /***/ }),
  10116. /***/ 87:
  10117. /*!****************************************************************************************************************************!*\
  10118. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  10119. \****************************************************************************************************************************/
  10120. /*! no static exports found */
  10121. /***/ (function(module, exports, __webpack_require__) {
  10122. "use strict";
  10123. /* WEBPACK VAR INJECTION */(function(uni, uniCloud) {Object.defineProperty(exports, "__esModule", { value: true });exports.chooseAndUploadFile = chooseAndUploadFile;exports.uploadCloudFiles = uploadCloudFiles;
  10124. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  10125. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  10126. function chooseImage(opts) {var
  10127. count =
  10128. opts.count,_opts$sizeType = opts.sizeType,sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,sourceType = opts.sourceType,extension = opts.extension;
  10129. return new Promise(function (resolve, reject) {
  10130. uni.chooseImage({
  10131. count: count,
  10132. sizeType: sizeType,
  10133. sourceType: sourceType,
  10134. extension: extension,
  10135. success: function success(res) {
  10136. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  10137. },
  10138. fail: function fail(res) {
  10139. reject({
  10140. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL) });
  10141. } });
  10142. });
  10143. }
  10144. function chooseVideo(opts) {var
  10145. camera =
  10146. opts.camera,compressed = opts.compressed,maxDuration = opts.maxDuration,sourceType = opts.sourceType,extension = opts.extension;
  10147. return new Promise(function (resolve, reject) {
  10148. uni.chooseVideo({
  10149. camera: camera,
  10150. compressed: compressed,
  10151. maxDuration: maxDuration,
  10152. sourceType: sourceType,
  10153. extension: extension,
  10154. success: function success(res) {var
  10155. tempFilePath =
  10156. res.tempFilePath,duration = res.duration,size = res.size,height = res.height,width = res.width;
  10157. resolve(normalizeChooseAndUploadFileRes({
  10158. errMsg: 'chooseVideo:ok',
  10159. tempFilePaths: [tempFilePath],
  10160. tempFiles: [
  10161. {
  10162. name: res.tempFile && res.tempFile.name || '',
  10163. path: tempFilePath,
  10164. size: size,
  10165. type: res.tempFile && res.tempFile.type || '',
  10166. width: width,
  10167. height: height,
  10168. duration: duration,
  10169. fileType: 'video',
  10170. cloudPath: '' }] },
  10171. 'video'));
  10172. },
  10173. fail: function fail(res) {
  10174. reject({
  10175. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL) });
  10176. } });
  10177. });
  10178. }
  10179. function chooseAll(opts) {var
  10180. count =
  10181. opts.count,extension = opts.extension;
  10182. return new Promise(function (resolve, reject) {
  10183. var chooseFile = uni.chooseFile;
  10184. if (typeof wx !== 'undefined' &&
  10185. typeof wx.chooseMessageFile === 'function') {
  10186. chooseFile = wx.chooseMessageFile;
  10187. }
  10188. if (typeof chooseFile !== 'function') {
  10189. return reject({
  10190. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。' });
  10191. }
  10192. chooseFile({
  10193. type: 'all',
  10194. count: count,
  10195. extension: extension,
  10196. success: function success(res) {
  10197. resolve(normalizeChooseAndUploadFileRes(res));
  10198. },
  10199. fail: function fail(res) {
  10200. reject({
  10201. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL) });
  10202. } });
  10203. });
  10204. }
  10205. function normalizeChooseAndUploadFileRes(res, fileType) {
  10206. res.tempFiles.forEach(function (item, index) {
  10207. if (!item.name) {
  10208. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  10209. }
  10210. if (fileType) {
  10211. item.fileType = fileType;
  10212. }
  10213. item.cloudPath =
  10214. Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  10215. });
  10216. if (!res.tempFilePaths) {
  10217. res.tempFilePaths = res.tempFiles.map(function (file) {return file.path;});
  10218. }
  10219. return res;
  10220. }
  10221. function uploadCloudFiles(files) {var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  10222. files = JSON.parse(JSON.stringify(files));
  10223. var len = files.length;
  10224. var count = 0;
  10225. var self = this;
  10226. return new Promise(function (resolve) {
  10227. while (count < max) {
  10228. next();
  10229. }
  10230. function next() {
  10231. var cur = count++;
  10232. if (cur >= len) {
  10233. !files.find(function (item) {return !item.url && !item.errMsg;}) && resolve(files);
  10234. return;
  10235. }
  10236. var fileItem = files[cur];
  10237. var index = self.files.findIndex(function (v) {return v.uuid === fileItem.uuid;});
  10238. fileItem.url = '';
  10239. delete fileItem.errMsg;
  10240. uniCloud.
  10241. uploadFile({
  10242. filePath: fileItem.path,
  10243. cloudPath: fileItem.cloudPath,
  10244. fileType: fileItem.fileType,
  10245. onUploadProgress: function onUploadProgress(res) {
  10246. res.index = index;
  10247. _onUploadProgress && _onUploadProgress(res);
  10248. } }).
  10249. then(function (res) {
  10250. fileItem.url = res.fileID;
  10251. fileItem.index = index;
  10252. if (cur < len) {
  10253. next();
  10254. }
  10255. }).
  10256. catch(function (res) {
  10257. fileItem.errMsg = res.errMsg || res.message;
  10258. fileItem.index = index;
  10259. if (cur < len) {
  10260. next();
  10261. }
  10262. });
  10263. }
  10264. });
  10265. }
  10266. function uploadFiles(choosePromise, _ref)
  10267. {var onChooseFile = _ref.onChooseFile,onUploadProgress = _ref.onUploadProgress;
  10268. return choosePromise.
  10269. then(function (res) {
  10270. if (onChooseFile) {
  10271. var customChooseRes = onChooseFile(res);
  10272. if (typeof customChooseRes !== 'undefined') {
  10273. return Promise.resolve(customChooseRes).then(function (chooseRes) {return typeof chooseRes === 'undefined' ?
  10274. res : chooseRes;});
  10275. }
  10276. }
  10277. return res;
  10278. }).
  10279. then(function (res) {
  10280. if (res === false) {
  10281. return {
  10282. errMsg: ERR_MSG_OK,
  10283. tempFilePaths: [],
  10284. tempFiles: [] };
  10285. }
  10286. return res;
  10287. });
  10288. }
  10289. function chooseAndUploadFile()
  10290. {var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { type: 'all' };
  10291. if (opts.type === 'image') {
  10292. return uploadFiles(chooseImage(opts), opts);
  10293. } else
  10294. if (opts.type === 'video') {
  10295. return uploadFiles(chooseVideo(opts), opts);
  10296. }
  10297. return uploadFiles(chooseAll(opts), opts);
  10298. }
  10299. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 82)["default"]))
  10300. /***/ }),
  10301. /***/ 88:
  10302. /*!***********************************************************************************************************!*\
  10303. !*** D:/000/bjybz1/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  10304. \***********************************************************************************************************/
  10305. /*! no static exports found */
  10306. /***/ (function(module, exports, __webpack_require__) {
  10307. "use strict";
  10308. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.get_file_data = exports.get_file_info = exports.get_files_and_is_max = exports.get_extname = exports.get_file_ext = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 83));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);});};} /**
  10309. * 获取文件名和后缀
  10310. * @param {String} name
  10311. */
  10312. var get_file_ext = function get_file_ext(name) {
  10313. var last_len = name.lastIndexOf('.');
  10314. var len = name.length;
  10315. return {
  10316. name: name.substring(0, last_len),
  10317. ext: name.substring(last_len + 1, len) };
  10318. };
  10319. /**
  10320. * 获取扩展名
  10321. * @param {Array} fileExtname
  10322. */exports.get_file_ext = get_file_ext;
  10323. var get_extname = function get_extname(fileExtname) {
  10324. if (!Array.isArray(fileExtname)) {
  10325. var extname = fileExtname.replace(/(\[|\])/g, '');
  10326. return extname.split(',');
  10327. } else {
  10328. return fileExtname;
  10329. }
  10330. return [];
  10331. };
  10332. /**
  10333. * 获取文件和检测是否可选
  10334. */exports.get_extname = get_extname;
  10335. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  10336. var filePaths = [];
  10337. var files = [];
  10338. if (!_extname || _extname.length === 0) {
  10339. return {
  10340. filePaths: filePaths,
  10341. files: files };
  10342. }
  10343. res.tempFiles.forEach(function (v) {
  10344. var fileFullName = get_file_ext(v.name);
  10345. var extname = fileFullName.ext.toLowerCase();
  10346. if (_extname.indexOf(extname) !== -1) {
  10347. files.push(v);
  10348. filePaths.push(v.path);
  10349. }
  10350. });
  10351. if (files.length !== res.tempFiles.length) {
  10352. uni.showToast({
  10353. title: "\u5F53\u524D\u9009\u62E9\u4E86".concat(res.tempFiles.length, "\u4E2A\u6587\u4EF6 \uFF0C").concat(res.tempFiles.length - files.length, " \u4E2A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E"),
  10354. icon: 'none',
  10355. duration: 5000 });
  10356. }
  10357. return {
  10358. filePaths: filePaths,
  10359. files: files };
  10360. };
  10361. /**
  10362. * 获取图片信息
  10363. * @param {Object} filepath
  10364. */exports.get_files_and_is_max = get_files_and_is_max;
  10365. var get_file_info = function get_file_info(filepath) {
  10366. return new Promise(function (resolve, reject) {
  10367. uni.getImageInfo({
  10368. src: filepath,
  10369. success: function success(res) {
  10370. resolve(res);
  10371. },
  10372. fail: function fail(err) {
  10373. reject(err);
  10374. } });
  10375. });
  10376. };
  10377. /**
  10378. * 获取封装数据
  10379. */exports.get_file_info = get_file_info;
  10380. var get_file_data = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {var type,fileFullName,extname,filedata,imageinfo,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  10381. // 最终需要上传数据库的数据
  10382. fileFullName = get_file_ext(files.name);
  10383. extname = fileFullName.ext.toLowerCase();
  10384. filedata = {
  10385. name: files.name,
  10386. uuid: files.uuid,
  10387. extname: extname || '',
  10388. cloudPath: files.cloudPath,
  10389. fileType: files.fileType,
  10390. url: files.path || files.path,
  10391. size: files.size, //单位是字节
  10392. image: {},
  10393. path: files.path,
  10394. video: {} };if (!(
  10395. type === 'image')) {_context.next = 14;break;}_context.next = 7;return (
  10396. get_file_info(files.path));case 7:imageinfo = _context.sent;
  10397. delete filedata.video;
  10398. filedata.image.width = imageinfo.width;
  10399. filedata.image.height = imageinfo.height;
  10400. filedata.image.location = imageinfo.path;_context.next = 15;break;case 14:
  10401. delete filedata.image;case 15:return _context.abrupt("return",
  10402. filedata);case 16:case "end":return _context.stop();}}}, _callee);}));return function get_file_data(_x) {return _ref.apply(this, arguments);};}();exports.get_file_data = get_file_data;
  10403. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10404. /***/ })
  10405. }]);
  10406. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map