vendor.js 669 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738
  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', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function toPropertyKey(t) {
  84. var i = toPrimitive(t, "string");
  85. return "symbol" == _typeof(i) ? i : i + "";
  86. }
  87. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(o) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  98. return typeof o;
  99. } : function (o) {
  100. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 14:
  106. /*!************************************************************!*\
  107. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  108. \************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  112. function toPrimitive(t, r) {
  113. if ("object" != _typeof(t) || !t) return t;
  114. var e = t[Symbol.toPrimitive];
  115. if (void 0 !== e) {
  116. var i = e.call(t, r || "default");
  117. if ("object" != _typeof(i)) return i;
  118. throw new TypeError("@@toPrimitive must return a primitive value.");
  119. }
  120. return ("string" === r ? String : Number)(t);
  121. }
  122. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  123. /***/ }),
  124. /***/ 15:
  125. /*!**********************************************************!*\
  126. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  127. \**********************************************************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  131. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  132. function _construct(t, e, r) {
  133. if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  134. var o = [null];
  135. o.push.apply(o, e);
  136. var p = new (t.bind.apply(t, o))();
  137. return r && setPrototypeOf(p, r.prototype), p;
  138. }
  139. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  140. /***/ }),
  141. /***/ 16:
  142. /*!***************************************************************!*\
  143. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  144. \***************************************************************/
  145. /*! no static exports found */
  146. /***/ (function(module, exports) {
  147. function _setPrototypeOf(o, p) {
  148. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  149. o.__proto__ = p;
  150. return o;
  151. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  152. return _setPrototypeOf(o, p);
  153. }
  154. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  155. /***/ }),
  156. /***/ 17:
  157. /*!*************************************************************************!*\
  158. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  159. \*************************************************************************/
  160. /*! no static exports found */
  161. /***/ (function(module, exports) {
  162. function _isNativeReflectConstruct() {
  163. try {
  164. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  165. } catch (t) {}
  166. return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
  167. return !!t;
  168. }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
  169. }
  170. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  171. /***/ }),
  172. /***/ 18:
  173. /*!******************************************************************!*\
  174. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  175. \******************************************************************/
  176. /*! no static exports found */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  179. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  180. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  181. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  182. function _toConsumableArray(arr) {
  183. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  184. }
  185. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  186. /***/ }),
  187. /***/ 181:
  188. /*!***************************************************************************************************************!*\
  189. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js ***!
  190. \***************************************************************************************************************/
  191. /*! no static exports found */
  192. /***/ (function(module, exports, __webpack_require__) {
  193. "use strict";
  194. Object.defineProperty(exports, "__esModule", {
  195. value: true
  196. });
  197. exports.fontData = void 0;
  198. var fontData = [{
  199. "font_class": "arrow-down",
  200. "unicode": "\uE6BE"
  201. }, {
  202. "font_class": "arrow-left",
  203. "unicode": "\uE6BC"
  204. }, {
  205. "font_class": "arrow-right",
  206. "unicode": "\uE6BB"
  207. }, {
  208. "font_class": "arrow-up",
  209. "unicode": "\uE6BD"
  210. }, {
  211. "font_class": "auth",
  212. "unicode": "\uE6AB"
  213. }, {
  214. "font_class": "auth-filled",
  215. "unicode": "\uE6CC"
  216. }, {
  217. "font_class": "back",
  218. "unicode": "\uE6B9"
  219. }, {
  220. "font_class": "bars",
  221. "unicode": "\uE627"
  222. }, {
  223. "font_class": "calendar",
  224. "unicode": "\uE6A0"
  225. }, {
  226. "font_class": "calendar-filled",
  227. "unicode": "\uE6C0"
  228. }, {
  229. "font_class": "camera",
  230. "unicode": "\uE65A"
  231. }, {
  232. "font_class": "camera-filled",
  233. "unicode": "\uE658"
  234. }, {
  235. "font_class": "cart",
  236. "unicode": "\uE631"
  237. }, {
  238. "font_class": "cart-filled",
  239. "unicode": "\uE6D0"
  240. }, {
  241. "font_class": "chat",
  242. "unicode": "\uE65D"
  243. }, {
  244. "font_class": "chat-filled",
  245. "unicode": "\uE659"
  246. }, {
  247. "font_class": "chatboxes",
  248. "unicode": "\uE696"
  249. }, {
  250. "font_class": "chatboxes-filled",
  251. "unicode": "\uE692"
  252. }, {
  253. "font_class": "chatbubble",
  254. "unicode": "\uE697"
  255. }, {
  256. "font_class": "chatbubble-filled",
  257. "unicode": "\uE694"
  258. }, {
  259. "font_class": "checkbox",
  260. "unicode": "\uE62B"
  261. }, {
  262. "font_class": "checkbox-filled",
  263. "unicode": "\uE62C"
  264. }, {
  265. "font_class": "checkmarkempty",
  266. "unicode": "\uE65C"
  267. }, {
  268. "font_class": "circle",
  269. "unicode": "\uE65B"
  270. }, {
  271. "font_class": "circle-filled",
  272. "unicode": "\uE65E"
  273. }, {
  274. "font_class": "clear",
  275. "unicode": "\uE66D"
  276. }, {
  277. "font_class": "close",
  278. "unicode": "\uE673"
  279. }, {
  280. "font_class": "closeempty",
  281. "unicode": "\uE66C"
  282. }, {
  283. "font_class": "cloud-download",
  284. "unicode": "\uE647"
  285. }, {
  286. "font_class": "cloud-download-filled",
  287. "unicode": "\uE646"
  288. }, {
  289. "font_class": "cloud-upload",
  290. "unicode": "\uE645"
  291. }, {
  292. "font_class": "cloud-upload-filled",
  293. "unicode": "\uE648"
  294. }, {
  295. "font_class": "color",
  296. "unicode": "\uE6CF"
  297. }, {
  298. "font_class": "color-filled",
  299. "unicode": "\uE6C9"
  300. }, {
  301. "font_class": "compose",
  302. "unicode": "\uE67F"
  303. }, {
  304. "font_class": "contact",
  305. "unicode": "\uE693"
  306. }, {
  307. "font_class": "contact-filled",
  308. "unicode": "\uE695"
  309. }, {
  310. "font_class": "down",
  311. "unicode": "\uE6B8"
  312. }, {
  313. "font_class": "bottom",
  314. "unicode": "\uE6B8"
  315. }, {
  316. "font_class": "download",
  317. "unicode": "\uE68D"
  318. }, {
  319. "font_class": "download-filled",
  320. "unicode": "\uE681"
  321. }, {
  322. "font_class": "email",
  323. "unicode": "\uE69E"
  324. }, {
  325. "font_class": "email-filled",
  326. "unicode": "\uE69A"
  327. }, {
  328. "font_class": "eye",
  329. "unicode": "\uE651"
  330. }, {
  331. "font_class": "eye-filled",
  332. "unicode": "\uE66A"
  333. }, {
  334. "font_class": "eye-slash",
  335. "unicode": "\uE6B3"
  336. }, {
  337. "font_class": "eye-slash-filled",
  338. "unicode": "\uE6B4"
  339. }, {
  340. "font_class": "fire",
  341. "unicode": "\uE6A1"
  342. }, {
  343. "font_class": "fire-filled",
  344. "unicode": "\uE6C5"
  345. }, {
  346. "font_class": "flag",
  347. "unicode": "\uE65F"
  348. }, {
  349. "font_class": "flag-filled",
  350. "unicode": "\uE660"
  351. }, {
  352. "font_class": "folder-add",
  353. "unicode": "\uE6A9"
  354. }, {
  355. "font_class": "folder-add-filled",
  356. "unicode": "\uE6C8"
  357. }, {
  358. "font_class": "font",
  359. "unicode": "\uE6A3"
  360. }, {
  361. "font_class": "forward",
  362. "unicode": "\uE6BA"
  363. }, {
  364. "font_class": "gear",
  365. "unicode": "\uE664"
  366. }, {
  367. "font_class": "gear-filled",
  368. "unicode": "\uE661"
  369. }, {
  370. "font_class": "gift",
  371. "unicode": "\uE6A4"
  372. }, {
  373. "font_class": "gift-filled",
  374. "unicode": "\uE6C4"
  375. }, {
  376. "font_class": "hand-down",
  377. "unicode": "\uE63D"
  378. }, {
  379. "font_class": "hand-down-filled",
  380. "unicode": "\uE63C"
  381. }, {
  382. "font_class": "hand-up",
  383. "unicode": "\uE63F"
  384. }, {
  385. "font_class": "hand-up-filled",
  386. "unicode": "\uE63E"
  387. }, {
  388. "font_class": "headphones",
  389. "unicode": "\uE630"
  390. }, {
  391. "font_class": "heart",
  392. "unicode": "\uE639"
  393. }, {
  394. "font_class": "heart-filled",
  395. "unicode": "\uE641"
  396. }, {
  397. "font_class": "help",
  398. "unicode": "\uE679"
  399. }, {
  400. "font_class": "help-filled",
  401. "unicode": "\uE674"
  402. }, {
  403. "font_class": "home",
  404. "unicode": "\uE662"
  405. }, {
  406. "font_class": "home-filled",
  407. "unicode": "\uE663"
  408. }, {
  409. "font_class": "image",
  410. "unicode": "\uE670"
  411. }, {
  412. "font_class": "image-filled",
  413. "unicode": "\uE678"
  414. }, {
  415. "font_class": "images",
  416. "unicode": "\uE650"
  417. }, {
  418. "font_class": "images-filled",
  419. "unicode": "\uE64B"
  420. }, {
  421. "font_class": "info",
  422. "unicode": "\uE669"
  423. }, {
  424. "font_class": "info-filled",
  425. "unicode": "\uE649"
  426. }, {
  427. "font_class": "left",
  428. "unicode": "\uE6B7"
  429. }, {
  430. "font_class": "link",
  431. "unicode": "\uE6A5"
  432. }, {
  433. "font_class": "list",
  434. "unicode": "\uE644"
  435. }, {
  436. "font_class": "location",
  437. "unicode": "\uE6AE"
  438. }, {
  439. "font_class": "location-filled",
  440. "unicode": "\uE6AF"
  441. }, {
  442. "font_class": "locked",
  443. "unicode": "\uE66B"
  444. }, {
  445. "font_class": "locked-filled",
  446. "unicode": "\uE668"
  447. }, {
  448. "font_class": "loop",
  449. "unicode": "\uE633"
  450. }, {
  451. "font_class": "mail-open",
  452. "unicode": "\uE643"
  453. }, {
  454. "font_class": "mail-open-filled",
  455. "unicode": "\uE63A"
  456. }, {
  457. "font_class": "map",
  458. "unicode": "\uE667"
  459. }, {
  460. "font_class": "map-filled",
  461. "unicode": "\uE666"
  462. }, {
  463. "font_class": "map-pin",
  464. "unicode": "\uE6AD"
  465. }, {
  466. "font_class": "map-pin-ellipse",
  467. "unicode": "\uE6AC"
  468. }, {
  469. "font_class": "medal",
  470. "unicode": "\uE6A2"
  471. }, {
  472. "font_class": "medal-filled",
  473. "unicode": "\uE6C3"
  474. }, {
  475. "font_class": "mic",
  476. "unicode": "\uE671"
  477. }, {
  478. "font_class": "mic-filled",
  479. "unicode": "\uE677"
  480. }, {
  481. "font_class": "micoff",
  482. "unicode": "\uE67E"
  483. }, {
  484. "font_class": "micoff-filled",
  485. "unicode": "\uE6B0"
  486. }, {
  487. "font_class": "minus",
  488. "unicode": "\uE66F"
  489. }, {
  490. "font_class": "minus-filled",
  491. "unicode": "\uE67D"
  492. }, {
  493. "font_class": "more",
  494. "unicode": "\uE64D"
  495. }, {
  496. "font_class": "more-filled",
  497. "unicode": "\uE64E"
  498. }, {
  499. "font_class": "navigate",
  500. "unicode": "\uE66E"
  501. }, {
  502. "font_class": "navigate-filled",
  503. "unicode": "\uE67A"
  504. }, {
  505. "font_class": "notification",
  506. "unicode": "\uE6A6"
  507. }, {
  508. "font_class": "notification-filled",
  509. "unicode": "\uE6C1"
  510. }, {
  511. "font_class": "paperclip",
  512. "unicode": "\uE652"
  513. }, {
  514. "font_class": "paperplane",
  515. "unicode": "\uE672"
  516. }, {
  517. "font_class": "paperplane-filled",
  518. "unicode": "\uE675"
  519. }, {
  520. "font_class": "person",
  521. "unicode": "\uE699"
  522. }, {
  523. "font_class": "person-filled",
  524. "unicode": "\uE69D"
  525. }, {
  526. "font_class": "personadd",
  527. "unicode": "\uE69F"
  528. }, {
  529. "font_class": "personadd-filled",
  530. "unicode": "\uE698"
  531. }, {
  532. "font_class": "personadd-filled-copy",
  533. "unicode": "\uE6D1"
  534. }, {
  535. "font_class": "phone",
  536. "unicode": "\uE69C"
  537. }, {
  538. "font_class": "phone-filled",
  539. "unicode": "\uE69B"
  540. }, {
  541. "font_class": "plus",
  542. "unicode": "\uE676"
  543. }, {
  544. "font_class": "plus-filled",
  545. "unicode": "\uE6C7"
  546. }, {
  547. "font_class": "plusempty",
  548. "unicode": "\uE67B"
  549. }, {
  550. "font_class": "pulldown",
  551. "unicode": "\uE632"
  552. }, {
  553. "font_class": "pyq",
  554. "unicode": "\uE682"
  555. }, {
  556. "font_class": "qq",
  557. "unicode": "\uE680"
  558. }, {
  559. "font_class": "redo",
  560. "unicode": "\uE64A"
  561. }, {
  562. "font_class": "redo-filled",
  563. "unicode": "\uE655"
  564. }, {
  565. "font_class": "refresh",
  566. "unicode": "\uE657"
  567. }, {
  568. "font_class": "refresh-filled",
  569. "unicode": "\uE656"
  570. }, {
  571. "font_class": "refreshempty",
  572. "unicode": "\uE6BF"
  573. }, {
  574. "font_class": "reload",
  575. "unicode": "\uE6B2"
  576. }, {
  577. "font_class": "right",
  578. "unicode": "\uE6B5"
  579. }, {
  580. "font_class": "scan",
  581. "unicode": "\uE62A"
  582. }, {
  583. "font_class": "search",
  584. "unicode": "\uE654"
  585. }, {
  586. "font_class": "settings",
  587. "unicode": "\uE653"
  588. }, {
  589. "font_class": "settings-filled",
  590. "unicode": "\uE6CE"
  591. }, {
  592. "font_class": "shop",
  593. "unicode": "\uE62F"
  594. }, {
  595. "font_class": "shop-filled",
  596. "unicode": "\uE6CD"
  597. }, {
  598. "font_class": "smallcircle",
  599. "unicode": "\uE67C"
  600. }, {
  601. "font_class": "smallcircle-filled",
  602. "unicode": "\uE665"
  603. }, {
  604. "font_class": "sound",
  605. "unicode": "\uE684"
  606. }, {
  607. "font_class": "sound-filled",
  608. "unicode": "\uE686"
  609. }, {
  610. "font_class": "spinner-cycle",
  611. "unicode": "\uE68A"
  612. }, {
  613. "font_class": "staff",
  614. "unicode": "\uE6A7"
  615. }, {
  616. "font_class": "staff-filled",
  617. "unicode": "\uE6CB"
  618. }, {
  619. "font_class": "star",
  620. "unicode": "\uE688"
  621. }, {
  622. "font_class": "star-filled",
  623. "unicode": "\uE68F"
  624. }, {
  625. "font_class": "starhalf",
  626. "unicode": "\uE683"
  627. }, {
  628. "font_class": "trash",
  629. "unicode": "\uE687"
  630. }, {
  631. "font_class": "trash-filled",
  632. "unicode": "\uE685"
  633. }, {
  634. "font_class": "tune",
  635. "unicode": "\uE6AA"
  636. }, {
  637. "font_class": "tune-filled",
  638. "unicode": "\uE6CA"
  639. }, {
  640. "font_class": "undo",
  641. "unicode": "\uE64F"
  642. }, {
  643. "font_class": "undo-filled",
  644. "unicode": "\uE64C"
  645. }, {
  646. "font_class": "up",
  647. "unicode": "\uE6B6"
  648. }, {
  649. "font_class": "top",
  650. "unicode": "\uE6B6"
  651. }, {
  652. "font_class": "upload",
  653. "unicode": "\uE690"
  654. }, {
  655. "font_class": "upload-filled",
  656. "unicode": "\uE68E"
  657. }, {
  658. "font_class": "videocam",
  659. "unicode": "\uE68C"
  660. }, {
  661. "font_class": "videocam-filled",
  662. "unicode": "\uE689"
  663. }, {
  664. "font_class": "vip",
  665. "unicode": "\uE6A8"
  666. }, {
  667. "font_class": "vip-filled",
  668. "unicode": "\uE6C6"
  669. }, {
  670. "font_class": "wallet",
  671. "unicode": "\uE6B1"
  672. }, {
  673. "font_class": "wallet-filled",
  674. "unicode": "\uE6C2"
  675. }, {
  676. "font_class": "weibo",
  677. "unicode": "\uE68B"
  678. }, {
  679. "font_class": "weixin",
  680. "unicode": "\uE691"
  681. }];
  682. // export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
  683. exports.fontData = fontData;
  684. /***/ }),
  685. /***/ 19:
  686. /*!******************************************************************!*\
  687. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  688. \******************************************************************/
  689. /*! no static exports found */
  690. /***/ (function(module, exports, __webpack_require__) {
  691. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  692. function _arrayWithoutHoles(arr) {
  693. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  694. }
  695. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  696. /***/ }),
  697. /***/ 196:
  698. /*!***************************************************************************************************!*\
  699. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  700. \***************************************************************************************************/
  701. /*! no static exports found */
  702. /***/ (function(module, exports, __webpack_require__) {
  703. "use strict";
  704. Object.defineProperty(exports, "__esModule", {
  705. value: true
  706. });
  707. exports.default = void 0;
  708. var _default = {
  709. data: function data() {
  710. return {};
  711. },
  712. created: function created() {
  713. this.popup = this.getParent();
  714. },
  715. methods: {
  716. /**
  717. * 获取父元素实例
  718. */
  719. getParent: function getParent() {
  720. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'uniPopup';
  721. var parent = this.$parent;
  722. var parentName = parent.$options.name;
  723. while (parentName !== name) {
  724. parent = parent.$parent;
  725. if (!parent) return false;
  726. parentName = parent.$options.name;
  727. }
  728. return parent;
  729. }
  730. }
  731. };
  732. exports.default = _default;
  733. /***/ }),
  734. /***/ 197:
  735. /*!********************************************************************************************************!*\
  736. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/index.js ***!
  737. \********************************************************************************************************/
  738. /*! no static exports found */
  739. /***/ (function(module, exports, __webpack_require__) {
  740. "use strict";
  741. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  742. Object.defineProperty(exports, "__esModule", {
  743. value: true
  744. });
  745. exports.default = void 0;
  746. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 198));
  747. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 199));
  748. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 200));
  749. var _default = {
  750. en: _en.default,
  751. 'zh-Hans': _zhHans.default,
  752. 'zh-Hant': _zhHant.default
  753. };
  754. exports.default = _default;
  755. /***/ }),
  756. /***/ 198:
  757. /*!*******************************************************************************************************!*\
  758. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/en.json ***!
  759. \*******************************************************************************************************/
  760. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  761. /***/ (function(module) {
  762. module.exports = JSON.parse("{\"uni-popup.cancel\":\"cancel\",\"uni-popup.ok\":\"ok\",\"uni-popup.placeholder\":\"pleace enter\",\"uni-popup.title\":\"Hint\",\"uni-popup.shareTitle\":\"Share to\"}");
  763. /***/ }),
  764. /***/ 199:
  765. /*!************************************************************************************************************!*\
  766. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json ***!
  767. \************************************************************************************************************/
  768. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  769. /***/ (function(module) {
  770. module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"确定\",\"uni-popup.placeholder\":\"请输入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
  771. /***/ }),
  772. /***/ 2:
  773. /*!************************************************************!*\
  774. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  775. \************************************************************/
  776. /*! no static exports found */
  777. /***/ (function(module, exports, __webpack_require__) {
  778. "use strict";
  779. /* WEBPACK VAR INJECTION */(function(wx, global) {
  780. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  781. Object.defineProperty(exports, "__esModule", {
  782. value: true
  783. });
  784. exports.createApp = createApp;
  785. exports.createComponent = createComponent;
  786. exports.createPage = createPage;
  787. exports.createPlugin = createPlugin;
  788. exports.createSubpackageApp = createSubpackageApp;
  789. exports.default = void 0;
  790. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  791. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  792. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  793. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  794. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  795. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  796. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  797. 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; }
  798. 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; }
  799. var realAtob;
  800. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  801. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  802. if (typeof atob !== 'function') {
  803. realAtob = function realAtob(str) {
  804. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  805. if (!b64re.test(str)) {
  806. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  807. }
  808. // Adding the padding if missing, for semplicity
  809. str += '=='.slice(2 - (str.length & 3));
  810. var bitmap;
  811. var result = '';
  812. var r1;
  813. var r2;
  814. var i = 0;
  815. for (; i < str.length;) {
  816. 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++)));
  817. 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);
  818. }
  819. return result;
  820. };
  821. } else {
  822. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  823. realAtob = atob;
  824. }
  825. function b64DecodeUnicode(str) {
  826. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  827. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  828. }).join(''));
  829. }
  830. function getCurrentUserInfo() {
  831. var token = wx.getStorageSync('uni_id_token') || '';
  832. var tokenArr = token.split('.');
  833. if (!token || tokenArr.length !== 3) {
  834. return {
  835. uid: null,
  836. role: [],
  837. permission: [],
  838. tokenExpired: 0
  839. };
  840. }
  841. var userInfo;
  842. try {
  843. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  844. } catch (error) {
  845. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  846. }
  847. userInfo.tokenExpired = userInfo.exp * 1000;
  848. delete userInfo.exp;
  849. delete userInfo.iat;
  850. return userInfo;
  851. }
  852. function uniIdMixin(Vue) {
  853. Vue.prototype.uniIDHasRole = function (roleId) {
  854. var _getCurrentUserInfo = getCurrentUserInfo(),
  855. role = _getCurrentUserInfo.role;
  856. return role.indexOf(roleId) > -1;
  857. };
  858. Vue.prototype.uniIDHasPermission = function (permissionId) {
  859. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  860. permission = _getCurrentUserInfo2.permission;
  861. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  862. };
  863. Vue.prototype.uniIDTokenValid = function () {
  864. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  865. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  866. return tokenExpired > Date.now();
  867. };
  868. }
  869. var _toString = Object.prototype.toString;
  870. var hasOwnProperty = Object.prototype.hasOwnProperty;
  871. function isFn(fn) {
  872. return typeof fn === 'function';
  873. }
  874. function isStr(str) {
  875. return typeof str === 'string';
  876. }
  877. function isObject(obj) {
  878. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  879. }
  880. function isPlainObject(obj) {
  881. return _toString.call(obj) === '[object Object]';
  882. }
  883. function hasOwn(obj, key) {
  884. return hasOwnProperty.call(obj, key);
  885. }
  886. function noop() {}
  887. /**
  888. * Create a cached version of a pure function.
  889. */
  890. function cached(fn) {
  891. var cache = Object.create(null);
  892. return function cachedFn(str) {
  893. var hit = cache[str];
  894. return hit || (cache[str] = fn(str));
  895. };
  896. }
  897. /**
  898. * Camelize a hyphen-delimited string.
  899. */
  900. var camelizeRE = /-(\w)/g;
  901. var camelize = cached(function (str) {
  902. return str.replace(camelizeRE, function (_, c) {
  903. return c ? c.toUpperCase() : '';
  904. });
  905. });
  906. function sortObject(obj) {
  907. var sortObj = {};
  908. if (isPlainObject(obj)) {
  909. Object.keys(obj).sort().forEach(function (key) {
  910. sortObj[key] = obj[key];
  911. });
  912. }
  913. return !Object.keys(sortObj) ? obj : sortObj;
  914. }
  915. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  916. var globalInterceptors = {};
  917. var scopedInterceptors = {};
  918. function mergeHook(parentVal, childVal) {
  919. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  920. return res ? dedupeHooks(res) : res;
  921. }
  922. function dedupeHooks(hooks) {
  923. var res = [];
  924. for (var i = 0; i < hooks.length; i++) {
  925. if (res.indexOf(hooks[i]) === -1) {
  926. res.push(hooks[i]);
  927. }
  928. }
  929. return res;
  930. }
  931. function removeHook(hooks, hook) {
  932. var index = hooks.indexOf(hook);
  933. if (index !== -1) {
  934. hooks.splice(index, 1);
  935. }
  936. }
  937. function mergeInterceptorHook(interceptor, option) {
  938. Object.keys(option).forEach(function (hook) {
  939. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  940. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  941. }
  942. });
  943. }
  944. function removeInterceptorHook(interceptor, option) {
  945. if (!interceptor || !option) {
  946. return;
  947. }
  948. Object.keys(option).forEach(function (hook) {
  949. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  950. removeHook(interceptor[hook], option[hook]);
  951. }
  952. });
  953. }
  954. function addInterceptor(method, option) {
  955. if (typeof method === 'string' && isPlainObject(option)) {
  956. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  957. } else if (isPlainObject(method)) {
  958. mergeInterceptorHook(globalInterceptors, method);
  959. }
  960. }
  961. function removeInterceptor(method, option) {
  962. if (typeof method === 'string') {
  963. if (isPlainObject(option)) {
  964. removeInterceptorHook(scopedInterceptors[method], option);
  965. } else {
  966. delete scopedInterceptors[method];
  967. }
  968. } else if (isPlainObject(method)) {
  969. removeInterceptorHook(globalInterceptors, method);
  970. }
  971. }
  972. function wrapperHook(hook, params) {
  973. return function (data) {
  974. return hook(data, params) || data;
  975. };
  976. }
  977. function isPromise(obj) {
  978. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  979. }
  980. function queue(hooks, data, params) {
  981. var promise = false;
  982. for (var i = 0; i < hooks.length; i++) {
  983. var hook = hooks[i];
  984. if (promise) {
  985. promise = Promise.resolve(wrapperHook(hook, params));
  986. } else {
  987. var res = hook(data, params);
  988. if (isPromise(res)) {
  989. promise = Promise.resolve(res);
  990. }
  991. if (res === false) {
  992. return {
  993. then: function then() {}
  994. };
  995. }
  996. }
  997. }
  998. return promise || {
  999. then: function then(callback) {
  1000. return callback(data);
  1001. }
  1002. };
  1003. }
  1004. function wrapperOptions(interceptor) {
  1005. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1006. ['success', 'fail', 'complete'].forEach(function (name) {
  1007. if (Array.isArray(interceptor[name])) {
  1008. var oldCallback = options[name];
  1009. options[name] = function callbackInterceptor(res) {
  1010. queue(interceptor[name], res, options).then(function (res) {
  1011. /* eslint-disable no-mixed-operators */
  1012. return isFn(oldCallback) && oldCallback(res) || res;
  1013. });
  1014. };
  1015. }
  1016. });
  1017. return options;
  1018. }
  1019. function wrapperReturnValue(method, returnValue) {
  1020. var returnValueHooks = [];
  1021. if (Array.isArray(globalInterceptors.returnValue)) {
  1022. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1023. }
  1024. var interceptor = scopedInterceptors[method];
  1025. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1026. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1027. }
  1028. returnValueHooks.forEach(function (hook) {
  1029. returnValue = hook(returnValue) || returnValue;
  1030. });
  1031. return returnValue;
  1032. }
  1033. function getApiInterceptorHooks(method) {
  1034. var interceptor = Object.create(null);
  1035. Object.keys(globalInterceptors).forEach(function (hook) {
  1036. if (hook !== 'returnValue') {
  1037. interceptor[hook] = globalInterceptors[hook].slice();
  1038. }
  1039. });
  1040. var scopedInterceptor = scopedInterceptors[method];
  1041. if (scopedInterceptor) {
  1042. Object.keys(scopedInterceptor).forEach(function (hook) {
  1043. if (hook !== 'returnValue') {
  1044. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1045. }
  1046. });
  1047. }
  1048. return interceptor;
  1049. }
  1050. function invokeApi(method, api, options) {
  1051. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1052. params[_key - 3] = arguments[_key];
  1053. }
  1054. var interceptor = getApiInterceptorHooks(method);
  1055. if (interceptor && Object.keys(interceptor).length) {
  1056. if (Array.isArray(interceptor.invoke)) {
  1057. var res = queue(interceptor.invoke, options);
  1058. return res.then(function (options) {
  1059. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  1060. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  1061. });
  1062. } else {
  1063. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1064. }
  1065. }
  1066. return api.apply(void 0, [options].concat(params));
  1067. }
  1068. var promiseInterceptor = {
  1069. returnValue: function returnValue(res) {
  1070. if (!isPromise(res)) {
  1071. return res;
  1072. }
  1073. return new Promise(function (resolve, reject) {
  1074. res.then(function (res) {
  1075. if (res[0]) {
  1076. reject(res[0]);
  1077. } else {
  1078. resolve(res[1]);
  1079. }
  1080. });
  1081. });
  1082. }
  1083. };
  1084. 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|initUTS|requireUTS|registerUTS/;
  1085. var CONTEXT_API_RE = /^create|Manager$/;
  1086. // Context例外情况
  1087. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1088. // 同步例外情况
  1089. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1090. var CALLBACK_API_RE = /^on|^off/;
  1091. function isContextApi(name) {
  1092. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1093. }
  1094. function isSyncApi(name) {
  1095. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1096. }
  1097. function isCallbackApi(name) {
  1098. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1099. }
  1100. function handlePromise(promise) {
  1101. return promise.then(function (data) {
  1102. return [null, data];
  1103. }).catch(function (err) {
  1104. return [err];
  1105. });
  1106. }
  1107. function shouldPromise(name) {
  1108. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1109. return false;
  1110. }
  1111. return true;
  1112. }
  1113. /* eslint-disable no-extend-native */
  1114. if (!Promise.prototype.finally) {
  1115. Promise.prototype.finally = function (callback) {
  1116. var promise = this.constructor;
  1117. return this.then(function (value) {
  1118. return promise.resolve(callback()).then(function () {
  1119. return value;
  1120. });
  1121. }, function (reason) {
  1122. return promise.resolve(callback()).then(function () {
  1123. throw reason;
  1124. });
  1125. });
  1126. };
  1127. }
  1128. function promisify(name, api) {
  1129. if (!shouldPromise(name) || !isFn(api)) {
  1130. return api;
  1131. }
  1132. return function promiseApi() {
  1133. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1134. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1135. params[_key2 - 1] = arguments[_key2];
  1136. }
  1137. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1138. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1139. }
  1140. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1141. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1142. success: resolve,
  1143. fail: reject
  1144. })].concat(params));
  1145. })));
  1146. };
  1147. }
  1148. var EPS = 1e-4;
  1149. var BASE_DEVICE_WIDTH = 750;
  1150. var isIOS = false;
  1151. var deviceWidth = 0;
  1152. var deviceDPR = 0;
  1153. function checkDeviceWidth() {
  1154. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1155. platform = _wx$getSystemInfoSync.platform,
  1156. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1157. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1158. deviceWidth = windowWidth;
  1159. deviceDPR = pixelRatio;
  1160. isIOS = platform === 'ios';
  1161. }
  1162. function upx2px(number, newDeviceWidth) {
  1163. if (deviceWidth === 0) {
  1164. checkDeviceWidth();
  1165. }
  1166. number = Number(number);
  1167. if (number === 0) {
  1168. return 0;
  1169. }
  1170. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1171. if (result < 0) {
  1172. result = -result;
  1173. }
  1174. result = Math.floor(result + EPS);
  1175. if (result === 0) {
  1176. if (deviceDPR === 1 || !isIOS) {
  1177. result = 1;
  1178. } else {
  1179. result = 0.5;
  1180. }
  1181. }
  1182. return number < 0 ? -result : result;
  1183. }
  1184. var LOCALE_ZH_HANS = 'zh-Hans';
  1185. var LOCALE_ZH_HANT = 'zh-Hant';
  1186. var LOCALE_EN = 'en';
  1187. var LOCALE_FR = 'fr';
  1188. var LOCALE_ES = 'es';
  1189. var messages = {};
  1190. var locale;
  1191. {
  1192. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1193. }
  1194. function initI18nMessages() {
  1195. if (!isEnableLocale()) {
  1196. return;
  1197. }
  1198. var localeKeys = Object.keys(__uniConfig.locales);
  1199. if (localeKeys.length) {
  1200. localeKeys.forEach(function (locale) {
  1201. var curMessages = messages[locale];
  1202. var userMessages = __uniConfig.locales[locale];
  1203. if (curMessages) {
  1204. Object.assign(curMessages, userMessages);
  1205. } else {
  1206. messages[locale] = userMessages;
  1207. }
  1208. });
  1209. }
  1210. }
  1211. initI18nMessages();
  1212. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1213. var t = i18n.t;
  1214. var i18nMixin = i18n.mixin = {
  1215. beforeCreate: function beforeCreate() {
  1216. var _this = this;
  1217. var unwatch = i18n.i18n.watchLocale(function () {
  1218. _this.$forceUpdate();
  1219. });
  1220. this.$once('hook:beforeDestroy', function () {
  1221. unwatch();
  1222. });
  1223. },
  1224. methods: {
  1225. $$t: function $$t(key, values) {
  1226. return t(key, values);
  1227. }
  1228. }
  1229. };
  1230. var setLocale = i18n.setLocale;
  1231. var getLocale = i18n.getLocale;
  1232. function initAppLocale(Vue, appVm, locale) {
  1233. var state = Vue.observable({
  1234. locale: locale || i18n.getLocale()
  1235. });
  1236. var localeWatchers = [];
  1237. appVm.$watchLocale = function (fn) {
  1238. localeWatchers.push(fn);
  1239. };
  1240. Object.defineProperty(appVm, '$locale', {
  1241. get: function get() {
  1242. return state.locale;
  1243. },
  1244. set: function set(v) {
  1245. state.locale = v;
  1246. localeWatchers.forEach(function (watch) {
  1247. return watch(v);
  1248. });
  1249. }
  1250. });
  1251. }
  1252. function isEnableLocale() {
  1253. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1254. }
  1255. function include(str, parts) {
  1256. return !!parts.find(function (part) {
  1257. return str.indexOf(part) !== -1;
  1258. });
  1259. }
  1260. function startsWith(str, parts) {
  1261. return parts.find(function (part) {
  1262. return str.indexOf(part) === 0;
  1263. });
  1264. }
  1265. function normalizeLocale(locale, messages) {
  1266. if (!locale) {
  1267. return;
  1268. }
  1269. locale = locale.trim().replace(/_/g, '-');
  1270. if (messages && messages[locale]) {
  1271. return locale;
  1272. }
  1273. locale = locale.toLowerCase();
  1274. if (locale === 'chinese') {
  1275. // 支付宝
  1276. return LOCALE_ZH_HANS;
  1277. }
  1278. if (locale.indexOf('zh') === 0) {
  1279. if (locale.indexOf('-hans') > -1) {
  1280. return LOCALE_ZH_HANS;
  1281. }
  1282. if (locale.indexOf('-hant') > -1) {
  1283. return LOCALE_ZH_HANT;
  1284. }
  1285. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1286. return LOCALE_ZH_HANT;
  1287. }
  1288. return LOCALE_ZH_HANS;
  1289. }
  1290. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1291. if (lang) {
  1292. return lang;
  1293. }
  1294. }
  1295. // export function initI18n() {
  1296. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1297. // if (localeKeys.length) {
  1298. // localeKeys.forEach((locale) =>
  1299. // i18n.add(locale, __uniConfig.locales[locale])
  1300. // )
  1301. // }
  1302. // }
  1303. function getLocale$1() {
  1304. // 优先使用 $locale
  1305. if (isFn(getApp)) {
  1306. var app = getApp({
  1307. allowDefault: true
  1308. });
  1309. if (app && app.$vm) {
  1310. return app.$vm.$locale;
  1311. }
  1312. }
  1313. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1314. }
  1315. function setLocale$1(locale) {
  1316. var app = isFn(getApp) ? getApp() : false;
  1317. if (!app) {
  1318. return false;
  1319. }
  1320. var oldLocale = app.$vm.$locale;
  1321. if (oldLocale !== locale) {
  1322. app.$vm.$locale = locale;
  1323. onLocaleChangeCallbacks.forEach(function (fn) {
  1324. return fn({
  1325. locale: locale
  1326. });
  1327. });
  1328. return true;
  1329. }
  1330. return false;
  1331. }
  1332. var onLocaleChangeCallbacks = [];
  1333. function onLocaleChange(fn) {
  1334. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1335. onLocaleChangeCallbacks.push(fn);
  1336. }
  1337. }
  1338. if (typeof global !== 'undefined') {
  1339. global.getLocale = getLocale$1;
  1340. }
  1341. var interceptors = {
  1342. promiseInterceptor: promiseInterceptor
  1343. };
  1344. var baseApi = /*#__PURE__*/Object.freeze({
  1345. __proto__: null,
  1346. upx2px: upx2px,
  1347. getLocale: getLocale$1,
  1348. setLocale: setLocale$1,
  1349. onLocaleChange: onLocaleChange,
  1350. addInterceptor: addInterceptor,
  1351. removeInterceptor: removeInterceptor,
  1352. interceptors: interceptors
  1353. });
  1354. function findExistsPageIndex(url) {
  1355. var pages = getCurrentPages();
  1356. var len = pages.length;
  1357. while (len--) {
  1358. var page = pages[len];
  1359. if (page.$page && page.$page.fullPath === url) {
  1360. return len;
  1361. }
  1362. }
  1363. return -1;
  1364. }
  1365. var redirectTo = {
  1366. name: function name(fromArgs) {
  1367. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1368. return 'navigateBack';
  1369. }
  1370. return 'redirectTo';
  1371. },
  1372. args: function args(fromArgs) {
  1373. if (fromArgs.exists === 'back' && fromArgs.url) {
  1374. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1375. if (existsPageIndex !== -1) {
  1376. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1377. if (delta > 0) {
  1378. fromArgs.delta = delta;
  1379. }
  1380. }
  1381. }
  1382. }
  1383. };
  1384. var previewImage = {
  1385. args: function args(fromArgs) {
  1386. var currentIndex = parseInt(fromArgs.current);
  1387. if (isNaN(currentIndex)) {
  1388. return;
  1389. }
  1390. var urls = fromArgs.urls;
  1391. if (!Array.isArray(urls)) {
  1392. return;
  1393. }
  1394. var len = urls.length;
  1395. if (!len) {
  1396. return;
  1397. }
  1398. if (currentIndex < 0) {
  1399. currentIndex = 0;
  1400. } else if (currentIndex >= len) {
  1401. currentIndex = len - 1;
  1402. }
  1403. if (currentIndex > 0) {
  1404. fromArgs.current = urls[currentIndex];
  1405. fromArgs.urls = urls.filter(function (item, index) {
  1406. return index < currentIndex ? item !== urls[currentIndex] : true;
  1407. });
  1408. } else {
  1409. fromArgs.current = urls[0];
  1410. }
  1411. return {
  1412. indicator: false,
  1413. loop: false
  1414. };
  1415. }
  1416. };
  1417. var UUID_KEY = '__DC_STAT_UUID';
  1418. var deviceId;
  1419. function useDeviceId(result) {
  1420. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1421. if (!deviceId) {
  1422. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1423. wx.setStorage({
  1424. key: UUID_KEY,
  1425. data: deviceId
  1426. });
  1427. }
  1428. result.deviceId = deviceId;
  1429. }
  1430. function addSafeAreaInsets(result) {
  1431. if (result.safeArea) {
  1432. var safeArea = result.safeArea;
  1433. result.safeAreaInsets = {
  1434. top: safeArea.top,
  1435. left: safeArea.left,
  1436. right: result.windowWidth - safeArea.right,
  1437. bottom: result.screenHeight - safeArea.bottom
  1438. };
  1439. }
  1440. }
  1441. function populateParameters(result) {
  1442. var _result$brand = result.brand,
  1443. brand = _result$brand === void 0 ? '' : _result$brand,
  1444. _result$model = result.model,
  1445. model = _result$model === void 0 ? '' : _result$model,
  1446. _result$system = result.system,
  1447. system = _result$system === void 0 ? '' : _result$system,
  1448. _result$language = result.language,
  1449. language = _result$language === void 0 ? '' : _result$language,
  1450. theme = result.theme,
  1451. version = result.version,
  1452. platform = result.platform,
  1453. fontSizeSetting = result.fontSizeSetting,
  1454. SDKVersion = result.SDKVersion,
  1455. pixelRatio = result.pixelRatio,
  1456. deviceOrientation = result.deviceOrientation;
  1457. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1458. var extraParam = {};
  1459. // osName osVersion
  1460. var osName = '';
  1461. var osVersion = '';
  1462. {
  1463. osName = system.split(' ')[0] || '';
  1464. osVersion = system.split(' ')[1] || '';
  1465. }
  1466. var hostVersion = version;
  1467. // deviceType
  1468. var deviceType = getGetDeviceType(result, model);
  1469. // deviceModel
  1470. var deviceBrand = getDeviceBrand(brand);
  1471. // hostName
  1472. var _hostName = getHostName(result);
  1473. // deviceOrientation
  1474. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1475. // devicePixelRatio
  1476. var _devicePixelRatio = pixelRatio;
  1477. // SDKVersion
  1478. var _SDKVersion = SDKVersion;
  1479. // hostLanguage
  1480. var hostLanguage = language.replace(/_/g, '-');
  1481. // wx.getAccountInfoSync
  1482. var parameters = {
  1483. appId: "__UNI__DBC0602",
  1484. appName: "errand_app",
  1485. appVersion: "1.0.0",
  1486. appVersionCode: "100",
  1487. appLanguage: getAppLanguage(hostLanguage),
  1488. uniCompileVersion: "4.29",
  1489. uniRuntimeVersion: "4.29",
  1490. uniPlatform: undefined || "mp-weixin",
  1491. deviceBrand: deviceBrand,
  1492. deviceModel: model,
  1493. deviceType: deviceType,
  1494. devicePixelRatio: _devicePixelRatio,
  1495. deviceOrientation: _deviceOrientation,
  1496. osName: osName.toLocaleLowerCase(),
  1497. osVersion: osVersion,
  1498. hostTheme: theme,
  1499. hostVersion: hostVersion,
  1500. hostLanguage: hostLanguage,
  1501. hostName: _hostName,
  1502. hostSDKVersion: _SDKVersion,
  1503. hostFontSizeSetting: fontSizeSetting,
  1504. windowTop: 0,
  1505. windowBottom: 0,
  1506. // TODO
  1507. osLanguage: undefined,
  1508. osTheme: undefined,
  1509. ua: undefined,
  1510. hostPackageName: undefined,
  1511. browserName: undefined,
  1512. browserVersion: undefined
  1513. };
  1514. Object.assign(result, parameters, extraParam);
  1515. }
  1516. function getGetDeviceType(result, model) {
  1517. var deviceType = result.deviceType || 'phone';
  1518. {
  1519. var deviceTypeMaps = {
  1520. ipad: 'pad',
  1521. windows: 'pc',
  1522. mac: 'pc'
  1523. };
  1524. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1525. var _model = model.toLocaleLowerCase();
  1526. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1527. var _m = deviceTypeMapsKeys[index];
  1528. if (_model.indexOf(_m) !== -1) {
  1529. deviceType = deviceTypeMaps[_m];
  1530. break;
  1531. }
  1532. }
  1533. }
  1534. return deviceType;
  1535. }
  1536. function getDeviceBrand(brand) {
  1537. var deviceBrand = brand;
  1538. if (deviceBrand) {
  1539. deviceBrand = brand.toLocaleLowerCase();
  1540. }
  1541. return deviceBrand;
  1542. }
  1543. function getAppLanguage(defaultLanguage) {
  1544. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1545. }
  1546. function getHostName(result) {
  1547. var _platform = 'WeChat';
  1548. var _hostName = result.hostName || _platform; // mp-jd
  1549. {
  1550. if (result.environment) {
  1551. _hostName = result.environment;
  1552. } else if (result.host && result.host.env) {
  1553. _hostName = result.host.env;
  1554. }
  1555. }
  1556. return _hostName;
  1557. }
  1558. var getSystemInfo = {
  1559. returnValue: function returnValue(result) {
  1560. useDeviceId(result);
  1561. addSafeAreaInsets(result);
  1562. populateParameters(result);
  1563. }
  1564. };
  1565. var showActionSheet = {
  1566. args: function args(fromArgs) {
  1567. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1568. fromArgs.alertText = fromArgs.title;
  1569. }
  1570. }
  1571. };
  1572. var getAppBaseInfo = {
  1573. returnValue: function returnValue(result) {
  1574. var _result = result,
  1575. version = _result.version,
  1576. language = _result.language,
  1577. SDKVersion = _result.SDKVersion,
  1578. theme = _result.theme;
  1579. var _hostName = getHostName(result);
  1580. var hostLanguage = language.replace('_', '-');
  1581. result = sortObject(Object.assign(result, {
  1582. appId: "__UNI__DBC0602",
  1583. appName: "errand_app",
  1584. appVersion: "1.0.0",
  1585. appVersionCode: "100",
  1586. appLanguage: getAppLanguage(hostLanguage),
  1587. hostVersion: version,
  1588. hostLanguage: hostLanguage,
  1589. hostName: _hostName,
  1590. hostSDKVersion: SDKVersion,
  1591. hostTheme: theme
  1592. }));
  1593. }
  1594. };
  1595. var getDeviceInfo = {
  1596. returnValue: function returnValue(result) {
  1597. var _result2 = result,
  1598. brand = _result2.brand,
  1599. model = _result2.model;
  1600. var deviceType = getGetDeviceType(result, model);
  1601. var deviceBrand = getDeviceBrand(brand);
  1602. useDeviceId(result);
  1603. result = sortObject(Object.assign(result, {
  1604. deviceType: deviceType,
  1605. deviceBrand: deviceBrand,
  1606. deviceModel: model
  1607. }));
  1608. }
  1609. };
  1610. var getWindowInfo = {
  1611. returnValue: function returnValue(result) {
  1612. addSafeAreaInsets(result);
  1613. result = sortObject(Object.assign(result, {
  1614. windowTop: 0,
  1615. windowBottom: 0
  1616. }));
  1617. }
  1618. };
  1619. var getAppAuthorizeSetting = {
  1620. returnValue: function returnValue(result) {
  1621. var locationReducedAccuracy = result.locationReducedAccuracy;
  1622. result.locationAccuracy = 'unsupported';
  1623. if (locationReducedAccuracy === true) {
  1624. result.locationAccuracy = 'reduced';
  1625. } else if (locationReducedAccuracy === false) {
  1626. result.locationAccuracy = 'full';
  1627. }
  1628. }
  1629. };
  1630. // import navigateTo from 'uni-helpers/navigate-to'
  1631. var compressImage = {
  1632. args: function args(fromArgs) {
  1633. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1634. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1635. fromArgs.compressHeight = fromArgs.compressedHeight;
  1636. }
  1637. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1638. fromArgs.compressWidth = fromArgs.compressedWidth;
  1639. }
  1640. }
  1641. };
  1642. var protocols = {
  1643. redirectTo: redirectTo,
  1644. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1645. previewImage: previewImage,
  1646. getSystemInfo: getSystemInfo,
  1647. getSystemInfoSync: getSystemInfo,
  1648. showActionSheet: showActionSheet,
  1649. getAppBaseInfo: getAppBaseInfo,
  1650. getDeviceInfo: getDeviceInfo,
  1651. getWindowInfo: getWindowInfo,
  1652. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1653. compressImage: compressImage
  1654. };
  1655. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1656. var canIUses = [];
  1657. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1658. function processCallback(methodName, method, returnValue) {
  1659. return function (res) {
  1660. return method(processReturnValue(methodName, res, returnValue));
  1661. };
  1662. }
  1663. function processArgs(methodName, fromArgs) {
  1664. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1665. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1666. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1667. if (isPlainObject(fromArgs)) {
  1668. // 一般 api 的参数解析
  1669. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1670. if (isFn(argsOption)) {
  1671. argsOption = argsOption(fromArgs, toArgs) || {};
  1672. }
  1673. for (var key in fromArgs) {
  1674. if (hasOwn(argsOption, key)) {
  1675. var keyOption = argsOption[key];
  1676. if (isFn(keyOption)) {
  1677. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1678. }
  1679. if (!keyOption) {
  1680. // 不支持的参数
  1681. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1682. } else if (isStr(keyOption)) {
  1683. // 重写参数 key
  1684. toArgs[keyOption] = fromArgs[key];
  1685. } else if (isPlainObject(keyOption)) {
  1686. // {name:newName,value:value}可重新指定参数 key:value
  1687. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1688. }
  1689. } else if (CALLBACKS.indexOf(key) !== -1) {
  1690. if (isFn(fromArgs[key])) {
  1691. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1692. }
  1693. } else {
  1694. if (!keepFromArgs) {
  1695. toArgs[key] = fromArgs[key];
  1696. }
  1697. }
  1698. }
  1699. return toArgs;
  1700. } else if (isFn(fromArgs)) {
  1701. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1702. }
  1703. return fromArgs;
  1704. }
  1705. function processReturnValue(methodName, res, returnValue) {
  1706. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1707. if (isFn(protocols.returnValue)) {
  1708. // 处理通用 returnValue
  1709. res = protocols.returnValue(methodName, res);
  1710. }
  1711. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1712. }
  1713. function wrapper(methodName, method) {
  1714. if (hasOwn(protocols, methodName)) {
  1715. var protocol = protocols[methodName];
  1716. if (!protocol) {
  1717. // 暂不支持的 api
  1718. return function () {
  1719. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1720. };
  1721. }
  1722. return function (arg1, arg2) {
  1723. // 目前 api 最多两个参数
  1724. var options = protocol;
  1725. if (isFn(protocol)) {
  1726. options = protocol(arg1);
  1727. }
  1728. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1729. var args = [arg1];
  1730. if (typeof arg2 !== 'undefined') {
  1731. args.push(arg2);
  1732. }
  1733. if (isFn(options.name)) {
  1734. methodName = options.name(arg1);
  1735. } else if (isStr(options.name)) {
  1736. methodName = options.name;
  1737. }
  1738. var returnValue = wx[methodName].apply(wx, args);
  1739. if (isSyncApi(methodName)) {
  1740. // 同步 api
  1741. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1742. }
  1743. return returnValue;
  1744. };
  1745. }
  1746. return method;
  1747. }
  1748. var todoApis = Object.create(null);
  1749. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1750. function createTodoApi(name) {
  1751. return function todoApi(_ref) {
  1752. var fail = _ref.fail,
  1753. complete = _ref.complete;
  1754. var res = {
  1755. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1756. };
  1757. isFn(fail) && fail(res);
  1758. isFn(complete) && complete(res);
  1759. };
  1760. }
  1761. TODOS.forEach(function (name) {
  1762. todoApis[name] = createTodoApi(name);
  1763. });
  1764. var providers = {
  1765. oauth: ['weixin'],
  1766. share: ['weixin'],
  1767. payment: ['wxpay'],
  1768. push: ['weixin']
  1769. };
  1770. function getProvider(_ref2) {
  1771. var service = _ref2.service,
  1772. success = _ref2.success,
  1773. fail = _ref2.fail,
  1774. complete = _ref2.complete;
  1775. var res = false;
  1776. if (providers[service]) {
  1777. res = {
  1778. errMsg: 'getProvider:ok',
  1779. service: service,
  1780. provider: providers[service]
  1781. };
  1782. isFn(success) && success(res);
  1783. } else {
  1784. res = {
  1785. errMsg: 'getProvider:fail service not found'
  1786. };
  1787. isFn(fail) && fail(res);
  1788. }
  1789. isFn(complete) && complete(res);
  1790. }
  1791. var extraApi = /*#__PURE__*/Object.freeze({
  1792. __proto__: null,
  1793. getProvider: getProvider
  1794. });
  1795. var getEmitter = function () {
  1796. var Emitter;
  1797. return function getUniEmitter() {
  1798. if (!Emitter) {
  1799. Emitter = new _vue.default();
  1800. }
  1801. return Emitter;
  1802. };
  1803. }();
  1804. function apply(ctx, method, args) {
  1805. return ctx[method].apply(ctx, args);
  1806. }
  1807. function $on() {
  1808. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1809. }
  1810. function $off() {
  1811. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1812. }
  1813. function $once() {
  1814. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1815. }
  1816. function $emit() {
  1817. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1818. }
  1819. var eventApi = /*#__PURE__*/Object.freeze({
  1820. __proto__: null,
  1821. $on: $on,
  1822. $off: $off,
  1823. $once: $once,
  1824. $emit: $emit
  1825. });
  1826. /**
  1827. * 框架内 try-catch
  1828. */
  1829. /**
  1830. * 开发者 try-catch
  1831. */
  1832. function tryCatch(fn) {
  1833. return function () {
  1834. try {
  1835. return fn.apply(fn, arguments);
  1836. } catch (e) {
  1837. // TODO
  1838. console.error(e);
  1839. }
  1840. };
  1841. }
  1842. function getApiCallbacks(params) {
  1843. var apiCallbacks = {};
  1844. for (var name in params) {
  1845. var param = params[name];
  1846. if (isFn(param)) {
  1847. apiCallbacks[name] = tryCatch(param);
  1848. delete params[name];
  1849. }
  1850. }
  1851. return apiCallbacks;
  1852. }
  1853. var cid;
  1854. var cidErrMsg;
  1855. var enabled;
  1856. function normalizePushMessage(message) {
  1857. try {
  1858. return JSON.parse(message);
  1859. } catch (e) {}
  1860. return message;
  1861. }
  1862. function invokePushCallback(args) {
  1863. if (args.type === 'enabled') {
  1864. enabled = true;
  1865. } else if (args.type === 'clientId') {
  1866. cid = args.cid;
  1867. cidErrMsg = args.errMsg;
  1868. invokeGetPushCidCallbacks(cid, args.errMsg);
  1869. } else if (args.type === 'pushMsg') {
  1870. var message = {
  1871. type: 'receive',
  1872. data: normalizePushMessage(args.message)
  1873. };
  1874. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1875. var callback = onPushMessageCallbacks[i];
  1876. callback(message);
  1877. // 该消息已被阻止
  1878. if (message.stopped) {
  1879. break;
  1880. }
  1881. }
  1882. } else if (args.type === 'click') {
  1883. onPushMessageCallbacks.forEach(function (callback) {
  1884. callback({
  1885. type: 'click',
  1886. data: normalizePushMessage(args.message)
  1887. });
  1888. });
  1889. }
  1890. }
  1891. var getPushCidCallbacks = [];
  1892. function invokeGetPushCidCallbacks(cid, errMsg) {
  1893. getPushCidCallbacks.forEach(function (callback) {
  1894. callback(cid, errMsg);
  1895. });
  1896. getPushCidCallbacks.length = 0;
  1897. }
  1898. function getPushClientId(args) {
  1899. if (!isPlainObject(args)) {
  1900. args = {};
  1901. }
  1902. var _getApiCallbacks = getApiCallbacks(args),
  1903. success = _getApiCallbacks.success,
  1904. fail = _getApiCallbacks.fail,
  1905. complete = _getApiCallbacks.complete;
  1906. var hasSuccess = isFn(success);
  1907. var hasFail = isFn(fail);
  1908. var hasComplete = isFn(complete);
  1909. Promise.resolve().then(function () {
  1910. if (typeof enabled === 'undefined') {
  1911. enabled = false;
  1912. cid = '';
  1913. cidErrMsg = 'uniPush is not enabled';
  1914. }
  1915. getPushCidCallbacks.push(function (cid, errMsg) {
  1916. var res;
  1917. if (cid) {
  1918. res = {
  1919. errMsg: 'getPushClientId:ok',
  1920. cid: cid
  1921. };
  1922. hasSuccess && success(res);
  1923. } else {
  1924. res = {
  1925. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1926. };
  1927. hasFail && fail(res);
  1928. }
  1929. hasComplete && complete(res);
  1930. });
  1931. if (typeof cid !== 'undefined') {
  1932. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1933. }
  1934. });
  1935. }
  1936. var onPushMessageCallbacks = [];
  1937. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1938. var onPushMessage = function onPushMessage(fn) {
  1939. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1940. onPushMessageCallbacks.push(fn);
  1941. }
  1942. };
  1943. var offPushMessage = function offPushMessage(fn) {
  1944. if (!fn) {
  1945. onPushMessageCallbacks.length = 0;
  1946. } else {
  1947. var index = onPushMessageCallbacks.indexOf(fn);
  1948. if (index > -1) {
  1949. onPushMessageCallbacks.splice(index, 1);
  1950. }
  1951. }
  1952. };
  1953. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1954. if (!baseInfo) {
  1955. baseInfo = wx.getSystemInfoSync();
  1956. }
  1957. var host = baseInfo ? baseInfo.host : null;
  1958. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1959. var api = /*#__PURE__*/Object.freeze({
  1960. __proto__: null,
  1961. shareVideoMessage: shareVideoMessage,
  1962. getPushClientId: getPushClientId,
  1963. onPushMessage: onPushMessage,
  1964. offPushMessage: offPushMessage,
  1965. invokePushCallback: invokePushCallback
  1966. });
  1967. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1968. function findVmByVueId(vm, vuePid) {
  1969. var $children = vm.$children;
  1970. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1971. for (var i = $children.length - 1; i >= 0; i--) {
  1972. var childVm = $children[i];
  1973. if (childVm.$scope._$vueId === vuePid) {
  1974. return childVm;
  1975. }
  1976. }
  1977. // 反向递归查找
  1978. var parentVm;
  1979. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1980. parentVm = findVmByVueId($children[_i], vuePid);
  1981. if (parentVm) {
  1982. return parentVm;
  1983. }
  1984. }
  1985. }
  1986. function initBehavior(options) {
  1987. return Behavior(options);
  1988. }
  1989. function isPage() {
  1990. return !!this.route;
  1991. }
  1992. function initRelation(detail) {
  1993. this.triggerEvent('__l', detail);
  1994. }
  1995. function selectAllComponents(mpInstance, selector, $refs) {
  1996. var components = mpInstance.selectAllComponents(selector) || [];
  1997. components.forEach(function (component) {
  1998. var ref = component.dataset.ref;
  1999. $refs[ref] = component.$vm || toSkip(component);
  2000. {
  2001. if (component.dataset.vueGeneric === 'scoped') {
  2002. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2003. selectAllComponents(scopedComponent, selector, $refs);
  2004. });
  2005. }
  2006. }
  2007. });
  2008. }
  2009. function syncRefs(refs, newRefs) {
  2010. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2011. var newKeys = Object.keys(newRefs);
  2012. newKeys.forEach(function (key) {
  2013. var oldValue = refs[key];
  2014. var newValue = newRefs[key];
  2015. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2016. return oldValue.includes(value);
  2017. })) {
  2018. return;
  2019. }
  2020. refs[key] = newValue;
  2021. oldKeys.delete(key);
  2022. });
  2023. oldKeys.forEach(function (key) {
  2024. delete refs[key];
  2025. });
  2026. return refs;
  2027. }
  2028. function initRefs(vm) {
  2029. var mpInstance = vm.$scope;
  2030. var refs = {};
  2031. Object.defineProperty(vm, '$refs', {
  2032. get: function get() {
  2033. var $refs = {};
  2034. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2035. // TODO 暂不考虑 for 中的 scoped
  2036. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2037. forComponents.forEach(function (component) {
  2038. var ref = component.dataset.ref;
  2039. if (!$refs[ref]) {
  2040. $refs[ref] = [];
  2041. }
  2042. $refs[ref].push(component.$vm || toSkip(component));
  2043. });
  2044. return syncRefs(refs, $refs);
  2045. }
  2046. });
  2047. }
  2048. function handleLink(event) {
  2049. var _ref3 = event.detail || event.value,
  2050. vuePid = _ref3.vuePid,
  2051. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2052. var parentVm;
  2053. if (vuePid) {
  2054. parentVm = findVmByVueId(this.$vm, vuePid);
  2055. }
  2056. if (!parentVm) {
  2057. parentVm = this.$vm;
  2058. }
  2059. vueOptions.parent = parentVm;
  2060. }
  2061. function markMPComponent(component) {
  2062. // 在 Vue 中标记为小程序组件
  2063. var IS_MP = '__v_isMPComponent';
  2064. Object.defineProperty(component, IS_MP, {
  2065. configurable: true,
  2066. enumerable: false,
  2067. value: true
  2068. });
  2069. return component;
  2070. }
  2071. function toSkip(obj) {
  2072. var OB = '__ob__';
  2073. var SKIP = '__v_skip';
  2074. if (isObject(obj) && Object.isExtensible(obj)) {
  2075. // 避免被 @vue/composition-api 观测
  2076. Object.defineProperty(obj, OB, {
  2077. configurable: true,
  2078. enumerable: false,
  2079. value: (0, _defineProperty2.default)({}, SKIP, true)
  2080. });
  2081. }
  2082. return obj;
  2083. }
  2084. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2085. function initWorkletMethods(mpMethods, vueMethods) {
  2086. if (vueMethods) {
  2087. Object.keys(vueMethods).forEach(function (name) {
  2088. var matches = name.match(WORKLET_RE);
  2089. if (matches) {
  2090. var workletName = matches[1];
  2091. mpMethods[name] = vueMethods[name];
  2092. mpMethods[workletName] = vueMethods[workletName];
  2093. }
  2094. });
  2095. }
  2096. }
  2097. var MPPage = Page;
  2098. var MPComponent = Component;
  2099. var customizeRE = /:/g;
  2100. var customize = cached(function (str) {
  2101. return camelize(str.replace(customizeRE, '-'));
  2102. });
  2103. function initTriggerEvent(mpInstance) {
  2104. var oldTriggerEvent = mpInstance.triggerEvent;
  2105. var newTriggerEvent = function newTriggerEvent(event) {
  2106. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2107. args[_key3 - 1] = arguments[_key3];
  2108. }
  2109. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2110. if (this.$vm || this.dataset && this.dataset.comType) {
  2111. event = customize(event);
  2112. } else {
  2113. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2114. var newEvent = customize(event);
  2115. if (newEvent !== event) {
  2116. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2117. }
  2118. }
  2119. return oldTriggerEvent.apply(this, [event].concat(args));
  2120. };
  2121. try {
  2122. // 京东小程序 triggerEvent 为只读
  2123. mpInstance.triggerEvent = newTriggerEvent;
  2124. } catch (error) {
  2125. mpInstance._triggerEvent = newTriggerEvent;
  2126. }
  2127. }
  2128. function initHook(name, options, isComponent) {
  2129. var oldHook = options[name];
  2130. options[name] = function () {
  2131. markMPComponent(this);
  2132. initTriggerEvent(this);
  2133. if (oldHook) {
  2134. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2135. args[_key4] = arguments[_key4];
  2136. }
  2137. return oldHook.apply(this, args);
  2138. }
  2139. };
  2140. }
  2141. if (!MPPage.__$wrappered) {
  2142. MPPage.__$wrappered = true;
  2143. Page = function Page() {
  2144. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2145. initHook('onLoad', options);
  2146. return MPPage(options);
  2147. };
  2148. Page.after = MPPage.after;
  2149. Component = function Component() {
  2150. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2151. initHook('created', options);
  2152. return MPComponent(options);
  2153. };
  2154. }
  2155. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2156. function initMocks(vm, mocks) {
  2157. var mpInstance = vm.$mp[vm.mpType];
  2158. mocks.forEach(function (mock) {
  2159. if (hasOwn(mpInstance, mock)) {
  2160. vm[mock] = mpInstance[mock];
  2161. }
  2162. });
  2163. }
  2164. function hasHook(hook, vueOptions) {
  2165. if (!vueOptions) {
  2166. return true;
  2167. }
  2168. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2169. return true;
  2170. }
  2171. vueOptions = vueOptions.default || vueOptions;
  2172. if (isFn(vueOptions)) {
  2173. if (isFn(vueOptions.extendOptions[hook])) {
  2174. return true;
  2175. }
  2176. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2177. return true;
  2178. }
  2179. return false;
  2180. }
  2181. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2182. return true;
  2183. }
  2184. var mixins = vueOptions.mixins;
  2185. if (Array.isArray(mixins)) {
  2186. return !!mixins.find(function (mixin) {
  2187. return hasHook(hook, mixin);
  2188. });
  2189. }
  2190. }
  2191. function initHooks(mpOptions, hooks, vueOptions) {
  2192. hooks.forEach(function (hook) {
  2193. if (hasHook(hook, vueOptions)) {
  2194. mpOptions[hook] = function (args) {
  2195. return this.$vm && this.$vm.__call_hook(hook, args);
  2196. };
  2197. }
  2198. });
  2199. }
  2200. function initUnknownHooks(mpOptions, vueOptions) {
  2201. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2202. findHooks(vueOptions).forEach(function (hook) {
  2203. return initHook$1(mpOptions, hook, excludes);
  2204. });
  2205. }
  2206. function findHooks(vueOptions) {
  2207. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2208. if (vueOptions) {
  2209. Object.keys(vueOptions).forEach(function (name) {
  2210. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2211. hooks.push(name);
  2212. }
  2213. });
  2214. }
  2215. return hooks;
  2216. }
  2217. function initHook$1(mpOptions, hook, excludes) {
  2218. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2219. mpOptions[hook] = function (args) {
  2220. return this.$vm && this.$vm.__call_hook(hook, args);
  2221. };
  2222. }
  2223. }
  2224. function initVueComponent(Vue, vueOptions) {
  2225. vueOptions = vueOptions.default || vueOptions;
  2226. var VueComponent;
  2227. if (isFn(vueOptions)) {
  2228. VueComponent = vueOptions;
  2229. } else {
  2230. VueComponent = Vue.extend(vueOptions);
  2231. }
  2232. vueOptions = VueComponent.options;
  2233. return [VueComponent, vueOptions];
  2234. }
  2235. function initSlots(vm, vueSlots) {
  2236. if (Array.isArray(vueSlots) && vueSlots.length) {
  2237. var $slots = Object.create(null);
  2238. vueSlots.forEach(function (slotName) {
  2239. $slots[slotName] = true;
  2240. });
  2241. vm.$scopedSlots = vm.$slots = $slots;
  2242. }
  2243. }
  2244. function initVueIds(vueIds, mpInstance) {
  2245. vueIds = (vueIds || '').split(',');
  2246. var len = vueIds.length;
  2247. if (len === 1) {
  2248. mpInstance._$vueId = vueIds[0];
  2249. } else if (len === 2) {
  2250. mpInstance._$vueId = vueIds[0];
  2251. mpInstance._$vuePid = vueIds[1];
  2252. }
  2253. }
  2254. function initData(vueOptions, context) {
  2255. var data = vueOptions.data || {};
  2256. var methods = vueOptions.methods || {};
  2257. if (typeof data === 'function') {
  2258. try {
  2259. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2260. } catch (e) {
  2261. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2262. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2263. }
  2264. }
  2265. } else {
  2266. try {
  2267. // 对 data 格式化
  2268. data = JSON.parse(JSON.stringify(data));
  2269. } catch (e) {}
  2270. }
  2271. if (!isPlainObject(data)) {
  2272. data = {};
  2273. }
  2274. Object.keys(methods).forEach(function (methodName) {
  2275. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2276. data[methodName] = methods[methodName];
  2277. }
  2278. });
  2279. return data;
  2280. }
  2281. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2282. function createObserver(name) {
  2283. return function observer(newVal, oldVal) {
  2284. if (this.$vm) {
  2285. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2286. }
  2287. };
  2288. }
  2289. function initBehaviors(vueOptions, initBehavior) {
  2290. var vueBehaviors = vueOptions.behaviors;
  2291. var vueExtends = vueOptions.extends;
  2292. var vueMixins = vueOptions.mixins;
  2293. var vueProps = vueOptions.props;
  2294. if (!vueProps) {
  2295. vueOptions.props = vueProps = [];
  2296. }
  2297. var behaviors = [];
  2298. if (Array.isArray(vueBehaviors)) {
  2299. vueBehaviors.forEach(function (behavior) {
  2300. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2301. if (behavior === 'uni://form-field') {
  2302. if (Array.isArray(vueProps)) {
  2303. vueProps.push('name');
  2304. vueProps.push('value');
  2305. } else {
  2306. vueProps.name = {
  2307. type: String,
  2308. default: ''
  2309. };
  2310. vueProps.value = {
  2311. type: [String, Number, Boolean, Array, Object, Date],
  2312. default: ''
  2313. };
  2314. }
  2315. }
  2316. });
  2317. }
  2318. if (isPlainObject(vueExtends) && vueExtends.props) {
  2319. behaviors.push(initBehavior({
  2320. properties: initProperties(vueExtends.props, true)
  2321. }));
  2322. }
  2323. if (Array.isArray(vueMixins)) {
  2324. vueMixins.forEach(function (vueMixin) {
  2325. if (isPlainObject(vueMixin) && vueMixin.props) {
  2326. behaviors.push(initBehavior({
  2327. properties: initProperties(vueMixin.props, true)
  2328. }));
  2329. }
  2330. });
  2331. }
  2332. return behaviors;
  2333. }
  2334. function parsePropType(key, type, defaultValue, file) {
  2335. // [String]=>String
  2336. if (Array.isArray(type) && type.length === 1) {
  2337. return type[0];
  2338. }
  2339. return type;
  2340. }
  2341. function initProperties(props) {
  2342. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2343. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2344. var options = arguments.length > 3 ? arguments[3] : undefined;
  2345. var properties = {};
  2346. if (!isBehavior) {
  2347. properties.vueId = {
  2348. type: String,
  2349. value: ''
  2350. };
  2351. {
  2352. if (options.virtualHost) {
  2353. properties.virtualHostStyle = {
  2354. type: null,
  2355. value: ''
  2356. };
  2357. properties.virtualHostClass = {
  2358. type: null,
  2359. value: ''
  2360. };
  2361. }
  2362. }
  2363. // scopedSlotsCompiler auto
  2364. properties.scopedSlotsCompiler = {
  2365. type: String,
  2366. value: ''
  2367. };
  2368. properties.vueSlots = {
  2369. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2370. type: null,
  2371. value: [],
  2372. observer: function observer(newVal, oldVal) {
  2373. var $slots = Object.create(null);
  2374. newVal.forEach(function (slotName) {
  2375. $slots[slotName] = true;
  2376. });
  2377. this.setData({
  2378. $slots: $slots
  2379. });
  2380. }
  2381. };
  2382. }
  2383. if (Array.isArray(props)) {
  2384. // ['title']
  2385. props.forEach(function (key) {
  2386. properties[key] = {
  2387. type: null,
  2388. observer: createObserver(key)
  2389. };
  2390. });
  2391. } else if (isPlainObject(props)) {
  2392. // {title:{type:String,default:''},content:String}
  2393. Object.keys(props).forEach(function (key) {
  2394. var opts = props[key];
  2395. if (isPlainObject(opts)) {
  2396. // title:{type:String,default:''}
  2397. var value = opts.default;
  2398. if (isFn(value)) {
  2399. value = value();
  2400. }
  2401. opts.type = parsePropType(key, opts.type);
  2402. properties[key] = {
  2403. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2404. value: value,
  2405. observer: createObserver(key)
  2406. };
  2407. } else {
  2408. // content:String
  2409. var type = parsePropType(key, opts);
  2410. properties[key] = {
  2411. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2412. observer: createObserver(key)
  2413. };
  2414. }
  2415. });
  2416. }
  2417. return properties;
  2418. }
  2419. function wrapper$1(event) {
  2420. // TODO 又得兼容 mpvue 的 mp 对象
  2421. try {
  2422. event.mp = JSON.parse(JSON.stringify(event));
  2423. } catch (e) {}
  2424. event.stopPropagation = noop;
  2425. event.preventDefault = noop;
  2426. event.target = event.target || {};
  2427. if (!hasOwn(event, 'detail')) {
  2428. event.detail = {};
  2429. }
  2430. if (hasOwn(event, 'markerId')) {
  2431. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2432. event.detail.markerId = event.markerId;
  2433. }
  2434. if (isPlainObject(event.detail)) {
  2435. event.target = Object.assign({}, event.target, event.detail);
  2436. }
  2437. return event;
  2438. }
  2439. function getExtraValue(vm, dataPathsArray) {
  2440. var context = vm;
  2441. dataPathsArray.forEach(function (dataPathArray) {
  2442. var dataPath = dataPathArray[0];
  2443. var value = dataPathArray[2];
  2444. if (dataPath || typeof value !== 'undefined') {
  2445. // ['','',index,'disable']
  2446. var propPath = dataPathArray[1];
  2447. var valuePath = dataPathArray[3];
  2448. var vFor;
  2449. if (Number.isInteger(dataPath)) {
  2450. vFor = dataPath;
  2451. } else if (!dataPath) {
  2452. vFor = context;
  2453. } else if (typeof dataPath === 'string' && dataPath) {
  2454. if (dataPath.indexOf('#s#') === 0) {
  2455. vFor = dataPath.substr(3);
  2456. } else {
  2457. vFor = vm.__get_value(dataPath, context);
  2458. }
  2459. }
  2460. if (Number.isInteger(vFor)) {
  2461. context = value;
  2462. } else if (!propPath) {
  2463. context = vFor[value];
  2464. } else {
  2465. if (Array.isArray(vFor)) {
  2466. context = vFor.find(function (vForItem) {
  2467. return vm.__get_value(propPath, vForItem) === value;
  2468. });
  2469. } else if (isPlainObject(vFor)) {
  2470. context = Object.keys(vFor).find(function (vForKey) {
  2471. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2472. });
  2473. } else {
  2474. console.error('v-for 暂不支持循环数据:', vFor);
  2475. }
  2476. }
  2477. if (valuePath) {
  2478. context = vm.__get_value(valuePath, context);
  2479. }
  2480. }
  2481. });
  2482. return context;
  2483. }
  2484. function processEventExtra(vm, extra, event, __args__) {
  2485. var extraObj = {};
  2486. if (Array.isArray(extra) && extra.length) {
  2487. /**
  2488. *[
  2489. * ['data.items', 'data.id', item.data.id],
  2490. * ['metas', 'id', meta.id]
  2491. *],
  2492. *[
  2493. * ['data.items', 'data.id', item.data.id],
  2494. * ['metas', 'id', meta.id]
  2495. *],
  2496. *'test'
  2497. */
  2498. extra.forEach(function (dataPath, index) {
  2499. if (typeof dataPath === 'string') {
  2500. if (!dataPath) {
  2501. // model,prop.sync
  2502. extraObj['$' + index] = vm;
  2503. } else {
  2504. if (dataPath === '$event') {
  2505. // $event
  2506. extraObj['$' + index] = event;
  2507. } else if (dataPath === 'arguments') {
  2508. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2509. } else if (dataPath.indexOf('$event.') === 0) {
  2510. // $event.target.value
  2511. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2512. } else {
  2513. extraObj['$' + index] = vm.__get_value(dataPath);
  2514. }
  2515. }
  2516. } else {
  2517. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2518. }
  2519. });
  2520. }
  2521. return extraObj;
  2522. }
  2523. function getObjByArray(arr) {
  2524. var obj = {};
  2525. for (var i = 1; i < arr.length; i++) {
  2526. var element = arr[i];
  2527. obj[element[0]] = element[1];
  2528. }
  2529. return obj;
  2530. }
  2531. function processEventArgs(vm, event) {
  2532. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2533. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2534. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2535. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2536. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2537. // fixed 用户直接触发 mpInstance.triggerEvent
  2538. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2539. if (isCustom) {
  2540. // 自定义事件
  2541. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2542. if (!args.length) {
  2543. // 无参数,直接传入 event 或 detail 数组
  2544. if (isCustomMPEvent) {
  2545. return [event];
  2546. }
  2547. return __args__;
  2548. }
  2549. }
  2550. var extraObj = processEventExtra(vm, extra, event, __args__);
  2551. var ret = [];
  2552. args.forEach(function (arg) {
  2553. if (arg === '$event') {
  2554. if (methodName === '__set_model' && !isCustom) {
  2555. // input v-model value
  2556. ret.push(event.target.value);
  2557. } else {
  2558. if (isCustom && !isCustomMPEvent) {
  2559. ret.push(__args__[0]);
  2560. } else {
  2561. // wxcomponent 组件或内置组件
  2562. ret.push(event);
  2563. }
  2564. }
  2565. } else {
  2566. if (Array.isArray(arg) && arg[0] === 'o') {
  2567. ret.push(getObjByArray(arg));
  2568. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2569. ret.push(extraObj[arg]);
  2570. } else {
  2571. ret.push(arg);
  2572. }
  2573. }
  2574. });
  2575. return ret;
  2576. }
  2577. var ONCE = '~';
  2578. var CUSTOM = '^';
  2579. function isMatchEventType(eventType, optType) {
  2580. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2581. }
  2582. function getContextVm(vm) {
  2583. var $parent = vm.$parent;
  2584. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2585. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2586. $parent = $parent.$parent;
  2587. }
  2588. return $parent && $parent.$parent;
  2589. }
  2590. function handleEvent(event) {
  2591. var _this2 = this;
  2592. event = wrapper$1(event);
  2593. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2594. var dataset = (event.currentTarget || event.target).dataset;
  2595. if (!dataset) {
  2596. return console.warn('事件信息不存在');
  2597. }
  2598. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2599. if (!eventOpts) {
  2600. return console.warn('事件信息不存在');
  2601. }
  2602. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2603. var eventType = event.type;
  2604. var ret = [];
  2605. eventOpts.forEach(function (eventOpt) {
  2606. var type = eventOpt[0];
  2607. var eventsArray = eventOpt[1];
  2608. var isCustom = type.charAt(0) === CUSTOM;
  2609. type = isCustom ? type.slice(1) : type;
  2610. var isOnce = type.charAt(0) === ONCE;
  2611. type = isOnce ? type.slice(1) : type;
  2612. if (eventsArray && isMatchEventType(eventType, type)) {
  2613. eventsArray.forEach(function (eventArray) {
  2614. var methodName = eventArray[0];
  2615. if (methodName) {
  2616. var handlerCtx = _this2.$vm;
  2617. if (handlerCtx.$options.generic) {
  2618. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2619. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2620. }
  2621. if (methodName === '$emit') {
  2622. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2623. return;
  2624. }
  2625. var handler = handlerCtx[methodName];
  2626. if (!isFn(handler)) {
  2627. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2628. var path = _this2.route || _this2.is;
  2629. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2630. }
  2631. if (isOnce) {
  2632. if (handler.once) {
  2633. return;
  2634. }
  2635. handler.once = true;
  2636. }
  2637. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2638. params = Array.isArray(params) ? params : [];
  2639. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2640. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2641. // eslint-disable-next-line no-sparse-arrays
  2642. params = params.concat([,,,,,,,,,, event]);
  2643. }
  2644. ret.push(handler.apply(handlerCtx, params));
  2645. }
  2646. });
  2647. }
  2648. });
  2649. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2650. return ret[0];
  2651. }
  2652. }
  2653. var eventChannels = {};
  2654. function getEventChannel(id) {
  2655. var eventChannel = eventChannels[id];
  2656. delete eventChannels[id];
  2657. return eventChannel;
  2658. }
  2659. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2660. function initEventChannel() {
  2661. _vue.default.prototype.getOpenerEventChannel = function () {
  2662. // 微信小程序使用自身getOpenerEventChannel
  2663. {
  2664. return this.$scope.getOpenerEventChannel();
  2665. }
  2666. };
  2667. var callHook = _vue.default.prototype.__call_hook;
  2668. _vue.default.prototype.__call_hook = function (hook, args) {
  2669. if (hook === 'onLoad' && args && args.__id__) {
  2670. this.__eventChannel__ = getEventChannel(args.__id__);
  2671. delete args.__id__;
  2672. }
  2673. return callHook.call(this, hook, args);
  2674. };
  2675. }
  2676. function initScopedSlotsParams() {
  2677. var center = {};
  2678. var parents = {};
  2679. function currentId(fn) {
  2680. var vueIds = this.$options.propsData.vueId;
  2681. if (vueIds) {
  2682. var vueId = vueIds.split(',')[0];
  2683. fn(vueId);
  2684. }
  2685. }
  2686. _vue.default.prototype.$hasSSP = function (vueId) {
  2687. var slot = center[vueId];
  2688. if (!slot) {
  2689. parents[vueId] = this;
  2690. this.$on('hook:destroyed', function () {
  2691. delete parents[vueId];
  2692. });
  2693. }
  2694. return slot;
  2695. };
  2696. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2697. var slot = center[vueId];
  2698. if (slot) {
  2699. var params = slot[name] || [];
  2700. if (needAll) {
  2701. return params;
  2702. }
  2703. return params[0];
  2704. }
  2705. };
  2706. _vue.default.prototype.$setSSP = function (name, value) {
  2707. var index = 0;
  2708. currentId.call(this, function (vueId) {
  2709. var slot = center[vueId];
  2710. var params = slot[name] = slot[name] || [];
  2711. params.push(value);
  2712. index = params.length - 1;
  2713. });
  2714. return index;
  2715. };
  2716. _vue.default.prototype.$initSSP = function () {
  2717. currentId.call(this, function (vueId) {
  2718. center[vueId] = {};
  2719. });
  2720. };
  2721. _vue.default.prototype.$callSSP = function () {
  2722. currentId.call(this, function (vueId) {
  2723. if (parents[vueId]) {
  2724. parents[vueId].$forceUpdate();
  2725. }
  2726. });
  2727. };
  2728. _vue.default.mixin({
  2729. destroyed: function destroyed() {
  2730. var propsData = this.$options.propsData;
  2731. var vueId = propsData && propsData.vueId;
  2732. if (vueId) {
  2733. delete center[vueId];
  2734. delete parents[vueId];
  2735. }
  2736. }
  2737. });
  2738. }
  2739. function parseBaseApp(vm, _ref4) {
  2740. var mocks = _ref4.mocks,
  2741. initRefs = _ref4.initRefs;
  2742. initEventChannel();
  2743. {
  2744. initScopedSlotsParams();
  2745. }
  2746. if (vm.$options.store) {
  2747. _vue.default.prototype.$store = vm.$options.store;
  2748. }
  2749. uniIdMixin(_vue.default);
  2750. _vue.default.prototype.mpHost = "mp-weixin";
  2751. _vue.default.mixin({
  2752. beforeCreate: function beforeCreate() {
  2753. if (!this.$options.mpType) {
  2754. return;
  2755. }
  2756. this.mpType = this.$options.mpType;
  2757. this.$mp = (0, _defineProperty2.default)({
  2758. data: {}
  2759. }, this.mpType, this.$options.mpInstance);
  2760. this.$scope = this.$options.mpInstance;
  2761. delete this.$options.mpType;
  2762. delete this.$options.mpInstance;
  2763. if (this.mpType === 'page' && typeof getApp === 'function') {
  2764. // hack vue-i18n
  2765. var app = getApp();
  2766. if (app.$vm && app.$vm.$i18n) {
  2767. this._i18n = app.$vm.$i18n;
  2768. }
  2769. }
  2770. if (this.mpType !== 'app') {
  2771. initRefs(this);
  2772. initMocks(this, mocks);
  2773. }
  2774. }
  2775. });
  2776. var appOptions = {
  2777. onLaunch: function onLaunch(args) {
  2778. if (this.$vm) {
  2779. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2780. return;
  2781. }
  2782. {
  2783. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2784. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2785. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2786. }
  2787. }
  2788. this.$vm = vm;
  2789. this.$vm.$mp = {
  2790. app: this
  2791. };
  2792. this.$vm.$scope = this;
  2793. // vm 上也挂载 globalData
  2794. this.$vm.globalData = this.globalData;
  2795. this.$vm._isMounted = true;
  2796. this.$vm.__call_hook('mounted', args);
  2797. this.$vm.__call_hook('onLaunch', args);
  2798. }
  2799. };
  2800. // 兼容旧版本 globalData
  2801. appOptions.globalData = vm.$options.globalData || {};
  2802. // 将 methods 中的方法挂在 getApp() 中
  2803. var methods = vm.$options.methods;
  2804. if (methods) {
  2805. Object.keys(methods).forEach(function (name) {
  2806. appOptions[name] = methods[name];
  2807. });
  2808. }
  2809. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2810. initHooks(appOptions, hooks);
  2811. initUnknownHooks(appOptions, vm.$options);
  2812. return appOptions;
  2813. }
  2814. function parseApp(vm) {
  2815. return parseBaseApp(vm, {
  2816. mocks: mocks,
  2817. initRefs: initRefs
  2818. });
  2819. }
  2820. function createApp(vm) {
  2821. App(parseApp(vm));
  2822. return vm;
  2823. }
  2824. var encodeReserveRE = /[!'()*]/g;
  2825. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2826. return '%' + c.charCodeAt(0).toString(16);
  2827. };
  2828. var commaRE = /%2C/g;
  2829. // fixed encodeURIComponent which is more conformant to RFC3986:
  2830. // - escapes [!'()*]
  2831. // - preserve commas
  2832. var encode = function encode(str) {
  2833. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2834. };
  2835. function stringifyQuery(obj) {
  2836. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2837. var res = obj ? Object.keys(obj).map(function (key) {
  2838. var val = obj[key];
  2839. if (val === undefined) {
  2840. return '';
  2841. }
  2842. if (val === null) {
  2843. return encodeStr(key);
  2844. }
  2845. if (Array.isArray(val)) {
  2846. var result = [];
  2847. val.forEach(function (val2) {
  2848. if (val2 === undefined) {
  2849. return;
  2850. }
  2851. if (val2 === null) {
  2852. result.push(encodeStr(key));
  2853. } else {
  2854. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2855. }
  2856. });
  2857. return result.join('&');
  2858. }
  2859. return encodeStr(key) + '=' + encodeStr(val);
  2860. }).filter(function (x) {
  2861. return x.length > 0;
  2862. }).join('&') : null;
  2863. return res ? "?".concat(res) : '';
  2864. }
  2865. function parseBaseComponent(vueComponentOptions) {
  2866. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2867. isPage = _ref5.isPage,
  2868. initRelation = _ref5.initRelation;
  2869. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2870. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2871. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2872. VueComponent = _initVueComponent2[0],
  2873. vueOptions = _initVueComponent2[1];
  2874. var options = _objectSpread({
  2875. multipleSlots: true,
  2876. // styleIsolation: 'apply-shared',
  2877. addGlobalClass: true
  2878. }, vueOptions.options || {});
  2879. {
  2880. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2881. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2882. Object.assign(options, vueOptions['mp-weixin'].options);
  2883. }
  2884. }
  2885. var componentOptions = {
  2886. options: options,
  2887. data: initData(vueOptions, _vue.default.prototype),
  2888. behaviors: initBehaviors(vueOptions, initBehavior),
  2889. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2890. lifetimes: {
  2891. attached: function attached() {
  2892. var properties = this.properties;
  2893. var options = {
  2894. mpType: isPage.call(this) ? 'page' : 'component',
  2895. mpInstance: this,
  2896. propsData: properties
  2897. };
  2898. initVueIds(properties.vueId, this);
  2899. // 处理父子关系
  2900. initRelation.call(this, {
  2901. vuePid: this._$vuePid,
  2902. vueOptions: options
  2903. });
  2904. // 初始化 vue 实例
  2905. this.$vm = new VueComponent(options);
  2906. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2907. initSlots(this.$vm, properties.vueSlots);
  2908. // 触发首次 setData
  2909. this.$vm.$mount();
  2910. },
  2911. ready: function ready() {
  2912. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2913. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2914. if (this.$vm) {
  2915. this.$vm._isMounted = true;
  2916. this.$vm.__call_hook('mounted');
  2917. this.$vm.__call_hook('onReady');
  2918. }
  2919. },
  2920. detached: function detached() {
  2921. this.$vm && this.$vm.$destroy();
  2922. }
  2923. },
  2924. pageLifetimes: {
  2925. show: function show(args) {
  2926. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2927. },
  2928. hide: function hide() {
  2929. this.$vm && this.$vm.__call_hook('onPageHide');
  2930. },
  2931. resize: function resize(size) {
  2932. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2933. }
  2934. },
  2935. methods: {
  2936. __l: handleLink,
  2937. __e: handleEvent
  2938. }
  2939. };
  2940. // externalClasses
  2941. if (vueOptions.externalClasses) {
  2942. componentOptions.externalClasses = vueOptions.externalClasses;
  2943. }
  2944. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2945. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2946. componentOptions.methods[callMethod] = function (args) {
  2947. return this.$vm[callMethod](args);
  2948. };
  2949. });
  2950. }
  2951. if (needVueOptions) {
  2952. return [componentOptions, vueOptions, VueComponent];
  2953. }
  2954. if (isPage) {
  2955. return componentOptions;
  2956. }
  2957. return [componentOptions, VueComponent];
  2958. }
  2959. function parseComponent(vueComponentOptions, needVueOptions) {
  2960. return parseBaseComponent(vueComponentOptions, {
  2961. isPage: isPage,
  2962. initRelation: initRelation
  2963. }, needVueOptions);
  2964. }
  2965. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2966. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2967. function parseBasePage(vuePageOptions) {
  2968. var _parseComponent = parseComponent(vuePageOptions, true),
  2969. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2970. pageOptions = _parseComponent2[0],
  2971. vueOptions = _parseComponent2[1];
  2972. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2973. pageOptions.methods.onLoad = function (query) {
  2974. this.options = query;
  2975. var copyQuery = Object.assign({}, query);
  2976. delete copyQuery.__id__;
  2977. this.$page = {
  2978. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2979. };
  2980. this.$vm.$mp.query = query; // 兼容 mpvue
  2981. this.$vm.__call_hook('onLoad', query);
  2982. };
  2983. {
  2984. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2985. }
  2986. {
  2987. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2988. }
  2989. return pageOptions;
  2990. }
  2991. function parsePage(vuePageOptions) {
  2992. return parseBasePage(vuePageOptions);
  2993. }
  2994. function createPage(vuePageOptions) {
  2995. {
  2996. return Component(parsePage(vuePageOptions));
  2997. }
  2998. }
  2999. function createComponent(vueOptions) {
  3000. {
  3001. return Component(parseComponent(vueOptions));
  3002. }
  3003. }
  3004. function createSubpackageApp(vm) {
  3005. var appOptions = parseApp(vm);
  3006. var app = getApp({
  3007. allowDefault: true
  3008. });
  3009. vm.$scope = app;
  3010. var globalData = app.globalData;
  3011. if (globalData) {
  3012. Object.keys(appOptions.globalData).forEach(function (name) {
  3013. if (!hasOwn(globalData, name)) {
  3014. globalData[name] = appOptions.globalData[name];
  3015. }
  3016. });
  3017. }
  3018. Object.keys(appOptions).forEach(function (name) {
  3019. if (!hasOwn(app, name)) {
  3020. app[name] = appOptions[name];
  3021. }
  3022. });
  3023. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3024. wx.onAppShow(function () {
  3025. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3026. args[_key5] = arguments[_key5];
  3027. }
  3028. vm.__call_hook('onShow', args);
  3029. });
  3030. }
  3031. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3032. wx.onAppHide(function () {
  3033. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3034. args[_key6] = arguments[_key6];
  3035. }
  3036. vm.__call_hook('onHide', args);
  3037. });
  3038. }
  3039. if (isFn(appOptions.onLaunch)) {
  3040. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3041. vm.__call_hook('onLaunch', args);
  3042. }
  3043. return vm;
  3044. }
  3045. function createPlugin(vm) {
  3046. var appOptions = parseApp(vm);
  3047. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3048. wx.onAppShow(function () {
  3049. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3050. args[_key7] = arguments[_key7];
  3051. }
  3052. vm.__call_hook('onShow', args);
  3053. });
  3054. }
  3055. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3056. wx.onAppHide(function () {
  3057. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3058. args[_key8] = arguments[_key8];
  3059. }
  3060. vm.__call_hook('onHide', args);
  3061. });
  3062. }
  3063. if (isFn(appOptions.onLaunch)) {
  3064. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3065. vm.__call_hook('onLaunch', args);
  3066. }
  3067. return vm;
  3068. }
  3069. todos.forEach(function (todoApi) {
  3070. protocols[todoApi] = false;
  3071. });
  3072. canIUses.forEach(function (canIUseApi) {
  3073. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3074. if (!wx.canIUse(apiName)) {
  3075. protocols[canIUseApi] = false;
  3076. }
  3077. });
  3078. var uni = {};
  3079. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3080. uni = new Proxy({}, {
  3081. get: function get(target, name) {
  3082. if (hasOwn(target, name)) {
  3083. return target[name];
  3084. }
  3085. if (baseApi[name]) {
  3086. return baseApi[name];
  3087. }
  3088. if (api[name]) {
  3089. return promisify(name, api[name]);
  3090. }
  3091. {
  3092. if (extraApi[name]) {
  3093. return promisify(name, extraApi[name]);
  3094. }
  3095. if (todoApis[name]) {
  3096. return promisify(name, todoApis[name]);
  3097. }
  3098. }
  3099. if (eventApi[name]) {
  3100. return eventApi[name];
  3101. }
  3102. return promisify(name, wrapper(name, wx[name]));
  3103. },
  3104. set: function set(target, name, value) {
  3105. target[name] = value;
  3106. return true;
  3107. }
  3108. });
  3109. } else {
  3110. Object.keys(baseApi).forEach(function (name) {
  3111. uni[name] = baseApi[name];
  3112. });
  3113. {
  3114. Object.keys(todoApis).forEach(function (name) {
  3115. uni[name] = promisify(name, todoApis[name]);
  3116. });
  3117. Object.keys(extraApi).forEach(function (name) {
  3118. uni[name] = promisify(name, extraApi[name]);
  3119. });
  3120. }
  3121. Object.keys(eventApi).forEach(function (name) {
  3122. uni[name] = eventApi[name];
  3123. });
  3124. Object.keys(api).forEach(function (name) {
  3125. uni[name] = promisify(name, api[name]);
  3126. });
  3127. Object.keys(wx).forEach(function (name) {
  3128. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3129. uni[name] = promisify(name, wrapper(name, wx[name]));
  3130. }
  3131. });
  3132. }
  3133. wx.createApp = createApp;
  3134. wx.createPage = createPage;
  3135. wx.createComponent = createComponent;
  3136. wx.createSubpackageApp = createSubpackageApp;
  3137. wx.createPlugin = createPlugin;
  3138. var uni$1 = uni;
  3139. var _default = uni$1;
  3140. exports.default = _default;
  3141. /* 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)))
  3142. /***/ }),
  3143. /***/ 20:
  3144. /*!****************************************************************!*\
  3145. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3146. \****************************************************************/
  3147. /*! no static exports found */
  3148. /***/ (function(module, exports) {
  3149. function _iterableToArray(iter) {
  3150. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3151. }
  3152. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3153. /***/ }),
  3154. /***/ 200:
  3155. /*!************************************************************************************************************!*\
  3156. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json ***!
  3157. \************************************************************************************************************/
  3158. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  3159. /***/ (function(module) {
  3160. module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"確定\",\"uni-popup.placeholder\":\"請輸入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
  3161. /***/ }),
  3162. /***/ 208:
  3163. /*!************************************************************************************************!*\
  3164. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  3165. \************************************************************************************************/
  3166. /*! no static exports found */
  3167. /***/ (function(module, exports, __webpack_require__) {
  3168. // TODO(Babel 8): Remove this file.
  3169. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 209)();
  3170. module.exports = runtime;
  3171. /***/ }),
  3172. /***/ 209:
  3173. /*!*******************************************************************!*\
  3174. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  3175. \*******************************************************************/
  3176. /*! no static exports found */
  3177. /***/ (function(module, exports, __webpack_require__) {
  3178. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  3179. function _regeneratorRuntime() {
  3180. "use strict";
  3181. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  3182. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  3183. return e;
  3184. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3185. var t,
  3186. e = {},
  3187. r = Object.prototype,
  3188. n = r.hasOwnProperty,
  3189. o = Object.defineProperty || function (t, e, r) {
  3190. t[e] = r.value;
  3191. },
  3192. i = "function" == typeof Symbol ? Symbol : {},
  3193. a = i.iterator || "@@iterator",
  3194. c = i.asyncIterator || "@@asyncIterator",
  3195. u = i.toStringTag || "@@toStringTag";
  3196. function define(t, e, r) {
  3197. return Object.defineProperty(t, e, {
  3198. value: r,
  3199. enumerable: !0,
  3200. configurable: !0,
  3201. writable: !0
  3202. }), t[e];
  3203. }
  3204. try {
  3205. define({}, "");
  3206. } catch (t) {
  3207. define = function define(t, e, r) {
  3208. return t[e] = r;
  3209. };
  3210. }
  3211. function wrap(t, e, r, n) {
  3212. var i = e && e.prototype instanceof Generator ? e : Generator,
  3213. a = Object.create(i.prototype),
  3214. c = new Context(n || []);
  3215. return o(a, "_invoke", {
  3216. value: makeInvokeMethod(t, r, c)
  3217. }), a;
  3218. }
  3219. function tryCatch(t, e, r) {
  3220. try {
  3221. return {
  3222. type: "normal",
  3223. arg: t.call(e, r)
  3224. };
  3225. } catch (t) {
  3226. return {
  3227. type: "throw",
  3228. arg: t
  3229. };
  3230. }
  3231. }
  3232. e.wrap = wrap;
  3233. var h = "suspendedStart",
  3234. l = "suspendedYield",
  3235. f = "executing",
  3236. s = "completed",
  3237. y = {};
  3238. function Generator() {}
  3239. function GeneratorFunction() {}
  3240. function GeneratorFunctionPrototype() {}
  3241. var p = {};
  3242. define(p, a, function () {
  3243. return this;
  3244. });
  3245. var d = Object.getPrototypeOf,
  3246. v = d && d(d(values([])));
  3247. v && v !== r && n.call(v, a) && (p = v);
  3248. var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
  3249. function defineIteratorMethods(t) {
  3250. ["next", "throw", "return"].forEach(function (e) {
  3251. define(t, e, function (t) {
  3252. return this._invoke(e, t);
  3253. });
  3254. });
  3255. }
  3256. function AsyncIterator(t, e) {
  3257. function invoke(r, o, i, a) {
  3258. var c = tryCatch(t[r], t, o);
  3259. if ("throw" !== c.type) {
  3260. var u = c.arg,
  3261. h = u.value;
  3262. return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
  3263. invoke("next", t, i, a);
  3264. }, function (t) {
  3265. invoke("throw", t, i, a);
  3266. }) : e.resolve(h).then(function (t) {
  3267. u.value = t, i(u);
  3268. }, function (t) {
  3269. return invoke("throw", t, i, a);
  3270. });
  3271. }
  3272. a(c.arg);
  3273. }
  3274. var r;
  3275. o(this, "_invoke", {
  3276. value: function value(t, n) {
  3277. function callInvokeWithMethodAndArg() {
  3278. return new e(function (e, r) {
  3279. invoke(t, n, e, r);
  3280. });
  3281. }
  3282. return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  3283. }
  3284. });
  3285. }
  3286. function makeInvokeMethod(e, r, n) {
  3287. var o = h;
  3288. return function (i, a) {
  3289. if (o === f) throw Error("Generator is already running");
  3290. if (o === s) {
  3291. if ("throw" === i) throw a;
  3292. return {
  3293. value: t,
  3294. done: !0
  3295. };
  3296. }
  3297. for (n.method = i, n.arg = a;;) {
  3298. var c = n.delegate;
  3299. if (c) {
  3300. var u = maybeInvokeDelegate(c, n);
  3301. if (u) {
  3302. if (u === y) continue;
  3303. return u;
  3304. }
  3305. }
  3306. if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
  3307. if (o === h) throw o = s, n.arg;
  3308. n.dispatchException(n.arg);
  3309. } else "return" === n.method && n.abrupt("return", n.arg);
  3310. o = f;
  3311. var p = tryCatch(e, r, n);
  3312. if ("normal" === p.type) {
  3313. if (o = n.done ? s : l, p.arg === y) continue;
  3314. return {
  3315. value: p.arg,
  3316. done: n.done
  3317. };
  3318. }
  3319. "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
  3320. }
  3321. };
  3322. }
  3323. function maybeInvokeDelegate(e, r) {
  3324. var n = r.method,
  3325. o = e.iterator[n];
  3326. if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
  3327. var i = tryCatch(o, e.iterator, r.arg);
  3328. if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
  3329. var a = i.arg;
  3330. return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
  3331. }
  3332. function pushTryEntry(t) {
  3333. var e = {
  3334. tryLoc: t[0]
  3335. };
  3336. 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
  3337. }
  3338. function resetTryEntry(t) {
  3339. var e = t.completion || {};
  3340. e.type = "normal", delete e.arg, t.completion = e;
  3341. }
  3342. function Context(t) {
  3343. this.tryEntries = [{
  3344. tryLoc: "root"
  3345. }], t.forEach(pushTryEntry, this), this.reset(!0);
  3346. }
  3347. function values(e) {
  3348. if (e || "" === e) {
  3349. var r = e[a];
  3350. if (r) return r.call(e);
  3351. if ("function" == typeof e.next) return e;
  3352. if (!isNaN(e.length)) {
  3353. var o = -1,
  3354. i = function next() {
  3355. for (; ++o < e.length;) {
  3356. if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
  3357. }
  3358. return next.value = t, next.done = !0, next;
  3359. };
  3360. return i.next = i;
  3361. }
  3362. }
  3363. throw new TypeError(_typeof(e) + " is not iterable");
  3364. }
  3365. return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
  3366. value: GeneratorFunctionPrototype,
  3367. configurable: !0
  3368. }), o(GeneratorFunctionPrototype, "constructor", {
  3369. value: GeneratorFunction,
  3370. configurable: !0
  3371. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
  3372. var e = "function" == typeof t && t.constructor;
  3373. return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
  3374. }, e.mark = function (t) {
  3375. return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
  3376. }, e.awrap = function (t) {
  3377. return {
  3378. __await: t
  3379. };
  3380. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
  3381. return this;
  3382. }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
  3383. void 0 === i && (i = Promise);
  3384. var a = new AsyncIterator(wrap(t, r, n, o), i);
  3385. return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
  3386. return t.done ? t.value : a.next();
  3387. });
  3388. }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
  3389. return this;
  3390. }), define(g, "toString", function () {
  3391. return "[object Generator]";
  3392. }), e.keys = function (t) {
  3393. var e = Object(t),
  3394. r = [];
  3395. for (var n in e) {
  3396. r.push(n);
  3397. }
  3398. return r.reverse(), function next() {
  3399. for (; r.length;) {
  3400. var t = r.pop();
  3401. if (t in e) return next.value = t, next.done = !1, next;
  3402. }
  3403. return next.done = !0, next;
  3404. };
  3405. }, e.values = values, Context.prototype = {
  3406. constructor: Context,
  3407. reset: function reset(e) {
  3408. if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) {
  3409. "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
  3410. }
  3411. },
  3412. stop: function stop() {
  3413. this.done = !0;
  3414. var t = this.tryEntries[0].completion;
  3415. if ("throw" === t.type) throw t.arg;
  3416. return this.rval;
  3417. },
  3418. dispatchException: function dispatchException(e) {
  3419. if (this.done) throw e;
  3420. var r = this;
  3421. function handle(n, o) {
  3422. return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
  3423. }
  3424. for (var o = this.tryEntries.length - 1; o >= 0; --o) {
  3425. var i = this.tryEntries[o],
  3426. a = i.completion;
  3427. if ("root" === i.tryLoc) return handle("end");
  3428. if (i.tryLoc <= this.prev) {
  3429. var c = n.call(i, "catchLoc"),
  3430. u = n.call(i, "finallyLoc");
  3431. if (c && u) {
  3432. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  3433. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  3434. } else if (c) {
  3435. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  3436. } else {
  3437. if (!u) throw Error("try statement without catch or finally");
  3438. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  3439. }
  3440. }
  3441. }
  3442. },
  3443. abrupt: function abrupt(t, e) {
  3444. for (var r = this.tryEntries.length - 1; r >= 0; --r) {
  3445. var o = this.tryEntries[r];
  3446. if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
  3447. var i = o;
  3448. break;
  3449. }
  3450. }
  3451. i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
  3452. var a = i ? i.completion : {};
  3453. return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
  3454. },
  3455. complete: function complete(t, e) {
  3456. if ("throw" === t.type) throw t.arg;
  3457. return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
  3458. },
  3459. finish: function finish(t) {
  3460. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  3461. var r = this.tryEntries[e];
  3462. if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
  3463. }
  3464. },
  3465. "catch": function _catch(t) {
  3466. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  3467. var r = this.tryEntries[e];
  3468. if (r.tryLoc === t) {
  3469. var n = r.completion;
  3470. if ("throw" === n.type) {
  3471. var o = n.arg;
  3472. resetTryEntry(r);
  3473. }
  3474. return o;
  3475. }
  3476. }
  3477. throw Error("illegal catch attempt");
  3478. },
  3479. delegateYield: function delegateYield(e, r, n) {
  3480. return this.delegate = {
  3481. iterator: values(e),
  3482. resultName: r,
  3483. nextLoc: n
  3484. }, "next" === this.method && (this.arg = t), y;
  3485. }
  3486. }, e;
  3487. }
  3488. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3489. /***/ }),
  3490. /***/ 21:
  3491. /*!******************************************************************!*\
  3492. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3493. \******************************************************************/
  3494. /*! no static exports found */
  3495. /***/ (function(module, exports) {
  3496. function _nonIterableSpread() {
  3497. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3498. }
  3499. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3500. /***/ }),
  3501. /***/ 210:
  3502. /*!*****************************************************************!*\
  3503. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  3504. \*****************************************************************/
  3505. /*! no static exports found */
  3506. /***/ (function(module, exports) {
  3507. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  3508. try {
  3509. var info = gen[key](arg);
  3510. var value = info.value;
  3511. } catch (error) {
  3512. reject(error);
  3513. return;
  3514. }
  3515. if (info.done) {
  3516. resolve(value);
  3517. } else {
  3518. Promise.resolve(value).then(_next, _throw);
  3519. }
  3520. }
  3521. function _asyncToGenerator(fn) {
  3522. return function () {
  3523. var self = this,
  3524. args = arguments;
  3525. return new Promise(function (resolve, reject) {
  3526. var gen = fn.apply(self, args);
  3527. function _next(value) {
  3528. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  3529. }
  3530. function _throw(err) {
  3531. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  3532. }
  3533. _next(undefined);
  3534. });
  3535. };
  3536. }
  3537. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3538. /***/ }),
  3539. /***/ 211:
  3540. /*!******************************************************************************************************!*\
  3541. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  3542. \******************************************************************************************************/
  3543. /*! no static exports found */
  3544. /***/ (function(module, exports, __webpack_require__) {
  3545. "use strict";
  3546. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3547. Object.defineProperty(exports, "__esModule", {
  3548. value: true
  3549. });
  3550. exports.default = void 0;
  3551. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  3552. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 212));
  3553. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 213));
  3554. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 215));
  3555. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  3556. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3557. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3558. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3559. 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); }; }
  3560. 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; } }
  3561. var pattern = {
  3562. email: /^\S+?@\S+?\.\S+?$/,
  3563. 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]$/,
  3564. 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')
  3565. };
  3566. var FORMAT_MAPPING = {
  3567. "int": 'integer',
  3568. "bool": 'boolean',
  3569. "double": 'number',
  3570. "long": 'number',
  3571. "password": 'string'
  3572. // "fileurls": 'array'
  3573. };
  3574. function formatMessage(args) {
  3575. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  3576. var defaultMessage = ['label'];
  3577. defaultMessage.forEach(function (item) {
  3578. if (args[item] === undefined) {
  3579. args[item] = '';
  3580. }
  3581. });
  3582. var str = resources;
  3583. for (var key in args) {
  3584. var reg = new RegExp('{' + key + '}');
  3585. str = str.replace(reg, args[key]);
  3586. }
  3587. return str;
  3588. }
  3589. function isEmptyValue(value, type) {
  3590. if (value === undefined || value === null) {
  3591. return true;
  3592. }
  3593. if (typeof value === 'string' && !value) {
  3594. return true;
  3595. }
  3596. if (Array.isArray(value) && !value.length) {
  3597. return true;
  3598. }
  3599. if (type === 'object' && !Object.keys(value).length) {
  3600. return true;
  3601. }
  3602. return false;
  3603. }
  3604. var types = {
  3605. integer: function integer(value) {
  3606. return types.number(value) && parseInt(value, 10) === value;
  3607. },
  3608. string: function string(value) {
  3609. return typeof value === 'string';
  3610. },
  3611. number: function number(value) {
  3612. if (isNaN(value)) {
  3613. return false;
  3614. }
  3615. return typeof value === 'number';
  3616. },
  3617. "boolean": function boolean(value) {
  3618. return typeof value === 'boolean';
  3619. },
  3620. "float": function float(value) {
  3621. return types.number(value) && !types.integer(value);
  3622. },
  3623. array: function array(value) {
  3624. return Array.isArray(value);
  3625. },
  3626. object: function object(value) {
  3627. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  3628. },
  3629. date: function date(value) {
  3630. return value instanceof Date;
  3631. },
  3632. timestamp: function timestamp(value) {
  3633. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  3634. return false;
  3635. }
  3636. return true;
  3637. },
  3638. file: function file(value) {
  3639. return typeof value.url === 'string';
  3640. },
  3641. email: function email(value) {
  3642. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  3643. },
  3644. url: function url(value) {
  3645. return typeof value === 'string' && !!value.match(pattern.url);
  3646. },
  3647. pattern: function pattern(reg, value) {
  3648. try {
  3649. return new RegExp(reg).test(value);
  3650. } catch (e) {
  3651. return false;
  3652. }
  3653. },
  3654. method: function method(value) {
  3655. return typeof value === 'function';
  3656. },
  3657. idcard: function idcard(value) {
  3658. return typeof value === 'string' && !!value.match(pattern.idcard);
  3659. },
  3660. 'url-https': function urlHttps(value) {
  3661. return this.url(value) && value.startsWith('https://');
  3662. },
  3663. 'url-scheme': function urlScheme(value) {
  3664. return value.startsWith('://');
  3665. },
  3666. 'url-web': function urlWeb(value) {
  3667. return false;
  3668. }
  3669. };
  3670. var RuleValidator = /*#__PURE__*/function () {
  3671. function RuleValidator(message) {
  3672. (0, _classCallCheck2.default)(this, RuleValidator);
  3673. this._message = message;
  3674. }
  3675. (0, _createClass2.default)(RuleValidator, [{
  3676. key: "validateRule",
  3677. value: function () {
  3678. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  3679. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  3680. return _regenerator.default.wrap(function _callee$(_context) {
  3681. while (1) {
  3682. switch (_context.prev = _context.next) {
  3683. case 0:
  3684. result = null;
  3685. rules = fieldValue.rules;
  3686. hasRequired = rules.findIndex(function (item) {
  3687. return item.required;
  3688. });
  3689. if (!(hasRequired < 0)) {
  3690. _context.next = 8;
  3691. break;
  3692. }
  3693. if (!(value === null || value === undefined)) {
  3694. _context.next = 6;
  3695. break;
  3696. }
  3697. return _context.abrupt("return", result);
  3698. case 6:
  3699. if (!(typeof value === 'string' && !value.length)) {
  3700. _context.next = 8;
  3701. break;
  3702. }
  3703. return _context.abrupt("return", result);
  3704. case 8:
  3705. message = this._message;
  3706. if (!(rules === undefined)) {
  3707. _context.next = 11;
  3708. break;
  3709. }
  3710. return _context.abrupt("return", message['default']);
  3711. case 11:
  3712. i = 0;
  3713. case 12:
  3714. if (!(i < rules.length)) {
  3715. _context.next = 35;
  3716. break;
  3717. }
  3718. rule = rules[i];
  3719. vt = this._getValidateType(rule);
  3720. Object.assign(rule, {
  3721. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  3722. });
  3723. if (!RuleValidatorHelper[vt]) {
  3724. _context.next = 20;
  3725. break;
  3726. }
  3727. result = RuleValidatorHelper[vt](rule, value, message);
  3728. if (!(result != null)) {
  3729. _context.next = 20;
  3730. break;
  3731. }
  3732. return _context.abrupt("break", 35);
  3733. case 20:
  3734. if (!rule.validateExpr) {
  3735. _context.next = 26;
  3736. break;
  3737. }
  3738. now = Date.now();
  3739. resultExpr = rule.validateExpr(value, allData, now);
  3740. if (!(resultExpr === false)) {
  3741. _context.next = 26;
  3742. break;
  3743. }
  3744. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  3745. return _context.abrupt("break", 35);
  3746. case 26:
  3747. if (!rule.validateFunction) {
  3748. _context.next = 32;
  3749. break;
  3750. }
  3751. _context.next = 29;
  3752. return this.validateFunction(rule, value, data, allData, vt);
  3753. case 29:
  3754. result = _context.sent;
  3755. if (!(result !== null)) {
  3756. _context.next = 32;
  3757. break;
  3758. }
  3759. return _context.abrupt("break", 35);
  3760. case 32:
  3761. i++;
  3762. _context.next = 12;
  3763. break;
  3764. case 35:
  3765. if (result !== null) {
  3766. result = message.TAG + result;
  3767. }
  3768. return _context.abrupt("return", result);
  3769. case 37:
  3770. case "end":
  3771. return _context.stop();
  3772. }
  3773. }
  3774. }, _callee, this);
  3775. }));
  3776. function validateRule(_x, _x2, _x3, _x4, _x5) {
  3777. return _validateRule.apply(this, arguments);
  3778. }
  3779. return validateRule;
  3780. }()
  3781. }, {
  3782. key: "validateFunction",
  3783. value: function () {
  3784. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  3785. var result, callbackMessage, res;
  3786. return _regenerator.default.wrap(function _callee2$(_context2) {
  3787. while (1) {
  3788. switch (_context2.prev = _context2.next) {
  3789. case 0:
  3790. result = null;
  3791. _context2.prev = 1;
  3792. callbackMessage = null;
  3793. _context2.next = 5;
  3794. return rule.validateFunction(rule, value, allData || data, function (message) {
  3795. callbackMessage = message;
  3796. });
  3797. case 5:
  3798. res = _context2.sent;
  3799. if (callbackMessage || typeof res === 'string' && res || res === false) {
  3800. result = this._getMessage(rule, callbackMessage || res, vt);
  3801. }
  3802. _context2.next = 12;
  3803. break;
  3804. case 9:
  3805. _context2.prev = 9;
  3806. _context2.t0 = _context2["catch"](1);
  3807. result = this._getMessage(rule, _context2.t0.message, vt);
  3808. case 12:
  3809. return _context2.abrupt("return", result);
  3810. case 13:
  3811. case "end":
  3812. return _context2.stop();
  3813. }
  3814. }
  3815. }, _callee2, this, [[1, 9]]);
  3816. }));
  3817. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  3818. return _validateFunction.apply(this, arguments);
  3819. }
  3820. return validateFunction;
  3821. }()
  3822. }, {
  3823. key: "_getMessage",
  3824. value: function _getMessage(rule, message, vt) {
  3825. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  3826. }
  3827. }, {
  3828. key: "_getValidateType",
  3829. value: function _getValidateType(rule) {
  3830. var result = '';
  3831. if (rule.required) {
  3832. result = 'required';
  3833. } else if (rule.format) {
  3834. result = 'format';
  3835. } else if (rule.arrayType) {
  3836. result = 'arrayTypeFormat';
  3837. } else if (rule.range) {
  3838. result = 'range';
  3839. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  3840. result = 'rangeNumber';
  3841. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  3842. result = 'rangeLength';
  3843. } else if (rule.pattern) {
  3844. result = 'pattern';
  3845. } else if (rule.validateFunction) {
  3846. result = 'validateFunction';
  3847. }
  3848. return result;
  3849. }
  3850. }]);
  3851. return RuleValidator;
  3852. }();
  3853. var RuleValidatorHelper = {
  3854. required: function required(rule, value, message) {
  3855. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  3856. return formatMessage(rule, rule.errorMessage || message.required);
  3857. }
  3858. return null;
  3859. },
  3860. range: function range(rule, value, message) {
  3861. var range = rule.range,
  3862. errorMessage = rule.errorMessage;
  3863. var list = new Array(range.length);
  3864. for (var i = 0; i < range.length; i++) {
  3865. var item = range[i];
  3866. if (types.object(item) && item.value !== undefined) {
  3867. list[i] = item.value;
  3868. } else {
  3869. list[i] = item;
  3870. }
  3871. }
  3872. var result = false;
  3873. if (Array.isArray(value)) {
  3874. result = new Set(value.concat(list)).size === list.length;
  3875. } else {
  3876. if (list.indexOf(value) > -1) {
  3877. result = true;
  3878. }
  3879. }
  3880. if (!result) {
  3881. return formatMessage(rule, errorMessage || message['enum']);
  3882. }
  3883. return null;
  3884. },
  3885. rangeNumber: function rangeNumber(rule, value, message) {
  3886. if (!types.number(value)) {
  3887. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3888. }
  3889. var minimum = rule.minimum,
  3890. maximum = rule.maximum,
  3891. exclusiveMinimum = rule.exclusiveMinimum,
  3892. exclusiveMaximum = rule.exclusiveMaximum;
  3893. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  3894. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  3895. if (minimum !== undefined && min) {
  3896. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  3897. } else if (maximum !== undefined && max) {
  3898. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  3899. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  3900. return formatMessage(rule, rule.errorMessage || message['number'].range);
  3901. }
  3902. return null;
  3903. },
  3904. rangeLength: function rangeLength(rule, value, message) {
  3905. if (!types.string(value) && !types.array(value)) {
  3906. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3907. }
  3908. var min = rule.minLength;
  3909. var max = rule.maxLength;
  3910. var val = value.length;
  3911. if (min !== undefined && val < min) {
  3912. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  3913. } else if (max !== undefined && val > max) {
  3914. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  3915. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  3916. return formatMessage(rule, rule.errorMessage || message['length'].range);
  3917. }
  3918. return null;
  3919. },
  3920. pattern: function pattern(rule, value, message) {
  3921. if (!types['pattern'](rule.pattern, value)) {
  3922. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3923. }
  3924. return null;
  3925. },
  3926. format: function format(rule, value, message) {
  3927. var customTypes = Object.keys(types);
  3928. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  3929. if (customTypes.indexOf(format) > -1) {
  3930. if (!types[format](value)) {
  3931. return formatMessage(rule, rule.errorMessage || message.typeError);
  3932. }
  3933. }
  3934. return null;
  3935. },
  3936. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  3937. if (!Array.isArray(value)) {
  3938. return formatMessage(rule, rule.errorMessage || message.typeError);
  3939. }
  3940. for (var i = 0; i < value.length; i++) {
  3941. var element = value[i];
  3942. var formatResult = this.format(rule, element, message);
  3943. if (formatResult !== null) {
  3944. return formatResult;
  3945. }
  3946. }
  3947. return null;
  3948. }
  3949. };
  3950. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  3951. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  3952. var _super = _createSuper(SchemaValidator);
  3953. function SchemaValidator(schema, options) {
  3954. var _this;
  3955. (0, _classCallCheck2.default)(this, SchemaValidator);
  3956. _this = _super.call(this, SchemaValidator.message);
  3957. _this._schema = schema;
  3958. _this._options = options || null;
  3959. return _this;
  3960. }
  3961. (0, _createClass2.default)(SchemaValidator, [{
  3962. key: "updateSchema",
  3963. value: function updateSchema(schema) {
  3964. this._schema = schema;
  3965. }
  3966. }, {
  3967. key: "validate",
  3968. value: function () {
  3969. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  3970. var result;
  3971. return _regenerator.default.wrap(function _callee3$(_context3) {
  3972. while (1) {
  3973. switch (_context3.prev = _context3.next) {
  3974. case 0:
  3975. result = this._checkFieldInSchema(data);
  3976. if (result) {
  3977. _context3.next = 5;
  3978. break;
  3979. }
  3980. _context3.next = 4;
  3981. return this.invokeValidate(data, false, allData);
  3982. case 4:
  3983. result = _context3.sent;
  3984. case 5:
  3985. return _context3.abrupt("return", result.length ? result[0] : null);
  3986. case 6:
  3987. case "end":
  3988. return _context3.stop();
  3989. }
  3990. }
  3991. }, _callee3, this);
  3992. }));
  3993. function validate(_x11, _x12) {
  3994. return _validate.apply(this, arguments);
  3995. }
  3996. return validate;
  3997. }()
  3998. }, {
  3999. key: "validateAll",
  4000. value: function () {
  4001. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  4002. var result;
  4003. return _regenerator.default.wrap(function _callee4$(_context4) {
  4004. while (1) {
  4005. switch (_context4.prev = _context4.next) {
  4006. case 0:
  4007. result = this._checkFieldInSchema(data);
  4008. if (result) {
  4009. _context4.next = 5;
  4010. break;
  4011. }
  4012. _context4.next = 4;
  4013. return this.invokeValidate(data, true, allData);
  4014. case 4:
  4015. result = _context4.sent;
  4016. case 5:
  4017. return _context4.abrupt("return", result);
  4018. case 6:
  4019. case "end":
  4020. return _context4.stop();
  4021. }
  4022. }
  4023. }, _callee4, this);
  4024. }));
  4025. function validateAll(_x13, _x14) {
  4026. return _validateAll.apply(this, arguments);
  4027. }
  4028. return validateAll;
  4029. }()
  4030. }, {
  4031. key: "validateUpdate",
  4032. value: function () {
  4033. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  4034. var result;
  4035. return _regenerator.default.wrap(function _callee5$(_context5) {
  4036. while (1) {
  4037. switch (_context5.prev = _context5.next) {
  4038. case 0:
  4039. result = this._checkFieldInSchema(data);
  4040. if (result) {
  4041. _context5.next = 5;
  4042. break;
  4043. }
  4044. _context5.next = 4;
  4045. return this.invokeValidateUpdate(data, false, allData);
  4046. case 4:
  4047. result = _context5.sent;
  4048. case 5:
  4049. return _context5.abrupt("return", result.length ? result[0] : null);
  4050. case 6:
  4051. case "end":
  4052. return _context5.stop();
  4053. }
  4054. }
  4055. }, _callee5, this);
  4056. }));
  4057. function validateUpdate(_x15, _x16) {
  4058. return _validateUpdate.apply(this, arguments);
  4059. }
  4060. return validateUpdate;
  4061. }()
  4062. }, {
  4063. key: "invokeValidate",
  4064. value: function () {
  4065. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  4066. var result, schema, key, value, errorMessage;
  4067. return _regenerator.default.wrap(function _callee6$(_context6) {
  4068. while (1) {
  4069. switch (_context6.prev = _context6.next) {
  4070. case 0:
  4071. result = [];
  4072. schema = this._schema;
  4073. _context6.t0 = _regenerator.default.keys(schema);
  4074. case 3:
  4075. if ((_context6.t1 = _context6.t0()).done) {
  4076. _context6.next = 15;
  4077. break;
  4078. }
  4079. key = _context6.t1.value;
  4080. value = schema[key];
  4081. _context6.next = 8;
  4082. return this.validateRule(key, value, data[key], data, allData);
  4083. case 8:
  4084. errorMessage = _context6.sent;
  4085. if (!(errorMessage != null)) {
  4086. _context6.next = 13;
  4087. break;
  4088. }
  4089. result.push({
  4090. key: key,
  4091. errorMessage: errorMessage
  4092. });
  4093. if (all) {
  4094. _context6.next = 13;
  4095. break;
  4096. }
  4097. return _context6.abrupt("break", 15);
  4098. case 13:
  4099. _context6.next = 3;
  4100. break;
  4101. case 15:
  4102. return _context6.abrupt("return", result);
  4103. case 16:
  4104. case "end":
  4105. return _context6.stop();
  4106. }
  4107. }
  4108. }, _callee6, this);
  4109. }));
  4110. function invokeValidate(_x17, _x18, _x19) {
  4111. return _invokeValidate.apply(this, arguments);
  4112. }
  4113. return invokeValidate;
  4114. }()
  4115. }, {
  4116. key: "invokeValidateUpdate",
  4117. value: function () {
  4118. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  4119. var result, key, errorMessage;
  4120. return _regenerator.default.wrap(function _callee7$(_context7) {
  4121. while (1) {
  4122. switch (_context7.prev = _context7.next) {
  4123. case 0:
  4124. result = [];
  4125. _context7.t0 = _regenerator.default.keys(data);
  4126. case 2:
  4127. if ((_context7.t1 = _context7.t0()).done) {
  4128. _context7.next = 13;
  4129. break;
  4130. }
  4131. key = _context7.t1.value;
  4132. _context7.next = 6;
  4133. return this.validateRule(key, this._schema[key], data[key], data, allData);
  4134. case 6:
  4135. errorMessage = _context7.sent;
  4136. if (!(errorMessage != null)) {
  4137. _context7.next = 11;
  4138. break;
  4139. }
  4140. result.push({
  4141. key: key,
  4142. errorMessage: errorMessage
  4143. });
  4144. if (all) {
  4145. _context7.next = 11;
  4146. break;
  4147. }
  4148. return _context7.abrupt("break", 13);
  4149. case 11:
  4150. _context7.next = 2;
  4151. break;
  4152. case 13:
  4153. return _context7.abrupt("return", result);
  4154. case 14:
  4155. case "end":
  4156. return _context7.stop();
  4157. }
  4158. }
  4159. }, _callee7, this);
  4160. }));
  4161. function invokeValidateUpdate(_x20, _x21, _x22) {
  4162. return _invokeValidateUpdate.apply(this, arguments);
  4163. }
  4164. return invokeValidateUpdate;
  4165. }()
  4166. }, {
  4167. key: "_checkFieldInSchema",
  4168. value: function _checkFieldInSchema(data) {
  4169. var keys = Object.keys(data);
  4170. var keys2 = Object.keys(this._schema);
  4171. if (new Set(keys.concat(keys2)).size === keys2.length) {
  4172. return '';
  4173. }
  4174. var noExistFields = keys.filter(function (key) {
  4175. return keys2.indexOf(key) < 0;
  4176. });
  4177. var errorMessage = formatMessage({
  4178. field: JSON.stringify(noExistFields)
  4179. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  4180. return [{
  4181. key: 'invalid',
  4182. errorMessage: errorMessage
  4183. }];
  4184. }
  4185. }]);
  4186. return SchemaValidator;
  4187. }(RuleValidator);
  4188. function Message() {
  4189. return {
  4190. TAG: "",
  4191. default: '验证错误',
  4192. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  4193. validateFunction: '验证无效',
  4194. required: '{label}必填',
  4195. 'enum': '{label}超出范围',
  4196. timestamp: '{label}格式无效',
  4197. whitespace: '{label}不能为空',
  4198. typeError: '{label}类型无效',
  4199. date: {
  4200. format: '{label}日期{value}格式无效',
  4201. parse: '{label}日期无法解析,{value}无效',
  4202. invalid: '{label}日期{value}无效'
  4203. },
  4204. length: {
  4205. minLength: '{label}长度不能少于{minLength}',
  4206. maxLength: '{label}长度不能超过{maxLength}',
  4207. range: '{label}必须介于{minLength}和{maxLength}之间'
  4208. },
  4209. number: {
  4210. minimum: '{label}不能小于{minimum}',
  4211. maximum: '{label}不能大于{maximum}',
  4212. exclusiveMinimum: '{label}不能小于等于{minimum}',
  4213. exclusiveMaximum: '{label}不能大于等于{maximum}',
  4214. range: '{label}必须介于{minimum}and{maximum}之间'
  4215. },
  4216. pattern: {
  4217. mismatch: '{label}格式不匹配'
  4218. }
  4219. };
  4220. }
  4221. SchemaValidator.message = new Message();
  4222. var _default = SchemaValidator;
  4223. exports.default = _default;
  4224. /***/ }),
  4225. /***/ 212:
  4226. /*!*********************************************************!*\
  4227. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  4228. \*********************************************************/
  4229. /*! no static exports found */
  4230. /***/ (function(module, exports, __webpack_require__) {
  4231. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  4232. function _inherits(subClass, superClass) {
  4233. if (typeof superClass !== "function" && superClass !== null) {
  4234. throw new TypeError("Super expression must either be null or a function");
  4235. }
  4236. subClass.prototype = Object.create(superClass && superClass.prototype, {
  4237. constructor: {
  4238. value: subClass,
  4239. writable: true,
  4240. configurable: true
  4241. }
  4242. });
  4243. Object.defineProperty(subClass, "prototype", {
  4244. writable: false
  4245. });
  4246. if (superClass) setPrototypeOf(subClass, superClass);
  4247. }
  4248. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4249. /***/ }),
  4250. /***/ 213:
  4251. /*!**************************************************************************!*\
  4252. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  4253. \**************************************************************************/
  4254. /*! no static exports found */
  4255. /***/ (function(module, exports, __webpack_require__) {
  4256. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  4257. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 214);
  4258. function _possibleConstructorReturn(self, call) {
  4259. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  4260. return call;
  4261. } else if (call !== void 0) {
  4262. throw new TypeError("Derived constructors may only return object or undefined");
  4263. }
  4264. return assertThisInitialized(self);
  4265. }
  4266. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4267. /***/ }),
  4268. /***/ 214:
  4269. /*!**********************************************************************!*\
  4270. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  4271. \**********************************************************************/
  4272. /*! no static exports found */
  4273. /***/ (function(module, exports) {
  4274. function _assertThisInitialized(self) {
  4275. if (self === void 0) {
  4276. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4277. }
  4278. return self;
  4279. }
  4280. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4281. /***/ }),
  4282. /***/ 215:
  4283. /*!***************************************************************!*\
  4284. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  4285. \***************************************************************/
  4286. /*! no static exports found */
  4287. /***/ (function(module, exports) {
  4288. function _getPrototypeOf(o) {
  4289. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  4290. return o.__proto__ || Object.getPrototypeOf(o);
  4291. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4292. return _getPrototypeOf(o);
  4293. }
  4294. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4295. /***/ }),
  4296. /***/ 216:
  4297. /*!***************************************************************************************************!*\
  4298. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  4299. \***************************************************************************************************/
  4300. /*! no static exports found */
  4301. /***/ (function(module, exports, __webpack_require__) {
  4302. "use strict";
  4303. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4304. Object.defineProperty(exports, "__esModule", {
  4305. value: true
  4306. });
  4307. 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;
  4308. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4309. /**
  4310. * 简单处理对象拷贝
  4311. * @param {Obejct} 被拷贝对象
  4312. * @@return {Object} 拷贝对象
  4313. */
  4314. var deepCopy = function deepCopy(val) {
  4315. return JSON.parse(JSON.stringify(val));
  4316. };
  4317. /**
  4318. * 过滤数字类型
  4319. * @param {String} format 数字类型
  4320. * @@return {Boolean} 返回是否为数字类型
  4321. */
  4322. exports.deepCopy = deepCopy;
  4323. var typeFilter = function typeFilter(format) {
  4324. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  4325. };
  4326. /**
  4327. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  4328. * @param {String} key 字段名
  4329. * @param {any} value 字段值
  4330. * @param {Object} rules 表单校验规则
  4331. */
  4332. exports.typeFilter = typeFilter;
  4333. var getValue = function getValue(key, value, rules) {
  4334. var isRuleNumType = rules.find(function (val) {
  4335. return val.format && typeFilter(val.format);
  4336. });
  4337. var isRuleBoolType = rules.find(function (val) {
  4338. return val.format && val.format === 'boolean' || val.format === 'bool';
  4339. });
  4340. // 输入类型为 number
  4341. if (!!isRuleNumType) {
  4342. if (!value && value !== 0) {
  4343. value = null;
  4344. } else {
  4345. value = isNumber(Number(value)) ? Number(value) : value;
  4346. }
  4347. }
  4348. // 输入类型为 boolean
  4349. if (!!isRuleBoolType) {
  4350. value = isBoolean(value) ? value : false;
  4351. }
  4352. return value;
  4353. };
  4354. /**
  4355. * 获取表单数据
  4356. * @param {String|Array} name 真实名称,需要使用 realName 获取
  4357. * @param {Object} data 原始数据
  4358. * @param {any} value 需要设置的值
  4359. */
  4360. exports.getValue = getValue;
  4361. var setDataValue = function setDataValue(field, formdata, value) {
  4362. formdata[field] = value;
  4363. return value || '';
  4364. };
  4365. /**
  4366. * 获取表单数据
  4367. * @param {String|Array} field 真实名称,需要使用 realName 获取
  4368. * @param {Object} data 原始数据
  4369. */
  4370. exports.setDataValue = setDataValue;
  4371. var getDataValue = function getDataValue(field, data) {
  4372. return objGet(data, field);
  4373. };
  4374. /**
  4375. * 获取表单类型
  4376. * @param {String|Array} field 真实名称,需要使用 realName 获取
  4377. */
  4378. exports.getDataValue = getDataValue;
  4379. var getDataValueType = function getDataValueType(field, data) {
  4380. var value = getDataValue(field, data);
  4381. return {
  4382. type: type(value),
  4383. value: value
  4384. };
  4385. };
  4386. /**
  4387. * 获取表单可用的真实name
  4388. * @param {String|Array} name 表单name
  4389. * @@return {String} 表单可用的真实name
  4390. */
  4391. exports.getDataValueType = getDataValueType;
  4392. var realName = function realName(name) {
  4393. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4394. var base_name = _basePath(name);
  4395. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  4396. var realname = base_name.reduce(function (a, b) {
  4397. return a += "#".concat(b);
  4398. }, '_formdata_');
  4399. return realname;
  4400. }
  4401. return base_name[0] || name;
  4402. };
  4403. /**
  4404. * 判断是否表单可用的真实name
  4405. * @param {String|Array} name 表单name
  4406. * @@return {String} 表单可用的真实name
  4407. */
  4408. exports.realName = realName;
  4409. var isRealName = function isRealName(name) {
  4410. var reg = /^_formdata_#*/;
  4411. return reg.test(name);
  4412. };
  4413. /**
  4414. * 获取表单数据的原始格式
  4415. * @@return {Object|Array} object 需要解析的数据
  4416. */
  4417. exports.isRealName = isRealName;
  4418. var rawData = function rawData() {
  4419. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4420. var name = arguments.length > 1 ? arguments[1] : undefined;
  4421. var newData = JSON.parse(JSON.stringify(object));
  4422. var formData = {};
  4423. for (var i in newData) {
  4424. var path = name2arr(i);
  4425. objSet(formData, path, newData[i]);
  4426. }
  4427. return formData;
  4428. };
  4429. /**
  4430. * 真实name还原为 array
  4431. * @param {*} name
  4432. */
  4433. exports.rawData = rawData;
  4434. var name2arr = function name2arr(name) {
  4435. var field = name.replace('_formdata_#', '');
  4436. field = field.split('#').map(function (v) {
  4437. return isNumber(v) ? Number(v) : v;
  4438. });
  4439. return field;
  4440. };
  4441. /**
  4442. * 对象中设置值
  4443. * @param {Object|Array} object 源数据
  4444. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  4445. * @param {String} value 需要设置的值
  4446. */
  4447. exports.name2arr = name2arr;
  4448. var objSet = function objSet(object, path, value) {
  4449. if ((0, _typeof2.default)(object) !== 'object') return object;
  4450. _basePath(path).reduce(function (o, k, i, _) {
  4451. if (i === _.length - 1) {
  4452. // 若遍历结束直接赋值
  4453. o[k] = value;
  4454. return null;
  4455. } else if (k in o) {
  4456. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  4457. return o[k];
  4458. } else {
  4459. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  4460. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  4461. return o[k];
  4462. }
  4463. }, object);
  4464. // 返回object
  4465. return object;
  4466. };
  4467. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  4468. exports.objSet = objSet;
  4469. function _basePath(path) {
  4470. // 若是数组,则直接返回
  4471. if (Array.isArray(path)) return path;
  4472. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  4473. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  4474. }
  4475. /**
  4476. * 从对象中获取值
  4477. * @param {Object|Array} object 源数据
  4478. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  4479. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  4480. */
  4481. var objGet = function objGet(object, path) {
  4482. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  4483. // 先将path处理成统一格式
  4484. var newPath = _basePath(path);
  4485. // 递归处理,返回最后结果
  4486. var val = newPath.reduce(function (o, k) {
  4487. return (o || {})[k];
  4488. }, object);
  4489. return !val || val !== undefined ? val : defaultVal;
  4490. };
  4491. /**
  4492. * 是否为 number 类型
  4493. * @param {any} num 需要判断的值
  4494. * @return {Boolean} 是否为 number
  4495. */
  4496. exports.objGet = objGet;
  4497. var isNumber = function isNumber(num) {
  4498. return !isNaN(Number(num));
  4499. };
  4500. /**
  4501. * 是否为 boolean 类型
  4502. * @param {any} bool 需要判断的值
  4503. * @return {Boolean} 是否为 boolean
  4504. */
  4505. exports.isNumber = isNumber;
  4506. var isBoolean = function isBoolean(bool) {
  4507. return typeof bool === 'boolean';
  4508. };
  4509. /**
  4510. * 是否有必填字段
  4511. * @param {Object} rules 规则
  4512. * @return {Boolean} 是否有必填字段
  4513. */
  4514. exports.isBoolean = isBoolean;
  4515. var isRequiredField = function isRequiredField(rules) {
  4516. var isNoField = false;
  4517. for (var i = 0; i < rules.length; i++) {
  4518. var ruleData = rules[i];
  4519. if (ruleData.required) {
  4520. isNoField = true;
  4521. break;
  4522. }
  4523. }
  4524. return isNoField;
  4525. };
  4526. /**
  4527. * 获取数据类型
  4528. * @param {Any} obj 需要获取数据类型的值
  4529. */
  4530. exports.isRequiredField = isRequiredField;
  4531. var type = function type(obj) {
  4532. var class2type = {};
  4533. // 生成class2type映射
  4534. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  4535. class2type["[object " + item + "]"] = item.toLowerCase();
  4536. });
  4537. if (obj == null) {
  4538. return obj + "";
  4539. }
  4540. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  4541. };
  4542. /**
  4543. * 判断两个值是否相等
  4544. * @param {any} a 值
  4545. * @param {any} b 值
  4546. * @return {Boolean} 是否相等
  4547. */
  4548. exports.type = type;
  4549. var isEqual = function isEqual(a, b) {
  4550. //如果a和b本来就全等
  4551. if (a === b) {
  4552. //判断是否为0和-0
  4553. return a !== 0 || 1 / a === 1 / b;
  4554. }
  4555. //判断是否为null和undefined
  4556. if (a == null || b == null) {
  4557. return a === b;
  4558. }
  4559. //接下来判断a和b的数据类型
  4560. var classNameA = toString.call(a),
  4561. classNameB = toString.call(b);
  4562. //如果数据类型不相等,则返回false
  4563. if (classNameA !== classNameB) {
  4564. return false;
  4565. }
  4566. //如果数据类型相等,再根据不同数据类型分别判断
  4567. switch (classNameA) {
  4568. case '[object RegExp]':
  4569. case '[object String]':
  4570. //进行字符串转换比较
  4571. return '' + a === '' + b;
  4572. case '[object Number]':
  4573. //进行数字转换比较,判断是否为NaN
  4574. if (+a !== +a) {
  4575. return +b !== +b;
  4576. }
  4577. //判断是否为0或-0
  4578. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  4579. case '[object Date]':
  4580. case '[object Boolean]':
  4581. return +a === +b;
  4582. }
  4583. //如果是对象类型
  4584. if (classNameA == '[object Object]') {
  4585. //获取a和b的属性长度
  4586. var propsA = Object.getOwnPropertyNames(a),
  4587. propsB = Object.getOwnPropertyNames(b);
  4588. if (propsA.length != propsB.length) {
  4589. return false;
  4590. }
  4591. for (var i = 0; i < propsA.length; i++) {
  4592. var propName = propsA[i];
  4593. //如果对应属性对应值不相等,则返回false
  4594. if (a[propName] !== b[propName]) {
  4595. return false;
  4596. }
  4597. }
  4598. return true;
  4599. }
  4600. //如果是数组类型
  4601. if (classNameA == '[object Array]') {
  4602. if (a.toString() == b.toString()) {
  4603. return true;
  4604. }
  4605. return false;
  4606. }
  4607. };
  4608. exports.isEqual = isEqual;
  4609. /***/ }),
  4610. /***/ 22:
  4611. /*!*************************************************************!*\
  4612. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  4613. \*************************************************************/
  4614. /*! no static exports found */
  4615. /***/ (function(module, exports, __webpack_require__) {
  4616. "use strict";
  4617. /* WEBPACK VAR INJECTION */(function(uni, global) {
  4618. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4619. Object.defineProperty(exports, "__esModule", {
  4620. value: true
  4621. });
  4622. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  4623. exports.compileI18nJsonStr = compileI18nJsonStr;
  4624. exports.hasI18nJson = hasI18nJson;
  4625. exports.initVueI18n = initVueI18n;
  4626. exports.isI18nStr = isI18nStr;
  4627. exports.isString = void 0;
  4628. exports.normalizeLocale = normalizeLocale;
  4629. exports.parseI18nJson = parseI18nJson;
  4630. exports.resolveLocale = resolveLocale;
  4631. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  4632. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  4633. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  4634. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4635. var isObject = function isObject(val) {
  4636. return val !== null && (0, _typeof2.default)(val) === 'object';
  4637. };
  4638. var defaultDelimiters = ['{', '}'];
  4639. var BaseFormatter = /*#__PURE__*/function () {
  4640. function BaseFormatter() {
  4641. (0, _classCallCheck2.default)(this, BaseFormatter);
  4642. this._caches = Object.create(null);
  4643. }
  4644. (0, _createClass2.default)(BaseFormatter, [{
  4645. key: "interpolate",
  4646. value: function interpolate(message, values) {
  4647. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  4648. if (!values) {
  4649. return [message];
  4650. }
  4651. var tokens = this._caches[message];
  4652. if (!tokens) {
  4653. tokens = parse(message, delimiters);
  4654. this._caches[message] = tokens;
  4655. }
  4656. return compile(tokens, values);
  4657. }
  4658. }]);
  4659. return BaseFormatter;
  4660. }();
  4661. exports.Formatter = BaseFormatter;
  4662. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  4663. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  4664. function parse(format, _ref) {
  4665. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  4666. startDelimiter = _ref2[0],
  4667. endDelimiter = _ref2[1];
  4668. var tokens = [];
  4669. var position = 0;
  4670. var text = '';
  4671. while (position < format.length) {
  4672. var char = format[position++];
  4673. if (char === startDelimiter) {
  4674. if (text) {
  4675. tokens.push({
  4676. type: 'text',
  4677. value: text
  4678. });
  4679. }
  4680. text = '';
  4681. var sub = '';
  4682. char = format[position++];
  4683. while (char !== undefined && char !== endDelimiter) {
  4684. sub += char;
  4685. char = format[position++];
  4686. }
  4687. var isClosed = char === endDelimiter;
  4688. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  4689. tokens.push({
  4690. value: sub,
  4691. type: type
  4692. });
  4693. }
  4694. // else if (char === '%') {
  4695. // // when found rails i18n syntax, skip text capture
  4696. // if (format[position] !== '{') {
  4697. // text += char
  4698. // }
  4699. // }
  4700. else {
  4701. text += char;
  4702. }
  4703. }
  4704. text && tokens.push({
  4705. type: 'text',
  4706. value: text
  4707. });
  4708. return tokens;
  4709. }
  4710. function compile(tokens, values) {
  4711. var compiled = [];
  4712. var index = 0;
  4713. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  4714. if (mode === 'unknown') {
  4715. return compiled;
  4716. }
  4717. while (index < tokens.length) {
  4718. var token = tokens[index];
  4719. switch (token.type) {
  4720. case 'text':
  4721. compiled.push(token.value);
  4722. break;
  4723. case 'list':
  4724. compiled.push(values[parseInt(token.value, 10)]);
  4725. break;
  4726. case 'named':
  4727. if (mode === 'named') {
  4728. compiled.push(values[token.value]);
  4729. } else {
  4730. if (true) {
  4731. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  4732. }
  4733. }
  4734. break;
  4735. case 'unknown':
  4736. if (true) {
  4737. console.warn("Detect 'unknown' type of token!");
  4738. }
  4739. break;
  4740. }
  4741. index++;
  4742. }
  4743. return compiled;
  4744. }
  4745. var LOCALE_ZH_HANS = 'zh-Hans';
  4746. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  4747. var LOCALE_ZH_HANT = 'zh-Hant';
  4748. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  4749. var LOCALE_EN = 'en';
  4750. exports.LOCALE_EN = LOCALE_EN;
  4751. var LOCALE_FR = 'fr';
  4752. exports.LOCALE_FR = LOCALE_FR;
  4753. var LOCALE_ES = 'es';
  4754. exports.LOCALE_ES = LOCALE_ES;
  4755. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4756. var hasOwn = function hasOwn(val, key) {
  4757. return hasOwnProperty.call(val, key);
  4758. };
  4759. var defaultFormatter = new BaseFormatter();
  4760. function include(str, parts) {
  4761. return !!parts.find(function (part) {
  4762. return str.indexOf(part) !== -1;
  4763. });
  4764. }
  4765. function startsWith(str, parts) {
  4766. return parts.find(function (part) {
  4767. return str.indexOf(part) === 0;
  4768. });
  4769. }
  4770. function normalizeLocale(locale, messages) {
  4771. if (!locale) {
  4772. return;
  4773. }
  4774. locale = locale.trim().replace(/_/g, '-');
  4775. if (messages && messages[locale]) {
  4776. return locale;
  4777. }
  4778. locale = locale.toLowerCase();
  4779. if (locale === 'chinese') {
  4780. // 支付宝
  4781. return LOCALE_ZH_HANS;
  4782. }
  4783. if (locale.indexOf('zh') === 0) {
  4784. if (locale.indexOf('-hans') > -1) {
  4785. return LOCALE_ZH_HANS;
  4786. }
  4787. if (locale.indexOf('-hant') > -1) {
  4788. return LOCALE_ZH_HANT;
  4789. }
  4790. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  4791. return LOCALE_ZH_HANT;
  4792. }
  4793. return LOCALE_ZH_HANS;
  4794. }
  4795. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  4796. if (messages && Object.keys(messages).length > 0) {
  4797. locales = Object.keys(messages);
  4798. }
  4799. var lang = startsWith(locale, locales);
  4800. if (lang) {
  4801. return lang;
  4802. }
  4803. }
  4804. var I18n = /*#__PURE__*/function () {
  4805. function I18n(_ref3) {
  4806. var locale = _ref3.locale,
  4807. fallbackLocale = _ref3.fallbackLocale,
  4808. messages = _ref3.messages,
  4809. watcher = _ref3.watcher,
  4810. formater = _ref3.formater;
  4811. (0, _classCallCheck2.default)(this, I18n);
  4812. this.locale = LOCALE_EN;
  4813. this.fallbackLocale = LOCALE_EN;
  4814. this.message = {};
  4815. this.messages = {};
  4816. this.watchers = [];
  4817. if (fallbackLocale) {
  4818. this.fallbackLocale = fallbackLocale;
  4819. }
  4820. this.formater = formater || defaultFormatter;
  4821. this.messages = messages || {};
  4822. this.setLocale(locale || LOCALE_EN);
  4823. if (watcher) {
  4824. this.watchLocale(watcher);
  4825. }
  4826. }
  4827. (0, _createClass2.default)(I18n, [{
  4828. key: "setLocale",
  4829. value: function setLocale(locale) {
  4830. var _this = this;
  4831. var oldLocale = this.locale;
  4832. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  4833. if (!this.messages[this.locale]) {
  4834. // 可能初始化时不存在
  4835. this.messages[this.locale] = {};
  4836. }
  4837. this.message = this.messages[this.locale];
  4838. // 仅发生变化时,通知
  4839. if (oldLocale !== this.locale) {
  4840. this.watchers.forEach(function (watcher) {
  4841. watcher(_this.locale, oldLocale);
  4842. });
  4843. }
  4844. }
  4845. }, {
  4846. key: "getLocale",
  4847. value: function getLocale() {
  4848. return this.locale;
  4849. }
  4850. }, {
  4851. key: "watchLocale",
  4852. value: function watchLocale(fn) {
  4853. var _this2 = this;
  4854. var index = this.watchers.push(fn) - 1;
  4855. return function () {
  4856. _this2.watchers.splice(index, 1);
  4857. };
  4858. }
  4859. }, {
  4860. key: "add",
  4861. value: function add(locale, message) {
  4862. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4863. var curMessages = this.messages[locale];
  4864. if (curMessages) {
  4865. if (override) {
  4866. Object.assign(curMessages, message);
  4867. } else {
  4868. Object.keys(message).forEach(function (key) {
  4869. if (!hasOwn(curMessages, key)) {
  4870. curMessages[key] = message[key];
  4871. }
  4872. });
  4873. }
  4874. } else {
  4875. this.messages[locale] = message;
  4876. }
  4877. }
  4878. }, {
  4879. key: "f",
  4880. value: function f(message, values, delimiters) {
  4881. return this.formater.interpolate(message, values, delimiters).join('');
  4882. }
  4883. }, {
  4884. key: "t",
  4885. value: function t(key, locale, values) {
  4886. var message = this.message;
  4887. if (typeof locale === 'string') {
  4888. locale = normalizeLocale(locale, this.messages);
  4889. locale && (message = this.messages[locale]);
  4890. } else {
  4891. values = locale;
  4892. }
  4893. if (!hasOwn(message, key)) {
  4894. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  4895. return key;
  4896. }
  4897. return this.formater.interpolate(message[key], values).join('');
  4898. }
  4899. }]);
  4900. return I18n;
  4901. }();
  4902. exports.I18n = I18n;
  4903. function watchAppLocale(appVm, i18n) {
  4904. // 需要保证 watch 的触发在组件渲染之前
  4905. if (appVm.$watchLocale) {
  4906. // vue2
  4907. appVm.$watchLocale(function (newLocale) {
  4908. i18n.setLocale(newLocale);
  4909. });
  4910. } else {
  4911. appVm.$watch(function () {
  4912. return appVm.$locale;
  4913. }, function (newLocale) {
  4914. i18n.setLocale(newLocale);
  4915. });
  4916. }
  4917. }
  4918. function getDefaultLocale() {
  4919. if (typeof uni !== 'undefined' && uni.getLocale) {
  4920. return uni.getLocale();
  4921. }
  4922. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  4923. if (typeof global !== 'undefined' && global.getLocale) {
  4924. return global.getLocale();
  4925. }
  4926. return LOCALE_EN;
  4927. }
  4928. function initVueI18n(locale) {
  4929. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4930. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  4931. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  4932. // 兼容旧版本入参
  4933. if (typeof locale !== 'string') {
  4934. var _ref4 = [messages, locale];
  4935. locale = _ref4[0];
  4936. messages = _ref4[1];
  4937. }
  4938. if (typeof locale !== 'string') {
  4939. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  4940. locale = getDefaultLocale();
  4941. }
  4942. if (typeof fallbackLocale !== 'string') {
  4943. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  4944. }
  4945. var i18n = new I18n({
  4946. locale: locale,
  4947. fallbackLocale: fallbackLocale,
  4948. messages: messages,
  4949. watcher: watcher
  4950. });
  4951. var _t = function t(key, values) {
  4952. if (typeof getApp !== 'function') {
  4953. // app view
  4954. /* eslint-disable no-func-assign */
  4955. _t = function t(key, values) {
  4956. return i18n.t(key, values);
  4957. };
  4958. } else {
  4959. var isWatchedAppLocale = false;
  4960. _t = function t(key, values) {
  4961. var appVm = getApp().$vm;
  4962. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  4963. // options: {
  4964. // type: Array,
  4965. // default () {
  4966. // return [{
  4967. // icon: 'shop',
  4968. // text: t("uni-goods-nav.options.shop"),
  4969. // }, {
  4970. // icon: 'cart',
  4971. // text: t("uni-goods-nav.options.cart")
  4972. // }]
  4973. // }
  4974. // },
  4975. if (appVm) {
  4976. // 触发响应式
  4977. appVm.$locale;
  4978. if (!isWatchedAppLocale) {
  4979. isWatchedAppLocale = true;
  4980. watchAppLocale(appVm, i18n);
  4981. }
  4982. }
  4983. return i18n.t(key, values);
  4984. };
  4985. }
  4986. return _t(key, values);
  4987. };
  4988. return {
  4989. i18n: i18n,
  4990. f: function f(message, values, delimiters) {
  4991. return i18n.f(message, values, delimiters);
  4992. },
  4993. t: function t(key, values) {
  4994. return _t(key, values);
  4995. },
  4996. add: function add(locale, message) {
  4997. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4998. return i18n.add(locale, message, override);
  4999. },
  5000. watch: function watch(fn) {
  5001. return i18n.watchLocale(fn);
  5002. },
  5003. getLocale: function getLocale() {
  5004. return i18n.getLocale();
  5005. },
  5006. setLocale: function setLocale(newLocale) {
  5007. return i18n.setLocale(newLocale);
  5008. }
  5009. };
  5010. }
  5011. var isString = function isString(val) {
  5012. return typeof val === 'string';
  5013. };
  5014. exports.isString = isString;
  5015. var formater;
  5016. function hasI18nJson(jsonObj, delimiters) {
  5017. if (!formater) {
  5018. formater = new BaseFormatter();
  5019. }
  5020. return walkJsonObj(jsonObj, function (jsonObj, key) {
  5021. var value = jsonObj[key];
  5022. if (isString(value)) {
  5023. if (isI18nStr(value, delimiters)) {
  5024. return true;
  5025. }
  5026. } else {
  5027. return hasI18nJson(value, delimiters);
  5028. }
  5029. });
  5030. }
  5031. function parseI18nJson(jsonObj, values, delimiters) {
  5032. if (!formater) {
  5033. formater = new BaseFormatter();
  5034. }
  5035. walkJsonObj(jsonObj, function (jsonObj, key) {
  5036. var value = jsonObj[key];
  5037. if (isString(value)) {
  5038. if (isI18nStr(value, delimiters)) {
  5039. jsonObj[key] = compileStr(value, values, delimiters);
  5040. }
  5041. } else {
  5042. parseI18nJson(value, values, delimiters);
  5043. }
  5044. });
  5045. return jsonObj;
  5046. }
  5047. function compileI18nJsonStr(jsonStr, _ref5) {
  5048. var locale = _ref5.locale,
  5049. locales = _ref5.locales,
  5050. delimiters = _ref5.delimiters;
  5051. if (!isI18nStr(jsonStr, delimiters)) {
  5052. return jsonStr;
  5053. }
  5054. if (!formater) {
  5055. formater = new BaseFormatter();
  5056. }
  5057. var localeValues = [];
  5058. Object.keys(locales).forEach(function (name) {
  5059. if (name !== locale) {
  5060. localeValues.push({
  5061. locale: name,
  5062. values: locales[name]
  5063. });
  5064. }
  5065. });
  5066. localeValues.unshift({
  5067. locale: locale,
  5068. values: locales[locale]
  5069. });
  5070. try {
  5071. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  5072. } catch (e) {}
  5073. return jsonStr;
  5074. }
  5075. function isI18nStr(value, delimiters) {
  5076. return value.indexOf(delimiters[0]) > -1;
  5077. }
  5078. function compileStr(value, values, delimiters) {
  5079. return formater.interpolate(value, values, delimiters).join('');
  5080. }
  5081. function compileValue(jsonObj, key, localeValues, delimiters) {
  5082. var value = jsonObj[key];
  5083. if (isString(value)) {
  5084. // 存在国际化
  5085. if (isI18nStr(value, delimiters)) {
  5086. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  5087. if (localeValues.length > 1) {
  5088. // 格式化国际化语言
  5089. var valueLocales = jsonObj[key + 'Locales'] = {};
  5090. localeValues.forEach(function (localValue) {
  5091. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  5092. });
  5093. }
  5094. }
  5095. } else {
  5096. compileJsonObj(value, localeValues, delimiters);
  5097. }
  5098. }
  5099. function compileJsonObj(jsonObj, localeValues, delimiters) {
  5100. walkJsonObj(jsonObj, function (jsonObj, key) {
  5101. compileValue(jsonObj, key, localeValues, delimiters);
  5102. });
  5103. return jsonObj;
  5104. }
  5105. function walkJsonObj(jsonObj, walk) {
  5106. if (Array.isArray(jsonObj)) {
  5107. for (var i = 0; i < jsonObj.length; i++) {
  5108. if (walk(jsonObj, i)) {
  5109. return true;
  5110. }
  5111. }
  5112. } else if (isObject(jsonObj)) {
  5113. for (var key in jsonObj) {
  5114. if (walk(jsonObj, key)) {
  5115. return true;
  5116. }
  5117. }
  5118. }
  5119. return false;
  5120. }
  5121. function resolveLocale(locales) {
  5122. return function (locale) {
  5123. if (!locale) {
  5124. return locale;
  5125. }
  5126. locale = normalizeLocale(locale) || locale;
  5127. return resolveLocaleChain(locale).find(function (locale) {
  5128. return locales.indexOf(locale) > -1;
  5129. });
  5130. };
  5131. }
  5132. function resolveLocaleChain(locale) {
  5133. var chain = [];
  5134. var tokens = locale.split('-');
  5135. while (tokens.length) {
  5136. chain.push(tokens.join('-'));
  5137. tokens.pop();
  5138. }
  5139. return chain;
  5140. }
  5141. /* 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)))
  5142. /***/ }),
  5143. /***/ 23:
  5144. /*!***************************************************************!*\
  5145. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  5146. \***************************************************************/
  5147. /*! no static exports found */
  5148. /***/ (function(module, exports) {
  5149. function _classCallCheck(instance, Constructor) {
  5150. if (!(instance instanceof Constructor)) {
  5151. throw new TypeError("Cannot call a class as a function");
  5152. }
  5153. }
  5154. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  5155. /***/ }),
  5156. /***/ 24:
  5157. /*!************************************************************!*\
  5158. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  5159. \************************************************************/
  5160. /*! no static exports found */
  5161. /***/ (function(module, exports, __webpack_require__) {
  5162. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  5163. function _defineProperties(target, props) {
  5164. for (var i = 0; i < props.length; i++) {
  5165. var descriptor = props[i];
  5166. descriptor.enumerable = descriptor.enumerable || false;
  5167. descriptor.configurable = true;
  5168. if ("value" in descriptor) descriptor.writable = true;
  5169. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  5170. }
  5171. }
  5172. function _createClass(Constructor, protoProps, staticProps) {
  5173. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  5174. if (staticProps) _defineProperties(Constructor, staticProps);
  5175. Object.defineProperty(Constructor, "prototype", {
  5176. writable: false
  5177. });
  5178. return Constructor;
  5179. }
  5180. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  5181. /***/ }),
  5182. /***/ 25:
  5183. /*!******************************************************************************************!*\
  5184. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  5185. \******************************************************************************************/
  5186. /*! exports provided: default */
  5187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5188. "use strict";
  5189. __webpack_require__.r(__webpack_exports__);
  5190. /* WEBPACK VAR INJECTION */(function(global) {/*!
  5191. * Vue.js v2.6.11
  5192. * (c) 2014-2023 Evan You
  5193. * Released under the MIT License.
  5194. */
  5195. /* */
  5196. var emptyObject = Object.freeze({});
  5197. // These helpers produce better VM code in JS engines due to their
  5198. // explicitness and function inlining.
  5199. function isUndef (v) {
  5200. return v === undefined || v === null
  5201. }
  5202. function isDef (v) {
  5203. return v !== undefined && v !== null
  5204. }
  5205. function isTrue (v) {
  5206. return v === true
  5207. }
  5208. function isFalse (v) {
  5209. return v === false
  5210. }
  5211. /**
  5212. * Check if value is primitive.
  5213. */
  5214. function isPrimitive (value) {
  5215. return (
  5216. typeof value === 'string' ||
  5217. typeof value === 'number' ||
  5218. // $flow-disable-line
  5219. typeof value === 'symbol' ||
  5220. typeof value === 'boolean'
  5221. )
  5222. }
  5223. /**
  5224. * Quick object check - this is primarily used to tell
  5225. * Objects from primitive values when we know the value
  5226. * is a JSON-compliant type.
  5227. */
  5228. function isObject (obj) {
  5229. return obj !== null && typeof obj === 'object'
  5230. }
  5231. /**
  5232. * Get the raw type string of a value, e.g., [object Object].
  5233. */
  5234. var _toString = Object.prototype.toString;
  5235. function toRawType (value) {
  5236. return _toString.call(value).slice(8, -1)
  5237. }
  5238. /**
  5239. * Strict object type check. Only returns true
  5240. * for plain JavaScript objects.
  5241. */
  5242. function isPlainObject (obj) {
  5243. return _toString.call(obj) === '[object Object]'
  5244. }
  5245. function isRegExp (v) {
  5246. return _toString.call(v) === '[object RegExp]'
  5247. }
  5248. /**
  5249. * Check if val is a valid array index.
  5250. */
  5251. function isValidArrayIndex (val) {
  5252. var n = parseFloat(String(val));
  5253. return n >= 0 && Math.floor(n) === n && isFinite(val)
  5254. }
  5255. function isPromise (val) {
  5256. return (
  5257. isDef(val) &&
  5258. typeof val.then === 'function' &&
  5259. typeof val.catch === 'function'
  5260. )
  5261. }
  5262. /**
  5263. * Convert a value to a string that is actually rendered.
  5264. */
  5265. function toString (val) {
  5266. return val == null
  5267. ? ''
  5268. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  5269. ? JSON.stringify(val, null, 2)
  5270. : String(val)
  5271. }
  5272. /**
  5273. * Convert an input value to a number for persistence.
  5274. * If the conversion fails, return original string.
  5275. */
  5276. function toNumber (val) {
  5277. var n = parseFloat(val);
  5278. return isNaN(n) ? val : n
  5279. }
  5280. /**
  5281. * Make a map and return a function for checking if a key
  5282. * is in that map.
  5283. */
  5284. function makeMap (
  5285. str,
  5286. expectsLowerCase
  5287. ) {
  5288. var map = Object.create(null);
  5289. var list = str.split(',');
  5290. for (var i = 0; i < list.length; i++) {
  5291. map[list[i]] = true;
  5292. }
  5293. return expectsLowerCase
  5294. ? function (val) { return map[val.toLowerCase()]; }
  5295. : function (val) { return map[val]; }
  5296. }
  5297. /**
  5298. * Check if a tag is a built-in tag.
  5299. */
  5300. var isBuiltInTag = makeMap('slot,component', true);
  5301. /**
  5302. * Check if an attribute is a reserved attribute.
  5303. */
  5304. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  5305. /**
  5306. * Remove an item from an array.
  5307. */
  5308. function remove (arr, item) {
  5309. if (arr.length) {
  5310. var index = arr.indexOf(item);
  5311. if (index > -1) {
  5312. return arr.splice(index, 1)
  5313. }
  5314. }
  5315. }
  5316. /**
  5317. * Check whether an object has the property.
  5318. */
  5319. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5320. function hasOwn (obj, key) {
  5321. return hasOwnProperty.call(obj, key)
  5322. }
  5323. /**
  5324. * Create a cached version of a pure function.
  5325. */
  5326. function cached (fn) {
  5327. var cache = Object.create(null);
  5328. return (function cachedFn (str) {
  5329. var hit = cache[str];
  5330. return hit || (cache[str] = fn(str))
  5331. })
  5332. }
  5333. /**
  5334. * Camelize a hyphen-delimited string.
  5335. */
  5336. var camelizeRE = /-(\w)/g;
  5337. var camelize = cached(function (str) {
  5338. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  5339. });
  5340. /**
  5341. * Capitalize a string.
  5342. */
  5343. var capitalize = cached(function (str) {
  5344. return str.charAt(0).toUpperCase() + str.slice(1)
  5345. });
  5346. /**
  5347. * Hyphenate a camelCase string.
  5348. */
  5349. var hyphenateRE = /\B([A-Z])/g;
  5350. var hyphenate = cached(function (str) {
  5351. return str.replace(hyphenateRE, '-$1').toLowerCase()
  5352. });
  5353. /**
  5354. * Simple bind polyfill for environments that do not support it,
  5355. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  5356. * since native bind is now performant enough in most browsers.
  5357. * But removing it would mean breaking code that was able to run in
  5358. * PhantomJS 1.x, so this must be kept for backward compatibility.
  5359. */
  5360. /* istanbul ignore next */
  5361. function polyfillBind (fn, ctx) {
  5362. function boundFn (a) {
  5363. var l = arguments.length;
  5364. return l
  5365. ? l > 1
  5366. ? fn.apply(ctx, arguments)
  5367. : fn.call(ctx, a)
  5368. : fn.call(ctx)
  5369. }
  5370. boundFn._length = fn.length;
  5371. return boundFn
  5372. }
  5373. function nativeBind (fn, ctx) {
  5374. return fn.bind(ctx)
  5375. }
  5376. var bind = Function.prototype.bind
  5377. ? nativeBind
  5378. : polyfillBind;
  5379. /**
  5380. * Convert an Array-like object to a real Array.
  5381. */
  5382. function toArray (list, start) {
  5383. start = start || 0;
  5384. var i = list.length - start;
  5385. var ret = new Array(i);
  5386. while (i--) {
  5387. ret[i] = list[i + start];
  5388. }
  5389. return ret
  5390. }
  5391. /**
  5392. * Mix properties into target object.
  5393. */
  5394. function extend (to, _from) {
  5395. for (var key in _from) {
  5396. to[key] = _from[key];
  5397. }
  5398. return to
  5399. }
  5400. /**
  5401. * Merge an Array of Objects into a single Object.
  5402. */
  5403. function toObject (arr) {
  5404. var res = {};
  5405. for (var i = 0; i < arr.length; i++) {
  5406. if (arr[i]) {
  5407. extend(res, arr[i]);
  5408. }
  5409. }
  5410. return res
  5411. }
  5412. /* eslint-disable no-unused-vars */
  5413. /**
  5414. * Perform no operation.
  5415. * Stubbing args to make Flow happy without leaving useless transpiled code
  5416. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  5417. */
  5418. function noop (a, b, c) {}
  5419. /**
  5420. * Always return false.
  5421. */
  5422. var no = function (a, b, c) { return false; };
  5423. /* eslint-enable no-unused-vars */
  5424. /**
  5425. * Return the same value.
  5426. */
  5427. var identity = function (_) { return _; };
  5428. /**
  5429. * Check if two values are loosely equal - that is,
  5430. * if they are plain objects, do they have the same shape?
  5431. */
  5432. function looseEqual (a, b) {
  5433. if (a === b) { return true }
  5434. var isObjectA = isObject(a);
  5435. var isObjectB = isObject(b);
  5436. if (isObjectA && isObjectB) {
  5437. try {
  5438. var isArrayA = Array.isArray(a);
  5439. var isArrayB = Array.isArray(b);
  5440. if (isArrayA && isArrayB) {
  5441. return a.length === b.length && a.every(function (e, i) {
  5442. return looseEqual(e, b[i])
  5443. })
  5444. } else if (a instanceof Date && b instanceof Date) {
  5445. return a.getTime() === b.getTime()
  5446. } else if (!isArrayA && !isArrayB) {
  5447. var keysA = Object.keys(a);
  5448. var keysB = Object.keys(b);
  5449. return keysA.length === keysB.length && keysA.every(function (key) {
  5450. return looseEqual(a[key], b[key])
  5451. })
  5452. } else {
  5453. /* istanbul ignore next */
  5454. return false
  5455. }
  5456. } catch (e) {
  5457. /* istanbul ignore next */
  5458. return false
  5459. }
  5460. } else if (!isObjectA && !isObjectB) {
  5461. return String(a) === String(b)
  5462. } else {
  5463. return false
  5464. }
  5465. }
  5466. /**
  5467. * Return the first index at which a loosely equal value can be
  5468. * found in the array (if value is a plain object, the array must
  5469. * contain an object of the same shape), or -1 if it is not present.
  5470. */
  5471. function looseIndexOf (arr, val) {
  5472. for (var i = 0; i < arr.length; i++) {
  5473. if (looseEqual(arr[i], val)) { return i }
  5474. }
  5475. return -1
  5476. }
  5477. /**
  5478. * Ensure a function is called only once.
  5479. */
  5480. function once (fn) {
  5481. var called = false;
  5482. return function () {
  5483. if (!called) {
  5484. called = true;
  5485. fn.apply(this, arguments);
  5486. }
  5487. }
  5488. }
  5489. var ASSET_TYPES = [
  5490. 'component',
  5491. 'directive',
  5492. 'filter'
  5493. ];
  5494. var LIFECYCLE_HOOKS = [
  5495. 'beforeCreate',
  5496. 'created',
  5497. 'beforeMount',
  5498. 'mounted',
  5499. 'beforeUpdate',
  5500. 'updated',
  5501. 'beforeDestroy',
  5502. 'destroyed',
  5503. 'activated',
  5504. 'deactivated',
  5505. 'errorCaptured',
  5506. 'serverPrefetch'
  5507. ];
  5508. /* */
  5509. var config = ({
  5510. /**
  5511. * Option merge strategies (used in core/util/options)
  5512. */
  5513. // $flow-disable-line
  5514. optionMergeStrategies: Object.create(null),
  5515. /**
  5516. * Whether to suppress warnings.
  5517. */
  5518. silent: false,
  5519. /**
  5520. * Show production mode tip message on boot?
  5521. */
  5522. productionTip: "development" !== 'production',
  5523. /**
  5524. * Whether to enable devtools
  5525. */
  5526. devtools: "development" !== 'production',
  5527. /**
  5528. * Whether to record perf
  5529. */
  5530. performance: false,
  5531. /**
  5532. * Error handler for watcher errors
  5533. */
  5534. errorHandler: null,
  5535. /**
  5536. * Warn handler for watcher warns
  5537. */
  5538. warnHandler: null,
  5539. /**
  5540. * Ignore certain custom elements
  5541. */
  5542. ignoredElements: [],
  5543. /**
  5544. * Custom user key aliases for v-on
  5545. */
  5546. // $flow-disable-line
  5547. keyCodes: Object.create(null),
  5548. /**
  5549. * Check if a tag is reserved so that it cannot be registered as a
  5550. * component. This is platform-dependent and may be overwritten.
  5551. */
  5552. isReservedTag: no,
  5553. /**
  5554. * Check if an attribute is reserved so that it cannot be used as a component
  5555. * prop. This is platform-dependent and may be overwritten.
  5556. */
  5557. isReservedAttr: no,
  5558. /**
  5559. * Check if a tag is an unknown element.
  5560. * Platform-dependent.
  5561. */
  5562. isUnknownElement: no,
  5563. /**
  5564. * Get the namespace of an element
  5565. */
  5566. getTagNamespace: noop,
  5567. /**
  5568. * Parse the real tag name for the specific platform.
  5569. */
  5570. parsePlatformTagName: identity,
  5571. /**
  5572. * Check if an attribute must be bound using property, e.g. value
  5573. * Platform-dependent.
  5574. */
  5575. mustUseProp: no,
  5576. /**
  5577. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  5578. * This will significantly reduce performance if set to false.
  5579. */
  5580. async: true,
  5581. /**
  5582. * Exposed for legacy reasons
  5583. */
  5584. _lifecycleHooks: LIFECYCLE_HOOKS
  5585. });
  5586. /* */
  5587. /**
  5588. * unicode letters used for parsing html tags, component names and property paths.
  5589. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  5590. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  5591. */
  5592. 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/;
  5593. /**
  5594. * Check if a string starts with $ or _
  5595. */
  5596. function isReserved (str) {
  5597. var c = (str + '').charCodeAt(0);
  5598. return c === 0x24 || c === 0x5F
  5599. }
  5600. /**
  5601. * Define a property.
  5602. */
  5603. function def (obj, key, val, enumerable) {
  5604. Object.defineProperty(obj, key, {
  5605. value: val,
  5606. enumerable: !!enumerable,
  5607. writable: true,
  5608. configurable: true
  5609. });
  5610. }
  5611. /**
  5612. * Parse simple path.
  5613. */
  5614. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  5615. function parsePath (path) {
  5616. if (bailRE.test(path)) {
  5617. return
  5618. }
  5619. var segments = path.split('.');
  5620. return function (obj) {
  5621. for (var i = 0; i < segments.length; i++) {
  5622. if (!obj) { return }
  5623. obj = obj[segments[i]];
  5624. }
  5625. return obj
  5626. }
  5627. }
  5628. /* */
  5629. // can we use __proto__?
  5630. var hasProto = '__proto__' in {};
  5631. // Browser environment sniffing
  5632. var inBrowser = typeof window !== 'undefined';
  5633. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  5634. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  5635. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  5636. var isIE = UA && /msie|trident/.test(UA);
  5637. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  5638. var isEdge = UA && UA.indexOf('edge/') > 0;
  5639. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  5640. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  5641. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  5642. var isPhantomJS = UA && /phantomjs/.test(UA);
  5643. var isFF = UA && UA.match(/firefox\/(\d+)/);
  5644. // Firefox has a "watch" function on Object.prototype...
  5645. var nativeWatch = ({}).watch;
  5646. if (inBrowser) {
  5647. try {
  5648. var opts = {};
  5649. Object.defineProperty(opts, 'passive', ({
  5650. get: function get () {
  5651. }
  5652. })); // https://github.com/facebook/flow/issues/285
  5653. window.addEventListener('test-passive', null, opts);
  5654. } catch (e) {}
  5655. }
  5656. // this needs to be lazy-evaled because vue may be required before
  5657. // vue-server-renderer can set VUE_ENV
  5658. var _isServer;
  5659. var isServerRendering = function () {
  5660. if (_isServer === undefined) {
  5661. /* istanbul ignore if */
  5662. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  5663. // detect presence of vue-server-renderer and avoid
  5664. // Webpack shimming the process
  5665. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  5666. } else {
  5667. _isServer = false;
  5668. }
  5669. }
  5670. return _isServer
  5671. };
  5672. // detect devtools
  5673. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  5674. /* istanbul ignore next */
  5675. function isNative (Ctor) {
  5676. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  5677. }
  5678. var hasSymbol =
  5679. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  5680. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  5681. var _Set;
  5682. /* istanbul ignore if */ // $flow-disable-line
  5683. if (typeof Set !== 'undefined' && isNative(Set)) {
  5684. // use native Set when available.
  5685. _Set = Set;
  5686. } else {
  5687. // a non-standard Set polyfill that only works with primitive keys.
  5688. _Set = /*@__PURE__*/(function () {
  5689. function Set () {
  5690. this.set = Object.create(null);
  5691. }
  5692. Set.prototype.has = function has (key) {
  5693. return this.set[key] === true
  5694. };
  5695. Set.prototype.add = function add (key) {
  5696. this.set[key] = true;
  5697. };
  5698. Set.prototype.clear = function clear () {
  5699. this.set = Object.create(null);
  5700. };
  5701. return Set;
  5702. }());
  5703. }
  5704. /* */
  5705. var warn = noop;
  5706. var tip = noop;
  5707. var generateComponentTrace = (noop); // work around flow check
  5708. var formatComponentName = (noop);
  5709. if (true) {
  5710. var hasConsole = typeof console !== 'undefined';
  5711. var classifyRE = /(?:^|[-_])(\w)/g;
  5712. var classify = function (str) { return str
  5713. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  5714. .replace(/[-_]/g, ''); };
  5715. warn = function (msg, vm) {
  5716. var trace = vm ? generateComponentTrace(vm) : '';
  5717. if (config.warnHandler) {
  5718. config.warnHandler.call(null, msg, vm, trace);
  5719. } else if (hasConsole && (!config.silent)) {
  5720. console.error(("[Vue warn]: " + msg + trace));
  5721. }
  5722. };
  5723. tip = function (msg, vm) {
  5724. if (hasConsole && (!config.silent)) {
  5725. console.warn("[Vue tip]: " + msg + (
  5726. vm ? generateComponentTrace(vm) : ''
  5727. ));
  5728. }
  5729. };
  5730. formatComponentName = function (vm, includeFile) {
  5731. if (vm.$root === vm) {
  5732. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  5733. return ('') + vm.$options.__file
  5734. }
  5735. return '<Root>'
  5736. }
  5737. var options = typeof vm === 'function' && vm.cid != null
  5738. ? vm.options
  5739. : vm._isVue
  5740. ? vm.$options || vm.constructor.options
  5741. : vm;
  5742. var name = options.name || options._componentTag;
  5743. var file = options.__file;
  5744. if (!name && file) {
  5745. var match = file.match(/([^/\\]+)\.vue$/);
  5746. name = match && match[1];
  5747. }
  5748. return (
  5749. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5750. (file && includeFile !== false ? (" at " + file) : '')
  5751. )
  5752. };
  5753. var repeat = function (str, n) {
  5754. var res = '';
  5755. while (n) {
  5756. if (n % 2 === 1) { res += str; }
  5757. if (n > 1) { str += str; }
  5758. n >>= 1;
  5759. }
  5760. return res
  5761. };
  5762. generateComponentTrace = function (vm) {
  5763. if (vm._isVue && vm.$parent) {
  5764. var tree = [];
  5765. var currentRecursiveSequence = 0;
  5766. while (vm && vm.$options.name !== 'PageBody') {
  5767. if (tree.length > 0) {
  5768. var last = tree[tree.length - 1];
  5769. if (last.constructor === vm.constructor) {
  5770. currentRecursiveSequence++;
  5771. vm = vm.$parent;
  5772. continue
  5773. } else if (currentRecursiveSequence > 0) {
  5774. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5775. currentRecursiveSequence = 0;
  5776. }
  5777. }
  5778. !vm.$options.isReserved && tree.push(vm);
  5779. vm = vm.$parent;
  5780. }
  5781. return '\n\nfound in\n\n' + tree
  5782. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5783. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5784. : formatComponentName(vm))); })
  5785. .join('\n')
  5786. } else {
  5787. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5788. }
  5789. };
  5790. }
  5791. /* */
  5792. var uid = 0;
  5793. /**
  5794. * A dep is an observable that can have multiple
  5795. * directives subscribing to it.
  5796. */
  5797. var Dep = function Dep () {
  5798. this.id = uid++;
  5799. this.subs = [];
  5800. };
  5801. Dep.prototype.addSub = function addSub (sub) {
  5802. this.subs.push(sub);
  5803. };
  5804. Dep.prototype.removeSub = function removeSub (sub) {
  5805. remove(this.subs, sub);
  5806. };
  5807. Dep.prototype.depend = function depend () {
  5808. if (Dep.SharedObject.target) {
  5809. Dep.SharedObject.target.addDep(this);
  5810. }
  5811. };
  5812. Dep.prototype.notify = function notify () {
  5813. // stabilize the subscriber list first
  5814. var subs = this.subs.slice();
  5815. if ( true && !config.async) {
  5816. // subs aren't sorted in scheduler if not running async
  5817. // we need to sort them now to make sure they fire in correct
  5818. // order
  5819. subs.sort(function (a, b) { return a.id - b.id; });
  5820. }
  5821. for (var i = 0, l = subs.length; i < l; i++) {
  5822. subs[i].update();
  5823. }
  5824. };
  5825. // The current target watcher being evaluated.
  5826. // This is globally unique because only one watcher
  5827. // can be evaluated at a time.
  5828. // fixed by xxxxxx (nvue shared vuex)
  5829. /* eslint-disable no-undef */
  5830. Dep.SharedObject = {};
  5831. Dep.SharedObject.target = null;
  5832. Dep.SharedObject.targetStack = [];
  5833. function pushTarget (target) {
  5834. Dep.SharedObject.targetStack.push(target);
  5835. Dep.SharedObject.target = target;
  5836. Dep.target = target;
  5837. }
  5838. function popTarget () {
  5839. Dep.SharedObject.targetStack.pop();
  5840. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5841. Dep.target = Dep.SharedObject.target;
  5842. }
  5843. /* */
  5844. var VNode = function VNode (
  5845. tag,
  5846. data,
  5847. children,
  5848. text,
  5849. elm,
  5850. context,
  5851. componentOptions,
  5852. asyncFactory
  5853. ) {
  5854. this.tag = tag;
  5855. this.data = data;
  5856. this.children = children;
  5857. this.text = text;
  5858. this.elm = elm;
  5859. this.ns = undefined;
  5860. this.context = context;
  5861. this.fnContext = undefined;
  5862. this.fnOptions = undefined;
  5863. this.fnScopeId = undefined;
  5864. this.key = data && data.key;
  5865. this.componentOptions = componentOptions;
  5866. this.componentInstance = undefined;
  5867. this.parent = undefined;
  5868. this.raw = false;
  5869. this.isStatic = false;
  5870. this.isRootInsert = true;
  5871. this.isComment = false;
  5872. this.isCloned = false;
  5873. this.isOnce = false;
  5874. this.asyncFactory = asyncFactory;
  5875. this.asyncMeta = undefined;
  5876. this.isAsyncPlaceholder = false;
  5877. };
  5878. var prototypeAccessors = { child: { configurable: true } };
  5879. // DEPRECATED: alias for componentInstance for backwards compat.
  5880. /* istanbul ignore next */
  5881. prototypeAccessors.child.get = function () {
  5882. return this.componentInstance
  5883. };
  5884. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5885. var createEmptyVNode = function (text) {
  5886. if ( text === void 0 ) text = '';
  5887. var node = new VNode();
  5888. node.text = text;
  5889. node.isComment = true;
  5890. return node
  5891. };
  5892. function createTextVNode (val) {
  5893. return new VNode(undefined, undefined, undefined, String(val))
  5894. }
  5895. // optimized shallow clone
  5896. // used for static nodes and slot nodes because they may be reused across
  5897. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5898. // on their elm reference.
  5899. function cloneVNode (vnode) {
  5900. var cloned = new VNode(
  5901. vnode.tag,
  5902. vnode.data,
  5903. // #7975
  5904. // clone children array to avoid mutating original in case of cloning
  5905. // a child.
  5906. vnode.children && vnode.children.slice(),
  5907. vnode.text,
  5908. vnode.elm,
  5909. vnode.context,
  5910. vnode.componentOptions,
  5911. vnode.asyncFactory
  5912. );
  5913. cloned.ns = vnode.ns;
  5914. cloned.isStatic = vnode.isStatic;
  5915. cloned.key = vnode.key;
  5916. cloned.isComment = vnode.isComment;
  5917. cloned.fnContext = vnode.fnContext;
  5918. cloned.fnOptions = vnode.fnOptions;
  5919. cloned.fnScopeId = vnode.fnScopeId;
  5920. cloned.asyncMeta = vnode.asyncMeta;
  5921. cloned.isCloned = true;
  5922. return cloned
  5923. }
  5924. /*
  5925. * not type checking this file because flow doesn't play well with
  5926. * dynamically accessing methods on Array prototype
  5927. */
  5928. var arrayProto = Array.prototype;
  5929. var arrayMethods = Object.create(arrayProto);
  5930. var methodsToPatch = [
  5931. 'push',
  5932. 'pop',
  5933. 'shift',
  5934. 'unshift',
  5935. 'splice',
  5936. 'sort',
  5937. 'reverse'
  5938. ];
  5939. /**
  5940. * Intercept mutating methods and emit events
  5941. */
  5942. methodsToPatch.forEach(function (method) {
  5943. // cache original method
  5944. var original = arrayProto[method];
  5945. def(arrayMethods, method, function mutator () {
  5946. var args = [], len = arguments.length;
  5947. while ( len-- ) args[ len ] = arguments[ len ];
  5948. var result = original.apply(this, args);
  5949. var ob = this.__ob__;
  5950. var inserted;
  5951. switch (method) {
  5952. case 'push':
  5953. case 'unshift':
  5954. inserted = args;
  5955. break
  5956. case 'splice':
  5957. inserted = args.slice(2);
  5958. break
  5959. }
  5960. if (inserted) { ob.observeArray(inserted); }
  5961. // notify change
  5962. ob.dep.notify();
  5963. return result
  5964. });
  5965. });
  5966. /* */
  5967. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5968. /**
  5969. * In some cases we may want to disable observation inside a component's
  5970. * update computation.
  5971. */
  5972. var shouldObserve = true;
  5973. function toggleObserving (value) {
  5974. shouldObserve = value;
  5975. }
  5976. /**
  5977. * Observer class that is attached to each observed
  5978. * object. Once attached, the observer converts the target
  5979. * object's property keys into getter/setters that
  5980. * collect dependencies and dispatch updates.
  5981. */
  5982. var Observer = function Observer (value) {
  5983. this.value = value;
  5984. this.dep = new Dep();
  5985. this.vmCount = 0;
  5986. def(value, '__ob__', this);
  5987. if (Array.isArray(value)) {
  5988. if (hasProto) {
  5989. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5990. if(value.push !== value.__proto__.push){
  5991. copyAugment(value, arrayMethods, arrayKeys);
  5992. } else {
  5993. protoAugment(value, arrayMethods);
  5994. }
  5995. }
  5996. } else {
  5997. copyAugment(value, arrayMethods, arrayKeys);
  5998. }
  5999. this.observeArray(value);
  6000. } else {
  6001. this.walk(value);
  6002. }
  6003. };
  6004. /**
  6005. * Walk through all properties and convert them into
  6006. * getter/setters. This method should only be called when
  6007. * value type is Object.
  6008. */
  6009. Observer.prototype.walk = function walk (obj) {
  6010. var keys = Object.keys(obj);
  6011. for (var i = 0; i < keys.length; i++) {
  6012. defineReactive$$1(obj, keys[i]);
  6013. }
  6014. };
  6015. /**
  6016. * Observe a list of Array items.
  6017. */
  6018. Observer.prototype.observeArray = function observeArray (items) {
  6019. for (var i = 0, l = items.length; i < l; i++) {
  6020. observe(items[i]);
  6021. }
  6022. };
  6023. // helpers
  6024. /**
  6025. * Augment a target Object or Array by intercepting
  6026. * the prototype chain using __proto__
  6027. */
  6028. function protoAugment (target, src) {
  6029. /* eslint-disable no-proto */
  6030. target.__proto__ = src;
  6031. /* eslint-enable no-proto */
  6032. }
  6033. /**
  6034. * Augment a target Object or Array by defining
  6035. * hidden properties.
  6036. */
  6037. /* istanbul ignore next */
  6038. function copyAugment (target, src, keys) {
  6039. for (var i = 0, l = keys.length; i < l; i++) {
  6040. var key = keys[i];
  6041. def(target, key, src[key]);
  6042. }
  6043. }
  6044. /**
  6045. * Attempt to create an observer instance for a value,
  6046. * returns the new observer if successfully observed,
  6047. * or the existing observer if the value already has one.
  6048. */
  6049. function observe (value, asRootData) {
  6050. if (!isObject(value) || value instanceof VNode) {
  6051. return
  6052. }
  6053. var ob;
  6054. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  6055. ob = value.__ob__;
  6056. } else if (
  6057. shouldObserve &&
  6058. !isServerRendering() &&
  6059. (Array.isArray(value) || isPlainObject(value)) &&
  6060. Object.isExtensible(value) &&
  6061. !value._isVue &&
  6062. !value.__v_isMPComponent
  6063. ) {
  6064. ob = new Observer(value);
  6065. }
  6066. if (asRootData && ob) {
  6067. ob.vmCount++;
  6068. }
  6069. return ob
  6070. }
  6071. /**
  6072. * Define a reactive property on an Object.
  6073. */
  6074. function defineReactive$$1 (
  6075. obj,
  6076. key,
  6077. val,
  6078. customSetter,
  6079. shallow
  6080. ) {
  6081. var dep = new Dep();
  6082. var property = Object.getOwnPropertyDescriptor(obj, key);
  6083. if (property && property.configurable === false) {
  6084. return
  6085. }
  6086. // cater for pre-defined getter/setters
  6087. var getter = property && property.get;
  6088. var setter = property && property.set;
  6089. if ((!getter || setter) && arguments.length === 2) {
  6090. val = obj[key];
  6091. }
  6092. var childOb = !shallow && observe(val);
  6093. Object.defineProperty(obj, key, {
  6094. enumerable: true,
  6095. configurable: true,
  6096. get: function reactiveGetter () {
  6097. var value = getter ? getter.call(obj) : val;
  6098. if (Dep.SharedObject.target) { // fixed by xxxxxx
  6099. dep.depend();
  6100. if (childOb) {
  6101. childOb.dep.depend();
  6102. if (Array.isArray(value)) {
  6103. dependArray(value);
  6104. }
  6105. }
  6106. }
  6107. return value
  6108. },
  6109. set: function reactiveSetter (newVal) {
  6110. var value = getter ? getter.call(obj) : val;
  6111. /* eslint-disable no-self-compare */
  6112. if (newVal === value || (newVal !== newVal && value !== value)) {
  6113. return
  6114. }
  6115. /* eslint-enable no-self-compare */
  6116. if ( true && customSetter) {
  6117. customSetter();
  6118. }
  6119. // #7981: for accessor properties without setter
  6120. if (getter && !setter) { return }
  6121. if (setter) {
  6122. setter.call(obj, newVal);
  6123. } else {
  6124. val = newVal;
  6125. }
  6126. childOb = !shallow && observe(newVal);
  6127. dep.notify();
  6128. }
  6129. });
  6130. }
  6131. /**
  6132. * Set a property on an object. Adds the new property and
  6133. * triggers change notification if the property doesn't
  6134. * already exist.
  6135. */
  6136. function set (target, key, val) {
  6137. if ( true &&
  6138. (isUndef(target) || isPrimitive(target))
  6139. ) {
  6140. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  6141. }
  6142. if (Array.isArray(target) && isValidArrayIndex(key)) {
  6143. target.length = Math.max(target.length, key);
  6144. target.splice(key, 1, val);
  6145. return val
  6146. }
  6147. if (key in target && !(key in Object.prototype)) {
  6148. target[key] = val;
  6149. return val
  6150. }
  6151. var ob = (target).__ob__;
  6152. if (target._isVue || (ob && ob.vmCount)) {
  6153. true && warn(
  6154. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  6155. 'at runtime - declare it upfront in the data option.'
  6156. );
  6157. return val
  6158. }
  6159. if (!ob) {
  6160. target[key] = val;
  6161. return val
  6162. }
  6163. defineReactive$$1(ob.value, key, val);
  6164. ob.dep.notify();
  6165. return val
  6166. }
  6167. /**
  6168. * Delete a property and trigger change if necessary.
  6169. */
  6170. function del (target, key) {
  6171. if ( true &&
  6172. (isUndef(target) || isPrimitive(target))
  6173. ) {
  6174. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  6175. }
  6176. if (Array.isArray(target) && isValidArrayIndex(key)) {
  6177. target.splice(key, 1);
  6178. return
  6179. }
  6180. var ob = (target).__ob__;
  6181. if (target._isVue || (ob && ob.vmCount)) {
  6182. true && warn(
  6183. 'Avoid deleting properties on a Vue instance or its root $data ' +
  6184. '- just set it to null.'
  6185. );
  6186. return
  6187. }
  6188. if (!hasOwn(target, key)) {
  6189. return
  6190. }
  6191. delete target[key];
  6192. if (!ob) {
  6193. return
  6194. }
  6195. ob.dep.notify();
  6196. }
  6197. /**
  6198. * Collect dependencies on array elements when the array is touched, since
  6199. * we cannot intercept array element access like property getters.
  6200. */
  6201. function dependArray (value) {
  6202. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  6203. e = value[i];
  6204. e && e.__ob__ && e.__ob__.dep.depend();
  6205. if (Array.isArray(e)) {
  6206. dependArray(e);
  6207. }
  6208. }
  6209. }
  6210. /* */
  6211. /**
  6212. * Option overwriting strategies are functions that handle
  6213. * how to merge a parent option value and a child option
  6214. * value into the final value.
  6215. */
  6216. var strats = config.optionMergeStrategies;
  6217. /**
  6218. * Options with restrictions
  6219. */
  6220. if (true) {
  6221. strats.el = strats.propsData = function (parent, child, vm, key) {
  6222. if (!vm) {
  6223. warn(
  6224. "option \"" + key + "\" can only be used during instance " +
  6225. 'creation with the `new` keyword.'
  6226. );
  6227. }
  6228. return defaultStrat(parent, child)
  6229. };
  6230. }
  6231. /**
  6232. * Helper that recursively merges two data objects together.
  6233. */
  6234. function mergeData (to, from) {
  6235. if (!from) { return to }
  6236. var key, toVal, fromVal;
  6237. var keys = hasSymbol
  6238. ? Reflect.ownKeys(from)
  6239. : Object.keys(from);
  6240. for (var i = 0; i < keys.length; i++) {
  6241. key = keys[i];
  6242. // in case the object is already observed...
  6243. if (key === '__ob__') { continue }
  6244. toVal = to[key];
  6245. fromVal = from[key];
  6246. if (!hasOwn(to, key)) {
  6247. set(to, key, fromVal);
  6248. } else if (
  6249. toVal !== fromVal &&
  6250. isPlainObject(toVal) &&
  6251. isPlainObject(fromVal)
  6252. ) {
  6253. mergeData(toVal, fromVal);
  6254. }
  6255. }
  6256. return to
  6257. }
  6258. /**
  6259. * Data
  6260. */
  6261. function mergeDataOrFn (
  6262. parentVal,
  6263. childVal,
  6264. vm
  6265. ) {
  6266. if (!vm) {
  6267. // in a Vue.extend merge, both should be functions
  6268. if (!childVal) {
  6269. return parentVal
  6270. }
  6271. if (!parentVal) {
  6272. return childVal
  6273. }
  6274. // when parentVal & childVal are both present,
  6275. // we need to return a function that returns the
  6276. // merged result of both functions... no need to
  6277. // check if parentVal is a function here because
  6278. // it has to be a function to pass previous merges.
  6279. return function mergedDataFn () {
  6280. return mergeData(
  6281. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  6282. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  6283. )
  6284. }
  6285. } else {
  6286. return function mergedInstanceDataFn () {
  6287. // instance merge
  6288. var instanceData = typeof childVal === 'function'
  6289. ? childVal.call(vm, vm)
  6290. : childVal;
  6291. var defaultData = typeof parentVal === 'function'
  6292. ? parentVal.call(vm, vm)
  6293. : parentVal;
  6294. if (instanceData) {
  6295. return mergeData(instanceData, defaultData)
  6296. } else {
  6297. return defaultData
  6298. }
  6299. }
  6300. }
  6301. }
  6302. strats.data = function (
  6303. parentVal,
  6304. childVal,
  6305. vm
  6306. ) {
  6307. if (!vm) {
  6308. if (childVal && typeof childVal !== 'function') {
  6309. true && warn(
  6310. 'The "data" option should be a function ' +
  6311. 'that returns a per-instance value in component ' +
  6312. 'definitions.',
  6313. vm
  6314. );
  6315. return parentVal
  6316. }
  6317. return mergeDataOrFn(parentVal, childVal)
  6318. }
  6319. return mergeDataOrFn(parentVal, childVal, vm)
  6320. };
  6321. /**
  6322. * Hooks and props are merged as arrays.
  6323. */
  6324. function mergeHook (
  6325. parentVal,
  6326. childVal
  6327. ) {
  6328. var res = childVal
  6329. ? parentVal
  6330. ? parentVal.concat(childVal)
  6331. : Array.isArray(childVal)
  6332. ? childVal
  6333. : [childVal]
  6334. : parentVal;
  6335. return res
  6336. ? dedupeHooks(res)
  6337. : res
  6338. }
  6339. function dedupeHooks (hooks) {
  6340. var res = [];
  6341. for (var i = 0; i < hooks.length; i++) {
  6342. if (res.indexOf(hooks[i]) === -1) {
  6343. res.push(hooks[i]);
  6344. }
  6345. }
  6346. return res
  6347. }
  6348. LIFECYCLE_HOOKS.forEach(function (hook) {
  6349. strats[hook] = mergeHook;
  6350. });
  6351. /**
  6352. * Assets
  6353. *
  6354. * When a vm is present (instance creation), we need to do
  6355. * a three-way merge between constructor options, instance
  6356. * options and parent options.
  6357. */
  6358. function mergeAssets (
  6359. parentVal,
  6360. childVal,
  6361. vm,
  6362. key
  6363. ) {
  6364. var res = Object.create(parentVal || null);
  6365. if (childVal) {
  6366. true && assertObjectType(key, childVal, vm);
  6367. return extend(res, childVal)
  6368. } else {
  6369. return res
  6370. }
  6371. }
  6372. ASSET_TYPES.forEach(function (type) {
  6373. strats[type + 's'] = mergeAssets;
  6374. });
  6375. /**
  6376. * Watchers.
  6377. *
  6378. * Watchers hashes should not overwrite one
  6379. * another, so we merge them as arrays.
  6380. */
  6381. strats.watch = function (
  6382. parentVal,
  6383. childVal,
  6384. vm,
  6385. key
  6386. ) {
  6387. // work around Firefox's Object.prototype.watch...
  6388. if (parentVal === nativeWatch) { parentVal = undefined; }
  6389. if (childVal === nativeWatch) { childVal = undefined; }
  6390. /* istanbul ignore if */
  6391. if (!childVal) { return Object.create(parentVal || null) }
  6392. if (true) {
  6393. assertObjectType(key, childVal, vm);
  6394. }
  6395. if (!parentVal) { return childVal }
  6396. var ret = {};
  6397. extend(ret, parentVal);
  6398. for (var key$1 in childVal) {
  6399. var parent = ret[key$1];
  6400. var child = childVal[key$1];
  6401. if (parent && !Array.isArray(parent)) {
  6402. parent = [parent];
  6403. }
  6404. ret[key$1] = parent
  6405. ? parent.concat(child)
  6406. : Array.isArray(child) ? child : [child];
  6407. }
  6408. return ret
  6409. };
  6410. /**
  6411. * Other object hashes.
  6412. */
  6413. strats.props =
  6414. strats.methods =
  6415. strats.inject =
  6416. strats.computed = function (
  6417. parentVal,
  6418. childVal,
  6419. vm,
  6420. key
  6421. ) {
  6422. if (childVal && "development" !== 'production') {
  6423. assertObjectType(key, childVal, vm);
  6424. }
  6425. if (!parentVal) { return childVal }
  6426. var ret = Object.create(null);
  6427. extend(ret, parentVal);
  6428. if (childVal) { extend(ret, childVal); }
  6429. return ret
  6430. };
  6431. strats.provide = mergeDataOrFn;
  6432. /**
  6433. * Default strategy.
  6434. */
  6435. var defaultStrat = function (parentVal, childVal) {
  6436. return childVal === undefined
  6437. ? parentVal
  6438. : childVal
  6439. };
  6440. /**
  6441. * Validate component names
  6442. */
  6443. function checkComponents (options) {
  6444. for (var key in options.components) {
  6445. validateComponentName(key);
  6446. }
  6447. }
  6448. function validateComponentName (name) {
  6449. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  6450. warn(
  6451. 'Invalid component name: "' + name + '". Component names ' +
  6452. 'should conform to valid custom element name in html5 specification.'
  6453. );
  6454. }
  6455. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  6456. warn(
  6457. 'Do not use built-in or reserved HTML elements as component ' +
  6458. 'id: ' + name
  6459. );
  6460. }
  6461. }
  6462. /**
  6463. * Ensure all props option syntax are normalized into the
  6464. * Object-based format.
  6465. */
  6466. function normalizeProps (options, vm) {
  6467. var props = options.props;
  6468. if (!props) { return }
  6469. var res = {};
  6470. var i, val, name;
  6471. if (Array.isArray(props)) {
  6472. i = props.length;
  6473. while (i--) {
  6474. val = props[i];
  6475. if (typeof val === 'string') {
  6476. name = camelize(val);
  6477. res[name] = { type: null };
  6478. } else if (true) {
  6479. warn('props must be strings when using array syntax.');
  6480. }
  6481. }
  6482. } else if (isPlainObject(props)) {
  6483. for (var key in props) {
  6484. val = props[key];
  6485. name = camelize(key);
  6486. res[name] = isPlainObject(val)
  6487. ? val
  6488. : { type: val };
  6489. }
  6490. } else if (true) {
  6491. warn(
  6492. "Invalid value for option \"props\": expected an Array or an Object, " +
  6493. "but got " + (toRawType(props)) + ".",
  6494. vm
  6495. );
  6496. }
  6497. options.props = res;
  6498. }
  6499. /**
  6500. * Normalize all injections into Object-based format
  6501. */
  6502. function normalizeInject (options, vm) {
  6503. var inject = options.inject;
  6504. if (!inject) { return }
  6505. var normalized = options.inject = {};
  6506. if (Array.isArray(inject)) {
  6507. for (var i = 0; i < inject.length; i++) {
  6508. normalized[inject[i]] = { from: inject[i] };
  6509. }
  6510. } else if (isPlainObject(inject)) {
  6511. for (var key in inject) {
  6512. var val = inject[key];
  6513. normalized[key] = isPlainObject(val)
  6514. ? extend({ from: key }, val)
  6515. : { from: val };
  6516. }
  6517. } else if (true) {
  6518. warn(
  6519. "Invalid value for option \"inject\": expected an Array or an Object, " +
  6520. "but got " + (toRawType(inject)) + ".",
  6521. vm
  6522. );
  6523. }
  6524. }
  6525. /**
  6526. * Normalize raw function directives into object format.
  6527. */
  6528. function normalizeDirectives (options) {
  6529. var dirs = options.directives;
  6530. if (dirs) {
  6531. for (var key in dirs) {
  6532. var def$$1 = dirs[key];
  6533. if (typeof def$$1 === 'function') {
  6534. dirs[key] = { bind: def$$1, update: def$$1 };
  6535. }
  6536. }
  6537. }
  6538. }
  6539. function assertObjectType (name, value, vm) {
  6540. if (!isPlainObject(value)) {
  6541. warn(
  6542. "Invalid value for option \"" + name + "\": expected an Object, " +
  6543. "but got " + (toRawType(value)) + ".",
  6544. vm
  6545. );
  6546. }
  6547. }
  6548. /**
  6549. * Merge two option objects into a new one.
  6550. * Core utility used in both instantiation and inheritance.
  6551. */
  6552. function mergeOptions (
  6553. parent,
  6554. child,
  6555. vm
  6556. ) {
  6557. if (true) {
  6558. checkComponents(child);
  6559. }
  6560. if (typeof child === 'function') {
  6561. child = child.options;
  6562. }
  6563. normalizeProps(child, vm);
  6564. normalizeInject(child, vm);
  6565. normalizeDirectives(child);
  6566. // Apply extends and mixins on the child options,
  6567. // but only if it is a raw options object that isn't
  6568. // the result of another mergeOptions call.
  6569. // Only merged options has the _base property.
  6570. if (!child._base) {
  6571. if (child.extends) {
  6572. parent = mergeOptions(parent, child.extends, vm);
  6573. }
  6574. if (child.mixins) {
  6575. for (var i = 0, l = child.mixins.length; i < l; i++) {
  6576. parent = mergeOptions(parent, child.mixins[i], vm);
  6577. }
  6578. }
  6579. }
  6580. var options = {};
  6581. var key;
  6582. for (key in parent) {
  6583. mergeField(key);
  6584. }
  6585. for (key in child) {
  6586. if (!hasOwn(parent, key)) {
  6587. mergeField(key);
  6588. }
  6589. }
  6590. function mergeField (key) {
  6591. var strat = strats[key] || defaultStrat;
  6592. options[key] = strat(parent[key], child[key], vm, key);
  6593. }
  6594. return options
  6595. }
  6596. /**
  6597. * Resolve an asset.
  6598. * This function is used because child instances need access
  6599. * to assets defined in its ancestor chain.
  6600. */
  6601. function resolveAsset (
  6602. options,
  6603. type,
  6604. id,
  6605. warnMissing
  6606. ) {
  6607. /* istanbul ignore if */
  6608. if (typeof id !== 'string') {
  6609. return
  6610. }
  6611. var assets = options[type];
  6612. // check local registration variations first
  6613. if (hasOwn(assets, id)) { return assets[id] }
  6614. var camelizedId = camelize(id);
  6615. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  6616. var PascalCaseId = capitalize(camelizedId);
  6617. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  6618. // fallback to prototype chain
  6619. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  6620. if ( true && warnMissing && !res) {
  6621. warn(
  6622. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  6623. options
  6624. );
  6625. }
  6626. return res
  6627. }
  6628. /* */
  6629. function validateProp (
  6630. key,
  6631. propOptions,
  6632. propsData,
  6633. vm
  6634. ) {
  6635. var prop = propOptions[key];
  6636. var absent = !hasOwn(propsData, key);
  6637. var value = propsData[key];
  6638. // boolean casting
  6639. var booleanIndex = getTypeIndex(Boolean, prop.type);
  6640. if (booleanIndex > -1) {
  6641. if (absent && !hasOwn(prop, 'default')) {
  6642. value = false;
  6643. } else if (value === '' || value === hyphenate(key)) {
  6644. // only cast empty string / same name to boolean if
  6645. // boolean has higher priority
  6646. var stringIndex = getTypeIndex(String, prop.type);
  6647. if (stringIndex < 0 || booleanIndex < stringIndex) {
  6648. value = true;
  6649. }
  6650. }
  6651. }
  6652. // check default value
  6653. if (value === undefined) {
  6654. value = getPropDefaultValue(vm, prop, key);
  6655. // since the default value is a fresh copy,
  6656. // make sure to observe it.
  6657. var prevShouldObserve = shouldObserve;
  6658. toggleObserving(true);
  6659. observe(value);
  6660. toggleObserving(prevShouldObserve);
  6661. }
  6662. if (
  6663. true
  6664. ) {
  6665. assertProp(prop, key, value, vm, absent);
  6666. }
  6667. return value
  6668. }
  6669. /**
  6670. * Get the default value of a prop.
  6671. */
  6672. function getPropDefaultValue (vm, prop, key) {
  6673. // no default, return undefined
  6674. if (!hasOwn(prop, 'default')) {
  6675. return undefined
  6676. }
  6677. var def = prop.default;
  6678. // warn against non-factory defaults for Object & Array
  6679. if ( true && isObject(def)) {
  6680. warn(
  6681. 'Invalid default value for prop "' + key + '": ' +
  6682. 'Props with type Object/Array must use a factory function ' +
  6683. 'to return the default value.',
  6684. vm
  6685. );
  6686. }
  6687. // the raw prop value was also undefined from previous render,
  6688. // return previous default value to avoid unnecessary watcher trigger
  6689. if (vm && vm.$options.propsData &&
  6690. vm.$options.propsData[key] === undefined &&
  6691. vm._props[key] !== undefined
  6692. ) {
  6693. return vm._props[key]
  6694. }
  6695. // call factory function for non-Function types
  6696. // a value is Function if its prototype is function even across different execution context
  6697. return typeof def === 'function' && getType(prop.type) !== 'Function'
  6698. ? def.call(vm)
  6699. : def
  6700. }
  6701. /**
  6702. * Assert whether a prop is valid.
  6703. */
  6704. function assertProp (
  6705. prop,
  6706. name,
  6707. value,
  6708. vm,
  6709. absent
  6710. ) {
  6711. if (prop.required && absent) {
  6712. warn(
  6713. 'Missing required prop: "' + name + '"',
  6714. vm
  6715. );
  6716. return
  6717. }
  6718. if (value == null && !prop.required) {
  6719. return
  6720. }
  6721. var type = prop.type;
  6722. var valid = !type || type === true;
  6723. var expectedTypes = [];
  6724. if (type) {
  6725. if (!Array.isArray(type)) {
  6726. type = [type];
  6727. }
  6728. for (var i = 0; i < type.length && !valid; i++) {
  6729. var assertedType = assertType(value, type[i]);
  6730. expectedTypes.push(assertedType.expectedType || '');
  6731. valid = assertedType.valid;
  6732. }
  6733. }
  6734. if (!valid) {
  6735. warn(
  6736. getInvalidTypeMessage(name, value, expectedTypes),
  6737. vm
  6738. );
  6739. return
  6740. }
  6741. var validator = prop.validator;
  6742. if (validator) {
  6743. if (!validator(value)) {
  6744. warn(
  6745. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6746. vm
  6747. );
  6748. }
  6749. }
  6750. }
  6751. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6752. function assertType (value, type) {
  6753. var valid;
  6754. var expectedType = getType(type);
  6755. if (simpleCheckRE.test(expectedType)) {
  6756. var t = typeof value;
  6757. valid = t === expectedType.toLowerCase();
  6758. // for primitive wrapper objects
  6759. if (!valid && t === 'object') {
  6760. valid = value instanceof type;
  6761. }
  6762. } else if (expectedType === 'Object') {
  6763. valid = isPlainObject(value);
  6764. } else if (expectedType === 'Array') {
  6765. valid = Array.isArray(value);
  6766. } else {
  6767. valid = value instanceof type;
  6768. }
  6769. return {
  6770. valid: valid,
  6771. expectedType: expectedType
  6772. }
  6773. }
  6774. /**
  6775. * Use function string name to check built-in types,
  6776. * because a simple equality check will fail when running
  6777. * across different vms / iframes.
  6778. */
  6779. function getType (fn) {
  6780. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6781. return match ? match[1] : ''
  6782. }
  6783. function isSameType (a, b) {
  6784. return getType(a) === getType(b)
  6785. }
  6786. function getTypeIndex (type, expectedTypes) {
  6787. if (!Array.isArray(expectedTypes)) {
  6788. return isSameType(expectedTypes, type) ? 0 : -1
  6789. }
  6790. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6791. if (isSameType(expectedTypes[i], type)) {
  6792. return i
  6793. }
  6794. }
  6795. return -1
  6796. }
  6797. function getInvalidTypeMessage (name, value, expectedTypes) {
  6798. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6799. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6800. var expectedType = expectedTypes[0];
  6801. var receivedType = toRawType(value);
  6802. var expectedValue = styleValue(value, expectedType);
  6803. var receivedValue = styleValue(value, receivedType);
  6804. // check if we need to specify expected value
  6805. if (expectedTypes.length === 1 &&
  6806. isExplicable(expectedType) &&
  6807. !isBoolean(expectedType, receivedType)) {
  6808. message += " with value " + expectedValue;
  6809. }
  6810. message += ", got " + receivedType + " ";
  6811. // check if we need to specify received value
  6812. if (isExplicable(receivedType)) {
  6813. message += "with value " + receivedValue + ".";
  6814. }
  6815. return message
  6816. }
  6817. function styleValue (value, type) {
  6818. if (type === 'String') {
  6819. return ("\"" + value + "\"")
  6820. } else if (type === 'Number') {
  6821. return ("" + (Number(value)))
  6822. } else {
  6823. return ("" + value)
  6824. }
  6825. }
  6826. function isExplicable (value) {
  6827. var explicitTypes = ['string', 'number', 'boolean'];
  6828. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6829. }
  6830. function isBoolean () {
  6831. var args = [], len = arguments.length;
  6832. while ( len-- ) args[ len ] = arguments[ len ];
  6833. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6834. }
  6835. /* */
  6836. function handleError (err, vm, info) {
  6837. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6838. // See: https://github.com/vuejs/vuex/issues/1505
  6839. pushTarget();
  6840. try {
  6841. if (vm) {
  6842. var cur = vm;
  6843. while ((cur = cur.$parent)) {
  6844. var hooks = cur.$options.errorCaptured;
  6845. if (hooks) {
  6846. for (var i = 0; i < hooks.length; i++) {
  6847. try {
  6848. var capture = hooks[i].call(cur, err, vm, info) === false;
  6849. if (capture) { return }
  6850. } catch (e) {
  6851. globalHandleError(e, cur, 'errorCaptured hook');
  6852. }
  6853. }
  6854. }
  6855. }
  6856. }
  6857. globalHandleError(err, vm, info);
  6858. } finally {
  6859. popTarget();
  6860. }
  6861. }
  6862. function invokeWithErrorHandling (
  6863. handler,
  6864. context,
  6865. args,
  6866. vm,
  6867. info
  6868. ) {
  6869. var res;
  6870. try {
  6871. res = args ? handler.apply(context, args) : handler.call(context);
  6872. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6873. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6874. // issue #9511
  6875. // avoid catch triggering multiple times when nested calls
  6876. res._handled = true;
  6877. }
  6878. } catch (e) {
  6879. handleError(e, vm, info);
  6880. }
  6881. return res
  6882. }
  6883. function globalHandleError (err, vm, info) {
  6884. if (config.errorHandler) {
  6885. try {
  6886. return config.errorHandler.call(null, err, vm, info)
  6887. } catch (e) {
  6888. // if the user intentionally throws the original error in the handler,
  6889. // do not log it twice
  6890. if (e !== err) {
  6891. logError(e, null, 'config.errorHandler');
  6892. }
  6893. }
  6894. }
  6895. logError(err, vm, info);
  6896. }
  6897. function logError (err, vm, info) {
  6898. if (true) {
  6899. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6900. }
  6901. /* istanbul ignore else */
  6902. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6903. console.error(err);
  6904. } else {
  6905. throw err
  6906. }
  6907. }
  6908. /* */
  6909. var callbacks = [];
  6910. var pending = false;
  6911. function flushCallbacks () {
  6912. pending = false;
  6913. var copies = callbacks.slice(0);
  6914. callbacks.length = 0;
  6915. for (var i = 0; i < copies.length; i++) {
  6916. copies[i]();
  6917. }
  6918. }
  6919. // Here we have async deferring wrappers using microtasks.
  6920. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6921. // However, it has subtle problems when state is changed right before repaint
  6922. // (e.g. #6813, out-in transitions).
  6923. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6924. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6925. // So we now use microtasks everywhere, again.
  6926. // A major drawback of this tradeoff is that there are some scenarios
  6927. // where microtasks have too high a priority and fire in between supposedly
  6928. // sequential events (e.g. #4521, #6690, which have workarounds)
  6929. // or even between bubbling of the same event (#6566).
  6930. var timerFunc;
  6931. // The nextTick behavior leverages the microtask queue, which can be accessed
  6932. // via either native Promise.then or MutationObserver.
  6933. // MutationObserver has wider support, however it is seriously bugged in
  6934. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6935. // completely stops working after triggering a few times... so, if native
  6936. // Promise is available, we will use it:
  6937. /* istanbul ignore next, $flow-disable-line */
  6938. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6939. var p = Promise.resolve();
  6940. timerFunc = function () {
  6941. p.then(flushCallbacks);
  6942. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6943. // it can get stuck in a weird state where callbacks are pushed into the
  6944. // microtask queue but the queue isn't being flushed, until the browser
  6945. // needs to do some other work, e.g. handle a timer. Therefore we can
  6946. // "force" the microtask queue to be flushed by adding an empty timer.
  6947. if (isIOS) { setTimeout(noop); }
  6948. };
  6949. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6950. isNative(MutationObserver) ||
  6951. // PhantomJS and iOS 7.x
  6952. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6953. )) {
  6954. // Use MutationObserver where native Promise is not available,
  6955. // e.g. PhantomJS, iOS7, Android 4.4
  6956. // (#6466 MutationObserver is unreliable in IE11)
  6957. var counter = 1;
  6958. var observer = new MutationObserver(flushCallbacks);
  6959. var textNode = document.createTextNode(String(counter));
  6960. observer.observe(textNode, {
  6961. characterData: true
  6962. });
  6963. timerFunc = function () {
  6964. counter = (counter + 1) % 2;
  6965. textNode.data = String(counter);
  6966. };
  6967. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6968. // Fallback to setImmediate.
  6969. // Technically it leverages the (macro) task queue,
  6970. // but it is still a better choice than setTimeout.
  6971. timerFunc = function () {
  6972. setImmediate(flushCallbacks);
  6973. };
  6974. } else {
  6975. // Fallback to setTimeout.
  6976. timerFunc = function () {
  6977. setTimeout(flushCallbacks, 0);
  6978. };
  6979. }
  6980. function nextTick (cb, ctx) {
  6981. var _resolve;
  6982. callbacks.push(function () {
  6983. if (cb) {
  6984. try {
  6985. cb.call(ctx);
  6986. } catch (e) {
  6987. handleError(e, ctx, 'nextTick');
  6988. }
  6989. } else if (_resolve) {
  6990. _resolve(ctx);
  6991. }
  6992. });
  6993. if (!pending) {
  6994. pending = true;
  6995. timerFunc();
  6996. }
  6997. // $flow-disable-line
  6998. if (!cb && typeof Promise !== 'undefined') {
  6999. return new Promise(function (resolve) {
  7000. _resolve = resolve;
  7001. })
  7002. }
  7003. }
  7004. /* */
  7005. /* not type checking this file because flow doesn't play well with Proxy */
  7006. var initProxy;
  7007. if (true) {
  7008. var allowedGlobals = makeMap(
  7009. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  7010. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  7011. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  7012. 'require' // for Webpack/Browserify
  7013. );
  7014. var warnNonPresent = function (target, key) {
  7015. warn(
  7016. "Property or method \"" + key + "\" is not defined on the instance but " +
  7017. 'referenced during render. Make sure that this property is reactive, ' +
  7018. 'either in the data option, or for class-based components, by ' +
  7019. 'initializing the property. ' +
  7020. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  7021. target
  7022. );
  7023. };
  7024. var warnReservedPrefix = function (target, key) {
  7025. warn(
  7026. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  7027. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  7028. 'prevent conflicts with Vue internals. ' +
  7029. 'See: https://vuejs.org/v2/api/#data',
  7030. target
  7031. );
  7032. };
  7033. var hasProxy =
  7034. typeof Proxy !== 'undefined' && isNative(Proxy);
  7035. if (hasProxy) {
  7036. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  7037. config.keyCodes = new Proxy(config.keyCodes, {
  7038. set: function set (target, key, value) {
  7039. if (isBuiltInModifier(key)) {
  7040. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  7041. return false
  7042. } else {
  7043. target[key] = value;
  7044. return true
  7045. }
  7046. }
  7047. });
  7048. }
  7049. var hasHandler = {
  7050. has: function has (target, key) {
  7051. var has = key in target;
  7052. var isAllowed = allowedGlobals(key) ||
  7053. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  7054. if (!has && !isAllowed) {
  7055. if (key in target.$data) { warnReservedPrefix(target, key); }
  7056. else { warnNonPresent(target, key); }
  7057. }
  7058. return has || !isAllowed
  7059. }
  7060. };
  7061. var getHandler = {
  7062. get: function get (target, key) {
  7063. if (typeof key === 'string' && !(key in target)) {
  7064. if (key in target.$data) { warnReservedPrefix(target, key); }
  7065. else { warnNonPresent(target, key); }
  7066. }
  7067. return target[key]
  7068. }
  7069. };
  7070. initProxy = function initProxy (vm) {
  7071. if (hasProxy) {
  7072. // determine which proxy handler to use
  7073. var options = vm.$options;
  7074. var handlers = options.render && options.render._withStripped
  7075. ? getHandler
  7076. : hasHandler;
  7077. vm._renderProxy = new Proxy(vm, handlers);
  7078. } else {
  7079. vm._renderProxy = vm;
  7080. }
  7081. };
  7082. }
  7083. /* */
  7084. var seenObjects = new _Set();
  7085. /**
  7086. * Recursively traverse an object to evoke all converted
  7087. * getters, so that every nested property inside the object
  7088. * is collected as a "deep" dependency.
  7089. */
  7090. function traverse (val) {
  7091. _traverse(val, seenObjects);
  7092. seenObjects.clear();
  7093. }
  7094. function _traverse (val, seen) {
  7095. var i, keys;
  7096. var isA = Array.isArray(val);
  7097. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  7098. return
  7099. }
  7100. if (val.__ob__) {
  7101. var depId = val.__ob__.dep.id;
  7102. if (seen.has(depId)) {
  7103. return
  7104. }
  7105. seen.add(depId);
  7106. }
  7107. if (isA) {
  7108. i = val.length;
  7109. while (i--) { _traverse(val[i], seen); }
  7110. } else {
  7111. keys = Object.keys(val);
  7112. i = keys.length;
  7113. while (i--) { _traverse(val[keys[i]], seen); }
  7114. }
  7115. }
  7116. var mark;
  7117. var measure;
  7118. if (true) {
  7119. var perf = inBrowser && window.performance;
  7120. /* istanbul ignore if */
  7121. if (
  7122. perf &&
  7123. perf.mark &&
  7124. perf.measure &&
  7125. perf.clearMarks &&
  7126. perf.clearMeasures
  7127. ) {
  7128. mark = function (tag) { return perf.mark(tag); };
  7129. measure = function (name, startTag, endTag) {
  7130. perf.measure(name, startTag, endTag);
  7131. perf.clearMarks(startTag);
  7132. perf.clearMarks(endTag);
  7133. // perf.clearMeasures(name)
  7134. };
  7135. }
  7136. }
  7137. /* */
  7138. var normalizeEvent = cached(function (name) {
  7139. var passive = name.charAt(0) === '&';
  7140. name = passive ? name.slice(1) : name;
  7141. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  7142. name = once$$1 ? name.slice(1) : name;
  7143. var capture = name.charAt(0) === '!';
  7144. name = capture ? name.slice(1) : name;
  7145. return {
  7146. name: name,
  7147. once: once$$1,
  7148. capture: capture,
  7149. passive: passive
  7150. }
  7151. });
  7152. function createFnInvoker (fns, vm) {
  7153. function invoker () {
  7154. var arguments$1 = arguments;
  7155. var fns = invoker.fns;
  7156. if (Array.isArray(fns)) {
  7157. var cloned = fns.slice();
  7158. for (var i = 0; i < cloned.length; i++) {
  7159. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  7160. }
  7161. } else {
  7162. // return handler return value for single handlers
  7163. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  7164. }
  7165. }
  7166. invoker.fns = fns;
  7167. return invoker
  7168. }
  7169. function updateListeners (
  7170. on,
  7171. oldOn,
  7172. add,
  7173. remove$$1,
  7174. createOnceHandler,
  7175. vm
  7176. ) {
  7177. var name, def$$1, cur, old, event;
  7178. for (name in on) {
  7179. def$$1 = cur = on[name];
  7180. old = oldOn[name];
  7181. event = normalizeEvent(name);
  7182. if (isUndef(cur)) {
  7183. true && warn(
  7184. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  7185. vm
  7186. );
  7187. } else if (isUndef(old)) {
  7188. if (isUndef(cur.fns)) {
  7189. cur = on[name] = createFnInvoker(cur, vm);
  7190. }
  7191. if (isTrue(event.once)) {
  7192. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  7193. }
  7194. add(event.name, cur, event.capture, event.passive, event.params);
  7195. } else if (cur !== old) {
  7196. old.fns = cur;
  7197. on[name] = old;
  7198. }
  7199. }
  7200. for (name in oldOn) {
  7201. if (isUndef(on[name])) {
  7202. event = normalizeEvent(name);
  7203. remove$$1(event.name, oldOn[name], event.capture);
  7204. }
  7205. }
  7206. }
  7207. /* */
  7208. /* */
  7209. // fixed by xxxxxx (mp properties)
  7210. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  7211. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  7212. if (isUndef(propOptions)) {
  7213. return res
  7214. }
  7215. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  7216. var attrs = data.attrs;
  7217. var props = data.props;
  7218. if (isDef(attrs) || isDef(props)) {
  7219. for (var key in propOptions) {
  7220. var altKey = hyphenate(key);
  7221. var result = checkProp(res, props, key, altKey, true) ||
  7222. checkProp(res, attrs, key, altKey, false);
  7223. // externalClass
  7224. if (
  7225. result &&
  7226. res[key] &&
  7227. externalClasses.indexOf(altKey) !== -1 &&
  7228. context[camelize(res[key])]
  7229. ) {
  7230. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  7231. res[key] = context[camelize(res[key])];
  7232. }
  7233. }
  7234. }
  7235. return res
  7236. }
  7237. function extractPropsFromVNodeData (
  7238. data,
  7239. Ctor,
  7240. tag,
  7241. context// fixed by xxxxxx
  7242. ) {
  7243. // we are only extracting raw values here.
  7244. // validation and default values are handled in the child
  7245. // component itself.
  7246. var propOptions = Ctor.options.props;
  7247. if (isUndef(propOptions)) {
  7248. // fixed by xxxxxx
  7249. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  7250. }
  7251. var res = {};
  7252. var attrs = data.attrs;
  7253. var props = data.props;
  7254. if (isDef(attrs) || isDef(props)) {
  7255. for (var key in propOptions) {
  7256. var altKey = hyphenate(key);
  7257. if (true) {
  7258. var keyInLowerCase = key.toLowerCase();
  7259. if (
  7260. key !== keyInLowerCase &&
  7261. attrs && hasOwn(attrs, keyInLowerCase)
  7262. ) {
  7263. tip(
  7264. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  7265. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  7266. " \"" + key + "\". " +
  7267. "Note that HTML attributes are case-insensitive and camelCased " +
  7268. "props need to use their kebab-case equivalents when using in-DOM " +
  7269. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  7270. );
  7271. }
  7272. }
  7273. checkProp(res, props, key, altKey, true) ||
  7274. checkProp(res, attrs, key, altKey, false);
  7275. }
  7276. }
  7277. // fixed by xxxxxx
  7278. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  7279. }
  7280. function checkProp (
  7281. res,
  7282. hash,
  7283. key,
  7284. altKey,
  7285. preserve
  7286. ) {
  7287. if (isDef(hash)) {
  7288. if (hasOwn(hash, key)) {
  7289. res[key] = hash[key];
  7290. if (!preserve) {
  7291. delete hash[key];
  7292. }
  7293. return true
  7294. } else if (hasOwn(hash, altKey)) {
  7295. res[key] = hash[altKey];
  7296. if (!preserve) {
  7297. delete hash[altKey];
  7298. }
  7299. return true
  7300. }
  7301. }
  7302. return false
  7303. }
  7304. /* */
  7305. // The template compiler attempts to minimize the need for normalization by
  7306. // statically analyzing the template at compile time.
  7307. //
  7308. // For plain HTML markup, normalization can be completely skipped because the
  7309. // generated render function is guaranteed to return Array<VNode>. There are
  7310. // two cases where extra normalization is needed:
  7311. // 1. When the children contains components - because a functional component
  7312. // may return an Array instead of a single root. In this case, just a simple
  7313. // normalization is needed - if any child is an Array, we flatten the whole
  7314. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  7315. // because functional components already normalize their own children.
  7316. function simpleNormalizeChildren (children) {
  7317. for (var i = 0; i < children.length; i++) {
  7318. if (Array.isArray(children[i])) {
  7319. return Array.prototype.concat.apply([], children)
  7320. }
  7321. }
  7322. return children
  7323. }
  7324. // 2. When the children contains constructs that always generated nested Arrays,
  7325. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  7326. // with hand-written render functions / JSX. In such cases a full normalization
  7327. // is needed to cater to all possible types of children values.
  7328. function normalizeChildren (children) {
  7329. return isPrimitive(children)
  7330. ? [createTextVNode(children)]
  7331. : Array.isArray(children)
  7332. ? normalizeArrayChildren(children)
  7333. : undefined
  7334. }
  7335. function isTextNode (node) {
  7336. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  7337. }
  7338. function normalizeArrayChildren (children, nestedIndex) {
  7339. var res = [];
  7340. var i, c, lastIndex, last;
  7341. for (i = 0; i < children.length; i++) {
  7342. c = children[i];
  7343. if (isUndef(c) || typeof c === 'boolean') { continue }
  7344. lastIndex = res.length - 1;
  7345. last = res[lastIndex];
  7346. // nested
  7347. if (Array.isArray(c)) {
  7348. if (c.length > 0) {
  7349. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  7350. // merge adjacent text nodes
  7351. if (isTextNode(c[0]) && isTextNode(last)) {
  7352. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  7353. c.shift();
  7354. }
  7355. res.push.apply(res, c);
  7356. }
  7357. } else if (isPrimitive(c)) {
  7358. if (isTextNode(last)) {
  7359. // merge adjacent text nodes
  7360. // this is necessary for SSR hydration because text nodes are
  7361. // essentially merged when rendered to HTML strings
  7362. res[lastIndex] = createTextVNode(last.text + c);
  7363. } else if (c !== '') {
  7364. // convert primitive to vnode
  7365. res.push(createTextVNode(c));
  7366. }
  7367. } else {
  7368. if (isTextNode(c) && isTextNode(last)) {
  7369. // merge adjacent text nodes
  7370. res[lastIndex] = createTextVNode(last.text + c.text);
  7371. } else {
  7372. // default key for nested array children (likely generated by v-for)
  7373. if (isTrue(children._isVList) &&
  7374. isDef(c.tag) &&
  7375. isUndef(c.key) &&
  7376. isDef(nestedIndex)) {
  7377. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  7378. }
  7379. res.push(c);
  7380. }
  7381. }
  7382. }
  7383. return res
  7384. }
  7385. /* */
  7386. function initProvide (vm) {
  7387. var provide = vm.$options.provide;
  7388. if (provide) {
  7389. vm._provided = typeof provide === 'function'
  7390. ? provide.call(vm)
  7391. : provide;
  7392. }
  7393. }
  7394. function initInjections (vm) {
  7395. var result = resolveInject(vm.$options.inject, vm);
  7396. if (result) {
  7397. toggleObserving(false);
  7398. Object.keys(result).forEach(function (key) {
  7399. /* istanbul ignore else */
  7400. if (true) {
  7401. defineReactive$$1(vm, key, result[key], function () {
  7402. warn(
  7403. "Avoid mutating an injected value directly since the changes will be " +
  7404. "overwritten whenever the provided component re-renders. " +
  7405. "injection being mutated: \"" + key + "\"",
  7406. vm
  7407. );
  7408. });
  7409. } else {}
  7410. });
  7411. toggleObserving(true);
  7412. }
  7413. }
  7414. function resolveInject (inject, vm) {
  7415. if (inject) {
  7416. // inject is :any because flow is not smart enough to figure out cached
  7417. var result = Object.create(null);
  7418. var keys = hasSymbol
  7419. ? Reflect.ownKeys(inject)
  7420. : Object.keys(inject);
  7421. for (var i = 0; i < keys.length; i++) {
  7422. var key = keys[i];
  7423. // #6574 in case the inject object is observed...
  7424. if (key === '__ob__') { continue }
  7425. var provideKey = inject[key].from;
  7426. var source = vm;
  7427. while (source) {
  7428. if (source._provided && hasOwn(source._provided, provideKey)) {
  7429. result[key] = source._provided[provideKey];
  7430. break
  7431. }
  7432. source = source.$parent;
  7433. }
  7434. if (!source) {
  7435. if ('default' in inject[key]) {
  7436. var provideDefault = inject[key].default;
  7437. result[key] = typeof provideDefault === 'function'
  7438. ? provideDefault.call(vm)
  7439. : provideDefault;
  7440. } else if (true) {
  7441. warn(("Injection \"" + key + "\" not found"), vm);
  7442. }
  7443. }
  7444. }
  7445. return result
  7446. }
  7447. }
  7448. /* */
  7449. /**
  7450. * Runtime helper for resolving raw children VNodes into a slot object.
  7451. */
  7452. function resolveSlots (
  7453. children,
  7454. context
  7455. ) {
  7456. if (!children || !children.length) {
  7457. return {}
  7458. }
  7459. var slots = {};
  7460. for (var i = 0, l = children.length; i < l; i++) {
  7461. var child = children[i];
  7462. var data = child.data;
  7463. // remove slot attribute if the node is resolved as a Vue slot node
  7464. if (data && data.attrs && data.attrs.slot) {
  7465. delete data.attrs.slot;
  7466. }
  7467. // named slots should only be respected if the vnode was rendered in the
  7468. // same context.
  7469. if ((child.context === context || child.fnContext === context) &&
  7470. data && data.slot != null
  7471. ) {
  7472. var name = data.slot;
  7473. var slot = (slots[name] || (slots[name] = []));
  7474. if (child.tag === 'template') {
  7475. slot.push.apply(slot, child.children || []);
  7476. } else {
  7477. slot.push(child);
  7478. }
  7479. } else {
  7480. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  7481. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  7482. (slots['page'] || (slots['page'] = [])).push(child);
  7483. }else{
  7484. (slots.default || (slots.default = [])).push(child);
  7485. }
  7486. }
  7487. }
  7488. // ignore slots that contains only whitespace
  7489. for (var name$1 in slots) {
  7490. if (slots[name$1].every(isWhitespace)) {
  7491. delete slots[name$1];
  7492. }
  7493. }
  7494. return slots
  7495. }
  7496. function isWhitespace (node) {
  7497. return (node.isComment && !node.asyncFactory) || node.text === ' '
  7498. }
  7499. /* */
  7500. function normalizeScopedSlots (
  7501. slots,
  7502. normalSlots,
  7503. prevSlots
  7504. ) {
  7505. var res;
  7506. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  7507. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  7508. var key = slots && slots.$key;
  7509. if (!slots) {
  7510. res = {};
  7511. } else if (slots._normalized) {
  7512. // fast path 1: child component re-render only, parent did not change
  7513. return slots._normalized
  7514. } else if (
  7515. isStable &&
  7516. prevSlots &&
  7517. prevSlots !== emptyObject &&
  7518. key === prevSlots.$key &&
  7519. !hasNormalSlots &&
  7520. !prevSlots.$hasNormal
  7521. ) {
  7522. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  7523. // only need to normalize once
  7524. return prevSlots
  7525. } else {
  7526. res = {};
  7527. for (var key$1 in slots) {
  7528. if (slots[key$1] && key$1[0] !== '$') {
  7529. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  7530. }
  7531. }
  7532. }
  7533. // expose normal slots on scopedSlots
  7534. for (var key$2 in normalSlots) {
  7535. if (!(key$2 in res)) {
  7536. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  7537. }
  7538. }
  7539. // avoriaz seems to mock a non-extensible $scopedSlots object
  7540. // and when that is passed down this would cause an error
  7541. if (slots && Object.isExtensible(slots)) {
  7542. (slots)._normalized = res;
  7543. }
  7544. def(res, '$stable', isStable);
  7545. def(res, '$key', key);
  7546. def(res, '$hasNormal', hasNormalSlots);
  7547. return res
  7548. }
  7549. function normalizeScopedSlot(normalSlots, key, fn) {
  7550. var normalized = function () {
  7551. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  7552. res = res && typeof res === 'object' && !Array.isArray(res)
  7553. ? [res] // single vnode
  7554. : normalizeChildren(res);
  7555. return res && (
  7556. res.length === 0 ||
  7557. (res.length === 1 && res[0].isComment) // #9658
  7558. ) ? undefined
  7559. : res
  7560. };
  7561. // this is a slot using the new v-slot syntax without scope. although it is
  7562. // compiled as a scoped slot, render fn users would expect it to be present
  7563. // on this.$slots because the usage is semantically a normal slot.
  7564. if (fn.proxy) {
  7565. Object.defineProperty(normalSlots, key, {
  7566. get: normalized,
  7567. enumerable: true,
  7568. configurable: true
  7569. });
  7570. }
  7571. return normalized
  7572. }
  7573. function proxyNormalSlot(slots, key) {
  7574. return function () { return slots[key]; }
  7575. }
  7576. /* */
  7577. /**
  7578. * Runtime helper for rendering v-for lists.
  7579. */
  7580. function renderList (
  7581. val,
  7582. render
  7583. ) {
  7584. var ret, i, l, keys, key;
  7585. if (Array.isArray(val) || typeof val === 'string') {
  7586. ret = new Array(val.length);
  7587. for (i = 0, l = val.length; i < l; i++) {
  7588. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  7589. }
  7590. } else if (typeof val === 'number') {
  7591. ret = new Array(val);
  7592. for (i = 0; i < val; i++) {
  7593. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  7594. }
  7595. } else if (isObject(val)) {
  7596. if (hasSymbol && val[Symbol.iterator]) {
  7597. ret = [];
  7598. var iterator = val[Symbol.iterator]();
  7599. var result = iterator.next();
  7600. while (!result.done) {
  7601. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  7602. result = iterator.next();
  7603. }
  7604. } else {
  7605. keys = Object.keys(val);
  7606. ret = new Array(keys.length);
  7607. for (i = 0, l = keys.length; i < l; i++) {
  7608. key = keys[i];
  7609. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  7610. }
  7611. }
  7612. }
  7613. if (!isDef(ret)) {
  7614. ret = [];
  7615. }
  7616. (ret)._isVList = true;
  7617. return ret
  7618. }
  7619. /* */
  7620. /**
  7621. * Runtime helper for rendering <slot>
  7622. */
  7623. function renderSlot (
  7624. name,
  7625. fallback,
  7626. props,
  7627. bindObject
  7628. ) {
  7629. var scopedSlotFn = this.$scopedSlots[name];
  7630. var nodes;
  7631. if (scopedSlotFn) { // scoped slot
  7632. props = props || {};
  7633. if (bindObject) {
  7634. if ( true && !isObject(bindObject)) {
  7635. warn(
  7636. 'slot v-bind without argument expects an Object',
  7637. this
  7638. );
  7639. }
  7640. props = extend(extend({}, bindObject), props);
  7641. }
  7642. // fixed by xxxxxx app-plus scopedSlot
  7643. nodes = scopedSlotFn(props, this, props._i) || fallback;
  7644. } else {
  7645. nodes = this.$slots[name] || fallback;
  7646. }
  7647. var target = props && props.slot;
  7648. if (target) {
  7649. return this.$createElement('template', { slot: target }, nodes)
  7650. } else {
  7651. return nodes
  7652. }
  7653. }
  7654. /* */
  7655. /**
  7656. * Runtime helper for resolving filters
  7657. */
  7658. function resolveFilter (id) {
  7659. return resolveAsset(this.$options, 'filters', id, true) || identity
  7660. }
  7661. /* */
  7662. function isKeyNotMatch (expect, actual) {
  7663. if (Array.isArray(expect)) {
  7664. return expect.indexOf(actual) === -1
  7665. } else {
  7666. return expect !== actual
  7667. }
  7668. }
  7669. /**
  7670. * Runtime helper for checking keyCodes from config.
  7671. * exposed as Vue.prototype._k
  7672. * passing in eventKeyName as last argument separately for backwards compat
  7673. */
  7674. function checkKeyCodes (
  7675. eventKeyCode,
  7676. key,
  7677. builtInKeyCode,
  7678. eventKeyName,
  7679. builtInKeyName
  7680. ) {
  7681. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7682. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7683. return isKeyNotMatch(builtInKeyName, eventKeyName)
  7684. } else if (mappedKeyCode) {
  7685. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  7686. } else if (eventKeyName) {
  7687. return hyphenate(eventKeyName) !== key
  7688. }
  7689. }
  7690. /* */
  7691. /**
  7692. * Runtime helper for merging v-bind="object" into a VNode's data.
  7693. */
  7694. function bindObjectProps (
  7695. data,
  7696. tag,
  7697. value,
  7698. asProp,
  7699. isSync
  7700. ) {
  7701. if (value) {
  7702. if (!isObject(value)) {
  7703. true && warn(
  7704. 'v-bind without argument expects an Object or Array value',
  7705. this
  7706. );
  7707. } else {
  7708. if (Array.isArray(value)) {
  7709. value = toObject(value);
  7710. }
  7711. var hash;
  7712. var loop = function ( key ) {
  7713. if (
  7714. key === 'class' ||
  7715. key === 'style' ||
  7716. isReservedAttribute(key)
  7717. ) {
  7718. hash = data;
  7719. } else {
  7720. var type = data.attrs && data.attrs.type;
  7721. hash = asProp || config.mustUseProp(tag, type, key)
  7722. ? data.domProps || (data.domProps = {})
  7723. : data.attrs || (data.attrs = {});
  7724. }
  7725. var camelizedKey = camelize(key);
  7726. var hyphenatedKey = hyphenate(key);
  7727. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  7728. hash[key] = value[key];
  7729. if (isSync) {
  7730. var on = data.on || (data.on = {});
  7731. on[("update:" + key)] = function ($event) {
  7732. value[key] = $event;
  7733. };
  7734. }
  7735. }
  7736. };
  7737. for (var key in value) loop( key );
  7738. }
  7739. }
  7740. return data
  7741. }
  7742. /* */
  7743. /**
  7744. * Runtime helper for rendering static trees.
  7745. */
  7746. function renderStatic (
  7747. index,
  7748. isInFor
  7749. ) {
  7750. var cached = this._staticTrees || (this._staticTrees = []);
  7751. var tree = cached[index];
  7752. // if has already-rendered static tree and not inside v-for,
  7753. // we can reuse the same tree.
  7754. if (tree && !isInFor) {
  7755. return tree
  7756. }
  7757. // otherwise, render a fresh tree.
  7758. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7759. this._renderProxy,
  7760. null,
  7761. this // for render fns generated for functional component templates
  7762. );
  7763. markStatic(tree, ("__static__" + index), false);
  7764. return tree
  7765. }
  7766. /**
  7767. * Runtime helper for v-once.
  7768. * Effectively it means marking the node as static with a unique key.
  7769. */
  7770. function markOnce (
  7771. tree,
  7772. index,
  7773. key
  7774. ) {
  7775. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7776. return tree
  7777. }
  7778. function markStatic (
  7779. tree,
  7780. key,
  7781. isOnce
  7782. ) {
  7783. if (Array.isArray(tree)) {
  7784. for (var i = 0; i < tree.length; i++) {
  7785. if (tree[i] && typeof tree[i] !== 'string') {
  7786. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7787. }
  7788. }
  7789. } else {
  7790. markStaticNode(tree, key, isOnce);
  7791. }
  7792. }
  7793. function markStaticNode (node, key, isOnce) {
  7794. node.isStatic = true;
  7795. node.key = key;
  7796. node.isOnce = isOnce;
  7797. }
  7798. /* */
  7799. function bindObjectListeners (data, value) {
  7800. if (value) {
  7801. if (!isPlainObject(value)) {
  7802. true && warn(
  7803. 'v-on without argument expects an Object value',
  7804. this
  7805. );
  7806. } else {
  7807. var on = data.on = data.on ? extend({}, data.on) : {};
  7808. for (var key in value) {
  7809. var existing = on[key];
  7810. var ours = value[key];
  7811. on[key] = existing ? [].concat(existing, ours) : ours;
  7812. }
  7813. }
  7814. }
  7815. return data
  7816. }
  7817. /* */
  7818. function resolveScopedSlots (
  7819. fns, // see flow/vnode
  7820. res,
  7821. // the following are added in 2.6
  7822. hasDynamicKeys,
  7823. contentHashKey
  7824. ) {
  7825. res = res || { $stable: !hasDynamicKeys };
  7826. for (var i = 0; i < fns.length; i++) {
  7827. var slot = fns[i];
  7828. if (Array.isArray(slot)) {
  7829. resolveScopedSlots(slot, res, hasDynamicKeys);
  7830. } else if (slot) {
  7831. // marker for reverse proxying v-slot without scope on this.$slots
  7832. if (slot.proxy) {
  7833. slot.fn.proxy = true;
  7834. }
  7835. res[slot.key] = slot.fn;
  7836. }
  7837. }
  7838. if (contentHashKey) {
  7839. (res).$key = contentHashKey;
  7840. }
  7841. return res
  7842. }
  7843. /* */
  7844. function bindDynamicKeys (baseObj, values) {
  7845. for (var i = 0; i < values.length; i += 2) {
  7846. var key = values[i];
  7847. if (typeof key === 'string' && key) {
  7848. baseObj[values[i]] = values[i + 1];
  7849. } else if ( true && key !== '' && key !== null) {
  7850. // null is a special value for explicitly removing a binding
  7851. warn(
  7852. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7853. this
  7854. );
  7855. }
  7856. }
  7857. return baseObj
  7858. }
  7859. // helper to dynamically append modifier runtime markers to event names.
  7860. // ensure only append when value is already string, otherwise it will be cast
  7861. // to string and cause the type check to miss.
  7862. function prependModifier (value, symbol) {
  7863. return typeof value === 'string' ? symbol + value : value
  7864. }
  7865. /* */
  7866. function installRenderHelpers (target) {
  7867. target._o = markOnce;
  7868. target._n = toNumber;
  7869. target._s = toString;
  7870. target._l = renderList;
  7871. target._t = renderSlot;
  7872. target._q = looseEqual;
  7873. target._i = looseIndexOf;
  7874. target._m = renderStatic;
  7875. target._f = resolveFilter;
  7876. target._k = checkKeyCodes;
  7877. target._b = bindObjectProps;
  7878. target._v = createTextVNode;
  7879. target._e = createEmptyVNode;
  7880. target._u = resolveScopedSlots;
  7881. target._g = bindObjectListeners;
  7882. target._d = bindDynamicKeys;
  7883. target._p = prependModifier;
  7884. }
  7885. /* */
  7886. function FunctionalRenderContext (
  7887. data,
  7888. props,
  7889. children,
  7890. parent,
  7891. Ctor
  7892. ) {
  7893. var this$1 = this;
  7894. var options = Ctor.options;
  7895. // ensure the createElement function in functional components
  7896. // gets a unique context - this is necessary for correct named slot check
  7897. var contextVm;
  7898. if (hasOwn(parent, '_uid')) {
  7899. contextVm = Object.create(parent);
  7900. // $flow-disable-line
  7901. contextVm._original = parent;
  7902. } else {
  7903. // the context vm passed in is a functional context as well.
  7904. // in this case we want to make sure we are able to get a hold to the
  7905. // real context instance.
  7906. contextVm = parent;
  7907. // $flow-disable-line
  7908. parent = parent._original;
  7909. }
  7910. var isCompiled = isTrue(options._compiled);
  7911. var needNormalization = !isCompiled;
  7912. this.data = data;
  7913. this.props = props;
  7914. this.children = children;
  7915. this.parent = parent;
  7916. this.listeners = data.on || emptyObject;
  7917. this.injections = resolveInject(options.inject, parent);
  7918. this.slots = function () {
  7919. if (!this$1.$slots) {
  7920. normalizeScopedSlots(
  7921. data.scopedSlots,
  7922. this$1.$slots = resolveSlots(children, parent)
  7923. );
  7924. }
  7925. return this$1.$slots
  7926. };
  7927. Object.defineProperty(this, 'scopedSlots', ({
  7928. enumerable: true,
  7929. get: function get () {
  7930. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7931. }
  7932. }));
  7933. // support for compiled functional template
  7934. if (isCompiled) {
  7935. // exposing $options for renderStatic()
  7936. this.$options = options;
  7937. // pre-resolve slots for renderSlot()
  7938. this.$slots = this.slots();
  7939. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7940. }
  7941. if (options._scopeId) {
  7942. this._c = function (a, b, c, d) {
  7943. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7944. if (vnode && !Array.isArray(vnode)) {
  7945. vnode.fnScopeId = options._scopeId;
  7946. vnode.fnContext = parent;
  7947. }
  7948. return vnode
  7949. };
  7950. } else {
  7951. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7952. }
  7953. }
  7954. installRenderHelpers(FunctionalRenderContext.prototype);
  7955. function createFunctionalComponent (
  7956. Ctor,
  7957. propsData,
  7958. data,
  7959. contextVm,
  7960. children
  7961. ) {
  7962. var options = Ctor.options;
  7963. var props = {};
  7964. var propOptions = options.props;
  7965. if (isDef(propOptions)) {
  7966. for (var key in propOptions) {
  7967. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7968. }
  7969. } else {
  7970. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7971. if (isDef(data.props)) { mergeProps(props, data.props); }
  7972. }
  7973. var renderContext = new FunctionalRenderContext(
  7974. data,
  7975. props,
  7976. children,
  7977. contextVm,
  7978. Ctor
  7979. );
  7980. var vnode = options.render.call(null, renderContext._c, renderContext);
  7981. if (vnode instanceof VNode) {
  7982. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7983. } else if (Array.isArray(vnode)) {
  7984. var vnodes = normalizeChildren(vnode) || [];
  7985. var res = new Array(vnodes.length);
  7986. for (var i = 0; i < vnodes.length; i++) {
  7987. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7988. }
  7989. return res
  7990. }
  7991. }
  7992. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7993. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7994. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7995. // that should not be matched to match.
  7996. var clone = cloneVNode(vnode);
  7997. clone.fnContext = contextVm;
  7998. clone.fnOptions = options;
  7999. if (true) {
  8000. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  8001. }
  8002. if (data.slot) {
  8003. (clone.data || (clone.data = {})).slot = data.slot;
  8004. }
  8005. return clone
  8006. }
  8007. function mergeProps (to, from) {
  8008. for (var key in from) {
  8009. to[camelize(key)] = from[key];
  8010. }
  8011. }
  8012. /* */
  8013. /* */
  8014. /* */
  8015. /* */
  8016. // inline hooks to be invoked on component VNodes during patch
  8017. var componentVNodeHooks = {
  8018. init: function init (vnode, hydrating) {
  8019. if (
  8020. vnode.componentInstance &&
  8021. !vnode.componentInstance._isDestroyed &&
  8022. vnode.data.keepAlive
  8023. ) {
  8024. // kept-alive components, treat as a patch
  8025. var mountedNode = vnode; // work around flow
  8026. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  8027. } else {
  8028. var child = vnode.componentInstance = createComponentInstanceForVnode(
  8029. vnode,
  8030. activeInstance
  8031. );
  8032. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  8033. }
  8034. },
  8035. prepatch: function prepatch (oldVnode, vnode) {
  8036. var options = vnode.componentOptions;
  8037. var child = vnode.componentInstance = oldVnode.componentInstance;
  8038. updateChildComponent(
  8039. child,
  8040. options.propsData, // updated props
  8041. options.listeners, // updated listeners
  8042. vnode, // new parent vnode
  8043. options.children // new children
  8044. );
  8045. },
  8046. insert: function insert (vnode) {
  8047. var context = vnode.context;
  8048. var componentInstance = vnode.componentInstance;
  8049. if (!componentInstance._isMounted) {
  8050. callHook(componentInstance, 'onServiceCreated');
  8051. callHook(componentInstance, 'onServiceAttached');
  8052. componentInstance._isMounted = true;
  8053. callHook(componentInstance, 'mounted');
  8054. }
  8055. if (vnode.data.keepAlive) {
  8056. if (context._isMounted) {
  8057. // vue-router#1212
  8058. // During updates, a kept-alive component's child components may
  8059. // change, so directly walking the tree here may call activated hooks
  8060. // on incorrect children. Instead we push them into a queue which will
  8061. // be processed after the whole patch process ended.
  8062. queueActivatedComponent(componentInstance);
  8063. } else {
  8064. activateChildComponent(componentInstance, true /* direct */);
  8065. }
  8066. }
  8067. },
  8068. destroy: function destroy (vnode) {
  8069. var componentInstance = vnode.componentInstance;
  8070. if (!componentInstance._isDestroyed) {
  8071. if (!vnode.data.keepAlive) {
  8072. componentInstance.$destroy();
  8073. } else {
  8074. deactivateChildComponent(componentInstance, true /* direct */);
  8075. }
  8076. }
  8077. }
  8078. };
  8079. var hooksToMerge = Object.keys(componentVNodeHooks);
  8080. function createComponent (
  8081. Ctor,
  8082. data,
  8083. context,
  8084. children,
  8085. tag
  8086. ) {
  8087. if (isUndef(Ctor)) {
  8088. return
  8089. }
  8090. var baseCtor = context.$options._base;
  8091. // plain options object: turn it into a constructor
  8092. if (isObject(Ctor)) {
  8093. Ctor = baseCtor.extend(Ctor);
  8094. }
  8095. // if at this stage it's not a constructor or an async component factory,
  8096. // reject.
  8097. if (typeof Ctor !== 'function') {
  8098. if (true) {
  8099. warn(("Invalid Component definition: " + (String(Ctor))), context);
  8100. }
  8101. return
  8102. }
  8103. // async component
  8104. var asyncFactory;
  8105. if (isUndef(Ctor.cid)) {
  8106. asyncFactory = Ctor;
  8107. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  8108. if (Ctor === undefined) {
  8109. // return a placeholder node for async component, which is rendered
  8110. // as a comment node but preserves all the raw information for the node.
  8111. // the information will be used for async server-rendering and hydration.
  8112. return createAsyncPlaceholder(
  8113. asyncFactory,
  8114. data,
  8115. context,
  8116. children,
  8117. tag
  8118. )
  8119. }
  8120. }
  8121. data = data || {};
  8122. // resolve constructor options in case global mixins are applied after
  8123. // component constructor creation
  8124. resolveConstructorOptions(Ctor);
  8125. // transform component v-model data into props & events
  8126. if (isDef(data.model)) {
  8127. transformModel(Ctor.options, data);
  8128. }
  8129. // extract props
  8130. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  8131. // functional component
  8132. if (isTrue(Ctor.options.functional)) {
  8133. return createFunctionalComponent(Ctor, propsData, data, context, children)
  8134. }
  8135. // extract listeners, since these needs to be treated as
  8136. // child component listeners instead of DOM listeners
  8137. var listeners = data.on;
  8138. // replace with listeners with .native modifier
  8139. // so it gets processed during parent component patch.
  8140. data.on = data.nativeOn;
  8141. if (isTrue(Ctor.options.abstract)) {
  8142. // abstract components do not keep anything
  8143. // other than props & listeners & slot
  8144. // work around flow
  8145. var slot = data.slot;
  8146. data = {};
  8147. if (slot) {
  8148. data.slot = slot;
  8149. }
  8150. }
  8151. // install component management hooks onto the placeholder node
  8152. installComponentHooks(data);
  8153. // return a placeholder vnode
  8154. var name = Ctor.options.name || tag;
  8155. var vnode = new VNode(
  8156. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  8157. data, undefined, undefined, undefined, context,
  8158. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  8159. asyncFactory
  8160. );
  8161. return vnode
  8162. }
  8163. function createComponentInstanceForVnode (
  8164. vnode, // we know it's MountedComponentVNode but flow doesn't
  8165. parent // activeInstance in lifecycle state
  8166. ) {
  8167. var options = {
  8168. _isComponent: true,
  8169. _parentVnode: vnode,
  8170. parent: parent
  8171. };
  8172. // check inline-template render functions
  8173. var inlineTemplate = vnode.data.inlineTemplate;
  8174. if (isDef(inlineTemplate)) {
  8175. options.render = inlineTemplate.render;
  8176. options.staticRenderFns = inlineTemplate.staticRenderFns;
  8177. }
  8178. return new vnode.componentOptions.Ctor(options)
  8179. }
  8180. function installComponentHooks (data) {
  8181. var hooks = data.hook || (data.hook = {});
  8182. for (var i = 0; i < hooksToMerge.length; i++) {
  8183. var key = hooksToMerge[i];
  8184. var existing = hooks[key];
  8185. var toMerge = componentVNodeHooks[key];
  8186. if (existing !== toMerge && !(existing && existing._merged)) {
  8187. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  8188. }
  8189. }
  8190. }
  8191. function mergeHook$1 (f1, f2) {
  8192. var merged = function (a, b) {
  8193. // flow complains about extra args which is why we use any
  8194. f1(a, b);
  8195. f2(a, b);
  8196. };
  8197. merged._merged = true;
  8198. return merged
  8199. }
  8200. // transform component v-model info (value and callback) into
  8201. // prop and event handler respectively.
  8202. function transformModel (options, data) {
  8203. var prop = (options.model && options.model.prop) || 'value';
  8204. var event = (options.model && options.model.event) || 'input'
  8205. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  8206. var on = data.on || (data.on = {});
  8207. var existing = on[event];
  8208. var callback = data.model.callback;
  8209. if (isDef(existing)) {
  8210. if (
  8211. Array.isArray(existing)
  8212. ? existing.indexOf(callback) === -1
  8213. : existing !== callback
  8214. ) {
  8215. on[event] = [callback].concat(existing);
  8216. }
  8217. } else {
  8218. on[event] = callback;
  8219. }
  8220. }
  8221. /* */
  8222. var SIMPLE_NORMALIZE = 1;
  8223. var ALWAYS_NORMALIZE = 2;
  8224. // wrapper function for providing a more flexible interface
  8225. // without getting yelled at by flow
  8226. function createElement (
  8227. context,
  8228. tag,
  8229. data,
  8230. children,
  8231. normalizationType,
  8232. alwaysNormalize
  8233. ) {
  8234. if (Array.isArray(data) || isPrimitive(data)) {
  8235. normalizationType = children;
  8236. children = data;
  8237. data = undefined;
  8238. }
  8239. if (isTrue(alwaysNormalize)) {
  8240. normalizationType = ALWAYS_NORMALIZE;
  8241. }
  8242. return _createElement(context, tag, data, children, normalizationType)
  8243. }
  8244. function _createElement (
  8245. context,
  8246. tag,
  8247. data,
  8248. children,
  8249. normalizationType
  8250. ) {
  8251. if (isDef(data) && isDef((data).__ob__)) {
  8252. true && warn(
  8253. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  8254. 'Always create fresh vnode data objects in each render!',
  8255. context
  8256. );
  8257. return createEmptyVNode()
  8258. }
  8259. // object syntax in v-bind
  8260. if (isDef(data) && isDef(data.is)) {
  8261. tag = data.is;
  8262. }
  8263. if (!tag) {
  8264. // in case of component :is set to falsy value
  8265. return createEmptyVNode()
  8266. }
  8267. // warn against non-primitive key
  8268. if ( true &&
  8269. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  8270. ) {
  8271. {
  8272. warn(
  8273. 'Avoid using non-primitive value as key, ' +
  8274. 'use string/number value instead.',
  8275. context
  8276. );
  8277. }
  8278. }
  8279. // support single function children as default scoped slot
  8280. if (Array.isArray(children) &&
  8281. typeof children[0] === 'function'
  8282. ) {
  8283. data = data || {};
  8284. data.scopedSlots = { default: children[0] };
  8285. children.length = 0;
  8286. }
  8287. if (normalizationType === ALWAYS_NORMALIZE) {
  8288. children = normalizeChildren(children);
  8289. } else if (normalizationType === SIMPLE_NORMALIZE) {
  8290. children = simpleNormalizeChildren(children);
  8291. }
  8292. var vnode, ns;
  8293. if (typeof tag === 'string') {
  8294. var Ctor;
  8295. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  8296. if (config.isReservedTag(tag)) {
  8297. // platform built-in elements
  8298. if ( true && isDef(data) && isDef(data.nativeOn)) {
  8299. warn(
  8300. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  8301. context
  8302. );
  8303. }
  8304. vnode = new VNode(
  8305. config.parsePlatformTagName(tag), data, children,
  8306. undefined, undefined, context
  8307. );
  8308. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  8309. // component
  8310. vnode = createComponent(Ctor, data, context, children, tag);
  8311. } else {
  8312. // unknown or unlisted namespaced elements
  8313. // check at runtime because it may get assigned a namespace when its
  8314. // parent normalizes children
  8315. vnode = new VNode(
  8316. tag, data, children,
  8317. undefined, undefined, context
  8318. );
  8319. }
  8320. } else {
  8321. // direct component options / constructor
  8322. vnode = createComponent(tag, data, context, children);
  8323. }
  8324. if (Array.isArray(vnode)) {
  8325. return vnode
  8326. } else if (isDef(vnode)) {
  8327. if (isDef(ns)) { applyNS(vnode, ns); }
  8328. if (isDef(data)) { registerDeepBindings(data); }
  8329. return vnode
  8330. } else {
  8331. return createEmptyVNode()
  8332. }
  8333. }
  8334. function applyNS (vnode, ns, force) {
  8335. vnode.ns = ns;
  8336. if (vnode.tag === 'foreignObject') {
  8337. // use default namespace inside foreignObject
  8338. ns = undefined;
  8339. force = true;
  8340. }
  8341. if (isDef(vnode.children)) {
  8342. for (var i = 0, l = vnode.children.length; i < l; i++) {
  8343. var child = vnode.children[i];
  8344. if (isDef(child.tag) && (
  8345. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  8346. applyNS(child, ns, force);
  8347. }
  8348. }
  8349. }
  8350. }
  8351. // ref #5318
  8352. // necessary to ensure parent re-render when deep bindings like :style and
  8353. // :class are used on slot nodes
  8354. function registerDeepBindings (data) {
  8355. if (isObject(data.style)) {
  8356. traverse(data.style);
  8357. }
  8358. if (isObject(data.class)) {
  8359. traverse(data.class);
  8360. }
  8361. }
  8362. /* */
  8363. function initRender (vm) {
  8364. vm._vnode = null; // the root of the child tree
  8365. vm._staticTrees = null; // v-once cached trees
  8366. var options = vm.$options;
  8367. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  8368. var renderContext = parentVnode && parentVnode.context;
  8369. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  8370. vm.$scopedSlots = emptyObject;
  8371. // bind the createElement fn to this instance
  8372. // so that we get proper render context inside it.
  8373. // args order: tag, data, children, normalizationType, alwaysNormalize
  8374. // internal version is used by render functions compiled from templates
  8375. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  8376. // normalization is always applied for the public version, used in
  8377. // user-written render functions.
  8378. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  8379. // $attrs & $listeners are exposed for easier HOC creation.
  8380. // they need to be reactive so that HOCs using them are always updated
  8381. var parentData = parentVnode && parentVnode.data;
  8382. /* istanbul ignore else */
  8383. if (true) {
  8384. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  8385. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  8386. }, true);
  8387. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  8388. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  8389. }, true);
  8390. } else {}
  8391. }
  8392. var currentRenderingInstance = null;
  8393. function renderMixin (Vue) {
  8394. // install runtime convenience helpers
  8395. installRenderHelpers(Vue.prototype);
  8396. Vue.prototype.$nextTick = function (fn) {
  8397. return nextTick(fn, this)
  8398. };
  8399. Vue.prototype._render = function () {
  8400. var vm = this;
  8401. var ref = vm.$options;
  8402. var render = ref.render;
  8403. var _parentVnode = ref._parentVnode;
  8404. if (_parentVnode) {
  8405. vm.$scopedSlots = normalizeScopedSlots(
  8406. _parentVnode.data.scopedSlots,
  8407. vm.$slots,
  8408. vm.$scopedSlots
  8409. );
  8410. }
  8411. // set parent vnode. this allows render functions to have access
  8412. // to the data on the placeholder node.
  8413. vm.$vnode = _parentVnode;
  8414. // render self
  8415. var vnode;
  8416. try {
  8417. // There's no need to maintain a stack because all render fns are called
  8418. // separately from one another. Nested component's render fns are called
  8419. // when parent component is patched.
  8420. currentRenderingInstance = vm;
  8421. vnode = render.call(vm._renderProxy, vm.$createElement);
  8422. } catch (e) {
  8423. handleError(e, vm, "render");
  8424. // return error render result,
  8425. // or previous vnode to prevent render error causing blank component
  8426. /* istanbul ignore else */
  8427. if ( true && vm.$options.renderError) {
  8428. try {
  8429. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  8430. } catch (e) {
  8431. handleError(e, vm, "renderError");
  8432. vnode = vm._vnode;
  8433. }
  8434. } else {
  8435. vnode = vm._vnode;
  8436. }
  8437. } finally {
  8438. currentRenderingInstance = null;
  8439. }
  8440. // if the returned array contains only a single node, allow it
  8441. if (Array.isArray(vnode) && vnode.length === 1) {
  8442. vnode = vnode[0];
  8443. }
  8444. // return empty vnode in case the render function errored out
  8445. if (!(vnode instanceof VNode)) {
  8446. if ( true && Array.isArray(vnode)) {
  8447. warn(
  8448. 'Multiple root nodes returned from render function. Render function ' +
  8449. 'should return a single root node.',
  8450. vm
  8451. );
  8452. }
  8453. vnode = createEmptyVNode();
  8454. }
  8455. // set parent
  8456. vnode.parent = _parentVnode;
  8457. return vnode
  8458. };
  8459. }
  8460. /* */
  8461. function ensureCtor (comp, base) {
  8462. if (
  8463. comp.__esModule ||
  8464. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  8465. ) {
  8466. comp = comp.default;
  8467. }
  8468. return isObject(comp)
  8469. ? base.extend(comp)
  8470. : comp
  8471. }
  8472. function createAsyncPlaceholder (
  8473. factory,
  8474. data,
  8475. context,
  8476. children,
  8477. tag
  8478. ) {
  8479. var node = createEmptyVNode();
  8480. node.asyncFactory = factory;
  8481. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  8482. return node
  8483. }
  8484. function resolveAsyncComponent (
  8485. factory,
  8486. baseCtor
  8487. ) {
  8488. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  8489. return factory.errorComp
  8490. }
  8491. if (isDef(factory.resolved)) {
  8492. return factory.resolved
  8493. }
  8494. var owner = currentRenderingInstance;
  8495. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  8496. // already pending
  8497. factory.owners.push(owner);
  8498. }
  8499. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  8500. return factory.loadingComp
  8501. }
  8502. if (owner && !isDef(factory.owners)) {
  8503. var owners = factory.owners = [owner];
  8504. var sync = true;
  8505. var timerLoading = null;
  8506. var timerTimeout = null
  8507. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  8508. var forceRender = function (renderCompleted) {
  8509. for (var i = 0, l = owners.length; i < l; i++) {
  8510. (owners[i]).$forceUpdate();
  8511. }
  8512. if (renderCompleted) {
  8513. owners.length = 0;
  8514. if (timerLoading !== null) {
  8515. clearTimeout(timerLoading);
  8516. timerLoading = null;
  8517. }
  8518. if (timerTimeout !== null) {
  8519. clearTimeout(timerTimeout);
  8520. timerTimeout = null;
  8521. }
  8522. }
  8523. };
  8524. var resolve = once(function (res) {
  8525. // cache resolved
  8526. factory.resolved = ensureCtor(res, baseCtor);
  8527. // invoke callbacks only if this is not a synchronous resolve
  8528. // (async resolves are shimmed as synchronous during SSR)
  8529. if (!sync) {
  8530. forceRender(true);
  8531. } else {
  8532. owners.length = 0;
  8533. }
  8534. });
  8535. var reject = once(function (reason) {
  8536. true && warn(
  8537. "Failed to resolve async component: " + (String(factory)) +
  8538. (reason ? ("\nReason: " + reason) : '')
  8539. );
  8540. if (isDef(factory.errorComp)) {
  8541. factory.error = true;
  8542. forceRender(true);
  8543. }
  8544. });
  8545. var res = factory(resolve, reject);
  8546. if (isObject(res)) {
  8547. if (isPromise(res)) {
  8548. // () => Promise
  8549. if (isUndef(factory.resolved)) {
  8550. res.then(resolve, reject);
  8551. }
  8552. } else if (isPromise(res.component)) {
  8553. res.component.then(resolve, reject);
  8554. if (isDef(res.error)) {
  8555. factory.errorComp = ensureCtor(res.error, baseCtor);
  8556. }
  8557. if (isDef(res.loading)) {
  8558. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  8559. if (res.delay === 0) {
  8560. factory.loading = true;
  8561. } else {
  8562. timerLoading = setTimeout(function () {
  8563. timerLoading = null;
  8564. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  8565. factory.loading = true;
  8566. forceRender(false);
  8567. }
  8568. }, res.delay || 200);
  8569. }
  8570. }
  8571. if (isDef(res.timeout)) {
  8572. timerTimeout = setTimeout(function () {
  8573. timerTimeout = null;
  8574. if (isUndef(factory.resolved)) {
  8575. reject(
  8576. true
  8577. ? ("timeout (" + (res.timeout) + "ms)")
  8578. : undefined
  8579. );
  8580. }
  8581. }, res.timeout);
  8582. }
  8583. }
  8584. }
  8585. sync = false;
  8586. // return in case resolved synchronously
  8587. return factory.loading
  8588. ? factory.loadingComp
  8589. : factory.resolved
  8590. }
  8591. }
  8592. /* */
  8593. function isAsyncPlaceholder (node) {
  8594. return node.isComment && node.asyncFactory
  8595. }
  8596. /* */
  8597. function getFirstComponentChild (children) {
  8598. if (Array.isArray(children)) {
  8599. for (var i = 0; i < children.length; i++) {
  8600. var c = children[i];
  8601. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  8602. return c
  8603. }
  8604. }
  8605. }
  8606. }
  8607. /* */
  8608. /* */
  8609. function initEvents (vm) {
  8610. vm._events = Object.create(null);
  8611. vm._hasHookEvent = false;
  8612. // init parent attached events
  8613. var listeners = vm.$options._parentListeners;
  8614. if (listeners) {
  8615. updateComponentListeners(vm, listeners);
  8616. }
  8617. }
  8618. var target;
  8619. function add (event, fn) {
  8620. target.$on(event, fn);
  8621. }
  8622. function remove$1 (event, fn) {
  8623. target.$off(event, fn);
  8624. }
  8625. function createOnceHandler (event, fn) {
  8626. var _target = target;
  8627. return function onceHandler () {
  8628. var res = fn.apply(null, arguments);
  8629. if (res !== null) {
  8630. _target.$off(event, onceHandler);
  8631. }
  8632. }
  8633. }
  8634. function updateComponentListeners (
  8635. vm,
  8636. listeners,
  8637. oldListeners
  8638. ) {
  8639. target = vm;
  8640. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  8641. target = undefined;
  8642. }
  8643. function eventsMixin (Vue) {
  8644. var hookRE = /^hook:/;
  8645. Vue.prototype.$on = function (event, fn) {
  8646. var vm = this;
  8647. if (Array.isArray(event)) {
  8648. for (var i = 0, l = event.length; i < l; i++) {
  8649. vm.$on(event[i], fn);
  8650. }
  8651. } else {
  8652. (vm._events[event] || (vm._events[event] = [])).push(fn);
  8653. // optimize hook:event cost by using a boolean flag marked at registration
  8654. // instead of a hash lookup
  8655. if (hookRE.test(event)) {
  8656. vm._hasHookEvent = true;
  8657. }
  8658. }
  8659. return vm
  8660. };
  8661. Vue.prototype.$once = function (event, fn) {
  8662. var vm = this;
  8663. function on () {
  8664. vm.$off(event, on);
  8665. fn.apply(vm, arguments);
  8666. }
  8667. on.fn = fn;
  8668. vm.$on(event, on);
  8669. return vm
  8670. };
  8671. Vue.prototype.$off = function (event, fn) {
  8672. var vm = this;
  8673. // all
  8674. if (!arguments.length) {
  8675. vm._events = Object.create(null);
  8676. return vm
  8677. }
  8678. // array of events
  8679. if (Array.isArray(event)) {
  8680. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  8681. vm.$off(event[i$1], fn);
  8682. }
  8683. return vm
  8684. }
  8685. // specific event
  8686. var cbs = vm._events[event];
  8687. if (!cbs) {
  8688. return vm
  8689. }
  8690. if (!fn) {
  8691. vm._events[event] = null;
  8692. return vm
  8693. }
  8694. // specific handler
  8695. var cb;
  8696. var i = cbs.length;
  8697. while (i--) {
  8698. cb = cbs[i];
  8699. if (cb === fn || cb.fn === fn) {
  8700. cbs.splice(i, 1);
  8701. break
  8702. }
  8703. }
  8704. return vm
  8705. };
  8706. Vue.prototype.$emit = function (event) {
  8707. var vm = this;
  8708. if (true) {
  8709. var lowerCaseEvent = event.toLowerCase();
  8710. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  8711. tip(
  8712. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  8713. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  8714. "Note that HTML attributes are case-insensitive and you cannot use " +
  8715. "v-on to listen to camelCase events when using in-DOM templates. " +
  8716. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  8717. );
  8718. }
  8719. }
  8720. var cbs = vm._events[event];
  8721. if (cbs) {
  8722. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  8723. var args = toArray(arguments, 1);
  8724. var info = "event handler for \"" + event + "\"";
  8725. for (var i = 0, l = cbs.length; i < l; i++) {
  8726. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  8727. }
  8728. }
  8729. return vm
  8730. };
  8731. }
  8732. /* */
  8733. var activeInstance = null;
  8734. var isUpdatingChildComponent = false;
  8735. function setActiveInstance(vm) {
  8736. var prevActiveInstance = activeInstance;
  8737. activeInstance = vm;
  8738. return function () {
  8739. activeInstance = prevActiveInstance;
  8740. }
  8741. }
  8742. function initLifecycle (vm) {
  8743. var options = vm.$options;
  8744. // locate first non-abstract parent
  8745. var parent = options.parent;
  8746. if (parent && !options.abstract) {
  8747. while (parent.$options.abstract && parent.$parent) {
  8748. parent = parent.$parent;
  8749. }
  8750. parent.$children.push(vm);
  8751. }
  8752. vm.$parent = parent;
  8753. vm.$root = parent ? parent.$root : vm;
  8754. vm.$children = [];
  8755. vm.$refs = {};
  8756. vm._watcher = null;
  8757. vm._inactive = null;
  8758. vm._directInactive = false;
  8759. vm._isMounted = false;
  8760. vm._isDestroyed = false;
  8761. vm._isBeingDestroyed = false;
  8762. }
  8763. function lifecycleMixin (Vue) {
  8764. Vue.prototype._update = function (vnode, hydrating) {
  8765. var vm = this;
  8766. var prevEl = vm.$el;
  8767. var prevVnode = vm._vnode;
  8768. var restoreActiveInstance = setActiveInstance(vm);
  8769. vm._vnode = vnode;
  8770. // Vue.prototype.__patch__ is injected in entry points
  8771. // based on the rendering backend used.
  8772. if (!prevVnode) {
  8773. // initial render
  8774. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8775. } else {
  8776. // updates
  8777. vm.$el = vm.__patch__(prevVnode, vnode);
  8778. }
  8779. restoreActiveInstance();
  8780. // update __vue__ reference
  8781. if (prevEl) {
  8782. prevEl.__vue__ = null;
  8783. }
  8784. if (vm.$el) {
  8785. vm.$el.__vue__ = vm;
  8786. }
  8787. // if parent is an HOC, update its $el as well
  8788. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8789. vm.$parent.$el = vm.$el;
  8790. }
  8791. // updated hook is called by the scheduler to ensure that children are
  8792. // updated in a parent's updated hook.
  8793. };
  8794. Vue.prototype.$forceUpdate = function () {
  8795. var vm = this;
  8796. if (vm._watcher) {
  8797. vm._watcher.update();
  8798. }
  8799. };
  8800. Vue.prototype.$destroy = function () {
  8801. var vm = this;
  8802. if (vm._isBeingDestroyed) {
  8803. return
  8804. }
  8805. callHook(vm, 'beforeDestroy');
  8806. vm._isBeingDestroyed = true;
  8807. // remove self from parent
  8808. var parent = vm.$parent;
  8809. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8810. remove(parent.$children, vm);
  8811. }
  8812. // teardown watchers
  8813. if (vm._watcher) {
  8814. vm._watcher.teardown();
  8815. }
  8816. var i = vm._watchers.length;
  8817. while (i--) {
  8818. vm._watchers[i].teardown();
  8819. }
  8820. // remove reference from data ob
  8821. // frozen object may not have observer.
  8822. if (vm._data.__ob__) {
  8823. vm._data.__ob__.vmCount--;
  8824. }
  8825. // call the last hook...
  8826. vm._isDestroyed = true;
  8827. // invoke destroy hooks on current rendered tree
  8828. vm.__patch__(vm._vnode, null);
  8829. // fire destroyed hook
  8830. callHook(vm, 'destroyed');
  8831. // turn off all instance listeners.
  8832. vm.$off();
  8833. // remove __vue__ reference
  8834. if (vm.$el) {
  8835. vm.$el.__vue__ = null;
  8836. }
  8837. // release circular reference (#6759)
  8838. if (vm.$vnode) {
  8839. vm.$vnode.parent = null;
  8840. }
  8841. };
  8842. }
  8843. function updateChildComponent (
  8844. vm,
  8845. propsData,
  8846. listeners,
  8847. parentVnode,
  8848. renderChildren
  8849. ) {
  8850. if (true) {
  8851. isUpdatingChildComponent = true;
  8852. }
  8853. // determine whether component has slot children
  8854. // we need to do this before overwriting $options._renderChildren.
  8855. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8856. // dynamic slot names). Static scoped slots compiled from template has the
  8857. // "$stable" marker.
  8858. var newScopedSlots = parentVnode.data.scopedSlots;
  8859. var oldScopedSlots = vm.$scopedSlots;
  8860. var hasDynamicScopedSlot = !!(
  8861. (newScopedSlots && !newScopedSlots.$stable) ||
  8862. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8863. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8864. );
  8865. // Any static slot children from the parent may have changed during parent's
  8866. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8867. // update is necessary to ensure correctness.
  8868. var needsForceUpdate = !!(
  8869. renderChildren || // has new static slots
  8870. vm.$options._renderChildren || // has old static slots
  8871. hasDynamicScopedSlot
  8872. );
  8873. vm.$options._parentVnode = parentVnode;
  8874. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8875. if (vm._vnode) { // update child tree's parent
  8876. vm._vnode.parent = parentVnode;
  8877. }
  8878. vm.$options._renderChildren = renderChildren;
  8879. // update $attrs and $listeners hash
  8880. // these are also reactive so they may trigger child update if the child
  8881. // used them during render
  8882. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8883. vm.$listeners = listeners || emptyObject;
  8884. // update props
  8885. if (propsData && vm.$options.props) {
  8886. toggleObserving(false);
  8887. var props = vm._props;
  8888. var propKeys = vm.$options._propKeys || [];
  8889. for (var i = 0; i < propKeys.length; i++) {
  8890. var key = propKeys[i];
  8891. var propOptions = vm.$options.props; // wtf flow?
  8892. props[key] = validateProp(key, propOptions, propsData, vm);
  8893. }
  8894. toggleObserving(true);
  8895. // keep a copy of raw propsData
  8896. vm.$options.propsData = propsData;
  8897. }
  8898. // fixed by xxxxxx update properties(mp runtime)
  8899. vm._$updateProperties && vm._$updateProperties(vm);
  8900. // update listeners
  8901. listeners = listeners || emptyObject;
  8902. var oldListeners = vm.$options._parentListeners;
  8903. vm.$options._parentListeners = listeners;
  8904. updateComponentListeners(vm, listeners, oldListeners);
  8905. // resolve slots + force update if has children
  8906. if (needsForceUpdate) {
  8907. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8908. vm.$forceUpdate();
  8909. }
  8910. if (true) {
  8911. isUpdatingChildComponent = false;
  8912. }
  8913. }
  8914. function isInInactiveTree (vm) {
  8915. while (vm && (vm = vm.$parent)) {
  8916. if (vm._inactive) { return true }
  8917. }
  8918. return false
  8919. }
  8920. function activateChildComponent (vm, direct) {
  8921. if (direct) {
  8922. vm._directInactive = false;
  8923. if (isInInactiveTree(vm)) {
  8924. return
  8925. }
  8926. } else if (vm._directInactive) {
  8927. return
  8928. }
  8929. if (vm._inactive || vm._inactive === null) {
  8930. vm._inactive = false;
  8931. for (var i = 0; i < vm.$children.length; i++) {
  8932. activateChildComponent(vm.$children[i]);
  8933. }
  8934. callHook(vm, 'activated');
  8935. }
  8936. }
  8937. function deactivateChildComponent (vm, direct) {
  8938. if (direct) {
  8939. vm._directInactive = true;
  8940. if (isInInactiveTree(vm)) {
  8941. return
  8942. }
  8943. }
  8944. if (!vm._inactive) {
  8945. vm._inactive = true;
  8946. for (var i = 0; i < vm.$children.length; i++) {
  8947. deactivateChildComponent(vm.$children[i]);
  8948. }
  8949. callHook(vm, 'deactivated');
  8950. }
  8951. }
  8952. function callHook (vm, hook) {
  8953. // #7573 disable dep collection when invoking lifecycle hooks
  8954. pushTarget();
  8955. var handlers = vm.$options[hook];
  8956. var info = hook + " hook";
  8957. if (handlers) {
  8958. for (var i = 0, j = handlers.length; i < j; i++) {
  8959. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8960. }
  8961. }
  8962. if (vm._hasHookEvent) {
  8963. vm.$emit('hook:' + hook);
  8964. }
  8965. popTarget();
  8966. }
  8967. /* */
  8968. var MAX_UPDATE_COUNT = 100;
  8969. var queue = [];
  8970. var activatedChildren = [];
  8971. var has = {};
  8972. var circular = {};
  8973. var waiting = false;
  8974. var flushing = false;
  8975. var index = 0;
  8976. /**
  8977. * Reset the scheduler's state.
  8978. */
  8979. function resetSchedulerState () {
  8980. index = queue.length = activatedChildren.length = 0;
  8981. has = {};
  8982. if (true) {
  8983. circular = {};
  8984. }
  8985. waiting = flushing = false;
  8986. }
  8987. // Async edge case #6566 requires saving the timestamp when event listeners are
  8988. // attached. However, calling performance.now() has a perf overhead especially
  8989. // if the page has thousands of event listeners. Instead, we take a timestamp
  8990. // every time the scheduler flushes and use that for all event listeners
  8991. // attached during that flush.
  8992. var currentFlushTimestamp = 0;
  8993. // Async edge case fix requires storing an event listener's attach timestamp.
  8994. var getNow = Date.now;
  8995. // Determine what event timestamp the browser is using. Annoyingly, the
  8996. // timestamp can either be hi-res (relative to page load) or low-res
  8997. // (relative to UNIX epoch), so in order to compare time we have to use the
  8998. // same timestamp type when saving the flush timestamp.
  8999. // All IE versions use low-res event timestamps, and have problematic clock
  9000. // implementations (#9632)
  9001. if (inBrowser && !isIE) {
  9002. var performance = window.performance;
  9003. if (
  9004. performance &&
  9005. typeof performance.now === 'function' &&
  9006. getNow() > document.createEvent('Event').timeStamp
  9007. ) {
  9008. // if the event timestamp, although evaluated AFTER the Date.now(), is
  9009. // smaller than it, it means the event is using a hi-res timestamp,
  9010. // and we need to use the hi-res version for event listener timestamps as
  9011. // well.
  9012. getNow = function () { return performance.now(); };
  9013. }
  9014. }
  9015. /**
  9016. * Flush both queues and run the watchers.
  9017. */
  9018. function flushSchedulerQueue () {
  9019. currentFlushTimestamp = getNow();
  9020. flushing = true;
  9021. var watcher, id;
  9022. // Sort queue before flush.
  9023. // This ensures that:
  9024. // 1. Components are updated from parent to child. (because parent is always
  9025. // created before the child)
  9026. // 2. A component's user watchers are run before its render watcher (because
  9027. // user watchers are created before the render watcher)
  9028. // 3. If a component is destroyed during a parent component's watcher run,
  9029. // its watchers can be skipped.
  9030. queue.sort(function (a, b) { return a.id - b.id; });
  9031. // do not cache length because more watchers might be pushed
  9032. // as we run existing watchers
  9033. for (index = 0; index < queue.length; index++) {
  9034. watcher = queue[index];
  9035. if (watcher.before) {
  9036. watcher.before();
  9037. }
  9038. id = watcher.id;
  9039. has[id] = null;
  9040. watcher.run();
  9041. // in dev build, check and stop circular updates.
  9042. if ( true && has[id] != null) {
  9043. circular[id] = (circular[id] || 0) + 1;
  9044. if (circular[id] > MAX_UPDATE_COUNT) {
  9045. warn(
  9046. 'You may have an infinite update loop ' + (
  9047. watcher.user
  9048. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  9049. : "in a component render function."
  9050. ),
  9051. watcher.vm
  9052. );
  9053. break
  9054. }
  9055. }
  9056. }
  9057. // keep copies of post queues before resetting state
  9058. var activatedQueue = activatedChildren.slice();
  9059. var updatedQueue = queue.slice();
  9060. resetSchedulerState();
  9061. // call component updated and activated hooks
  9062. callActivatedHooks(activatedQueue);
  9063. callUpdatedHooks(updatedQueue);
  9064. // devtool hook
  9065. /* istanbul ignore if */
  9066. if (devtools && config.devtools) {
  9067. devtools.emit('flush');
  9068. }
  9069. }
  9070. function callUpdatedHooks (queue) {
  9071. var i = queue.length;
  9072. while (i--) {
  9073. var watcher = queue[i];
  9074. var vm = watcher.vm;
  9075. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  9076. callHook(vm, 'updated');
  9077. }
  9078. }
  9079. }
  9080. /**
  9081. * Queue a kept-alive component that was activated during patch.
  9082. * The queue will be processed after the entire tree has been patched.
  9083. */
  9084. function queueActivatedComponent (vm) {
  9085. // setting _inactive to false here so that a render function can
  9086. // rely on checking whether it's in an inactive tree (e.g. router-view)
  9087. vm._inactive = false;
  9088. activatedChildren.push(vm);
  9089. }
  9090. function callActivatedHooks (queue) {
  9091. for (var i = 0; i < queue.length; i++) {
  9092. queue[i]._inactive = true;
  9093. activateChildComponent(queue[i], true /* true */);
  9094. }
  9095. }
  9096. /**
  9097. * Push a watcher into the watcher queue.
  9098. * Jobs with duplicate IDs will be skipped unless it's
  9099. * pushed when the queue is being flushed.
  9100. */
  9101. function queueWatcher (watcher) {
  9102. var id = watcher.id;
  9103. if (has[id] == null) {
  9104. has[id] = true;
  9105. if (!flushing) {
  9106. queue.push(watcher);
  9107. } else {
  9108. // if already flushing, splice the watcher based on its id
  9109. // if already past its id, it will be run next immediately.
  9110. var i = queue.length - 1;
  9111. while (i > index && queue[i].id > watcher.id) {
  9112. i--;
  9113. }
  9114. queue.splice(i + 1, 0, watcher);
  9115. }
  9116. // queue the flush
  9117. if (!waiting) {
  9118. waiting = true;
  9119. if ( true && !config.async) {
  9120. flushSchedulerQueue();
  9121. return
  9122. }
  9123. nextTick(flushSchedulerQueue);
  9124. }
  9125. }
  9126. }
  9127. /* */
  9128. var uid$2 = 0;
  9129. /**
  9130. * A watcher parses an expression, collects dependencies,
  9131. * and fires callback when the expression value changes.
  9132. * This is used for both the $watch() api and directives.
  9133. */
  9134. var Watcher = function Watcher (
  9135. vm,
  9136. expOrFn,
  9137. cb,
  9138. options,
  9139. isRenderWatcher
  9140. ) {
  9141. this.vm = vm;
  9142. if (isRenderWatcher) {
  9143. vm._watcher = this;
  9144. }
  9145. vm._watchers.push(this);
  9146. // options
  9147. if (options) {
  9148. this.deep = !!options.deep;
  9149. this.user = !!options.user;
  9150. this.lazy = !!options.lazy;
  9151. this.sync = !!options.sync;
  9152. this.before = options.before;
  9153. } else {
  9154. this.deep = this.user = this.lazy = this.sync = false;
  9155. }
  9156. this.cb = cb;
  9157. this.id = ++uid$2; // uid for batching
  9158. this.active = true;
  9159. this.dirty = this.lazy; // for lazy watchers
  9160. this.deps = [];
  9161. this.newDeps = [];
  9162. this.depIds = new _Set();
  9163. this.newDepIds = new _Set();
  9164. this.expression = true
  9165. ? expOrFn.toString()
  9166. : undefined;
  9167. // parse expression for getter
  9168. if (typeof expOrFn === 'function') {
  9169. this.getter = expOrFn;
  9170. } else {
  9171. this.getter = parsePath(expOrFn);
  9172. if (!this.getter) {
  9173. this.getter = noop;
  9174. true && warn(
  9175. "Failed watching path: \"" + expOrFn + "\" " +
  9176. 'Watcher only accepts simple dot-delimited paths. ' +
  9177. 'For full control, use a function instead.',
  9178. vm
  9179. );
  9180. }
  9181. }
  9182. this.value = this.lazy
  9183. ? undefined
  9184. : this.get();
  9185. };
  9186. /**
  9187. * Evaluate the getter, and re-collect dependencies.
  9188. */
  9189. Watcher.prototype.get = function get () {
  9190. pushTarget(this);
  9191. var value;
  9192. var vm = this.vm;
  9193. try {
  9194. value = this.getter.call(vm, vm);
  9195. } catch (e) {
  9196. if (this.user) {
  9197. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  9198. } else {
  9199. throw e
  9200. }
  9201. } finally {
  9202. // "touch" every property so they are all tracked as
  9203. // dependencies for deep watching
  9204. if (this.deep) {
  9205. traverse(value);
  9206. }
  9207. popTarget();
  9208. this.cleanupDeps();
  9209. }
  9210. return value
  9211. };
  9212. /**
  9213. * Add a dependency to this directive.
  9214. */
  9215. Watcher.prototype.addDep = function addDep (dep) {
  9216. var id = dep.id;
  9217. if (!this.newDepIds.has(id)) {
  9218. this.newDepIds.add(id);
  9219. this.newDeps.push(dep);
  9220. if (!this.depIds.has(id)) {
  9221. dep.addSub(this);
  9222. }
  9223. }
  9224. };
  9225. /**
  9226. * Clean up for dependency collection.
  9227. */
  9228. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  9229. var i = this.deps.length;
  9230. while (i--) {
  9231. var dep = this.deps[i];
  9232. if (!this.newDepIds.has(dep.id)) {
  9233. dep.removeSub(this);
  9234. }
  9235. }
  9236. var tmp = this.depIds;
  9237. this.depIds = this.newDepIds;
  9238. this.newDepIds = tmp;
  9239. this.newDepIds.clear();
  9240. tmp = this.deps;
  9241. this.deps = this.newDeps;
  9242. this.newDeps = tmp;
  9243. this.newDeps.length = 0;
  9244. };
  9245. /**
  9246. * Subscriber interface.
  9247. * Will be called when a dependency changes.
  9248. */
  9249. Watcher.prototype.update = function update () {
  9250. /* istanbul ignore else */
  9251. if (this.lazy) {
  9252. this.dirty = true;
  9253. } else if (this.sync) {
  9254. this.run();
  9255. } else {
  9256. queueWatcher(this);
  9257. }
  9258. };
  9259. /**
  9260. * Scheduler job interface.
  9261. * Will be called by the scheduler.
  9262. */
  9263. Watcher.prototype.run = function run () {
  9264. if (this.active) {
  9265. var value = this.get();
  9266. if (
  9267. value !== this.value ||
  9268. // Deep watchers and watchers on Object/Arrays should fire even
  9269. // when the value is the same, because the value may
  9270. // have mutated.
  9271. isObject(value) ||
  9272. this.deep
  9273. ) {
  9274. // set new value
  9275. var oldValue = this.value;
  9276. this.value = value;
  9277. if (this.user) {
  9278. try {
  9279. this.cb.call(this.vm, value, oldValue);
  9280. } catch (e) {
  9281. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  9282. }
  9283. } else {
  9284. this.cb.call(this.vm, value, oldValue);
  9285. }
  9286. }
  9287. }
  9288. };
  9289. /**
  9290. * Evaluate the value of the watcher.
  9291. * This only gets called for lazy watchers.
  9292. */
  9293. Watcher.prototype.evaluate = function evaluate () {
  9294. this.value = this.get();
  9295. this.dirty = false;
  9296. };
  9297. /**
  9298. * Depend on all deps collected by this watcher.
  9299. */
  9300. Watcher.prototype.depend = function depend () {
  9301. var i = this.deps.length;
  9302. while (i--) {
  9303. this.deps[i].depend();
  9304. }
  9305. };
  9306. /**
  9307. * Remove self from all dependencies' subscriber list.
  9308. */
  9309. Watcher.prototype.teardown = function teardown () {
  9310. if (this.active) {
  9311. // remove self from vm's watcher list
  9312. // this is a somewhat expensive operation so we skip it
  9313. // if the vm is being destroyed.
  9314. if (!this.vm._isBeingDestroyed) {
  9315. remove(this.vm._watchers, this);
  9316. }
  9317. var i = this.deps.length;
  9318. while (i--) {
  9319. this.deps[i].removeSub(this);
  9320. }
  9321. this.active = false;
  9322. }
  9323. };
  9324. /* */
  9325. var sharedPropertyDefinition = {
  9326. enumerable: true,
  9327. configurable: true,
  9328. get: noop,
  9329. set: noop
  9330. };
  9331. function proxy (target, sourceKey, key) {
  9332. sharedPropertyDefinition.get = function proxyGetter () {
  9333. return this[sourceKey][key]
  9334. };
  9335. sharedPropertyDefinition.set = function proxySetter (val) {
  9336. this[sourceKey][key] = val;
  9337. };
  9338. Object.defineProperty(target, key, sharedPropertyDefinition);
  9339. }
  9340. function initState (vm) {
  9341. vm._watchers = [];
  9342. var opts = vm.$options;
  9343. if (opts.props) { initProps(vm, opts.props); }
  9344. if (opts.methods) { initMethods(vm, opts.methods); }
  9345. if (opts.data) {
  9346. initData(vm);
  9347. } else {
  9348. observe(vm._data = {}, true /* asRootData */);
  9349. }
  9350. if (opts.computed) { initComputed(vm, opts.computed); }
  9351. if (opts.watch && opts.watch !== nativeWatch) {
  9352. initWatch(vm, opts.watch);
  9353. }
  9354. }
  9355. function initProps (vm, propsOptions) {
  9356. var propsData = vm.$options.propsData || {};
  9357. var props = vm._props = {};
  9358. // cache prop keys so that future props updates can iterate using Array
  9359. // instead of dynamic object key enumeration.
  9360. var keys = vm.$options._propKeys = [];
  9361. var isRoot = !vm.$parent;
  9362. // root instance props should be converted
  9363. if (!isRoot) {
  9364. toggleObserving(false);
  9365. }
  9366. var loop = function ( key ) {
  9367. keys.push(key);
  9368. var value = validateProp(key, propsOptions, propsData, vm);
  9369. /* istanbul ignore else */
  9370. if (true) {
  9371. var hyphenatedKey = hyphenate(key);
  9372. if (isReservedAttribute(hyphenatedKey) ||
  9373. config.isReservedAttr(hyphenatedKey)) {
  9374. warn(
  9375. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  9376. vm
  9377. );
  9378. }
  9379. defineReactive$$1(props, key, value, function () {
  9380. if (!isRoot && !isUpdatingChildComponent) {
  9381. {
  9382. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  9383. return
  9384. }
  9385. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  9386. if(
  9387. key === 'value' &&
  9388. Array.isArray(vm.$options.behaviors) &&
  9389. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9390. ){
  9391. return
  9392. }
  9393. if(vm._getFormData){
  9394. return
  9395. }
  9396. var $parent = vm.$parent;
  9397. while($parent){
  9398. if($parent.__next_tick_pending){
  9399. return
  9400. }
  9401. $parent = $parent.$parent;
  9402. }
  9403. }
  9404. warn(
  9405. "Avoid mutating a prop directly since the value will be " +
  9406. "overwritten whenever the parent component re-renders. " +
  9407. "Instead, use a data or computed property based on the prop's " +
  9408. "value. Prop being mutated: \"" + key + "\"",
  9409. vm
  9410. );
  9411. }
  9412. });
  9413. } else {}
  9414. // static props are already proxied on the component's prototype
  9415. // during Vue.extend(). We only need to proxy props defined at
  9416. // instantiation here.
  9417. if (!(key in vm)) {
  9418. proxy(vm, "_props", key);
  9419. }
  9420. };
  9421. for (var key in propsOptions) loop( key );
  9422. toggleObserving(true);
  9423. }
  9424. function initData (vm) {
  9425. var data = vm.$options.data;
  9426. data = vm._data = typeof data === 'function'
  9427. ? getData(data, vm)
  9428. : data || {};
  9429. if (!isPlainObject(data)) {
  9430. data = {};
  9431. true && warn(
  9432. 'data functions should return an object:\n' +
  9433. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  9434. vm
  9435. );
  9436. }
  9437. // proxy data on instance
  9438. var keys = Object.keys(data);
  9439. var props = vm.$options.props;
  9440. var methods = vm.$options.methods;
  9441. var i = keys.length;
  9442. while (i--) {
  9443. var key = keys[i];
  9444. if (true) {
  9445. if (methods && hasOwn(methods, key)) {
  9446. warn(
  9447. ("Method \"" + key + "\" has already been defined as a data property."),
  9448. vm
  9449. );
  9450. }
  9451. }
  9452. if (props && hasOwn(props, key)) {
  9453. true && warn(
  9454. "The data property \"" + key + "\" is already declared as a prop. " +
  9455. "Use prop default value instead.",
  9456. vm
  9457. );
  9458. } else if (!isReserved(key)) {
  9459. proxy(vm, "_data", key);
  9460. }
  9461. }
  9462. // observe data
  9463. observe(data, true /* asRootData */);
  9464. }
  9465. function getData (data, vm) {
  9466. // #7573 disable dep collection when invoking data getters
  9467. pushTarget();
  9468. try {
  9469. return data.call(vm, vm)
  9470. } catch (e) {
  9471. handleError(e, vm, "data()");
  9472. return {}
  9473. } finally {
  9474. popTarget();
  9475. }
  9476. }
  9477. var computedWatcherOptions = { lazy: true };
  9478. function initComputed (vm, computed) {
  9479. // $flow-disable-line
  9480. var watchers = vm._computedWatchers = Object.create(null);
  9481. // computed properties are just getters during SSR
  9482. var isSSR = isServerRendering();
  9483. for (var key in computed) {
  9484. var userDef = computed[key];
  9485. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  9486. if ( true && getter == null) {
  9487. warn(
  9488. ("Getter is missing for computed property \"" + key + "\"."),
  9489. vm
  9490. );
  9491. }
  9492. if (!isSSR) {
  9493. // create internal watcher for the computed property.
  9494. watchers[key] = new Watcher(
  9495. vm,
  9496. getter || noop,
  9497. noop,
  9498. computedWatcherOptions
  9499. );
  9500. }
  9501. // component-defined computed properties are already defined on the
  9502. // component prototype. We only need to define computed properties defined
  9503. // at instantiation here.
  9504. if (!(key in vm)) {
  9505. defineComputed(vm, key, userDef);
  9506. } else if (true) {
  9507. if (key in vm.$data) {
  9508. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  9509. } else if (vm.$options.props && key in vm.$options.props) {
  9510. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  9511. }
  9512. }
  9513. }
  9514. }
  9515. function defineComputed (
  9516. target,
  9517. key,
  9518. userDef
  9519. ) {
  9520. var shouldCache = !isServerRendering();
  9521. if (typeof userDef === 'function') {
  9522. sharedPropertyDefinition.get = shouldCache
  9523. ? createComputedGetter(key)
  9524. : createGetterInvoker(userDef);
  9525. sharedPropertyDefinition.set = noop;
  9526. } else {
  9527. sharedPropertyDefinition.get = userDef.get
  9528. ? shouldCache && userDef.cache !== false
  9529. ? createComputedGetter(key)
  9530. : createGetterInvoker(userDef.get)
  9531. : noop;
  9532. sharedPropertyDefinition.set = userDef.set || noop;
  9533. }
  9534. if ( true &&
  9535. sharedPropertyDefinition.set === noop) {
  9536. sharedPropertyDefinition.set = function () {
  9537. warn(
  9538. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  9539. this
  9540. );
  9541. };
  9542. }
  9543. Object.defineProperty(target, key, sharedPropertyDefinition);
  9544. }
  9545. function createComputedGetter (key) {
  9546. return function computedGetter () {
  9547. var watcher = this._computedWatchers && this._computedWatchers[key];
  9548. if (watcher) {
  9549. if (watcher.dirty) {
  9550. watcher.evaluate();
  9551. }
  9552. if (Dep.SharedObject.target) {// fixed by xxxxxx
  9553. watcher.depend();
  9554. }
  9555. return watcher.value
  9556. }
  9557. }
  9558. }
  9559. function createGetterInvoker(fn) {
  9560. return function computedGetter () {
  9561. return fn.call(this, this)
  9562. }
  9563. }
  9564. function initMethods (vm, methods) {
  9565. var props = vm.$options.props;
  9566. for (var key in methods) {
  9567. if (true) {
  9568. if (typeof methods[key] !== 'function') {
  9569. warn(
  9570. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  9571. "Did you reference the function correctly?",
  9572. vm
  9573. );
  9574. }
  9575. if (props && hasOwn(props, key)) {
  9576. warn(
  9577. ("Method \"" + key + "\" has already been defined as a prop."),
  9578. vm
  9579. );
  9580. }
  9581. if ((key in vm) && isReserved(key)) {
  9582. warn(
  9583. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  9584. "Avoid defining component methods that start with _ or $."
  9585. );
  9586. }
  9587. }
  9588. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  9589. }
  9590. }
  9591. function initWatch (vm, watch) {
  9592. for (var key in watch) {
  9593. var handler = watch[key];
  9594. if (Array.isArray(handler)) {
  9595. for (var i = 0; i < handler.length; i++) {
  9596. createWatcher(vm, key, handler[i]);
  9597. }
  9598. } else {
  9599. createWatcher(vm, key, handler);
  9600. }
  9601. }
  9602. }
  9603. function createWatcher (
  9604. vm,
  9605. expOrFn,
  9606. handler,
  9607. options
  9608. ) {
  9609. if (isPlainObject(handler)) {
  9610. options = handler;
  9611. handler = handler.handler;
  9612. }
  9613. if (typeof handler === 'string') {
  9614. handler = vm[handler];
  9615. }
  9616. return vm.$watch(expOrFn, handler, options)
  9617. }
  9618. function stateMixin (Vue) {
  9619. // flow somehow has problems with directly declared definition object
  9620. // when using Object.defineProperty, so we have to procedurally build up
  9621. // the object here.
  9622. var dataDef = {};
  9623. dataDef.get = function () { return this._data };
  9624. var propsDef = {};
  9625. propsDef.get = function () { return this._props };
  9626. if (true) {
  9627. dataDef.set = function () {
  9628. warn(
  9629. 'Avoid replacing instance root $data. ' +
  9630. 'Use nested data properties instead.',
  9631. this
  9632. );
  9633. };
  9634. propsDef.set = function () {
  9635. warn("$props is readonly.", this);
  9636. };
  9637. }
  9638. Object.defineProperty(Vue.prototype, '$data', dataDef);
  9639. Object.defineProperty(Vue.prototype, '$props', propsDef);
  9640. Vue.prototype.$set = set;
  9641. Vue.prototype.$delete = del;
  9642. Vue.prototype.$watch = function (
  9643. expOrFn,
  9644. cb,
  9645. options
  9646. ) {
  9647. var vm = this;
  9648. if (isPlainObject(cb)) {
  9649. return createWatcher(vm, expOrFn, cb, options)
  9650. }
  9651. options = options || {};
  9652. options.user = true;
  9653. var watcher = new Watcher(vm, expOrFn, cb, options);
  9654. if (options.immediate) {
  9655. try {
  9656. cb.call(vm, watcher.value);
  9657. } catch (error) {
  9658. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  9659. }
  9660. }
  9661. return function unwatchFn () {
  9662. watcher.teardown();
  9663. }
  9664. };
  9665. }
  9666. /* */
  9667. var uid$3 = 0;
  9668. function initMixin (Vue) {
  9669. Vue.prototype._init = function (options) {
  9670. var vm = this;
  9671. // a uid
  9672. vm._uid = uid$3++;
  9673. var startTag, endTag;
  9674. /* istanbul ignore if */
  9675. if ( true && config.performance && mark) {
  9676. startTag = "vue-perf-start:" + (vm._uid);
  9677. endTag = "vue-perf-end:" + (vm._uid);
  9678. mark(startTag);
  9679. }
  9680. // a flag to avoid this being observed
  9681. vm._isVue = true;
  9682. // merge options
  9683. if (options && options._isComponent) {
  9684. // optimize internal component instantiation
  9685. // since dynamic options merging is pretty slow, and none of the
  9686. // internal component options needs special treatment.
  9687. initInternalComponent(vm, options);
  9688. } else {
  9689. vm.$options = mergeOptions(
  9690. resolveConstructorOptions(vm.constructor),
  9691. options || {},
  9692. vm
  9693. );
  9694. }
  9695. /* istanbul ignore else */
  9696. if (true) {
  9697. initProxy(vm);
  9698. } else {}
  9699. // expose real self
  9700. vm._self = vm;
  9701. initLifecycle(vm);
  9702. initEvents(vm);
  9703. initRender(vm);
  9704. callHook(vm, 'beforeCreate');
  9705. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  9706. initState(vm);
  9707. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  9708. !vm._$fallback && callHook(vm, 'created');
  9709. /* istanbul ignore if */
  9710. if ( true && config.performance && mark) {
  9711. vm._name = formatComponentName(vm, false);
  9712. mark(endTag);
  9713. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  9714. }
  9715. if (vm.$options.el) {
  9716. vm.$mount(vm.$options.el);
  9717. }
  9718. };
  9719. }
  9720. function initInternalComponent (vm, options) {
  9721. var opts = vm.$options = Object.create(vm.constructor.options);
  9722. // doing this because it's faster than dynamic enumeration.
  9723. var parentVnode = options._parentVnode;
  9724. opts.parent = options.parent;
  9725. opts._parentVnode = parentVnode;
  9726. var vnodeComponentOptions = parentVnode.componentOptions;
  9727. opts.propsData = vnodeComponentOptions.propsData;
  9728. opts._parentListeners = vnodeComponentOptions.listeners;
  9729. opts._renderChildren = vnodeComponentOptions.children;
  9730. opts._componentTag = vnodeComponentOptions.tag;
  9731. if (options.render) {
  9732. opts.render = options.render;
  9733. opts.staticRenderFns = options.staticRenderFns;
  9734. }
  9735. }
  9736. function resolveConstructorOptions (Ctor) {
  9737. var options = Ctor.options;
  9738. if (Ctor.super) {
  9739. var superOptions = resolveConstructorOptions(Ctor.super);
  9740. var cachedSuperOptions = Ctor.superOptions;
  9741. if (superOptions !== cachedSuperOptions) {
  9742. // super option changed,
  9743. // need to resolve new options.
  9744. Ctor.superOptions = superOptions;
  9745. // check if there are any late-modified/attached options (#4976)
  9746. var modifiedOptions = resolveModifiedOptions(Ctor);
  9747. // update base extend options
  9748. if (modifiedOptions) {
  9749. extend(Ctor.extendOptions, modifiedOptions);
  9750. }
  9751. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9752. if (options.name) {
  9753. options.components[options.name] = Ctor;
  9754. }
  9755. }
  9756. }
  9757. return options
  9758. }
  9759. function resolveModifiedOptions (Ctor) {
  9760. var modified;
  9761. var latest = Ctor.options;
  9762. var sealed = Ctor.sealedOptions;
  9763. for (var key in latest) {
  9764. if (latest[key] !== sealed[key]) {
  9765. if (!modified) { modified = {}; }
  9766. modified[key] = latest[key];
  9767. }
  9768. }
  9769. return modified
  9770. }
  9771. function Vue (options) {
  9772. if ( true &&
  9773. !(this instanceof Vue)
  9774. ) {
  9775. warn('Vue is a constructor and should be called with the `new` keyword');
  9776. }
  9777. this._init(options);
  9778. }
  9779. initMixin(Vue);
  9780. stateMixin(Vue);
  9781. eventsMixin(Vue);
  9782. lifecycleMixin(Vue);
  9783. renderMixin(Vue);
  9784. /* */
  9785. function initUse (Vue) {
  9786. Vue.use = function (plugin) {
  9787. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9788. if (installedPlugins.indexOf(plugin) > -1) {
  9789. return this
  9790. }
  9791. // additional parameters
  9792. var args = toArray(arguments, 1);
  9793. args.unshift(this);
  9794. if (typeof plugin.install === 'function') {
  9795. plugin.install.apply(plugin, args);
  9796. } else if (typeof plugin === 'function') {
  9797. plugin.apply(null, args);
  9798. }
  9799. installedPlugins.push(plugin);
  9800. return this
  9801. };
  9802. }
  9803. /* */
  9804. function initMixin$1 (Vue) {
  9805. Vue.mixin = function (mixin) {
  9806. this.options = mergeOptions(this.options, mixin);
  9807. return this
  9808. };
  9809. }
  9810. /* */
  9811. function initExtend (Vue) {
  9812. /**
  9813. * Each instance constructor, including Vue, has a unique
  9814. * cid. This enables us to create wrapped "child
  9815. * constructors" for prototypal inheritance and cache them.
  9816. */
  9817. Vue.cid = 0;
  9818. var cid = 1;
  9819. /**
  9820. * Class inheritance
  9821. */
  9822. Vue.extend = function (extendOptions) {
  9823. extendOptions = extendOptions || {};
  9824. var Super = this;
  9825. var SuperId = Super.cid;
  9826. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9827. if (cachedCtors[SuperId]) {
  9828. return cachedCtors[SuperId]
  9829. }
  9830. var name = extendOptions.name || Super.options.name;
  9831. if ( true && name) {
  9832. validateComponentName(name);
  9833. }
  9834. var Sub = function VueComponent (options) {
  9835. this._init(options);
  9836. };
  9837. Sub.prototype = Object.create(Super.prototype);
  9838. Sub.prototype.constructor = Sub;
  9839. Sub.cid = cid++;
  9840. Sub.options = mergeOptions(
  9841. Super.options,
  9842. extendOptions
  9843. );
  9844. Sub['super'] = Super;
  9845. // For props and computed properties, we define the proxy getters on
  9846. // the Vue instances at extension time, on the extended prototype. This
  9847. // avoids Object.defineProperty calls for each instance created.
  9848. if (Sub.options.props) {
  9849. initProps$1(Sub);
  9850. }
  9851. if (Sub.options.computed) {
  9852. initComputed$1(Sub);
  9853. }
  9854. // allow further extension/mixin/plugin usage
  9855. Sub.extend = Super.extend;
  9856. Sub.mixin = Super.mixin;
  9857. Sub.use = Super.use;
  9858. // create asset registers, so extended classes
  9859. // can have their private assets too.
  9860. ASSET_TYPES.forEach(function (type) {
  9861. Sub[type] = Super[type];
  9862. });
  9863. // enable recursive self-lookup
  9864. if (name) {
  9865. Sub.options.components[name] = Sub;
  9866. }
  9867. // keep a reference to the super options at extension time.
  9868. // later at instantiation we can check if Super's options have
  9869. // been updated.
  9870. Sub.superOptions = Super.options;
  9871. Sub.extendOptions = extendOptions;
  9872. Sub.sealedOptions = extend({}, Sub.options);
  9873. // cache constructor
  9874. cachedCtors[SuperId] = Sub;
  9875. return Sub
  9876. };
  9877. }
  9878. function initProps$1 (Comp) {
  9879. var props = Comp.options.props;
  9880. for (var key in props) {
  9881. proxy(Comp.prototype, "_props", key);
  9882. }
  9883. }
  9884. function initComputed$1 (Comp) {
  9885. var computed = Comp.options.computed;
  9886. for (var key in computed) {
  9887. defineComputed(Comp.prototype, key, computed[key]);
  9888. }
  9889. }
  9890. /* */
  9891. function initAssetRegisters (Vue) {
  9892. /**
  9893. * Create asset registration methods.
  9894. */
  9895. ASSET_TYPES.forEach(function (type) {
  9896. Vue[type] = function (
  9897. id,
  9898. definition
  9899. ) {
  9900. if (!definition) {
  9901. return this.options[type + 's'][id]
  9902. } else {
  9903. /* istanbul ignore if */
  9904. if ( true && type === 'component') {
  9905. validateComponentName(id);
  9906. }
  9907. if (type === 'component' && isPlainObject(definition)) {
  9908. definition.name = definition.name || id;
  9909. definition = this.options._base.extend(definition);
  9910. }
  9911. if (type === 'directive' && typeof definition === 'function') {
  9912. definition = { bind: definition, update: definition };
  9913. }
  9914. this.options[type + 's'][id] = definition;
  9915. return definition
  9916. }
  9917. };
  9918. });
  9919. }
  9920. /* */
  9921. function getComponentName (opts) {
  9922. return opts && (opts.Ctor.options.name || opts.tag)
  9923. }
  9924. function matches (pattern, name) {
  9925. if (Array.isArray(pattern)) {
  9926. return pattern.indexOf(name) > -1
  9927. } else if (typeof pattern === 'string') {
  9928. return pattern.split(',').indexOf(name) > -1
  9929. } else if (isRegExp(pattern)) {
  9930. return pattern.test(name)
  9931. }
  9932. /* istanbul ignore next */
  9933. return false
  9934. }
  9935. function pruneCache (keepAliveInstance, filter) {
  9936. var cache = keepAliveInstance.cache;
  9937. var keys = keepAliveInstance.keys;
  9938. var _vnode = keepAliveInstance._vnode;
  9939. for (var key in cache) {
  9940. var cachedNode = cache[key];
  9941. if (cachedNode) {
  9942. var name = getComponentName(cachedNode.componentOptions);
  9943. if (name && !filter(name)) {
  9944. pruneCacheEntry(cache, key, keys, _vnode);
  9945. }
  9946. }
  9947. }
  9948. }
  9949. function pruneCacheEntry (
  9950. cache,
  9951. key,
  9952. keys,
  9953. current
  9954. ) {
  9955. var cached$$1 = cache[key];
  9956. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9957. cached$$1.componentInstance.$destroy();
  9958. }
  9959. cache[key] = null;
  9960. remove(keys, key);
  9961. }
  9962. var patternTypes = [String, RegExp, Array];
  9963. var KeepAlive = {
  9964. name: 'keep-alive',
  9965. abstract: true,
  9966. props: {
  9967. include: patternTypes,
  9968. exclude: patternTypes,
  9969. max: [String, Number]
  9970. },
  9971. created: function created () {
  9972. this.cache = Object.create(null);
  9973. this.keys = [];
  9974. },
  9975. destroyed: function destroyed () {
  9976. for (var key in this.cache) {
  9977. pruneCacheEntry(this.cache, key, this.keys);
  9978. }
  9979. },
  9980. mounted: function mounted () {
  9981. var this$1 = this;
  9982. this.$watch('include', function (val) {
  9983. pruneCache(this$1, function (name) { return matches(val, name); });
  9984. });
  9985. this.$watch('exclude', function (val) {
  9986. pruneCache(this$1, function (name) { return !matches(val, name); });
  9987. });
  9988. },
  9989. render: function render () {
  9990. var slot = this.$slots.default;
  9991. var vnode = getFirstComponentChild(slot);
  9992. var componentOptions = vnode && vnode.componentOptions;
  9993. if (componentOptions) {
  9994. // check pattern
  9995. var name = getComponentName(componentOptions);
  9996. var ref = this;
  9997. var include = ref.include;
  9998. var exclude = ref.exclude;
  9999. if (
  10000. // not included
  10001. (include && (!name || !matches(include, name))) ||
  10002. // excluded
  10003. (exclude && name && matches(exclude, name))
  10004. ) {
  10005. return vnode
  10006. }
  10007. var ref$1 = this;
  10008. var cache = ref$1.cache;
  10009. var keys = ref$1.keys;
  10010. var key = vnode.key == null
  10011. // same constructor may get registered as different local components
  10012. // so cid alone is not enough (#3269)
  10013. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  10014. : vnode.key;
  10015. if (cache[key]) {
  10016. vnode.componentInstance = cache[key].componentInstance;
  10017. // make current key freshest
  10018. remove(keys, key);
  10019. keys.push(key);
  10020. } else {
  10021. cache[key] = vnode;
  10022. keys.push(key);
  10023. // prune oldest entry
  10024. if (this.max && keys.length > parseInt(this.max)) {
  10025. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  10026. }
  10027. }
  10028. vnode.data.keepAlive = true;
  10029. }
  10030. return vnode || (slot && slot[0])
  10031. }
  10032. };
  10033. var builtInComponents = {
  10034. KeepAlive: KeepAlive
  10035. };
  10036. /* */
  10037. function initGlobalAPI (Vue) {
  10038. // config
  10039. var configDef = {};
  10040. configDef.get = function () { return config; };
  10041. if (true) {
  10042. configDef.set = function () {
  10043. warn(
  10044. 'Do not replace the Vue.config object, set individual fields instead.'
  10045. );
  10046. };
  10047. }
  10048. Object.defineProperty(Vue, 'config', configDef);
  10049. // exposed util methods.
  10050. // NOTE: these are not considered part of the public API - avoid relying on
  10051. // them unless you are aware of the risk.
  10052. Vue.util = {
  10053. warn: warn,
  10054. extend: extend,
  10055. mergeOptions: mergeOptions,
  10056. defineReactive: defineReactive$$1
  10057. };
  10058. Vue.set = set;
  10059. Vue.delete = del;
  10060. Vue.nextTick = nextTick;
  10061. // 2.6 explicit observable API
  10062. Vue.observable = function (obj) {
  10063. observe(obj);
  10064. return obj
  10065. };
  10066. Vue.options = Object.create(null);
  10067. ASSET_TYPES.forEach(function (type) {
  10068. Vue.options[type + 's'] = Object.create(null);
  10069. });
  10070. // this is used to identify the "base" constructor to extend all plain-object
  10071. // components with in Weex's multi-instance scenarios.
  10072. Vue.options._base = Vue;
  10073. extend(Vue.options.components, builtInComponents);
  10074. initUse(Vue);
  10075. initMixin$1(Vue);
  10076. initExtend(Vue);
  10077. initAssetRegisters(Vue);
  10078. }
  10079. initGlobalAPI(Vue);
  10080. Object.defineProperty(Vue.prototype, '$isServer', {
  10081. get: isServerRendering
  10082. });
  10083. Object.defineProperty(Vue.prototype, '$ssrContext', {
  10084. get: function get () {
  10085. /* istanbul ignore next */
  10086. return this.$vnode && this.$vnode.ssrContext
  10087. }
  10088. });
  10089. // expose FunctionalRenderContext for ssr runtime helper installation
  10090. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  10091. value: FunctionalRenderContext
  10092. });
  10093. Vue.version = '2.6.11';
  10094. /**
  10095. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  10096. */
  10097. var ARRAYTYPE = '[object Array]';
  10098. var OBJECTTYPE = '[object Object]';
  10099. var NULLTYPE = '[object Null]';
  10100. var UNDEFINEDTYPE = '[object Undefined]';
  10101. // const FUNCTIONTYPE = '[object Function]'
  10102. function diff(current, pre) {
  10103. var result = {};
  10104. syncKeys(current, pre);
  10105. _diff(current, pre, '', result);
  10106. return result
  10107. }
  10108. function syncKeys(current, pre) {
  10109. if (current === pre) { return }
  10110. var rootCurrentType = type(current);
  10111. var rootPreType = type(pre);
  10112. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  10113. if(Object.keys(current).length >= Object.keys(pre).length){
  10114. for (var key in pre) {
  10115. var currentValue = current[key];
  10116. if (currentValue === undefined) {
  10117. current[key] = null;
  10118. } else {
  10119. syncKeys(currentValue, pre[key]);
  10120. }
  10121. }
  10122. }
  10123. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  10124. if (current.length >= pre.length) {
  10125. pre.forEach(function (item, index) {
  10126. syncKeys(current[index], item);
  10127. });
  10128. }
  10129. }
  10130. }
  10131. function nullOrUndefined(currentType, preType) {
  10132. if(
  10133. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  10134. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  10135. ) {
  10136. return false
  10137. }
  10138. return true
  10139. }
  10140. function _diff(current, pre, path, result) {
  10141. if (current === pre) { return }
  10142. var rootCurrentType = type(current);
  10143. var rootPreType = type(pre);
  10144. if (rootCurrentType == OBJECTTYPE) {
  10145. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  10146. setResult(result, path, current);
  10147. } else {
  10148. var loop = function ( key ) {
  10149. var currentValue = current[key];
  10150. var preValue = pre[key];
  10151. var currentType = type(currentValue);
  10152. var preType = type(preValue);
  10153. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  10154. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  10155. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10156. }
  10157. } else if (currentType == ARRAYTYPE) {
  10158. if (preType != ARRAYTYPE) {
  10159. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10160. } else {
  10161. if (currentValue.length < preValue.length) {
  10162. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10163. } else {
  10164. currentValue.forEach(function (item, index) {
  10165. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  10166. });
  10167. }
  10168. }
  10169. } else if (currentType == OBJECTTYPE) {
  10170. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  10171. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10172. } else {
  10173. for (var subKey in currentValue) {
  10174. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  10175. }
  10176. }
  10177. }
  10178. };
  10179. for (var key in current) loop( key );
  10180. }
  10181. } else if (rootCurrentType == ARRAYTYPE) {
  10182. if (rootPreType != ARRAYTYPE) {
  10183. setResult(result, path, current);
  10184. } else {
  10185. if (current.length < pre.length) {
  10186. setResult(result, path, current);
  10187. } else {
  10188. current.forEach(function (item, index) {
  10189. _diff(item, pre[index], path + '[' + index + ']', result);
  10190. });
  10191. }
  10192. }
  10193. } else {
  10194. setResult(result, path, current);
  10195. }
  10196. }
  10197. function setResult(result, k, v) {
  10198. // if (type(v) != FUNCTIONTYPE) {
  10199. result[k] = v;
  10200. // }
  10201. }
  10202. function type(obj) {
  10203. return Object.prototype.toString.call(obj)
  10204. }
  10205. /* */
  10206. function flushCallbacks$1(vm) {
  10207. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  10208. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  10209. var mpInstance = vm.$scope;
  10210. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  10211. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  10212. }
  10213. var copies = vm.__next_tick_callbacks.slice(0);
  10214. vm.__next_tick_callbacks.length = 0;
  10215. for (var i = 0; i < copies.length; i++) {
  10216. copies[i]();
  10217. }
  10218. }
  10219. }
  10220. function hasRenderWatcher(vm) {
  10221. return queue.find(function (watcher) { return vm._watcher === watcher; })
  10222. }
  10223. function nextTick$1(vm, cb) {
  10224. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  10225. //2.nextTick 之前存在 render watcher
  10226. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  10227. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  10228. var mpInstance = vm.$scope;
  10229. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  10230. ']:nextVueTick');
  10231. }
  10232. return nextTick(cb, vm)
  10233. }else{
  10234. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  10235. var mpInstance$1 = vm.$scope;
  10236. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  10237. ']:nextMPTick');
  10238. }
  10239. }
  10240. var _resolve;
  10241. if (!vm.__next_tick_callbacks) {
  10242. vm.__next_tick_callbacks = [];
  10243. }
  10244. vm.__next_tick_callbacks.push(function () {
  10245. if (cb) {
  10246. try {
  10247. cb.call(vm);
  10248. } catch (e) {
  10249. handleError(e, vm, 'nextTick');
  10250. }
  10251. } else if (_resolve) {
  10252. _resolve(vm);
  10253. }
  10254. });
  10255. // $flow-disable-line
  10256. if (!cb && typeof Promise !== 'undefined') {
  10257. return new Promise(function (resolve) {
  10258. _resolve = resolve;
  10259. })
  10260. }
  10261. }
  10262. /* */
  10263. function clearInstance(key, value) {
  10264. // 简易去除 Vue 和小程序组件实例
  10265. if (value) {
  10266. if (value._isVue || value.__v_isMPComponent) {
  10267. return {}
  10268. }
  10269. }
  10270. return value
  10271. }
  10272. function cloneWithData(vm) {
  10273. // 确保当前 vm 所有数据被同步
  10274. var ret = Object.create(null);
  10275. var dataKeys = [].concat(
  10276. Object.keys(vm._data || {}),
  10277. Object.keys(vm._computedWatchers || {}));
  10278. dataKeys.reduce(function(ret, key) {
  10279. ret[key] = vm[key];
  10280. return ret
  10281. }, ret);
  10282. // vue-composition-api
  10283. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  10284. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  10285. if (rawBindings) {
  10286. Object.keys(rawBindings).forEach(function (key) {
  10287. ret[key] = vm[key];
  10288. });
  10289. }
  10290. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  10291. Object.assign(ret, vm.$mp.data || {});
  10292. if (
  10293. Array.isArray(vm.$options.behaviors) &&
  10294. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  10295. ) { //form-field
  10296. ret['name'] = vm.name;
  10297. ret['value'] = vm.value;
  10298. }
  10299. return JSON.parse(JSON.stringify(ret, clearInstance))
  10300. }
  10301. var patch = function(oldVnode, vnode) {
  10302. var this$1 = this;
  10303. if (vnode === null) { //destroy
  10304. return
  10305. }
  10306. if (this.mpType === 'page' || this.mpType === 'component') {
  10307. var mpInstance = this.$scope;
  10308. var data = Object.create(null);
  10309. try {
  10310. data = cloneWithData(this);
  10311. } catch (err) {
  10312. console.error(err);
  10313. }
  10314. data.__webviewId__ = mpInstance.data.__webviewId__;
  10315. var mpData = Object.create(null);
  10316. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  10317. mpData[key] = mpInstance.data[key];
  10318. });
  10319. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  10320. if (Object.keys(diffData).length) {
  10321. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  10322. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  10323. ']差量更新',
  10324. JSON.stringify(diffData));
  10325. }
  10326. this.__next_tick_pending = true;
  10327. mpInstance.setData(diffData, function () {
  10328. this$1.__next_tick_pending = false;
  10329. flushCallbacks$1(this$1);
  10330. });
  10331. } else {
  10332. flushCallbacks$1(this);
  10333. }
  10334. }
  10335. };
  10336. /* */
  10337. function createEmptyRender() {
  10338. }
  10339. function mountComponent$1(
  10340. vm,
  10341. el,
  10342. hydrating
  10343. ) {
  10344. if (!vm.mpType) {//main.js 中的 new Vue
  10345. return vm
  10346. }
  10347. if (vm.mpType === 'app') {
  10348. vm.$options.render = createEmptyRender;
  10349. }
  10350. if (!vm.$options.render) {
  10351. vm.$options.render = createEmptyRender;
  10352. if (true) {
  10353. /* istanbul ignore if */
  10354. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  10355. vm.$options.el || el) {
  10356. warn(
  10357. 'You are using the runtime-only build of Vue where the template ' +
  10358. 'compiler is not available. Either pre-compile the templates into ' +
  10359. 'render functions, or use the compiler-included build.',
  10360. vm
  10361. );
  10362. } else {
  10363. warn(
  10364. 'Failed to mount component: template or render function not defined.',
  10365. vm
  10366. );
  10367. }
  10368. }
  10369. }
  10370. !vm._$fallback && callHook(vm, 'beforeMount');
  10371. var updateComponent = function () {
  10372. vm._update(vm._render(), hydrating);
  10373. };
  10374. // we set this to vm._watcher inside the watcher's constructor
  10375. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  10376. // component's mounted hook), which relies on vm._watcher being already defined
  10377. new Watcher(vm, updateComponent, noop, {
  10378. before: function before() {
  10379. if (vm._isMounted && !vm._isDestroyed) {
  10380. callHook(vm, 'beforeUpdate');
  10381. }
  10382. }
  10383. }, true /* isRenderWatcher */);
  10384. hydrating = false;
  10385. return vm
  10386. }
  10387. /* */
  10388. function renderClass (
  10389. staticClass,
  10390. dynamicClass
  10391. ) {
  10392. if (isDef(staticClass) || isDef(dynamicClass)) {
  10393. return concat(staticClass, stringifyClass(dynamicClass))
  10394. }
  10395. /* istanbul ignore next */
  10396. return ''
  10397. }
  10398. function concat (a, b) {
  10399. return a ? b ? (a + ' ' + b) : a : (b || '')
  10400. }
  10401. function stringifyClass (value) {
  10402. if (Array.isArray(value)) {
  10403. return stringifyArray(value)
  10404. }
  10405. if (isObject(value)) {
  10406. return stringifyObject(value)
  10407. }
  10408. if (typeof value === 'string') {
  10409. return value
  10410. }
  10411. /* istanbul ignore next */
  10412. return ''
  10413. }
  10414. function stringifyArray (value) {
  10415. var res = '';
  10416. var stringified;
  10417. for (var i = 0, l = value.length; i < l; i++) {
  10418. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  10419. if (res) { res += ' '; }
  10420. res += stringified;
  10421. }
  10422. }
  10423. return res
  10424. }
  10425. function stringifyObject (value) {
  10426. var res = '';
  10427. for (var key in value) {
  10428. if (value[key]) {
  10429. if (res) { res += ' '; }
  10430. res += key;
  10431. }
  10432. }
  10433. return res
  10434. }
  10435. /* */
  10436. var parseStyleText = cached(function (cssText) {
  10437. var res = {};
  10438. var listDelimiter = /;(?![^(]*\))/g;
  10439. var propertyDelimiter = /:(.+)/;
  10440. cssText.split(listDelimiter).forEach(function (item) {
  10441. if (item) {
  10442. var tmp = item.split(propertyDelimiter);
  10443. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  10444. }
  10445. });
  10446. return res
  10447. });
  10448. // normalize possible array / string values into Object
  10449. function normalizeStyleBinding (bindingStyle) {
  10450. if (Array.isArray(bindingStyle)) {
  10451. return toObject(bindingStyle)
  10452. }
  10453. if (typeof bindingStyle === 'string') {
  10454. return parseStyleText(bindingStyle)
  10455. }
  10456. return bindingStyle
  10457. }
  10458. /* */
  10459. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  10460. function getTarget(obj, path) {
  10461. var parts = path.split('.');
  10462. var key = parts[0];
  10463. if (key.indexOf('__$n') === 0) { //number index
  10464. key = parseInt(key.replace('__$n', ''));
  10465. }
  10466. if (parts.length === 1) {
  10467. return obj[key]
  10468. }
  10469. return getTarget(obj[key], parts.slice(1).join('.'))
  10470. }
  10471. function internalMixin(Vue) {
  10472. Vue.config.errorHandler = function(err, vm, info) {
  10473. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  10474. console.error(err);
  10475. /* eslint-disable no-undef */
  10476. var app = typeof getApp === 'function' && getApp();
  10477. if (app && app.onError) {
  10478. app.onError(err);
  10479. }
  10480. };
  10481. var oldEmit = Vue.prototype.$emit;
  10482. Vue.prototype.$emit = function(event) {
  10483. if (this.$scope && event) {
  10484. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  10485. if (triggerEvent) {
  10486. try {
  10487. triggerEvent.call(this.$scope, event, {
  10488. __args__: toArray(arguments, 1)
  10489. });
  10490. } catch (error) {
  10491. }
  10492. }
  10493. }
  10494. return oldEmit.apply(this, arguments)
  10495. };
  10496. Vue.prototype.$nextTick = function(fn) {
  10497. return nextTick$1(this, fn)
  10498. };
  10499. MP_METHODS.forEach(function (method) {
  10500. Vue.prototype[method] = function(args) {
  10501. if (this.$scope && this.$scope[method]) {
  10502. return this.$scope[method](args)
  10503. }
  10504. // mp-alipay
  10505. if (typeof my === 'undefined') {
  10506. return
  10507. }
  10508. if (method === 'createSelectorQuery') {
  10509. /* eslint-disable no-undef */
  10510. return my.createSelectorQuery(args)
  10511. } else if (method === 'createIntersectionObserver') {
  10512. /* eslint-disable no-undef */
  10513. return my.createIntersectionObserver(args)
  10514. }
  10515. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  10516. };
  10517. });
  10518. Vue.prototype.__init_provide = initProvide;
  10519. Vue.prototype.__init_injections = initInjections;
  10520. Vue.prototype.__call_hook = function(hook, args) {
  10521. var vm = this;
  10522. // #7573 disable dep collection when invoking lifecycle hooks
  10523. pushTarget();
  10524. var handlers = vm.$options[hook];
  10525. var info = hook + " hook";
  10526. var ret;
  10527. if (handlers) {
  10528. for (var i = 0, j = handlers.length; i < j; i++) {
  10529. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  10530. }
  10531. }
  10532. if (vm._hasHookEvent) {
  10533. vm.$emit('hook:' + hook, args);
  10534. }
  10535. popTarget();
  10536. return ret
  10537. };
  10538. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  10539. if (Array.isArray(modifiers)) {
  10540. if (modifiers.indexOf('trim') !== -1) {
  10541. value = value.trim();
  10542. }
  10543. if (modifiers.indexOf('number') !== -1) {
  10544. value = this._n(value);
  10545. }
  10546. }
  10547. if (!target) {
  10548. target = this;
  10549. }
  10550. // 解决动态属性添加
  10551. Vue.set(target, key, value);
  10552. };
  10553. Vue.prototype.__set_sync = function(target, key, value) {
  10554. if (!target) {
  10555. target = this;
  10556. }
  10557. // 解决动态属性添加
  10558. Vue.set(target, key, value);
  10559. };
  10560. Vue.prototype.__get_orig = function(item) {
  10561. if (isPlainObject(item)) {
  10562. return item['$orig'] || item
  10563. }
  10564. return item
  10565. };
  10566. Vue.prototype.__get_value = function(dataPath, target) {
  10567. return getTarget(target || this, dataPath)
  10568. };
  10569. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  10570. return renderClass(staticClass, dynamicClass)
  10571. };
  10572. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  10573. if (!dynamicStyle && !staticStyle) {
  10574. return ''
  10575. }
  10576. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  10577. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  10578. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  10579. };
  10580. Vue.prototype.__map = function(val, iteratee) {
  10581. //TODO 暂不考虑 string
  10582. var ret, i, l, keys, key;
  10583. if (Array.isArray(val)) {
  10584. ret = new Array(val.length);
  10585. for (i = 0, l = val.length; i < l; i++) {
  10586. ret[i] = iteratee(val[i], i);
  10587. }
  10588. return ret
  10589. } else if (isObject(val)) {
  10590. keys = Object.keys(val);
  10591. ret = Object.create(null);
  10592. for (i = 0, l = keys.length; i < l; i++) {
  10593. key = keys[i];
  10594. ret[key] = iteratee(val[key], key, i);
  10595. }
  10596. return ret
  10597. } else if (typeof val === 'number') {
  10598. ret = new Array(val);
  10599. for (i = 0, l = val; i < l; i++) {
  10600. // 第一个参数暂时仍和小程序一致
  10601. ret[i] = iteratee(i, i);
  10602. }
  10603. return ret
  10604. }
  10605. return []
  10606. };
  10607. }
  10608. /* */
  10609. var LIFECYCLE_HOOKS$1 = [
  10610. //App
  10611. 'onLaunch',
  10612. 'onShow',
  10613. 'onHide',
  10614. 'onUniNViewMessage',
  10615. 'onPageNotFound',
  10616. 'onThemeChange',
  10617. 'onError',
  10618. 'onUnhandledRejection',
  10619. //Page
  10620. 'onInit',
  10621. 'onLoad',
  10622. // 'onShow',
  10623. 'onReady',
  10624. // 'onHide',
  10625. 'onUnload',
  10626. 'onPullDownRefresh',
  10627. 'onReachBottom',
  10628. 'onTabItemTap',
  10629. 'onAddToFavorites',
  10630. 'onShareTimeline',
  10631. 'onShareAppMessage',
  10632. 'onResize',
  10633. 'onPageScroll',
  10634. 'onNavigationBarButtonTap',
  10635. 'onBackPress',
  10636. 'onNavigationBarSearchInputChanged',
  10637. 'onNavigationBarSearchInputConfirmed',
  10638. 'onNavigationBarSearchInputClicked',
  10639. 'onUploadDouyinVideo',
  10640. 'onNFCReadMessage',
  10641. //Component
  10642. // 'onReady', // 兼容旧版本,应该移除该事件
  10643. 'onPageShow',
  10644. 'onPageHide',
  10645. 'onPageResize'
  10646. ];
  10647. function lifecycleMixin$1(Vue) {
  10648. //fixed vue-class-component
  10649. var oldExtend = Vue.extend;
  10650. Vue.extend = function(extendOptions) {
  10651. extendOptions = extendOptions || {};
  10652. var methods = extendOptions.methods;
  10653. if (methods) {
  10654. Object.keys(methods).forEach(function (methodName) {
  10655. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  10656. extendOptions[methodName] = methods[methodName];
  10657. delete methods[methodName];
  10658. }
  10659. });
  10660. }
  10661. return oldExtend.call(this, extendOptions)
  10662. };
  10663. var strategies = Vue.config.optionMergeStrategies;
  10664. var mergeHook = strategies.created;
  10665. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  10666. strategies[hook] = mergeHook;
  10667. });
  10668. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  10669. }
  10670. /* */
  10671. // install platform patch function
  10672. Vue.prototype.__patch__ = patch;
  10673. // public mount method
  10674. Vue.prototype.$mount = function(
  10675. el ,
  10676. hydrating
  10677. ) {
  10678. return mountComponent$1(this, el, hydrating)
  10679. };
  10680. lifecycleMixin$1(Vue);
  10681. internalMixin(Vue);
  10682. /* */
  10683. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  10684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  10685. /***/ }),
  10686. /***/ 252:
  10687. /*!************************************************************************************!*\
  10688. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  10689. \************************************************************************************/
  10690. /*! no static exports found */
  10691. /***/ (function(module, exports, __webpack_require__) {
  10692. "use strict";
  10693. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  10694. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10695. Object.defineProperty(exports, "__esModule", {
  10696. value: true
  10697. });
  10698. exports.default = exports.UniCloudError = void 0;
  10699. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  10700. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 214));
  10701. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  10702. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10703. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  10704. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  10705. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10706. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 212));
  10707. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 213));
  10708. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 215));
  10709. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 253));
  10710. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10711. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10712. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 255));
  10713. 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; } } }; }
  10714. 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); }
  10715. 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; }
  10716. 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; }
  10717. 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; }
  10718. 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); }; }
  10719. 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; } }
  10720. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  10721. function t(e) {
  10722. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  10723. }
  10724. function n(e, t, n) {
  10725. return e(n = {
  10726. path: t,
  10727. exports: {},
  10728. require: function require(e, t) {
  10729. return function () {
  10730. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  10731. }(null == t && n.path);
  10732. }
  10733. }, n.exports), n.exports;
  10734. }
  10735. var s = n(function (e, t) {
  10736. var n;
  10737. e.exports = (n = n || function (e, t) {
  10738. var n = Object.create || function () {
  10739. function e() {}
  10740. return function (t) {
  10741. var n;
  10742. return e.prototype = t, n = new e(), e.prototype = null, n;
  10743. };
  10744. }(),
  10745. s = {},
  10746. r = s.lib = {},
  10747. i = r.Base = {
  10748. extend: function extend(e) {
  10749. var t = n(this);
  10750. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  10751. t.$super.init.apply(this, arguments);
  10752. }), t.init.prototype = t, t.$super = this, t;
  10753. },
  10754. create: function create() {
  10755. var e = this.extend();
  10756. return e.init.apply(e, arguments), e;
  10757. },
  10758. init: function init() {},
  10759. mixIn: function mixIn(e) {
  10760. for (var t in e) {
  10761. e.hasOwnProperty(t) && (this[t] = e[t]);
  10762. }
  10763. e.hasOwnProperty("toString") && (this.toString = e.toString);
  10764. },
  10765. clone: function clone() {
  10766. return this.init.prototype.extend(this);
  10767. }
  10768. },
  10769. o = r.WordArray = i.extend({
  10770. init: function init(e, n) {
  10771. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  10772. },
  10773. toString: function toString(e) {
  10774. return (e || c).stringify(this);
  10775. },
  10776. concat: function concat(e) {
  10777. var t = this.words,
  10778. n = e.words,
  10779. s = this.sigBytes,
  10780. r = e.sigBytes;
  10781. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  10782. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  10783. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  10784. } else for (i = 0; i < r; i += 4) {
  10785. t[s + i >>> 2] = n[i >>> 2];
  10786. }
  10787. return this.sigBytes += r, this;
  10788. },
  10789. clamp: function clamp() {
  10790. var t = this.words,
  10791. n = this.sigBytes;
  10792. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  10793. },
  10794. clone: function clone() {
  10795. var e = i.clone.call(this);
  10796. return e.words = this.words.slice(0), e;
  10797. },
  10798. random: function random(t) {
  10799. for (var n, s = [], r = function r(t) {
  10800. t = t;
  10801. var n = 987654321,
  10802. s = 4294967295;
  10803. return function () {
  10804. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  10805. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  10806. };
  10807. }, i = 0; i < t; i += 4) {
  10808. var a = r(4294967296 * (n || e.random()));
  10809. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  10810. }
  10811. return new o.init(s, t);
  10812. }
  10813. }),
  10814. a = s.enc = {},
  10815. c = a.Hex = {
  10816. stringify: function stringify(e) {
  10817. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10818. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10819. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10820. }
  10821. return s.join("");
  10822. },
  10823. parse: function parse(e) {
  10824. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10825. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10826. }
  10827. return new o.init(n, t / 2);
  10828. }
  10829. },
  10830. u = a.Latin1 = {
  10831. stringify: function stringify(e) {
  10832. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10833. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10834. s.push(String.fromCharCode(i));
  10835. }
  10836. return s.join("");
  10837. },
  10838. parse: function parse(e) {
  10839. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10840. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10841. }
  10842. return new o.init(n, t);
  10843. }
  10844. },
  10845. l = a.Utf8 = {
  10846. stringify: function stringify(e) {
  10847. try {
  10848. return decodeURIComponent(escape(u.stringify(e)));
  10849. } catch (e) {
  10850. throw new Error("Malformed UTF-8 data");
  10851. }
  10852. },
  10853. parse: function parse(e) {
  10854. return u.parse(unescape(encodeURIComponent(e)));
  10855. }
  10856. },
  10857. h = r.BufferedBlockAlgorithm = i.extend({
  10858. reset: function reset() {
  10859. this._data = new o.init(), this._nDataBytes = 0;
  10860. },
  10861. _append: function _append(e) {
  10862. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10863. },
  10864. _process: function _process(t) {
  10865. var n = this._data,
  10866. s = n.words,
  10867. r = n.sigBytes,
  10868. i = this.blockSize,
  10869. a = r / (4 * i),
  10870. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10871. u = e.min(4 * c, r);
  10872. if (c) {
  10873. for (var l = 0; l < c; l += i) {
  10874. this._doProcessBlock(s, l);
  10875. }
  10876. var h = s.splice(0, c);
  10877. n.sigBytes -= u;
  10878. }
  10879. return new o.init(h, u);
  10880. },
  10881. clone: function clone() {
  10882. var e = i.clone.call(this);
  10883. return e._data = this._data.clone(), e;
  10884. },
  10885. _minBufferSize: 0
  10886. });
  10887. r.Hasher = h.extend({
  10888. cfg: i.extend(),
  10889. init: function init(e) {
  10890. this.cfg = this.cfg.extend(e), this.reset();
  10891. },
  10892. reset: function reset() {
  10893. h.reset.call(this), this._doReset();
  10894. },
  10895. update: function update(e) {
  10896. return this._append(e), this._process(), this;
  10897. },
  10898. finalize: function finalize(e) {
  10899. return e && this._append(e), this._doFinalize();
  10900. },
  10901. blockSize: 16,
  10902. _createHelper: function _createHelper(e) {
  10903. return function (t, n) {
  10904. return new e.init(n).finalize(t);
  10905. };
  10906. },
  10907. _createHmacHelper: function _createHmacHelper(e) {
  10908. return function (t, n) {
  10909. return new d.HMAC.init(e, n).finalize(t);
  10910. };
  10911. }
  10912. });
  10913. var d = s.algo = {};
  10914. return s;
  10915. }(Math), n);
  10916. }),
  10917. r = s,
  10918. i = (n(function (e, t) {
  10919. var n;
  10920. e.exports = (n = r, function (e) {
  10921. var t = n,
  10922. s = t.lib,
  10923. r = s.WordArray,
  10924. i = s.Hasher,
  10925. o = t.algo,
  10926. a = [];
  10927. !function () {
  10928. for (var t = 0; t < 64; t++) {
  10929. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10930. }
  10931. }();
  10932. var c = o.MD5 = i.extend({
  10933. _doReset: function _doReset() {
  10934. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10935. },
  10936. _doProcessBlock: function _doProcessBlock(e, t) {
  10937. for (var n = 0; n < 16; n++) {
  10938. var s = t + n,
  10939. r = e[s];
  10940. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10941. }
  10942. var i = this._hash.words,
  10943. o = e[t + 0],
  10944. c = e[t + 1],
  10945. p = e[t + 2],
  10946. f = e[t + 3],
  10947. g = e[t + 4],
  10948. m = e[t + 5],
  10949. y = e[t + 6],
  10950. _ = e[t + 7],
  10951. w = e[t + 8],
  10952. v = e[t + 9],
  10953. I = e[t + 10],
  10954. S = e[t + 11],
  10955. b = e[t + 12],
  10956. k = e[t + 13],
  10957. A = e[t + 14],
  10958. C = e[t + 15],
  10959. P = i[0],
  10960. T = i[1],
  10961. x = i[2],
  10962. O = i[3];
  10963. P = u(P, T, x, O, o, 7, a[0]), O = u(O, P, T, x, c, 12, a[1]), x = u(x, O, P, T, p, 17, a[2]), T = u(T, x, O, P, f, 22, a[3]), P = u(P, T, x, O, g, 7, a[4]), O = u(O, P, T, x, m, 12, a[5]), x = u(x, O, P, T, y, 17, a[6]), T = u(T, x, O, P, _, 22, a[7]), P = u(P, T, x, O, w, 7, a[8]), O = u(O, P, T, x, v, 12, a[9]), x = u(x, O, P, T, I, 17, a[10]), T = u(T, x, O, P, S, 22, a[11]), P = u(P, T, x, O, b, 7, a[12]), O = u(O, P, T, x, k, 12, a[13]), x = u(x, O, P, T, A, 17, a[14]), P = l(P, T = u(T, x, O, P, C, 22, a[15]), x, O, c, 5, a[16]), O = l(O, P, T, x, y, 9, a[17]), x = l(x, O, P, T, S, 14, a[18]), T = l(T, x, O, P, o, 20, a[19]), P = l(P, T, x, O, m, 5, a[20]), O = l(O, P, T, x, I, 9, a[21]), x = l(x, O, P, T, C, 14, a[22]), T = l(T, x, O, P, g, 20, a[23]), P = l(P, T, x, O, v, 5, a[24]), O = l(O, P, T, x, A, 9, a[25]), x = l(x, O, P, T, f, 14, a[26]), T = l(T, x, O, P, w, 20, a[27]), P = l(P, T, x, O, k, 5, a[28]), O = l(O, P, T, x, p, 9, a[29]), x = l(x, O, P, T, _, 14, a[30]), P = h(P, T = l(T, x, O, P, b, 20, a[31]), x, O, m, 4, a[32]), O = h(O, P, T, x, w, 11, a[33]), x = h(x, O, P, T, S, 16, a[34]), T = h(T, x, O, P, A, 23, a[35]), P = h(P, T, x, O, c, 4, a[36]), O = h(O, P, T, x, g, 11, a[37]), x = h(x, O, P, T, _, 16, a[38]), T = h(T, x, O, P, I, 23, a[39]), P = h(P, T, x, O, k, 4, a[40]), O = h(O, P, T, x, o, 11, a[41]), x = h(x, O, P, T, f, 16, a[42]), T = h(T, x, O, P, y, 23, a[43]), P = h(P, T, x, O, v, 4, a[44]), O = h(O, P, T, x, b, 11, a[45]), x = h(x, O, P, T, C, 16, a[46]), P = d(P, T = h(T, x, O, P, p, 23, a[47]), x, O, o, 6, a[48]), O = d(O, P, T, x, _, 10, a[49]), x = d(x, O, P, T, A, 15, a[50]), T = d(T, x, O, P, m, 21, a[51]), P = d(P, T, x, O, b, 6, a[52]), O = d(O, P, T, x, f, 10, a[53]), x = d(x, O, P, T, I, 15, a[54]), T = d(T, x, O, P, c, 21, a[55]), P = d(P, T, x, O, w, 6, a[56]), O = d(O, P, T, x, C, 10, a[57]), x = d(x, O, P, T, y, 15, a[58]), T = d(T, x, O, P, k, 21, a[59]), P = d(P, T, x, O, g, 6, a[60]), O = d(O, P, T, x, S, 10, a[61]), x = d(x, O, P, T, p, 15, a[62]), T = d(T, x, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + T | 0, i[2] = i[2] + x | 0, i[3] = i[3] + O | 0;
  10964. },
  10965. _doFinalize: function _doFinalize() {
  10966. var t = this._data,
  10967. n = t.words,
  10968. s = 8 * this._nDataBytes,
  10969. r = 8 * t.sigBytes;
  10970. n[r >>> 5] |= 128 << 24 - r % 32;
  10971. var i = e.floor(s / 4294967296),
  10972. o = s;
  10973. 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();
  10974. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10975. var l = c[u];
  10976. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  10977. }
  10978. return a;
  10979. },
  10980. clone: function clone() {
  10981. var e = i.clone.call(this);
  10982. return e._hash = this._hash.clone(), e;
  10983. }
  10984. });
  10985. function u(e, t, n, s, r, i, o) {
  10986. var a = e + (t & n | ~t & s) + r + o;
  10987. return (a << i | a >>> 32 - i) + t;
  10988. }
  10989. function l(e, t, n, s, r, i, o) {
  10990. var a = e + (t & s | n & ~s) + r + o;
  10991. return (a << i | a >>> 32 - i) + t;
  10992. }
  10993. function h(e, t, n, s, r, i, o) {
  10994. var a = e + (t ^ n ^ s) + r + o;
  10995. return (a << i | a >>> 32 - i) + t;
  10996. }
  10997. function d(e, t, n, s, r, i, o) {
  10998. var a = e + (n ^ (t | ~s)) + r + o;
  10999. return (a << i | a >>> 32 - i) + t;
  11000. }
  11001. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  11002. }(Math), n.MD5);
  11003. }), n(function (e, t) {
  11004. var n;
  11005. e.exports = (n = r, void function () {
  11006. var e = n,
  11007. t = e.lib.Base,
  11008. s = e.enc.Utf8;
  11009. e.algo.HMAC = t.extend({
  11010. init: function init(e, t) {
  11011. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  11012. var n = e.blockSize,
  11013. r = 4 * n;
  11014. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  11015. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  11016. a[u] ^= 1549556828, c[u] ^= 909522486;
  11017. }
  11018. i.sigBytes = o.sigBytes = r, this.reset();
  11019. },
  11020. reset: function reset() {
  11021. var e = this._hasher;
  11022. e.reset(), e.update(this._iKey);
  11023. },
  11024. update: function update(e) {
  11025. return this._hasher.update(e), this;
  11026. },
  11027. finalize: function finalize(e) {
  11028. var t = this._hasher,
  11029. n = t.finalize(e);
  11030. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  11031. }
  11032. });
  11033. }());
  11034. }), n(function (e, t) {
  11035. e.exports = r.HmacMD5;
  11036. })),
  11037. o = n(function (e, t) {
  11038. e.exports = r.enc.Utf8;
  11039. }),
  11040. a = n(function (e, t) {
  11041. var n;
  11042. e.exports = (n = r, function () {
  11043. var e = n,
  11044. t = e.lib.WordArray;
  11045. function s(e, n, s) {
  11046. for (var r = [], i = 0, o = 0; o < n; o++) {
  11047. if (o % 4) {
  11048. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  11049. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  11050. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  11051. }
  11052. }
  11053. return t.create(r, i);
  11054. }
  11055. e.enc.Base64 = {
  11056. stringify: function stringify(e) {
  11057. var t = e.words,
  11058. n = e.sigBytes,
  11059. s = this._map;
  11060. e.clamp();
  11061. for (var r = [], i = 0; i < n; i += 3) {
  11062. 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++) {
  11063. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  11064. }
  11065. }
  11066. var c = s.charAt(64);
  11067. if (c) for (; r.length % 4;) {
  11068. r.push(c);
  11069. }
  11070. return r.join("");
  11071. },
  11072. parse: function parse(e) {
  11073. var t = e.length,
  11074. n = this._map,
  11075. r = this._reverseMap;
  11076. if (!r) {
  11077. r = this._reverseMap = [];
  11078. for (var i = 0; i < n.length; i++) {
  11079. r[n.charCodeAt(i)] = i;
  11080. }
  11081. }
  11082. var o = n.charAt(64);
  11083. if (o) {
  11084. var a = e.indexOf(o);
  11085. -1 !== a && (t = a);
  11086. }
  11087. return s(e, t, r);
  11088. },
  11089. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  11090. };
  11091. }(), n.enc.Base64);
  11092. });
  11093. var c = "FUNCTION",
  11094. u = "OBJECT",
  11095. l = "CLIENT_DB",
  11096. h = "pending",
  11097. d = "fulfilled",
  11098. p = "rejected";
  11099. function f(e) {
  11100. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  11101. }
  11102. function g(e) {
  11103. return "object" === f(e);
  11104. }
  11105. function m(e) {
  11106. return "function" == typeof e;
  11107. }
  11108. function y(e) {
  11109. return function () {
  11110. try {
  11111. return e.apply(e, arguments);
  11112. } catch (e) {
  11113. console.error(e);
  11114. }
  11115. };
  11116. }
  11117. var _ = "REJECTED",
  11118. w = "NOT_PENDING";
  11119. var v = /*#__PURE__*/function () {
  11120. function v() {
  11121. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11122. e = _ref.createPromise,
  11123. _ref$retryRule = _ref.retryRule,
  11124. t = _ref$retryRule === void 0 ? _ : _ref$retryRule;
  11125. (0, _classCallCheck2.default)(this, v);
  11126. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  11127. }
  11128. (0, _createClass2.default)(v, [{
  11129. key: "needRetry",
  11130. get: function get() {
  11131. if (!this.status) return !0;
  11132. switch (this.retryRule) {
  11133. case _:
  11134. return this.status === p;
  11135. case w:
  11136. return this.status !== h;
  11137. }
  11138. }
  11139. }, {
  11140. key: "exec",
  11141. value: function exec() {
  11142. var _this = this;
  11143. return this.needRetry ? (this.status = h, this.promise = this.createPromise().then(function (e) {
  11144. return _this.status = d, Promise.resolve(e);
  11145. }, function (e) {
  11146. return _this.status = p, Promise.reject(e);
  11147. }), this.promise) : this.promise;
  11148. }
  11149. }]);
  11150. return v;
  11151. }();
  11152. function I(e) {
  11153. return e && "string" == typeof e ? JSON.parse(e) : e;
  11154. }
  11155. var S = "development" === "development",
  11156. b = "mp-weixin",
  11157. k = "true" === undefined || !0 === undefined,
  11158. A = I([]),
  11159. C = "h5" === b ? "web" : "app-plus" === b ? "app" : b,
  11160. P = I(undefined),
  11161. T = I([]) || [],
  11162. x = true;
  11163. var O = "";
  11164. try {
  11165. O = (__webpack_require__(/*! uni-stat-config */ 256).default || __webpack_require__(/*! uni-stat-config */ 256)).appid;
  11166. } catch (e) {}
  11167. var E = {};
  11168. function L(e) {
  11169. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11170. var n, s;
  11171. return n = E, s = e, Object.prototype.hasOwnProperty.call(n, s) || (E[e] = t), E[e];
  11172. }
  11173. "app" === C && (E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  11174. var R = ["invoke", "success", "fail", "complete"],
  11175. U = L("_globalUniCloudInterceptor");
  11176. function N(e, t) {
  11177. U[e] || (U[e] = {}), g(t) && Object.keys(t).forEach(function (n) {
  11178. R.indexOf(n) > -1 && function (e, t, n) {
  11179. var s = U[e][t];
  11180. s || (s = U[e][t] = []), -1 === s.indexOf(n) && m(n) && s.push(n);
  11181. }(e, n, t[n]);
  11182. });
  11183. }
  11184. function D(e, t) {
  11185. U[e] || (U[e] = {}), g(t) ? Object.keys(t).forEach(function (n) {
  11186. R.indexOf(n) > -1 && function (e, t, n) {
  11187. var s = U[e][t];
  11188. if (!s) return;
  11189. var r = s.indexOf(n);
  11190. r > -1 && s.splice(r, 1);
  11191. }(e, n, t[n]);
  11192. }) : delete U[e];
  11193. }
  11194. function q(e, t) {
  11195. return e && 0 !== e.length ? e.reduce(function (e, n) {
  11196. return e.then(function () {
  11197. return n(t);
  11198. });
  11199. }, Promise.resolve()) : Promise.resolve();
  11200. }
  11201. function M(e, t) {
  11202. return U[e] && U[e][t] || [];
  11203. }
  11204. function F(e) {
  11205. N("callObject", e);
  11206. }
  11207. var K = L("_globalUniCloudListener"),
  11208. j = "response",
  11209. $ = "needLogin",
  11210. B = "refreshToken",
  11211. W = "clientdb",
  11212. H = "cloudfunction",
  11213. J = "cloudobject";
  11214. function z(e) {
  11215. return K[e] || (K[e] = []), K[e];
  11216. }
  11217. function V(e, t) {
  11218. var n = z(e);
  11219. n.includes(t) || n.push(t);
  11220. }
  11221. function G(e, t) {
  11222. var n = z(e),
  11223. s = n.indexOf(t);
  11224. -1 !== s && n.splice(s, 1);
  11225. }
  11226. function Y(e, t) {
  11227. var n = z(e);
  11228. for (var _e2 = 0; _e2 < n.length; _e2++) {
  11229. (0, n[_e2])(t);
  11230. }
  11231. }
  11232. var Q,
  11233. X = !1;
  11234. function Z() {
  11235. return Q || (Q = new Promise(function (e) {
  11236. X && e(), function t() {
  11237. if ("function" == typeof getCurrentPages) {
  11238. var _t2 = getCurrentPages();
  11239. _t2 && _t2[0] && (X = !0, e());
  11240. }
  11241. X || setTimeout(function () {
  11242. t();
  11243. }, 30);
  11244. }();
  11245. }), Q);
  11246. }
  11247. function ee(e) {
  11248. var t = {};
  11249. for (var _n2 in e) {
  11250. var _s2 = e[_n2];
  11251. m(_s2) && (t[_n2] = y(_s2));
  11252. }
  11253. return t;
  11254. }
  11255. var te = /*#__PURE__*/function (_Error) {
  11256. (0, _inherits2.default)(te, _Error);
  11257. var _super = _createSuper(te);
  11258. function te(e) {
  11259. var _this2;
  11260. (0, _classCallCheck2.default)(this, te);
  11261. _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;
  11262. return _this2;
  11263. }
  11264. (0, _createClass2.default)(te, [{
  11265. key: "toJson",
  11266. value: function toJson() {
  11267. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  11268. if (!(e >= 10)) return e++, {
  11269. errCode: this.errCode,
  11270. errMsg: this.errMsg,
  11271. errSubject: this.errSubject,
  11272. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  11273. };
  11274. }
  11275. }]);
  11276. return te;
  11277. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  11278. exports.UniCloudError = te;
  11279. var ne = {
  11280. request: function request(e) {
  11281. return uni.request(e);
  11282. },
  11283. uploadFile: function uploadFile(e) {
  11284. return uni.uploadFile(e);
  11285. },
  11286. setStorageSync: function setStorageSync(e, t) {
  11287. return uni.setStorageSync(e, t);
  11288. },
  11289. getStorageSync: function getStorageSync(e) {
  11290. return uni.getStorageSync(e);
  11291. },
  11292. removeStorageSync: function removeStorageSync(e) {
  11293. return uni.removeStorageSync(e);
  11294. },
  11295. clearStorageSync: function clearStorageSync() {
  11296. return uni.clearStorageSync();
  11297. },
  11298. connectSocket: function connectSocket(e) {
  11299. return uni.connectSocket(e);
  11300. }
  11301. };
  11302. function se() {
  11303. return {
  11304. token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"),
  11305. tokenExpired: ne.getStorageSync("uni_id_token_expired")
  11306. };
  11307. }
  11308. function re() {
  11309. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11310. e = _ref2.token,
  11311. t = _ref2.tokenExpired;
  11312. e && ne.setStorageSync("uni_id_token", e), t && ne.setStorageSync("uni_id_token_expired", t);
  11313. }
  11314. var ie, oe;
  11315. function ae() {
  11316. return ie || (ie = uni.getSystemInfoSync()), ie;
  11317. }
  11318. function ce() {
  11319. var e, t;
  11320. try {
  11321. if (uni.getLaunchOptionsSync) {
  11322. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  11323. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  11324. _n3 = _uni$getLaunchOptions.scene,
  11325. _s3 = _uni$getLaunchOptions.channel;
  11326. e = _s3, t = _n3;
  11327. }
  11328. } catch (e) {}
  11329. return {
  11330. channel: e,
  11331. scene: t
  11332. };
  11333. }
  11334. var ue = {};
  11335. function le() {
  11336. var e = uni.getLocale && uni.getLocale() || "en";
  11337. if (oe) return _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  11338. locale: e,
  11339. LOCALE: e
  11340. });
  11341. var t = ae(),
  11342. n = t.deviceId,
  11343. s = t.osName,
  11344. r = t.uniPlatform,
  11345. i = t.appId,
  11346. o = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
  11347. for (var _e3 in t) {
  11348. Object.hasOwnProperty.call(t, _e3) && -1 === o.indexOf(_e3) && delete t[_e3];
  11349. }
  11350. return oe = _objectSpread(_objectSpread({
  11351. PLATFORM: r,
  11352. OS: s,
  11353. APPID: i,
  11354. DEVICEID: n
  11355. }, ce()), t), _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  11356. locale: e,
  11357. LOCALE: e
  11358. });
  11359. }
  11360. var he = {
  11361. sign: function sign(e, t) {
  11362. var n = "";
  11363. return Object.keys(e).sort().forEach(function (t) {
  11364. e[t] && (n = n + "&" + t + "=" + e[t]);
  11365. }), n = n.slice(1), i(n, t).toString();
  11366. },
  11367. wrappedRequest: function wrappedRequest(e, t) {
  11368. return new Promise(function (n, s) {
  11369. t(Object.assign(e, {
  11370. complete: function complete(e) {
  11371. e || (e = {}), S && "web" === C && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  11372. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  11373. if (!e.statusCode || e.statusCode >= 400) {
  11374. var _n4 = e.data && e.data.error && e.data.error.code || "SYS_ERR",
  11375. _r = e.data && e.data.error && e.data.error.message || e.errMsg || "request:fail";
  11376. return s(new te({
  11377. code: _n4,
  11378. message: _r,
  11379. requestId: t
  11380. }));
  11381. }
  11382. var r = e.data;
  11383. if (r.error) return s(new te({
  11384. code: r.error.code,
  11385. message: r.error.message,
  11386. requestId: t
  11387. }));
  11388. r.result = r.data, r.requestId = t, delete r.data, n(r);
  11389. }
  11390. }));
  11391. });
  11392. },
  11393. toBase64: function toBase64(e) {
  11394. return a.stringify(o.parse(e));
  11395. }
  11396. };
  11397. var de = /*#__PURE__*/function () {
  11398. function de(e) {
  11399. var _this3 = this;
  11400. (0, _classCallCheck2.default)(this, de);
  11401. ["spaceId", "clientSecret"].forEach(function (t) {
  11402. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  11403. }), this.config = Object.assign({}, {
  11404. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  11405. }, 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 = ne, this._getAccessTokenPromiseHub = new v({
  11406. createPromise: function createPromise() {
  11407. return _this3.requestAuth(_this3.setupRequest({
  11408. method: "serverless.auth.user.anonymousAuthorize",
  11409. params: "{}"
  11410. }, "auth")).then(function (e) {
  11411. if (!e.result || !e.result.accessToken) throw new te({
  11412. code: "AUTH_FAILED",
  11413. message: "获取accessToken失败"
  11414. });
  11415. _this3.setAccessToken(e.result.accessToken);
  11416. });
  11417. },
  11418. retryRule: w
  11419. });
  11420. }
  11421. (0, _createClass2.default)(de, [{
  11422. key: "hasAccessToken",
  11423. get: function get() {
  11424. return !!this.accessToken;
  11425. }
  11426. }, {
  11427. key: "setAccessToken",
  11428. value: function setAccessToken(e) {
  11429. this.accessToken = e;
  11430. }
  11431. }, {
  11432. key: "requestWrapped",
  11433. value: function requestWrapped(e) {
  11434. return he.wrappedRequest(e, this.adapter.request);
  11435. }
  11436. }, {
  11437. key: "requestAuth",
  11438. value: function requestAuth(e) {
  11439. return this.requestWrapped(e);
  11440. }
  11441. }, {
  11442. key: "request",
  11443. value: function request(e, t) {
  11444. var _this4 = this;
  11445. return Promise.resolve().then(function () {
  11446. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  11447. return new Promise(function (e, n) {
  11448. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  11449. }).then(function () {
  11450. return _this4.getAccessToken();
  11451. }).then(function () {
  11452. var t = _this4.rebuildRequest(e);
  11453. return _this4.request(t, !0);
  11454. });
  11455. }) : _this4.getAccessToken().then(function () {
  11456. var t = _this4.rebuildRequest(e);
  11457. return _this4.request(t, !0);
  11458. });
  11459. });
  11460. }
  11461. }, {
  11462. key: "rebuildRequest",
  11463. value: function rebuildRequest(e) {
  11464. var t = Object.assign({}, e);
  11465. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = he.sign(t.data, this.config.clientSecret), t;
  11466. }
  11467. }, {
  11468. key: "setupRequest",
  11469. value: function setupRequest(e, t) {
  11470. var n = Object.assign({}, e, {
  11471. spaceId: this.config.spaceId,
  11472. timestamp: Date.now()
  11473. }),
  11474. s = {
  11475. "Content-Type": "application/json"
  11476. };
  11477. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  11478. url: this.config.requestUrl,
  11479. method: "POST",
  11480. data: n,
  11481. dataType: "json",
  11482. header: s
  11483. };
  11484. }
  11485. }, {
  11486. key: "getAccessToken",
  11487. value: function getAccessToken() {
  11488. return this._getAccessTokenPromiseHub.exec();
  11489. }
  11490. }, {
  11491. key: "authorize",
  11492. value: function () {
  11493. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11494. return _regenerator.default.wrap(function _callee$(_context) {
  11495. while (1) {
  11496. switch (_context.prev = _context.next) {
  11497. case 0:
  11498. _context.next = 2;
  11499. return this.getAccessToken();
  11500. case 2:
  11501. case "end":
  11502. return _context.stop();
  11503. }
  11504. }
  11505. }, _callee, this);
  11506. }));
  11507. function authorize() {
  11508. return _authorize.apply(this, arguments);
  11509. }
  11510. return authorize;
  11511. }()
  11512. }, {
  11513. key: "callFunction",
  11514. value: function callFunction(e) {
  11515. var t = {
  11516. method: "serverless.function.runtime.invoke",
  11517. params: JSON.stringify({
  11518. functionTarget: e.name,
  11519. functionArgs: e.data || {}
  11520. })
  11521. };
  11522. return this.request(_objectSpread(_objectSpread({}, this.setupRequest(t)), {}, {
  11523. timeout: e.timeout
  11524. }));
  11525. }
  11526. }, {
  11527. key: "getOSSUploadOptionsFromPath",
  11528. value: function getOSSUploadOptionsFromPath(e) {
  11529. var t = {
  11530. method: "serverless.file.resource.generateProximalSign",
  11531. params: JSON.stringify(e)
  11532. };
  11533. return this.request(this.setupRequest(t));
  11534. }
  11535. }, {
  11536. key: "uploadFileToOSS",
  11537. value: function uploadFileToOSS(_ref3) {
  11538. var _this5 = this;
  11539. var e = _ref3.url,
  11540. t = _ref3.formData,
  11541. n = _ref3.name,
  11542. s = _ref3.filePath,
  11543. r = _ref3.fileType,
  11544. i = _ref3.onUploadProgress;
  11545. return new Promise(function (o, a) {
  11546. var c = _this5.adapter.uploadFile({
  11547. url: e,
  11548. formData: t,
  11549. name: n,
  11550. filePath: s,
  11551. fileType: r,
  11552. header: {
  11553. "X-OSS-server-side-encrpytion": "AES256"
  11554. },
  11555. success: function success(e) {
  11556. e && e.statusCode < 400 ? o(e) : a(new te({
  11557. code: "UPLOAD_FAILED",
  11558. message: "文件上传失败"
  11559. }));
  11560. },
  11561. fail: function fail(e) {
  11562. a(new te({
  11563. code: e.code || "UPLOAD_FAILED",
  11564. message: e.message || e.errMsg || "文件上传失败"
  11565. }));
  11566. }
  11567. });
  11568. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  11569. i({
  11570. loaded: e.totalBytesSent,
  11571. total: e.totalBytesExpectedToSend
  11572. });
  11573. });
  11574. });
  11575. }
  11576. }, {
  11577. key: "reportOSSUpload",
  11578. value: function reportOSSUpload(e) {
  11579. var t = {
  11580. method: "serverless.file.resource.report",
  11581. params: JSON.stringify(e)
  11582. };
  11583. return this.request(this.setupRequest(t));
  11584. }
  11585. }, {
  11586. key: "uploadFile",
  11587. value: function () {
  11588. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  11589. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, l, h, d, p, g, m, y, _, _e4, w;
  11590. return _regenerator.default.wrap(function _callee2$(_context2) {
  11591. while (1) {
  11592. switch (_context2.prev = _context2.next) {
  11593. case 0:
  11594. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, _ref4$cloudPathAsReal = _ref4.cloudPathAsRealPath, s = _ref4$cloudPathAsReal === void 0 ? !1 : _ref4$cloudPathAsReal, r = _ref4.onUploadProgress, i = _ref4.config;
  11595. if (!("string" !== f(t))) {
  11596. _context2.next = 3;
  11597. break;
  11598. }
  11599. throw new te({
  11600. code: "INVALID_PARAM",
  11601. message: "cloudPath必须为字符串类型"
  11602. });
  11603. case 3:
  11604. if (t = t.trim()) {
  11605. _context2.next = 5;
  11606. break;
  11607. }
  11608. throw new te({
  11609. code: "INVALID_PARAM",
  11610. message: "cloudPath不可为空"
  11611. });
  11612. case 5:
  11613. if (!/:\/\//.test(t)) {
  11614. _context2.next = 7;
  11615. break;
  11616. }
  11617. throw new te({
  11618. code: "INVALID_PARAM",
  11619. message: "cloudPath不合法"
  11620. });
  11621. case 7:
  11622. o = i && i.envType || this.config.envType;
  11623. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  11624. _context2.next = 10;
  11625. break;
  11626. }
  11627. throw new te({
  11628. code: "INVALID_PARAM",
  11629. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  11630. });
  11631. case 10:
  11632. _context2.next = 12;
  11633. return this.getOSSUploadOptionsFromPath({
  11634. env: o,
  11635. filename: s ? t.split("/").pop() : t,
  11636. fileId: s ? t : void 0
  11637. });
  11638. case 12:
  11639. a = _context2.sent.result;
  11640. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  11641. u = a.securityToken;
  11642. l = a.accessKeyId;
  11643. h = a.signature;
  11644. d = a.host;
  11645. p = a.ossPath;
  11646. g = a.id;
  11647. m = a.policy;
  11648. y = a.ossCallbackUrl;
  11649. _ = {
  11650. "Cache-Control": "max-age=2592000",
  11651. "Content-Disposition": "attachment",
  11652. OSSAccessKeyId: l,
  11653. Signature: h,
  11654. host: d,
  11655. id: g,
  11656. key: p,
  11657. policy: m,
  11658. success_action_status: 200
  11659. };
  11660. if (u && (_["x-oss-security-token"] = u), y) {
  11661. _e4 = JSON.stringify({
  11662. callbackUrl: y,
  11663. callbackBody: JSON.stringify({
  11664. fileId: g,
  11665. spaceId: this.config.spaceId
  11666. }),
  11667. callbackBodyType: "application/json"
  11668. });
  11669. _.callback = he.toBase64(_e4);
  11670. }
  11671. w = {
  11672. url: "https://" + a.host,
  11673. formData: _,
  11674. fileName: "file",
  11675. name: "file",
  11676. filePath: e,
  11677. fileType: n
  11678. };
  11679. _context2.next = 27;
  11680. return this.uploadFileToOSS(Object.assign({}, w, {
  11681. onUploadProgress: r
  11682. }));
  11683. case 27:
  11684. if (!y) {
  11685. _context2.next = 29;
  11686. break;
  11687. }
  11688. return _context2.abrupt("return", {
  11689. success: !0,
  11690. filePath: e,
  11691. fileID: c
  11692. });
  11693. case 29:
  11694. _context2.next = 31;
  11695. return this.reportOSSUpload({
  11696. id: g
  11697. });
  11698. case 31:
  11699. if (!_context2.sent.success) {
  11700. _context2.next = 33;
  11701. break;
  11702. }
  11703. return _context2.abrupt("return", {
  11704. success: !0,
  11705. filePath: e,
  11706. fileID: c
  11707. });
  11708. case 33:
  11709. throw new te({
  11710. code: "UPLOAD_FAILED",
  11711. message: "文件上传失败"
  11712. });
  11713. case 34:
  11714. case "end":
  11715. return _context2.stop();
  11716. }
  11717. }
  11718. }, _callee2, this);
  11719. }));
  11720. function uploadFile(_x) {
  11721. return _uploadFile.apply(this, arguments);
  11722. }
  11723. return uploadFile;
  11724. }()
  11725. }, {
  11726. key: "getTempFileURL",
  11727. value: function getTempFileURL() {
  11728. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11729. e = _ref5.fileList;
  11730. return new Promise(function (t, n) {
  11731. Array.isArray(e) && 0 !== e.length || n(new te({
  11732. code: "INVALID_PARAM",
  11733. message: "fileList的元素必须是非空的字符串"
  11734. })), t({
  11735. fileList: e.map(function (e) {
  11736. return {
  11737. fileID: e,
  11738. tempFileURL: e
  11739. };
  11740. })
  11741. });
  11742. });
  11743. }
  11744. }, {
  11745. key: "getFileInfo",
  11746. value: function () {
  11747. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  11748. var _ref6,
  11749. e,
  11750. t,
  11751. _args3 = arguments;
  11752. return _regenerator.default.wrap(function _callee3$(_context3) {
  11753. while (1) {
  11754. switch (_context3.prev = _context3.next) {
  11755. case 0:
  11756. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  11757. if (!(!Array.isArray(e) || 0 === e.length)) {
  11758. _context3.next = 3;
  11759. break;
  11760. }
  11761. throw new te({
  11762. code: "INVALID_PARAM",
  11763. message: "fileList的元素必须是非空的字符串"
  11764. });
  11765. case 3:
  11766. t = {
  11767. method: "serverless.file.resource.info",
  11768. params: JSON.stringify({
  11769. id: e.map(function (e) {
  11770. return e.split("?")[0];
  11771. }).join(",")
  11772. })
  11773. };
  11774. _context3.next = 6;
  11775. return this.request(this.setupRequest(t));
  11776. case 6:
  11777. _context3.t0 = _context3.sent.result;
  11778. return _context3.abrupt("return", {
  11779. fileList: _context3.t0
  11780. });
  11781. case 8:
  11782. case "end":
  11783. return _context3.stop();
  11784. }
  11785. }
  11786. }, _callee3, this);
  11787. }));
  11788. function getFileInfo() {
  11789. return _getFileInfo.apply(this, arguments);
  11790. }
  11791. return getFileInfo;
  11792. }()
  11793. }]);
  11794. return de;
  11795. }();
  11796. var pe = {
  11797. init: function init(e) {
  11798. var t = new de(e),
  11799. n = {
  11800. signInAnonymously: function signInAnonymously() {
  11801. return t.authorize();
  11802. },
  11803. getLoginState: function getLoginState() {
  11804. return Promise.resolve(!1);
  11805. }
  11806. };
  11807. return t.auth = function () {
  11808. return n;
  11809. }, t.customAuth = t.auth, t;
  11810. }
  11811. };
  11812. var fe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11813. var ge;
  11814. !function (e) {
  11815. e.local = "local", e.none = "none", e.session = "session";
  11816. }(ge || (ge = {}));
  11817. var me = function me() {},
  11818. ye = n(function (e, t) {
  11819. var n;
  11820. e.exports = (n = r, function (e) {
  11821. var t = n,
  11822. s = t.lib,
  11823. r = s.WordArray,
  11824. i = s.Hasher,
  11825. o = t.algo,
  11826. a = [],
  11827. c = [];
  11828. !function () {
  11829. function t(t) {
  11830. for (var n = e.sqrt(t), s = 2; s <= n; s++) {
  11831. if (!(t % s)) return !1;
  11832. }
  11833. return !0;
  11834. }
  11835. function n(e) {
  11836. return 4294967296 * (e - (0 | e)) | 0;
  11837. }
  11838. for (var s = 2, r = 0; r < 64;) {
  11839. t(s) && (r < 8 && (a[r] = n(e.pow(s, .5))), c[r] = n(e.pow(s, 1 / 3)), r++), s++;
  11840. }
  11841. }();
  11842. var u = [],
  11843. l = o.SHA256 = i.extend({
  11844. _doReset: function _doReset() {
  11845. this._hash = new r.init(a.slice(0));
  11846. },
  11847. _doProcessBlock: function _doProcessBlock(e, t) {
  11848. for (var n = this._hash.words, s = n[0], r = n[1], i = n[2], o = n[3], a = n[4], l = n[5], h = n[6], d = n[7], p = 0; p < 64; p++) {
  11849. if (p < 16) u[p] = 0 | e[t + p];else {
  11850. var f = u[p - 15],
  11851. g = (f << 25 | f >>> 7) ^ (f << 14 | f >>> 18) ^ f >>> 3,
  11852. m = u[p - 2],
  11853. y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
  11854. u[p] = g + u[p - 7] + y + u[p - 16];
  11855. }
  11856. var _ = s & r ^ s & i ^ r & i,
  11857. w = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
  11858. v = d + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & l ^ ~a & h) + c[p] + u[p];
  11859. d = h, h = l, l = a, a = o + v | 0, o = i, i = r, r = s, s = v + (w + _) | 0;
  11860. }
  11861. n[0] = n[0] + s | 0, n[1] = n[1] + r | 0, n[2] = n[2] + i | 0, n[3] = n[3] + o | 0, n[4] = n[4] + a | 0, n[5] = n[5] + l | 0, n[6] = n[6] + h | 0, n[7] = n[7] + d | 0;
  11862. },
  11863. _doFinalize: function _doFinalize() {
  11864. var t = this._data,
  11865. n = t.words,
  11866. s = 8 * this._nDataBytes,
  11867. r = 8 * t.sigBytes;
  11868. return n[r >>> 5] |= 128 << 24 - r % 32, n[14 + (r + 64 >>> 9 << 4)] = e.floor(s / 4294967296), n[15 + (r + 64 >>> 9 << 4)] = s, t.sigBytes = 4 * n.length, this._process(), this._hash;
  11869. },
  11870. clone: function clone() {
  11871. var e = i.clone.call(this);
  11872. return e._hash = this._hash.clone(), e;
  11873. }
  11874. });
  11875. t.SHA256 = i._createHelper(l), t.HmacSHA256 = i._createHmacHelper(l);
  11876. }(Math), n.SHA256);
  11877. }),
  11878. _e = ye,
  11879. we = n(function (e, t) {
  11880. e.exports = r.HmacSHA256;
  11881. });
  11882. var ve = function ve() {
  11883. var e;
  11884. if (!Promise) {
  11885. e = function e() {}, e.promise = {};
  11886. var _t3 = function _t3() {
  11887. throw new te({
  11888. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11889. });
  11890. };
  11891. return Object.defineProperty(e.promise, "then", {
  11892. get: _t3
  11893. }), Object.defineProperty(e.promise, "catch", {
  11894. get: _t3
  11895. }), e;
  11896. }
  11897. var t = new Promise(function (t, n) {
  11898. e = function e(_e5, s) {
  11899. return _e5 ? n(_e5) : t(s);
  11900. };
  11901. });
  11902. return e.promise = t, e;
  11903. };
  11904. function Ie(e) {
  11905. return void 0 === e;
  11906. }
  11907. function Se(e) {
  11908. return "[object Null]" === Object.prototype.toString.call(e);
  11909. }
  11910. var be;
  11911. function ke(e) {
  11912. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11913. var n;
  11914. var _iterator = _createForOfIteratorHelper(t),
  11915. _step;
  11916. try {
  11917. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11918. var _e6 = _step.value;
  11919. var _t4 = _e6.isMatch,
  11920. _n5 = _e6.genAdapter,
  11921. _s4 = _e6.runtime;
  11922. if (_t4()) return {
  11923. adapter: _n5(),
  11924. runtime: _s4
  11925. };
  11926. }
  11927. } catch (err) {
  11928. _iterator.e(err);
  11929. } finally {
  11930. _iterator.f();
  11931. }
  11932. }
  11933. !function (e) {
  11934. e.WEB = "web", e.WX_MP = "wx_mp";
  11935. }(be || (be = {}));
  11936. var Ae = {
  11937. adapter: null,
  11938. runtime: void 0
  11939. },
  11940. Ce = ["anonymousUuidKey"];
  11941. var Pe = /*#__PURE__*/function (_me) {
  11942. (0, _inherits2.default)(Pe, _me);
  11943. var _super2 = _createSuper(Pe);
  11944. function Pe() {
  11945. var _this6;
  11946. (0, _classCallCheck2.default)(this, Pe);
  11947. _this6 = _super2.call(this), Ae.adapter.root.tcbObject || (Ae.adapter.root.tcbObject = {});
  11948. return _this6;
  11949. }
  11950. (0, _createClass2.default)(Pe, [{
  11951. key: "setItem",
  11952. value: function setItem(e, t) {
  11953. Ae.adapter.root.tcbObject[e] = t;
  11954. }
  11955. }, {
  11956. key: "getItem",
  11957. value: function getItem(e) {
  11958. return Ae.adapter.root.tcbObject[e];
  11959. }
  11960. }, {
  11961. key: "removeItem",
  11962. value: function removeItem(e) {
  11963. delete Ae.adapter.root.tcbObject[e];
  11964. }
  11965. }, {
  11966. key: "clear",
  11967. value: function clear() {
  11968. delete Ae.adapter.root.tcbObject;
  11969. }
  11970. }]);
  11971. return Pe;
  11972. }(me);
  11973. function Te(e, t) {
  11974. switch (e) {
  11975. case "local":
  11976. return t.localStorage || new Pe();
  11977. case "none":
  11978. return new Pe();
  11979. default:
  11980. return t.sessionStorage || new Pe();
  11981. }
  11982. }
  11983. var xe = /*#__PURE__*/function () {
  11984. function xe(e) {
  11985. (0, _classCallCheck2.default)(this, xe);
  11986. if (!this._storage) {
  11987. this._persistence = Ae.adapter.primaryStorage || e.persistence, this._storage = Te(this._persistence, Ae.adapter);
  11988. var _t5 = "access_token_".concat(e.env),
  11989. _n6 = "access_token_expire_".concat(e.env),
  11990. _s5 = "refresh_token_".concat(e.env),
  11991. _r2 = "anonymous_uuid_".concat(e.env),
  11992. _i = "login_type_".concat(e.env),
  11993. _o = "user_info_".concat(e.env);
  11994. this.keys = {
  11995. accessTokenKey: _t5,
  11996. accessTokenExpireKey: _n6,
  11997. refreshTokenKey: _s5,
  11998. anonymousUuidKey: _r2,
  11999. loginTypeKey: _i,
  12000. userInfoKey: _o
  12001. };
  12002. }
  12003. }
  12004. (0, _createClass2.default)(xe, [{
  12005. key: "updatePersistence",
  12006. value: function updatePersistence(e) {
  12007. if (e === this._persistence) return;
  12008. var t = "local" === this._persistence;
  12009. this._persistence = e;
  12010. var n = Te(e, Ae.adapter);
  12011. for (var _e7 in this.keys) {
  12012. var _s6 = this.keys[_e7];
  12013. if (t && Ce.includes(_e7)) continue;
  12014. var _r3 = this._storage.getItem(_s6);
  12015. Ie(_r3) || Se(_r3) || (n.setItem(_s6, _r3), this._storage.removeItem(_s6));
  12016. }
  12017. this._storage = n;
  12018. }
  12019. }, {
  12020. key: "setStore",
  12021. value: function setStore(e, t, n) {
  12022. if (!this._storage) return;
  12023. var s = {
  12024. version: n || "localCachev1",
  12025. content: t
  12026. },
  12027. r = JSON.stringify(s);
  12028. try {
  12029. this._storage.setItem(e, r);
  12030. } catch (e) {
  12031. throw e;
  12032. }
  12033. }
  12034. }, {
  12035. key: "getStore",
  12036. value: function getStore(e, t) {
  12037. try {
  12038. if (!this._storage) return;
  12039. } catch (e) {
  12040. return "";
  12041. }
  12042. t = t || "localCachev1";
  12043. var n = this._storage.getItem(e);
  12044. if (!n) return "";
  12045. if (n.indexOf(t) >= 0) {
  12046. return JSON.parse(n).content;
  12047. }
  12048. return "";
  12049. }
  12050. }, {
  12051. key: "removeStore",
  12052. value: function removeStore(e) {
  12053. this._storage.removeItem(e);
  12054. }
  12055. }]);
  12056. return xe;
  12057. }();
  12058. var Oe = {},
  12059. Ee = {};
  12060. function Le(e) {
  12061. return Oe[e];
  12062. }
  12063. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  12064. (0, _classCallCheck2.default)(this, Re);
  12065. this.data = t || null, this.name = e;
  12066. });
  12067. var Ue = /*#__PURE__*/function (_Re) {
  12068. (0, _inherits2.default)(Ue, _Re);
  12069. var _super3 = _createSuper(Ue);
  12070. function Ue(e, t) {
  12071. var _this7;
  12072. (0, _classCallCheck2.default)(this, Ue);
  12073. _this7 = _super3.call(this, "error", {
  12074. error: e,
  12075. data: t
  12076. }), _this7.error = e;
  12077. return _this7;
  12078. }
  12079. return (0, _createClass2.default)(Ue);
  12080. }(Re);
  12081. var Ne = new ( /*#__PURE__*/function () {
  12082. function _class() {
  12083. (0, _classCallCheck2.default)(this, _class);
  12084. this._listeners = {};
  12085. }
  12086. (0, _createClass2.default)(_class, [{
  12087. key: "on",
  12088. value: function on(e, t) {
  12089. return function (e, t, n) {
  12090. n[e] = n[e] || [], n[e].push(t);
  12091. }(e, t, this._listeners), this;
  12092. }
  12093. }, {
  12094. key: "off",
  12095. value: function off(e, t) {
  12096. return function (e, t, n) {
  12097. if (n && n[e]) {
  12098. var _s7 = n[e].indexOf(t);
  12099. -1 !== _s7 && n[e].splice(_s7, 1);
  12100. }
  12101. }(e, t, this._listeners), this;
  12102. }
  12103. }, {
  12104. key: "fire",
  12105. value: function fire(e, t) {
  12106. if (e instanceof Ue) return console.error(e.error), this;
  12107. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  12108. var s = n.name;
  12109. if (this._listens(s)) {
  12110. n.target = this;
  12111. var _e8 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  12112. var _iterator2 = _createForOfIteratorHelper(_e8),
  12113. _step2;
  12114. try {
  12115. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  12116. var _t6 = _step2.value;
  12117. _t6.call(this, n);
  12118. }
  12119. } catch (err) {
  12120. _iterator2.e(err);
  12121. } finally {
  12122. _iterator2.f();
  12123. }
  12124. }
  12125. return this;
  12126. }
  12127. }, {
  12128. key: "_listens",
  12129. value: function _listens(e) {
  12130. return this._listeners[e] && this._listeners[e].length > 0;
  12131. }
  12132. }]);
  12133. return _class;
  12134. }())();
  12135. function De(e, t) {
  12136. Ne.on(e, t);
  12137. }
  12138. function qe(e) {
  12139. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12140. Ne.fire(e, t);
  12141. }
  12142. function Me(e, t) {
  12143. Ne.off(e, t);
  12144. }
  12145. var Fe = "loginStateChanged",
  12146. Ke = "loginStateExpire",
  12147. je = "loginTypeChanged",
  12148. $e = "anonymousConverted",
  12149. Be = "refreshAccessToken";
  12150. var We;
  12151. !function (e) {
  12152. 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";
  12153. }(We || (We = {}));
  12154. var He = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  12155. Je = {
  12156. "X-SDK-Version": "1.3.5"
  12157. };
  12158. function ze(e, t, n) {
  12159. var s = e[t];
  12160. e[t] = function (t) {
  12161. var r = {},
  12162. i = {};
  12163. n.forEach(function (n) {
  12164. var _n$call = n.call(e, t),
  12165. s = _n$call.data,
  12166. o = _n$call.headers;
  12167. Object.assign(r, s), Object.assign(i, o);
  12168. });
  12169. var o = t.data;
  12170. return o && function () {
  12171. var e;
  12172. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e9 in r) {
  12173. o.append(_e9, r[_e9]);
  12174. }
  12175. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  12176. };
  12177. }
  12178. function Ve() {
  12179. var e = Math.random().toString(16).slice(2);
  12180. return {
  12181. data: {
  12182. seqId: e
  12183. },
  12184. headers: _objectSpread(_objectSpread({}, Je), {}, {
  12185. "x-seqid": e
  12186. })
  12187. };
  12188. }
  12189. var Ge = /*#__PURE__*/function () {
  12190. function Ge() {
  12191. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12192. (0, _classCallCheck2.default)(this, Ge);
  12193. var t;
  12194. this.config = e, this._reqClass = new Ae.adapter.reqClass({
  12195. timeout: this.config.timeout,
  12196. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  12197. restrictedMethods: ["post"]
  12198. }), this._cache = Le(this.config.env), this._localCache = (t = this.config.env, Ee[t]), ze(this._reqClass, "post", [Ve]), ze(this._reqClass, "upload", [Ve]), ze(this._reqClass, "download", [Ve]);
  12199. }
  12200. (0, _createClass2.default)(Ge, [{
  12201. key: "post",
  12202. value: function () {
  12203. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  12204. return _regenerator.default.wrap(function _callee4$(_context4) {
  12205. while (1) {
  12206. switch (_context4.prev = _context4.next) {
  12207. case 0:
  12208. _context4.next = 2;
  12209. return this._reqClass.post(e);
  12210. case 2:
  12211. return _context4.abrupt("return", _context4.sent);
  12212. case 3:
  12213. case "end":
  12214. return _context4.stop();
  12215. }
  12216. }
  12217. }, _callee4, this);
  12218. }));
  12219. function post(_x2) {
  12220. return _post.apply(this, arguments);
  12221. }
  12222. return post;
  12223. }()
  12224. }, {
  12225. key: "upload",
  12226. value: function () {
  12227. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  12228. return _regenerator.default.wrap(function _callee5$(_context5) {
  12229. while (1) {
  12230. switch (_context5.prev = _context5.next) {
  12231. case 0:
  12232. _context5.next = 2;
  12233. return this._reqClass.upload(e);
  12234. case 2:
  12235. return _context5.abrupt("return", _context5.sent);
  12236. case 3:
  12237. case "end":
  12238. return _context5.stop();
  12239. }
  12240. }
  12241. }, _callee5, this);
  12242. }));
  12243. function upload(_x3) {
  12244. return _upload.apply(this, arguments);
  12245. }
  12246. return upload;
  12247. }()
  12248. }, {
  12249. key: "download",
  12250. value: function () {
  12251. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  12252. return _regenerator.default.wrap(function _callee6$(_context6) {
  12253. while (1) {
  12254. switch (_context6.prev = _context6.next) {
  12255. case 0:
  12256. _context6.next = 2;
  12257. return this._reqClass.download(e);
  12258. case 2:
  12259. return _context6.abrupt("return", _context6.sent);
  12260. case 3:
  12261. case "end":
  12262. return _context6.stop();
  12263. }
  12264. }
  12265. }, _callee6, this);
  12266. }));
  12267. function download(_x4) {
  12268. return _download.apply(this, arguments);
  12269. }
  12270. return download;
  12271. }()
  12272. }, {
  12273. key: "refreshAccessToken",
  12274. value: function () {
  12275. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  12276. var e, t;
  12277. return _regenerator.default.wrap(function _callee7$(_context7) {
  12278. while (1) {
  12279. switch (_context7.prev = _context7.next) {
  12280. case 0:
  12281. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  12282. _context7.prev = 1;
  12283. _context7.next = 4;
  12284. return this._refreshAccessTokenPromise;
  12285. case 4:
  12286. e = _context7.sent;
  12287. _context7.next = 10;
  12288. break;
  12289. case 7:
  12290. _context7.prev = 7;
  12291. _context7.t0 = _context7["catch"](1);
  12292. t = _context7.t0;
  12293. case 10:
  12294. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  12295. _context7.next = 12;
  12296. break;
  12297. }
  12298. throw t;
  12299. case 12:
  12300. return _context7.abrupt("return", e);
  12301. case 13:
  12302. case "end":
  12303. return _context7.stop();
  12304. }
  12305. }
  12306. }, _callee7, this, [[1, 7]]);
  12307. }));
  12308. function refreshAccessToken() {
  12309. return _refreshAccessToken2.apply(this, arguments);
  12310. }
  12311. return refreshAccessToken;
  12312. }()
  12313. }, {
  12314. key: "_refreshAccessToken",
  12315. value: function () {
  12316. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  12317. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e10, _e11, _t7, _s8;
  12318. return _regenerator.default.wrap(function _callee8$(_context8) {
  12319. while (1) {
  12320. switch (_context8.prev = _context8.next) {
  12321. case 0:
  12322. _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;
  12323. this._cache.removeStore(e), this._cache.removeStore(t);
  12324. i = this._cache.getStore(n);
  12325. if (i) {
  12326. _context8.next = 5;
  12327. break;
  12328. }
  12329. throw new te({
  12330. message: "未登录CloudBase"
  12331. });
  12332. case 5:
  12333. o = {
  12334. refresh_token: i
  12335. };
  12336. _context8.next = 8;
  12337. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  12338. case 8:
  12339. a = _context8.sent;
  12340. if (!a.data.code) {
  12341. _context8.next = 21;
  12342. break;
  12343. }
  12344. _e10 = a.data.code;
  12345. if (!("SIGN_PARAM_INVALID" === _e10 || "REFRESH_TOKEN_EXPIRED" === _e10 || "INVALID_REFRESH_TOKEN" === _e10)) {
  12346. _context8.next = 20;
  12347. break;
  12348. }
  12349. if (!(this._cache.getStore(s) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e10)) {
  12350. _context8.next = 19;
  12351. break;
  12352. }
  12353. _e11 = this._cache.getStore(r);
  12354. _t7 = this._cache.getStore(n);
  12355. _context8.next = 17;
  12356. return this.send("auth.signInAnonymously", {
  12357. anonymous_uuid: _e11,
  12358. refresh_token: _t7
  12359. });
  12360. case 17:
  12361. _s8 = _context8.sent;
  12362. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  12363. case 19:
  12364. qe(Ke), this._cache.removeStore(n);
  12365. case 20:
  12366. throw new te({
  12367. code: a.data.code,
  12368. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  12369. });
  12370. case 21:
  12371. if (!a.data.access_token) {
  12372. _context8.next = 23;
  12373. break;
  12374. }
  12375. return _context8.abrupt("return", (qe(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  12376. accessToken: a.data.access_token,
  12377. accessTokenExpire: a.data.access_token_expire
  12378. }));
  12379. case 23:
  12380. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  12381. case 24:
  12382. case "end":
  12383. return _context8.stop();
  12384. }
  12385. }
  12386. }, _callee8, this);
  12387. }));
  12388. function _refreshAccessToken() {
  12389. return _refreshAccessToken3.apply(this, arguments);
  12390. }
  12391. return _refreshAccessToken;
  12392. }()
  12393. }, {
  12394. key: "getAccessToken",
  12395. value: function () {
  12396. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  12397. var _this$_cache$keys2, e, t, n, s, r, i;
  12398. return _regenerator.default.wrap(function _callee9$(_context9) {
  12399. while (1) {
  12400. switch (_context9.prev = _context9.next) {
  12401. case 0:
  12402. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  12403. if (this._cache.getStore(n)) {
  12404. _context9.next = 3;
  12405. break;
  12406. }
  12407. throw new te({
  12408. message: "refresh token不存在,登录状态异常"
  12409. });
  12410. case 3:
  12411. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  12412. _context9.t0 = this._shouldRefreshAccessTokenHook;
  12413. if (!_context9.t0) {
  12414. _context9.next = 9;
  12415. break;
  12416. }
  12417. _context9.next = 8;
  12418. return this._shouldRefreshAccessTokenHook(s, r);
  12419. case 8:
  12420. _context9.t0 = !_context9.sent;
  12421. case 9:
  12422. _context9.t1 = _context9.t0;
  12423. if (!_context9.t1) {
  12424. _context9.next = 12;
  12425. break;
  12426. }
  12427. i = !1;
  12428. case 12:
  12429. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  12430. accessToken: s,
  12431. accessTokenExpire: r
  12432. });
  12433. case 13:
  12434. case "end":
  12435. return _context9.stop();
  12436. }
  12437. }
  12438. }, _callee9, this);
  12439. }));
  12440. function getAccessToken() {
  12441. return _getAccessToken.apply(this, arguments);
  12442. }
  12443. return getAccessToken;
  12444. }()
  12445. }, {
  12446. key: "request",
  12447. value: function () {
  12448. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  12449. var s, r, i, _e12, o, _e13, _e14, a, c, u, l, h, d, p, f, g;
  12450. return _regenerator.default.wrap(function _callee10$(_context10) {
  12451. while (1) {
  12452. switch (_context10.prev = _context10.next) {
  12453. case 0:
  12454. s = "x-tcb-trace_".concat(this.config.env);
  12455. r = "application/x-www-form-urlencoded";
  12456. i = _objectSpread({
  12457. action: e,
  12458. env: this.config.env,
  12459. dataVersion: "2019-08-16"
  12460. }, t);
  12461. if (!(-1 === He.indexOf(e))) {
  12462. _context10.next = 10;
  12463. break;
  12464. }
  12465. _e12 = this._cache.keys.refreshTokenKey;
  12466. _context10.t0 = this._cache.getStore(_e12);
  12467. if (!_context10.t0) {
  12468. _context10.next = 10;
  12469. break;
  12470. }
  12471. _context10.next = 9;
  12472. return this.getAccessToken();
  12473. case 9:
  12474. i.access_token = _context10.sent.accessToken;
  12475. case 10:
  12476. if ("storage.uploadFile" === e) {
  12477. o = new FormData();
  12478. for (_e13 in o) {
  12479. o.hasOwnProperty(_e13) && void 0 !== o[_e13] && o.append(_e13, i[_e13]);
  12480. }
  12481. r = "multipart/form-data";
  12482. } else {
  12483. r = "application/json", o = {};
  12484. for (_e14 in i) {
  12485. void 0 !== i[_e14] && (o[_e14] = i[_e14]);
  12486. }
  12487. }
  12488. a = {
  12489. headers: {
  12490. "content-type": r
  12491. }
  12492. };
  12493. n && n.timeout && (a.timeout = n.timeout), n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  12494. c = this._localCache.getStore(s);
  12495. c && (a.headers["X-TCB-Trace"] = c);
  12496. u = t.parse, l = t.inQuery, h = t.search;
  12497. d = {
  12498. env: this.config.env
  12499. };
  12500. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  12501. p = function (e, t) {
  12502. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12503. var s = /\?/.test(t);
  12504. var r = "";
  12505. for (var _e15 in n) {
  12506. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e15, "=").concat(encodeURIComponent(n[_e15]));
  12507. }
  12508. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  12509. }(fe, "//tcb-api.tencentcloudapi.com/web", d);
  12510. h && (p += h);
  12511. _context10.next = 22;
  12512. return this.post(_objectSpread({
  12513. url: p,
  12514. data: o
  12515. }, a));
  12516. case 22:
  12517. f = _context10.sent;
  12518. g = f.header && f.header["x-tcb-trace"];
  12519. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  12520. _context10.next = 26;
  12521. break;
  12522. }
  12523. throw new te({
  12524. code: "NETWORK_ERROR",
  12525. message: "network request error"
  12526. });
  12527. case 26:
  12528. return _context10.abrupt("return", f);
  12529. case 27:
  12530. case "end":
  12531. return _context10.stop();
  12532. }
  12533. }
  12534. }, _callee10, this);
  12535. }));
  12536. function request(_x5, _x6, _x7) {
  12537. return _request.apply(this, arguments);
  12538. }
  12539. return request;
  12540. }()
  12541. }, {
  12542. key: "send",
  12543. value: function () {
  12544. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  12545. var t,
  12546. n,
  12547. s,
  12548. _s9,
  12549. _args11 = arguments;
  12550. return _regenerator.default.wrap(function _callee11$(_context11) {
  12551. while (1) {
  12552. switch (_context11.prev = _context11.next) {
  12553. case 0:
  12554. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  12555. n = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
  12556. _context11.next = 4;
  12557. return this.request(e, t, _objectSpread(_objectSpread({}, n), {}, {
  12558. onUploadProgress: t.onUploadProgress
  12559. }));
  12560. case 4:
  12561. s = _context11.sent;
  12562. if (!("ACCESS_TOKEN_EXPIRED" === s.data.code && -1 === He.indexOf(e))) {
  12563. _context11.next = 14;
  12564. break;
  12565. }
  12566. _context11.next = 8;
  12567. return this.refreshAccessToken();
  12568. case 8:
  12569. _context11.next = 10;
  12570. return this.request(e, t, _objectSpread(_objectSpread({}, n), {}, {
  12571. onUploadProgress: t.onUploadProgress
  12572. }));
  12573. case 10:
  12574. _s9 = _context11.sent;
  12575. if (!_s9.data.code) {
  12576. _context11.next = 13;
  12577. break;
  12578. }
  12579. throw new te({
  12580. code: _s9.data.code,
  12581. message: _s9.data.message
  12582. });
  12583. case 13:
  12584. return _context11.abrupt("return", _s9.data);
  12585. case 14:
  12586. if (!s.data.code) {
  12587. _context11.next = 16;
  12588. break;
  12589. }
  12590. throw new te({
  12591. code: s.data.code,
  12592. message: s.data.message
  12593. });
  12594. case 16:
  12595. return _context11.abrupt("return", s.data);
  12596. case 17:
  12597. case "end":
  12598. return _context11.stop();
  12599. }
  12600. }
  12601. }, _callee11, this);
  12602. }));
  12603. function send(_x8) {
  12604. return _send.apply(this, arguments);
  12605. }
  12606. return send;
  12607. }()
  12608. }, {
  12609. key: "setRefreshToken",
  12610. value: function setRefreshToken(e) {
  12611. var _this$_cache$keys3 = this._cache.keys,
  12612. t = _this$_cache$keys3.accessTokenKey,
  12613. n = _this$_cache$keys3.accessTokenExpireKey,
  12614. s = _this$_cache$keys3.refreshTokenKey;
  12615. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12616. }
  12617. }]);
  12618. return Ge;
  12619. }();
  12620. var Ye = {};
  12621. function Qe(e) {
  12622. return Ye[e];
  12623. }
  12624. var Xe = /*#__PURE__*/function () {
  12625. function Xe(e) {
  12626. (0, _classCallCheck2.default)(this, Xe);
  12627. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env);
  12628. }
  12629. (0, _createClass2.default)(Xe, [{
  12630. key: "setRefreshToken",
  12631. value: function setRefreshToken(e) {
  12632. var _this$_cache$keys4 = this._cache.keys,
  12633. t = _this$_cache$keys4.accessTokenKey,
  12634. n = _this$_cache$keys4.accessTokenExpireKey,
  12635. s = _this$_cache$keys4.refreshTokenKey;
  12636. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12637. }
  12638. }, {
  12639. key: "setAccessToken",
  12640. value: function setAccessToken(e, t) {
  12641. var _this$_cache$keys5 = this._cache.keys,
  12642. n = _this$_cache$keys5.accessTokenKey,
  12643. s = _this$_cache$keys5.accessTokenExpireKey;
  12644. this._cache.setStore(n, e), this._cache.setStore(s, t);
  12645. }
  12646. }, {
  12647. key: "refreshUserInfo",
  12648. value: function () {
  12649. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  12650. var _yield$this$_request$, e;
  12651. return _regenerator.default.wrap(function _callee12$(_context12) {
  12652. while (1) {
  12653. switch (_context12.prev = _context12.next) {
  12654. case 0:
  12655. _context12.next = 2;
  12656. return this._request.send("auth.getUserInfo", {});
  12657. case 2:
  12658. _yield$this$_request$ = _context12.sent;
  12659. e = _yield$this$_request$.data;
  12660. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  12661. case 5:
  12662. case "end":
  12663. return _context12.stop();
  12664. }
  12665. }
  12666. }, _callee12, this);
  12667. }));
  12668. function refreshUserInfo() {
  12669. return _refreshUserInfo.apply(this, arguments);
  12670. }
  12671. return refreshUserInfo;
  12672. }()
  12673. }, {
  12674. key: "setLocalUserInfo",
  12675. value: function setLocalUserInfo(e) {
  12676. var t = this._cache.keys.userInfoKey;
  12677. this._cache.setStore(t, e);
  12678. }
  12679. }]);
  12680. return Xe;
  12681. }();
  12682. var Ze = /*#__PURE__*/function () {
  12683. function Ze(e) {
  12684. (0, _classCallCheck2.default)(this, Ze);
  12685. if (!e) throw new te({
  12686. code: "PARAM_ERROR",
  12687. message: "envId is not defined"
  12688. });
  12689. this._envId = e, this._cache = Le(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  12690. }
  12691. (0, _createClass2.default)(Ze, [{
  12692. key: "linkWithTicket",
  12693. value: function linkWithTicket(e) {
  12694. if ("string" != typeof e) throw new te({
  12695. code: "PARAM_ERROR",
  12696. message: "ticket must be string"
  12697. });
  12698. return this._request.send("auth.linkWithTicket", {
  12699. ticket: e
  12700. });
  12701. }
  12702. }, {
  12703. key: "linkWithRedirect",
  12704. value: function linkWithRedirect(e) {
  12705. e.signInWithRedirect();
  12706. }
  12707. }, {
  12708. key: "updatePassword",
  12709. value: function updatePassword(e, t) {
  12710. return this._request.send("auth.updatePassword", {
  12711. oldPassword: t,
  12712. newPassword: e
  12713. });
  12714. }
  12715. }, {
  12716. key: "updateEmail",
  12717. value: function updateEmail(e) {
  12718. return this._request.send("auth.updateEmail", {
  12719. newEmail: e
  12720. });
  12721. }
  12722. }, {
  12723. key: "updateUsername",
  12724. value: function updateUsername(e) {
  12725. if ("string" != typeof e) throw new te({
  12726. code: "PARAM_ERROR",
  12727. message: "username must be a string"
  12728. });
  12729. return this._request.send("auth.updateUsername", {
  12730. username: e
  12731. });
  12732. }
  12733. }, {
  12734. key: "getLinkedUidList",
  12735. value: function () {
  12736. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  12737. var _yield$this$_request$2, e, t, n;
  12738. return _regenerator.default.wrap(function _callee13$(_context13) {
  12739. while (1) {
  12740. switch (_context13.prev = _context13.next) {
  12741. case 0:
  12742. _context13.next = 2;
  12743. return this._request.send("auth.getLinkedUidList", {});
  12744. case 2:
  12745. _yield$this$_request$2 = _context13.sent;
  12746. e = _yield$this$_request$2.data;
  12747. t = !1;
  12748. n = e.users;
  12749. return _context13.abrupt("return", (n.forEach(function (e) {
  12750. e.wxOpenId && e.wxPublicId && (t = !0);
  12751. }), {
  12752. users: n,
  12753. hasPrimaryUid: t
  12754. }));
  12755. case 7:
  12756. case "end":
  12757. return _context13.stop();
  12758. }
  12759. }
  12760. }, _callee13, this);
  12761. }));
  12762. function getLinkedUidList() {
  12763. return _getLinkedUidList.apply(this, arguments);
  12764. }
  12765. return getLinkedUidList;
  12766. }()
  12767. }, {
  12768. key: "setPrimaryUid",
  12769. value: function setPrimaryUid(e) {
  12770. return this._request.send("auth.setPrimaryUid", {
  12771. uid: e
  12772. });
  12773. }
  12774. }, {
  12775. key: "unlink",
  12776. value: function unlink(e) {
  12777. return this._request.send("auth.unlink", {
  12778. platform: e
  12779. });
  12780. }
  12781. }, {
  12782. key: "update",
  12783. value: function () {
  12784. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  12785. var t, n, s, r, i, o, _yield$this$_request$3, a;
  12786. return _regenerator.default.wrap(function _callee14$(_context14) {
  12787. while (1) {
  12788. switch (_context14.prev = _context14.next) {
  12789. case 0:
  12790. t = e.nickName;
  12791. n = e.gender;
  12792. s = e.avatarUrl;
  12793. r = e.province;
  12794. i = e.country;
  12795. o = e.city;
  12796. _context14.next = 8;
  12797. return this._request.send("auth.updateUserInfo", {
  12798. nickName: t,
  12799. gender: n,
  12800. avatarUrl: s,
  12801. province: r,
  12802. country: i,
  12803. city: o
  12804. });
  12805. case 8:
  12806. _yield$this$_request$3 = _context14.sent;
  12807. a = _yield$this$_request$3.data;
  12808. this.setLocalUserInfo(a);
  12809. case 11:
  12810. case "end":
  12811. return _context14.stop();
  12812. }
  12813. }
  12814. }, _callee14, this);
  12815. }));
  12816. function update(_x9) {
  12817. return _update.apply(this, arguments);
  12818. }
  12819. return update;
  12820. }()
  12821. }, {
  12822. key: "refresh",
  12823. value: function () {
  12824. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  12825. var _yield$this$_request$4, e;
  12826. return _regenerator.default.wrap(function _callee15$(_context15) {
  12827. while (1) {
  12828. switch (_context15.prev = _context15.next) {
  12829. case 0:
  12830. _context15.next = 2;
  12831. return this._request.send("auth.getUserInfo", {});
  12832. case 2:
  12833. _yield$this$_request$4 = _context15.sent;
  12834. e = _yield$this$_request$4.data;
  12835. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  12836. case 5:
  12837. case "end":
  12838. return _context15.stop();
  12839. }
  12840. }
  12841. }, _callee15, this);
  12842. }));
  12843. function refresh() {
  12844. return _refresh.apply(this, arguments);
  12845. }
  12846. return refresh;
  12847. }()
  12848. }, {
  12849. key: "setUserInfo",
  12850. value: function setUserInfo() {
  12851. var _this8 = this;
  12852. var e = this._cache.keys.userInfoKey,
  12853. t = this._cache.getStore(e);
  12854. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  12855. _this8[e] = t[e];
  12856. }), this.location = {
  12857. country: t.country,
  12858. province: t.province,
  12859. city: t.city
  12860. };
  12861. }
  12862. }, {
  12863. key: "setLocalUserInfo",
  12864. value: function setLocalUserInfo(e) {
  12865. var t = this._cache.keys.userInfoKey;
  12866. this._cache.setStore(t, e), this.setUserInfo();
  12867. }
  12868. }]);
  12869. return Ze;
  12870. }();
  12871. var et = /*#__PURE__*/function () {
  12872. function et(e) {
  12873. (0, _classCallCheck2.default)(this, et);
  12874. if (!e) throw new te({
  12875. code: "PARAM_ERROR",
  12876. message: "envId is not defined"
  12877. });
  12878. this._cache = Le(e);
  12879. var _this$_cache$keys6 = this._cache.keys,
  12880. t = _this$_cache$keys6.refreshTokenKey,
  12881. n = _this$_cache$keys6.accessTokenKey,
  12882. s = _this$_cache$keys6.accessTokenExpireKey,
  12883. r = this._cache.getStore(t),
  12884. i = this._cache.getStore(n),
  12885. o = this._cache.getStore(s);
  12886. this.credential = {
  12887. refreshToken: r,
  12888. accessToken: i,
  12889. accessTokenExpire: o
  12890. }, this.user = new Ze(e);
  12891. }
  12892. (0, _createClass2.default)(et, [{
  12893. key: "isAnonymousAuth",
  12894. get: function get() {
  12895. return this.loginType === We.ANONYMOUS;
  12896. }
  12897. }, {
  12898. key: "isCustomAuth",
  12899. get: function get() {
  12900. return this.loginType === We.CUSTOM;
  12901. }
  12902. }, {
  12903. key: "isWeixinAuth",
  12904. get: function get() {
  12905. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  12906. }
  12907. }, {
  12908. key: "loginType",
  12909. get: function get() {
  12910. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12911. }
  12912. }]);
  12913. return et;
  12914. }();
  12915. var tt = /*#__PURE__*/function (_Xe) {
  12916. (0, _inherits2.default)(tt, _Xe);
  12917. var _super4 = _createSuper(tt);
  12918. function tt() {
  12919. (0, _classCallCheck2.default)(this, tt);
  12920. return _super4.apply(this, arguments);
  12921. }
  12922. (0, _createClass2.default)(tt, [{
  12923. key: "signIn",
  12924. value: function () {
  12925. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12926. var _this$_cache$keys7, e, t, n, s, r, _e16;
  12927. return _regenerator.default.wrap(function _callee16$(_context16) {
  12928. while (1) {
  12929. switch (_context16.prev = _context16.next) {
  12930. case 0:
  12931. this._cache.updatePersistence("local");
  12932. _this$_cache$keys7 = this._cache.keys;
  12933. e = _this$_cache$keys7.anonymousUuidKey;
  12934. t = _this$_cache$keys7.refreshTokenKey;
  12935. n = this._cache.getStore(e) || void 0;
  12936. s = this._cache.getStore(t) || void 0;
  12937. _context16.next = 8;
  12938. return this._request.send("auth.signInAnonymously", {
  12939. anonymous_uuid: n,
  12940. refresh_token: s
  12941. });
  12942. case 8:
  12943. r = _context16.sent;
  12944. if (!(r.uuid && r.refresh_token)) {
  12945. _context16.next = 20;
  12946. break;
  12947. }
  12948. this._setAnonymousUUID(r.uuid);
  12949. this.setRefreshToken(r.refresh_token);
  12950. _context16.next = 14;
  12951. return this._request.refreshAccessToken();
  12952. case 14:
  12953. qe(Fe);
  12954. qe(je, {
  12955. env: this.config.env,
  12956. loginType: We.ANONYMOUS,
  12957. persistence: "local"
  12958. });
  12959. _e16 = new et(this.config.env);
  12960. _context16.next = 19;
  12961. return _e16.user.refresh();
  12962. case 19:
  12963. return _context16.abrupt("return", _e16);
  12964. case 20:
  12965. throw new te({
  12966. message: "匿名登录失败"
  12967. });
  12968. case 21:
  12969. case "end":
  12970. return _context16.stop();
  12971. }
  12972. }
  12973. }, _callee16, this);
  12974. }));
  12975. function signIn() {
  12976. return _signIn.apply(this, arguments);
  12977. }
  12978. return signIn;
  12979. }()
  12980. }, {
  12981. key: "linkAndRetrieveDataWithTicket",
  12982. value: function () {
  12983. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12984. var _this$_cache$keys8, t, n, s, r, i;
  12985. return _regenerator.default.wrap(function _callee17$(_context17) {
  12986. while (1) {
  12987. switch (_context17.prev = _context17.next) {
  12988. case 0:
  12989. _this$_cache$keys8 = this._cache.keys;
  12990. t = _this$_cache$keys8.anonymousUuidKey;
  12991. n = _this$_cache$keys8.refreshTokenKey;
  12992. s = this._cache.getStore(t);
  12993. r = this._cache.getStore(n);
  12994. _context17.next = 7;
  12995. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12996. anonymous_uuid: s,
  12997. refresh_token: r,
  12998. ticket: e
  12999. });
  13000. case 7:
  13001. i = _context17.sent;
  13002. if (!i.refresh_token) {
  13003. _context17.next = 16;
  13004. break;
  13005. }
  13006. this._clearAnonymousUUID();
  13007. this.setRefreshToken(i.refresh_token);
  13008. _context17.next = 13;
  13009. return this._request.refreshAccessToken();
  13010. case 13:
  13011. qe($e, {
  13012. env: this.config.env
  13013. });
  13014. qe(je, {
  13015. loginType: We.CUSTOM,
  13016. persistence: "local"
  13017. });
  13018. return _context17.abrupt("return", {
  13019. credential: {
  13020. refreshToken: i.refresh_token
  13021. }
  13022. });
  13023. case 16:
  13024. throw new te({
  13025. message: "匿名转化失败"
  13026. });
  13027. case 17:
  13028. case "end":
  13029. return _context17.stop();
  13030. }
  13031. }
  13032. }, _callee17, this);
  13033. }));
  13034. function linkAndRetrieveDataWithTicket(_x10) {
  13035. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  13036. }
  13037. return linkAndRetrieveDataWithTicket;
  13038. }()
  13039. }, {
  13040. key: "_setAnonymousUUID",
  13041. value: function _setAnonymousUUID(e) {
  13042. var _this$_cache$keys9 = this._cache.keys,
  13043. t = _this$_cache$keys9.anonymousUuidKey,
  13044. n = _this$_cache$keys9.loginTypeKey;
  13045. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, We.ANONYMOUS);
  13046. }
  13047. }, {
  13048. key: "_clearAnonymousUUID",
  13049. value: function _clearAnonymousUUID() {
  13050. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  13051. }
  13052. }]);
  13053. return tt;
  13054. }(Xe);
  13055. var nt = /*#__PURE__*/function (_Xe2) {
  13056. (0, _inherits2.default)(nt, _Xe2);
  13057. var _super5 = _createSuper(nt);
  13058. function nt() {
  13059. (0, _classCallCheck2.default)(this, nt);
  13060. return _super5.apply(this, arguments);
  13061. }
  13062. (0, _createClass2.default)(nt, [{
  13063. key: "signIn",
  13064. value: function () {
  13065. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  13066. var t, n;
  13067. return _regenerator.default.wrap(function _callee18$(_context18) {
  13068. while (1) {
  13069. switch (_context18.prev = _context18.next) {
  13070. case 0:
  13071. if (!("string" != typeof e)) {
  13072. _context18.next = 2;
  13073. break;
  13074. }
  13075. throw new te({
  13076. code: "PARAM_ERROR",
  13077. message: "ticket must be a string"
  13078. });
  13079. case 2:
  13080. t = this._cache.keys.refreshTokenKey;
  13081. _context18.next = 5;
  13082. return this._request.send("auth.signInWithTicket", {
  13083. ticket: e,
  13084. refresh_token: this._cache.getStore(t) || ""
  13085. });
  13086. case 5:
  13087. n = _context18.sent;
  13088. if (!n.refresh_token) {
  13089. _context18.next = 15;
  13090. break;
  13091. }
  13092. this.setRefreshToken(n.refresh_token);
  13093. _context18.next = 10;
  13094. return this._request.refreshAccessToken();
  13095. case 10:
  13096. qe(Fe);
  13097. qe(je, {
  13098. env: this.config.env,
  13099. loginType: We.CUSTOM,
  13100. persistence: this.config.persistence
  13101. });
  13102. _context18.next = 14;
  13103. return this.refreshUserInfo();
  13104. case 14:
  13105. return _context18.abrupt("return", new et(this.config.env));
  13106. case 15:
  13107. throw new te({
  13108. message: "自定义登录失败"
  13109. });
  13110. case 16:
  13111. case "end":
  13112. return _context18.stop();
  13113. }
  13114. }
  13115. }, _callee18, this);
  13116. }));
  13117. function signIn(_x11) {
  13118. return _signIn2.apply(this, arguments);
  13119. }
  13120. return signIn;
  13121. }()
  13122. }]);
  13123. return nt;
  13124. }(Xe);
  13125. var st = /*#__PURE__*/function (_Xe3) {
  13126. (0, _inherits2.default)(st, _Xe3);
  13127. var _super6 = _createSuper(st);
  13128. function st() {
  13129. (0, _classCallCheck2.default)(this, st);
  13130. return _super6.apply(this, arguments);
  13131. }
  13132. (0, _createClass2.default)(st, [{
  13133. key: "signIn",
  13134. value: function () {
  13135. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  13136. var n, s, r, i, o;
  13137. return _regenerator.default.wrap(function _callee19$(_context19) {
  13138. while (1) {
  13139. switch (_context19.prev = _context19.next) {
  13140. case 0:
  13141. if (!("string" != typeof e)) {
  13142. _context19.next = 2;
  13143. break;
  13144. }
  13145. throw new te({
  13146. code: "PARAM_ERROR",
  13147. message: "email must be a string"
  13148. });
  13149. case 2:
  13150. n = this._cache.keys.refreshTokenKey;
  13151. _context19.next = 5;
  13152. return this._request.send("auth.signIn", {
  13153. loginType: "EMAIL",
  13154. email: e,
  13155. password: t,
  13156. refresh_token: this._cache.getStore(n) || ""
  13157. });
  13158. case 5:
  13159. s = _context19.sent;
  13160. r = s.refresh_token;
  13161. i = s.access_token;
  13162. o = s.access_token_expire;
  13163. if (!r) {
  13164. _context19.next = 22;
  13165. break;
  13166. }
  13167. this.setRefreshToken(r);
  13168. if (!(i && o)) {
  13169. _context19.next = 15;
  13170. break;
  13171. }
  13172. this.setAccessToken(i, o);
  13173. _context19.next = 17;
  13174. break;
  13175. case 15:
  13176. _context19.next = 17;
  13177. return this._request.refreshAccessToken();
  13178. case 17:
  13179. _context19.next = 19;
  13180. return this.refreshUserInfo();
  13181. case 19:
  13182. qe(Fe);
  13183. qe(je, {
  13184. env: this.config.env,
  13185. loginType: We.EMAIL,
  13186. persistence: this.config.persistence
  13187. });
  13188. return _context19.abrupt("return", new et(this.config.env));
  13189. case 22:
  13190. throw s.code ? new te({
  13191. code: s.code,
  13192. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13193. }) : new te({
  13194. message: "邮箱登录失败"
  13195. });
  13196. case 23:
  13197. case "end":
  13198. return _context19.stop();
  13199. }
  13200. }
  13201. }, _callee19, this);
  13202. }));
  13203. function signIn(_x12, _x13) {
  13204. return _signIn3.apply(this, arguments);
  13205. }
  13206. return signIn;
  13207. }()
  13208. }, {
  13209. key: "activate",
  13210. value: function () {
  13211. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  13212. return _regenerator.default.wrap(function _callee20$(_context20) {
  13213. while (1) {
  13214. switch (_context20.prev = _context20.next) {
  13215. case 0:
  13216. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  13217. token: e
  13218. }));
  13219. case 1:
  13220. case "end":
  13221. return _context20.stop();
  13222. }
  13223. }
  13224. }, _callee20, this);
  13225. }));
  13226. function activate(_x14) {
  13227. return _activate.apply(this, arguments);
  13228. }
  13229. return activate;
  13230. }()
  13231. }, {
  13232. key: "resetPasswordWithToken",
  13233. value: function () {
  13234. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  13235. return _regenerator.default.wrap(function _callee21$(_context21) {
  13236. while (1) {
  13237. switch (_context21.prev = _context21.next) {
  13238. case 0:
  13239. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  13240. token: e,
  13241. newPassword: t
  13242. }));
  13243. case 1:
  13244. case "end":
  13245. return _context21.stop();
  13246. }
  13247. }
  13248. }, _callee21, this);
  13249. }));
  13250. function resetPasswordWithToken(_x15, _x16) {
  13251. return _resetPasswordWithToken.apply(this, arguments);
  13252. }
  13253. return resetPasswordWithToken;
  13254. }()
  13255. }]);
  13256. return st;
  13257. }(Xe);
  13258. var rt = /*#__PURE__*/function (_Xe4) {
  13259. (0, _inherits2.default)(rt, _Xe4);
  13260. var _super7 = _createSuper(rt);
  13261. function rt() {
  13262. (0, _classCallCheck2.default)(this, rt);
  13263. return _super7.apply(this, arguments);
  13264. }
  13265. (0, _createClass2.default)(rt, [{
  13266. key: "signIn",
  13267. value: function () {
  13268. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  13269. var n, s, r, i, o;
  13270. return _regenerator.default.wrap(function _callee22$(_context22) {
  13271. while (1) {
  13272. switch (_context22.prev = _context22.next) {
  13273. case 0:
  13274. if (!("string" != typeof e)) {
  13275. _context22.next = 2;
  13276. break;
  13277. }
  13278. throw new te({
  13279. code: "PARAM_ERROR",
  13280. message: "username must be a string"
  13281. });
  13282. case 2:
  13283. "string" != typeof t && (t = "", console.warn("password is empty"));
  13284. n = this._cache.keys.refreshTokenKey;
  13285. _context22.next = 6;
  13286. return this._request.send("auth.signIn", {
  13287. loginType: We.USERNAME,
  13288. username: e,
  13289. password: t,
  13290. refresh_token: this._cache.getStore(n) || ""
  13291. });
  13292. case 6:
  13293. s = _context22.sent;
  13294. r = s.refresh_token;
  13295. i = s.access_token_expire;
  13296. o = s.access_token;
  13297. if (!r) {
  13298. _context22.next = 23;
  13299. break;
  13300. }
  13301. this.setRefreshToken(r);
  13302. if (!(o && i)) {
  13303. _context22.next = 16;
  13304. break;
  13305. }
  13306. this.setAccessToken(o, i);
  13307. _context22.next = 18;
  13308. break;
  13309. case 16:
  13310. _context22.next = 18;
  13311. return this._request.refreshAccessToken();
  13312. case 18:
  13313. _context22.next = 20;
  13314. return this.refreshUserInfo();
  13315. case 20:
  13316. qe(Fe);
  13317. qe(je, {
  13318. env: this.config.env,
  13319. loginType: We.USERNAME,
  13320. persistence: this.config.persistence
  13321. });
  13322. return _context22.abrupt("return", new et(this.config.env));
  13323. case 23:
  13324. throw s.code ? new te({
  13325. code: s.code,
  13326. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13327. }) : new te({
  13328. message: "用户名密码登录失败"
  13329. });
  13330. case 24:
  13331. case "end":
  13332. return _context22.stop();
  13333. }
  13334. }
  13335. }, _callee22, this);
  13336. }));
  13337. function signIn(_x17, _x18) {
  13338. return _signIn4.apply(this, arguments);
  13339. }
  13340. return signIn;
  13341. }()
  13342. }]);
  13343. return rt;
  13344. }(Xe);
  13345. var it = /*#__PURE__*/function () {
  13346. function it(e) {
  13347. (0, _classCallCheck2.default)(this, it);
  13348. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  13349. }
  13350. (0, _createClass2.default)(it, [{
  13351. key: "currentUser",
  13352. get: function get() {
  13353. var e = this.hasLoginState();
  13354. return e && e.user || null;
  13355. }
  13356. }, {
  13357. key: "loginType",
  13358. get: function get() {
  13359. return this._cache.getStore(this._cache.keys.loginTypeKey);
  13360. }
  13361. }, {
  13362. key: "anonymousAuthProvider",
  13363. value: function anonymousAuthProvider() {
  13364. return new tt(this.config);
  13365. }
  13366. }, {
  13367. key: "customAuthProvider",
  13368. value: function customAuthProvider() {
  13369. return new nt(this.config);
  13370. }
  13371. }, {
  13372. key: "emailAuthProvider",
  13373. value: function emailAuthProvider() {
  13374. return new st(this.config);
  13375. }
  13376. }, {
  13377. key: "usernameAuthProvider",
  13378. value: function usernameAuthProvider() {
  13379. return new rt(this.config);
  13380. }
  13381. }, {
  13382. key: "signInAnonymously",
  13383. value: function () {
  13384. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  13385. return _regenerator.default.wrap(function _callee23$(_context23) {
  13386. while (1) {
  13387. switch (_context23.prev = _context23.next) {
  13388. case 0:
  13389. return _context23.abrupt("return", new tt(this.config).signIn());
  13390. case 1:
  13391. case "end":
  13392. return _context23.stop();
  13393. }
  13394. }
  13395. }, _callee23, this);
  13396. }));
  13397. function signInAnonymously() {
  13398. return _signInAnonymously.apply(this, arguments);
  13399. }
  13400. return signInAnonymously;
  13401. }()
  13402. }, {
  13403. key: "signInWithEmailAndPassword",
  13404. value: function () {
  13405. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  13406. return _regenerator.default.wrap(function _callee24$(_context24) {
  13407. while (1) {
  13408. switch (_context24.prev = _context24.next) {
  13409. case 0:
  13410. return _context24.abrupt("return", new st(this.config).signIn(e, t));
  13411. case 1:
  13412. case "end":
  13413. return _context24.stop();
  13414. }
  13415. }
  13416. }, _callee24, this);
  13417. }));
  13418. function signInWithEmailAndPassword(_x19, _x20) {
  13419. return _signInWithEmailAndPassword.apply(this, arguments);
  13420. }
  13421. return signInWithEmailAndPassword;
  13422. }()
  13423. }, {
  13424. key: "signInWithUsernameAndPassword",
  13425. value: function signInWithUsernameAndPassword(e, t) {
  13426. return new rt(this.config).signIn(e, t);
  13427. }
  13428. }, {
  13429. key: "linkAndRetrieveDataWithTicket",
  13430. value: function () {
  13431. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  13432. return _regenerator.default.wrap(function _callee25$(_context25) {
  13433. while (1) {
  13434. switch (_context25.prev = _context25.next) {
  13435. case 0:
  13436. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De($e, this._onAnonymousConverted);
  13437. _context25.next = 3;
  13438. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  13439. case 3:
  13440. return _context25.abrupt("return", _context25.sent);
  13441. case 4:
  13442. case "end":
  13443. return _context25.stop();
  13444. }
  13445. }
  13446. }, _callee25, this);
  13447. }));
  13448. function linkAndRetrieveDataWithTicket(_x21) {
  13449. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  13450. }
  13451. return linkAndRetrieveDataWithTicket;
  13452. }()
  13453. }, {
  13454. key: "signOut",
  13455. value: function () {
  13456. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  13457. var _this$_cache$keys10, e, t, n, s, r;
  13458. return _regenerator.default.wrap(function _callee26$(_context26) {
  13459. while (1) {
  13460. switch (_context26.prev = _context26.next) {
  13461. case 0:
  13462. if (!(this.loginType === We.ANONYMOUS)) {
  13463. _context26.next = 2;
  13464. break;
  13465. }
  13466. throw new te({
  13467. message: "匿名用户不支持登出操作"
  13468. });
  13469. case 2:
  13470. _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);
  13471. if (s) {
  13472. _context26.next = 5;
  13473. break;
  13474. }
  13475. return _context26.abrupt("return");
  13476. case 5:
  13477. _context26.next = 7;
  13478. return this._request.send("auth.logout", {
  13479. refresh_token: s
  13480. });
  13481. case 7:
  13482. r = _context26.sent;
  13483. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), qe(Fe), qe(je, {
  13484. env: this.config.env,
  13485. loginType: We.NULL,
  13486. persistence: this.config.persistence
  13487. }), r));
  13488. case 9:
  13489. case "end":
  13490. return _context26.stop();
  13491. }
  13492. }
  13493. }, _callee26, this);
  13494. }));
  13495. function signOut() {
  13496. return _signOut.apply(this, arguments);
  13497. }
  13498. return signOut;
  13499. }()
  13500. }, {
  13501. key: "signUpWithEmailAndPassword",
  13502. value: function () {
  13503. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  13504. return _regenerator.default.wrap(function _callee27$(_context27) {
  13505. while (1) {
  13506. switch (_context27.prev = _context27.next) {
  13507. case 0:
  13508. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  13509. email: e,
  13510. password: t
  13511. }));
  13512. case 1:
  13513. case "end":
  13514. return _context27.stop();
  13515. }
  13516. }
  13517. }, _callee27, this);
  13518. }));
  13519. function signUpWithEmailAndPassword(_x22, _x23) {
  13520. return _signUpWithEmailAndPassword.apply(this, arguments);
  13521. }
  13522. return signUpWithEmailAndPassword;
  13523. }()
  13524. }, {
  13525. key: "sendPasswordResetEmail",
  13526. value: function () {
  13527. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  13528. return _regenerator.default.wrap(function _callee28$(_context28) {
  13529. while (1) {
  13530. switch (_context28.prev = _context28.next) {
  13531. case 0:
  13532. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  13533. email: e
  13534. }));
  13535. case 1:
  13536. case "end":
  13537. return _context28.stop();
  13538. }
  13539. }
  13540. }, _callee28, this);
  13541. }));
  13542. function sendPasswordResetEmail(_x24) {
  13543. return _sendPasswordResetEmail.apply(this, arguments);
  13544. }
  13545. return sendPasswordResetEmail;
  13546. }()
  13547. }, {
  13548. key: "onLoginStateChanged",
  13549. value: function onLoginStateChanged(e) {
  13550. var _this9 = this;
  13551. De(Fe, function () {
  13552. var t = _this9.hasLoginState();
  13553. e.call(_this9, t);
  13554. });
  13555. var t = this.hasLoginState();
  13556. e.call(this, t);
  13557. }
  13558. }, {
  13559. key: "onLoginStateExpired",
  13560. value: function onLoginStateExpired(e) {
  13561. De(Ke, e.bind(this));
  13562. }
  13563. }, {
  13564. key: "onAccessTokenRefreshed",
  13565. value: function onAccessTokenRefreshed(e) {
  13566. De(Be, e.bind(this));
  13567. }
  13568. }, {
  13569. key: "onAnonymousConverted",
  13570. value: function onAnonymousConverted(e) {
  13571. De($e, e.bind(this));
  13572. }
  13573. }, {
  13574. key: "onLoginTypeChanged",
  13575. value: function onLoginTypeChanged(e) {
  13576. var _this10 = this;
  13577. De(je, function () {
  13578. var t = _this10.hasLoginState();
  13579. e.call(_this10, t);
  13580. });
  13581. }
  13582. }, {
  13583. key: "getAccessToken",
  13584. value: function () {
  13585. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  13586. return _regenerator.default.wrap(function _callee29$(_context29) {
  13587. while (1) {
  13588. switch (_context29.prev = _context29.next) {
  13589. case 0:
  13590. _context29.next = 2;
  13591. return this._request.getAccessToken();
  13592. case 2:
  13593. _context29.t0 = _context29.sent.accessToken;
  13594. _context29.t1 = this.config.env;
  13595. return _context29.abrupt("return", {
  13596. accessToken: _context29.t0,
  13597. env: _context29.t1
  13598. });
  13599. case 5:
  13600. case "end":
  13601. return _context29.stop();
  13602. }
  13603. }
  13604. }, _callee29, this);
  13605. }));
  13606. function getAccessToken() {
  13607. return _getAccessToken2.apply(this, arguments);
  13608. }
  13609. return getAccessToken;
  13610. }()
  13611. }, {
  13612. key: "hasLoginState",
  13613. value: function hasLoginState() {
  13614. var e = this._cache.keys.refreshTokenKey;
  13615. return this._cache.getStore(e) ? new et(this.config.env) : null;
  13616. }
  13617. }, {
  13618. key: "isUsernameRegistered",
  13619. value: function () {
  13620. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  13621. var _yield$this$_request$5, t;
  13622. return _regenerator.default.wrap(function _callee30$(_context30) {
  13623. while (1) {
  13624. switch (_context30.prev = _context30.next) {
  13625. case 0:
  13626. if (!("string" != typeof e)) {
  13627. _context30.next = 2;
  13628. break;
  13629. }
  13630. throw new te({
  13631. code: "PARAM_ERROR",
  13632. message: "username must be a string"
  13633. });
  13634. case 2:
  13635. _context30.next = 4;
  13636. return this._request.send("auth.isUsernameRegistered", {
  13637. username: e
  13638. });
  13639. case 4:
  13640. _yield$this$_request$5 = _context30.sent;
  13641. t = _yield$this$_request$5.data;
  13642. return _context30.abrupt("return", t && t.isRegistered);
  13643. case 7:
  13644. case "end":
  13645. return _context30.stop();
  13646. }
  13647. }
  13648. }, _callee30, this);
  13649. }));
  13650. function isUsernameRegistered(_x25) {
  13651. return _isUsernameRegistered.apply(this, arguments);
  13652. }
  13653. return isUsernameRegistered;
  13654. }()
  13655. }, {
  13656. key: "getLoginState",
  13657. value: function getLoginState() {
  13658. return Promise.resolve(this.hasLoginState());
  13659. }
  13660. }, {
  13661. key: "signInWithTicket",
  13662. value: function () {
  13663. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  13664. return _regenerator.default.wrap(function _callee31$(_context31) {
  13665. while (1) {
  13666. switch (_context31.prev = _context31.next) {
  13667. case 0:
  13668. return _context31.abrupt("return", new nt(this.config).signIn(e));
  13669. case 1:
  13670. case "end":
  13671. return _context31.stop();
  13672. }
  13673. }
  13674. }, _callee31, this);
  13675. }));
  13676. function signInWithTicket(_x26) {
  13677. return _signInWithTicket.apply(this, arguments);
  13678. }
  13679. return signInWithTicket;
  13680. }()
  13681. }, {
  13682. key: "shouldRefreshAccessToken",
  13683. value: function shouldRefreshAccessToken(e) {
  13684. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  13685. }
  13686. }, {
  13687. key: "getUserInfo",
  13688. value: function getUserInfo() {
  13689. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  13690. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  13691. requestId: e.seqId
  13692. });
  13693. });
  13694. }
  13695. }, {
  13696. key: "getAuthHeader",
  13697. value: function getAuthHeader() {
  13698. var _this$_cache$keys11 = this._cache.keys,
  13699. e = _this$_cache$keys11.refreshTokenKey,
  13700. t = _this$_cache$keys11.accessTokenKey,
  13701. n = this._cache.getStore(e);
  13702. return {
  13703. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  13704. };
  13705. }
  13706. }, {
  13707. key: "_onAnonymousConverted",
  13708. value: function _onAnonymousConverted(e) {
  13709. var t = e.data.env;
  13710. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  13711. }
  13712. }, {
  13713. key: "_onLoginTypeChanged",
  13714. value: function _onLoginTypeChanged(e) {
  13715. var _e$data = e.data,
  13716. t = _e$data.loginType,
  13717. n = _e$data.persistence,
  13718. s = _e$data.env;
  13719. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  13720. }
  13721. }]);
  13722. return it;
  13723. }();
  13724. var ot = function ot(e, t) {
  13725. t = t || ve();
  13726. var n = Qe(this.config.env),
  13727. s = e.cloudPath,
  13728. r = e.filePath,
  13729. i = e.onUploadProgress,
  13730. _e$fileType = e.fileType,
  13731. o = _e$fileType === void 0 ? "image" : _e$fileType;
  13732. return n.send("storage.getUploadMetadata", {
  13733. path: s
  13734. }).then(function (e) {
  13735. var _e$data2 = e.data,
  13736. a = _e$data2.url,
  13737. c = _e$data2.authorization,
  13738. u = _e$data2.token,
  13739. l = _e$data2.fileId,
  13740. h = _e$data2.cosFileId,
  13741. d = e.requestId,
  13742. p = {
  13743. key: s,
  13744. signature: c,
  13745. "x-cos-meta-fileid": h,
  13746. success_action_status: "201",
  13747. "x-cos-security-token": u
  13748. };
  13749. n.upload({
  13750. url: a,
  13751. data: p,
  13752. file: r,
  13753. name: s,
  13754. fileType: o,
  13755. onUploadProgress: i
  13756. }).then(function (e) {
  13757. 201 === e.statusCode ? t(null, {
  13758. fileID: l,
  13759. requestId: d
  13760. }) : t(new te({
  13761. code: "STORAGE_REQUEST_FAIL",
  13762. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  13763. }));
  13764. }).catch(function (e) {
  13765. t(e);
  13766. });
  13767. }).catch(function (e) {
  13768. t(e);
  13769. }), t.promise;
  13770. },
  13771. at = function at(e, t) {
  13772. t = t || ve();
  13773. var n = Qe(this.config.env),
  13774. s = e.cloudPath;
  13775. return n.send("storage.getUploadMetadata", {
  13776. path: s
  13777. }).then(function (e) {
  13778. t(null, e);
  13779. }).catch(function (e) {
  13780. t(e);
  13781. }), t.promise;
  13782. },
  13783. ct = function ct(_ref7, t) {
  13784. var e = _ref7.fileList;
  13785. if (t = t || ve(), !e || !Array.isArray(e)) return {
  13786. code: "INVALID_PARAM",
  13787. message: "fileList必须是非空的数组"
  13788. };
  13789. var _iterator3 = _createForOfIteratorHelper(e),
  13790. _step3;
  13791. try {
  13792. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  13793. var _t8 = _step3.value;
  13794. if (!_t8 || "string" != typeof _t8) return {
  13795. code: "INVALID_PARAM",
  13796. message: "fileList的元素必须是非空的字符串"
  13797. };
  13798. }
  13799. } catch (err) {
  13800. _iterator3.e(err);
  13801. } finally {
  13802. _iterator3.f();
  13803. }
  13804. var n = {
  13805. fileid_list: e
  13806. };
  13807. return Qe(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  13808. e.code ? t(null, e) : t(null, {
  13809. fileList: e.data.delete_list,
  13810. requestId: e.requestId
  13811. });
  13812. }).catch(function (e) {
  13813. t(e);
  13814. }), t.promise;
  13815. },
  13816. ut = function ut(_ref8, t) {
  13817. var e = _ref8.fileList;
  13818. t = t || ve(), e && Array.isArray(e) || t(null, {
  13819. code: "INVALID_PARAM",
  13820. message: "fileList必须是非空的数组"
  13821. });
  13822. var n = [];
  13823. var _iterator4 = _createForOfIteratorHelper(e),
  13824. _step4;
  13825. try {
  13826. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  13827. var _s10 = _step4.value;
  13828. "object" == (0, _typeof2.default)(_s10) ? (_s10.hasOwnProperty("fileID") && _s10.hasOwnProperty("maxAge") || t(null, {
  13829. code: "INVALID_PARAM",
  13830. message: "fileList的元素必须是包含fileID和maxAge的对象"
  13831. }), n.push({
  13832. fileid: _s10.fileID,
  13833. max_age: _s10.maxAge
  13834. })) : "string" == typeof _s10 ? n.push({
  13835. fileid: _s10
  13836. }) : t(null, {
  13837. code: "INVALID_PARAM",
  13838. message: "fileList的元素必须是字符串"
  13839. });
  13840. }
  13841. } catch (err) {
  13842. _iterator4.e(err);
  13843. } finally {
  13844. _iterator4.f();
  13845. }
  13846. var s = {
  13847. file_list: n
  13848. };
  13849. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  13850. e.code ? t(null, e) : t(null, {
  13851. fileList: e.data.download_list,
  13852. requestId: e.requestId
  13853. });
  13854. }).catch(function (e) {
  13855. t(e);
  13856. }), t.promise;
  13857. },
  13858. lt = /*#__PURE__*/function () {
  13859. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  13860. var e, n, s, r;
  13861. return _regenerator.default.wrap(function _callee32$(_context32) {
  13862. while (1) {
  13863. switch (_context32.prev = _context32.next) {
  13864. case 0:
  13865. e = _ref9.fileID;
  13866. _context32.next = 3;
  13867. return ut.call(this, {
  13868. fileList: [{
  13869. fileID: e,
  13870. maxAge: 600
  13871. }]
  13872. });
  13873. case 3:
  13874. n = _context32.sent.fileList[0];
  13875. if (!("SUCCESS" !== n.code)) {
  13876. _context32.next = 6;
  13877. break;
  13878. }
  13879. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13880. e(n);
  13881. }));
  13882. case 6:
  13883. s = Qe(this.config.env);
  13884. r = n.download_url;
  13885. if (!(r = encodeURI(r), !t)) {
  13886. _context32.next = 10;
  13887. break;
  13888. }
  13889. return _context32.abrupt("return", s.download({
  13890. url: r
  13891. }));
  13892. case 10:
  13893. _context32.t0 = t;
  13894. _context32.next = 13;
  13895. return s.download({
  13896. url: r
  13897. });
  13898. case 13:
  13899. _context32.t1 = _context32.sent;
  13900. (0, _context32.t0)(_context32.t1);
  13901. case 15:
  13902. case "end":
  13903. return _context32.stop();
  13904. }
  13905. }
  13906. }, _callee32, this);
  13907. }));
  13908. return function lt(_x27, _x28) {
  13909. return _ref10.apply(this, arguments);
  13910. };
  13911. }(),
  13912. ht = function ht(_ref11, o) {
  13913. var e = _ref11.name,
  13914. t = _ref11.data,
  13915. n = _ref11.query,
  13916. s = _ref11.parse,
  13917. r = _ref11.search,
  13918. i = _ref11.timeout;
  13919. var a = o || ve();
  13920. var c;
  13921. try {
  13922. c = t ? JSON.stringify(t) : "";
  13923. } catch (e) {
  13924. return Promise.reject(e);
  13925. }
  13926. if (!e) return Promise.reject(new te({
  13927. code: "PARAM_ERROR",
  13928. message: "函数名不能为空"
  13929. }));
  13930. var u = {
  13931. inQuery: n,
  13932. parse: s,
  13933. search: r,
  13934. function_name: e,
  13935. request_data: c
  13936. };
  13937. return Qe(this.config.env).send("functions.invokeFunction", u, {
  13938. timeout: i
  13939. }).then(function (e) {
  13940. if (e.code) a(null, e);else {
  13941. var _t9 = e.data.response_data;
  13942. if (s) a(null, {
  13943. result: _t9,
  13944. requestId: e.requestId
  13945. });else try {
  13946. _t9 = JSON.parse(e.data.response_data), a(null, {
  13947. result: _t9,
  13948. requestId: e.requestId
  13949. });
  13950. } catch (e) {
  13951. a(new te({
  13952. message: "response data must be json"
  13953. }));
  13954. }
  13955. }
  13956. return a.promise;
  13957. }).catch(function (e) {
  13958. a(e);
  13959. }), a.promise;
  13960. },
  13961. dt = {
  13962. timeout: 15e3,
  13963. persistence: "session"
  13964. },
  13965. pt = {};
  13966. var ft = /*#__PURE__*/function () {
  13967. function ft(e) {
  13968. (0, _classCallCheck2.default)(this, ft);
  13969. this.config = e || this.config, this.authObj = void 0;
  13970. }
  13971. (0, _createClass2.default)(ft, [{
  13972. key: "init",
  13973. value: function init(e) {
  13974. switch (Ae.adapter || (this.requestClient = new Ae.adapter.reqClass({
  13975. timeout: e.timeout || 5e3,
  13976. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13977. })), this.config = _objectSpread(_objectSpread({}, dt), e), !0) {
  13978. case this.config.timeout > 6e5:
  13979. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13980. break;
  13981. case this.config.timeout < 100:
  13982. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13983. }
  13984. return new ft(this.config);
  13985. }
  13986. }, {
  13987. key: "auth",
  13988. value: function auth() {
  13989. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13990. e = _ref12.persistence;
  13991. if (this.authObj) return this.authObj;
  13992. var t = e || Ae.adapter.primaryStorage || dt.persistence;
  13993. var n;
  13994. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13995. var t = e.env;
  13996. Oe[t] = new xe(e), Ee[t] = new xe(_objectSpread(_objectSpread({}, e), {}, {
  13997. persistence: "local"
  13998. }));
  13999. }(this.config), n = this.config, Ye[n.env] = new Ge(n), this.authObj = new it(this.config), this.authObj;
  14000. }
  14001. }, {
  14002. key: "on",
  14003. value: function on(e, t) {
  14004. return De.apply(this, [e, t]);
  14005. }
  14006. }, {
  14007. key: "off",
  14008. value: function off(e, t) {
  14009. return Me.apply(this, [e, t]);
  14010. }
  14011. }, {
  14012. key: "callFunction",
  14013. value: function callFunction(e, t) {
  14014. return ht.apply(this, [e, t]);
  14015. }
  14016. }, {
  14017. key: "deleteFile",
  14018. value: function deleteFile(e, t) {
  14019. return ct.apply(this, [e, t]);
  14020. }
  14021. }, {
  14022. key: "getTempFileURL",
  14023. value: function getTempFileURL(e, t) {
  14024. return ut.apply(this, [e, t]);
  14025. }
  14026. }, {
  14027. key: "downloadFile",
  14028. value: function downloadFile(e, t) {
  14029. return lt.apply(this, [e, t]);
  14030. }
  14031. }, {
  14032. key: "uploadFile",
  14033. value: function uploadFile(e, t) {
  14034. return ot.apply(this, [e, t]);
  14035. }
  14036. }, {
  14037. key: "getUploadMetadata",
  14038. value: function getUploadMetadata(e, t) {
  14039. return at.apply(this, [e, t]);
  14040. }
  14041. }, {
  14042. key: "registerExtension",
  14043. value: function registerExtension(e) {
  14044. pt[e.name] = e;
  14045. }
  14046. }, {
  14047. key: "invokeExtension",
  14048. value: function () {
  14049. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  14050. var n;
  14051. return _regenerator.default.wrap(function _callee33$(_context33) {
  14052. while (1) {
  14053. switch (_context33.prev = _context33.next) {
  14054. case 0:
  14055. n = pt[e];
  14056. if (n) {
  14057. _context33.next = 3;
  14058. break;
  14059. }
  14060. throw new te({
  14061. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  14062. });
  14063. case 3:
  14064. _context33.next = 5;
  14065. return n.invoke(t, this);
  14066. case 5:
  14067. return _context33.abrupt("return", _context33.sent);
  14068. case 6:
  14069. case "end":
  14070. return _context33.stop();
  14071. }
  14072. }
  14073. }, _callee33, this);
  14074. }));
  14075. function invokeExtension(_x29, _x30) {
  14076. return _invokeExtension.apply(this, arguments);
  14077. }
  14078. return invokeExtension;
  14079. }()
  14080. }, {
  14081. key: "useAdapters",
  14082. value: function useAdapters(e) {
  14083. var _ref13 = ke(e) || {},
  14084. t = _ref13.adapter,
  14085. n = _ref13.runtime;
  14086. t && (Ae.adapter = t), n && (Ae.runtime = n);
  14087. }
  14088. }]);
  14089. return ft;
  14090. }();
  14091. var gt = new ft();
  14092. function mt(e, t, n) {
  14093. void 0 === n && (n = {});
  14094. var s = /\?/.test(t),
  14095. r = "";
  14096. for (var i in n) {
  14097. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  14098. }
  14099. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  14100. }
  14101. var yt = /*#__PURE__*/function () {
  14102. function yt() {
  14103. (0, _classCallCheck2.default)(this, yt);
  14104. }
  14105. (0, _createClass2.default)(yt, [{
  14106. key: "post",
  14107. value: function post(e) {
  14108. var t = e.url,
  14109. n = e.data,
  14110. s = e.headers,
  14111. r = e.timeout;
  14112. return new Promise(function (e, i) {
  14113. ne.request({
  14114. url: mt("https:", t),
  14115. data: n,
  14116. method: "POST",
  14117. header: s,
  14118. timeout: r,
  14119. success: function success(t) {
  14120. e(t);
  14121. },
  14122. fail: function fail(e) {
  14123. i(e);
  14124. }
  14125. });
  14126. });
  14127. }
  14128. }, {
  14129. key: "upload",
  14130. value: function upload(e) {
  14131. return new Promise(function (t, n) {
  14132. var s = e.url,
  14133. r = e.file,
  14134. i = e.data,
  14135. o = e.headers,
  14136. a = e.fileType,
  14137. c = ne.uploadFile({
  14138. url: mt("https:", s),
  14139. name: "file",
  14140. formData: Object.assign({}, i),
  14141. filePath: r,
  14142. fileType: a,
  14143. header: o,
  14144. success: function success(e) {
  14145. var n = {
  14146. statusCode: e.statusCode,
  14147. data: e.data || {}
  14148. };
  14149. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  14150. },
  14151. fail: function fail(e) {
  14152. n(new Error(e.errMsg || "uploadFile:fail"));
  14153. }
  14154. });
  14155. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  14156. e.onUploadProgress({
  14157. loaded: t.totalBytesSent,
  14158. total: t.totalBytesExpectedToSend
  14159. });
  14160. });
  14161. });
  14162. }
  14163. }]);
  14164. return yt;
  14165. }();
  14166. var _t = {
  14167. setItem: function setItem(e, t) {
  14168. ne.setStorageSync(e, t);
  14169. },
  14170. getItem: function getItem(e) {
  14171. return ne.getStorageSync(e);
  14172. },
  14173. removeItem: function removeItem(e) {
  14174. ne.removeStorageSync(e);
  14175. },
  14176. clear: function clear() {
  14177. ne.clearStorageSync();
  14178. }
  14179. };
  14180. var wt = {
  14181. genAdapter: function genAdapter() {
  14182. return {
  14183. root: {},
  14184. reqClass: yt,
  14185. localStorage: _t,
  14186. primaryStorage: "local"
  14187. };
  14188. },
  14189. isMatch: function isMatch() {
  14190. return !0;
  14191. },
  14192. runtime: "uni_app"
  14193. };
  14194. gt.useAdapters(wt);
  14195. var vt = gt,
  14196. It = vt.init;
  14197. vt.init = function (e) {
  14198. e.env = e.spaceId;
  14199. var t = It.call(this, e);
  14200. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  14201. var n = t.auth;
  14202. return t.auth = function (e) {
  14203. var t = n.call(this, e);
  14204. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  14205. var n;
  14206. t[e] = (n = t[e], function (e) {
  14207. e = e || {};
  14208. var _ee = ee(e),
  14209. t = _ee.success,
  14210. s = _ee.fail,
  14211. r = _ee.complete;
  14212. if (!(t || s || r)) return n.call(this, e);
  14213. n.call(this, e).then(function (e) {
  14214. t && t(e), r && r(e);
  14215. }, function (e) {
  14216. s && s(e), r && r(e);
  14217. });
  14218. }).bind(t);
  14219. }), t;
  14220. }, t.customAuth = t.auth, t;
  14221. };
  14222. var St = vt;
  14223. function bt(_x31, _x32) {
  14224. return _bt.apply(this, arguments);
  14225. }
  14226. function _bt() {
  14227. _bt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e, t) {
  14228. var n, _e30, s;
  14229. return _regenerator.default.wrap(function _callee59$(_context59) {
  14230. while (1) {
  14231. switch (_context59.prev = _context59.next) {
  14232. case 0:
  14233. n = "http://".concat(e, ":").concat(t, "/system/ping");
  14234. _context59.prev = 1;
  14235. _context59.next = 4;
  14236. return s = {
  14237. url: n,
  14238. timeout: 500
  14239. }, new Promise(function (e, t) {
  14240. ne.request(_objectSpread(_objectSpread({}, s), {}, {
  14241. success: function success(t) {
  14242. e(t);
  14243. },
  14244. fail: function fail(e) {
  14245. t(e);
  14246. }
  14247. }));
  14248. });
  14249. case 4:
  14250. _e30 = _context59.sent;
  14251. return _context59.abrupt("return", !(!_e30.data || 0 !== _e30.data.code));
  14252. case 8:
  14253. _context59.prev = 8;
  14254. _context59.t0 = _context59["catch"](1);
  14255. return _context59.abrupt("return", !1);
  14256. case 11:
  14257. case "end":
  14258. return _context59.stop();
  14259. }
  14260. }
  14261. }, _callee59, null, [[1, 8]]);
  14262. }));
  14263. return _bt.apply(this, arguments);
  14264. }
  14265. function kt(_x33, _x34) {
  14266. return _kt.apply(this, arguments);
  14267. }
  14268. function _kt() {
  14269. _kt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(e, t) {
  14270. var n, s, _r10;
  14271. return _regenerator.default.wrap(function _callee60$(_context60) {
  14272. while (1) {
  14273. switch (_context60.prev = _context60.next) {
  14274. case 0:
  14275. s = 0;
  14276. case 1:
  14277. if (!(s < e.length)) {
  14278. _context60.next = 11;
  14279. break;
  14280. }
  14281. _r10 = e[s];
  14282. _context60.next = 5;
  14283. return bt(_r10, t);
  14284. case 5:
  14285. if (!_context60.sent) {
  14286. _context60.next = 8;
  14287. break;
  14288. }
  14289. n = _r10;
  14290. return _context60.abrupt("break", 11);
  14291. case 8:
  14292. s++;
  14293. _context60.next = 1;
  14294. break;
  14295. case 11:
  14296. return _context60.abrupt("return", {
  14297. address: n,
  14298. port: t
  14299. });
  14300. case 12:
  14301. case "end":
  14302. return _context60.stop();
  14303. }
  14304. }
  14305. }, _callee60);
  14306. }));
  14307. return _kt.apply(this, arguments);
  14308. }
  14309. var At = {
  14310. "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign",
  14311. "serverless.file.resource.report": "storage/report",
  14312. "serverless.file.resource.delete": "storage/delete",
  14313. "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url"
  14314. };
  14315. var Ct = /*#__PURE__*/function () {
  14316. function Ct(e) {
  14317. (0, _classCallCheck2.default)(this, Ct);
  14318. if (["spaceId", "clientSecret"].forEach(function (t) {
  14319. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  14320. }), !e.endpoint) throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");
  14321. this.config = Object.assign({}, e), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ne;
  14322. }
  14323. (0, _createClass2.default)(Ct, [{
  14324. key: "request",
  14325. value: function () {
  14326. var _request2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  14327. var _this11 = this;
  14328. var t,
  14329. n,
  14330. _args34 = arguments;
  14331. return _regenerator.default.wrap(function _callee34$(_context34) {
  14332. while (1) {
  14333. switch (_context34.prev = _context34.next) {
  14334. case 0:
  14335. t = _args34.length > 1 && _args34[1] !== undefined ? _args34[1] : !0;
  14336. n = S && t;
  14337. if (!n) {
  14338. _context34.next = 8;
  14339. break;
  14340. }
  14341. _context34.next = 5;
  14342. return this.setupLocalRequest(e);
  14343. case 5:
  14344. _context34.t0 = _context34.sent;
  14345. _context34.next = 9;
  14346. break;
  14347. case 8:
  14348. _context34.t0 = this.setupRequest(e);
  14349. case 9:
  14350. e = _context34.t0;
  14351. return _context34.abrupt("return", Promise.resolve().then(function () {
  14352. return n ? _this11.requestLocal(e) : he.wrappedRequest(e, _this11.adapter.request);
  14353. }));
  14354. case 11:
  14355. case "end":
  14356. return _context34.stop();
  14357. }
  14358. }
  14359. }, _callee34, this);
  14360. }));
  14361. function request(_x35) {
  14362. return _request2.apply(this, arguments);
  14363. }
  14364. return request;
  14365. }()
  14366. }, {
  14367. key: "requestLocal",
  14368. value: function requestLocal(e) {
  14369. var _this12 = this;
  14370. return new Promise(function (t, n) {
  14371. _this12.adapter.request(Object.assign(e, {
  14372. complete: function complete(e) {
  14373. if (e || (e = {}), !e.statusCode || e.statusCode >= 400) {
  14374. var _t10 = e.data && e.data.code || "SYS_ERR",
  14375. _s11 = e.data && e.data.message || "request:fail";
  14376. return n(new te({
  14377. code: _t10,
  14378. message: _s11
  14379. }));
  14380. }
  14381. t({
  14382. success: !0,
  14383. result: e.data
  14384. });
  14385. }
  14386. }));
  14387. });
  14388. }
  14389. }, {
  14390. key: "setupRequest",
  14391. value: function setupRequest(e) {
  14392. var t = Object.assign({}, e, {
  14393. spaceId: this.config.spaceId,
  14394. timestamp: Date.now()
  14395. }),
  14396. n = {
  14397. "Content-Type": "application/json"
  14398. };
  14399. n["x-serverless-sign"] = he.sign(t, this.config.clientSecret);
  14400. var s = le();
  14401. n["x-client-info"] = encodeURIComponent(JSON.stringify(s));
  14402. var _se = se(),
  14403. r = _se.token;
  14404. return n["x-client-token"] = r, {
  14405. url: this.config.requestUrl,
  14406. method: "POST",
  14407. data: t,
  14408. dataType: "json",
  14409. header: JSON.parse(JSON.stringify(n))
  14410. };
  14411. }
  14412. }, {
  14413. key: "setupLocalRequest",
  14414. value: function () {
  14415. var _setupLocalRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  14416. var t, _se2, n, s, _ref14, r, i, _yield$kt, o;
  14417. return _regenerator.default.wrap(function _callee35$(_context35) {
  14418. while (1) {
  14419. switch (_context35.prev = _context35.next) {
  14420. case 0:
  14421. t = le();
  14422. _se2 = se();
  14423. n = _se2.token;
  14424. s = Object.assign({}, e, {
  14425. spaceId: this.config.spaceId,
  14426. timestamp: Date.now(),
  14427. clientInfo: t,
  14428. token: n
  14429. });
  14430. _ref14 = this.__dev__ && this.__dev__.debugInfo || {};
  14431. r = _ref14.address;
  14432. i = _ref14.servePort;
  14433. _context35.next = 9;
  14434. return kt(r, i);
  14435. case 9:
  14436. _yield$kt = _context35.sent;
  14437. o = _yield$kt.address;
  14438. return _context35.abrupt("return", {
  14439. url: "http://".concat(o, ":").concat(i, "/").concat(At[e.method]),
  14440. method: "POST",
  14441. data: s,
  14442. dataType: "json",
  14443. header: JSON.parse(JSON.stringify({
  14444. "Content-Type": "application/json"
  14445. }))
  14446. });
  14447. case 12:
  14448. case "end":
  14449. return _context35.stop();
  14450. }
  14451. }
  14452. }, _callee35, this);
  14453. }));
  14454. function setupLocalRequest(_x36) {
  14455. return _setupLocalRequest.apply(this, arguments);
  14456. }
  14457. return setupLocalRequest;
  14458. }()
  14459. }, {
  14460. key: "callFunction",
  14461. value: function callFunction(e) {
  14462. var t = {
  14463. method: "serverless.function.runtime.invoke",
  14464. params: JSON.stringify({
  14465. functionTarget: e.name,
  14466. functionArgs: e.data || {}
  14467. })
  14468. };
  14469. return this.request(t, !1);
  14470. }
  14471. }, {
  14472. key: "getUploadFileOptions",
  14473. value: function getUploadFileOptions(e) {
  14474. var t = {
  14475. method: "serverless.file.resource.generateProximalSign",
  14476. params: JSON.stringify(e)
  14477. };
  14478. return this.request(t);
  14479. }
  14480. }, {
  14481. key: "reportUploadFile",
  14482. value: function reportUploadFile(e) {
  14483. var t = {
  14484. method: "serverless.file.resource.report",
  14485. params: JSON.stringify(e)
  14486. };
  14487. return this.request(t);
  14488. }
  14489. }, {
  14490. key: "uploadFile",
  14491. value: function uploadFile(_ref15) {
  14492. var _this13 = this;
  14493. var e = _ref15.filePath,
  14494. t = _ref15.cloudPath,
  14495. _ref15$fileType = _ref15.fileType,
  14496. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  14497. s = _ref15.onUploadProgress;
  14498. if (!t) throw new te({
  14499. code: "CLOUDPATH_REQUIRED",
  14500. message: "cloudPath不可为空"
  14501. });
  14502. var r;
  14503. return this.getUploadFileOptions({
  14504. cloudPath: t
  14505. }).then(function (t) {
  14506. var _t$result = t.result,
  14507. i = _t$result.url,
  14508. o = _t$result.formData,
  14509. a = _t$result.name;
  14510. return r = t.result.fileUrl, new Promise(function (t, r) {
  14511. var c = _this13.adapter.uploadFile({
  14512. url: i,
  14513. formData: o,
  14514. name: a,
  14515. filePath: e,
  14516. fileType: n,
  14517. success: function success(e) {
  14518. e && e.statusCode < 400 ? t(e) : r(new te({
  14519. code: "UPLOAD_FAILED",
  14520. message: "文件上传失败"
  14521. }));
  14522. },
  14523. fail: function fail(e) {
  14524. r(new te({
  14525. code: e.code || "UPLOAD_FAILED",
  14526. message: e.message || e.errMsg || "文件上传失败"
  14527. }));
  14528. }
  14529. });
  14530. "function" == typeof s && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  14531. s({
  14532. loaded: e.totalBytesSent,
  14533. total: e.totalBytesExpectedToSend
  14534. });
  14535. });
  14536. });
  14537. }).then(function () {
  14538. return _this13.reportUploadFile({
  14539. cloudPath: t
  14540. });
  14541. }).then(function (t) {
  14542. return new Promise(function (n, s) {
  14543. t.success ? n({
  14544. success: !0,
  14545. filePath: e,
  14546. fileID: r
  14547. }) : s(new te({
  14548. code: "UPLOAD_FAILED",
  14549. message: "文件上传失败"
  14550. }));
  14551. });
  14552. });
  14553. }
  14554. }, {
  14555. key: "deleteFile",
  14556. value: function deleteFile(_ref16) {
  14557. var e = _ref16.fileList;
  14558. var t = {
  14559. method: "serverless.file.resource.delete",
  14560. params: JSON.stringify({
  14561. fileList: e
  14562. })
  14563. };
  14564. return this.request(t).then(function (e) {
  14565. if (e.success) return e.result;
  14566. throw new te({
  14567. code: "DELETE_FILE_FAILED",
  14568. message: "删除文件失败"
  14569. });
  14570. });
  14571. }
  14572. }, {
  14573. key: "getTempFileURL",
  14574. value: function getTempFileURL() {
  14575. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14576. e = _ref17.fileList,
  14577. t = _ref17.maxAge;
  14578. if (!Array.isArray(e) || 0 === e.length) throw new te({
  14579. code: "INVALID_PARAM",
  14580. message: "fileList的元素必须是非空的字符串"
  14581. });
  14582. var n = {
  14583. method: "serverless.file.resource.getTempFileURL",
  14584. params: JSON.stringify({
  14585. fileList: e,
  14586. maxAge: t
  14587. })
  14588. };
  14589. return this.request(n).then(function (e) {
  14590. if (e.success) return {
  14591. fileList: e.result.fileList.map(function (e) {
  14592. return {
  14593. fileID: e.fileID,
  14594. tempFileURL: e.tempFileURL
  14595. };
  14596. })
  14597. };
  14598. throw new te({
  14599. code: "GET_TEMP_FILE_URL_FAILED",
  14600. message: "获取临时文件链接失败"
  14601. });
  14602. });
  14603. }
  14604. }]);
  14605. return Ct;
  14606. }();
  14607. var Pt = {
  14608. init: function init(e) {
  14609. var t = new Ct(e),
  14610. n = {
  14611. signInAnonymously: function signInAnonymously() {
  14612. return Promise.resolve();
  14613. },
  14614. getLoginState: function getLoginState() {
  14615. return Promise.resolve(!1);
  14616. }
  14617. };
  14618. return t.auth = function () {
  14619. return n;
  14620. }, t.customAuth = t.auth, t;
  14621. }
  14622. },
  14623. Tt = n(function (e, t) {
  14624. e.exports = r.enc.Hex;
  14625. });
  14626. function xt() {
  14627. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (e) {
  14628. var t = 16 * Math.random() | 0;
  14629. return ("x" === e ? t : 3 & t | 8).toString(16);
  14630. });
  14631. }
  14632. function Ot() {
  14633. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14634. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14635. var n = t.data,
  14636. s = t.functionName,
  14637. r = t.method,
  14638. i = t.headers,
  14639. _t$signHeaderKeys = t.signHeaderKeys,
  14640. o = _t$signHeaderKeys === void 0 ? [] : _t$signHeaderKeys,
  14641. a = t.config,
  14642. c = Date.now(),
  14643. u = xt(),
  14644. l = Object.assign({}, i, {
  14645. "x-from-app-id": a.spaceAppId,
  14646. "x-from-env-id": a.spaceId,
  14647. "x-to-env-id": a.spaceId,
  14648. "x-from-instance-id": c,
  14649. "x-from-function-name": s,
  14650. "x-client-timestamp": c,
  14651. "x-alipay-source": "client",
  14652. "x-request-id": u,
  14653. "x-alipay-callid": u,
  14654. "x-trace-id": u
  14655. }),
  14656. h = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o),
  14657. _ref18 = e.split("?") || [],
  14658. _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
  14659. _ref19$ = _ref19[0],
  14660. d = _ref19$ === void 0 ? "" : _ref19$,
  14661. _ref19$2 = _ref19[1],
  14662. p = _ref19$2 === void 0 ? "" : _ref19$2,
  14663. f = function (e) {
  14664. var t = e.signedHeaders.join(";"),
  14665. n = e.signedHeaders.map(function (t) {
  14666. return "".concat(t.toLowerCase(), ":").concat(e.headers[t], "\n");
  14667. }).join(""),
  14668. s = _e(e.body).toString(Tt),
  14669. r = "".concat(e.method.toUpperCase(), "\n").concat(e.path, "\n").concat(e.query, "\n").concat(n, "\n").concat(t, "\n").concat(s, "\n"),
  14670. i = _e(r).toString(Tt),
  14671. o = "HMAC-SHA256\n".concat(e.timestamp, "\n").concat(i, "\n"),
  14672. a = we(o, e.secretKey).toString(Tt);
  14673. return "HMAC-SHA256 Credential=".concat(e.secretId, ", SignedHeaders=").concat(t, ", Signature=").concat(a);
  14674. }({
  14675. path: d,
  14676. query: p,
  14677. method: r,
  14678. headers: l,
  14679. timestamp: c,
  14680. body: JSON.stringify(n),
  14681. secretId: a.accessKey,
  14682. secretKey: a.secretKey,
  14683. signedHeaders: h.sort()
  14684. });
  14685. return {
  14686. url: "".concat(a.endpoint).concat(e),
  14687. headers: Object.assign({}, l, {
  14688. Authorization: f
  14689. })
  14690. };
  14691. }
  14692. function Et(_ref20) {
  14693. var e = _ref20.url,
  14694. t = _ref20.data,
  14695. _ref20$method = _ref20.method,
  14696. n = _ref20$method === void 0 ? "POST" : _ref20$method,
  14697. _ref20$headers = _ref20.headers,
  14698. s = _ref20$headers === void 0 ? {} : _ref20$headers,
  14699. r = _ref20.timeout;
  14700. return new Promise(function (i, o) {
  14701. ne.request({
  14702. url: e,
  14703. method: n,
  14704. data: "object" == (0, _typeof2.default)(t) ? JSON.stringify(t) : t,
  14705. header: s,
  14706. dataType: "json",
  14707. timeout: r,
  14708. complete: function complete() {
  14709. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14710. var t = s["x-trace-id"] || "";
  14711. if (!e.statusCode || e.statusCode >= 400) {
  14712. var _ref21 = e.data || {},
  14713. _n7 = _ref21.message,
  14714. _s12 = _ref21.errMsg,
  14715. _r4 = _ref21.trace_id;
  14716. return o(new te({
  14717. code: "SYS_ERR",
  14718. message: _n7 || _s12 || "request:fail",
  14719. requestId: _r4 || t
  14720. }));
  14721. }
  14722. i({
  14723. status: e.statusCode,
  14724. data: e.data,
  14725. headers: e.header,
  14726. requestId: t
  14727. });
  14728. }
  14729. });
  14730. });
  14731. }
  14732. function Lt(e, t) {
  14733. var n = e.path,
  14734. s = e.data,
  14735. _e$method = e.method,
  14736. r = _e$method === void 0 ? "GET" : _e$method,
  14737. _Ot = Ot(n, {
  14738. functionName: "",
  14739. data: s,
  14740. method: r,
  14741. headers: {
  14742. "x-alipay-cloud-mode": "oss",
  14743. "x-data-api-type": "oss",
  14744. "x-expire-timestamp": Date.now() + 6e4
  14745. },
  14746. signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"],
  14747. config: t
  14748. }),
  14749. i = _Ot.url,
  14750. o = _Ot.headers;
  14751. return Et({
  14752. url: i,
  14753. data: s,
  14754. method: r,
  14755. headers: o
  14756. }).then(function (e) {
  14757. var t = e.data || {};
  14758. if (!t.success) throw new te({
  14759. code: e.errCode,
  14760. message: e.errMsg,
  14761. requestId: e.requestId
  14762. });
  14763. return t.data || {};
  14764. }).catch(function (e) {
  14765. throw new te({
  14766. code: e.errCode,
  14767. message: e.errMsg,
  14768. requestId: e.requestId
  14769. });
  14770. });
  14771. }
  14772. function Rt() {
  14773. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14774. var t = e.trim().replace(/^cloud:\/\//, ""),
  14775. n = t.indexOf("/");
  14776. if (n <= 0) throw new te({
  14777. code: "INVALID_PARAM",
  14778. message: "fileID不合法"
  14779. });
  14780. var s = t.substring(0, n),
  14781. r = t.substring(n + 1);
  14782. return s !== this.config.spaceId && console.warn("file ".concat(e, " does not belong to env ").concat(this.config.spaceId)), r;
  14783. }
  14784. function Ut() {
  14785. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14786. return "cloud://".concat(this.config.spaceId, "/").concat(e.replace(/^\/+/, ""));
  14787. }
  14788. var Nt = /*#__PURE__*/function () {
  14789. function Nt(e) {
  14790. (0, _classCallCheck2.default)(this, Nt);
  14791. this.config = e;
  14792. }
  14793. (0, _createClass2.default)(Nt, [{
  14794. key: "signedURL",
  14795. value: function signedURL(e) {
  14796. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14797. var n = "/ws/function/".concat(e),
  14798. s = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""),
  14799. r = Object.assign({}, t, {
  14800. accessKeyId: this.config.accessKey,
  14801. signatureNonce: xt(),
  14802. timestamp: "" + Date.now()
  14803. }),
  14804. i = [n, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function (e) {
  14805. return r[e] ? "".concat(e, "=").concat(r[e]) : null;
  14806. }).filter(Boolean).join("&"), "host:".concat(s)].join("\n"),
  14807. o = ["HMAC-SHA256", _e(i).toString(Tt)].join("\n"),
  14808. a = we(o, this.config.secretKey).toString(Tt),
  14809. c = Object.keys(r).map(function (e) {
  14810. return "".concat(e, "=").concat(encodeURIComponent(r[e]));
  14811. }).join("&");
  14812. return "".concat(this.config.wsEndpoint).concat(n, "?").concat(c, "&signature=").concat(a);
  14813. }
  14814. }]);
  14815. return Nt;
  14816. }();
  14817. var Dt = /*#__PURE__*/function () {
  14818. function Dt(e) {
  14819. (0, _classCallCheck2.default)(this, Dt);
  14820. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach(function (t) {
  14821. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  14822. }), e.endpoint) {
  14823. if ("string" != typeof e.endpoint) throw new Error("endpoint must be string");
  14824. if (!/^https:\/\//.test(e.endpoint)) throw new Error("endpoint must start with https://");
  14825. e.endpoint = e.endpoint.replace(/\/$/, "");
  14826. }
  14827. this.config = Object.assign({}, e, {
  14828. endpoint: e.endpoint || "https://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn"),
  14829. wsEndpoint: e.wsEndpoint || "wss://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn")
  14830. }), this._websocket = new Nt(this.config);
  14831. }
  14832. (0, _createClass2.default)(Dt, [{
  14833. key: "callFunction",
  14834. value: function callFunction(e) {
  14835. return function (e, t) {
  14836. var n = e.name,
  14837. s = e.data,
  14838. _e$async = e.async,
  14839. r = _e$async === void 0 ? !1 : _e$async,
  14840. i = e.timeout,
  14841. o = "POST",
  14842. a = {
  14843. "x-to-function-name": n
  14844. };
  14845. r && (a["x-function-invoke-type"] = "async");
  14846. var _Ot2 = Ot("/functions/invokeFunction", {
  14847. functionName: n,
  14848. data: s,
  14849. method: o,
  14850. headers: a,
  14851. signHeaderKeys: ["x-to-function-name"],
  14852. config: t
  14853. }),
  14854. c = _Ot2.url,
  14855. u = _Ot2.headers;
  14856. return Et({
  14857. url: c,
  14858. data: s,
  14859. method: o,
  14860. headers: u,
  14861. timeout: i
  14862. }).then(function (e) {
  14863. var t = 0;
  14864. if (r) {
  14865. var _n8 = e.data || {};
  14866. t = "200" === _n8.errCode ? 0 : _n8.errCode, e.data = _n8.data || {}, e.errMsg = _n8.errMsg;
  14867. }
  14868. if (0 !== t) throw new te({
  14869. code: t,
  14870. message: e.errMsg,
  14871. requestId: e.requestId
  14872. });
  14873. return {
  14874. errCode: t,
  14875. success: 0 === t,
  14876. requestId: e.requestId,
  14877. result: e.data
  14878. };
  14879. }).catch(function (e) {
  14880. throw new te({
  14881. code: e.errCode,
  14882. message: e.errMsg,
  14883. requestId: e.requestId
  14884. });
  14885. });
  14886. }(e, this.config);
  14887. }
  14888. }, {
  14889. key: "uploadFileToOSS",
  14890. value: function uploadFileToOSS(_ref22) {
  14891. var e = _ref22.url,
  14892. t = _ref22.filePath,
  14893. n = _ref22.fileType,
  14894. s = _ref22.formData,
  14895. r = _ref22.onUploadProgress;
  14896. return new Promise(function (i, o) {
  14897. var a = ne.uploadFile({
  14898. url: e,
  14899. filePath: t,
  14900. fileType: n,
  14901. formData: s,
  14902. name: "file",
  14903. success: function success(e) {
  14904. e && e.statusCode < 400 ? i(e) : o(new te({
  14905. code: "UPLOAD_FAILED",
  14906. message: "文件上传失败"
  14907. }));
  14908. },
  14909. fail: function fail(e) {
  14910. o(new te({
  14911. code: e.code || "UPLOAD_FAILED",
  14912. message: e.message || e.errMsg || "文件上传失败"
  14913. }));
  14914. }
  14915. });
  14916. "function" == typeof r && a && "function" == typeof a.onProgressUpdate && a.onProgressUpdate(function (e) {
  14917. r({
  14918. loaded: e.totalBytesSent,
  14919. total: e.totalBytesExpectedToSend
  14920. });
  14921. });
  14922. });
  14923. }
  14924. }, {
  14925. key: "uploadFile",
  14926. value: function () {
  14927. var _uploadFile2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(_ref23) {
  14928. var e, _ref23$cloudPath, t, _ref23$fileType, n, s, r, i, o, a, c;
  14929. return _regenerator.default.wrap(function _callee36$(_context36) {
  14930. while (1) {
  14931. switch (_context36.prev = _context36.next) {
  14932. case 0:
  14933. e = _ref23.filePath, _ref23$cloudPath = _ref23.cloudPath, t = _ref23$cloudPath === void 0 ? "" : _ref23$cloudPath, _ref23$fileType = _ref23.fileType, n = _ref23$fileType === void 0 ? "image" : _ref23$fileType, s = _ref23.onUploadProgress;
  14934. if (!("string" !== f(t))) {
  14935. _context36.next = 3;
  14936. break;
  14937. }
  14938. throw new te({
  14939. code: "INVALID_PARAM",
  14940. message: "cloudPath必须为字符串类型"
  14941. });
  14942. case 3:
  14943. if (t = t.trim()) {
  14944. _context36.next = 5;
  14945. break;
  14946. }
  14947. throw new te({
  14948. code: "INVALID_PARAM",
  14949. message: "cloudPath不可为空"
  14950. });
  14951. case 5:
  14952. if (!/:\/\//.test(t)) {
  14953. _context36.next = 7;
  14954. break;
  14955. }
  14956. throw new te({
  14957. code: "INVALID_PARAM",
  14958. message: "cloudPath不合法"
  14959. });
  14960. case 7:
  14961. _context36.next = 9;
  14962. return Lt({
  14963. path: "/".concat(t.replace(/^\//, ""), "?post_url")
  14964. }, this.config);
  14965. case 9:
  14966. r = _context36.sent;
  14967. i = r.file_id;
  14968. o = r.upload_url;
  14969. a = r.form_data;
  14970. c = a && a.reduce(function (e, t) {
  14971. return e[t.key] = t.value, e;
  14972. }, {});
  14973. return _context36.abrupt("return", this.uploadFileToOSS({
  14974. url: o,
  14975. filePath: e,
  14976. fileType: n,
  14977. formData: c,
  14978. onUploadProgress: s
  14979. }).then(function () {
  14980. return {
  14981. fileID: i
  14982. };
  14983. }));
  14984. case 15:
  14985. case "end":
  14986. return _context36.stop();
  14987. }
  14988. }
  14989. }, _callee36, this);
  14990. }));
  14991. function uploadFile(_x37) {
  14992. return _uploadFile2.apply(this, arguments);
  14993. }
  14994. return uploadFile;
  14995. }()
  14996. }, {
  14997. key: "getTempFileURL",
  14998. value: function () {
  14999. var _getTempFileURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(_ref24) {
  15000. var _this14 = this;
  15001. var e;
  15002. return _regenerator.default.wrap(function _callee37$(_context37) {
  15003. while (1) {
  15004. switch (_context37.prev = _context37.next) {
  15005. case 0:
  15006. e = _ref24.fileList;
  15007. return _context37.abrupt("return", new Promise(function (t, n) {
  15008. (!e || e.length < 0) && n(new te({
  15009. errCode: "INVALID_PARAM",
  15010. errMsg: "fileList不能为空数组"
  15011. })), e.length > 50 && n(new te({
  15012. errCode: "INVALID_PARAM",
  15013. errMsg: "fileList数组长度不能超过50"
  15014. }));
  15015. var s = [];
  15016. var _iterator5 = _createForOfIteratorHelper(e),
  15017. _step5;
  15018. try {
  15019. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  15020. var _t11 = _step5.value;
  15021. "string" !== f(_t11) && n(new te({
  15022. errCode: "INVALID_PARAM",
  15023. errMsg: "fileList的元素必须是非空的字符串"
  15024. }));
  15025. var _e17 = Rt.call(_this14, _t11);
  15026. s.push({
  15027. file_id: _e17,
  15028. expire: 600
  15029. });
  15030. }
  15031. } catch (err) {
  15032. _iterator5.e(err);
  15033. } finally {
  15034. _iterator5.f();
  15035. }
  15036. Lt({
  15037. path: "/?download_url",
  15038. data: {
  15039. file_list: s
  15040. },
  15041. method: "POST"
  15042. }, _this14.config).then(function (e) {
  15043. var _e$file_list = e.file_list,
  15044. n = _e$file_list === void 0 ? [] : _e$file_list;
  15045. t({
  15046. fileList: n.map(function (e) {
  15047. return {
  15048. fileID: Ut.call(_this14, e.file_id),
  15049. tempFileURL: e.download_url
  15050. };
  15051. })
  15052. });
  15053. }).catch(function (e) {
  15054. return n(e);
  15055. });
  15056. }));
  15057. case 2:
  15058. case "end":
  15059. return _context37.stop();
  15060. }
  15061. }
  15062. }, _callee37);
  15063. }));
  15064. function getTempFileURL(_x38) {
  15065. return _getTempFileURL.apply(this, arguments);
  15066. }
  15067. return getTempFileURL;
  15068. }()
  15069. }, {
  15070. key: "connectWebSocket",
  15071. value: function () {
  15072. var _connectWebSocket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(e) {
  15073. var t, n;
  15074. return _regenerator.default.wrap(function _callee38$(_context38) {
  15075. while (1) {
  15076. switch (_context38.prev = _context38.next) {
  15077. case 0:
  15078. t = e.name, n = e.query;
  15079. return _context38.abrupt("return", ne.connectSocket({
  15080. url: this._websocket.signedURL(t, n),
  15081. complete: function complete() {}
  15082. }));
  15083. case 2:
  15084. case "end":
  15085. return _context38.stop();
  15086. }
  15087. }
  15088. }, _callee38, this);
  15089. }));
  15090. function connectWebSocket(_x39) {
  15091. return _connectWebSocket.apply(this, arguments);
  15092. }
  15093. return connectWebSocket;
  15094. }()
  15095. }]);
  15096. return Dt;
  15097. }();
  15098. var qt = {
  15099. init: function init(e) {
  15100. e.provider = "alipay";
  15101. var t = new Dt(e);
  15102. return t.auth = function () {
  15103. return {
  15104. signInAnonymously: function signInAnonymously() {
  15105. return Promise.resolve();
  15106. },
  15107. getLoginState: function getLoginState() {
  15108. return Promise.resolve(!0);
  15109. }
  15110. };
  15111. }, t;
  15112. }
  15113. };
  15114. function Mt(_ref25) {
  15115. var e = _ref25.data;
  15116. var t;
  15117. t = le();
  15118. var n = JSON.parse(JSON.stringify(e || {}));
  15119. if (Object.assign(n, {
  15120. clientInfo: t
  15121. }), !n.uniIdToken) {
  15122. var _se3 = se(),
  15123. _e18 = _se3.token;
  15124. _e18 && (n.uniIdToken = _e18);
  15125. }
  15126. return n;
  15127. }
  15128. function Ft() {
  15129. return _Ft.apply(this, arguments);
  15130. }
  15131. function _Ft() {
  15132. _Ft = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
  15133. var _this27 = this;
  15134. var e,
  15135. _this$__dev__,
  15136. t,
  15137. n,
  15138. s,
  15139. r,
  15140. i,
  15141. o,
  15142. _args8 = arguments;
  15143. return _regenerator.default.wrap(function _callee61$(_context61) {
  15144. while (1) {
  15145. switch (_context61.prev = _context61.next) {
  15146. case 0:
  15147. e = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
  15148. _context61.next = 3;
  15149. return this.__dev__.initLocalNetwork();
  15150. case 3:
  15151. _this$__dev__ = this.__dev__, t = _this$__dev__.localAddress, n = _this$__dev__.localPort, s = {
  15152. aliyun: "aliyun",
  15153. tencent: "tcb",
  15154. alipay: "alipay",
  15155. dcloud: "dcloud"
  15156. }[this.config.provider], r = this.config.spaceId, i = "http://".concat(t, ":").concat(n, "/system/check-function"), o = "http://".concat(t, ":").concat(n, "/cloudfunctions/").concat(e.name);
  15157. return _context61.abrupt("return", new Promise(function (t, n) {
  15158. ne.request({
  15159. method: "POST",
  15160. url: i,
  15161. data: {
  15162. name: e.name,
  15163. platform: C,
  15164. provider: s,
  15165. spaceId: r
  15166. },
  15167. timeout: 3e3,
  15168. success: function success(e) {
  15169. t(e);
  15170. },
  15171. fail: function fail() {
  15172. t({
  15173. data: {
  15174. code: "NETWORK_ERROR",
  15175. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  15176. }
  15177. });
  15178. }
  15179. });
  15180. }).then(function () {
  15181. var _ref67 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15182. e = _ref67.data;
  15183. var _ref68 = e || {},
  15184. t = _ref68.code,
  15185. n = _ref68.message;
  15186. return {
  15187. code: 0 === t ? 0 : t || "SYS_ERR",
  15188. message: n || "SYS_ERR"
  15189. };
  15190. }).then(function (_ref69) {
  15191. var t = _ref69.code,
  15192. n = _ref69.message;
  15193. if (0 !== t) {
  15194. switch (t) {
  15195. case "MODULE_ENCRYPTED":
  15196. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e.name, "\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"));
  15197. break;
  15198. case "FUNCTION_ENCRYPTED":
  15199. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e.name, "\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"));
  15200. break;
  15201. case "ACTION_ENCRYPTED":
  15202. console.error(n || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  15203. break;
  15204. case "NETWORK_ERROR":
  15205. console.error(n || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  15206. break;
  15207. case "SWITCH_TO_CLOUD":
  15208. break;
  15209. default:
  15210. {
  15211. var _e31 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(n, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");
  15212. throw console.error(_e31), new Error(_e31);
  15213. }
  15214. }
  15215. return _this27._callCloudFunction(e);
  15216. }
  15217. return new Promise(function (t, n) {
  15218. var r = Mt.call(_this27, {
  15219. data: e.data
  15220. });
  15221. ne.request({
  15222. method: "POST",
  15223. url: o,
  15224. data: {
  15225. provider: s,
  15226. platform: C,
  15227. param: r
  15228. },
  15229. timeout: e.timeout,
  15230. success: function success() {
  15231. var _ref70 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15232. e = _ref70.statusCode,
  15233. s = _ref70.data;
  15234. return !e || e >= 400 ? n(new te({
  15235. code: s.code || "SYS_ERR",
  15236. message: s.message || "request:fail"
  15237. })) : t({
  15238. result: s
  15239. });
  15240. },
  15241. fail: function fail(e) {
  15242. n(new te({
  15243. code: e.code || e.errCode || "SYS_ERR",
  15244. message: e.message || e.errMsg || "request:fail"
  15245. }));
  15246. }
  15247. });
  15248. });
  15249. }));
  15250. case 5:
  15251. case "end":
  15252. return _context61.stop();
  15253. }
  15254. }
  15255. }, _callee61, this);
  15256. }));
  15257. return _Ft.apply(this, arguments);
  15258. }
  15259. var Kt = [{
  15260. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  15261. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  15262. mode: "append"
  15263. }];
  15264. var jt = /[\\^$.*+?()[\]{}|]/g,
  15265. $t = RegExp(jt.source);
  15266. function Bt(e, t, n) {
  15267. return e.replace(new RegExp((s = t) && $t.test(s) ? s.replace(jt, "\\$&") : s, "g"), n);
  15268. var s;
  15269. }
  15270. var Wt = "none",
  15271. Ht = "request",
  15272. Jt = "response",
  15273. zt = "both";
  15274. var Vt = /*#__PURE__*/function () {
  15275. function Vt() {
  15276. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15277. e = _ref26.secretType,
  15278. t = _ref26.uniCloudIns;
  15279. (0, _classCallCheck2.default)(this, Vt);
  15280. this.clientType = "", this.secretType = e || Wt, this.uniCloudIns = t;
  15281. var _this$uniCloudIns$con = this.uniCloudIns.config,
  15282. n = _this$uniCloudIns$con.provider,
  15283. s = _this$uniCloudIns$con.spaceId;
  15284. var r;
  15285. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  15286. }
  15287. (0, _createClass2.default)(Vt, [{
  15288. key: "getSystemInfo",
  15289. value: function getSystemInfo() {
  15290. return this._systemInfo || (this._systemInfo = ae()), this._systemInfo;
  15291. }
  15292. }, {
  15293. key: "appId",
  15294. get: function get() {
  15295. return this.getSystemInfo().appId;
  15296. }
  15297. }, {
  15298. key: "deviceId",
  15299. get: function get() {
  15300. return this.getSystemInfo().deviceId;
  15301. }
  15302. }, {
  15303. key: "encryptData",
  15304. value: function () {
  15305. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(e) {
  15306. return _regenerator.default.wrap(function _callee39$(_context39) {
  15307. while (1) {
  15308. switch (_context39.prev = _context39.next) {
  15309. case 0:
  15310. return _context39.abrupt("return", this.secretType === Wt ? e : this.platformEncryptData(e));
  15311. case 1:
  15312. case "end":
  15313. return _context39.stop();
  15314. }
  15315. }
  15316. }, _callee39, this);
  15317. }));
  15318. function encryptData(_x40) {
  15319. return _encryptData.apply(this, arguments);
  15320. }
  15321. return encryptData;
  15322. }()
  15323. }, {
  15324. key: "decryptResult",
  15325. value: function () {
  15326. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(e) {
  15327. var _ref27, t, n;
  15328. return _regenerator.default.wrap(function _callee40$(_context40) {
  15329. while (1) {
  15330. switch (_context40.prev = _context40.next) {
  15331. case 0:
  15332. if (!(this.secretType === Wt)) {
  15333. _context40.next = 2;
  15334. break;
  15335. }
  15336. return _context40.abrupt("return", e);
  15337. case 2:
  15338. _ref27 = e || {}, t = _ref27.errCode, n = _ref27.content;
  15339. return _context40.abrupt("return", t || !n ? e : this.secretType === Ht ? n : this.platformDecryptResult(e));
  15340. case 4:
  15341. case "end":
  15342. return _context40.stop();
  15343. }
  15344. }
  15345. }, _callee40, this);
  15346. }));
  15347. function decryptResult(_x41) {
  15348. return _decryptResult.apply(this, arguments);
  15349. }
  15350. return decryptResult;
  15351. }()
  15352. }, {
  15353. key: "wrapVerifyClientCallFunction",
  15354. value: function wrapVerifyClientCallFunction(e) {
  15355. var t = this;
  15356. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
  15357. var _ref29,
  15358. n,
  15359. _ref29$data,
  15360. s,
  15361. r,
  15362. _args41 = arguments;
  15363. return _regenerator.default.wrap(function _callee41$(_context41) {
  15364. while (1) {
  15365. switch (_context41.prev = _context41.next) {
  15366. case 0:
  15367. _ref29 = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {}, n = _ref29.name, _ref29$data = _ref29.data, s = _ref29$data === void 0 ? {} : _ref29$data;
  15368. _context41.next = 3;
  15369. return t.prepare();
  15370. case 3:
  15371. _context41.next = 5;
  15372. return t.platformGetSignOption();
  15373. case 5:
  15374. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context41.sent;
  15375. _context41.next = 8;
  15376. return e({
  15377. name: n,
  15378. data: s
  15379. });
  15380. case 8:
  15381. r = _context41.sent;
  15382. _context41.t0 = t.isClientKeyNotFound(r);
  15383. if (!_context41.t0) {
  15384. _context41.next = 19;
  15385. break;
  15386. }
  15387. _context41.next = 13;
  15388. return t.prepare({
  15389. forceUpdate: !0
  15390. });
  15391. case 13:
  15392. _context41.next = 15;
  15393. return t.platformGetSignOption();
  15394. case 15:
  15395. s._uniCloudOptions = _context41.sent;
  15396. _context41.next = 18;
  15397. return e({
  15398. name: n,
  15399. data: s
  15400. });
  15401. case 18:
  15402. r = _context41.sent;
  15403. case 19:
  15404. return _context41.abrupt("return", r);
  15405. case 20:
  15406. case "end":
  15407. return _context41.stop();
  15408. }
  15409. }
  15410. }, _callee41);
  15411. }));
  15412. }
  15413. }, {
  15414. key: "wrapEncryptDataCallFunction",
  15415. value: function wrapEncryptDataCallFunction(e) {
  15416. var t = this;
  15417. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  15418. var _ref31,
  15419. n,
  15420. _ref31$data,
  15421. s,
  15422. r,
  15423. i,
  15424. _r5,
  15425. _args42 = arguments;
  15426. return _regenerator.default.wrap(function _callee42$(_context42) {
  15427. while (1) {
  15428. switch (_context42.prev = _context42.next) {
  15429. case 0:
  15430. _ref31 = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {}, n = _ref31.name, _ref31$data = _ref31.data, s = _ref31$data === void 0 ? {} : _ref31$data;
  15431. _context42.next = 3;
  15432. return t.prepare();
  15433. case 3:
  15434. _context42.next = 5;
  15435. return t.encryptData(s);
  15436. case 5:
  15437. r = _context42.sent;
  15438. _context42.next = 8;
  15439. return e({
  15440. name: n,
  15441. data: r
  15442. });
  15443. case 8:
  15444. i = _context42.sent;
  15445. if (!t.isClientKeyNotFound(i)) {
  15446. _context42.next = 21;
  15447. break;
  15448. }
  15449. _context42.next = 12;
  15450. return t.prepare({
  15451. forceUpdate: !0
  15452. });
  15453. case 12:
  15454. _context42.next = 14;
  15455. return t.encryptData(s);
  15456. case 14:
  15457. _r5 = _context42.sent;
  15458. _context42.next = 17;
  15459. return t.platformGetSignOption();
  15460. case 17:
  15461. s._uniCloudOptions = _context42.sent;
  15462. _context42.next = 20;
  15463. return e({
  15464. name: n,
  15465. data: _r5
  15466. });
  15467. case 20:
  15468. i = _context42.sent;
  15469. case 21:
  15470. _context42.next = 23;
  15471. return t.decryptResult(i.result);
  15472. case 23:
  15473. i.result = _context42.sent;
  15474. return _context42.abrupt("return", i);
  15475. case 25:
  15476. case "end":
  15477. return _context42.stop();
  15478. }
  15479. }
  15480. }, _callee42);
  15481. }));
  15482. }
  15483. }]);
  15484. return Vt;
  15485. }();
  15486. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  15487. function Gt(e) {
  15488. return parseInt(e) === e;
  15489. }
  15490. function Yt(e) {
  15491. if (!Gt(e.length)) return !1;
  15492. for (var t = 0; t < e.length; t++) {
  15493. if (!Gt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  15494. }
  15495. return !0;
  15496. }
  15497. function Qt(e, t) {
  15498. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  15499. if (Array.isArray(e)) {
  15500. if (!Yt(e)) throw new Error("Array contains invalid value: " + e);
  15501. return new Uint8Array(e);
  15502. }
  15503. if (Gt(e.length) && Yt(e)) return new Uint8Array(e);
  15504. throw new Error("unsupported array-like object");
  15505. }
  15506. function Xt(e) {
  15507. return new Uint8Array(e);
  15508. }
  15509. function Zt(e, t, n, s, r) {
  15510. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  15511. }
  15512. var en,
  15513. tn = {
  15514. toBytes: function toBytes(e) {
  15515. var t = [],
  15516. n = 0;
  15517. for (e = encodeURI(e); n < e.length;) {
  15518. var s = e.charCodeAt(n++);
  15519. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  15520. }
  15521. return Qt(t);
  15522. },
  15523. fromBytes: function fromBytes(e) {
  15524. for (var t = [], n = 0; n < e.length;) {
  15525. var s = e[n];
  15526. 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);
  15527. }
  15528. return t.join("");
  15529. }
  15530. },
  15531. nn = (en = "0123456789abcdef", {
  15532. toBytes: function toBytes(e) {
  15533. for (var t = [], n = 0; n < e.length; n += 2) {
  15534. t.push(parseInt(e.substr(n, 2), 16));
  15535. }
  15536. return t;
  15537. },
  15538. fromBytes: function fromBytes(e) {
  15539. for (var t = [], n = 0; n < e.length; n++) {
  15540. var s = e[n];
  15541. t.push(en[(240 & s) >> 4] + en[15 & s]);
  15542. }
  15543. return t.join("");
  15544. }
  15545. }),
  15546. sn = {
  15547. 16: 10,
  15548. 24: 12,
  15549. 32: 14
  15550. },
  15551. rn = [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],
  15552. on = [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],
  15553. an = [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],
  15554. cn = [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],
  15555. un = [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],
  15556. ln = [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],
  15557. hn = [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],
  15558. dn = [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],
  15559. pn = [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],
  15560. fn = [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],
  15561. gn = [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],
  15562. mn = [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],
  15563. yn = [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],
  15564. _n = [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],
  15565. wn = [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];
  15566. function vn(e) {
  15567. for (var t = [], n = 0; n < e.length; n += 4) {
  15568. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  15569. }
  15570. return t;
  15571. }
  15572. var In = /*#__PURE__*/function () {
  15573. function In(e) {
  15574. (0, _classCallCheck2.default)(this, In);
  15575. if (!(this instanceof In)) throw Error("AES must be instanitated with `new`");
  15576. Object.defineProperty(this, "key", {
  15577. value: Qt(e, !0)
  15578. }), this._prepare();
  15579. }
  15580. (0, _createClass2.default)(In, [{
  15581. key: "_prepare",
  15582. value: function _prepare() {
  15583. var e = sn[this.key.length];
  15584. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  15585. this._Ke = [], this._Kd = [];
  15586. for (var t = 0; t <= e; t++) {
  15587. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  15588. }
  15589. var n,
  15590. s = 4 * (e + 1),
  15591. r = this.key.length / 4,
  15592. i = vn(this.key);
  15593. for (t = 0; t < r; t++) {
  15594. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  15595. }
  15596. for (var o, a = 0, c = r; c < s;) {
  15597. if (o = i[r - 1], i[0] ^= on[o >> 16 & 255] << 24 ^ on[o >> 8 & 255] << 16 ^ on[255 & o] << 8 ^ on[o >> 24 & 255] ^ rn[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  15598. i[t] ^= i[t - 1];
  15599. } else {
  15600. for (t = 1; t < r / 2; t++) {
  15601. i[t] ^= i[t - 1];
  15602. }
  15603. o = i[r / 2 - 1], i[r / 2] ^= on[255 & o] ^ on[o >> 8 & 255] << 8 ^ on[o >> 16 & 255] << 16 ^ on[o >> 24 & 255] << 24;
  15604. for (t = r / 2 + 1; t < r; t++) {
  15605. i[t] ^= i[t - 1];
  15606. }
  15607. }
  15608. for (t = 0; t < r && c < s;) {
  15609. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  15610. }
  15611. }
  15612. for (var u = 1; u < e; u++) {
  15613. for (var l = 0; l < 4; l++) {
  15614. o = this._Kd[u][l], this._Kd[u][l] = mn[o >> 24 & 255] ^ yn[o >> 16 & 255] ^ _n[o >> 8 & 255] ^ wn[255 & o];
  15615. }
  15616. }
  15617. }
  15618. }, {
  15619. key: "encrypt",
  15620. value: function encrypt(e) {
  15621. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  15622. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = vn(e), r = 0; r < 4; r++) {
  15623. s[r] ^= this._Ke[0][r];
  15624. }
  15625. for (var i = 1; i < t; i++) {
  15626. for (r = 0; r < 4; r++) {
  15627. n[r] = cn[s[r] >> 24 & 255] ^ un[s[(r + 1) % 4] >> 16 & 255] ^ ln[s[(r + 2) % 4] >> 8 & 255] ^ hn[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  15628. }
  15629. s = n.slice();
  15630. }
  15631. var o,
  15632. a = Xt(16);
  15633. for (r = 0; r < 4; r++) {
  15634. o = this._Ke[t][r], a[4 * r] = 255 & (on[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (on[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (on[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (on[255 & s[(r + 3) % 4]] ^ o);
  15635. }
  15636. return a;
  15637. }
  15638. }, {
  15639. key: "decrypt",
  15640. value: function decrypt(e) {
  15641. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  15642. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = vn(e), r = 0; r < 4; r++) {
  15643. s[r] ^= this._Kd[0][r];
  15644. }
  15645. for (var i = 1; i < t; i++) {
  15646. for (r = 0; r < 4; r++) {
  15647. n[r] = dn[s[r] >> 24 & 255] ^ pn[s[(r + 3) % 4] >> 16 & 255] ^ fn[s[(r + 2) % 4] >> 8 & 255] ^ gn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  15648. }
  15649. s = n.slice();
  15650. }
  15651. var o,
  15652. a = Xt(16);
  15653. for (r = 0; r < 4; r++) {
  15654. o = this._Kd[t][r], a[4 * r] = 255 & (an[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (an[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (an[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (an[255 & s[(r + 1) % 4]] ^ o);
  15655. }
  15656. return a;
  15657. }
  15658. }]);
  15659. return In;
  15660. }();
  15661. var Sn = /*#__PURE__*/function () {
  15662. function Sn(e) {
  15663. (0, _classCallCheck2.default)(this, Sn);
  15664. if (!(this instanceof Sn)) throw Error("AES must be instanitated with `new`");
  15665. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new In(e);
  15666. }
  15667. (0, _createClass2.default)(Sn, [{
  15668. key: "encrypt",
  15669. value: function encrypt(e) {
  15670. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15671. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  15672. Zt(e, n, 0, s, s + 16), Zt(n = this._aes.encrypt(n), t, s);
  15673. }
  15674. return t;
  15675. }
  15676. }, {
  15677. key: "decrypt",
  15678. value: function decrypt(e) {
  15679. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15680. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  15681. Zt(e, n, 0, s, s + 16), Zt(n = this._aes.decrypt(n), t, s);
  15682. }
  15683. return t;
  15684. }
  15685. }]);
  15686. return Sn;
  15687. }();
  15688. var bn = /*#__PURE__*/function () {
  15689. function bn(e, t) {
  15690. (0, _classCallCheck2.default)(this, bn);
  15691. if (!(this instanceof bn)) throw Error("AES must be instanitated with `new`");
  15692. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  15693. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15694. } else t = Xt(16);
  15695. this._lastCipherblock = Qt(t, !0), this._aes = new In(e);
  15696. }
  15697. (0, _createClass2.default)(bn, [{
  15698. key: "encrypt",
  15699. value: function encrypt(e) {
  15700. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15701. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  15702. Zt(e, n, 0, s, s + 16);
  15703. for (var r = 0; r < 16; r++) {
  15704. n[r] ^= this._lastCipherblock[r];
  15705. }
  15706. this._lastCipherblock = this._aes.encrypt(n), Zt(this._lastCipherblock, t, s);
  15707. }
  15708. return t;
  15709. }
  15710. }, {
  15711. key: "decrypt",
  15712. value: function decrypt(e) {
  15713. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15714. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  15715. Zt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  15716. for (var r = 0; r < 16; r++) {
  15717. t[s + r] = n[r] ^ this._lastCipherblock[r];
  15718. }
  15719. Zt(e, this._lastCipherblock, 0, s, s + 16);
  15720. }
  15721. return t;
  15722. }
  15723. }]);
  15724. return bn;
  15725. }();
  15726. var kn = /*#__PURE__*/function () {
  15727. function kn(e, t, n) {
  15728. (0, _classCallCheck2.default)(this, kn);
  15729. if (!(this instanceof kn)) throw Error("AES must be instanitated with `new`");
  15730. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  15731. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  15732. } else t = Xt(16);
  15733. n || (n = 1), this.segmentSize = n, this._shiftRegister = Qt(t, !0), this._aes = new In(e);
  15734. }
  15735. (0, _createClass2.default)(kn, [{
  15736. key: "encrypt",
  15737. value: function encrypt(e) {
  15738. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  15739. for (var t, n = Qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15740. t = this._aes.encrypt(this._shiftRegister);
  15741. for (var r = 0; r < this.segmentSize; r++) {
  15742. n[s + r] ^= t[r];
  15743. }
  15744. Zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Zt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15745. }
  15746. return n;
  15747. }
  15748. }, {
  15749. key: "decrypt",
  15750. value: function decrypt(e) {
  15751. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  15752. for (var t, n = Qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15753. t = this._aes.encrypt(this._shiftRegister);
  15754. for (var r = 0; r < this.segmentSize; r++) {
  15755. n[s + r] ^= t[r];
  15756. }
  15757. Zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Zt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15758. }
  15759. return n;
  15760. }
  15761. }]);
  15762. return kn;
  15763. }();
  15764. var An = /*#__PURE__*/function () {
  15765. function An(e, t) {
  15766. (0, _classCallCheck2.default)(this, An);
  15767. if (!(this instanceof An)) throw Error("AES must be instanitated with `new`");
  15768. if (this.description = "Output Feedback", this.name = "ofb", t) {
  15769. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15770. } else t = Xt(16);
  15771. this._lastPrecipher = Qt(t, !0), this._lastPrecipherIndex = 16, this._aes = new In(e);
  15772. }
  15773. (0, _createClass2.default)(An, [{
  15774. key: "encrypt",
  15775. value: function encrypt(e) {
  15776. for (var t = Qt(e, !0), n = 0; n < t.length; n++) {
  15777. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  15778. }
  15779. return t;
  15780. }
  15781. }, {
  15782. key: "decrypt",
  15783. value: function decrypt(e) {
  15784. return this.encrypt(e);
  15785. }
  15786. }]);
  15787. return An;
  15788. }();
  15789. var Cn = /*#__PURE__*/function () {
  15790. function Cn(e) {
  15791. (0, _classCallCheck2.default)(this, Cn);
  15792. if (!(this instanceof Cn)) throw Error("Counter must be instanitated with `new`");
  15793. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Xt(16), this.setValue(e)) : this.setBytes(e);
  15794. }
  15795. (0, _createClass2.default)(Cn, [{
  15796. key: "setValue",
  15797. value: function setValue(e) {
  15798. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  15799. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  15800. for (var t = 15; t >= 0; --t) {
  15801. this._counter[t] = e % 256, e = parseInt(e / 256);
  15802. }
  15803. }
  15804. }, {
  15805. key: "setBytes",
  15806. value: function setBytes(e) {
  15807. if (16 != (e = Qt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  15808. this._counter = e;
  15809. }
  15810. }, {
  15811. key: "increment",
  15812. value: function increment() {
  15813. for (var e = 15; e >= 0; e--) {
  15814. if (255 !== this._counter[e]) {
  15815. this._counter[e]++;
  15816. break;
  15817. }
  15818. this._counter[e] = 0;
  15819. }
  15820. }
  15821. }]);
  15822. return Cn;
  15823. }();
  15824. var Pn = /*#__PURE__*/function () {
  15825. function Pn(e, t) {
  15826. (0, _classCallCheck2.default)(this, Pn);
  15827. if (!(this instanceof Pn)) throw Error("AES must be instanitated with `new`");
  15828. 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 In(e);
  15829. }
  15830. (0, _createClass2.default)(Pn, [{
  15831. key: "encrypt",
  15832. value: function encrypt(e) {
  15833. for (var t = Qt(e, !0), n = 0; n < t.length; n++) {
  15834. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  15835. }
  15836. return t;
  15837. }
  15838. }, {
  15839. key: "decrypt",
  15840. value: function decrypt(e) {
  15841. return this.encrypt(e);
  15842. }
  15843. }]);
  15844. return Pn;
  15845. }();
  15846. var Tn = {
  15847. AES: In,
  15848. Counter: Cn,
  15849. ModeOfOperation: {
  15850. ecb: Sn,
  15851. cbc: bn,
  15852. cfb: kn,
  15853. ofb: An,
  15854. ctr: Pn
  15855. },
  15856. utils: {
  15857. hex: nn,
  15858. utf8: tn
  15859. },
  15860. padding: {
  15861. pkcs7: {
  15862. pad: function pad(e) {
  15863. var t = 16 - (e = Qt(e, !0)).length % 16,
  15864. n = Xt(e.length + t);
  15865. Zt(e, n);
  15866. for (var s = e.length; s < n.length; s++) {
  15867. n[s] = t;
  15868. }
  15869. return n;
  15870. },
  15871. strip: function strip(e) {
  15872. if ((e = Qt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  15873. var t = e[e.length - 1];
  15874. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  15875. for (var n = e.length - t, s = 0; s < t; s++) {
  15876. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  15877. }
  15878. var r = Xt(n);
  15879. return Zt(e, r, 0, 0, n), r;
  15880. }
  15881. }
  15882. },
  15883. _arrayTest: {
  15884. coerceArray: Qt,
  15885. createArray: Xt,
  15886. copyArray: Zt
  15887. }
  15888. };
  15889. function xn(e, t, n) {
  15890. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15891. r = Tn.utils.utf8.toBytes(n),
  15892. i = Tn.utils.utf8.toBytes(e),
  15893. o = new Tn.ModeOfOperation.cbc(s, r),
  15894. a = Tn.padding.pkcs7.pad(i),
  15895. c = o.encrypt(a);
  15896. return uni.arrayBufferToBase64(c);
  15897. }
  15898. var On = {
  15899. code: 2e4,
  15900. message: "System error"
  15901. },
  15902. En = {
  15903. code: 20101,
  15904. message: "Invalid client"
  15905. },
  15906. Ln = {
  15907. code: 20102,
  15908. message: "Get encrypt key failed"
  15909. },
  15910. Rn = {
  15911. 10001: "Secure network is not supported on current playground or unimpsdk",
  15912. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  15913. 10009: "Encrypt payload failed",
  15914. 10010: "Decrypt response failed"
  15915. };
  15916. function Un(e) {
  15917. var _ref32 = e || {},
  15918. t = _ref32.errSubject,
  15919. n = _ref32.subject,
  15920. s = _ref32.errCode,
  15921. r = _ref32.errMsg,
  15922. i = _ref32.code,
  15923. o = _ref32.message,
  15924. a = _ref32.cause;
  15925. return new te({
  15926. subject: t || n || "uni-secure-network",
  15927. code: s || i || On.code,
  15928. message: r || o,
  15929. cause: a
  15930. });
  15931. }
  15932. var Nn,
  15933. Dn,
  15934. qn = null;
  15935. var Mn = /*#__PURE__*/function (_Vt) {
  15936. (0, _inherits2.default)(Mn, _Vt);
  15937. var _super8 = _createSuper(Mn);
  15938. function Mn(e) {
  15939. var _this15;
  15940. (0, _classCallCheck2.default)(this, Mn);
  15941. _this15 = _super8.call(this, e), _this15.clientType = "mp-weixin", _this15.userEncryptKey = null;
  15942. return _this15;
  15943. }
  15944. (0, _createClass2.default)(Mn, [{
  15945. key: "isLogin",
  15946. value: function isLogin() {
  15947. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  15948. }
  15949. }, {
  15950. key: "prepare",
  15951. value: function () {
  15952. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  15953. return _regenerator.default.wrap(function _callee43$(_context43) {
  15954. while (1) {
  15955. switch (_context43.prev = _context43.next) {
  15956. case 0:
  15957. if (this.isLogin()) {
  15958. _context43.next = 7;
  15959. break;
  15960. }
  15961. if (this.scopedGlobalCache.initPromise) {
  15962. _context43.next = 3;
  15963. break;
  15964. }
  15965. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  15966. case 3:
  15967. _context43.next = 5;
  15968. return this.scopedGlobalCache.initPromise;
  15969. case 5:
  15970. if (this.isLogin()) {
  15971. _context43.next = 7;
  15972. break;
  15973. }
  15974. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  15975. case 7:
  15976. case "end":
  15977. return _context43.stop();
  15978. }
  15979. }
  15980. }, _callee43, this);
  15981. }));
  15982. function prepare() {
  15983. return _prepare2.apply(this, arguments);
  15984. }
  15985. return prepare;
  15986. }()
  15987. }, {
  15988. key: "getUserEncryptKey",
  15989. value: function () {
  15990. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  15991. var _this16 = this;
  15992. var e;
  15993. return _regenerator.default.wrap(function _callee44$(_context44) {
  15994. while (1) {
  15995. switch (_context44.prev = _context44.next) {
  15996. case 0:
  15997. if (!this.userEncryptKey) {
  15998. _context44.next = 2;
  15999. break;
  16000. }
  16001. return _context44.abrupt("return", this.userEncryptKey);
  16002. case 2:
  16003. if (!(qn && qn.expireTime)) {
  16004. _context44.next = 6;
  16005. break;
  16006. }
  16007. e = Date.now();
  16008. if (!(qn.expireTime - e > 0)) {
  16009. _context44.next = 6;
  16010. break;
  16011. }
  16012. return _context44.abrupt("return", (this.userEncryptKey = qn, this.userEncryptKey));
  16013. case 6:
  16014. return _context44.abrupt("return", new Promise(function (e, t) {
  16015. uni.getUserCryptoManager().getLatestUserKey({
  16016. success: function success(t) {
  16017. qn = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  16018. },
  16019. fail: function fail(e) {
  16020. t(Un(_objectSpread(_objectSpread({}, Ln), {}, {
  16021. cause: e
  16022. })));
  16023. }
  16024. });
  16025. }));
  16026. case 7:
  16027. case "end":
  16028. return _context44.stop();
  16029. }
  16030. }
  16031. }, _callee44, this);
  16032. }));
  16033. function getUserEncryptKey() {
  16034. return _getUserEncryptKey.apply(this, arguments);
  16035. }
  16036. return getUserEncryptKey;
  16037. }()
  16038. }, {
  16039. key: "getWxAppId",
  16040. value: function getWxAppId() {
  16041. return wx.getAccountInfoSync().miniProgram.appId;
  16042. }
  16043. }, {
  16044. key: "platformGetSignOption",
  16045. value: function () {
  16046. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  16047. var _yield$this$getUserEn, e, t, n;
  16048. return _regenerator.default.wrap(function _callee45$(_context45) {
  16049. while (1) {
  16050. switch (_context45.prev = _context45.next) {
  16051. case 0:
  16052. _context45.next = 2;
  16053. return this.getUserEncryptKey();
  16054. case 2:
  16055. _yield$this$getUserEn = _context45.sent;
  16056. e = _yield$this$getUserEn.encryptKey;
  16057. t = _yield$this$getUserEn.iv;
  16058. n = _yield$this$getUserEn.version;
  16059. return _context45.abrupt("return", {
  16060. verifyClientSign: xn(JSON.stringify({
  16061. data: JSON.stringify({}),
  16062. appId: this.appId,
  16063. deviceId: this.deviceId,
  16064. wxAppId: this.getWxAppId(),
  16065. simulator: "devtools" === ae().platform,
  16066. timestamp: Date.now()
  16067. }), e, t),
  16068. encryptKeyId: n,
  16069. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16070. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16071. });
  16072. case 7:
  16073. case "end":
  16074. return _context45.stop();
  16075. }
  16076. }
  16077. }, _callee45, this);
  16078. }));
  16079. function platformGetSignOption() {
  16080. return _platformGetSignOption.apply(this, arguments);
  16081. }
  16082. return platformGetSignOption;
  16083. }()
  16084. }, {
  16085. key: "platformEncryptData",
  16086. value: function () {
  16087. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(e) {
  16088. var _yield$this$getUserEn2, t, n, s, r;
  16089. return _regenerator.default.wrap(function _callee46$(_context46) {
  16090. while (1) {
  16091. switch (_context46.prev = _context46.next) {
  16092. case 0:
  16093. _context46.next = 2;
  16094. return this.getUserEncryptKey();
  16095. case 2:
  16096. _yield$this$getUserEn2 = _context46.sent;
  16097. t = _yield$this$getUserEn2.encryptKey;
  16098. n = _yield$this$getUserEn2.iv;
  16099. s = _yield$this$getUserEn2.version;
  16100. r = {
  16101. secretType: this.secretType,
  16102. encryptKeyId: s,
  16103. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16104. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16105. };
  16106. return _context46.abrupt("return", this.secretType === Jt ? {
  16107. content: e,
  16108. _uniCloudOptions: r
  16109. } : {
  16110. content: xn(JSON.stringify({
  16111. data: JSON.stringify(e),
  16112. appId: this.appId,
  16113. deviceId: this.deviceId,
  16114. wxAppId: this.getWxAppId(),
  16115. simulator: "devtools" === ae().platform,
  16116. timestamp: Date.now()
  16117. }), t, n),
  16118. _uniCloudOptions: r
  16119. });
  16120. case 8:
  16121. case "end":
  16122. return _context46.stop();
  16123. }
  16124. }
  16125. }, _callee46, this);
  16126. }));
  16127. function platformEncryptData(_x42) {
  16128. return _platformEncryptData.apply(this, arguments);
  16129. }
  16130. return platformEncryptData;
  16131. }()
  16132. }, {
  16133. key: "platformDecryptResult",
  16134. value: function () {
  16135. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(e) {
  16136. var t, _yield$this$getUserEn3, n, s;
  16137. return _regenerator.default.wrap(function _callee47$(_context47) {
  16138. while (1) {
  16139. switch (_context47.prev = _context47.next) {
  16140. case 0:
  16141. t = e.content;
  16142. _context47.next = 3;
  16143. return this.getUserEncryptKey();
  16144. case 3:
  16145. _yield$this$getUserEn3 = _context47.sent;
  16146. n = _yield$this$getUserEn3.encryptKey;
  16147. s = _yield$this$getUserEn3.iv;
  16148. return _context47.abrupt("return", JSON.parse(function (e, t, n) {
  16149. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  16150. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16151. i = Tn.utils.utf8.toBytes(n),
  16152. o = new Tn.ModeOfOperation.cbc(r, i),
  16153. a = Tn.padding.pkcs7.strip(o.decrypt(s));
  16154. return Tn.utils.utf8.fromBytes(a);
  16155. }(t, n, s)));
  16156. case 7:
  16157. case "end":
  16158. return _context47.stop();
  16159. }
  16160. }
  16161. }, _callee47, this);
  16162. }));
  16163. function platformDecryptResult(_x43) {
  16164. return _platformDecryptResult.apply(this, arguments);
  16165. }
  16166. return platformDecryptResult;
  16167. }()
  16168. }, {
  16169. key: "isClientKeyNotFound",
  16170. value: function isClientKeyNotFound() {
  16171. return !1;
  16172. }
  16173. }]);
  16174. return Mn;
  16175. }(Vt);
  16176. function Fn(e) {
  16177. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  16178. n = {};
  16179. var _loop = function _loop(_s13) {
  16180. var r = t[_s13];
  16181. n[r] = function () {
  16182. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  16183. t[_key] = arguments[_key];
  16184. }
  16185. return new Promise(function (n, s) {
  16186. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  16187. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16188. e = _ref33.type,
  16189. t = _ref33.data,
  16190. r = _ref33.errCode,
  16191. i = _ref33.errMsg,
  16192. o = _ref33.errSubject,
  16193. a = _ref33.message;
  16194. "success" === e ? n(t) : s(Un({
  16195. errCode: r,
  16196. errMsg: Rn[r] || i || a,
  16197. errSubject: o
  16198. }));
  16199. }])) : s(Un({
  16200. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  16201. }));
  16202. });
  16203. };
  16204. };
  16205. for (var _s13 = 0; _s13 < t.length; _s13++) {
  16206. _loop(_s13);
  16207. }
  16208. return n;
  16209. }
  16210. var Kn = /*#__PURE__*/function (_Vt2) {
  16211. (0, _inherits2.default)(Kn, _Vt2);
  16212. var _super9 = _createSuper(Kn);
  16213. function Kn(e) {
  16214. var _this17;
  16215. (0, _classCallCheck2.default)(this, Kn);
  16216. _this17 = _super9.call(this, e), _this17.clientType = "app", _this17.appUtils = _objectSpread({}, Fn(uni.requireNativePlugin("plus"))), _this17.systemInfo = Nn || (Nn = ae());
  16217. return _this17;
  16218. }
  16219. (0, _createClass2.default)(Kn, [{
  16220. key: "hasClientKey",
  16221. value: function () {
  16222. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
  16223. return _regenerator.default.wrap(function _callee48$(_context48) {
  16224. while (1) {
  16225. switch (_context48.prev = _context48.next) {
  16226. case 0:
  16227. _context48.next = 2;
  16228. return this.appUtils.hasClientKey({
  16229. provider: this.provider,
  16230. spaceId: this.spaceId
  16231. });
  16232. case 2:
  16233. this._hasClientKey = _context48.sent;
  16234. return _context48.abrupt("return", this._hasClientKey);
  16235. case 4:
  16236. case "end":
  16237. return _context48.stop();
  16238. }
  16239. }
  16240. }, _callee48, this);
  16241. }));
  16242. function hasClientKey() {
  16243. return _hasClientKey.apply(this, arguments);
  16244. }
  16245. return hasClientKey;
  16246. }()
  16247. }, {
  16248. key: "getAppClientKey",
  16249. value: function () {
  16250. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  16251. var _yield$this$appUtils$, e, t, n, s, r;
  16252. return _regenerator.default.wrap(function _callee49$(_context49) {
  16253. while (1) {
  16254. switch (_context49.prev = _context49.next) {
  16255. case 0:
  16256. _context49.next = 2;
  16257. return this.appUtils.encryptGetClientKeyPayload({
  16258. data: JSON.stringify({})
  16259. });
  16260. case 2:
  16261. _yield$this$appUtils$ = _context49.sent;
  16262. e = _yield$this$appUtils$.data;
  16263. t = _yield$this$appUtils$.key;
  16264. _context49.next = 7;
  16265. return this.uniCloudIns.callFunction({
  16266. name: "DCloud-clientDB",
  16267. data: {
  16268. redirectTo: "encryption",
  16269. action: "getAppClientKey",
  16270. data: e,
  16271. key: t
  16272. }
  16273. });
  16274. case 7:
  16275. _context49.t0 = _context49.sent.result;
  16276. if (_context49.t0) {
  16277. _context49.next = 10;
  16278. break;
  16279. }
  16280. _context49.t0 = {};
  16281. case 10:
  16282. n = _context49.t0;
  16283. if (!(0 !== n.errCode)) {
  16284. _context49.next = 13;
  16285. break;
  16286. }
  16287. throw function (e) {
  16288. return new te({
  16289. subject: e.errSubject || "uni-secure-network",
  16290. code: e.errCode || e.code || On.code,
  16291. message: e.errMsg || e.message
  16292. });
  16293. }(n);
  16294. case 13:
  16295. s = n.clientKey, r = n.key;
  16296. _context49.next = 16;
  16297. return this.appUtils.setClientKey({
  16298. provider: this.provider,
  16299. spaceId: this.spaceId,
  16300. clientKey: s,
  16301. key: r
  16302. });
  16303. case 16:
  16304. case "end":
  16305. return _context49.stop();
  16306. }
  16307. }
  16308. }, _callee49, this);
  16309. }));
  16310. function getAppClientKey() {
  16311. return _getAppClientKey.apply(this, arguments);
  16312. }
  16313. return getAppClientKey;
  16314. }()
  16315. }, {
  16316. key: "ensureClientKey",
  16317. value: function () {
  16318. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16319. var _this18 = this;
  16320. var _ref34,
  16321. _ref34$forceUpdate,
  16322. e,
  16323. _args50 = arguments;
  16324. return _regenerator.default.wrap(function _callee50$(_context50) {
  16325. while (1) {
  16326. switch (_context50.prev = _context50.next) {
  16327. case 0:
  16328. _ref34 = _args50.length > 0 && _args50[0] !== undefined ? _args50[0] : {}, _ref34$forceUpdate = _ref34.forceUpdate, e = _ref34$forceUpdate === void 0 ? !1 : _ref34$forceUpdate;
  16329. _context50.t1 = !0;
  16330. _context50.next = 4;
  16331. return this.hasClientKey();
  16332. case 4:
  16333. _context50.t2 = _context50.sent;
  16334. _context50.t0 = _context50.t1 !== _context50.t2;
  16335. if (_context50.t0) {
  16336. _context50.next = 8;
  16337. break;
  16338. }
  16339. _context50.t0 = e;
  16340. case 8:
  16341. if (!_context50.t0) {
  16342. _context50.next = 10;
  16343. break;
  16344. }
  16345. return _context50.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === h || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== p || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  16346. _this18.scopedGlobalCache.initStatus = d;
  16347. }).catch(function (e) {
  16348. throw _this18.scopedGlobalCache.initStatus = p, e;
  16349. }), this.scopedGlobalCache.initStatus = h), this.scopedGlobalCache.initPromise));
  16350. case 10:
  16351. case "end":
  16352. return _context50.stop();
  16353. }
  16354. }
  16355. }, _callee50, this);
  16356. }));
  16357. function ensureClientKey() {
  16358. return _ensureClientKey.apply(this, arguments);
  16359. }
  16360. return ensureClientKey;
  16361. }()
  16362. }, {
  16363. key: "prepare",
  16364. value: function () {
  16365. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  16366. var _ref35,
  16367. _ref35$forceUpdate,
  16368. e,
  16369. _args51 = arguments;
  16370. return _regenerator.default.wrap(function _callee51$(_context51) {
  16371. while (1) {
  16372. switch (_context51.prev = _context51.next) {
  16373. case 0:
  16374. _ref35 = _args51.length > 0 && _args51[0] !== undefined ? _args51[0] : {}, _ref35$forceUpdate = _ref35.forceUpdate, e = _ref35$forceUpdate === void 0 ? !1 : _ref35$forceUpdate;
  16375. _context51.next = 3;
  16376. return this.ensureClientKey({
  16377. forceUpdate: e
  16378. });
  16379. case 3:
  16380. case "end":
  16381. return _context51.stop();
  16382. }
  16383. }
  16384. }, _callee51, this);
  16385. }));
  16386. function prepare() {
  16387. return _prepare3.apply(this, arguments);
  16388. }
  16389. return prepare;
  16390. }()
  16391. }, {
  16392. key: "platformGetSignOption",
  16393. value: function () {
  16394. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  16395. var _yield$this$appUtils$2, e, t;
  16396. return _regenerator.default.wrap(function _callee52$(_context52) {
  16397. while (1) {
  16398. switch (_context52.prev = _context52.next) {
  16399. case 0:
  16400. _context52.next = 2;
  16401. return this.appUtils.encrypt({
  16402. provider: this.provider,
  16403. spaceId: this.spaceId,
  16404. data: JSON.stringify({})
  16405. });
  16406. case 2:
  16407. _yield$this$appUtils$2 = _context52.sent;
  16408. e = _yield$this$appUtils$2.data;
  16409. t = _yield$this$appUtils$2.key;
  16410. return _context52.abrupt("return", {
  16411. verifyClientSign: e,
  16412. encryptKeyId: t
  16413. });
  16414. case 6:
  16415. case "end":
  16416. return _context52.stop();
  16417. }
  16418. }
  16419. }, _callee52, this);
  16420. }));
  16421. function platformGetSignOption() {
  16422. return _platformGetSignOption2.apply(this, arguments);
  16423. }
  16424. return platformGetSignOption;
  16425. }()
  16426. }, {
  16427. key: "platformEncryptData",
  16428. value: function () {
  16429. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(e) {
  16430. var _yield$this$appUtils$3, t, n, s;
  16431. return _regenerator.default.wrap(function _callee53$(_context53) {
  16432. while (1) {
  16433. switch (_context53.prev = _context53.next) {
  16434. case 0:
  16435. _context53.next = 2;
  16436. return this.appUtils.encrypt({
  16437. provider: this.provider,
  16438. spaceId: this.spaceId,
  16439. data: JSON.stringify(e)
  16440. });
  16441. case 2:
  16442. _yield$this$appUtils$3 = _context53.sent;
  16443. t = _yield$this$appUtils$3.data;
  16444. n = _yield$this$appUtils$3.key;
  16445. s = {
  16446. secretType: this.secretType,
  16447. encryptKeyId: n
  16448. };
  16449. return _context53.abrupt("return", this.secretType === Jt ? {
  16450. content: e,
  16451. _uniCloudOptions: s
  16452. } : {
  16453. content: t,
  16454. _uniCloudOptions: s
  16455. });
  16456. case 7:
  16457. case "end":
  16458. return _context53.stop();
  16459. }
  16460. }
  16461. }, _callee53, this);
  16462. }));
  16463. function platformEncryptData(_x44) {
  16464. return _platformEncryptData2.apply(this, arguments);
  16465. }
  16466. return platformEncryptData;
  16467. }()
  16468. }, {
  16469. key: "platformDecryptResult",
  16470. value: function () {
  16471. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(e) {
  16472. var t, _e$_uniCloudOptions, n, s, r;
  16473. return _regenerator.default.wrap(function _callee54$(_context54) {
  16474. while (1) {
  16475. switch (_context54.prev = _context54.next) {
  16476. case 0:
  16477. t = e.content;
  16478. _e$_uniCloudOptions = e._uniCloudOptions;
  16479. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  16480. s = n.encryptKeyId;
  16481. _context54.next = 6;
  16482. return this.appUtils.decrypt({
  16483. provider: this.provider,
  16484. spaceId: this.spaceId,
  16485. data: t,
  16486. key: s
  16487. });
  16488. case 6:
  16489. r = _context54.sent;
  16490. return _context54.abrupt("return", JSON.parse(r.data));
  16491. case 8:
  16492. case "end":
  16493. return _context54.stop();
  16494. }
  16495. }
  16496. }, _callee54, this);
  16497. }));
  16498. function platformDecryptResult(_x45) {
  16499. return _platformDecryptResult2.apply(this, arguments);
  16500. }
  16501. return platformDecryptResult;
  16502. }()
  16503. }, {
  16504. key: "isClientKeyNotFound",
  16505. value: function isClientKeyNotFound() {
  16506. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16507. var t = e.result || {};
  16508. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  16509. }
  16510. }]);
  16511. return Kn;
  16512. }(Vt);
  16513. function jn() {
  16514. var _ref36 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16515. e = _ref36.secretType;
  16516. return e === Ht || e === Jt || e === zt;
  16517. }
  16518. function $n() {
  16519. var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16520. e = _ref37.name,
  16521. _ref37$data = _ref37.data,
  16522. t = _ref37$data === void 0 ? {} : _ref37$data;
  16523. return "app" === C && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  16524. }
  16525. function Bn() {
  16526. var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16527. e = _ref38.provider,
  16528. t = _ref38.spaceId,
  16529. n = _ref38.functionName;
  16530. var _ae = ae(),
  16531. s = _ae.appId,
  16532. r = _ae.uniPlatform,
  16533. i = _ae.osName;
  16534. var o = r;
  16535. "app" === r && (o = i);
  16536. var a = function () {
  16537. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16538. e = _ref39.provider,
  16539. t = _ref39.spaceId;
  16540. var n = A;
  16541. if (!n) return {};
  16542. e = function (e) {
  16543. return "tencent" === e ? "tcb" : e;
  16544. }(e);
  16545. var s = n.find(function (n) {
  16546. return n.provider === e && n.spaceId === t;
  16547. });
  16548. return s && s.config;
  16549. }({
  16550. provider: e,
  16551. spaceId: t
  16552. });
  16553. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  16554. var c = a.accessControl.function || {},
  16555. u = Object.keys(c);
  16556. if (0 === u.length) return !0;
  16557. var l = function (e, t) {
  16558. var n, s, r;
  16559. for (var _i2 = 0; _i2 < e.length; _i2++) {
  16560. var _o2 = e[_i2];
  16561. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  16562. return e.trim();
  16563. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  16564. }
  16565. return n || s || r;
  16566. }(u, n);
  16567. if (!l) return !1;
  16568. if ((c[l] || []).find(function () {
  16569. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16570. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  16571. })) return !0;
  16572. 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")), Un(En);
  16573. }
  16574. function Wn(_ref40) {
  16575. var e = _ref40.functionName,
  16576. t = _ref40.result,
  16577. n = _ref40.logPvd;
  16578. if (S && this.__dev__.debugLog && t && t.requestId) {
  16579. var _s14 = JSON.stringify({
  16580. spaceId: this.config.spaceId,
  16581. functionName: e,
  16582. requestId: t.requestId
  16583. });
  16584. console.log("[".concat(n, "-request]").concat(_s14, "[/").concat(n, "-request]"));
  16585. }
  16586. }
  16587. function Hn(e) {
  16588. var t = e.callFunction,
  16589. n = function n(_n9) {
  16590. var _this19 = this;
  16591. var s = _n9.name;
  16592. _n9.data = Mt.call(e, {
  16593. data: _n9.data
  16594. });
  16595. var r = {
  16596. aliyun: "aliyun",
  16597. tencent: "tcb",
  16598. tcb: "tcb",
  16599. alipay: "alipay",
  16600. dcloud: "dcloud"
  16601. }[this.config.provider],
  16602. i = jn(_n9),
  16603. o = $n(_n9),
  16604. a = i || o;
  16605. return t.call(this, _n9).then(function (e) {
  16606. return e.errCode = 0, !a && Wn.call(_this19, {
  16607. functionName: s,
  16608. result: e,
  16609. logPvd: r
  16610. }), Promise.resolve(e);
  16611. }, function (e) {
  16612. return !a && Wn.call(_this19, {
  16613. functionName: s,
  16614. result: e,
  16615. logPvd: r
  16616. }), e && e.message && (e.message = function () {
  16617. var _ref41 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16618. _ref41$message = _ref41.message,
  16619. e = _ref41$message === void 0 ? "" : _ref41$message,
  16620. _ref41$extraInfo = _ref41.extraInfo,
  16621. t = _ref41$extraInfo === void 0 ? {} : _ref41$extraInfo,
  16622. _ref41$formatter = _ref41.formatter,
  16623. n = _ref41$formatter === void 0 ? [] : _ref41$formatter;
  16624. for (var _s15 = 0; _s15 < n.length; _s15++) {
  16625. var _n$_s = n[_s15],
  16626. _r6 = _n$_s.rule,
  16627. _i3 = _n$_s.content,
  16628. _o3 = _n$_s.mode,
  16629. _a = e.match(_r6);
  16630. if (!_a) continue;
  16631. var _c = _i3;
  16632. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  16633. _c = Bt(_c, "{$".concat(_e19, "}"), _a[_e19]);
  16634. }
  16635. for (var _e20 in t) {
  16636. _c = Bt(_c, "{".concat(_e20, "}"), t[_e20]);
  16637. }
  16638. return "replace" === _o3 ? _c : e + _c;
  16639. }
  16640. return e;
  16641. }({
  16642. message: "[".concat(_n9.name, "]: ").concat(e.message),
  16643. formatter: Kt,
  16644. extraInfo: {
  16645. functionName: s
  16646. }
  16647. })), Promise.reject(e);
  16648. });
  16649. };
  16650. e.callFunction = function (t) {
  16651. var _e$config = e.config,
  16652. s = _e$config.provider,
  16653. r = _e$config.spaceId,
  16654. i = t.name;
  16655. var o, a;
  16656. if (t.data = t.data || {}, S && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && T ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ft), o = Ft) : o = n, o = o.bind(e), $n(t)) a = n.call(e, t);else if (function (_ref42) {
  16657. var e = _ref42.name,
  16658. _ref42$data = _ref42.data,
  16659. t = _ref42$data === void 0 ? {} : _ref42$data;
  16660. return "mp-weixin" === C && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  16661. }(t)) a = o.call(e, t);else if (jn(t)) {
  16662. a = new Dn({
  16663. secretType: t.secretType,
  16664. uniCloudIns: e
  16665. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  16666. } else if (Bn({
  16667. provider: s,
  16668. spaceId: r,
  16669. functionName: i
  16670. })) {
  16671. a = new Dn({
  16672. secretType: t.secretType,
  16673. uniCloudIns: e
  16674. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  16675. } else a = o(t);
  16676. return Object.defineProperty(a, "result", {
  16677. get: function get() {
  16678. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  16679. }
  16680. }), a.then(function (e) {
  16681. return "undefined" != typeof UTSJSONObject && (e.result = new UTSJSONObject(e.result)), e;
  16682. });
  16683. };
  16684. }
  16685. Dn = "mp-weixin" !== C && "app" !== C ? /*#__PURE__*/function () {
  16686. function _class2() {
  16687. (0, _classCallCheck2.default)(this, _class2);
  16688. throw Un({
  16689. message: "Platform ".concat(C, " is not supported by secure network")
  16690. });
  16691. }
  16692. return (0, _createClass2.default)(_class2);
  16693. }() : k ? "mp-weixin" === C ? Mn : Kn : /*#__PURE__*/function () {
  16694. function _class3() {
  16695. (0, _classCallCheck2.default)(this, _class3);
  16696. throw Un({
  16697. message: "Platform ".concat(C, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  16698. });
  16699. }
  16700. return (0, _createClass2.default)(_class3);
  16701. }();
  16702. var Jn = Symbol("CLIENT_DB_INTERNAL");
  16703. function zn(e, t) {
  16704. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Jn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  16705. get: function get(e, n, s) {
  16706. if ("_uniClient" === n) return null;
  16707. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  16708. if (n in e || "string" != typeof n) {
  16709. var _t12 = e[n];
  16710. return "function" == typeof _t12 ? _t12.bind(e) : _t12;
  16711. }
  16712. return t.get(e, n, s);
  16713. }
  16714. });
  16715. }
  16716. function Vn(e) {
  16717. return {
  16718. on: function on(t, n) {
  16719. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  16720. },
  16721. off: function off(t, n) {
  16722. e[t] = e[t] || [];
  16723. var s = e[t].indexOf(n);
  16724. -1 !== s && e[t].splice(s, 1);
  16725. }
  16726. };
  16727. }
  16728. var Gn = ["db.Geo", "db.command", "command.aggregate"];
  16729. function Yn(e, t) {
  16730. return Gn.indexOf("".concat(e, ".").concat(t)) > -1;
  16731. }
  16732. function Qn(e) {
  16733. switch (f(e)) {
  16734. case "array":
  16735. return e.map(function (e) {
  16736. return Qn(e);
  16737. });
  16738. case "object":
  16739. return e._internalType === Jn || Object.keys(e).forEach(function (t) {
  16740. e[t] = Qn(e[t]);
  16741. }), e;
  16742. case "regexp":
  16743. return {
  16744. $regexp: {
  16745. source: e.source,
  16746. flags: e.flags
  16747. }
  16748. };
  16749. case "date":
  16750. return {
  16751. $date: e.toISOString()
  16752. };
  16753. default:
  16754. return e;
  16755. }
  16756. }
  16757. function Xn(e) {
  16758. return e && e.content && e.content.$method;
  16759. }
  16760. var Zn = /*#__PURE__*/function () {
  16761. function Zn(e, t, n) {
  16762. (0, _classCallCheck2.default)(this, Zn);
  16763. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  16764. }
  16765. (0, _createClass2.default)(Zn, [{
  16766. key: "toJSON",
  16767. value: function toJSON() {
  16768. var e = this;
  16769. var t = [e.content];
  16770. for (; e.prevStage;) {
  16771. e = e.prevStage, t.push(e.content);
  16772. }
  16773. return {
  16774. $db: t.reverse().map(function (e) {
  16775. return {
  16776. $method: e.$method,
  16777. $param: Qn(e.$param)
  16778. };
  16779. })
  16780. };
  16781. }
  16782. }, {
  16783. key: "toString",
  16784. value: function toString() {
  16785. return JSON.stringify(this.toJSON());
  16786. }
  16787. }, {
  16788. key: "getAction",
  16789. value: function getAction() {
  16790. var e = this.toJSON().$db.find(function (e) {
  16791. return "action" === e.$method;
  16792. });
  16793. return e && e.$param && e.$param[0];
  16794. }
  16795. }, {
  16796. key: "getCommand",
  16797. value: function getCommand() {
  16798. return {
  16799. $db: this.toJSON().$db.filter(function (e) {
  16800. return "action" !== e.$method;
  16801. })
  16802. };
  16803. }
  16804. }, {
  16805. key: "isAggregate",
  16806. get: function get() {
  16807. var e = this;
  16808. for (; e;) {
  16809. var t = Xn(e),
  16810. _n10 = Xn(e.prevStage);
  16811. if ("aggregate" === t && "collection" === _n10 || "pipeline" === t) return !0;
  16812. e = e.prevStage;
  16813. }
  16814. return !1;
  16815. }
  16816. }, {
  16817. key: "isCommand",
  16818. get: function get() {
  16819. var e = this;
  16820. for (; e;) {
  16821. if ("command" === Xn(e)) return !0;
  16822. e = e.prevStage;
  16823. }
  16824. return !1;
  16825. }
  16826. }, {
  16827. key: "isAggregateCommand",
  16828. get: function get() {
  16829. var e = this;
  16830. for (; e;) {
  16831. var t = Xn(e),
  16832. _n11 = Xn(e.prevStage);
  16833. if ("aggregate" === t && "command" === _n11) return !0;
  16834. e = e.prevStage;
  16835. }
  16836. return !1;
  16837. }
  16838. }, {
  16839. key: "getNextStageFn",
  16840. value: function getNextStageFn(e) {
  16841. var t = this;
  16842. return function () {
  16843. return es({
  16844. $method: e,
  16845. $param: Qn(Array.from(arguments))
  16846. }, t, t._database);
  16847. };
  16848. }
  16849. }, {
  16850. key: "count",
  16851. get: function get() {
  16852. return this.isAggregate ? this.getNextStageFn("count") : function () {
  16853. return this._send("count", Array.from(arguments));
  16854. };
  16855. }
  16856. }, {
  16857. key: "remove",
  16858. get: function get() {
  16859. return this.isCommand ? this.getNextStageFn("remove") : function () {
  16860. return this._send("remove", Array.from(arguments));
  16861. };
  16862. }
  16863. }, {
  16864. key: "get",
  16865. value: function get() {
  16866. return this._send("get", Array.from(arguments));
  16867. }
  16868. }, {
  16869. key: "add",
  16870. get: function get() {
  16871. return this.isCommand ? this.getNextStageFn("add") : function () {
  16872. return this._send("add", Array.from(arguments));
  16873. };
  16874. }
  16875. }, {
  16876. key: "update",
  16877. value: function update() {
  16878. return this._send("update", Array.from(arguments));
  16879. }
  16880. }, {
  16881. key: "end",
  16882. value: function end() {
  16883. return this._send("end", Array.from(arguments));
  16884. }
  16885. }, {
  16886. key: "set",
  16887. get: function get() {
  16888. return this.isCommand ? this.getNextStageFn("set") : function () {
  16889. throw new Error("JQL禁止使用set方法");
  16890. };
  16891. }
  16892. }, {
  16893. key: "_send",
  16894. value: function _send(e, t) {
  16895. var n = this.getAction(),
  16896. s = this.getCommand();
  16897. if (s.$db.push({
  16898. $method: e,
  16899. $param: Qn(t)
  16900. }), S) {
  16901. var _e21 = s.$db.find(function (e) {
  16902. return "collection" === e.$method;
  16903. }),
  16904. _t13 = _e21 && _e21.$param;
  16905. _t13 && 1 === _t13.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  16906. }
  16907. return this._database._callCloudFunction({
  16908. action: n,
  16909. command: s
  16910. });
  16911. }
  16912. }]);
  16913. return Zn;
  16914. }();
  16915. function es(e, t, n) {
  16916. return zn(new Zn(e, t, n), {
  16917. get: function get(e, t) {
  16918. var s = "db";
  16919. return e && e.content && (s = e.content.$method), Yn(s, t) ? es({
  16920. $method: t
  16921. }, e, n) : function () {
  16922. return es({
  16923. $method: t,
  16924. $param: Qn(Array.from(arguments))
  16925. }, e, n);
  16926. };
  16927. }
  16928. });
  16929. }
  16930. function ts(_ref43) {
  16931. var e = _ref43.path,
  16932. t = _ref43.method;
  16933. return /*#__PURE__*/function () {
  16934. function _class4() {
  16935. (0, _classCallCheck2.default)(this, _class4);
  16936. this.param = Array.from(arguments);
  16937. }
  16938. (0, _createClass2.default)(_class4, [{
  16939. key: "toJSON",
  16940. value: function toJSON() {
  16941. return {
  16942. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  16943. return {
  16944. $method: e
  16945. };
  16946. })), [{
  16947. $method: t,
  16948. $param: this.param
  16949. }])
  16950. };
  16951. }
  16952. }, {
  16953. key: "toString",
  16954. value: function toString() {
  16955. return JSON.stringify(this.toJSON());
  16956. }
  16957. }]);
  16958. return _class4;
  16959. }();
  16960. }
  16961. function ns(e) {
  16962. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16963. return zn(new e(t), {
  16964. get: function get(e, t) {
  16965. return Yn("db", t) ? es({
  16966. $method: t
  16967. }, null, e) : function () {
  16968. return es({
  16969. $method: t,
  16970. $param: Qn(Array.from(arguments))
  16971. }, null, e);
  16972. };
  16973. }
  16974. });
  16975. }
  16976. var ss = /*#__PURE__*/function (_ref44) {
  16977. (0, _inherits2.default)(ss, _ref44);
  16978. var _super10 = _createSuper(ss);
  16979. function ss() {
  16980. (0, _classCallCheck2.default)(this, ss);
  16981. return _super10.apply(this, arguments);
  16982. }
  16983. (0, _createClass2.default)(ss, [{
  16984. key: "_parseResult",
  16985. value: function _parseResult(e) {
  16986. return this._isJQL ? e.result : e;
  16987. }
  16988. }, {
  16989. key: "_callCloudFunction",
  16990. value: function _callCloudFunction(_ref45) {
  16991. var _this20 = this;
  16992. var e = _ref45.action,
  16993. t = _ref45.command,
  16994. n = _ref45.multiCommand,
  16995. s = _ref45.queryList;
  16996. function r(e, t) {
  16997. if (n && s) for (var _n12 = 0; _n12 < s.length; _n12++) {
  16998. var _r7 = s[_n12];
  16999. _r7.udb && "function" == typeof _r7.udb.setResult && (t ? _r7.udb.setResult(t) : _r7.udb.setResult(e.result.dataList[_n12]));
  17000. }
  17001. }
  17002. var i = this,
  17003. o = this._isJQL ? "databaseForJQL" : "database";
  17004. function a(e) {
  17005. return i._callback("error", [e]), q(M(o, "fail"), e).then(function () {
  17006. return q(M(o, "complete"), e);
  17007. }).then(function () {
  17008. return r(null, e), Y(j, {
  17009. type: W,
  17010. content: e
  17011. }), Promise.reject(e);
  17012. });
  17013. }
  17014. var c = q(M(o, "invoke")),
  17015. u = this._uniClient;
  17016. return c.then(function () {
  17017. return u.callFunction({
  17018. name: "DCloud-clientDB",
  17019. type: l,
  17020. data: {
  17021. action: e,
  17022. command: t,
  17023. multiCommand: n
  17024. }
  17025. });
  17026. }).then(function (e) {
  17027. var _e$result = e.result,
  17028. t = _e$result.code,
  17029. n = _e$result.message,
  17030. s = _e$result.token,
  17031. c = _e$result.tokenExpired,
  17032. _e$result$systemInfo = _e$result.systemInfo,
  17033. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  17034. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  17035. var _u$_e = u[_e22],
  17036. _t14 = _u$_e.level,
  17037. _n13 = _u$_e.message,
  17038. _s16 = _u$_e.detail,
  17039. _r8 = console["app" === C && "warn" === _t14 ? "error" : _t14] || console.log;
  17040. var _i4 = "[System Info]" + _n13;
  17041. _s16 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s16)), _r8(_i4);
  17042. }
  17043. if (t) {
  17044. return a(new te({
  17045. code: t,
  17046. message: n,
  17047. requestId: e.requestId
  17048. }));
  17049. }
  17050. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (re({
  17051. token: s,
  17052. tokenExpired: c
  17053. }), _this20._callbackAuth("refreshToken", [{
  17054. token: s,
  17055. tokenExpired: c
  17056. }]), _this20._callback("refreshToken", [{
  17057. token: s,
  17058. tokenExpired: c
  17059. }]), Y(B, {
  17060. token: s,
  17061. tokenExpired: c
  17062. }));
  17063. var l = [{
  17064. prop: "affectedDocs",
  17065. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  17066. }, {
  17067. prop: "code",
  17068. tips: "code不再推荐使用,请使用errCode替代"
  17069. }, {
  17070. prop: "message",
  17071. tips: "message不再推荐使用,请使用errMsg替代"
  17072. }];
  17073. var _loop2 = function _loop2(_t15) {
  17074. var _l$_t = l[_t15],
  17075. n = _l$_t.prop,
  17076. s = _l$_t.tips;
  17077. if (n in e.result) {
  17078. var _t16 = e.result[n];
  17079. Object.defineProperty(e.result, n, {
  17080. get: function get() {
  17081. return console.warn(s), _t16;
  17082. }
  17083. });
  17084. }
  17085. };
  17086. for (var _t15 = 0; _t15 < l.length; _t15++) {
  17087. _loop2(_t15);
  17088. }
  17089. return function (e) {
  17090. return q(M(o, "success"), e).then(function () {
  17091. return q(M(o, "complete"), e);
  17092. }).then(function () {
  17093. r(e, null);
  17094. var t = i._parseResult(e);
  17095. return Y(j, {
  17096. type: W,
  17097. content: t
  17098. }), Promise.resolve(t);
  17099. });
  17100. }(e);
  17101. }, function (e) {
  17102. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  17103. return a(new te({
  17104. code: e.code || "SYSTEM_ERROR",
  17105. message: e.message,
  17106. requestId: e.requestId
  17107. }));
  17108. });
  17109. }
  17110. }]);
  17111. return ss;
  17112. }( /*#__PURE__*/function () {
  17113. function _class5() {
  17114. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17115. _ref46$uniClient = _ref46.uniClient,
  17116. e = _ref46$uniClient === void 0 ? {} : _ref46$uniClient,
  17117. _ref46$isJQL = _ref46.isJQL,
  17118. t = _ref46$isJQL === void 0 ? !1 : _ref46$isJQL;
  17119. (0, _classCallCheck2.default)(this, _class5);
  17120. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = Vn(this._authCallBacks)), this._isJQL = t, Object.assign(this, Vn(this._dbCallBacks)), this.env = zn({}, {
  17121. get: function get(e, t) {
  17122. return {
  17123. $env: t
  17124. };
  17125. }
  17126. }), this.Geo = zn({}, {
  17127. get: function get(e, t) {
  17128. return ts({
  17129. path: ["Geo"],
  17130. method: t
  17131. });
  17132. }
  17133. }), this.serverDate = ts({
  17134. path: [],
  17135. method: "serverDate"
  17136. }), this.RegExp = ts({
  17137. path: [],
  17138. method: "RegExp"
  17139. });
  17140. }
  17141. (0, _createClass2.default)(_class5, [{
  17142. key: "getCloudEnv",
  17143. value: function getCloudEnv(e) {
  17144. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  17145. return {
  17146. $env: e.replace("$cloudEnv_", "")
  17147. };
  17148. }
  17149. }, {
  17150. key: "_callback",
  17151. value: function _callback(e, t) {
  17152. var n = this._dbCallBacks;
  17153. n[e] && n[e].forEach(function (e) {
  17154. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17155. });
  17156. }
  17157. }, {
  17158. key: "_callbackAuth",
  17159. value: function _callbackAuth(e, t) {
  17160. var n = this._authCallBacks;
  17161. n[e] && n[e].forEach(function (e) {
  17162. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17163. });
  17164. }
  17165. }, {
  17166. key: "multiSend",
  17167. value: function multiSend() {
  17168. var e = Array.from(arguments),
  17169. t = e.map(function (e) {
  17170. var t = e.getAction(),
  17171. n = e.getCommand();
  17172. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  17173. return {
  17174. action: t,
  17175. command: n
  17176. };
  17177. });
  17178. return this._callCloudFunction({
  17179. multiCommand: t,
  17180. queryList: e
  17181. });
  17182. }
  17183. }]);
  17184. return _class5;
  17185. }());
  17186. var rs = "token无效,跳转登录页面",
  17187. is = "token过期,跳转登录页面",
  17188. os = {
  17189. TOKEN_INVALID_TOKEN_EXPIRED: is,
  17190. TOKEN_INVALID_INVALID_CLIENTID: rs,
  17191. TOKEN_INVALID: rs,
  17192. TOKEN_INVALID_WRONG_TOKEN: rs,
  17193. TOKEN_INVALID_ANONYMOUS_USER: rs
  17194. },
  17195. as = {
  17196. "uni-id-token-expired": is,
  17197. "uni-id-check-token-failed": rs,
  17198. "uni-id-token-not-exist": rs,
  17199. "uni-id-check-device-feature-failed": rs
  17200. };
  17201. function cs(e, t) {
  17202. var n = "";
  17203. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  17204. }
  17205. function us() {
  17206. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17207. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  17208. var n = [],
  17209. s = [];
  17210. return e.forEach(function (e) {
  17211. !0 === e.needLogin ? n.push(cs(t, e.path)) : !1 === e.needLogin && s.push(cs(t, e.path));
  17212. }), {
  17213. needLoginPage: n,
  17214. notNeedLoginPage: s
  17215. };
  17216. }
  17217. function ls(e) {
  17218. return e.split("?")[0].replace(/^\//, "");
  17219. }
  17220. function hs() {
  17221. return function (e) {
  17222. var t = e && e.$page && e.$page.fullPath || "";
  17223. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  17224. }(function () {
  17225. var e = getCurrentPages();
  17226. return e[e.length - 1];
  17227. }());
  17228. }
  17229. function ds() {
  17230. return ls(hs());
  17231. }
  17232. function ps() {
  17233. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  17234. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17235. if (!e) return !1;
  17236. if (!(t && t.list && t.list.length)) return !1;
  17237. var n = t.list,
  17238. s = ls(e);
  17239. return n.some(function (e) {
  17240. return e.pagePath === s;
  17241. });
  17242. }
  17243. var fs = !!_pages.default.uniIdRouter;
  17244. var _ref47 = function () {
  17245. var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  17246. _ref28$pages = _ref28.pages,
  17247. t = _ref28$pages === void 0 ? [] : _ref28$pages,
  17248. _ref28$subPackages = _ref28.subPackages,
  17249. n = _ref28$subPackages === void 0 ? [] : _ref28$subPackages,
  17250. _ref28$uniIdRouter = _ref28.uniIdRouter,
  17251. s = _ref28$uniIdRouter === void 0 ? {} : _ref28$uniIdRouter,
  17252. _ref28$tabBar = _ref28.tabBar,
  17253. r = _ref28$tabBar === void 0 ? {} : _ref28$tabBar;
  17254. var i = s.loginPage,
  17255. _s$needLogin = s.needLogin,
  17256. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  17257. _s$resToLogin = s.resToLogin,
  17258. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  17259. _us = us(t),
  17260. c = _us.needLoginPage,
  17261. u = _us.notNeedLoginPage,
  17262. _ref30 = function () {
  17263. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17264. var t = [],
  17265. n = [];
  17266. return e.forEach(function (e) {
  17267. var s = e.root,
  17268. _e$pages = e.pages,
  17269. r = _e$pages === void 0 ? [] : _e$pages,
  17270. _us2 = us(r, s),
  17271. i = _us2.needLoginPage,
  17272. o = _us2.notNeedLoginPage;
  17273. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  17274. }), {
  17275. needLoginPage: t,
  17276. notNeedLoginPage: n
  17277. };
  17278. }(n),
  17279. l = _ref30.needLoginPage,
  17280. h = _ref30.notNeedLoginPage;
  17281. return {
  17282. loginPage: i,
  17283. routerNeedLogin: o,
  17284. resToLogin: a,
  17285. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  17286. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  17287. loginPageInTabBar: ps(i, r)
  17288. };
  17289. }(),
  17290. gs = _ref47.loginPage,
  17291. ms = _ref47.routerNeedLogin,
  17292. ys = _ref47.resToLogin,
  17293. _s = _ref47.needLoginPage,
  17294. ws = _ref47.notNeedLoginPage,
  17295. vs = _ref47.loginPageInTabBar;
  17296. if (_s.indexOf(gs) > -1) throw new Error("Login page [".concat(gs, "] should not be \"needLogin\", please check your pages.json"));
  17297. function Is(e) {
  17298. var t = ds();
  17299. if ("/" === e.charAt(0)) return e;
  17300. var _e$split = e.split("?"),
  17301. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  17302. n = _e$split2[0],
  17303. s = _e$split2[1],
  17304. r = n.replace(/^\//, "").split("/"),
  17305. i = t.split("/");
  17306. i.pop();
  17307. for (var _e23 = 0; _e23 < r.length; _e23++) {
  17308. var _t17 = r[_e23];
  17309. ".." === _t17 ? i.pop() : "." !== _t17 && i.push(_t17);
  17310. }
  17311. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  17312. }
  17313. function Ss(e) {
  17314. var t = ls(Is(e));
  17315. return !(ws.indexOf(t) > -1) && (_s.indexOf(t) > -1 || ms.some(function (t) {
  17316. return function (e, t) {
  17317. return new RegExp(t).test(e);
  17318. }(e, t);
  17319. }));
  17320. }
  17321. function bs(_ref48) {
  17322. var e = _ref48.redirect;
  17323. var t = ls(e),
  17324. n = ls(gs);
  17325. return ds() !== n && t !== n;
  17326. }
  17327. function ks() {
  17328. var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17329. e = _ref49.api,
  17330. t = _ref49.redirect;
  17331. if (!t || !bs({
  17332. redirect: t
  17333. })) return;
  17334. var n = function (e, t) {
  17335. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  17336. }(gs, t);
  17337. vs ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  17338. var s = {
  17339. navigateTo: uni.navigateTo,
  17340. redirectTo: uni.redirectTo,
  17341. switchTab: uni.switchTab,
  17342. reLaunch: uni.reLaunch
  17343. };
  17344. setTimeout(function () {
  17345. s[e]({
  17346. url: n
  17347. });
  17348. }, 0);
  17349. }
  17350. function As() {
  17351. var _ref50 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17352. e = _ref50.url;
  17353. var t = {
  17354. abortLoginPageJump: !1,
  17355. autoToLoginPage: !1
  17356. },
  17357. n = function () {
  17358. var _se4 = se(),
  17359. e = _se4.token,
  17360. t = _se4.tokenExpired;
  17361. var n;
  17362. if (e) {
  17363. if (t < Date.now()) {
  17364. var _e24 = "uni-id-token-expired";
  17365. n = {
  17366. errCode: _e24,
  17367. errMsg: as[_e24]
  17368. };
  17369. }
  17370. } else {
  17371. var _e25 = "uni-id-check-token-failed";
  17372. n = {
  17373. errCode: _e25,
  17374. errMsg: as[_e25]
  17375. };
  17376. }
  17377. return n;
  17378. }();
  17379. if (Ss(e) && n) {
  17380. n.uniIdRedirectUrl = e;
  17381. if (z($).length > 0) return setTimeout(function () {
  17382. Y($, n);
  17383. }, 0), t.abortLoginPageJump = !0, t;
  17384. t.autoToLoginPage = !0;
  17385. }
  17386. return t;
  17387. }
  17388. function Cs() {
  17389. !function () {
  17390. var e = hs(),
  17391. _As = As({
  17392. url: e
  17393. }),
  17394. t = _As.abortLoginPageJump,
  17395. n = _As.autoToLoginPage;
  17396. t || n && ks({
  17397. api: "redirectTo",
  17398. redirect: e
  17399. });
  17400. }();
  17401. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  17402. var _loop3 = function _loop3(_t18) {
  17403. var n = e[_t18];
  17404. uni.addInterceptor(n, {
  17405. invoke: function invoke(e) {
  17406. var _As2 = As({
  17407. url: e.url
  17408. }),
  17409. t = _As2.abortLoginPageJump,
  17410. s = _As2.autoToLoginPage;
  17411. return t ? e : s ? (ks({
  17412. api: n,
  17413. redirect: Is(e.url)
  17414. }), !1) : e;
  17415. }
  17416. });
  17417. };
  17418. for (var _t18 = 0; _t18 < e.length; _t18++) {
  17419. _loop3(_t18);
  17420. }
  17421. }
  17422. function Ps() {
  17423. this.onResponse(function (e) {
  17424. var t = e.type,
  17425. n = e.content;
  17426. var s = !1;
  17427. switch (t) {
  17428. case "cloudobject":
  17429. s = function (e) {
  17430. if ("object" != (0, _typeof2.default)(e)) return !1;
  17431. var _ref51 = e || {},
  17432. t = _ref51.errCode;
  17433. return t in as;
  17434. }(n);
  17435. break;
  17436. case "clientdb":
  17437. s = function (e) {
  17438. if ("object" != (0, _typeof2.default)(e)) return !1;
  17439. var _ref52 = e || {},
  17440. t = _ref52.errCode;
  17441. return t in os;
  17442. }(n);
  17443. }
  17444. s && function () {
  17445. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17446. var t = z($);
  17447. Z().then(function () {
  17448. var n = hs();
  17449. if (n && bs({
  17450. redirect: n
  17451. })) return t.length > 0 ? Y($, Object.assign({
  17452. uniIdRedirectUrl: n
  17453. }, e)) : void (gs && ks({
  17454. api: "navigateTo",
  17455. redirect: n
  17456. }));
  17457. });
  17458. }(n);
  17459. });
  17460. }
  17461. function Ts(e) {
  17462. !function (e) {
  17463. e.onResponse = function (e) {
  17464. V(j, e);
  17465. }, e.offResponse = function (e) {
  17466. G(j, e);
  17467. };
  17468. }(e), function (e) {
  17469. e.onNeedLogin = function (e) {
  17470. V($, e);
  17471. }, e.offNeedLogin = function (e) {
  17472. G($, e);
  17473. }, fs && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, Z().then(function () {
  17474. Cs.call(e);
  17475. }), ys && Ps.call(e)));
  17476. }(e), function (e) {
  17477. e.onRefreshToken = function (e) {
  17478. V(B, e);
  17479. }, e.offRefreshToken = function (e) {
  17480. G(B, e);
  17481. };
  17482. }(e);
  17483. }
  17484. var xs;
  17485. var Os = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  17486. Es = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  17487. function Ls() {
  17488. var e = se().token || "",
  17489. t = e.split(".");
  17490. if (!e || 3 !== t.length) return {
  17491. uid: null,
  17492. role: [],
  17493. permission: [],
  17494. tokenExpired: 0
  17495. };
  17496. var n;
  17497. try {
  17498. n = JSON.parse((s = t[1], decodeURIComponent(xs(s).split("").map(function (e) {
  17499. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  17500. }).join(""))));
  17501. } catch (e) {
  17502. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  17503. }
  17504. var s;
  17505. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  17506. }
  17507. xs = "function" != typeof atob ? function (e) {
  17508. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !Es.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  17509. var t;
  17510. e += "==".slice(2 - (3 & e.length));
  17511. for (var n, s, r = "", i = 0; i < e.length;) {
  17512. t = Os.indexOf(e.charAt(i++)) << 18 | Os.indexOf(e.charAt(i++)) << 12 | (n = Os.indexOf(e.charAt(i++))) << 6 | (s = Os.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);
  17513. }
  17514. return r;
  17515. } : atob;
  17516. var Rs = n(function (e, t) {
  17517. Object.defineProperty(t, "__esModule", {
  17518. value: !0
  17519. });
  17520. var n = "chooseAndUploadFile:ok",
  17521. s = "chooseAndUploadFile:fail";
  17522. function r(e, t) {
  17523. return e.tempFiles.forEach(function (e, n) {
  17524. 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("."));
  17525. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  17526. return e.path;
  17527. })), e;
  17528. }
  17529. function i(e, t, _ref53) {
  17530. var s = _ref53.onChooseFile,
  17531. r = _ref53.onUploadProgress;
  17532. return t.then(function (e) {
  17533. if (s) {
  17534. var _t19 = s(e);
  17535. if (void 0 !== _t19) return Promise.resolve(_t19).then(function (t) {
  17536. return void 0 === t ? e : t;
  17537. });
  17538. }
  17539. return e;
  17540. }).then(function (t) {
  17541. return !1 === t ? {
  17542. errMsg: n,
  17543. tempFilePaths: [],
  17544. tempFiles: []
  17545. } : function (e, t) {
  17546. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  17547. var r = arguments.length > 3 ? arguments[3] : undefined;
  17548. (t = Object.assign({}, t)).errMsg = n;
  17549. var i = t.tempFiles,
  17550. o = i.length;
  17551. var a = 0;
  17552. return new Promise(function (n) {
  17553. for (; a < s;) {
  17554. c();
  17555. }
  17556. function c() {
  17557. var s = a++;
  17558. if (s >= o) return void (!i.find(function (e) {
  17559. return !e.url && !e.errMsg;
  17560. }) && n(t));
  17561. var u = i[s];
  17562. e.uploadFile({
  17563. provider: u.provider,
  17564. filePath: u.path,
  17565. cloudPath: u.cloudPath,
  17566. fileType: u.fileType,
  17567. cloudPathAsRealPath: u.cloudPathAsRealPath,
  17568. onUploadProgress: function onUploadProgress(e) {
  17569. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  17570. }
  17571. }).then(function (e) {
  17572. u.url = e.fileID, s < o && c();
  17573. }).catch(function (e) {
  17574. u.errMsg = e.errMsg || e.message, s < o && c();
  17575. });
  17576. }
  17577. });
  17578. }(e, t, 5, r);
  17579. });
  17580. }
  17581. t.initChooseAndUploadFile = function (e) {
  17582. return function () {
  17583. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17584. type: "all"
  17585. };
  17586. return "image" === t.type ? i(e, function (e) {
  17587. var t = e.count,
  17588. n = e.sizeType,
  17589. _e$sourceType = e.sourceType,
  17590. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  17591. o = e.extension;
  17592. return new Promise(function (e, a) {
  17593. uni.chooseImage({
  17594. count: t,
  17595. sizeType: n,
  17596. sourceType: i,
  17597. extension: o,
  17598. success: function success(t) {
  17599. e(r(t, "image"));
  17600. },
  17601. fail: function fail(e) {
  17602. a({
  17603. errMsg: e.errMsg.replace("chooseImage:fail", s)
  17604. });
  17605. }
  17606. });
  17607. });
  17608. }(t), t) : "video" === t.type ? i(e, function (e) {
  17609. var t = e.camera,
  17610. n = e.compressed,
  17611. i = e.maxDuration,
  17612. _e$sourceType2 = e.sourceType,
  17613. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  17614. a = e.extension;
  17615. return new Promise(function (e, c) {
  17616. uni.chooseVideo({
  17617. camera: t,
  17618. compressed: n,
  17619. maxDuration: i,
  17620. sourceType: o,
  17621. extension: a,
  17622. success: function success(t) {
  17623. var n = t.tempFilePath,
  17624. s = t.duration,
  17625. i = t.size,
  17626. o = t.height,
  17627. a = t.width;
  17628. e(r({
  17629. errMsg: "chooseVideo:ok",
  17630. tempFilePaths: [n],
  17631. tempFiles: [{
  17632. name: t.tempFile && t.tempFile.name || "",
  17633. path: n,
  17634. size: i,
  17635. type: t.tempFile && t.tempFile.type || "",
  17636. width: a,
  17637. height: o,
  17638. duration: s,
  17639. fileType: "video",
  17640. cloudPath: ""
  17641. }]
  17642. }, "video"));
  17643. },
  17644. fail: function fail(e) {
  17645. c({
  17646. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  17647. });
  17648. }
  17649. });
  17650. });
  17651. }(t), t) : i(e, function (e) {
  17652. var t = e.count,
  17653. n = e.extension;
  17654. return new Promise(function (e, i) {
  17655. var o = uni.chooseFile;
  17656. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  17657. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  17658. });
  17659. o({
  17660. type: "all",
  17661. count: t,
  17662. extension: n,
  17663. success: function success(t) {
  17664. e(r(t));
  17665. },
  17666. fail: function fail(e) {
  17667. i({
  17668. errMsg: e.errMsg.replace("chooseFile:fail", s)
  17669. });
  17670. }
  17671. });
  17672. });
  17673. }(t), t);
  17674. };
  17675. };
  17676. }),
  17677. Us = t(Rs);
  17678. var Ns = "manual";
  17679. function Ds(e) {
  17680. return {
  17681. props: {
  17682. localdata: {
  17683. type: Array,
  17684. default: function _default() {
  17685. return [];
  17686. }
  17687. },
  17688. options: {
  17689. type: [Object, Array],
  17690. default: function _default() {
  17691. return {};
  17692. }
  17693. },
  17694. spaceInfo: {
  17695. type: Object,
  17696. default: function _default() {
  17697. return {};
  17698. }
  17699. },
  17700. collection: {
  17701. type: [String, Array],
  17702. default: ""
  17703. },
  17704. action: {
  17705. type: String,
  17706. default: ""
  17707. },
  17708. field: {
  17709. type: String,
  17710. default: ""
  17711. },
  17712. orderby: {
  17713. type: String,
  17714. default: ""
  17715. },
  17716. where: {
  17717. type: [String, Object],
  17718. default: ""
  17719. },
  17720. pageData: {
  17721. type: String,
  17722. default: "add"
  17723. },
  17724. pageCurrent: {
  17725. type: Number,
  17726. default: 1
  17727. },
  17728. pageSize: {
  17729. type: Number,
  17730. default: 20
  17731. },
  17732. getcount: {
  17733. type: [Boolean, String],
  17734. default: !1
  17735. },
  17736. gettree: {
  17737. type: [Boolean, String],
  17738. default: !1
  17739. },
  17740. gettreepath: {
  17741. type: [Boolean, String],
  17742. default: !1
  17743. },
  17744. startwith: {
  17745. type: String,
  17746. default: ""
  17747. },
  17748. limitlevel: {
  17749. type: Number,
  17750. default: 10
  17751. },
  17752. groupby: {
  17753. type: String,
  17754. default: ""
  17755. },
  17756. groupField: {
  17757. type: String,
  17758. default: ""
  17759. },
  17760. distinct: {
  17761. type: [Boolean, String],
  17762. default: !1
  17763. },
  17764. foreignKey: {
  17765. type: String,
  17766. default: ""
  17767. },
  17768. loadtime: {
  17769. type: String,
  17770. default: "auto"
  17771. },
  17772. manual: {
  17773. type: Boolean,
  17774. default: !1
  17775. }
  17776. },
  17777. data: function data() {
  17778. return {
  17779. mixinDatacomLoading: !1,
  17780. mixinDatacomHasMore: !1,
  17781. mixinDatacomResData: [],
  17782. mixinDatacomErrorMessage: "",
  17783. mixinDatacomPage: {},
  17784. mixinDatacomError: null
  17785. };
  17786. },
  17787. created: function created() {
  17788. var _this21 = this;
  17789. this.mixinDatacomPage = {
  17790. current: this.pageCurrent,
  17791. size: this.pageSize,
  17792. count: 0
  17793. }, this.$watch(function () {
  17794. var e = [];
  17795. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  17796. e.push(_this21[t]);
  17797. }), e;
  17798. }, function (e, t) {
  17799. if (_this21.loadtime === Ns) return;
  17800. var n = !1;
  17801. var s = [];
  17802. for (var _r9 = 2; _r9 < e.length; _r9++) {
  17803. e[_r9] !== t[_r9] && (s.push(e[_r9]), n = !0);
  17804. }
  17805. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  17806. });
  17807. },
  17808. methods: {
  17809. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  17810. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  17811. var _this22 = this;
  17812. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17813. _ref54$getone = _ref54.getone,
  17814. e = _ref54$getone === void 0 ? !1 : _ref54$getone,
  17815. t = _ref54.success,
  17816. n = _ref54.fail;
  17817. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then(function (n) {
  17818. _this22.mixinDatacomLoading = !1;
  17819. var _n$result = n.result,
  17820. s = _n$result.data,
  17821. r = _n$result.count;
  17822. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  17823. var i = e ? s.length ? s[0] : void 0 : s;
  17824. _this22.mixinDatacomResData = i, t && t(i);
  17825. }).catch(function (e) {
  17826. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, _this22.mixinDatacomError = e, n && n(e);
  17827. }));
  17828. },
  17829. mixinDatacomGet: function mixinDatacomGet() {
  17830. var _n14;
  17831. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17832. var n;
  17833. t = t || {}, n = "undefined" != typeof __uniX && __uniX ? e.databaseForJQL(this.spaceInfo) : e.database(this.spaceInfo);
  17834. var s = t.action || this.action;
  17835. s && (n = n.action(s));
  17836. var r = t.collection || this.collection;
  17837. n = Array.isArray(r) ? (_n14 = n).collection.apply(_n14, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  17838. var i = t.where || this.where;
  17839. i && Object.keys(i).length && (n = n.where(i));
  17840. var o = t.field || this.field;
  17841. o && (n = n.field(o));
  17842. var a = t.foreignKey || this.foreignKey;
  17843. a && (n = n.foreignKey(a));
  17844. var c = t.groupby || this.groupby;
  17845. c && (n = n.groupBy(c));
  17846. var u = t.groupField || this.groupField;
  17847. u && (n = n.groupField(u));
  17848. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  17849. var l = t.orderby || this.orderby;
  17850. l && (n = n.orderBy(l));
  17851. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  17852. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  17853. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  17854. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  17855. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  17856. m = {
  17857. getCount: p
  17858. },
  17859. y = {
  17860. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  17861. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  17862. };
  17863. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  17864. }
  17865. }
  17866. };
  17867. }
  17868. function qs(e) {
  17869. return function (t) {
  17870. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17871. n = function (e) {
  17872. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17873. 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;
  17874. }({
  17875. customUI: !1,
  17876. loadingOptions: {
  17877. title: "加载中...",
  17878. mask: !0
  17879. },
  17880. errorOptions: {
  17881. type: "modal",
  17882. retry: !1
  17883. }
  17884. }, n);
  17885. var _n15 = n,
  17886. s = _n15.customUI,
  17887. r = _n15.loadingOptions,
  17888. i = _n15.errorOptions,
  17889. o = _n15.parseSystemError,
  17890. a = !s;
  17891. return new Proxy({}, {
  17892. get: function get(s, c) {
  17893. switch (c) {
  17894. case "toString":
  17895. return "[object UniCloudObject]";
  17896. case "toJSON":
  17897. return {};
  17898. }
  17899. return function () {
  17900. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17901. e = _ref55.fn,
  17902. t = _ref55.interceptorName,
  17903. n = _ref55.getCallbackArgs;
  17904. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  17905. var _len2,
  17906. s,
  17907. _key2,
  17908. r,
  17909. i,
  17910. o,
  17911. _args = arguments;
  17912. return _regenerator.default.wrap(function _callee55$(_context55) {
  17913. while (1) {
  17914. switch (_context55.prev = _context55.next) {
  17915. case 0:
  17916. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  17917. s[_key2] = _args[_key2];
  17918. }
  17919. r = n ? n({
  17920. params: s
  17921. }) : {};
  17922. _context55.prev = 2;
  17923. _context55.next = 5;
  17924. return q(M(t, "invoke"), _objectSpread({}, r));
  17925. case 5:
  17926. _context55.next = 7;
  17927. return e.apply(void 0, s);
  17928. case 7:
  17929. i = _context55.sent;
  17930. _context55.next = 10;
  17931. return q(M(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  17932. result: i
  17933. }));
  17934. case 10:
  17935. return _context55.abrupt("return", i);
  17936. case 13:
  17937. _context55.prev = 13;
  17938. _context55.t0 = _context55["catch"](2);
  17939. o = _context55.t0;
  17940. _context55.next = 18;
  17941. return q(M(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  17942. error: o
  17943. }));
  17944. case 18:
  17945. throw o;
  17946. case 19:
  17947. _context55.prev = 19;
  17948. _context55.next = 22;
  17949. return q(M(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  17950. error: o
  17951. }) : _objectSpread(_objectSpread({}, r), {}, {
  17952. result: i
  17953. }));
  17954. case 22:
  17955. return _context55.finish(19);
  17956. case 23:
  17957. case "end":
  17958. return _context55.stop();
  17959. }
  17960. }
  17961. }, _callee55, null, [[2, 13, 19, 23]]);
  17962. }));
  17963. }({
  17964. fn: function () {
  17965. var _s17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
  17966. var h,
  17967. _len3,
  17968. l,
  17969. _key3,
  17970. d,
  17971. p,
  17972. _ref57,
  17973. f,
  17974. g,
  17975. m,
  17976. y,
  17977. _e26,
  17978. _yield,
  17979. _t20,
  17980. _n16,
  17981. _args4 = arguments;
  17982. return _regenerator.default.wrap(function _callee57$(_context57) {
  17983. while (1) {
  17984. switch (_context57.prev = _context57.next) {
  17985. case 0:
  17986. a && uni.showLoading({
  17987. title: r.title,
  17988. mask: r.mask
  17989. });
  17990. for (_len3 = _args4.length, l = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  17991. l[_key3] = _args4[_key3];
  17992. }
  17993. d = {
  17994. name: t,
  17995. type: u,
  17996. data: {
  17997. method: c,
  17998. params: l
  17999. }
  18000. };
  18001. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  18002. var n = t.data.method,
  18003. s = e.secretMethods || {},
  18004. r = s[n] || s["*"];
  18005. r && (t.secretType = r);
  18006. }(n, d);
  18007. p = !1;
  18008. _context57.prev = 5;
  18009. _context57.next = 8;
  18010. return e.callFunction(d);
  18011. case 8:
  18012. h = _context57.sent;
  18013. _context57.next = 14;
  18014. break;
  18015. case 11:
  18016. _context57.prev = 11;
  18017. _context57.t0 = _context57["catch"](5);
  18018. p = !0, h = {
  18019. result: new te(_context57.t0)
  18020. };
  18021. case 14:
  18022. _ref57 = h.result || {}, f = _ref57.errSubject, g = _ref57.errCode, m = _ref57.errMsg, y = _ref57.newToken;
  18023. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (re(y), Y(B, _objectSpread({}, y))), g)) {
  18024. _context57.next = 39;
  18025. break;
  18026. }
  18027. _e26 = m;
  18028. if (!(p && o)) {
  18029. _context57.next = 24;
  18030. break;
  18031. }
  18032. _context57.next = 20;
  18033. return o({
  18034. objectName: t,
  18035. methodName: c,
  18036. params: l,
  18037. errSubject: f,
  18038. errCode: g,
  18039. errMsg: m
  18040. });
  18041. case 20:
  18042. _context57.t1 = _context57.sent.errMsg;
  18043. if (_context57.t1) {
  18044. _context57.next = 23;
  18045. break;
  18046. }
  18047. _context57.t1 = m;
  18048. case 23:
  18049. _e26 = _context57.t1;
  18050. case 24:
  18051. if (!a) {
  18052. _context57.next = 37;
  18053. break;
  18054. }
  18055. if (!("toast" === i.type)) {
  18056. _context57.next = 29;
  18057. break;
  18058. }
  18059. uni.showToast({
  18060. title: _e26,
  18061. icon: "none"
  18062. });
  18063. _context57.next = 37;
  18064. break;
  18065. case 29:
  18066. if (!("modal" !== i.type)) {
  18067. _context57.next = 31;
  18068. break;
  18069. }
  18070. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  18071. case 31:
  18072. _context57.next = 33;
  18073. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
  18074. var _ref59,
  18075. e,
  18076. t,
  18077. n,
  18078. s,
  18079. r,
  18080. _args2 = arguments;
  18081. return _regenerator.default.wrap(function _callee56$(_context56) {
  18082. while (1) {
  18083. switch (_context56.prev = _context56.next) {
  18084. case 0:
  18085. _ref59 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref59.title, t = _ref59.content, n = _ref59.showCancel, s = _ref59.cancelText, r = _ref59.confirmText;
  18086. return _context56.abrupt("return", new Promise(function (i, o) {
  18087. uni.showModal({
  18088. title: e,
  18089. content: t,
  18090. showCancel: n,
  18091. cancelText: s,
  18092. confirmText: r,
  18093. success: function success(e) {
  18094. i(e);
  18095. },
  18096. fail: function fail() {
  18097. i({
  18098. confirm: !1,
  18099. cancel: !0
  18100. });
  18101. }
  18102. });
  18103. }));
  18104. case 2:
  18105. case "end":
  18106. return _context56.stop();
  18107. }
  18108. }
  18109. }, _callee56);
  18110. }))({
  18111. title: "提示",
  18112. content: _e26,
  18113. showCancel: i.retry,
  18114. cancelText: "取消",
  18115. confirmText: i.retry ? "重试" : "确定"
  18116. });
  18117. case 33:
  18118. _yield = _context57.sent;
  18119. _t20 = _yield.confirm;
  18120. if (!(i.retry && _t20)) {
  18121. _context57.next = 37;
  18122. break;
  18123. }
  18124. return _context57.abrupt("return", s.apply(void 0, l));
  18125. case 37:
  18126. _n16 = new te({
  18127. subject: f,
  18128. code: g,
  18129. message: m,
  18130. requestId: h.requestId
  18131. });
  18132. throw _n16.detail = h.result, Y(j, {
  18133. type: J,
  18134. content: _n16
  18135. }), _n16;
  18136. case 39:
  18137. return _context57.abrupt("return", (Y(j, {
  18138. type: J,
  18139. content: h.result
  18140. }), h.result));
  18141. case 40:
  18142. case "end":
  18143. return _context57.stop();
  18144. }
  18145. }
  18146. }, _callee57, null, [[5, 11]]);
  18147. }));
  18148. function s() {
  18149. return _s17.apply(this, arguments);
  18150. }
  18151. return s;
  18152. }(),
  18153. interceptorName: "callObject",
  18154. getCallbackArgs: function getCallbackArgs() {
  18155. var _ref60 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18156. e = _ref60.params;
  18157. return {
  18158. objectName: t,
  18159. methodName: c,
  18160. params: e
  18161. };
  18162. }
  18163. });
  18164. }
  18165. });
  18166. };
  18167. }
  18168. function Ms(e) {
  18169. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  18170. }
  18171. function Fs() {
  18172. return _Fs.apply(this, arguments);
  18173. }
  18174. function _Fs() {
  18175. _Fs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
  18176. var _ref71,
  18177. e,
  18178. _ref71$callLoginByWei,
  18179. t,
  18180. n,
  18181. s,
  18182. r,
  18183. _args9 = arguments;
  18184. return _regenerator.default.wrap(function _callee62$(_context62) {
  18185. while (1) {
  18186. switch (_context62.prev = _context62.next) {
  18187. case 0:
  18188. _ref71 = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {}, e = _ref71.openid, _ref71$callLoginByWei = _ref71.callLoginByWeixin, t = _ref71$callLoginByWei === void 0 ? !1 : _ref71$callLoginByWei;
  18189. n = Ms(this);
  18190. if (!("mp-weixin" !== C)) {
  18191. _context62.next = 4;
  18192. break;
  18193. }
  18194. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(C, "`"));
  18195. case 4:
  18196. if (!(e && t)) {
  18197. _context62.next = 6;
  18198. break;
  18199. }
  18200. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  18201. case 6:
  18202. if (!e) {
  18203. _context62.next = 8;
  18204. break;
  18205. }
  18206. return _context62.abrupt("return", (n.mpWeixinOpenid = e, {}));
  18207. case 8:
  18208. _context62.next = 10;
  18209. return new Promise(function (e, t) {
  18210. uni.login({
  18211. success: function success(t) {
  18212. e(t.code);
  18213. },
  18214. fail: function fail(e) {
  18215. t(new Error(e.errMsg));
  18216. }
  18217. });
  18218. });
  18219. case 10:
  18220. s = _context62.sent;
  18221. r = this.importObject("uni-id-co", {
  18222. customUI: !0
  18223. });
  18224. _context62.next = 14;
  18225. return r.secureNetworkHandshakeByWeixin({
  18226. code: s,
  18227. callLoginByWeixin: t
  18228. });
  18229. case 14:
  18230. n.mpWeixinCode = s;
  18231. return _context62.abrupt("return", {
  18232. code: s
  18233. });
  18234. case 16:
  18235. case "end":
  18236. return _context62.stop();
  18237. }
  18238. }
  18239. }, _callee62, this);
  18240. }));
  18241. return _Fs.apply(this, arguments);
  18242. }
  18243. function Ks(_x46) {
  18244. return _Ks.apply(this, arguments);
  18245. }
  18246. function _Ks() {
  18247. _Ks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63(e) {
  18248. var t;
  18249. return _regenerator.default.wrap(function _callee63$(_context63) {
  18250. while (1) {
  18251. switch (_context63.prev = _context63.next) {
  18252. case 0:
  18253. t = Ms(this);
  18254. return _context63.abrupt("return", (t.initPromise || (t.initPromise = Fs.call(this, e).then(function (e) {
  18255. return e;
  18256. }).catch(function (e) {
  18257. throw delete t.initPromise, e;
  18258. })), t.initPromise));
  18259. case 2:
  18260. case "end":
  18261. return _context63.stop();
  18262. }
  18263. }
  18264. }, _callee63, this);
  18265. }));
  18266. return _Ks.apply(this, arguments);
  18267. }
  18268. function js(e) {
  18269. return function () {
  18270. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18271. t = _ref61.openid,
  18272. _ref61$callLoginByWei = _ref61.callLoginByWeixin,
  18273. n = _ref61$callLoginByWei === void 0 ? !1 : _ref61$callLoginByWei;
  18274. return Ks.call(e, {
  18275. openid: t,
  18276. callLoginByWeixin: n
  18277. });
  18278. };
  18279. }
  18280. function $s(e) {
  18281. !function (e) {
  18282. ue = e;
  18283. }(e);
  18284. }
  18285. function Bs(e) {
  18286. var t = {
  18287. getSystemInfo: uni.getSystemInfo,
  18288. getPushClientId: uni.getPushClientId
  18289. };
  18290. return function (n) {
  18291. return new Promise(function (s, r) {
  18292. t[e](_objectSpread(_objectSpread({}, n), {}, {
  18293. success: function success(e) {
  18294. s(e);
  18295. },
  18296. fail: function fail(e) {
  18297. r(e);
  18298. }
  18299. }));
  18300. });
  18301. };
  18302. }
  18303. var Ws = /*#__PURE__*/function (_ref62) {
  18304. (0, _inherits2.default)(Ws, _ref62);
  18305. var _super11 = _createSuper(Ws);
  18306. function Ws() {
  18307. var _this23;
  18308. (0, _classCallCheck2.default)(this, Ws);
  18309. _this23 = _super11.call(this), _this23._uniPushMessageCallback = _this23._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this23)), _this23._currentMessageId = -1, _this23._payloadQueue = [];
  18310. return _this23;
  18311. }
  18312. (0, _createClass2.default)(Ws, [{
  18313. key: "init",
  18314. value: function init() {
  18315. var _this24 = this;
  18316. return Promise.all([Bs("getSystemInfo")(), Bs("getPushClientId")()]).then(function () {
  18317. var _ref63 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  18318. _ref64 = (0, _slicedToArray2.default)(_ref63, 2),
  18319. _ref64$ = _ref64[0];
  18320. _ref64$ = _ref64$ === void 0 ? {} : _ref64$;
  18321. var e = _ref64$.appId,
  18322. _ref64$2 = _ref64[1];
  18323. _ref64$2 = _ref64$2 === void 0 ? {} : _ref64$2;
  18324. var t = _ref64$2.cid;
  18325. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  18326. if (!t) throw new Error("Invalid push client id");
  18327. _this24._appId = e, _this24._pushClientId = t, _this24._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this24.emit("open"), _this24._initMessageListener();
  18328. }, function (e) {
  18329. throw _this24.emit("error", e), _this24.close(), e;
  18330. });
  18331. }
  18332. }, {
  18333. key: "open",
  18334. value: function () {
  18335. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
  18336. return _regenerator.default.wrap(function _callee58$(_context58) {
  18337. while (1) {
  18338. switch (_context58.prev = _context58.next) {
  18339. case 0:
  18340. return _context58.abrupt("return", this.init());
  18341. case 1:
  18342. case "end":
  18343. return _context58.stop();
  18344. }
  18345. }
  18346. }, _callee58, this);
  18347. }));
  18348. function open() {
  18349. return _open.apply(this, arguments);
  18350. }
  18351. return open;
  18352. }()
  18353. }, {
  18354. key: "_isUniCloudSSE",
  18355. value: function _isUniCloudSSE(e) {
  18356. if ("receive" !== e.type) return !1;
  18357. var t = e && e.data && e.data.payload;
  18358. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  18359. }
  18360. }, {
  18361. key: "_receivePushMessage",
  18362. value: function _receivePushMessage(e) {
  18363. if (!this._isUniCloudSSE(e)) return;
  18364. var t = e && e.data && e.data.payload,
  18365. n = t.action,
  18366. s = t.messageId,
  18367. r = t.message;
  18368. this._payloadQueue.push({
  18369. action: n,
  18370. messageId: s,
  18371. message: r
  18372. }), this._consumMessage();
  18373. }
  18374. }, {
  18375. key: "_consumMessage",
  18376. value: function _consumMessage() {
  18377. var _this25 = this;
  18378. for (;;) {
  18379. var _e27 = this._payloadQueue.find(function (e) {
  18380. return e.messageId === _this25._currentMessageId + 1;
  18381. });
  18382. if (!_e27) break;
  18383. this._currentMessageId++, this._parseMessagePayload(_e27);
  18384. }
  18385. }
  18386. }, {
  18387. key: "_parseMessagePayload",
  18388. value: function _parseMessagePayload(e) {
  18389. var t = e.action,
  18390. n = e.messageId,
  18391. s = e.message;
  18392. "end" === t ? this._end({
  18393. messageId: n,
  18394. message: s
  18395. }) : "message" === t && this._appendMessage({
  18396. messageId: n,
  18397. message: s
  18398. });
  18399. }
  18400. }, {
  18401. key: "_appendMessage",
  18402. value: function _appendMessage() {
  18403. var _ref65 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18404. e = _ref65.messageId,
  18405. t = _ref65.message;
  18406. this.emit("message", t);
  18407. }
  18408. }, {
  18409. key: "_end",
  18410. value: function _end() {
  18411. var _ref66 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18412. e = _ref66.messageId,
  18413. t = _ref66.message;
  18414. this.emit("end", t), this.close();
  18415. }
  18416. }, {
  18417. key: "_initMessageListener",
  18418. value: function _initMessageListener() {
  18419. uni.onPushMessage(this._uniPushMessageCallback);
  18420. }
  18421. }, {
  18422. key: "_destroy",
  18423. value: function _destroy() {
  18424. uni.offPushMessage(this._uniPushMessageCallback);
  18425. }
  18426. }, {
  18427. key: "toJSON",
  18428. value: function toJSON() {
  18429. return {
  18430. appId: this._appId,
  18431. pushClientId: this._pushClientId,
  18432. seqId: this._seqId
  18433. };
  18434. }
  18435. }, {
  18436. key: "close",
  18437. value: function close() {
  18438. this._destroy(), this.emit("close");
  18439. }
  18440. }]);
  18441. return Ws;
  18442. }( /*#__PURE__*/function () {
  18443. function _class6() {
  18444. (0, _classCallCheck2.default)(this, _class6);
  18445. this._callback = {};
  18446. }
  18447. (0, _createClass2.default)(_class6, [{
  18448. key: "addListener",
  18449. value: function addListener(e, t) {
  18450. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  18451. }
  18452. }, {
  18453. key: "on",
  18454. value: function on(e, t) {
  18455. return this.addListener(e, t);
  18456. }
  18457. }, {
  18458. key: "removeListener",
  18459. value: function removeListener(e, t) {
  18460. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  18461. var n = this._callback[e];
  18462. if (!n) return;
  18463. var s = function (e, t) {
  18464. for (var _n17 = e.length - 1; _n17 >= 0; _n17--) {
  18465. if (e[_n17] === t) return _n17;
  18466. }
  18467. return -1;
  18468. }(n, t);
  18469. n.splice(s, 1);
  18470. }
  18471. }, {
  18472. key: "off",
  18473. value: function off(e, t) {
  18474. return this.removeListener(e, t);
  18475. }
  18476. }, {
  18477. key: "removeAllListener",
  18478. value: function removeAllListener(e) {
  18479. delete this._callback[e];
  18480. }
  18481. }, {
  18482. key: "emit",
  18483. value: function emit(e) {
  18484. var n = this._callback[e];
  18485. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  18486. t[_key4 - 1] = arguments[_key4];
  18487. }
  18488. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  18489. n[_e28].apply(n, t);
  18490. }
  18491. }
  18492. }]);
  18493. return _class6;
  18494. }());
  18495. function Hs(_x47) {
  18496. return _Hs.apply(this, arguments);
  18497. }
  18498. function _Hs() {
  18499. _Hs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64(e) {
  18500. var _ae2, _e32, _t22, t, _t$debugInfo, n, s, _yield$kt2, r, i, o;
  18501. return _regenerator.default.wrap(function _callee64$(_context64) {
  18502. while (1) {
  18503. switch (_context64.prev = _context64.next) {
  18504. case 0:
  18505. if (S) {
  18506. _context64.next = 2;
  18507. break;
  18508. }
  18509. return _context64.abrupt("return", Promise.resolve());
  18510. case 2:
  18511. if ("app" === C) {
  18512. _ae2 = ae(), _e32 = _ae2.osName, _t22 = _ae2.osVersion;
  18513. "ios" === _e32 && function (e) {
  18514. if (!e || "string" != typeof e) return 0;
  18515. var t = e.match(/^(\d+)./);
  18516. return t && t[1] ? parseInt(t[1]) : 0;
  18517. }(_t22) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  18518. }
  18519. t = e.__dev__;
  18520. if (t.debugInfo) {
  18521. _context64.next = 6;
  18522. break;
  18523. }
  18524. return _context64.abrupt("return");
  18525. case 6:
  18526. _t$debugInfo = t.debugInfo;
  18527. n = _t$debugInfo.address;
  18528. s = _t$debugInfo.servePort;
  18529. _context64.next = 11;
  18530. return kt(n, s);
  18531. case 11:
  18532. _yield$kt2 = _context64.sent;
  18533. r = _yield$kt2.address;
  18534. if (!r) {
  18535. _context64.next = 15;
  18536. break;
  18537. }
  18538. return _context64.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  18539. case 15:
  18540. i = console["app" === C ? "error" : "warn"];
  18541. o = "";
  18542. if (!("remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, o = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === C && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === C.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  18543. _context64.next = 19;
  18544. break;
  18545. }
  18546. throw new Error(o);
  18547. case 19:
  18548. i(o);
  18549. case 20:
  18550. case "end":
  18551. return _context64.stop();
  18552. }
  18553. }
  18554. }, _callee64);
  18555. }));
  18556. return _Hs.apply(this, arguments);
  18557. }
  18558. function Js(e) {
  18559. e._initPromiseHub || (e._initPromiseHub = new v({
  18560. createPromise: function createPromise() {
  18561. var t = Promise.resolve();
  18562. var n;
  18563. n = 1, t = new Promise(function (e) {
  18564. setTimeout(function () {
  18565. e();
  18566. }, n);
  18567. });
  18568. var s = e.auth();
  18569. return t.then(function () {
  18570. return s.getLoginState();
  18571. }).then(function (e) {
  18572. return e ? Promise.resolve() : s.signInAnonymously();
  18573. });
  18574. }
  18575. }));
  18576. }
  18577. var zs = {
  18578. tcb: St,
  18579. tencent: St,
  18580. aliyun: pe,
  18581. private: Pt,
  18582. dcloud: Pt,
  18583. alipay: qt
  18584. };
  18585. var Vs = new ( /*#__PURE__*/function () {
  18586. function _class7() {
  18587. (0, _classCallCheck2.default)(this, _class7);
  18588. }
  18589. (0, _createClass2.default)(_class7, [{
  18590. key: "init",
  18591. value: function init(e) {
  18592. var t = {};
  18593. var n = zs[e.provider];
  18594. if (!n) throw new Error("未提供正确的provider参数");
  18595. t = n.init(e), S && function (e) {
  18596. if (!S) return;
  18597. var t = {};
  18598. e.__dev__ = t, t.debugLog = S && ("web" === C && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === C);
  18599. var n = P;
  18600. n && !n.code && (t.debugInfo = n);
  18601. var s = new v({
  18602. createPromise: function createPromise() {
  18603. return Hs(e);
  18604. }
  18605. });
  18606. t.initLocalNetwork = function () {
  18607. return s.exec();
  18608. };
  18609. }(t), Js(t), Hn(t), function (e) {
  18610. var t = e.uploadFile;
  18611. e.uploadFile = function (e) {
  18612. return t.call(this, e);
  18613. };
  18614. }(t), function (e) {
  18615. e.database = function (t) {
  18616. if (t && Object.keys(t).length > 0) return e.init(t).database();
  18617. if (this._database) return this._database;
  18618. var n = ns(ss, {
  18619. uniClient: e
  18620. });
  18621. return this._database = n, n;
  18622. }, e.databaseForJQL = function (t) {
  18623. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  18624. if (this._databaseForJQL) return this._databaseForJQL;
  18625. var n = ns(ss, {
  18626. uniClient: e,
  18627. isJQL: !0
  18628. });
  18629. return this._databaseForJQL = n, n;
  18630. };
  18631. }(t), function (e) {
  18632. e.getCurrentUserInfo = Ls, e.chooseAndUploadFile = Us.initChooseAndUploadFile(e), Object.assign(e, {
  18633. get mixinDatacom() {
  18634. return Ds(e);
  18635. }
  18636. }), e.SSEChannel = Ws, e.initSecureNetworkByWeixin = js(e), e.setCustomClientInfo = $s, e.importObject = qs(e);
  18637. }(t);
  18638. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  18639. if (!t[e]) return;
  18640. var n = t[e];
  18641. t[e] = function () {
  18642. return n.apply(t, Array.from(arguments));
  18643. }, t[e] = function (e, t) {
  18644. return function (n) {
  18645. var _this26 = this;
  18646. var s = !1;
  18647. if ("callFunction" === t) {
  18648. var _e29 = n && n.type || c;
  18649. s = _e29 !== c;
  18650. }
  18651. var r = "callFunction" === t && !s,
  18652. i = this._initPromiseHub.exec();
  18653. n = n || {};
  18654. var _ee2 = ee(n),
  18655. o = _ee2.success,
  18656. a = _ee2.fail,
  18657. u = _ee2.complete,
  18658. l = i.then(function () {
  18659. return s ? Promise.resolve() : q(M(t, "invoke"), n);
  18660. }).then(function () {
  18661. return e.call(_this26, n);
  18662. }).then(function (e) {
  18663. return s ? Promise.resolve(e) : q(M(t, "success"), e).then(function () {
  18664. return q(M(t, "complete"), e);
  18665. }).then(function () {
  18666. return r && Y(j, {
  18667. type: H,
  18668. content: e
  18669. }), Promise.resolve(e);
  18670. });
  18671. }, function (e) {
  18672. return s ? Promise.reject(e) : q(M(t, "fail"), e).then(function () {
  18673. return q(M(t, "complete"), e);
  18674. }).then(function () {
  18675. return Y(j, {
  18676. type: H,
  18677. content: e
  18678. }), Promise.reject(e);
  18679. });
  18680. });
  18681. if (!(o || a || u)) return l;
  18682. l.then(function (e) {
  18683. o && o(e), u && u(e), r && Y(j, {
  18684. type: H,
  18685. content: e
  18686. });
  18687. }, function (e) {
  18688. a && a(e), u && u(e), r && Y(j, {
  18689. type: H,
  18690. content: e
  18691. });
  18692. });
  18693. };
  18694. }(t[e], e).bind(t);
  18695. }), t.init = this.init, t;
  18696. }
  18697. }]);
  18698. return _class7;
  18699. }())();
  18700. (function () {
  18701. var e = T;
  18702. var t = {};
  18703. if (e && 1 === e.length) t = e[0], Vs = Vs.init(t), Vs._isDefault = !0;else {
  18704. var _t21 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  18705. var _n18;
  18706. _n18 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t21.forEach(function (e) {
  18707. Vs[e] = function () {
  18708. return console.error(_n18), Promise.reject(new te({
  18709. code: "SYS_ERR",
  18710. message: _n18
  18711. }));
  18712. };
  18713. });
  18714. }
  18715. Object.assign(Vs, {
  18716. get mixinDatacom() {
  18717. return Ds(Vs);
  18718. }
  18719. }), Ts(Vs), Vs.addInterceptor = N, Vs.removeInterceptor = D, Vs.interceptObject = F, S && "web" === C && (window.uniCloud = Vs);
  18720. })();
  18721. var Gs = Vs;
  18722. exports.default = Gs;
  18723. /* 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"]))
  18724. /***/ }),
  18725. /***/ 253:
  18726. /*!****************************************************************!*\
  18727. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  18728. \****************************************************************/
  18729. /*! no static exports found */
  18730. /***/ (function(module, exports, __webpack_require__) {
  18731. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 215);
  18732. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  18733. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 254);
  18734. var construct = __webpack_require__(/*! ./construct.js */ 15);
  18735. function _wrapNativeSuper(Class) {
  18736. var _cache = typeof Map === "function" ? new Map() : undefined;
  18737. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  18738. if (Class === null || !isNativeFunction(Class)) return Class;
  18739. if (typeof Class !== "function") {
  18740. throw new TypeError("Super expression must either be null or a function");
  18741. }
  18742. if (typeof _cache !== "undefined") {
  18743. if (_cache.has(Class)) return _cache.get(Class);
  18744. _cache.set(Class, Wrapper);
  18745. }
  18746. function Wrapper() {
  18747. return construct(Class, arguments, getPrototypeOf(this).constructor);
  18748. }
  18749. Wrapper.prototype = Object.create(Class.prototype, {
  18750. constructor: {
  18751. value: Wrapper,
  18752. enumerable: false,
  18753. writable: true,
  18754. configurable: true
  18755. }
  18756. });
  18757. return setPrototypeOf(Wrapper, Class);
  18758. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18759. return _wrapNativeSuper(Class);
  18760. }
  18761. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18762. /***/ }),
  18763. /***/ 254:
  18764. /*!*****************************************************************!*\
  18765. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  18766. \*****************************************************************/
  18767. /*! no static exports found */
  18768. /***/ (function(module, exports) {
  18769. function _isNativeFunction(fn) {
  18770. try {
  18771. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  18772. } catch (e) {
  18773. return typeof fn === "function";
  18774. }
  18775. }
  18776. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18777. /***/ }),
  18778. /***/ 255:
  18779. /*!***************************************************************************************!*\
  18780. !*** D:/A_GraduationDesign/errand/errand_app/pages.json?{"type":"origin-pages-json"} ***!
  18781. \***************************************************************************************/
  18782. /*! no static exports found */
  18783. /***/ (function(module, exports, __webpack_require__) {
  18784. "use strict";
  18785. Object.defineProperty(exports, "__esModule", {
  18786. value: true
  18787. });
  18788. exports.default = void 0;
  18789. var _default = {
  18790. "pages": [{
  18791. "path": "pages/index/index",
  18792. "style": {
  18793. "navigationBarTitleText": "校园综合服务平台"
  18794. }
  18795. }, {
  18796. "path": "pages/orders/orders",
  18797. "style": {
  18798. "navigationBarTitleText": "订 单",
  18799. "enablePullDownRefresh": false
  18800. }
  18801. }, {
  18802. "path": "pages/me/me",
  18803. "style": {
  18804. "navigationBarTitleText": "我 的",
  18805. "enablePullDownRefresh": false
  18806. }
  18807. }, {
  18808. "path": "pages/login/login",
  18809. "style": {
  18810. "navigationBarTitleText": "登 录"
  18811. }
  18812. }, {
  18813. "path": "pages/register/register",
  18814. "style": {
  18815. "navigationBarTitleText": "注 册"
  18816. }
  18817. }, {
  18818. "path": "pages/preOrder/preOrder",
  18819. "style": {
  18820. "navigationBarTitleText": "下单"
  18821. }
  18822. }, {
  18823. "path": "pages/address/address",
  18824. "style": {
  18825. "navigationBarTitleText": "我的地址"
  18826. }
  18827. }, {
  18828. "path": "pages/detail/detail",
  18829. "style": {
  18830. "navigationBarTitleText": "订单详情"
  18831. }
  18832. }, {
  18833. "path": "pages/introduce/introduce",
  18834. "style": {
  18835. "navigationBarTitleText": "平台介绍"
  18836. }
  18837. }, {
  18838. "path": "pages/agreement/agreement",
  18839. "style": {
  18840. "navigationBarTitleText": "用户协议"
  18841. }
  18842. }, {
  18843. "path": "pages/person/person",
  18844. "style": {
  18845. "navigationBarTitleText": "个人介绍"
  18846. }
  18847. }, {
  18848. "path": "pages/certification/certification",
  18849. "style": {
  18850. "navigationBarTitleText": "骑手认证"
  18851. }
  18852. }, {
  18853. "path": "pages/acceptOrders/acceptOrders",
  18854. "style": {
  18855. "navigationBarTitleText": "骑手订单"
  18856. }
  18857. }, {
  18858. "path": "pages/records/records",
  18859. "style": {
  18860. "navigationBarTitleText": "收支明细"
  18861. }
  18862. }, {
  18863. "path": "pages/wallet/wallet",
  18864. "style": {
  18865. "navigationBarTitleText": "钱 包"
  18866. }
  18867. }, {
  18868. "path": "pages/charge/charge",
  18869. "style": {
  18870. "navigationBarTitleText": "充 值"
  18871. }
  18872. }, {
  18873. "path": "pages/comment/comment",
  18874. "style": {
  18875. "navigationBarTitleText": "订单评价"
  18876. }
  18877. }, {
  18878. "path": "pages/myComment/myComment",
  18879. "style": {
  18880. "navigationBarTitleText": "评价中心"
  18881. }
  18882. }],
  18883. "globalStyle": {
  18884. "navigationBarTextStyle": "white",
  18885. "navigationBarTitleText": "校园综合服务平台",
  18886. "navigationBarBackgroundColor": "#006eff",
  18887. "backgroundColor": "#F8F8F8"
  18888. },
  18889. "tabBar": {
  18890. "backgroundColor": "#fff",
  18891. "selectedColor": "#006eff",
  18892. "color": "#666",
  18893. "list": [{
  18894. "iconPath": "/static/icons/home.png",
  18895. "selectedIconPath": "static/icons/home-active.png",
  18896. "text": "首页",
  18897. "pagePath": "pages/index/index"
  18898. }, {
  18899. "iconPath": "/static/icons/orders.png",
  18900. "selectedIconPath": "static/icons/orders-active.png",
  18901. "text": "订单",
  18902. "pagePath": "pages/orders/orders"
  18903. }, {
  18904. "iconPath": "/static/icons/me.png",
  18905. "selectedIconPath": "static/icons/me-active.png",
  18906. "text": "我的",
  18907. "pagePath": "pages/me/me"
  18908. }]
  18909. },
  18910. "uniIdRouter": {}
  18911. };
  18912. exports.default = _default;
  18913. /***/ }),
  18914. /***/ 256:
  18915. /*!**************************************************************************!*\
  18916. !*** D:/A_GraduationDesign/errand/errand_app/pages.json?{"type":"stat"} ***!
  18917. \**************************************************************************/
  18918. /*! no static exports found */
  18919. /***/ (function(module, exports, __webpack_require__) {
  18920. "use strict";
  18921. Object.defineProperty(exports, "__esModule", {
  18922. value: true
  18923. });
  18924. exports.default = void 0;
  18925. var _default = {
  18926. "appid": "__UNI__DBC0602"
  18927. };
  18928. exports.default = _default;
  18929. /***/ }),
  18930. /***/ 26:
  18931. /*!**********************************************************!*\
  18932. !*** D:/A_GraduationDesign/errand/errand_app/pages.json ***!
  18933. \**********************************************************/
  18934. /*! no static exports found */
  18935. /***/ (function(module, exports) {
  18936. /***/ }),
  18937. /***/ 264:
  18938. /*!********************************************************************************************************************************!*\
  18939. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  18940. \********************************************************************************************************************************/
  18941. /*! no static exports found */
  18942. /***/ (function(module, exports, __webpack_require__) {
  18943. "use strict";
  18944. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  18945. Object.defineProperty(exports, "__esModule", {
  18946. value: true
  18947. });
  18948. exports.chooseAndUploadFile = chooseAndUploadFile;
  18949. exports.uploadCloudFiles = uploadCloudFiles;
  18950. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  18951. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  18952. function chooseImage(opts) {
  18953. var count = opts.count,
  18954. _opts$sizeType = opts.sizeType,
  18955. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  18956. sourceType = opts.sourceType,
  18957. extension = opts.extension;
  18958. return new Promise(function (resolve, reject) {
  18959. uni.chooseImage({
  18960. count: count,
  18961. sizeType: sizeType,
  18962. sourceType: sourceType,
  18963. extension: extension,
  18964. success: function success(res) {
  18965. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  18966. },
  18967. fail: function fail(res) {
  18968. reject({
  18969. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  18970. });
  18971. }
  18972. });
  18973. });
  18974. }
  18975. function chooseVideo(opts) {
  18976. var camera = opts.camera,
  18977. compressed = opts.compressed,
  18978. maxDuration = opts.maxDuration,
  18979. sourceType = opts.sourceType,
  18980. extension = opts.extension;
  18981. return new Promise(function (resolve, reject) {
  18982. uni.chooseVideo({
  18983. camera: camera,
  18984. compressed: compressed,
  18985. maxDuration: maxDuration,
  18986. sourceType: sourceType,
  18987. extension: extension,
  18988. success: function success(res) {
  18989. var tempFilePath = res.tempFilePath,
  18990. duration = res.duration,
  18991. size = res.size,
  18992. height = res.height,
  18993. width = res.width;
  18994. resolve(normalizeChooseAndUploadFileRes({
  18995. errMsg: 'chooseVideo:ok',
  18996. tempFilePaths: [tempFilePath],
  18997. tempFiles: [{
  18998. name: res.tempFile && res.tempFile.name || '',
  18999. path: tempFilePath,
  19000. size: size,
  19001. type: res.tempFile && res.tempFile.type || '',
  19002. width: width,
  19003. height: height,
  19004. duration: duration,
  19005. fileType: 'video',
  19006. cloudPath: ''
  19007. }]
  19008. }, 'video'));
  19009. },
  19010. fail: function fail(res) {
  19011. reject({
  19012. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  19013. });
  19014. }
  19015. });
  19016. });
  19017. }
  19018. function chooseAll(opts) {
  19019. var count = opts.count,
  19020. extension = opts.extension;
  19021. return new Promise(function (resolve, reject) {
  19022. var chooseFile = uni.chooseFile;
  19023. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  19024. chooseFile = wx.chooseMessageFile;
  19025. }
  19026. if (typeof chooseFile !== 'function') {
  19027. return reject({
  19028. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  19029. });
  19030. }
  19031. chooseFile({
  19032. type: 'all',
  19033. count: count,
  19034. extension: extension,
  19035. success: function success(res) {
  19036. resolve(normalizeChooseAndUploadFileRes(res));
  19037. },
  19038. fail: function fail(res) {
  19039. reject({
  19040. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  19041. });
  19042. }
  19043. });
  19044. });
  19045. }
  19046. function normalizeChooseAndUploadFileRes(res, fileType) {
  19047. res.tempFiles.forEach(function (item, index) {
  19048. if (!item.name) {
  19049. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  19050. }
  19051. if (fileType) {
  19052. item.fileType = fileType;
  19053. }
  19054. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  19055. });
  19056. if (!res.tempFilePaths) {
  19057. res.tempFilePaths = res.tempFiles.map(function (file) {
  19058. return file.path;
  19059. });
  19060. }
  19061. return res;
  19062. }
  19063. function uploadCloudFiles(files) {
  19064. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  19065. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  19066. files = JSON.parse(JSON.stringify(files));
  19067. var len = files.length;
  19068. var count = 0;
  19069. var self = this;
  19070. return new Promise(function (resolve) {
  19071. while (count < max) {
  19072. next();
  19073. }
  19074. function next() {
  19075. var cur = count++;
  19076. if (cur >= len) {
  19077. !files.find(function (item) {
  19078. return !item.url && !item.errMsg;
  19079. }) && resolve(files);
  19080. return;
  19081. }
  19082. var fileItem = files[cur];
  19083. var index = self.files.findIndex(function (v) {
  19084. return v.uuid === fileItem.uuid;
  19085. });
  19086. fileItem.url = '';
  19087. delete fileItem.errMsg;
  19088. uniCloud.uploadFile({
  19089. filePath: fileItem.path,
  19090. cloudPath: fileItem.cloudPath,
  19091. fileType: fileItem.fileType,
  19092. onUploadProgress: function onUploadProgress(res) {
  19093. res.index = index;
  19094. _onUploadProgress && _onUploadProgress(res);
  19095. }
  19096. }).then(function (res) {
  19097. fileItem.url = res.fileID;
  19098. fileItem.index = index;
  19099. if (cur < len) {
  19100. next();
  19101. }
  19102. }).catch(function (res) {
  19103. fileItem.errMsg = res.errMsg || res.message;
  19104. fileItem.index = index;
  19105. if (cur < len) {
  19106. next();
  19107. }
  19108. });
  19109. }
  19110. });
  19111. }
  19112. function uploadFiles(choosePromise, _ref) {
  19113. var onChooseFile = _ref.onChooseFile,
  19114. onUploadProgress = _ref.onUploadProgress;
  19115. return choosePromise.then(function (res) {
  19116. if (onChooseFile) {
  19117. var customChooseRes = onChooseFile(res);
  19118. if (typeof customChooseRes !== 'undefined') {
  19119. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  19120. return typeof chooseRes === 'undefined' ? res : chooseRes;
  19121. });
  19122. }
  19123. }
  19124. return res;
  19125. }).then(function (res) {
  19126. if (res === false) {
  19127. return {
  19128. errMsg: ERR_MSG_OK,
  19129. tempFilePaths: [],
  19130. tempFiles: []
  19131. };
  19132. }
  19133. return res;
  19134. });
  19135. }
  19136. function chooseAndUploadFile() {
  19137. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  19138. type: 'all'
  19139. };
  19140. if (opts.type === 'image') {
  19141. return uploadFiles(chooseImage(opts), opts);
  19142. } else if (opts.type === 'video') {
  19143. return uploadFiles(chooseVideo(opts), opts);
  19144. }
  19145. return uploadFiles(chooseAll(opts), opts);
  19146. }
  19147. /* WEBPACK VAR INJECTION */}.call(this, __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"], __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 252)["default"]))
  19148. /***/ }),
  19149. /***/ 265:
  19150. /*!***************************************************************************************************************!*\
  19151. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  19152. \***************************************************************************************************************/
  19153. /*! no static exports found */
  19154. /***/ (function(module, exports, __webpack_require__) {
  19155. "use strict";
  19156. /* WEBPACK VAR INJECTION */(function(uni) {
  19157. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19158. Object.defineProperty(exports, "__esModule", {
  19159. value: true
  19160. });
  19161. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  19162. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  19163. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  19164. /**
  19165. * 获取文件名和后缀
  19166. * @param {String} name
  19167. */
  19168. var get_file_ext = function get_file_ext(name) {
  19169. var last_len = name.lastIndexOf('.');
  19170. var len = name.length;
  19171. return {
  19172. name: name.substring(0, last_len),
  19173. ext: name.substring(last_len + 1, len)
  19174. };
  19175. };
  19176. /**
  19177. * 获取扩展名
  19178. * @param {Array} fileExtname
  19179. */
  19180. exports.get_file_ext = get_file_ext;
  19181. var get_extname = function get_extname(fileExtname) {
  19182. if (!Array.isArray(fileExtname)) {
  19183. var extname = fileExtname.replace(/(\[|\])/g, '');
  19184. return extname.split(',');
  19185. } else {
  19186. return fileExtname;
  19187. }
  19188. return [];
  19189. };
  19190. /**
  19191. * 获取文件和检测是否可选
  19192. */
  19193. exports.get_extname = get_extname;
  19194. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  19195. var filePaths = [];
  19196. var files = [];
  19197. if (!_extname || _extname.length === 0) {
  19198. return {
  19199. filePaths: filePaths,
  19200. files: files
  19201. };
  19202. }
  19203. res.tempFiles.forEach(function (v) {
  19204. var fileFullName = get_file_ext(v.name);
  19205. var extname = fileFullName.ext.toLowerCase();
  19206. if (_extname.indexOf(extname) !== -1) {
  19207. files.push(v);
  19208. filePaths.push(v.path);
  19209. }
  19210. });
  19211. if (files.length !== res.tempFiles.length) {
  19212. uni.showToast({
  19213. title: "\u5F53\u524D\u9009\u62E9\u4E86".concat(res.tempFiles.length, "\u4E2A\u6587\u4EF6 \uFF0C").concat(res.tempFiles.length - files.length, " \u4E2A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E"),
  19214. icon: 'none',
  19215. duration: 5000
  19216. });
  19217. }
  19218. return {
  19219. filePaths: filePaths,
  19220. files: files
  19221. };
  19222. };
  19223. /**
  19224. * 获取图片信息
  19225. * @param {Object} filepath
  19226. */
  19227. exports.get_files_and_is_max = get_files_and_is_max;
  19228. var get_file_info = function get_file_info(filepath) {
  19229. return new Promise(function (resolve, reject) {
  19230. uni.getImageInfo({
  19231. src: filepath,
  19232. success: function success(res) {
  19233. resolve(res);
  19234. },
  19235. fail: function fail(err) {
  19236. reject(err);
  19237. }
  19238. });
  19239. });
  19240. };
  19241. /**
  19242. * 获取封装数据
  19243. */
  19244. exports.get_file_info = get_file_info;
  19245. var get_file_data = /*#__PURE__*/function () {
  19246. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  19247. var type,
  19248. fileFullName,
  19249. extname,
  19250. filedata,
  19251. imageinfo,
  19252. _args = arguments;
  19253. return _regenerator.default.wrap(function _callee$(_context) {
  19254. while (1) {
  19255. switch (_context.prev = _context.next) {
  19256. case 0:
  19257. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  19258. // 最终需要上传数据库的数据
  19259. fileFullName = get_file_ext(files.name);
  19260. extname = fileFullName.ext.toLowerCase();
  19261. filedata = {
  19262. name: files.name,
  19263. uuid: files.uuid,
  19264. extname: extname || '',
  19265. cloudPath: files.cloudPath,
  19266. fileType: files.fileType,
  19267. url: files.path || files.path,
  19268. size: files.size,
  19269. //单位是字节
  19270. image: {},
  19271. path: files.path,
  19272. video: {}
  19273. };
  19274. if (!(type === 'image')) {
  19275. _context.next = 14;
  19276. break;
  19277. }
  19278. _context.next = 7;
  19279. return get_file_info(files.path);
  19280. case 7:
  19281. imageinfo = _context.sent;
  19282. delete filedata.video;
  19283. filedata.image.width = imageinfo.width;
  19284. filedata.image.height = imageinfo.height;
  19285. filedata.image.location = imageinfo.path;
  19286. _context.next = 15;
  19287. break;
  19288. case 14:
  19289. delete filedata.image;
  19290. case 15:
  19291. return _context.abrupt("return", filedata);
  19292. case 16:
  19293. case "end":
  19294. return _context.stop();
  19295. }
  19296. }
  19297. }, _callee);
  19298. }));
  19299. return function get_file_data(_x) {
  19300. return _ref.apply(this, arguments);
  19301. };
  19302. }();
  19303. exports.get_file_data = get_file_data;
  19304. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19305. /***/ }),
  19306. /***/ 3:
  19307. /*!***********************************!*\
  19308. !*** (webpack)/buildin/global.js ***!
  19309. \***********************************/
  19310. /*! no static exports found */
  19311. /***/ (function(module, exports) {
  19312. var g;
  19313. // This works in non-strict mode
  19314. g = (function() {
  19315. return this;
  19316. })();
  19317. try {
  19318. // This works if eval is allowed (see CSP)
  19319. g = g || new Function("return this")();
  19320. } catch (e) {
  19321. // This works if the window reference is available
  19322. if (typeof window === "object") g = window;
  19323. }
  19324. // g can still be undefined, but nothing to do about it...
  19325. // We return undefined, instead of nothing here, so it's
  19326. // easier to handle this case. if(!global) { ...}
  19327. module.exports = g;
  19328. /***/ }),
  19329. /***/ 301:
  19330. /*!***********************************************************************************************************************!*\
  19331. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  19332. \***********************************************************************************************************************/
  19333. /*! no static exports found */
  19334. /***/ (function(module, exports, __webpack_require__) {
  19335. "use strict";
  19336. /* WEBPACK VAR INJECTION */(function(uni) {
  19337. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19338. Object.defineProperty(exports, "__esModule", {
  19339. value: true
  19340. });
  19341. exports.createAnimation = createAnimation;
  19342. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  19343. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  19344. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  19345. 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; }
  19346. 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; }
  19347. // const defaultOption = {
  19348. // duration: 300,
  19349. // timingFunction: 'linear',
  19350. // delay: 0,
  19351. // transformOrigin: '50% 50% 0'
  19352. // }
  19353. var MPAnimation = /*#__PURE__*/function () {
  19354. function MPAnimation(options, _this) {
  19355. (0, _classCallCheck2.default)(this, MPAnimation);
  19356. this.options = options;
  19357. // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
  19358. this.animation = uni.createAnimation(_objectSpread({}, options));
  19359. this.currentStepAnimates = {};
  19360. this.next = 0;
  19361. this.$ = _this;
  19362. }
  19363. (0, _createClass2.default)(MPAnimation, [{
  19364. key: "_nvuePushAnimates",
  19365. value: function _nvuePushAnimates(type, args) {
  19366. var aniObj = this.currentStepAnimates[this.next];
  19367. var styles = {};
  19368. if (!aniObj) {
  19369. styles = {
  19370. styles: {},
  19371. config: {}
  19372. };
  19373. } else {
  19374. styles = aniObj;
  19375. }
  19376. if (animateTypes1.includes(type)) {
  19377. if (!styles.styles.transform) {
  19378. styles.styles.transform = '';
  19379. }
  19380. var unit = '';
  19381. if (type === 'rotate') {
  19382. unit = 'deg';
  19383. }
  19384. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  19385. } else {
  19386. styles.styles[type] = "".concat(args);
  19387. }
  19388. this.currentStepAnimates[this.next] = styles;
  19389. }
  19390. }, {
  19391. key: "_animateRun",
  19392. value: function _animateRun() {
  19393. var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19394. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19395. var ref = this.$.$refs['ani'].ref;
  19396. if (!ref) return;
  19397. return new Promise(function (resolve, reject) {
  19398. nvueAnimation.transition(ref, _objectSpread({
  19399. styles: styles
  19400. }, config), function (res) {
  19401. resolve();
  19402. });
  19403. });
  19404. }
  19405. }, {
  19406. key: "_nvueNextAnimate",
  19407. value: function _nvueNextAnimate(animates) {
  19408. var _this2 = this;
  19409. var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  19410. var fn = arguments.length > 2 ? arguments[2] : undefined;
  19411. var obj = animates[step];
  19412. if (obj) {
  19413. var styles = obj.styles,
  19414. config = obj.config;
  19415. this._animateRun(styles, config).then(function () {
  19416. step += 1;
  19417. _this2._nvueNextAnimate(animates, step, fn);
  19418. });
  19419. } else {
  19420. this.currentStepAnimates = {};
  19421. typeof fn === 'function' && fn();
  19422. this.isEnd = true;
  19423. }
  19424. }
  19425. }, {
  19426. key: "step",
  19427. value: function step() {
  19428. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19429. this.animation.step(config);
  19430. return this;
  19431. }
  19432. }, {
  19433. key: "run",
  19434. value: function run(fn) {
  19435. this.$.animationData = this.animation.export();
  19436. this.$.timer = setTimeout(function () {
  19437. typeof fn === 'function' && fn();
  19438. }, this.$.durationTime);
  19439. }
  19440. }]);
  19441. return MPAnimation;
  19442. }();
  19443. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];
  19444. var animateTypes2 = ['opacity', 'backgroundColor'];
  19445. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  19446. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  19447. MPAnimation.prototype[type] = function () {
  19448. var _this$animation;
  19449. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  19450. return this;
  19451. };
  19452. });
  19453. function createAnimation(option, _this) {
  19454. if (!_this) return;
  19455. clearTimeout(_this.timer);
  19456. return new MPAnimation(option, _this);
  19457. }
  19458. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19459. /***/ }),
  19460. /***/ 32:
  19461. /*!**********************************************************************************************************!*\
  19462. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  19463. \**********************************************************************************************************/
  19464. /*! exports provided: default */
  19465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19466. "use strict";
  19467. __webpack_require__.r(__webpack_exports__);
  19468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  19469. /* globals __VUE_SSR_CONTEXT__ */
  19470. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  19471. // This module is a runtime utility for cleaner component module output and will
  19472. // be included in the final webpack user bundle.
  19473. function normalizeComponent (
  19474. scriptExports,
  19475. render,
  19476. staticRenderFns,
  19477. functionalTemplate,
  19478. injectStyles,
  19479. scopeId,
  19480. moduleIdentifier, /* server only */
  19481. shadowMode, /* vue-cli only */
  19482. components, // fixed by xxxxxx auto components
  19483. renderjs // fixed by xxxxxx renderjs
  19484. ) {
  19485. // Vue.extend constructor export interop
  19486. var options = typeof scriptExports === 'function'
  19487. ? scriptExports.options
  19488. : scriptExports
  19489. // fixed by xxxxxx auto components
  19490. if (components) {
  19491. if (!options.components) {
  19492. options.components = {}
  19493. }
  19494. var hasOwn = Object.prototype.hasOwnProperty
  19495. for (var name in components) {
  19496. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  19497. options.components[name] = components[name]
  19498. }
  19499. }
  19500. }
  19501. // fixed by xxxxxx renderjs
  19502. if (renderjs) {
  19503. if(typeof renderjs.beforeCreate === 'function'){
  19504. renderjs.beforeCreate = [renderjs.beforeCreate]
  19505. }
  19506. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  19507. this[renderjs.__module] = this
  19508. });
  19509. (options.mixins || (options.mixins = [])).push(renderjs)
  19510. }
  19511. // render functions
  19512. if (render) {
  19513. options.render = render
  19514. options.staticRenderFns = staticRenderFns
  19515. options._compiled = true
  19516. }
  19517. // functional template
  19518. if (functionalTemplate) {
  19519. options.functional = true
  19520. }
  19521. // scopedId
  19522. if (scopeId) {
  19523. options._scopeId = 'data-v-' + scopeId
  19524. }
  19525. var hook
  19526. if (moduleIdentifier) { // server build
  19527. hook = function (context) {
  19528. // 2.3 injection
  19529. context =
  19530. context || // cached call
  19531. (this.$vnode && this.$vnode.ssrContext) || // stateful
  19532. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  19533. // 2.2 with runInNewContext: true
  19534. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  19535. context = __VUE_SSR_CONTEXT__
  19536. }
  19537. // inject component styles
  19538. if (injectStyles) {
  19539. injectStyles.call(this, context)
  19540. }
  19541. // register component module identifier for async chunk inferrence
  19542. if (context && context._registeredComponents) {
  19543. context._registeredComponents.add(moduleIdentifier)
  19544. }
  19545. }
  19546. // used by ssr in case component is cached and beforeCreate
  19547. // never gets called
  19548. options._ssrRegister = hook
  19549. } else if (injectStyles) {
  19550. hook = shadowMode
  19551. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  19552. : injectStyles
  19553. }
  19554. if (hook) {
  19555. if (options.functional) {
  19556. // for template-only hot-reload because in that case the render fn doesn't
  19557. // go through the normalizer
  19558. options._injectStyles = hook
  19559. // register for functioal component in vue file
  19560. var originalRender = options.render
  19561. options.render = function renderWithStyleInjection (h, context) {
  19562. hook.call(context)
  19563. return originalRender(h, context)
  19564. }
  19565. } else {
  19566. // inject component registration as beforeCreate hook
  19567. var existing = options.beforeCreate
  19568. options.beforeCreate = existing
  19569. ? [].concat(existing, hook)
  19570. : [hook]
  19571. }
  19572. }
  19573. return {
  19574. exports: scriptExports,
  19575. options: options
  19576. }
  19577. }
  19578. /***/ }),
  19579. /***/ 321:
  19580. /*!****************************************************************************************************************!*\
  19581. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  19582. \****************************************************************************************************************/
  19583. /*! no static exports found */
  19584. /***/ (function(module, exports, __webpack_require__) {
  19585. "use strict";
  19586. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19587. Object.defineProperty(exports, "__esModule", {
  19588. value: true
  19589. });
  19590. exports.default = void 0;
  19591. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 322));
  19592. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 323));
  19593. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 324));
  19594. var _default = {
  19595. en: _en.default,
  19596. 'zh-Hans': _zhHans.default,
  19597. 'zh-Hant': _zhHant.default
  19598. };
  19599. exports.default = _default;
  19600. /***/ }),
  19601. /***/ 322:
  19602. /*!***************************************************************************************************************!*\
  19603. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  19604. \***************************************************************************************************************/
  19605. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19606. /***/ (function(module) {
  19607. 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\"}");
  19608. /***/ }),
  19609. /***/ 323:
  19610. /*!********************************************************************************************************************!*\
  19611. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  19612. \********************************************************************************************************************/
  19613. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19614. /***/ (function(module) {
  19615. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  19616. /***/ }),
  19617. /***/ 324:
  19618. /*!********************************************************************************************************************!*\
  19619. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  19620. \********************************************************************************************************************/
  19621. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19622. /***/ (function(module) {
  19623. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  19624. /***/ }),
  19625. /***/ 33:
  19626. /*!************************************************************************!*\
  19627. !*** D:/A_GraduationDesign/errand/errand_app/uni.promisify.adaptor.js ***!
  19628. \************************************************************************/
  19629. /*! no static exports found */
  19630. /***/ (function(module, exports, __webpack_require__) {
  19631. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  19632. uni.addInterceptor({
  19633. returnValue: function returnValue(res) {
  19634. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  19635. return res;
  19636. }
  19637. return new Promise(function (resolve, reject) {
  19638. res.then(function (res) {
  19639. return res[0] ? reject(res[0]) : resolve(res[1]);
  19640. });
  19641. });
  19642. }
  19643. });
  19644. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19645. /***/ }),
  19646. /***/ 34:
  19647. /*!*********************************************************************!*\
  19648. !*** D:/A_GraduationDesign/errand/errand_app/static/css/global.css ***!
  19649. \*********************************************************************/
  19650. /*! no static exports found */
  19651. /***/ (function(module, exports, __webpack_require__) {
  19652. // extracted by mini-css-extract-plugin
  19653. if(false) { var cssReload; }
  19654. /***/ }),
  19655. /***/ 35:
  19656. /*!****************************************************************!*\
  19657. !*** D:/A_GraduationDesign/errand/errand_app/utils/request.js ***!
  19658. \****************************************************************/
  19659. /*! no static exports found */
  19660. /***/ (function(module, exports, __webpack_require__) {
  19661. "use strict";
  19662. /* WEBPACK VAR INJECTION */(function(uni) {
  19663. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19664. Object.defineProperty(exports, "__esModule", {
  19665. value: true
  19666. });
  19667. exports.default = void 0;
  19668. var _config = _interopRequireDefault(__webpack_require__(/*! @/config.js */ 36));
  19669. var baseUrl = true ? _config.default.dev.baseUrl : undefined;
  19670. var request = function request() {
  19671. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19672. return new Promise(function (resolve, reject) {
  19673. var _uni$getStorageSync;
  19674. uni.request({
  19675. url: baseUrl + options.url || '',
  19676. method: options.method || 'GET',
  19677. data: options.data || {},
  19678. header: options.header || {
  19679. "Content-Type": "application/json",
  19680. token: (_uni$getStorageSync = uni.getStorageSync('xm-user')) === null || _uni$getStorageSync === void 0 ? void 0 : _uni$getStorageSync.token
  19681. }
  19682. }).then(function (res) {
  19683. var data = res.data;
  19684. if (data.code === '401') {
  19685. uni.navigateTo({
  19686. url: '/pages/login/login'
  19687. });
  19688. }
  19689. resolve(data);
  19690. }).catch(function (error) {
  19691. reject(error);
  19692. });
  19693. });
  19694. };
  19695. var get = function get(url, data) {
  19696. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19697. options.method = 'GET';
  19698. options.data = data;
  19699. options.url = url;
  19700. return request(options);
  19701. };
  19702. var post = function post(url, data) {
  19703. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19704. options.method = 'POST';
  19705. options.data = data;
  19706. options.url = url;
  19707. return request(options);
  19708. };
  19709. var put = function put(url, data) {
  19710. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19711. options.method = 'PUT';
  19712. options.data = data;
  19713. options.url = url;
  19714. return request(options);
  19715. };
  19716. var del = function del(url, data) {
  19717. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19718. options.method = 'DELETE';
  19719. options.data = data;
  19720. options.url = url;
  19721. return request(options);
  19722. };
  19723. var _default = {
  19724. request: request,
  19725. get: get,
  19726. post: post,
  19727. put: put,
  19728. del: del
  19729. };
  19730. exports.default = _default;
  19731. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19732. /***/ }),
  19733. /***/ 36:
  19734. /*!*********************************************************!*\
  19735. !*** D:/A_GraduationDesign/errand/errand_app/config.js ***!
  19736. \*********************************************************/
  19737. /*! no static exports found */
  19738. /***/ (function(module, exports, __webpack_require__) {
  19739. "use strict";
  19740. Object.defineProperty(exports, "__esModule", {
  19741. value: true
  19742. });
  19743. exports.default = void 0;
  19744. var apiConfig = {
  19745. dev: {
  19746. baseUrl: 'http://localhost:9090'
  19747. },
  19748. prod: {
  19749. baseUrl: 'http://:9090'
  19750. }
  19751. };
  19752. var _default = apiConfig;
  19753. exports.default = _default;
  19754. /***/ }),
  19755. /***/ 4:
  19756. /*!**********************************************************************!*\
  19757. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  19758. \**********************************************************************/
  19759. /*! no static exports found */
  19760. /***/ (function(module, exports) {
  19761. function _interopRequireDefault(obj) {
  19762. return obj && obj.__esModule ? obj : {
  19763. "default": obj
  19764. };
  19765. }
  19766. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19767. /***/ }),
  19768. /***/ 43:
  19769. /*!***********************************************************************!*\
  19770. !*** D:/A_GraduationDesign/errand/errand_app/static/imgs/banner1.png ***!
  19771. \***********************************************************************/
  19772. /*! no static exports found */
  19773. /***/ (function(module, exports, __webpack_require__) {
  19774. module.exports = __webpack_require__.p + "static/imgs/banner1.png";
  19775. /***/ }),
  19776. /***/ 44:
  19777. /*!***********************************************************************!*\
  19778. !*** D:/A_GraduationDesign/errand/errand_app/static/imgs/banner2.png ***!
  19779. \***********************************************************************/
  19780. /*! no static exports found */
  19781. /***/ (function(module, exports, __webpack_require__) {
  19782. module.exports = __webpack_require__.p + "static/imgs/banner2.png";
  19783. /***/ }),
  19784. /***/ 5:
  19785. /*!**************************************************************!*\
  19786. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  19787. \**************************************************************/
  19788. /*! no static exports found */
  19789. /***/ (function(module, exports, __webpack_require__) {
  19790. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  19791. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  19792. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  19793. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  19794. function _slicedToArray(arr, i) {
  19795. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  19796. }
  19797. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19798. /***/ }),
  19799. /***/ 6:
  19800. /*!***************************************************************!*\
  19801. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  19802. \***************************************************************/
  19803. /*! no static exports found */
  19804. /***/ (function(module, exports) {
  19805. function _arrayWithHoles(arr) {
  19806. if (Array.isArray(arr)) return arr;
  19807. }
  19808. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19809. /***/ }),
  19810. /***/ 7:
  19811. /*!*********************************************************************!*\
  19812. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  19813. \*********************************************************************/
  19814. /*! no static exports found */
  19815. /***/ (function(module, exports) {
  19816. function _iterableToArrayLimit(r, l) {
  19817. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  19818. if (null != t) {
  19819. var e,
  19820. n,
  19821. i,
  19822. u,
  19823. a = [],
  19824. f = !0,
  19825. o = !1;
  19826. try {
  19827. if (i = (t = t.call(r)).next, 0 === l) {
  19828. if (Object(t) !== t) return;
  19829. f = !1;
  19830. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
  19831. ;
  19832. }
  19833. } catch (r) {
  19834. o = !0, n = r;
  19835. } finally {
  19836. try {
  19837. if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
  19838. } finally {
  19839. if (o) throw n;
  19840. }
  19841. }
  19842. return a;
  19843. }
  19844. }
  19845. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19846. /***/ }),
  19847. /***/ 8:
  19848. /*!***************************************************************************!*\
  19849. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  19850. \***************************************************************************/
  19851. /*! no static exports found */
  19852. /***/ (function(module, exports, __webpack_require__) {
  19853. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  19854. function _unsupportedIterableToArray(o, minLen) {
  19855. if (!o) return;
  19856. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  19857. var n = Object.prototype.toString.call(o).slice(8, -1);
  19858. if (n === "Object" && o.constructor) n = o.constructor.name;
  19859. if (n === "Map" || n === "Set") return Array.from(o);
  19860. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  19861. }
  19862. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19863. /***/ }),
  19864. /***/ 9:
  19865. /*!*****************************************************************!*\
  19866. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  19867. \*****************************************************************/
  19868. /*! no static exports found */
  19869. /***/ (function(module, exports) {
  19870. function _arrayLikeToArray(arr, len) {
  19871. if (len == null || len > arr.length) len = arr.length;
  19872. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  19873. arr2[i] = arr[i];
  19874. }
  19875. return arr2;
  19876. }
  19877. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19878. /***/ })
  19879. }]);
  19880. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map