vendor.js 626 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  15. return this;
  16. }();
  17. var key = ['w', 'x'].join('');
  18. var oldWx = target[key];
  19. function isWxKey(key) {
  20. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  21. }
  22. function initWx() {
  23. var newWx = {};
  24. for (var _key in oldWx) {
  25. if (isWxKey(_key)) {
  26. // TODO wrapper function
  27. newWx[_key] = oldWx[_key];
  28. }
  29. }
  30. return newWx;
  31. }
  32. target[key] = initWx();
  33. var _default = target[key];
  34. exports.default = _default;
  35. /***/ }),
  36. /***/ 10:
  37. /*!****************************************************************!*\
  38. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  39. \****************************************************************/
  40. /*! no static exports found */
  41. /***/ (function(module, exports) {
  42. function _nonIterableRest() {
  43. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  44. }
  45. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  46. /***/ }),
  47. /***/ 11:
  48. /*!***************************************************************!*\
  49. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  50. \***************************************************************/
  51. /*! no static exports found */
  52. /***/ (function(module, exports, __webpack_require__) {
  53. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  54. function _defineProperty(obj, key, value) {
  55. key = toPropertyKey(key);
  56. if (key in obj) {
  57. Object.defineProperty(obj, key, {
  58. value: value,
  59. enumerable: true,
  60. configurable: true,
  61. writable: true
  62. });
  63. } else {
  64. obj[key] = value;
  65. }
  66. return obj;
  67. }
  68. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  69. /***/ }),
  70. /***/ 12:
  71. /*!**************************************************************!*\
  72. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  73. \**************************************************************/
  74. /*! no static exports found */
  75. /***/ (function(module, exports, __webpack_require__) {
  76. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  77. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  78. function _toPropertyKey(arg) {
  79. var key = toPrimitive(arg, "string");
  80. return _typeof(key) === "symbol" ? key : String(key);
  81. }
  82. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  83. /***/ }),
  84. /***/ 13:
  85. /*!*******************************************************!*\
  86. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  87. \*******************************************************/
  88. /*! no static exports found */
  89. /***/ (function(module, exports) {
  90. function _typeof(obj) {
  91. "@babel/helpers - typeof";
  92. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  93. return typeof obj;
  94. } : function (obj) {
  95. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  96. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  97. }
  98. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  99. /***/ }),
  100. /***/ 14:
  101. /*!************************************************************!*\
  102. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  103. \************************************************************/
  104. /*! no static exports found */
  105. /***/ (function(module, exports, __webpack_require__) {
  106. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  107. function _toPrimitive(input, hint) {
  108. if (_typeof(input) !== "object" || input === null) return input;
  109. var prim = input[Symbol.toPrimitive];
  110. if (prim !== undefined) {
  111. var res = prim.call(input, hint || "default");
  112. if (_typeof(res) !== "object") return res;
  113. throw new TypeError("@@toPrimitive must return a primitive value.");
  114. }
  115. return (hint === "string" ? String : Number)(input);
  116. }
  117. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  118. /***/ }),
  119. /***/ 15:
  120. /*!**********************************************************!*\
  121. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  122. \**********************************************************/
  123. /*! no static exports found */
  124. /***/ (function(module, exports, __webpack_require__) {
  125. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  126. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  127. function _construct(Parent, args, Class) {
  128. if (isNativeReflectConstruct()) {
  129. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  130. } else {
  131. module.exports = _construct = function _construct(Parent, args, Class) {
  132. var a = [null];
  133. a.push.apply(a, args);
  134. var Constructor = Function.bind.apply(Parent, a);
  135. var instance = new Constructor();
  136. if (Class) setPrototypeOf(instance, Class.prototype);
  137. return instance;
  138. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  139. }
  140. return _construct.apply(null, arguments);
  141. }
  142. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  143. /***/ }),
  144. /***/ 153:
  145. /*!**********************************************************************************!*\
  146. !*** D:/project/项目模板/uniapp/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  147. \**********************************************************************************/
  148. /*! no static exports found */
  149. /***/ (function(module, exports, __webpack_require__) {
  150. "use strict";
  151. Object.defineProperty(exports, "__esModule", {
  152. value: true
  153. });
  154. exports.default = void 0;
  155. var _default = {
  156. "id": "2852637",
  157. "name": "uniui图标库",
  158. "font_family": "uniicons",
  159. "css_prefix_text": "uniui-",
  160. "description": "",
  161. "glyphs": [{
  162. "icon_id": "25027049",
  163. "name": "yanse",
  164. "font_class": "color",
  165. "unicode": "e6cf",
  166. "unicode_decimal": 59087
  167. }, {
  168. "icon_id": "25027048",
  169. "name": "wallet",
  170. "font_class": "wallet",
  171. "unicode": "e6b1",
  172. "unicode_decimal": 59057
  173. }, {
  174. "icon_id": "25015720",
  175. "name": "settings-filled",
  176. "font_class": "settings-filled",
  177. "unicode": "e6ce",
  178. "unicode_decimal": 59086
  179. }, {
  180. "icon_id": "25015434",
  181. "name": "shimingrenzheng-filled",
  182. "font_class": "auth-filled",
  183. "unicode": "e6cc",
  184. "unicode_decimal": 59084
  185. }, {
  186. "icon_id": "24934246",
  187. "name": "shop-filled",
  188. "font_class": "shop-filled",
  189. "unicode": "e6cd",
  190. "unicode_decimal": 59085
  191. }, {
  192. "icon_id": "24934159",
  193. "name": "staff-filled-01",
  194. "font_class": "staff-filled",
  195. "unicode": "e6cb",
  196. "unicode_decimal": 59083
  197. }, {
  198. "icon_id": "24932461",
  199. "name": "VIP-filled",
  200. "font_class": "vip-filled",
  201. "unicode": "e6c6",
  202. "unicode_decimal": 59078
  203. }, {
  204. "icon_id": "24932462",
  205. "name": "plus_circle_fill",
  206. "font_class": "plus-filled",
  207. "unicode": "e6c7",
  208. "unicode_decimal": 59079
  209. }, {
  210. "icon_id": "24932463",
  211. "name": "folder_add-filled",
  212. "font_class": "folder-add-filled",
  213. "unicode": "e6c8",
  214. "unicode_decimal": 59080
  215. }, {
  216. "icon_id": "24932464",
  217. "name": "yanse-filled",
  218. "font_class": "color-filled",
  219. "unicode": "e6c9",
  220. "unicode_decimal": 59081
  221. }, {
  222. "icon_id": "24932465",
  223. "name": "tune-filled",
  224. "font_class": "tune-filled",
  225. "unicode": "e6ca",
  226. "unicode_decimal": 59082
  227. }, {
  228. "icon_id": "24932455",
  229. "name": "a-rilidaka-filled",
  230. "font_class": "calendar-filled",
  231. "unicode": "e6c0",
  232. "unicode_decimal": 59072
  233. }, {
  234. "icon_id": "24932456",
  235. "name": "notification-filled",
  236. "font_class": "notification-filled",
  237. "unicode": "e6c1",
  238. "unicode_decimal": 59073
  239. }, {
  240. "icon_id": "24932457",
  241. "name": "wallet-filled",
  242. "font_class": "wallet-filled",
  243. "unicode": "e6c2",
  244. "unicode_decimal": 59074
  245. }, {
  246. "icon_id": "24932458",
  247. "name": "paihangbang-filled",
  248. "font_class": "medal-filled",
  249. "unicode": "e6c3",
  250. "unicode_decimal": 59075
  251. }, {
  252. "icon_id": "24932459",
  253. "name": "gift-filled",
  254. "font_class": "gift-filled",
  255. "unicode": "e6c4",
  256. "unicode_decimal": 59076
  257. }, {
  258. "icon_id": "24932460",
  259. "name": "fire-filled",
  260. "font_class": "fire-filled",
  261. "unicode": "e6c5",
  262. "unicode_decimal": 59077
  263. }, {
  264. "icon_id": "24928001",
  265. "name": "refreshempty",
  266. "font_class": "refreshempty",
  267. "unicode": "e6bf",
  268. "unicode_decimal": 59071
  269. }, {
  270. "icon_id": "24926853",
  271. "name": "location-ellipse",
  272. "font_class": "location-filled",
  273. "unicode": "e6af",
  274. "unicode_decimal": 59055
  275. }, {
  276. "icon_id": "24926735",
  277. "name": "person-filled",
  278. "font_class": "person-filled",
  279. "unicode": "e69d",
  280. "unicode_decimal": 59037
  281. }, {
  282. "icon_id": "24926703",
  283. "name": "personadd-filled",
  284. "font_class": "personadd-filled",
  285. "unicode": "e698",
  286. "unicode_decimal": 59032
  287. }, {
  288. "icon_id": "24923351",
  289. "name": "back",
  290. "font_class": "back",
  291. "unicode": "e6b9",
  292. "unicode_decimal": 59065
  293. }, {
  294. "icon_id": "24923352",
  295. "name": "forward",
  296. "font_class": "forward",
  297. "unicode": "e6ba",
  298. "unicode_decimal": 59066
  299. }, {
  300. "icon_id": "24923353",
  301. "name": "arrowthinright",
  302. "font_class": "arrow-right",
  303. "unicode": "e6bb",
  304. "unicode_decimal": 59067
  305. }, {
  306. "icon_id": "24923353",
  307. "name": "arrowthinright",
  308. "font_class": "arrowthinright",
  309. "unicode": "e6bb",
  310. "unicode_decimal": 59067
  311. }, {
  312. "icon_id": "24923354",
  313. "name": "arrowthinleft",
  314. "font_class": "arrow-left",
  315. "unicode": "e6bc",
  316. "unicode_decimal": 59068
  317. }, {
  318. "icon_id": "24923354",
  319. "name": "arrowthinleft",
  320. "font_class": "arrowthinleft",
  321. "unicode": "e6bc",
  322. "unicode_decimal": 59068
  323. }, {
  324. "icon_id": "24923355",
  325. "name": "arrowthinup",
  326. "font_class": "arrow-up",
  327. "unicode": "e6bd",
  328. "unicode_decimal": 59069
  329. }, {
  330. "icon_id": "24923355",
  331. "name": "arrowthinup",
  332. "font_class": "arrowthinup",
  333. "unicode": "e6bd",
  334. "unicode_decimal": 59069
  335. }, {
  336. "icon_id": "24923356",
  337. "name": "arrowthindown",
  338. "font_class": "arrow-down",
  339. "unicode": "e6be",
  340. "unicode_decimal": 59070
  341. }, {
  342. "icon_id": "24923356",
  343. "name": "arrowthindown",
  344. "font_class": "arrowthindown",
  345. "unicode": "e6be",
  346. "unicode_decimal": 59070
  347. }, {
  348. "icon_id": "24923349",
  349. "name": "arrowdown",
  350. "font_class": "bottom",
  351. "unicode": "e6b8",
  352. "unicode_decimal": 59064
  353. }, {
  354. "icon_id": "24923349",
  355. "name": "arrowdown",
  356. "font_class": "arrowdown",
  357. "unicode": "e6b8",
  358. "unicode_decimal": 59064
  359. }, {
  360. "icon_id": "24923346",
  361. "name": "arrowright",
  362. "font_class": "right",
  363. "unicode": "e6b5",
  364. "unicode_decimal": 59061
  365. }, {
  366. "icon_id": "24923346",
  367. "name": "arrowright",
  368. "font_class": "arrowright",
  369. "unicode": "e6b5",
  370. "unicode_decimal": 59061
  371. }, {
  372. "icon_id": "24923347",
  373. "name": "arrowup",
  374. "font_class": "top",
  375. "unicode": "e6b6",
  376. "unicode_decimal": 59062
  377. }, {
  378. "icon_id": "24923347",
  379. "name": "arrowup",
  380. "font_class": "arrowup",
  381. "unicode": "e6b6",
  382. "unicode_decimal": 59062
  383. }, {
  384. "icon_id": "24923348",
  385. "name": "arrowleft",
  386. "font_class": "left",
  387. "unicode": "e6b7",
  388. "unicode_decimal": 59063
  389. }, {
  390. "icon_id": "24923348",
  391. "name": "arrowleft",
  392. "font_class": "arrowleft",
  393. "unicode": "e6b7",
  394. "unicode_decimal": 59063
  395. }, {
  396. "icon_id": "24923334",
  397. "name": "eye",
  398. "font_class": "eye",
  399. "unicode": "e651",
  400. "unicode_decimal": 58961
  401. }, {
  402. "icon_id": "24923335",
  403. "name": "eye-filled",
  404. "font_class": "eye-filled",
  405. "unicode": "e66a",
  406. "unicode_decimal": 58986
  407. }, {
  408. "icon_id": "24923336",
  409. "name": "eye-slash",
  410. "font_class": "eye-slash",
  411. "unicode": "e6b3",
  412. "unicode_decimal": 59059
  413. }, {
  414. "icon_id": "24923337",
  415. "name": "eye-slash-filled",
  416. "font_class": "eye-slash-filled",
  417. "unicode": "e6b4",
  418. "unicode_decimal": 59060
  419. }, {
  420. "icon_id": "24923305",
  421. "name": "info-filled",
  422. "font_class": "info-filled",
  423. "unicode": "e649",
  424. "unicode_decimal": 58953
  425. }, {
  426. "icon_id": "24923299",
  427. "name": "reload-01",
  428. "font_class": "reload",
  429. "unicode": "e6b2",
  430. "unicode_decimal": 59058
  431. }, {
  432. "icon_id": "24923195",
  433. "name": "mic_slash_fill",
  434. "font_class": "micoff-filled",
  435. "unicode": "e6b0",
  436. "unicode_decimal": 59056
  437. }, {
  438. "icon_id": "24923165",
  439. "name": "map-pin-ellipse",
  440. "font_class": "map-pin-ellipse",
  441. "unicode": "e6ac",
  442. "unicode_decimal": 59052
  443. }, {
  444. "icon_id": "24923166",
  445. "name": "map-pin",
  446. "font_class": "map-pin",
  447. "unicode": "e6ad",
  448. "unicode_decimal": 59053
  449. }, {
  450. "icon_id": "24923167",
  451. "name": "location",
  452. "font_class": "location",
  453. "unicode": "e6ae",
  454. "unicode_decimal": 59054
  455. }, {
  456. "icon_id": "24923064",
  457. "name": "starhalf",
  458. "font_class": "starhalf",
  459. "unicode": "e683",
  460. "unicode_decimal": 59011
  461. }, {
  462. "icon_id": "24923065",
  463. "name": "star",
  464. "font_class": "star",
  465. "unicode": "e688",
  466. "unicode_decimal": 59016
  467. }, {
  468. "icon_id": "24923066",
  469. "name": "star-filled",
  470. "font_class": "star-filled",
  471. "unicode": "e68f",
  472. "unicode_decimal": 59023
  473. }, {
  474. "icon_id": "24899646",
  475. "name": "a-rilidaka",
  476. "font_class": "calendar",
  477. "unicode": "e6a0",
  478. "unicode_decimal": 59040
  479. }, {
  480. "icon_id": "24899647",
  481. "name": "fire",
  482. "font_class": "fire",
  483. "unicode": "e6a1",
  484. "unicode_decimal": 59041
  485. }, {
  486. "icon_id": "24899648",
  487. "name": "paihangbang",
  488. "font_class": "medal",
  489. "unicode": "e6a2",
  490. "unicode_decimal": 59042
  491. }, {
  492. "icon_id": "24899649",
  493. "name": "font",
  494. "font_class": "font",
  495. "unicode": "e6a3",
  496. "unicode_decimal": 59043
  497. }, {
  498. "icon_id": "24899650",
  499. "name": "gift",
  500. "font_class": "gift",
  501. "unicode": "e6a4",
  502. "unicode_decimal": 59044
  503. }, {
  504. "icon_id": "24899651",
  505. "name": "link",
  506. "font_class": "link",
  507. "unicode": "e6a5",
  508. "unicode_decimal": 59045
  509. }, {
  510. "icon_id": "24899652",
  511. "name": "notification",
  512. "font_class": "notification",
  513. "unicode": "e6a6",
  514. "unicode_decimal": 59046
  515. }, {
  516. "icon_id": "24899653",
  517. "name": "staff",
  518. "font_class": "staff",
  519. "unicode": "e6a7",
  520. "unicode_decimal": 59047
  521. }, {
  522. "icon_id": "24899654",
  523. "name": "VIP",
  524. "font_class": "vip",
  525. "unicode": "e6a8",
  526. "unicode_decimal": 59048
  527. }, {
  528. "icon_id": "24899655",
  529. "name": "folder_add",
  530. "font_class": "folder-add",
  531. "unicode": "e6a9",
  532. "unicode_decimal": 59049
  533. }, {
  534. "icon_id": "24899656",
  535. "name": "tune",
  536. "font_class": "tune",
  537. "unicode": "e6aa",
  538. "unicode_decimal": 59050
  539. }, {
  540. "icon_id": "24899657",
  541. "name": "shimingrenzheng",
  542. "font_class": "auth",
  543. "unicode": "e6ab",
  544. "unicode_decimal": 59051
  545. }, {
  546. "icon_id": "24899565",
  547. "name": "person",
  548. "font_class": "person",
  549. "unicode": "e699",
  550. "unicode_decimal": 59033
  551. }, {
  552. "icon_id": "24899566",
  553. "name": "email-filled",
  554. "font_class": "email-filled",
  555. "unicode": "e69a",
  556. "unicode_decimal": 59034
  557. }, {
  558. "icon_id": "24899567",
  559. "name": "phone-filled",
  560. "font_class": "phone-filled",
  561. "unicode": "e69b",
  562. "unicode_decimal": 59035
  563. }, {
  564. "icon_id": "24899568",
  565. "name": "phone",
  566. "font_class": "phone",
  567. "unicode": "e69c",
  568. "unicode_decimal": 59036
  569. }, {
  570. "icon_id": "24899570",
  571. "name": "email",
  572. "font_class": "email",
  573. "unicode": "e69e",
  574. "unicode_decimal": 59038
  575. }, {
  576. "icon_id": "24899571",
  577. "name": "personadd",
  578. "font_class": "personadd",
  579. "unicode": "e69f",
  580. "unicode_decimal": 59039
  581. }, {
  582. "icon_id": "24899558",
  583. "name": "chatboxes-filled",
  584. "font_class": "chatboxes-filled",
  585. "unicode": "e692",
  586. "unicode_decimal": 59026
  587. }, {
  588. "icon_id": "24899559",
  589. "name": "contact",
  590. "font_class": "contact",
  591. "unicode": "e693",
  592. "unicode_decimal": 59027
  593. }, {
  594. "icon_id": "24899560",
  595. "name": "chatbubble-filled",
  596. "font_class": "chatbubble-filled",
  597. "unicode": "e694",
  598. "unicode_decimal": 59028
  599. }, {
  600. "icon_id": "24899561",
  601. "name": "contact-filled",
  602. "font_class": "contact-filled",
  603. "unicode": "e695",
  604. "unicode_decimal": 59029
  605. }, {
  606. "icon_id": "24899562",
  607. "name": "chatboxes",
  608. "font_class": "chatboxes",
  609. "unicode": "e696",
  610. "unicode_decimal": 59030
  611. }, {
  612. "icon_id": "24899563",
  613. "name": "chatbubble",
  614. "font_class": "chatbubble",
  615. "unicode": "e697",
  616. "unicode_decimal": 59031
  617. }, {
  618. "icon_id": "24881290",
  619. "name": "upload-filled",
  620. "font_class": "upload-filled",
  621. "unicode": "e68e",
  622. "unicode_decimal": 59022
  623. }, {
  624. "icon_id": "24881292",
  625. "name": "upload",
  626. "font_class": "upload",
  627. "unicode": "e690",
  628. "unicode_decimal": 59024
  629. }, {
  630. "icon_id": "24881293",
  631. "name": "weixin",
  632. "font_class": "weixin",
  633. "unicode": "e691",
  634. "unicode_decimal": 59025
  635. }, {
  636. "icon_id": "24881274",
  637. "name": "compose",
  638. "font_class": "compose",
  639. "unicode": "e67f",
  640. "unicode_decimal": 59007
  641. }, {
  642. "icon_id": "24881275",
  643. "name": "qq",
  644. "font_class": "qq",
  645. "unicode": "e680",
  646. "unicode_decimal": 59008
  647. }, {
  648. "icon_id": "24881276",
  649. "name": "download-filled",
  650. "font_class": "download-filled",
  651. "unicode": "e681",
  652. "unicode_decimal": 59009
  653. }, {
  654. "icon_id": "24881277",
  655. "name": "pengyouquan",
  656. "font_class": "pyq",
  657. "unicode": "e682",
  658. "unicode_decimal": 59010
  659. }, {
  660. "icon_id": "24881279",
  661. "name": "sound",
  662. "font_class": "sound",
  663. "unicode": "e684",
  664. "unicode_decimal": 59012
  665. }, {
  666. "icon_id": "24881280",
  667. "name": "trash-filled",
  668. "font_class": "trash-filled",
  669. "unicode": "e685",
  670. "unicode_decimal": 59013
  671. }, {
  672. "icon_id": "24881281",
  673. "name": "sound-filled",
  674. "font_class": "sound-filled",
  675. "unicode": "e686",
  676. "unicode_decimal": 59014
  677. }, {
  678. "icon_id": "24881282",
  679. "name": "trash",
  680. "font_class": "trash",
  681. "unicode": "e687",
  682. "unicode_decimal": 59015
  683. }, {
  684. "icon_id": "24881284",
  685. "name": "videocam-filled",
  686. "font_class": "videocam-filled",
  687. "unicode": "e689",
  688. "unicode_decimal": 59017
  689. }, {
  690. "icon_id": "24881285",
  691. "name": "spinner-cycle",
  692. "font_class": "spinner-cycle",
  693. "unicode": "e68a",
  694. "unicode_decimal": 59018
  695. }, {
  696. "icon_id": "24881286",
  697. "name": "weibo",
  698. "font_class": "weibo",
  699. "unicode": "e68b",
  700. "unicode_decimal": 59019
  701. }, {
  702. "icon_id": "24881288",
  703. "name": "videocam",
  704. "font_class": "videocam",
  705. "unicode": "e68c",
  706. "unicode_decimal": 59020
  707. }, {
  708. "icon_id": "24881289",
  709. "name": "download",
  710. "font_class": "download",
  711. "unicode": "e68d",
  712. "unicode_decimal": 59021
  713. }, {
  714. "icon_id": "24879601",
  715. "name": "help",
  716. "font_class": "help",
  717. "unicode": "e679",
  718. "unicode_decimal": 59001
  719. }, {
  720. "icon_id": "24879602",
  721. "name": "navigate-filled",
  722. "font_class": "navigate-filled",
  723. "unicode": "e67a",
  724. "unicode_decimal": 59002
  725. }, {
  726. "icon_id": "24879603",
  727. "name": "plusempty",
  728. "font_class": "plusempty",
  729. "unicode": "e67b",
  730. "unicode_decimal": 59003
  731. }, {
  732. "icon_id": "24879604",
  733. "name": "smallcircle",
  734. "font_class": "smallcircle",
  735. "unicode": "e67c",
  736. "unicode_decimal": 59004
  737. }, {
  738. "icon_id": "24879605",
  739. "name": "minus-filled",
  740. "font_class": "minus-filled",
  741. "unicode": "e67d",
  742. "unicode_decimal": 59005
  743. }, {
  744. "icon_id": "24879606",
  745. "name": "micoff",
  746. "font_class": "micoff",
  747. "unicode": "e67e",
  748. "unicode_decimal": 59006
  749. }, {
  750. "icon_id": "24879588",
  751. "name": "closeempty",
  752. "font_class": "closeempty",
  753. "unicode": "e66c",
  754. "unicode_decimal": 58988
  755. }, {
  756. "icon_id": "24879589",
  757. "name": "clear",
  758. "font_class": "clear",
  759. "unicode": "e66d",
  760. "unicode_decimal": 58989
  761. }, {
  762. "icon_id": "24879590",
  763. "name": "navigate",
  764. "font_class": "navigate",
  765. "unicode": "e66e",
  766. "unicode_decimal": 58990
  767. }, {
  768. "icon_id": "24879591",
  769. "name": "minus",
  770. "font_class": "minus",
  771. "unicode": "e66f",
  772. "unicode_decimal": 58991
  773. }, {
  774. "icon_id": "24879592",
  775. "name": "image",
  776. "font_class": "image",
  777. "unicode": "e670",
  778. "unicode_decimal": 58992
  779. }, {
  780. "icon_id": "24879593",
  781. "name": "mic",
  782. "font_class": "mic",
  783. "unicode": "e671",
  784. "unicode_decimal": 58993
  785. }, {
  786. "icon_id": "24879594",
  787. "name": "paperplane",
  788. "font_class": "paperplane",
  789. "unicode": "e672",
  790. "unicode_decimal": 58994
  791. }, {
  792. "icon_id": "24879595",
  793. "name": "close",
  794. "font_class": "close",
  795. "unicode": "e673",
  796. "unicode_decimal": 58995
  797. }, {
  798. "icon_id": "24879596",
  799. "name": "help-filled",
  800. "font_class": "help-filled",
  801. "unicode": "e674",
  802. "unicode_decimal": 58996
  803. }, {
  804. "icon_id": "24879597",
  805. "name": "plus-filled",
  806. "font_class": "paperplane-filled",
  807. "unicode": "e675",
  808. "unicode_decimal": 58997
  809. }, {
  810. "icon_id": "24879598",
  811. "name": "plus",
  812. "font_class": "plus",
  813. "unicode": "e676",
  814. "unicode_decimal": 58998
  815. }, {
  816. "icon_id": "24879599",
  817. "name": "mic-filled",
  818. "font_class": "mic-filled",
  819. "unicode": "e677",
  820. "unicode_decimal": 58999
  821. }, {
  822. "icon_id": "24879600",
  823. "name": "image-filled",
  824. "font_class": "image-filled",
  825. "unicode": "e678",
  826. "unicode_decimal": 59000
  827. }, {
  828. "icon_id": "24855900",
  829. "name": "locked-filled",
  830. "font_class": "locked-filled",
  831. "unicode": "e668",
  832. "unicode_decimal": 58984
  833. }, {
  834. "icon_id": "24855901",
  835. "name": "info",
  836. "font_class": "info",
  837. "unicode": "e669",
  838. "unicode_decimal": 58985
  839. }, {
  840. "icon_id": "24855903",
  841. "name": "locked",
  842. "font_class": "locked",
  843. "unicode": "e66b",
  844. "unicode_decimal": 58987
  845. }, {
  846. "icon_id": "24855884",
  847. "name": "camera-filled",
  848. "font_class": "camera-filled",
  849. "unicode": "e658",
  850. "unicode_decimal": 58968
  851. }, {
  852. "icon_id": "24855885",
  853. "name": "chat-filled",
  854. "font_class": "chat-filled",
  855. "unicode": "e659",
  856. "unicode_decimal": 58969
  857. }, {
  858. "icon_id": "24855886",
  859. "name": "camera",
  860. "font_class": "camera",
  861. "unicode": "e65a",
  862. "unicode_decimal": 58970
  863. }, {
  864. "icon_id": "24855887",
  865. "name": "circle",
  866. "font_class": "circle",
  867. "unicode": "e65b",
  868. "unicode_decimal": 58971
  869. }, {
  870. "icon_id": "24855888",
  871. "name": "checkmarkempty",
  872. "font_class": "checkmarkempty",
  873. "unicode": "e65c",
  874. "unicode_decimal": 58972
  875. }, {
  876. "icon_id": "24855889",
  877. "name": "chat",
  878. "font_class": "chat",
  879. "unicode": "e65d",
  880. "unicode_decimal": 58973
  881. }, {
  882. "icon_id": "24855890",
  883. "name": "circle-filled",
  884. "font_class": "circle-filled",
  885. "unicode": "e65e",
  886. "unicode_decimal": 58974
  887. }, {
  888. "icon_id": "24855891",
  889. "name": "flag",
  890. "font_class": "flag",
  891. "unicode": "e65f",
  892. "unicode_decimal": 58975
  893. }, {
  894. "icon_id": "24855892",
  895. "name": "flag-filled",
  896. "font_class": "flag-filled",
  897. "unicode": "e660",
  898. "unicode_decimal": 58976
  899. }, {
  900. "icon_id": "24855893",
  901. "name": "gear-filled",
  902. "font_class": "gear-filled",
  903. "unicode": "e661",
  904. "unicode_decimal": 58977
  905. }, {
  906. "icon_id": "24855894",
  907. "name": "home",
  908. "font_class": "home",
  909. "unicode": "e662",
  910. "unicode_decimal": 58978
  911. }, {
  912. "icon_id": "24855895",
  913. "name": "home-filled",
  914. "font_class": "home-filled",
  915. "unicode": "e663",
  916. "unicode_decimal": 58979
  917. }, {
  918. "icon_id": "24855896",
  919. "name": "gear",
  920. "font_class": "gear",
  921. "unicode": "e664",
  922. "unicode_decimal": 58980
  923. }, {
  924. "icon_id": "24855897",
  925. "name": "smallcircle-filled",
  926. "font_class": "smallcircle-filled",
  927. "unicode": "e665",
  928. "unicode_decimal": 58981
  929. }, {
  930. "icon_id": "24855898",
  931. "name": "map-filled",
  932. "font_class": "map-filled",
  933. "unicode": "e666",
  934. "unicode_decimal": 58982
  935. }, {
  936. "icon_id": "24855899",
  937. "name": "map",
  938. "font_class": "map",
  939. "unicode": "e667",
  940. "unicode_decimal": 58983
  941. }, {
  942. "icon_id": "24855825",
  943. "name": "refresh-filled",
  944. "font_class": "refresh-filled",
  945. "unicode": "e656",
  946. "unicode_decimal": 58966
  947. }, {
  948. "icon_id": "24855826",
  949. "name": "refresh",
  950. "font_class": "refresh",
  951. "unicode": "e657",
  952. "unicode_decimal": 58967
  953. }, {
  954. "icon_id": "24855808",
  955. "name": "cloud-upload",
  956. "font_class": "cloud-upload",
  957. "unicode": "e645",
  958. "unicode_decimal": 58949
  959. }, {
  960. "icon_id": "24855809",
  961. "name": "cloud-download-filled",
  962. "font_class": "cloud-download-filled",
  963. "unicode": "e646",
  964. "unicode_decimal": 58950
  965. }, {
  966. "icon_id": "24855810",
  967. "name": "cloud-download",
  968. "font_class": "cloud-download",
  969. "unicode": "e647",
  970. "unicode_decimal": 58951
  971. }, {
  972. "icon_id": "24855811",
  973. "name": "cloud-upload-filled",
  974. "font_class": "cloud-upload-filled",
  975. "unicode": "e648",
  976. "unicode_decimal": 58952
  977. }, {
  978. "icon_id": "24855813",
  979. "name": "redo",
  980. "font_class": "redo",
  981. "unicode": "e64a",
  982. "unicode_decimal": 58954
  983. }, {
  984. "icon_id": "24855814",
  985. "name": "images-filled",
  986. "font_class": "images-filled",
  987. "unicode": "e64b",
  988. "unicode_decimal": 58955
  989. }, {
  990. "icon_id": "24855815",
  991. "name": "undo-filled",
  992. "font_class": "undo-filled",
  993. "unicode": "e64c",
  994. "unicode_decimal": 58956
  995. }, {
  996. "icon_id": "24855816",
  997. "name": "more",
  998. "font_class": "more",
  999. "unicode": "e64d",
  1000. "unicode_decimal": 58957
  1001. }, {
  1002. "icon_id": "24855817",
  1003. "name": "more-filled",
  1004. "font_class": "more-filled",
  1005. "unicode": "e64e",
  1006. "unicode_decimal": 58958
  1007. }, {
  1008. "icon_id": "24855818",
  1009. "name": "undo",
  1010. "font_class": "undo",
  1011. "unicode": "e64f",
  1012. "unicode_decimal": 58959
  1013. }, {
  1014. "icon_id": "24855819",
  1015. "name": "images",
  1016. "font_class": "images",
  1017. "unicode": "e650",
  1018. "unicode_decimal": 58960
  1019. }, {
  1020. "icon_id": "24855821",
  1021. "name": "paperclip",
  1022. "font_class": "paperclip",
  1023. "unicode": "e652",
  1024. "unicode_decimal": 58962
  1025. }, {
  1026. "icon_id": "24855822",
  1027. "name": "settings",
  1028. "font_class": "settings",
  1029. "unicode": "e653",
  1030. "unicode_decimal": 58963
  1031. }, {
  1032. "icon_id": "24855823",
  1033. "name": "search",
  1034. "font_class": "search",
  1035. "unicode": "e654",
  1036. "unicode_decimal": 58964
  1037. }, {
  1038. "icon_id": "24855824",
  1039. "name": "redo-filled",
  1040. "font_class": "redo-filled",
  1041. "unicode": "e655",
  1042. "unicode_decimal": 58965
  1043. }, {
  1044. "icon_id": "24841702",
  1045. "name": "list",
  1046. "font_class": "list",
  1047. "unicode": "e644",
  1048. "unicode_decimal": 58948
  1049. }, {
  1050. "icon_id": "24841489",
  1051. "name": "mail-open-filled",
  1052. "font_class": "mail-open-filled",
  1053. "unicode": "e63a",
  1054. "unicode_decimal": 58938
  1055. }, {
  1056. "icon_id": "24841491",
  1057. "name": "hand-thumbsdown-filled",
  1058. "font_class": "hand-down-filled",
  1059. "unicode": "e63c",
  1060. "unicode_decimal": 58940
  1061. }, {
  1062. "icon_id": "24841492",
  1063. "name": "hand-thumbsdown",
  1064. "font_class": "hand-down",
  1065. "unicode": "e63d",
  1066. "unicode_decimal": 58941
  1067. }, {
  1068. "icon_id": "24841493",
  1069. "name": "hand-thumbsup-filled",
  1070. "font_class": "hand-up-filled",
  1071. "unicode": "e63e",
  1072. "unicode_decimal": 58942
  1073. }, {
  1074. "icon_id": "24841494",
  1075. "name": "hand-thumbsup",
  1076. "font_class": "hand-up",
  1077. "unicode": "e63f",
  1078. "unicode_decimal": 58943
  1079. }, {
  1080. "icon_id": "24841496",
  1081. "name": "heart-filled",
  1082. "font_class": "heart-filled",
  1083. "unicode": "e641",
  1084. "unicode_decimal": 58945
  1085. }, {
  1086. "icon_id": "24841498",
  1087. "name": "mail-open",
  1088. "font_class": "mail-open",
  1089. "unicode": "e643",
  1090. "unicode_decimal": 58947
  1091. }, {
  1092. "icon_id": "24841488",
  1093. "name": "heart",
  1094. "font_class": "heart",
  1095. "unicode": "e639",
  1096. "unicode_decimal": 58937
  1097. }, {
  1098. "icon_id": "24839963",
  1099. "name": "loop",
  1100. "font_class": "loop",
  1101. "unicode": "e633",
  1102. "unicode_decimal": 58931
  1103. }, {
  1104. "icon_id": "24839866",
  1105. "name": "pulldown",
  1106. "font_class": "pulldown",
  1107. "unicode": "e632",
  1108. "unicode_decimal": 58930
  1109. }, {
  1110. "icon_id": "24813798",
  1111. "name": "scan",
  1112. "font_class": "scan",
  1113. "unicode": "e62a",
  1114. "unicode_decimal": 58922
  1115. }, {
  1116. "icon_id": "24813786",
  1117. "name": "bars",
  1118. "font_class": "bars",
  1119. "unicode": "e627",
  1120. "unicode_decimal": 58919
  1121. }, {
  1122. "icon_id": "24813788",
  1123. "name": "cart-filled",
  1124. "font_class": "cart-filled",
  1125. "unicode": "e629",
  1126. "unicode_decimal": 58921
  1127. }, {
  1128. "icon_id": "24813790",
  1129. "name": "checkbox",
  1130. "font_class": "checkbox",
  1131. "unicode": "e62b",
  1132. "unicode_decimal": 58923
  1133. }, {
  1134. "icon_id": "24813791",
  1135. "name": "checkbox-filled",
  1136. "font_class": "checkbox-filled",
  1137. "unicode": "e62c",
  1138. "unicode_decimal": 58924
  1139. }, {
  1140. "icon_id": "24813794",
  1141. "name": "shop",
  1142. "font_class": "shop",
  1143. "unicode": "e62f",
  1144. "unicode_decimal": 58927
  1145. }, {
  1146. "icon_id": "24813795",
  1147. "name": "headphones",
  1148. "font_class": "headphones",
  1149. "unicode": "e630",
  1150. "unicode_decimal": 58928
  1151. }, {
  1152. "icon_id": "24813796",
  1153. "name": "cart",
  1154. "font_class": "cart",
  1155. "unicode": "e631",
  1156. "unicode_decimal": 58929
  1157. }]
  1158. };
  1159. exports.default = _default;
  1160. /***/ }),
  1161. /***/ 16:
  1162. /*!***************************************************************!*\
  1163. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  1164. \***************************************************************/
  1165. /*! no static exports found */
  1166. /***/ (function(module, exports) {
  1167. function _setPrototypeOf(o, p) {
  1168. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  1169. o.__proto__ = p;
  1170. return o;
  1171. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1172. return _setPrototypeOf(o, p);
  1173. }
  1174. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1175. /***/ }),
  1176. /***/ 168:
  1177. /*!*************************************************************************************!*\
  1178. !*** D:/project/项目模板/uniapp/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  1179. \*************************************************************************************/
  1180. /*! no static exports found */
  1181. /***/ (function(module, exports, __webpack_require__) {
  1182. "use strict";
  1183. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1184. Object.defineProperty(exports, "__esModule", {
  1185. value: true
  1186. });
  1187. exports.default = void 0;
  1188. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  1189. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 169));
  1190. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 170));
  1191. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 172));
  1192. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  1193. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  1194. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  1195. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1196. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  1197. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1198. var pattern = {
  1199. email: /^\S+?@\S+?\.\S+?$/,
  1200. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  1201. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  1202. };
  1203. var FORMAT_MAPPING = {
  1204. "int": 'integer',
  1205. "bool": 'boolean',
  1206. "double": 'number',
  1207. "long": 'number',
  1208. "password": 'string'
  1209. // "fileurls": 'array'
  1210. };
  1211. function formatMessage(args) {
  1212. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1213. var defaultMessage = ['label'];
  1214. defaultMessage.forEach(function (item) {
  1215. if (args[item] === undefined) {
  1216. args[item] = '';
  1217. }
  1218. });
  1219. var str = resources;
  1220. for (var key in args) {
  1221. var reg = new RegExp('{' + key + '}');
  1222. str = str.replace(reg, args[key]);
  1223. }
  1224. return str;
  1225. }
  1226. function isEmptyValue(value, type) {
  1227. if (value === undefined || value === null) {
  1228. return true;
  1229. }
  1230. if (typeof value === 'string' && !value) {
  1231. return true;
  1232. }
  1233. if (Array.isArray(value) && !value.length) {
  1234. return true;
  1235. }
  1236. if (type === 'object' && !Object.keys(value).length) {
  1237. return true;
  1238. }
  1239. return false;
  1240. }
  1241. var types = {
  1242. integer: function integer(value) {
  1243. return types.number(value) && parseInt(value, 10) === value;
  1244. },
  1245. string: function string(value) {
  1246. return typeof value === 'string';
  1247. },
  1248. number: function number(value) {
  1249. if (isNaN(value)) {
  1250. return false;
  1251. }
  1252. return typeof value === 'number';
  1253. },
  1254. "boolean": function boolean(value) {
  1255. return typeof value === 'boolean';
  1256. },
  1257. "float": function float(value) {
  1258. return types.number(value) && !types.integer(value);
  1259. },
  1260. array: function array(value) {
  1261. return Array.isArray(value);
  1262. },
  1263. object: function object(value) {
  1264. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  1265. },
  1266. date: function date(value) {
  1267. return value instanceof Date;
  1268. },
  1269. timestamp: function timestamp(value) {
  1270. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  1271. return false;
  1272. }
  1273. return true;
  1274. },
  1275. file: function file(value) {
  1276. return typeof value.url === 'string';
  1277. },
  1278. email: function email(value) {
  1279. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  1280. },
  1281. url: function url(value) {
  1282. return typeof value === 'string' && !!value.match(pattern.url);
  1283. },
  1284. pattern: function pattern(reg, value) {
  1285. try {
  1286. return new RegExp(reg).test(value);
  1287. } catch (e) {
  1288. return false;
  1289. }
  1290. },
  1291. method: function method(value) {
  1292. return typeof value === 'function';
  1293. },
  1294. idcard: function idcard(value) {
  1295. return typeof value === 'string' && !!value.match(pattern.idcard);
  1296. },
  1297. 'url-https': function urlHttps(value) {
  1298. return this.url(value) && value.startsWith('https://');
  1299. },
  1300. 'url-scheme': function urlScheme(value) {
  1301. return value.startsWith('://');
  1302. },
  1303. 'url-web': function urlWeb(value) {
  1304. return false;
  1305. }
  1306. };
  1307. var RuleValidator = /*#__PURE__*/function () {
  1308. function RuleValidator(message) {
  1309. (0, _classCallCheck2.default)(this, RuleValidator);
  1310. this._message = message;
  1311. }
  1312. (0, _createClass2.default)(RuleValidator, [{
  1313. key: "validateRule",
  1314. value: function () {
  1315. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  1316. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  1317. return _regenerator.default.wrap(function _callee$(_context) {
  1318. while (1) {
  1319. switch (_context.prev = _context.next) {
  1320. case 0:
  1321. result = null;
  1322. rules = fieldValue.rules;
  1323. hasRequired = rules.findIndex(function (item) {
  1324. return item.required;
  1325. });
  1326. if (!(hasRequired < 0)) {
  1327. _context.next = 8;
  1328. break;
  1329. }
  1330. if (!(value === null || value === undefined)) {
  1331. _context.next = 6;
  1332. break;
  1333. }
  1334. return _context.abrupt("return", result);
  1335. case 6:
  1336. if (!(typeof value === 'string' && !value.length)) {
  1337. _context.next = 8;
  1338. break;
  1339. }
  1340. return _context.abrupt("return", result);
  1341. case 8:
  1342. message = this._message;
  1343. if (!(rules === undefined)) {
  1344. _context.next = 11;
  1345. break;
  1346. }
  1347. return _context.abrupt("return", message['default']);
  1348. case 11:
  1349. i = 0;
  1350. case 12:
  1351. if (!(i < rules.length)) {
  1352. _context.next = 35;
  1353. break;
  1354. }
  1355. rule = rules[i];
  1356. vt = this._getValidateType(rule);
  1357. Object.assign(rule, {
  1358. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  1359. });
  1360. if (!RuleValidatorHelper[vt]) {
  1361. _context.next = 20;
  1362. break;
  1363. }
  1364. result = RuleValidatorHelper[vt](rule, value, message);
  1365. if (!(result != null)) {
  1366. _context.next = 20;
  1367. break;
  1368. }
  1369. return _context.abrupt("break", 35);
  1370. case 20:
  1371. if (!rule.validateExpr) {
  1372. _context.next = 26;
  1373. break;
  1374. }
  1375. now = Date.now();
  1376. resultExpr = rule.validateExpr(value, allData, now);
  1377. if (!(resultExpr === false)) {
  1378. _context.next = 26;
  1379. break;
  1380. }
  1381. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  1382. return _context.abrupt("break", 35);
  1383. case 26:
  1384. if (!rule.validateFunction) {
  1385. _context.next = 32;
  1386. break;
  1387. }
  1388. _context.next = 29;
  1389. return this.validateFunction(rule, value, data, allData, vt);
  1390. case 29:
  1391. result = _context.sent;
  1392. if (!(result !== null)) {
  1393. _context.next = 32;
  1394. break;
  1395. }
  1396. return _context.abrupt("break", 35);
  1397. case 32:
  1398. i++;
  1399. _context.next = 12;
  1400. break;
  1401. case 35:
  1402. if (result !== null) {
  1403. result = message.TAG + result;
  1404. }
  1405. return _context.abrupt("return", result);
  1406. case 37:
  1407. case "end":
  1408. return _context.stop();
  1409. }
  1410. }
  1411. }, _callee, this);
  1412. }));
  1413. function validateRule(_x, _x2, _x3, _x4, _x5) {
  1414. return _validateRule.apply(this, arguments);
  1415. }
  1416. return validateRule;
  1417. }()
  1418. }, {
  1419. key: "validateFunction",
  1420. value: function () {
  1421. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  1422. var result, callbackMessage, res;
  1423. return _regenerator.default.wrap(function _callee2$(_context2) {
  1424. while (1) {
  1425. switch (_context2.prev = _context2.next) {
  1426. case 0:
  1427. result = null;
  1428. _context2.prev = 1;
  1429. callbackMessage = null;
  1430. _context2.next = 5;
  1431. return rule.validateFunction(rule, value, allData || data, function (message) {
  1432. callbackMessage = message;
  1433. });
  1434. case 5:
  1435. res = _context2.sent;
  1436. if (callbackMessage || typeof res === 'string' && res || res === false) {
  1437. result = this._getMessage(rule, callbackMessage || res, vt);
  1438. }
  1439. _context2.next = 12;
  1440. break;
  1441. case 9:
  1442. _context2.prev = 9;
  1443. _context2.t0 = _context2["catch"](1);
  1444. result = this._getMessage(rule, _context2.t0.message, vt);
  1445. case 12:
  1446. return _context2.abrupt("return", result);
  1447. case 13:
  1448. case "end":
  1449. return _context2.stop();
  1450. }
  1451. }
  1452. }, _callee2, this, [[1, 9]]);
  1453. }));
  1454. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  1455. return _validateFunction.apply(this, arguments);
  1456. }
  1457. return validateFunction;
  1458. }()
  1459. }, {
  1460. key: "_getMessage",
  1461. value: function _getMessage(rule, message, vt) {
  1462. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  1463. }
  1464. }, {
  1465. key: "_getValidateType",
  1466. value: function _getValidateType(rule) {
  1467. var result = '';
  1468. if (rule.required) {
  1469. result = 'required';
  1470. } else if (rule.format) {
  1471. result = 'format';
  1472. } else if (rule.arrayType) {
  1473. result = 'arrayTypeFormat';
  1474. } else if (rule.range) {
  1475. result = 'range';
  1476. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  1477. result = 'rangeNumber';
  1478. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  1479. result = 'rangeLength';
  1480. } else if (rule.pattern) {
  1481. result = 'pattern';
  1482. } else if (rule.validateFunction) {
  1483. result = 'validateFunction';
  1484. }
  1485. return result;
  1486. }
  1487. }]);
  1488. return RuleValidator;
  1489. }();
  1490. var RuleValidatorHelper = {
  1491. required: function required(rule, value, message) {
  1492. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  1493. return formatMessage(rule, rule.errorMessage || message.required);
  1494. }
  1495. return null;
  1496. },
  1497. range: function range(rule, value, message) {
  1498. var range = rule.range,
  1499. errorMessage = rule.errorMessage;
  1500. var list = new Array(range.length);
  1501. for (var i = 0; i < range.length; i++) {
  1502. var item = range[i];
  1503. if (types.object(item) && item.value !== undefined) {
  1504. list[i] = item.value;
  1505. } else {
  1506. list[i] = item;
  1507. }
  1508. }
  1509. var result = false;
  1510. if (Array.isArray(value)) {
  1511. result = new Set(value.concat(list)).size === list.length;
  1512. } else {
  1513. if (list.indexOf(value) > -1) {
  1514. result = true;
  1515. }
  1516. }
  1517. if (!result) {
  1518. return formatMessage(rule, errorMessage || message['enum']);
  1519. }
  1520. return null;
  1521. },
  1522. rangeNumber: function rangeNumber(rule, value, message) {
  1523. if (!types.number(value)) {
  1524. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1525. }
  1526. var minimum = rule.minimum,
  1527. maximum = rule.maximum,
  1528. exclusiveMinimum = rule.exclusiveMinimum,
  1529. exclusiveMaximum = rule.exclusiveMaximum;
  1530. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  1531. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  1532. if (minimum !== undefined && min) {
  1533. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  1534. } else if (maximum !== undefined && max) {
  1535. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  1536. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  1537. return formatMessage(rule, rule.errorMessage || message['number'].range);
  1538. }
  1539. return null;
  1540. },
  1541. rangeLength: function rangeLength(rule, value, message) {
  1542. if (!types.string(value) && !types.array(value)) {
  1543. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1544. }
  1545. var min = rule.minLength;
  1546. var max = rule.maxLength;
  1547. var val = value.length;
  1548. if (min !== undefined && val < min) {
  1549. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  1550. } else if (max !== undefined && val > max) {
  1551. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  1552. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  1553. return formatMessage(rule, rule.errorMessage || message['length'].range);
  1554. }
  1555. return null;
  1556. },
  1557. pattern: function pattern(rule, value, message) {
  1558. if (!types['pattern'](rule.pattern, value)) {
  1559. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1560. }
  1561. return null;
  1562. },
  1563. format: function format(rule, value, message) {
  1564. var customTypes = Object.keys(types);
  1565. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  1566. if (customTypes.indexOf(format) > -1) {
  1567. if (!types[format](value)) {
  1568. return formatMessage(rule, rule.errorMessage || message.typeError);
  1569. }
  1570. }
  1571. return null;
  1572. },
  1573. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  1574. if (!Array.isArray(value)) {
  1575. return formatMessage(rule, rule.errorMessage || message.typeError);
  1576. }
  1577. for (var i = 0; i < value.length; i++) {
  1578. var element = value[i];
  1579. var formatResult = this.format(rule, element, message);
  1580. if (formatResult !== null) {
  1581. return formatResult;
  1582. }
  1583. }
  1584. return null;
  1585. }
  1586. };
  1587. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  1588. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  1589. var _super = _createSuper(SchemaValidator);
  1590. function SchemaValidator(schema, options) {
  1591. var _this;
  1592. (0, _classCallCheck2.default)(this, SchemaValidator);
  1593. _this = _super.call(this, SchemaValidator.message);
  1594. _this._schema = schema;
  1595. _this._options = options || null;
  1596. return _this;
  1597. }
  1598. (0, _createClass2.default)(SchemaValidator, [{
  1599. key: "updateSchema",
  1600. value: function updateSchema(schema) {
  1601. this._schema = schema;
  1602. }
  1603. }, {
  1604. key: "validate",
  1605. value: function () {
  1606. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  1607. var result;
  1608. return _regenerator.default.wrap(function _callee3$(_context3) {
  1609. while (1) {
  1610. switch (_context3.prev = _context3.next) {
  1611. case 0:
  1612. result = this._checkFieldInSchema(data);
  1613. if (result) {
  1614. _context3.next = 5;
  1615. break;
  1616. }
  1617. _context3.next = 4;
  1618. return this.invokeValidate(data, false, allData);
  1619. case 4:
  1620. result = _context3.sent;
  1621. case 5:
  1622. return _context3.abrupt("return", result.length ? result[0] : null);
  1623. case 6:
  1624. case "end":
  1625. return _context3.stop();
  1626. }
  1627. }
  1628. }, _callee3, this);
  1629. }));
  1630. function validate(_x11, _x12) {
  1631. return _validate.apply(this, arguments);
  1632. }
  1633. return validate;
  1634. }()
  1635. }, {
  1636. key: "validateAll",
  1637. value: function () {
  1638. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  1639. var result;
  1640. return _regenerator.default.wrap(function _callee4$(_context4) {
  1641. while (1) {
  1642. switch (_context4.prev = _context4.next) {
  1643. case 0:
  1644. result = this._checkFieldInSchema(data);
  1645. if (result) {
  1646. _context4.next = 5;
  1647. break;
  1648. }
  1649. _context4.next = 4;
  1650. return this.invokeValidate(data, true, allData);
  1651. case 4:
  1652. result = _context4.sent;
  1653. case 5:
  1654. return _context4.abrupt("return", result);
  1655. case 6:
  1656. case "end":
  1657. return _context4.stop();
  1658. }
  1659. }
  1660. }, _callee4, this);
  1661. }));
  1662. function validateAll(_x13, _x14) {
  1663. return _validateAll.apply(this, arguments);
  1664. }
  1665. return validateAll;
  1666. }()
  1667. }, {
  1668. key: "validateUpdate",
  1669. value: function () {
  1670. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  1671. var result;
  1672. return _regenerator.default.wrap(function _callee5$(_context5) {
  1673. while (1) {
  1674. switch (_context5.prev = _context5.next) {
  1675. case 0:
  1676. result = this._checkFieldInSchema(data);
  1677. if (result) {
  1678. _context5.next = 5;
  1679. break;
  1680. }
  1681. _context5.next = 4;
  1682. return this.invokeValidateUpdate(data, false, allData);
  1683. case 4:
  1684. result = _context5.sent;
  1685. case 5:
  1686. return _context5.abrupt("return", result.length ? result[0] : null);
  1687. case 6:
  1688. case "end":
  1689. return _context5.stop();
  1690. }
  1691. }
  1692. }, _callee5, this);
  1693. }));
  1694. function validateUpdate(_x15, _x16) {
  1695. return _validateUpdate.apply(this, arguments);
  1696. }
  1697. return validateUpdate;
  1698. }()
  1699. }, {
  1700. key: "invokeValidate",
  1701. value: function () {
  1702. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  1703. var result, schema, key, value, errorMessage;
  1704. return _regenerator.default.wrap(function _callee6$(_context6) {
  1705. while (1) {
  1706. switch (_context6.prev = _context6.next) {
  1707. case 0:
  1708. result = [];
  1709. schema = this._schema;
  1710. _context6.t0 = _regenerator.default.keys(schema);
  1711. case 3:
  1712. if ((_context6.t1 = _context6.t0()).done) {
  1713. _context6.next = 15;
  1714. break;
  1715. }
  1716. key = _context6.t1.value;
  1717. value = schema[key];
  1718. _context6.next = 8;
  1719. return this.validateRule(key, value, data[key], data, allData);
  1720. case 8:
  1721. errorMessage = _context6.sent;
  1722. if (!(errorMessage != null)) {
  1723. _context6.next = 13;
  1724. break;
  1725. }
  1726. result.push({
  1727. key: key,
  1728. errorMessage: errorMessage
  1729. });
  1730. if (all) {
  1731. _context6.next = 13;
  1732. break;
  1733. }
  1734. return _context6.abrupt("break", 15);
  1735. case 13:
  1736. _context6.next = 3;
  1737. break;
  1738. case 15:
  1739. return _context6.abrupt("return", result);
  1740. case 16:
  1741. case "end":
  1742. return _context6.stop();
  1743. }
  1744. }
  1745. }, _callee6, this);
  1746. }));
  1747. function invokeValidate(_x17, _x18, _x19) {
  1748. return _invokeValidate.apply(this, arguments);
  1749. }
  1750. return invokeValidate;
  1751. }()
  1752. }, {
  1753. key: "invokeValidateUpdate",
  1754. value: function () {
  1755. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  1756. var result, key, errorMessage;
  1757. return _regenerator.default.wrap(function _callee7$(_context7) {
  1758. while (1) {
  1759. switch (_context7.prev = _context7.next) {
  1760. case 0:
  1761. result = [];
  1762. _context7.t0 = _regenerator.default.keys(data);
  1763. case 2:
  1764. if ((_context7.t1 = _context7.t0()).done) {
  1765. _context7.next = 13;
  1766. break;
  1767. }
  1768. key = _context7.t1.value;
  1769. _context7.next = 6;
  1770. return this.validateRule(key, this._schema[key], data[key], data, allData);
  1771. case 6:
  1772. errorMessage = _context7.sent;
  1773. if (!(errorMessage != null)) {
  1774. _context7.next = 11;
  1775. break;
  1776. }
  1777. result.push({
  1778. key: key,
  1779. errorMessage: errorMessage
  1780. });
  1781. if (all) {
  1782. _context7.next = 11;
  1783. break;
  1784. }
  1785. return _context7.abrupt("break", 13);
  1786. case 11:
  1787. _context7.next = 2;
  1788. break;
  1789. case 13:
  1790. return _context7.abrupt("return", result);
  1791. case 14:
  1792. case "end":
  1793. return _context7.stop();
  1794. }
  1795. }
  1796. }, _callee7, this);
  1797. }));
  1798. function invokeValidateUpdate(_x20, _x21, _x22) {
  1799. return _invokeValidateUpdate.apply(this, arguments);
  1800. }
  1801. return invokeValidateUpdate;
  1802. }()
  1803. }, {
  1804. key: "_checkFieldInSchema",
  1805. value: function _checkFieldInSchema(data) {
  1806. var keys = Object.keys(data);
  1807. var keys2 = Object.keys(this._schema);
  1808. if (new Set(keys.concat(keys2)).size === keys2.length) {
  1809. return '';
  1810. }
  1811. var noExistFields = keys.filter(function (key) {
  1812. return keys2.indexOf(key) < 0;
  1813. });
  1814. var errorMessage = formatMessage({
  1815. field: JSON.stringify(noExistFields)
  1816. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  1817. return [{
  1818. key: 'invalid',
  1819. errorMessage: errorMessage
  1820. }];
  1821. }
  1822. }]);
  1823. return SchemaValidator;
  1824. }(RuleValidator);
  1825. function Message() {
  1826. return {
  1827. TAG: "",
  1828. default: '验证错误',
  1829. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  1830. validateFunction: '验证无效',
  1831. required: '{label}必填',
  1832. 'enum': '{label}超出范围',
  1833. timestamp: '{label}格式无效',
  1834. whitespace: '{label}不能为空',
  1835. typeError: '{label}类型无效',
  1836. date: {
  1837. format: '{label}日期{value}格式无效',
  1838. parse: '{label}日期无法解析,{value}无效',
  1839. invalid: '{label}日期{value}无效'
  1840. },
  1841. length: {
  1842. minLength: '{label}长度不能少于{minLength}',
  1843. maxLength: '{label}长度不能超过{maxLength}',
  1844. range: '{label}必须介于{minLength}和{maxLength}之间'
  1845. },
  1846. number: {
  1847. minimum: '{label}不能小于{minimum}',
  1848. maximum: '{label}不能大于{maximum}',
  1849. exclusiveMinimum: '{label}不能小于等于{minimum}',
  1850. exclusiveMaximum: '{label}不能大于等于{maximum}',
  1851. range: '{label}必须介于{minimum}and{maximum}之间'
  1852. },
  1853. pattern: {
  1854. mismatch: '{label}格式不匹配'
  1855. }
  1856. };
  1857. }
  1858. SchemaValidator.message = new Message();
  1859. var _default = SchemaValidator;
  1860. exports.default = _default;
  1861. /***/ }),
  1862. /***/ 169:
  1863. /*!*********************************************************!*\
  1864. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  1865. \*********************************************************/
  1866. /*! no static exports found */
  1867. /***/ (function(module, exports, __webpack_require__) {
  1868. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1869. function _inherits(subClass, superClass) {
  1870. if (typeof superClass !== "function" && superClass !== null) {
  1871. throw new TypeError("Super expression must either be null or a function");
  1872. }
  1873. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1874. constructor: {
  1875. value: subClass,
  1876. writable: true,
  1877. configurable: true
  1878. }
  1879. });
  1880. Object.defineProperty(subClass, "prototype", {
  1881. writable: false
  1882. });
  1883. if (superClass) setPrototypeOf(subClass, superClass);
  1884. }
  1885. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1886. /***/ }),
  1887. /***/ 17:
  1888. /*!*************************************************************************!*\
  1889. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  1890. \*************************************************************************/
  1891. /*! no static exports found */
  1892. /***/ (function(module, exports) {
  1893. function _isNativeReflectConstruct() {
  1894. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1895. if (Reflect.construct.sham) return false;
  1896. if (typeof Proxy === "function") return true;
  1897. try {
  1898. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  1899. return true;
  1900. } catch (e) {
  1901. return false;
  1902. }
  1903. }
  1904. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1905. /***/ }),
  1906. /***/ 170:
  1907. /*!**************************************************************************!*\
  1908. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  1909. \**************************************************************************/
  1910. /*! no static exports found */
  1911. /***/ (function(module, exports, __webpack_require__) {
  1912. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  1913. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 171);
  1914. function _possibleConstructorReturn(self, call) {
  1915. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  1916. return call;
  1917. } else if (call !== void 0) {
  1918. throw new TypeError("Derived constructors may only return object or undefined");
  1919. }
  1920. return assertThisInitialized(self);
  1921. }
  1922. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1923. /***/ }),
  1924. /***/ 171:
  1925. /*!**********************************************************************!*\
  1926. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  1927. \**********************************************************************/
  1928. /*! no static exports found */
  1929. /***/ (function(module, exports) {
  1930. function _assertThisInitialized(self) {
  1931. if (self === void 0) {
  1932. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1933. }
  1934. return self;
  1935. }
  1936. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1937. /***/ }),
  1938. /***/ 172:
  1939. /*!***************************************************************!*\
  1940. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  1941. \***************************************************************/
  1942. /*! no static exports found */
  1943. /***/ (function(module, exports) {
  1944. function _getPrototypeOf(o) {
  1945. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  1946. return o.__proto__ || Object.getPrototypeOf(o);
  1947. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1948. return _getPrototypeOf(o);
  1949. }
  1950. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1951. /***/ }),
  1952. /***/ 173:
  1953. /*!**********************************************************************************!*\
  1954. !*** D:/project/项目模板/uniapp/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  1955. \**********************************************************************************/
  1956. /*! no static exports found */
  1957. /***/ (function(module, exports, __webpack_require__) {
  1958. "use strict";
  1959. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1960. Object.defineProperty(exports, "__esModule", {
  1961. value: true
  1962. });
  1963. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  1964. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1965. /**
  1966. * 简单处理对象拷贝
  1967. * @param {Obejct} 被拷贝对象
  1968. * @@return {Object} 拷贝对象
  1969. */
  1970. var deepCopy = function deepCopy(val) {
  1971. return JSON.parse(JSON.stringify(val));
  1972. };
  1973. /**
  1974. * 过滤数字类型
  1975. * @param {String} format 数字类型
  1976. * @@return {Boolean} 返回是否为数字类型
  1977. */
  1978. exports.deepCopy = deepCopy;
  1979. var typeFilter = function typeFilter(format) {
  1980. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  1981. };
  1982. /**
  1983. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  1984. * @param {String} key 字段名
  1985. * @param {any} value 字段值
  1986. * @param {Object} rules 表单校验规则
  1987. */
  1988. exports.typeFilter = typeFilter;
  1989. var getValue = function getValue(key, value, rules) {
  1990. var isRuleNumType = rules.find(function (val) {
  1991. return val.format && typeFilter(val.format);
  1992. });
  1993. var isRuleBoolType = rules.find(function (val) {
  1994. return val.format && val.format === 'boolean' || val.format === 'bool';
  1995. });
  1996. // 输入类型为 number
  1997. if (!!isRuleNumType) {
  1998. if (!value && value !== 0) {
  1999. value = null;
  2000. } else {
  2001. value = isNumber(Number(value)) ? Number(value) : value;
  2002. }
  2003. }
  2004. // 输入类型为 boolean
  2005. if (!!isRuleBoolType) {
  2006. value = isBoolean(value) ? value : false;
  2007. }
  2008. return value;
  2009. };
  2010. /**
  2011. * 获取表单数据
  2012. * @param {String|Array} name 真实名称,需要使用 realName 获取
  2013. * @param {Object} data 原始数据
  2014. * @param {any} value 需要设置的值
  2015. */
  2016. exports.getValue = getValue;
  2017. var setDataValue = function setDataValue(field, formdata, value) {
  2018. formdata[field] = value;
  2019. return value || '';
  2020. };
  2021. /**
  2022. * 获取表单数据
  2023. * @param {String|Array} field 真实名称,需要使用 realName 获取
  2024. * @param {Object} data 原始数据
  2025. */
  2026. exports.setDataValue = setDataValue;
  2027. var getDataValue = function getDataValue(field, data) {
  2028. return objGet(data, field);
  2029. };
  2030. /**
  2031. * 获取表单类型
  2032. * @param {String|Array} field 真实名称,需要使用 realName 获取
  2033. */
  2034. exports.getDataValue = getDataValue;
  2035. var getDataValueType = function getDataValueType(field, data) {
  2036. var value = getDataValue(field, data);
  2037. return {
  2038. type: type(value),
  2039. value: value
  2040. };
  2041. };
  2042. /**
  2043. * 获取表单可用的真实name
  2044. * @param {String|Array} name 表单name
  2045. * @@return {String} 表单可用的真实name
  2046. */
  2047. exports.getDataValueType = getDataValueType;
  2048. var realName = function realName(name) {
  2049. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2050. var base_name = _basePath(name);
  2051. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  2052. var realname = base_name.reduce(function (a, b) {
  2053. return a += "#".concat(b);
  2054. }, '_formdata_');
  2055. return realname;
  2056. }
  2057. return base_name[0] || name;
  2058. };
  2059. /**
  2060. * 判断是否表单可用的真实name
  2061. * @param {String|Array} name 表单name
  2062. * @@return {String} 表单可用的真实name
  2063. */
  2064. exports.realName = realName;
  2065. var isRealName = function isRealName(name) {
  2066. var reg = /^_formdata_#*/;
  2067. return reg.test(name);
  2068. };
  2069. /**
  2070. * 获取表单数据的原始格式
  2071. * @@return {Object|Array} object 需要解析的数据
  2072. */
  2073. exports.isRealName = isRealName;
  2074. var rawData = function rawData() {
  2075. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2076. var name = arguments.length > 1 ? arguments[1] : undefined;
  2077. var newData = JSON.parse(JSON.stringify(object));
  2078. var formData = {};
  2079. for (var i in newData) {
  2080. var path = name2arr(i);
  2081. objSet(formData, path, newData[i]);
  2082. }
  2083. return formData;
  2084. };
  2085. /**
  2086. * 真实name还原为 array
  2087. * @param {*} name
  2088. */
  2089. exports.rawData = rawData;
  2090. var name2arr = function name2arr(name) {
  2091. var field = name.replace('_formdata_#', '');
  2092. field = field.split('#').map(function (v) {
  2093. return isNumber(v) ? Number(v) : v;
  2094. });
  2095. return field;
  2096. };
  2097. /**
  2098. * 对象中设置值
  2099. * @param {Object|Array} object 源数据
  2100. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  2101. * @param {String} value 需要设置的值
  2102. */
  2103. exports.name2arr = name2arr;
  2104. var objSet = function objSet(object, path, value) {
  2105. if ((0, _typeof2.default)(object) !== 'object') return object;
  2106. _basePath(path).reduce(function (o, k, i, _) {
  2107. if (i === _.length - 1) {
  2108. // 若遍历结束直接赋值
  2109. o[k] = value;
  2110. return null;
  2111. } else if (k in o) {
  2112. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  2113. return o[k];
  2114. } else {
  2115. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  2116. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  2117. return o[k];
  2118. }
  2119. }, object);
  2120. // 返回object
  2121. return object;
  2122. };
  2123. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  2124. exports.objSet = objSet;
  2125. function _basePath(path) {
  2126. // 若是数组,则直接返回
  2127. if (Array.isArray(path)) return path;
  2128. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  2129. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  2130. }
  2131. /**
  2132. * 从对象中获取值
  2133. * @param {Object|Array} object 源数据
  2134. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  2135. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  2136. */
  2137. var objGet = function objGet(object, path) {
  2138. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  2139. // 先将path处理成统一格式
  2140. var newPath = _basePath(path);
  2141. // 递归处理,返回最后结果
  2142. var val = newPath.reduce(function (o, k) {
  2143. return (o || {})[k];
  2144. }, object);
  2145. return !val || val !== undefined ? val : defaultVal;
  2146. };
  2147. /**
  2148. * 是否为 number 类型
  2149. * @param {any} num 需要判断的值
  2150. * @return {Boolean} 是否为 number
  2151. */
  2152. exports.objGet = objGet;
  2153. var isNumber = function isNumber(num) {
  2154. return !isNaN(Number(num));
  2155. };
  2156. /**
  2157. * 是否为 boolean 类型
  2158. * @param {any} bool 需要判断的值
  2159. * @return {Boolean} 是否为 boolean
  2160. */
  2161. exports.isNumber = isNumber;
  2162. var isBoolean = function isBoolean(bool) {
  2163. return typeof bool === 'boolean';
  2164. };
  2165. /**
  2166. * 是否有必填字段
  2167. * @param {Object} rules 规则
  2168. * @return {Boolean} 是否有必填字段
  2169. */
  2170. exports.isBoolean = isBoolean;
  2171. var isRequiredField = function isRequiredField(rules) {
  2172. var isNoField = false;
  2173. for (var i = 0; i < rules.length; i++) {
  2174. var ruleData = rules[i];
  2175. if (ruleData.required) {
  2176. isNoField = true;
  2177. break;
  2178. }
  2179. }
  2180. return isNoField;
  2181. };
  2182. /**
  2183. * 获取数据类型
  2184. * @param {Any} obj 需要获取数据类型的值
  2185. */
  2186. exports.isRequiredField = isRequiredField;
  2187. var type = function type(obj) {
  2188. var class2type = {};
  2189. // 生成class2type映射
  2190. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  2191. class2type["[object " + item + "]"] = item.toLowerCase();
  2192. });
  2193. if (obj == null) {
  2194. return obj + "";
  2195. }
  2196. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  2197. };
  2198. /**
  2199. * 判断两个值是否相等
  2200. * @param {any} a 值
  2201. * @param {any} b 值
  2202. * @return {Boolean} 是否相等
  2203. */
  2204. exports.type = type;
  2205. var isEqual = function isEqual(a, b) {
  2206. //如果a和b本来就全等
  2207. if (a === b) {
  2208. //判断是否为0和-0
  2209. return a !== 0 || 1 / a === 1 / b;
  2210. }
  2211. //判断是否为null和undefined
  2212. if (a == null || b == null) {
  2213. return a === b;
  2214. }
  2215. //接下来判断a和b的数据类型
  2216. var classNameA = toString.call(a),
  2217. classNameB = toString.call(b);
  2218. //如果数据类型不相等,则返回false
  2219. if (classNameA !== classNameB) {
  2220. return false;
  2221. }
  2222. //如果数据类型相等,再根据不同数据类型分别判断
  2223. switch (classNameA) {
  2224. case '[object RegExp]':
  2225. case '[object String]':
  2226. //进行字符串转换比较
  2227. return '' + a === '' + b;
  2228. case '[object Number]':
  2229. //进行数字转换比较,判断是否为NaN
  2230. if (+a !== +a) {
  2231. return +b !== +b;
  2232. }
  2233. //判断是否为0或-0
  2234. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  2235. case '[object Date]':
  2236. case '[object Boolean]':
  2237. return +a === +b;
  2238. }
  2239. //如果是对象类型
  2240. if (classNameA == '[object Object]') {
  2241. //获取a和b的属性长度
  2242. var propsA = Object.getOwnPropertyNames(a),
  2243. propsB = Object.getOwnPropertyNames(b);
  2244. if (propsA.length != propsB.length) {
  2245. return false;
  2246. }
  2247. for (var i = 0; i < propsA.length; i++) {
  2248. var propName = propsA[i];
  2249. //如果对应属性对应值不相等,则返回false
  2250. if (a[propName] !== b[propName]) {
  2251. return false;
  2252. }
  2253. }
  2254. return true;
  2255. }
  2256. //如果是数组类型
  2257. if (classNameA == '[object Array]') {
  2258. if (a.toString() == b.toString()) {
  2259. return true;
  2260. }
  2261. return false;
  2262. }
  2263. };
  2264. exports.isEqual = isEqual;
  2265. /***/ }),
  2266. /***/ 18:
  2267. /*!******************************************************************!*\
  2268. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2269. \******************************************************************/
  2270. /*! no static exports found */
  2271. /***/ (function(module, exports, __webpack_require__) {
  2272. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2273. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2274. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2275. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2276. function _toConsumableArray(arr) {
  2277. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2278. }
  2279. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2280. /***/ }),
  2281. /***/ 19:
  2282. /*!******************************************************************!*\
  2283. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2284. \******************************************************************/
  2285. /*! no static exports found */
  2286. /***/ (function(module, exports, __webpack_require__) {
  2287. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2288. function _arrayWithoutHoles(arr) {
  2289. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2290. }
  2291. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2292. /***/ }),
  2293. /***/ 195:
  2294. /*!************************************************************************************!*\
  2295. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  2296. \************************************************************************************/
  2297. /*! no static exports found */
  2298. /***/ (function(module, exports, __webpack_require__) {
  2299. "use strict";
  2300. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  2301. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2302. Object.defineProperty(exports, "__esModule", {
  2303. value: true
  2304. });
  2305. exports.default = void 0;
  2306. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  2307. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2308. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2309. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  2310. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  2311. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  2312. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2313. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2314. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 169));
  2315. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 170));
  2316. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 172));
  2317. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 196));
  2318. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  2319. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 198));
  2320. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { 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(_e33) { throw _e33; }, 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 = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e34) { didErr = true; err = _e34; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  2321. 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); }
  2322. 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; }
  2323. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  2324. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  2325. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  2326. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  2327. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  2328. function n(e) {
  2329. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  2330. }
  2331. function s(e, t, n) {
  2332. return e(n = {
  2333. path: t,
  2334. exports: {},
  2335. require: function require(e, t) {
  2336. return function () {
  2337. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  2338. }(null == t && n.path);
  2339. }
  2340. }, n.exports), n.exports;
  2341. }
  2342. var r = s(function (e, t) {
  2343. var n;
  2344. e.exports = (n = n || function (e, t) {
  2345. var n = Object.create || function () {
  2346. function e() {}
  2347. return function (t) {
  2348. var n;
  2349. return e.prototype = t, n = new e(), e.prototype = null, n;
  2350. };
  2351. }(),
  2352. s = {},
  2353. r = s.lib = {},
  2354. i = r.Base = {
  2355. extend: function extend(e) {
  2356. var t = n(this);
  2357. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  2358. t.$super.init.apply(this, arguments);
  2359. }), t.init.prototype = t, t.$super = this, t;
  2360. },
  2361. create: function create() {
  2362. var e = this.extend();
  2363. return e.init.apply(e, arguments), e;
  2364. },
  2365. init: function init() {},
  2366. mixIn: function mixIn(e) {
  2367. for (var t in e) {
  2368. e.hasOwnProperty(t) && (this[t] = e[t]);
  2369. }
  2370. e.hasOwnProperty("toString") && (this.toString = e.toString);
  2371. },
  2372. clone: function clone() {
  2373. return this.init.prototype.extend(this);
  2374. }
  2375. },
  2376. o = r.WordArray = i.extend({
  2377. init: function init(e, n) {
  2378. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  2379. },
  2380. toString: function toString(e) {
  2381. return (e || c).stringify(this);
  2382. },
  2383. concat: function concat(e) {
  2384. var t = this.words,
  2385. n = e.words,
  2386. s = this.sigBytes,
  2387. r = e.sigBytes;
  2388. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  2389. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  2390. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  2391. } else for (i = 0; i < r; i += 4) {
  2392. t[s + i >>> 2] = n[i >>> 2];
  2393. }
  2394. return this.sigBytes += r, this;
  2395. },
  2396. clamp: function clamp() {
  2397. var t = this.words,
  2398. n = this.sigBytes;
  2399. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  2400. },
  2401. clone: function clone() {
  2402. var e = i.clone.call(this);
  2403. return e.words = this.words.slice(0), e;
  2404. },
  2405. random: function random(t) {
  2406. for (var n, s = [], r = function r(t) {
  2407. t = t;
  2408. var n = 987654321,
  2409. s = 4294967295;
  2410. return function () {
  2411. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  2412. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  2413. };
  2414. }, i = 0; i < t; i += 4) {
  2415. var a = r(4294967296 * (n || e.random()));
  2416. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  2417. }
  2418. return new o.init(s, t);
  2419. }
  2420. }),
  2421. a = s.enc = {},
  2422. c = a.Hex = {
  2423. stringify: function stringify(e) {
  2424. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  2425. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  2426. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  2427. }
  2428. return s.join("");
  2429. },
  2430. parse: function parse(e) {
  2431. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  2432. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  2433. }
  2434. return new o.init(n, t / 2);
  2435. }
  2436. },
  2437. u = a.Latin1 = {
  2438. stringify: function stringify(e) {
  2439. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  2440. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  2441. s.push(String.fromCharCode(i));
  2442. }
  2443. return s.join("");
  2444. },
  2445. parse: function parse(e) {
  2446. for (var t = e.length, n = [], s = 0; s < t; s++) {
  2447. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  2448. }
  2449. return new o.init(n, t);
  2450. }
  2451. },
  2452. l = a.Utf8 = {
  2453. stringify: function stringify(e) {
  2454. try {
  2455. return decodeURIComponent(escape(u.stringify(e)));
  2456. } catch (e) {
  2457. throw new Error("Malformed UTF-8 data");
  2458. }
  2459. },
  2460. parse: function parse(e) {
  2461. return u.parse(unescape(encodeURIComponent(e)));
  2462. }
  2463. },
  2464. h = r.BufferedBlockAlgorithm = i.extend({
  2465. reset: function reset() {
  2466. this._data = new o.init(), this._nDataBytes = 0;
  2467. },
  2468. _append: function _append(e) {
  2469. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  2470. },
  2471. _process: function _process(t) {
  2472. var n = this._data,
  2473. s = n.words,
  2474. r = n.sigBytes,
  2475. i = this.blockSize,
  2476. a = r / (4 * i),
  2477. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  2478. u = e.min(4 * c, r);
  2479. if (c) {
  2480. for (var l = 0; l < c; l += i) {
  2481. this._doProcessBlock(s, l);
  2482. }
  2483. var h = s.splice(0, c);
  2484. n.sigBytes -= u;
  2485. }
  2486. return new o.init(h, u);
  2487. },
  2488. clone: function clone() {
  2489. var e = i.clone.call(this);
  2490. return e._data = this._data.clone(), e;
  2491. },
  2492. _minBufferSize: 0
  2493. });
  2494. r.Hasher = h.extend({
  2495. cfg: i.extend(),
  2496. init: function init(e) {
  2497. this.cfg = this.cfg.extend(e), this.reset();
  2498. },
  2499. reset: function reset() {
  2500. h.reset.call(this), this._doReset();
  2501. },
  2502. update: function update(e) {
  2503. return this._append(e), this._process(), this;
  2504. },
  2505. finalize: function finalize(e) {
  2506. return e && this._append(e), this._doFinalize();
  2507. },
  2508. blockSize: 16,
  2509. _createHelper: function _createHelper(e) {
  2510. return function (t, n) {
  2511. return new e.init(n).finalize(t);
  2512. };
  2513. },
  2514. _createHmacHelper: function _createHmacHelper(e) {
  2515. return function (t, n) {
  2516. return new d.HMAC.init(e, n).finalize(t);
  2517. };
  2518. }
  2519. });
  2520. var d = s.algo = {};
  2521. return s;
  2522. }(Math), n);
  2523. }),
  2524. i = r,
  2525. o = (s(function (e, t) {
  2526. var n;
  2527. e.exports = (n = i, function (e) {
  2528. var t = n,
  2529. s = t.lib,
  2530. r = s.WordArray,
  2531. i = s.Hasher,
  2532. o = t.algo,
  2533. a = [];
  2534. !function () {
  2535. for (var t = 0; t < 64; t++) {
  2536. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  2537. }
  2538. }();
  2539. var c = o.MD5 = i.extend({
  2540. _doReset: function _doReset() {
  2541. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  2542. },
  2543. _doProcessBlock: function _doProcessBlock(e, t) {
  2544. for (var n = 0; n < 16; n++) {
  2545. var s = t + n,
  2546. r = e[s];
  2547. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  2548. }
  2549. var i = this._hash.words,
  2550. o = e[t + 0],
  2551. c = e[t + 1],
  2552. f = e[t + 2],
  2553. p = e[t + 3],
  2554. g = e[t + 4],
  2555. m = e[t + 5],
  2556. y = e[t + 6],
  2557. _ = e[t + 7],
  2558. w = e[t + 8],
  2559. v = e[t + 9],
  2560. S = e[t + 10],
  2561. k = e[t + 11],
  2562. I = e[t + 12],
  2563. b = e[t + 13],
  2564. T = e[t + 14],
  2565. A = e[t + 15],
  2566. C = i[0],
  2567. P = i[1],
  2568. E = i[2],
  2569. O = i[3];
  2570. C = u(C, P, E, O, o, 7, a[0]), O = u(O, C, P, E, c, 12, a[1]), E = u(E, O, C, P, f, 17, a[2]), P = u(P, E, O, C, p, 22, a[3]), C = u(C, P, E, O, g, 7, a[4]), O = u(O, C, P, E, m, 12, a[5]), E = u(E, O, C, P, y, 17, a[6]), P = u(P, E, O, C, _, 22, a[7]), C = u(C, P, E, O, w, 7, a[8]), O = u(O, C, P, E, v, 12, a[9]), E = u(E, O, C, P, S, 17, a[10]), P = u(P, E, O, C, k, 22, a[11]), C = u(C, P, E, O, I, 7, a[12]), O = u(O, C, P, E, b, 12, a[13]), E = u(E, O, C, P, T, 17, a[14]), C = l(C, P = u(P, E, O, C, A, 22, a[15]), E, O, c, 5, a[16]), O = l(O, C, P, E, y, 9, a[17]), E = l(E, O, C, P, k, 14, a[18]), P = l(P, E, O, C, o, 20, a[19]), C = l(C, P, E, O, m, 5, a[20]), O = l(O, C, P, E, S, 9, a[21]), E = l(E, O, C, P, A, 14, a[22]), P = l(P, E, O, C, g, 20, a[23]), C = l(C, P, E, O, v, 5, a[24]), O = l(O, C, P, E, T, 9, a[25]), E = l(E, O, C, P, p, 14, a[26]), P = l(P, E, O, C, w, 20, a[27]), C = l(C, P, E, O, b, 5, a[28]), O = l(O, C, P, E, f, 9, a[29]), E = l(E, O, C, P, _, 14, a[30]), C = h(C, P = l(P, E, O, C, I, 20, a[31]), E, O, m, 4, a[32]), O = h(O, C, P, E, w, 11, a[33]), E = h(E, O, C, P, k, 16, a[34]), P = h(P, E, O, C, T, 23, a[35]), C = h(C, P, E, O, c, 4, a[36]), O = h(O, C, P, E, g, 11, a[37]), E = h(E, O, C, P, _, 16, a[38]), P = h(P, E, O, C, S, 23, a[39]), C = h(C, P, E, O, b, 4, a[40]), O = h(O, C, P, E, o, 11, a[41]), E = h(E, O, C, P, p, 16, a[42]), P = h(P, E, O, C, y, 23, a[43]), C = h(C, P, E, O, v, 4, a[44]), O = h(O, C, P, E, I, 11, a[45]), E = h(E, O, C, P, A, 16, a[46]), C = d(C, P = h(P, E, O, C, f, 23, a[47]), E, O, o, 6, a[48]), O = d(O, C, P, E, _, 10, a[49]), E = d(E, O, C, P, T, 15, a[50]), P = d(P, E, O, C, m, 21, a[51]), C = d(C, P, E, O, I, 6, a[52]), O = d(O, C, P, E, p, 10, a[53]), E = d(E, O, C, P, S, 15, a[54]), P = d(P, E, O, C, c, 21, a[55]), C = d(C, P, E, O, w, 6, a[56]), O = d(O, C, P, E, A, 10, a[57]), E = d(E, O, C, P, y, 15, a[58]), P = d(P, E, O, C, b, 21, a[59]), C = d(C, P, E, O, g, 6, a[60]), O = d(O, C, P, E, k, 10, a[61]), E = d(E, O, C, P, f, 15, a[62]), P = d(P, E, O, C, v, 21, a[63]), i[0] = i[0] + C | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  2571. },
  2572. _doFinalize: function _doFinalize() {
  2573. var t = this._data,
  2574. n = t.words,
  2575. s = 8 * this._nDataBytes,
  2576. r = 8 * t.sigBytes;
  2577. n[r >>> 5] |= 128 << 24 - r % 32;
  2578. var i = e.floor(s / 4294967296),
  2579. o = s;
  2580. n[15 + (r + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), n[14 + (r + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();
  2581. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  2582. var l = c[u];
  2583. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  2584. }
  2585. return a;
  2586. },
  2587. clone: function clone() {
  2588. var e = i.clone.call(this);
  2589. return e._hash = this._hash.clone(), e;
  2590. }
  2591. });
  2592. function u(e, t, n, s, r, i, o) {
  2593. var a = e + (t & n | ~t & s) + r + o;
  2594. return (a << i | a >>> 32 - i) + t;
  2595. }
  2596. function l(e, t, n, s, r, i, o) {
  2597. var a = e + (t & s | n & ~s) + r + o;
  2598. return (a << i | a >>> 32 - i) + t;
  2599. }
  2600. function h(e, t, n, s, r, i, o) {
  2601. var a = e + (t ^ n ^ s) + r + o;
  2602. return (a << i | a >>> 32 - i) + t;
  2603. }
  2604. function d(e, t, n, s, r, i, o) {
  2605. var a = e + (n ^ (t | ~s)) + r + o;
  2606. return (a << i | a >>> 32 - i) + t;
  2607. }
  2608. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  2609. }(Math), n.MD5);
  2610. }), s(function (e, t) {
  2611. var n;
  2612. e.exports = (n = i, void function () {
  2613. var e = n,
  2614. t = e.lib.Base,
  2615. s = e.enc.Utf8;
  2616. e.algo.HMAC = t.extend({
  2617. init: function init(e, t) {
  2618. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  2619. var n = e.blockSize,
  2620. r = 4 * n;
  2621. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  2622. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  2623. a[u] ^= 1549556828, c[u] ^= 909522486;
  2624. }
  2625. i.sigBytes = o.sigBytes = r, this.reset();
  2626. },
  2627. reset: function reset() {
  2628. var e = this._hasher;
  2629. e.reset(), e.update(this._iKey);
  2630. },
  2631. update: function update(e) {
  2632. return this._hasher.update(e), this;
  2633. },
  2634. finalize: function finalize(e) {
  2635. var t = this._hasher,
  2636. n = t.finalize(e);
  2637. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  2638. }
  2639. });
  2640. }());
  2641. }), s(function (e, t) {
  2642. e.exports = i.HmacMD5;
  2643. })),
  2644. a = s(function (e, t) {
  2645. e.exports = i.enc.Utf8;
  2646. }),
  2647. c = s(function (e, t) {
  2648. var n;
  2649. e.exports = (n = i, function () {
  2650. var e = n,
  2651. t = e.lib.WordArray;
  2652. function s(e, n, s) {
  2653. for (var r = [], i = 0, o = 0; o < n; o++) {
  2654. if (o % 4) {
  2655. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  2656. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  2657. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  2658. }
  2659. }
  2660. return t.create(r, i);
  2661. }
  2662. e.enc.Base64 = {
  2663. stringify: function stringify(e) {
  2664. var t = e.words,
  2665. n = e.sigBytes,
  2666. s = this._map;
  2667. e.clamp();
  2668. for (var r = [], i = 0; i < n; i += 3) {
  2669. for (var o = (t[i >>> 2] >>> 24 - i % 4 * 8 & 255) << 16 | (t[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255) << 8 | t[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, a = 0; a < 4 && i + .75 * a < n; a++) {
  2670. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  2671. }
  2672. }
  2673. var c = s.charAt(64);
  2674. if (c) for (; r.length % 4;) {
  2675. r.push(c);
  2676. }
  2677. return r.join("");
  2678. },
  2679. parse: function parse(e) {
  2680. var t = e.length,
  2681. n = this._map,
  2682. r = this._reverseMap;
  2683. if (!r) {
  2684. r = this._reverseMap = [];
  2685. for (var i = 0; i < n.length; i++) {
  2686. r[n.charCodeAt(i)] = i;
  2687. }
  2688. }
  2689. var o = n.charAt(64);
  2690. if (o) {
  2691. var a = e.indexOf(o);
  2692. -1 !== a && (t = a);
  2693. }
  2694. return s(e, t, r);
  2695. },
  2696. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  2697. };
  2698. }(), n.enc.Base64);
  2699. });
  2700. var u = "FUNCTION",
  2701. l = "OBJECT",
  2702. h = "CLIENT_DB";
  2703. function d(e) {
  2704. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  2705. }
  2706. function f(e) {
  2707. return "object" === d(e);
  2708. }
  2709. function p(e) {
  2710. return "function" == typeof e;
  2711. }
  2712. function g(e) {
  2713. return function () {
  2714. try {
  2715. return e.apply(e, arguments);
  2716. } catch (e) {
  2717. console.error(e);
  2718. }
  2719. };
  2720. }
  2721. function m(e) {
  2722. return e && "string" == typeof e ? JSON.parse(e) : e;
  2723. }
  2724. var y = "development" === "development",
  2725. _ = "mp-weixin",
  2726. w = "true" === undefined || !0 === undefined,
  2727. v = m([]);
  2728. var S;
  2729. S = "h5" === _ ? "web" : "app-plus" === _ ? "app" : _;
  2730. var k = m(undefined),
  2731. I = m([]) || [],
  2732. b = true;
  2733. var T = "";
  2734. try {
  2735. {
  2736. var _e2 = __webpack_require__(/*! uni-stat-config */ 199).default || __webpack_require__(/*! uni-stat-config */ 199);
  2737. T = _e2.appid;
  2738. }
  2739. } catch (e) {}
  2740. var A = {};
  2741. function C(e) {
  2742. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2743. var n, s;
  2744. return n = A, s = e, Object.prototype.hasOwnProperty.call(n, s) || (A[e] = t), A[e];
  2745. }
  2746. "app" === S && (A = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  2747. var P = ["invoke", "success", "fail", "complete"],
  2748. E = C("_globalUniCloudInterceptor");
  2749. function O(e, t) {
  2750. E[e] || (E[e] = {}), f(t) && Object.keys(t).forEach(function (n) {
  2751. P.indexOf(n) > -1 && function (e, t, n) {
  2752. var s = E[e][t];
  2753. s || (s = E[e][t] = []), -1 === s.indexOf(n) && p(n) && s.push(n);
  2754. }(e, n, t[n]);
  2755. });
  2756. }
  2757. function x(e, t) {
  2758. E[e] || (E[e] = {}), f(t) ? Object.keys(t).forEach(function (n) {
  2759. P.indexOf(n) > -1 && function (e, t, n) {
  2760. var s = E[e][t];
  2761. if (!s) return;
  2762. var r = s.indexOf(n);
  2763. r > -1 && s.splice(r, 1);
  2764. }(e, n, t[n]);
  2765. }) : delete E[e];
  2766. }
  2767. function U(e, t) {
  2768. return e && 0 !== e.length ? e.reduce(function (e, n) {
  2769. return e.then(function () {
  2770. return n(t);
  2771. });
  2772. }, Promise.resolve()) : Promise.resolve();
  2773. }
  2774. function R(e, t) {
  2775. return E[e] && E[e][t] || [];
  2776. }
  2777. function L(e) {
  2778. O("callObject", e);
  2779. }
  2780. var N = C("_globalUniCloudListener"),
  2781. D = "response",
  2782. F = "needLogin",
  2783. q = "refreshToken",
  2784. K = "clientdb",
  2785. M = "cloudfunction",
  2786. j = "cloudobject";
  2787. function B(e) {
  2788. return N[e] || (N[e] = []), N[e];
  2789. }
  2790. function $(e, t) {
  2791. var n = B(e);
  2792. n.includes(t) || n.push(t);
  2793. }
  2794. function W(e, t) {
  2795. var n = B(e),
  2796. s = n.indexOf(t);
  2797. -1 !== s && n.splice(s, 1);
  2798. }
  2799. function z(e, t) {
  2800. var n = B(e);
  2801. for (var _e3 = 0; _e3 < n.length; _e3++) {
  2802. (0, n[_e3])(t);
  2803. }
  2804. }
  2805. var J,
  2806. H = !1;
  2807. function G() {
  2808. return J || (J = new Promise(function (e) {
  2809. H && e(), function t() {
  2810. if ("function" == typeof getCurrentPages) {
  2811. var _t2 = getCurrentPages();
  2812. _t2 && _t2[0] && (H = !0, e());
  2813. }
  2814. H || setTimeout(function () {
  2815. t();
  2816. }, 30);
  2817. }();
  2818. }), J);
  2819. }
  2820. function V(e) {
  2821. var t = {};
  2822. for (var _n2 in e) {
  2823. var _s2 = e[_n2];
  2824. p(_s2) && (t[_n2] = g(_s2));
  2825. }
  2826. return t;
  2827. }
  2828. function Y(e, t) {
  2829. return t ? function (n) {
  2830. var _this = this;
  2831. var s = !1;
  2832. if ("callFunction" === t) {
  2833. var _e4 = n && n.type || u;
  2834. s = _e4 !== u;
  2835. }
  2836. var r = "callFunction" === t && !s;
  2837. var i;
  2838. i = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};
  2839. var _V = V(n),
  2840. o = _V.success,
  2841. a = _V.fail,
  2842. c = _V.complete,
  2843. l = i.then(function () {
  2844. return s ? Promise.resolve() : U(R(t, "invoke"), n);
  2845. }).then(function () {
  2846. return e.call(_this, n);
  2847. }).then(function (e) {
  2848. return s ? Promise.resolve(e) : U(R(t, "success"), e).then(function () {
  2849. return U(R(t, "complete"), e);
  2850. }).then(function () {
  2851. return r && z(D, {
  2852. type: M,
  2853. content: e
  2854. }), Promise.resolve(e);
  2855. });
  2856. }, function (e) {
  2857. return s ? Promise.reject(e) : U(R(t, "fail"), e).then(function () {
  2858. return U(R(t, "complete"), e);
  2859. }).then(function () {
  2860. return z(D, {
  2861. type: M,
  2862. content: e
  2863. }), Promise.reject(e);
  2864. });
  2865. });
  2866. if (!(o || a || c)) return l;
  2867. l.then(function (e) {
  2868. o && o(e), c && c(e), r && z(D, {
  2869. type: M,
  2870. content: e
  2871. });
  2872. }, function (e) {
  2873. a && a(e), c && c(e), r && z(D, {
  2874. type: M,
  2875. content: e
  2876. });
  2877. });
  2878. } : function (t) {
  2879. t = t || {};
  2880. var _V2 = V(t),
  2881. n = _V2.success,
  2882. s = _V2.fail,
  2883. r = _V2.complete;
  2884. if (!(n || s || r)) return e.call(this, t);
  2885. e.call(this, t).then(function (e) {
  2886. n && n(e), r && r(e);
  2887. }, function (e) {
  2888. s && s(e), r && r(e);
  2889. });
  2890. };
  2891. }
  2892. var Q = /*#__PURE__*/function (_Error) {
  2893. (0, _inherits2.default)(Q, _Error);
  2894. var _super = _createSuper(Q);
  2895. function Q(e) {
  2896. var _this2;
  2897. (0, _classCallCheck2.default)(this, Q);
  2898. _this2 = _super.call(this, e.message), _this2.errMsg = e.message || e.errMsg || "unknown system error", _this2.code = _this2.errCode = e.code || e.errCode || "SYSTEM_ERROR", _this2.errSubject = _this2.subject = e.subject || e.errSubject, _this2.cause = e.cause, _this2.requestId = e.requestId;
  2899. return _this2;
  2900. }
  2901. (0, _createClass2.default)(Q, [{
  2902. key: "toJson",
  2903. value: function toJson() {
  2904. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  2905. if (!(e >= 10)) return e++, {
  2906. errCode: this.errCode,
  2907. errMsg: this.errMsg,
  2908. errSubject: this.errSubject,
  2909. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  2910. };
  2911. }
  2912. }]);
  2913. return Q;
  2914. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  2915. var X = {
  2916. request: function request(e) {
  2917. return uni.request(e);
  2918. },
  2919. uploadFile: function uploadFile(e) {
  2920. return uni.uploadFile(e);
  2921. },
  2922. setStorageSync: function setStorageSync(e, t) {
  2923. return uni.setStorageSync(e, t);
  2924. },
  2925. getStorageSync: function getStorageSync(e) {
  2926. return uni.getStorageSync(e);
  2927. },
  2928. removeStorageSync: function removeStorageSync(e) {
  2929. return uni.removeStorageSync(e);
  2930. },
  2931. clearStorageSync: function clearStorageSync() {
  2932. return uni.clearStorageSync();
  2933. }
  2934. };
  2935. function Z() {
  2936. return {
  2937. token: X.getStorageSync("uni_id_token") || X.getStorageSync("uniIdToken"),
  2938. tokenExpired: X.getStorageSync("uni_id_token_expired")
  2939. };
  2940. }
  2941. function ee() {
  2942. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  2943. e = _ref.token,
  2944. t = _ref.tokenExpired;
  2945. e && X.setStorageSync("uni_id_token", e), t && X.setStorageSync("uni_id_token_expired", t);
  2946. }
  2947. function te() {
  2948. if (!y || "web" !== S) return;
  2949. uni.getStorageSync("__LAST_DCLOUD_APPID") !== T && (uni.setStorageSync("__LAST_DCLOUD_APPID", T), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), X.removeStorageSync("uni_id_token"), X.removeStorageSync("uniIdToken"), X.removeStorageSync("uni_id_token_expired"));
  2950. }
  2951. var ne, se;
  2952. function re() {
  2953. return ne || (ne = uni.getSystemInfoSync()), ne;
  2954. }
  2955. function ie() {
  2956. var e, t;
  2957. try {
  2958. if (uni.getLaunchOptionsSync) {
  2959. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  2960. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  2961. _n3 = _uni$getLaunchOptions.scene,
  2962. _s3 = _uni$getLaunchOptions.channel;
  2963. e = _s3, t = _n3;
  2964. }
  2965. } catch (e) {}
  2966. return {
  2967. channel: e,
  2968. scene: t
  2969. };
  2970. }
  2971. function oe() {
  2972. var e = uni.getLocale && uni.getLocale() || "en";
  2973. if (se) return _objectSpread(_objectSpread({}, se), {}, {
  2974. locale: e,
  2975. LOCALE: e
  2976. });
  2977. var t = re(),
  2978. n = t.deviceId,
  2979. s = t.osName,
  2980. r = t.uniPlatform,
  2981. i = t.appId,
  2982. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  2983. for (var _e5 = 0; _e5 < o.length; _e5++) {
  2984. delete t[o[_e5]];
  2985. }
  2986. return se = _objectSpread(_objectSpread({
  2987. PLATFORM: r,
  2988. OS: s,
  2989. APPID: i,
  2990. DEVICEID: n
  2991. }, ie()), t), _objectSpread(_objectSpread({}, se), {}, {
  2992. locale: e,
  2993. LOCALE: e
  2994. });
  2995. }
  2996. var ae = {
  2997. sign: function sign(e, t) {
  2998. var n = "";
  2999. return Object.keys(e).sort().forEach(function (t) {
  3000. e[t] && (n = n + "&" + t + "=" + e[t]);
  3001. }), n = n.slice(1), o(n, t).toString();
  3002. },
  3003. wrappedRequest: function wrappedRequest(e, t) {
  3004. return new Promise(function (n, s) {
  3005. t(Object.assign(e, {
  3006. complete: function complete(e) {
  3007. e || (e = {}), y && "web" === S && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  3008. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  3009. if (!e.statusCode || e.statusCode >= 400) return s(new Q({
  3010. code: "SYS_ERR",
  3011. message: e.errMsg || "request:fail",
  3012. requestId: t
  3013. }));
  3014. var r = e.data;
  3015. if (r.error) return s(new Q({
  3016. code: r.error.code,
  3017. message: r.error.message,
  3018. requestId: t
  3019. }));
  3020. r.result = r.data, r.requestId = t, delete r.data, n(r);
  3021. }
  3022. }));
  3023. });
  3024. },
  3025. toBase64: function toBase64(e) {
  3026. return c.stringify(a.parse(e));
  3027. }
  3028. },
  3029. ce = {
  3030. "uniCloud.init.paramRequired": "{param} required",
  3031. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  3032. };
  3033. var _e6 = (0, _uniI18n.initVueI18n)({
  3034. "zh-Hans": {
  3035. "uniCloud.init.paramRequired": "缺少参数:{param}",
  3036. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  3037. },
  3038. "zh-Hant": {
  3039. "uniCloud.init.paramRequired": "缺少参数:{param}",
  3040. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  3041. },
  3042. en: ce,
  3043. fr: {
  3044. "uniCloud.init.paramRequired": "{param} required",
  3045. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  3046. },
  3047. es: {
  3048. "uniCloud.init.paramRequired": "{param} required",
  3049. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  3050. },
  3051. ja: ce
  3052. }, "zh-Hans"),
  3053. ue = _e6.t;
  3054. var le = /*#__PURE__*/function () {
  3055. function le(e) {
  3056. (0, _classCallCheck2.default)(this, le);
  3057. ["spaceId", "clientSecret"].forEach(function (t) {
  3058. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(ue("uniCloud.init.paramRequired", {
  3059. param: t
  3060. }));
  3061. }), this.config = Object.assign({}, {
  3062. endpoint: "https://api.bspapp.com"
  3063. }, 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 = X, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;
  3064. }
  3065. (0, _createClass2.default)(le, [{
  3066. key: "hasAccessToken",
  3067. get: function get() {
  3068. return !!this.accessToken;
  3069. }
  3070. }, {
  3071. key: "setAccessToken",
  3072. value: function setAccessToken(e) {
  3073. this.accessToken = e;
  3074. }
  3075. }, {
  3076. key: "requestWrapped",
  3077. value: function requestWrapped(e) {
  3078. return ae.wrappedRequest(e, this.adapter.request);
  3079. }
  3080. }, {
  3081. key: "requestAuth",
  3082. value: function requestAuth(e) {
  3083. return this.requestWrapped(e);
  3084. }
  3085. }, {
  3086. key: "request",
  3087. value: function request(e, t) {
  3088. var _this3 = this;
  3089. return Promise.resolve().then(function () {
  3090. return _this3.hasAccessToken ? t ? _this3.requestWrapped(e) : _this3.requestWrapped(e).catch(function (t) {
  3091. return new Promise(function (e, n) {
  3092. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  3093. }).then(function () {
  3094. return _this3.getAccessToken();
  3095. }).then(function () {
  3096. var t = _this3.rebuildRequest(e);
  3097. return _this3.request(t, !0);
  3098. });
  3099. }) : _this3.getAccessToken().then(function () {
  3100. var t = _this3.rebuildRequest(e);
  3101. return _this3.request(t, !0);
  3102. });
  3103. });
  3104. }
  3105. }, {
  3106. key: "rebuildRequest",
  3107. value: function rebuildRequest(e) {
  3108. var t = Object.assign({}, e);
  3109. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = ae.sign(t.data, this.config.clientSecret), t;
  3110. }
  3111. }, {
  3112. key: "setupRequest",
  3113. value: function setupRequest(e, t) {
  3114. var n = Object.assign({}, e, {
  3115. spaceId: this.config.spaceId,
  3116. timestamp: Date.now()
  3117. }),
  3118. s = {
  3119. "Content-Type": "application/json"
  3120. };
  3121. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret), {
  3122. url: this.config.requestUrl,
  3123. method: "POST",
  3124. data: n,
  3125. dataType: "json",
  3126. header: s
  3127. };
  3128. }
  3129. }, {
  3130. key: "getAccessToken",
  3131. value: function getAccessToken() {
  3132. var _this4 = this;
  3133. if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;
  3134. this._getAccessTokenPromiseStatus = "pending";
  3135. return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({
  3136. method: "serverless.auth.user.anonymousAuthorize",
  3137. params: "{}"
  3138. }, "auth")).then(function (e) {
  3139. return new Promise(function (t, n) {
  3140. e.result && e.result.accessToken ? (_this4.setAccessToken(e.result.accessToken), _this4._getAccessTokenPromiseStatus = "fulfilled", t(_this4.accessToken)) : (_this4._getAccessTokenPromiseStatus = "rejected", n(new Q({
  3141. code: "AUTH_FAILED",
  3142. message: "获取accessToken失败"
  3143. })));
  3144. });
  3145. }, function (e) {
  3146. return _this4._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);
  3147. }), this._getAccessTokenPromise;
  3148. }
  3149. }, {
  3150. key: "authorize",
  3151. value: function authorize() {
  3152. this.getAccessToken();
  3153. }
  3154. }, {
  3155. key: "callFunction",
  3156. value: function callFunction(e) {
  3157. var t = {
  3158. method: "serverless.function.runtime.invoke",
  3159. params: JSON.stringify({
  3160. functionTarget: e.name,
  3161. functionArgs: e.data || {}
  3162. })
  3163. };
  3164. return this.request(this.setupRequest(t));
  3165. }
  3166. }, {
  3167. key: "getOSSUploadOptionsFromPath",
  3168. value: function getOSSUploadOptionsFromPath(e) {
  3169. var t = {
  3170. method: "serverless.file.resource.generateProximalSign",
  3171. params: JSON.stringify(e)
  3172. };
  3173. return this.request(this.setupRequest(t));
  3174. }
  3175. }, {
  3176. key: "uploadFileToOSS",
  3177. value: function uploadFileToOSS(_ref2) {
  3178. var _this5 = this;
  3179. var e = _ref2.url,
  3180. t = _ref2.formData,
  3181. n = _ref2.name,
  3182. s = _ref2.filePath,
  3183. r = _ref2.fileType,
  3184. i = _ref2.onUploadProgress;
  3185. return new Promise(function (o, a) {
  3186. var c = _this5.adapter.uploadFile({
  3187. url: e,
  3188. formData: t,
  3189. name: n,
  3190. filePath: s,
  3191. fileType: r,
  3192. header: {
  3193. "X-OSS-server-side-encrpytion": "AES256"
  3194. },
  3195. success: function success(e) {
  3196. e && e.statusCode < 400 ? o(e) : a(new Q({
  3197. code: "UPLOAD_FAILED",
  3198. message: "文件上传失败"
  3199. }));
  3200. },
  3201. fail: function fail(e) {
  3202. a(new Q({
  3203. code: e.code || "UPLOAD_FAILED",
  3204. message: e.message || e.errMsg || "文件上传失败"
  3205. }));
  3206. }
  3207. });
  3208. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  3209. i({
  3210. loaded: e.totalBytesSent,
  3211. total: e.totalBytesExpectedToSend
  3212. });
  3213. });
  3214. });
  3215. }
  3216. }, {
  3217. key: "reportOSSUpload",
  3218. value: function reportOSSUpload(e) {
  3219. var t = {
  3220. method: "serverless.file.resource.report",
  3221. params: JSON.stringify(e)
  3222. };
  3223. return this.request(this.setupRequest(t));
  3224. }
  3225. }, {
  3226. key: "uploadFile",
  3227. value: function () {
  3228. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
  3229. var e, t, _ref3$fileType, n, s, r, i, o, a, c, u, l, h, f, p, g, m, y, _e7, _;
  3230. return _regenerator.default.wrap(function _callee$(_context) {
  3231. while (1) {
  3232. switch (_context.prev = _context.next) {
  3233. case 0:
  3234. e = _ref3.filePath, t = _ref3.cloudPath, _ref3$fileType = _ref3.fileType, n = _ref3$fileType === void 0 ? "image" : _ref3$fileType, s = _ref3.onUploadProgress, r = _ref3.config;
  3235. if (!("string" !== d(t))) {
  3236. _context.next = 3;
  3237. break;
  3238. }
  3239. throw new Q({
  3240. code: "INVALID_PARAM",
  3241. message: "cloudPath必须为字符串类型"
  3242. });
  3243. case 3:
  3244. if (t = t.trim()) {
  3245. _context.next = 5;
  3246. break;
  3247. }
  3248. throw new Q({
  3249. code: "CLOUDPATH_REQUIRED",
  3250. message: "cloudPath不可为空"
  3251. });
  3252. case 5:
  3253. if (!/:\/\//.test(t)) {
  3254. _context.next = 7;
  3255. break;
  3256. }
  3257. throw new Q({
  3258. code: "INVALID_PARAM",
  3259. message: "cloudPath不合法"
  3260. });
  3261. case 7:
  3262. i = r && r.envType || this.config.envType;
  3263. _context.next = 10;
  3264. return this.getOSSUploadOptionsFromPath({
  3265. env: i,
  3266. filename: t
  3267. });
  3268. case 10:
  3269. o = _context.sent.result;
  3270. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  3271. c = o.securityToken;
  3272. u = o.accessKeyId;
  3273. l = o.signature;
  3274. h = o.host;
  3275. f = o.ossPath;
  3276. p = o.id;
  3277. g = o.policy;
  3278. m = o.ossCallbackUrl;
  3279. y = {
  3280. "Cache-Control": "max-age=2592000",
  3281. "Content-Disposition": "attachment",
  3282. OSSAccessKeyId: u,
  3283. Signature: l,
  3284. host: h,
  3285. id: p,
  3286. key: f,
  3287. policy: g,
  3288. success_action_status: 200
  3289. };
  3290. if (c && (y["x-oss-security-token"] = c), m) {
  3291. _e7 = JSON.stringify({
  3292. callbackUrl: m,
  3293. callbackBody: JSON.stringify({
  3294. fileId: p,
  3295. spaceId: this.config.spaceId
  3296. }),
  3297. callbackBodyType: "application/json"
  3298. });
  3299. y.callback = ae.toBase64(_e7);
  3300. }
  3301. _ = {
  3302. url: "https://" + o.host,
  3303. formData: y,
  3304. fileName: "file",
  3305. name: "file",
  3306. filePath: e,
  3307. fileType: n
  3308. };
  3309. _context.next = 25;
  3310. return this.uploadFileToOSS(Object.assign({}, _, {
  3311. onUploadProgress: s
  3312. }));
  3313. case 25:
  3314. if (!m) {
  3315. _context.next = 27;
  3316. break;
  3317. }
  3318. return _context.abrupt("return", {
  3319. success: !0,
  3320. filePath: e,
  3321. fileID: a
  3322. });
  3323. case 27:
  3324. _context.next = 29;
  3325. return this.reportOSSUpload({
  3326. id: p
  3327. });
  3328. case 29:
  3329. if (!_context.sent.success) {
  3330. _context.next = 31;
  3331. break;
  3332. }
  3333. return _context.abrupt("return", {
  3334. success: !0,
  3335. filePath: e,
  3336. fileID: a
  3337. });
  3338. case 31:
  3339. throw new Q({
  3340. code: "UPLOAD_FAILED",
  3341. message: "文件上传失败"
  3342. });
  3343. case 32:
  3344. case "end":
  3345. return _context.stop();
  3346. }
  3347. }
  3348. }, _callee, this);
  3349. }));
  3350. function uploadFile(_x) {
  3351. return _uploadFile.apply(this, arguments);
  3352. }
  3353. return uploadFile;
  3354. }()
  3355. }, {
  3356. key: "getTempFileURL",
  3357. value: function getTempFileURL() {
  3358. var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  3359. e = _ref4.fileList;
  3360. return new Promise(function (t, n) {
  3361. Array.isArray(e) && 0 !== e.length || n(new Q({
  3362. code: "INVALID_PARAM",
  3363. message: "fileList的元素必须是非空的字符串"
  3364. })), t({
  3365. fileList: e.map(function (e) {
  3366. return {
  3367. fileID: e,
  3368. tempFileURL: e
  3369. };
  3370. })
  3371. });
  3372. });
  3373. }
  3374. }, {
  3375. key: "getFileInfo",
  3376. value: function () {
  3377. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  3378. var _ref5,
  3379. e,
  3380. t,
  3381. _args2 = arguments;
  3382. return _regenerator.default.wrap(function _callee2$(_context2) {
  3383. while (1) {
  3384. switch (_context2.prev = _context2.next) {
  3385. case 0:
  3386. _ref5 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref5.fileList;
  3387. if (!(!Array.isArray(e) || 0 === e.length)) {
  3388. _context2.next = 3;
  3389. break;
  3390. }
  3391. throw new Q({
  3392. code: "INVALID_PARAM",
  3393. message: "fileList的元素必须是非空的字符串"
  3394. });
  3395. case 3:
  3396. t = {
  3397. method: "serverless.file.resource.info",
  3398. params: JSON.stringify({
  3399. id: e.map(function (e) {
  3400. return e.split("?")[0];
  3401. }).join(",")
  3402. })
  3403. };
  3404. _context2.next = 6;
  3405. return this.request(this.setupRequest(t));
  3406. case 6:
  3407. _context2.t0 = _context2.sent.result;
  3408. return _context2.abrupt("return", {
  3409. fileList: _context2.t0
  3410. });
  3411. case 8:
  3412. case "end":
  3413. return _context2.stop();
  3414. }
  3415. }
  3416. }, _callee2, this);
  3417. }));
  3418. function getFileInfo() {
  3419. return _getFileInfo.apply(this, arguments);
  3420. }
  3421. return getFileInfo;
  3422. }()
  3423. }]);
  3424. return le;
  3425. }();
  3426. var he = {
  3427. init: function init(e) {
  3428. var t = new le(e),
  3429. n = {
  3430. signInAnonymously: function signInAnonymously() {
  3431. return t.authorize();
  3432. },
  3433. getLoginState: function getLoginState() {
  3434. return Promise.resolve(!1);
  3435. }
  3436. };
  3437. return t.auth = function () {
  3438. return n;
  3439. }, t.customAuth = t.auth, t;
  3440. }
  3441. };
  3442. var de = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  3443. var fe;
  3444. !function (e) {
  3445. e.local = "local", e.none = "none", e.session = "session";
  3446. }(fe || (fe = {}));
  3447. var pe = function pe() {};
  3448. var ge = function ge() {
  3449. var e;
  3450. if (!Promise) {
  3451. e = function e() {}, e.promise = {};
  3452. var _t3 = function _t3() {
  3453. throw new Q({
  3454. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  3455. });
  3456. };
  3457. return Object.defineProperty(e.promise, "then", {
  3458. get: _t3
  3459. }), Object.defineProperty(e.promise, "catch", {
  3460. get: _t3
  3461. }), e;
  3462. }
  3463. var t = new Promise(function (t, n) {
  3464. e = function e(_e8, s) {
  3465. return _e8 ? n(_e8) : t(s);
  3466. };
  3467. });
  3468. return e.promise = t, e;
  3469. };
  3470. function me(e) {
  3471. return void 0 === e;
  3472. }
  3473. function ye(e) {
  3474. return "[object Null]" === Object.prototype.toString.call(e);
  3475. }
  3476. var _e;
  3477. function we(e) {
  3478. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  3479. var n;
  3480. var _iterator = _createForOfIteratorHelper(t),
  3481. _step;
  3482. try {
  3483. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  3484. var _e9 = _step.value;
  3485. var _t4 = _e9.isMatch,
  3486. _n4 = _e9.genAdapter,
  3487. _s4 = _e9.runtime;
  3488. if (_t4()) return {
  3489. adapter: _n4(),
  3490. runtime: _s4
  3491. };
  3492. }
  3493. } catch (err) {
  3494. _iterator.e(err);
  3495. } finally {
  3496. _iterator.f();
  3497. }
  3498. }
  3499. !function (e) {
  3500. e.WEB = "web", e.WX_MP = "wx_mp";
  3501. }(_e || (_e = {}));
  3502. var ve = {
  3503. adapter: null,
  3504. runtime: void 0
  3505. },
  3506. Se = ["anonymousUuidKey"];
  3507. var ke = /*#__PURE__*/function (_pe) {
  3508. (0, _inherits2.default)(ke, _pe);
  3509. var _super2 = _createSuper(ke);
  3510. function ke() {
  3511. var _this6;
  3512. (0, _classCallCheck2.default)(this, ke);
  3513. _this6 = _super2.call(this), ve.adapter.root.tcbObject || (ve.adapter.root.tcbObject = {});
  3514. return _this6;
  3515. }
  3516. (0, _createClass2.default)(ke, [{
  3517. key: "setItem",
  3518. value: function setItem(e, t) {
  3519. ve.adapter.root.tcbObject[e] = t;
  3520. }
  3521. }, {
  3522. key: "getItem",
  3523. value: function getItem(e) {
  3524. return ve.adapter.root.tcbObject[e];
  3525. }
  3526. }, {
  3527. key: "removeItem",
  3528. value: function removeItem(e) {
  3529. delete ve.adapter.root.tcbObject[e];
  3530. }
  3531. }, {
  3532. key: "clear",
  3533. value: function clear() {
  3534. delete ve.adapter.root.tcbObject;
  3535. }
  3536. }]);
  3537. return ke;
  3538. }(pe);
  3539. function Ie(e, t) {
  3540. switch (e) {
  3541. case "local":
  3542. return t.localStorage || new ke();
  3543. case "none":
  3544. return new ke();
  3545. default:
  3546. return t.sessionStorage || new ke();
  3547. }
  3548. }
  3549. var be = /*#__PURE__*/function () {
  3550. function be(e) {
  3551. (0, _classCallCheck2.default)(this, be);
  3552. if (!this._storage) {
  3553. this._persistence = ve.adapter.primaryStorage || e.persistence, this._storage = Ie(this._persistence, ve.adapter);
  3554. var _t5 = "access_token_".concat(e.env),
  3555. _n5 = "access_token_expire_".concat(e.env),
  3556. _s5 = "refresh_token_".concat(e.env),
  3557. _r = "anonymous_uuid_".concat(e.env),
  3558. _i = "login_type_".concat(e.env),
  3559. _o = "user_info_".concat(e.env);
  3560. this.keys = {
  3561. accessTokenKey: _t5,
  3562. accessTokenExpireKey: _n5,
  3563. refreshTokenKey: _s5,
  3564. anonymousUuidKey: _r,
  3565. loginTypeKey: _i,
  3566. userInfoKey: _o
  3567. };
  3568. }
  3569. }
  3570. (0, _createClass2.default)(be, [{
  3571. key: "updatePersistence",
  3572. value: function updatePersistence(e) {
  3573. if (e === this._persistence) return;
  3574. var t = "local" === this._persistence;
  3575. this._persistence = e;
  3576. var n = Ie(e, ve.adapter);
  3577. for (var _e10 in this.keys) {
  3578. var _s6 = this.keys[_e10];
  3579. if (t && Se.includes(_e10)) continue;
  3580. var _r2 = this._storage.getItem(_s6);
  3581. me(_r2) || ye(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  3582. }
  3583. this._storage = n;
  3584. }
  3585. }, {
  3586. key: "setStore",
  3587. value: function setStore(e, t, n) {
  3588. if (!this._storage) return;
  3589. var s = {
  3590. version: n || "localCachev1",
  3591. content: t
  3592. },
  3593. r = JSON.stringify(s);
  3594. try {
  3595. this._storage.setItem(e, r);
  3596. } catch (e) {
  3597. throw e;
  3598. }
  3599. }
  3600. }, {
  3601. key: "getStore",
  3602. value: function getStore(e, t) {
  3603. try {
  3604. if (!this._storage) return;
  3605. } catch (e) {
  3606. return "";
  3607. }
  3608. t = t || "localCachev1";
  3609. var n = this._storage.getItem(e);
  3610. if (!n) return "";
  3611. if (n.indexOf(t) >= 0) {
  3612. return JSON.parse(n).content;
  3613. }
  3614. return "";
  3615. }
  3616. }, {
  3617. key: "removeStore",
  3618. value: function removeStore(e) {
  3619. this._storage.removeItem(e);
  3620. }
  3621. }]);
  3622. return be;
  3623. }();
  3624. var Te = {},
  3625. Ae = {};
  3626. function Ce(e) {
  3627. return Te[e];
  3628. }
  3629. var Pe = /*#__PURE__*/(0, _createClass2.default)(function Pe(e, t) {
  3630. (0, _classCallCheck2.default)(this, Pe);
  3631. this.data = t || null, this.name = e;
  3632. });
  3633. var Ee = /*#__PURE__*/function (_Pe) {
  3634. (0, _inherits2.default)(Ee, _Pe);
  3635. var _super3 = _createSuper(Ee);
  3636. function Ee(e, t) {
  3637. var _this7;
  3638. (0, _classCallCheck2.default)(this, Ee);
  3639. _this7 = _super3.call(this, "error", {
  3640. error: e,
  3641. data: t
  3642. }), _this7.error = e;
  3643. return _this7;
  3644. }
  3645. return (0, _createClass2.default)(Ee);
  3646. }(Pe);
  3647. var Oe = new ( /*#__PURE__*/function () {
  3648. function _class() {
  3649. (0, _classCallCheck2.default)(this, _class);
  3650. this._listeners = {};
  3651. }
  3652. (0, _createClass2.default)(_class, [{
  3653. key: "on",
  3654. value: function on(e, t) {
  3655. return function (e, t, n) {
  3656. n[e] = n[e] || [], n[e].push(t);
  3657. }(e, t, this._listeners), this;
  3658. }
  3659. }, {
  3660. key: "off",
  3661. value: function off(e, t) {
  3662. return function (e, t, n) {
  3663. if (n && n[e]) {
  3664. var _s7 = n[e].indexOf(t);
  3665. -1 !== _s7 && n[e].splice(_s7, 1);
  3666. }
  3667. }(e, t, this._listeners), this;
  3668. }
  3669. }, {
  3670. key: "fire",
  3671. value: function fire(e, t) {
  3672. if (e instanceof Ee) return console.error(e.error), this;
  3673. var n = "string" == typeof e ? new Pe(e, t || {}) : e;
  3674. var s = n.name;
  3675. if (this._listens(s)) {
  3676. n.target = this;
  3677. var _e11 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  3678. var _iterator2 = _createForOfIteratorHelper(_e11),
  3679. _step2;
  3680. try {
  3681. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  3682. var _t6 = _step2.value;
  3683. _t6.call(this, n);
  3684. }
  3685. } catch (err) {
  3686. _iterator2.e(err);
  3687. } finally {
  3688. _iterator2.f();
  3689. }
  3690. }
  3691. return this;
  3692. }
  3693. }, {
  3694. key: "_listens",
  3695. value: function _listens(e) {
  3696. return this._listeners[e] && this._listeners[e].length > 0;
  3697. }
  3698. }]);
  3699. return _class;
  3700. }())();
  3701. function xe(e, t) {
  3702. Oe.on(e, t);
  3703. }
  3704. function Ue(e) {
  3705. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3706. Oe.fire(e, t);
  3707. }
  3708. function Re(e, t) {
  3709. Oe.off(e, t);
  3710. }
  3711. var Le = "loginStateChanged",
  3712. Ne = "loginStateExpire",
  3713. De = "loginTypeChanged",
  3714. Fe = "anonymousConverted",
  3715. qe = "refreshAccessToken";
  3716. var Ke;
  3717. !function (e) {
  3718. 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";
  3719. }(Ke || (Ke = {}));
  3720. var Me = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  3721. je = {
  3722. "X-SDK-Version": "1.3.5"
  3723. };
  3724. function Be(e, t, n) {
  3725. var s = e[t];
  3726. e[t] = function (t) {
  3727. var r = {},
  3728. i = {};
  3729. n.forEach(function (n) {
  3730. var _n$call = n.call(e, t),
  3731. s = _n$call.data,
  3732. o = _n$call.headers;
  3733. Object.assign(r, s), Object.assign(i, o);
  3734. });
  3735. var o = t.data;
  3736. return o && function () {
  3737. var e;
  3738. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e12 in r) {
  3739. o.append(_e12, r[_e12]);
  3740. }
  3741. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  3742. };
  3743. }
  3744. function $e() {
  3745. var e = Math.random().toString(16).slice(2);
  3746. return {
  3747. data: {
  3748. seqId: e
  3749. },
  3750. headers: _objectSpread(_objectSpread({}, je), {}, {
  3751. "x-seqid": e
  3752. })
  3753. };
  3754. }
  3755. var We = /*#__PURE__*/function () {
  3756. function We() {
  3757. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3758. (0, _classCallCheck2.default)(this, We);
  3759. var t;
  3760. this.config = e, this._reqClass = new ve.adapter.reqClass({
  3761. timeout: this.config.timeout,
  3762. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  3763. restrictedMethods: ["post"]
  3764. }), this._cache = Ce(this.config.env), this._localCache = (t = this.config.env, Ae[t]), Be(this._reqClass, "post", [$e]), Be(this._reqClass, "upload", [$e]), Be(this._reqClass, "download", [$e]);
  3765. }
  3766. (0, _createClass2.default)(We, [{
  3767. key: "post",
  3768. value: function () {
  3769. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {
  3770. return _regenerator.default.wrap(function _callee3$(_context3) {
  3771. while (1) {
  3772. switch (_context3.prev = _context3.next) {
  3773. case 0:
  3774. _context3.next = 2;
  3775. return this._reqClass.post(e);
  3776. case 2:
  3777. return _context3.abrupt("return", _context3.sent);
  3778. case 3:
  3779. case "end":
  3780. return _context3.stop();
  3781. }
  3782. }
  3783. }, _callee3, this);
  3784. }));
  3785. function post(_x2) {
  3786. return _post.apply(this, arguments);
  3787. }
  3788. return post;
  3789. }()
  3790. }, {
  3791. key: "upload",
  3792. value: function () {
  3793. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  3794. return _regenerator.default.wrap(function _callee4$(_context4) {
  3795. while (1) {
  3796. switch (_context4.prev = _context4.next) {
  3797. case 0:
  3798. _context4.next = 2;
  3799. return this._reqClass.upload(e);
  3800. case 2:
  3801. return _context4.abrupt("return", _context4.sent);
  3802. case 3:
  3803. case "end":
  3804. return _context4.stop();
  3805. }
  3806. }
  3807. }, _callee4, this);
  3808. }));
  3809. function upload(_x3) {
  3810. return _upload.apply(this, arguments);
  3811. }
  3812. return upload;
  3813. }()
  3814. }, {
  3815. key: "download",
  3816. value: function () {
  3817. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  3818. return _regenerator.default.wrap(function _callee5$(_context5) {
  3819. while (1) {
  3820. switch (_context5.prev = _context5.next) {
  3821. case 0:
  3822. _context5.next = 2;
  3823. return this._reqClass.download(e);
  3824. case 2:
  3825. return _context5.abrupt("return", _context5.sent);
  3826. case 3:
  3827. case "end":
  3828. return _context5.stop();
  3829. }
  3830. }
  3831. }, _callee5, this);
  3832. }));
  3833. function download(_x4) {
  3834. return _download.apply(this, arguments);
  3835. }
  3836. return download;
  3837. }()
  3838. }, {
  3839. key: "refreshAccessToken",
  3840. value: function () {
  3841. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
  3842. var e, t;
  3843. return _regenerator.default.wrap(function _callee6$(_context6) {
  3844. while (1) {
  3845. switch (_context6.prev = _context6.next) {
  3846. case 0:
  3847. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  3848. _context6.prev = 1;
  3849. _context6.next = 4;
  3850. return this._refreshAccessTokenPromise;
  3851. case 4:
  3852. e = _context6.sent;
  3853. _context6.next = 10;
  3854. break;
  3855. case 7:
  3856. _context6.prev = 7;
  3857. _context6.t0 = _context6["catch"](1);
  3858. t = _context6.t0;
  3859. case 10:
  3860. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  3861. _context6.next = 12;
  3862. break;
  3863. }
  3864. throw t;
  3865. case 12:
  3866. return _context6.abrupt("return", e);
  3867. case 13:
  3868. case "end":
  3869. return _context6.stop();
  3870. }
  3871. }
  3872. }, _callee6, this, [[1, 7]]);
  3873. }));
  3874. function refreshAccessToken() {
  3875. return _refreshAccessToken2.apply(this, arguments);
  3876. }
  3877. return refreshAccessToken;
  3878. }()
  3879. }, {
  3880. key: "_refreshAccessToken",
  3881. value: function () {
  3882. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  3883. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e13, _e14, _t7, _s8;
  3884. return _regenerator.default.wrap(function _callee7$(_context7) {
  3885. while (1) {
  3886. switch (_context7.prev = _context7.next) {
  3887. case 0:
  3888. _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;
  3889. this._cache.removeStore(e), this._cache.removeStore(t);
  3890. i = this._cache.getStore(n);
  3891. if (i) {
  3892. _context7.next = 5;
  3893. break;
  3894. }
  3895. throw new Q({
  3896. message: "未登录CloudBase"
  3897. });
  3898. case 5:
  3899. o = {
  3900. refresh_token: i
  3901. };
  3902. _context7.next = 8;
  3903. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  3904. case 8:
  3905. a = _context7.sent;
  3906. if (!a.data.code) {
  3907. _context7.next = 21;
  3908. break;
  3909. }
  3910. _e13 = a.data.code;
  3911. if (!("SIGN_PARAM_INVALID" === _e13 || "REFRESH_TOKEN_EXPIRED" === _e13 || "INVALID_REFRESH_TOKEN" === _e13)) {
  3912. _context7.next = 20;
  3913. break;
  3914. }
  3915. if (!(this._cache.getStore(s) === Ke.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e13)) {
  3916. _context7.next = 19;
  3917. break;
  3918. }
  3919. _e14 = this._cache.getStore(r);
  3920. _t7 = this._cache.getStore(n);
  3921. _context7.next = 17;
  3922. return this.send("auth.signInAnonymously", {
  3923. anonymous_uuid: _e14,
  3924. refresh_token: _t7
  3925. });
  3926. case 17:
  3927. _s8 = _context7.sent;
  3928. return _context7.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  3929. case 19:
  3930. Ue(Ne), this._cache.removeStore(n);
  3931. case 20:
  3932. throw new Q({
  3933. code: a.data.code,
  3934. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  3935. });
  3936. case 21:
  3937. if (!a.data.access_token) {
  3938. _context7.next = 23;
  3939. break;
  3940. }
  3941. return _context7.abrupt("return", (Ue(qe), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  3942. accessToken: a.data.access_token,
  3943. accessTokenExpire: a.data.access_token_expire
  3944. }));
  3945. case 23:
  3946. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  3947. case 24:
  3948. case "end":
  3949. return _context7.stop();
  3950. }
  3951. }
  3952. }, _callee7, this);
  3953. }));
  3954. function _refreshAccessToken() {
  3955. return _refreshAccessToken3.apply(this, arguments);
  3956. }
  3957. return _refreshAccessToken;
  3958. }()
  3959. }, {
  3960. key: "getAccessToken",
  3961. value: function () {
  3962. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  3963. var _this$_cache$keys2, e, t, n, s, r, i;
  3964. return _regenerator.default.wrap(function _callee8$(_context8) {
  3965. while (1) {
  3966. switch (_context8.prev = _context8.next) {
  3967. case 0:
  3968. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  3969. if (this._cache.getStore(n)) {
  3970. _context8.next = 3;
  3971. break;
  3972. }
  3973. throw new Q({
  3974. message: "refresh token不存在,登录状态异常"
  3975. });
  3976. case 3:
  3977. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  3978. _context8.t0 = this._shouldRefreshAccessTokenHook;
  3979. if (!_context8.t0) {
  3980. _context8.next = 9;
  3981. break;
  3982. }
  3983. _context8.next = 8;
  3984. return this._shouldRefreshAccessTokenHook(s, r);
  3985. case 8:
  3986. _context8.t0 = !_context8.sent;
  3987. case 9:
  3988. _context8.t1 = _context8.t0;
  3989. if (!_context8.t1) {
  3990. _context8.next = 12;
  3991. break;
  3992. }
  3993. i = !1;
  3994. case 12:
  3995. return _context8.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  3996. accessToken: s,
  3997. accessTokenExpire: r
  3998. });
  3999. case 13:
  4000. case "end":
  4001. return _context8.stop();
  4002. }
  4003. }
  4004. }, _callee8, this);
  4005. }));
  4006. function getAccessToken() {
  4007. return _getAccessToken.apply(this, arguments);
  4008. }
  4009. return getAccessToken;
  4010. }()
  4011. }, {
  4012. key: "request",
  4013. value: function () {
  4014. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, t, n) {
  4015. var s, r, i, _e15, o, _e16, _e17, a, c, u, l, h, d, f, p, g;
  4016. return _regenerator.default.wrap(function _callee9$(_context9) {
  4017. while (1) {
  4018. switch (_context9.prev = _context9.next) {
  4019. case 0:
  4020. s = "x-tcb-trace_".concat(this.config.env);
  4021. r = "application/x-www-form-urlencoded";
  4022. i = _objectSpread({
  4023. action: e,
  4024. env: this.config.env,
  4025. dataVersion: "2019-08-16"
  4026. }, t);
  4027. if (!(-1 === Me.indexOf(e))) {
  4028. _context9.next = 10;
  4029. break;
  4030. }
  4031. _e15 = this._cache.keys.refreshTokenKey;
  4032. _context9.t0 = this._cache.getStore(_e15);
  4033. if (!_context9.t0) {
  4034. _context9.next = 10;
  4035. break;
  4036. }
  4037. _context9.next = 9;
  4038. return this.getAccessToken();
  4039. case 9:
  4040. i.access_token = _context9.sent.accessToken;
  4041. case 10:
  4042. if ("storage.uploadFile" === e) {
  4043. o = new FormData();
  4044. for (_e16 in o) {
  4045. o.hasOwnProperty(_e16) && void 0 !== o[_e16] && o.append(_e16, i[_e16]);
  4046. }
  4047. r = "multipart/form-data";
  4048. } else {
  4049. r = "application/json", o = {};
  4050. for (_e17 in i) {
  4051. void 0 !== i[_e17] && (o[_e17] = i[_e17]);
  4052. }
  4053. }
  4054. a = {
  4055. headers: {
  4056. "content-type": r
  4057. }
  4058. };
  4059. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  4060. c = this._localCache.getStore(s);
  4061. c && (a.headers["X-TCB-Trace"] = c);
  4062. u = t.parse, l = t.inQuery, h = t.search;
  4063. d = {
  4064. env: this.config.env
  4065. };
  4066. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  4067. f = function (e, t) {
  4068. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  4069. var s = /\?/.test(t);
  4070. var r = "";
  4071. for (var _e18 in n) {
  4072. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e18, "=").concat(encodeURIComponent(n[_e18]));
  4073. }
  4074. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  4075. }(de, "//tcb-api.tencentcloudapi.com/web", d);
  4076. h && (f += h);
  4077. _context9.next = 22;
  4078. return this.post(_objectSpread({
  4079. url: f,
  4080. data: o
  4081. }, a));
  4082. case 22:
  4083. p = _context9.sent;
  4084. g = p.header && p.header["x-tcb-trace"];
  4085. if (!(g && this._localCache.setStore(s, g), 200 !== Number(p.status) && 200 !== Number(p.statusCode) || !p.data)) {
  4086. _context9.next = 26;
  4087. break;
  4088. }
  4089. throw new Q({
  4090. code: "NETWORK_ERROR",
  4091. message: "network request error"
  4092. });
  4093. case 26:
  4094. return _context9.abrupt("return", p);
  4095. case 27:
  4096. case "end":
  4097. return _context9.stop();
  4098. }
  4099. }
  4100. }, _callee9, this);
  4101. }));
  4102. function request(_x5, _x6, _x7) {
  4103. return _request.apply(this, arguments);
  4104. }
  4105. return request;
  4106. }()
  4107. }, {
  4108. key: "send",
  4109. value: function () {
  4110. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e) {
  4111. var t,
  4112. n,
  4113. _n6,
  4114. _args10 = arguments;
  4115. return _regenerator.default.wrap(function _callee10$(_context10) {
  4116. while (1) {
  4117. switch (_context10.prev = _context10.next) {
  4118. case 0:
  4119. t = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
  4120. _context10.next = 3;
  4121. return this.request(e, t, {
  4122. onUploadProgress: t.onUploadProgress
  4123. });
  4124. case 3:
  4125. n = _context10.sent;
  4126. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === Me.indexOf(e))) {
  4127. _context10.next = 13;
  4128. break;
  4129. }
  4130. _context10.next = 7;
  4131. return this.refreshAccessToken();
  4132. case 7:
  4133. _context10.next = 9;
  4134. return this.request(e, t, {
  4135. onUploadProgress: t.onUploadProgress
  4136. });
  4137. case 9:
  4138. _n6 = _context10.sent;
  4139. if (!_n6.data.code) {
  4140. _context10.next = 12;
  4141. break;
  4142. }
  4143. throw new Q({
  4144. code: _n6.data.code,
  4145. message: _n6.data.message
  4146. });
  4147. case 12:
  4148. return _context10.abrupt("return", _n6.data);
  4149. case 13:
  4150. if (!n.data.code) {
  4151. _context10.next = 15;
  4152. break;
  4153. }
  4154. throw new Q({
  4155. code: n.data.code,
  4156. message: n.data.message
  4157. });
  4158. case 15:
  4159. return _context10.abrupt("return", n.data);
  4160. case 16:
  4161. case "end":
  4162. return _context10.stop();
  4163. }
  4164. }
  4165. }, _callee10, this);
  4166. }));
  4167. function send(_x8) {
  4168. return _send.apply(this, arguments);
  4169. }
  4170. return send;
  4171. }()
  4172. }, {
  4173. key: "setRefreshToken",
  4174. value: function setRefreshToken(e) {
  4175. var _this$_cache$keys3 = this._cache.keys,
  4176. t = _this$_cache$keys3.accessTokenKey,
  4177. n = _this$_cache$keys3.accessTokenExpireKey,
  4178. s = _this$_cache$keys3.refreshTokenKey;
  4179. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  4180. }
  4181. }]);
  4182. return We;
  4183. }();
  4184. var ze = {};
  4185. function Je(e) {
  4186. return ze[e];
  4187. }
  4188. var He = /*#__PURE__*/function () {
  4189. function He(e) {
  4190. (0, _classCallCheck2.default)(this, He);
  4191. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env);
  4192. }
  4193. (0, _createClass2.default)(He, [{
  4194. key: "setRefreshToken",
  4195. value: function setRefreshToken(e) {
  4196. var _this$_cache$keys4 = this._cache.keys,
  4197. t = _this$_cache$keys4.accessTokenKey,
  4198. n = _this$_cache$keys4.accessTokenExpireKey,
  4199. s = _this$_cache$keys4.refreshTokenKey;
  4200. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  4201. }
  4202. }, {
  4203. key: "setAccessToken",
  4204. value: function setAccessToken(e, t) {
  4205. var _this$_cache$keys5 = this._cache.keys,
  4206. n = _this$_cache$keys5.accessTokenKey,
  4207. s = _this$_cache$keys5.accessTokenExpireKey;
  4208. this._cache.setStore(n, e), this._cache.setStore(s, t);
  4209. }
  4210. }, {
  4211. key: "refreshUserInfo",
  4212. value: function () {
  4213. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
  4214. var _yield$this$_request$, e;
  4215. return _regenerator.default.wrap(function _callee11$(_context11) {
  4216. while (1) {
  4217. switch (_context11.prev = _context11.next) {
  4218. case 0:
  4219. _context11.next = 2;
  4220. return this._request.send("auth.getUserInfo", {});
  4221. case 2:
  4222. _yield$this$_request$ = _context11.sent;
  4223. e = _yield$this$_request$.data;
  4224. return _context11.abrupt("return", (this.setLocalUserInfo(e), e));
  4225. case 5:
  4226. case "end":
  4227. return _context11.stop();
  4228. }
  4229. }
  4230. }, _callee11, this);
  4231. }));
  4232. function refreshUserInfo() {
  4233. return _refreshUserInfo.apply(this, arguments);
  4234. }
  4235. return refreshUserInfo;
  4236. }()
  4237. }, {
  4238. key: "setLocalUserInfo",
  4239. value: function setLocalUserInfo(e) {
  4240. var t = this._cache.keys.userInfoKey;
  4241. this._cache.setStore(t, e);
  4242. }
  4243. }]);
  4244. return He;
  4245. }();
  4246. var Ge = /*#__PURE__*/function () {
  4247. function Ge(e) {
  4248. (0, _classCallCheck2.default)(this, Ge);
  4249. if (!e) throw new Q({
  4250. code: "PARAM_ERROR",
  4251. message: "envId is not defined"
  4252. });
  4253. this._envId = e, this._cache = Ce(this._envId), this._request = Je(this._envId), this.setUserInfo();
  4254. }
  4255. (0, _createClass2.default)(Ge, [{
  4256. key: "linkWithTicket",
  4257. value: function linkWithTicket(e) {
  4258. if ("string" != typeof e) throw new Q({
  4259. code: "PARAM_ERROR",
  4260. message: "ticket must be string"
  4261. });
  4262. return this._request.send("auth.linkWithTicket", {
  4263. ticket: e
  4264. });
  4265. }
  4266. }, {
  4267. key: "linkWithRedirect",
  4268. value: function linkWithRedirect(e) {
  4269. e.signInWithRedirect();
  4270. }
  4271. }, {
  4272. key: "updatePassword",
  4273. value: function updatePassword(e, t) {
  4274. return this._request.send("auth.updatePassword", {
  4275. oldPassword: t,
  4276. newPassword: e
  4277. });
  4278. }
  4279. }, {
  4280. key: "updateEmail",
  4281. value: function updateEmail(e) {
  4282. return this._request.send("auth.updateEmail", {
  4283. newEmail: e
  4284. });
  4285. }
  4286. }, {
  4287. key: "updateUsername",
  4288. value: function updateUsername(e) {
  4289. if ("string" != typeof e) throw new Q({
  4290. code: "PARAM_ERROR",
  4291. message: "username must be a string"
  4292. });
  4293. return this._request.send("auth.updateUsername", {
  4294. username: e
  4295. });
  4296. }
  4297. }, {
  4298. key: "getLinkedUidList",
  4299. value: function () {
  4300. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  4301. var _yield$this$_request$2, e, t, n;
  4302. return _regenerator.default.wrap(function _callee12$(_context12) {
  4303. while (1) {
  4304. switch (_context12.prev = _context12.next) {
  4305. case 0:
  4306. _context12.next = 2;
  4307. return this._request.send("auth.getLinkedUidList", {});
  4308. case 2:
  4309. _yield$this$_request$2 = _context12.sent;
  4310. e = _yield$this$_request$2.data;
  4311. t = !1;
  4312. n = e.users;
  4313. return _context12.abrupt("return", (n.forEach(function (e) {
  4314. e.wxOpenId && e.wxPublicId && (t = !0);
  4315. }), {
  4316. users: n,
  4317. hasPrimaryUid: t
  4318. }));
  4319. case 7:
  4320. case "end":
  4321. return _context12.stop();
  4322. }
  4323. }
  4324. }, _callee12, this);
  4325. }));
  4326. function getLinkedUidList() {
  4327. return _getLinkedUidList.apply(this, arguments);
  4328. }
  4329. return getLinkedUidList;
  4330. }()
  4331. }, {
  4332. key: "setPrimaryUid",
  4333. value: function setPrimaryUid(e) {
  4334. return this._request.send("auth.setPrimaryUid", {
  4335. uid: e
  4336. });
  4337. }
  4338. }, {
  4339. key: "unlink",
  4340. value: function unlink(e) {
  4341. return this._request.send("auth.unlink", {
  4342. platform: e
  4343. });
  4344. }
  4345. }, {
  4346. key: "update",
  4347. value: function () {
  4348. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(e) {
  4349. var t, n, s, r, i, o, _yield$this$_request$3, a;
  4350. return _regenerator.default.wrap(function _callee13$(_context13) {
  4351. while (1) {
  4352. switch (_context13.prev = _context13.next) {
  4353. case 0:
  4354. t = e.nickName;
  4355. n = e.gender;
  4356. s = e.avatarUrl;
  4357. r = e.province;
  4358. i = e.country;
  4359. o = e.city;
  4360. _context13.next = 8;
  4361. return this._request.send("auth.updateUserInfo", {
  4362. nickName: t,
  4363. gender: n,
  4364. avatarUrl: s,
  4365. province: r,
  4366. country: i,
  4367. city: o
  4368. });
  4369. case 8:
  4370. _yield$this$_request$3 = _context13.sent;
  4371. a = _yield$this$_request$3.data;
  4372. this.setLocalUserInfo(a);
  4373. case 11:
  4374. case "end":
  4375. return _context13.stop();
  4376. }
  4377. }
  4378. }, _callee13, this);
  4379. }));
  4380. function update(_x9) {
  4381. return _update.apply(this, arguments);
  4382. }
  4383. return update;
  4384. }()
  4385. }, {
  4386. key: "refresh",
  4387. value: function () {
  4388. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
  4389. var _yield$this$_request$4, e;
  4390. return _regenerator.default.wrap(function _callee14$(_context14) {
  4391. while (1) {
  4392. switch (_context14.prev = _context14.next) {
  4393. case 0:
  4394. _context14.next = 2;
  4395. return this._request.send("auth.getUserInfo", {});
  4396. case 2:
  4397. _yield$this$_request$4 = _context14.sent;
  4398. e = _yield$this$_request$4.data;
  4399. return _context14.abrupt("return", (this.setLocalUserInfo(e), e));
  4400. case 5:
  4401. case "end":
  4402. return _context14.stop();
  4403. }
  4404. }
  4405. }, _callee14, this);
  4406. }));
  4407. function refresh() {
  4408. return _refresh.apply(this, arguments);
  4409. }
  4410. return refresh;
  4411. }()
  4412. }, {
  4413. key: "setUserInfo",
  4414. value: function setUserInfo() {
  4415. var _this8 = this;
  4416. var e = this._cache.keys.userInfoKey,
  4417. t = this._cache.getStore(e);
  4418. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  4419. _this8[e] = t[e];
  4420. }), this.location = {
  4421. country: t.country,
  4422. province: t.province,
  4423. city: t.city
  4424. };
  4425. }
  4426. }, {
  4427. key: "setLocalUserInfo",
  4428. value: function setLocalUserInfo(e) {
  4429. var t = this._cache.keys.userInfoKey;
  4430. this._cache.setStore(t, e), this.setUserInfo();
  4431. }
  4432. }]);
  4433. return Ge;
  4434. }();
  4435. var Ve = /*#__PURE__*/function () {
  4436. function Ve(e) {
  4437. (0, _classCallCheck2.default)(this, Ve);
  4438. if (!e) throw new Q({
  4439. code: "PARAM_ERROR",
  4440. message: "envId is not defined"
  4441. });
  4442. this._cache = Ce(e);
  4443. var _this$_cache$keys6 = this._cache.keys,
  4444. t = _this$_cache$keys6.refreshTokenKey,
  4445. n = _this$_cache$keys6.accessTokenKey,
  4446. s = _this$_cache$keys6.accessTokenExpireKey,
  4447. r = this._cache.getStore(t),
  4448. i = this._cache.getStore(n),
  4449. o = this._cache.getStore(s);
  4450. this.credential = {
  4451. refreshToken: r,
  4452. accessToken: i,
  4453. accessTokenExpire: o
  4454. }, this.user = new Ge(e);
  4455. }
  4456. (0, _createClass2.default)(Ve, [{
  4457. key: "isAnonymousAuth",
  4458. get: function get() {
  4459. return this.loginType === Ke.ANONYMOUS;
  4460. }
  4461. }, {
  4462. key: "isCustomAuth",
  4463. get: function get() {
  4464. return this.loginType === Ke.CUSTOM;
  4465. }
  4466. }, {
  4467. key: "isWeixinAuth",
  4468. get: function get() {
  4469. return this.loginType === Ke.WECHAT || this.loginType === Ke.WECHAT_OPEN || this.loginType === Ke.WECHAT_PUBLIC;
  4470. }
  4471. }, {
  4472. key: "loginType",
  4473. get: function get() {
  4474. return this._cache.getStore(this._cache.keys.loginTypeKey);
  4475. }
  4476. }]);
  4477. return Ve;
  4478. }();
  4479. var Ye = /*#__PURE__*/function (_He) {
  4480. (0, _inherits2.default)(Ye, _He);
  4481. var _super4 = _createSuper(Ye);
  4482. function Ye() {
  4483. (0, _classCallCheck2.default)(this, Ye);
  4484. return _super4.apply(this, arguments);
  4485. }
  4486. (0, _createClass2.default)(Ye, [{
  4487. key: "signIn",
  4488. value: function () {
  4489. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  4490. var _this$_cache$keys7, e, t, n, s, r, _e19;
  4491. return _regenerator.default.wrap(function _callee15$(_context15) {
  4492. while (1) {
  4493. switch (_context15.prev = _context15.next) {
  4494. case 0:
  4495. this._cache.updatePersistence("local");
  4496. _this$_cache$keys7 = this._cache.keys;
  4497. e = _this$_cache$keys7.anonymousUuidKey;
  4498. t = _this$_cache$keys7.refreshTokenKey;
  4499. n = this._cache.getStore(e) || void 0;
  4500. s = this._cache.getStore(t) || void 0;
  4501. _context15.next = 8;
  4502. return this._request.send("auth.signInAnonymously", {
  4503. anonymous_uuid: n,
  4504. refresh_token: s
  4505. });
  4506. case 8:
  4507. r = _context15.sent;
  4508. if (!(r.uuid && r.refresh_token)) {
  4509. _context15.next = 20;
  4510. break;
  4511. }
  4512. this._setAnonymousUUID(r.uuid);
  4513. this.setRefreshToken(r.refresh_token);
  4514. _context15.next = 14;
  4515. return this._request.refreshAccessToken();
  4516. case 14:
  4517. Ue(Le);
  4518. Ue(De, {
  4519. env: this.config.env,
  4520. loginType: Ke.ANONYMOUS,
  4521. persistence: "local"
  4522. });
  4523. _e19 = new Ve(this.config.env);
  4524. _context15.next = 19;
  4525. return _e19.user.refresh();
  4526. case 19:
  4527. return _context15.abrupt("return", _e19);
  4528. case 20:
  4529. throw new Q({
  4530. message: "匿名登录失败"
  4531. });
  4532. case 21:
  4533. case "end":
  4534. return _context15.stop();
  4535. }
  4536. }
  4537. }, _callee15, this);
  4538. }));
  4539. function signIn() {
  4540. return _signIn.apply(this, arguments);
  4541. }
  4542. return signIn;
  4543. }()
  4544. }, {
  4545. key: "linkAndRetrieveDataWithTicket",
  4546. value: function () {
  4547. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(e) {
  4548. var _this$_cache$keys8, t, n, s, r, i;
  4549. return _regenerator.default.wrap(function _callee16$(_context16) {
  4550. while (1) {
  4551. switch (_context16.prev = _context16.next) {
  4552. case 0:
  4553. _this$_cache$keys8 = this._cache.keys;
  4554. t = _this$_cache$keys8.anonymousUuidKey;
  4555. n = _this$_cache$keys8.refreshTokenKey;
  4556. s = this._cache.getStore(t);
  4557. r = this._cache.getStore(n);
  4558. _context16.next = 7;
  4559. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  4560. anonymous_uuid: s,
  4561. refresh_token: r,
  4562. ticket: e
  4563. });
  4564. case 7:
  4565. i = _context16.sent;
  4566. if (!i.refresh_token) {
  4567. _context16.next = 16;
  4568. break;
  4569. }
  4570. this._clearAnonymousUUID();
  4571. this.setRefreshToken(i.refresh_token);
  4572. _context16.next = 13;
  4573. return this._request.refreshAccessToken();
  4574. case 13:
  4575. Ue(Fe, {
  4576. env: this.config.env
  4577. });
  4578. Ue(De, {
  4579. loginType: Ke.CUSTOM,
  4580. persistence: "local"
  4581. });
  4582. return _context16.abrupt("return", {
  4583. credential: {
  4584. refreshToken: i.refresh_token
  4585. }
  4586. });
  4587. case 16:
  4588. throw new Q({
  4589. message: "匿名转化失败"
  4590. });
  4591. case 17:
  4592. case "end":
  4593. return _context16.stop();
  4594. }
  4595. }
  4596. }, _callee16, this);
  4597. }));
  4598. function linkAndRetrieveDataWithTicket(_x10) {
  4599. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  4600. }
  4601. return linkAndRetrieveDataWithTicket;
  4602. }()
  4603. }, {
  4604. key: "_setAnonymousUUID",
  4605. value: function _setAnonymousUUID(e) {
  4606. var _this$_cache$keys9 = this._cache.keys,
  4607. t = _this$_cache$keys9.anonymousUuidKey,
  4608. n = _this$_cache$keys9.loginTypeKey;
  4609. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Ke.ANONYMOUS);
  4610. }
  4611. }, {
  4612. key: "_clearAnonymousUUID",
  4613. value: function _clearAnonymousUUID() {
  4614. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  4615. }
  4616. }]);
  4617. return Ye;
  4618. }(He);
  4619. var Qe = /*#__PURE__*/function (_He2) {
  4620. (0, _inherits2.default)(Qe, _He2);
  4621. var _super5 = _createSuper(Qe);
  4622. function Qe() {
  4623. (0, _classCallCheck2.default)(this, Qe);
  4624. return _super5.apply(this, arguments);
  4625. }
  4626. (0, _createClass2.default)(Qe, [{
  4627. key: "signIn",
  4628. value: function () {
  4629. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  4630. var t, n;
  4631. return _regenerator.default.wrap(function _callee17$(_context17) {
  4632. while (1) {
  4633. switch (_context17.prev = _context17.next) {
  4634. case 0:
  4635. if (!("string" != typeof e)) {
  4636. _context17.next = 2;
  4637. break;
  4638. }
  4639. throw new Q({
  4640. code: "PARAM_ERROR",
  4641. message: "ticket must be a string"
  4642. });
  4643. case 2:
  4644. t = this._cache.keys.refreshTokenKey;
  4645. _context17.next = 5;
  4646. return this._request.send("auth.signInWithTicket", {
  4647. ticket: e,
  4648. refresh_token: this._cache.getStore(t) || ""
  4649. });
  4650. case 5:
  4651. n = _context17.sent;
  4652. if (!n.refresh_token) {
  4653. _context17.next = 15;
  4654. break;
  4655. }
  4656. this.setRefreshToken(n.refresh_token);
  4657. _context17.next = 10;
  4658. return this._request.refreshAccessToken();
  4659. case 10:
  4660. Ue(Le);
  4661. Ue(De, {
  4662. env: this.config.env,
  4663. loginType: Ke.CUSTOM,
  4664. persistence: this.config.persistence
  4665. });
  4666. _context17.next = 14;
  4667. return this.refreshUserInfo();
  4668. case 14:
  4669. return _context17.abrupt("return", new Ve(this.config.env));
  4670. case 15:
  4671. throw new Q({
  4672. message: "自定义登录失败"
  4673. });
  4674. case 16:
  4675. case "end":
  4676. return _context17.stop();
  4677. }
  4678. }
  4679. }, _callee17, this);
  4680. }));
  4681. function signIn(_x11) {
  4682. return _signIn2.apply(this, arguments);
  4683. }
  4684. return signIn;
  4685. }()
  4686. }]);
  4687. return Qe;
  4688. }(He);
  4689. var Xe = /*#__PURE__*/function (_He3) {
  4690. (0, _inherits2.default)(Xe, _He3);
  4691. var _super6 = _createSuper(Xe);
  4692. function Xe() {
  4693. (0, _classCallCheck2.default)(this, Xe);
  4694. return _super6.apply(this, arguments);
  4695. }
  4696. (0, _createClass2.default)(Xe, [{
  4697. key: "signIn",
  4698. value: function () {
  4699. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {
  4700. var n, s, r, i, o;
  4701. return _regenerator.default.wrap(function _callee18$(_context18) {
  4702. while (1) {
  4703. switch (_context18.prev = _context18.next) {
  4704. case 0:
  4705. if (!("string" != typeof e)) {
  4706. _context18.next = 2;
  4707. break;
  4708. }
  4709. throw new Q({
  4710. code: "PARAM_ERROR",
  4711. message: "email must be a string"
  4712. });
  4713. case 2:
  4714. n = this._cache.keys.refreshTokenKey;
  4715. _context18.next = 5;
  4716. return this._request.send("auth.signIn", {
  4717. loginType: "EMAIL",
  4718. email: e,
  4719. password: t,
  4720. refresh_token: this._cache.getStore(n) || ""
  4721. });
  4722. case 5:
  4723. s = _context18.sent;
  4724. r = s.refresh_token;
  4725. i = s.access_token;
  4726. o = s.access_token_expire;
  4727. if (!r) {
  4728. _context18.next = 22;
  4729. break;
  4730. }
  4731. this.setRefreshToken(r);
  4732. if (!(i && o)) {
  4733. _context18.next = 15;
  4734. break;
  4735. }
  4736. this.setAccessToken(i, o);
  4737. _context18.next = 17;
  4738. break;
  4739. case 15:
  4740. _context18.next = 17;
  4741. return this._request.refreshAccessToken();
  4742. case 17:
  4743. _context18.next = 19;
  4744. return this.refreshUserInfo();
  4745. case 19:
  4746. Ue(Le);
  4747. Ue(De, {
  4748. env: this.config.env,
  4749. loginType: Ke.EMAIL,
  4750. persistence: this.config.persistence
  4751. });
  4752. return _context18.abrupt("return", new Ve(this.config.env));
  4753. case 22:
  4754. throw s.code ? new Q({
  4755. code: s.code,
  4756. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  4757. }) : new Q({
  4758. message: "邮箱登录失败"
  4759. });
  4760. case 23:
  4761. case "end":
  4762. return _context18.stop();
  4763. }
  4764. }
  4765. }, _callee18, this);
  4766. }));
  4767. function signIn(_x12, _x13) {
  4768. return _signIn3.apply(this, arguments);
  4769. }
  4770. return signIn;
  4771. }()
  4772. }, {
  4773. key: "activate",
  4774. value: function () {
  4775. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e) {
  4776. return _regenerator.default.wrap(function _callee19$(_context19) {
  4777. while (1) {
  4778. switch (_context19.prev = _context19.next) {
  4779. case 0:
  4780. return _context19.abrupt("return", this._request.send("auth.activateEndUserMail", {
  4781. token: e
  4782. }));
  4783. case 1:
  4784. case "end":
  4785. return _context19.stop();
  4786. }
  4787. }
  4788. }, _callee19, this);
  4789. }));
  4790. function activate(_x14) {
  4791. return _activate.apply(this, arguments);
  4792. }
  4793. return activate;
  4794. }()
  4795. }, {
  4796. key: "resetPasswordWithToken",
  4797. value: function () {
  4798. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e, t) {
  4799. return _regenerator.default.wrap(function _callee20$(_context20) {
  4800. while (1) {
  4801. switch (_context20.prev = _context20.next) {
  4802. case 0:
  4803. return _context20.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  4804. token: e,
  4805. newPassword: t
  4806. }));
  4807. case 1:
  4808. case "end":
  4809. return _context20.stop();
  4810. }
  4811. }
  4812. }, _callee20, this);
  4813. }));
  4814. function resetPasswordWithToken(_x15, _x16) {
  4815. return _resetPasswordWithToken.apply(this, arguments);
  4816. }
  4817. return resetPasswordWithToken;
  4818. }()
  4819. }]);
  4820. return Xe;
  4821. }(He);
  4822. var Ze = /*#__PURE__*/function (_He4) {
  4823. (0, _inherits2.default)(Ze, _He4);
  4824. var _super7 = _createSuper(Ze);
  4825. function Ze() {
  4826. (0, _classCallCheck2.default)(this, Ze);
  4827. return _super7.apply(this, arguments);
  4828. }
  4829. (0, _createClass2.default)(Ze, [{
  4830. key: "signIn",
  4831. value: function () {
  4832. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  4833. var n, s, r, i, o;
  4834. return _regenerator.default.wrap(function _callee21$(_context21) {
  4835. while (1) {
  4836. switch (_context21.prev = _context21.next) {
  4837. case 0:
  4838. if (!("string" != typeof e)) {
  4839. _context21.next = 2;
  4840. break;
  4841. }
  4842. throw new Q({
  4843. code: "PARAM_ERROR",
  4844. message: "username must be a string"
  4845. });
  4846. case 2:
  4847. "string" != typeof t && (t = "", console.warn("password is empty"));
  4848. n = this._cache.keys.refreshTokenKey;
  4849. _context21.next = 6;
  4850. return this._request.send("auth.signIn", {
  4851. loginType: Ke.USERNAME,
  4852. username: e,
  4853. password: t,
  4854. refresh_token: this._cache.getStore(n) || ""
  4855. });
  4856. case 6:
  4857. s = _context21.sent;
  4858. r = s.refresh_token;
  4859. i = s.access_token_expire;
  4860. o = s.access_token;
  4861. if (!r) {
  4862. _context21.next = 23;
  4863. break;
  4864. }
  4865. this.setRefreshToken(r);
  4866. if (!(o && i)) {
  4867. _context21.next = 16;
  4868. break;
  4869. }
  4870. this.setAccessToken(o, i);
  4871. _context21.next = 18;
  4872. break;
  4873. case 16:
  4874. _context21.next = 18;
  4875. return this._request.refreshAccessToken();
  4876. case 18:
  4877. _context21.next = 20;
  4878. return this.refreshUserInfo();
  4879. case 20:
  4880. Ue(Le);
  4881. Ue(De, {
  4882. env: this.config.env,
  4883. loginType: Ke.USERNAME,
  4884. persistence: this.config.persistence
  4885. });
  4886. return _context21.abrupt("return", new Ve(this.config.env));
  4887. case 23:
  4888. throw s.code ? new Q({
  4889. code: s.code,
  4890. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  4891. }) : new Q({
  4892. message: "用户名密码登录失败"
  4893. });
  4894. case 24:
  4895. case "end":
  4896. return _context21.stop();
  4897. }
  4898. }
  4899. }, _callee21, this);
  4900. }));
  4901. function signIn(_x17, _x18) {
  4902. return _signIn4.apply(this, arguments);
  4903. }
  4904. return signIn;
  4905. }()
  4906. }]);
  4907. return Ze;
  4908. }(He);
  4909. var et = /*#__PURE__*/function () {
  4910. function et(e) {
  4911. (0, _classCallCheck2.default)(this, et);
  4912. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), xe(De, this._onLoginTypeChanged);
  4913. }
  4914. (0, _createClass2.default)(et, [{
  4915. key: "currentUser",
  4916. get: function get() {
  4917. var e = this.hasLoginState();
  4918. return e && e.user || null;
  4919. }
  4920. }, {
  4921. key: "loginType",
  4922. get: function get() {
  4923. return this._cache.getStore(this._cache.keys.loginTypeKey);
  4924. }
  4925. }, {
  4926. key: "anonymousAuthProvider",
  4927. value: function anonymousAuthProvider() {
  4928. return new Ye(this.config);
  4929. }
  4930. }, {
  4931. key: "customAuthProvider",
  4932. value: function customAuthProvider() {
  4933. return new Qe(this.config);
  4934. }
  4935. }, {
  4936. key: "emailAuthProvider",
  4937. value: function emailAuthProvider() {
  4938. return new Xe(this.config);
  4939. }
  4940. }, {
  4941. key: "usernameAuthProvider",
  4942. value: function usernameAuthProvider() {
  4943. return new Ze(this.config);
  4944. }
  4945. }, {
  4946. key: "signInAnonymously",
  4947. value: function () {
  4948. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
  4949. return _regenerator.default.wrap(function _callee22$(_context22) {
  4950. while (1) {
  4951. switch (_context22.prev = _context22.next) {
  4952. case 0:
  4953. return _context22.abrupt("return", new Ye(this.config).signIn());
  4954. case 1:
  4955. case "end":
  4956. return _context22.stop();
  4957. }
  4958. }
  4959. }, _callee22, this);
  4960. }));
  4961. function signInAnonymously() {
  4962. return _signInAnonymously.apply(this, arguments);
  4963. }
  4964. return signInAnonymously;
  4965. }()
  4966. }, {
  4967. key: "signInWithEmailAndPassword",
  4968. value: function () {
  4969. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(e, t) {
  4970. return _regenerator.default.wrap(function _callee23$(_context23) {
  4971. while (1) {
  4972. switch (_context23.prev = _context23.next) {
  4973. case 0:
  4974. return _context23.abrupt("return", new Xe(this.config).signIn(e, t));
  4975. case 1:
  4976. case "end":
  4977. return _context23.stop();
  4978. }
  4979. }
  4980. }, _callee23, this);
  4981. }));
  4982. function signInWithEmailAndPassword(_x19, _x20) {
  4983. return _signInWithEmailAndPassword.apply(this, arguments);
  4984. }
  4985. return signInWithEmailAndPassword;
  4986. }()
  4987. }, {
  4988. key: "signInWithUsernameAndPassword",
  4989. value: function signInWithUsernameAndPassword(e, t) {
  4990. return new Ze(this.config).signIn(e, t);
  4991. }
  4992. }, {
  4993. key: "linkAndRetrieveDataWithTicket",
  4994. value: function () {
  4995. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e) {
  4996. return _regenerator.default.wrap(function _callee24$(_context24) {
  4997. while (1) {
  4998. switch (_context24.prev = _context24.next) {
  4999. case 0:
  5000. this._anonymousAuthProvider || (this._anonymousAuthProvider = new Ye(this.config)), xe(Fe, this._onAnonymousConverted);
  5001. _context24.next = 3;
  5002. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  5003. case 3:
  5004. return _context24.abrupt("return", _context24.sent);
  5005. case 4:
  5006. case "end":
  5007. return _context24.stop();
  5008. }
  5009. }
  5010. }, _callee24, this);
  5011. }));
  5012. function linkAndRetrieveDataWithTicket(_x21) {
  5013. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  5014. }
  5015. return linkAndRetrieveDataWithTicket;
  5016. }()
  5017. }, {
  5018. key: "signOut",
  5019. value: function () {
  5020. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
  5021. var _this$_cache$keys10, e, t, n, s, r;
  5022. return _regenerator.default.wrap(function _callee25$(_context25) {
  5023. while (1) {
  5024. switch (_context25.prev = _context25.next) {
  5025. case 0:
  5026. if (!(this.loginType === Ke.ANONYMOUS)) {
  5027. _context25.next = 2;
  5028. break;
  5029. }
  5030. throw new Q({
  5031. message: "匿名用户不支持登出操作"
  5032. });
  5033. case 2:
  5034. _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);
  5035. if (s) {
  5036. _context25.next = 5;
  5037. break;
  5038. }
  5039. return _context25.abrupt("return");
  5040. case 5:
  5041. _context25.next = 7;
  5042. return this._request.send("auth.logout", {
  5043. refresh_token: s
  5044. });
  5045. case 7:
  5046. r = _context25.sent;
  5047. return _context25.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Ue(Le), Ue(De, {
  5048. env: this.config.env,
  5049. loginType: Ke.NULL,
  5050. persistence: this.config.persistence
  5051. }), r));
  5052. case 9:
  5053. case "end":
  5054. return _context25.stop();
  5055. }
  5056. }
  5057. }, _callee25, this);
  5058. }));
  5059. function signOut() {
  5060. return _signOut.apply(this, arguments);
  5061. }
  5062. return signOut;
  5063. }()
  5064. }, {
  5065. key: "signUpWithEmailAndPassword",
  5066. value: function () {
  5067. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(e, t) {
  5068. return _regenerator.default.wrap(function _callee26$(_context26) {
  5069. while (1) {
  5070. switch (_context26.prev = _context26.next) {
  5071. case 0:
  5072. return _context26.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  5073. email: e,
  5074. password: t
  5075. }));
  5076. case 1:
  5077. case "end":
  5078. return _context26.stop();
  5079. }
  5080. }
  5081. }, _callee26, this);
  5082. }));
  5083. function signUpWithEmailAndPassword(_x22, _x23) {
  5084. return _signUpWithEmailAndPassword.apply(this, arguments);
  5085. }
  5086. return signUpWithEmailAndPassword;
  5087. }()
  5088. }, {
  5089. key: "sendPasswordResetEmail",
  5090. value: function () {
  5091. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {
  5092. return _regenerator.default.wrap(function _callee27$(_context27) {
  5093. while (1) {
  5094. switch (_context27.prev = _context27.next) {
  5095. case 0:
  5096. return _context27.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  5097. email: e
  5098. }));
  5099. case 1:
  5100. case "end":
  5101. return _context27.stop();
  5102. }
  5103. }
  5104. }, _callee27, this);
  5105. }));
  5106. function sendPasswordResetEmail(_x24) {
  5107. return _sendPasswordResetEmail.apply(this, arguments);
  5108. }
  5109. return sendPasswordResetEmail;
  5110. }()
  5111. }, {
  5112. key: "onLoginStateChanged",
  5113. value: function onLoginStateChanged(e) {
  5114. var _this9 = this;
  5115. xe(Le, function () {
  5116. var t = _this9.hasLoginState();
  5117. e.call(_this9, t);
  5118. });
  5119. var t = this.hasLoginState();
  5120. e.call(this, t);
  5121. }
  5122. }, {
  5123. key: "onLoginStateExpired",
  5124. value: function onLoginStateExpired(e) {
  5125. xe(Ne, e.bind(this));
  5126. }
  5127. }, {
  5128. key: "onAccessTokenRefreshed",
  5129. value: function onAccessTokenRefreshed(e) {
  5130. xe(qe, e.bind(this));
  5131. }
  5132. }, {
  5133. key: "onAnonymousConverted",
  5134. value: function onAnonymousConverted(e) {
  5135. xe(Fe, e.bind(this));
  5136. }
  5137. }, {
  5138. key: "onLoginTypeChanged",
  5139. value: function onLoginTypeChanged(e) {
  5140. var _this10 = this;
  5141. xe(De, function () {
  5142. var t = _this10.hasLoginState();
  5143. e.call(_this10, t);
  5144. });
  5145. }
  5146. }, {
  5147. key: "getAccessToken",
  5148. value: function () {
  5149. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
  5150. return _regenerator.default.wrap(function _callee28$(_context28) {
  5151. while (1) {
  5152. switch (_context28.prev = _context28.next) {
  5153. case 0:
  5154. _context28.next = 2;
  5155. return this._request.getAccessToken();
  5156. case 2:
  5157. _context28.t0 = _context28.sent.accessToken;
  5158. _context28.t1 = this.config.env;
  5159. return _context28.abrupt("return", {
  5160. accessToken: _context28.t0,
  5161. env: _context28.t1
  5162. });
  5163. case 5:
  5164. case "end":
  5165. return _context28.stop();
  5166. }
  5167. }
  5168. }, _callee28, this);
  5169. }));
  5170. function getAccessToken() {
  5171. return _getAccessToken2.apply(this, arguments);
  5172. }
  5173. return getAccessToken;
  5174. }()
  5175. }, {
  5176. key: "hasLoginState",
  5177. value: function hasLoginState() {
  5178. var e = this._cache.keys.refreshTokenKey;
  5179. return this._cache.getStore(e) ? new Ve(this.config.env) : null;
  5180. }
  5181. }, {
  5182. key: "isUsernameRegistered",
  5183. value: function () {
  5184. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(e) {
  5185. var _yield$this$_request$5, t;
  5186. return _regenerator.default.wrap(function _callee29$(_context29) {
  5187. while (1) {
  5188. switch (_context29.prev = _context29.next) {
  5189. case 0:
  5190. if (!("string" != typeof e)) {
  5191. _context29.next = 2;
  5192. break;
  5193. }
  5194. throw new Q({
  5195. code: "PARAM_ERROR",
  5196. message: "username must be a string"
  5197. });
  5198. case 2:
  5199. _context29.next = 4;
  5200. return this._request.send("auth.isUsernameRegistered", {
  5201. username: e
  5202. });
  5203. case 4:
  5204. _yield$this$_request$5 = _context29.sent;
  5205. t = _yield$this$_request$5.data;
  5206. return _context29.abrupt("return", t && t.isRegistered);
  5207. case 7:
  5208. case "end":
  5209. return _context29.stop();
  5210. }
  5211. }
  5212. }, _callee29, this);
  5213. }));
  5214. function isUsernameRegistered(_x25) {
  5215. return _isUsernameRegistered.apply(this, arguments);
  5216. }
  5217. return isUsernameRegistered;
  5218. }()
  5219. }, {
  5220. key: "getLoginState",
  5221. value: function getLoginState() {
  5222. return Promise.resolve(this.hasLoginState());
  5223. }
  5224. }, {
  5225. key: "signInWithTicket",
  5226. value: function () {
  5227. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  5228. return _regenerator.default.wrap(function _callee30$(_context30) {
  5229. while (1) {
  5230. switch (_context30.prev = _context30.next) {
  5231. case 0:
  5232. return _context30.abrupt("return", new Qe(this.config).signIn(e));
  5233. case 1:
  5234. case "end":
  5235. return _context30.stop();
  5236. }
  5237. }
  5238. }, _callee30, this);
  5239. }));
  5240. function signInWithTicket(_x26) {
  5241. return _signInWithTicket.apply(this, arguments);
  5242. }
  5243. return signInWithTicket;
  5244. }()
  5245. }, {
  5246. key: "shouldRefreshAccessToken",
  5247. value: function shouldRefreshAccessToken(e) {
  5248. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  5249. }
  5250. }, {
  5251. key: "getUserInfo",
  5252. value: function getUserInfo() {
  5253. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  5254. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  5255. requestId: e.seqId
  5256. });
  5257. });
  5258. }
  5259. }, {
  5260. key: "getAuthHeader",
  5261. value: function getAuthHeader() {
  5262. var _this$_cache$keys11 = this._cache.keys,
  5263. e = _this$_cache$keys11.refreshTokenKey,
  5264. t = _this$_cache$keys11.accessTokenKey,
  5265. n = this._cache.getStore(e);
  5266. return {
  5267. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  5268. };
  5269. }
  5270. }, {
  5271. key: "_onAnonymousConverted",
  5272. value: function _onAnonymousConverted(e) {
  5273. var t = e.data.env;
  5274. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  5275. }
  5276. }, {
  5277. key: "_onLoginTypeChanged",
  5278. value: function _onLoginTypeChanged(e) {
  5279. var _e$data = e.data,
  5280. t = _e$data.loginType,
  5281. n = _e$data.persistence,
  5282. s = _e$data.env;
  5283. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  5284. }
  5285. }]);
  5286. return et;
  5287. }();
  5288. var tt = function tt(e, t) {
  5289. t = t || ge();
  5290. var n = Je(this.config.env),
  5291. s = e.cloudPath,
  5292. r = e.filePath,
  5293. i = e.onUploadProgress,
  5294. _e$fileType = e.fileType,
  5295. o = _e$fileType === void 0 ? "image" : _e$fileType;
  5296. return n.send("storage.getUploadMetadata", {
  5297. path: s
  5298. }).then(function (e) {
  5299. var _e$data2 = e.data,
  5300. a = _e$data2.url,
  5301. c = _e$data2.authorization,
  5302. u = _e$data2.token,
  5303. l = _e$data2.fileId,
  5304. h = _e$data2.cosFileId,
  5305. d = e.requestId,
  5306. f = {
  5307. key: s,
  5308. signature: c,
  5309. "x-cos-meta-fileid": h,
  5310. success_action_status: "201",
  5311. "x-cos-security-token": u
  5312. };
  5313. n.upload({
  5314. url: a,
  5315. data: f,
  5316. file: r,
  5317. name: s,
  5318. fileType: o,
  5319. onUploadProgress: i
  5320. }).then(function (e) {
  5321. 201 === e.statusCode ? t(null, {
  5322. fileID: l,
  5323. requestId: d
  5324. }) : t(new Q({
  5325. code: "STORAGE_REQUEST_FAIL",
  5326. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  5327. }));
  5328. }).catch(function (e) {
  5329. t(e);
  5330. });
  5331. }).catch(function (e) {
  5332. t(e);
  5333. }), t.promise;
  5334. },
  5335. nt = function nt(e, t) {
  5336. t = t || ge();
  5337. var n = Je(this.config.env),
  5338. s = e.cloudPath;
  5339. return n.send("storage.getUploadMetadata", {
  5340. path: s
  5341. }).then(function (e) {
  5342. t(null, e);
  5343. }).catch(function (e) {
  5344. t(e);
  5345. }), t.promise;
  5346. },
  5347. st = function st(_ref6, t) {
  5348. var e = _ref6.fileList;
  5349. if (t = t || ge(), !e || !Array.isArray(e)) return {
  5350. code: "INVALID_PARAM",
  5351. message: "fileList必须是非空的数组"
  5352. };
  5353. var _iterator3 = _createForOfIteratorHelper(e),
  5354. _step3;
  5355. try {
  5356. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  5357. var _t8 = _step3.value;
  5358. if (!_t8 || "string" != typeof _t8) return {
  5359. code: "INVALID_PARAM",
  5360. message: "fileList的元素必须是非空的字符串"
  5361. };
  5362. }
  5363. } catch (err) {
  5364. _iterator3.e(err);
  5365. } finally {
  5366. _iterator3.f();
  5367. }
  5368. var n = {
  5369. fileid_list: e
  5370. };
  5371. return Je(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  5372. e.code ? t(null, e) : t(null, {
  5373. fileList: e.data.delete_list,
  5374. requestId: e.requestId
  5375. });
  5376. }).catch(function (e) {
  5377. t(e);
  5378. }), t.promise;
  5379. },
  5380. rt = function rt(_ref7, t) {
  5381. var e = _ref7.fileList;
  5382. t = t || ge(), e && Array.isArray(e) || t(null, {
  5383. code: "INVALID_PARAM",
  5384. message: "fileList必须是非空的数组"
  5385. });
  5386. var n = [];
  5387. var _iterator4 = _createForOfIteratorHelper(e),
  5388. _step4;
  5389. try {
  5390. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  5391. var _s9 = _step4.value;
  5392. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  5393. code: "INVALID_PARAM",
  5394. message: "fileList的元素必须是包含fileID和maxAge的对象"
  5395. }), n.push({
  5396. fileid: _s9.fileID,
  5397. max_age: _s9.maxAge
  5398. })) : "string" == typeof _s9 ? n.push({
  5399. fileid: _s9
  5400. }) : t(null, {
  5401. code: "INVALID_PARAM",
  5402. message: "fileList的元素必须是字符串"
  5403. });
  5404. }
  5405. } catch (err) {
  5406. _iterator4.e(err);
  5407. } finally {
  5408. _iterator4.f();
  5409. }
  5410. var s = {
  5411. file_list: n
  5412. };
  5413. return Je(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  5414. e.code ? t(null, e) : t(null, {
  5415. fileList: e.data.download_list,
  5416. requestId: e.requestId
  5417. });
  5418. }).catch(function (e) {
  5419. t(e);
  5420. }), t.promise;
  5421. },
  5422. it = /*#__PURE__*/function () {
  5423. var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(_ref8, t) {
  5424. var e, n, s, r;
  5425. return _regenerator.default.wrap(function _callee31$(_context31) {
  5426. while (1) {
  5427. switch (_context31.prev = _context31.next) {
  5428. case 0:
  5429. e = _ref8.fileID;
  5430. _context31.next = 3;
  5431. return rt.call(this, {
  5432. fileList: [{
  5433. fileID: e,
  5434. maxAge: 600
  5435. }]
  5436. });
  5437. case 3:
  5438. n = _context31.sent.fileList[0];
  5439. if (!("SUCCESS" !== n.code)) {
  5440. _context31.next = 6;
  5441. break;
  5442. }
  5443. return _context31.abrupt("return", t ? t(n) : new Promise(function (e) {
  5444. e(n);
  5445. }));
  5446. case 6:
  5447. s = Je(this.config.env);
  5448. r = n.download_url;
  5449. if (!(r = encodeURI(r), !t)) {
  5450. _context31.next = 10;
  5451. break;
  5452. }
  5453. return _context31.abrupt("return", s.download({
  5454. url: r
  5455. }));
  5456. case 10:
  5457. _context31.t0 = t;
  5458. _context31.next = 13;
  5459. return s.download({
  5460. url: r
  5461. });
  5462. case 13:
  5463. _context31.t1 = _context31.sent;
  5464. (0, _context31.t0)(_context31.t1);
  5465. case 15:
  5466. case "end":
  5467. return _context31.stop();
  5468. }
  5469. }
  5470. }, _callee31, this);
  5471. }));
  5472. return function it(_x27, _x28) {
  5473. return _ref9.apply(this, arguments);
  5474. };
  5475. }(),
  5476. ot = function ot(_ref10, i) {
  5477. var e = _ref10.name,
  5478. t = _ref10.data,
  5479. n = _ref10.query,
  5480. s = _ref10.parse,
  5481. r = _ref10.search;
  5482. var o = i || ge();
  5483. var a;
  5484. try {
  5485. a = t ? JSON.stringify(t) : "";
  5486. } catch (e) {
  5487. return Promise.reject(e);
  5488. }
  5489. if (!e) return Promise.reject(new Q({
  5490. code: "PARAM_ERROR",
  5491. message: "函数名不能为空"
  5492. }));
  5493. var c = {
  5494. inQuery: n,
  5495. parse: s,
  5496. search: r,
  5497. function_name: e,
  5498. request_data: a
  5499. };
  5500. return Je(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  5501. if (e.code) o(null, e);else {
  5502. var _t9 = e.data.response_data;
  5503. if (s) o(null, {
  5504. result: _t9,
  5505. requestId: e.requestId
  5506. });else try {
  5507. _t9 = JSON.parse(e.data.response_data), o(null, {
  5508. result: _t9,
  5509. requestId: e.requestId
  5510. });
  5511. } catch (e) {
  5512. o(new Q({
  5513. message: "response data must be json"
  5514. }));
  5515. }
  5516. }
  5517. return o.promise;
  5518. }).catch(function (e) {
  5519. o(e);
  5520. }), o.promise;
  5521. },
  5522. at = {
  5523. timeout: 15e3,
  5524. persistence: "session"
  5525. },
  5526. ct = {};
  5527. var ut = /*#__PURE__*/function () {
  5528. function ut(e) {
  5529. (0, _classCallCheck2.default)(this, ut);
  5530. this.config = e || this.config, this.authObj = void 0;
  5531. }
  5532. (0, _createClass2.default)(ut, [{
  5533. key: "init",
  5534. value: function init(e) {
  5535. switch (ve.adapter || (this.requestClient = new ve.adapter.reqClass({
  5536. timeout: e.timeout || 5e3,
  5537. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  5538. })), this.config = _objectSpread(_objectSpread({}, at), e), !0) {
  5539. case this.config.timeout > 6e5:
  5540. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  5541. break;
  5542. case this.config.timeout < 100:
  5543. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  5544. }
  5545. return new ut(this.config);
  5546. }
  5547. }, {
  5548. key: "auth",
  5549. value: function auth() {
  5550. var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5551. e = _ref11.persistence;
  5552. if (this.authObj) return this.authObj;
  5553. var t = e || ve.adapter.primaryStorage || at.persistence;
  5554. var n;
  5555. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  5556. var t = e.env;
  5557. Te[t] = new be(e), Ae[t] = new be(_objectSpread(_objectSpread({}, e), {}, {
  5558. persistence: "local"
  5559. }));
  5560. }(this.config), n = this.config, ze[n.env] = new We(n), this.authObj = new et(this.config), this.authObj;
  5561. }
  5562. }, {
  5563. key: "on",
  5564. value: function on(e, t) {
  5565. return xe.apply(this, [e, t]);
  5566. }
  5567. }, {
  5568. key: "off",
  5569. value: function off(e, t) {
  5570. return Re.apply(this, [e, t]);
  5571. }
  5572. }, {
  5573. key: "callFunction",
  5574. value: function callFunction(e, t) {
  5575. return ot.apply(this, [e, t]);
  5576. }
  5577. }, {
  5578. key: "deleteFile",
  5579. value: function deleteFile(e, t) {
  5580. return st.apply(this, [e, t]);
  5581. }
  5582. }, {
  5583. key: "getTempFileURL",
  5584. value: function getTempFileURL(e, t) {
  5585. return rt.apply(this, [e, t]);
  5586. }
  5587. }, {
  5588. key: "downloadFile",
  5589. value: function downloadFile(e, t) {
  5590. return it.apply(this, [e, t]);
  5591. }
  5592. }, {
  5593. key: "uploadFile",
  5594. value: function uploadFile(e, t) {
  5595. return tt.apply(this, [e, t]);
  5596. }
  5597. }, {
  5598. key: "getUploadMetadata",
  5599. value: function getUploadMetadata(e, t) {
  5600. return nt.apply(this, [e, t]);
  5601. }
  5602. }, {
  5603. key: "registerExtension",
  5604. value: function registerExtension(e) {
  5605. ct[e.name] = e;
  5606. }
  5607. }, {
  5608. key: "invokeExtension",
  5609. value: function () {
  5610. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(e, t) {
  5611. var n;
  5612. return _regenerator.default.wrap(function _callee32$(_context32) {
  5613. while (1) {
  5614. switch (_context32.prev = _context32.next) {
  5615. case 0:
  5616. n = ct[e];
  5617. if (n) {
  5618. _context32.next = 3;
  5619. break;
  5620. }
  5621. throw new Q({
  5622. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  5623. });
  5624. case 3:
  5625. _context32.next = 5;
  5626. return n.invoke(t, this);
  5627. case 5:
  5628. return _context32.abrupt("return", _context32.sent);
  5629. case 6:
  5630. case "end":
  5631. return _context32.stop();
  5632. }
  5633. }
  5634. }, _callee32, this);
  5635. }));
  5636. function invokeExtension(_x29, _x30) {
  5637. return _invokeExtension.apply(this, arguments);
  5638. }
  5639. return invokeExtension;
  5640. }()
  5641. }, {
  5642. key: "useAdapters",
  5643. value: function useAdapters(e) {
  5644. var _ref12 = we(e) || {},
  5645. t = _ref12.adapter,
  5646. n = _ref12.runtime;
  5647. t && (ve.adapter = t), n && (ve.runtime = n);
  5648. }
  5649. }]);
  5650. return ut;
  5651. }();
  5652. var lt = new ut();
  5653. function ht(e, t, n) {
  5654. void 0 === n && (n = {});
  5655. var s = /\?/.test(t),
  5656. r = "";
  5657. for (var i in n) {
  5658. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  5659. }
  5660. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  5661. }
  5662. var dt = /*#__PURE__*/function () {
  5663. function dt() {
  5664. (0, _classCallCheck2.default)(this, dt);
  5665. }
  5666. (0, _createClass2.default)(dt, [{
  5667. key: "post",
  5668. value: function post(e) {
  5669. var t = e.url,
  5670. n = e.data,
  5671. s = e.headers;
  5672. return new Promise(function (e, r) {
  5673. X.request({
  5674. url: ht("https:", t),
  5675. data: n,
  5676. method: "POST",
  5677. header: s,
  5678. success: function success(t) {
  5679. e(t);
  5680. },
  5681. fail: function fail(e) {
  5682. r(e);
  5683. }
  5684. });
  5685. });
  5686. }
  5687. }, {
  5688. key: "upload",
  5689. value: function upload(e) {
  5690. return new Promise(function (t, n) {
  5691. var s = e.url,
  5692. r = e.file,
  5693. i = e.data,
  5694. o = e.headers,
  5695. a = e.fileType,
  5696. c = X.uploadFile({
  5697. url: ht("https:", s),
  5698. name: "file",
  5699. formData: Object.assign({}, i),
  5700. filePath: r,
  5701. fileType: a,
  5702. header: o,
  5703. success: function success(e) {
  5704. var n = {
  5705. statusCode: e.statusCode,
  5706. data: e.data || {}
  5707. };
  5708. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  5709. },
  5710. fail: function fail(e) {
  5711. n(new Error(e.errMsg || "uploadFile:fail"));
  5712. }
  5713. });
  5714. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  5715. e.onUploadProgress({
  5716. loaded: t.totalBytesSent,
  5717. total: t.totalBytesExpectedToSend
  5718. });
  5719. });
  5720. });
  5721. }
  5722. }]);
  5723. return dt;
  5724. }();
  5725. var ft = {
  5726. setItem: function setItem(e, t) {
  5727. X.setStorageSync(e, t);
  5728. },
  5729. getItem: function getItem(e) {
  5730. return X.getStorageSync(e);
  5731. },
  5732. removeItem: function removeItem(e) {
  5733. X.removeStorageSync(e);
  5734. },
  5735. clear: function clear() {
  5736. X.clearStorageSync();
  5737. }
  5738. };
  5739. var pt = {
  5740. genAdapter: function genAdapter() {
  5741. return {
  5742. root: {},
  5743. reqClass: dt,
  5744. localStorage: ft,
  5745. primaryStorage: "local"
  5746. };
  5747. },
  5748. isMatch: function isMatch() {
  5749. return !0;
  5750. },
  5751. runtime: "uni_app"
  5752. };
  5753. lt.useAdapters(pt);
  5754. var gt = lt,
  5755. mt = gt.init;
  5756. gt.init = function (e) {
  5757. e.env = e.spaceId;
  5758. var t = mt.call(this, e);
  5759. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  5760. var n = t.auth;
  5761. return t.auth = function (e) {
  5762. var t = n.call(this, e);
  5763. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  5764. t[e] = Y(t[e]).bind(t);
  5765. }), t;
  5766. }, t.customAuth = t.auth, t;
  5767. };
  5768. var yt = gt;
  5769. var _t = /*#__PURE__*/function (_le) {
  5770. (0, _inherits2.default)(_t, _le);
  5771. var _super8 = _createSuper(_t);
  5772. function _t() {
  5773. (0, _classCallCheck2.default)(this, _t);
  5774. return _super8.apply(this, arguments);
  5775. }
  5776. (0, _createClass2.default)(_t, [{
  5777. key: "getAccessToken",
  5778. value: function getAccessToken() {
  5779. var _this11 = this;
  5780. return new Promise(function (e, t) {
  5781. var n = "Anonymous_Access_token";
  5782. _this11.setAccessToken(n), e(n);
  5783. });
  5784. }
  5785. }, {
  5786. key: "setupRequest",
  5787. value: function setupRequest(e, t) {
  5788. var n = Object.assign({}, e, {
  5789. spaceId: this.config.spaceId,
  5790. timestamp: Date.now()
  5791. }),
  5792. s = {
  5793. "Content-Type": "application/json"
  5794. };
  5795. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret);
  5796. var r = oe();
  5797. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  5798. var _Z = Z(),
  5799. i = _Z.token;
  5800. return s["x-client-token"] = i, {
  5801. url: this.config.requestUrl,
  5802. method: "POST",
  5803. data: n,
  5804. dataType: "json",
  5805. header: JSON.parse(JSON.stringify(s))
  5806. };
  5807. }
  5808. }, {
  5809. key: "uploadFileToOSS",
  5810. value: function uploadFileToOSS(_ref13) {
  5811. var _this12 = this;
  5812. var e = _ref13.url,
  5813. t = _ref13.formData,
  5814. n = _ref13.name,
  5815. s = _ref13.filePath,
  5816. r = _ref13.fileType,
  5817. i = _ref13.onUploadProgress;
  5818. return new Promise(function (o, a) {
  5819. var c = _this12.adapter.uploadFile({
  5820. url: e,
  5821. formData: t,
  5822. name: n,
  5823. filePath: s,
  5824. fileType: r,
  5825. success: function success(e) {
  5826. e && e.statusCode < 400 ? o(e) : a(new Q({
  5827. code: "UPLOAD_FAILED",
  5828. message: "文件上传失败"
  5829. }));
  5830. },
  5831. fail: function fail(e) {
  5832. a(new Q({
  5833. code: e.code || "UPLOAD_FAILED",
  5834. message: e.message || e.errMsg || "文件上传失败"
  5835. }));
  5836. }
  5837. });
  5838. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  5839. i({
  5840. loaded: e.totalBytesSent,
  5841. total: e.totalBytesExpectedToSend
  5842. });
  5843. });
  5844. });
  5845. }
  5846. }, {
  5847. key: "uploadFile",
  5848. value: function uploadFile(_ref14) {
  5849. var _this13 = this;
  5850. var e = _ref14.filePath,
  5851. t = _ref14.cloudPath,
  5852. _ref14$fileType = _ref14.fileType,
  5853. n = _ref14$fileType === void 0 ? "image" : _ref14$fileType,
  5854. s = _ref14.onUploadProgress;
  5855. if (!t) throw new Q({
  5856. code: "CLOUDPATH_REQUIRED",
  5857. message: "cloudPath不可为空"
  5858. });
  5859. var r;
  5860. return this.getOSSUploadOptionsFromPath({
  5861. cloudPath: t
  5862. }).then(function (t) {
  5863. var _t$result = t.result,
  5864. i = _t$result.url,
  5865. o = _t$result.formData,
  5866. a = _t$result.name;
  5867. r = t.result.fileUrl;
  5868. var c = {
  5869. url: i,
  5870. formData: o,
  5871. name: a,
  5872. filePath: e,
  5873. fileType: n
  5874. };
  5875. return _this13.uploadFileToOSS(Object.assign({}, c, {
  5876. onUploadProgress: s
  5877. }));
  5878. }).then(function () {
  5879. return _this13.reportOSSUpload({
  5880. cloudPath: t
  5881. });
  5882. }).then(function (t) {
  5883. return new Promise(function (n, s) {
  5884. t.success ? n({
  5885. success: !0,
  5886. filePath: e,
  5887. fileID: r
  5888. }) : s(new Q({
  5889. code: "UPLOAD_FAILED",
  5890. message: "文件上传失败"
  5891. }));
  5892. });
  5893. });
  5894. }
  5895. }, {
  5896. key: "deleteFile",
  5897. value: function deleteFile(_ref15) {
  5898. var e = _ref15.fileList;
  5899. var t = {
  5900. method: "serverless.file.resource.delete",
  5901. params: JSON.stringify({
  5902. fileList: e
  5903. })
  5904. };
  5905. return this.request(this.setupRequest(t)).then(function (e) {
  5906. if (e.success) return e.result;
  5907. throw new Q({
  5908. code: "DELETE_FILE_FAILED",
  5909. message: "删除文件失败"
  5910. });
  5911. });
  5912. }
  5913. }, {
  5914. key: "getTempFileURL",
  5915. value: function getTempFileURL() {
  5916. var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5917. e = _ref16.fileList;
  5918. if (!Array.isArray(e) || 0 === e.length) throw new Q({
  5919. code: "INVALID_PARAM",
  5920. message: "fileList的元素必须是非空的字符串"
  5921. });
  5922. var t = {
  5923. method: "serverless.file.resource.getTempFileURL",
  5924. params: JSON.stringify({
  5925. fileList: e
  5926. })
  5927. };
  5928. return this.request(this.setupRequest(t)).then(function (e) {
  5929. if (e.success) return {
  5930. fileList: e.result.fileList.map(function (e) {
  5931. return {
  5932. fileID: e.fileID,
  5933. tempFileURL: e.tempFileURL
  5934. };
  5935. })
  5936. };
  5937. throw new Q({
  5938. code: "GET_TEMP_FILE_URL_FAILED",
  5939. message: "获取临时文件链接失败"
  5940. });
  5941. });
  5942. }
  5943. }]);
  5944. return _t;
  5945. }(le);
  5946. var wt = {
  5947. init: function init(e) {
  5948. var t = new _t(e),
  5949. n = {
  5950. signInAnonymously: function signInAnonymously() {
  5951. return t.authorize();
  5952. },
  5953. getLoginState: function getLoginState() {
  5954. return Promise.resolve(!1);
  5955. }
  5956. };
  5957. return t.auth = function () {
  5958. return n;
  5959. }, t.customAuth = t.auth, t;
  5960. }
  5961. };
  5962. function vt(_ref17) {
  5963. var e = _ref17.data;
  5964. var t;
  5965. t = oe();
  5966. var n = JSON.parse(JSON.stringify(e || {}));
  5967. if (Object.assign(n, {
  5968. clientInfo: t
  5969. }), !n.uniIdToken) {
  5970. var _Z2 = Z(),
  5971. _e20 = _Z2.token;
  5972. _e20 && (n.uniIdToken = _e20);
  5973. }
  5974. return n;
  5975. }
  5976. function St() {
  5977. var _this14 = this;
  5978. var _ref18 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5979. e = _ref18.name,
  5980. t = _ref18.data;
  5981. var _this$__dev__ = this.__dev__,
  5982. n = _this$__dev__.localAddress,
  5983. s = _this$__dev__.localPort,
  5984. r = {
  5985. aliyun: "aliyun",
  5986. tencent: "tcb"
  5987. }[this.config.provider],
  5988. i = this.config.spaceId,
  5989. o = "http://".concat(n, ":").concat(s, "/system/check-function"),
  5990. a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  5991. return new Promise(function (t, n) {
  5992. X.request({
  5993. method: "POST",
  5994. url: o,
  5995. data: {
  5996. name: e,
  5997. platform: S,
  5998. provider: r,
  5999. spaceId: i
  6000. },
  6001. timeout: 3e3,
  6002. success: function success(e) {
  6003. t(e);
  6004. },
  6005. fail: function fail() {
  6006. t({
  6007. data: {
  6008. code: "NETWORK_ERROR",
  6009. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  6010. }
  6011. });
  6012. }
  6013. });
  6014. }).then(function () {
  6015. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  6016. e = _ref19.data;
  6017. var _ref20 = e || {},
  6018. t = _ref20.code,
  6019. n = _ref20.message;
  6020. return {
  6021. code: 0 === t ? 0 : t || "SYS_ERR",
  6022. message: n || "SYS_ERR"
  6023. };
  6024. }).then(function (_ref21) {
  6025. var n = _ref21.code,
  6026. s = _ref21.message;
  6027. if (0 !== n) {
  6028. switch (n) {
  6029. case "MODULE_ENCRYPTED":
  6030. 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"));
  6031. break;
  6032. case "FUNCTION_ENCRYPTED":
  6033. 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"));
  6034. break;
  6035. case "ACTION_ENCRYPTED":
  6036. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  6037. break;
  6038. case "NETWORK_ERROR":
  6039. {
  6040. var _e21 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  6041. throw console.error(_e21), new Error(_e21);
  6042. }
  6043. case "SWITCH_TO_CLOUD":
  6044. break;
  6045. default:
  6046. {
  6047. var _e22 = "\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");
  6048. throw console.error(_e22), new Error(_e22);
  6049. }
  6050. }
  6051. return _this14._callCloudFunction({
  6052. name: e,
  6053. data: t
  6054. });
  6055. }
  6056. return new Promise(function (e, n) {
  6057. var s = vt.call(_this14, {
  6058. data: t
  6059. });
  6060. X.request({
  6061. method: "POST",
  6062. url: a,
  6063. data: {
  6064. provider: r,
  6065. platform: S,
  6066. param: s
  6067. },
  6068. success: function success() {
  6069. var _ref22 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  6070. t = _ref22.statusCode,
  6071. s = _ref22.data;
  6072. return !t || t >= 400 ? n(new Q({
  6073. code: s.code || "SYS_ERR",
  6074. message: s.message || "request:fail"
  6075. })) : e({
  6076. result: s
  6077. });
  6078. },
  6079. fail: function fail(e) {
  6080. n(new Q({
  6081. code: e.code || e.errCode || "SYS_ERR",
  6082. message: e.message || e.errMsg || "request:fail"
  6083. }));
  6084. }
  6085. });
  6086. });
  6087. });
  6088. }
  6089. var kt = [{
  6090. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  6091. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  6092. mode: "append"
  6093. }];
  6094. var It = /[\\^$.*+?()[\]{}|]/g,
  6095. bt = RegExp(It.source);
  6096. function Tt(e, t, n) {
  6097. return e.replace(new RegExp((s = t) && bt.test(s) ? s.replace(It, "\\$&") : s, "g"), n);
  6098. var s;
  6099. }
  6100. var At = "none",
  6101. Ct = "request",
  6102. Pt = "response",
  6103. Et = "both";
  6104. var Ot = /*#__PURE__*/function () {
  6105. function Ot() {
  6106. var _ref23 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  6107. e = _ref23.secretType,
  6108. t = _ref23.uniCloudIns;
  6109. (0, _classCallCheck2.default)(this, Ot);
  6110. this.secretType = e || At, this.uniCloudIns = t;
  6111. var _this$uniCloudIns$con = this.uniCloudIns.config,
  6112. n = _this$uniCloudIns$con.provider,
  6113. s = _this$uniCloudIns$con.spaceId;
  6114. var r;
  6115. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  6116. }
  6117. (0, _createClass2.default)(Ot, [{
  6118. key: "getSystemInfo",
  6119. value: function getSystemInfo() {
  6120. return this._systemInfo || (this._systemInfo = re()), this._systemInfo;
  6121. }
  6122. }, {
  6123. key: "appId",
  6124. get: function get() {
  6125. return this.getSystemInfo().appId;
  6126. }
  6127. }, {
  6128. key: "deviceId",
  6129. get: function get() {
  6130. return this.getSystemInfo().deviceId;
  6131. }
  6132. }, {
  6133. key: "encryptData",
  6134. value: function () {
  6135. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e) {
  6136. return _regenerator.default.wrap(function _callee33$(_context33) {
  6137. while (1) {
  6138. switch (_context33.prev = _context33.next) {
  6139. case 0:
  6140. return _context33.abrupt("return", this.secretType === At || this.secretType === At ? e : this.platformEncryptData(e));
  6141. case 1:
  6142. case "end":
  6143. return _context33.stop();
  6144. }
  6145. }
  6146. }, _callee33, this);
  6147. }));
  6148. function encryptData(_x31) {
  6149. return _encryptData.apply(this, arguments);
  6150. }
  6151. return encryptData;
  6152. }()
  6153. }, {
  6154. key: "decryptResult",
  6155. value: function () {
  6156. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  6157. var t;
  6158. return _regenerator.default.wrap(function _callee34$(_context34) {
  6159. while (1) {
  6160. switch (_context34.prev = _context34.next) {
  6161. case 0:
  6162. if (!(this.secretType === At)) {
  6163. _context34.next = 2;
  6164. break;
  6165. }
  6166. return _context34.abrupt("return", e);
  6167. case 2:
  6168. t = e.content;
  6169. return _context34.abrupt("return", t ? this.secretType === Ct ? t : this.platformDecryptResult(e) : e);
  6170. case 4:
  6171. case "end":
  6172. return _context34.stop();
  6173. }
  6174. }
  6175. }, _callee34, this);
  6176. }));
  6177. function decryptResult(_x32) {
  6178. return _decryptResult.apply(this, arguments);
  6179. }
  6180. return decryptResult;
  6181. }()
  6182. }, {
  6183. key: "wrapVerifyClientCallFunction",
  6184. value: function wrapVerifyClientCallFunction(e) {
  6185. var t = this;
  6186. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
  6187. var _ref25,
  6188. n,
  6189. _ref25$data,
  6190. s,
  6191. _args35 = arguments;
  6192. return _regenerator.default.wrap(function _callee35$(_context35) {
  6193. while (1) {
  6194. switch (_context35.prev = _context35.next) {
  6195. case 0:
  6196. _ref25 = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {}, n = _ref25.name, _ref25$data = _ref25.data, s = _ref25$data === void 0 ? {} : _ref25$data;
  6197. _context35.next = 3;
  6198. return t.prepare();
  6199. case 3:
  6200. _context35.next = 5;
  6201. return t.platformGetSignOption();
  6202. case 5:
  6203. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context35.sent;
  6204. _context35.next = 8;
  6205. return e({
  6206. name: n,
  6207. data: s
  6208. });
  6209. case 8:
  6210. return _context35.abrupt("return", _context35.sent);
  6211. case 9:
  6212. case "end":
  6213. return _context35.stop();
  6214. }
  6215. }
  6216. }, _callee35);
  6217. }));
  6218. }
  6219. }, {
  6220. key: "wrapEncryptDataCallFunction",
  6221. value: function wrapEncryptDataCallFunction(e) {
  6222. var t = this;
  6223. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  6224. var _ref27,
  6225. n,
  6226. _ref27$data,
  6227. s,
  6228. r,
  6229. i,
  6230. _args36 = arguments;
  6231. return _regenerator.default.wrap(function _callee36$(_context36) {
  6232. while (1) {
  6233. switch (_context36.prev = _context36.next) {
  6234. case 0:
  6235. _ref27 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref27.name, _ref27$data = _ref27.data, s = _ref27$data === void 0 ? {} : _ref27$data;
  6236. _context36.next = 3;
  6237. return t.prepare();
  6238. case 3:
  6239. _context36.next = 5;
  6240. return t.encryptData(s);
  6241. case 5:
  6242. r = _context36.sent;
  6243. _context36.next = 8;
  6244. return e({
  6245. name: n,
  6246. data: r
  6247. });
  6248. case 8:
  6249. i = _context36.sent;
  6250. _context36.next = 11;
  6251. return t.decryptResult(i.result);
  6252. case 11:
  6253. i.result = _context36.sent;
  6254. return _context36.abrupt("return", i);
  6255. case 13:
  6256. case "end":
  6257. return _context36.stop();
  6258. }
  6259. }
  6260. }, _callee36);
  6261. }));
  6262. }
  6263. }]);
  6264. return Ot;
  6265. }();
  6266. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  6267. function xt(e) {
  6268. return parseInt(e) === e;
  6269. }
  6270. function Ut(e) {
  6271. if (!xt(e.length)) return !1;
  6272. for (var t = 0; t < e.length; t++) {
  6273. if (!xt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  6274. }
  6275. return !0;
  6276. }
  6277. function Rt(e, t) {
  6278. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  6279. if (Array.isArray(e)) {
  6280. if (!Ut(e)) throw new Error("Array contains invalid value: " + e);
  6281. return new Uint8Array(e);
  6282. }
  6283. if (xt(e.length) && Ut(e)) return new Uint8Array(e);
  6284. throw new Error("unsupported array-like object");
  6285. }
  6286. function Lt(e) {
  6287. return new Uint8Array(e);
  6288. }
  6289. function Nt(e, t, n, s, r) {
  6290. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  6291. }
  6292. var Dt,
  6293. Ft = {
  6294. toBytes: function toBytes(e) {
  6295. var t = [],
  6296. n = 0;
  6297. for (e = encodeURI(e); n < e.length;) {
  6298. var s = e.charCodeAt(n++);
  6299. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  6300. }
  6301. return Rt(t);
  6302. },
  6303. fromBytes: function fromBytes(e) {
  6304. for (var t = [], n = 0; n < e.length;) {
  6305. var s = e[n];
  6306. s < 128 ? (t.push(String.fromCharCode(s)), n++) : s > 191 && s < 224 ? (t.push(String.fromCharCode((31 & s) << 6 | 63 & e[n + 1])), n += 2) : (t.push(String.fromCharCode((15 & s) << 12 | (63 & e[n + 1]) << 6 | 63 & e[n + 2])), n += 3);
  6307. }
  6308. return t.join("");
  6309. }
  6310. },
  6311. qt = (Dt = "0123456789abcdef", {
  6312. toBytes: function toBytes(e) {
  6313. for (var t = [], n = 0; n < e.length; n += 2) {
  6314. t.push(parseInt(e.substr(n, 2), 16));
  6315. }
  6316. return t;
  6317. },
  6318. fromBytes: function fromBytes(e) {
  6319. for (var t = [], n = 0; n < e.length; n++) {
  6320. var s = e[n];
  6321. t.push(Dt[(240 & s) >> 4] + Dt[15 & s]);
  6322. }
  6323. return t.join("");
  6324. }
  6325. }),
  6326. Kt = {
  6327. 16: 10,
  6328. 24: 12,
  6329. 32: 14
  6330. },
  6331. Mt = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  6332. jt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  6333. Bt = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  6334. $t = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  6335. Wt = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  6336. zt = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  6337. Jt = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  6338. Ht = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  6339. Gt = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  6340. Vt = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  6341. Yt = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  6342. Qt = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  6343. Xt = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  6344. Zt = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  6345. en = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  6346. function tn(e) {
  6347. for (var t = [], n = 0; n < e.length; n += 4) {
  6348. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  6349. }
  6350. return t;
  6351. }
  6352. var nn = /*#__PURE__*/function () {
  6353. function nn(e) {
  6354. (0, _classCallCheck2.default)(this, nn);
  6355. if (!(this instanceof nn)) throw Error("AES must be instanitated with `new`");
  6356. Object.defineProperty(this, "key", {
  6357. value: Rt(e, !0)
  6358. }), this._prepare();
  6359. }
  6360. (0, _createClass2.default)(nn, [{
  6361. key: "_prepare",
  6362. value: function _prepare() {
  6363. var e = Kt[this.key.length];
  6364. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  6365. this._Ke = [], this._Kd = [];
  6366. for (var t = 0; t <= e; t++) {
  6367. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  6368. }
  6369. var n,
  6370. s = 4 * (e + 1),
  6371. r = this.key.length / 4,
  6372. i = tn(this.key);
  6373. for (t = 0; t < r; t++) {
  6374. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  6375. }
  6376. for (var o, a = 0, c = r; c < s;) {
  6377. if (o = i[r - 1], i[0] ^= jt[o >> 16 & 255] << 24 ^ jt[o >> 8 & 255] << 16 ^ jt[255 & o] << 8 ^ jt[o >> 24 & 255] ^ Mt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  6378. i[t] ^= i[t - 1];
  6379. } else {
  6380. for (t = 1; t < r / 2; t++) {
  6381. i[t] ^= i[t - 1];
  6382. }
  6383. o = i[r / 2 - 1], i[r / 2] ^= jt[255 & o] ^ jt[o >> 8 & 255] << 8 ^ jt[o >> 16 & 255] << 16 ^ jt[o >> 24 & 255] << 24;
  6384. for (t = r / 2 + 1; t < r; t++) {
  6385. i[t] ^= i[t - 1];
  6386. }
  6387. }
  6388. for (t = 0; t < r && c < s;) {
  6389. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  6390. }
  6391. }
  6392. for (var u = 1; u < e; u++) {
  6393. for (var l = 0; l < 4; l++) {
  6394. o = this._Kd[u][l], this._Kd[u][l] = Qt[o >> 24 & 255] ^ Xt[o >> 16 & 255] ^ Zt[o >> 8 & 255] ^ en[255 & o];
  6395. }
  6396. }
  6397. }
  6398. }, {
  6399. key: "encrypt",
  6400. value: function encrypt(e) {
  6401. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  6402. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  6403. s[r] ^= this._Ke[0][r];
  6404. }
  6405. for (var i = 1; i < t; i++) {
  6406. for (r = 0; r < 4; r++) {
  6407. n[r] = $t[s[r] >> 24 & 255] ^ Wt[s[(r + 1) % 4] >> 16 & 255] ^ zt[s[(r + 2) % 4] >> 8 & 255] ^ Jt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  6408. }
  6409. s = n.slice();
  6410. }
  6411. var o,
  6412. a = Lt(16);
  6413. for (r = 0; r < 4; r++) {
  6414. o = this._Ke[t][r], a[4 * r] = 255 & (jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (jt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (jt[255 & s[(r + 3) % 4]] ^ o);
  6415. }
  6416. return a;
  6417. }
  6418. }, {
  6419. key: "decrypt",
  6420. value: function decrypt(e) {
  6421. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  6422. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  6423. s[r] ^= this._Kd[0][r];
  6424. }
  6425. for (var i = 1; i < t; i++) {
  6426. for (r = 0; r < 4; r++) {
  6427. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 3) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  6428. }
  6429. s = n.slice();
  6430. }
  6431. var o,
  6432. a = Lt(16);
  6433. for (r = 0; r < 4; r++) {
  6434. o = this._Kd[t][r], a[4 * r] = 255 & (Bt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Bt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Bt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Bt[255 & s[(r + 1) % 4]] ^ o);
  6435. }
  6436. return a;
  6437. }
  6438. }]);
  6439. return nn;
  6440. }();
  6441. var sn = /*#__PURE__*/function () {
  6442. function sn(e) {
  6443. (0, _classCallCheck2.default)(this, sn);
  6444. if (!(this instanceof sn)) throw Error("AES must be instanitated with `new`");
  6445. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new nn(e);
  6446. }
  6447. (0, _createClass2.default)(sn, [{
  6448. key: "encrypt",
  6449. value: function encrypt(e) {
  6450. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  6451. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  6452. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.encrypt(n), t, s);
  6453. }
  6454. return t;
  6455. }
  6456. }, {
  6457. key: "decrypt",
  6458. value: function decrypt(e) {
  6459. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  6460. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  6461. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.decrypt(n), t, s);
  6462. }
  6463. return t;
  6464. }
  6465. }]);
  6466. return sn;
  6467. }();
  6468. var rn = /*#__PURE__*/function () {
  6469. function rn(e, t) {
  6470. (0, _classCallCheck2.default)(this, rn);
  6471. if (!(this instanceof rn)) throw Error("AES must be instanitated with `new`");
  6472. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  6473. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  6474. } else t = Lt(16);
  6475. this._lastCipherblock = Rt(t, !0), this._aes = new nn(e);
  6476. }
  6477. (0, _createClass2.default)(rn, [{
  6478. key: "encrypt",
  6479. value: function encrypt(e) {
  6480. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  6481. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  6482. Nt(e, n, 0, s, s + 16);
  6483. for (var r = 0; r < 16; r++) {
  6484. n[r] ^= this._lastCipherblock[r];
  6485. }
  6486. this._lastCipherblock = this._aes.encrypt(n), Nt(this._lastCipherblock, t, s);
  6487. }
  6488. return t;
  6489. }
  6490. }, {
  6491. key: "decrypt",
  6492. value: function decrypt(e) {
  6493. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  6494. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  6495. Nt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  6496. for (var r = 0; r < 16; r++) {
  6497. t[s + r] = n[r] ^ this._lastCipherblock[r];
  6498. }
  6499. Nt(e, this._lastCipherblock, 0, s, s + 16);
  6500. }
  6501. return t;
  6502. }
  6503. }]);
  6504. return rn;
  6505. }();
  6506. var on = /*#__PURE__*/function () {
  6507. function on(e, t, n) {
  6508. (0, _classCallCheck2.default)(this, on);
  6509. if (!(this instanceof on)) throw Error("AES must be instanitated with `new`");
  6510. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  6511. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  6512. } else t = Lt(16);
  6513. n || (n = 1), this.segmentSize = n, this._shiftRegister = Rt(t, !0), this._aes = new nn(e);
  6514. }
  6515. (0, _createClass2.default)(on, [{
  6516. key: "encrypt",
  6517. value: function encrypt(e) {
  6518. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  6519. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  6520. t = this._aes.encrypt(this._shiftRegister);
  6521. for (var r = 0; r < this.segmentSize; r++) {
  6522. n[s + r] ^= t[r];
  6523. }
  6524. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  6525. }
  6526. return n;
  6527. }
  6528. }, {
  6529. key: "decrypt",
  6530. value: function decrypt(e) {
  6531. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  6532. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  6533. t = this._aes.encrypt(this._shiftRegister);
  6534. for (var r = 0; r < this.segmentSize; r++) {
  6535. n[s + r] ^= t[r];
  6536. }
  6537. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  6538. }
  6539. return n;
  6540. }
  6541. }]);
  6542. return on;
  6543. }();
  6544. var an = /*#__PURE__*/function () {
  6545. function an(e, t) {
  6546. (0, _classCallCheck2.default)(this, an);
  6547. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  6548. if (this.description = "Output Feedback", this.name = "ofb", t) {
  6549. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  6550. } else t = Lt(16);
  6551. this._lastPrecipher = Rt(t, !0), this._lastPrecipherIndex = 16, this._aes = new nn(e);
  6552. }
  6553. (0, _createClass2.default)(an, [{
  6554. key: "encrypt",
  6555. value: function encrypt(e) {
  6556. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  6557. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  6558. }
  6559. return t;
  6560. }
  6561. }, {
  6562. key: "decrypt",
  6563. value: function decrypt(e) {
  6564. return this.encrypt(e);
  6565. }
  6566. }]);
  6567. return an;
  6568. }();
  6569. var cn = /*#__PURE__*/function () {
  6570. function cn(e) {
  6571. (0, _classCallCheck2.default)(this, cn);
  6572. if (!(this instanceof cn)) throw Error("Counter must be instanitated with `new`");
  6573. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Lt(16), this.setValue(e)) : this.setBytes(e);
  6574. }
  6575. (0, _createClass2.default)(cn, [{
  6576. key: "setValue",
  6577. value: function setValue(e) {
  6578. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  6579. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  6580. for (var t = 15; t >= 0; --t) {
  6581. this._counter[t] = e % 256, e = parseInt(e / 256);
  6582. }
  6583. }
  6584. }, {
  6585. key: "setBytes",
  6586. value: function setBytes(e) {
  6587. if (16 != (e = Rt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  6588. this._counter = e;
  6589. }
  6590. }, {
  6591. key: "increment",
  6592. value: function increment() {
  6593. for (var e = 15; e >= 0; e--) {
  6594. if (255 !== this._counter[e]) {
  6595. this._counter[e]++;
  6596. break;
  6597. }
  6598. this._counter[e] = 0;
  6599. }
  6600. }
  6601. }]);
  6602. return cn;
  6603. }();
  6604. var un = /*#__PURE__*/function () {
  6605. function un(e, t) {
  6606. (0, _classCallCheck2.default)(this, un);
  6607. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  6608. this.description = "Counter", this.name = "ctr", t instanceof cn || (t = new cn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new nn(e);
  6609. }
  6610. (0, _createClass2.default)(un, [{
  6611. key: "encrypt",
  6612. value: function encrypt(e) {
  6613. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  6614. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  6615. }
  6616. return t;
  6617. }
  6618. }, {
  6619. key: "decrypt",
  6620. value: function decrypt(e) {
  6621. return this.encrypt(e);
  6622. }
  6623. }]);
  6624. return un;
  6625. }();
  6626. var ln = {
  6627. AES: nn,
  6628. Counter: cn,
  6629. ModeOfOperation: {
  6630. ecb: sn,
  6631. cbc: rn,
  6632. cfb: on,
  6633. ofb: an,
  6634. ctr: un
  6635. },
  6636. utils: {
  6637. hex: qt,
  6638. utf8: Ft
  6639. },
  6640. padding: {
  6641. pkcs7: {
  6642. pad: function pad(e) {
  6643. var t = 16 - (e = Rt(e, !0)).length % 16,
  6644. n = Lt(e.length + t);
  6645. Nt(e, n);
  6646. for (var s = e.length; s < n.length; s++) {
  6647. n[s] = t;
  6648. }
  6649. return n;
  6650. },
  6651. strip: function strip(e) {
  6652. if ((e = Rt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  6653. var t = e[e.length - 1];
  6654. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  6655. for (var n = e.length - t, s = 0; s < t; s++) {
  6656. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  6657. }
  6658. var r = Lt(n);
  6659. return Nt(e, r, 0, 0, n), r;
  6660. }
  6661. }
  6662. },
  6663. _arrayTest: {
  6664. coerceArray: Rt,
  6665. createArray: Lt,
  6666. copyArray: Nt
  6667. }
  6668. };
  6669. function hn(e, t, n) {
  6670. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  6671. r = ln.utils.utf8.toBytes(n),
  6672. i = ln.utils.utf8.toBytes(e),
  6673. o = new ln.ModeOfOperation.cbc(s, r),
  6674. a = ln.padding.pkcs7.pad(i),
  6675. c = o.encrypt(a);
  6676. return uni.arrayBufferToBase64(c);
  6677. }
  6678. var dn = {
  6679. code: 2e4,
  6680. message: "System error"
  6681. },
  6682. fn = {
  6683. code: 20101,
  6684. message: "Invalid client"
  6685. },
  6686. pn = {
  6687. code: 20102,
  6688. message: "Get encrypt key failed"
  6689. },
  6690. gn = {
  6691. 10001: "Secure network is not supported on current playground or unimpsdk",
  6692. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  6693. 10009: "Encrypt payload failed",
  6694. 10010: "Decrypt response failed"
  6695. };
  6696. function mn(e) {
  6697. var _ref28 = e || {},
  6698. t = _ref28.errSubject,
  6699. n = _ref28.subject,
  6700. s = _ref28.errCode,
  6701. r = _ref28.errMsg,
  6702. i = _ref28.code,
  6703. o = _ref28.message,
  6704. a = _ref28.cause;
  6705. return new Q({
  6706. subject: t || n || "uni-secure-network",
  6707. code: s || i || dn.code,
  6708. message: r || o,
  6709. cause: a
  6710. });
  6711. }
  6712. var yn,
  6713. _n,
  6714. wn = null;
  6715. var vn = /*#__PURE__*/function (_Ot) {
  6716. (0, _inherits2.default)(vn, _Ot);
  6717. var _super9 = _createSuper(vn);
  6718. function vn(e) {
  6719. var _this15;
  6720. (0, _classCallCheck2.default)(this, vn);
  6721. _this15 = _super9.call(this, e), _this15.userEncryptKey = null;
  6722. return _this15;
  6723. }
  6724. (0, _createClass2.default)(vn, [{
  6725. key: "isLogin",
  6726. value: function isLogin() {
  6727. return !!this.scopedGlobalCache.mpWeixinCode;
  6728. }
  6729. }, {
  6730. key: "prepare",
  6731. value: function () {
  6732. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  6733. return _regenerator.default.wrap(function _callee37$(_context37) {
  6734. while (1) {
  6735. switch (_context37.prev = _context37.next) {
  6736. case 0:
  6737. if (this.isLogin()) {
  6738. _context37.next = 7;
  6739. break;
  6740. }
  6741. if (this.scopedGlobalCache.initPromise) {
  6742. _context37.next = 3;
  6743. break;
  6744. }
  6745. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  6746. case 3:
  6747. _context37.next = 5;
  6748. return this.scopedGlobalCache.initPromise;
  6749. case 5:
  6750. if (this.scopedGlobalCache.mpWeixinCode) {
  6751. _context37.next = 7;
  6752. break;
  6753. }
  6754. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  6755. case 7:
  6756. case "end":
  6757. return _context37.stop();
  6758. }
  6759. }
  6760. }, _callee37, this);
  6761. }));
  6762. function prepare() {
  6763. return _prepare2.apply(this, arguments);
  6764. }
  6765. return prepare;
  6766. }()
  6767. }, {
  6768. key: "getUserEncryptKey",
  6769. value: function () {
  6770. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  6771. var _this16 = this;
  6772. var e;
  6773. return _regenerator.default.wrap(function _callee38$(_context38) {
  6774. while (1) {
  6775. switch (_context38.prev = _context38.next) {
  6776. case 0:
  6777. if (!this.userEncryptKey) {
  6778. _context38.next = 2;
  6779. break;
  6780. }
  6781. return _context38.abrupt("return", this.userEncryptKey);
  6782. case 2:
  6783. if (!(wn && wn.expireTime)) {
  6784. _context38.next = 6;
  6785. break;
  6786. }
  6787. e = Date.now();
  6788. if (!(wn.expireTime - e > 0)) {
  6789. _context38.next = 6;
  6790. break;
  6791. }
  6792. return _context38.abrupt("return", (this.userEncryptKey = wn, this.userEncryptKey));
  6793. case 6:
  6794. return _context38.abrupt("return", new Promise(function (e, t) {
  6795. uni.getUserCryptoManager().getLatestUserKey({
  6796. success: function success(t) {
  6797. wn = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  6798. },
  6799. fail: function fail(e) {
  6800. t(mn(_objectSpread(_objectSpread({}, pn), {}, {
  6801. cause: e
  6802. })));
  6803. }
  6804. });
  6805. }));
  6806. case 7:
  6807. case "end":
  6808. return _context38.stop();
  6809. }
  6810. }
  6811. }, _callee38, this);
  6812. }));
  6813. function getUserEncryptKey() {
  6814. return _getUserEncryptKey.apply(this, arguments);
  6815. }
  6816. return getUserEncryptKey;
  6817. }()
  6818. }, {
  6819. key: "getWxAppId",
  6820. value: function getWxAppId() {
  6821. return wx.getAccountInfoSync().miniProgram.appId;
  6822. }
  6823. }, {
  6824. key: "platformGetSignOption",
  6825. value: function () {
  6826. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  6827. var _yield$this$getUserEn, e, t, n;
  6828. return _regenerator.default.wrap(function _callee39$(_context39) {
  6829. while (1) {
  6830. switch (_context39.prev = _context39.next) {
  6831. case 0:
  6832. _context39.next = 2;
  6833. return this.getUserEncryptKey();
  6834. case 2:
  6835. _yield$this$getUserEn = _context39.sent;
  6836. e = _yield$this$getUserEn.encryptKey;
  6837. t = _yield$this$getUserEn.iv;
  6838. n = _yield$this$getUserEn.version;
  6839. return _context39.abrupt("return", {
  6840. verifyClientSign: hn(JSON.stringify({
  6841. data: JSON.stringify({}),
  6842. appId: this.appId,
  6843. deviceId: this.deviceId,
  6844. wxAppId: this.getWxAppId(),
  6845. simulator: "devtools" === re().platform,
  6846. timestamp: Date.now()
  6847. }), e, t),
  6848. encryptKeyId: n,
  6849. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  6850. });
  6851. case 7:
  6852. case "end":
  6853. return _context39.stop();
  6854. }
  6855. }
  6856. }, _callee39, this);
  6857. }));
  6858. function platformGetSignOption() {
  6859. return _platformGetSignOption.apply(this, arguments);
  6860. }
  6861. return platformGetSignOption;
  6862. }()
  6863. }, {
  6864. key: "platformEncryptData",
  6865. value: function () {
  6866. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(e) {
  6867. var _yield$this$getUserEn2, t, n, s, r;
  6868. return _regenerator.default.wrap(function _callee40$(_context40) {
  6869. while (1) {
  6870. switch (_context40.prev = _context40.next) {
  6871. case 0:
  6872. _context40.next = 2;
  6873. return this.getUserEncryptKey();
  6874. case 2:
  6875. _yield$this$getUserEn2 = _context40.sent;
  6876. t = _yield$this$getUserEn2.encryptKey;
  6877. n = _yield$this$getUserEn2.iv;
  6878. s = _yield$this$getUserEn2.version;
  6879. r = {
  6880. secretType: this.secretType,
  6881. encryptKeyId: s,
  6882. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  6883. };
  6884. return _context40.abrupt("return", this.secretType === Pt ? {
  6885. content: e,
  6886. _uniCloudOptions: r
  6887. } : {
  6888. content: hn(JSON.stringify({
  6889. data: JSON.stringify(e),
  6890. appId: this.appId,
  6891. deviceId: this.deviceId,
  6892. wxAppId: this.getWxAppId(),
  6893. simulator: "devtools" === re().platform,
  6894. timestamp: Date.now()
  6895. }), t, n),
  6896. _uniCloudOptions: r
  6897. });
  6898. case 8:
  6899. case "end":
  6900. return _context40.stop();
  6901. }
  6902. }
  6903. }, _callee40, this);
  6904. }));
  6905. function platformEncryptData(_x33) {
  6906. return _platformEncryptData.apply(this, arguments);
  6907. }
  6908. return platformEncryptData;
  6909. }()
  6910. }, {
  6911. key: "platformDecryptResult",
  6912. value: function () {
  6913. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  6914. var t, _yield$this$getUserEn3, n, s;
  6915. return _regenerator.default.wrap(function _callee41$(_context41) {
  6916. while (1) {
  6917. switch (_context41.prev = _context41.next) {
  6918. case 0:
  6919. t = e.content;
  6920. _context41.next = 3;
  6921. return this.getUserEncryptKey();
  6922. case 3:
  6923. _yield$this$getUserEn3 = _context41.sent;
  6924. n = _yield$this$getUserEn3.encryptKey;
  6925. s = _yield$this$getUserEn3.iv;
  6926. return _context41.abrupt("return", JSON.parse(function (e, t, n) {
  6927. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  6928. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  6929. i = ln.utils.utf8.toBytes(n),
  6930. o = new ln.ModeOfOperation.cbc(r, i),
  6931. a = ln.padding.pkcs7.strip(o.decrypt(s));
  6932. return ln.utils.utf8.fromBytes(a);
  6933. }(t, n, s)));
  6934. case 7:
  6935. case "end":
  6936. return _context41.stop();
  6937. }
  6938. }
  6939. }, _callee41, this);
  6940. }));
  6941. function platformDecryptResult(_x34) {
  6942. return _platformDecryptResult.apply(this, arguments);
  6943. }
  6944. return platformDecryptResult;
  6945. }()
  6946. }]);
  6947. return vn;
  6948. }(Ot);
  6949. function Sn(e) {
  6950. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  6951. n = {};
  6952. var _loop = function _loop(_s10) {
  6953. var r = t[_s10];
  6954. n[r] = function () {
  6955. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  6956. t[_key] = arguments[_key];
  6957. }
  6958. return new Promise(function (n, s) {
  6959. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  6960. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  6961. e = _ref29.type,
  6962. t = _ref29.data,
  6963. r = _ref29.errCode,
  6964. i = _ref29.errMsg,
  6965. o = _ref29.errSubject,
  6966. a = _ref29.message;
  6967. "success" === e ? n(t) : s(mn({
  6968. errCode: r,
  6969. errMsg: gn[r] || i || a,
  6970. errSubject: o
  6971. }));
  6972. }])) : s(mn({
  6973. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  6974. }));
  6975. });
  6976. };
  6977. };
  6978. for (var _s10 = 0; _s10 < t.length; _s10++) {
  6979. _loop(_s10);
  6980. }
  6981. return n;
  6982. }
  6983. var kn = /*#__PURE__*/function (_Ot2) {
  6984. (0, _inherits2.default)(kn, _Ot2);
  6985. var _super10 = _createSuper(kn);
  6986. function kn(e) {
  6987. var _this17;
  6988. (0, _classCallCheck2.default)(this, kn);
  6989. _this17 = _super10.call(this, e), _this17.appUtils = _objectSpread({}, Sn(uni.requireNativePlugin("plus"))), _this17.systemInfo = yn || (yn = re());
  6990. return _this17;
  6991. }
  6992. (0, _createClass2.default)(kn, [{
  6993. key: "hasClientKey",
  6994. value: function () {
  6995. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  6996. return _regenerator.default.wrap(function _callee42$(_context42) {
  6997. while (1) {
  6998. switch (_context42.prev = _context42.next) {
  6999. case 0:
  7000. _context42.next = 2;
  7001. return this.appUtils.hasClientKey({
  7002. provider: this.provider,
  7003. spaceId: this.spaceId
  7004. });
  7005. case 2:
  7006. this._hasClientKey = _context42.sent;
  7007. return _context42.abrupt("return", this._hasClientKey);
  7008. case 4:
  7009. case "end":
  7010. return _context42.stop();
  7011. }
  7012. }
  7013. }, _callee42, this);
  7014. }));
  7015. function hasClientKey() {
  7016. return _hasClientKey.apply(this, arguments);
  7017. }
  7018. return hasClientKey;
  7019. }()
  7020. }, {
  7021. key: "getAppClientKey",
  7022. value: function () {
  7023. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  7024. var _yield$this$appUtils$, e, t, n, s, r;
  7025. return _regenerator.default.wrap(function _callee43$(_context43) {
  7026. while (1) {
  7027. switch (_context43.prev = _context43.next) {
  7028. case 0:
  7029. _context43.next = 2;
  7030. return this.appUtils.encryptGetClientKeyPayload({
  7031. data: JSON.stringify({})
  7032. });
  7033. case 2:
  7034. _yield$this$appUtils$ = _context43.sent;
  7035. e = _yield$this$appUtils$.data;
  7036. t = _yield$this$appUtils$.key;
  7037. _context43.next = 7;
  7038. return this.uniCloudIns.callFunction({
  7039. name: "DCloud-clientDB",
  7040. data: {
  7041. redirectTo: "encryption",
  7042. action: "getAppClientKey",
  7043. data: e,
  7044. key: t
  7045. }
  7046. });
  7047. case 7:
  7048. _context43.t0 = _context43.sent.result;
  7049. if (_context43.t0) {
  7050. _context43.next = 10;
  7051. break;
  7052. }
  7053. _context43.t0 = {};
  7054. case 10:
  7055. n = _context43.t0;
  7056. if (!(0 !== n.errCode)) {
  7057. _context43.next = 13;
  7058. break;
  7059. }
  7060. throw function (e) {
  7061. return new Q({
  7062. subject: e.errSubject || "uni-secure-network",
  7063. code: e.errCode || e.code || dn.code,
  7064. message: e.errMsg || e.message
  7065. });
  7066. }(n);
  7067. case 13:
  7068. s = n.clientKey, r = n.key;
  7069. _context43.next = 16;
  7070. return this.appUtils.setClientKey({
  7071. provider: this.provider,
  7072. spaceId: this.spaceId,
  7073. clientKey: s,
  7074. key: r
  7075. });
  7076. case 16:
  7077. case "end":
  7078. return _context43.stop();
  7079. }
  7080. }
  7081. }, _callee43, this);
  7082. }));
  7083. function getAppClientKey() {
  7084. return _getAppClientKey.apply(this, arguments);
  7085. }
  7086. return getAppClientKey;
  7087. }()
  7088. }, {
  7089. key: "ensureClientKey",
  7090. value: function () {
  7091. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  7092. var _this18 = this;
  7093. return _regenerator.default.wrap(function _callee44$(_context44) {
  7094. while (1) {
  7095. switch (_context44.prev = _context44.next) {
  7096. case 0:
  7097. _context44.t0 = !0;
  7098. _context44.next = 3;
  7099. return this.hasClientKey();
  7100. case 3:
  7101. _context44.t1 = _context44.sent;
  7102. if (!(_context44.t0 !== _context44.t1)) {
  7103. _context44.next = 6;
  7104. break;
  7105. }
  7106. return _context44.abrupt("return", (this.scopedGlobalCache.initPromise && "rejected" !== this.scopedGlobalCache.initStatus || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  7107. _this18.scopedGlobalCache.initStatus = "fullfilled";
  7108. }).catch(function (e) {
  7109. throw _this18.scopedGlobalCache.initStatus = "rejected", e;
  7110. })), this.scopedGlobalCache.initPromise));
  7111. case 6:
  7112. case "end":
  7113. return _context44.stop();
  7114. }
  7115. }
  7116. }, _callee44, this);
  7117. }));
  7118. function ensureClientKey() {
  7119. return _ensureClientKey.apply(this, arguments);
  7120. }
  7121. return ensureClientKey;
  7122. }()
  7123. }, {
  7124. key: "prepare",
  7125. value: function () {
  7126. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  7127. return _regenerator.default.wrap(function _callee45$(_context45) {
  7128. while (1) {
  7129. switch (_context45.prev = _context45.next) {
  7130. case 0:
  7131. _context45.next = 2;
  7132. return this.ensureClientKey();
  7133. case 2:
  7134. case "end":
  7135. return _context45.stop();
  7136. }
  7137. }
  7138. }, _callee45, this);
  7139. }));
  7140. function prepare() {
  7141. return _prepare3.apply(this, arguments);
  7142. }
  7143. return prepare;
  7144. }()
  7145. }, {
  7146. key: "platformGetSignOption",
  7147. value: function () {
  7148. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  7149. var _yield$this$appUtils$2, e, t;
  7150. return _regenerator.default.wrap(function _callee46$(_context46) {
  7151. while (1) {
  7152. switch (_context46.prev = _context46.next) {
  7153. case 0:
  7154. _context46.next = 2;
  7155. return this.appUtils.encrypt({
  7156. provider: this.provider,
  7157. spaceId: this.spaceId,
  7158. data: JSON.stringify({})
  7159. });
  7160. case 2:
  7161. _yield$this$appUtils$2 = _context46.sent;
  7162. e = _yield$this$appUtils$2.data;
  7163. t = _yield$this$appUtils$2.key;
  7164. return _context46.abrupt("return", {
  7165. verifyClientSign: e,
  7166. encryptKeyId: t
  7167. });
  7168. case 6:
  7169. case "end":
  7170. return _context46.stop();
  7171. }
  7172. }
  7173. }, _callee46, this);
  7174. }));
  7175. function platformGetSignOption() {
  7176. return _platformGetSignOption2.apply(this, arguments);
  7177. }
  7178. return platformGetSignOption;
  7179. }()
  7180. }, {
  7181. key: "platformEncryptData",
  7182. value: function () {
  7183. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(e) {
  7184. var _yield$this$appUtils$3, t, n, s;
  7185. return _regenerator.default.wrap(function _callee47$(_context47) {
  7186. while (1) {
  7187. switch (_context47.prev = _context47.next) {
  7188. case 0:
  7189. _context47.next = 2;
  7190. return this.appUtils.encrypt({
  7191. provider: this.provider,
  7192. spaceId: this.spaceId,
  7193. data: JSON.stringify(e)
  7194. });
  7195. case 2:
  7196. _yield$this$appUtils$3 = _context47.sent;
  7197. t = _yield$this$appUtils$3.data;
  7198. n = _yield$this$appUtils$3.key;
  7199. s = {
  7200. secretType: this.secretType,
  7201. encryptKeyId: n
  7202. };
  7203. return _context47.abrupt("return", this.secretType === Pt ? {
  7204. content: e,
  7205. _uniCloudOptions: s
  7206. } : {
  7207. content: t,
  7208. _uniCloudOptions: s
  7209. });
  7210. case 7:
  7211. case "end":
  7212. return _context47.stop();
  7213. }
  7214. }
  7215. }, _callee47, this);
  7216. }));
  7217. function platformEncryptData(_x35) {
  7218. return _platformEncryptData2.apply(this, arguments);
  7219. }
  7220. return platformEncryptData;
  7221. }()
  7222. }, {
  7223. key: "platformDecryptResult",
  7224. value: function () {
  7225. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  7226. var t, _e$_uniCloudOptions, n, s, r;
  7227. return _regenerator.default.wrap(function _callee48$(_context48) {
  7228. while (1) {
  7229. switch (_context48.prev = _context48.next) {
  7230. case 0:
  7231. t = e.content;
  7232. _e$_uniCloudOptions = e._uniCloudOptions;
  7233. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  7234. s = n.encryptKeyId;
  7235. _context48.next = 6;
  7236. return this.appUtils.decrypt({
  7237. provider: this.provider,
  7238. spaceId: this.spaceId,
  7239. data: t,
  7240. key: s
  7241. });
  7242. case 6:
  7243. r = _context48.sent;
  7244. return _context48.abrupt("return", JSON.parse(r.data));
  7245. case 8:
  7246. case "end":
  7247. return _context48.stop();
  7248. }
  7249. }
  7250. }, _callee48, this);
  7251. }));
  7252. function platformDecryptResult(_x36) {
  7253. return _platformDecryptResult2.apply(this, arguments);
  7254. }
  7255. return platformDecryptResult;
  7256. }()
  7257. }]);
  7258. return kn;
  7259. }(Ot);
  7260. function In() {
  7261. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7262. e = _ref30.secretType;
  7263. return e === Ct || e === Pt || e === Et;
  7264. }
  7265. function bn() {
  7266. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7267. e = _ref31.name,
  7268. _ref31$data = _ref31.data,
  7269. t = _ref31$data === void 0 ? {} : _ref31$data;
  7270. return "app" === S && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  7271. }
  7272. function Tn() {
  7273. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7274. e = _ref32.provider,
  7275. t = _ref32.spaceId,
  7276. n = _ref32.functionName;
  7277. var _re = re(),
  7278. s = _re.appId,
  7279. r = _re.uniPlatform,
  7280. i = _re.osName;
  7281. var o = r;
  7282. "app" === r && (o = i);
  7283. var a = function () {
  7284. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7285. e = _ref33.provider,
  7286. t = _ref33.spaceId;
  7287. var n = v;
  7288. if (!n) return {};
  7289. e = function (e) {
  7290. return "tencent" === e ? "tcb" : e;
  7291. }(e);
  7292. var s = n.find(function (n) {
  7293. return n.provider === e && n.spaceId === t;
  7294. });
  7295. return s && s.config;
  7296. }({
  7297. provider: e,
  7298. spaceId: t
  7299. });
  7300. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  7301. var c = a.accessControl.function || {},
  7302. u = Object.keys(c);
  7303. if (0 === u.length) return !0;
  7304. var l = function (e, t) {
  7305. var n, s, r;
  7306. for (var _i2 = 0; _i2 < e.length; _i2++) {
  7307. var _o2 = e[_i2];
  7308. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  7309. return e.trim();
  7310. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  7311. }
  7312. return n || s || r;
  7313. }(u, n);
  7314. if (!l) return !1;
  7315. if ((c[l] || []).find(function () {
  7316. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7317. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  7318. })) return !0;
  7319. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), mn(fn);
  7320. }
  7321. function An(_ref34) {
  7322. var e = _ref34.functionName,
  7323. t = _ref34.result,
  7324. n = _ref34.logPvd;
  7325. if (this.__dev__.debugLog && t && t.requestId) {
  7326. var _s11 = JSON.stringify({
  7327. spaceId: this.config.spaceId,
  7328. functionName: e,
  7329. requestId: t.requestId
  7330. });
  7331. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  7332. }
  7333. }
  7334. function Cn(e) {
  7335. var t = e.callFunction,
  7336. n = function n(_n7) {
  7337. var _this19 = this;
  7338. var s = _n7.name;
  7339. _n7.data = vt.call(e, {
  7340. data: _n7.data
  7341. });
  7342. var r = {
  7343. aliyun: "aliyun",
  7344. tencent: "tcb",
  7345. tcb: "tcb"
  7346. }[this.config.provider],
  7347. i = In(_n7),
  7348. o = bn(_n7),
  7349. a = i || o;
  7350. return t.call(this, _n7).then(function (e) {
  7351. return e.errCode = 0, !a && An.call(_this19, {
  7352. functionName: s,
  7353. result: e,
  7354. logPvd: r
  7355. }), Promise.resolve(e);
  7356. }, function (e) {
  7357. return !a && An.call(_this19, {
  7358. functionName: s,
  7359. result: e,
  7360. logPvd: r
  7361. }), e && e.message && (e.message = function () {
  7362. var _ref35 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7363. _ref35$message = _ref35.message,
  7364. e = _ref35$message === void 0 ? "" : _ref35$message,
  7365. _ref35$extraInfo = _ref35.extraInfo,
  7366. t = _ref35$extraInfo === void 0 ? {} : _ref35$extraInfo,
  7367. _ref35$formatter = _ref35.formatter,
  7368. n = _ref35$formatter === void 0 ? [] : _ref35$formatter;
  7369. for (var _s12 = 0; _s12 < n.length; _s12++) {
  7370. var _n$_s = n[_s12],
  7371. _r3 = _n$_s.rule,
  7372. _i3 = _n$_s.content,
  7373. _o3 = _n$_s.mode,
  7374. _a = e.match(_r3);
  7375. if (!_a) continue;
  7376. var _c = _i3;
  7377. for (var _e23 = 1; _e23 < _a.length; _e23++) {
  7378. _c = Tt(_c, "{$".concat(_e23, "}"), _a[_e23]);
  7379. }
  7380. for (var _e24 in t) {
  7381. _c = Tt(_c, "{".concat(_e24, "}"), t[_e24]);
  7382. }
  7383. return "replace" === _o3 ? _c : e + _c;
  7384. }
  7385. return e;
  7386. }({
  7387. message: "[".concat(_n7.name, "]: ").concat(e.message),
  7388. formatter: kt,
  7389. extraInfo: {
  7390. functionName: s
  7391. }
  7392. })), Promise.reject(e);
  7393. });
  7394. };
  7395. e.callFunction = function (t) {
  7396. var _e$config = e.config,
  7397. s = _e$config.provider,
  7398. r = _e$config.spaceId,
  7399. i = t.name;
  7400. var o, a;
  7401. if (t.data = t.data || {}, y && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && I ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = St), o = St) : o = n, o = o.bind(e), bn(t)) a = n.call(e, t);else if (function (_ref36) {
  7402. var e = _ref36.name,
  7403. _ref36$data = _ref36.data,
  7404. t = _ref36$data === void 0 ? {} : _ref36$data;
  7405. return "mp-weixin" === S && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  7406. }(t)) a = o.call(e, t);else if (In(t)) {
  7407. a = new _n({
  7408. secretType: t.secretType,
  7409. uniCloudIns: e
  7410. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  7411. } else if (Tn({
  7412. provider: s,
  7413. spaceId: r,
  7414. functionName: i
  7415. })) {
  7416. a = new _n({
  7417. secretType: t.secretType,
  7418. uniCloudIns: e
  7419. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  7420. } else a = o(t);
  7421. return Object.defineProperty(a, "result", {
  7422. get: function get() {
  7423. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  7424. }
  7425. }), a;
  7426. };
  7427. }
  7428. _n = "mp-weixin" !== S && "app" !== S ? /*#__PURE__*/function () {
  7429. function _class2() {
  7430. (0, _classCallCheck2.default)(this, _class2);
  7431. throw mn({
  7432. message: "Platform ".concat(S, " is not supported by secure network")
  7433. });
  7434. }
  7435. return (0, _createClass2.default)(_class2);
  7436. }() : w ? "mp-weixin" === S ? vn : kn : /*#__PURE__*/function () {
  7437. function _class3() {
  7438. (0, _classCallCheck2.default)(this, _class3);
  7439. throw mn({
  7440. message: "Platform ".concat(S, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  7441. });
  7442. }
  7443. return (0, _createClass2.default)(_class3);
  7444. }();
  7445. var Pn = Symbol("CLIENT_DB_INTERNAL");
  7446. function En(e, t) {
  7447. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Pn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  7448. get: function get(e, n, s) {
  7449. if ("_uniClient" === n) return null;
  7450. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  7451. if (n in e || "string" != typeof n) {
  7452. var _t10 = e[n];
  7453. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  7454. }
  7455. return t.get(e, n, s);
  7456. }
  7457. });
  7458. }
  7459. function On(e) {
  7460. return {
  7461. on: function on(t, n) {
  7462. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  7463. },
  7464. off: function off(t, n) {
  7465. e[t] = e[t] || [];
  7466. var s = e[t].indexOf(n);
  7467. -1 !== s && e[t].splice(s, 1);
  7468. }
  7469. };
  7470. }
  7471. var xn = ["db.Geo", "db.command", "command.aggregate"];
  7472. function Un(e, t) {
  7473. return xn.indexOf("".concat(e, ".").concat(t)) > -1;
  7474. }
  7475. function Rn(e) {
  7476. switch (d(e)) {
  7477. case "array":
  7478. return e.map(function (e) {
  7479. return Rn(e);
  7480. });
  7481. case "object":
  7482. return e._internalType === Pn || Object.keys(e).forEach(function (t) {
  7483. e[t] = Rn(e[t]);
  7484. }), e;
  7485. case "regexp":
  7486. return {
  7487. $regexp: {
  7488. source: e.source,
  7489. flags: e.flags
  7490. }
  7491. };
  7492. case "date":
  7493. return {
  7494. $date: e.toISOString()
  7495. };
  7496. default:
  7497. return e;
  7498. }
  7499. }
  7500. function Ln(e) {
  7501. return e && e.content && e.content.$method;
  7502. }
  7503. var Nn = /*#__PURE__*/function () {
  7504. function Nn(e, t, n) {
  7505. (0, _classCallCheck2.default)(this, Nn);
  7506. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  7507. }
  7508. (0, _createClass2.default)(Nn, [{
  7509. key: "toJSON",
  7510. value: function toJSON() {
  7511. var e = this;
  7512. var t = [e.content];
  7513. for (; e.prevStage;) {
  7514. e = e.prevStage, t.push(e.content);
  7515. }
  7516. return {
  7517. $db: t.reverse().map(function (e) {
  7518. return {
  7519. $method: e.$method,
  7520. $param: Rn(e.$param)
  7521. };
  7522. })
  7523. };
  7524. }
  7525. }, {
  7526. key: "getAction",
  7527. value: function getAction() {
  7528. var e = this.toJSON().$db.find(function (e) {
  7529. return "action" === e.$method;
  7530. });
  7531. return e && e.$param && e.$param[0];
  7532. }
  7533. }, {
  7534. key: "getCommand",
  7535. value: function getCommand() {
  7536. return {
  7537. $db: this.toJSON().$db.filter(function (e) {
  7538. return "action" !== e.$method;
  7539. })
  7540. };
  7541. }
  7542. }, {
  7543. key: "isAggregate",
  7544. get: function get() {
  7545. var e = this;
  7546. for (; e;) {
  7547. var t = Ln(e),
  7548. _n8 = Ln(e.prevStage);
  7549. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  7550. e = e.prevStage;
  7551. }
  7552. return !1;
  7553. }
  7554. }, {
  7555. key: "isCommand",
  7556. get: function get() {
  7557. var e = this;
  7558. for (; e;) {
  7559. if ("command" === Ln(e)) return !0;
  7560. e = e.prevStage;
  7561. }
  7562. return !1;
  7563. }
  7564. }, {
  7565. key: "isAggregateCommand",
  7566. get: function get() {
  7567. var e = this;
  7568. for (; e;) {
  7569. var t = Ln(e),
  7570. _n9 = Ln(e.prevStage);
  7571. if ("aggregate" === t && "command" === _n9) return !0;
  7572. e = e.prevStage;
  7573. }
  7574. return !1;
  7575. }
  7576. }, {
  7577. key: "getNextStageFn",
  7578. value: function getNextStageFn(e) {
  7579. var t = this;
  7580. return function () {
  7581. return Dn({
  7582. $method: e,
  7583. $param: Rn(Array.from(arguments))
  7584. }, t, t._database);
  7585. };
  7586. }
  7587. }, {
  7588. key: "count",
  7589. get: function get() {
  7590. return this.isAggregate ? this.getNextStageFn("count") : function () {
  7591. return this._send("count", Array.from(arguments));
  7592. };
  7593. }
  7594. }, {
  7595. key: "remove",
  7596. get: function get() {
  7597. return this.isCommand ? this.getNextStageFn("remove") : function () {
  7598. return this._send("remove", Array.from(arguments));
  7599. };
  7600. }
  7601. }, {
  7602. key: "get",
  7603. value: function get() {
  7604. return this._send("get", Array.from(arguments));
  7605. }
  7606. }, {
  7607. key: "add",
  7608. get: function get() {
  7609. return this.isCommand ? this.getNextStageFn("add") : function () {
  7610. return this._send("add", Array.from(arguments));
  7611. };
  7612. }
  7613. }, {
  7614. key: "update",
  7615. value: function update() {
  7616. return this._send("update", Array.from(arguments));
  7617. }
  7618. }, {
  7619. key: "end",
  7620. value: function end() {
  7621. return this._send("end", Array.from(arguments));
  7622. }
  7623. }, {
  7624. key: "set",
  7625. get: function get() {
  7626. return this.isCommand ? this.getNextStageFn("set") : function () {
  7627. throw new Error("JQL禁止使用set方法");
  7628. };
  7629. }
  7630. }, {
  7631. key: "_send",
  7632. value: function _send(e, t) {
  7633. var n = this.getAction(),
  7634. s = this.getCommand();
  7635. if (s.$db.push({
  7636. $method: e,
  7637. $param: Rn(t)
  7638. }), y) {
  7639. var _e25 = s.$db.find(function (e) {
  7640. return "collection" === e.$method;
  7641. }),
  7642. _t11 = _e25 && _e25.$param;
  7643. _t11 && 1 === _t11.length && "string" == typeof _e25.$param[0] && _e25.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  7644. }
  7645. return this._database._callCloudFunction({
  7646. action: n,
  7647. command: s
  7648. });
  7649. }
  7650. }]);
  7651. return Nn;
  7652. }();
  7653. function Dn(e, t, n) {
  7654. return En(new Nn(e, t, n), {
  7655. get: function get(e, t) {
  7656. var s = "db";
  7657. return e && e.content && (s = e.content.$method), Un(s, t) ? Dn({
  7658. $method: t
  7659. }, e, n) : function () {
  7660. return Dn({
  7661. $method: t,
  7662. $param: Rn(Array.from(arguments))
  7663. }, e, n);
  7664. };
  7665. }
  7666. });
  7667. }
  7668. function Fn(_ref37) {
  7669. var e = _ref37.path,
  7670. t = _ref37.method;
  7671. return /*#__PURE__*/function () {
  7672. function _class4() {
  7673. (0, _classCallCheck2.default)(this, _class4);
  7674. this.param = Array.from(arguments);
  7675. }
  7676. (0, _createClass2.default)(_class4, [{
  7677. key: "toJSON",
  7678. value: function toJSON() {
  7679. return {
  7680. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  7681. return {
  7682. $method: e
  7683. };
  7684. })), [{
  7685. $method: t,
  7686. $param: this.param
  7687. }])
  7688. };
  7689. }
  7690. }]);
  7691. return _class4;
  7692. }();
  7693. }
  7694. function qn(e) {
  7695. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7696. return En(new e(t), {
  7697. get: function get(e, t) {
  7698. return Un("db", t) ? Dn({
  7699. $method: t
  7700. }, null, e) : function () {
  7701. return Dn({
  7702. $method: t,
  7703. $param: Rn(Array.from(arguments))
  7704. }, null, e);
  7705. };
  7706. }
  7707. });
  7708. }
  7709. var Kn = /*#__PURE__*/function (_ref38) {
  7710. (0, _inherits2.default)(Kn, _ref38);
  7711. var _super11 = _createSuper(Kn);
  7712. function Kn() {
  7713. (0, _classCallCheck2.default)(this, Kn);
  7714. return _super11.apply(this, arguments);
  7715. }
  7716. (0, _createClass2.default)(Kn, [{
  7717. key: "_parseResult",
  7718. value: function _parseResult(e) {
  7719. return this._isJQL ? e.result : e;
  7720. }
  7721. }, {
  7722. key: "_callCloudFunction",
  7723. value: function _callCloudFunction(_ref39) {
  7724. var _this20 = this;
  7725. var e = _ref39.action,
  7726. t = _ref39.command,
  7727. n = _ref39.multiCommand,
  7728. s = _ref39.queryList;
  7729. function r(e, t) {
  7730. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  7731. var _r4 = s[_n10];
  7732. _r4.udb && "function" == typeof _r4.udb.setResult && (t ? _r4.udb.setResult(t) : _r4.udb.setResult(e.result.dataList[_n10]));
  7733. }
  7734. }
  7735. var i = this,
  7736. o = this._isJQL ? "databaseForJQL" : "database";
  7737. function a(e) {
  7738. return i._callback("error", [e]), U(R(o, "fail"), e).then(function () {
  7739. return U(R(o, "complete"), e);
  7740. }).then(function () {
  7741. return r(null, e), z(D, {
  7742. type: K,
  7743. content: e
  7744. }), Promise.reject(e);
  7745. });
  7746. }
  7747. var c = U(R(o, "invoke")),
  7748. u = this._uniClient;
  7749. return c.then(function () {
  7750. return u.callFunction({
  7751. name: "DCloud-clientDB",
  7752. type: h,
  7753. data: {
  7754. action: e,
  7755. command: t,
  7756. multiCommand: n
  7757. }
  7758. });
  7759. }).then(function (e) {
  7760. var _e$result = e.result,
  7761. t = _e$result.code,
  7762. n = _e$result.message,
  7763. s = _e$result.token,
  7764. c = _e$result.tokenExpired,
  7765. _e$result$systemInfo = _e$result.systemInfo,
  7766. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  7767. if (u) for (var _e26 = 0; _e26 < u.length; _e26++) {
  7768. var _u$_e = u[_e26],
  7769. _t12 = _u$_e.level,
  7770. _n11 = _u$_e.message,
  7771. _s13 = _u$_e.detail,
  7772. _r5 = console["app" === S && "warn" === _t12 ? "error" : _t12] || console.log;
  7773. var _i4 = "[System Info]" + _n11;
  7774. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r5(_i4);
  7775. }
  7776. if (t) {
  7777. return a(new Q({
  7778. code: t,
  7779. message: n,
  7780. requestId: e.requestId
  7781. }));
  7782. }
  7783. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ee({
  7784. token: s,
  7785. tokenExpired: c
  7786. }), _this20._callbackAuth("refreshToken", [{
  7787. token: s,
  7788. tokenExpired: c
  7789. }]), _this20._callback("refreshToken", [{
  7790. token: s,
  7791. tokenExpired: c
  7792. }]), z(q, {
  7793. token: s,
  7794. tokenExpired: c
  7795. }));
  7796. var l = [{
  7797. prop: "affectedDocs",
  7798. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  7799. }, {
  7800. prop: "code",
  7801. tips: "code不再推荐使用,请使用errCode替代"
  7802. }, {
  7803. prop: "message",
  7804. tips: "message不再推荐使用,请使用errMsg替代"
  7805. }];
  7806. var _loop2 = function _loop2(_t13) {
  7807. var _l$_t = l[_t13],
  7808. n = _l$_t.prop,
  7809. s = _l$_t.tips;
  7810. if (n in e.result) {
  7811. var _t14 = e.result[n];
  7812. Object.defineProperty(e.result, n, {
  7813. get: function get() {
  7814. return console.warn(s), _t14;
  7815. }
  7816. });
  7817. }
  7818. };
  7819. for (var _t13 = 0; _t13 < l.length; _t13++) {
  7820. _loop2(_t13);
  7821. }
  7822. return function (e) {
  7823. return U(R(o, "success"), e).then(function () {
  7824. return U(R(o, "complete"), e);
  7825. }).then(function () {
  7826. r(e, null);
  7827. var t = i._parseResult(e);
  7828. return z(D, {
  7829. type: K,
  7830. content: t
  7831. }), Promise.resolve(t);
  7832. });
  7833. }(e);
  7834. }, function (e) {
  7835. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  7836. return a(new Q({
  7837. code: e.code || "SYSTEM_ERROR",
  7838. message: e.message,
  7839. requestId: e.requestId
  7840. }));
  7841. });
  7842. }
  7843. }]);
  7844. return Kn;
  7845. }( /*#__PURE__*/function () {
  7846. function _class5() {
  7847. var _ref40 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7848. _ref40$uniClient = _ref40.uniClient,
  7849. e = _ref40$uniClient === void 0 ? {} : _ref40$uniClient,
  7850. _ref40$isJQL = _ref40.isJQL,
  7851. t = _ref40$isJQL === void 0 ? !1 : _ref40$isJQL;
  7852. (0, _classCallCheck2.default)(this, _class5);
  7853. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e.isDefault && (this._dbCallBacks = C("_globalUniCloudDatabaseCallback")), t || (this.auth = On(this._authCallBacks)), this._isJQL = t, Object.assign(this, On(this._dbCallBacks)), this.env = En({}, {
  7854. get: function get(e, t) {
  7855. return {
  7856. $env: t
  7857. };
  7858. }
  7859. }), this.Geo = En({}, {
  7860. get: function get(e, t) {
  7861. return Fn({
  7862. path: ["Geo"],
  7863. method: t
  7864. });
  7865. }
  7866. }), this.serverDate = Fn({
  7867. path: [],
  7868. method: "serverDate"
  7869. }), this.RegExp = Fn({
  7870. path: [],
  7871. method: "RegExp"
  7872. });
  7873. }
  7874. (0, _createClass2.default)(_class5, [{
  7875. key: "getCloudEnv",
  7876. value: function getCloudEnv(e) {
  7877. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  7878. return {
  7879. $env: e.replace("$cloudEnv_", "")
  7880. };
  7881. }
  7882. }, {
  7883. key: "_callback",
  7884. value: function _callback(e, t) {
  7885. var n = this._dbCallBacks;
  7886. n[e] && n[e].forEach(function (e) {
  7887. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  7888. });
  7889. }
  7890. }, {
  7891. key: "_callbackAuth",
  7892. value: function _callbackAuth(e, t) {
  7893. var n = this._authCallBacks;
  7894. n[e] && n[e].forEach(function (e) {
  7895. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  7896. });
  7897. }
  7898. }, {
  7899. key: "multiSend",
  7900. value: function multiSend() {
  7901. var e = Array.from(arguments),
  7902. t = e.map(function (e) {
  7903. var t = e.getAction(),
  7904. n = e.getCommand();
  7905. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  7906. return {
  7907. action: t,
  7908. command: n
  7909. };
  7910. });
  7911. return this._callCloudFunction({
  7912. multiCommand: t,
  7913. queryList: e
  7914. });
  7915. }
  7916. }]);
  7917. return _class5;
  7918. }());
  7919. var Mn = "token无效,跳转登录页面",
  7920. jn = "token过期,跳转登录页面",
  7921. Bn = {
  7922. TOKEN_INVALID_TOKEN_EXPIRED: jn,
  7923. TOKEN_INVALID_INVALID_CLIENTID: Mn,
  7924. TOKEN_INVALID: Mn,
  7925. TOKEN_INVALID_WRONG_TOKEN: Mn,
  7926. TOKEN_INVALID_ANONYMOUS_USER: Mn
  7927. },
  7928. $n = {
  7929. "uni-id-token-expired": jn,
  7930. "uni-id-check-token-failed": Mn,
  7931. "uni-id-token-not-exist": Mn,
  7932. "uni-id-check-device-feature-failed": Mn
  7933. };
  7934. function Wn(e, t) {
  7935. var n = "";
  7936. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  7937. }
  7938. function zn() {
  7939. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7940. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  7941. var n = [],
  7942. s = [];
  7943. return e.forEach(function (e) {
  7944. !0 === e.needLogin ? n.push(Wn(t, e.path)) : !1 === e.needLogin && s.push(Wn(t, e.path));
  7945. }), {
  7946. needLoginPage: n,
  7947. notNeedLoginPage: s
  7948. };
  7949. }
  7950. function Jn(e) {
  7951. return e.split("?")[0].replace(/^\//, "");
  7952. }
  7953. function Hn() {
  7954. return function (e) {
  7955. var t = e && e.$page && e.$page.fullPath || "";
  7956. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  7957. }(function () {
  7958. var e = getCurrentPages();
  7959. return e[e.length - 1];
  7960. }());
  7961. }
  7962. function Gn() {
  7963. return Jn(Hn());
  7964. }
  7965. function Vn() {
  7966. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  7967. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7968. if (!e) return !1;
  7969. if (!(t && t.list && t.list.length)) return !1;
  7970. var n = t.list,
  7971. s = Jn(e);
  7972. return n.some(function (e) {
  7973. return e.pagePath === s;
  7974. });
  7975. }
  7976. var Yn = !!_pages.default.uniIdRouter;
  7977. var _ref41 = function () {
  7978. var _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  7979. _ref24$pages = _ref24.pages,
  7980. e = _ref24$pages === void 0 ? [] : _ref24$pages,
  7981. _ref24$subPackages = _ref24.subPackages,
  7982. n = _ref24$subPackages === void 0 ? [] : _ref24$subPackages,
  7983. _ref24$uniIdRouter = _ref24.uniIdRouter,
  7984. s = _ref24$uniIdRouter === void 0 ? {} : _ref24$uniIdRouter,
  7985. _ref24$tabBar = _ref24.tabBar,
  7986. r = _ref24$tabBar === void 0 ? {} : _ref24$tabBar;
  7987. var i = s.loginPage,
  7988. _s$needLogin = s.needLogin,
  7989. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  7990. _s$resToLogin = s.resToLogin,
  7991. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  7992. _zn = zn(e),
  7993. c = _zn.needLoginPage,
  7994. u = _zn.notNeedLoginPage,
  7995. _ref26 = function () {
  7996. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7997. var t = [],
  7998. n = [];
  7999. return e.forEach(function (e) {
  8000. var s = e.root,
  8001. _e$pages = e.pages,
  8002. r = _e$pages === void 0 ? [] : _e$pages,
  8003. _zn2 = zn(r, s),
  8004. i = _zn2.needLoginPage,
  8005. o = _zn2.notNeedLoginPage;
  8006. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  8007. }), {
  8008. needLoginPage: t,
  8009. notNeedLoginPage: n
  8010. };
  8011. }(n),
  8012. l = _ref26.needLoginPage,
  8013. h = _ref26.notNeedLoginPage;
  8014. return {
  8015. loginPage: i,
  8016. routerNeedLogin: o,
  8017. resToLogin: a,
  8018. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  8019. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  8020. loginPageInTabBar: Vn(i, r)
  8021. };
  8022. }(),
  8023. Qn = _ref41.loginPage,
  8024. Xn = _ref41.routerNeedLogin,
  8025. Zn = _ref41.resToLogin,
  8026. es = _ref41.needLoginPage,
  8027. ts = _ref41.notNeedLoginPage,
  8028. ns = _ref41.loginPageInTabBar;
  8029. if (es.indexOf(Qn) > -1) throw new Error("Login page [".concat(Qn, "] should not be \"needLogin\", please check your pages.json"));
  8030. function ss(e) {
  8031. var t = Gn();
  8032. if ("/" === e.charAt(0)) return e;
  8033. var _e$split = e.split("?"),
  8034. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  8035. n = _e$split2[0],
  8036. s = _e$split2[1],
  8037. r = n.replace(/^\//, "").split("/"),
  8038. i = t.split("/");
  8039. i.pop();
  8040. for (var _e27 = 0; _e27 < r.length; _e27++) {
  8041. var _t15 = r[_e27];
  8042. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  8043. }
  8044. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  8045. }
  8046. function rs(e) {
  8047. var t = Jn(ss(e));
  8048. return !(ts.indexOf(t) > -1) && (es.indexOf(t) > -1 || Xn.some(function (t) {
  8049. return function (e, t) {
  8050. return new RegExp(t).test(e);
  8051. }(e, t);
  8052. }));
  8053. }
  8054. function is(_ref42) {
  8055. var e = _ref42.redirect;
  8056. var t = Jn(e),
  8057. n = Jn(Qn);
  8058. return Gn() !== n && t !== n;
  8059. }
  8060. function os() {
  8061. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8062. e = _ref43.api,
  8063. t = _ref43.redirect;
  8064. if (!t || !is({
  8065. redirect: t
  8066. })) return;
  8067. var n = function (e, t) {
  8068. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  8069. }(Qn, t);
  8070. ns ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  8071. var s = {
  8072. navigateTo: uni.navigateTo,
  8073. redirectTo: uni.redirectTo,
  8074. switchTab: uni.switchTab,
  8075. reLaunch: uni.reLaunch
  8076. };
  8077. setTimeout(function () {
  8078. s[e]({
  8079. url: n
  8080. });
  8081. });
  8082. }
  8083. function as() {
  8084. var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8085. e = _ref44.url;
  8086. var t = {
  8087. abortLoginPageJump: !1,
  8088. autoToLoginPage: !1
  8089. },
  8090. n = function () {
  8091. var _Z3 = Z(),
  8092. e = _Z3.token,
  8093. t = _Z3.tokenExpired;
  8094. var n;
  8095. if (e) {
  8096. if (t < Date.now()) {
  8097. var _e28 = "uni-id-token-expired";
  8098. n = {
  8099. errCode: _e28,
  8100. errMsg: $n[_e28]
  8101. };
  8102. }
  8103. } else {
  8104. var _e29 = "uni-id-check-token-failed";
  8105. n = {
  8106. errCode: _e29,
  8107. errMsg: $n[_e29]
  8108. };
  8109. }
  8110. return n;
  8111. }();
  8112. if (rs(e) && n) {
  8113. n.uniIdRedirectUrl = e;
  8114. if (B(F).length > 0) return setTimeout(function () {
  8115. z(F, n);
  8116. }, 0), t.abortLoginPageJump = !0, t;
  8117. t.autoToLoginPage = !0;
  8118. }
  8119. return t;
  8120. }
  8121. function cs() {
  8122. !function () {
  8123. var e = Hn(),
  8124. _as = as({
  8125. url: e
  8126. }),
  8127. t = _as.abortLoginPageJump,
  8128. n = _as.autoToLoginPage;
  8129. t || n && os({
  8130. api: "redirectTo",
  8131. redirect: e
  8132. });
  8133. }();
  8134. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  8135. var _loop3 = function _loop3(_t16) {
  8136. var n = e[_t16];
  8137. uni.addInterceptor(n, {
  8138. invoke: function invoke(e) {
  8139. var _as2 = as({
  8140. url: e.url
  8141. }),
  8142. t = _as2.abortLoginPageJump,
  8143. s = _as2.autoToLoginPage;
  8144. return t ? e : s ? (os({
  8145. api: n,
  8146. redirect: ss(e.url)
  8147. }), !1) : e;
  8148. }
  8149. });
  8150. };
  8151. for (var _t16 = 0; _t16 < e.length; _t16++) {
  8152. _loop3(_t16);
  8153. }
  8154. }
  8155. function us() {
  8156. this.onResponse(function (e) {
  8157. var t = e.type,
  8158. n = e.content;
  8159. var s = !1;
  8160. switch (t) {
  8161. case "cloudobject":
  8162. s = function (e) {
  8163. var t = e.errCode;
  8164. return t in $n;
  8165. }(n);
  8166. break;
  8167. case "clientdb":
  8168. s = function (e) {
  8169. var t = e.errCode;
  8170. return t in Bn;
  8171. }(n);
  8172. }
  8173. s && function () {
  8174. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8175. var t = B(F);
  8176. G().then(function () {
  8177. var n = Hn();
  8178. if (n && is({
  8179. redirect: n
  8180. })) return t.length > 0 ? z(F, Object.assign({
  8181. uniIdRedirectUrl: n
  8182. }, e)) : void (Qn && os({
  8183. api: "navigateTo",
  8184. redirect: n
  8185. }));
  8186. });
  8187. }(n);
  8188. });
  8189. }
  8190. function ls(e) {
  8191. !function (e) {
  8192. e.onResponse = function (e) {
  8193. $(D, e);
  8194. }, e.offResponse = function (e) {
  8195. W(D, e);
  8196. };
  8197. }(e), function (e) {
  8198. e.onNeedLogin = function (e) {
  8199. $(F, e);
  8200. }, e.offNeedLogin = function (e) {
  8201. W(F, e);
  8202. }, Yn && (C("_globalUniCloudStatus").needLoginInit || (C("_globalUniCloudStatus").needLoginInit = !0, G().then(function () {
  8203. cs.call(e);
  8204. }), Zn && us.call(e)));
  8205. }(e), function (e) {
  8206. e.onRefreshToken = function (e) {
  8207. $(q, e);
  8208. }, e.offRefreshToken = function (e) {
  8209. W(q, e);
  8210. };
  8211. }(e);
  8212. }
  8213. var hs;
  8214. var ds = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  8215. fs = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  8216. function ps() {
  8217. var e = Z().token || "",
  8218. t = e.split(".");
  8219. if (!e || 3 !== t.length) return {
  8220. uid: null,
  8221. role: [],
  8222. permission: [],
  8223. tokenExpired: 0
  8224. };
  8225. var n;
  8226. try {
  8227. n = JSON.parse((s = t[1], decodeURIComponent(hs(s).split("").map(function (e) {
  8228. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  8229. }).join(""))));
  8230. } catch (e) {
  8231. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  8232. }
  8233. var s;
  8234. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  8235. }
  8236. hs = "function" != typeof atob ? function (e) {
  8237. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !fs.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  8238. var t;
  8239. e += "==".slice(2 - (3 & e.length));
  8240. for (var n, s, r = "", i = 0; i < e.length;) {
  8241. t = ds.indexOf(e.charAt(i++)) << 18 | ds.indexOf(e.charAt(i++)) << 12 | (n = ds.indexOf(e.charAt(i++))) << 6 | (s = ds.indexOf(e.charAt(i++))), 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);
  8242. }
  8243. return r;
  8244. } : atob;
  8245. var gs = s(function (e, t) {
  8246. Object.defineProperty(t, "__esModule", {
  8247. value: !0
  8248. });
  8249. var n = "chooseAndUploadFile:ok",
  8250. s = "chooseAndUploadFile:fail";
  8251. function r(e, t) {
  8252. return e.tempFiles.forEach(function (e, n) {
  8253. 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("."));
  8254. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  8255. return e.path;
  8256. })), e;
  8257. }
  8258. function i(e, t, _ref45) {
  8259. var s = _ref45.onChooseFile,
  8260. r = _ref45.onUploadProgress;
  8261. return t.then(function (e) {
  8262. if (s) {
  8263. var _t17 = s(e);
  8264. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  8265. return void 0 === t ? e : t;
  8266. });
  8267. }
  8268. return e;
  8269. }).then(function (t) {
  8270. return !1 === t ? {
  8271. errMsg: n,
  8272. tempFilePaths: [],
  8273. tempFiles: []
  8274. } : function (e, t) {
  8275. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  8276. var r = arguments.length > 3 ? arguments[3] : undefined;
  8277. (t = Object.assign({}, t)).errMsg = n;
  8278. var i = t.tempFiles,
  8279. o = i.length;
  8280. var a = 0;
  8281. return new Promise(function (n) {
  8282. for (; a < s;) {
  8283. c();
  8284. }
  8285. function c() {
  8286. var s = a++;
  8287. if (s >= o) return void (!i.find(function (e) {
  8288. return !e.url && !e.errMsg;
  8289. }) && n(t));
  8290. var u = i[s];
  8291. e.uploadFile({
  8292. filePath: u.path,
  8293. cloudPath: u.cloudPath,
  8294. fileType: u.fileType,
  8295. onUploadProgress: function onUploadProgress(e) {
  8296. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  8297. }
  8298. }).then(function (e) {
  8299. u.url = e.fileID, s < o && c();
  8300. }).catch(function (e) {
  8301. u.errMsg = e.errMsg || e.message, s < o && c();
  8302. });
  8303. }
  8304. });
  8305. }(e, t, 5, r);
  8306. });
  8307. }
  8308. t.initChooseAndUploadFile = function (e) {
  8309. return function () {
  8310. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  8311. type: "all"
  8312. };
  8313. return "image" === t.type ? i(e, function (e) {
  8314. var t = e.count,
  8315. n = e.sizeType,
  8316. _e$sourceType = e.sourceType,
  8317. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  8318. o = e.extension;
  8319. return new Promise(function (e, a) {
  8320. uni.chooseImage({
  8321. count: t,
  8322. sizeType: n,
  8323. sourceType: i,
  8324. extension: o,
  8325. success: function success(t) {
  8326. e(r(t, "image"));
  8327. },
  8328. fail: function fail(e) {
  8329. a({
  8330. errMsg: e.errMsg.replace("chooseImage:fail", s)
  8331. });
  8332. }
  8333. });
  8334. });
  8335. }(t), t) : "video" === t.type ? i(e, function (e) {
  8336. var t = e.camera,
  8337. n = e.compressed,
  8338. i = e.maxDuration,
  8339. _e$sourceType2 = e.sourceType,
  8340. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  8341. a = e.extension;
  8342. return new Promise(function (e, c) {
  8343. uni.chooseVideo({
  8344. camera: t,
  8345. compressed: n,
  8346. maxDuration: i,
  8347. sourceType: o,
  8348. extension: a,
  8349. success: function success(t) {
  8350. var n = t.tempFilePath,
  8351. s = t.duration,
  8352. i = t.size,
  8353. o = t.height,
  8354. a = t.width;
  8355. e(r({
  8356. errMsg: "chooseVideo:ok",
  8357. tempFilePaths: [n],
  8358. tempFiles: [{
  8359. name: t.tempFile && t.tempFile.name || "",
  8360. path: n,
  8361. size: i,
  8362. type: t.tempFile && t.tempFile.type || "",
  8363. width: a,
  8364. height: o,
  8365. duration: s,
  8366. fileType: "video",
  8367. cloudPath: ""
  8368. }]
  8369. }, "video"));
  8370. },
  8371. fail: function fail(e) {
  8372. c({
  8373. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  8374. });
  8375. }
  8376. });
  8377. });
  8378. }(t), t) : i(e, function (e) {
  8379. var t = e.count,
  8380. n = e.extension;
  8381. return new Promise(function (e, i) {
  8382. var o = uni.chooseFile;
  8383. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  8384. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  8385. });
  8386. o({
  8387. type: "all",
  8388. count: t,
  8389. extension: n,
  8390. success: function success(t) {
  8391. e(r(t));
  8392. },
  8393. fail: function fail(e) {
  8394. i({
  8395. errMsg: e.errMsg.replace("chooseFile:fail", s)
  8396. });
  8397. }
  8398. });
  8399. });
  8400. }(t), t);
  8401. };
  8402. };
  8403. }),
  8404. ms = n(gs);
  8405. var ys = "manual";
  8406. function _s(e) {
  8407. return {
  8408. props: {
  8409. localdata: {
  8410. type: Array,
  8411. default: function _default() {
  8412. return [];
  8413. }
  8414. },
  8415. options: {
  8416. type: [Object, Array],
  8417. default: function _default() {
  8418. return {};
  8419. }
  8420. },
  8421. spaceInfo: {
  8422. type: Object,
  8423. default: function _default() {
  8424. return {};
  8425. }
  8426. },
  8427. collection: {
  8428. type: [String, Array],
  8429. default: ""
  8430. },
  8431. action: {
  8432. type: String,
  8433. default: ""
  8434. },
  8435. field: {
  8436. type: String,
  8437. default: ""
  8438. },
  8439. orderby: {
  8440. type: String,
  8441. default: ""
  8442. },
  8443. where: {
  8444. type: [String, Object],
  8445. default: ""
  8446. },
  8447. pageData: {
  8448. type: String,
  8449. default: "add"
  8450. },
  8451. pageCurrent: {
  8452. type: Number,
  8453. default: 1
  8454. },
  8455. pageSize: {
  8456. type: Number,
  8457. default: 20
  8458. },
  8459. getcount: {
  8460. type: [Boolean, String],
  8461. default: !1
  8462. },
  8463. gettree: {
  8464. type: [Boolean, String],
  8465. default: !1
  8466. },
  8467. gettreepath: {
  8468. type: [Boolean, String],
  8469. default: !1
  8470. },
  8471. startwith: {
  8472. type: String,
  8473. default: ""
  8474. },
  8475. limitlevel: {
  8476. type: Number,
  8477. default: 10
  8478. },
  8479. groupby: {
  8480. type: String,
  8481. default: ""
  8482. },
  8483. groupField: {
  8484. type: String,
  8485. default: ""
  8486. },
  8487. distinct: {
  8488. type: [Boolean, String],
  8489. default: !1
  8490. },
  8491. foreignKey: {
  8492. type: String,
  8493. default: ""
  8494. },
  8495. loadtime: {
  8496. type: String,
  8497. default: "auto"
  8498. },
  8499. manual: {
  8500. type: Boolean,
  8501. default: !1
  8502. }
  8503. },
  8504. data: function data() {
  8505. return {
  8506. mixinDatacomLoading: !1,
  8507. mixinDatacomHasMore: !1,
  8508. mixinDatacomResData: [],
  8509. mixinDatacomErrorMessage: "",
  8510. mixinDatacomPage: {}
  8511. };
  8512. },
  8513. created: function created() {
  8514. var _this21 = this;
  8515. this.mixinDatacomPage = {
  8516. current: this.pageCurrent,
  8517. size: this.pageSize,
  8518. count: 0
  8519. }, this.$watch(function () {
  8520. var e = [];
  8521. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  8522. e.push(_this21[t]);
  8523. }), e;
  8524. }, function (e, t) {
  8525. if (_this21.loadtime === ys) return;
  8526. var n = !1;
  8527. var s = [];
  8528. for (var _r6 = 2; _r6 < e.length; _r6++) {
  8529. e[_r6] !== t[_r6] && (s.push(e[_r6]), n = !0);
  8530. }
  8531. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  8532. });
  8533. },
  8534. methods: {
  8535. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  8536. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  8537. var _this22 = this;
  8538. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8539. _ref46$getone = _ref46.getone,
  8540. e = _ref46$getone === void 0 ? !1 : _ref46$getone,
  8541. t = _ref46.success,
  8542. n = _ref46.fail;
  8543. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  8544. _this22.mixinDatacomLoading = !1;
  8545. var _n$result = n.result,
  8546. s = _n$result.data,
  8547. r = _n$result.count;
  8548. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  8549. var i = e ? s.length ? s[0] : void 0 : s;
  8550. _this22.mixinDatacomResData = i, t && t(i);
  8551. }).catch(function (e) {
  8552. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, n && n(e);
  8553. }));
  8554. },
  8555. mixinDatacomGet: function mixinDatacomGet() {
  8556. var _n12;
  8557. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8558. var n = e.database(this.spaceInfo);
  8559. var s = t.action || this.action;
  8560. s && (n = n.action(s));
  8561. var r = t.collection || this.collection;
  8562. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  8563. var i = t.where || this.where;
  8564. i && Object.keys(i).length && (n = n.where(i));
  8565. var o = t.field || this.field;
  8566. o && (n = n.field(o));
  8567. var a = t.foreignKey || this.foreignKey;
  8568. a && (n = n.foreignKey(a));
  8569. var c = t.groupby || this.groupby;
  8570. c && (n = n.groupBy(c));
  8571. var u = t.groupField || this.groupField;
  8572. u && (n = n.groupField(u));
  8573. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  8574. var l = t.orderby || this.orderby;
  8575. l && (n = n.orderBy(l));
  8576. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  8577. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  8578. f = void 0 !== t.getcount ? t.getcount : this.getcount,
  8579. p = void 0 !== t.gettree ? t.gettree : this.gettree,
  8580. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  8581. m = {
  8582. getCount: f
  8583. },
  8584. y = {
  8585. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  8586. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  8587. };
  8588. return p && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  8589. }
  8590. }
  8591. };
  8592. }
  8593. function ws(e) {
  8594. return function (t) {
  8595. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8596. n = function (e) {
  8597. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8598. return e.customUI = t.customUI || e.customUI, e.parseSystemError = t.parseSystemError || e.parseSystemError, Object.assign(e.loadingOptions, t.loadingOptions), Object.assign(e.errorOptions, t.errorOptions), "object" == (0, _typeof2.default)(t.secretMethods) && (e.secretMethods = t.secretMethods), e;
  8599. }({
  8600. customUI: !1,
  8601. loadingOptions: {
  8602. title: "加载中...",
  8603. mask: !0
  8604. },
  8605. errorOptions: {
  8606. type: "modal",
  8607. retry: !1
  8608. }
  8609. }, n);
  8610. var _n13 = n,
  8611. s = _n13.customUI,
  8612. r = _n13.loadingOptions,
  8613. i = _n13.errorOptions,
  8614. o = _n13.parseSystemError,
  8615. a = !s;
  8616. return new Proxy({}, {
  8617. get: function get(s, c) {
  8618. return function () {
  8619. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8620. e = _ref47.fn,
  8621. t = _ref47.interceptorName,
  8622. n = _ref47.getCallbackArgs;
  8623. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  8624. var _len2,
  8625. s,
  8626. _key2,
  8627. r,
  8628. i,
  8629. o,
  8630. _args = arguments;
  8631. return _regenerator.default.wrap(function _callee49$(_context49) {
  8632. while (1) {
  8633. switch (_context49.prev = _context49.next) {
  8634. case 0:
  8635. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  8636. s[_key2] = _args[_key2];
  8637. }
  8638. r = n ? n({
  8639. params: s
  8640. }) : {};
  8641. _context49.prev = 2;
  8642. _context49.next = 5;
  8643. return U(R(t, "invoke"), _objectSpread({}, r));
  8644. case 5:
  8645. _context49.next = 7;
  8646. return e.apply(void 0, s);
  8647. case 7:
  8648. i = _context49.sent;
  8649. _context49.next = 10;
  8650. return U(R(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  8651. result: i
  8652. }));
  8653. case 10:
  8654. return _context49.abrupt("return", i);
  8655. case 13:
  8656. _context49.prev = 13;
  8657. _context49.t0 = _context49["catch"](2);
  8658. o = _context49.t0;
  8659. _context49.next = 18;
  8660. return U(R(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  8661. error: o
  8662. }));
  8663. case 18:
  8664. throw o;
  8665. case 19:
  8666. _context49.prev = 19;
  8667. _context49.next = 22;
  8668. return U(R(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  8669. error: o
  8670. }) : _objectSpread(_objectSpread({}, r), {}, {
  8671. result: i
  8672. }));
  8673. case 22:
  8674. return _context49.finish(19);
  8675. case 23:
  8676. case "end":
  8677. return _context49.stop();
  8678. }
  8679. }
  8680. }, _callee49, null, [[2, 13, 19, 23]]);
  8681. }));
  8682. }({
  8683. fn: function () {
  8684. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  8685. var h,
  8686. _len3,
  8687. u,
  8688. _key3,
  8689. d,
  8690. f,
  8691. _ref49,
  8692. p,
  8693. g,
  8694. m,
  8695. y,
  8696. _e30,
  8697. _yield,
  8698. _t18,
  8699. _n14,
  8700. _args4 = arguments;
  8701. return _regenerator.default.wrap(function _callee51$(_context51) {
  8702. while (1) {
  8703. switch (_context51.prev = _context51.next) {
  8704. case 0:
  8705. a && uni.showLoading({
  8706. title: r.title,
  8707. mask: r.mask
  8708. });
  8709. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  8710. u[_key3] = _args4[_key3];
  8711. }
  8712. d = {
  8713. name: t,
  8714. type: l,
  8715. data: {
  8716. method: c,
  8717. params: u
  8718. }
  8719. };
  8720. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  8721. var n = t.data.method,
  8722. s = e.secretMethods || {},
  8723. r = s[n] || s["*"];
  8724. r && (t.secretType = r);
  8725. }(n, d);
  8726. f = !1;
  8727. _context51.prev = 5;
  8728. _context51.next = 8;
  8729. return e.callFunction(d);
  8730. case 8:
  8731. h = _context51.sent;
  8732. _context51.next = 14;
  8733. break;
  8734. case 11:
  8735. _context51.prev = 11;
  8736. _context51.t0 = _context51["catch"](5);
  8737. f = !0, h = {
  8738. result: new Q(_context51.t0)
  8739. };
  8740. case 14:
  8741. _ref49 = h.result || {}, p = _ref49.errSubject, g = _ref49.errCode, m = _ref49.errMsg, y = _ref49.newToken;
  8742. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ee(y), z(q, _objectSpread({}, y))), g)) {
  8743. _context51.next = 39;
  8744. break;
  8745. }
  8746. _e30 = m;
  8747. if (!(f && o)) {
  8748. _context51.next = 24;
  8749. break;
  8750. }
  8751. _context51.next = 20;
  8752. return o({
  8753. objectName: t,
  8754. methodName: c,
  8755. params: u,
  8756. errSubject: p,
  8757. errCode: g,
  8758. errMsg: m
  8759. });
  8760. case 20:
  8761. _context51.t1 = _context51.sent.errMsg;
  8762. if (_context51.t1) {
  8763. _context51.next = 23;
  8764. break;
  8765. }
  8766. _context51.t1 = m;
  8767. case 23:
  8768. _e30 = _context51.t1;
  8769. case 24:
  8770. if (!a) {
  8771. _context51.next = 37;
  8772. break;
  8773. }
  8774. if (!("toast" === i.type)) {
  8775. _context51.next = 29;
  8776. break;
  8777. }
  8778. uni.showToast({
  8779. title: _e30,
  8780. icon: "none"
  8781. });
  8782. _context51.next = 37;
  8783. break;
  8784. case 29:
  8785. if (!("modal" !== i.type)) {
  8786. _context51.next = 31;
  8787. break;
  8788. }
  8789. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  8790. case 31:
  8791. _context51.next = 33;
  8792. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  8793. var _ref51,
  8794. e,
  8795. t,
  8796. n,
  8797. s,
  8798. r,
  8799. _args3 = arguments;
  8800. return _regenerator.default.wrap(function _callee50$(_context50) {
  8801. while (1) {
  8802. switch (_context50.prev = _context50.next) {
  8803. case 0:
  8804. _ref51 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref51.title, t = _ref51.content, n = _ref51.showCancel, s = _ref51.cancelText, r = _ref51.confirmText;
  8805. return _context50.abrupt("return", new Promise(function (i, o) {
  8806. uni.showModal({
  8807. title: e,
  8808. content: t,
  8809. showCancel: n,
  8810. cancelText: s,
  8811. confirmText: r,
  8812. success: function success(e) {
  8813. i(e);
  8814. },
  8815. fail: function fail() {
  8816. i({
  8817. confirm: !1,
  8818. cancel: !0
  8819. });
  8820. }
  8821. });
  8822. }));
  8823. case 2:
  8824. case "end":
  8825. return _context50.stop();
  8826. }
  8827. }
  8828. }, _callee50);
  8829. }))({
  8830. title: "提示",
  8831. content: _e30,
  8832. showCancel: i.retry,
  8833. cancelText: "取消",
  8834. confirmText: i.retry ? "重试" : "确定"
  8835. });
  8836. case 33:
  8837. _yield = _context51.sent;
  8838. _t18 = _yield.confirm;
  8839. if (!(i.retry && _t18)) {
  8840. _context51.next = 37;
  8841. break;
  8842. }
  8843. return _context51.abrupt("return", s.apply(void 0, u));
  8844. case 37:
  8845. _n14 = new Q({
  8846. subject: p,
  8847. code: g,
  8848. message: m,
  8849. requestId: h.requestId
  8850. });
  8851. throw _n14.detail = h.result, z(D, {
  8852. type: j,
  8853. content: _n14
  8854. }), _n14;
  8855. case 39:
  8856. return _context51.abrupt("return", (z(D, {
  8857. type: j,
  8858. content: h.result
  8859. }), h.result));
  8860. case 40:
  8861. case "end":
  8862. return _context51.stop();
  8863. }
  8864. }
  8865. }, _callee51, null, [[5, 11]]);
  8866. }));
  8867. function s() {
  8868. return _s14.apply(this, arguments);
  8869. }
  8870. return s;
  8871. }(),
  8872. interceptorName: "callObject",
  8873. getCallbackArgs: function getCallbackArgs() {
  8874. var _ref52 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8875. e = _ref52.params;
  8876. return {
  8877. objectName: t,
  8878. methodName: c,
  8879. params: e
  8880. };
  8881. }
  8882. });
  8883. }
  8884. });
  8885. };
  8886. }
  8887. function vs(e) {
  8888. return C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  8889. }
  8890. function Ss() {
  8891. return _Ss.apply(this, arguments);
  8892. }
  8893. function _Ss() {
  8894. _Ss = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  8895. var _ref56,
  8896. _ref56$callLoginByWei,
  8897. e,
  8898. t,
  8899. n,
  8900. s,
  8901. _args6 = arguments;
  8902. return _regenerator.default.wrap(function _callee53$(_context53) {
  8903. while (1) {
  8904. switch (_context53.prev = _context53.next) {
  8905. case 0:
  8906. _ref56 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref56$callLoginByWei = _ref56.callLoginByWeixin, e = _ref56$callLoginByWei === void 0 ? !1 : _ref56$callLoginByWei;
  8907. t = vs(this);
  8908. if (!("mp-weixin" !== S)) {
  8909. _context53.next = 4;
  8910. break;
  8911. }
  8912. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(S, "`"));
  8913. case 4:
  8914. _context53.next = 6;
  8915. return new Promise(function (e, t) {
  8916. uni.login({
  8917. success: function success(t) {
  8918. e(t.code);
  8919. },
  8920. fail: function fail(e) {
  8921. t(new Error(e.errMsg));
  8922. }
  8923. });
  8924. });
  8925. case 6:
  8926. n = _context53.sent;
  8927. s = this.importObject("uni-id-co", {
  8928. customUI: !0
  8929. });
  8930. _context53.next = 10;
  8931. return s.secureNetworkHandshakeByWeixin({
  8932. code: n,
  8933. callLoginByWeixin: e
  8934. });
  8935. case 10:
  8936. t.mpWeixinCode = n;
  8937. return _context53.abrupt("return", {
  8938. code: n
  8939. });
  8940. case 12:
  8941. case "end":
  8942. return _context53.stop();
  8943. }
  8944. }
  8945. }, _callee53, this);
  8946. }));
  8947. return _Ss.apply(this, arguments);
  8948. }
  8949. function ks(_x37) {
  8950. return _ks.apply(this, arguments);
  8951. }
  8952. function _ks() {
  8953. _ks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(e) {
  8954. var t;
  8955. return _regenerator.default.wrap(function _callee54$(_context54) {
  8956. while (1) {
  8957. switch (_context54.prev = _context54.next) {
  8958. case 0:
  8959. t = vs(this);
  8960. return _context54.abrupt("return", (t.initPromise || (t.initPromise = Ss.call(this, e)), t.initPromise));
  8961. case 2:
  8962. case "end":
  8963. return _context54.stop();
  8964. }
  8965. }
  8966. }, _callee54, this);
  8967. }));
  8968. return _ks.apply(this, arguments);
  8969. }
  8970. function Is(e) {
  8971. return function () {
  8972. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8973. _ref53$callLoginByWei = _ref53.callLoginByWeixin,
  8974. t = _ref53$callLoginByWei === void 0 ? !1 : _ref53$callLoginByWei;
  8975. return ks.call(e, {
  8976. callLoginByWeixin: t
  8977. });
  8978. };
  8979. }
  8980. function bs(_x38, _x39) {
  8981. return _bs.apply(this, arguments);
  8982. }
  8983. function _bs() {
  8984. _bs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e, t) {
  8985. var n, _e32, s;
  8986. return _regenerator.default.wrap(function _callee55$(_context55) {
  8987. while (1) {
  8988. switch (_context55.prev = _context55.next) {
  8989. case 0:
  8990. n = "http://".concat(e, ":").concat(t, "/system/ping");
  8991. _context55.prev = 1;
  8992. _context55.next = 4;
  8993. return s = {
  8994. url: n,
  8995. timeout: 500
  8996. }, new Promise(function (e, t) {
  8997. X.request(_objectSpread(_objectSpread({}, s), {}, {
  8998. success: function success(t) {
  8999. e(t);
  9000. },
  9001. fail: function fail(e) {
  9002. t(e);
  9003. }
  9004. }));
  9005. });
  9006. case 4:
  9007. _e32 = _context55.sent;
  9008. return _context55.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  9009. case 8:
  9010. _context55.prev = 8;
  9011. _context55.t0 = _context55["catch"](1);
  9012. return _context55.abrupt("return", !1);
  9013. case 11:
  9014. case "end":
  9015. return _context55.stop();
  9016. }
  9017. }
  9018. }, _callee55, null, [[1, 8]]);
  9019. }));
  9020. return _bs.apply(this, arguments);
  9021. }
  9022. function Ts(e) {
  9023. if (e.initUniCloudStatus && "rejected" !== e.initUniCloudStatus) return;
  9024. var t = Promise.resolve();
  9025. var n;
  9026. n = 1, t = new Promise(function (e) {
  9027. setTimeout(function () {
  9028. e();
  9029. }, n);
  9030. }), e.isReady = !1, e.isDefault = !1;
  9031. var s = e.auth();
  9032. e.initUniCloudStatus = "pending", e.initUniCloud = t.then(function () {
  9033. return s.getLoginState();
  9034. }).then(function (e) {
  9035. return e ? Promise.resolve() : s.signInAnonymously();
  9036. }).then(function () {
  9037. if (!y) return Promise.resolve();
  9038. if ("app" === S) {
  9039. var _re2 = re(),
  9040. _e31 = _re2.osName,
  9041. _t19 = _re2.osVersion;
  9042. "ios" === _e31 && function (e) {
  9043. if (!e || "string" != typeof e) return 0;
  9044. var t = e.match(/^(\d+)./);
  9045. return t && t[1] ? parseInt(t[1]) : 0;
  9046. }(_t19) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  9047. }
  9048. if (y && e.__dev__.debugInfo) {
  9049. var _e$__dev__$debugInfo = e.__dev__.debugInfo,
  9050. _t20 = _e$__dev__$debugInfo.address,
  9051. _n15 = _e$__dev__$debugInfo.servePort;
  9052. return function () {
  9053. var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(e, t) {
  9054. var n, _s15, _r7;
  9055. return _regenerator.default.wrap(function _callee52$(_context52) {
  9056. while (1) {
  9057. switch (_context52.prev = _context52.next) {
  9058. case 0:
  9059. _s15 = 0;
  9060. case 1:
  9061. if (!(_s15 < e.length)) {
  9062. _context52.next = 11;
  9063. break;
  9064. }
  9065. _r7 = e[_s15];
  9066. _context52.next = 5;
  9067. return bs(_r7, t);
  9068. case 5:
  9069. if (!_context52.sent) {
  9070. _context52.next = 8;
  9071. break;
  9072. }
  9073. n = _r7;
  9074. return _context52.abrupt("break", 11);
  9075. case 8:
  9076. _s15++;
  9077. _context52.next = 1;
  9078. break;
  9079. case 11:
  9080. return _context52.abrupt("return", {
  9081. address: n,
  9082. port: t
  9083. });
  9084. case 12:
  9085. case "end":
  9086. return _context52.stop();
  9087. }
  9088. }
  9089. }, _callee52);
  9090. }));
  9091. return function (_x40, _x41) {
  9092. return _ref54.apply(this, arguments);
  9093. };
  9094. }()(_t20, _n15);
  9095. }
  9096. }).then(function () {
  9097. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9098. t = _ref55.address,
  9099. n = _ref55.port;
  9100. if (!y) return Promise.resolve();
  9101. var s = console["app" === S ? "error" : "warn"];
  9102. if (t) e.__dev__.localAddress = t, e.__dev__.localPort = n;else if (e.__dev__.debugInfo) {
  9103. var _t21 = "";
  9104. "remote" === e.__dev__.debugInfo.initialLaunchType ? (e.__dev__.debugInfo.forceRemote = !0, _t21 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : _t21 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", _t21 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === S && (_t21 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === S.indexOf("mp-") && (_t21 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), s(_t21);
  9105. }
  9106. }).then(function () {
  9107. te(), e.isReady = !0, e.initUniCloudStatus = "fulfilled";
  9108. }).catch(function (t) {
  9109. console.error(t), e.initUniCloudStatus = "rejected";
  9110. });
  9111. }
  9112. var As = {
  9113. tcb: yt,
  9114. tencent: yt,
  9115. aliyun: he,
  9116. private: wt
  9117. };
  9118. var Cs = new ( /*#__PURE__*/function () {
  9119. function _class6() {
  9120. (0, _classCallCheck2.default)(this, _class6);
  9121. }
  9122. (0, _createClass2.default)(_class6, [{
  9123. key: "init",
  9124. value: function init(e) {
  9125. var t = {};
  9126. var n = As[e.provider];
  9127. if (!n) throw new Error("未提供正确的provider参数");
  9128. t = n.init(e), t.__dev__ = {}, t.__dev__.debugLog = y && ("web" === S && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === S);
  9129. var s = k;
  9130. y && s && !s.code && (t.__dev__.debugInfo = s), Ts(t), t.reInit = function () {
  9131. Ts(this);
  9132. }, Cn(t), function (e) {
  9133. var t = e.uploadFile;
  9134. e.uploadFile = function (e) {
  9135. return t.call(this, e);
  9136. };
  9137. }(t), function (e) {
  9138. e.database = function (t) {
  9139. if (t && Object.keys(t).length > 0) return e.init(t).database();
  9140. if (this._database) return this._database;
  9141. var n = qn(Kn, {
  9142. uniClient: e
  9143. });
  9144. return this._database = n, n;
  9145. }, e.databaseForJQL = function (t) {
  9146. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  9147. if (this._databaseForJQL) return this._databaseForJQL;
  9148. var n = qn(Kn, {
  9149. uniClient: e,
  9150. isJQL: !0
  9151. });
  9152. return this._databaseForJQL = n, n;
  9153. };
  9154. }(t), function (e) {
  9155. e.getCurrentUserInfo = ps, e.chooseAndUploadFile = ms.initChooseAndUploadFile(e), Object.assign(e, {
  9156. get mixinDatacom() {
  9157. return _s(e);
  9158. }
  9159. }), e.importObject = ws(e), e.initSecureNetworkByWeixin = Is(e);
  9160. }(t);
  9161. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  9162. if (!t[e]) return;
  9163. var n = t[e];
  9164. t[e] = function () {
  9165. return t.reInit(), n.apply(t, Array.from(arguments));
  9166. }, t[e] = Y(t[e], e).bind(t);
  9167. }), t.init = this.init, t;
  9168. }
  9169. }]);
  9170. return _class6;
  9171. }())();
  9172. (function () {
  9173. var e = I;
  9174. var t = {};
  9175. if (e && 1 === e.length) t = e[0], Cs = Cs.init(t), Cs.isDefault = !0;else {
  9176. var _t22 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  9177. var _n16;
  9178. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : b ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t22.forEach(function (e) {
  9179. Cs[e] = function () {
  9180. return console.error(_n16), Promise.reject(new Q({
  9181. code: "SYS_ERR",
  9182. message: _n16
  9183. }));
  9184. };
  9185. });
  9186. }
  9187. Object.assign(Cs, {
  9188. get mixinDatacom() {
  9189. return _s(Cs);
  9190. }
  9191. }), ls(Cs), Cs.addInterceptor = O, Cs.removeInterceptor = x, Cs.interceptObject = L, y && "web" === S && (window.uniCloud = Cs);
  9192. })();
  9193. var Ps = Cs;
  9194. exports.default = Ps;
  9195. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9196. /***/ }),
  9197. /***/ 196:
  9198. /*!****************************************************************!*\
  9199. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  9200. \****************************************************************/
  9201. /*! no static exports found */
  9202. /***/ (function(module, exports, __webpack_require__) {
  9203. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 172);
  9204. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  9205. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 197);
  9206. var construct = __webpack_require__(/*! ./construct.js */ 15);
  9207. function _wrapNativeSuper(Class) {
  9208. var _cache = typeof Map === "function" ? new Map() : undefined;
  9209. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  9210. if (Class === null || !isNativeFunction(Class)) return Class;
  9211. if (typeof Class !== "function") {
  9212. throw new TypeError("Super expression must either be null or a function");
  9213. }
  9214. if (typeof _cache !== "undefined") {
  9215. if (_cache.has(Class)) return _cache.get(Class);
  9216. _cache.set(Class, Wrapper);
  9217. }
  9218. function Wrapper() {
  9219. return construct(Class, arguments, getPrototypeOf(this).constructor);
  9220. }
  9221. Wrapper.prototype = Object.create(Class.prototype, {
  9222. constructor: {
  9223. value: Wrapper,
  9224. enumerable: false,
  9225. writable: true,
  9226. configurable: true
  9227. }
  9228. });
  9229. return setPrototypeOf(Wrapper, Class);
  9230. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9231. return _wrapNativeSuper(Class);
  9232. }
  9233. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9234. /***/ }),
  9235. /***/ 197:
  9236. /*!*****************************************************************!*\
  9237. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  9238. \*****************************************************************/
  9239. /*! no static exports found */
  9240. /***/ (function(module, exports) {
  9241. function _isNativeFunction(fn) {
  9242. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  9243. }
  9244. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9245. /***/ }),
  9246. /***/ 198:
  9247. /*!**********************************************************************!*\
  9248. !*** D:/project/项目模板/uniapp/pages.json?{"type":"origin-pages-json"} ***!
  9249. \**********************************************************************/
  9250. /*! no static exports found */
  9251. /***/ (function(module, exports, __webpack_require__) {
  9252. "use strict";
  9253. Object.defineProperty(exports, "__esModule", {
  9254. value: true
  9255. });
  9256. exports.default = void 0;
  9257. var _default = {
  9258. "pages": [{
  9259. "path": "pages/index/index",
  9260. "style": {
  9261. "navigationBarTitleText": "首页"
  9262. }
  9263. }],
  9264. "subPackages": [{
  9265. "root": "pagesCommon",
  9266. "pages": [{
  9267. "path": "test/index",
  9268. "style": {
  9269. "navigationBarTitleText": "测试一",
  9270. "enablePullDownRefresh": true
  9271. }
  9272. }]
  9273. }, {
  9274. "root": "pagesHome",
  9275. "pages": [{
  9276. "path": "home/index",
  9277. "style": {
  9278. "navigationBarTitleText": "首页",
  9279. "enablePullDownRefresh": false
  9280. }
  9281. }, {
  9282. "path": "hot/index",
  9283. "style": {
  9284. "navigationBarTitleText": "热播",
  9285. "enablePullDownRefresh": false
  9286. }
  9287. }, {
  9288. "path": "app/index",
  9289. "style": {
  9290. "navigationBarTitleText": "应用",
  9291. "enablePullDownRefresh": false
  9292. }
  9293. }, {
  9294. "path": "find/index",
  9295. "style": {
  9296. "navigationBarTitleText": "发现",
  9297. "enablePullDownRefresh": false
  9298. }
  9299. }, {
  9300. "path": "account/index",
  9301. "style": {
  9302. "navigationBarTitleText": "账户",
  9303. "enablePullDownRefresh": false
  9304. }
  9305. }]
  9306. }, {
  9307. "root": "pagesAccount",
  9308. "pages": [{
  9309. "path": "login/index",
  9310. "style": {
  9311. "navigationBarTitleText": "账号登录",
  9312. "enablePullDownRefresh": false
  9313. }
  9314. }, {
  9315. "path": "register/index",
  9316. "style": {
  9317. "navigationBarTitleText": "账号注册",
  9318. "enablePullDownRefresh": false
  9319. }
  9320. }, {
  9321. "path": "other/agree",
  9322. "style": {
  9323. "navigationBarTitleText": "用户协议",
  9324. "enablePullDownRefresh": false
  9325. }
  9326. }, {
  9327. "path": "like/index",
  9328. "style": {
  9329. "navigationBarTitleText": "我的喜欢",
  9330. "enablePullDownRefresh": true
  9331. }
  9332. }, {
  9333. "path": "collect/index",
  9334. "style": {
  9335. "navigationBarTitleText": "我的收藏",
  9336. "enablePullDownRefresh": true
  9337. }
  9338. }, {
  9339. "path": "basic/index",
  9340. "style": {
  9341. "navigationBarTitleText": "账号信息",
  9342. "enablePullDownRefresh": false
  9343. }
  9344. }]
  9345. }],
  9346. "globalStyle": {
  9347. "navigationBarTextStyle": "white",
  9348. "navigationBarTitleText": "益智游戏",
  9349. "navigationBarBackgroundColor": "#111111",
  9350. "backgroundColor": "#000000"
  9351. },
  9352. "uniIdRouter": {}
  9353. };
  9354. exports.default = _default;
  9355. /***/ }),
  9356. /***/ 199:
  9357. /*!*********************************************************!*\
  9358. !*** D:/project/项目模板/uniapp/pages.json?{"type":"stat"} ***!
  9359. \*********************************************************/
  9360. /*! no static exports found */
  9361. /***/ (function(module, exports, __webpack_require__) {
  9362. "use strict";
  9363. Object.defineProperty(exports, "__esModule", {
  9364. value: true
  9365. });
  9366. exports.default = void 0;
  9367. var _default = {
  9368. "appid": "__UNI__2080341"
  9369. };
  9370. exports.default = _default;
  9371. /***/ }),
  9372. /***/ 2:
  9373. /*!************************************************************!*\
  9374. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  9375. \************************************************************/
  9376. /*! no static exports found */
  9377. /***/ (function(module, exports, __webpack_require__) {
  9378. "use strict";
  9379. /* WEBPACK VAR INJECTION */(function(wx, global) {
  9380. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9381. Object.defineProperty(exports, "__esModule", {
  9382. value: true
  9383. });
  9384. exports.createApp = createApp;
  9385. exports.createComponent = createComponent;
  9386. exports.createPage = createPage;
  9387. exports.createPlugin = createPlugin;
  9388. exports.createSubpackageApp = createSubpackageApp;
  9389. exports.default = void 0;
  9390. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9391. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  9392. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  9393. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  9394. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9395. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  9396. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  9397. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  9398. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  9399. var realAtob;
  9400. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  9401. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  9402. if (typeof atob !== 'function') {
  9403. realAtob = function realAtob(str) {
  9404. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  9405. if (!b64re.test(str)) {
  9406. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  9407. }
  9408. // Adding the padding if missing, for semplicity
  9409. str += '=='.slice(2 - (str.length & 3));
  9410. var bitmap;
  9411. var result = '';
  9412. var r1;
  9413. var r2;
  9414. var i = 0;
  9415. for (; i < str.length;) {
  9416. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  9417. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  9418. }
  9419. return result;
  9420. };
  9421. } else {
  9422. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  9423. realAtob = atob;
  9424. }
  9425. function b64DecodeUnicode(str) {
  9426. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  9427. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  9428. }).join(''));
  9429. }
  9430. function getCurrentUserInfo() {
  9431. var token = wx.getStorageSync('uni_id_token') || '';
  9432. var tokenArr = token.split('.');
  9433. if (!token || tokenArr.length !== 3) {
  9434. return {
  9435. uid: null,
  9436. role: [],
  9437. permission: [],
  9438. tokenExpired: 0
  9439. };
  9440. }
  9441. var userInfo;
  9442. try {
  9443. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  9444. } catch (error) {
  9445. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  9446. }
  9447. userInfo.tokenExpired = userInfo.exp * 1000;
  9448. delete userInfo.exp;
  9449. delete userInfo.iat;
  9450. return userInfo;
  9451. }
  9452. function uniIdMixin(Vue) {
  9453. Vue.prototype.uniIDHasRole = function (roleId) {
  9454. var _getCurrentUserInfo = getCurrentUserInfo(),
  9455. role = _getCurrentUserInfo.role;
  9456. return role.indexOf(roleId) > -1;
  9457. };
  9458. Vue.prototype.uniIDHasPermission = function (permissionId) {
  9459. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  9460. permission = _getCurrentUserInfo2.permission;
  9461. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  9462. };
  9463. Vue.prototype.uniIDTokenValid = function () {
  9464. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  9465. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  9466. return tokenExpired > Date.now();
  9467. };
  9468. }
  9469. var _toString = Object.prototype.toString;
  9470. var hasOwnProperty = Object.prototype.hasOwnProperty;
  9471. function isFn(fn) {
  9472. return typeof fn === 'function';
  9473. }
  9474. function isStr(str) {
  9475. return typeof str === 'string';
  9476. }
  9477. function isObject(obj) {
  9478. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  9479. }
  9480. function isPlainObject(obj) {
  9481. return _toString.call(obj) === '[object Object]';
  9482. }
  9483. function hasOwn(obj, key) {
  9484. return hasOwnProperty.call(obj, key);
  9485. }
  9486. function noop() {}
  9487. /**
  9488. * Create a cached version of a pure function.
  9489. */
  9490. function cached(fn) {
  9491. var cache = Object.create(null);
  9492. return function cachedFn(str) {
  9493. var hit = cache[str];
  9494. return hit || (cache[str] = fn(str));
  9495. };
  9496. }
  9497. /**
  9498. * Camelize a hyphen-delimited string.
  9499. */
  9500. var camelizeRE = /-(\w)/g;
  9501. var camelize = cached(function (str) {
  9502. return str.replace(camelizeRE, function (_, c) {
  9503. return c ? c.toUpperCase() : '';
  9504. });
  9505. });
  9506. function sortObject(obj) {
  9507. var sortObj = {};
  9508. if (isPlainObject(obj)) {
  9509. Object.keys(obj).sort().forEach(function (key) {
  9510. sortObj[key] = obj[key];
  9511. });
  9512. }
  9513. return !Object.keys(sortObj) ? obj : sortObj;
  9514. }
  9515. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  9516. var globalInterceptors = {};
  9517. var scopedInterceptors = {};
  9518. function mergeHook(parentVal, childVal) {
  9519. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  9520. return res ? dedupeHooks(res) : res;
  9521. }
  9522. function dedupeHooks(hooks) {
  9523. var res = [];
  9524. for (var i = 0; i < hooks.length; i++) {
  9525. if (res.indexOf(hooks[i]) === -1) {
  9526. res.push(hooks[i]);
  9527. }
  9528. }
  9529. return res;
  9530. }
  9531. function removeHook(hooks, hook) {
  9532. var index = hooks.indexOf(hook);
  9533. if (index !== -1) {
  9534. hooks.splice(index, 1);
  9535. }
  9536. }
  9537. function mergeInterceptorHook(interceptor, option) {
  9538. Object.keys(option).forEach(function (hook) {
  9539. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  9540. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  9541. }
  9542. });
  9543. }
  9544. function removeInterceptorHook(interceptor, option) {
  9545. if (!interceptor || !option) {
  9546. return;
  9547. }
  9548. Object.keys(option).forEach(function (hook) {
  9549. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  9550. removeHook(interceptor[hook], option[hook]);
  9551. }
  9552. });
  9553. }
  9554. function addInterceptor(method, option) {
  9555. if (typeof method === 'string' && isPlainObject(option)) {
  9556. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  9557. } else if (isPlainObject(method)) {
  9558. mergeInterceptorHook(globalInterceptors, method);
  9559. }
  9560. }
  9561. function removeInterceptor(method, option) {
  9562. if (typeof method === 'string') {
  9563. if (isPlainObject(option)) {
  9564. removeInterceptorHook(scopedInterceptors[method], option);
  9565. } else {
  9566. delete scopedInterceptors[method];
  9567. }
  9568. } else if (isPlainObject(method)) {
  9569. removeInterceptorHook(globalInterceptors, method);
  9570. }
  9571. }
  9572. function wrapperHook(hook) {
  9573. return function (data) {
  9574. return hook(data) || data;
  9575. };
  9576. }
  9577. function isPromise(obj) {
  9578. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  9579. }
  9580. function queue(hooks, data) {
  9581. var promise = false;
  9582. for (var i = 0; i < hooks.length; i++) {
  9583. var hook = hooks[i];
  9584. if (promise) {
  9585. promise = Promise.resolve(wrapperHook(hook));
  9586. } else {
  9587. var res = hook(data);
  9588. if (isPromise(res)) {
  9589. promise = Promise.resolve(res);
  9590. }
  9591. if (res === false) {
  9592. return {
  9593. then: function then() {}
  9594. };
  9595. }
  9596. }
  9597. }
  9598. return promise || {
  9599. then: function then(callback) {
  9600. return callback(data);
  9601. }
  9602. };
  9603. }
  9604. function wrapperOptions(interceptor) {
  9605. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9606. ['success', 'fail', 'complete'].forEach(function (name) {
  9607. if (Array.isArray(interceptor[name])) {
  9608. var oldCallback = options[name];
  9609. options[name] = function callbackInterceptor(res) {
  9610. queue(interceptor[name], res).then(function (res) {
  9611. /* eslint-disable no-mixed-operators */
  9612. return isFn(oldCallback) && oldCallback(res) || res;
  9613. });
  9614. };
  9615. }
  9616. });
  9617. return options;
  9618. }
  9619. function wrapperReturnValue(method, returnValue) {
  9620. var returnValueHooks = [];
  9621. if (Array.isArray(globalInterceptors.returnValue)) {
  9622. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  9623. }
  9624. var interceptor = scopedInterceptors[method];
  9625. if (interceptor && Array.isArray(interceptor.returnValue)) {
  9626. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  9627. }
  9628. returnValueHooks.forEach(function (hook) {
  9629. returnValue = hook(returnValue) || returnValue;
  9630. });
  9631. return returnValue;
  9632. }
  9633. function getApiInterceptorHooks(method) {
  9634. var interceptor = Object.create(null);
  9635. Object.keys(globalInterceptors).forEach(function (hook) {
  9636. if (hook !== 'returnValue') {
  9637. interceptor[hook] = globalInterceptors[hook].slice();
  9638. }
  9639. });
  9640. var scopedInterceptor = scopedInterceptors[method];
  9641. if (scopedInterceptor) {
  9642. Object.keys(scopedInterceptor).forEach(function (hook) {
  9643. if (hook !== 'returnValue') {
  9644. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  9645. }
  9646. });
  9647. }
  9648. return interceptor;
  9649. }
  9650. function invokeApi(method, api, options) {
  9651. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  9652. params[_key - 3] = arguments[_key];
  9653. }
  9654. var interceptor = getApiInterceptorHooks(method);
  9655. if (interceptor && Object.keys(interceptor).length) {
  9656. if (Array.isArray(interceptor.invoke)) {
  9657. var res = queue(interceptor.invoke, options);
  9658. return res.then(function (options) {
  9659. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  9660. });
  9661. } else {
  9662. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  9663. }
  9664. }
  9665. return api.apply(void 0, [options].concat(params));
  9666. }
  9667. var promiseInterceptor = {
  9668. returnValue: function returnValue(res) {
  9669. if (!isPromise(res)) {
  9670. return res;
  9671. }
  9672. return new Promise(function (resolve, reject) {
  9673. res.then(function (res) {
  9674. if (res[0]) {
  9675. reject(res[0]);
  9676. } else {
  9677. resolve(res[1]);
  9678. }
  9679. });
  9680. });
  9681. }
  9682. };
  9683. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  9684. var CONTEXT_API_RE = /^create|Manager$/;
  9685. // Context例外情况
  9686. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  9687. // 同步例外情况
  9688. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  9689. var CALLBACK_API_RE = /^on|^off/;
  9690. function isContextApi(name) {
  9691. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  9692. }
  9693. function isSyncApi(name) {
  9694. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  9695. }
  9696. function isCallbackApi(name) {
  9697. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  9698. }
  9699. function handlePromise(promise) {
  9700. return promise.then(function (data) {
  9701. return [null, data];
  9702. }).catch(function (err) {
  9703. return [err];
  9704. });
  9705. }
  9706. function shouldPromise(name) {
  9707. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  9708. return false;
  9709. }
  9710. return true;
  9711. }
  9712. /* eslint-disable no-extend-native */
  9713. if (!Promise.prototype.finally) {
  9714. Promise.prototype.finally = function (callback) {
  9715. var promise = this.constructor;
  9716. return this.then(function (value) {
  9717. return promise.resolve(callback()).then(function () {
  9718. return value;
  9719. });
  9720. }, function (reason) {
  9721. return promise.resolve(callback()).then(function () {
  9722. throw reason;
  9723. });
  9724. });
  9725. };
  9726. }
  9727. function promisify(name, api) {
  9728. if (!shouldPromise(name) || !isFn(api)) {
  9729. return api;
  9730. }
  9731. return function promiseApi() {
  9732. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9733. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  9734. params[_key2 - 1] = arguments[_key2];
  9735. }
  9736. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  9737. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  9738. }
  9739. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  9740. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  9741. success: resolve,
  9742. fail: reject
  9743. })].concat(params));
  9744. })));
  9745. };
  9746. }
  9747. var EPS = 1e-4;
  9748. var BASE_DEVICE_WIDTH = 750;
  9749. var isIOS = false;
  9750. var deviceWidth = 0;
  9751. var deviceDPR = 0;
  9752. function checkDeviceWidth() {
  9753. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  9754. platform = _wx$getSystemInfoSync.platform,
  9755. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  9756. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  9757. deviceWidth = windowWidth;
  9758. deviceDPR = pixelRatio;
  9759. isIOS = platform === 'ios';
  9760. }
  9761. function upx2px(number, newDeviceWidth) {
  9762. if (deviceWidth === 0) {
  9763. checkDeviceWidth();
  9764. }
  9765. number = Number(number);
  9766. if (number === 0) {
  9767. return 0;
  9768. }
  9769. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  9770. if (result < 0) {
  9771. result = -result;
  9772. }
  9773. result = Math.floor(result + EPS);
  9774. if (result === 0) {
  9775. if (deviceDPR === 1 || !isIOS) {
  9776. result = 1;
  9777. } else {
  9778. result = 0.5;
  9779. }
  9780. }
  9781. return number < 0 ? -result : result;
  9782. }
  9783. var LOCALE_ZH_HANS = 'zh-Hans';
  9784. var LOCALE_ZH_HANT = 'zh-Hant';
  9785. var LOCALE_EN = 'en';
  9786. var LOCALE_FR = 'fr';
  9787. var LOCALE_ES = 'es';
  9788. var messages = {};
  9789. var locale;
  9790. {
  9791. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  9792. }
  9793. function initI18nMessages() {
  9794. if (!isEnableLocale()) {
  9795. return;
  9796. }
  9797. var localeKeys = Object.keys(__uniConfig.locales);
  9798. if (localeKeys.length) {
  9799. localeKeys.forEach(function (locale) {
  9800. var curMessages = messages[locale];
  9801. var userMessages = __uniConfig.locales[locale];
  9802. if (curMessages) {
  9803. Object.assign(curMessages, userMessages);
  9804. } else {
  9805. messages[locale] = userMessages;
  9806. }
  9807. });
  9808. }
  9809. }
  9810. initI18nMessages();
  9811. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  9812. var t = i18n.t;
  9813. var i18nMixin = i18n.mixin = {
  9814. beforeCreate: function beforeCreate() {
  9815. var _this = this;
  9816. var unwatch = i18n.i18n.watchLocale(function () {
  9817. _this.$forceUpdate();
  9818. });
  9819. this.$once('hook:beforeDestroy', function () {
  9820. unwatch();
  9821. });
  9822. },
  9823. methods: {
  9824. $$t: function $$t(key, values) {
  9825. return t(key, values);
  9826. }
  9827. }
  9828. };
  9829. var setLocale = i18n.setLocale;
  9830. var getLocale = i18n.getLocale;
  9831. function initAppLocale(Vue, appVm, locale) {
  9832. var state = Vue.observable({
  9833. locale: locale || i18n.getLocale()
  9834. });
  9835. var localeWatchers = [];
  9836. appVm.$watchLocale = function (fn) {
  9837. localeWatchers.push(fn);
  9838. };
  9839. Object.defineProperty(appVm, '$locale', {
  9840. get: function get() {
  9841. return state.locale;
  9842. },
  9843. set: function set(v) {
  9844. state.locale = v;
  9845. localeWatchers.forEach(function (watch) {
  9846. return watch(v);
  9847. });
  9848. }
  9849. });
  9850. }
  9851. function isEnableLocale() {
  9852. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  9853. }
  9854. function include(str, parts) {
  9855. return !!parts.find(function (part) {
  9856. return str.indexOf(part) !== -1;
  9857. });
  9858. }
  9859. function startsWith(str, parts) {
  9860. return parts.find(function (part) {
  9861. return str.indexOf(part) === 0;
  9862. });
  9863. }
  9864. function normalizeLocale(locale, messages) {
  9865. if (!locale) {
  9866. return;
  9867. }
  9868. locale = locale.trim().replace(/_/g, '-');
  9869. if (messages && messages[locale]) {
  9870. return locale;
  9871. }
  9872. locale = locale.toLowerCase();
  9873. if (locale === 'chinese') {
  9874. // 支付宝
  9875. return LOCALE_ZH_HANS;
  9876. }
  9877. if (locale.indexOf('zh') === 0) {
  9878. if (locale.indexOf('-hans') > -1) {
  9879. return LOCALE_ZH_HANS;
  9880. }
  9881. if (locale.indexOf('-hant') > -1) {
  9882. return LOCALE_ZH_HANT;
  9883. }
  9884. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  9885. return LOCALE_ZH_HANT;
  9886. }
  9887. return LOCALE_ZH_HANS;
  9888. }
  9889. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  9890. if (lang) {
  9891. return lang;
  9892. }
  9893. }
  9894. // export function initI18n() {
  9895. // const localeKeys = Object.keys(__uniConfig.locales || {})
  9896. // if (localeKeys.length) {
  9897. // localeKeys.forEach((locale) =>
  9898. // i18n.add(locale, __uniConfig.locales[locale])
  9899. // )
  9900. // }
  9901. // }
  9902. function getLocale$1() {
  9903. // 优先使用 $locale
  9904. if (isFn(getApp)) {
  9905. var app = getApp({
  9906. allowDefault: true
  9907. });
  9908. if (app && app.$vm) {
  9909. return app.$vm.$locale;
  9910. }
  9911. }
  9912. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  9913. }
  9914. function setLocale$1(locale) {
  9915. var app = isFn(getApp) ? getApp() : false;
  9916. if (!app) {
  9917. return false;
  9918. }
  9919. var oldLocale = app.$vm.$locale;
  9920. if (oldLocale !== locale) {
  9921. app.$vm.$locale = locale;
  9922. onLocaleChangeCallbacks.forEach(function (fn) {
  9923. return fn({
  9924. locale: locale
  9925. });
  9926. });
  9927. return true;
  9928. }
  9929. return false;
  9930. }
  9931. var onLocaleChangeCallbacks = [];
  9932. function onLocaleChange(fn) {
  9933. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  9934. onLocaleChangeCallbacks.push(fn);
  9935. }
  9936. }
  9937. if (typeof global !== 'undefined') {
  9938. global.getLocale = getLocale$1;
  9939. }
  9940. var interceptors = {
  9941. promiseInterceptor: promiseInterceptor
  9942. };
  9943. var baseApi = /*#__PURE__*/Object.freeze({
  9944. __proto__: null,
  9945. upx2px: upx2px,
  9946. getLocale: getLocale$1,
  9947. setLocale: setLocale$1,
  9948. onLocaleChange: onLocaleChange,
  9949. addInterceptor: addInterceptor,
  9950. removeInterceptor: removeInterceptor,
  9951. interceptors: interceptors
  9952. });
  9953. function findExistsPageIndex(url) {
  9954. var pages = getCurrentPages();
  9955. var len = pages.length;
  9956. while (len--) {
  9957. var page = pages[len];
  9958. if (page.$page && page.$page.fullPath === url) {
  9959. return len;
  9960. }
  9961. }
  9962. return -1;
  9963. }
  9964. var redirectTo = {
  9965. name: function name(fromArgs) {
  9966. if (fromArgs.exists === 'back' && fromArgs.delta) {
  9967. return 'navigateBack';
  9968. }
  9969. return 'redirectTo';
  9970. },
  9971. args: function args(fromArgs) {
  9972. if (fromArgs.exists === 'back' && fromArgs.url) {
  9973. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  9974. if (existsPageIndex !== -1) {
  9975. var delta = getCurrentPages().length - 1 - existsPageIndex;
  9976. if (delta > 0) {
  9977. fromArgs.delta = delta;
  9978. }
  9979. }
  9980. }
  9981. }
  9982. };
  9983. var previewImage = {
  9984. args: function args(fromArgs) {
  9985. var currentIndex = parseInt(fromArgs.current);
  9986. if (isNaN(currentIndex)) {
  9987. return;
  9988. }
  9989. var urls = fromArgs.urls;
  9990. if (!Array.isArray(urls)) {
  9991. return;
  9992. }
  9993. var len = urls.length;
  9994. if (!len) {
  9995. return;
  9996. }
  9997. if (currentIndex < 0) {
  9998. currentIndex = 0;
  9999. } else if (currentIndex >= len) {
  10000. currentIndex = len - 1;
  10001. }
  10002. if (currentIndex > 0) {
  10003. fromArgs.current = urls[currentIndex];
  10004. fromArgs.urls = urls.filter(function (item, index) {
  10005. return index < currentIndex ? item !== urls[currentIndex] : true;
  10006. });
  10007. } else {
  10008. fromArgs.current = urls[0];
  10009. }
  10010. return {
  10011. indicator: false,
  10012. loop: false
  10013. };
  10014. }
  10015. };
  10016. var UUID_KEY = '__DC_STAT_UUID';
  10017. var deviceId;
  10018. function useDeviceId(result) {
  10019. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  10020. if (!deviceId) {
  10021. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  10022. wx.setStorage({
  10023. key: UUID_KEY,
  10024. data: deviceId
  10025. });
  10026. }
  10027. result.deviceId = deviceId;
  10028. }
  10029. function addSafeAreaInsets(result) {
  10030. if (result.safeArea) {
  10031. var safeArea = result.safeArea;
  10032. result.safeAreaInsets = {
  10033. top: safeArea.top,
  10034. left: safeArea.left,
  10035. right: result.windowWidth - safeArea.right,
  10036. bottom: result.screenHeight - safeArea.bottom
  10037. };
  10038. }
  10039. }
  10040. function populateParameters(result) {
  10041. var _result$brand = result.brand,
  10042. brand = _result$brand === void 0 ? '' : _result$brand,
  10043. _result$model = result.model,
  10044. model = _result$model === void 0 ? '' : _result$model,
  10045. _result$system = result.system,
  10046. system = _result$system === void 0 ? '' : _result$system,
  10047. _result$language = result.language,
  10048. language = _result$language === void 0 ? '' : _result$language,
  10049. theme = result.theme,
  10050. version = result.version,
  10051. platform = result.platform,
  10052. fontSizeSetting = result.fontSizeSetting,
  10053. SDKVersion = result.SDKVersion,
  10054. pixelRatio = result.pixelRatio,
  10055. deviceOrientation = result.deviceOrientation;
  10056. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  10057. // osName osVersion
  10058. var osName = '';
  10059. var osVersion = '';
  10060. {
  10061. osName = system.split(' ')[0] || '';
  10062. osVersion = system.split(' ')[1] || '';
  10063. }
  10064. var hostVersion = version;
  10065. // deviceType
  10066. var deviceType = getGetDeviceType(result, model);
  10067. // deviceModel
  10068. var deviceBrand = getDeviceBrand(brand);
  10069. // hostName
  10070. var _hostName = getHostName(result);
  10071. // deviceOrientation
  10072. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  10073. // devicePixelRatio
  10074. var _devicePixelRatio = pixelRatio;
  10075. // SDKVersion
  10076. var _SDKVersion = SDKVersion;
  10077. // hostLanguage
  10078. var hostLanguage = language.replace(/_/g, '-');
  10079. // wx.getAccountInfoSync
  10080. var parameters = {
  10081. appId: "__UNI__2080341",
  10082. appName: "益智游戏",
  10083. appVersion: "1.1.1",
  10084. appVersionCode: "111",
  10085. appLanguage: getAppLanguage(hostLanguage),
  10086. uniCompileVersion: "3.6.18",
  10087. uniRuntimeVersion: "3.6.18",
  10088. uniPlatform: undefined || "mp-weixin",
  10089. deviceBrand: deviceBrand,
  10090. deviceModel: model,
  10091. deviceType: deviceType,
  10092. devicePixelRatio: _devicePixelRatio,
  10093. deviceOrientation: _deviceOrientation,
  10094. osName: osName.toLocaleLowerCase(),
  10095. osVersion: osVersion,
  10096. hostTheme: theme,
  10097. hostVersion: hostVersion,
  10098. hostLanguage: hostLanguage,
  10099. hostName: _hostName,
  10100. hostSDKVersion: _SDKVersion,
  10101. hostFontSizeSetting: fontSizeSetting,
  10102. windowTop: 0,
  10103. windowBottom: 0,
  10104. // TODO
  10105. osLanguage: undefined,
  10106. osTheme: undefined,
  10107. ua: undefined,
  10108. hostPackageName: undefined,
  10109. browserName: undefined,
  10110. browserVersion: undefined
  10111. };
  10112. Object.assign(result, parameters);
  10113. }
  10114. function getGetDeviceType(result, model) {
  10115. var deviceType = result.deviceType || 'phone';
  10116. {
  10117. var deviceTypeMaps = {
  10118. ipad: 'pad',
  10119. windows: 'pc',
  10120. mac: 'pc'
  10121. };
  10122. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  10123. var _model = model.toLocaleLowerCase();
  10124. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  10125. var _m = deviceTypeMapsKeys[index];
  10126. if (_model.indexOf(_m) !== -1) {
  10127. deviceType = deviceTypeMaps[_m];
  10128. break;
  10129. }
  10130. }
  10131. }
  10132. return deviceType;
  10133. }
  10134. function getDeviceBrand(brand) {
  10135. var deviceBrand = brand;
  10136. if (deviceBrand) {
  10137. deviceBrand = brand.toLocaleLowerCase();
  10138. }
  10139. return deviceBrand;
  10140. }
  10141. function getAppLanguage(defaultLanguage) {
  10142. return getLocale$1 ? getLocale$1() : defaultLanguage;
  10143. }
  10144. function getHostName(result) {
  10145. var _platform = 'WeChat';
  10146. var _hostName = result.hostName || _platform; // mp-jd
  10147. {
  10148. if (result.environment) {
  10149. _hostName = result.environment;
  10150. } else if (result.host && result.host.env) {
  10151. _hostName = result.host.env;
  10152. }
  10153. }
  10154. return _hostName;
  10155. }
  10156. var getSystemInfo = {
  10157. returnValue: function returnValue(result) {
  10158. useDeviceId(result);
  10159. addSafeAreaInsets(result);
  10160. populateParameters(result);
  10161. }
  10162. };
  10163. var showActionSheet = {
  10164. args: function args(fromArgs) {
  10165. if ((0, _typeof2.default)(fromArgs) === 'object') {
  10166. fromArgs.alertText = fromArgs.title;
  10167. }
  10168. }
  10169. };
  10170. var getAppBaseInfo = {
  10171. returnValue: function returnValue(result) {
  10172. var _result = result,
  10173. version = _result.version,
  10174. language = _result.language,
  10175. SDKVersion = _result.SDKVersion,
  10176. theme = _result.theme;
  10177. var _hostName = getHostName(result);
  10178. var hostLanguage = language.replace('_', '-');
  10179. result = sortObject(Object.assign(result, {
  10180. appId: "__UNI__2080341",
  10181. appName: "益智游戏",
  10182. appVersion: "1.1.1",
  10183. appVersionCode: "111",
  10184. appLanguage: getAppLanguage(hostLanguage),
  10185. hostVersion: version,
  10186. hostLanguage: hostLanguage,
  10187. hostName: _hostName,
  10188. hostSDKVersion: SDKVersion,
  10189. hostTheme: theme
  10190. }));
  10191. }
  10192. };
  10193. var getDeviceInfo = {
  10194. returnValue: function returnValue(result) {
  10195. var _result2 = result,
  10196. brand = _result2.brand,
  10197. model = _result2.model;
  10198. var deviceType = getGetDeviceType(result, model);
  10199. var deviceBrand = getDeviceBrand(brand);
  10200. useDeviceId(result);
  10201. result = sortObject(Object.assign(result, {
  10202. deviceType: deviceType,
  10203. deviceBrand: deviceBrand,
  10204. deviceModel: model
  10205. }));
  10206. }
  10207. };
  10208. var getWindowInfo = {
  10209. returnValue: function returnValue(result) {
  10210. addSafeAreaInsets(result);
  10211. result = sortObject(Object.assign(result, {
  10212. windowTop: 0,
  10213. windowBottom: 0
  10214. }));
  10215. }
  10216. };
  10217. var getAppAuthorizeSetting = {
  10218. returnValue: function returnValue(result) {
  10219. var locationReducedAccuracy = result.locationReducedAccuracy;
  10220. result.locationAccuracy = 'unsupported';
  10221. if (locationReducedAccuracy === true) {
  10222. result.locationAccuracy = 'reduced';
  10223. } else if (locationReducedAccuracy === false) {
  10224. result.locationAccuracy = 'full';
  10225. }
  10226. }
  10227. };
  10228. // import navigateTo from 'uni-helpers/navigate-to'
  10229. var protocols = {
  10230. redirectTo: redirectTo,
  10231. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  10232. previewImage: previewImage,
  10233. getSystemInfo: getSystemInfo,
  10234. getSystemInfoSync: getSystemInfo,
  10235. showActionSheet: showActionSheet,
  10236. getAppBaseInfo: getAppBaseInfo,
  10237. getDeviceInfo: getDeviceInfo,
  10238. getWindowInfo: getWindowInfo,
  10239. getAppAuthorizeSetting: getAppAuthorizeSetting
  10240. };
  10241. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  10242. var canIUses = [];
  10243. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  10244. function processCallback(methodName, method, returnValue) {
  10245. return function (res) {
  10246. return method(processReturnValue(methodName, res, returnValue));
  10247. };
  10248. }
  10249. function processArgs(methodName, fromArgs) {
  10250. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10251. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  10252. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  10253. if (isPlainObject(fromArgs)) {
  10254. // 一般 api 的参数解析
  10255. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  10256. if (isFn(argsOption)) {
  10257. argsOption = argsOption(fromArgs, toArgs) || {};
  10258. }
  10259. for (var key in fromArgs) {
  10260. if (hasOwn(argsOption, key)) {
  10261. var keyOption = argsOption[key];
  10262. if (isFn(keyOption)) {
  10263. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  10264. }
  10265. if (!keyOption) {
  10266. // 不支持的参数
  10267. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  10268. } else if (isStr(keyOption)) {
  10269. // 重写参数 key
  10270. toArgs[keyOption] = fromArgs[key];
  10271. } else if (isPlainObject(keyOption)) {
  10272. // {name:newName,value:value}可重新指定参数 key:value
  10273. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  10274. }
  10275. } else if (CALLBACKS.indexOf(key) !== -1) {
  10276. if (isFn(fromArgs[key])) {
  10277. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  10278. }
  10279. } else {
  10280. if (!keepFromArgs) {
  10281. toArgs[key] = fromArgs[key];
  10282. }
  10283. }
  10284. }
  10285. return toArgs;
  10286. } else if (isFn(fromArgs)) {
  10287. fromArgs = processCallback(methodName, fromArgs, returnValue);
  10288. }
  10289. return fromArgs;
  10290. }
  10291. function processReturnValue(methodName, res, returnValue) {
  10292. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  10293. if (isFn(protocols.returnValue)) {
  10294. // 处理通用 returnValue
  10295. res = protocols.returnValue(methodName, res);
  10296. }
  10297. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  10298. }
  10299. function wrapper(methodName, method) {
  10300. if (hasOwn(protocols, methodName)) {
  10301. var protocol = protocols[methodName];
  10302. if (!protocol) {
  10303. // 暂不支持的 api
  10304. return function () {
  10305. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  10306. };
  10307. }
  10308. return function (arg1, arg2) {
  10309. // 目前 api 最多两个参数
  10310. var options = protocol;
  10311. if (isFn(protocol)) {
  10312. options = protocol(arg1);
  10313. }
  10314. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  10315. var args = [arg1];
  10316. if (typeof arg2 !== 'undefined') {
  10317. args.push(arg2);
  10318. }
  10319. if (isFn(options.name)) {
  10320. methodName = options.name(arg1);
  10321. } else if (isStr(options.name)) {
  10322. methodName = options.name;
  10323. }
  10324. var returnValue = wx[methodName].apply(wx, args);
  10325. if (isSyncApi(methodName)) {
  10326. // 同步 api
  10327. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  10328. }
  10329. return returnValue;
  10330. };
  10331. }
  10332. return method;
  10333. }
  10334. var todoApis = Object.create(null);
  10335. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  10336. function createTodoApi(name) {
  10337. return function todoApi(_ref) {
  10338. var fail = _ref.fail,
  10339. complete = _ref.complete;
  10340. var res = {
  10341. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  10342. };
  10343. isFn(fail) && fail(res);
  10344. isFn(complete) && complete(res);
  10345. };
  10346. }
  10347. TODOS.forEach(function (name) {
  10348. todoApis[name] = createTodoApi(name);
  10349. });
  10350. var providers = {
  10351. oauth: ['weixin'],
  10352. share: ['weixin'],
  10353. payment: ['wxpay'],
  10354. push: ['weixin']
  10355. };
  10356. function getProvider(_ref2) {
  10357. var service = _ref2.service,
  10358. success = _ref2.success,
  10359. fail = _ref2.fail,
  10360. complete = _ref2.complete;
  10361. var res = false;
  10362. if (providers[service]) {
  10363. res = {
  10364. errMsg: 'getProvider:ok',
  10365. service: service,
  10366. provider: providers[service]
  10367. };
  10368. isFn(success) && success(res);
  10369. } else {
  10370. res = {
  10371. errMsg: 'getProvider:fail service not found'
  10372. };
  10373. isFn(fail) && fail(res);
  10374. }
  10375. isFn(complete) && complete(res);
  10376. }
  10377. var extraApi = /*#__PURE__*/Object.freeze({
  10378. __proto__: null,
  10379. getProvider: getProvider
  10380. });
  10381. var getEmitter = function () {
  10382. var Emitter;
  10383. return function getUniEmitter() {
  10384. if (!Emitter) {
  10385. Emitter = new _vue.default();
  10386. }
  10387. return Emitter;
  10388. };
  10389. }();
  10390. function apply(ctx, method, args) {
  10391. return ctx[method].apply(ctx, args);
  10392. }
  10393. function $on() {
  10394. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  10395. }
  10396. function $off() {
  10397. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  10398. }
  10399. function $once() {
  10400. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  10401. }
  10402. function $emit() {
  10403. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  10404. }
  10405. var eventApi = /*#__PURE__*/Object.freeze({
  10406. __proto__: null,
  10407. $on: $on,
  10408. $off: $off,
  10409. $once: $once,
  10410. $emit: $emit
  10411. });
  10412. /**
  10413. * 框架内 try-catch
  10414. */
  10415. /**
  10416. * 开发者 try-catch
  10417. */
  10418. function tryCatch(fn) {
  10419. return function () {
  10420. try {
  10421. return fn.apply(fn, arguments);
  10422. } catch (e) {
  10423. // TODO
  10424. console.error(e);
  10425. }
  10426. };
  10427. }
  10428. function getApiCallbacks(params) {
  10429. var apiCallbacks = {};
  10430. for (var name in params) {
  10431. var param = params[name];
  10432. if (isFn(param)) {
  10433. apiCallbacks[name] = tryCatch(param);
  10434. delete params[name];
  10435. }
  10436. }
  10437. return apiCallbacks;
  10438. }
  10439. var cid;
  10440. var cidErrMsg;
  10441. var enabled;
  10442. function normalizePushMessage(message) {
  10443. try {
  10444. return JSON.parse(message);
  10445. } catch (e) {}
  10446. return message;
  10447. }
  10448. function invokePushCallback(args) {
  10449. if (args.type === 'enabled') {
  10450. enabled = true;
  10451. } else if (args.type === 'clientId') {
  10452. cid = args.cid;
  10453. cidErrMsg = args.errMsg;
  10454. invokeGetPushCidCallbacks(cid, args.errMsg);
  10455. } else if (args.type === 'pushMsg') {
  10456. var message = {
  10457. type: 'receive',
  10458. data: normalizePushMessage(args.message)
  10459. };
  10460. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  10461. var callback = onPushMessageCallbacks[i];
  10462. callback(message);
  10463. // 该消息已被阻止
  10464. if (message.stopped) {
  10465. break;
  10466. }
  10467. }
  10468. } else if (args.type === 'click') {
  10469. onPushMessageCallbacks.forEach(function (callback) {
  10470. callback({
  10471. type: 'click',
  10472. data: normalizePushMessage(args.message)
  10473. });
  10474. });
  10475. }
  10476. }
  10477. var getPushCidCallbacks = [];
  10478. function invokeGetPushCidCallbacks(cid, errMsg) {
  10479. getPushCidCallbacks.forEach(function (callback) {
  10480. callback(cid, errMsg);
  10481. });
  10482. getPushCidCallbacks.length = 0;
  10483. }
  10484. function getPushClientId(args) {
  10485. if (!isPlainObject(args)) {
  10486. args = {};
  10487. }
  10488. var _getApiCallbacks = getApiCallbacks(args),
  10489. success = _getApiCallbacks.success,
  10490. fail = _getApiCallbacks.fail,
  10491. complete = _getApiCallbacks.complete;
  10492. var hasSuccess = isFn(success);
  10493. var hasFail = isFn(fail);
  10494. var hasComplete = isFn(complete);
  10495. Promise.resolve().then(function () {
  10496. if (typeof enabled === 'undefined') {
  10497. enabled = false;
  10498. cid = '';
  10499. cidErrMsg = 'uniPush is not enabled';
  10500. }
  10501. getPushCidCallbacks.push(function (cid, errMsg) {
  10502. var res;
  10503. if (cid) {
  10504. res = {
  10505. errMsg: 'getPushClientId:ok',
  10506. cid: cid
  10507. };
  10508. hasSuccess && success(res);
  10509. } else {
  10510. res = {
  10511. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  10512. };
  10513. hasFail && fail(res);
  10514. }
  10515. hasComplete && complete(res);
  10516. });
  10517. if (typeof cid !== 'undefined') {
  10518. invokeGetPushCidCallbacks(cid, cidErrMsg);
  10519. }
  10520. });
  10521. }
  10522. var onPushMessageCallbacks = [];
  10523. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  10524. var onPushMessage = function onPushMessage(fn) {
  10525. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  10526. onPushMessageCallbacks.push(fn);
  10527. }
  10528. };
  10529. var offPushMessage = function offPushMessage(fn) {
  10530. if (!fn) {
  10531. onPushMessageCallbacks.length = 0;
  10532. } else {
  10533. var index = onPushMessageCallbacks.indexOf(fn);
  10534. if (index > -1) {
  10535. onPushMessageCallbacks.splice(index, 1);
  10536. }
  10537. }
  10538. };
  10539. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  10540. if (!baseInfo) {
  10541. baseInfo = wx.getSystemInfoSync();
  10542. }
  10543. var host = baseInfo ? baseInfo.host : null;
  10544. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  10545. var api = /*#__PURE__*/Object.freeze({
  10546. __proto__: null,
  10547. shareVideoMessage: shareVideoMessage,
  10548. getPushClientId: getPushClientId,
  10549. onPushMessage: onPushMessage,
  10550. offPushMessage: offPushMessage,
  10551. invokePushCallback: invokePushCallback
  10552. });
  10553. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  10554. function findVmByVueId(vm, vuePid) {
  10555. var $children = vm.$children;
  10556. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  10557. for (var i = $children.length - 1; i >= 0; i--) {
  10558. var childVm = $children[i];
  10559. if (childVm.$scope._$vueId === vuePid) {
  10560. return childVm;
  10561. }
  10562. }
  10563. // 反向递归查找
  10564. var parentVm;
  10565. for (var _i = $children.length - 1; _i >= 0; _i--) {
  10566. parentVm = findVmByVueId($children[_i], vuePid);
  10567. if (parentVm) {
  10568. return parentVm;
  10569. }
  10570. }
  10571. }
  10572. function initBehavior(options) {
  10573. return Behavior(options);
  10574. }
  10575. function isPage() {
  10576. return !!this.route;
  10577. }
  10578. function initRelation(detail) {
  10579. this.triggerEvent('__l', detail);
  10580. }
  10581. function selectAllComponents(mpInstance, selector, $refs) {
  10582. var components = mpInstance.selectAllComponents(selector) || [];
  10583. components.forEach(function (component) {
  10584. var ref = component.dataset.ref;
  10585. $refs[ref] = component.$vm || toSkip(component);
  10586. {
  10587. if (component.dataset.vueGeneric === 'scoped') {
  10588. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  10589. selectAllComponents(scopedComponent, selector, $refs);
  10590. });
  10591. }
  10592. }
  10593. });
  10594. }
  10595. function syncRefs(refs, newRefs) {
  10596. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  10597. var newKeys = Object.keys(newRefs);
  10598. newKeys.forEach(function (key) {
  10599. var oldValue = refs[key];
  10600. var newValue = newRefs[key];
  10601. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  10602. return oldValue.includes(value);
  10603. })) {
  10604. return;
  10605. }
  10606. refs[key] = newValue;
  10607. oldKeys.delete(key);
  10608. });
  10609. oldKeys.forEach(function (key) {
  10610. delete refs[key];
  10611. });
  10612. return refs;
  10613. }
  10614. function initRefs(vm) {
  10615. var mpInstance = vm.$scope;
  10616. var refs = {};
  10617. Object.defineProperty(vm, '$refs', {
  10618. get: function get() {
  10619. var $refs = {};
  10620. selectAllComponents(mpInstance, '.vue-ref', $refs);
  10621. // TODO 暂不考虑 for 中的 scoped
  10622. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  10623. forComponents.forEach(function (component) {
  10624. var ref = component.dataset.ref;
  10625. if (!$refs[ref]) {
  10626. $refs[ref] = [];
  10627. }
  10628. $refs[ref].push(component.$vm || toSkip(component));
  10629. });
  10630. return syncRefs(refs, $refs);
  10631. }
  10632. });
  10633. }
  10634. function handleLink(event) {
  10635. var _ref3 = event.detail || event.value,
  10636. vuePid = _ref3.vuePid,
  10637. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  10638. var parentVm;
  10639. if (vuePid) {
  10640. parentVm = findVmByVueId(this.$vm, vuePid);
  10641. }
  10642. if (!parentVm) {
  10643. parentVm = this.$vm;
  10644. }
  10645. vueOptions.parent = parentVm;
  10646. }
  10647. function markMPComponent(component) {
  10648. // 在 Vue 中标记为小程序组件
  10649. var IS_MP = '__v_isMPComponent';
  10650. Object.defineProperty(component, IS_MP, {
  10651. configurable: true,
  10652. enumerable: false,
  10653. value: true
  10654. });
  10655. return component;
  10656. }
  10657. function toSkip(obj) {
  10658. var OB = '__ob__';
  10659. var SKIP = '__v_skip';
  10660. if (isObject(obj) && Object.isExtensible(obj)) {
  10661. // 避免被 @vue/composition-api 观测
  10662. Object.defineProperty(obj, OB, {
  10663. configurable: true,
  10664. enumerable: false,
  10665. value: (0, _defineProperty2.default)({}, SKIP, true)
  10666. });
  10667. }
  10668. return obj;
  10669. }
  10670. var MPPage = Page;
  10671. var MPComponent = Component;
  10672. var customizeRE = /:/g;
  10673. var customize = cached(function (str) {
  10674. return camelize(str.replace(customizeRE, '-'));
  10675. });
  10676. function initTriggerEvent(mpInstance) {
  10677. var oldTriggerEvent = mpInstance.triggerEvent;
  10678. var newTriggerEvent = function newTriggerEvent(event) {
  10679. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  10680. args[_key3 - 1] = arguments[_key3];
  10681. }
  10682. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  10683. if (this.$vm || this.dataset && this.dataset.comType) {
  10684. event = customize(event);
  10685. } else {
  10686. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  10687. var newEvent = customize(event);
  10688. if (newEvent !== event) {
  10689. oldTriggerEvent.apply(this, [newEvent].concat(args));
  10690. }
  10691. }
  10692. return oldTriggerEvent.apply(this, [event].concat(args));
  10693. };
  10694. try {
  10695. // 京东小程序 triggerEvent 为只读
  10696. mpInstance.triggerEvent = newTriggerEvent;
  10697. } catch (error) {
  10698. mpInstance._triggerEvent = newTriggerEvent;
  10699. }
  10700. }
  10701. function initHook(name, options, isComponent) {
  10702. var oldHook = options[name];
  10703. options[name] = function () {
  10704. markMPComponent(this);
  10705. initTriggerEvent(this);
  10706. if (oldHook) {
  10707. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  10708. args[_key4] = arguments[_key4];
  10709. }
  10710. return oldHook.apply(this, args);
  10711. }
  10712. };
  10713. }
  10714. if (!MPPage.__$wrappered) {
  10715. MPPage.__$wrappered = true;
  10716. Page = function Page() {
  10717. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10718. initHook('onLoad', options);
  10719. return MPPage(options);
  10720. };
  10721. Page.after = MPPage.after;
  10722. Component = function Component() {
  10723. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10724. initHook('created', options);
  10725. return MPComponent(options);
  10726. };
  10727. }
  10728. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  10729. function initMocks(vm, mocks) {
  10730. var mpInstance = vm.$mp[vm.mpType];
  10731. mocks.forEach(function (mock) {
  10732. if (hasOwn(mpInstance, mock)) {
  10733. vm[mock] = mpInstance[mock];
  10734. }
  10735. });
  10736. }
  10737. function hasHook(hook, vueOptions) {
  10738. if (!vueOptions) {
  10739. return true;
  10740. }
  10741. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  10742. return true;
  10743. }
  10744. vueOptions = vueOptions.default || vueOptions;
  10745. if (isFn(vueOptions)) {
  10746. if (isFn(vueOptions.extendOptions[hook])) {
  10747. return true;
  10748. }
  10749. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  10750. return true;
  10751. }
  10752. return false;
  10753. }
  10754. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  10755. return true;
  10756. }
  10757. var mixins = vueOptions.mixins;
  10758. if (Array.isArray(mixins)) {
  10759. return !!mixins.find(function (mixin) {
  10760. return hasHook(hook, mixin);
  10761. });
  10762. }
  10763. }
  10764. function initHooks(mpOptions, hooks, vueOptions) {
  10765. hooks.forEach(function (hook) {
  10766. if (hasHook(hook, vueOptions)) {
  10767. mpOptions[hook] = function (args) {
  10768. return this.$vm && this.$vm.__call_hook(hook, args);
  10769. };
  10770. }
  10771. });
  10772. }
  10773. function initUnknownHooks(mpOptions, vueOptions) {
  10774. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  10775. findHooks(vueOptions).forEach(function (hook) {
  10776. return initHook$1(mpOptions, hook, excludes);
  10777. });
  10778. }
  10779. function findHooks(vueOptions) {
  10780. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  10781. if (vueOptions) {
  10782. Object.keys(vueOptions).forEach(function (name) {
  10783. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  10784. hooks.push(name);
  10785. }
  10786. });
  10787. }
  10788. return hooks;
  10789. }
  10790. function initHook$1(mpOptions, hook, excludes) {
  10791. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  10792. mpOptions[hook] = function (args) {
  10793. return this.$vm && this.$vm.__call_hook(hook, args);
  10794. };
  10795. }
  10796. }
  10797. function initVueComponent(Vue, vueOptions) {
  10798. vueOptions = vueOptions.default || vueOptions;
  10799. var VueComponent;
  10800. if (isFn(vueOptions)) {
  10801. VueComponent = vueOptions;
  10802. } else {
  10803. VueComponent = Vue.extend(vueOptions);
  10804. }
  10805. vueOptions = VueComponent.options;
  10806. return [VueComponent, vueOptions];
  10807. }
  10808. function initSlots(vm, vueSlots) {
  10809. if (Array.isArray(vueSlots) && vueSlots.length) {
  10810. var $slots = Object.create(null);
  10811. vueSlots.forEach(function (slotName) {
  10812. $slots[slotName] = true;
  10813. });
  10814. vm.$scopedSlots = vm.$slots = $slots;
  10815. }
  10816. }
  10817. function initVueIds(vueIds, mpInstance) {
  10818. vueIds = (vueIds || '').split(',');
  10819. var len = vueIds.length;
  10820. if (len === 1) {
  10821. mpInstance._$vueId = vueIds[0];
  10822. } else if (len === 2) {
  10823. mpInstance._$vueId = vueIds[0];
  10824. mpInstance._$vuePid = vueIds[1];
  10825. }
  10826. }
  10827. function initData(vueOptions, context) {
  10828. var data = vueOptions.data || {};
  10829. var methods = vueOptions.methods || {};
  10830. if (typeof data === 'function') {
  10831. try {
  10832. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  10833. } catch (e) {
  10834. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  10835. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  10836. }
  10837. }
  10838. } else {
  10839. try {
  10840. // 对 data 格式化
  10841. data = JSON.parse(JSON.stringify(data));
  10842. } catch (e) {}
  10843. }
  10844. if (!isPlainObject(data)) {
  10845. data = {};
  10846. }
  10847. Object.keys(methods).forEach(function (methodName) {
  10848. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  10849. data[methodName] = methods[methodName];
  10850. }
  10851. });
  10852. return data;
  10853. }
  10854. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  10855. function createObserver(name) {
  10856. return function observer(newVal, oldVal) {
  10857. if (this.$vm) {
  10858. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  10859. }
  10860. };
  10861. }
  10862. function initBehaviors(vueOptions, initBehavior) {
  10863. var vueBehaviors = vueOptions.behaviors;
  10864. var vueExtends = vueOptions.extends;
  10865. var vueMixins = vueOptions.mixins;
  10866. var vueProps = vueOptions.props;
  10867. if (!vueProps) {
  10868. vueOptions.props = vueProps = [];
  10869. }
  10870. var behaviors = [];
  10871. if (Array.isArray(vueBehaviors)) {
  10872. vueBehaviors.forEach(function (behavior) {
  10873. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  10874. if (behavior === 'uni://form-field') {
  10875. if (Array.isArray(vueProps)) {
  10876. vueProps.push('name');
  10877. vueProps.push('value');
  10878. } else {
  10879. vueProps.name = {
  10880. type: String,
  10881. default: ''
  10882. };
  10883. vueProps.value = {
  10884. type: [String, Number, Boolean, Array, Object, Date],
  10885. default: ''
  10886. };
  10887. }
  10888. }
  10889. });
  10890. }
  10891. if (isPlainObject(vueExtends) && vueExtends.props) {
  10892. behaviors.push(initBehavior({
  10893. properties: initProperties(vueExtends.props, true)
  10894. }));
  10895. }
  10896. if (Array.isArray(vueMixins)) {
  10897. vueMixins.forEach(function (vueMixin) {
  10898. if (isPlainObject(vueMixin) && vueMixin.props) {
  10899. behaviors.push(initBehavior({
  10900. properties: initProperties(vueMixin.props, true)
  10901. }));
  10902. }
  10903. });
  10904. }
  10905. return behaviors;
  10906. }
  10907. function parsePropType(key, type, defaultValue, file) {
  10908. // [String]=>String
  10909. if (Array.isArray(type) && type.length === 1) {
  10910. return type[0];
  10911. }
  10912. return type;
  10913. }
  10914. function initProperties(props) {
  10915. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  10916. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  10917. var options = arguments.length > 3 ? arguments[3] : undefined;
  10918. var properties = {};
  10919. if (!isBehavior) {
  10920. properties.vueId = {
  10921. type: String,
  10922. value: ''
  10923. };
  10924. {
  10925. if (options.virtualHost) {
  10926. properties.virtualHostStyle = {
  10927. type: null,
  10928. value: ''
  10929. };
  10930. properties.virtualHostClass = {
  10931. type: null,
  10932. value: ''
  10933. };
  10934. }
  10935. }
  10936. // scopedSlotsCompiler auto
  10937. properties.scopedSlotsCompiler = {
  10938. type: String,
  10939. value: ''
  10940. };
  10941. properties.vueSlots = {
  10942. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  10943. type: null,
  10944. value: [],
  10945. observer: function observer(newVal, oldVal) {
  10946. var $slots = Object.create(null);
  10947. newVal.forEach(function (slotName) {
  10948. $slots[slotName] = true;
  10949. });
  10950. this.setData({
  10951. $slots: $slots
  10952. });
  10953. }
  10954. };
  10955. }
  10956. if (Array.isArray(props)) {
  10957. // ['title']
  10958. props.forEach(function (key) {
  10959. properties[key] = {
  10960. type: null,
  10961. observer: createObserver(key)
  10962. };
  10963. });
  10964. } else if (isPlainObject(props)) {
  10965. // {title:{type:String,default:''},content:String}
  10966. Object.keys(props).forEach(function (key) {
  10967. var opts = props[key];
  10968. if (isPlainObject(opts)) {
  10969. // title:{type:String,default:''}
  10970. var value = opts.default;
  10971. if (isFn(value)) {
  10972. value = value();
  10973. }
  10974. opts.type = parsePropType(key, opts.type);
  10975. properties[key] = {
  10976. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  10977. value: value,
  10978. observer: createObserver(key)
  10979. };
  10980. } else {
  10981. // content:String
  10982. var type = parsePropType(key, opts);
  10983. properties[key] = {
  10984. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  10985. observer: createObserver(key)
  10986. };
  10987. }
  10988. });
  10989. }
  10990. return properties;
  10991. }
  10992. function wrapper$1(event) {
  10993. // TODO 又得兼容 mpvue 的 mp 对象
  10994. try {
  10995. event.mp = JSON.parse(JSON.stringify(event));
  10996. } catch (e) {}
  10997. event.stopPropagation = noop;
  10998. event.preventDefault = noop;
  10999. event.target = event.target || {};
  11000. if (!hasOwn(event, 'detail')) {
  11001. event.detail = {};
  11002. }
  11003. if (hasOwn(event, 'markerId')) {
  11004. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  11005. event.detail.markerId = event.markerId;
  11006. }
  11007. if (isPlainObject(event.detail)) {
  11008. event.target = Object.assign({}, event.target, event.detail);
  11009. }
  11010. return event;
  11011. }
  11012. function getExtraValue(vm, dataPathsArray) {
  11013. var context = vm;
  11014. dataPathsArray.forEach(function (dataPathArray) {
  11015. var dataPath = dataPathArray[0];
  11016. var value = dataPathArray[2];
  11017. if (dataPath || typeof value !== 'undefined') {
  11018. // ['','',index,'disable']
  11019. var propPath = dataPathArray[1];
  11020. var valuePath = dataPathArray[3];
  11021. var vFor;
  11022. if (Number.isInteger(dataPath)) {
  11023. vFor = dataPath;
  11024. } else if (!dataPath) {
  11025. vFor = context;
  11026. } else if (typeof dataPath === 'string' && dataPath) {
  11027. if (dataPath.indexOf('#s#') === 0) {
  11028. vFor = dataPath.substr(3);
  11029. } else {
  11030. vFor = vm.__get_value(dataPath, context);
  11031. }
  11032. }
  11033. if (Number.isInteger(vFor)) {
  11034. context = value;
  11035. } else if (!propPath) {
  11036. context = vFor[value];
  11037. } else {
  11038. if (Array.isArray(vFor)) {
  11039. context = vFor.find(function (vForItem) {
  11040. return vm.__get_value(propPath, vForItem) === value;
  11041. });
  11042. } else if (isPlainObject(vFor)) {
  11043. context = Object.keys(vFor).find(function (vForKey) {
  11044. return vm.__get_value(propPath, vFor[vForKey]) === value;
  11045. });
  11046. } else {
  11047. console.error('v-for 暂不支持循环数据:', vFor);
  11048. }
  11049. }
  11050. if (valuePath) {
  11051. context = vm.__get_value(valuePath, context);
  11052. }
  11053. }
  11054. });
  11055. return context;
  11056. }
  11057. function processEventExtra(vm, extra, event, __args__) {
  11058. var extraObj = {};
  11059. if (Array.isArray(extra) && extra.length) {
  11060. /**
  11061. *[
  11062. * ['data.items', 'data.id', item.data.id],
  11063. * ['metas', 'id', meta.id]
  11064. *],
  11065. *[
  11066. * ['data.items', 'data.id', item.data.id],
  11067. * ['metas', 'id', meta.id]
  11068. *],
  11069. *'test'
  11070. */
  11071. extra.forEach(function (dataPath, index) {
  11072. if (typeof dataPath === 'string') {
  11073. if (!dataPath) {
  11074. // model,prop.sync
  11075. extraObj['$' + index] = vm;
  11076. } else {
  11077. if (dataPath === '$event') {
  11078. // $event
  11079. extraObj['$' + index] = event;
  11080. } else if (dataPath === 'arguments') {
  11081. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  11082. } else if (dataPath.indexOf('$event.') === 0) {
  11083. // $event.target.value
  11084. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  11085. } else {
  11086. extraObj['$' + index] = vm.__get_value(dataPath);
  11087. }
  11088. }
  11089. } else {
  11090. extraObj['$' + index] = getExtraValue(vm, dataPath);
  11091. }
  11092. });
  11093. }
  11094. return extraObj;
  11095. }
  11096. function getObjByArray(arr) {
  11097. var obj = {};
  11098. for (var i = 1; i < arr.length; i++) {
  11099. var element = arr[i];
  11100. obj[element[0]] = element[1];
  11101. }
  11102. return obj;
  11103. }
  11104. function processEventArgs(vm, event) {
  11105. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  11106. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  11107. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  11108. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  11109. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  11110. // fixed 用户直接触发 mpInstance.triggerEvent
  11111. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  11112. if (isCustom) {
  11113. // 自定义事件
  11114. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  11115. if (!args.length) {
  11116. // 无参数,直接传入 event 或 detail 数组
  11117. if (isCustomMPEvent) {
  11118. return [event];
  11119. }
  11120. return __args__;
  11121. }
  11122. }
  11123. var extraObj = processEventExtra(vm, extra, event, __args__);
  11124. var ret = [];
  11125. args.forEach(function (arg) {
  11126. if (arg === '$event') {
  11127. if (methodName === '__set_model' && !isCustom) {
  11128. // input v-model value
  11129. ret.push(event.target.value);
  11130. } else {
  11131. if (isCustom && !isCustomMPEvent) {
  11132. ret.push(__args__[0]);
  11133. } else {
  11134. // wxcomponent 组件或内置组件
  11135. ret.push(event);
  11136. }
  11137. }
  11138. } else {
  11139. if (Array.isArray(arg) && arg[0] === 'o') {
  11140. ret.push(getObjByArray(arg));
  11141. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  11142. ret.push(extraObj[arg]);
  11143. } else {
  11144. ret.push(arg);
  11145. }
  11146. }
  11147. });
  11148. return ret;
  11149. }
  11150. var ONCE = '~';
  11151. var CUSTOM = '^';
  11152. function isMatchEventType(eventType, optType) {
  11153. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  11154. }
  11155. function getContextVm(vm) {
  11156. var $parent = vm.$parent;
  11157. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  11158. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  11159. $parent = $parent.$parent;
  11160. }
  11161. return $parent && $parent.$parent;
  11162. }
  11163. function handleEvent(event) {
  11164. var _this2 = this;
  11165. event = wrapper$1(event);
  11166. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  11167. var dataset = (event.currentTarget || event.target).dataset;
  11168. if (!dataset) {
  11169. return console.warn('事件信息不存在');
  11170. }
  11171. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  11172. if (!eventOpts) {
  11173. return console.warn('事件信息不存在');
  11174. }
  11175. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  11176. var eventType = event.type;
  11177. var ret = [];
  11178. eventOpts.forEach(function (eventOpt) {
  11179. var type = eventOpt[0];
  11180. var eventsArray = eventOpt[1];
  11181. var isCustom = type.charAt(0) === CUSTOM;
  11182. type = isCustom ? type.slice(1) : type;
  11183. var isOnce = type.charAt(0) === ONCE;
  11184. type = isOnce ? type.slice(1) : type;
  11185. if (eventsArray && isMatchEventType(eventType, type)) {
  11186. eventsArray.forEach(function (eventArray) {
  11187. var methodName = eventArray[0];
  11188. if (methodName) {
  11189. var handlerCtx = _this2.$vm;
  11190. if (handlerCtx.$options.generic) {
  11191. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  11192. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  11193. }
  11194. if (methodName === '$emit') {
  11195. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  11196. return;
  11197. }
  11198. var handler = handlerCtx[methodName];
  11199. if (!isFn(handler)) {
  11200. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  11201. var path = _this2.route || _this2.is;
  11202. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  11203. }
  11204. if (isOnce) {
  11205. if (handler.once) {
  11206. return;
  11207. }
  11208. handler.once = true;
  11209. }
  11210. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  11211. params = Array.isArray(params) ? params : [];
  11212. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  11213. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  11214. // eslint-disable-next-line no-sparse-arrays
  11215. params = params.concat([,,,,,,,,,, event]);
  11216. }
  11217. ret.push(handler.apply(handlerCtx, params));
  11218. }
  11219. });
  11220. }
  11221. });
  11222. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  11223. return ret[0];
  11224. }
  11225. }
  11226. var eventChannels = {};
  11227. var eventChannelStack = [];
  11228. function getEventChannel(id) {
  11229. if (id) {
  11230. var eventChannel = eventChannels[id];
  11231. delete eventChannels[id];
  11232. return eventChannel;
  11233. }
  11234. return eventChannelStack.shift();
  11235. }
  11236. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  11237. function initEventChannel() {
  11238. _vue.default.prototype.getOpenerEventChannel = function () {
  11239. // 微信小程序使用自身getOpenerEventChannel
  11240. {
  11241. return this.$scope.getOpenerEventChannel();
  11242. }
  11243. };
  11244. var callHook = _vue.default.prototype.__call_hook;
  11245. _vue.default.prototype.__call_hook = function (hook, args) {
  11246. if (hook === 'onLoad' && args && args.__id__) {
  11247. this.__eventChannel__ = getEventChannel(args.__id__);
  11248. delete args.__id__;
  11249. }
  11250. return callHook.call(this, hook, args);
  11251. };
  11252. }
  11253. function initScopedSlotsParams() {
  11254. var center = {};
  11255. var parents = {};
  11256. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  11257. var has = center[vueId];
  11258. if (!has) {
  11259. parents[vueId] = this;
  11260. this.$on('hook:destroyed', function () {
  11261. delete parents[vueId];
  11262. });
  11263. }
  11264. return has;
  11265. };
  11266. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  11267. var data = center[vueId];
  11268. if (data) {
  11269. var object = data[name] || {};
  11270. return key ? object[key] : object;
  11271. } else {
  11272. parents[vueId] = this;
  11273. this.$on('hook:destroyed', function () {
  11274. delete parents[vueId];
  11275. });
  11276. }
  11277. };
  11278. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  11279. var vueIds = this.$options.propsData.vueId;
  11280. if (vueIds) {
  11281. var vueId = vueIds.split(',')[0];
  11282. var object = center[vueId] = center[vueId] || {};
  11283. object[name] = value;
  11284. if (parents[vueId]) {
  11285. parents[vueId].$forceUpdate();
  11286. }
  11287. }
  11288. };
  11289. _vue.default.mixin({
  11290. destroyed: function destroyed() {
  11291. var propsData = this.$options.propsData;
  11292. var vueId = propsData && propsData.vueId;
  11293. if (vueId) {
  11294. delete center[vueId];
  11295. delete parents[vueId];
  11296. }
  11297. }
  11298. });
  11299. }
  11300. function parseBaseApp(vm, _ref4) {
  11301. var mocks = _ref4.mocks,
  11302. initRefs = _ref4.initRefs;
  11303. initEventChannel();
  11304. {
  11305. initScopedSlotsParams();
  11306. }
  11307. if (vm.$options.store) {
  11308. _vue.default.prototype.$store = vm.$options.store;
  11309. }
  11310. uniIdMixin(_vue.default);
  11311. _vue.default.prototype.mpHost = "mp-weixin";
  11312. _vue.default.mixin({
  11313. beforeCreate: function beforeCreate() {
  11314. if (!this.$options.mpType) {
  11315. return;
  11316. }
  11317. this.mpType = this.$options.mpType;
  11318. this.$mp = (0, _defineProperty2.default)({
  11319. data: {}
  11320. }, this.mpType, this.$options.mpInstance);
  11321. this.$scope = this.$options.mpInstance;
  11322. delete this.$options.mpType;
  11323. delete this.$options.mpInstance;
  11324. if (this.mpType === 'page' && typeof getApp === 'function') {
  11325. // hack vue-i18n
  11326. var app = getApp();
  11327. if (app.$vm && app.$vm.$i18n) {
  11328. this._i18n = app.$vm.$i18n;
  11329. }
  11330. }
  11331. if (this.mpType !== 'app') {
  11332. initRefs(this);
  11333. initMocks(this, mocks);
  11334. }
  11335. }
  11336. });
  11337. var appOptions = {
  11338. onLaunch: function onLaunch(args) {
  11339. if (this.$vm) {
  11340. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  11341. return;
  11342. }
  11343. {
  11344. if (wx.canIUse && !wx.canIUse('nextTick')) {
  11345. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  11346. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  11347. }
  11348. }
  11349. this.$vm = vm;
  11350. this.$vm.$mp = {
  11351. app: this
  11352. };
  11353. this.$vm.$scope = this;
  11354. // vm 上也挂载 globalData
  11355. this.$vm.globalData = this.globalData;
  11356. this.$vm._isMounted = true;
  11357. this.$vm.__call_hook('mounted', args);
  11358. this.$vm.__call_hook('onLaunch', args);
  11359. }
  11360. };
  11361. // 兼容旧版本 globalData
  11362. appOptions.globalData = vm.$options.globalData || {};
  11363. // 将 methods 中的方法挂在 getApp() 中
  11364. var methods = vm.$options.methods;
  11365. if (methods) {
  11366. Object.keys(methods).forEach(function (name) {
  11367. appOptions[name] = methods[name];
  11368. });
  11369. }
  11370. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  11371. initHooks(appOptions, hooks);
  11372. initUnknownHooks(appOptions, vm.$options);
  11373. return appOptions;
  11374. }
  11375. function parseApp(vm) {
  11376. return parseBaseApp(vm, {
  11377. mocks: mocks,
  11378. initRefs: initRefs
  11379. });
  11380. }
  11381. function createApp(vm) {
  11382. App(parseApp(vm));
  11383. return vm;
  11384. }
  11385. var encodeReserveRE = /[!'()*]/g;
  11386. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  11387. return '%' + c.charCodeAt(0).toString(16);
  11388. };
  11389. var commaRE = /%2C/g;
  11390. // fixed encodeURIComponent which is more conformant to RFC3986:
  11391. // - escapes [!'()*]
  11392. // - preserve commas
  11393. var encode = function encode(str) {
  11394. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  11395. };
  11396. function stringifyQuery(obj) {
  11397. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  11398. var res = obj ? Object.keys(obj).map(function (key) {
  11399. var val = obj[key];
  11400. if (val === undefined) {
  11401. return '';
  11402. }
  11403. if (val === null) {
  11404. return encodeStr(key);
  11405. }
  11406. if (Array.isArray(val)) {
  11407. var result = [];
  11408. val.forEach(function (val2) {
  11409. if (val2 === undefined) {
  11410. return;
  11411. }
  11412. if (val2 === null) {
  11413. result.push(encodeStr(key));
  11414. } else {
  11415. result.push(encodeStr(key) + '=' + encodeStr(val2));
  11416. }
  11417. });
  11418. return result.join('&');
  11419. }
  11420. return encodeStr(key) + '=' + encodeStr(val);
  11421. }).filter(function (x) {
  11422. return x.length > 0;
  11423. }).join('&') : null;
  11424. return res ? "?".concat(res) : '';
  11425. }
  11426. function parseBaseComponent(vueComponentOptions) {
  11427. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  11428. isPage = _ref5.isPage,
  11429. initRelation = _ref5.initRelation;
  11430. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  11431. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  11432. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  11433. VueComponent = _initVueComponent2[0],
  11434. vueOptions = _initVueComponent2[1];
  11435. var options = _objectSpread({
  11436. multipleSlots: true,
  11437. addGlobalClass: true
  11438. }, vueOptions.options || {});
  11439. {
  11440. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  11441. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  11442. Object.assign(options, vueOptions['mp-weixin'].options);
  11443. }
  11444. }
  11445. var componentOptions = {
  11446. options: options,
  11447. data: initData(vueOptions, _vue.default.prototype),
  11448. behaviors: initBehaviors(vueOptions, initBehavior),
  11449. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  11450. lifetimes: {
  11451. attached: function attached() {
  11452. var properties = this.properties;
  11453. var options = {
  11454. mpType: isPage.call(this) ? 'page' : 'component',
  11455. mpInstance: this,
  11456. propsData: properties
  11457. };
  11458. initVueIds(properties.vueId, this);
  11459. // 处理父子关系
  11460. initRelation.call(this, {
  11461. vuePid: this._$vuePid,
  11462. vueOptions: options
  11463. });
  11464. // 初始化 vue 实例
  11465. this.$vm = new VueComponent(options);
  11466. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  11467. initSlots(this.$vm, properties.vueSlots);
  11468. // 触发首次 setData
  11469. this.$vm.$mount();
  11470. },
  11471. ready: function ready() {
  11472. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  11473. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  11474. if (this.$vm) {
  11475. this.$vm._isMounted = true;
  11476. this.$vm.__call_hook('mounted');
  11477. this.$vm.__call_hook('onReady');
  11478. }
  11479. },
  11480. detached: function detached() {
  11481. this.$vm && this.$vm.$destroy();
  11482. }
  11483. },
  11484. pageLifetimes: {
  11485. show: function show(args) {
  11486. this.$vm && this.$vm.__call_hook('onPageShow', args);
  11487. },
  11488. hide: function hide() {
  11489. this.$vm && this.$vm.__call_hook('onPageHide');
  11490. },
  11491. resize: function resize(size) {
  11492. this.$vm && this.$vm.__call_hook('onPageResize', size);
  11493. }
  11494. },
  11495. methods: {
  11496. __l: handleLink,
  11497. __e: handleEvent
  11498. }
  11499. };
  11500. // externalClasses
  11501. if (vueOptions.externalClasses) {
  11502. componentOptions.externalClasses = vueOptions.externalClasses;
  11503. }
  11504. if (Array.isArray(vueOptions.wxsCallMethods)) {
  11505. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  11506. componentOptions.methods[callMethod] = function (args) {
  11507. return this.$vm[callMethod](args);
  11508. };
  11509. });
  11510. }
  11511. if (needVueOptions) {
  11512. return [componentOptions, vueOptions, VueComponent];
  11513. }
  11514. if (isPage) {
  11515. return componentOptions;
  11516. }
  11517. return [componentOptions, VueComponent];
  11518. }
  11519. function parseComponent(vueComponentOptions, needVueOptions) {
  11520. return parseBaseComponent(vueComponentOptions, {
  11521. isPage: isPage,
  11522. initRelation: initRelation
  11523. }, needVueOptions);
  11524. }
  11525. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  11526. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  11527. function parseBasePage(vuePageOptions) {
  11528. var _parseComponent = parseComponent(vuePageOptions, true),
  11529. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  11530. pageOptions = _parseComponent2[0],
  11531. vueOptions = _parseComponent2[1];
  11532. initHooks(pageOptions.methods, hooks$1, vueOptions);
  11533. pageOptions.methods.onLoad = function (query) {
  11534. this.options = query;
  11535. var copyQuery = Object.assign({}, query);
  11536. delete copyQuery.__id__;
  11537. this.$page = {
  11538. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  11539. };
  11540. this.$vm.$mp.query = query; // 兼容 mpvue
  11541. this.$vm.__call_hook('onLoad', query);
  11542. };
  11543. {
  11544. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  11545. }
  11546. return pageOptions;
  11547. }
  11548. function parsePage(vuePageOptions) {
  11549. return parseBasePage(vuePageOptions);
  11550. }
  11551. function createPage(vuePageOptions) {
  11552. {
  11553. return Component(parsePage(vuePageOptions));
  11554. }
  11555. }
  11556. function createComponent(vueOptions) {
  11557. {
  11558. return Component(parseComponent(vueOptions));
  11559. }
  11560. }
  11561. function createSubpackageApp(vm) {
  11562. var appOptions = parseApp(vm);
  11563. var app = getApp({
  11564. allowDefault: true
  11565. });
  11566. vm.$scope = app;
  11567. var globalData = app.globalData;
  11568. if (globalData) {
  11569. Object.keys(appOptions.globalData).forEach(function (name) {
  11570. if (!hasOwn(globalData, name)) {
  11571. globalData[name] = appOptions.globalData[name];
  11572. }
  11573. });
  11574. }
  11575. Object.keys(appOptions).forEach(function (name) {
  11576. if (!hasOwn(app, name)) {
  11577. app[name] = appOptions[name];
  11578. }
  11579. });
  11580. if (isFn(appOptions.onShow) && wx.onAppShow) {
  11581. wx.onAppShow(function () {
  11582. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  11583. args[_key5] = arguments[_key5];
  11584. }
  11585. vm.__call_hook('onShow', args);
  11586. });
  11587. }
  11588. if (isFn(appOptions.onHide) && wx.onAppHide) {
  11589. wx.onAppHide(function () {
  11590. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  11591. args[_key6] = arguments[_key6];
  11592. }
  11593. vm.__call_hook('onHide', args);
  11594. });
  11595. }
  11596. if (isFn(appOptions.onLaunch)) {
  11597. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  11598. vm.__call_hook('onLaunch', args);
  11599. }
  11600. return vm;
  11601. }
  11602. function createPlugin(vm) {
  11603. var appOptions = parseApp(vm);
  11604. if (isFn(appOptions.onShow) && wx.onAppShow) {
  11605. wx.onAppShow(function () {
  11606. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  11607. args[_key7] = arguments[_key7];
  11608. }
  11609. vm.__call_hook('onShow', args);
  11610. });
  11611. }
  11612. if (isFn(appOptions.onHide) && wx.onAppHide) {
  11613. wx.onAppHide(function () {
  11614. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  11615. args[_key8] = arguments[_key8];
  11616. }
  11617. vm.__call_hook('onHide', args);
  11618. });
  11619. }
  11620. if (isFn(appOptions.onLaunch)) {
  11621. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  11622. vm.__call_hook('onLaunch', args);
  11623. }
  11624. return vm;
  11625. }
  11626. todos.forEach(function (todoApi) {
  11627. protocols[todoApi] = false;
  11628. });
  11629. canIUses.forEach(function (canIUseApi) {
  11630. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  11631. if (!wx.canIUse(apiName)) {
  11632. protocols[canIUseApi] = false;
  11633. }
  11634. });
  11635. var uni = {};
  11636. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  11637. uni = new Proxy({}, {
  11638. get: function get(target, name) {
  11639. if (hasOwn(target, name)) {
  11640. return target[name];
  11641. }
  11642. if (baseApi[name]) {
  11643. return baseApi[name];
  11644. }
  11645. if (api[name]) {
  11646. return promisify(name, api[name]);
  11647. }
  11648. {
  11649. if (extraApi[name]) {
  11650. return promisify(name, extraApi[name]);
  11651. }
  11652. if (todoApis[name]) {
  11653. return promisify(name, todoApis[name]);
  11654. }
  11655. }
  11656. if (eventApi[name]) {
  11657. return eventApi[name];
  11658. }
  11659. return promisify(name, wrapper(name, wx[name]));
  11660. },
  11661. set: function set(target, name, value) {
  11662. target[name] = value;
  11663. return true;
  11664. }
  11665. });
  11666. } else {
  11667. Object.keys(baseApi).forEach(function (name) {
  11668. uni[name] = baseApi[name];
  11669. });
  11670. {
  11671. Object.keys(todoApis).forEach(function (name) {
  11672. uni[name] = promisify(name, todoApis[name]);
  11673. });
  11674. Object.keys(extraApi).forEach(function (name) {
  11675. uni[name] = promisify(name, todoApis[name]);
  11676. });
  11677. }
  11678. Object.keys(eventApi).forEach(function (name) {
  11679. uni[name] = eventApi[name];
  11680. });
  11681. Object.keys(api).forEach(function (name) {
  11682. uni[name] = promisify(name, api[name]);
  11683. });
  11684. Object.keys(wx).forEach(function (name) {
  11685. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  11686. uni[name] = promisify(name, wrapper(name, wx[name]));
  11687. }
  11688. });
  11689. }
  11690. wx.createApp = createApp;
  11691. wx.createPage = createPage;
  11692. wx.createComponent = createComponent;
  11693. wx.createSubpackageApp = createSubpackageApp;
  11694. wx.createPlugin = createPlugin;
  11695. var uni$1 = uni;
  11696. var _default = uni$1;
  11697. exports.default = _default;
  11698. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  11699. /***/ }),
  11700. /***/ 20:
  11701. /*!****************************************************************!*\
  11702. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  11703. \****************************************************************/
  11704. /*! no static exports found */
  11705. /***/ (function(module, exports) {
  11706. function _iterableToArray(iter) {
  11707. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  11708. }
  11709. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11710. /***/ }),
  11711. /***/ 207:
  11712. /*!***********************************************************************************************!*\
  11713. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  11714. \***********************************************************************************************/
  11715. /*! no static exports found */
  11716. /***/ (function(module, exports, __webpack_require__) {
  11717. "use strict";
  11718. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11719. Object.defineProperty(exports, "__esModule", {
  11720. value: true
  11721. });
  11722. exports.default = void 0;
  11723. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 208));
  11724. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 209));
  11725. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 210));
  11726. var _default = {
  11727. en: _en.default,
  11728. 'zh-Hans': _zhHans.default,
  11729. 'zh-Hant': _zhHant.default
  11730. };
  11731. exports.default = _default;
  11732. /***/ }),
  11733. /***/ 208:
  11734. /*!**********************************************************************************************!*\
  11735. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  11736. \**********************************************************************************************/
  11737. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11738. /***/ (function(module) {
  11739. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  11740. /***/ }),
  11741. /***/ 209:
  11742. /*!***************************************************************************************************!*\
  11743. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  11744. \***************************************************************************************************/
  11745. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11746. /***/ (function(module) {
  11747. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  11748. /***/ }),
  11749. /***/ 21:
  11750. /*!******************************************************************!*\
  11751. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  11752. \******************************************************************/
  11753. /*! no static exports found */
  11754. /***/ (function(module, exports) {
  11755. function _nonIterableSpread() {
  11756. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  11757. }
  11758. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11759. /***/ }),
  11760. /***/ 210:
  11761. /*!***************************************************************************************************!*\
  11762. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  11763. \***************************************************************************************************/
  11764. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11765. /***/ (function(module) {
  11766. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  11767. /***/ }),
  11768. /***/ 22:
  11769. /*!*************************************************************!*\
  11770. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  11771. \*************************************************************/
  11772. /*! no static exports found */
  11773. /***/ (function(module, exports, __webpack_require__) {
  11774. "use strict";
  11775. /* WEBPACK VAR INJECTION */(function(uni, global) {
  11776. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11777. Object.defineProperty(exports, "__esModule", {
  11778. value: true
  11779. });
  11780. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  11781. exports.compileI18nJsonStr = compileI18nJsonStr;
  11782. exports.hasI18nJson = hasI18nJson;
  11783. exports.initVueI18n = initVueI18n;
  11784. exports.isI18nStr = isI18nStr;
  11785. exports.isString = void 0;
  11786. exports.normalizeLocale = normalizeLocale;
  11787. exports.parseI18nJson = parseI18nJson;
  11788. exports.resolveLocale = resolveLocale;
  11789. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11790. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11791. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11792. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11793. var isArray = Array.isArray;
  11794. var isObject = function isObject(val) {
  11795. return val !== null && (0, _typeof2.default)(val) === 'object';
  11796. };
  11797. var defaultDelimiters = ['{', '}'];
  11798. var BaseFormatter = /*#__PURE__*/function () {
  11799. function BaseFormatter() {
  11800. (0, _classCallCheck2.default)(this, BaseFormatter);
  11801. this._caches = Object.create(null);
  11802. }
  11803. (0, _createClass2.default)(BaseFormatter, [{
  11804. key: "interpolate",
  11805. value: function interpolate(message, values) {
  11806. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  11807. if (!values) {
  11808. return [message];
  11809. }
  11810. var tokens = this._caches[message];
  11811. if (!tokens) {
  11812. tokens = parse(message, delimiters);
  11813. this._caches[message] = tokens;
  11814. }
  11815. return compile(tokens, values);
  11816. }
  11817. }]);
  11818. return BaseFormatter;
  11819. }();
  11820. exports.Formatter = BaseFormatter;
  11821. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  11822. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  11823. function parse(format, _ref) {
  11824. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  11825. startDelimiter = _ref2[0],
  11826. endDelimiter = _ref2[1];
  11827. var tokens = [];
  11828. var position = 0;
  11829. var text = '';
  11830. while (position < format.length) {
  11831. var char = format[position++];
  11832. if (char === startDelimiter) {
  11833. if (text) {
  11834. tokens.push({
  11835. type: 'text',
  11836. value: text
  11837. });
  11838. }
  11839. text = '';
  11840. var sub = '';
  11841. char = format[position++];
  11842. while (char !== undefined && char !== endDelimiter) {
  11843. sub += char;
  11844. char = format[position++];
  11845. }
  11846. var isClosed = char === endDelimiter;
  11847. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  11848. tokens.push({
  11849. value: sub,
  11850. type: type
  11851. });
  11852. }
  11853. // else if (char === '%') {
  11854. // // when found rails i18n syntax, skip text capture
  11855. // if (format[position] !== '{') {
  11856. // text += char
  11857. // }
  11858. // }
  11859. else {
  11860. text += char;
  11861. }
  11862. }
  11863. text && tokens.push({
  11864. type: 'text',
  11865. value: text
  11866. });
  11867. return tokens;
  11868. }
  11869. function compile(tokens, values) {
  11870. var compiled = [];
  11871. var index = 0;
  11872. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  11873. if (mode === 'unknown') {
  11874. return compiled;
  11875. }
  11876. while (index < tokens.length) {
  11877. var token = tokens[index];
  11878. switch (token.type) {
  11879. case 'text':
  11880. compiled.push(token.value);
  11881. break;
  11882. case 'list':
  11883. compiled.push(values[parseInt(token.value, 10)]);
  11884. break;
  11885. case 'named':
  11886. if (mode === 'named') {
  11887. compiled.push(values[token.value]);
  11888. } else {
  11889. if (true) {
  11890. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  11891. }
  11892. }
  11893. break;
  11894. case 'unknown':
  11895. if (true) {
  11896. console.warn("Detect 'unknown' type of token!");
  11897. }
  11898. break;
  11899. }
  11900. index++;
  11901. }
  11902. return compiled;
  11903. }
  11904. var LOCALE_ZH_HANS = 'zh-Hans';
  11905. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  11906. var LOCALE_ZH_HANT = 'zh-Hant';
  11907. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  11908. var LOCALE_EN = 'en';
  11909. exports.LOCALE_EN = LOCALE_EN;
  11910. var LOCALE_FR = 'fr';
  11911. exports.LOCALE_FR = LOCALE_FR;
  11912. var LOCALE_ES = 'es';
  11913. exports.LOCALE_ES = LOCALE_ES;
  11914. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11915. var hasOwn = function hasOwn(val, key) {
  11916. return hasOwnProperty.call(val, key);
  11917. };
  11918. var defaultFormatter = new BaseFormatter();
  11919. function include(str, parts) {
  11920. return !!parts.find(function (part) {
  11921. return str.indexOf(part) !== -1;
  11922. });
  11923. }
  11924. function startsWith(str, parts) {
  11925. return parts.find(function (part) {
  11926. return str.indexOf(part) === 0;
  11927. });
  11928. }
  11929. function normalizeLocale(locale, messages) {
  11930. if (!locale) {
  11931. return;
  11932. }
  11933. locale = locale.trim().replace(/_/g, '-');
  11934. if (messages && messages[locale]) {
  11935. return locale;
  11936. }
  11937. locale = locale.toLowerCase();
  11938. if (locale.indexOf('zh') === 0) {
  11939. if (locale.indexOf('-hans') > -1) {
  11940. return LOCALE_ZH_HANS;
  11941. }
  11942. if (locale.indexOf('-hant') > -1) {
  11943. return LOCALE_ZH_HANT;
  11944. }
  11945. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  11946. return LOCALE_ZH_HANT;
  11947. }
  11948. return LOCALE_ZH_HANS;
  11949. }
  11950. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  11951. if (lang) {
  11952. return lang;
  11953. }
  11954. }
  11955. var I18n = /*#__PURE__*/function () {
  11956. function I18n(_ref3) {
  11957. var locale = _ref3.locale,
  11958. fallbackLocale = _ref3.fallbackLocale,
  11959. messages = _ref3.messages,
  11960. watcher = _ref3.watcher,
  11961. formater = _ref3.formater;
  11962. (0, _classCallCheck2.default)(this, I18n);
  11963. this.locale = LOCALE_EN;
  11964. this.fallbackLocale = LOCALE_EN;
  11965. this.message = {};
  11966. this.messages = {};
  11967. this.watchers = [];
  11968. if (fallbackLocale) {
  11969. this.fallbackLocale = fallbackLocale;
  11970. }
  11971. this.formater = formater || defaultFormatter;
  11972. this.messages = messages || {};
  11973. this.setLocale(locale || LOCALE_EN);
  11974. if (watcher) {
  11975. this.watchLocale(watcher);
  11976. }
  11977. }
  11978. (0, _createClass2.default)(I18n, [{
  11979. key: "setLocale",
  11980. value: function setLocale(locale) {
  11981. var _this = this;
  11982. var oldLocale = this.locale;
  11983. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  11984. if (!this.messages[this.locale]) {
  11985. // 可能初始化时不存在
  11986. this.messages[this.locale] = {};
  11987. }
  11988. this.message = this.messages[this.locale];
  11989. // 仅发生变化时,通知
  11990. if (oldLocale !== this.locale) {
  11991. this.watchers.forEach(function (watcher) {
  11992. watcher(_this.locale, oldLocale);
  11993. });
  11994. }
  11995. }
  11996. }, {
  11997. key: "getLocale",
  11998. value: function getLocale() {
  11999. return this.locale;
  12000. }
  12001. }, {
  12002. key: "watchLocale",
  12003. value: function watchLocale(fn) {
  12004. var _this2 = this;
  12005. var index = this.watchers.push(fn) - 1;
  12006. return function () {
  12007. _this2.watchers.splice(index, 1);
  12008. };
  12009. }
  12010. }, {
  12011. key: "add",
  12012. value: function add(locale, message) {
  12013. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  12014. var curMessages = this.messages[locale];
  12015. if (curMessages) {
  12016. if (override) {
  12017. Object.assign(curMessages, message);
  12018. } else {
  12019. Object.keys(message).forEach(function (key) {
  12020. if (!hasOwn(curMessages, key)) {
  12021. curMessages[key] = message[key];
  12022. }
  12023. });
  12024. }
  12025. } else {
  12026. this.messages[locale] = message;
  12027. }
  12028. }
  12029. }, {
  12030. key: "f",
  12031. value: function f(message, values, delimiters) {
  12032. return this.formater.interpolate(message, values, delimiters).join('');
  12033. }
  12034. }, {
  12035. key: "t",
  12036. value: function t(key, locale, values) {
  12037. var message = this.message;
  12038. if (typeof locale === 'string') {
  12039. locale = normalizeLocale(locale, this.messages);
  12040. locale && (message = this.messages[locale]);
  12041. } else {
  12042. values = locale;
  12043. }
  12044. if (!hasOwn(message, key)) {
  12045. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  12046. return key;
  12047. }
  12048. return this.formater.interpolate(message[key], values).join('');
  12049. }
  12050. }]);
  12051. return I18n;
  12052. }();
  12053. exports.I18n = I18n;
  12054. function watchAppLocale(appVm, i18n) {
  12055. // 需要保证 watch 的触发在组件渲染之前
  12056. if (appVm.$watchLocale) {
  12057. // vue2
  12058. appVm.$watchLocale(function (newLocale) {
  12059. i18n.setLocale(newLocale);
  12060. });
  12061. } else {
  12062. appVm.$watch(function () {
  12063. return appVm.$locale;
  12064. }, function (newLocale) {
  12065. i18n.setLocale(newLocale);
  12066. });
  12067. }
  12068. }
  12069. function getDefaultLocale() {
  12070. if (typeof uni !== 'undefined' && uni.getLocale) {
  12071. return uni.getLocale();
  12072. }
  12073. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  12074. if (typeof global !== 'undefined' && global.getLocale) {
  12075. return global.getLocale();
  12076. }
  12077. return LOCALE_EN;
  12078. }
  12079. function initVueI18n(locale) {
  12080. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12081. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  12082. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  12083. // 兼容旧版本入参
  12084. if (typeof locale !== 'string') {
  12085. var _ref4 = [messages, locale];
  12086. locale = _ref4[0];
  12087. messages = _ref4[1];
  12088. }
  12089. if (typeof locale !== 'string') {
  12090. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  12091. locale = getDefaultLocale();
  12092. }
  12093. if (typeof fallbackLocale !== 'string') {
  12094. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  12095. }
  12096. var i18n = new I18n({
  12097. locale: locale,
  12098. fallbackLocale: fallbackLocale,
  12099. messages: messages,
  12100. watcher: watcher
  12101. });
  12102. var _t = function t(key, values) {
  12103. if (typeof getApp !== 'function') {
  12104. // app view
  12105. /* eslint-disable no-func-assign */
  12106. _t = function t(key, values) {
  12107. return i18n.t(key, values);
  12108. };
  12109. } else {
  12110. var isWatchedAppLocale = false;
  12111. _t = function t(key, values) {
  12112. var appVm = getApp().$vm;
  12113. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  12114. // options: {
  12115. // type: Array,
  12116. // default () {
  12117. // return [{
  12118. // icon: 'shop',
  12119. // text: t("uni-goods-nav.options.shop"),
  12120. // }, {
  12121. // icon: 'cart',
  12122. // text: t("uni-goods-nav.options.cart")
  12123. // }]
  12124. // }
  12125. // },
  12126. if (appVm) {
  12127. // 触发响应式
  12128. appVm.$locale;
  12129. if (!isWatchedAppLocale) {
  12130. isWatchedAppLocale = true;
  12131. watchAppLocale(appVm, i18n);
  12132. }
  12133. }
  12134. return i18n.t(key, values);
  12135. };
  12136. }
  12137. return _t(key, values);
  12138. };
  12139. return {
  12140. i18n: i18n,
  12141. f: function f(message, values, delimiters) {
  12142. return i18n.f(message, values, delimiters);
  12143. },
  12144. t: function t(key, values) {
  12145. return _t(key, values);
  12146. },
  12147. add: function add(locale, message) {
  12148. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  12149. return i18n.add(locale, message, override);
  12150. },
  12151. watch: function watch(fn) {
  12152. return i18n.watchLocale(fn);
  12153. },
  12154. getLocale: function getLocale() {
  12155. return i18n.getLocale();
  12156. },
  12157. setLocale: function setLocale(newLocale) {
  12158. return i18n.setLocale(newLocale);
  12159. }
  12160. };
  12161. }
  12162. var isString = function isString(val) {
  12163. return typeof val === 'string';
  12164. };
  12165. exports.isString = isString;
  12166. var formater;
  12167. function hasI18nJson(jsonObj, delimiters) {
  12168. if (!formater) {
  12169. formater = new BaseFormatter();
  12170. }
  12171. return walkJsonObj(jsonObj, function (jsonObj, key) {
  12172. var value = jsonObj[key];
  12173. if (isString(value)) {
  12174. if (isI18nStr(value, delimiters)) {
  12175. return true;
  12176. }
  12177. } else {
  12178. return hasI18nJson(value, delimiters);
  12179. }
  12180. });
  12181. }
  12182. function parseI18nJson(jsonObj, values, delimiters) {
  12183. if (!formater) {
  12184. formater = new BaseFormatter();
  12185. }
  12186. walkJsonObj(jsonObj, function (jsonObj, key) {
  12187. var value = jsonObj[key];
  12188. if (isString(value)) {
  12189. if (isI18nStr(value, delimiters)) {
  12190. jsonObj[key] = compileStr(value, values, delimiters);
  12191. }
  12192. } else {
  12193. parseI18nJson(value, values, delimiters);
  12194. }
  12195. });
  12196. return jsonObj;
  12197. }
  12198. function compileI18nJsonStr(jsonStr, _ref5) {
  12199. var locale = _ref5.locale,
  12200. locales = _ref5.locales,
  12201. delimiters = _ref5.delimiters;
  12202. if (!isI18nStr(jsonStr, delimiters)) {
  12203. return jsonStr;
  12204. }
  12205. if (!formater) {
  12206. formater = new BaseFormatter();
  12207. }
  12208. var localeValues = [];
  12209. Object.keys(locales).forEach(function (name) {
  12210. if (name !== locale) {
  12211. localeValues.push({
  12212. locale: name,
  12213. values: locales[name]
  12214. });
  12215. }
  12216. });
  12217. localeValues.unshift({
  12218. locale: locale,
  12219. values: locales[locale]
  12220. });
  12221. try {
  12222. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  12223. } catch (e) {}
  12224. return jsonStr;
  12225. }
  12226. function isI18nStr(value, delimiters) {
  12227. return value.indexOf(delimiters[0]) > -1;
  12228. }
  12229. function compileStr(value, values, delimiters) {
  12230. return formater.interpolate(value, values, delimiters).join('');
  12231. }
  12232. function compileValue(jsonObj, key, localeValues, delimiters) {
  12233. var value = jsonObj[key];
  12234. if (isString(value)) {
  12235. // 存在国际化
  12236. if (isI18nStr(value, delimiters)) {
  12237. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  12238. if (localeValues.length > 1) {
  12239. // 格式化国际化语言
  12240. var valueLocales = jsonObj[key + 'Locales'] = {};
  12241. localeValues.forEach(function (localValue) {
  12242. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  12243. });
  12244. }
  12245. }
  12246. } else {
  12247. compileJsonObj(value, localeValues, delimiters);
  12248. }
  12249. }
  12250. function compileJsonObj(jsonObj, localeValues, delimiters) {
  12251. walkJsonObj(jsonObj, function (jsonObj, key) {
  12252. compileValue(jsonObj, key, localeValues, delimiters);
  12253. });
  12254. return jsonObj;
  12255. }
  12256. function walkJsonObj(jsonObj, walk) {
  12257. if (isArray(jsonObj)) {
  12258. for (var i = 0; i < jsonObj.length; i++) {
  12259. if (walk(jsonObj, i)) {
  12260. return true;
  12261. }
  12262. }
  12263. } else if (isObject(jsonObj)) {
  12264. for (var key in jsonObj) {
  12265. if (walk(jsonObj, key)) {
  12266. return true;
  12267. }
  12268. }
  12269. }
  12270. return false;
  12271. }
  12272. function resolveLocale(locales) {
  12273. return function (locale) {
  12274. if (!locale) {
  12275. return locale;
  12276. }
  12277. locale = normalizeLocale(locale) || locale;
  12278. return resolveLocaleChain(locale).find(function (locale) {
  12279. return locales.indexOf(locale) > -1;
  12280. });
  12281. };
  12282. }
  12283. function resolveLocaleChain(locale) {
  12284. var chain = [];
  12285. var tokens = locale.split('-');
  12286. while (tokens.length) {
  12287. chain.push(tokens.join('-'));
  12288. tokens.pop();
  12289. }
  12290. return chain;
  12291. }
  12292. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  12293. /***/ }),
  12294. /***/ 23:
  12295. /*!***************************************************************!*\
  12296. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  12297. \***************************************************************/
  12298. /*! no static exports found */
  12299. /***/ (function(module, exports) {
  12300. function _classCallCheck(instance, Constructor) {
  12301. if (!(instance instanceof Constructor)) {
  12302. throw new TypeError("Cannot call a class as a function");
  12303. }
  12304. }
  12305. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12306. /***/ }),
  12307. /***/ 24:
  12308. /*!************************************************************!*\
  12309. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  12310. \************************************************************/
  12311. /*! no static exports found */
  12312. /***/ (function(module, exports, __webpack_require__) {
  12313. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  12314. function _defineProperties(target, props) {
  12315. for (var i = 0; i < props.length; i++) {
  12316. var descriptor = props[i];
  12317. descriptor.enumerable = descriptor.enumerable || false;
  12318. descriptor.configurable = true;
  12319. if ("value" in descriptor) descriptor.writable = true;
  12320. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  12321. }
  12322. }
  12323. function _createClass(Constructor, protoProps, staticProps) {
  12324. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  12325. if (staticProps) _defineProperties(Constructor, staticProps);
  12326. Object.defineProperty(Constructor, "prototype", {
  12327. writable: false
  12328. });
  12329. return Constructor;
  12330. }
  12331. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12332. /***/ }),
  12333. /***/ 25:
  12334. /*!******************************************************************************************!*\
  12335. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  12336. \******************************************************************************************/
  12337. /*! exports provided: default */
  12338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12339. "use strict";
  12340. __webpack_require__.r(__webpack_exports__);
  12341. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12342. * Vue.js v2.6.11
  12343. * (c) 2014-2022 Evan You
  12344. * Released under the MIT License.
  12345. */
  12346. /* */
  12347. var emptyObject = Object.freeze({});
  12348. // These helpers produce better VM code in JS engines due to their
  12349. // explicitness and function inlining.
  12350. function isUndef (v) {
  12351. return v === undefined || v === null
  12352. }
  12353. function isDef (v) {
  12354. return v !== undefined && v !== null
  12355. }
  12356. function isTrue (v) {
  12357. return v === true
  12358. }
  12359. function isFalse (v) {
  12360. return v === false
  12361. }
  12362. /**
  12363. * Check if value is primitive.
  12364. */
  12365. function isPrimitive (value) {
  12366. return (
  12367. typeof value === 'string' ||
  12368. typeof value === 'number' ||
  12369. // $flow-disable-line
  12370. typeof value === 'symbol' ||
  12371. typeof value === 'boolean'
  12372. )
  12373. }
  12374. /**
  12375. * Quick object check - this is primarily used to tell
  12376. * Objects from primitive values when we know the value
  12377. * is a JSON-compliant type.
  12378. */
  12379. function isObject (obj) {
  12380. return obj !== null && typeof obj === 'object'
  12381. }
  12382. /**
  12383. * Get the raw type string of a value, e.g., [object Object].
  12384. */
  12385. var _toString = Object.prototype.toString;
  12386. function toRawType (value) {
  12387. return _toString.call(value).slice(8, -1)
  12388. }
  12389. /**
  12390. * Strict object type check. Only returns true
  12391. * for plain JavaScript objects.
  12392. */
  12393. function isPlainObject (obj) {
  12394. return _toString.call(obj) === '[object Object]'
  12395. }
  12396. function isRegExp (v) {
  12397. return _toString.call(v) === '[object RegExp]'
  12398. }
  12399. /**
  12400. * Check if val is a valid array index.
  12401. */
  12402. function isValidArrayIndex (val) {
  12403. var n = parseFloat(String(val));
  12404. return n >= 0 && Math.floor(n) === n && isFinite(val)
  12405. }
  12406. function isPromise (val) {
  12407. return (
  12408. isDef(val) &&
  12409. typeof val.then === 'function' &&
  12410. typeof val.catch === 'function'
  12411. )
  12412. }
  12413. /**
  12414. * Convert a value to a string that is actually rendered.
  12415. */
  12416. function toString (val) {
  12417. return val == null
  12418. ? ''
  12419. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  12420. ? JSON.stringify(val, null, 2)
  12421. : String(val)
  12422. }
  12423. /**
  12424. * Convert an input value to a number for persistence.
  12425. * If the conversion fails, return original string.
  12426. */
  12427. function toNumber (val) {
  12428. var n = parseFloat(val);
  12429. return isNaN(n) ? val : n
  12430. }
  12431. /**
  12432. * Make a map and return a function for checking if a key
  12433. * is in that map.
  12434. */
  12435. function makeMap (
  12436. str,
  12437. expectsLowerCase
  12438. ) {
  12439. var map = Object.create(null);
  12440. var list = str.split(',');
  12441. for (var i = 0; i < list.length; i++) {
  12442. map[list[i]] = true;
  12443. }
  12444. return expectsLowerCase
  12445. ? function (val) { return map[val.toLowerCase()]; }
  12446. : function (val) { return map[val]; }
  12447. }
  12448. /**
  12449. * Check if a tag is a built-in tag.
  12450. */
  12451. var isBuiltInTag = makeMap('slot,component', true);
  12452. /**
  12453. * Check if an attribute is a reserved attribute.
  12454. */
  12455. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  12456. /**
  12457. * Remove an item from an array.
  12458. */
  12459. function remove (arr, item) {
  12460. if (arr.length) {
  12461. var index = arr.indexOf(item);
  12462. if (index > -1) {
  12463. return arr.splice(index, 1)
  12464. }
  12465. }
  12466. }
  12467. /**
  12468. * Check whether an object has the property.
  12469. */
  12470. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12471. function hasOwn (obj, key) {
  12472. return hasOwnProperty.call(obj, key)
  12473. }
  12474. /**
  12475. * Create a cached version of a pure function.
  12476. */
  12477. function cached (fn) {
  12478. var cache = Object.create(null);
  12479. return (function cachedFn (str) {
  12480. var hit = cache[str];
  12481. return hit || (cache[str] = fn(str))
  12482. })
  12483. }
  12484. /**
  12485. * Camelize a hyphen-delimited string.
  12486. */
  12487. var camelizeRE = /-(\w)/g;
  12488. var camelize = cached(function (str) {
  12489. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  12490. });
  12491. /**
  12492. * Capitalize a string.
  12493. */
  12494. var capitalize = cached(function (str) {
  12495. return str.charAt(0).toUpperCase() + str.slice(1)
  12496. });
  12497. /**
  12498. * Hyphenate a camelCase string.
  12499. */
  12500. var hyphenateRE = /\B([A-Z])/g;
  12501. var hyphenate = cached(function (str) {
  12502. return str.replace(hyphenateRE, '-$1').toLowerCase()
  12503. });
  12504. /**
  12505. * Simple bind polyfill for environments that do not support it,
  12506. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  12507. * since native bind is now performant enough in most browsers.
  12508. * But removing it would mean breaking code that was able to run in
  12509. * PhantomJS 1.x, so this must be kept for backward compatibility.
  12510. */
  12511. /* istanbul ignore next */
  12512. function polyfillBind (fn, ctx) {
  12513. function boundFn (a) {
  12514. var l = arguments.length;
  12515. return l
  12516. ? l > 1
  12517. ? fn.apply(ctx, arguments)
  12518. : fn.call(ctx, a)
  12519. : fn.call(ctx)
  12520. }
  12521. boundFn._length = fn.length;
  12522. return boundFn
  12523. }
  12524. function nativeBind (fn, ctx) {
  12525. return fn.bind(ctx)
  12526. }
  12527. var bind = Function.prototype.bind
  12528. ? nativeBind
  12529. : polyfillBind;
  12530. /**
  12531. * Convert an Array-like object to a real Array.
  12532. */
  12533. function toArray (list, start) {
  12534. start = start || 0;
  12535. var i = list.length - start;
  12536. var ret = new Array(i);
  12537. while (i--) {
  12538. ret[i] = list[i + start];
  12539. }
  12540. return ret
  12541. }
  12542. /**
  12543. * Mix properties into target object.
  12544. */
  12545. function extend (to, _from) {
  12546. for (var key in _from) {
  12547. to[key] = _from[key];
  12548. }
  12549. return to
  12550. }
  12551. /**
  12552. * Merge an Array of Objects into a single Object.
  12553. */
  12554. function toObject (arr) {
  12555. var res = {};
  12556. for (var i = 0; i < arr.length; i++) {
  12557. if (arr[i]) {
  12558. extend(res, arr[i]);
  12559. }
  12560. }
  12561. return res
  12562. }
  12563. /* eslint-disable no-unused-vars */
  12564. /**
  12565. * Perform no operation.
  12566. * Stubbing args to make Flow happy without leaving useless transpiled code
  12567. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  12568. */
  12569. function noop (a, b, c) {}
  12570. /**
  12571. * Always return false.
  12572. */
  12573. var no = function (a, b, c) { return false; };
  12574. /* eslint-enable no-unused-vars */
  12575. /**
  12576. * Return the same value.
  12577. */
  12578. var identity = function (_) { return _; };
  12579. /**
  12580. * Check if two values are loosely equal - that is,
  12581. * if they are plain objects, do they have the same shape?
  12582. */
  12583. function looseEqual (a, b) {
  12584. if (a === b) { return true }
  12585. var isObjectA = isObject(a);
  12586. var isObjectB = isObject(b);
  12587. if (isObjectA && isObjectB) {
  12588. try {
  12589. var isArrayA = Array.isArray(a);
  12590. var isArrayB = Array.isArray(b);
  12591. if (isArrayA && isArrayB) {
  12592. return a.length === b.length && a.every(function (e, i) {
  12593. return looseEqual(e, b[i])
  12594. })
  12595. } else if (a instanceof Date && b instanceof Date) {
  12596. return a.getTime() === b.getTime()
  12597. } else if (!isArrayA && !isArrayB) {
  12598. var keysA = Object.keys(a);
  12599. var keysB = Object.keys(b);
  12600. return keysA.length === keysB.length && keysA.every(function (key) {
  12601. return looseEqual(a[key], b[key])
  12602. })
  12603. } else {
  12604. /* istanbul ignore next */
  12605. return false
  12606. }
  12607. } catch (e) {
  12608. /* istanbul ignore next */
  12609. return false
  12610. }
  12611. } else if (!isObjectA && !isObjectB) {
  12612. return String(a) === String(b)
  12613. } else {
  12614. return false
  12615. }
  12616. }
  12617. /**
  12618. * Return the first index at which a loosely equal value can be
  12619. * found in the array (if value is a plain object, the array must
  12620. * contain an object of the same shape), or -1 if it is not present.
  12621. */
  12622. function looseIndexOf (arr, val) {
  12623. for (var i = 0; i < arr.length; i++) {
  12624. if (looseEqual(arr[i], val)) { return i }
  12625. }
  12626. return -1
  12627. }
  12628. /**
  12629. * Ensure a function is called only once.
  12630. */
  12631. function once (fn) {
  12632. var called = false;
  12633. return function () {
  12634. if (!called) {
  12635. called = true;
  12636. fn.apply(this, arguments);
  12637. }
  12638. }
  12639. }
  12640. var ASSET_TYPES = [
  12641. 'component',
  12642. 'directive',
  12643. 'filter'
  12644. ];
  12645. var LIFECYCLE_HOOKS = [
  12646. 'beforeCreate',
  12647. 'created',
  12648. 'beforeMount',
  12649. 'mounted',
  12650. 'beforeUpdate',
  12651. 'updated',
  12652. 'beforeDestroy',
  12653. 'destroyed',
  12654. 'activated',
  12655. 'deactivated',
  12656. 'errorCaptured',
  12657. 'serverPrefetch'
  12658. ];
  12659. /* */
  12660. var config = ({
  12661. /**
  12662. * Option merge strategies (used in core/util/options)
  12663. */
  12664. // $flow-disable-line
  12665. optionMergeStrategies: Object.create(null),
  12666. /**
  12667. * Whether to suppress warnings.
  12668. */
  12669. silent: false,
  12670. /**
  12671. * Show production mode tip message on boot?
  12672. */
  12673. productionTip: "development" !== 'production',
  12674. /**
  12675. * Whether to enable devtools
  12676. */
  12677. devtools: "development" !== 'production',
  12678. /**
  12679. * Whether to record perf
  12680. */
  12681. performance: false,
  12682. /**
  12683. * Error handler for watcher errors
  12684. */
  12685. errorHandler: null,
  12686. /**
  12687. * Warn handler for watcher warns
  12688. */
  12689. warnHandler: null,
  12690. /**
  12691. * Ignore certain custom elements
  12692. */
  12693. ignoredElements: [],
  12694. /**
  12695. * Custom user key aliases for v-on
  12696. */
  12697. // $flow-disable-line
  12698. keyCodes: Object.create(null),
  12699. /**
  12700. * Check if a tag is reserved so that it cannot be registered as a
  12701. * component. This is platform-dependent and may be overwritten.
  12702. */
  12703. isReservedTag: no,
  12704. /**
  12705. * Check if an attribute is reserved so that it cannot be used as a component
  12706. * prop. This is platform-dependent and may be overwritten.
  12707. */
  12708. isReservedAttr: no,
  12709. /**
  12710. * Check if a tag is an unknown element.
  12711. * Platform-dependent.
  12712. */
  12713. isUnknownElement: no,
  12714. /**
  12715. * Get the namespace of an element
  12716. */
  12717. getTagNamespace: noop,
  12718. /**
  12719. * Parse the real tag name for the specific platform.
  12720. */
  12721. parsePlatformTagName: identity,
  12722. /**
  12723. * Check if an attribute must be bound using property, e.g. value
  12724. * Platform-dependent.
  12725. */
  12726. mustUseProp: no,
  12727. /**
  12728. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  12729. * This will significantly reduce performance if set to false.
  12730. */
  12731. async: true,
  12732. /**
  12733. * Exposed for legacy reasons
  12734. */
  12735. _lifecycleHooks: LIFECYCLE_HOOKS
  12736. });
  12737. /* */
  12738. /**
  12739. * unicode letters used for parsing html tags, component names and property paths.
  12740. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  12741. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  12742. */
  12743. 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/;
  12744. /**
  12745. * Check if a string starts with $ or _
  12746. */
  12747. function isReserved (str) {
  12748. var c = (str + '').charCodeAt(0);
  12749. return c === 0x24 || c === 0x5F
  12750. }
  12751. /**
  12752. * Define a property.
  12753. */
  12754. function def (obj, key, val, enumerable) {
  12755. Object.defineProperty(obj, key, {
  12756. value: val,
  12757. enumerable: !!enumerable,
  12758. writable: true,
  12759. configurable: true
  12760. });
  12761. }
  12762. /**
  12763. * Parse simple path.
  12764. */
  12765. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  12766. function parsePath (path) {
  12767. if (bailRE.test(path)) {
  12768. return
  12769. }
  12770. var segments = path.split('.');
  12771. return function (obj) {
  12772. for (var i = 0; i < segments.length; i++) {
  12773. if (!obj) { return }
  12774. obj = obj[segments[i]];
  12775. }
  12776. return obj
  12777. }
  12778. }
  12779. /* */
  12780. // can we use __proto__?
  12781. var hasProto = '__proto__' in {};
  12782. // Browser environment sniffing
  12783. var inBrowser = typeof window !== 'undefined';
  12784. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  12785. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  12786. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  12787. var isIE = UA && /msie|trident/.test(UA);
  12788. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12789. var isEdge = UA && UA.indexOf('edge/') > 0;
  12790. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  12791. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  12792. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  12793. var isPhantomJS = UA && /phantomjs/.test(UA);
  12794. var isFF = UA && UA.match(/firefox\/(\d+)/);
  12795. // Firefox has a "watch" function on Object.prototype...
  12796. var nativeWatch = ({}).watch;
  12797. if (inBrowser) {
  12798. try {
  12799. var opts = {};
  12800. Object.defineProperty(opts, 'passive', ({
  12801. get: function get () {
  12802. }
  12803. })); // https://github.com/facebook/flow/issues/285
  12804. window.addEventListener('test-passive', null, opts);
  12805. } catch (e) {}
  12806. }
  12807. // this needs to be lazy-evaled because vue may be required before
  12808. // vue-server-renderer can set VUE_ENV
  12809. var _isServer;
  12810. var isServerRendering = function () {
  12811. if (_isServer === undefined) {
  12812. /* istanbul ignore if */
  12813. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  12814. // detect presence of vue-server-renderer and avoid
  12815. // Webpack shimming the process
  12816. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  12817. } else {
  12818. _isServer = false;
  12819. }
  12820. }
  12821. return _isServer
  12822. };
  12823. // detect devtools
  12824. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12825. /* istanbul ignore next */
  12826. function isNative (Ctor) {
  12827. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  12828. }
  12829. var hasSymbol =
  12830. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  12831. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  12832. var _Set;
  12833. /* istanbul ignore if */ // $flow-disable-line
  12834. if (typeof Set !== 'undefined' && isNative(Set)) {
  12835. // use native Set when available.
  12836. _Set = Set;
  12837. } else {
  12838. // a non-standard Set polyfill that only works with primitive keys.
  12839. _Set = /*@__PURE__*/(function () {
  12840. function Set () {
  12841. this.set = Object.create(null);
  12842. }
  12843. Set.prototype.has = function has (key) {
  12844. return this.set[key] === true
  12845. };
  12846. Set.prototype.add = function add (key) {
  12847. this.set[key] = true;
  12848. };
  12849. Set.prototype.clear = function clear () {
  12850. this.set = Object.create(null);
  12851. };
  12852. return Set;
  12853. }());
  12854. }
  12855. /* */
  12856. var warn = noop;
  12857. var tip = noop;
  12858. var generateComponentTrace = (noop); // work around flow check
  12859. var formatComponentName = (noop);
  12860. if (true) {
  12861. var hasConsole = typeof console !== 'undefined';
  12862. var classifyRE = /(?:^|[-_])(\w)/g;
  12863. var classify = function (str) { return str
  12864. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  12865. .replace(/[-_]/g, ''); };
  12866. warn = function (msg, vm) {
  12867. var trace = vm ? generateComponentTrace(vm) : '';
  12868. if (config.warnHandler) {
  12869. config.warnHandler.call(null, msg, vm, trace);
  12870. } else if (hasConsole && (!config.silent)) {
  12871. console.error(("[Vue warn]: " + msg + trace));
  12872. }
  12873. };
  12874. tip = function (msg, vm) {
  12875. if (hasConsole && (!config.silent)) {
  12876. console.warn("[Vue tip]: " + msg + (
  12877. vm ? generateComponentTrace(vm) : ''
  12878. ));
  12879. }
  12880. };
  12881. formatComponentName = function (vm, includeFile) {
  12882. if (vm.$root === vm) {
  12883. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  12884. return ('') + vm.$options.__file
  12885. }
  12886. return '<Root>'
  12887. }
  12888. var options = typeof vm === 'function' && vm.cid != null
  12889. ? vm.options
  12890. : vm._isVue
  12891. ? vm.$options || vm.constructor.options
  12892. : vm;
  12893. var name = options.name || options._componentTag;
  12894. var file = options.__file;
  12895. if (!name && file) {
  12896. var match = file.match(/([^/\\]+)\.vue$/);
  12897. name = match && match[1];
  12898. }
  12899. return (
  12900. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  12901. (file && includeFile !== false ? (" at " + file) : '')
  12902. )
  12903. };
  12904. var repeat = function (str, n) {
  12905. var res = '';
  12906. while (n) {
  12907. if (n % 2 === 1) { res += str; }
  12908. if (n > 1) { str += str; }
  12909. n >>= 1;
  12910. }
  12911. return res
  12912. };
  12913. generateComponentTrace = function (vm) {
  12914. if (vm._isVue && vm.$parent) {
  12915. var tree = [];
  12916. var currentRecursiveSequence = 0;
  12917. while (vm && vm.$options.name !== 'PageBody') {
  12918. if (tree.length > 0) {
  12919. var last = tree[tree.length - 1];
  12920. if (last.constructor === vm.constructor) {
  12921. currentRecursiveSequence++;
  12922. vm = vm.$parent;
  12923. continue
  12924. } else if (currentRecursiveSequence > 0) {
  12925. tree[tree.length - 1] = [last, currentRecursiveSequence];
  12926. currentRecursiveSequence = 0;
  12927. }
  12928. }
  12929. !vm.$options.isReserved && tree.push(vm);
  12930. vm = vm.$parent;
  12931. }
  12932. return '\n\nfound in\n\n' + tree
  12933. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  12934. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  12935. : formatComponentName(vm))); })
  12936. .join('\n')
  12937. } else {
  12938. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  12939. }
  12940. };
  12941. }
  12942. /* */
  12943. var uid = 0;
  12944. /**
  12945. * A dep is an observable that can have multiple
  12946. * directives subscribing to it.
  12947. */
  12948. var Dep = function Dep () {
  12949. this.id = uid++;
  12950. this.subs = [];
  12951. };
  12952. Dep.prototype.addSub = function addSub (sub) {
  12953. this.subs.push(sub);
  12954. };
  12955. Dep.prototype.removeSub = function removeSub (sub) {
  12956. remove(this.subs, sub);
  12957. };
  12958. Dep.prototype.depend = function depend () {
  12959. if (Dep.SharedObject.target) {
  12960. Dep.SharedObject.target.addDep(this);
  12961. }
  12962. };
  12963. Dep.prototype.notify = function notify () {
  12964. // stabilize the subscriber list first
  12965. var subs = this.subs.slice();
  12966. if ( true && !config.async) {
  12967. // subs aren't sorted in scheduler if not running async
  12968. // we need to sort them now to make sure they fire in correct
  12969. // order
  12970. subs.sort(function (a, b) { return a.id - b.id; });
  12971. }
  12972. for (var i = 0, l = subs.length; i < l; i++) {
  12973. subs[i].update();
  12974. }
  12975. };
  12976. // The current target watcher being evaluated.
  12977. // This is globally unique because only one watcher
  12978. // can be evaluated at a time.
  12979. // fixed by xxxxxx (nvue shared vuex)
  12980. /* eslint-disable no-undef */
  12981. Dep.SharedObject = {};
  12982. Dep.SharedObject.target = null;
  12983. Dep.SharedObject.targetStack = [];
  12984. function pushTarget (target) {
  12985. Dep.SharedObject.targetStack.push(target);
  12986. Dep.SharedObject.target = target;
  12987. Dep.target = target;
  12988. }
  12989. function popTarget () {
  12990. Dep.SharedObject.targetStack.pop();
  12991. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  12992. Dep.target = Dep.SharedObject.target;
  12993. }
  12994. /* */
  12995. var VNode = function VNode (
  12996. tag,
  12997. data,
  12998. children,
  12999. text,
  13000. elm,
  13001. context,
  13002. componentOptions,
  13003. asyncFactory
  13004. ) {
  13005. this.tag = tag;
  13006. this.data = data;
  13007. this.children = children;
  13008. this.text = text;
  13009. this.elm = elm;
  13010. this.ns = undefined;
  13011. this.context = context;
  13012. this.fnContext = undefined;
  13013. this.fnOptions = undefined;
  13014. this.fnScopeId = undefined;
  13015. this.key = data && data.key;
  13016. this.componentOptions = componentOptions;
  13017. this.componentInstance = undefined;
  13018. this.parent = undefined;
  13019. this.raw = false;
  13020. this.isStatic = false;
  13021. this.isRootInsert = true;
  13022. this.isComment = false;
  13023. this.isCloned = false;
  13024. this.isOnce = false;
  13025. this.asyncFactory = asyncFactory;
  13026. this.asyncMeta = undefined;
  13027. this.isAsyncPlaceholder = false;
  13028. };
  13029. var prototypeAccessors = { child: { configurable: true } };
  13030. // DEPRECATED: alias for componentInstance for backwards compat.
  13031. /* istanbul ignore next */
  13032. prototypeAccessors.child.get = function () {
  13033. return this.componentInstance
  13034. };
  13035. Object.defineProperties( VNode.prototype, prototypeAccessors );
  13036. var createEmptyVNode = function (text) {
  13037. if ( text === void 0 ) text = '';
  13038. var node = new VNode();
  13039. node.text = text;
  13040. node.isComment = true;
  13041. return node
  13042. };
  13043. function createTextVNode (val) {
  13044. return new VNode(undefined, undefined, undefined, String(val))
  13045. }
  13046. // optimized shallow clone
  13047. // used for static nodes and slot nodes because they may be reused across
  13048. // multiple renders, cloning them avoids errors when DOM manipulations rely
  13049. // on their elm reference.
  13050. function cloneVNode (vnode) {
  13051. var cloned = new VNode(
  13052. vnode.tag,
  13053. vnode.data,
  13054. // #7975
  13055. // clone children array to avoid mutating original in case of cloning
  13056. // a child.
  13057. vnode.children && vnode.children.slice(),
  13058. vnode.text,
  13059. vnode.elm,
  13060. vnode.context,
  13061. vnode.componentOptions,
  13062. vnode.asyncFactory
  13063. );
  13064. cloned.ns = vnode.ns;
  13065. cloned.isStatic = vnode.isStatic;
  13066. cloned.key = vnode.key;
  13067. cloned.isComment = vnode.isComment;
  13068. cloned.fnContext = vnode.fnContext;
  13069. cloned.fnOptions = vnode.fnOptions;
  13070. cloned.fnScopeId = vnode.fnScopeId;
  13071. cloned.asyncMeta = vnode.asyncMeta;
  13072. cloned.isCloned = true;
  13073. return cloned
  13074. }
  13075. /*
  13076. * not type checking this file because flow doesn't play well with
  13077. * dynamically accessing methods on Array prototype
  13078. */
  13079. var arrayProto = Array.prototype;
  13080. var arrayMethods = Object.create(arrayProto);
  13081. var methodsToPatch = [
  13082. 'push',
  13083. 'pop',
  13084. 'shift',
  13085. 'unshift',
  13086. 'splice',
  13087. 'sort',
  13088. 'reverse'
  13089. ];
  13090. /**
  13091. * Intercept mutating methods and emit events
  13092. */
  13093. methodsToPatch.forEach(function (method) {
  13094. // cache original method
  13095. var original = arrayProto[method];
  13096. def(arrayMethods, method, function mutator () {
  13097. var args = [], len = arguments.length;
  13098. while ( len-- ) args[ len ] = arguments[ len ];
  13099. var result = original.apply(this, args);
  13100. var ob = this.__ob__;
  13101. var inserted;
  13102. switch (method) {
  13103. case 'push':
  13104. case 'unshift':
  13105. inserted = args;
  13106. break
  13107. case 'splice':
  13108. inserted = args.slice(2);
  13109. break
  13110. }
  13111. if (inserted) { ob.observeArray(inserted); }
  13112. // notify change
  13113. ob.dep.notify();
  13114. return result
  13115. });
  13116. });
  13117. /* */
  13118. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  13119. /**
  13120. * In some cases we may want to disable observation inside a component's
  13121. * update computation.
  13122. */
  13123. var shouldObserve = true;
  13124. function toggleObserving (value) {
  13125. shouldObserve = value;
  13126. }
  13127. /**
  13128. * Observer class that is attached to each observed
  13129. * object. Once attached, the observer converts the target
  13130. * object's property keys into getter/setters that
  13131. * collect dependencies and dispatch updates.
  13132. */
  13133. var Observer = function Observer (value) {
  13134. this.value = value;
  13135. this.dep = new Dep();
  13136. this.vmCount = 0;
  13137. def(value, '__ob__', this);
  13138. if (Array.isArray(value)) {
  13139. if (hasProto) {
  13140. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  13141. if(value.push !== value.__proto__.push){
  13142. copyAugment(value, arrayMethods, arrayKeys);
  13143. } else {
  13144. protoAugment(value, arrayMethods);
  13145. }
  13146. }
  13147. } else {
  13148. copyAugment(value, arrayMethods, arrayKeys);
  13149. }
  13150. this.observeArray(value);
  13151. } else {
  13152. this.walk(value);
  13153. }
  13154. };
  13155. /**
  13156. * Walk through all properties and convert them into
  13157. * getter/setters. This method should only be called when
  13158. * value type is Object.
  13159. */
  13160. Observer.prototype.walk = function walk (obj) {
  13161. var keys = Object.keys(obj);
  13162. for (var i = 0; i < keys.length; i++) {
  13163. defineReactive$$1(obj, keys[i]);
  13164. }
  13165. };
  13166. /**
  13167. * Observe a list of Array items.
  13168. */
  13169. Observer.prototype.observeArray = function observeArray (items) {
  13170. for (var i = 0, l = items.length; i < l; i++) {
  13171. observe(items[i]);
  13172. }
  13173. };
  13174. // helpers
  13175. /**
  13176. * Augment a target Object or Array by intercepting
  13177. * the prototype chain using __proto__
  13178. */
  13179. function protoAugment (target, src) {
  13180. /* eslint-disable no-proto */
  13181. target.__proto__ = src;
  13182. /* eslint-enable no-proto */
  13183. }
  13184. /**
  13185. * Augment a target Object or Array by defining
  13186. * hidden properties.
  13187. */
  13188. /* istanbul ignore next */
  13189. function copyAugment (target, src, keys) {
  13190. for (var i = 0, l = keys.length; i < l; i++) {
  13191. var key = keys[i];
  13192. def(target, key, src[key]);
  13193. }
  13194. }
  13195. /**
  13196. * Attempt to create an observer instance for a value,
  13197. * returns the new observer if successfully observed,
  13198. * or the existing observer if the value already has one.
  13199. */
  13200. function observe (value, asRootData) {
  13201. if (!isObject(value) || value instanceof VNode) {
  13202. return
  13203. }
  13204. var ob;
  13205. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  13206. ob = value.__ob__;
  13207. } else if (
  13208. shouldObserve &&
  13209. !isServerRendering() &&
  13210. (Array.isArray(value) || isPlainObject(value)) &&
  13211. Object.isExtensible(value) &&
  13212. !value._isVue &&
  13213. !value.__v_isMPComponent
  13214. ) {
  13215. ob = new Observer(value);
  13216. }
  13217. if (asRootData && ob) {
  13218. ob.vmCount++;
  13219. }
  13220. return ob
  13221. }
  13222. /**
  13223. * Define a reactive property on an Object.
  13224. */
  13225. function defineReactive$$1 (
  13226. obj,
  13227. key,
  13228. val,
  13229. customSetter,
  13230. shallow
  13231. ) {
  13232. var dep = new Dep();
  13233. var property = Object.getOwnPropertyDescriptor(obj, key);
  13234. if (property && property.configurable === false) {
  13235. return
  13236. }
  13237. // cater for pre-defined getter/setters
  13238. var getter = property && property.get;
  13239. var setter = property && property.set;
  13240. if ((!getter || setter) && arguments.length === 2) {
  13241. val = obj[key];
  13242. }
  13243. var childOb = !shallow && observe(val);
  13244. Object.defineProperty(obj, key, {
  13245. enumerable: true,
  13246. configurable: true,
  13247. get: function reactiveGetter () {
  13248. var value = getter ? getter.call(obj) : val;
  13249. if (Dep.SharedObject.target) { // fixed by xxxxxx
  13250. dep.depend();
  13251. if (childOb) {
  13252. childOb.dep.depend();
  13253. if (Array.isArray(value)) {
  13254. dependArray(value);
  13255. }
  13256. }
  13257. }
  13258. return value
  13259. },
  13260. set: function reactiveSetter (newVal) {
  13261. var value = getter ? getter.call(obj) : val;
  13262. /* eslint-disable no-self-compare */
  13263. if (newVal === value || (newVal !== newVal && value !== value)) {
  13264. return
  13265. }
  13266. /* eslint-enable no-self-compare */
  13267. if ( true && customSetter) {
  13268. customSetter();
  13269. }
  13270. // #7981: for accessor properties without setter
  13271. if (getter && !setter) { return }
  13272. if (setter) {
  13273. setter.call(obj, newVal);
  13274. } else {
  13275. val = newVal;
  13276. }
  13277. childOb = !shallow && observe(newVal);
  13278. dep.notify();
  13279. }
  13280. });
  13281. }
  13282. /**
  13283. * Set a property on an object. Adds the new property and
  13284. * triggers change notification if the property doesn't
  13285. * already exist.
  13286. */
  13287. function set (target, key, val) {
  13288. if ( true &&
  13289. (isUndef(target) || isPrimitive(target))
  13290. ) {
  13291. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  13292. }
  13293. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13294. target.length = Math.max(target.length, key);
  13295. target.splice(key, 1, val);
  13296. return val
  13297. }
  13298. if (key in target && !(key in Object.prototype)) {
  13299. target[key] = val;
  13300. return val
  13301. }
  13302. var ob = (target).__ob__;
  13303. if (target._isVue || (ob && ob.vmCount)) {
  13304. true && warn(
  13305. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  13306. 'at runtime - declare it upfront in the data option.'
  13307. );
  13308. return val
  13309. }
  13310. if (!ob) {
  13311. target[key] = val;
  13312. return val
  13313. }
  13314. defineReactive$$1(ob.value, key, val);
  13315. ob.dep.notify();
  13316. return val
  13317. }
  13318. /**
  13319. * Delete a property and trigger change if necessary.
  13320. */
  13321. function del (target, key) {
  13322. if ( true &&
  13323. (isUndef(target) || isPrimitive(target))
  13324. ) {
  13325. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  13326. }
  13327. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13328. target.splice(key, 1);
  13329. return
  13330. }
  13331. var ob = (target).__ob__;
  13332. if (target._isVue || (ob && ob.vmCount)) {
  13333. true && warn(
  13334. 'Avoid deleting properties on a Vue instance or its root $data ' +
  13335. '- just set it to null.'
  13336. );
  13337. return
  13338. }
  13339. if (!hasOwn(target, key)) {
  13340. return
  13341. }
  13342. delete target[key];
  13343. if (!ob) {
  13344. return
  13345. }
  13346. ob.dep.notify();
  13347. }
  13348. /**
  13349. * Collect dependencies on array elements when the array is touched, since
  13350. * we cannot intercept array element access like property getters.
  13351. */
  13352. function dependArray (value) {
  13353. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  13354. e = value[i];
  13355. e && e.__ob__ && e.__ob__.dep.depend();
  13356. if (Array.isArray(e)) {
  13357. dependArray(e);
  13358. }
  13359. }
  13360. }
  13361. /* */
  13362. /**
  13363. * Option overwriting strategies are functions that handle
  13364. * how to merge a parent option value and a child option
  13365. * value into the final value.
  13366. */
  13367. var strats = config.optionMergeStrategies;
  13368. /**
  13369. * Options with restrictions
  13370. */
  13371. if (true) {
  13372. strats.el = strats.propsData = function (parent, child, vm, key) {
  13373. if (!vm) {
  13374. warn(
  13375. "option \"" + key + "\" can only be used during instance " +
  13376. 'creation with the `new` keyword.'
  13377. );
  13378. }
  13379. return defaultStrat(parent, child)
  13380. };
  13381. }
  13382. /**
  13383. * Helper that recursively merges two data objects together.
  13384. */
  13385. function mergeData (to, from) {
  13386. if (!from) { return to }
  13387. var key, toVal, fromVal;
  13388. var keys = hasSymbol
  13389. ? Reflect.ownKeys(from)
  13390. : Object.keys(from);
  13391. for (var i = 0; i < keys.length; i++) {
  13392. key = keys[i];
  13393. // in case the object is already observed...
  13394. if (key === '__ob__') { continue }
  13395. toVal = to[key];
  13396. fromVal = from[key];
  13397. if (!hasOwn(to, key)) {
  13398. set(to, key, fromVal);
  13399. } else if (
  13400. toVal !== fromVal &&
  13401. isPlainObject(toVal) &&
  13402. isPlainObject(fromVal)
  13403. ) {
  13404. mergeData(toVal, fromVal);
  13405. }
  13406. }
  13407. return to
  13408. }
  13409. /**
  13410. * Data
  13411. */
  13412. function mergeDataOrFn (
  13413. parentVal,
  13414. childVal,
  13415. vm
  13416. ) {
  13417. if (!vm) {
  13418. // in a Vue.extend merge, both should be functions
  13419. if (!childVal) {
  13420. return parentVal
  13421. }
  13422. if (!parentVal) {
  13423. return childVal
  13424. }
  13425. // when parentVal & childVal are both present,
  13426. // we need to return a function that returns the
  13427. // merged result of both functions... no need to
  13428. // check if parentVal is a function here because
  13429. // it has to be a function to pass previous merges.
  13430. return function mergedDataFn () {
  13431. return mergeData(
  13432. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  13433. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  13434. )
  13435. }
  13436. } else {
  13437. return function mergedInstanceDataFn () {
  13438. // instance merge
  13439. var instanceData = typeof childVal === 'function'
  13440. ? childVal.call(vm, vm)
  13441. : childVal;
  13442. var defaultData = typeof parentVal === 'function'
  13443. ? parentVal.call(vm, vm)
  13444. : parentVal;
  13445. if (instanceData) {
  13446. return mergeData(instanceData, defaultData)
  13447. } else {
  13448. return defaultData
  13449. }
  13450. }
  13451. }
  13452. }
  13453. strats.data = function (
  13454. parentVal,
  13455. childVal,
  13456. vm
  13457. ) {
  13458. if (!vm) {
  13459. if (childVal && typeof childVal !== 'function') {
  13460. true && warn(
  13461. 'The "data" option should be a function ' +
  13462. 'that returns a per-instance value in component ' +
  13463. 'definitions.',
  13464. vm
  13465. );
  13466. return parentVal
  13467. }
  13468. return mergeDataOrFn(parentVal, childVal)
  13469. }
  13470. return mergeDataOrFn(parentVal, childVal, vm)
  13471. };
  13472. /**
  13473. * Hooks and props are merged as arrays.
  13474. */
  13475. function mergeHook (
  13476. parentVal,
  13477. childVal
  13478. ) {
  13479. var res = childVal
  13480. ? parentVal
  13481. ? parentVal.concat(childVal)
  13482. : Array.isArray(childVal)
  13483. ? childVal
  13484. : [childVal]
  13485. : parentVal;
  13486. return res
  13487. ? dedupeHooks(res)
  13488. : res
  13489. }
  13490. function dedupeHooks (hooks) {
  13491. var res = [];
  13492. for (var i = 0; i < hooks.length; i++) {
  13493. if (res.indexOf(hooks[i]) === -1) {
  13494. res.push(hooks[i]);
  13495. }
  13496. }
  13497. return res
  13498. }
  13499. LIFECYCLE_HOOKS.forEach(function (hook) {
  13500. strats[hook] = mergeHook;
  13501. });
  13502. /**
  13503. * Assets
  13504. *
  13505. * When a vm is present (instance creation), we need to do
  13506. * a three-way merge between constructor options, instance
  13507. * options and parent options.
  13508. */
  13509. function mergeAssets (
  13510. parentVal,
  13511. childVal,
  13512. vm,
  13513. key
  13514. ) {
  13515. var res = Object.create(parentVal || null);
  13516. if (childVal) {
  13517. true && assertObjectType(key, childVal, vm);
  13518. return extend(res, childVal)
  13519. } else {
  13520. return res
  13521. }
  13522. }
  13523. ASSET_TYPES.forEach(function (type) {
  13524. strats[type + 's'] = mergeAssets;
  13525. });
  13526. /**
  13527. * Watchers.
  13528. *
  13529. * Watchers hashes should not overwrite one
  13530. * another, so we merge them as arrays.
  13531. */
  13532. strats.watch = function (
  13533. parentVal,
  13534. childVal,
  13535. vm,
  13536. key
  13537. ) {
  13538. // work around Firefox's Object.prototype.watch...
  13539. if (parentVal === nativeWatch) { parentVal = undefined; }
  13540. if (childVal === nativeWatch) { childVal = undefined; }
  13541. /* istanbul ignore if */
  13542. if (!childVal) { return Object.create(parentVal || null) }
  13543. if (true) {
  13544. assertObjectType(key, childVal, vm);
  13545. }
  13546. if (!parentVal) { return childVal }
  13547. var ret = {};
  13548. extend(ret, parentVal);
  13549. for (var key$1 in childVal) {
  13550. var parent = ret[key$1];
  13551. var child = childVal[key$1];
  13552. if (parent && !Array.isArray(parent)) {
  13553. parent = [parent];
  13554. }
  13555. ret[key$1] = parent
  13556. ? parent.concat(child)
  13557. : Array.isArray(child) ? child : [child];
  13558. }
  13559. return ret
  13560. };
  13561. /**
  13562. * Other object hashes.
  13563. */
  13564. strats.props =
  13565. strats.methods =
  13566. strats.inject =
  13567. strats.computed = function (
  13568. parentVal,
  13569. childVal,
  13570. vm,
  13571. key
  13572. ) {
  13573. if (childVal && "development" !== 'production') {
  13574. assertObjectType(key, childVal, vm);
  13575. }
  13576. if (!parentVal) { return childVal }
  13577. var ret = Object.create(null);
  13578. extend(ret, parentVal);
  13579. if (childVal) { extend(ret, childVal); }
  13580. return ret
  13581. };
  13582. strats.provide = mergeDataOrFn;
  13583. /**
  13584. * Default strategy.
  13585. */
  13586. var defaultStrat = function (parentVal, childVal) {
  13587. return childVal === undefined
  13588. ? parentVal
  13589. : childVal
  13590. };
  13591. /**
  13592. * Validate component names
  13593. */
  13594. function checkComponents (options) {
  13595. for (var key in options.components) {
  13596. validateComponentName(key);
  13597. }
  13598. }
  13599. function validateComponentName (name) {
  13600. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  13601. warn(
  13602. 'Invalid component name: "' + name + '". Component names ' +
  13603. 'should conform to valid custom element name in html5 specification.'
  13604. );
  13605. }
  13606. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  13607. warn(
  13608. 'Do not use built-in or reserved HTML elements as component ' +
  13609. 'id: ' + name
  13610. );
  13611. }
  13612. }
  13613. /**
  13614. * Ensure all props option syntax are normalized into the
  13615. * Object-based format.
  13616. */
  13617. function normalizeProps (options, vm) {
  13618. var props = options.props;
  13619. if (!props) { return }
  13620. var res = {};
  13621. var i, val, name;
  13622. if (Array.isArray(props)) {
  13623. i = props.length;
  13624. while (i--) {
  13625. val = props[i];
  13626. if (typeof val === 'string') {
  13627. name = camelize(val);
  13628. res[name] = { type: null };
  13629. } else if (true) {
  13630. warn('props must be strings when using array syntax.');
  13631. }
  13632. }
  13633. } else if (isPlainObject(props)) {
  13634. for (var key in props) {
  13635. val = props[key];
  13636. name = camelize(key);
  13637. res[name] = isPlainObject(val)
  13638. ? val
  13639. : { type: val };
  13640. }
  13641. } else if (true) {
  13642. warn(
  13643. "Invalid value for option \"props\": expected an Array or an Object, " +
  13644. "but got " + (toRawType(props)) + ".",
  13645. vm
  13646. );
  13647. }
  13648. options.props = res;
  13649. }
  13650. /**
  13651. * Normalize all injections into Object-based format
  13652. */
  13653. function normalizeInject (options, vm) {
  13654. var inject = options.inject;
  13655. if (!inject) { return }
  13656. var normalized = options.inject = {};
  13657. if (Array.isArray(inject)) {
  13658. for (var i = 0; i < inject.length; i++) {
  13659. normalized[inject[i]] = { from: inject[i] };
  13660. }
  13661. } else if (isPlainObject(inject)) {
  13662. for (var key in inject) {
  13663. var val = inject[key];
  13664. normalized[key] = isPlainObject(val)
  13665. ? extend({ from: key }, val)
  13666. : { from: val };
  13667. }
  13668. } else if (true) {
  13669. warn(
  13670. "Invalid value for option \"inject\": expected an Array or an Object, " +
  13671. "but got " + (toRawType(inject)) + ".",
  13672. vm
  13673. );
  13674. }
  13675. }
  13676. /**
  13677. * Normalize raw function directives into object format.
  13678. */
  13679. function normalizeDirectives (options) {
  13680. var dirs = options.directives;
  13681. if (dirs) {
  13682. for (var key in dirs) {
  13683. var def$$1 = dirs[key];
  13684. if (typeof def$$1 === 'function') {
  13685. dirs[key] = { bind: def$$1, update: def$$1 };
  13686. }
  13687. }
  13688. }
  13689. }
  13690. function assertObjectType (name, value, vm) {
  13691. if (!isPlainObject(value)) {
  13692. warn(
  13693. "Invalid value for option \"" + name + "\": expected an Object, " +
  13694. "but got " + (toRawType(value)) + ".",
  13695. vm
  13696. );
  13697. }
  13698. }
  13699. /**
  13700. * Merge two option objects into a new one.
  13701. * Core utility used in both instantiation and inheritance.
  13702. */
  13703. function mergeOptions (
  13704. parent,
  13705. child,
  13706. vm
  13707. ) {
  13708. if (true) {
  13709. checkComponents(child);
  13710. }
  13711. if (typeof child === 'function') {
  13712. child = child.options;
  13713. }
  13714. normalizeProps(child, vm);
  13715. normalizeInject(child, vm);
  13716. normalizeDirectives(child);
  13717. // Apply extends and mixins on the child options,
  13718. // but only if it is a raw options object that isn't
  13719. // the result of another mergeOptions call.
  13720. // Only merged options has the _base property.
  13721. if (!child._base) {
  13722. if (child.extends) {
  13723. parent = mergeOptions(parent, child.extends, vm);
  13724. }
  13725. if (child.mixins) {
  13726. for (var i = 0, l = child.mixins.length; i < l; i++) {
  13727. parent = mergeOptions(parent, child.mixins[i], vm);
  13728. }
  13729. }
  13730. }
  13731. var options = {};
  13732. var key;
  13733. for (key in parent) {
  13734. mergeField(key);
  13735. }
  13736. for (key in child) {
  13737. if (!hasOwn(parent, key)) {
  13738. mergeField(key);
  13739. }
  13740. }
  13741. function mergeField (key) {
  13742. var strat = strats[key] || defaultStrat;
  13743. options[key] = strat(parent[key], child[key], vm, key);
  13744. }
  13745. return options
  13746. }
  13747. /**
  13748. * Resolve an asset.
  13749. * This function is used because child instances need access
  13750. * to assets defined in its ancestor chain.
  13751. */
  13752. function resolveAsset (
  13753. options,
  13754. type,
  13755. id,
  13756. warnMissing
  13757. ) {
  13758. /* istanbul ignore if */
  13759. if (typeof id !== 'string') {
  13760. return
  13761. }
  13762. var assets = options[type];
  13763. // check local registration variations first
  13764. if (hasOwn(assets, id)) { return assets[id] }
  13765. var camelizedId = camelize(id);
  13766. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  13767. var PascalCaseId = capitalize(camelizedId);
  13768. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  13769. // fallback to prototype chain
  13770. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  13771. if ( true && warnMissing && !res) {
  13772. warn(
  13773. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  13774. options
  13775. );
  13776. }
  13777. return res
  13778. }
  13779. /* */
  13780. function validateProp (
  13781. key,
  13782. propOptions,
  13783. propsData,
  13784. vm
  13785. ) {
  13786. var prop = propOptions[key];
  13787. var absent = !hasOwn(propsData, key);
  13788. var value = propsData[key];
  13789. // boolean casting
  13790. var booleanIndex = getTypeIndex(Boolean, prop.type);
  13791. if (booleanIndex > -1) {
  13792. if (absent && !hasOwn(prop, 'default')) {
  13793. value = false;
  13794. } else if (value === '' || value === hyphenate(key)) {
  13795. // only cast empty string / same name to boolean if
  13796. // boolean has higher priority
  13797. var stringIndex = getTypeIndex(String, prop.type);
  13798. if (stringIndex < 0 || booleanIndex < stringIndex) {
  13799. value = true;
  13800. }
  13801. }
  13802. }
  13803. // check default value
  13804. if (value === undefined) {
  13805. value = getPropDefaultValue(vm, prop, key);
  13806. // since the default value is a fresh copy,
  13807. // make sure to observe it.
  13808. var prevShouldObserve = shouldObserve;
  13809. toggleObserving(true);
  13810. observe(value);
  13811. toggleObserving(prevShouldObserve);
  13812. }
  13813. if (
  13814. true
  13815. ) {
  13816. assertProp(prop, key, value, vm, absent);
  13817. }
  13818. return value
  13819. }
  13820. /**
  13821. * Get the default value of a prop.
  13822. */
  13823. function getPropDefaultValue (vm, prop, key) {
  13824. // no default, return undefined
  13825. if (!hasOwn(prop, 'default')) {
  13826. return undefined
  13827. }
  13828. var def = prop.default;
  13829. // warn against non-factory defaults for Object & Array
  13830. if ( true && isObject(def)) {
  13831. warn(
  13832. 'Invalid default value for prop "' + key + '": ' +
  13833. 'Props with type Object/Array must use a factory function ' +
  13834. 'to return the default value.',
  13835. vm
  13836. );
  13837. }
  13838. // the raw prop value was also undefined from previous render,
  13839. // return previous default value to avoid unnecessary watcher trigger
  13840. if (vm && vm.$options.propsData &&
  13841. vm.$options.propsData[key] === undefined &&
  13842. vm._props[key] !== undefined
  13843. ) {
  13844. return vm._props[key]
  13845. }
  13846. // call factory function for non-Function types
  13847. // a value is Function if its prototype is function even across different execution context
  13848. return typeof def === 'function' && getType(prop.type) !== 'Function'
  13849. ? def.call(vm)
  13850. : def
  13851. }
  13852. /**
  13853. * Assert whether a prop is valid.
  13854. */
  13855. function assertProp (
  13856. prop,
  13857. name,
  13858. value,
  13859. vm,
  13860. absent
  13861. ) {
  13862. if (prop.required && absent) {
  13863. warn(
  13864. 'Missing required prop: "' + name + '"',
  13865. vm
  13866. );
  13867. return
  13868. }
  13869. if (value == null && !prop.required) {
  13870. return
  13871. }
  13872. var type = prop.type;
  13873. var valid = !type || type === true;
  13874. var expectedTypes = [];
  13875. if (type) {
  13876. if (!Array.isArray(type)) {
  13877. type = [type];
  13878. }
  13879. for (var i = 0; i < type.length && !valid; i++) {
  13880. var assertedType = assertType(value, type[i]);
  13881. expectedTypes.push(assertedType.expectedType || '');
  13882. valid = assertedType.valid;
  13883. }
  13884. }
  13885. if (!valid) {
  13886. warn(
  13887. getInvalidTypeMessage(name, value, expectedTypes),
  13888. vm
  13889. );
  13890. return
  13891. }
  13892. var validator = prop.validator;
  13893. if (validator) {
  13894. if (!validator(value)) {
  13895. warn(
  13896. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  13897. vm
  13898. );
  13899. }
  13900. }
  13901. }
  13902. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  13903. function assertType (value, type) {
  13904. var valid;
  13905. var expectedType = getType(type);
  13906. if (simpleCheckRE.test(expectedType)) {
  13907. var t = typeof value;
  13908. valid = t === expectedType.toLowerCase();
  13909. // for primitive wrapper objects
  13910. if (!valid && t === 'object') {
  13911. valid = value instanceof type;
  13912. }
  13913. } else if (expectedType === 'Object') {
  13914. valid = isPlainObject(value);
  13915. } else if (expectedType === 'Array') {
  13916. valid = Array.isArray(value);
  13917. } else {
  13918. valid = value instanceof type;
  13919. }
  13920. return {
  13921. valid: valid,
  13922. expectedType: expectedType
  13923. }
  13924. }
  13925. /**
  13926. * Use function string name to check built-in types,
  13927. * because a simple equality check will fail when running
  13928. * across different vms / iframes.
  13929. */
  13930. function getType (fn) {
  13931. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  13932. return match ? match[1] : ''
  13933. }
  13934. function isSameType (a, b) {
  13935. return getType(a) === getType(b)
  13936. }
  13937. function getTypeIndex (type, expectedTypes) {
  13938. if (!Array.isArray(expectedTypes)) {
  13939. return isSameType(expectedTypes, type) ? 0 : -1
  13940. }
  13941. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  13942. if (isSameType(expectedTypes[i], type)) {
  13943. return i
  13944. }
  13945. }
  13946. return -1
  13947. }
  13948. function getInvalidTypeMessage (name, value, expectedTypes) {
  13949. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  13950. " Expected " + (expectedTypes.map(capitalize).join(', '));
  13951. var expectedType = expectedTypes[0];
  13952. var receivedType = toRawType(value);
  13953. var expectedValue = styleValue(value, expectedType);
  13954. var receivedValue = styleValue(value, receivedType);
  13955. // check if we need to specify expected value
  13956. if (expectedTypes.length === 1 &&
  13957. isExplicable(expectedType) &&
  13958. !isBoolean(expectedType, receivedType)) {
  13959. message += " with value " + expectedValue;
  13960. }
  13961. message += ", got " + receivedType + " ";
  13962. // check if we need to specify received value
  13963. if (isExplicable(receivedType)) {
  13964. message += "with value " + receivedValue + ".";
  13965. }
  13966. return message
  13967. }
  13968. function styleValue (value, type) {
  13969. if (type === 'String') {
  13970. return ("\"" + value + "\"")
  13971. } else if (type === 'Number') {
  13972. return ("" + (Number(value)))
  13973. } else {
  13974. return ("" + value)
  13975. }
  13976. }
  13977. function isExplicable (value) {
  13978. var explicitTypes = ['string', 'number', 'boolean'];
  13979. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  13980. }
  13981. function isBoolean () {
  13982. var args = [], len = arguments.length;
  13983. while ( len-- ) args[ len ] = arguments[ len ];
  13984. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  13985. }
  13986. /* */
  13987. function handleError (err, vm, info) {
  13988. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  13989. // See: https://github.com/vuejs/vuex/issues/1505
  13990. pushTarget();
  13991. try {
  13992. if (vm) {
  13993. var cur = vm;
  13994. while ((cur = cur.$parent)) {
  13995. var hooks = cur.$options.errorCaptured;
  13996. if (hooks) {
  13997. for (var i = 0; i < hooks.length; i++) {
  13998. try {
  13999. var capture = hooks[i].call(cur, err, vm, info) === false;
  14000. if (capture) { return }
  14001. } catch (e) {
  14002. globalHandleError(e, cur, 'errorCaptured hook');
  14003. }
  14004. }
  14005. }
  14006. }
  14007. }
  14008. globalHandleError(err, vm, info);
  14009. } finally {
  14010. popTarget();
  14011. }
  14012. }
  14013. function invokeWithErrorHandling (
  14014. handler,
  14015. context,
  14016. args,
  14017. vm,
  14018. info
  14019. ) {
  14020. var res;
  14021. try {
  14022. res = args ? handler.apply(context, args) : handler.call(context);
  14023. if (res && !res._isVue && isPromise(res) && !res._handled) {
  14024. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  14025. // issue #9511
  14026. // avoid catch triggering multiple times when nested calls
  14027. res._handled = true;
  14028. }
  14029. } catch (e) {
  14030. handleError(e, vm, info);
  14031. }
  14032. return res
  14033. }
  14034. function globalHandleError (err, vm, info) {
  14035. if (config.errorHandler) {
  14036. try {
  14037. return config.errorHandler.call(null, err, vm, info)
  14038. } catch (e) {
  14039. // if the user intentionally throws the original error in the handler,
  14040. // do not log it twice
  14041. if (e !== err) {
  14042. logError(e, null, 'config.errorHandler');
  14043. }
  14044. }
  14045. }
  14046. logError(err, vm, info);
  14047. }
  14048. function logError (err, vm, info) {
  14049. if (true) {
  14050. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  14051. }
  14052. /* istanbul ignore else */
  14053. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  14054. console.error(err);
  14055. } else {
  14056. throw err
  14057. }
  14058. }
  14059. /* */
  14060. var callbacks = [];
  14061. var pending = false;
  14062. function flushCallbacks () {
  14063. pending = false;
  14064. var copies = callbacks.slice(0);
  14065. callbacks.length = 0;
  14066. for (var i = 0; i < copies.length; i++) {
  14067. copies[i]();
  14068. }
  14069. }
  14070. // Here we have async deferring wrappers using microtasks.
  14071. // In 2.5 we used (macro) tasks (in combination with microtasks).
  14072. // However, it has subtle problems when state is changed right before repaint
  14073. // (e.g. #6813, out-in transitions).
  14074. // Also, using (macro) tasks in event handler would cause some weird behaviors
  14075. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  14076. // So we now use microtasks everywhere, again.
  14077. // A major drawback of this tradeoff is that there are some scenarios
  14078. // where microtasks have too high a priority and fire in between supposedly
  14079. // sequential events (e.g. #4521, #6690, which have workarounds)
  14080. // or even between bubbling of the same event (#6566).
  14081. var timerFunc;
  14082. // The nextTick behavior leverages the microtask queue, which can be accessed
  14083. // via either native Promise.then or MutationObserver.
  14084. // MutationObserver has wider support, however it is seriously bugged in
  14085. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  14086. // completely stops working after triggering a few times... so, if native
  14087. // Promise is available, we will use it:
  14088. /* istanbul ignore next, $flow-disable-line */
  14089. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  14090. var p = Promise.resolve();
  14091. timerFunc = function () {
  14092. p.then(flushCallbacks);
  14093. // In problematic UIWebViews, Promise.then doesn't completely break, but
  14094. // it can get stuck in a weird state where callbacks are pushed into the
  14095. // microtask queue but the queue isn't being flushed, until the browser
  14096. // needs to do some other work, e.g. handle a timer. Therefore we can
  14097. // "force" the microtask queue to be flushed by adding an empty timer.
  14098. if (isIOS) { setTimeout(noop); }
  14099. };
  14100. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  14101. isNative(MutationObserver) ||
  14102. // PhantomJS and iOS 7.x
  14103. MutationObserver.toString() === '[object MutationObserverConstructor]'
  14104. )) {
  14105. // Use MutationObserver where native Promise is not available,
  14106. // e.g. PhantomJS, iOS7, Android 4.4
  14107. // (#6466 MutationObserver is unreliable in IE11)
  14108. var counter = 1;
  14109. var observer = new MutationObserver(flushCallbacks);
  14110. var textNode = document.createTextNode(String(counter));
  14111. observer.observe(textNode, {
  14112. characterData: true
  14113. });
  14114. timerFunc = function () {
  14115. counter = (counter + 1) % 2;
  14116. textNode.data = String(counter);
  14117. };
  14118. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  14119. // Fallback to setImmediate.
  14120. // Technically it leverages the (macro) task queue,
  14121. // but it is still a better choice than setTimeout.
  14122. timerFunc = function () {
  14123. setImmediate(flushCallbacks);
  14124. };
  14125. } else {
  14126. // Fallback to setTimeout.
  14127. timerFunc = function () {
  14128. setTimeout(flushCallbacks, 0);
  14129. };
  14130. }
  14131. function nextTick (cb, ctx) {
  14132. var _resolve;
  14133. callbacks.push(function () {
  14134. if (cb) {
  14135. try {
  14136. cb.call(ctx);
  14137. } catch (e) {
  14138. handleError(e, ctx, 'nextTick');
  14139. }
  14140. } else if (_resolve) {
  14141. _resolve(ctx);
  14142. }
  14143. });
  14144. if (!pending) {
  14145. pending = true;
  14146. timerFunc();
  14147. }
  14148. // $flow-disable-line
  14149. if (!cb && typeof Promise !== 'undefined') {
  14150. return new Promise(function (resolve) {
  14151. _resolve = resolve;
  14152. })
  14153. }
  14154. }
  14155. /* */
  14156. /* not type checking this file because flow doesn't play well with Proxy */
  14157. var initProxy;
  14158. if (true) {
  14159. var allowedGlobals = makeMap(
  14160. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  14161. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  14162. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  14163. 'require' // for Webpack/Browserify
  14164. );
  14165. var warnNonPresent = function (target, key) {
  14166. warn(
  14167. "Property or method \"" + key + "\" is not defined on the instance but " +
  14168. 'referenced during render. Make sure that this property is reactive, ' +
  14169. 'either in the data option, or for class-based components, by ' +
  14170. 'initializing the property. ' +
  14171. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  14172. target
  14173. );
  14174. };
  14175. var warnReservedPrefix = function (target, key) {
  14176. warn(
  14177. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  14178. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  14179. 'prevent conflicts with Vue internals. ' +
  14180. 'See: https://vuejs.org/v2/api/#data',
  14181. target
  14182. );
  14183. };
  14184. var hasProxy =
  14185. typeof Proxy !== 'undefined' && isNative(Proxy);
  14186. if (hasProxy) {
  14187. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  14188. config.keyCodes = new Proxy(config.keyCodes, {
  14189. set: function set (target, key, value) {
  14190. if (isBuiltInModifier(key)) {
  14191. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  14192. return false
  14193. } else {
  14194. target[key] = value;
  14195. return true
  14196. }
  14197. }
  14198. });
  14199. }
  14200. var hasHandler = {
  14201. has: function has (target, key) {
  14202. var has = key in target;
  14203. var isAllowed = allowedGlobals(key) ||
  14204. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  14205. if (!has && !isAllowed) {
  14206. if (key in target.$data) { warnReservedPrefix(target, key); }
  14207. else { warnNonPresent(target, key); }
  14208. }
  14209. return has || !isAllowed
  14210. }
  14211. };
  14212. var getHandler = {
  14213. get: function get (target, key) {
  14214. if (typeof key === 'string' && !(key in target)) {
  14215. if (key in target.$data) { warnReservedPrefix(target, key); }
  14216. else { warnNonPresent(target, key); }
  14217. }
  14218. return target[key]
  14219. }
  14220. };
  14221. initProxy = function initProxy (vm) {
  14222. if (hasProxy) {
  14223. // determine which proxy handler to use
  14224. var options = vm.$options;
  14225. var handlers = options.render && options.render._withStripped
  14226. ? getHandler
  14227. : hasHandler;
  14228. vm._renderProxy = new Proxy(vm, handlers);
  14229. } else {
  14230. vm._renderProxy = vm;
  14231. }
  14232. };
  14233. }
  14234. /* */
  14235. var seenObjects = new _Set();
  14236. /**
  14237. * Recursively traverse an object to evoke all converted
  14238. * getters, so that every nested property inside the object
  14239. * is collected as a "deep" dependency.
  14240. */
  14241. function traverse (val) {
  14242. _traverse(val, seenObjects);
  14243. seenObjects.clear();
  14244. }
  14245. function _traverse (val, seen) {
  14246. var i, keys;
  14247. var isA = Array.isArray(val);
  14248. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  14249. return
  14250. }
  14251. if (val.__ob__) {
  14252. var depId = val.__ob__.dep.id;
  14253. if (seen.has(depId)) {
  14254. return
  14255. }
  14256. seen.add(depId);
  14257. }
  14258. if (isA) {
  14259. i = val.length;
  14260. while (i--) { _traverse(val[i], seen); }
  14261. } else {
  14262. keys = Object.keys(val);
  14263. i = keys.length;
  14264. while (i--) { _traverse(val[keys[i]], seen); }
  14265. }
  14266. }
  14267. var mark;
  14268. var measure;
  14269. if (true) {
  14270. var perf = inBrowser && window.performance;
  14271. /* istanbul ignore if */
  14272. if (
  14273. perf &&
  14274. perf.mark &&
  14275. perf.measure &&
  14276. perf.clearMarks &&
  14277. perf.clearMeasures
  14278. ) {
  14279. mark = function (tag) { return perf.mark(tag); };
  14280. measure = function (name, startTag, endTag) {
  14281. perf.measure(name, startTag, endTag);
  14282. perf.clearMarks(startTag);
  14283. perf.clearMarks(endTag);
  14284. // perf.clearMeasures(name)
  14285. };
  14286. }
  14287. }
  14288. /* */
  14289. var normalizeEvent = cached(function (name) {
  14290. var passive = name.charAt(0) === '&';
  14291. name = passive ? name.slice(1) : name;
  14292. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  14293. name = once$$1 ? name.slice(1) : name;
  14294. var capture = name.charAt(0) === '!';
  14295. name = capture ? name.slice(1) : name;
  14296. return {
  14297. name: name,
  14298. once: once$$1,
  14299. capture: capture,
  14300. passive: passive
  14301. }
  14302. });
  14303. function createFnInvoker (fns, vm) {
  14304. function invoker () {
  14305. var arguments$1 = arguments;
  14306. var fns = invoker.fns;
  14307. if (Array.isArray(fns)) {
  14308. var cloned = fns.slice();
  14309. for (var i = 0; i < cloned.length; i++) {
  14310. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  14311. }
  14312. } else {
  14313. // return handler return value for single handlers
  14314. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  14315. }
  14316. }
  14317. invoker.fns = fns;
  14318. return invoker
  14319. }
  14320. function updateListeners (
  14321. on,
  14322. oldOn,
  14323. add,
  14324. remove$$1,
  14325. createOnceHandler,
  14326. vm
  14327. ) {
  14328. var name, def$$1, cur, old, event;
  14329. for (name in on) {
  14330. def$$1 = cur = on[name];
  14331. old = oldOn[name];
  14332. event = normalizeEvent(name);
  14333. if (isUndef(cur)) {
  14334. true && warn(
  14335. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  14336. vm
  14337. );
  14338. } else if (isUndef(old)) {
  14339. if (isUndef(cur.fns)) {
  14340. cur = on[name] = createFnInvoker(cur, vm);
  14341. }
  14342. if (isTrue(event.once)) {
  14343. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  14344. }
  14345. add(event.name, cur, event.capture, event.passive, event.params);
  14346. } else if (cur !== old) {
  14347. old.fns = cur;
  14348. on[name] = old;
  14349. }
  14350. }
  14351. for (name in oldOn) {
  14352. if (isUndef(on[name])) {
  14353. event = normalizeEvent(name);
  14354. remove$$1(event.name, oldOn[name], event.capture);
  14355. }
  14356. }
  14357. }
  14358. /* */
  14359. /* */
  14360. // fixed by xxxxxx (mp properties)
  14361. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  14362. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  14363. if (isUndef(propOptions)) {
  14364. return res
  14365. }
  14366. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  14367. var attrs = data.attrs;
  14368. var props = data.props;
  14369. if (isDef(attrs) || isDef(props)) {
  14370. for (var key in propOptions) {
  14371. var altKey = hyphenate(key);
  14372. var result = checkProp(res, props, key, altKey, true) ||
  14373. checkProp(res, attrs, key, altKey, false);
  14374. // externalClass
  14375. if (
  14376. result &&
  14377. res[key] &&
  14378. externalClasses.indexOf(altKey) !== -1 &&
  14379. context[camelize(res[key])]
  14380. ) {
  14381. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  14382. res[key] = context[camelize(res[key])];
  14383. }
  14384. }
  14385. }
  14386. return res
  14387. }
  14388. function extractPropsFromVNodeData (
  14389. data,
  14390. Ctor,
  14391. tag,
  14392. context// fixed by xxxxxx
  14393. ) {
  14394. // we are only extracting raw values here.
  14395. // validation and default values are handled in the child
  14396. // component itself.
  14397. var propOptions = Ctor.options.props;
  14398. if (isUndef(propOptions)) {
  14399. // fixed by xxxxxx
  14400. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  14401. }
  14402. var res = {};
  14403. var attrs = data.attrs;
  14404. var props = data.props;
  14405. if (isDef(attrs) || isDef(props)) {
  14406. for (var key in propOptions) {
  14407. var altKey = hyphenate(key);
  14408. if (true) {
  14409. var keyInLowerCase = key.toLowerCase();
  14410. if (
  14411. key !== keyInLowerCase &&
  14412. attrs && hasOwn(attrs, keyInLowerCase)
  14413. ) {
  14414. tip(
  14415. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  14416. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  14417. " \"" + key + "\". " +
  14418. "Note that HTML attributes are case-insensitive and camelCased " +
  14419. "props need to use their kebab-case equivalents when using in-DOM " +
  14420. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  14421. );
  14422. }
  14423. }
  14424. checkProp(res, props, key, altKey, true) ||
  14425. checkProp(res, attrs, key, altKey, false);
  14426. }
  14427. }
  14428. // fixed by xxxxxx
  14429. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  14430. }
  14431. function checkProp (
  14432. res,
  14433. hash,
  14434. key,
  14435. altKey,
  14436. preserve
  14437. ) {
  14438. if (isDef(hash)) {
  14439. if (hasOwn(hash, key)) {
  14440. res[key] = hash[key];
  14441. if (!preserve) {
  14442. delete hash[key];
  14443. }
  14444. return true
  14445. } else if (hasOwn(hash, altKey)) {
  14446. res[key] = hash[altKey];
  14447. if (!preserve) {
  14448. delete hash[altKey];
  14449. }
  14450. return true
  14451. }
  14452. }
  14453. return false
  14454. }
  14455. /* */
  14456. // The template compiler attempts to minimize the need for normalization by
  14457. // statically analyzing the template at compile time.
  14458. //
  14459. // For plain HTML markup, normalization can be completely skipped because the
  14460. // generated render function is guaranteed to return Array<VNode>. There are
  14461. // two cases where extra normalization is needed:
  14462. // 1. When the children contains components - because a functional component
  14463. // may return an Array instead of a single root. In this case, just a simple
  14464. // normalization is needed - if any child is an Array, we flatten the whole
  14465. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  14466. // because functional components already normalize their own children.
  14467. function simpleNormalizeChildren (children) {
  14468. for (var i = 0; i < children.length; i++) {
  14469. if (Array.isArray(children[i])) {
  14470. return Array.prototype.concat.apply([], children)
  14471. }
  14472. }
  14473. return children
  14474. }
  14475. // 2. When the children contains constructs that always generated nested Arrays,
  14476. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  14477. // with hand-written render functions / JSX. In such cases a full normalization
  14478. // is needed to cater to all possible types of children values.
  14479. function normalizeChildren (children) {
  14480. return isPrimitive(children)
  14481. ? [createTextVNode(children)]
  14482. : Array.isArray(children)
  14483. ? normalizeArrayChildren(children)
  14484. : undefined
  14485. }
  14486. function isTextNode (node) {
  14487. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  14488. }
  14489. function normalizeArrayChildren (children, nestedIndex) {
  14490. var res = [];
  14491. var i, c, lastIndex, last;
  14492. for (i = 0; i < children.length; i++) {
  14493. c = children[i];
  14494. if (isUndef(c) || typeof c === 'boolean') { continue }
  14495. lastIndex = res.length - 1;
  14496. last = res[lastIndex];
  14497. // nested
  14498. if (Array.isArray(c)) {
  14499. if (c.length > 0) {
  14500. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  14501. // merge adjacent text nodes
  14502. if (isTextNode(c[0]) && isTextNode(last)) {
  14503. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  14504. c.shift();
  14505. }
  14506. res.push.apply(res, c);
  14507. }
  14508. } else if (isPrimitive(c)) {
  14509. if (isTextNode(last)) {
  14510. // merge adjacent text nodes
  14511. // this is necessary for SSR hydration because text nodes are
  14512. // essentially merged when rendered to HTML strings
  14513. res[lastIndex] = createTextVNode(last.text + c);
  14514. } else if (c !== '') {
  14515. // convert primitive to vnode
  14516. res.push(createTextVNode(c));
  14517. }
  14518. } else {
  14519. if (isTextNode(c) && isTextNode(last)) {
  14520. // merge adjacent text nodes
  14521. res[lastIndex] = createTextVNode(last.text + c.text);
  14522. } else {
  14523. // default key for nested array children (likely generated by v-for)
  14524. if (isTrue(children._isVList) &&
  14525. isDef(c.tag) &&
  14526. isUndef(c.key) &&
  14527. isDef(nestedIndex)) {
  14528. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  14529. }
  14530. res.push(c);
  14531. }
  14532. }
  14533. }
  14534. return res
  14535. }
  14536. /* */
  14537. function initProvide (vm) {
  14538. var provide = vm.$options.provide;
  14539. if (provide) {
  14540. vm._provided = typeof provide === 'function'
  14541. ? provide.call(vm)
  14542. : provide;
  14543. }
  14544. }
  14545. function initInjections (vm) {
  14546. var result = resolveInject(vm.$options.inject, vm);
  14547. if (result) {
  14548. toggleObserving(false);
  14549. Object.keys(result).forEach(function (key) {
  14550. /* istanbul ignore else */
  14551. if (true) {
  14552. defineReactive$$1(vm, key, result[key], function () {
  14553. warn(
  14554. "Avoid mutating an injected value directly since the changes will be " +
  14555. "overwritten whenever the provided component re-renders. " +
  14556. "injection being mutated: \"" + key + "\"",
  14557. vm
  14558. );
  14559. });
  14560. } else {}
  14561. });
  14562. toggleObserving(true);
  14563. }
  14564. }
  14565. function resolveInject (inject, vm) {
  14566. if (inject) {
  14567. // inject is :any because flow is not smart enough to figure out cached
  14568. var result = Object.create(null);
  14569. var keys = hasSymbol
  14570. ? Reflect.ownKeys(inject)
  14571. : Object.keys(inject);
  14572. for (var i = 0; i < keys.length; i++) {
  14573. var key = keys[i];
  14574. // #6574 in case the inject object is observed...
  14575. if (key === '__ob__') { continue }
  14576. var provideKey = inject[key].from;
  14577. var source = vm;
  14578. while (source) {
  14579. if (source._provided && hasOwn(source._provided, provideKey)) {
  14580. result[key] = source._provided[provideKey];
  14581. break
  14582. }
  14583. source = source.$parent;
  14584. }
  14585. if (!source) {
  14586. if ('default' in inject[key]) {
  14587. var provideDefault = inject[key].default;
  14588. result[key] = typeof provideDefault === 'function'
  14589. ? provideDefault.call(vm)
  14590. : provideDefault;
  14591. } else if (true) {
  14592. warn(("Injection \"" + key + "\" not found"), vm);
  14593. }
  14594. }
  14595. }
  14596. return result
  14597. }
  14598. }
  14599. /* */
  14600. /**
  14601. * Runtime helper for resolving raw children VNodes into a slot object.
  14602. */
  14603. function resolveSlots (
  14604. children,
  14605. context
  14606. ) {
  14607. if (!children || !children.length) {
  14608. return {}
  14609. }
  14610. var slots = {};
  14611. for (var i = 0, l = children.length; i < l; i++) {
  14612. var child = children[i];
  14613. var data = child.data;
  14614. // remove slot attribute if the node is resolved as a Vue slot node
  14615. if (data && data.attrs && data.attrs.slot) {
  14616. delete data.attrs.slot;
  14617. }
  14618. // named slots should only be respected if the vnode was rendered in the
  14619. // same context.
  14620. if ((child.context === context || child.fnContext === context) &&
  14621. data && data.slot != null
  14622. ) {
  14623. var name = data.slot;
  14624. var slot = (slots[name] || (slots[name] = []));
  14625. if (child.tag === 'template') {
  14626. slot.push.apply(slot, child.children || []);
  14627. } else {
  14628. slot.push(child);
  14629. }
  14630. } else {
  14631. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  14632. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  14633. (slots['page'] || (slots['page'] = [])).push(child);
  14634. }else{
  14635. (slots.default || (slots.default = [])).push(child);
  14636. }
  14637. }
  14638. }
  14639. // ignore slots that contains only whitespace
  14640. for (var name$1 in slots) {
  14641. if (slots[name$1].every(isWhitespace)) {
  14642. delete slots[name$1];
  14643. }
  14644. }
  14645. return slots
  14646. }
  14647. function isWhitespace (node) {
  14648. return (node.isComment && !node.asyncFactory) || node.text === ' '
  14649. }
  14650. /* */
  14651. function normalizeScopedSlots (
  14652. slots,
  14653. normalSlots,
  14654. prevSlots
  14655. ) {
  14656. var res;
  14657. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  14658. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  14659. var key = slots && slots.$key;
  14660. if (!slots) {
  14661. res = {};
  14662. } else if (slots._normalized) {
  14663. // fast path 1: child component re-render only, parent did not change
  14664. return slots._normalized
  14665. } else if (
  14666. isStable &&
  14667. prevSlots &&
  14668. prevSlots !== emptyObject &&
  14669. key === prevSlots.$key &&
  14670. !hasNormalSlots &&
  14671. !prevSlots.$hasNormal
  14672. ) {
  14673. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  14674. // only need to normalize once
  14675. return prevSlots
  14676. } else {
  14677. res = {};
  14678. for (var key$1 in slots) {
  14679. if (slots[key$1] && key$1[0] !== '$') {
  14680. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  14681. }
  14682. }
  14683. }
  14684. // expose normal slots on scopedSlots
  14685. for (var key$2 in normalSlots) {
  14686. if (!(key$2 in res)) {
  14687. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  14688. }
  14689. }
  14690. // avoriaz seems to mock a non-extensible $scopedSlots object
  14691. // and when that is passed down this would cause an error
  14692. if (slots && Object.isExtensible(slots)) {
  14693. (slots)._normalized = res;
  14694. }
  14695. def(res, '$stable', isStable);
  14696. def(res, '$key', key);
  14697. def(res, '$hasNormal', hasNormalSlots);
  14698. return res
  14699. }
  14700. function normalizeScopedSlot(normalSlots, key, fn) {
  14701. var normalized = function () {
  14702. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  14703. res = res && typeof res === 'object' && !Array.isArray(res)
  14704. ? [res] // single vnode
  14705. : normalizeChildren(res);
  14706. return res && (
  14707. res.length === 0 ||
  14708. (res.length === 1 && res[0].isComment) // #9658
  14709. ) ? undefined
  14710. : res
  14711. };
  14712. // this is a slot using the new v-slot syntax without scope. although it is
  14713. // compiled as a scoped slot, render fn users would expect it to be present
  14714. // on this.$slots because the usage is semantically a normal slot.
  14715. if (fn.proxy) {
  14716. Object.defineProperty(normalSlots, key, {
  14717. get: normalized,
  14718. enumerable: true,
  14719. configurable: true
  14720. });
  14721. }
  14722. return normalized
  14723. }
  14724. function proxyNormalSlot(slots, key) {
  14725. return function () { return slots[key]; }
  14726. }
  14727. /* */
  14728. /**
  14729. * Runtime helper for rendering v-for lists.
  14730. */
  14731. function renderList (
  14732. val,
  14733. render
  14734. ) {
  14735. var ret, i, l, keys, key;
  14736. if (Array.isArray(val) || typeof val === 'string') {
  14737. ret = new Array(val.length);
  14738. for (i = 0, l = val.length; i < l; i++) {
  14739. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  14740. }
  14741. } else if (typeof val === 'number') {
  14742. ret = new Array(val);
  14743. for (i = 0; i < val; i++) {
  14744. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  14745. }
  14746. } else if (isObject(val)) {
  14747. if (hasSymbol && val[Symbol.iterator]) {
  14748. ret = [];
  14749. var iterator = val[Symbol.iterator]();
  14750. var result = iterator.next();
  14751. while (!result.done) {
  14752. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  14753. result = iterator.next();
  14754. }
  14755. } else {
  14756. keys = Object.keys(val);
  14757. ret = new Array(keys.length);
  14758. for (i = 0, l = keys.length; i < l; i++) {
  14759. key = keys[i];
  14760. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  14761. }
  14762. }
  14763. }
  14764. if (!isDef(ret)) {
  14765. ret = [];
  14766. }
  14767. (ret)._isVList = true;
  14768. return ret
  14769. }
  14770. /* */
  14771. /**
  14772. * Runtime helper for rendering <slot>
  14773. */
  14774. function renderSlot (
  14775. name,
  14776. fallback,
  14777. props,
  14778. bindObject
  14779. ) {
  14780. var scopedSlotFn = this.$scopedSlots[name];
  14781. var nodes;
  14782. if (scopedSlotFn) { // scoped slot
  14783. props = props || {};
  14784. if (bindObject) {
  14785. if ( true && !isObject(bindObject)) {
  14786. warn(
  14787. 'slot v-bind without argument expects an Object',
  14788. this
  14789. );
  14790. }
  14791. props = extend(extend({}, bindObject), props);
  14792. }
  14793. // fixed by xxxxxx app-plus scopedSlot
  14794. nodes = scopedSlotFn(props, this, props._i) || fallback;
  14795. } else {
  14796. nodes = this.$slots[name] || fallback;
  14797. }
  14798. var target = props && props.slot;
  14799. if (target) {
  14800. return this.$createElement('template', { slot: target }, nodes)
  14801. } else {
  14802. return nodes
  14803. }
  14804. }
  14805. /* */
  14806. /**
  14807. * Runtime helper for resolving filters
  14808. */
  14809. function resolveFilter (id) {
  14810. return resolveAsset(this.$options, 'filters', id, true) || identity
  14811. }
  14812. /* */
  14813. function isKeyNotMatch (expect, actual) {
  14814. if (Array.isArray(expect)) {
  14815. return expect.indexOf(actual) === -1
  14816. } else {
  14817. return expect !== actual
  14818. }
  14819. }
  14820. /**
  14821. * Runtime helper for checking keyCodes from config.
  14822. * exposed as Vue.prototype._k
  14823. * passing in eventKeyName as last argument separately for backwards compat
  14824. */
  14825. function checkKeyCodes (
  14826. eventKeyCode,
  14827. key,
  14828. builtInKeyCode,
  14829. eventKeyName,
  14830. builtInKeyName
  14831. ) {
  14832. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  14833. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  14834. return isKeyNotMatch(builtInKeyName, eventKeyName)
  14835. } else if (mappedKeyCode) {
  14836. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  14837. } else if (eventKeyName) {
  14838. return hyphenate(eventKeyName) !== key
  14839. }
  14840. }
  14841. /* */
  14842. /**
  14843. * Runtime helper for merging v-bind="object" into a VNode's data.
  14844. */
  14845. function bindObjectProps (
  14846. data,
  14847. tag,
  14848. value,
  14849. asProp,
  14850. isSync
  14851. ) {
  14852. if (value) {
  14853. if (!isObject(value)) {
  14854. true && warn(
  14855. 'v-bind without argument expects an Object or Array value',
  14856. this
  14857. );
  14858. } else {
  14859. if (Array.isArray(value)) {
  14860. value = toObject(value);
  14861. }
  14862. var hash;
  14863. var loop = function ( key ) {
  14864. if (
  14865. key === 'class' ||
  14866. key === 'style' ||
  14867. isReservedAttribute(key)
  14868. ) {
  14869. hash = data;
  14870. } else {
  14871. var type = data.attrs && data.attrs.type;
  14872. hash = asProp || config.mustUseProp(tag, type, key)
  14873. ? data.domProps || (data.domProps = {})
  14874. : data.attrs || (data.attrs = {});
  14875. }
  14876. var camelizedKey = camelize(key);
  14877. var hyphenatedKey = hyphenate(key);
  14878. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  14879. hash[key] = value[key];
  14880. if (isSync) {
  14881. var on = data.on || (data.on = {});
  14882. on[("update:" + key)] = function ($event) {
  14883. value[key] = $event;
  14884. };
  14885. }
  14886. }
  14887. };
  14888. for (var key in value) loop( key );
  14889. }
  14890. }
  14891. return data
  14892. }
  14893. /* */
  14894. /**
  14895. * Runtime helper for rendering static trees.
  14896. */
  14897. function renderStatic (
  14898. index,
  14899. isInFor
  14900. ) {
  14901. var cached = this._staticTrees || (this._staticTrees = []);
  14902. var tree = cached[index];
  14903. // if has already-rendered static tree and not inside v-for,
  14904. // we can reuse the same tree.
  14905. if (tree && !isInFor) {
  14906. return tree
  14907. }
  14908. // otherwise, render a fresh tree.
  14909. tree = cached[index] = this.$options.staticRenderFns[index].call(
  14910. this._renderProxy,
  14911. null,
  14912. this // for render fns generated for functional component templates
  14913. );
  14914. markStatic(tree, ("__static__" + index), false);
  14915. return tree
  14916. }
  14917. /**
  14918. * Runtime helper for v-once.
  14919. * Effectively it means marking the node as static with a unique key.
  14920. */
  14921. function markOnce (
  14922. tree,
  14923. index,
  14924. key
  14925. ) {
  14926. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  14927. return tree
  14928. }
  14929. function markStatic (
  14930. tree,
  14931. key,
  14932. isOnce
  14933. ) {
  14934. if (Array.isArray(tree)) {
  14935. for (var i = 0; i < tree.length; i++) {
  14936. if (tree[i] && typeof tree[i] !== 'string') {
  14937. markStaticNode(tree[i], (key + "_" + i), isOnce);
  14938. }
  14939. }
  14940. } else {
  14941. markStaticNode(tree, key, isOnce);
  14942. }
  14943. }
  14944. function markStaticNode (node, key, isOnce) {
  14945. node.isStatic = true;
  14946. node.key = key;
  14947. node.isOnce = isOnce;
  14948. }
  14949. /* */
  14950. function bindObjectListeners (data, value) {
  14951. if (value) {
  14952. if (!isPlainObject(value)) {
  14953. true && warn(
  14954. 'v-on without argument expects an Object value',
  14955. this
  14956. );
  14957. } else {
  14958. var on = data.on = data.on ? extend({}, data.on) : {};
  14959. for (var key in value) {
  14960. var existing = on[key];
  14961. var ours = value[key];
  14962. on[key] = existing ? [].concat(existing, ours) : ours;
  14963. }
  14964. }
  14965. }
  14966. return data
  14967. }
  14968. /* */
  14969. function resolveScopedSlots (
  14970. fns, // see flow/vnode
  14971. res,
  14972. // the following are added in 2.6
  14973. hasDynamicKeys,
  14974. contentHashKey
  14975. ) {
  14976. res = res || { $stable: !hasDynamicKeys };
  14977. for (var i = 0; i < fns.length; i++) {
  14978. var slot = fns[i];
  14979. if (Array.isArray(slot)) {
  14980. resolveScopedSlots(slot, res, hasDynamicKeys);
  14981. } else if (slot) {
  14982. // marker for reverse proxying v-slot without scope on this.$slots
  14983. if (slot.proxy) {
  14984. slot.fn.proxy = true;
  14985. }
  14986. res[slot.key] = slot.fn;
  14987. }
  14988. }
  14989. if (contentHashKey) {
  14990. (res).$key = contentHashKey;
  14991. }
  14992. return res
  14993. }
  14994. /* */
  14995. function bindDynamicKeys (baseObj, values) {
  14996. for (var i = 0; i < values.length; i += 2) {
  14997. var key = values[i];
  14998. if (typeof key === 'string' && key) {
  14999. baseObj[values[i]] = values[i + 1];
  15000. } else if ( true && key !== '' && key !== null) {
  15001. // null is a special value for explicitly removing a binding
  15002. warn(
  15003. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  15004. this
  15005. );
  15006. }
  15007. }
  15008. return baseObj
  15009. }
  15010. // helper to dynamically append modifier runtime markers to event names.
  15011. // ensure only append when value is already string, otherwise it will be cast
  15012. // to string and cause the type check to miss.
  15013. function prependModifier (value, symbol) {
  15014. return typeof value === 'string' ? symbol + value : value
  15015. }
  15016. /* */
  15017. function installRenderHelpers (target) {
  15018. target._o = markOnce;
  15019. target._n = toNumber;
  15020. target._s = toString;
  15021. target._l = renderList;
  15022. target._t = renderSlot;
  15023. target._q = looseEqual;
  15024. target._i = looseIndexOf;
  15025. target._m = renderStatic;
  15026. target._f = resolveFilter;
  15027. target._k = checkKeyCodes;
  15028. target._b = bindObjectProps;
  15029. target._v = createTextVNode;
  15030. target._e = createEmptyVNode;
  15031. target._u = resolveScopedSlots;
  15032. target._g = bindObjectListeners;
  15033. target._d = bindDynamicKeys;
  15034. target._p = prependModifier;
  15035. }
  15036. /* */
  15037. function FunctionalRenderContext (
  15038. data,
  15039. props,
  15040. children,
  15041. parent,
  15042. Ctor
  15043. ) {
  15044. var this$1 = this;
  15045. var options = Ctor.options;
  15046. // ensure the createElement function in functional components
  15047. // gets a unique context - this is necessary for correct named slot check
  15048. var contextVm;
  15049. if (hasOwn(parent, '_uid')) {
  15050. contextVm = Object.create(parent);
  15051. // $flow-disable-line
  15052. contextVm._original = parent;
  15053. } else {
  15054. // the context vm passed in is a functional context as well.
  15055. // in this case we want to make sure we are able to get a hold to the
  15056. // real context instance.
  15057. contextVm = parent;
  15058. // $flow-disable-line
  15059. parent = parent._original;
  15060. }
  15061. var isCompiled = isTrue(options._compiled);
  15062. var needNormalization = !isCompiled;
  15063. this.data = data;
  15064. this.props = props;
  15065. this.children = children;
  15066. this.parent = parent;
  15067. this.listeners = data.on || emptyObject;
  15068. this.injections = resolveInject(options.inject, parent);
  15069. this.slots = function () {
  15070. if (!this$1.$slots) {
  15071. normalizeScopedSlots(
  15072. data.scopedSlots,
  15073. this$1.$slots = resolveSlots(children, parent)
  15074. );
  15075. }
  15076. return this$1.$slots
  15077. };
  15078. Object.defineProperty(this, 'scopedSlots', ({
  15079. enumerable: true,
  15080. get: function get () {
  15081. return normalizeScopedSlots(data.scopedSlots, this.slots())
  15082. }
  15083. }));
  15084. // support for compiled functional template
  15085. if (isCompiled) {
  15086. // exposing $options for renderStatic()
  15087. this.$options = options;
  15088. // pre-resolve slots for renderSlot()
  15089. this.$slots = this.slots();
  15090. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  15091. }
  15092. if (options._scopeId) {
  15093. this._c = function (a, b, c, d) {
  15094. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  15095. if (vnode && !Array.isArray(vnode)) {
  15096. vnode.fnScopeId = options._scopeId;
  15097. vnode.fnContext = parent;
  15098. }
  15099. return vnode
  15100. };
  15101. } else {
  15102. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  15103. }
  15104. }
  15105. installRenderHelpers(FunctionalRenderContext.prototype);
  15106. function createFunctionalComponent (
  15107. Ctor,
  15108. propsData,
  15109. data,
  15110. contextVm,
  15111. children
  15112. ) {
  15113. var options = Ctor.options;
  15114. var props = {};
  15115. var propOptions = options.props;
  15116. if (isDef(propOptions)) {
  15117. for (var key in propOptions) {
  15118. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  15119. }
  15120. } else {
  15121. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  15122. if (isDef(data.props)) { mergeProps(props, data.props); }
  15123. }
  15124. var renderContext = new FunctionalRenderContext(
  15125. data,
  15126. props,
  15127. children,
  15128. contextVm,
  15129. Ctor
  15130. );
  15131. var vnode = options.render.call(null, renderContext._c, renderContext);
  15132. if (vnode instanceof VNode) {
  15133. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  15134. } else if (Array.isArray(vnode)) {
  15135. var vnodes = normalizeChildren(vnode) || [];
  15136. var res = new Array(vnodes.length);
  15137. for (var i = 0; i < vnodes.length; i++) {
  15138. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  15139. }
  15140. return res
  15141. }
  15142. }
  15143. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  15144. // #7817 clone node before setting fnContext, otherwise if the node is reused
  15145. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  15146. // that should not be matched to match.
  15147. var clone = cloneVNode(vnode);
  15148. clone.fnContext = contextVm;
  15149. clone.fnOptions = options;
  15150. if (true) {
  15151. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  15152. }
  15153. if (data.slot) {
  15154. (clone.data || (clone.data = {})).slot = data.slot;
  15155. }
  15156. return clone
  15157. }
  15158. function mergeProps (to, from) {
  15159. for (var key in from) {
  15160. to[camelize(key)] = from[key];
  15161. }
  15162. }
  15163. /* */
  15164. /* */
  15165. /* */
  15166. /* */
  15167. // inline hooks to be invoked on component VNodes during patch
  15168. var componentVNodeHooks = {
  15169. init: function init (vnode, hydrating) {
  15170. if (
  15171. vnode.componentInstance &&
  15172. !vnode.componentInstance._isDestroyed &&
  15173. vnode.data.keepAlive
  15174. ) {
  15175. // kept-alive components, treat as a patch
  15176. var mountedNode = vnode; // work around flow
  15177. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  15178. } else {
  15179. var child = vnode.componentInstance = createComponentInstanceForVnode(
  15180. vnode,
  15181. activeInstance
  15182. );
  15183. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  15184. }
  15185. },
  15186. prepatch: function prepatch (oldVnode, vnode) {
  15187. var options = vnode.componentOptions;
  15188. var child = vnode.componentInstance = oldVnode.componentInstance;
  15189. updateChildComponent(
  15190. child,
  15191. options.propsData, // updated props
  15192. options.listeners, // updated listeners
  15193. vnode, // new parent vnode
  15194. options.children // new children
  15195. );
  15196. },
  15197. insert: function insert (vnode) {
  15198. var context = vnode.context;
  15199. var componentInstance = vnode.componentInstance;
  15200. if (!componentInstance._isMounted) {
  15201. callHook(componentInstance, 'onServiceCreated');
  15202. callHook(componentInstance, 'onServiceAttached');
  15203. componentInstance._isMounted = true;
  15204. callHook(componentInstance, 'mounted');
  15205. }
  15206. if (vnode.data.keepAlive) {
  15207. if (context._isMounted) {
  15208. // vue-router#1212
  15209. // During updates, a kept-alive component's child components may
  15210. // change, so directly walking the tree here may call activated hooks
  15211. // on incorrect children. Instead we push them into a queue which will
  15212. // be processed after the whole patch process ended.
  15213. queueActivatedComponent(componentInstance);
  15214. } else {
  15215. activateChildComponent(componentInstance, true /* direct */);
  15216. }
  15217. }
  15218. },
  15219. destroy: function destroy (vnode) {
  15220. var componentInstance = vnode.componentInstance;
  15221. if (!componentInstance._isDestroyed) {
  15222. if (!vnode.data.keepAlive) {
  15223. componentInstance.$destroy();
  15224. } else {
  15225. deactivateChildComponent(componentInstance, true /* direct */);
  15226. }
  15227. }
  15228. }
  15229. };
  15230. var hooksToMerge = Object.keys(componentVNodeHooks);
  15231. function createComponent (
  15232. Ctor,
  15233. data,
  15234. context,
  15235. children,
  15236. tag
  15237. ) {
  15238. if (isUndef(Ctor)) {
  15239. return
  15240. }
  15241. var baseCtor = context.$options._base;
  15242. // plain options object: turn it into a constructor
  15243. if (isObject(Ctor)) {
  15244. Ctor = baseCtor.extend(Ctor);
  15245. }
  15246. // if at this stage it's not a constructor or an async component factory,
  15247. // reject.
  15248. if (typeof Ctor !== 'function') {
  15249. if (true) {
  15250. warn(("Invalid Component definition: " + (String(Ctor))), context);
  15251. }
  15252. return
  15253. }
  15254. // async component
  15255. var asyncFactory;
  15256. if (isUndef(Ctor.cid)) {
  15257. asyncFactory = Ctor;
  15258. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  15259. if (Ctor === undefined) {
  15260. // return a placeholder node for async component, which is rendered
  15261. // as a comment node but preserves all the raw information for the node.
  15262. // the information will be used for async server-rendering and hydration.
  15263. return createAsyncPlaceholder(
  15264. asyncFactory,
  15265. data,
  15266. context,
  15267. children,
  15268. tag
  15269. )
  15270. }
  15271. }
  15272. data = data || {};
  15273. // resolve constructor options in case global mixins are applied after
  15274. // component constructor creation
  15275. resolveConstructorOptions(Ctor);
  15276. // transform component v-model data into props & events
  15277. if (isDef(data.model)) {
  15278. transformModel(Ctor.options, data);
  15279. }
  15280. // extract props
  15281. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  15282. // functional component
  15283. if (isTrue(Ctor.options.functional)) {
  15284. return createFunctionalComponent(Ctor, propsData, data, context, children)
  15285. }
  15286. // extract listeners, since these needs to be treated as
  15287. // child component listeners instead of DOM listeners
  15288. var listeners = data.on;
  15289. // replace with listeners with .native modifier
  15290. // so it gets processed during parent component patch.
  15291. data.on = data.nativeOn;
  15292. if (isTrue(Ctor.options.abstract)) {
  15293. // abstract components do not keep anything
  15294. // other than props & listeners & slot
  15295. // work around flow
  15296. var slot = data.slot;
  15297. data = {};
  15298. if (slot) {
  15299. data.slot = slot;
  15300. }
  15301. }
  15302. // install component management hooks onto the placeholder node
  15303. installComponentHooks(data);
  15304. // return a placeholder vnode
  15305. var name = Ctor.options.name || tag;
  15306. var vnode = new VNode(
  15307. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  15308. data, undefined, undefined, undefined, context,
  15309. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  15310. asyncFactory
  15311. );
  15312. return vnode
  15313. }
  15314. function createComponentInstanceForVnode (
  15315. vnode, // we know it's MountedComponentVNode but flow doesn't
  15316. parent // activeInstance in lifecycle state
  15317. ) {
  15318. var options = {
  15319. _isComponent: true,
  15320. _parentVnode: vnode,
  15321. parent: parent
  15322. };
  15323. // check inline-template render functions
  15324. var inlineTemplate = vnode.data.inlineTemplate;
  15325. if (isDef(inlineTemplate)) {
  15326. options.render = inlineTemplate.render;
  15327. options.staticRenderFns = inlineTemplate.staticRenderFns;
  15328. }
  15329. return new vnode.componentOptions.Ctor(options)
  15330. }
  15331. function installComponentHooks (data) {
  15332. var hooks = data.hook || (data.hook = {});
  15333. for (var i = 0; i < hooksToMerge.length; i++) {
  15334. var key = hooksToMerge[i];
  15335. var existing = hooks[key];
  15336. var toMerge = componentVNodeHooks[key];
  15337. if (existing !== toMerge && !(existing && existing._merged)) {
  15338. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  15339. }
  15340. }
  15341. }
  15342. function mergeHook$1 (f1, f2) {
  15343. var merged = function (a, b) {
  15344. // flow complains about extra args which is why we use any
  15345. f1(a, b);
  15346. f2(a, b);
  15347. };
  15348. merged._merged = true;
  15349. return merged
  15350. }
  15351. // transform component v-model info (value and callback) into
  15352. // prop and event handler respectively.
  15353. function transformModel (options, data) {
  15354. var prop = (options.model && options.model.prop) || 'value';
  15355. var event = (options.model && options.model.event) || 'input'
  15356. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  15357. var on = data.on || (data.on = {});
  15358. var existing = on[event];
  15359. var callback = data.model.callback;
  15360. if (isDef(existing)) {
  15361. if (
  15362. Array.isArray(existing)
  15363. ? existing.indexOf(callback) === -1
  15364. : existing !== callback
  15365. ) {
  15366. on[event] = [callback].concat(existing);
  15367. }
  15368. } else {
  15369. on[event] = callback;
  15370. }
  15371. }
  15372. /* */
  15373. var SIMPLE_NORMALIZE = 1;
  15374. var ALWAYS_NORMALIZE = 2;
  15375. // wrapper function for providing a more flexible interface
  15376. // without getting yelled at by flow
  15377. function createElement (
  15378. context,
  15379. tag,
  15380. data,
  15381. children,
  15382. normalizationType,
  15383. alwaysNormalize
  15384. ) {
  15385. if (Array.isArray(data) || isPrimitive(data)) {
  15386. normalizationType = children;
  15387. children = data;
  15388. data = undefined;
  15389. }
  15390. if (isTrue(alwaysNormalize)) {
  15391. normalizationType = ALWAYS_NORMALIZE;
  15392. }
  15393. return _createElement(context, tag, data, children, normalizationType)
  15394. }
  15395. function _createElement (
  15396. context,
  15397. tag,
  15398. data,
  15399. children,
  15400. normalizationType
  15401. ) {
  15402. if (isDef(data) && isDef((data).__ob__)) {
  15403. true && warn(
  15404. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  15405. 'Always create fresh vnode data objects in each render!',
  15406. context
  15407. );
  15408. return createEmptyVNode()
  15409. }
  15410. // object syntax in v-bind
  15411. if (isDef(data) && isDef(data.is)) {
  15412. tag = data.is;
  15413. }
  15414. if (!tag) {
  15415. // in case of component :is set to falsy value
  15416. return createEmptyVNode()
  15417. }
  15418. // warn against non-primitive key
  15419. if ( true &&
  15420. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  15421. ) {
  15422. {
  15423. warn(
  15424. 'Avoid using non-primitive value as key, ' +
  15425. 'use string/number value instead.',
  15426. context
  15427. );
  15428. }
  15429. }
  15430. // support single function children as default scoped slot
  15431. if (Array.isArray(children) &&
  15432. typeof children[0] === 'function'
  15433. ) {
  15434. data = data || {};
  15435. data.scopedSlots = { default: children[0] };
  15436. children.length = 0;
  15437. }
  15438. if (normalizationType === ALWAYS_NORMALIZE) {
  15439. children = normalizeChildren(children);
  15440. } else if (normalizationType === SIMPLE_NORMALIZE) {
  15441. children = simpleNormalizeChildren(children);
  15442. }
  15443. var vnode, ns;
  15444. if (typeof tag === 'string') {
  15445. var Ctor;
  15446. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  15447. if (config.isReservedTag(tag)) {
  15448. // platform built-in elements
  15449. if ( true && isDef(data) && isDef(data.nativeOn)) {
  15450. warn(
  15451. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  15452. context
  15453. );
  15454. }
  15455. vnode = new VNode(
  15456. config.parsePlatformTagName(tag), data, children,
  15457. undefined, undefined, context
  15458. );
  15459. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  15460. // component
  15461. vnode = createComponent(Ctor, data, context, children, tag);
  15462. } else {
  15463. // unknown or unlisted namespaced elements
  15464. // check at runtime because it may get assigned a namespace when its
  15465. // parent normalizes children
  15466. vnode = new VNode(
  15467. tag, data, children,
  15468. undefined, undefined, context
  15469. );
  15470. }
  15471. } else {
  15472. // direct component options / constructor
  15473. vnode = createComponent(tag, data, context, children);
  15474. }
  15475. if (Array.isArray(vnode)) {
  15476. return vnode
  15477. } else if (isDef(vnode)) {
  15478. if (isDef(ns)) { applyNS(vnode, ns); }
  15479. if (isDef(data)) { registerDeepBindings(data); }
  15480. return vnode
  15481. } else {
  15482. return createEmptyVNode()
  15483. }
  15484. }
  15485. function applyNS (vnode, ns, force) {
  15486. vnode.ns = ns;
  15487. if (vnode.tag === 'foreignObject') {
  15488. // use default namespace inside foreignObject
  15489. ns = undefined;
  15490. force = true;
  15491. }
  15492. if (isDef(vnode.children)) {
  15493. for (var i = 0, l = vnode.children.length; i < l; i++) {
  15494. var child = vnode.children[i];
  15495. if (isDef(child.tag) && (
  15496. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  15497. applyNS(child, ns, force);
  15498. }
  15499. }
  15500. }
  15501. }
  15502. // ref #5318
  15503. // necessary to ensure parent re-render when deep bindings like :style and
  15504. // :class are used on slot nodes
  15505. function registerDeepBindings (data) {
  15506. if (isObject(data.style)) {
  15507. traverse(data.style);
  15508. }
  15509. if (isObject(data.class)) {
  15510. traverse(data.class);
  15511. }
  15512. }
  15513. /* */
  15514. function initRender (vm) {
  15515. vm._vnode = null; // the root of the child tree
  15516. vm._staticTrees = null; // v-once cached trees
  15517. var options = vm.$options;
  15518. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  15519. var renderContext = parentVnode && parentVnode.context;
  15520. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  15521. vm.$scopedSlots = emptyObject;
  15522. // bind the createElement fn to this instance
  15523. // so that we get proper render context inside it.
  15524. // args order: tag, data, children, normalizationType, alwaysNormalize
  15525. // internal version is used by render functions compiled from templates
  15526. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  15527. // normalization is always applied for the public version, used in
  15528. // user-written render functions.
  15529. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  15530. // $attrs & $listeners are exposed for easier HOC creation.
  15531. // they need to be reactive so that HOCs using them are always updated
  15532. var parentData = parentVnode && parentVnode.data;
  15533. /* istanbul ignore else */
  15534. if (true) {
  15535. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  15536. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  15537. }, true);
  15538. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  15539. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  15540. }, true);
  15541. } else {}
  15542. }
  15543. var currentRenderingInstance = null;
  15544. function renderMixin (Vue) {
  15545. // install runtime convenience helpers
  15546. installRenderHelpers(Vue.prototype);
  15547. Vue.prototype.$nextTick = function (fn) {
  15548. return nextTick(fn, this)
  15549. };
  15550. Vue.prototype._render = function () {
  15551. var vm = this;
  15552. var ref = vm.$options;
  15553. var render = ref.render;
  15554. var _parentVnode = ref._parentVnode;
  15555. if (_parentVnode) {
  15556. vm.$scopedSlots = normalizeScopedSlots(
  15557. _parentVnode.data.scopedSlots,
  15558. vm.$slots,
  15559. vm.$scopedSlots
  15560. );
  15561. }
  15562. // set parent vnode. this allows render functions to have access
  15563. // to the data on the placeholder node.
  15564. vm.$vnode = _parentVnode;
  15565. // render self
  15566. var vnode;
  15567. try {
  15568. // There's no need to maintain a stack because all render fns are called
  15569. // separately from one another. Nested component's render fns are called
  15570. // when parent component is patched.
  15571. currentRenderingInstance = vm;
  15572. vnode = render.call(vm._renderProxy, vm.$createElement);
  15573. } catch (e) {
  15574. handleError(e, vm, "render");
  15575. // return error render result,
  15576. // or previous vnode to prevent render error causing blank component
  15577. /* istanbul ignore else */
  15578. if ( true && vm.$options.renderError) {
  15579. try {
  15580. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  15581. } catch (e) {
  15582. handleError(e, vm, "renderError");
  15583. vnode = vm._vnode;
  15584. }
  15585. } else {
  15586. vnode = vm._vnode;
  15587. }
  15588. } finally {
  15589. currentRenderingInstance = null;
  15590. }
  15591. // if the returned array contains only a single node, allow it
  15592. if (Array.isArray(vnode) && vnode.length === 1) {
  15593. vnode = vnode[0];
  15594. }
  15595. // return empty vnode in case the render function errored out
  15596. if (!(vnode instanceof VNode)) {
  15597. if ( true && Array.isArray(vnode)) {
  15598. warn(
  15599. 'Multiple root nodes returned from render function. Render function ' +
  15600. 'should return a single root node.',
  15601. vm
  15602. );
  15603. }
  15604. vnode = createEmptyVNode();
  15605. }
  15606. // set parent
  15607. vnode.parent = _parentVnode;
  15608. return vnode
  15609. };
  15610. }
  15611. /* */
  15612. function ensureCtor (comp, base) {
  15613. if (
  15614. comp.__esModule ||
  15615. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  15616. ) {
  15617. comp = comp.default;
  15618. }
  15619. return isObject(comp)
  15620. ? base.extend(comp)
  15621. : comp
  15622. }
  15623. function createAsyncPlaceholder (
  15624. factory,
  15625. data,
  15626. context,
  15627. children,
  15628. tag
  15629. ) {
  15630. var node = createEmptyVNode();
  15631. node.asyncFactory = factory;
  15632. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  15633. return node
  15634. }
  15635. function resolveAsyncComponent (
  15636. factory,
  15637. baseCtor
  15638. ) {
  15639. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  15640. return factory.errorComp
  15641. }
  15642. if (isDef(factory.resolved)) {
  15643. return factory.resolved
  15644. }
  15645. var owner = currentRenderingInstance;
  15646. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  15647. // already pending
  15648. factory.owners.push(owner);
  15649. }
  15650. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  15651. return factory.loadingComp
  15652. }
  15653. if (owner && !isDef(factory.owners)) {
  15654. var owners = factory.owners = [owner];
  15655. var sync = true;
  15656. var timerLoading = null;
  15657. var timerTimeout = null
  15658. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  15659. var forceRender = function (renderCompleted) {
  15660. for (var i = 0, l = owners.length; i < l; i++) {
  15661. (owners[i]).$forceUpdate();
  15662. }
  15663. if (renderCompleted) {
  15664. owners.length = 0;
  15665. if (timerLoading !== null) {
  15666. clearTimeout(timerLoading);
  15667. timerLoading = null;
  15668. }
  15669. if (timerTimeout !== null) {
  15670. clearTimeout(timerTimeout);
  15671. timerTimeout = null;
  15672. }
  15673. }
  15674. };
  15675. var resolve = once(function (res) {
  15676. // cache resolved
  15677. factory.resolved = ensureCtor(res, baseCtor);
  15678. // invoke callbacks only if this is not a synchronous resolve
  15679. // (async resolves are shimmed as synchronous during SSR)
  15680. if (!sync) {
  15681. forceRender(true);
  15682. } else {
  15683. owners.length = 0;
  15684. }
  15685. });
  15686. var reject = once(function (reason) {
  15687. true && warn(
  15688. "Failed to resolve async component: " + (String(factory)) +
  15689. (reason ? ("\nReason: " + reason) : '')
  15690. );
  15691. if (isDef(factory.errorComp)) {
  15692. factory.error = true;
  15693. forceRender(true);
  15694. }
  15695. });
  15696. var res = factory(resolve, reject);
  15697. if (isObject(res)) {
  15698. if (isPromise(res)) {
  15699. // () => Promise
  15700. if (isUndef(factory.resolved)) {
  15701. res.then(resolve, reject);
  15702. }
  15703. } else if (isPromise(res.component)) {
  15704. res.component.then(resolve, reject);
  15705. if (isDef(res.error)) {
  15706. factory.errorComp = ensureCtor(res.error, baseCtor);
  15707. }
  15708. if (isDef(res.loading)) {
  15709. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  15710. if (res.delay === 0) {
  15711. factory.loading = true;
  15712. } else {
  15713. timerLoading = setTimeout(function () {
  15714. timerLoading = null;
  15715. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  15716. factory.loading = true;
  15717. forceRender(false);
  15718. }
  15719. }, res.delay || 200);
  15720. }
  15721. }
  15722. if (isDef(res.timeout)) {
  15723. timerTimeout = setTimeout(function () {
  15724. timerTimeout = null;
  15725. if (isUndef(factory.resolved)) {
  15726. reject(
  15727. true
  15728. ? ("timeout (" + (res.timeout) + "ms)")
  15729. : undefined
  15730. );
  15731. }
  15732. }, res.timeout);
  15733. }
  15734. }
  15735. }
  15736. sync = false;
  15737. // return in case resolved synchronously
  15738. return factory.loading
  15739. ? factory.loadingComp
  15740. : factory.resolved
  15741. }
  15742. }
  15743. /* */
  15744. function isAsyncPlaceholder (node) {
  15745. return node.isComment && node.asyncFactory
  15746. }
  15747. /* */
  15748. function getFirstComponentChild (children) {
  15749. if (Array.isArray(children)) {
  15750. for (var i = 0; i < children.length; i++) {
  15751. var c = children[i];
  15752. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  15753. return c
  15754. }
  15755. }
  15756. }
  15757. }
  15758. /* */
  15759. /* */
  15760. function initEvents (vm) {
  15761. vm._events = Object.create(null);
  15762. vm._hasHookEvent = false;
  15763. // init parent attached events
  15764. var listeners = vm.$options._parentListeners;
  15765. if (listeners) {
  15766. updateComponentListeners(vm, listeners);
  15767. }
  15768. }
  15769. var target;
  15770. function add (event, fn) {
  15771. target.$on(event, fn);
  15772. }
  15773. function remove$1 (event, fn) {
  15774. target.$off(event, fn);
  15775. }
  15776. function createOnceHandler (event, fn) {
  15777. var _target = target;
  15778. return function onceHandler () {
  15779. var res = fn.apply(null, arguments);
  15780. if (res !== null) {
  15781. _target.$off(event, onceHandler);
  15782. }
  15783. }
  15784. }
  15785. function updateComponentListeners (
  15786. vm,
  15787. listeners,
  15788. oldListeners
  15789. ) {
  15790. target = vm;
  15791. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  15792. target = undefined;
  15793. }
  15794. function eventsMixin (Vue) {
  15795. var hookRE = /^hook:/;
  15796. Vue.prototype.$on = function (event, fn) {
  15797. var vm = this;
  15798. if (Array.isArray(event)) {
  15799. for (var i = 0, l = event.length; i < l; i++) {
  15800. vm.$on(event[i], fn);
  15801. }
  15802. } else {
  15803. (vm._events[event] || (vm._events[event] = [])).push(fn);
  15804. // optimize hook:event cost by using a boolean flag marked at registration
  15805. // instead of a hash lookup
  15806. if (hookRE.test(event)) {
  15807. vm._hasHookEvent = true;
  15808. }
  15809. }
  15810. return vm
  15811. };
  15812. Vue.prototype.$once = function (event, fn) {
  15813. var vm = this;
  15814. function on () {
  15815. vm.$off(event, on);
  15816. fn.apply(vm, arguments);
  15817. }
  15818. on.fn = fn;
  15819. vm.$on(event, on);
  15820. return vm
  15821. };
  15822. Vue.prototype.$off = function (event, fn) {
  15823. var vm = this;
  15824. // all
  15825. if (!arguments.length) {
  15826. vm._events = Object.create(null);
  15827. return vm
  15828. }
  15829. // array of events
  15830. if (Array.isArray(event)) {
  15831. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  15832. vm.$off(event[i$1], fn);
  15833. }
  15834. return vm
  15835. }
  15836. // specific event
  15837. var cbs = vm._events[event];
  15838. if (!cbs) {
  15839. return vm
  15840. }
  15841. if (!fn) {
  15842. vm._events[event] = null;
  15843. return vm
  15844. }
  15845. // specific handler
  15846. var cb;
  15847. var i = cbs.length;
  15848. while (i--) {
  15849. cb = cbs[i];
  15850. if (cb === fn || cb.fn === fn) {
  15851. cbs.splice(i, 1);
  15852. break
  15853. }
  15854. }
  15855. return vm
  15856. };
  15857. Vue.prototype.$emit = function (event) {
  15858. var vm = this;
  15859. if (true) {
  15860. var lowerCaseEvent = event.toLowerCase();
  15861. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  15862. tip(
  15863. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  15864. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  15865. "Note that HTML attributes are case-insensitive and you cannot use " +
  15866. "v-on to listen to camelCase events when using in-DOM templates. " +
  15867. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  15868. );
  15869. }
  15870. }
  15871. var cbs = vm._events[event];
  15872. if (cbs) {
  15873. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  15874. var args = toArray(arguments, 1);
  15875. var info = "event handler for \"" + event + "\"";
  15876. for (var i = 0, l = cbs.length; i < l; i++) {
  15877. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  15878. }
  15879. }
  15880. return vm
  15881. };
  15882. }
  15883. /* */
  15884. var activeInstance = null;
  15885. var isUpdatingChildComponent = false;
  15886. function setActiveInstance(vm) {
  15887. var prevActiveInstance = activeInstance;
  15888. activeInstance = vm;
  15889. return function () {
  15890. activeInstance = prevActiveInstance;
  15891. }
  15892. }
  15893. function initLifecycle (vm) {
  15894. var options = vm.$options;
  15895. // locate first non-abstract parent
  15896. var parent = options.parent;
  15897. if (parent && !options.abstract) {
  15898. while (parent.$options.abstract && parent.$parent) {
  15899. parent = parent.$parent;
  15900. }
  15901. parent.$children.push(vm);
  15902. }
  15903. vm.$parent = parent;
  15904. vm.$root = parent ? parent.$root : vm;
  15905. vm.$children = [];
  15906. vm.$refs = {};
  15907. vm._watcher = null;
  15908. vm._inactive = null;
  15909. vm._directInactive = false;
  15910. vm._isMounted = false;
  15911. vm._isDestroyed = false;
  15912. vm._isBeingDestroyed = false;
  15913. }
  15914. function lifecycleMixin (Vue) {
  15915. Vue.prototype._update = function (vnode, hydrating) {
  15916. var vm = this;
  15917. var prevEl = vm.$el;
  15918. var prevVnode = vm._vnode;
  15919. var restoreActiveInstance = setActiveInstance(vm);
  15920. vm._vnode = vnode;
  15921. // Vue.prototype.__patch__ is injected in entry points
  15922. // based on the rendering backend used.
  15923. if (!prevVnode) {
  15924. // initial render
  15925. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  15926. } else {
  15927. // updates
  15928. vm.$el = vm.__patch__(prevVnode, vnode);
  15929. }
  15930. restoreActiveInstance();
  15931. // update __vue__ reference
  15932. if (prevEl) {
  15933. prevEl.__vue__ = null;
  15934. }
  15935. if (vm.$el) {
  15936. vm.$el.__vue__ = vm;
  15937. }
  15938. // if parent is an HOC, update its $el as well
  15939. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  15940. vm.$parent.$el = vm.$el;
  15941. }
  15942. // updated hook is called by the scheduler to ensure that children are
  15943. // updated in a parent's updated hook.
  15944. };
  15945. Vue.prototype.$forceUpdate = function () {
  15946. var vm = this;
  15947. if (vm._watcher) {
  15948. vm._watcher.update();
  15949. }
  15950. };
  15951. Vue.prototype.$destroy = function () {
  15952. var vm = this;
  15953. if (vm._isBeingDestroyed) {
  15954. return
  15955. }
  15956. callHook(vm, 'beforeDestroy');
  15957. vm._isBeingDestroyed = true;
  15958. // remove self from parent
  15959. var parent = vm.$parent;
  15960. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  15961. remove(parent.$children, vm);
  15962. }
  15963. // teardown watchers
  15964. if (vm._watcher) {
  15965. vm._watcher.teardown();
  15966. }
  15967. var i = vm._watchers.length;
  15968. while (i--) {
  15969. vm._watchers[i].teardown();
  15970. }
  15971. // remove reference from data ob
  15972. // frozen object may not have observer.
  15973. if (vm._data.__ob__) {
  15974. vm._data.__ob__.vmCount--;
  15975. }
  15976. // call the last hook...
  15977. vm._isDestroyed = true;
  15978. // invoke destroy hooks on current rendered tree
  15979. vm.__patch__(vm._vnode, null);
  15980. // fire destroyed hook
  15981. callHook(vm, 'destroyed');
  15982. // turn off all instance listeners.
  15983. vm.$off();
  15984. // remove __vue__ reference
  15985. if (vm.$el) {
  15986. vm.$el.__vue__ = null;
  15987. }
  15988. // release circular reference (#6759)
  15989. if (vm.$vnode) {
  15990. vm.$vnode.parent = null;
  15991. }
  15992. };
  15993. }
  15994. function updateChildComponent (
  15995. vm,
  15996. propsData,
  15997. listeners,
  15998. parentVnode,
  15999. renderChildren
  16000. ) {
  16001. if (true) {
  16002. isUpdatingChildComponent = true;
  16003. }
  16004. // determine whether component has slot children
  16005. // we need to do this before overwriting $options._renderChildren.
  16006. // check if there are dynamic scopedSlots (hand-written or compiled but with
  16007. // dynamic slot names). Static scoped slots compiled from template has the
  16008. // "$stable" marker.
  16009. var newScopedSlots = parentVnode.data.scopedSlots;
  16010. var oldScopedSlots = vm.$scopedSlots;
  16011. var hasDynamicScopedSlot = !!(
  16012. (newScopedSlots && !newScopedSlots.$stable) ||
  16013. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  16014. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  16015. );
  16016. // Any static slot children from the parent may have changed during parent's
  16017. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  16018. // update is necessary to ensure correctness.
  16019. var needsForceUpdate = !!(
  16020. renderChildren || // has new static slots
  16021. vm.$options._renderChildren || // has old static slots
  16022. hasDynamicScopedSlot
  16023. );
  16024. vm.$options._parentVnode = parentVnode;
  16025. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  16026. if (vm._vnode) { // update child tree's parent
  16027. vm._vnode.parent = parentVnode;
  16028. }
  16029. vm.$options._renderChildren = renderChildren;
  16030. // update $attrs and $listeners hash
  16031. // these are also reactive so they may trigger child update if the child
  16032. // used them during render
  16033. vm.$attrs = parentVnode.data.attrs || emptyObject;
  16034. vm.$listeners = listeners || emptyObject;
  16035. // update props
  16036. if (propsData && vm.$options.props) {
  16037. toggleObserving(false);
  16038. var props = vm._props;
  16039. var propKeys = vm.$options._propKeys || [];
  16040. for (var i = 0; i < propKeys.length; i++) {
  16041. var key = propKeys[i];
  16042. var propOptions = vm.$options.props; // wtf flow?
  16043. props[key] = validateProp(key, propOptions, propsData, vm);
  16044. }
  16045. toggleObserving(true);
  16046. // keep a copy of raw propsData
  16047. vm.$options.propsData = propsData;
  16048. }
  16049. // fixed by xxxxxx update properties(mp runtime)
  16050. vm._$updateProperties && vm._$updateProperties(vm);
  16051. // update listeners
  16052. listeners = listeners || emptyObject;
  16053. var oldListeners = vm.$options._parentListeners;
  16054. vm.$options._parentListeners = listeners;
  16055. updateComponentListeners(vm, listeners, oldListeners);
  16056. // resolve slots + force update if has children
  16057. if (needsForceUpdate) {
  16058. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  16059. vm.$forceUpdate();
  16060. }
  16061. if (true) {
  16062. isUpdatingChildComponent = false;
  16063. }
  16064. }
  16065. function isInInactiveTree (vm) {
  16066. while (vm && (vm = vm.$parent)) {
  16067. if (vm._inactive) { return true }
  16068. }
  16069. return false
  16070. }
  16071. function activateChildComponent (vm, direct) {
  16072. if (direct) {
  16073. vm._directInactive = false;
  16074. if (isInInactiveTree(vm)) {
  16075. return
  16076. }
  16077. } else if (vm._directInactive) {
  16078. return
  16079. }
  16080. if (vm._inactive || vm._inactive === null) {
  16081. vm._inactive = false;
  16082. for (var i = 0; i < vm.$children.length; i++) {
  16083. activateChildComponent(vm.$children[i]);
  16084. }
  16085. callHook(vm, 'activated');
  16086. }
  16087. }
  16088. function deactivateChildComponent (vm, direct) {
  16089. if (direct) {
  16090. vm._directInactive = true;
  16091. if (isInInactiveTree(vm)) {
  16092. return
  16093. }
  16094. }
  16095. if (!vm._inactive) {
  16096. vm._inactive = true;
  16097. for (var i = 0; i < vm.$children.length; i++) {
  16098. deactivateChildComponent(vm.$children[i]);
  16099. }
  16100. callHook(vm, 'deactivated');
  16101. }
  16102. }
  16103. function callHook (vm, hook) {
  16104. // #7573 disable dep collection when invoking lifecycle hooks
  16105. pushTarget();
  16106. var handlers = vm.$options[hook];
  16107. var info = hook + " hook";
  16108. if (handlers) {
  16109. for (var i = 0, j = handlers.length; i < j; i++) {
  16110. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  16111. }
  16112. }
  16113. if (vm._hasHookEvent) {
  16114. vm.$emit('hook:' + hook);
  16115. }
  16116. popTarget();
  16117. }
  16118. /* */
  16119. var MAX_UPDATE_COUNT = 100;
  16120. var queue = [];
  16121. var activatedChildren = [];
  16122. var has = {};
  16123. var circular = {};
  16124. var waiting = false;
  16125. var flushing = false;
  16126. var index = 0;
  16127. /**
  16128. * Reset the scheduler's state.
  16129. */
  16130. function resetSchedulerState () {
  16131. index = queue.length = activatedChildren.length = 0;
  16132. has = {};
  16133. if (true) {
  16134. circular = {};
  16135. }
  16136. waiting = flushing = false;
  16137. }
  16138. // Async edge case #6566 requires saving the timestamp when event listeners are
  16139. // attached. However, calling performance.now() has a perf overhead especially
  16140. // if the page has thousands of event listeners. Instead, we take a timestamp
  16141. // every time the scheduler flushes and use that for all event listeners
  16142. // attached during that flush.
  16143. var currentFlushTimestamp = 0;
  16144. // Async edge case fix requires storing an event listener's attach timestamp.
  16145. var getNow = Date.now;
  16146. // Determine what event timestamp the browser is using. Annoyingly, the
  16147. // timestamp can either be hi-res (relative to page load) or low-res
  16148. // (relative to UNIX epoch), so in order to compare time we have to use the
  16149. // same timestamp type when saving the flush timestamp.
  16150. // All IE versions use low-res event timestamps, and have problematic clock
  16151. // implementations (#9632)
  16152. if (inBrowser && !isIE) {
  16153. var performance = window.performance;
  16154. if (
  16155. performance &&
  16156. typeof performance.now === 'function' &&
  16157. getNow() > document.createEvent('Event').timeStamp
  16158. ) {
  16159. // if the event timestamp, although evaluated AFTER the Date.now(), is
  16160. // smaller than it, it means the event is using a hi-res timestamp,
  16161. // and we need to use the hi-res version for event listener timestamps as
  16162. // well.
  16163. getNow = function () { return performance.now(); };
  16164. }
  16165. }
  16166. /**
  16167. * Flush both queues and run the watchers.
  16168. */
  16169. function flushSchedulerQueue () {
  16170. currentFlushTimestamp = getNow();
  16171. flushing = true;
  16172. var watcher, id;
  16173. // Sort queue before flush.
  16174. // This ensures that:
  16175. // 1. Components are updated from parent to child. (because parent is always
  16176. // created before the child)
  16177. // 2. A component's user watchers are run before its render watcher (because
  16178. // user watchers are created before the render watcher)
  16179. // 3. If a component is destroyed during a parent component's watcher run,
  16180. // its watchers can be skipped.
  16181. queue.sort(function (a, b) { return a.id - b.id; });
  16182. // do not cache length because more watchers might be pushed
  16183. // as we run existing watchers
  16184. for (index = 0; index < queue.length; index++) {
  16185. watcher = queue[index];
  16186. if (watcher.before) {
  16187. watcher.before();
  16188. }
  16189. id = watcher.id;
  16190. has[id] = null;
  16191. watcher.run();
  16192. // in dev build, check and stop circular updates.
  16193. if ( true && has[id] != null) {
  16194. circular[id] = (circular[id] || 0) + 1;
  16195. if (circular[id] > MAX_UPDATE_COUNT) {
  16196. warn(
  16197. 'You may have an infinite update loop ' + (
  16198. watcher.user
  16199. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  16200. : "in a component render function."
  16201. ),
  16202. watcher.vm
  16203. );
  16204. break
  16205. }
  16206. }
  16207. }
  16208. // keep copies of post queues before resetting state
  16209. var activatedQueue = activatedChildren.slice();
  16210. var updatedQueue = queue.slice();
  16211. resetSchedulerState();
  16212. // call component updated and activated hooks
  16213. callActivatedHooks(activatedQueue);
  16214. callUpdatedHooks(updatedQueue);
  16215. // devtool hook
  16216. /* istanbul ignore if */
  16217. if (devtools && config.devtools) {
  16218. devtools.emit('flush');
  16219. }
  16220. }
  16221. function callUpdatedHooks (queue) {
  16222. var i = queue.length;
  16223. while (i--) {
  16224. var watcher = queue[i];
  16225. var vm = watcher.vm;
  16226. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  16227. callHook(vm, 'updated');
  16228. }
  16229. }
  16230. }
  16231. /**
  16232. * Queue a kept-alive component that was activated during patch.
  16233. * The queue will be processed after the entire tree has been patched.
  16234. */
  16235. function queueActivatedComponent (vm) {
  16236. // setting _inactive to false here so that a render function can
  16237. // rely on checking whether it's in an inactive tree (e.g. router-view)
  16238. vm._inactive = false;
  16239. activatedChildren.push(vm);
  16240. }
  16241. function callActivatedHooks (queue) {
  16242. for (var i = 0; i < queue.length; i++) {
  16243. queue[i]._inactive = true;
  16244. activateChildComponent(queue[i], true /* true */);
  16245. }
  16246. }
  16247. /**
  16248. * Push a watcher into the watcher queue.
  16249. * Jobs with duplicate IDs will be skipped unless it's
  16250. * pushed when the queue is being flushed.
  16251. */
  16252. function queueWatcher (watcher) {
  16253. var id = watcher.id;
  16254. if (has[id] == null) {
  16255. has[id] = true;
  16256. if (!flushing) {
  16257. queue.push(watcher);
  16258. } else {
  16259. // if already flushing, splice the watcher based on its id
  16260. // if already past its id, it will be run next immediately.
  16261. var i = queue.length - 1;
  16262. while (i > index && queue[i].id > watcher.id) {
  16263. i--;
  16264. }
  16265. queue.splice(i + 1, 0, watcher);
  16266. }
  16267. // queue the flush
  16268. if (!waiting) {
  16269. waiting = true;
  16270. if ( true && !config.async) {
  16271. flushSchedulerQueue();
  16272. return
  16273. }
  16274. nextTick(flushSchedulerQueue);
  16275. }
  16276. }
  16277. }
  16278. /* */
  16279. var uid$2 = 0;
  16280. /**
  16281. * A watcher parses an expression, collects dependencies,
  16282. * and fires callback when the expression value changes.
  16283. * This is used for both the $watch() api and directives.
  16284. */
  16285. var Watcher = function Watcher (
  16286. vm,
  16287. expOrFn,
  16288. cb,
  16289. options,
  16290. isRenderWatcher
  16291. ) {
  16292. this.vm = vm;
  16293. if (isRenderWatcher) {
  16294. vm._watcher = this;
  16295. }
  16296. vm._watchers.push(this);
  16297. // options
  16298. if (options) {
  16299. this.deep = !!options.deep;
  16300. this.user = !!options.user;
  16301. this.lazy = !!options.lazy;
  16302. this.sync = !!options.sync;
  16303. this.before = options.before;
  16304. } else {
  16305. this.deep = this.user = this.lazy = this.sync = false;
  16306. }
  16307. this.cb = cb;
  16308. this.id = ++uid$2; // uid for batching
  16309. this.active = true;
  16310. this.dirty = this.lazy; // for lazy watchers
  16311. this.deps = [];
  16312. this.newDeps = [];
  16313. this.depIds = new _Set();
  16314. this.newDepIds = new _Set();
  16315. this.expression = true
  16316. ? expOrFn.toString()
  16317. : undefined;
  16318. // parse expression for getter
  16319. if (typeof expOrFn === 'function') {
  16320. this.getter = expOrFn;
  16321. } else {
  16322. this.getter = parsePath(expOrFn);
  16323. if (!this.getter) {
  16324. this.getter = noop;
  16325. true && warn(
  16326. "Failed watching path: \"" + expOrFn + "\" " +
  16327. 'Watcher only accepts simple dot-delimited paths. ' +
  16328. 'For full control, use a function instead.',
  16329. vm
  16330. );
  16331. }
  16332. }
  16333. this.value = this.lazy
  16334. ? undefined
  16335. : this.get();
  16336. };
  16337. /**
  16338. * Evaluate the getter, and re-collect dependencies.
  16339. */
  16340. Watcher.prototype.get = function get () {
  16341. pushTarget(this);
  16342. var value;
  16343. var vm = this.vm;
  16344. try {
  16345. value = this.getter.call(vm, vm);
  16346. } catch (e) {
  16347. if (this.user) {
  16348. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  16349. } else {
  16350. throw e
  16351. }
  16352. } finally {
  16353. // "touch" every property so they are all tracked as
  16354. // dependencies for deep watching
  16355. if (this.deep) {
  16356. traverse(value);
  16357. }
  16358. popTarget();
  16359. this.cleanupDeps();
  16360. }
  16361. return value
  16362. };
  16363. /**
  16364. * Add a dependency to this directive.
  16365. */
  16366. Watcher.prototype.addDep = function addDep (dep) {
  16367. var id = dep.id;
  16368. if (!this.newDepIds.has(id)) {
  16369. this.newDepIds.add(id);
  16370. this.newDeps.push(dep);
  16371. if (!this.depIds.has(id)) {
  16372. dep.addSub(this);
  16373. }
  16374. }
  16375. };
  16376. /**
  16377. * Clean up for dependency collection.
  16378. */
  16379. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  16380. var i = this.deps.length;
  16381. while (i--) {
  16382. var dep = this.deps[i];
  16383. if (!this.newDepIds.has(dep.id)) {
  16384. dep.removeSub(this);
  16385. }
  16386. }
  16387. var tmp = this.depIds;
  16388. this.depIds = this.newDepIds;
  16389. this.newDepIds = tmp;
  16390. this.newDepIds.clear();
  16391. tmp = this.deps;
  16392. this.deps = this.newDeps;
  16393. this.newDeps = tmp;
  16394. this.newDeps.length = 0;
  16395. };
  16396. /**
  16397. * Subscriber interface.
  16398. * Will be called when a dependency changes.
  16399. */
  16400. Watcher.prototype.update = function update () {
  16401. /* istanbul ignore else */
  16402. if (this.lazy) {
  16403. this.dirty = true;
  16404. } else if (this.sync) {
  16405. this.run();
  16406. } else {
  16407. queueWatcher(this);
  16408. }
  16409. };
  16410. /**
  16411. * Scheduler job interface.
  16412. * Will be called by the scheduler.
  16413. */
  16414. Watcher.prototype.run = function run () {
  16415. if (this.active) {
  16416. var value = this.get();
  16417. if (
  16418. value !== this.value ||
  16419. // Deep watchers and watchers on Object/Arrays should fire even
  16420. // when the value is the same, because the value may
  16421. // have mutated.
  16422. isObject(value) ||
  16423. this.deep
  16424. ) {
  16425. // set new value
  16426. var oldValue = this.value;
  16427. this.value = value;
  16428. if (this.user) {
  16429. try {
  16430. this.cb.call(this.vm, value, oldValue);
  16431. } catch (e) {
  16432. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  16433. }
  16434. } else {
  16435. this.cb.call(this.vm, value, oldValue);
  16436. }
  16437. }
  16438. }
  16439. };
  16440. /**
  16441. * Evaluate the value of the watcher.
  16442. * This only gets called for lazy watchers.
  16443. */
  16444. Watcher.prototype.evaluate = function evaluate () {
  16445. this.value = this.get();
  16446. this.dirty = false;
  16447. };
  16448. /**
  16449. * Depend on all deps collected by this watcher.
  16450. */
  16451. Watcher.prototype.depend = function depend () {
  16452. var i = this.deps.length;
  16453. while (i--) {
  16454. this.deps[i].depend();
  16455. }
  16456. };
  16457. /**
  16458. * Remove self from all dependencies' subscriber list.
  16459. */
  16460. Watcher.prototype.teardown = function teardown () {
  16461. if (this.active) {
  16462. // remove self from vm's watcher list
  16463. // this is a somewhat expensive operation so we skip it
  16464. // if the vm is being destroyed.
  16465. if (!this.vm._isBeingDestroyed) {
  16466. remove(this.vm._watchers, this);
  16467. }
  16468. var i = this.deps.length;
  16469. while (i--) {
  16470. this.deps[i].removeSub(this);
  16471. }
  16472. this.active = false;
  16473. }
  16474. };
  16475. /* */
  16476. var sharedPropertyDefinition = {
  16477. enumerable: true,
  16478. configurable: true,
  16479. get: noop,
  16480. set: noop
  16481. };
  16482. function proxy (target, sourceKey, key) {
  16483. sharedPropertyDefinition.get = function proxyGetter () {
  16484. return this[sourceKey][key]
  16485. };
  16486. sharedPropertyDefinition.set = function proxySetter (val) {
  16487. this[sourceKey][key] = val;
  16488. };
  16489. Object.defineProperty(target, key, sharedPropertyDefinition);
  16490. }
  16491. function initState (vm) {
  16492. vm._watchers = [];
  16493. var opts = vm.$options;
  16494. if (opts.props) { initProps(vm, opts.props); }
  16495. if (opts.methods) { initMethods(vm, opts.methods); }
  16496. if (opts.data) {
  16497. initData(vm);
  16498. } else {
  16499. observe(vm._data = {}, true /* asRootData */);
  16500. }
  16501. if (opts.computed) { initComputed(vm, opts.computed); }
  16502. if (opts.watch && opts.watch !== nativeWatch) {
  16503. initWatch(vm, opts.watch);
  16504. }
  16505. }
  16506. function initProps (vm, propsOptions) {
  16507. var propsData = vm.$options.propsData || {};
  16508. var props = vm._props = {};
  16509. // cache prop keys so that future props updates can iterate using Array
  16510. // instead of dynamic object key enumeration.
  16511. var keys = vm.$options._propKeys = [];
  16512. var isRoot = !vm.$parent;
  16513. // root instance props should be converted
  16514. if (!isRoot) {
  16515. toggleObserving(false);
  16516. }
  16517. var loop = function ( key ) {
  16518. keys.push(key);
  16519. var value = validateProp(key, propsOptions, propsData, vm);
  16520. /* istanbul ignore else */
  16521. if (true) {
  16522. var hyphenatedKey = hyphenate(key);
  16523. if (isReservedAttribute(hyphenatedKey) ||
  16524. config.isReservedAttr(hyphenatedKey)) {
  16525. warn(
  16526. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  16527. vm
  16528. );
  16529. }
  16530. defineReactive$$1(props, key, value, function () {
  16531. if (!isRoot && !isUpdatingChildComponent) {
  16532. {
  16533. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  16534. return
  16535. }
  16536. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  16537. if(
  16538. key === 'value' &&
  16539. Array.isArray(vm.$options.behaviors) &&
  16540. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  16541. ){
  16542. return
  16543. }
  16544. if(vm._getFormData){
  16545. return
  16546. }
  16547. var $parent = vm.$parent;
  16548. while($parent){
  16549. if($parent.__next_tick_pending){
  16550. return
  16551. }
  16552. $parent = $parent.$parent;
  16553. }
  16554. }
  16555. warn(
  16556. "Avoid mutating a prop directly since the value will be " +
  16557. "overwritten whenever the parent component re-renders. " +
  16558. "Instead, use a data or computed property based on the prop's " +
  16559. "value. Prop being mutated: \"" + key + "\"",
  16560. vm
  16561. );
  16562. }
  16563. });
  16564. } else {}
  16565. // static props are already proxied on the component's prototype
  16566. // during Vue.extend(). We only need to proxy props defined at
  16567. // instantiation here.
  16568. if (!(key in vm)) {
  16569. proxy(vm, "_props", key);
  16570. }
  16571. };
  16572. for (var key in propsOptions) loop( key );
  16573. toggleObserving(true);
  16574. }
  16575. function initData (vm) {
  16576. var data = vm.$options.data;
  16577. data = vm._data = typeof data === 'function'
  16578. ? getData(data, vm)
  16579. : data || {};
  16580. if (!isPlainObject(data)) {
  16581. data = {};
  16582. true && warn(
  16583. 'data functions should return an object:\n' +
  16584. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  16585. vm
  16586. );
  16587. }
  16588. // proxy data on instance
  16589. var keys = Object.keys(data);
  16590. var props = vm.$options.props;
  16591. var methods = vm.$options.methods;
  16592. var i = keys.length;
  16593. while (i--) {
  16594. var key = keys[i];
  16595. if (true) {
  16596. if (methods && hasOwn(methods, key)) {
  16597. warn(
  16598. ("Method \"" + key + "\" has already been defined as a data property."),
  16599. vm
  16600. );
  16601. }
  16602. }
  16603. if (props && hasOwn(props, key)) {
  16604. true && warn(
  16605. "The data property \"" + key + "\" is already declared as a prop. " +
  16606. "Use prop default value instead.",
  16607. vm
  16608. );
  16609. } else if (!isReserved(key)) {
  16610. proxy(vm, "_data", key);
  16611. }
  16612. }
  16613. // observe data
  16614. observe(data, true /* asRootData */);
  16615. }
  16616. function getData (data, vm) {
  16617. // #7573 disable dep collection when invoking data getters
  16618. pushTarget();
  16619. try {
  16620. return data.call(vm, vm)
  16621. } catch (e) {
  16622. handleError(e, vm, "data()");
  16623. return {}
  16624. } finally {
  16625. popTarget();
  16626. }
  16627. }
  16628. var computedWatcherOptions = { lazy: true };
  16629. function initComputed (vm, computed) {
  16630. // $flow-disable-line
  16631. var watchers = vm._computedWatchers = Object.create(null);
  16632. // computed properties are just getters during SSR
  16633. var isSSR = isServerRendering();
  16634. for (var key in computed) {
  16635. var userDef = computed[key];
  16636. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  16637. if ( true && getter == null) {
  16638. warn(
  16639. ("Getter is missing for computed property \"" + key + "\"."),
  16640. vm
  16641. );
  16642. }
  16643. if (!isSSR) {
  16644. // create internal watcher for the computed property.
  16645. watchers[key] = new Watcher(
  16646. vm,
  16647. getter || noop,
  16648. noop,
  16649. computedWatcherOptions
  16650. );
  16651. }
  16652. // component-defined computed properties are already defined on the
  16653. // component prototype. We only need to define computed properties defined
  16654. // at instantiation here.
  16655. if (!(key in vm)) {
  16656. defineComputed(vm, key, userDef);
  16657. } else if (true) {
  16658. if (key in vm.$data) {
  16659. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  16660. } else if (vm.$options.props && key in vm.$options.props) {
  16661. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  16662. }
  16663. }
  16664. }
  16665. }
  16666. function defineComputed (
  16667. target,
  16668. key,
  16669. userDef
  16670. ) {
  16671. var shouldCache = !isServerRendering();
  16672. if (typeof userDef === 'function') {
  16673. sharedPropertyDefinition.get = shouldCache
  16674. ? createComputedGetter(key)
  16675. : createGetterInvoker(userDef);
  16676. sharedPropertyDefinition.set = noop;
  16677. } else {
  16678. sharedPropertyDefinition.get = userDef.get
  16679. ? shouldCache && userDef.cache !== false
  16680. ? createComputedGetter(key)
  16681. : createGetterInvoker(userDef.get)
  16682. : noop;
  16683. sharedPropertyDefinition.set = userDef.set || noop;
  16684. }
  16685. if ( true &&
  16686. sharedPropertyDefinition.set === noop) {
  16687. sharedPropertyDefinition.set = function () {
  16688. warn(
  16689. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  16690. this
  16691. );
  16692. };
  16693. }
  16694. Object.defineProperty(target, key, sharedPropertyDefinition);
  16695. }
  16696. function createComputedGetter (key) {
  16697. return function computedGetter () {
  16698. var watcher = this._computedWatchers && this._computedWatchers[key];
  16699. if (watcher) {
  16700. if (watcher.dirty) {
  16701. watcher.evaluate();
  16702. }
  16703. if (Dep.SharedObject.target) {// fixed by xxxxxx
  16704. watcher.depend();
  16705. }
  16706. return watcher.value
  16707. }
  16708. }
  16709. }
  16710. function createGetterInvoker(fn) {
  16711. return function computedGetter () {
  16712. return fn.call(this, this)
  16713. }
  16714. }
  16715. function initMethods (vm, methods) {
  16716. var props = vm.$options.props;
  16717. for (var key in methods) {
  16718. if (true) {
  16719. if (typeof methods[key] !== 'function') {
  16720. warn(
  16721. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  16722. "Did you reference the function correctly?",
  16723. vm
  16724. );
  16725. }
  16726. if (props && hasOwn(props, key)) {
  16727. warn(
  16728. ("Method \"" + key + "\" has already been defined as a prop."),
  16729. vm
  16730. );
  16731. }
  16732. if ((key in vm) && isReserved(key)) {
  16733. warn(
  16734. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  16735. "Avoid defining component methods that start with _ or $."
  16736. );
  16737. }
  16738. }
  16739. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  16740. }
  16741. }
  16742. function initWatch (vm, watch) {
  16743. for (var key in watch) {
  16744. var handler = watch[key];
  16745. if (Array.isArray(handler)) {
  16746. for (var i = 0; i < handler.length; i++) {
  16747. createWatcher(vm, key, handler[i]);
  16748. }
  16749. } else {
  16750. createWatcher(vm, key, handler);
  16751. }
  16752. }
  16753. }
  16754. function createWatcher (
  16755. vm,
  16756. expOrFn,
  16757. handler,
  16758. options
  16759. ) {
  16760. if (isPlainObject(handler)) {
  16761. options = handler;
  16762. handler = handler.handler;
  16763. }
  16764. if (typeof handler === 'string') {
  16765. handler = vm[handler];
  16766. }
  16767. return vm.$watch(expOrFn, handler, options)
  16768. }
  16769. function stateMixin (Vue) {
  16770. // flow somehow has problems with directly declared definition object
  16771. // when using Object.defineProperty, so we have to procedurally build up
  16772. // the object here.
  16773. var dataDef = {};
  16774. dataDef.get = function () { return this._data };
  16775. var propsDef = {};
  16776. propsDef.get = function () { return this._props };
  16777. if (true) {
  16778. dataDef.set = function () {
  16779. warn(
  16780. 'Avoid replacing instance root $data. ' +
  16781. 'Use nested data properties instead.',
  16782. this
  16783. );
  16784. };
  16785. propsDef.set = function () {
  16786. warn("$props is readonly.", this);
  16787. };
  16788. }
  16789. Object.defineProperty(Vue.prototype, '$data', dataDef);
  16790. Object.defineProperty(Vue.prototype, '$props', propsDef);
  16791. Vue.prototype.$set = set;
  16792. Vue.prototype.$delete = del;
  16793. Vue.prototype.$watch = function (
  16794. expOrFn,
  16795. cb,
  16796. options
  16797. ) {
  16798. var vm = this;
  16799. if (isPlainObject(cb)) {
  16800. return createWatcher(vm, expOrFn, cb, options)
  16801. }
  16802. options = options || {};
  16803. options.user = true;
  16804. var watcher = new Watcher(vm, expOrFn, cb, options);
  16805. if (options.immediate) {
  16806. try {
  16807. cb.call(vm, watcher.value);
  16808. } catch (error) {
  16809. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  16810. }
  16811. }
  16812. return function unwatchFn () {
  16813. watcher.teardown();
  16814. }
  16815. };
  16816. }
  16817. /* */
  16818. var uid$3 = 0;
  16819. function initMixin (Vue) {
  16820. Vue.prototype._init = function (options) {
  16821. var vm = this;
  16822. // a uid
  16823. vm._uid = uid$3++;
  16824. var startTag, endTag;
  16825. /* istanbul ignore if */
  16826. if ( true && config.performance && mark) {
  16827. startTag = "vue-perf-start:" + (vm._uid);
  16828. endTag = "vue-perf-end:" + (vm._uid);
  16829. mark(startTag);
  16830. }
  16831. // a flag to avoid this being observed
  16832. vm._isVue = true;
  16833. // merge options
  16834. if (options && options._isComponent) {
  16835. // optimize internal component instantiation
  16836. // since dynamic options merging is pretty slow, and none of the
  16837. // internal component options needs special treatment.
  16838. initInternalComponent(vm, options);
  16839. } else {
  16840. vm.$options = mergeOptions(
  16841. resolveConstructorOptions(vm.constructor),
  16842. options || {},
  16843. vm
  16844. );
  16845. }
  16846. /* istanbul ignore else */
  16847. if (true) {
  16848. initProxy(vm);
  16849. } else {}
  16850. // expose real self
  16851. vm._self = vm;
  16852. initLifecycle(vm);
  16853. initEvents(vm);
  16854. initRender(vm);
  16855. callHook(vm, 'beforeCreate');
  16856. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  16857. initState(vm);
  16858. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  16859. !vm._$fallback && callHook(vm, 'created');
  16860. /* istanbul ignore if */
  16861. if ( true && config.performance && mark) {
  16862. vm._name = formatComponentName(vm, false);
  16863. mark(endTag);
  16864. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  16865. }
  16866. if (vm.$options.el) {
  16867. vm.$mount(vm.$options.el);
  16868. }
  16869. };
  16870. }
  16871. function initInternalComponent (vm, options) {
  16872. var opts = vm.$options = Object.create(vm.constructor.options);
  16873. // doing this because it's faster than dynamic enumeration.
  16874. var parentVnode = options._parentVnode;
  16875. opts.parent = options.parent;
  16876. opts._parentVnode = parentVnode;
  16877. var vnodeComponentOptions = parentVnode.componentOptions;
  16878. opts.propsData = vnodeComponentOptions.propsData;
  16879. opts._parentListeners = vnodeComponentOptions.listeners;
  16880. opts._renderChildren = vnodeComponentOptions.children;
  16881. opts._componentTag = vnodeComponentOptions.tag;
  16882. if (options.render) {
  16883. opts.render = options.render;
  16884. opts.staticRenderFns = options.staticRenderFns;
  16885. }
  16886. }
  16887. function resolveConstructorOptions (Ctor) {
  16888. var options = Ctor.options;
  16889. if (Ctor.super) {
  16890. var superOptions = resolveConstructorOptions(Ctor.super);
  16891. var cachedSuperOptions = Ctor.superOptions;
  16892. if (superOptions !== cachedSuperOptions) {
  16893. // super option changed,
  16894. // need to resolve new options.
  16895. Ctor.superOptions = superOptions;
  16896. // check if there are any late-modified/attached options (#4976)
  16897. var modifiedOptions = resolveModifiedOptions(Ctor);
  16898. // update base extend options
  16899. if (modifiedOptions) {
  16900. extend(Ctor.extendOptions, modifiedOptions);
  16901. }
  16902. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  16903. if (options.name) {
  16904. options.components[options.name] = Ctor;
  16905. }
  16906. }
  16907. }
  16908. return options
  16909. }
  16910. function resolveModifiedOptions (Ctor) {
  16911. var modified;
  16912. var latest = Ctor.options;
  16913. var sealed = Ctor.sealedOptions;
  16914. for (var key in latest) {
  16915. if (latest[key] !== sealed[key]) {
  16916. if (!modified) { modified = {}; }
  16917. modified[key] = latest[key];
  16918. }
  16919. }
  16920. return modified
  16921. }
  16922. function Vue (options) {
  16923. if ( true &&
  16924. !(this instanceof Vue)
  16925. ) {
  16926. warn('Vue is a constructor and should be called with the `new` keyword');
  16927. }
  16928. this._init(options);
  16929. }
  16930. initMixin(Vue);
  16931. stateMixin(Vue);
  16932. eventsMixin(Vue);
  16933. lifecycleMixin(Vue);
  16934. renderMixin(Vue);
  16935. /* */
  16936. function initUse (Vue) {
  16937. Vue.use = function (plugin) {
  16938. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  16939. if (installedPlugins.indexOf(plugin) > -1) {
  16940. return this
  16941. }
  16942. // additional parameters
  16943. var args = toArray(arguments, 1);
  16944. args.unshift(this);
  16945. if (typeof plugin.install === 'function') {
  16946. plugin.install.apply(plugin, args);
  16947. } else if (typeof plugin === 'function') {
  16948. plugin.apply(null, args);
  16949. }
  16950. installedPlugins.push(plugin);
  16951. return this
  16952. };
  16953. }
  16954. /* */
  16955. function initMixin$1 (Vue) {
  16956. Vue.mixin = function (mixin) {
  16957. this.options = mergeOptions(this.options, mixin);
  16958. return this
  16959. };
  16960. }
  16961. /* */
  16962. function initExtend (Vue) {
  16963. /**
  16964. * Each instance constructor, including Vue, has a unique
  16965. * cid. This enables us to create wrapped "child
  16966. * constructors" for prototypal inheritance and cache them.
  16967. */
  16968. Vue.cid = 0;
  16969. var cid = 1;
  16970. /**
  16971. * Class inheritance
  16972. */
  16973. Vue.extend = function (extendOptions) {
  16974. extendOptions = extendOptions || {};
  16975. var Super = this;
  16976. var SuperId = Super.cid;
  16977. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  16978. if (cachedCtors[SuperId]) {
  16979. return cachedCtors[SuperId]
  16980. }
  16981. var name = extendOptions.name || Super.options.name;
  16982. if ( true && name) {
  16983. validateComponentName(name);
  16984. }
  16985. var Sub = function VueComponent (options) {
  16986. this._init(options);
  16987. };
  16988. Sub.prototype = Object.create(Super.prototype);
  16989. Sub.prototype.constructor = Sub;
  16990. Sub.cid = cid++;
  16991. Sub.options = mergeOptions(
  16992. Super.options,
  16993. extendOptions
  16994. );
  16995. Sub['super'] = Super;
  16996. // For props and computed properties, we define the proxy getters on
  16997. // the Vue instances at extension time, on the extended prototype. This
  16998. // avoids Object.defineProperty calls for each instance created.
  16999. if (Sub.options.props) {
  17000. initProps$1(Sub);
  17001. }
  17002. if (Sub.options.computed) {
  17003. initComputed$1(Sub);
  17004. }
  17005. // allow further extension/mixin/plugin usage
  17006. Sub.extend = Super.extend;
  17007. Sub.mixin = Super.mixin;
  17008. Sub.use = Super.use;
  17009. // create asset registers, so extended classes
  17010. // can have their private assets too.
  17011. ASSET_TYPES.forEach(function (type) {
  17012. Sub[type] = Super[type];
  17013. });
  17014. // enable recursive self-lookup
  17015. if (name) {
  17016. Sub.options.components[name] = Sub;
  17017. }
  17018. // keep a reference to the super options at extension time.
  17019. // later at instantiation we can check if Super's options have
  17020. // been updated.
  17021. Sub.superOptions = Super.options;
  17022. Sub.extendOptions = extendOptions;
  17023. Sub.sealedOptions = extend({}, Sub.options);
  17024. // cache constructor
  17025. cachedCtors[SuperId] = Sub;
  17026. return Sub
  17027. };
  17028. }
  17029. function initProps$1 (Comp) {
  17030. var props = Comp.options.props;
  17031. for (var key in props) {
  17032. proxy(Comp.prototype, "_props", key);
  17033. }
  17034. }
  17035. function initComputed$1 (Comp) {
  17036. var computed = Comp.options.computed;
  17037. for (var key in computed) {
  17038. defineComputed(Comp.prototype, key, computed[key]);
  17039. }
  17040. }
  17041. /* */
  17042. function initAssetRegisters (Vue) {
  17043. /**
  17044. * Create asset registration methods.
  17045. */
  17046. ASSET_TYPES.forEach(function (type) {
  17047. Vue[type] = function (
  17048. id,
  17049. definition
  17050. ) {
  17051. if (!definition) {
  17052. return this.options[type + 's'][id]
  17053. } else {
  17054. /* istanbul ignore if */
  17055. if ( true && type === 'component') {
  17056. validateComponentName(id);
  17057. }
  17058. if (type === 'component' && isPlainObject(definition)) {
  17059. definition.name = definition.name || id;
  17060. definition = this.options._base.extend(definition);
  17061. }
  17062. if (type === 'directive' && typeof definition === 'function') {
  17063. definition = { bind: definition, update: definition };
  17064. }
  17065. this.options[type + 's'][id] = definition;
  17066. return definition
  17067. }
  17068. };
  17069. });
  17070. }
  17071. /* */
  17072. function getComponentName (opts) {
  17073. return opts && (opts.Ctor.options.name || opts.tag)
  17074. }
  17075. function matches (pattern, name) {
  17076. if (Array.isArray(pattern)) {
  17077. return pattern.indexOf(name) > -1
  17078. } else if (typeof pattern === 'string') {
  17079. return pattern.split(',').indexOf(name) > -1
  17080. } else if (isRegExp(pattern)) {
  17081. return pattern.test(name)
  17082. }
  17083. /* istanbul ignore next */
  17084. return false
  17085. }
  17086. function pruneCache (keepAliveInstance, filter) {
  17087. var cache = keepAliveInstance.cache;
  17088. var keys = keepAliveInstance.keys;
  17089. var _vnode = keepAliveInstance._vnode;
  17090. for (var key in cache) {
  17091. var cachedNode = cache[key];
  17092. if (cachedNode) {
  17093. var name = getComponentName(cachedNode.componentOptions);
  17094. if (name && !filter(name)) {
  17095. pruneCacheEntry(cache, key, keys, _vnode);
  17096. }
  17097. }
  17098. }
  17099. }
  17100. function pruneCacheEntry (
  17101. cache,
  17102. key,
  17103. keys,
  17104. current
  17105. ) {
  17106. var cached$$1 = cache[key];
  17107. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  17108. cached$$1.componentInstance.$destroy();
  17109. }
  17110. cache[key] = null;
  17111. remove(keys, key);
  17112. }
  17113. var patternTypes = [String, RegExp, Array];
  17114. var KeepAlive = {
  17115. name: 'keep-alive',
  17116. abstract: true,
  17117. props: {
  17118. include: patternTypes,
  17119. exclude: patternTypes,
  17120. max: [String, Number]
  17121. },
  17122. created: function created () {
  17123. this.cache = Object.create(null);
  17124. this.keys = [];
  17125. },
  17126. destroyed: function destroyed () {
  17127. for (var key in this.cache) {
  17128. pruneCacheEntry(this.cache, key, this.keys);
  17129. }
  17130. },
  17131. mounted: function mounted () {
  17132. var this$1 = this;
  17133. this.$watch('include', function (val) {
  17134. pruneCache(this$1, function (name) { return matches(val, name); });
  17135. });
  17136. this.$watch('exclude', function (val) {
  17137. pruneCache(this$1, function (name) { return !matches(val, name); });
  17138. });
  17139. },
  17140. render: function render () {
  17141. var slot = this.$slots.default;
  17142. var vnode = getFirstComponentChild(slot);
  17143. var componentOptions = vnode && vnode.componentOptions;
  17144. if (componentOptions) {
  17145. // check pattern
  17146. var name = getComponentName(componentOptions);
  17147. var ref = this;
  17148. var include = ref.include;
  17149. var exclude = ref.exclude;
  17150. if (
  17151. // not included
  17152. (include && (!name || !matches(include, name))) ||
  17153. // excluded
  17154. (exclude && name && matches(exclude, name))
  17155. ) {
  17156. return vnode
  17157. }
  17158. var ref$1 = this;
  17159. var cache = ref$1.cache;
  17160. var keys = ref$1.keys;
  17161. var key = vnode.key == null
  17162. // same constructor may get registered as different local components
  17163. // so cid alone is not enough (#3269)
  17164. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  17165. : vnode.key;
  17166. if (cache[key]) {
  17167. vnode.componentInstance = cache[key].componentInstance;
  17168. // make current key freshest
  17169. remove(keys, key);
  17170. keys.push(key);
  17171. } else {
  17172. cache[key] = vnode;
  17173. keys.push(key);
  17174. // prune oldest entry
  17175. if (this.max && keys.length > parseInt(this.max)) {
  17176. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  17177. }
  17178. }
  17179. vnode.data.keepAlive = true;
  17180. }
  17181. return vnode || (slot && slot[0])
  17182. }
  17183. };
  17184. var builtInComponents = {
  17185. KeepAlive: KeepAlive
  17186. };
  17187. /* */
  17188. function initGlobalAPI (Vue) {
  17189. // config
  17190. var configDef = {};
  17191. configDef.get = function () { return config; };
  17192. if (true) {
  17193. configDef.set = function () {
  17194. warn(
  17195. 'Do not replace the Vue.config object, set individual fields instead.'
  17196. );
  17197. };
  17198. }
  17199. Object.defineProperty(Vue, 'config', configDef);
  17200. // exposed util methods.
  17201. // NOTE: these are not considered part of the public API - avoid relying on
  17202. // them unless you are aware of the risk.
  17203. Vue.util = {
  17204. warn: warn,
  17205. extend: extend,
  17206. mergeOptions: mergeOptions,
  17207. defineReactive: defineReactive$$1
  17208. };
  17209. Vue.set = set;
  17210. Vue.delete = del;
  17211. Vue.nextTick = nextTick;
  17212. // 2.6 explicit observable API
  17213. Vue.observable = function (obj) {
  17214. observe(obj);
  17215. return obj
  17216. };
  17217. Vue.options = Object.create(null);
  17218. ASSET_TYPES.forEach(function (type) {
  17219. Vue.options[type + 's'] = Object.create(null);
  17220. });
  17221. // this is used to identify the "base" constructor to extend all plain-object
  17222. // components with in Weex's multi-instance scenarios.
  17223. Vue.options._base = Vue;
  17224. extend(Vue.options.components, builtInComponents);
  17225. initUse(Vue);
  17226. initMixin$1(Vue);
  17227. initExtend(Vue);
  17228. initAssetRegisters(Vue);
  17229. }
  17230. initGlobalAPI(Vue);
  17231. Object.defineProperty(Vue.prototype, '$isServer', {
  17232. get: isServerRendering
  17233. });
  17234. Object.defineProperty(Vue.prototype, '$ssrContext', {
  17235. get: function get () {
  17236. /* istanbul ignore next */
  17237. return this.$vnode && this.$vnode.ssrContext
  17238. }
  17239. });
  17240. // expose FunctionalRenderContext for ssr runtime helper installation
  17241. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  17242. value: FunctionalRenderContext
  17243. });
  17244. Vue.version = '2.6.11';
  17245. /**
  17246. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  17247. */
  17248. var ARRAYTYPE = '[object Array]';
  17249. var OBJECTTYPE = '[object Object]';
  17250. var NULLTYPE = '[object Null]';
  17251. var UNDEFINEDTYPE = '[object Undefined]';
  17252. // const FUNCTIONTYPE = '[object Function]'
  17253. function diff(current, pre) {
  17254. var result = {};
  17255. syncKeys(current, pre);
  17256. _diff(current, pre, '', result);
  17257. return result
  17258. }
  17259. function syncKeys(current, pre) {
  17260. if (current === pre) { return }
  17261. var rootCurrentType = type(current);
  17262. var rootPreType = type(pre);
  17263. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  17264. if(Object.keys(current).length >= Object.keys(pre).length){
  17265. for (var key in pre) {
  17266. var currentValue = current[key];
  17267. if (currentValue === undefined) {
  17268. current[key] = null;
  17269. } else {
  17270. syncKeys(currentValue, pre[key]);
  17271. }
  17272. }
  17273. }
  17274. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  17275. if (current.length >= pre.length) {
  17276. pre.forEach(function (item, index) {
  17277. syncKeys(current[index], item);
  17278. });
  17279. }
  17280. }
  17281. }
  17282. function nullOrUndefined(currentType, preType) {
  17283. if(
  17284. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  17285. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  17286. ) {
  17287. return false
  17288. }
  17289. return true
  17290. }
  17291. function _diff(current, pre, path, result) {
  17292. if (current === pre) { return }
  17293. var rootCurrentType = type(current);
  17294. var rootPreType = type(pre);
  17295. if (rootCurrentType == OBJECTTYPE) {
  17296. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  17297. setResult(result, path, current);
  17298. } else {
  17299. var loop = function ( key ) {
  17300. var currentValue = current[key];
  17301. var preValue = pre[key];
  17302. var currentType = type(currentValue);
  17303. var preType = type(preValue);
  17304. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  17305. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  17306. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17307. }
  17308. } else if (currentType == ARRAYTYPE) {
  17309. if (preType != ARRAYTYPE) {
  17310. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17311. } else {
  17312. if (currentValue.length < preValue.length) {
  17313. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17314. } else {
  17315. currentValue.forEach(function (item, index) {
  17316. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  17317. });
  17318. }
  17319. }
  17320. } else if (currentType == OBJECTTYPE) {
  17321. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  17322. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17323. } else {
  17324. for (var subKey in currentValue) {
  17325. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  17326. }
  17327. }
  17328. }
  17329. };
  17330. for (var key in current) loop( key );
  17331. }
  17332. } else if (rootCurrentType == ARRAYTYPE) {
  17333. if (rootPreType != ARRAYTYPE) {
  17334. setResult(result, path, current);
  17335. } else {
  17336. if (current.length < pre.length) {
  17337. setResult(result, path, current);
  17338. } else {
  17339. current.forEach(function (item, index) {
  17340. _diff(item, pre[index], path + '[' + index + ']', result);
  17341. });
  17342. }
  17343. }
  17344. } else {
  17345. setResult(result, path, current);
  17346. }
  17347. }
  17348. function setResult(result, k, v) {
  17349. // if (type(v) != FUNCTIONTYPE) {
  17350. result[k] = v;
  17351. // }
  17352. }
  17353. function type(obj) {
  17354. return Object.prototype.toString.call(obj)
  17355. }
  17356. /* */
  17357. function flushCallbacks$1(vm) {
  17358. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  17359. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17360. var mpInstance = vm.$scope;
  17361. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17362. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  17363. }
  17364. var copies = vm.__next_tick_callbacks.slice(0);
  17365. vm.__next_tick_callbacks.length = 0;
  17366. for (var i = 0; i < copies.length; i++) {
  17367. copies[i]();
  17368. }
  17369. }
  17370. }
  17371. function hasRenderWatcher(vm) {
  17372. return queue.find(function (watcher) { return vm._watcher === watcher; })
  17373. }
  17374. function nextTick$1(vm, cb) {
  17375. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  17376. //2.nextTick 之前存在 render watcher
  17377. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  17378. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  17379. var mpInstance = vm.$scope;
  17380. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17381. ']:nextVueTick');
  17382. }
  17383. return nextTick(cb, vm)
  17384. }else{
  17385. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  17386. var mpInstance$1 = vm.$scope;
  17387. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  17388. ']:nextMPTick');
  17389. }
  17390. }
  17391. var _resolve;
  17392. if (!vm.__next_tick_callbacks) {
  17393. vm.__next_tick_callbacks = [];
  17394. }
  17395. vm.__next_tick_callbacks.push(function () {
  17396. if (cb) {
  17397. try {
  17398. cb.call(vm);
  17399. } catch (e) {
  17400. handleError(e, vm, 'nextTick');
  17401. }
  17402. } else if (_resolve) {
  17403. _resolve(vm);
  17404. }
  17405. });
  17406. // $flow-disable-line
  17407. if (!cb && typeof Promise !== 'undefined') {
  17408. return new Promise(function (resolve) {
  17409. _resolve = resolve;
  17410. })
  17411. }
  17412. }
  17413. /* */
  17414. function clearInstance(key, value) {
  17415. // 简易去除 Vue 和小程序组件实例
  17416. if (value) {
  17417. if (value._isVue || value.__v_isMPComponent) {
  17418. return {}
  17419. }
  17420. }
  17421. return value
  17422. }
  17423. function cloneWithData(vm) {
  17424. // 确保当前 vm 所有数据被同步
  17425. var ret = Object.create(null);
  17426. var dataKeys = [].concat(
  17427. Object.keys(vm._data || {}),
  17428. Object.keys(vm._computedWatchers || {}));
  17429. dataKeys.reduce(function(ret, key) {
  17430. ret[key] = vm[key];
  17431. return ret
  17432. }, ret);
  17433. // vue-composition-api
  17434. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  17435. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  17436. if (rawBindings) {
  17437. Object.keys(rawBindings).forEach(function (key) {
  17438. ret[key] = vm[key];
  17439. });
  17440. }
  17441. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  17442. Object.assign(ret, vm.$mp.data || {});
  17443. if (
  17444. Array.isArray(vm.$options.behaviors) &&
  17445. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  17446. ) { //form-field
  17447. ret['name'] = vm.name;
  17448. ret['value'] = vm.value;
  17449. }
  17450. return JSON.parse(JSON.stringify(ret, clearInstance))
  17451. }
  17452. var patch = function(oldVnode, vnode) {
  17453. var this$1 = this;
  17454. if (vnode === null) { //destroy
  17455. return
  17456. }
  17457. if (this.mpType === 'page' || this.mpType === 'component') {
  17458. var mpInstance = this.$scope;
  17459. var data = Object.create(null);
  17460. try {
  17461. data = cloneWithData(this);
  17462. } catch (err) {
  17463. console.error(err);
  17464. }
  17465. data.__webviewId__ = mpInstance.data.__webviewId__;
  17466. var mpData = Object.create(null);
  17467. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  17468. mpData[key] = mpInstance.data[key];
  17469. });
  17470. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  17471. if (Object.keys(diffData).length) {
  17472. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17473. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  17474. ']差量更新',
  17475. JSON.stringify(diffData));
  17476. }
  17477. this.__next_tick_pending = true;
  17478. mpInstance.setData(diffData, function () {
  17479. this$1.__next_tick_pending = false;
  17480. flushCallbacks$1(this$1);
  17481. });
  17482. } else {
  17483. flushCallbacks$1(this);
  17484. }
  17485. }
  17486. };
  17487. /* */
  17488. function createEmptyRender() {
  17489. }
  17490. function mountComponent$1(
  17491. vm,
  17492. el,
  17493. hydrating
  17494. ) {
  17495. if (!vm.mpType) {//main.js 中的 new Vue
  17496. return vm
  17497. }
  17498. if (vm.mpType === 'app') {
  17499. vm.$options.render = createEmptyRender;
  17500. }
  17501. if (!vm.$options.render) {
  17502. vm.$options.render = createEmptyRender;
  17503. if (true) {
  17504. /* istanbul ignore if */
  17505. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  17506. vm.$options.el || el) {
  17507. warn(
  17508. 'You are using the runtime-only build of Vue where the template ' +
  17509. 'compiler is not available. Either pre-compile the templates into ' +
  17510. 'render functions, or use the compiler-included build.',
  17511. vm
  17512. );
  17513. } else {
  17514. warn(
  17515. 'Failed to mount component: template or render function not defined.',
  17516. vm
  17517. );
  17518. }
  17519. }
  17520. }
  17521. !vm._$fallback && callHook(vm, 'beforeMount');
  17522. var updateComponent = function () {
  17523. vm._update(vm._render(), hydrating);
  17524. };
  17525. // we set this to vm._watcher inside the watcher's constructor
  17526. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  17527. // component's mounted hook), which relies on vm._watcher being already defined
  17528. new Watcher(vm, updateComponent, noop, {
  17529. before: function before() {
  17530. if (vm._isMounted && !vm._isDestroyed) {
  17531. callHook(vm, 'beforeUpdate');
  17532. }
  17533. }
  17534. }, true /* isRenderWatcher */);
  17535. hydrating = false;
  17536. return vm
  17537. }
  17538. /* */
  17539. function renderClass (
  17540. staticClass,
  17541. dynamicClass
  17542. ) {
  17543. if (isDef(staticClass) || isDef(dynamicClass)) {
  17544. return concat(staticClass, stringifyClass(dynamicClass))
  17545. }
  17546. /* istanbul ignore next */
  17547. return ''
  17548. }
  17549. function concat (a, b) {
  17550. return a ? b ? (a + ' ' + b) : a : (b || '')
  17551. }
  17552. function stringifyClass (value) {
  17553. if (Array.isArray(value)) {
  17554. return stringifyArray(value)
  17555. }
  17556. if (isObject(value)) {
  17557. return stringifyObject(value)
  17558. }
  17559. if (typeof value === 'string') {
  17560. return value
  17561. }
  17562. /* istanbul ignore next */
  17563. return ''
  17564. }
  17565. function stringifyArray (value) {
  17566. var res = '';
  17567. var stringified;
  17568. for (var i = 0, l = value.length; i < l; i++) {
  17569. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  17570. if (res) { res += ' '; }
  17571. res += stringified;
  17572. }
  17573. }
  17574. return res
  17575. }
  17576. function stringifyObject (value) {
  17577. var res = '';
  17578. for (var key in value) {
  17579. if (value[key]) {
  17580. if (res) { res += ' '; }
  17581. res += key;
  17582. }
  17583. }
  17584. return res
  17585. }
  17586. /* */
  17587. var parseStyleText = cached(function (cssText) {
  17588. var res = {};
  17589. var listDelimiter = /;(?![^(]*\))/g;
  17590. var propertyDelimiter = /:(.+)/;
  17591. cssText.split(listDelimiter).forEach(function (item) {
  17592. if (item) {
  17593. var tmp = item.split(propertyDelimiter);
  17594. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  17595. }
  17596. });
  17597. return res
  17598. });
  17599. // normalize possible array / string values into Object
  17600. function normalizeStyleBinding (bindingStyle) {
  17601. if (Array.isArray(bindingStyle)) {
  17602. return toObject(bindingStyle)
  17603. }
  17604. if (typeof bindingStyle === 'string') {
  17605. return parseStyleText(bindingStyle)
  17606. }
  17607. return bindingStyle
  17608. }
  17609. /* */
  17610. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  17611. function getTarget(obj, path) {
  17612. var parts = path.split('.');
  17613. var key = parts[0];
  17614. if (key.indexOf('__$n') === 0) { //number index
  17615. key = parseInt(key.replace('__$n', ''));
  17616. }
  17617. if (parts.length === 1) {
  17618. return obj[key]
  17619. }
  17620. return getTarget(obj[key], parts.slice(1).join('.'))
  17621. }
  17622. function internalMixin(Vue) {
  17623. Vue.config.errorHandler = function(err, vm, info) {
  17624. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  17625. console.error(err);
  17626. /* eslint-disable no-undef */
  17627. var app = typeof getApp === 'function' && getApp();
  17628. if (app && app.onError) {
  17629. app.onError(err);
  17630. }
  17631. };
  17632. var oldEmit = Vue.prototype.$emit;
  17633. Vue.prototype.$emit = function(event) {
  17634. if (this.$scope && event) {
  17635. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  17636. if (triggerEvent) {
  17637. try {
  17638. triggerEvent.call(this.$scope, event, {
  17639. __args__: toArray(arguments, 1)
  17640. });
  17641. } catch (error) {
  17642. }
  17643. }
  17644. }
  17645. return oldEmit.apply(this, arguments)
  17646. };
  17647. Vue.prototype.$nextTick = function(fn) {
  17648. return nextTick$1(this, fn)
  17649. };
  17650. MP_METHODS.forEach(function (method) {
  17651. Vue.prototype[method] = function(args) {
  17652. if (this.$scope && this.$scope[method]) {
  17653. return this.$scope[method](args)
  17654. }
  17655. // mp-alipay
  17656. if (typeof my === 'undefined') {
  17657. return
  17658. }
  17659. if (method === 'createSelectorQuery') {
  17660. /* eslint-disable no-undef */
  17661. return my.createSelectorQuery(args)
  17662. } else if (method === 'createIntersectionObserver') {
  17663. /* eslint-disable no-undef */
  17664. return my.createIntersectionObserver(args)
  17665. }
  17666. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  17667. };
  17668. });
  17669. Vue.prototype.__init_provide = initProvide;
  17670. Vue.prototype.__init_injections = initInjections;
  17671. Vue.prototype.__call_hook = function(hook, args) {
  17672. var vm = this;
  17673. // #7573 disable dep collection when invoking lifecycle hooks
  17674. pushTarget();
  17675. var handlers = vm.$options[hook];
  17676. var info = hook + " hook";
  17677. var ret;
  17678. if (handlers) {
  17679. for (var i = 0, j = handlers.length; i < j; i++) {
  17680. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  17681. }
  17682. }
  17683. if (vm._hasHookEvent) {
  17684. vm.$emit('hook:' + hook, args);
  17685. }
  17686. popTarget();
  17687. return ret
  17688. };
  17689. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  17690. if (Array.isArray(modifiers)) {
  17691. if (modifiers.indexOf('trim') !== -1) {
  17692. value = value.trim();
  17693. }
  17694. if (modifiers.indexOf('number') !== -1) {
  17695. value = this._n(value);
  17696. }
  17697. }
  17698. if (!target) {
  17699. target = this;
  17700. }
  17701. // 解决动态属性添加
  17702. Vue.set(target, key, value);
  17703. };
  17704. Vue.prototype.__set_sync = function(target, key, value) {
  17705. if (!target) {
  17706. target = this;
  17707. }
  17708. // 解决动态属性添加
  17709. Vue.set(target, key, value);
  17710. };
  17711. Vue.prototype.__get_orig = function(item) {
  17712. if (isPlainObject(item)) {
  17713. return item['$orig'] || item
  17714. }
  17715. return item
  17716. };
  17717. Vue.prototype.__get_value = function(dataPath, target) {
  17718. return getTarget(target || this, dataPath)
  17719. };
  17720. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  17721. return renderClass(staticClass, dynamicClass)
  17722. };
  17723. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  17724. if (!dynamicStyle && !staticStyle) {
  17725. return ''
  17726. }
  17727. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  17728. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  17729. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  17730. };
  17731. Vue.prototype.__map = function(val, iteratee) {
  17732. //TODO 暂不考虑 string
  17733. var ret, i, l, keys, key;
  17734. if (Array.isArray(val)) {
  17735. ret = new Array(val.length);
  17736. for (i = 0, l = val.length; i < l; i++) {
  17737. ret[i] = iteratee(val[i], i);
  17738. }
  17739. return ret
  17740. } else if (isObject(val)) {
  17741. keys = Object.keys(val);
  17742. ret = Object.create(null);
  17743. for (i = 0, l = keys.length; i < l; i++) {
  17744. key = keys[i];
  17745. ret[key] = iteratee(val[key], key, i);
  17746. }
  17747. return ret
  17748. } else if (typeof val === 'number') {
  17749. ret = new Array(val);
  17750. for (i = 0, l = val; i < l; i++) {
  17751. // 第一个参数暂时仍和小程序一致
  17752. ret[i] = iteratee(i, i);
  17753. }
  17754. return ret
  17755. }
  17756. return []
  17757. };
  17758. }
  17759. /* */
  17760. var LIFECYCLE_HOOKS$1 = [
  17761. //App
  17762. 'onLaunch',
  17763. 'onShow',
  17764. 'onHide',
  17765. 'onUniNViewMessage',
  17766. 'onPageNotFound',
  17767. 'onThemeChange',
  17768. 'onError',
  17769. 'onUnhandledRejection',
  17770. //Page
  17771. 'onInit',
  17772. 'onLoad',
  17773. // 'onShow',
  17774. 'onReady',
  17775. // 'onHide',
  17776. 'onUnload',
  17777. 'onPullDownRefresh',
  17778. 'onReachBottom',
  17779. 'onTabItemTap',
  17780. 'onAddToFavorites',
  17781. 'onShareTimeline',
  17782. 'onShareAppMessage',
  17783. 'onResize',
  17784. 'onPageScroll',
  17785. 'onNavigationBarButtonTap',
  17786. 'onBackPress',
  17787. 'onNavigationBarSearchInputChanged',
  17788. 'onNavigationBarSearchInputConfirmed',
  17789. 'onNavigationBarSearchInputClicked',
  17790. //Component
  17791. // 'onReady', // 兼容旧版本,应该移除该事件
  17792. 'onPageShow',
  17793. 'onPageHide',
  17794. 'onPageResize',
  17795. 'onUploadDouyinVideo'
  17796. ];
  17797. function lifecycleMixin$1(Vue) {
  17798. //fixed vue-class-component
  17799. var oldExtend = Vue.extend;
  17800. Vue.extend = function(extendOptions) {
  17801. extendOptions = extendOptions || {};
  17802. var methods = extendOptions.methods;
  17803. if (methods) {
  17804. Object.keys(methods).forEach(function (methodName) {
  17805. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  17806. extendOptions[methodName] = methods[methodName];
  17807. delete methods[methodName];
  17808. }
  17809. });
  17810. }
  17811. return oldExtend.call(this, extendOptions)
  17812. };
  17813. var strategies = Vue.config.optionMergeStrategies;
  17814. var mergeHook = strategies.created;
  17815. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  17816. strategies[hook] = mergeHook;
  17817. });
  17818. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  17819. }
  17820. /* */
  17821. // install platform patch function
  17822. Vue.prototype.__patch__ = patch;
  17823. // public mount method
  17824. Vue.prototype.$mount = function(
  17825. el ,
  17826. hydrating
  17827. ) {
  17828. return mountComponent$1(this, el, hydrating)
  17829. };
  17830. lifecycleMixin$1(Vue);
  17831. internalMixin(Vue);
  17832. /* */
  17833. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  17834. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  17835. /***/ }),
  17836. /***/ 26:
  17837. /*!*****************************************!*\
  17838. !*** D:/project/项目模板/uniapp/pages.json ***!
  17839. \*****************************************/
  17840. /*! no static exports found */
  17841. /***/ (function(module, exports) {
  17842. /***/ }),
  17843. /***/ 3:
  17844. /*!***********************************!*\
  17845. !*** (webpack)/buildin/global.js ***!
  17846. \***********************************/
  17847. /*! no static exports found */
  17848. /***/ (function(module, exports) {
  17849. var g;
  17850. // This works in non-strict mode
  17851. g = (function() {
  17852. return this;
  17853. })();
  17854. try {
  17855. // This works if eval is allowed (see CSP)
  17856. g = g || new Function("return this")();
  17857. } catch (e) {
  17858. // This works if the window reference is available
  17859. if (typeof window === "object") g = window;
  17860. }
  17861. // g can still be undefined, but nothing to do about it...
  17862. // We return undefined, instead of nothing here, so it's
  17863. // easier to handle this case. if(!global) { ...}
  17864. module.exports = g;
  17865. /***/ }),
  17866. /***/ 32:
  17867. /*!**********************************************************************************************************!*\
  17868. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  17869. \**********************************************************************************************************/
  17870. /*! exports provided: default */
  17871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  17875. /* globals __VUE_SSR_CONTEXT__ */
  17876. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  17877. // This module is a runtime utility for cleaner component module output and will
  17878. // be included in the final webpack user bundle.
  17879. function normalizeComponent (
  17880. scriptExports,
  17881. render,
  17882. staticRenderFns,
  17883. functionalTemplate,
  17884. injectStyles,
  17885. scopeId,
  17886. moduleIdentifier, /* server only */
  17887. shadowMode, /* vue-cli only */
  17888. components, // fixed by xxxxxx auto components
  17889. renderjs // fixed by xxxxxx renderjs
  17890. ) {
  17891. // Vue.extend constructor export interop
  17892. var options = typeof scriptExports === 'function'
  17893. ? scriptExports.options
  17894. : scriptExports
  17895. // fixed by xxxxxx auto components
  17896. if (components) {
  17897. if (!options.components) {
  17898. options.components = {}
  17899. }
  17900. var hasOwn = Object.prototype.hasOwnProperty
  17901. for (var name in components) {
  17902. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  17903. options.components[name] = components[name]
  17904. }
  17905. }
  17906. }
  17907. // fixed by xxxxxx renderjs
  17908. if (renderjs) {
  17909. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  17910. this[renderjs.__module] = this
  17911. });
  17912. (options.mixins || (options.mixins = [])).push(renderjs)
  17913. }
  17914. // render functions
  17915. if (render) {
  17916. options.render = render
  17917. options.staticRenderFns = staticRenderFns
  17918. options._compiled = true
  17919. }
  17920. // functional template
  17921. if (functionalTemplate) {
  17922. options.functional = true
  17923. }
  17924. // scopedId
  17925. if (scopeId) {
  17926. options._scopeId = 'data-v-' + scopeId
  17927. }
  17928. var hook
  17929. if (moduleIdentifier) { // server build
  17930. hook = function (context) {
  17931. // 2.3 injection
  17932. context =
  17933. context || // cached call
  17934. (this.$vnode && this.$vnode.ssrContext) || // stateful
  17935. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  17936. // 2.2 with runInNewContext: true
  17937. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  17938. context = __VUE_SSR_CONTEXT__
  17939. }
  17940. // inject component styles
  17941. if (injectStyles) {
  17942. injectStyles.call(this, context)
  17943. }
  17944. // register component module identifier for async chunk inferrence
  17945. if (context && context._registeredComponents) {
  17946. context._registeredComponents.add(moduleIdentifier)
  17947. }
  17948. }
  17949. // used by ssr in case component is cached and beforeCreate
  17950. // never gets called
  17951. options._ssrRegister = hook
  17952. } else if (injectStyles) {
  17953. hook = shadowMode
  17954. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  17955. : injectStyles
  17956. }
  17957. if (hook) {
  17958. if (options.functional) {
  17959. // for template-only hot-reload because in that case the render fn doesn't
  17960. // go through the normalizer
  17961. options._injectStyles = hook
  17962. // register for functioal component in vue file
  17963. var originalRender = options.render
  17964. options.render = function renderWithStyleInjection (h, context) {
  17965. hook.call(context)
  17966. return originalRender(h, context)
  17967. }
  17968. } else {
  17969. // inject component registration as beforeCreate hook
  17970. var existing = options.beforeCreate
  17971. options.beforeCreate = existing
  17972. ? [].concat(existing, hook)
  17973. : [hook]
  17974. }
  17975. }
  17976. return {
  17977. exports: scriptExports,
  17978. options: options
  17979. }
  17980. }
  17981. /***/ }),
  17982. /***/ 33:
  17983. /*!***********************************************!*\
  17984. !*** D:/project/项目模板/uniapp/common/config.js ***!
  17985. \***********************************************/
  17986. /*! no static exports found */
  17987. /***/ (function(module, exports, __webpack_require__) {
  17988. "use strict";
  17989. /* WEBPACK VAR INJECTION */(function(uni) {
  17990. Object.defineProperty(exports, "__esModule", {
  17991. value: true
  17992. });
  17993. exports.default = void 0;
  17994. var _default = {
  17995. // 接口地址
  17996. serverUrl: "http://192.168.1.144:10102",
  17997. //http://47.93.34.200 http://www.freeskyghw.cn http://192.168.1.144:10102
  17998. fileserverUrl: 'http://broadcast.waityou24.cn',
  17999. wechatUrl: "http://broadcast.waityou24.cn",
  18000. // 设备信息
  18001. system: uni.getSystemInfoSync(),
  18002. // 节目类型
  18003. pro_type: [
  18004. //
  18005. {
  18006. dict_label: '电视节目',
  18007. dict_value: '0'
  18008. }, {
  18009. dict_label: '电影节目',
  18010. dict_value: '1'
  18011. }]
  18012. };
  18013. exports.default = _default;
  18014. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18015. /***/ }),
  18016. /***/ 34:
  18017. /*!********************************************!*\
  18018. !*** D:/project/项目模板/uniapp/common/api.js ***!
  18019. \********************************************/
  18020. /*! no static exports found */
  18021. /***/ (function(module, exports, __webpack_require__) {
  18022. "use strict";
  18023. /* WEBPACK VAR INJECTION */(function(uni) {
  18024. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18025. Object.defineProperty(exports, "__esModule", {
  18026. value: true
  18027. });
  18028. exports.requestFile = exports.requestBase = void 0;
  18029. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  18030. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  18031. var _config = _interopRequireDefault(__webpack_require__(/*! ../common/config */ 33));
  18032. var getDomain = function getDomain(uri, type) {
  18033. var serverUrl = _config.default.serverUrl,
  18034. fileserverUrl = _config.default.fileserverUrl,
  18035. wechatUrl = _config.default.wechatUrl;
  18036. // 自定义
  18037. if (uri.includes("http")) return uri;
  18038. // 微信
  18039. if (uri.startsWith("/wechat/api")) return wechatUrl + uri;
  18040. // 地址前缀
  18041. else if (type) return serverUrl + "/projectadmin/".concat(type, "/api/") + uri;
  18042. // 常规
  18043. return serverUrl + "/projectadmin/api/" + uri;
  18044. };
  18045. // 常规请求
  18046. var requestBase = /*#__PURE__*/function () {
  18047. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {
  18048. var method,
  18049. data,
  18050. type,
  18051. baseUrl,
  18052. header,
  18053. token,
  18054. _args = arguments;
  18055. return _regenerator.default.wrap(function _callee$(_context) {
  18056. while (1) {
  18057. switch (_context.prev = _context.next) {
  18058. case 0:
  18059. method = _args.length > 1 && _args[1] !== undefined ? _args[1] : "GET";
  18060. data = _args.length > 2 ? _args[2] : undefined;
  18061. type = _args.length > 3 ? _args[3] : undefined;
  18062. // 请求地址
  18063. baseUrl = getDomain(uri, type); // 请求头
  18064. header = {}; // 用户信息
  18065. token = "";
  18066. if (token) header.token = token;
  18067. return _context.abrupt("return", new Promise(function (resolve, reject) {
  18068. uni.request({
  18069. url: baseUrl,
  18070. method: method,
  18071. data: data,
  18072. header: header,
  18073. success: function success(res) {
  18074. return toResolve(resolve, res);
  18075. },
  18076. fail: function fail(err) {
  18077. console.log(err);
  18078. }
  18079. });
  18080. }));
  18081. case 8:
  18082. case "end":
  18083. return _context.stop();
  18084. }
  18085. }
  18086. }, _callee);
  18087. }));
  18088. return function requestBase(_x) {
  18089. return _ref.apply(this, arguments);
  18090. };
  18091. }();
  18092. // 图片请求
  18093. exports.requestBase = requestBase;
  18094. var requestFile = function requestFile(uri, method, data, type) {
  18095. // 请求地址
  18096. // let baseUrl = getDomain(uri, type);
  18097. return new Promise(function (resolve, reject) {
  18098. uni.uploadFile({
  18099. url: "".concat(_config.default.fileserverUrl, "/").concat(uri),
  18100. filePath: data,
  18101. name: 'file',
  18102. formData: {},
  18103. success: function success(res) {
  18104. return toResolve(resolve, res);
  18105. },
  18106. error: function error(e) {
  18107. return toReject(reject, e);
  18108. }
  18109. });
  18110. });
  18111. };
  18112. exports.requestFile = requestFile;
  18113. var toResolve = function toResolve(resolve, result) {
  18114. if (result.statusCode === 200) resolve(result.data);
  18115. };
  18116. var toReject = function toReject(reject, result) {
  18117. reject(result);
  18118. };
  18119. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18120. /***/ }),
  18121. /***/ 35:
  18122. /*!************************************************************************************************!*\
  18123. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  18124. \************************************************************************************************/
  18125. /*! no static exports found */
  18126. /***/ (function(module, exports, __webpack_require__) {
  18127. // TODO(Babel 8): Remove this file.
  18128. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 36)();
  18129. module.exports = runtime;
  18130. /***/ }),
  18131. /***/ 36:
  18132. /*!*******************************************************************!*\
  18133. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  18134. \*******************************************************************/
  18135. /*! no static exports found */
  18136. /***/ (function(module, exports, __webpack_require__) {
  18137. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  18138. function _regeneratorRuntime() {
  18139. "use strict";
  18140. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  18141. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  18142. return exports;
  18143. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18144. var exports = {},
  18145. Op = Object.prototype,
  18146. hasOwn = Op.hasOwnProperty,
  18147. defineProperty = Object.defineProperty || function (obj, key, desc) {
  18148. obj[key] = desc.value;
  18149. },
  18150. $Symbol = "function" == typeof Symbol ? Symbol : {},
  18151. iteratorSymbol = $Symbol.iterator || "@@iterator",
  18152. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  18153. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  18154. function define(obj, key, value) {
  18155. return Object.defineProperty(obj, key, {
  18156. value: value,
  18157. enumerable: !0,
  18158. configurable: !0,
  18159. writable: !0
  18160. }), obj[key];
  18161. }
  18162. try {
  18163. define({}, "");
  18164. } catch (err) {
  18165. define = function define(obj, key, value) {
  18166. return obj[key] = value;
  18167. };
  18168. }
  18169. function wrap(innerFn, outerFn, self, tryLocsList) {
  18170. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  18171. generator = Object.create(protoGenerator.prototype),
  18172. context = new Context(tryLocsList || []);
  18173. return defineProperty(generator, "_invoke", {
  18174. value: makeInvokeMethod(innerFn, self, context)
  18175. }), generator;
  18176. }
  18177. function tryCatch(fn, obj, arg) {
  18178. try {
  18179. return {
  18180. type: "normal",
  18181. arg: fn.call(obj, arg)
  18182. };
  18183. } catch (err) {
  18184. return {
  18185. type: "throw",
  18186. arg: err
  18187. };
  18188. }
  18189. }
  18190. exports.wrap = wrap;
  18191. var ContinueSentinel = {};
  18192. function Generator() {}
  18193. function GeneratorFunction() {}
  18194. function GeneratorFunctionPrototype() {}
  18195. var IteratorPrototype = {};
  18196. define(IteratorPrototype, iteratorSymbol, function () {
  18197. return this;
  18198. });
  18199. var getProto = Object.getPrototypeOf,
  18200. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  18201. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  18202. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  18203. function defineIteratorMethods(prototype) {
  18204. ["next", "throw", "return"].forEach(function (method) {
  18205. define(prototype, method, function (arg) {
  18206. return this._invoke(method, arg);
  18207. });
  18208. });
  18209. }
  18210. function AsyncIterator(generator, PromiseImpl) {
  18211. function invoke(method, arg, resolve, reject) {
  18212. var record = tryCatch(generator[method], generator, arg);
  18213. if ("throw" !== record.type) {
  18214. var result = record.arg,
  18215. value = result.value;
  18216. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  18217. invoke("next", value, resolve, reject);
  18218. }, function (err) {
  18219. invoke("throw", err, resolve, reject);
  18220. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  18221. result.value = unwrapped, resolve(result);
  18222. }, function (error) {
  18223. return invoke("throw", error, resolve, reject);
  18224. });
  18225. }
  18226. reject(record.arg);
  18227. }
  18228. var previousPromise;
  18229. defineProperty(this, "_invoke", {
  18230. value: function value(method, arg) {
  18231. function callInvokeWithMethodAndArg() {
  18232. return new PromiseImpl(function (resolve, reject) {
  18233. invoke(method, arg, resolve, reject);
  18234. });
  18235. }
  18236. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  18237. }
  18238. });
  18239. }
  18240. function makeInvokeMethod(innerFn, self, context) {
  18241. var state = "suspendedStart";
  18242. return function (method, arg) {
  18243. if ("executing" === state) throw new Error("Generator is already running");
  18244. if ("completed" === state) {
  18245. if ("throw" === method) throw arg;
  18246. return doneResult();
  18247. }
  18248. for (context.method = method, context.arg = arg;;) {
  18249. var delegate = context.delegate;
  18250. if (delegate) {
  18251. var delegateResult = maybeInvokeDelegate(delegate, context);
  18252. if (delegateResult) {
  18253. if (delegateResult === ContinueSentinel) continue;
  18254. return delegateResult;
  18255. }
  18256. }
  18257. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  18258. if ("suspendedStart" === state) throw state = "completed", context.arg;
  18259. context.dispatchException(context.arg);
  18260. } else "return" === context.method && context.abrupt("return", context.arg);
  18261. state = "executing";
  18262. var record = tryCatch(innerFn, self, context);
  18263. if ("normal" === record.type) {
  18264. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  18265. return {
  18266. value: record.arg,
  18267. done: context.done
  18268. };
  18269. }
  18270. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  18271. }
  18272. };
  18273. }
  18274. function maybeInvokeDelegate(delegate, context) {
  18275. var methodName = context.method,
  18276. method = delegate.iterator[methodName];
  18277. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  18278. var record = tryCatch(method, delegate.iterator, context.arg);
  18279. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  18280. var info = record.arg;
  18281. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  18282. }
  18283. function pushTryEntry(locs) {
  18284. var entry = {
  18285. tryLoc: locs[0]
  18286. };
  18287. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  18288. }
  18289. function resetTryEntry(entry) {
  18290. var record = entry.completion || {};
  18291. record.type = "normal", delete record.arg, entry.completion = record;
  18292. }
  18293. function Context(tryLocsList) {
  18294. this.tryEntries = [{
  18295. tryLoc: "root"
  18296. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  18297. }
  18298. function values(iterable) {
  18299. if (iterable) {
  18300. var iteratorMethod = iterable[iteratorSymbol];
  18301. if (iteratorMethod) return iteratorMethod.call(iterable);
  18302. if ("function" == typeof iterable.next) return iterable;
  18303. if (!isNaN(iterable.length)) {
  18304. var i = -1,
  18305. next = function next() {
  18306. for (; ++i < iterable.length;) {
  18307. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  18308. }
  18309. return next.value = undefined, next.done = !0, next;
  18310. };
  18311. return next.next = next;
  18312. }
  18313. }
  18314. return {
  18315. next: doneResult
  18316. };
  18317. }
  18318. function doneResult() {
  18319. return {
  18320. value: undefined,
  18321. done: !0
  18322. };
  18323. }
  18324. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  18325. value: GeneratorFunctionPrototype,
  18326. configurable: !0
  18327. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  18328. value: GeneratorFunction,
  18329. configurable: !0
  18330. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  18331. var ctor = "function" == typeof genFun && genFun.constructor;
  18332. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  18333. }, exports.mark = function (genFun) {
  18334. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  18335. }, exports.awrap = function (arg) {
  18336. return {
  18337. __await: arg
  18338. };
  18339. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  18340. return this;
  18341. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  18342. void 0 === PromiseImpl && (PromiseImpl = Promise);
  18343. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  18344. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  18345. return result.done ? result.value : iter.next();
  18346. });
  18347. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  18348. return this;
  18349. }), define(Gp, "toString", function () {
  18350. return "[object Generator]";
  18351. }), exports.keys = function (val) {
  18352. var object = Object(val),
  18353. keys = [];
  18354. for (var key in object) {
  18355. keys.push(key);
  18356. }
  18357. return keys.reverse(), function next() {
  18358. for (; keys.length;) {
  18359. var key = keys.pop();
  18360. if (key in object) return next.value = key, next.done = !1, next;
  18361. }
  18362. return next.done = !0, next;
  18363. };
  18364. }, exports.values = values, Context.prototype = {
  18365. constructor: Context,
  18366. reset: function reset(skipTempReset) {
  18367. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  18368. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  18369. }
  18370. },
  18371. stop: function stop() {
  18372. this.done = !0;
  18373. var rootRecord = this.tryEntries[0].completion;
  18374. if ("throw" === rootRecord.type) throw rootRecord.arg;
  18375. return this.rval;
  18376. },
  18377. dispatchException: function dispatchException(exception) {
  18378. if (this.done) throw exception;
  18379. var context = this;
  18380. function handle(loc, caught) {
  18381. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  18382. }
  18383. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18384. var entry = this.tryEntries[i],
  18385. record = entry.completion;
  18386. if ("root" === entry.tryLoc) return handle("end");
  18387. if (entry.tryLoc <= this.prev) {
  18388. var hasCatch = hasOwn.call(entry, "catchLoc"),
  18389. hasFinally = hasOwn.call(entry, "finallyLoc");
  18390. if (hasCatch && hasFinally) {
  18391. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  18392. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  18393. } else if (hasCatch) {
  18394. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  18395. } else {
  18396. if (!hasFinally) throw new Error("try statement without catch or finally");
  18397. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  18398. }
  18399. }
  18400. }
  18401. },
  18402. abrupt: function abrupt(type, arg) {
  18403. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18404. var entry = this.tryEntries[i];
  18405. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  18406. var finallyEntry = entry;
  18407. break;
  18408. }
  18409. }
  18410. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  18411. var record = finallyEntry ? finallyEntry.completion : {};
  18412. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  18413. },
  18414. complete: function complete(record, afterLoc) {
  18415. if ("throw" === record.type) throw record.arg;
  18416. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  18417. },
  18418. finish: function finish(finallyLoc) {
  18419. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18420. var entry = this.tryEntries[i];
  18421. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  18422. }
  18423. },
  18424. "catch": function _catch(tryLoc) {
  18425. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18426. var entry = this.tryEntries[i];
  18427. if (entry.tryLoc === tryLoc) {
  18428. var record = entry.completion;
  18429. if ("throw" === record.type) {
  18430. var thrown = record.arg;
  18431. resetTryEntry(entry);
  18432. }
  18433. return thrown;
  18434. }
  18435. }
  18436. throw new Error("illegal catch attempt");
  18437. },
  18438. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  18439. return this.delegate = {
  18440. iterator: values(iterable),
  18441. resultName: resultName,
  18442. nextLoc: nextLoc
  18443. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  18444. }
  18445. }, exports;
  18446. }
  18447. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18448. /***/ }),
  18449. /***/ 37:
  18450. /*!*****************************************************************!*\
  18451. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  18452. \*****************************************************************/
  18453. /*! no static exports found */
  18454. /***/ (function(module, exports) {
  18455. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  18456. try {
  18457. var info = gen[key](arg);
  18458. var value = info.value;
  18459. } catch (error) {
  18460. reject(error);
  18461. return;
  18462. }
  18463. if (info.done) {
  18464. resolve(value);
  18465. } else {
  18466. Promise.resolve(value).then(_next, _throw);
  18467. }
  18468. }
  18469. function _asyncToGenerator(fn) {
  18470. return function () {
  18471. var self = this,
  18472. args = arguments;
  18473. return new Promise(function (resolve, reject) {
  18474. var gen = fn.apply(self, args);
  18475. function _next(value) {
  18476. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  18477. }
  18478. function _throw(err) {
  18479. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  18480. }
  18481. _next(undefined);
  18482. });
  18483. };
  18484. }
  18485. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18486. /***/ }),
  18487. /***/ 38:
  18488. /*!**************************************************!*\
  18489. !*** D:/project/项目模板/uniapp/common/weapp-jwt.js ***!
  18490. \**************************************************/
  18491. /*! no static exports found */
  18492. /***/ (function(module, exports, __webpack_require__) {
  18493. "use strict";
  18494. Object.defineProperty(exports, "__esModule", {
  18495. value: true
  18496. });
  18497. var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  18498. var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
  18499. exports.weBtoa = function (string) {
  18500. string = String(string);
  18501. var bitmap,
  18502. a,
  18503. b,
  18504. c,
  18505. result = "",
  18506. i = 0,
  18507. rest = string.length % 3;
  18508. for (; i < string.length;) {
  18509. if ((a = string.charCodeAt(i++)) > 255 || (b = string.charCodeAt(i++)) > 255 || (c = string.charCodeAt(i++)) > 255) throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
  18510. bitmap = a << 16 | b << 8 | c;
  18511. result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
  18512. }
  18513. return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
  18514. };
  18515. exports.weAtob = function (string) {
  18516. string = String(string).replace(/[\t\n\f\r ]+/g, "");
  18517. if (!b64re.test(string)) throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  18518. string += "==".slice(2 - (string.length & 3));
  18519. var bitmap,
  18520. result = "",
  18521. r1,
  18522. r2,
  18523. i = 0;
  18524. for (; i < string.length;) {
  18525. bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 | (r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
  18526. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  18527. }
  18528. return result;
  18529. };
  18530. function b64DecodeUnicode(str) {
  18531. return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) {
  18532. var code = p.charCodeAt(0).toString(16).toUpperCase();
  18533. if (code.length < 2) {
  18534. code = "0" + code;
  18535. }
  18536. return "%" + code;
  18537. }));
  18538. }
  18539. function base64_url_decode(str) {
  18540. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  18541. switch (output.length % 4) {
  18542. case 0:
  18543. break;
  18544. case 2:
  18545. output += "==";
  18546. break;
  18547. case 3:
  18548. output += "=";
  18549. break;
  18550. default:
  18551. throw "Illegal base64url string!";
  18552. }
  18553. try {
  18554. return b64DecodeUnicode(output);
  18555. } catch (err) {
  18556. return exports.weAtob(output);
  18557. }
  18558. }
  18559. function weappJwtDecode(token, options) {
  18560. if (typeof token !== "string") {
  18561. throw "Invalid token specified";
  18562. }
  18563. options = options || {};
  18564. var pos = options.header === true ? 0 : 1;
  18565. try {
  18566. return JSON.parse(base64_url_decode(token.split(".")[pos]));
  18567. } catch (e) {
  18568. throw "Invalid token specified: " + e.message;
  18569. }
  18570. }
  18571. exports.default = weappJwtDecode;
  18572. /***/ }),
  18573. /***/ 4:
  18574. /*!**********************************************************************!*\
  18575. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  18576. \**********************************************************************/
  18577. /*! no static exports found */
  18578. /***/ (function(module, exports) {
  18579. function _interopRequireDefault(obj) {
  18580. return obj && obj.__esModule ? obj : {
  18581. "default": obj
  18582. };
  18583. }
  18584. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18585. /***/ }),
  18586. /***/ 5:
  18587. /*!**************************************************************!*\
  18588. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  18589. \**************************************************************/
  18590. /*! no static exports found */
  18591. /***/ (function(module, exports, __webpack_require__) {
  18592. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  18593. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  18594. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  18595. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  18596. function _slicedToArray(arr, i) {
  18597. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  18598. }
  18599. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18600. /***/ }),
  18601. /***/ 6:
  18602. /*!***************************************************************!*\
  18603. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  18604. \***************************************************************/
  18605. /*! no static exports found */
  18606. /***/ (function(module, exports) {
  18607. function _arrayWithHoles(arr) {
  18608. if (Array.isArray(arr)) return arr;
  18609. }
  18610. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18611. /***/ }),
  18612. /***/ 7:
  18613. /*!*********************************************************************!*\
  18614. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  18615. \*********************************************************************/
  18616. /*! no static exports found */
  18617. /***/ (function(module, exports) {
  18618. function _iterableToArrayLimit(arr, i) {
  18619. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  18620. if (null != _i) {
  18621. var _s,
  18622. _e,
  18623. _x,
  18624. _r,
  18625. _arr = [],
  18626. _n = !0,
  18627. _d = !1;
  18628. try {
  18629. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  18630. if (Object(_i) !== _i) return;
  18631. _n = !1;
  18632. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  18633. ;
  18634. }
  18635. } catch (err) {
  18636. _d = !0, _e = err;
  18637. } finally {
  18638. try {
  18639. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  18640. } finally {
  18641. if (_d) throw _e;
  18642. }
  18643. }
  18644. return _arr;
  18645. }
  18646. }
  18647. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18648. /***/ }),
  18649. /***/ 8:
  18650. /*!***************************************************************************!*\
  18651. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  18652. \***************************************************************************/
  18653. /*! no static exports found */
  18654. /***/ (function(module, exports, __webpack_require__) {
  18655. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  18656. function _unsupportedIterableToArray(o, minLen) {
  18657. if (!o) return;
  18658. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  18659. var n = Object.prototype.toString.call(o).slice(8, -1);
  18660. if (n === "Object" && o.constructor) n = o.constructor.name;
  18661. if (n === "Map" || n === "Set") return Array.from(o);
  18662. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  18663. }
  18664. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18665. /***/ }),
  18666. /***/ 9:
  18667. /*!*****************************************************************!*\
  18668. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  18669. \*****************************************************************/
  18670. /*! no static exports found */
  18671. /***/ (function(module, exports) {
  18672. function _arrayLikeToArray(arr, len) {
  18673. if (len == null || len > arr.length) len = arr.length;
  18674. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  18675. arr2[i] = arr[i];
  18676. }
  18677. return arr2;
  18678. }
  18679. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18680. /***/ })
  18681. }]);
  18682. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map