vendor.js 628 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  15. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  16. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  17. return this;
  18. }();
  19. var key = ['w', 'x'].join('');
  20. var oldWx = target[key];
  21. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  22. function isWxKey(key) {
  23. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  24. return false;
  25. }
  26. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  27. }
  28. function initWx() {
  29. var newWx = {};
  30. for (var _key in oldWx) {
  31. if (isWxKey(_key)) {
  32. // TODO wrapper function
  33. newWx[_key] = oldWx[_key];
  34. }
  35. }
  36. return newWx;
  37. }
  38. target[key] = initWx();
  39. var _default = target[key];
  40. exports.default = _default;
  41. /***/ }),
  42. /* 2 */
  43. /*!************************************************************!*\
  44. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  45. \************************************************************/
  46. /*! no static exports found */
  47. /***/ (function(module, exports, __webpack_require__) {
  48. "use strict";
  49. /* WEBPACK VAR INJECTION */(function(wx, global) {
  50. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  51. Object.defineProperty(exports, "__esModule", {
  52. value: true
  53. });
  54. exports.createApp = createApp;
  55. exports.createComponent = createComponent;
  56. exports.createPage = createPage;
  57. exports.createPlugin = createPlugin;
  58. exports.createSubpackageApp = createSubpackageApp;
  59. exports.default = void 0;
  60. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  61. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  62. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  63. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  64. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  65. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  66. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  67. 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; }
  68. 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; }
  69. var realAtob;
  70. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  71. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  72. if (typeof atob !== 'function') {
  73. realAtob = function realAtob(str) {
  74. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  75. if (!b64re.test(str)) {
  76. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  77. }
  78. // Adding the padding if missing, for semplicity
  79. str += '=='.slice(2 - (str.length & 3));
  80. var bitmap;
  81. var result = '';
  82. var r1;
  83. var r2;
  84. var i = 0;
  85. for (; i < str.length;) {
  86. 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++)));
  87. 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);
  88. }
  89. return result;
  90. };
  91. } else {
  92. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  93. realAtob = atob;
  94. }
  95. function b64DecodeUnicode(str) {
  96. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  97. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  98. }).join(''));
  99. }
  100. function getCurrentUserInfo() {
  101. var token = wx.getStorageSync('uni_id_token') || '';
  102. var tokenArr = token.split('.');
  103. if (!token || tokenArr.length !== 3) {
  104. return {
  105. uid: null,
  106. role: [],
  107. permission: [],
  108. tokenExpired: 0
  109. };
  110. }
  111. var userInfo;
  112. try {
  113. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  114. } catch (error) {
  115. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  116. }
  117. userInfo.tokenExpired = userInfo.exp * 1000;
  118. delete userInfo.exp;
  119. delete userInfo.iat;
  120. return userInfo;
  121. }
  122. function uniIdMixin(Vue) {
  123. Vue.prototype.uniIDHasRole = function (roleId) {
  124. var _getCurrentUserInfo = getCurrentUserInfo(),
  125. role = _getCurrentUserInfo.role;
  126. return role.indexOf(roleId) > -1;
  127. };
  128. Vue.prototype.uniIDHasPermission = function (permissionId) {
  129. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  130. permission = _getCurrentUserInfo2.permission;
  131. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  132. };
  133. Vue.prototype.uniIDTokenValid = function () {
  134. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  135. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  136. return tokenExpired > Date.now();
  137. };
  138. }
  139. var _toString = Object.prototype.toString;
  140. var hasOwnProperty = Object.prototype.hasOwnProperty;
  141. function isFn(fn) {
  142. return typeof fn === 'function';
  143. }
  144. function isStr(str) {
  145. return typeof str === 'string';
  146. }
  147. function isObject(obj) {
  148. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  149. }
  150. function isPlainObject(obj) {
  151. return _toString.call(obj) === '[object Object]';
  152. }
  153. function hasOwn(obj, key) {
  154. return hasOwnProperty.call(obj, key);
  155. }
  156. function noop() {}
  157. /**
  158. * Create a cached version of a pure function.
  159. */
  160. function cached(fn) {
  161. var cache = Object.create(null);
  162. return function cachedFn(str) {
  163. var hit = cache[str];
  164. return hit || (cache[str] = fn(str));
  165. };
  166. }
  167. /**
  168. * Camelize a hyphen-delimited string.
  169. */
  170. var camelizeRE = /-(\w)/g;
  171. var camelize = cached(function (str) {
  172. return str.replace(camelizeRE, function (_, c) {
  173. return c ? c.toUpperCase() : '';
  174. });
  175. });
  176. function sortObject(obj) {
  177. var sortObj = {};
  178. if (isPlainObject(obj)) {
  179. Object.keys(obj).sort().forEach(function (key) {
  180. sortObj[key] = obj[key];
  181. });
  182. }
  183. return !Object.keys(sortObj) ? obj : sortObj;
  184. }
  185. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  186. var globalInterceptors = {};
  187. var scopedInterceptors = {};
  188. function mergeHook(parentVal, childVal) {
  189. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  190. return res ? dedupeHooks(res) : res;
  191. }
  192. function dedupeHooks(hooks) {
  193. var res = [];
  194. for (var i = 0; i < hooks.length; i++) {
  195. if (res.indexOf(hooks[i]) === -1) {
  196. res.push(hooks[i]);
  197. }
  198. }
  199. return res;
  200. }
  201. function removeHook(hooks, hook) {
  202. var index = hooks.indexOf(hook);
  203. if (index !== -1) {
  204. hooks.splice(index, 1);
  205. }
  206. }
  207. function mergeInterceptorHook(interceptor, option) {
  208. Object.keys(option).forEach(function (hook) {
  209. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  210. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  211. }
  212. });
  213. }
  214. function removeInterceptorHook(interceptor, option) {
  215. if (!interceptor || !option) {
  216. return;
  217. }
  218. Object.keys(option).forEach(function (hook) {
  219. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  220. removeHook(interceptor[hook], option[hook]);
  221. }
  222. });
  223. }
  224. function addInterceptor(method, option) {
  225. if (typeof method === 'string' && isPlainObject(option)) {
  226. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  227. } else if (isPlainObject(method)) {
  228. mergeInterceptorHook(globalInterceptors, method);
  229. }
  230. }
  231. function removeInterceptor(method, option) {
  232. if (typeof method === 'string') {
  233. if (isPlainObject(option)) {
  234. removeInterceptorHook(scopedInterceptors[method], option);
  235. } else {
  236. delete scopedInterceptors[method];
  237. }
  238. } else if (isPlainObject(method)) {
  239. removeInterceptorHook(globalInterceptors, method);
  240. }
  241. }
  242. function wrapperHook(hook) {
  243. return function (data) {
  244. return hook(data) || data;
  245. };
  246. }
  247. function isPromise(obj) {
  248. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  249. }
  250. function queue(hooks, data) {
  251. var promise = false;
  252. for (var i = 0; i < hooks.length; i++) {
  253. var hook = hooks[i];
  254. if (promise) {
  255. promise = Promise.resolve(wrapperHook(hook));
  256. } else {
  257. var res = hook(data);
  258. if (isPromise(res)) {
  259. promise = Promise.resolve(res);
  260. }
  261. if (res === false) {
  262. return {
  263. then: function then() {}
  264. };
  265. }
  266. }
  267. }
  268. return promise || {
  269. then: function then(callback) {
  270. return callback(data);
  271. }
  272. };
  273. }
  274. function wrapperOptions(interceptor) {
  275. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  276. ['success', 'fail', 'complete'].forEach(function (name) {
  277. if (Array.isArray(interceptor[name])) {
  278. var oldCallback = options[name];
  279. options[name] = function callbackInterceptor(res) {
  280. queue(interceptor[name], res).then(function (res) {
  281. /* eslint-disable no-mixed-operators */
  282. return isFn(oldCallback) && oldCallback(res) || res;
  283. });
  284. };
  285. }
  286. });
  287. return options;
  288. }
  289. function wrapperReturnValue(method, returnValue) {
  290. var returnValueHooks = [];
  291. if (Array.isArray(globalInterceptors.returnValue)) {
  292. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  293. }
  294. var interceptor = scopedInterceptors[method];
  295. if (interceptor && Array.isArray(interceptor.returnValue)) {
  296. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  297. }
  298. returnValueHooks.forEach(function (hook) {
  299. returnValue = hook(returnValue) || returnValue;
  300. });
  301. return returnValue;
  302. }
  303. function getApiInterceptorHooks(method) {
  304. var interceptor = Object.create(null);
  305. Object.keys(globalInterceptors).forEach(function (hook) {
  306. if (hook !== 'returnValue') {
  307. interceptor[hook] = globalInterceptors[hook].slice();
  308. }
  309. });
  310. var scopedInterceptor = scopedInterceptors[method];
  311. if (scopedInterceptor) {
  312. Object.keys(scopedInterceptor).forEach(function (hook) {
  313. if (hook !== 'returnValue') {
  314. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  315. }
  316. });
  317. }
  318. return interceptor;
  319. }
  320. function invokeApi(method, api, options) {
  321. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  322. params[_key - 3] = arguments[_key];
  323. }
  324. var interceptor = getApiInterceptorHooks(method);
  325. if (interceptor && Object.keys(interceptor).length) {
  326. if (Array.isArray(interceptor.invoke)) {
  327. var res = queue(interceptor.invoke, options);
  328. return res.then(function (options) {
  329. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  330. });
  331. } else {
  332. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  333. }
  334. }
  335. return api.apply(void 0, [options].concat(params));
  336. }
  337. var promiseInterceptor = {
  338. returnValue: function returnValue(res) {
  339. if (!isPromise(res)) {
  340. return res;
  341. }
  342. return new Promise(function (resolve, reject) {
  343. res.then(function (res) {
  344. if (res[0]) {
  345. reject(res[0]);
  346. } else {
  347. resolve(res[1]);
  348. }
  349. });
  350. });
  351. }
  352. };
  353. 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/;
  354. var CONTEXT_API_RE = /^create|Manager$/;
  355. // Context例外情况
  356. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  357. // 同步例外情况
  358. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  359. var CALLBACK_API_RE = /^on|^off/;
  360. function isContextApi(name) {
  361. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  362. }
  363. function isSyncApi(name) {
  364. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  365. }
  366. function isCallbackApi(name) {
  367. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  368. }
  369. function handlePromise(promise) {
  370. return promise.then(function (data) {
  371. return [null, data];
  372. }).catch(function (err) {
  373. return [err];
  374. });
  375. }
  376. function shouldPromise(name) {
  377. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  378. return false;
  379. }
  380. return true;
  381. }
  382. /* eslint-disable no-extend-native */
  383. if (!Promise.prototype.finally) {
  384. Promise.prototype.finally = function (callback) {
  385. var promise = this.constructor;
  386. return this.then(function (value) {
  387. return promise.resolve(callback()).then(function () {
  388. return value;
  389. });
  390. }, function (reason) {
  391. return promise.resolve(callback()).then(function () {
  392. throw reason;
  393. });
  394. });
  395. };
  396. }
  397. function promisify(name, api) {
  398. if (!shouldPromise(name) || !isFn(api)) {
  399. return api;
  400. }
  401. return function promiseApi() {
  402. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  403. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  404. params[_key2 - 1] = arguments[_key2];
  405. }
  406. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  407. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  408. }
  409. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  410. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  411. success: resolve,
  412. fail: reject
  413. })].concat(params));
  414. })));
  415. };
  416. }
  417. var EPS = 1e-4;
  418. var BASE_DEVICE_WIDTH = 750;
  419. var isIOS = false;
  420. var deviceWidth = 0;
  421. var deviceDPR = 0;
  422. function checkDeviceWidth() {
  423. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  424. platform = _wx$getSystemInfoSync.platform,
  425. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  426. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  427. deviceWidth = windowWidth;
  428. deviceDPR = pixelRatio;
  429. isIOS = platform === 'ios';
  430. }
  431. function upx2px(number, newDeviceWidth) {
  432. if (deviceWidth === 0) {
  433. checkDeviceWidth();
  434. }
  435. number = Number(number);
  436. if (number === 0) {
  437. return 0;
  438. }
  439. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  440. if (result < 0) {
  441. result = -result;
  442. }
  443. result = Math.floor(result + EPS);
  444. if (result === 0) {
  445. if (deviceDPR === 1 || !isIOS) {
  446. result = 1;
  447. } else {
  448. result = 0.5;
  449. }
  450. }
  451. return number < 0 ? -result : result;
  452. }
  453. var LOCALE_ZH_HANS = 'zh-Hans';
  454. var LOCALE_ZH_HANT = 'zh-Hant';
  455. var LOCALE_EN = 'en';
  456. var LOCALE_FR = 'fr';
  457. var LOCALE_ES = 'es';
  458. var messages = {};
  459. var locale;
  460. {
  461. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  462. }
  463. function initI18nMessages() {
  464. if (!isEnableLocale()) {
  465. return;
  466. }
  467. var localeKeys = Object.keys(__uniConfig.locales);
  468. if (localeKeys.length) {
  469. localeKeys.forEach(function (locale) {
  470. var curMessages = messages[locale];
  471. var userMessages = __uniConfig.locales[locale];
  472. if (curMessages) {
  473. Object.assign(curMessages, userMessages);
  474. } else {
  475. messages[locale] = userMessages;
  476. }
  477. });
  478. }
  479. }
  480. initI18nMessages();
  481. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  482. var t = i18n.t;
  483. var i18nMixin = i18n.mixin = {
  484. beforeCreate: function beforeCreate() {
  485. var _this = this;
  486. var unwatch = i18n.i18n.watchLocale(function () {
  487. _this.$forceUpdate();
  488. });
  489. this.$once('hook:beforeDestroy', function () {
  490. unwatch();
  491. });
  492. },
  493. methods: {
  494. $$t: function $$t(key, values) {
  495. return t(key, values);
  496. }
  497. }
  498. };
  499. var setLocale = i18n.setLocale;
  500. var getLocale = i18n.getLocale;
  501. function initAppLocale(Vue, appVm, locale) {
  502. var state = Vue.observable({
  503. locale: locale || i18n.getLocale()
  504. });
  505. var localeWatchers = [];
  506. appVm.$watchLocale = function (fn) {
  507. localeWatchers.push(fn);
  508. };
  509. Object.defineProperty(appVm, '$locale', {
  510. get: function get() {
  511. return state.locale;
  512. },
  513. set: function set(v) {
  514. state.locale = v;
  515. localeWatchers.forEach(function (watch) {
  516. return watch(v);
  517. });
  518. }
  519. });
  520. }
  521. function isEnableLocale() {
  522. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  523. }
  524. function include(str, parts) {
  525. return !!parts.find(function (part) {
  526. return str.indexOf(part) !== -1;
  527. });
  528. }
  529. function startsWith(str, parts) {
  530. return parts.find(function (part) {
  531. return str.indexOf(part) === 0;
  532. });
  533. }
  534. function normalizeLocale(locale, messages) {
  535. if (!locale) {
  536. return;
  537. }
  538. locale = locale.trim().replace(/_/g, '-');
  539. if (messages && messages[locale]) {
  540. return locale;
  541. }
  542. locale = locale.toLowerCase();
  543. if (locale === 'chinese') {
  544. // 支付宝
  545. return LOCALE_ZH_HANS;
  546. }
  547. if (locale.indexOf('zh') === 0) {
  548. if (locale.indexOf('-hans') > -1) {
  549. return LOCALE_ZH_HANS;
  550. }
  551. if (locale.indexOf('-hant') > -1) {
  552. return LOCALE_ZH_HANT;
  553. }
  554. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  555. return LOCALE_ZH_HANT;
  556. }
  557. return LOCALE_ZH_HANS;
  558. }
  559. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  560. if (lang) {
  561. return lang;
  562. }
  563. }
  564. // export function initI18n() {
  565. // const localeKeys = Object.keys(__uniConfig.locales || {})
  566. // if (localeKeys.length) {
  567. // localeKeys.forEach((locale) =>
  568. // i18n.add(locale, __uniConfig.locales[locale])
  569. // )
  570. // }
  571. // }
  572. function getLocale$1() {
  573. // 优先使用 $locale
  574. if (isFn(getApp)) {
  575. var app = getApp({
  576. allowDefault: true
  577. });
  578. if (app && app.$vm) {
  579. return app.$vm.$locale;
  580. }
  581. }
  582. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  583. }
  584. function setLocale$1(locale) {
  585. var app = isFn(getApp) ? getApp() : false;
  586. if (!app) {
  587. return false;
  588. }
  589. var oldLocale = app.$vm.$locale;
  590. if (oldLocale !== locale) {
  591. app.$vm.$locale = locale;
  592. onLocaleChangeCallbacks.forEach(function (fn) {
  593. return fn({
  594. locale: locale
  595. });
  596. });
  597. return true;
  598. }
  599. return false;
  600. }
  601. var onLocaleChangeCallbacks = [];
  602. function onLocaleChange(fn) {
  603. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  604. onLocaleChangeCallbacks.push(fn);
  605. }
  606. }
  607. if (typeof global !== 'undefined') {
  608. global.getLocale = getLocale$1;
  609. }
  610. var interceptors = {
  611. promiseInterceptor: promiseInterceptor
  612. };
  613. var baseApi = /*#__PURE__*/Object.freeze({
  614. __proto__: null,
  615. upx2px: upx2px,
  616. getLocale: getLocale$1,
  617. setLocale: setLocale$1,
  618. onLocaleChange: onLocaleChange,
  619. addInterceptor: addInterceptor,
  620. removeInterceptor: removeInterceptor,
  621. interceptors: interceptors
  622. });
  623. function findExistsPageIndex(url) {
  624. var pages = getCurrentPages();
  625. var len = pages.length;
  626. while (len--) {
  627. var page = pages[len];
  628. if (page.$page && page.$page.fullPath === url) {
  629. return len;
  630. }
  631. }
  632. return -1;
  633. }
  634. var redirectTo = {
  635. name: function name(fromArgs) {
  636. if (fromArgs.exists === 'back' && fromArgs.delta) {
  637. return 'navigateBack';
  638. }
  639. return 'redirectTo';
  640. },
  641. args: function args(fromArgs) {
  642. if (fromArgs.exists === 'back' && fromArgs.url) {
  643. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  644. if (existsPageIndex !== -1) {
  645. var delta = getCurrentPages().length - 1 - existsPageIndex;
  646. if (delta > 0) {
  647. fromArgs.delta = delta;
  648. }
  649. }
  650. }
  651. }
  652. };
  653. var previewImage = {
  654. args: function args(fromArgs) {
  655. var currentIndex = parseInt(fromArgs.current);
  656. if (isNaN(currentIndex)) {
  657. return;
  658. }
  659. var urls = fromArgs.urls;
  660. if (!Array.isArray(urls)) {
  661. return;
  662. }
  663. var len = urls.length;
  664. if (!len) {
  665. return;
  666. }
  667. if (currentIndex < 0) {
  668. currentIndex = 0;
  669. } else if (currentIndex >= len) {
  670. currentIndex = len - 1;
  671. }
  672. if (currentIndex > 0) {
  673. fromArgs.current = urls[currentIndex];
  674. fromArgs.urls = urls.filter(function (item, index) {
  675. return index < currentIndex ? item !== urls[currentIndex] : true;
  676. });
  677. } else {
  678. fromArgs.current = urls[0];
  679. }
  680. return {
  681. indicator: false,
  682. loop: false
  683. };
  684. }
  685. };
  686. var UUID_KEY = '__DC_STAT_UUID';
  687. var deviceId;
  688. function useDeviceId(result) {
  689. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  690. if (!deviceId) {
  691. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  692. wx.setStorage({
  693. key: UUID_KEY,
  694. data: deviceId
  695. });
  696. }
  697. result.deviceId = deviceId;
  698. }
  699. function addSafeAreaInsets(result) {
  700. if (result.safeArea) {
  701. var safeArea = result.safeArea;
  702. result.safeAreaInsets = {
  703. top: safeArea.top,
  704. left: safeArea.left,
  705. right: result.windowWidth - safeArea.right,
  706. bottom: result.screenHeight - safeArea.bottom
  707. };
  708. }
  709. }
  710. function populateParameters(result) {
  711. var _result$brand = result.brand,
  712. brand = _result$brand === void 0 ? '' : _result$brand,
  713. _result$model = result.model,
  714. model = _result$model === void 0 ? '' : _result$model,
  715. _result$system = result.system,
  716. system = _result$system === void 0 ? '' : _result$system,
  717. _result$language = result.language,
  718. language = _result$language === void 0 ? '' : _result$language,
  719. theme = result.theme,
  720. version = result.version,
  721. platform = result.platform,
  722. fontSizeSetting = result.fontSizeSetting,
  723. SDKVersion = result.SDKVersion,
  724. pixelRatio = result.pixelRatio,
  725. deviceOrientation = result.deviceOrientation;
  726. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  727. var extraParam = {};
  728. // osName osVersion
  729. var osName = '';
  730. var osVersion = '';
  731. {
  732. osName = system.split(' ')[0] || '';
  733. osVersion = system.split(' ')[1] || '';
  734. }
  735. var hostVersion = version;
  736. // deviceType
  737. var deviceType = getGetDeviceType(result, model);
  738. // deviceModel
  739. var deviceBrand = getDeviceBrand(brand);
  740. // hostName
  741. var _hostName = getHostName(result);
  742. // deviceOrientation
  743. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  744. // devicePixelRatio
  745. var _devicePixelRatio = pixelRatio;
  746. // SDKVersion
  747. var _SDKVersion = SDKVersion;
  748. // hostLanguage
  749. var hostLanguage = language.replace(/_/g, '-');
  750. // wx.getAccountInfoSync
  751. var parameters = {
  752. appId: "__UNI__50B3EE1",
  753. appName: "wx-app-new",
  754. appVersion: "1.0.0",
  755. appVersionCode: "100",
  756. appLanguage: getAppLanguage(hostLanguage),
  757. uniCompileVersion: "3.7.9",
  758. uniRuntimeVersion: "3.7.9",
  759. uniPlatform: undefined || "mp-weixin",
  760. deviceBrand: deviceBrand,
  761. deviceModel: model,
  762. deviceType: deviceType,
  763. devicePixelRatio: _devicePixelRatio,
  764. deviceOrientation: _deviceOrientation,
  765. osName: osName.toLocaleLowerCase(),
  766. osVersion: osVersion,
  767. hostTheme: theme,
  768. hostVersion: hostVersion,
  769. hostLanguage: hostLanguage,
  770. hostName: _hostName,
  771. hostSDKVersion: _SDKVersion,
  772. hostFontSizeSetting: fontSizeSetting,
  773. windowTop: 0,
  774. windowBottom: 0,
  775. // TODO
  776. osLanguage: undefined,
  777. osTheme: undefined,
  778. ua: undefined,
  779. hostPackageName: undefined,
  780. browserName: undefined,
  781. browserVersion: undefined
  782. };
  783. Object.assign(result, parameters, extraParam);
  784. }
  785. function getGetDeviceType(result, model) {
  786. var deviceType = result.deviceType || 'phone';
  787. {
  788. var deviceTypeMaps = {
  789. ipad: 'pad',
  790. windows: 'pc',
  791. mac: 'pc'
  792. };
  793. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  794. var _model = model.toLocaleLowerCase();
  795. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  796. var _m = deviceTypeMapsKeys[index];
  797. if (_model.indexOf(_m) !== -1) {
  798. deviceType = deviceTypeMaps[_m];
  799. break;
  800. }
  801. }
  802. }
  803. return deviceType;
  804. }
  805. function getDeviceBrand(brand) {
  806. var deviceBrand = brand;
  807. if (deviceBrand) {
  808. deviceBrand = brand.toLocaleLowerCase();
  809. }
  810. return deviceBrand;
  811. }
  812. function getAppLanguage(defaultLanguage) {
  813. return getLocale$1 ? getLocale$1() : defaultLanguage;
  814. }
  815. function getHostName(result) {
  816. var _platform = 'WeChat';
  817. var _hostName = result.hostName || _platform; // mp-jd
  818. {
  819. if (result.environment) {
  820. _hostName = result.environment;
  821. } else if (result.host && result.host.env) {
  822. _hostName = result.host.env;
  823. }
  824. }
  825. return _hostName;
  826. }
  827. var getSystemInfo = {
  828. returnValue: function returnValue(result) {
  829. useDeviceId(result);
  830. addSafeAreaInsets(result);
  831. populateParameters(result);
  832. }
  833. };
  834. var showActionSheet = {
  835. args: function args(fromArgs) {
  836. if ((0, _typeof2.default)(fromArgs) === 'object') {
  837. fromArgs.alertText = fromArgs.title;
  838. }
  839. }
  840. };
  841. var getAppBaseInfo = {
  842. returnValue: function returnValue(result) {
  843. var _result = result,
  844. version = _result.version,
  845. language = _result.language,
  846. SDKVersion = _result.SDKVersion,
  847. theme = _result.theme;
  848. var _hostName = getHostName(result);
  849. var hostLanguage = language.replace('_', '-');
  850. result = sortObject(Object.assign(result, {
  851. appId: "__UNI__50B3EE1",
  852. appName: "wx-app-new",
  853. appVersion: "1.0.0",
  854. appVersionCode: "100",
  855. appLanguage: getAppLanguage(hostLanguage),
  856. hostVersion: version,
  857. hostLanguage: hostLanguage,
  858. hostName: _hostName,
  859. hostSDKVersion: SDKVersion,
  860. hostTheme: theme
  861. }));
  862. }
  863. };
  864. var getDeviceInfo = {
  865. returnValue: function returnValue(result) {
  866. var _result2 = result,
  867. brand = _result2.brand,
  868. model = _result2.model;
  869. var deviceType = getGetDeviceType(result, model);
  870. var deviceBrand = getDeviceBrand(brand);
  871. useDeviceId(result);
  872. result = sortObject(Object.assign(result, {
  873. deviceType: deviceType,
  874. deviceBrand: deviceBrand,
  875. deviceModel: model
  876. }));
  877. }
  878. };
  879. var getWindowInfo = {
  880. returnValue: function returnValue(result) {
  881. addSafeAreaInsets(result);
  882. result = sortObject(Object.assign(result, {
  883. windowTop: 0,
  884. windowBottom: 0
  885. }));
  886. }
  887. };
  888. var getAppAuthorizeSetting = {
  889. returnValue: function returnValue(result) {
  890. var locationReducedAccuracy = result.locationReducedAccuracy;
  891. result.locationAccuracy = 'unsupported';
  892. if (locationReducedAccuracy === true) {
  893. result.locationAccuracy = 'reduced';
  894. } else if (locationReducedAccuracy === false) {
  895. result.locationAccuracy = 'full';
  896. }
  897. }
  898. };
  899. // import navigateTo from 'uni-helpers/navigate-to'
  900. var compressImage = {
  901. args: function args(fromArgs) {
  902. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  903. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  904. fromArgs.compressHeight = fromArgs.compressedHeight;
  905. }
  906. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  907. fromArgs.compressWidth = fromArgs.compressedWidth;
  908. }
  909. }
  910. };
  911. var protocols = {
  912. redirectTo: redirectTo,
  913. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  914. previewImage: previewImage,
  915. getSystemInfo: getSystemInfo,
  916. getSystemInfoSync: getSystemInfo,
  917. showActionSheet: showActionSheet,
  918. getAppBaseInfo: getAppBaseInfo,
  919. getDeviceInfo: getDeviceInfo,
  920. getWindowInfo: getWindowInfo,
  921. getAppAuthorizeSetting: getAppAuthorizeSetting,
  922. compressImage: compressImage
  923. };
  924. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  925. var canIUses = [];
  926. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  927. function processCallback(methodName, method, returnValue) {
  928. return function (res) {
  929. return method(processReturnValue(methodName, res, returnValue));
  930. };
  931. }
  932. function processArgs(methodName, fromArgs) {
  933. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  934. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  935. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  936. if (isPlainObject(fromArgs)) {
  937. // 一般 api 的参数解析
  938. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  939. if (isFn(argsOption)) {
  940. argsOption = argsOption(fromArgs, toArgs) || {};
  941. }
  942. for (var key in fromArgs) {
  943. if (hasOwn(argsOption, key)) {
  944. var keyOption = argsOption[key];
  945. if (isFn(keyOption)) {
  946. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  947. }
  948. if (!keyOption) {
  949. // 不支持的参数
  950. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  951. } else if (isStr(keyOption)) {
  952. // 重写参数 key
  953. toArgs[keyOption] = fromArgs[key];
  954. } else if (isPlainObject(keyOption)) {
  955. // {name:newName,value:value}可重新指定参数 key:value
  956. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  957. }
  958. } else if (CALLBACKS.indexOf(key) !== -1) {
  959. if (isFn(fromArgs[key])) {
  960. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  961. }
  962. } else {
  963. if (!keepFromArgs) {
  964. toArgs[key] = fromArgs[key];
  965. }
  966. }
  967. }
  968. return toArgs;
  969. } else if (isFn(fromArgs)) {
  970. fromArgs = processCallback(methodName, fromArgs, returnValue);
  971. }
  972. return fromArgs;
  973. }
  974. function processReturnValue(methodName, res, returnValue) {
  975. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  976. if (isFn(protocols.returnValue)) {
  977. // 处理通用 returnValue
  978. res = protocols.returnValue(methodName, res);
  979. }
  980. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  981. }
  982. function wrapper(methodName, method) {
  983. if (hasOwn(protocols, methodName)) {
  984. var protocol = protocols[methodName];
  985. if (!protocol) {
  986. // 暂不支持的 api
  987. return function () {
  988. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  989. };
  990. }
  991. return function (arg1, arg2) {
  992. // 目前 api 最多两个参数
  993. var options = protocol;
  994. if (isFn(protocol)) {
  995. options = protocol(arg1);
  996. }
  997. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  998. var args = [arg1];
  999. if (typeof arg2 !== 'undefined') {
  1000. args.push(arg2);
  1001. }
  1002. if (isFn(options.name)) {
  1003. methodName = options.name(arg1);
  1004. } else if (isStr(options.name)) {
  1005. methodName = options.name;
  1006. }
  1007. var returnValue = wx[methodName].apply(wx, args);
  1008. if (isSyncApi(methodName)) {
  1009. // 同步 api
  1010. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1011. }
  1012. return returnValue;
  1013. };
  1014. }
  1015. return method;
  1016. }
  1017. var todoApis = Object.create(null);
  1018. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1019. function createTodoApi(name) {
  1020. return function todoApi(_ref) {
  1021. var fail = _ref.fail,
  1022. complete = _ref.complete;
  1023. var res = {
  1024. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1025. };
  1026. isFn(fail) && fail(res);
  1027. isFn(complete) && complete(res);
  1028. };
  1029. }
  1030. TODOS.forEach(function (name) {
  1031. todoApis[name] = createTodoApi(name);
  1032. });
  1033. var providers = {
  1034. oauth: ['weixin'],
  1035. share: ['weixin'],
  1036. payment: ['wxpay'],
  1037. push: ['weixin']
  1038. };
  1039. function getProvider(_ref2) {
  1040. var service = _ref2.service,
  1041. success = _ref2.success,
  1042. fail = _ref2.fail,
  1043. complete = _ref2.complete;
  1044. var res = false;
  1045. if (providers[service]) {
  1046. res = {
  1047. errMsg: 'getProvider:ok',
  1048. service: service,
  1049. provider: providers[service]
  1050. };
  1051. isFn(success) && success(res);
  1052. } else {
  1053. res = {
  1054. errMsg: 'getProvider:fail service not found'
  1055. };
  1056. isFn(fail) && fail(res);
  1057. }
  1058. isFn(complete) && complete(res);
  1059. }
  1060. var extraApi = /*#__PURE__*/Object.freeze({
  1061. __proto__: null,
  1062. getProvider: getProvider
  1063. });
  1064. var getEmitter = function () {
  1065. var Emitter;
  1066. return function getUniEmitter() {
  1067. if (!Emitter) {
  1068. Emitter = new _vue.default();
  1069. }
  1070. return Emitter;
  1071. };
  1072. }();
  1073. function apply(ctx, method, args) {
  1074. return ctx[method].apply(ctx, args);
  1075. }
  1076. function $on() {
  1077. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1078. }
  1079. function $off() {
  1080. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1081. }
  1082. function $once() {
  1083. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1084. }
  1085. function $emit() {
  1086. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1087. }
  1088. var eventApi = /*#__PURE__*/Object.freeze({
  1089. __proto__: null,
  1090. $on: $on,
  1091. $off: $off,
  1092. $once: $once,
  1093. $emit: $emit
  1094. });
  1095. /**
  1096. * 框架内 try-catch
  1097. */
  1098. /**
  1099. * 开发者 try-catch
  1100. */
  1101. function tryCatch(fn) {
  1102. return function () {
  1103. try {
  1104. return fn.apply(fn, arguments);
  1105. } catch (e) {
  1106. // TODO
  1107. console.error(e);
  1108. }
  1109. };
  1110. }
  1111. function getApiCallbacks(params) {
  1112. var apiCallbacks = {};
  1113. for (var name in params) {
  1114. var param = params[name];
  1115. if (isFn(param)) {
  1116. apiCallbacks[name] = tryCatch(param);
  1117. delete params[name];
  1118. }
  1119. }
  1120. return apiCallbacks;
  1121. }
  1122. var cid;
  1123. var cidErrMsg;
  1124. var enabled;
  1125. function normalizePushMessage(message) {
  1126. try {
  1127. return JSON.parse(message);
  1128. } catch (e) {}
  1129. return message;
  1130. }
  1131. function invokePushCallback(args) {
  1132. if (args.type === 'enabled') {
  1133. enabled = true;
  1134. } else if (args.type === 'clientId') {
  1135. cid = args.cid;
  1136. cidErrMsg = args.errMsg;
  1137. invokeGetPushCidCallbacks(cid, args.errMsg);
  1138. } else if (args.type === 'pushMsg') {
  1139. var message = {
  1140. type: 'receive',
  1141. data: normalizePushMessage(args.message)
  1142. };
  1143. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1144. var callback = onPushMessageCallbacks[i];
  1145. callback(message);
  1146. // 该消息已被阻止
  1147. if (message.stopped) {
  1148. break;
  1149. }
  1150. }
  1151. } else if (args.type === 'click') {
  1152. onPushMessageCallbacks.forEach(function (callback) {
  1153. callback({
  1154. type: 'click',
  1155. data: normalizePushMessage(args.message)
  1156. });
  1157. });
  1158. }
  1159. }
  1160. var getPushCidCallbacks = [];
  1161. function invokeGetPushCidCallbacks(cid, errMsg) {
  1162. getPushCidCallbacks.forEach(function (callback) {
  1163. callback(cid, errMsg);
  1164. });
  1165. getPushCidCallbacks.length = 0;
  1166. }
  1167. function getPushClientId(args) {
  1168. if (!isPlainObject(args)) {
  1169. args = {};
  1170. }
  1171. var _getApiCallbacks = getApiCallbacks(args),
  1172. success = _getApiCallbacks.success,
  1173. fail = _getApiCallbacks.fail,
  1174. complete = _getApiCallbacks.complete;
  1175. var hasSuccess = isFn(success);
  1176. var hasFail = isFn(fail);
  1177. var hasComplete = isFn(complete);
  1178. Promise.resolve().then(function () {
  1179. if (typeof enabled === 'undefined') {
  1180. enabled = false;
  1181. cid = '';
  1182. cidErrMsg = 'uniPush is not enabled';
  1183. }
  1184. getPushCidCallbacks.push(function (cid, errMsg) {
  1185. var res;
  1186. if (cid) {
  1187. res = {
  1188. errMsg: 'getPushClientId:ok',
  1189. cid: cid
  1190. };
  1191. hasSuccess && success(res);
  1192. } else {
  1193. res = {
  1194. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1195. };
  1196. hasFail && fail(res);
  1197. }
  1198. hasComplete && complete(res);
  1199. });
  1200. if (typeof cid !== 'undefined') {
  1201. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1202. }
  1203. });
  1204. }
  1205. var onPushMessageCallbacks = [];
  1206. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1207. var onPushMessage = function onPushMessage(fn) {
  1208. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1209. onPushMessageCallbacks.push(fn);
  1210. }
  1211. };
  1212. var offPushMessage = function offPushMessage(fn) {
  1213. if (!fn) {
  1214. onPushMessageCallbacks.length = 0;
  1215. } else {
  1216. var index = onPushMessageCallbacks.indexOf(fn);
  1217. if (index > -1) {
  1218. onPushMessageCallbacks.splice(index, 1);
  1219. }
  1220. }
  1221. };
  1222. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1223. if (!baseInfo) {
  1224. baseInfo = wx.getSystemInfoSync();
  1225. }
  1226. var host = baseInfo ? baseInfo.host : null;
  1227. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1228. var api = /*#__PURE__*/Object.freeze({
  1229. __proto__: null,
  1230. shareVideoMessage: shareVideoMessage,
  1231. getPushClientId: getPushClientId,
  1232. onPushMessage: onPushMessage,
  1233. offPushMessage: offPushMessage,
  1234. invokePushCallback: invokePushCallback
  1235. });
  1236. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1237. function findVmByVueId(vm, vuePid) {
  1238. var $children = vm.$children;
  1239. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1240. for (var i = $children.length - 1; i >= 0; i--) {
  1241. var childVm = $children[i];
  1242. if (childVm.$scope._$vueId === vuePid) {
  1243. return childVm;
  1244. }
  1245. }
  1246. // 反向递归查找
  1247. var parentVm;
  1248. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1249. parentVm = findVmByVueId($children[_i], vuePid);
  1250. if (parentVm) {
  1251. return parentVm;
  1252. }
  1253. }
  1254. }
  1255. function initBehavior(options) {
  1256. return Behavior(options);
  1257. }
  1258. function isPage() {
  1259. return !!this.route;
  1260. }
  1261. function initRelation(detail) {
  1262. this.triggerEvent('__l', detail);
  1263. }
  1264. function selectAllComponents(mpInstance, selector, $refs) {
  1265. var components = mpInstance.selectAllComponents(selector) || [];
  1266. components.forEach(function (component) {
  1267. var ref = component.dataset.ref;
  1268. $refs[ref] = component.$vm || toSkip(component);
  1269. {
  1270. if (component.dataset.vueGeneric === 'scoped') {
  1271. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1272. selectAllComponents(scopedComponent, selector, $refs);
  1273. });
  1274. }
  1275. }
  1276. });
  1277. }
  1278. function syncRefs(refs, newRefs) {
  1279. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1280. var newKeys = Object.keys(newRefs);
  1281. newKeys.forEach(function (key) {
  1282. var oldValue = refs[key];
  1283. var newValue = newRefs[key];
  1284. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1285. return oldValue.includes(value);
  1286. })) {
  1287. return;
  1288. }
  1289. refs[key] = newValue;
  1290. oldKeys.delete(key);
  1291. });
  1292. oldKeys.forEach(function (key) {
  1293. delete refs[key];
  1294. });
  1295. return refs;
  1296. }
  1297. function initRefs(vm) {
  1298. var mpInstance = vm.$scope;
  1299. var refs = {};
  1300. Object.defineProperty(vm, '$refs', {
  1301. get: function get() {
  1302. var $refs = {};
  1303. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1304. // TODO 暂不考虑 for 中的 scoped
  1305. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1306. forComponents.forEach(function (component) {
  1307. var ref = component.dataset.ref;
  1308. if (!$refs[ref]) {
  1309. $refs[ref] = [];
  1310. }
  1311. $refs[ref].push(component.$vm || toSkip(component));
  1312. });
  1313. return syncRefs(refs, $refs);
  1314. }
  1315. });
  1316. }
  1317. function handleLink(event) {
  1318. var _ref3 = event.detail || event.value,
  1319. vuePid = _ref3.vuePid,
  1320. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1321. var parentVm;
  1322. if (vuePid) {
  1323. parentVm = findVmByVueId(this.$vm, vuePid);
  1324. }
  1325. if (!parentVm) {
  1326. parentVm = this.$vm;
  1327. }
  1328. vueOptions.parent = parentVm;
  1329. }
  1330. function markMPComponent(component) {
  1331. // 在 Vue 中标记为小程序组件
  1332. var IS_MP = '__v_isMPComponent';
  1333. Object.defineProperty(component, IS_MP, {
  1334. configurable: true,
  1335. enumerable: false,
  1336. value: true
  1337. });
  1338. return component;
  1339. }
  1340. function toSkip(obj) {
  1341. var OB = '__ob__';
  1342. var SKIP = '__v_skip';
  1343. if (isObject(obj) && Object.isExtensible(obj)) {
  1344. // 避免被 @vue/composition-api 观测
  1345. Object.defineProperty(obj, OB, {
  1346. configurable: true,
  1347. enumerable: false,
  1348. value: (0, _defineProperty2.default)({}, SKIP, true)
  1349. });
  1350. }
  1351. return obj;
  1352. }
  1353. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1354. function initWorkletMethods(mpMethods, vueMethods) {
  1355. if (vueMethods) {
  1356. Object.keys(vueMethods).forEach(function (name) {
  1357. var matches = name.match(WORKLET_RE);
  1358. if (matches) {
  1359. var workletName = matches[1];
  1360. mpMethods[name] = vueMethods[name];
  1361. mpMethods[workletName] = vueMethods[workletName];
  1362. }
  1363. });
  1364. }
  1365. }
  1366. var MPPage = Page;
  1367. var MPComponent = Component;
  1368. var customizeRE = /:/g;
  1369. var customize = cached(function (str) {
  1370. return camelize(str.replace(customizeRE, '-'));
  1371. });
  1372. function initTriggerEvent(mpInstance) {
  1373. var oldTriggerEvent = mpInstance.triggerEvent;
  1374. var newTriggerEvent = function newTriggerEvent(event) {
  1375. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1376. args[_key3 - 1] = arguments[_key3];
  1377. }
  1378. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1379. if (this.$vm || this.dataset && this.dataset.comType) {
  1380. event = customize(event);
  1381. } else {
  1382. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1383. var newEvent = customize(event);
  1384. if (newEvent !== event) {
  1385. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1386. }
  1387. }
  1388. return oldTriggerEvent.apply(this, [event].concat(args));
  1389. };
  1390. try {
  1391. // 京东小程序 triggerEvent 为只读
  1392. mpInstance.triggerEvent = newTriggerEvent;
  1393. } catch (error) {
  1394. mpInstance._triggerEvent = newTriggerEvent;
  1395. }
  1396. }
  1397. function initHook(name, options, isComponent) {
  1398. var oldHook = options[name];
  1399. options[name] = function () {
  1400. markMPComponent(this);
  1401. initTriggerEvent(this);
  1402. if (oldHook) {
  1403. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1404. args[_key4] = arguments[_key4];
  1405. }
  1406. return oldHook.apply(this, args);
  1407. }
  1408. };
  1409. }
  1410. if (!MPPage.__$wrappered) {
  1411. MPPage.__$wrappered = true;
  1412. Page = function Page() {
  1413. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1414. initHook('onLoad', options);
  1415. return MPPage(options);
  1416. };
  1417. Page.after = MPPage.after;
  1418. Component = function Component() {
  1419. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1420. initHook('created', options);
  1421. return MPComponent(options);
  1422. };
  1423. }
  1424. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1425. function initMocks(vm, mocks) {
  1426. var mpInstance = vm.$mp[vm.mpType];
  1427. mocks.forEach(function (mock) {
  1428. if (hasOwn(mpInstance, mock)) {
  1429. vm[mock] = mpInstance[mock];
  1430. }
  1431. });
  1432. }
  1433. function hasHook(hook, vueOptions) {
  1434. if (!vueOptions) {
  1435. return true;
  1436. }
  1437. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1438. return true;
  1439. }
  1440. vueOptions = vueOptions.default || vueOptions;
  1441. if (isFn(vueOptions)) {
  1442. if (isFn(vueOptions.extendOptions[hook])) {
  1443. return true;
  1444. }
  1445. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1446. return true;
  1447. }
  1448. return false;
  1449. }
  1450. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1451. return true;
  1452. }
  1453. var mixins = vueOptions.mixins;
  1454. if (Array.isArray(mixins)) {
  1455. return !!mixins.find(function (mixin) {
  1456. return hasHook(hook, mixin);
  1457. });
  1458. }
  1459. }
  1460. function initHooks(mpOptions, hooks, vueOptions) {
  1461. hooks.forEach(function (hook) {
  1462. if (hasHook(hook, vueOptions)) {
  1463. mpOptions[hook] = function (args) {
  1464. return this.$vm && this.$vm.__call_hook(hook, args);
  1465. };
  1466. }
  1467. });
  1468. }
  1469. function initUnknownHooks(mpOptions, vueOptions) {
  1470. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1471. findHooks(vueOptions).forEach(function (hook) {
  1472. return initHook$1(mpOptions, hook, excludes);
  1473. });
  1474. }
  1475. function findHooks(vueOptions) {
  1476. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1477. if (vueOptions) {
  1478. Object.keys(vueOptions).forEach(function (name) {
  1479. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1480. hooks.push(name);
  1481. }
  1482. });
  1483. }
  1484. return hooks;
  1485. }
  1486. function initHook$1(mpOptions, hook, excludes) {
  1487. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1488. mpOptions[hook] = function (args) {
  1489. return this.$vm && this.$vm.__call_hook(hook, args);
  1490. };
  1491. }
  1492. }
  1493. function initVueComponent(Vue, vueOptions) {
  1494. vueOptions = vueOptions.default || vueOptions;
  1495. var VueComponent;
  1496. if (isFn(vueOptions)) {
  1497. VueComponent = vueOptions;
  1498. } else {
  1499. VueComponent = Vue.extend(vueOptions);
  1500. }
  1501. vueOptions = VueComponent.options;
  1502. return [VueComponent, vueOptions];
  1503. }
  1504. function initSlots(vm, vueSlots) {
  1505. if (Array.isArray(vueSlots) && vueSlots.length) {
  1506. var $slots = Object.create(null);
  1507. vueSlots.forEach(function (slotName) {
  1508. $slots[slotName] = true;
  1509. });
  1510. vm.$scopedSlots = vm.$slots = $slots;
  1511. }
  1512. }
  1513. function initVueIds(vueIds, mpInstance) {
  1514. vueIds = (vueIds || '').split(',');
  1515. var len = vueIds.length;
  1516. if (len === 1) {
  1517. mpInstance._$vueId = vueIds[0];
  1518. } else if (len === 2) {
  1519. mpInstance._$vueId = vueIds[0];
  1520. mpInstance._$vuePid = vueIds[1];
  1521. }
  1522. }
  1523. function initData(vueOptions, context) {
  1524. var data = vueOptions.data || {};
  1525. var methods = vueOptions.methods || {};
  1526. if (typeof data === 'function') {
  1527. try {
  1528. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1529. } catch (e) {
  1530. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1531. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1532. }
  1533. }
  1534. } else {
  1535. try {
  1536. // 对 data 格式化
  1537. data = JSON.parse(JSON.stringify(data));
  1538. } catch (e) {}
  1539. }
  1540. if (!isPlainObject(data)) {
  1541. data = {};
  1542. }
  1543. Object.keys(methods).forEach(function (methodName) {
  1544. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1545. data[methodName] = methods[methodName];
  1546. }
  1547. });
  1548. return data;
  1549. }
  1550. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1551. function createObserver(name) {
  1552. return function observer(newVal, oldVal) {
  1553. if (this.$vm) {
  1554. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1555. }
  1556. };
  1557. }
  1558. function initBehaviors(vueOptions, initBehavior) {
  1559. var vueBehaviors = vueOptions.behaviors;
  1560. var vueExtends = vueOptions.extends;
  1561. var vueMixins = vueOptions.mixins;
  1562. var vueProps = vueOptions.props;
  1563. if (!vueProps) {
  1564. vueOptions.props = vueProps = [];
  1565. }
  1566. var behaviors = [];
  1567. if (Array.isArray(vueBehaviors)) {
  1568. vueBehaviors.forEach(function (behavior) {
  1569. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1570. if (behavior === 'uni://form-field') {
  1571. if (Array.isArray(vueProps)) {
  1572. vueProps.push('name');
  1573. vueProps.push('value');
  1574. } else {
  1575. vueProps.name = {
  1576. type: String,
  1577. default: ''
  1578. };
  1579. vueProps.value = {
  1580. type: [String, Number, Boolean, Array, Object, Date],
  1581. default: ''
  1582. };
  1583. }
  1584. }
  1585. });
  1586. }
  1587. if (isPlainObject(vueExtends) && vueExtends.props) {
  1588. behaviors.push(initBehavior({
  1589. properties: initProperties(vueExtends.props, true)
  1590. }));
  1591. }
  1592. if (Array.isArray(vueMixins)) {
  1593. vueMixins.forEach(function (vueMixin) {
  1594. if (isPlainObject(vueMixin) && vueMixin.props) {
  1595. behaviors.push(initBehavior({
  1596. properties: initProperties(vueMixin.props, true)
  1597. }));
  1598. }
  1599. });
  1600. }
  1601. return behaviors;
  1602. }
  1603. function parsePropType(key, type, defaultValue, file) {
  1604. // [String]=>String
  1605. if (Array.isArray(type) && type.length === 1) {
  1606. return type[0];
  1607. }
  1608. return type;
  1609. }
  1610. function initProperties(props) {
  1611. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1612. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1613. var options = arguments.length > 3 ? arguments[3] : undefined;
  1614. var properties = {};
  1615. if (!isBehavior) {
  1616. properties.vueId = {
  1617. type: String,
  1618. value: ''
  1619. };
  1620. {
  1621. if (options.virtualHost) {
  1622. properties.virtualHostStyle = {
  1623. type: null,
  1624. value: ''
  1625. };
  1626. properties.virtualHostClass = {
  1627. type: null,
  1628. value: ''
  1629. };
  1630. }
  1631. }
  1632. // scopedSlotsCompiler auto
  1633. properties.scopedSlotsCompiler = {
  1634. type: String,
  1635. value: ''
  1636. };
  1637. properties.vueSlots = {
  1638. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1639. type: null,
  1640. value: [],
  1641. observer: function observer(newVal, oldVal) {
  1642. var $slots = Object.create(null);
  1643. newVal.forEach(function (slotName) {
  1644. $slots[slotName] = true;
  1645. });
  1646. this.setData({
  1647. $slots: $slots
  1648. });
  1649. }
  1650. };
  1651. }
  1652. if (Array.isArray(props)) {
  1653. // ['title']
  1654. props.forEach(function (key) {
  1655. properties[key] = {
  1656. type: null,
  1657. observer: createObserver(key)
  1658. };
  1659. });
  1660. } else if (isPlainObject(props)) {
  1661. // {title:{type:String,default:''},content:String}
  1662. Object.keys(props).forEach(function (key) {
  1663. var opts = props[key];
  1664. if (isPlainObject(opts)) {
  1665. // title:{type:String,default:''}
  1666. var value = opts.default;
  1667. if (isFn(value)) {
  1668. value = value();
  1669. }
  1670. opts.type = parsePropType(key, opts.type);
  1671. properties[key] = {
  1672. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1673. value: value,
  1674. observer: createObserver(key)
  1675. };
  1676. } else {
  1677. // content:String
  1678. var type = parsePropType(key, opts);
  1679. properties[key] = {
  1680. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1681. observer: createObserver(key)
  1682. };
  1683. }
  1684. });
  1685. }
  1686. return properties;
  1687. }
  1688. function wrapper$1(event) {
  1689. // TODO 又得兼容 mpvue 的 mp 对象
  1690. try {
  1691. event.mp = JSON.parse(JSON.stringify(event));
  1692. } catch (e) {}
  1693. event.stopPropagation = noop;
  1694. event.preventDefault = noop;
  1695. event.target = event.target || {};
  1696. if (!hasOwn(event, 'detail')) {
  1697. event.detail = {};
  1698. }
  1699. if (hasOwn(event, 'markerId')) {
  1700. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1701. event.detail.markerId = event.markerId;
  1702. }
  1703. if (isPlainObject(event.detail)) {
  1704. event.target = Object.assign({}, event.target, event.detail);
  1705. }
  1706. return event;
  1707. }
  1708. function getExtraValue(vm, dataPathsArray) {
  1709. var context = vm;
  1710. dataPathsArray.forEach(function (dataPathArray) {
  1711. var dataPath = dataPathArray[0];
  1712. var value = dataPathArray[2];
  1713. if (dataPath || typeof value !== 'undefined') {
  1714. // ['','',index,'disable']
  1715. var propPath = dataPathArray[1];
  1716. var valuePath = dataPathArray[3];
  1717. var vFor;
  1718. if (Number.isInteger(dataPath)) {
  1719. vFor = dataPath;
  1720. } else if (!dataPath) {
  1721. vFor = context;
  1722. } else if (typeof dataPath === 'string' && dataPath) {
  1723. if (dataPath.indexOf('#s#') === 0) {
  1724. vFor = dataPath.substr(3);
  1725. } else {
  1726. vFor = vm.__get_value(dataPath, context);
  1727. }
  1728. }
  1729. if (Number.isInteger(vFor)) {
  1730. context = value;
  1731. } else if (!propPath) {
  1732. context = vFor[value];
  1733. } else {
  1734. if (Array.isArray(vFor)) {
  1735. context = vFor.find(function (vForItem) {
  1736. return vm.__get_value(propPath, vForItem) === value;
  1737. });
  1738. } else if (isPlainObject(vFor)) {
  1739. context = Object.keys(vFor).find(function (vForKey) {
  1740. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1741. });
  1742. } else {
  1743. console.error('v-for 暂不支持循环数据:', vFor);
  1744. }
  1745. }
  1746. if (valuePath) {
  1747. context = vm.__get_value(valuePath, context);
  1748. }
  1749. }
  1750. });
  1751. return context;
  1752. }
  1753. function processEventExtra(vm, extra, event, __args__) {
  1754. var extraObj = {};
  1755. if (Array.isArray(extra) && extra.length) {
  1756. /**
  1757. *[
  1758. * ['data.items', 'data.id', item.data.id],
  1759. * ['metas', 'id', meta.id]
  1760. *],
  1761. *[
  1762. * ['data.items', 'data.id', item.data.id],
  1763. * ['metas', 'id', meta.id]
  1764. *],
  1765. *'test'
  1766. */
  1767. extra.forEach(function (dataPath, index) {
  1768. if (typeof dataPath === 'string') {
  1769. if (!dataPath) {
  1770. // model,prop.sync
  1771. extraObj['$' + index] = vm;
  1772. } else {
  1773. if (dataPath === '$event') {
  1774. // $event
  1775. extraObj['$' + index] = event;
  1776. } else if (dataPath === 'arguments') {
  1777. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1778. } else if (dataPath.indexOf('$event.') === 0) {
  1779. // $event.target.value
  1780. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1781. } else {
  1782. extraObj['$' + index] = vm.__get_value(dataPath);
  1783. }
  1784. }
  1785. } else {
  1786. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1787. }
  1788. });
  1789. }
  1790. return extraObj;
  1791. }
  1792. function getObjByArray(arr) {
  1793. var obj = {};
  1794. for (var i = 1; i < arr.length; i++) {
  1795. var element = arr[i];
  1796. obj[element[0]] = element[1];
  1797. }
  1798. return obj;
  1799. }
  1800. function processEventArgs(vm, event) {
  1801. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1802. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1803. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1804. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1805. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1806. // fixed 用户直接触发 mpInstance.triggerEvent
  1807. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1808. if (isCustom) {
  1809. // 自定义事件
  1810. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1811. if (!args.length) {
  1812. // 无参数,直接传入 event 或 detail 数组
  1813. if (isCustomMPEvent) {
  1814. return [event];
  1815. }
  1816. return __args__;
  1817. }
  1818. }
  1819. var extraObj = processEventExtra(vm, extra, event, __args__);
  1820. var ret = [];
  1821. args.forEach(function (arg) {
  1822. if (arg === '$event') {
  1823. if (methodName === '__set_model' && !isCustom) {
  1824. // input v-model value
  1825. ret.push(event.target.value);
  1826. } else {
  1827. if (isCustom && !isCustomMPEvent) {
  1828. ret.push(__args__[0]);
  1829. } else {
  1830. // wxcomponent 组件或内置组件
  1831. ret.push(event);
  1832. }
  1833. }
  1834. } else {
  1835. if (Array.isArray(arg) && arg[0] === 'o') {
  1836. ret.push(getObjByArray(arg));
  1837. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1838. ret.push(extraObj[arg]);
  1839. } else {
  1840. ret.push(arg);
  1841. }
  1842. }
  1843. });
  1844. return ret;
  1845. }
  1846. var ONCE = '~';
  1847. var CUSTOM = '^';
  1848. function isMatchEventType(eventType, optType) {
  1849. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1850. }
  1851. function getContextVm(vm) {
  1852. var $parent = vm.$parent;
  1853. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1854. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1855. $parent = $parent.$parent;
  1856. }
  1857. return $parent && $parent.$parent;
  1858. }
  1859. function handleEvent(event) {
  1860. var _this2 = this;
  1861. event = wrapper$1(event);
  1862. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1863. var dataset = (event.currentTarget || event.target).dataset;
  1864. if (!dataset) {
  1865. return console.warn('事件信息不存在');
  1866. }
  1867. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1868. if (!eventOpts) {
  1869. return console.warn('事件信息不存在');
  1870. }
  1871. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1872. var eventType = event.type;
  1873. var ret = [];
  1874. eventOpts.forEach(function (eventOpt) {
  1875. var type = eventOpt[0];
  1876. var eventsArray = eventOpt[1];
  1877. var isCustom = type.charAt(0) === CUSTOM;
  1878. type = isCustom ? type.slice(1) : type;
  1879. var isOnce = type.charAt(0) === ONCE;
  1880. type = isOnce ? type.slice(1) : type;
  1881. if (eventsArray && isMatchEventType(eventType, type)) {
  1882. eventsArray.forEach(function (eventArray) {
  1883. var methodName = eventArray[0];
  1884. if (methodName) {
  1885. var handlerCtx = _this2.$vm;
  1886. if (handlerCtx.$options.generic) {
  1887. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1888. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1889. }
  1890. if (methodName === '$emit') {
  1891. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1892. return;
  1893. }
  1894. var handler = handlerCtx[methodName];
  1895. if (!isFn(handler)) {
  1896. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1897. var path = _this2.route || _this2.is;
  1898. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1899. }
  1900. if (isOnce) {
  1901. if (handler.once) {
  1902. return;
  1903. }
  1904. handler.once = true;
  1905. }
  1906. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1907. params = Array.isArray(params) ? params : [];
  1908. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1909. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1910. // eslint-disable-next-line no-sparse-arrays
  1911. params = params.concat([,,,,,,,,,, event]);
  1912. }
  1913. ret.push(handler.apply(handlerCtx, params));
  1914. }
  1915. });
  1916. }
  1917. });
  1918. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1919. return ret[0];
  1920. }
  1921. }
  1922. var eventChannels = {};
  1923. var eventChannelStack = [];
  1924. function getEventChannel(id) {
  1925. if (id) {
  1926. var eventChannel = eventChannels[id];
  1927. delete eventChannels[id];
  1928. return eventChannel;
  1929. }
  1930. return eventChannelStack.shift();
  1931. }
  1932. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1933. function initEventChannel() {
  1934. _vue.default.prototype.getOpenerEventChannel = function () {
  1935. // 微信小程序使用自身getOpenerEventChannel
  1936. {
  1937. return this.$scope.getOpenerEventChannel();
  1938. }
  1939. };
  1940. var callHook = _vue.default.prototype.__call_hook;
  1941. _vue.default.prototype.__call_hook = function (hook, args) {
  1942. if (hook === 'onLoad' && args && args.__id__) {
  1943. this.__eventChannel__ = getEventChannel(args.__id__);
  1944. delete args.__id__;
  1945. }
  1946. return callHook.call(this, hook, args);
  1947. };
  1948. }
  1949. function initScopedSlotsParams() {
  1950. var center = {};
  1951. var parents = {};
  1952. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1953. var has = center[vueId];
  1954. if (!has) {
  1955. parents[vueId] = this;
  1956. this.$on('hook:destroyed', function () {
  1957. delete parents[vueId];
  1958. });
  1959. }
  1960. return has;
  1961. };
  1962. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1963. var data = center[vueId];
  1964. if (data) {
  1965. var object = data[name] || {};
  1966. return key ? object[key] : object;
  1967. } else {
  1968. parents[vueId] = this;
  1969. this.$on('hook:destroyed', function () {
  1970. delete parents[vueId];
  1971. });
  1972. }
  1973. };
  1974. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1975. var vueIds = this.$options.propsData.vueId;
  1976. if (vueIds) {
  1977. var vueId = vueIds.split(',')[0];
  1978. var object = center[vueId] = center[vueId] || {};
  1979. object[name] = value;
  1980. if (parents[vueId]) {
  1981. parents[vueId].$forceUpdate();
  1982. }
  1983. }
  1984. };
  1985. _vue.default.mixin({
  1986. destroyed: function destroyed() {
  1987. var propsData = this.$options.propsData;
  1988. var vueId = propsData && propsData.vueId;
  1989. if (vueId) {
  1990. delete center[vueId];
  1991. delete parents[vueId];
  1992. }
  1993. }
  1994. });
  1995. }
  1996. function parseBaseApp(vm, _ref4) {
  1997. var mocks = _ref4.mocks,
  1998. initRefs = _ref4.initRefs;
  1999. initEventChannel();
  2000. {
  2001. initScopedSlotsParams();
  2002. }
  2003. if (vm.$options.store) {
  2004. _vue.default.prototype.$store = vm.$options.store;
  2005. }
  2006. uniIdMixin(_vue.default);
  2007. _vue.default.prototype.mpHost = "mp-weixin";
  2008. _vue.default.mixin({
  2009. beforeCreate: function beforeCreate() {
  2010. if (!this.$options.mpType) {
  2011. return;
  2012. }
  2013. this.mpType = this.$options.mpType;
  2014. this.$mp = (0, _defineProperty2.default)({
  2015. data: {}
  2016. }, this.mpType, this.$options.mpInstance);
  2017. this.$scope = this.$options.mpInstance;
  2018. delete this.$options.mpType;
  2019. delete this.$options.mpInstance;
  2020. if (this.mpType === 'page' && typeof getApp === 'function') {
  2021. // hack vue-i18n
  2022. var app = getApp();
  2023. if (app.$vm && app.$vm.$i18n) {
  2024. this._i18n = app.$vm.$i18n;
  2025. }
  2026. }
  2027. if (this.mpType !== 'app') {
  2028. initRefs(this);
  2029. initMocks(this, mocks);
  2030. }
  2031. }
  2032. });
  2033. var appOptions = {
  2034. onLaunch: function onLaunch(args) {
  2035. if (this.$vm) {
  2036. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2037. return;
  2038. }
  2039. {
  2040. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2041. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2042. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2043. }
  2044. }
  2045. this.$vm = vm;
  2046. this.$vm.$mp = {
  2047. app: this
  2048. };
  2049. this.$vm.$scope = this;
  2050. // vm 上也挂载 globalData
  2051. this.$vm.globalData = this.globalData;
  2052. this.$vm._isMounted = true;
  2053. this.$vm.__call_hook('mounted', args);
  2054. this.$vm.__call_hook('onLaunch', args);
  2055. }
  2056. };
  2057. // 兼容旧版本 globalData
  2058. appOptions.globalData = vm.$options.globalData || {};
  2059. // 将 methods 中的方法挂在 getApp() 中
  2060. var methods = vm.$options.methods;
  2061. if (methods) {
  2062. Object.keys(methods).forEach(function (name) {
  2063. appOptions[name] = methods[name];
  2064. });
  2065. }
  2066. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2067. initHooks(appOptions, hooks);
  2068. initUnknownHooks(appOptions, vm.$options);
  2069. return appOptions;
  2070. }
  2071. function parseApp(vm) {
  2072. return parseBaseApp(vm, {
  2073. mocks: mocks,
  2074. initRefs: initRefs
  2075. });
  2076. }
  2077. function createApp(vm) {
  2078. App(parseApp(vm));
  2079. return vm;
  2080. }
  2081. var encodeReserveRE = /[!'()*]/g;
  2082. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2083. return '%' + c.charCodeAt(0).toString(16);
  2084. };
  2085. var commaRE = /%2C/g;
  2086. // fixed encodeURIComponent which is more conformant to RFC3986:
  2087. // - escapes [!'()*]
  2088. // - preserve commas
  2089. var encode = function encode(str) {
  2090. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2091. };
  2092. function stringifyQuery(obj) {
  2093. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2094. var res = obj ? Object.keys(obj).map(function (key) {
  2095. var val = obj[key];
  2096. if (val === undefined) {
  2097. return '';
  2098. }
  2099. if (val === null) {
  2100. return encodeStr(key);
  2101. }
  2102. if (Array.isArray(val)) {
  2103. var result = [];
  2104. val.forEach(function (val2) {
  2105. if (val2 === undefined) {
  2106. return;
  2107. }
  2108. if (val2 === null) {
  2109. result.push(encodeStr(key));
  2110. } else {
  2111. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2112. }
  2113. });
  2114. return result.join('&');
  2115. }
  2116. return encodeStr(key) + '=' + encodeStr(val);
  2117. }).filter(function (x) {
  2118. return x.length > 0;
  2119. }).join('&') : null;
  2120. return res ? "?".concat(res) : '';
  2121. }
  2122. function parseBaseComponent(vueComponentOptions) {
  2123. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2124. isPage = _ref5.isPage,
  2125. initRelation = _ref5.initRelation;
  2126. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2127. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2128. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2129. VueComponent = _initVueComponent2[0],
  2130. vueOptions = _initVueComponent2[1];
  2131. var options = _objectSpread({
  2132. multipleSlots: true,
  2133. addGlobalClass: true
  2134. }, vueOptions.options || {});
  2135. {
  2136. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2137. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2138. Object.assign(options, vueOptions['mp-weixin'].options);
  2139. }
  2140. }
  2141. var componentOptions = {
  2142. options: options,
  2143. data: initData(vueOptions, _vue.default.prototype),
  2144. behaviors: initBehaviors(vueOptions, initBehavior),
  2145. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2146. lifetimes: {
  2147. attached: function attached() {
  2148. var properties = this.properties;
  2149. var options = {
  2150. mpType: isPage.call(this) ? 'page' : 'component',
  2151. mpInstance: this,
  2152. propsData: properties
  2153. };
  2154. initVueIds(properties.vueId, this);
  2155. // 处理父子关系
  2156. initRelation.call(this, {
  2157. vuePid: this._$vuePid,
  2158. vueOptions: options
  2159. });
  2160. // 初始化 vue 实例
  2161. this.$vm = new VueComponent(options);
  2162. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2163. initSlots(this.$vm, properties.vueSlots);
  2164. // 触发首次 setData
  2165. this.$vm.$mount();
  2166. },
  2167. ready: function ready() {
  2168. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2169. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2170. if (this.$vm) {
  2171. this.$vm._isMounted = true;
  2172. this.$vm.__call_hook('mounted');
  2173. this.$vm.__call_hook('onReady');
  2174. }
  2175. },
  2176. detached: function detached() {
  2177. this.$vm && this.$vm.$destroy();
  2178. }
  2179. },
  2180. pageLifetimes: {
  2181. show: function show(args) {
  2182. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2183. },
  2184. hide: function hide() {
  2185. this.$vm && this.$vm.__call_hook('onPageHide');
  2186. },
  2187. resize: function resize(size) {
  2188. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2189. }
  2190. },
  2191. methods: {
  2192. __l: handleLink,
  2193. __e: handleEvent
  2194. }
  2195. };
  2196. // externalClasses
  2197. if (vueOptions.externalClasses) {
  2198. componentOptions.externalClasses = vueOptions.externalClasses;
  2199. }
  2200. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2201. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2202. componentOptions.methods[callMethod] = function (args) {
  2203. return this.$vm[callMethod](args);
  2204. };
  2205. });
  2206. }
  2207. if (needVueOptions) {
  2208. return [componentOptions, vueOptions, VueComponent];
  2209. }
  2210. if (isPage) {
  2211. return componentOptions;
  2212. }
  2213. return [componentOptions, VueComponent];
  2214. }
  2215. function parseComponent(vueComponentOptions, needVueOptions) {
  2216. return parseBaseComponent(vueComponentOptions, {
  2217. isPage: isPage,
  2218. initRelation: initRelation
  2219. }, needVueOptions);
  2220. }
  2221. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2222. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2223. function parseBasePage(vuePageOptions) {
  2224. var _parseComponent = parseComponent(vuePageOptions, true),
  2225. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2226. pageOptions = _parseComponent2[0],
  2227. vueOptions = _parseComponent2[1];
  2228. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2229. pageOptions.methods.onLoad = function (query) {
  2230. this.options = query;
  2231. var copyQuery = Object.assign({}, query);
  2232. delete copyQuery.__id__;
  2233. this.$page = {
  2234. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2235. };
  2236. this.$vm.$mp.query = query; // 兼容 mpvue
  2237. this.$vm.__call_hook('onLoad', query);
  2238. };
  2239. {
  2240. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2241. }
  2242. {
  2243. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2244. }
  2245. return pageOptions;
  2246. }
  2247. function parsePage(vuePageOptions) {
  2248. return parseBasePage(vuePageOptions);
  2249. }
  2250. function createPage(vuePageOptions) {
  2251. {
  2252. return Component(parsePage(vuePageOptions));
  2253. }
  2254. }
  2255. function createComponent(vueOptions) {
  2256. {
  2257. return Component(parseComponent(vueOptions));
  2258. }
  2259. }
  2260. function createSubpackageApp(vm) {
  2261. var appOptions = parseApp(vm);
  2262. var app = getApp({
  2263. allowDefault: true
  2264. });
  2265. vm.$scope = app;
  2266. var globalData = app.globalData;
  2267. if (globalData) {
  2268. Object.keys(appOptions.globalData).forEach(function (name) {
  2269. if (!hasOwn(globalData, name)) {
  2270. globalData[name] = appOptions.globalData[name];
  2271. }
  2272. });
  2273. }
  2274. Object.keys(appOptions).forEach(function (name) {
  2275. if (!hasOwn(app, name)) {
  2276. app[name] = appOptions[name];
  2277. }
  2278. });
  2279. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2280. wx.onAppShow(function () {
  2281. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2282. args[_key5] = arguments[_key5];
  2283. }
  2284. vm.__call_hook('onShow', args);
  2285. });
  2286. }
  2287. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2288. wx.onAppHide(function () {
  2289. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2290. args[_key6] = arguments[_key6];
  2291. }
  2292. vm.__call_hook('onHide', args);
  2293. });
  2294. }
  2295. if (isFn(appOptions.onLaunch)) {
  2296. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2297. vm.__call_hook('onLaunch', args);
  2298. }
  2299. return vm;
  2300. }
  2301. function createPlugin(vm) {
  2302. var appOptions = parseApp(vm);
  2303. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2304. wx.onAppShow(function () {
  2305. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2306. args[_key7] = arguments[_key7];
  2307. }
  2308. vm.__call_hook('onShow', args);
  2309. });
  2310. }
  2311. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2312. wx.onAppHide(function () {
  2313. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2314. args[_key8] = arguments[_key8];
  2315. }
  2316. vm.__call_hook('onHide', args);
  2317. });
  2318. }
  2319. if (isFn(appOptions.onLaunch)) {
  2320. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2321. vm.__call_hook('onLaunch', args);
  2322. }
  2323. return vm;
  2324. }
  2325. todos.forEach(function (todoApi) {
  2326. protocols[todoApi] = false;
  2327. });
  2328. canIUses.forEach(function (canIUseApi) {
  2329. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2330. if (!wx.canIUse(apiName)) {
  2331. protocols[canIUseApi] = false;
  2332. }
  2333. });
  2334. var uni = {};
  2335. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2336. uni = new Proxy({}, {
  2337. get: function get(target, name) {
  2338. if (hasOwn(target, name)) {
  2339. return target[name];
  2340. }
  2341. if (baseApi[name]) {
  2342. return baseApi[name];
  2343. }
  2344. if (api[name]) {
  2345. return promisify(name, api[name]);
  2346. }
  2347. {
  2348. if (extraApi[name]) {
  2349. return promisify(name, extraApi[name]);
  2350. }
  2351. if (todoApis[name]) {
  2352. return promisify(name, todoApis[name]);
  2353. }
  2354. }
  2355. if (eventApi[name]) {
  2356. return eventApi[name];
  2357. }
  2358. return promisify(name, wrapper(name, wx[name]));
  2359. },
  2360. set: function set(target, name, value) {
  2361. target[name] = value;
  2362. return true;
  2363. }
  2364. });
  2365. } else {
  2366. Object.keys(baseApi).forEach(function (name) {
  2367. uni[name] = baseApi[name];
  2368. });
  2369. {
  2370. Object.keys(todoApis).forEach(function (name) {
  2371. uni[name] = promisify(name, todoApis[name]);
  2372. });
  2373. Object.keys(extraApi).forEach(function (name) {
  2374. uni[name] = promisify(name, todoApis[name]);
  2375. });
  2376. }
  2377. Object.keys(eventApi).forEach(function (name) {
  2378. uni[name] = eventApi[name];
  2379. });
  2380. Object.keys(api).forEach(function (name) {
  2381. uni[name] = promisify(name, api[name]);
  2382. });
  2383. Object.keys(wx).forEach(function (name) {
  2384. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2385. uni[name] = promisify(name, wrapper(name, wx[name]));
  2386. }
  2387. });
  2388. }
  2389. wx.createApp = createApp;
  2390. wx.createPage = createPage;
  2391. wx.createComponent = createComponent;
  2392. wx.createSubpackageApp = createSubpackageApp;
  2393. wx.createPlugin = createPlugin;
  2394. var uni$1 = uni;
  2395. var _default = uni$1;
  2396. exports.default = _default;
  2397. /* 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)))
  2398. /***/ }),
  2399. /* 3 */
  2400. /*!***********************************!*\
  2401. !*** (webpack)/buildin/global.js ***!
  2402. \***********************************/
  2403. /*! no static exports found */
  2404. /***/ (function(module, exports) {
  2405. var g;
  2406. // This works in non-strict mode
  2407. g = (function() {
  2408. return this;
  2409. })();
  2410. try {
  2411. // This works if eval is allowed (see CSP)
  2412. g = g || new Function("return this")();
  2413. } catch (e) {
  2414. // This works if the window reference is available
  2415. if (typeof window === "object") g = window;
  2416. }
  2417. // g can still be undefined, but nothing to do about it...
  2418. // We return undefined, instead of nothing here, so it's
  2419. // easier to handle this case. if(!global) { ...}
  2420. module.exports = g;
  2421. /***/ }),
  2422. /* 4 */
  2423. /*!**********************************************************************!*\
  2424. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2425. \**********************************************************************/
  2426. /*! no static exports found */
  2427. /***/ (function(module, exports) {
  2428. function _interopRequireDefault(obj) {
  2429. return obj && obj.__esModule ? obj : {
  2430. "default": obj
  2431. };
  2432. }
  2433. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2434. /***/ }),
  2435. /* 5 */
  2436. /*!**************************************************************!*\
  2437. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2438. \**************************************************************/
  2439. /*! no static exports found */
  2440. /***/ (function(module, exports, __webpack_require__) {
  2441. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2442. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2443. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2444. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2445. function _slicedToArray(arr, i) {
  2446. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2447. }
  2448. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2449. /***/ }),
  2450. /* 6 */
  2451. /*!***************************************************************!*\
  2452. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2453. \***************************************************************/
  2454. /*! no static exports found */
  2455. /***/ (function(module, exports) {
  2456. function _arrayWithHoles(arr) {
  2457. if (Array.isArray(arr)) return arr;
  2458. }
  2459. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2460. /***/ }),
  2461. /* 7 */
  2462. /*!*********************************************************************!*\
  2463. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2464. \*********************************************************************/
  2465. /*! no static exports found */
  2466. /***/ (function(module, exports) {
  2467. function _iterableToArrayLimit(arr, i) {
  2468. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  2469. if (null != _i) {
  2470. var _s,
  2471. _e,
  2472. _x,
  2473. _r,
  2474. _arr = [],
  2475. _n = !0,
  2476. _d = !1;
  2477. try {
  2478. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  2479. if (Object(_i) !== _i) return;
  2480. _n = !1;
  2481. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  2482. ;
  2483. }
  2484. } catch (err) {
  2485. _d = !0, _e = err;
  2486. } finally {
  2487. try {
  2488. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  2489. } finally {
  2490. if (_d) throw _e;
  2491. }
  2492. }
  2493. return _arr;
  2494. }
  2495. }
  2496. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2497. /***/ }),
  2498. /* 8 */
  2499. /*!***************************************************************************!*\
  2500. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2501. \***************************************************************************/
  2502. /*! no static exports found */
  2503. /***/ (function(module, exports, __webpack_require__) {
  2504. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2505. function _unsupportedIterableToArray(o, minLen) {
  2506. if (!o) return;
  2507. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2508. var n = Object.prototype.toString.call(o).slice(8, -1);
  2509. if (n === "Object" && o.constructor) n = o.constructor.name;
  2510. if (n === "Map" || n === "Set") return Array.from(o);
  2511. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2512. }
  2513. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2514. /***/ }),
  2515. /* 9 */
  2516. /*!*****************************************************************!*\
  2517. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2518. \*****************************************************************/
  2519. /*! no static exports found */
  2520. /***/ (function(module, exports) {
  2521. function _arrayLikeToArray(arr, len) {
  2522. if (len == null || len > arr.length) len = arr.length;
  2523. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2524. arr2[i] = arr[i];
  2525. }
  2526. return arr2;
  2527. }
  2528. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2529. /***/ }),
  2530. /* 10 */
  2531. /*!****************************************************************!*\
  2532. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2533. \****************************************************************/
  2534. /*! no static exports found */
  2535. /***/ (function(module, exports) {
  2536. function _nonIterableRest() {
  2537. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2538. }
  2539. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2540. /***/ }),
  2541. /* 11 */
  2542. /*!***************************************************************!*\
  2543. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2544. \***************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2548. function _defineProperty(obj, key, value) {
  2549. key = toPropertyKey(key);
  2550. if (key in obj) {
  2551. Object.defineProperty(obj, key, {
  2552. value: value,
  2553. enumerable: true,
  2554. configurable: true,
  2555. writable: true
  2556. });
  2557. } else {
  2558. obj[key] = value;
  2559. }
  2560. return obj;
  2561. }
  2562. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2563. /***/ }),
  2564. /* 12 */
  2565. /*!**************************************************************!*\
  2566. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2567. \**************************************************************/
  2568. /*! no static exports found */
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2571. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2572. function _toPropertyKey(arg) {
  2573. var key = toPrimitive(arg, "string");
  2574. return _typeof(key) === "symbol" ? key : String(key);
  2575. }
  2576. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2577. /***/ }),
  2578. /* 13 */
  2579. /*!*******************************************************!*\
  2580. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2581. \*******************************************************/
  2582. /*! no static exports found */
  2583. /***/ (function(module, exports) {
  2584. function _typeof(obj) {
  2585. "@babel/helpers - typeof";
  2586. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2587. return typeof obj;
  2588. } : function (obj) {
  2589. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2590. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2591. }
  2592. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2593. /***/ }),
  2594. /* 14 */
  2595. /*!************************************************************!*\
  2596. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2597. \************************************************************/
  2598. /*! no static exports found */
  2599. /***/ (function(module, exports, __webpack_require__) {
  2600. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2601. function _toPrimitive(input, hint) {
  2602. if (_typeof(input) !== "object" || input === null) return input;
  2603. var prim = input[Symbol.toPrimitive];
  2604. if (prim !== undefined) {
  2605. var res = prim.call(input, hint || "default");
  2606. if (_typeof(res) !== "object") return res;
  2607. throw new TypeError("@@toPrimitive must return a primitive value.");
  2608. }
  2609. return (hint === "string" ? String : Number)(input);
  2610. }
  2611. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2612. /***/ }),
  2613. /* 15 */
  2614. /*!**********************************************************!*\
  2615. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2616. \**********************************************************/
  2617. /*! no static exports found */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2620. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2621. function _construct(Parent, args, Class) {
  2622. if (isNativeReflectConstruct()) {
  2623. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2624. } else {
  2625. module.exports = _construct = function _construct(Parent, args, Class) {
  2626. var a = [null];
  2627. a.push.apply(a, args);
  2628. var Constructor = Function.bind.apply(Parent, a);
  2629. var instance = new Constructor();
  2630. if (Class) setPrototypeOf(instance, Class.prototype);
  2631. return instance;
  2632. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2633. }
  2634. return _construct.apply(null, arguments);
  2635. }
  2636. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2637. /***/ }),
  2638. /* 16 */
  2639. /*!***************************************************************!*\
  2640. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2641. \***************************************************************/
  2642. /*! no static exports found */
  2643. /***/ (function(module, exports) {
  2644. function _setPrototypeOf(o, p) {
  2645. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2646. o.__proto__ = p;
  2647. return o;
  2648. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2649. return _setPrototypeOf(o, p);
  2650. }
  2651. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2652. /***/ }),
  2653. /* 17 */
  2654. /*!*************************************************************************!*\
  2655. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2656. \*************************************************************************/
  2657. /*! no static exports found */
  2658. /***/ (function(module, exports) {
  2659. function _isNativeReflectConstruct() {
  2660. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2661. if (Reflect.construct.sham) return false;
  2662. if (typeof Proxy === "function") return true;
  2663. try {
  2664. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2665. return true;
  2666. } catch (e) {
  2667. return false;
  2668. }
  2669. }
  2670. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2671. /***/ }),
  2672. /* 18 */
  2673. /*!******************************************************************!*\
  2674. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2675. \******************************************************************/
  2676. /*! no static exports found */
  2677. /***/ (function(module, exports, __webpack_require__) {
  2678. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2679. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2680. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2681. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2682. function _toConsumableArray(arr) {
  2683. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2684. }
  2685. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2686. /***/ }),
  2687. /* 19 */
  2688. /*!******************************************************************!*\
  2689. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2690. \******************************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2694. function _arrayWithoutHoles(arr) {
  2695. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2696. }
  2697. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2698. /***/ }),
  2699. /* 20 */
  2700. /*!****************************************************************!*\
  2701. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2702. \****************************************************************/
  2703. /*! no static exports found */
  2704. /***/ (function(module, exports) {
  2705. function _iterableToArray(iter) {
  2706. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2707. }
  2708. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2709. /***/ }),
  2710. /* 21 */
  2711. /*!******************************************************************!*\
  2712. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2713. \******************************************************************/
  2714. /*! no static exports found */
  2715. /***/ (function(module, exports) {
  2716. function _nonIterableSpread() {
  2717. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2718. }
  2719. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2720. /***/ }),
  2721. /* 22 */
  2722. /*!*************************************************************!*\
  2723. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2724. \*************************************************************/
  2725. /*! no static exports found */
  2726. /***/ (function(module, exports, __webpack_require__) {
  2727. "use strict";
  2728. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2729. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2730. Object.defineProperty(exports, "__esModule", {
  2731. value: true
  2732. });
  2733. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2734. exports.compileI18nJsonStr = compileI18nJsonStr;
  2735. exports.hasI18nJson = hasI18nJson;
  2736. exports.initVueI18n = initVueI18n;
  2737. exports.isI18nStr = isI18nStr;
  2738. exports.isString = void 0;
  2739. exports.normalizeLocale = normalizeLocale;
  2740. exports.parseI18nJson = parseI18nJson;
  2741. exports.resolveLocale = resolveLocale;
  2742. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2743. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2744. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2745. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2746. var isArray = Array.isArray;
  2747. var isObject = function isObject(val) {
  2748. return val !== null && (0, _typeof2.default)(val) === 'object';
  2749. };
  2750. var defaultDelimiters = ['{', '}'];
  2751. var BaseFormatter = /*#__PURE__*/function () {
  2752. function BaseFormatter() {
  2753. (0, _classCallCheck2.default)(this, BaseFormatter);
  2754. this._caches = Object.create(null);
  2755. }
  2756. (0, _createClass2.default)(BaseFormatter, [{
  2757. key: "interpolate",
  2758. value: function interpolate(message, values) {
  2759. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2760. if (!values) {
  2761. return [message];
  2762. }
  2763. var tokens = this._caches[message];
  2764. if (!tokens) {
  2765. tokens = parse(message, delimiters);
  2766. this._caches[message] = tokens;
  2767. }
  2768. return compile(tokens, values);
  2769. }
  2770. }]);
  2771. return BaseFormatter;
  2772. }();
  2773. exports.Formatter = BaseFormatter;
  2774. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2775. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2776. function parse(format, _ref) {
  2777. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2778. startDelimiter = _ref2[0],
  2779. endDelimiter = _ref2[1];
  2780. var tokens = [];
  2781. var position = 0;
  2782. var text = '';
  2783. while (position < format.length) {
  2784. var char = format[position++];
  2785. if (char === startDelimiter) {
  2786. if (text) {
  2787. tokens.push({
  2788. type: 'text',
  2789. value: text
  2790. });
  2791. }
  2792. text = '';
  2793. var sub = '';
  2794. char = format[position++];
  2795. while (char !== undefined && char !== endDelimiter) {
  2796. sub += char;
  2797. char = format[position++];
  2798. }
  2799. var isClosed = char === endDelimiter;
  2800. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2801. tokens.push({
  2802. value: sub,
  2803. type: type
  2804. });
  2805. }
  2806. // else if (char === '%') {
  2807. // // when found rails i18n syntax, skip text capture
  2808. // if (format[position] !== '{') {
  2809. // text += char
  2810. // }
  2811. // }
  2812. else {
  2813. text += char;
  2814. }
  2815. }
  2816. text && tokens.push({
  2817. type: 'text',
  2818. value: text
  2819. });
  2820. return tokens;
  2821. }
  2822. function compile(tokens, values) {
  2823. var compiled = [];
  2824. var index = 0;
  2825. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2826. if (mode === 'unknown') {
  2827. return compiled;
  2828. }
  2829. while (index < tokens.length) {
  2830. var token = tokens[index];
  2831. switch (token.type) {
  2832. case 'text':
  2833. compiled.push(token.value);
  2834. break;
  2835. case 'list':
  2836. compiled.push(values[parseInt(token.value, 10)]);
  2837. break;
  2838. case 'named':
  2839. if (mode === 'named') {
  2840. compiled.push(values[token.value]);
  2841. } else {
  2842. if (true) {
  2843. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2844. }
  2845. }
  2846. break;
  2847. case 'unknown':
  2848. if (true) {
  2849. console.warn("Detect 'unknown' type of token!");
  2850. }
  2851. break;
  2852. }
  2853. index++;
  2854. }
  2855. return compiled;
  2856. }
  2857. var LOCALE_ZH_HANS = 'zh-Hans';
  2858. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2859. var LOCALE_ZH_HANT = 'zh-Hant';
  2860. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2861. var LOCALE_EN = 'en';
  2862. exports.LOCALE_EN = LOCALE_EN;
  2863. var LOCALE_FR = 'fr';
  2864. exports.LOCALE_FR = LOCALE_FR;
  2865. var LOCALE_ES = 'es';
  2866. exports.LOCALE_ES = LOCALE_ES;
  2867. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2868. var hasOwn = function hasOwn(val, key) {
  2869. return hasOwnProperty.call(val, key);
  2870. };
  2871. var defaultFormatter = new BaseFormatter();
  2872. function include(str, parts) {
  2873. return !!parts.find(function (part) {
  2874. return str.indexOf(part) !== -1;
  2875. });
  2876. }
  2877. function startsWith(str, parts) {
  2878. return parts.find(function (part) {
  2879. return str.indexOf(part) === 0;
  2880. });
  2881. }
  2882. function normalizeLocale(locale, messages) {
  2883. if (!locale) {
  2884. return;
  2885. }
  2886. locale = locale.trim().replace(/_/g, '-');
  2887. if (messages && messages[locale]) {
  2888. return locale;
  2889. }
  2890. locale = locale.toLowerCase();
  2891. if (locale.indexOf('zh') === 0) {
  2892. if (locale.indexOf('-hans') > -1) {
  2893. return LOCALE_ZH_HANS;
  2894. }
  2895. if (locale.indexOf('-hant') > -1) {
  2896. return LOCALE_ZH_HANT;
  2897. }
  2898. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2899. return LOCALE_ZH_HANT;
  2900. }
  2901. return LOCALE_ZH_HANS;
  2902. }
  2903. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2904. if (lang) {
  2905. return lang;
  2906. }
  2907. }
  2908. var I18n = /*#__PURE__*/function () {
  2909. function I18n(_ref3) {
  2910. var locale = _ref3.locale,
  2911. fallbackLocale = _ref3.fallbackLocale,
  2912. messages = _ref3.messages,
  2913. watcher = _ref3.watcher,
  2914. formater = _ref3.formater;
  2915. (0, _classCallCheck2.default)(this, I18n);
  2916. this.locale = LOCALE_EN;
  2917. this.fallbackLocale = LOCALE_EN;
  2918. this.message = {};
  2919. this.messages = {};
  2920. this.watchers = [];
  2921. if (fallbackLocale) {
  2922. this.fallbackLocale = fallbackLocale;
  2923. }
  2924. this.formater = formater || defaultFormatter;
  2925. this.messages = messages || {};
  2926. this.setLocale(locale || LOCALE_EN);
  2927. if (watcher) {
  2928. this.watchLocale(watcher);
  2929. }
  2930. }
  2931. (0, _createClass2.default)(I18n, [{
  2932. key: "setLocale",
  2933. value: function setLocale(locale) {
  2934. var _this = this;
  2935. var oldLocale = this.locale;
  2936. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2937. if (!this.messages[this.locale]) {
  2938. // 可能初始化时不存在
  2939. this.messages[this.locale] = {};
  2940. }
  2941. this.message = this.messages[this.locale];
  2942. // 仅发生变化时,通知
  2943. if (oldLocale !== this.locale) {
  2944. this.watchers.forEach(function (watcher) {
  2945. watcher(_this.locale, oldLocale);
  2946. });
  2947. }
  2948. }
  2949. }, {
  2950. key: "getLocale",
  2951. value: function getLocale() {
  2952. return this.locale;
  2953. }
  2954. }, {
  2955. key: "watchLocale",
  2956. value: function watchLocale(fn) {
  2957. var _this2 = this;
  2958. var index = this.watchers.push(fn) - 1;
  2959. return function () {
  2960. _this2.watchers.splice(index, 1);
  2961. };
  2962. }
  2963. }, {
  2964. key: "add",
  2965. value: function add(locale, message) {
  2966. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2967. var curMessages = this.messages[locale];
  2968. if (curMessages) {
  2969. if (override) {
  2970. Object.assign(curMessages, message);
  2971. } else {
  2972. Object.keys(message).forEach(function (key) {
  2973. if (!hasOwn(curMessages, key)) {
  2974. curMessages[key] = message[key];
  2975. }
  2976. });
  2977. }
  2978. } else {
  2979. this.messages[locale] = message;
  2980. }
  2981. }
  2982. }, {
  2983. key: "f",
  2984. value: function f(message, values, delimiters) {
  2985. return this.formater.interpolate(message, values, delimiters).join('');
  2986. }
  2987. }, {
  2988. key: "t",
  2989. value: function t(key, locale, values) {
  2990. var message = this.message;
  2991. if (typeof locale === 'string') {
  2992. locale = normalizeLocale(locale, this.messages);
  2993. locale && (message = this.messages[locale]);
  2994. } else {
  2995. values = locale;
  2996. }
  2997. if (!hasOwn(message, key)) {
  2998. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2999. return key;
  3000. }
  3001. return this.formater.interpolate(message[key], values).join('');
  3002. }
  3003. }]);
  3004. return I18n;
  3005. }();
  3006. exports.I18n = I18n;
  3007. function watchAppLocale(appVm, i18n) {
  3008. // 需要保证 watch 的触发在组件渲染之前
  3009. if (appVm.$watchLocale) {
  3010. // vue2
  3011. appVm.$watchLocale(function (newLocale) {
  3012. i18n.setLocale(newLocale);
  3013. });
  3014. } else {
  3015. appVm.$watch(function () {
  3016. return appVm.$locale;
  3017. }, function (newLocale) {
  3018. i18n.setLocale(newLocale);
  3019. });
  3020. }
  3021. }
  3022. function getDefaultLocale() {
  3023. if (typeof uni !== 'undefined' && uni.getLocale) {
  3024. return uni.getLocale();
  3025. }
  3026. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3027. if (typeof global !== 'undefined' && global.getLocale) {
  3028. return global.getLocale();
  3029. }
  3030. return LOCALE_EN;
  3031. }
  3032. function initVueI18n(locale) {
  3033. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3034. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3035. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3036. // 兼容旧版本入参
  3037. if (typeof locale !== 'string') {
  3038. var _ref4 = [messages, locale];
  3039. locale = _ref4[0];
  3040. messages = _ref4[1];
  3041. }
  3042. if (typeof locale !== 'string') {
  3043. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3044. locale = getDefaultLocale();
  3045. }
  3046. if (typeof fallbackLocale !== 'string') {
  3047. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3048. }
  3049. var i18n = new I18n({
  3050. locale: locale,
  3051. fallbackLocale: fallbackLocale,
  3052. messages: messages,
  3053. watcher: watcher
  3054. });
  3055. var _t = function t(key, values) {
  3056. if (typeof getApp !== 'function') {
  3057. // app view
  3058. /* eslint-disable no-func-assign */
  3059. _t = function t(key, values) {
  3060. return i18n.t(key, values);
  3061. };
  3062. } else {
  3063. var isWatchedAppLocale = false;
  3064. _t = function t(key, values) {
  3065. var appVm = getApp().$vm;
  3066. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3067. // options: {
  3068. // type: Array,
  3069. // default () {
  3070. // return [{
  3071. // icon: 'shop',
  3072. // text: t("uni-goods-nav.options.shop"),
  3073. // }, {
  3074. // icon: 'cart',
  3075. // text: t("uni-goods-nav.options.cart")
  3076. // }]
  3077. // }
  3078. // },
  3079. if (appVm) {
  3080. // 触发响应式
  3081. appVm.$locale;
  3082. if (!isWatchedAppLocale) {
  3083. isWatchedAppLocale = true;
  3084. watchAppLocale(appVm, i18n);
  3085. }
  3086. }
  3087. return i18n.t(key, values);
  3088. };
  3089. }
  3090. return _t(key, values);
  3091. };
  3092. return {
  3093. i18n: i18n,
  3094. f: function f(message, values, delimiters) {
  3095. return i18n.f(message, values, delimiters);
  3096. },
  3097. t: function t(key, values) {
  3098. return _t(key, values);
  3099. },
  3100. add: function add(locale, message) {
  3101. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3102. return i18n.add(locale, message, override);
  3103. },
  3104. watch: function watch(fn) {
  3105. return i18n.watchLocale(fn);
  3106. },
  3107. getLocale: function getLocale() {
  3108. return i18n.getLocale();
  3109. },
  3110. setLocale: function setLocale(newLocale) {
  3111. return i18n.setLocale(newLocale);
  3112. }
  3113. };
  3114. }
  3115. var isString = function isString(val) {
  3116. return typeof val === 'string';
  3117. };
  3118. exports.isString = isString;
  3119. var formater;
  3120. function hasI18nJson(jsonObj, delimiters) {
  3121. if (!formater) {
  3122. formater = new BaseFormatter();
  3123. }
  3124. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3125. var value = jsonObj[key];
  3126. if (isString(value)) {
  3127. if (isI18nStr(value, delimiters)) {
  3128. return true;
  3129. }
  3130. } else {
  3131. return hasI18nJson(value, delimiters);
  3132. }
  3133. });
  3134. }
  3135. function parseI18nJson(jsonObj, values, delimiters) {
  3136. if (!formater) {
  3137. formater = new BaseFormatter();
  3138. }
  3139. walkJsonObj(jsonObj, function (jsonObj, key) {
  3140. var value = jsonObj[key];
  3141. if (isString(value)) {
  3142. if (isI18nStr(value, delimiters)) {
  3143. jsonObj[key] = compileStr(value, values, delimiters);
  3144. }
  3145. } else {
  3146. parseI18nJson(value, values, delimiters);
  3147. }
  3148. });
  3149. return jsonObj;
  3150. }
  3151. function compileI18nJsonStr(jsonStr, _ref5) {
  3152. var locale = _ref5.locale,
  3153. locales = _ref5.locales,
  3154. delimiters = _ref5.delimiters;
  3155. if (!isI18nStr(jsonStr, delimiters)) {
  3156. return jsonStr;
  3157. }
  3158. if (!formater) {
  3159. formater = new BaseFormatter();
  3160. }
  3161. var localeValues = [];
  3162. Object.keys(locales).forEach(function (name) {
  3163. if (name !== locale) {
  3164. localeValues.push({
  3165. locale: name,
  3166. values: locales[name]
  3167. });
  3168. }
  3169. });
  3170. localeValues.unshift({
  3171. locale: locale,
  3172. values: locales[locale]
  3173. });
  3174. try {
  3175. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3176. } catch (e) {}
  3177. return jsonStr;
  3178. }
  3179. function isI18nStr(value, delimiters) {
  3180. return value.indexOf(delimiters[0]) > -1;
  3181. }
  3182. function compileStr(value, values, delimiters) {
  3183. return formater.interpolate(value, values, delimiters).join('');
  3184. }
  3185. function compileValue(jsonObj, key, localeValues, delimiters) {
  3186. var value = jsonObj[key];
  3187. if (isString(value)) {
  3188. // 存在国际化
  3189. if (isI18nStr(value, delimiters)) {
  3190. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3191. if (localeValues.length > 1) {
  3192. // 格式化国际化语言
  3193. var valueLocales = jsonObj[key + 'Locales'] = {};
  3194. localeValues.forEach(function (localValue) {
  3195. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3196. });
  3197. }
  3198. }
  3199. } else {
  3200. compileJsonObj(value, localeValues, delimiters);
  3201. }
  3202. }
  3203. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3204. walkJsonObj(jsonObj, function (jsonObj, key) {
  3205. compileValue(jsonObj, key, localeValues, delimiters);
  3206. });
  3207. return jsonObj;
  3208. }
  3209. function walkJsonObj(jsonObj, walk) {
  3210. if (isArray(jsonObj)) {
  3211. for (var i = 0; i < jsonObj.length; i++) {
  3212. if (walk(jsonObj, i)) {
  3213. return true;
  3214. }
  3215. }
  3216. } else if (isObject(jsonObj)) {
  3217. for (var key in jsonObj) {
  3218. if (walk(jsonObj, key)) {
  3219. return true;
  3220. }
  3221. }
  3222. }
  3223. return false;
  3224. }
  3225. function resolveLocale(locales) {
  3226. return function (locale) {
  3227. if (!locale) {
  3228. return locale;
  3229. }
  3230. locale = normalizeLocale(locale) || locale;
  3231. return resolveLocaleChain(locale).find(function (locale) {
  3232. return locales.indexOf(locale) > -1;
  3233. });
  3234. };
  3235. }
  3236. function resolveLocaleChain(locale) {
  3237. var chain = [];
  3238. var tokens = locale.split('-');
  3239. while (tokens.length) {
  3240. chain.push(tokens.join('-'));
  3241. tokens.pop();
  3242. }
  3243. return chain;
  3244. }
  3245. /* 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)))
  3246. /***/ }),
  3247. /* 23 */
  3248. /*!***************************************************************!*\
  3249. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3250. \***************************************************************/
  3251. /*! no static exports found */
  3252. /***/ (function(module, exports) {
  3253. function _classCallCheck(instance, Constructor) {
  3254. if (!(instance instanceof Constructor)) {
  3255. throw new TypeError("Cannot call a class as a function");
  3256. }
  3257. }
  3258. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3259. /***/ }),
  3260. /* 24 */
  3261. /*!************************************************************!*\
  3262. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3263. \************************************************************/
  3264. /*! no static exports found */
  3265. /***/ (function(module, exports, __webpack_require__) {
  3266. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3267. function _defineProperties(target, props) {
  3268. for (var i = 0; i < props.length; i++) {
  3269. var descriptor = props[i];
  3270. descriptor.enumerable = descriptor.enumerable || false;
  3271. descriptor.configurable = true;
  3272. if ("value" in descriptor) descriptor.writable = true;
  3273. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3274. }
  3275. }
  3276. function _createClass(Constructor, protoProps, staticProps) {
  3277. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3278. if (staticProps) _defineProperties(Constructor, staticProps);
  3279. Object.defineProperty(Constructor, "prototype", {
  3280. writable: false
  3281. });
  3282. return Constructor;
  3283. }
  3284. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3285. /***/ }),
  3286. /* 25 */
  3287. /*!******************************************************************************************!*\
  3288. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3289. \******************************************************************************************/
  3290. /*! exports provided: default */
  3291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3292. "use strict";
  3293. __webpack_require__.r(__webpack_exports__);
  3294. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3295. * Vue.js v2.6.11
  3296. * (c) 2014-2022 Evan You
  3297. * Released under the MIT License.
  3298. */
  3299. /* */
  3300. var emptyObject = Object.freeze({});
  3301. // These helpers produce better VM code in JS engines due to their
  3302. // explicitness and function inlining.
  3303. function isUndef (v) {
  3304. return v === undefined || v === null
  3305. }
  3306. function isDef (v) {
  3307. return v !== undefined && v !== null
  3308. }
  3309. function isTrue (v) {
  3310. return v === true
  3311. }
  3312. function isFalse (v) {
  3313. return v === false
  3314. }
  3315. /**
  3316. * Check if value is primitive.
  3317. */
  3318. function isPrimitive (value) {
  3319. return (
  3320. typeof value === 'string' ||
  3321. typeof value === 'number' ||
  3322. // $flow-disable-line
  3323. typeof value === 'symbol' ||
  3324. typeof value === 'boolean'
  3325. )
  3326. }
  3327. /**
  3328. * Quick object check - this is primarily used to tell
  3329. * Objects from primitive values when we know the value
  3330. * is a JSON-compliant type.
  3331. */
  3332. function isObject (obj) {
  3333. return obj !== null && typeof obj === 'object'
  3334. }
  3335. /**
  3336. * Get the raw type string of a value, e.g., [object Object].
  3337. */
  3338. var _toString = Object.prototype.toString;
  3339. function toRawType (value) {
  3340. return _toString.call(value).slice(8, -1)
  3341. }
  3342. /**
  3343. * Strict object type check. Only returns true
  3344. * for plain JavaScript objects.
  3345. */
  3346. function isPlainObject (obj) {
  3347. return _toString.call(obj) === '[object Object]'
  3348. }
  3349. function isRegExp (v) {
  3350. return _toString.call(v) === '[object RegExp]'
  3351. }
  3352. /**
  3353. * Check if val is a valid array index.
  3354. */
  3355. function isValidArrayIndex (val) {
  3356. var n = parseFloat(String(val));
  3357. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3358. }
  3359. function isPromise (val) {
  3360. return (
  3361. isDef(val) &&
  3362. typeof val.then === 'function' &&
  3363. typeof val.catch === 'function'
  3364. )
  3365. }
  3366. /**
  3367. * Convert a value to a string that is actually rendered.
  3368. */
  3369. function toString (val) {
  3370. return val == null
  3371. ? ''
  3372. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3373. ? JSON.stringify(val, null, 2)
  3374. : String(val)
  3375. }
  3376. /**
  3377. * Convert an input value to a number for persistence.
  3378. * If the conversion fails, return original string.
  3379. */
  3380. function toNumber (val) {
  3381. var n = parseFloat(val);
  3382. return isNaN(n) ? val : n
  3383. }
  3384. /**
  3385. * Make a map and return a function for checking if a key
  3386. * is in that map.
  3387. */
  3388. function makeMap (
  3389. str,
  3390. expectsLowerCase
  3391. ) {
  3392. var map = Object.create(null);
  3393. var list = str.split(',');
  3394. for (var i = 0; i < list.length; i++) {
  3395. map[list[i]] = true;
  3396. }
  3397. return expectsLowerCase
  3398. ? function (val) { return map[val.toLowerCase()]; }
  3399. : function (val) { return map[val]; }
  3400. }
  3401. /**
  3402. * Check if a tag is a built-in tag.
  3403. */
  3404. var isBuiltInTag = makeMap('slot,component', true);
  3405. /**
  3406. * Check if an attribute is a reserved attribute.
  3407. */
  3408. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3409. /**
  3410. * Remove an item from an array.
  3411. */
  3412. function remove (arr, item) {
  3413. if (arr.length) {
  3414. var index = arr.indexOf(item);
  3415. if (index > -1) {
  3416. return arr.splice(index, 1)
  3417. }
  3418. }
  3419. }
  3420. /**
  3421. * Check whether an object has the property.
  3422. */
  3423. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3424. function hasOwn (obj, key) {
  3425. return hasOwnProperty.call(obj, key)
  3426. }
  3427. /**
  3428. * Create a cached version of a pure function.
  3429. */
  3430. function cached (fn) {
  3431. var cache = Object.create(null);
  3432. return (function cachedFn (str) {
  3433. var hit = cache[str];
  3434. return hit || (cache[str] = fn(str))
  3435. })
  3436. }
  3437. /**
  3438. * Camelize a hyphen-delimited string.
  3439. */
  3440. var camelizeRE = /-(\w)/g;
  3441. var camelize = cached(function (str) {
  3442. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3443. });
  3444. /**
  3445. * Capitalize a string.
  3446. */
  3447. var capitalize = cached(function (str) {
  3448. return str.charAt(0).toUpperCase() + str.slice(1)
  3449. });
  3450. /**
  3451. * Hyphenate a camelCase string.
  3452. */
  3453. var hyphenateRE = /\B([A-Z])/g;
  3454. var hyphenate = cached(function (str) {
  3455. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3456. });
  3457. /**
  3458. * Simple bind polyfill for environments that do not support it,
  3459. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3460. * since native bind is now performant enough in most browsers.
  3461. * But removing it would mean breaking code that was able to run in
  3462. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3463. */
  3464. /* istanbul ignore next */
  3465. function polyfillBind (fn, ctx) {
  3466. function boundFn (a) {
  3467. var l = arguments.length;
  3468. return l
  3469. ? l > 1
  3470. ? fn.apply(ctx, arguments)
  3471. : fn.call(ctx, a)
  3472. : fn.call(ctx)
  3473. }
  3474. boundFn._length = fn.length;
  3475. return boundFn
  3476. }
  3477. function nativeBind (fn, ctx) {
  3478. return fn.bind(ctx)
  3479. }
  3480. var bind = Function.prototype.bind
  3481. ? nativeBind
  3482. : polyfillBind;
  3483. /**
  3484. * Convert an Array-like object to a real Array.
  3485. */
  3486. function toArray (list, start) {
  3487. start = start || 0;
  3488. var i = list.length - start;
  3489. var ret = new Array(i);
  3490. while (i--) {
  3491. ret[i] = list[i + start];
  3492. }
  3493. return ret
  3494. }
  3495. /**
  3496. * Mix properties into target object.
  3497. */
  3498. function extend (to, _from) {
  3499. for (var key in _from) {
  3500. to[key] = _from[key];
  3501. }
  3502. return to
  3503. }
  3504. /**
  3505. * Merge an Array of Objects into a single Object.
  3506. */
  3507. function toObject (arr) {
  3508. var res = {};
  3509. for (var i = 0; i < arr.length; i++) {
  3510. if (arr[i]) {
  3511. extend(res, arr[i]);
  3512. }
  3513. }
  3514. return res
  3515. }
  3516. /* eslint-disable no-unused-vars */
  3517. /**
  3518. * Perform no operation.
  3519. * Stubbing args to make Flow happy without leaving useless transpiled code
  3520. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3521. */
  3522. function noop (a, b, c) {}
  3523. /**
  3524. * Always return false.
  3525. */
  3526. var no = function (a, b, c) { return false; };
  3527. /* eslint-enable no-unused-vars */
  3528. /**
  3529. * Return the same value.
  3530. */
  3531. var identity = function (_) { return _; };
  3532. /**
  3533. * Check if two values are loosely equal - that is,
  3534. * if they are plain objects, do they have the same shape?
  3535. */
  3536. function looseEqual (a, b) {
  3537. if (a === b) { return true }
  3538. var isObjectA = isObject(a);
  3539. var isObjectB = isObject(b);
  3540. if (isObjectA && isObjectB) {
  3541. try {
  3542. var isArrayA = Array.isArray(a);
  3543. var isArrayB = Array.isArray(b);
  3544. if (isArrayA && isArrayB) {
  3545. return a.length === b.length && a.every(function (e, i) {
  3546. return looseEqual(e, b[i])
  3547. })
  3548. } else if (a instanceof Date && b instanceof Date) {
  3549. return a.getTime() === b.getTime()
  3550. } else if (!isArrayA && !isArrayB) {
  3551. var keysA = Object.keys(a);
  3552. var keysB = Object.keys(b);
  3553. return keysA.length === keysB.length && keysA.every(function (key) {
  3554. return looseEqual(a[key], b[key])
  3555. })
  3556. } else {
  3557. /* istanbul ignore next */
  3558. return false
  3559. }
  3560. } catch (e) {
  3561. /* istanbul ignore next */
  3562. return false
  3563. }
  3564. } else if (!isObjectA && !isObjectB) {
  3565. return String(a) === String(b)
  3566. } else {
  3567. return false
  3568. }
  3569. }
  3570. /**
  3571. * Return the first index at which a loosely equal value can be
  3572. * found in the array (if value is a plain object, the array must
  3573. * contain an object of the same shape), or -1 if it is not present.
  3574. */
  3575. function looseIndexOf (arr, val) {
  3576. for (var i = 0; i < arr.length; i++) {
  3577. if (looseEqual(arr[i], val)) { return i }
  3578. }
  3579. return -1
  3580. }
  3581. /**
  3582. * Ensure a function is called only once.
  3583. */
  3584. function once (fn) {
  3585. var called = false;
  3586. return function () {
  3587. if (!called) {
  3588. called = true;
  3589. fn.apply(this, arguments);
  3590. }
  3591. }
  3592. }
  3593. var ASSET_TYPES = [
  3594. 'component',
  3595. 'directive',
  3596. 'filter'
  3597. ];
  3598. var LIFECYCLE_HOOKS = [
  3599. 'beforeCreate',
  3600. 'created',
  3601. 'beforeMount',
  3602. 'mounted',
  3603. 'beforeUpdate',
  3604. 'updated',
  3605. 'beforeDestroy',
  3606. 'destroyed',
  3607. 'activated',
  3608. 'deactivated',
  3609. 'errorCaptured',
  3610. 'serverPrefetch'
  3611. ];
  3612. /* */
  3613. var config = ({
  3614. /**
  3615. * Option merge strategies (used in core/util/options)
  3616. */
  3617. // $flow-disable-line
  3618. optionMergeStrategies: Object.create(null),
  3619. /**
  3620. * Whether to suppress warnings.
  3621. */
  3622. silent: false,
  3623. /**
  3624. * Show production mode tip message on boot?
  3625. */
  3626. productionTip: "development" !== 'production',
  3627. /**
  3628. * Whether to enable devtools
  3629. */
  3630. devtools: "development" !== 'production',
  3631. /**
  3632. * Whether to record perf
  3633. */
  3634. performance: false,
  3635. /**
  3636. * Error handler for watcher errors
  3637. */
  3638. errorHandler: null,
  3639. /**
  3640. * Warn handler for watcher warns
  3641. */
  3642. warnHandler: null,
  3643. /**
  3644. * Ignore certain custom elements
  3645. */
  3646. ignoredElements: [],
  3647. /**
  3648. * Custom user key aliases for v-on
  3649. */
  3650. // $flow-disable-line
  3651. keyCodes: Object.create(null),
  3652. /**
  3653. * Check if a tag is reserved so that it cannot be registered as a
  3654. * component. This is platform-dependent and may be overwritten.
  3655. */
  3656. isReservedTag: no,
  3657. /**
  3658. * Check if an attribute is reserved so that it cannot be used as a component
  3659. * prop. This is platform-dependent and may be overwritten.
  3660. */
  3661. isReservedAttr: no,
  3662. /**
  3663. * Check if a tag is an unknown element.
  3664. * Platform-dependent.
  3665. */
  3666. isUnknownElement: no,
  3667. /**
  3668. * Get the namespace of an element
  3669. */
  3670. getTagNamespace: noop,
  3671. /**
  3672. * Parse the real tag name for the specific platform.
  3673. */
  3674. parsePlatformTagName: identity,
  3675. /**
  3676. * Check if an attribute must be bound using property, e.g. value
  3677. * Platform-dependent.
  3678. */
  3679. mustUseProp: no,
  3680. /**
  3681. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3682. * This will significantly reduce performance if set to false.
  3683. */
  3684. async: true,
  3685. /**
  3686. * Exposed for legacy reasons
  3687. */
  3688. _lifecycleHooks: LIFECYCLE_HOOKS
  3689. });
  3690. /* */
  3691. /**
  3692. * unicode letters used for parsing html tags, component names and property paths.
  3693. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3694. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3695. */
  3696. 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/;
  3697. /**
  3698. * Check if a string starts with $ or _
  3699. */
  3700. function isReserved (str) {
  3701. var c = (str + '').charCodeAt(0);
  3702. return c === 0x24 || c === 0x5F
  3703. }
  3704. /**
  3705. * Define a property.
  3706. */
  3707. function def (obj, key, val, enumerable) {
  3708. Object.defineProperty(obj, key, {
  3709. value: val,
  3710. enumerable: !!enumerable,
  3711. writable: true,
  3712. configurable: true
  3713. });
  3714. }
  3715. /**
  3716. * Parse simple path.
  3717. */
  3718. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3719. function parsePath (path) {
  3720. if (bailRE.test(path)) {
  3721. return
  3722. }
  3723. var segments = path.split('.');
  3724. return function (obj) {
  3725. for (var i = 0; i < segments.length; i++) {
  3726. if (!obj) { return }
  3727. obj = obj[segments[i]];
  3728. }
  3729. return obj
  3730. }
  3731. }
  3732. /* */
  3733. // can we use __proto__?
  3734. var hasProto = '__proto__' in {};
  3735. // Browser environment sniffing
  3736. var inBrowser = typeof window !== 'undefined';
  3737. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3738. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3739. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3740. var isIE = UA && /msie|trident/.test(UA);
  3741. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3742. var isEdge = UA && UA.indexOf('edge/') > 0;
  3743. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3744. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3745. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3746. var isPhantomJS = UA && /phantomjs/.test(UA);
  3747. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3748. // Firefox has a "watch" function on Object.prototype...
  3749. var nativeWatch = ({}).watch;
  3750. if (inBrowser) {
  3751. try {
  3752. var opts = {};
  3753. Object.defineProperty(opts, 'passive', ({
  3754. get: function get () {
  3755. }
  3756. })); // https://github.com/facebook/flow/issues/285
  3757. window.addEventListener('test-passive', null, opts);
  3758. } catch (e) {}
  3759. }
  3760. // this needs to be lazy-evaled because vue may be required before
  3761. // vue-server-renderer can set VUE_ENV
  3762. var _isServer;
  3763. var isServerRendering = function () {
  3764. if (_isServer === undefined) {
  3765. /* istanbul ignore if */
  3766. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3767. // detect presence of vue-server-renderer and avoid
  3768. // Webpack shimming the process
  3769. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3770. } else {
  3771. _isServer = false;
  3772. }
  3773. }
  3774. return _isServer
  3775. };
  3776. // detect devtools
  3777. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3778. /* istanbul ignore next */
  3779. function isNative (Ctor) {
  3780. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3781. }
  3782. var hasSymbol =
  3783. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3784. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3785. var _Set;
  3786. /* istanbul ignore if */ // $flow-disable-line
  3787. if (typeof Set !== 'undefined' && isNative(Set)) {
  3788. // use native Set when available.
  3789. _Set = Set;
  3790. } else {
  3791. // a non-standard Set polyfill that only works with primitive keys.
  3792. _Set = /*@__PURE__*/(function () {
  3793. function Set () {
  3794. this.set = Object.create(null);
  3795. }
  3796. Set.prototype.has = function has (key) {
  3797. return this.set[key] === true
  3798. };
  3799. Set.prototype.add = function add (key) {
  3800. this.set[key] = true;
  3801. };
  3802. Set.prototype.clear = function clear () {
  3803. this.set = Object.create(null);
  3804. };
  3805. return Set;
  3806. }());
  3807. }
  3808. /* */
  3809. var warn = noop;
  3810. var tip = noop;
  3811. var generateComponentTrace = (noop); // work around flow check
  3812. var formatComponentName = (noop);
  3813. if (true) {
  3814. var hasConsole = typeof console !== 'undefined';
  3815. var classifyRE = /(?:^|[-_])(\w)/g;
  3816. var classify = function (str) { return str
  3817. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3818. .replace(/[-_]/g, ''); };
  3819. warn = function (msg, vm) {
  3820. var trace = vm ? generateComponentTrace(vm) : '';
  3821. if (config.warnHandler) {
  3822. config.warnHandler.call(null, msg, vm, trace);
  3823. } else if (hasConsole && (!config.silent)) {
  3824. console.error(("[Vue warn]: " + msg + trace));
  3825. }
  3826. };
  3827. tip = function (msg, vm) {
  3828. if (hasConsole && (!config.silent)) {
  3829. console.warn("[Vue tip]: " + msg + (
  3830. vm ? generateComponentTrace(vm) : ''
  3831. ));
  3832. }
  3833. };
  3834. formatComponentName = function (vm, includeFile) {
  3835. if (vm.$root === vm) {
  3836. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3837. return ('') + vm.$options.__file
  3838. }
  3839. return '<Root>'
  3840. }
  3841. var options = typeof vm === 'function' && vm.cid != null
  3842. ? vm.options
  3843. : vm._isVue
  3844. ? vm.$options || vm.constructor.options
  3845. : vm;
  3846. var name = options.name || options._componentTag;
  3847. var file = options.__file;
  3848. if (!name && file) {
  3849. var match = file.match(/([^/\\]+)\.vue$/);
  3850. name = match && match[1];
  3851. }
  3852. return (
  3853. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3854. (file && includeFile !== false ? (" at " + file) : '')
  3855. )
  3856. };
  3857. var repeat = function (str, n) {
  3858. var res = '';
  3859. while (n) {
  3860. if (n % 2 === 1) { res += str; }
  3861. if (n > 1) { str += str; }
  3862. n >>= 1;
  3863. }
  3864. return res
  3865. };
  3866. generateComponentTrace = function (vm) {
  3867. if (vm._isVue && vm.$parent) {
  3868. var tree = [];
  3869. var currentRecursiveSequence = 0;
  3870. while (vm && vm.$options.name !== 'PageBody') {
  3871. if (tree.length > 0) {
  3872. var last = tree[tree.length - 1];
  3873. if (last.constructor === vm.constructor) {
  3874. currentRecursiveSequence++;
  3875. vm = vm.$parent;
  3876. continue
  3877. } else if (currentRecursiveSequence > 0) {
  3878. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3879. currentRecursiveSequence = 0;
  3880. }
  3881. }
  3882. !vm.$options.isReserved && tree.push(vm);
  3883. vm = vm.$parent;
  3884. }
  3885. return '\n\nfound in\n\n' + tree
  3886. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3887. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3888. : formatComponentName(vm))); })
  3889. .join('\n')
  3890. } else {
  3891. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3892. }
  3893. };
  3894. }
  3895. /* */
  3896. var uid = 0;
  3897. /**
  3898. * A dep is an observable that can have multiple
  3899. * directives subscribing to it.
  3900. */
  3901. var Dep = function Dep () {
  3902. this.id = uid++;
  3903. this.subs = [];
  3904. };
  3905. Dep.prototype.addSub = function addSub (sub) {
  3906. this.subs.push(sub);
  3907. };
  3908. Dep.prototype.removeSub = function removeSub (sub) {
  3909. remove(this.subs, sub);
  3910. };
  3911. Dep.prototype.depend = function depend () {
  3912. if (Dep.SharedObject.target) {
  3913. Dep.SharedObject.target.addDep(this);
  3914. }
  3915. };
  3916. Dep.prototype.notify = function notify () {
  3917. // stabilize the subscriber list first
  3918. var subs = this.subs.slice();
  3919. if ( true && !config.async) {
  3920. // subs aren't sorted in scheduler if not running async
  3921. // we need to sort them now to make sure they fire in correct
  3922. // order
  3923. subs.sort(function (a, b) { return a.id - b.id; });
  3924. }
  3925. for (var i = 0, l = subs.length; i < l; i++) {
  3926. subs[i].update();
  3927. }
  3928. };
  3929. // The current target watcher being evaluated.
  3930. // This is globally unique because only one watcher
  3931. // can be evaluated at a time.
  3932. // fixed by xxxxxx (nvue shared vuex)
  3933. /* eslint-disable no-undef */
  3934. Dep.SharedObject = {};
  3935. Dep.SharedObject.target = null;
  3936. Dep.SharedObject.targetStack = [];
  3937. function pushTarget (target) {
  3938. Dep.SharedObject.targetStack.push(target);
  3939. Dep.SharedObject.target = target;
  3940. Dep.target = target;
  3941. }
  3942. function popTarget () {
  3943. Dep.SharedObject.targetStack.pop();
  3944. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3945. Dep.target = Dep.SharedObject.target;
  3946. }
  3947. /* */
  3948. var VNode = function VNode (
  3949. tag,
  3950. data,
  3951. children,
  3952. text,
  3953. elm,
  3954. context,
  3955. componentOptions,
  3956. asyncFactory
  3957. ) {
  3958. this.tag = tag;
  3959. this.data = data;
  3960. this.children = children;
  3961. this.text = text;
  3962. this.elm = elm;
  3963. this.ns = undefined;
  3964. this.context = context;
  3965. this.fnContext = undefined;
  3966. this.fnOptions = undefined;
  3967. this.fnScopeId = undefined;
  3968. this.key = data && data.key;
  3969. this.componentOptions = componentOptions;
  3970. this.componentInstance = undefined;
  3971. this.parent = undefined;
  3972. this.raw = false;
  3973. this.isStatic = false;
  3974. this.isRootInsert = true;
  3975. this.isComment = false;
  3976. this.isCloned = false;
  3977. this.isOnce = false;
  3978. this.asyncFactory = asyncFactory;
  3979. this.asyncMeta = undefined;
  3980. this.isAsyncPlaceholder = false;
  3981. };
  3982. var prototypeAccessors = { child: { configurable: true } };
  3983. // DEPRECATED: alias for componentInstance for backwards compat.
  3984. /* istanbul ignore next */
  3985. prototypeAccessors.child.get = function () {
  3986. return this.componentInstance
  3987. };
  3988. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3989. var createEmptyVNode = function (text) {
  3990. if ( text === void 0 ) text = '';
  3991. var node = new VNode();
  3992. node.text = text;
  3993. node.isComment = true;
  3994. return node
  3995. };
  3996. function createTextVNode (val) {
  3997. return new VNode(undefined, undefined, undefined, String(val))
  3998. }
  3999. // optimized shallow clone
  4000. // used for static nodes and slot nodes because they may be reused across
  4001. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4002. // on their elm reference.
  4003. function cloneVNode (vnode) {
  4004. var cloned = new VNode(
  4005. vnode.tag,
  4006. vnode.data,
  4007. // #7975
  4008. // clone children array to avoid mutating original in case of cloning
  4009. // a child.
  4010. vnode.children && vnode.children.slice(),
  4011. vnode.text,
  4012. vnode.elm,
  4013. vnode.context,
  4014. vnode.componentOptions,
  4015. vnode.asyncFactory
  4016. );
  4017. cloned.ns = vnode.ns;
  4018. cloned.isStatic = vnode.isStatic;
  4019. cloned.key = vnode.key;
  4020. cloned.isComment = vnode.isComment;
  4021. cloned.fnContext = vnode.fnContext;
  4022. cloned.fnOptions = vnode.fnOptions;
  4023. cloned.fnScopeId = vnode.fnScopeId;
  4024. cloned.asyncMeta = vnode.asyncMeta;
  4025. cloned.isCloned = true;
  4026. return cloned
  4027. }
  4028. /*
  4029. * not type checking this file because flow doesn't play well with
  4030. * dynamically accessing methods on Array prototype
  4031. */
  4032. var arrayProto = Array.prototype;
  4033. var arrayMethods = Object.create(arrayProto);
  4034. var methodsToPatch = [
  4035. 'push',
  4036. 'pop',
  4037. 'shift',
  4038. 'unshift',
  4039. 'splice',
  4040. 'sort',
  4041. 'reverse'
  4042. ];
  4043. /**
  4044. * Intercept mutating methods and emit events
  4045. */
  4046. methodsToPatch.forEach(function (method) {
  4047. // cache original method
  4048. var original = arrayProto[method];
  4049. def(arrayMethods, method, function mutator () {
  4050. var args = [], len = arguments.length;
  4051. while ( len-- ) args[ len ] = arguments[ len ];
  4052. var result = original.apply(this, args);
  4053. var ob = this.__ob__;
  4054. var inserted;
  4055. switch (method) {
  4056. case 'push':
  4057. case 'unshift':
  4058. inserted = args;
  4059. break
  4060. case 'splice':
  4061. inserted = args.slice(2);
  4062. break
  4063. }
  4064. if (inserted) { ob.observeArray(inserted); }
  4065. // notify change
  4066. ob.dep.notify();
  4067. return result
  4068. });
  4069. });
  4070. /* */
  4071. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4072. /**
  4073. * In some cases we may want to disable observation inside a component's
  4074. * update computation.
  4075. */
  4076. var shouldObserve = true;
  4077. function toggleObserving (value) {
  4078. shouldObserve = value;
  4079. }
  4080. /**
  4081. * Observer class that is attached to each observed
  4082. * object. Once attached, the observer converts the target
  4083. * object's property keys into getter/setters that
  4084. * collect dependencies and dispatch updates.
  4085. */
  4086. var Observer = function Observer (value) {
  4087. this.value = value;
  4088. this.dep = new Dep();
  4089. this.vmCount = 0;
  4090. def(value, '__ob__', this);
  4091. if (Array.isArray(value)) {
  4092. if (hasProto) {
  4093. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4094. if(value.push !== value.__proto__.push){
  4095. copyAugment(value, arrayMethods, arrayKeys);
  4096. } else {
  4097. protoAugment(value, arrayMethods);
  4098. }
  4099. }
  4100. } else {
  4101. copyAugment(value, arrayMethods, arrayKeys);
  4102. }
  4103. this.observeArray(value);
  4104. } else {
  4105. this.walk(value);
  4106. }
  4107. };
  4108. /**
  4109. * Walk through all properties and convert them into
  4110. * getter/setters. This method should only be called when
  4111. * value type is Object.
  4112. */
  4113. Observer.prototype.walk = function walk (obj) {
  4114. var keys = Object.keys(obj);
  4115. for (var i = 0; i < keys.length; i++) {
  4116. defineReactive$$1(obj, keys[i]);
  4117. }
  4118. };
  4119. /**
  4120. * Observe a list of Array items.
  4121. */
  4122. Observer.prototype.observeArray = function observeArray (items) {
  4123. for (var i = 0, l = items.length; i < l; i++) {
  4124. observe(items[i]);
  4125. }
  4126. };
  4127. // helpers
  4128. /**
  4129. * Augment a target Object or Array by intercepting
  4130. * the prototype chain using __proto__
  4131. */
  4132. function protoAugment (target, src) {
  4133. /* eslint-disable no-proto */
  4134. target.__proto__ = src;
  4135. /* eslint-enable no-proto */
  4136. }
  4137. /**
  4138. * Augment a target Object or Array by defining
  4139. * hidden properties.
  4140. */
  4141. /* istanbul ignore next */
  4142. function copyAugment (target, src, keys) {
  4143. for (var i = 0, l = keys.length; i < l; i++) {
  4144. var key = keys[i];
  4145. def(target, key, src[key]);
  4146. }
  4147. }
  4148. /**
  4149. * Attempt to create an observer instance for a value,
  4150. * returns the new observer if successfully observed,
  4151. * or the existing observer if the value already has one.
  4152. */
  4153. function observe (value, asRootData) {
  4154. if (!isObject(value) || value instanceof VNode) {
  4155. return
  4156. }
  4157. var ob;
  4158. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4159. ob = value.__ob__;
  4160. } else if (
  4161. shouldObserve &&
  4162. !isServerRendering() &&
  4163. (Array.isArray(value) || isPlainObject(value)) &&
  4164. Object.isExtensible(value) &&
  4165. !value._isVue &&
  4166. !value.__v_isMPComponent
  4167. ) {
  4168. ob = new Observer(value);
  4169. }
  4170. if (asRootData && ob) {
  4171. ob.vmCount++;
  4172. }
  4173. return ob
  4174. }
  4175. /**
  4176. * Define a reactive property on an Object.
  4177. */
  4178. function defineReactive$$1 (
  4179. obj,
  4180. key,
  4181. val,
  4182. customSetter,
  4183. shallow
  4184. ) {
  4185. var dep = new Dep();
  4186. var property = Object.getOwnPropertyDescriptor(obj, key);
  4187. if (property && property.configurable === false) {
  4188. return
  4189. }
  4190. // cater for pre-defined getter/setters
  4191. var getter = property && property.get;
  4192. var setter = property && property.set;
  4193. if ((!getter || setter) && arguments.length === 2) {
  4194. val = obj[key];
  4195. }
  4196. var childOb = !shallow && observe(val);
  4197. Object.defineProperty(obj, key, {
  4198. enumerable: true,
  4199. configurable: true,
  4200. get: function reactiveGetter () {
  4201. var value = getter ? getter.call(obj) : val;
  4202. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4203. dep.depend();
  4204. if (childOb) {
  4205. childOb.dep.depend();
  4206. if (Array.isArray(value)) {
  4207. dependArray(value);
  4208. }
  4209. }
  4210. }
  4211. return value
  4212. },
  4213. set: function reactiveSetter (newVal) {
  4214. var value = getter ? getter.call(obj) : val;
  4215. /* eslint-disable no-self-compare */
  4216. if (newVal === value || (newVal !== newVal && value !== value)) {
  4217. return
  4218. }
  4219. /* eslint-enable no-self-compare */
  4220. if ( true && customSetter) {
  4221. customSetter();
  4222. }
  4223. // #7981: for accessor properties without setter
  4224. if (getter && !setter) { return }
  4225. if (setter) {
  4226. setter.call(obj, newVal);
  4227. } else {
  4228. val = newVal;
  4229. }
  4230. childOb = !shallow && observe(newVal);
  4231. dep.notify();
  4232. }
  4233. });
  4234. }
  4235. /**
  4236. * Set a property on an object. Adds the new property and
  4237. * triggers change notification if the property doesn't
  4238. * already exist.
  4239. */
  4240. function set (target, key, val) {
  4241. if ( true &&
  4242. (isUndef(target) || isPrimitive(target))
  4243. ) {
  4244. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4245. }
  4246. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4247. target.length = Math.max(target.length, key);
  4248. target.splice(key, 1, val);
  4249. return val
  4250. }
  4251. if (key in target && !(key in Object.prototype)) {
  4252. target[key] = val;
  4253. return val
  4254. }
  4255. var ob = (target).__ob__;
  4256. if (target._isVue || (ob && ob.vmCount)) {
  4257. true && warn(
  4258. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4259. 'at runtime - declare it upfront in the data option.'
  4260. );
  4261. return val
  4262. }
  4263. if (!ob) {
  4264. target[key] = val;
  4265. return val
  4266. }
  4267. defineReactive$$1(ob.value, key, val);
  4268. ob.dep.notify();
  4269. return val
  4270. }
  4271. /**
  4272. * Delete a property and trigger change if necessary.
  4273. */
  4274. function del (target, key) {
  4275. if ( true &&
  4276. (isUndef(target) || isPrimitive(target))
  4277. ) {
  4278. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4279. }
  4280. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4281. target.splice(key, 1);
  4282. return
  4283. }
  4284. var ob = (target).__ob__;
  4285. if (target._isVue || (ob && ob.vmCount)) {
  4286. true && warn(
  4287. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4288. '- just set it to null.'
  4289. );
  4290. return
  4291. }
  4292. if (!hasOwn(target, key)) {
  4293. return
  4294. }
  4295. delete target[key];
  4296. if (!ob) {
  4297. return
  4298. }
  4299. ob.dep.notify();
  4300. }
  4301. /**
  4302. * Collect dependencies on array elements when the array is touched, since
  4303. * we cannot intercept array element access like property getters.
  4304. */
  4305. function dependArray (value) {
  4306. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4307. e = value[i];
  4308. e && e.__ob__ && e.__ob__.dep.depend();
  4309. if (Array.isArray(e)) {
  4310. dependArray(e);
  4311. }
  4312. }
  4313. }
  4314. /* */
  4315. /**
  4316. * Option overwriting strategies are functions that handle
  4317. * how to merge a parent option value and a child option
  4318. * value into the final value.
  4319. */
  4320. var strats = config.optionMergeStrategies;
  4321. /**
  4322. * Options with restrictions
  4323. */
  4324. if (true) {
  4325. strats.el = strats.propsData = function (parent, child, vm, key) {
  4326. if (!vm) {
  4327. warn(
  4328. "option \"" + key + "\" can only be used during instance " +
  4329. 'creation with the `new` keyword.'
  4330. );
  4331. }
  4332. return defaultStrat(parent, child)
  4333. };
  4334. }
  4335. /**
  4336. * Helper that recursively merges two data objects together.
  4337. */
  4338. function mergeData (to, from) {
  4339. if (!from) { return to }
  4340. var key, toVal, fromVal;
  4341. var keys = hasSymbol
  4342. ? Reflect.ownKeys(from)
  4343. : Object.keys(from);
  4344. for (var i = 0; i < keys.length; i++) {
  4345. key = keys[i];
  4346. // in case the object is already observed...
  4347. if (key === '__ob__') { continue }
  4348. toVal = to[key];
  4349. fromVal = from[key];
  4350. if (!hasOwn(to, key)) {
  4351. set(to, key, fromVal);
  4352. } else if (
  4353. toVal !== fromVal &&
  4354. isPlainObject(toVal) &&
  4355. isPlainObject(fromVal)
  4356. ) {
  4357. mergeData(toVal, fromVal);
  4358. }
  4359. }
  4360. return to
  4361. }
  4362. /**
  4363. * Data
  4364. */
  4365. function mergeDataOrFn (
  4366. parentVal,
  4367. childVal,
  4368. vm
  4369. ) {
  4370. if (!vm) {
  4371. // in a Vue.extend merge, both should be functions
  4372. if (!childVal) {
  4373. return parentVal
  4374. }
  4375. if (!parentVal) {
  4376. return childVal
  4377. }
  4378. // when parentVal & childVal are both present,
  4379. // we need to return a function that returns the
  4380. // merged result of both functions... no need to
  4381. // check if parentVal is a function here because
  4382. // it has to be a function to pass previous merges.
  4383. return function mergedDataFn () {
  4384. return mergeData(
  4385. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4386. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4387. )
  4388. }
  4389. } else {
  4390. return function mergedInstanceDataFn () {
  4391. // instance merge
  4392. var instanceData = typeof childVal === 'function'
  4393. ? childVal.call(vm, vm)
  4394. : childVal;
  4395. var defaultData = typeof parentVal === 'function'
  4396. ? parentVal.call(vm, vm)
  4397. : parentVal;
  4398. if (instanceData) {
  4399. return mergeData(instanceData, defaultData)
  4400. } else {
  4401. return defaultData
  4402. }
  4403. }
  4404. }
  4405. }
  4406. strats.data = function (
  4407. parentVal,
  4408. childVal,
  4409. vm
  4410. ) {
  4411. if (!vm) {
  4412. if (childVal && typeof childVal !== 'function') {
  4413. true && warn(
  4414. 'The "data" option should be a function ' +
  4415. 'that returns a per-instance value in component ' +
  4416. 'definitions.',
  4417. vm
  4418. );
  4419. return parentVal
  4420. }
  4421. return mergeDataOrFn(parentVal, childVal)
  4422. }
  4423. return mergeDataOrFn(parentVal, childVal, vm)
  4424. };
  4425. /**
  4426. * Hooks and props are merged as arrays.
  4427. */
  4428. function mergeHook (
  4429. parentVal,
  4430. childVal
  4431. ) {
  4432. var res = childVal
  4433. ? parentVal
  4434. ? parentVal.concat(childVal)
  4435. : Array.isArray(childVal)
  4436. ? childVal
  4437. : [childVal]
  4438. : parentVal;
  4439. return res
  4440. ? dedupeHooks(res)
  4441. : res
  4442. }
  4443. function dedupeHooks (hooks) {
  4444. var res = [];
  4445. for (var i = 0; i < hooks.length; i++) {
  4446. if (res.indexOf(hooks[i]) === -1) {
  4447. res.push(hooks[i]);
  4448. }
  4449. }
  4450. return res
  4451. }
  4452. LIFECYCLE_HOOKS.forEach(function (hook) {
  4453. strats[hook] = mergeHook;
  4454. });
  4455. /**
  4456. * Assets
  4457. *
  4458. * When a vm is present (instance creation), we need to do
  4459. * a three-way merge between constructor options, instance
  4460. * options and parent options.
  4461. */
  4462. function mergeAssets (
  4463. parentVal,
  4464. childVal,
  4465. vm,
  4466. key
  4467. ) {
  4468. var res = Object.create(parentVal || null);
  4469. if (childVal) {
  4470. true && assertObjectType(key, childVal, vm);
  4471. return extend(res, childVal)
  4472. } else {
  4473. return res
  4474. }
  4475. }
  4476. ASSET_TYPES.forEach(function (type) {
  4477. strats[type + 's'] = mergeAssets;
  4478. });
  4479. /**
  4480. * Watchers.
  4481. *
  4482. * Watchers hashes should not overwrite one
  4483. * another, so we merge them as arrays.
  4484. */
  4485. strats.watch = function (
  4486. parentVal,
  4487. childVal,
  4488. vm,
  4489. key
  4490. ) {
  4491. // work around Firefox's Object.prototype.watch...
  4492. if (parentVal === nativeWatch) { parentVal = undefined; }
  4493. if (childVal === nativeWatch) { childVal = undefined; }
  4494. /* istanbul ignore if */
  4495. if (!childVal) { return Object.create(parentVal || null) }
  4496. if (true) {
  4497. assertObjectType(key, childVal, vm);
  4498. }
  4499. if (!parentVal) { return childVal }
  4500. var ret = {};
  4501. extend(ret, parentVal);
  4502. for (var key$1 in childVal) {
  4503. var parent = ret[key$1];
  4504. var child = childVal[key$1];
  4505. if (parent && !Array.isArray(parent)) {
  4506. parent = [parent];
  4507. }
  4508. ret[key$1] = parent
  4509. ? parent.concat(child)
  4510. : Array.isArray(child) ? child : [child];
  4511. }
  4512. return ret
  4513. };
  4514. /**
  4515. * Other object hashes.
  4516. */
  4517. strats.props =
  4518. strats.methods =
  4519. strats.inject =
  4520. strats.computed = function (
  4521. parentVal,
  4522. childVal,
  4523. vm,
  4524. key
  4525. ) {
  4526. if (childVal && "development" !== 'production') {
  4527. assertObjectType(key, childVal, vm);
  4528. }
  4529. if (!parentVal) { return childVal }
  4530. var ret = Object.create(null);
  4531. extend(ret, parentVal);
  4532. if (childVal) { extend(ret, childVal); }
  4533. return ret
  4534. };
  4535. strats.provide = mergeDataOrFn;
  4536. /**
  4537. * Default strategy.
  4538. */
  4539. var defaultStrat = function (parentVal, childVal) {
  4540. return childVal === undefined
  4541. ? parentVal
  4542. : childVal
  4543. };
  4544. /**
  4545. * Validate component names
  4546. */
  4547. function checkComponents (options) {
  4548. for (var key in options.components) {
  4549. validateComponentName(key);
  4550. }
  4551. }
  4552. function validateComponentName (name) {
  4553. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4554. warn(
  4555. 'Invalid component name: "' + name + '". Component names ' +
  4556. 'should conform to valid custom element name in html5 specification.'
  4557. );
  4558. }
  4559. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4560. warn(
  4561. 'Do not use built-in or reserved HTML elements as component ' +
  4562. 'id: ' + name
  4563. );
  4564. }
  4565. }
  4566. /**
  4567. * Ensure all props option syntax are normalized into the
  4568. * Object-based format.
  4569. */
  4570. function normalizeProps (options, vm) {
  4571. var props = options.props;
  4572. if (!props) { return }
  4573. var res = {};
  4574. var i, val, name;
  4575. if (Array.isArray(props)) {
  4576. i = props.length;
  4577. while (i--) {
  4578. val = props[i];
  4579. if (typeof val === 'string') {
  4580. name = camelize(val);
  4581. res[name] = { type: null };
  4582. } else if (true) {
  4583. warn('props must be strings when using array syntax.');
  4584. }
  4585. }
  4586. } else if (isPlainObject(props)) {
  4587. for (var key in props) {
  4588. val = props[key];
  4589. name = camelize(key);
  4590. res[name] = isPlainObject(val)
  4591. ? val
  4592. : { type: val };
  4593. }
  4594. } else if (true) {
  4595. warn(
  4596. "Invalid value for option \"props\": expected an Array or an Object, " +
  4597. "but got " + (toRawType(props)) + ".",
  4598. vm
  4599. );
  4600. }
  4601. options.props = res;
  4602. }
  4603. /**
  4604. * Normalize all injections into Object-based format
  4605. */
  4606. function normalizeInject (options, vm) {
  4607. var inject = options.inject;
  4608. if (!inject) { return }
  4609. var normalized = options.inject = {};
  4610. if (Array.isArray(inject)) {
  4611. for (var i = 0; i < inject.length; i++) {
  4612. normalized[inject[i]] = { from: inject[i] };
  4613. }
  4614. } else if (isPlainObject(inject)) {
  4615. for (var key in inject) {
  4616. var val = inject[key];
  4617. normalized[key] = isPlainObject(val)
  4618. ? extend({ from: key }, val)
  4619. : { from: val };
  4620. }
  4621. } else if (true) {
  4622. warn(
  4623. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4624. "but got " + (toRawType(inject)) + ".",
  4625. vm
  4626. );
  4627. }
  4628. }
  4629. /**
  4630. * Normalize raw function directives into object format.
  4631. */
  4632. function normalizeDirectives (options) {
  4633. var dirs = options.directives;
  4634. if (dirs) {
  4635. for (var key in dirs) {
  4636. var def$$1 = dirs[key];
  4637. if (typeof def$$1 === 'function') {
  4638. dirs[key] = { bind: def$$1, update: def$$1 };
  4639. }
  4640. }
  4641. }
  4642. }
  4643. function assertObjectType (name, value, vm) {
  4644. if (!isPlainObject(value)) {
  4645. warn(
  4646. "Invalid value for option \"" + name + "\": expected an Object, " +
  4647. "but got " + (toRawType(value)) + ".",
  4648. vm
  4649. );
  4650. }
  4651. }
  4652. /**
  4653. * Merge two option objects into a new one.
  4654. * Core utility used in both instantiation and inheritance.
  4655. */
  4656. function mergeOptions (
  4657. parent,
  4658. child,
  4659. vm
  4660. ) {
  4661. if (true) {
  4662. checkComponents(child);
  4663. }
  4664. if (typeof child === 'function') {
  4665. child = child.options;
  4666. }
  4667. normalizeProps(child, vm);
  4668. normalizeInject(child, vm);
  4669. normalizeDirectives(child);
  4670. // Apply extends and mixins on the child options,
  4671. // but only if it is a raw options object that isn't
  4672. // the result of another mergeOptions call.
  4673. // Only merged options has the _base property.
  4674. if (!child._base) {
  4675. if (child.extends) {
  4676. parent = mergeOptions(parent, child.extends, vm);
  4677. }
  4678. if (child.mixins) {
  4679. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4680. parent = mergeOptions(parent, child.mixins[i], vm);
  4681. }
  4682. }
  4683. }
  4684. var options = {};
  4685. var key;
  4686. for (key in parent) {
  4687. mergeField(key);
  4688. }
  4689. for (key in child) {
  4690. if (!hasOwn(parent, key)) {
  4691. mergeField(key);
  4692. }
  4693. }
  4694. function mergeField (key) {
  4695. var strat = strats[key] || defaultStrat;
  4696. options[key] = strat(parent[key], child[key], vm, key);
  4697. }
  4698. return options
  4699. }
  4700. /**
  4701. * Resolve an asset.
  4702. * This function is used because child instances need access
  4703. * to assets defined in its ancestor chain.
  4704. */
  4705. function resolveAsset (
  4706. options,
  4707. type,
  4708. id,
  4709. warnMissing
  4710. ) {
  4711. /* istanbul ignore if */
  4712. if (typeof id !== 'string') {
  4713. return
  4714. }
  4715. var assets = options[type];
  4716. // check local registration variations first
  4717. if (hasOwn(assets, id)) { return assets[id] }
  4718. var camelizedId = camelize(id);
  4719. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4720. var PascalCaseId = capitalize(camelizedId);
  4721. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4722. // fallback to prototype chain
  4723. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4724. if ( true && warnMissing && !res) {
  4725. warn(
  4726. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4727. options
  4728. );
  4729. }
  4730. return res
  4731. }
  4732. /* */
  4733. function validateProp (
  4734. key,
  4735. propOptions,
  4736. propsData,
  4737. vm
  4738. ) {
  4739. var prop = propOptions[key];
  4740. var absent = !hasOwn(propsData, key);
  4741. var value = propsData[key];
  4742. // boolean casting
  4743. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4744. if (booleanIndex > -1) {
  4745. if (absent && !hasOwn(prop, 'default')) {
  4746. value = false;
  4747. } else if (value === '' || value === hyphenate(key)) {
  4748. // only cast empty string / same name to boolean if
  4749. // boolean has higher priority
  4750. var stringIndex = getTypeIndex(String, prop.type);
  4751. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4752. value = true;
  4753. }
  4754. }
  4755. }
  4756. // check default value
  4757. if (value === undefined) {
  4758. value = getPropDefaultValue(vm, prop, key);
  4759. // since the default value is a fresh copy,
  4760. // make sure to observe it.
  4761. var prevShouldObserve = shouldObserve;
  4762. toggleObserving(true);
  4763. observe(value);
  4764. toggleObserving(prevShouldObserve);
  4765. }
  4766. if (
  4767. true
  4768. ) {
  4769. assertProp(prop, key, value, vm, absent);
  4770. }
  4771. return value
  4772. }
  4773. /**
  4774. * Get the default value of a prop.
  4775. */
  4776. function getPropDefaultValue (vm, prop, key) {
  4777. // no default, return undefined
  4778. if (!hasOwn(prop, 'default')) {
  4779. return undefined
  4780. }
  4781. var def = prop.default;
  4782. // warn against non-factory defaults for Object & Array
  4783. if ( true && isObject(def)) {
  4784. warn(
  4785. 'Invalid default value for prop "' + key + '": ' +
  4786. 'Props with type Object/Array must use a factory function ' +
  4787. 'to return the default value.',
  4788. vm
  4789. );
  4790. }
  4791. // the raw prop value was also undefined from previous render,
  4792. // return previous default value to avoid unnecessary watcher trigger
  4793. if (vm && vm.$options.propsData &&
  4794. vm.$options.propsData[key] === undefined &&
  4795. vm._props[key] !== undefined
  4796. ) {
  4797. return vm._props[key]
  4798. }
  4799. // call factory function for non-Function types
  4800. // a value is Function if its prototype is function even across different execution context
  4801. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4802. ? def.call(vm)
  4803. : def
  4804. }
  4805. /**
  4806. * Assert whether a prop is valid.
  4807. */
  4808. function assertProp (
  4809. prop,
  4810. name,
  4811. value,
  4812. vm,
  4813. absent
  4814. ) {
  4815. if (prop.required && absent) {
  4816. warn(
  4817. 'Missing required prop: "' + name + '"',
  4818. vm
  4819. );
  4820. return
  4821. }
  4822. if (value == null && !prop.required) {
  4823. return
  4824. }
  4825. var type = prop.type;
  4826. var valid = !type || type === true;
  4827. var expectedTypes = [];
  4828. if (type) {
  4829. if (!Array.isArray(type)) {
  4830. type = [type];
  4831. }
  4832. for (var i = 0; i < type.length && !valid; i++) {
  4833. var assertedType = assertType(value, type[i]);
  4834. expectedTypes.push(assertedType.expectedType || '');
  4835. valid = assertedType.valid;
  4836. }
  4837. }
  4838. if (!valid) {
  4839. warn(
  4840. getInvalidTypeMessage(name, value, expectedTypes),
  4841. vm
  4842. );
  4843. return
  4844. }
  4845. var validator = prop.validator;
  4846. if (validator) {
  4847. if (!validator(value)) {
  4848. warn(
  4849. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4850. vm
  4851. );
  4852. }
  4853. }
  4854. }
  4855. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4856. function assertType (value, type) {
  4857. var valid;
  4858. var expectedType = getType(type);
  4859. if (simpleCheckRE.test(expectedType)) {
  4860. var t = typeof value;
  4861. valid = t === expectedType.toLowerCase();
  4862. // for primitive wrapper objects
  4863. if (!valid && t === 'object') {
  4864. valid = value instanceof type;
  4865. }
  4866. } else if (expectedType === 'Object') {
  4867. valid = isPlainObject(value);
  4868. } else if (expectedType === 'Array') {
  4869. valid = Array.isArray(value);
  4870. } else {
  4871. valid = value instanceof type;
  4872. }
  4873. return {
  4874. valid: valid,
  4875. expectedType: expectedType
  4876. }
  4877. }
  4878. /**
  4879. * Use function string name to check built-in types,
  4880. * because a simple equality check will fail when running
  4881. * across different vms / iframes.
  4882. */
  4883. function getType (fn) {
  4884. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4885. return match ? match[1] : ''
  4886. }
  4887. function isSameType (a, b) {
  4888. return getType(a) === getType(b)
  4889. }
  4890. function getTypeIndex (type, expectedTypes) {
  4891. if (!Array.isArray(expectedTypes)) {
  4892. return isSameType(expectedTypes, type) ? 0 : -1
  4893. }
  4894. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4895. if (isSameType(expectedTypes[i], type)) {
  4896. return i
  4897. }
  4898. }
  4899. return -1
  4900. }
  4901. function getInvalidTypeMessage (name, value, expectedTypes) {
  4902. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4903. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4904. var expectedType = expectedTypes[0];
  4905. var receivedType = toRawType(value);
  4906. var expectedValue = styleValue(value, expectedType);
  4907. var receivedValue = styleValue(value, receivedType);
  4908. // check if we need to specify expected value
  4909. if (expectedTypes.length === 1 &&
  4910. isExplicable(expectedType) &&
  4911. !isBoolean(expectedType, receivedType)) {
  4912. message += " with value " + expectedValue;
  4913. }
  4914. message += ", got " + receivedType + " ";
  4915. // check if we need to specify received value
  4916. if (isExplicable(receivedType)) {
  4917. message += "with value " + receivedValue + ".";
  4918. }
  4919. return message
  4920. }
  4921. function styleValue (value, type) {
  4922. if (type === 'String') {
  4923. return ("\"" + value + "\"")
  4924. } else if (type === 'Number') {
  4925. return ("" + (Number(value)))
  4926. } else {
  4927. return ("" + value)
  4928. }
  4929. }
  4930. function isExplicable (value) {
  4931. var explicitTypes = ['string', 'number', 'boolean'];
  4932. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4933. }
  4934. function isBoolean () {
  4935. var args = [], len = arguments.length;
  4936. while ( len-- ) args[ len ] = arguments[ len ];
  4937. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4938. }
  4939. /* */
  4940. function handleError (err, vm, info) {
  4941. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4942. // See: https://github.com/vuejs/vuex/issues/1505
  4943. pushTarget();
  4944. try {
  4945. if (vm) {
  4946. var cur = vm;
  4947. while ((cur = cur.$parent)) {
  4948. var hooks = cur.$options.errorCaptured;
  4949. if (hooks) {
  4950. for (var i = 0; i < hooks.length; i++) {
  4951. try {
  4952. var capture = hooks[i].call(cur, err, vm, info) === false;
  4953. if (capture) { return }
  4954. } catch (e) {
  4955. globalHandleError(e, cur, 'errorCaptured hook');
  4956. }
  4957. }
  4958. }
  4959. }
  4960. }
  4961. globalHandleError(err, vm, info);
  4962. } finally {
  4963. popTarget();
  4964. }
  4965. }
  4966. function invokeWithErrorHandling (
  4967. handler,
  4968. context,
  4969. args,
  4970. vm,
  4971. info
  4972. ) {
  4973. var res;
  4974. try {
  4975. res = args ? handler.apply(context, args) : handler.call(context);
  4976. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4977. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4978. // issue #9511
  4979. // avoid catch triggering multiple times when nested calls
  4980. res._handled = true;
  4981. }
  4982. } catch (e) {
  4983. handleError(e, vm, info);
  4984. }
  4985. return res
  4986. }
  4987. function globalHandleError (err, vm, info) {
  4988. if (config.errorHandler) {
  4989. try {
  4990. return config.errorHandler.call(null, err, vm, info)
  4991. } catch (e) {
  4992. // if the user intentionally throws the original error in the handler,
  4993. // do not log it twice
  4994. if (e !== err) {
  4995. logError(e, null, 'config.errorHandler');
  4996. }
  4997. }
  4998. }
  4999. logError(err, vm, info);
  5000. }
  5001. function logError (err, vm, info) {
  5002. if (true) {
  5003. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5004. }
  5005. /* istanbul ignore else */
  5006. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5007. console.error(err);
  5008. } else {
  5009. throw err
  5010. }
  5011. }
  5012. /* */
  5013. var callbacks = [];
  5014. var pending = false;
  5015. function flushCallbacks () {
  5016. pending = false;
  5017. var copies = callbacks.slice(0);
  5018. callbacks.length = 0;
  5019. for (var i = 0; i < copies.length; i++) {
  5020. copies[i]();
  5021. }
  5022. }
  5023. // Here we have async deferring wrappers using microtasks.
  5024. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5025. // However, it has subtle problems when state is changed right before repaint
  5026. // (e.g. #6813, out-in transitions).
  5027. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5028. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5029. // So we now use microtasks everywhere, again.
  5030. // A major drawback of this tradeoff is that there are some scenarios
  5031. // where microtasks have too high a priority and fire in between supposedly
  5032. // sequential events (e.g. #4521, #6690, which have workarounds)
  5033. // or even between bubbling of the same event (#6566).
  5034. var timerFunc;
  5035. // The nextTick behavior leverages the microtask queue, which can be accessed
  5036. // via either native Promise.then or MutationObserver.
  5037. // MutationObserver has wider support, however it is seriously bugged in
  5038. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5039. // completely stops working after triggering a few times... so, if native
  5040. // Promise is available, we will use it:
  5041. /* istanbul ignore next, $flow-disable-line */
  5042. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5043. var p = Promise.resolve();
  5044. timerFunc = function () {
  5045. p.then(flushCallbacks);
  5046. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5047. // it can get stuck in a weird state where callbacks are pushed into the
  5048. // microtask queue but the queue isn't being flushed, until the browser
  5049. // needs to do some other work, e.g. handle a timer. Therefore we can
  5050. // "force" the microtask queue to be flushed by adding an empty timer.
  5051. if (isIOS) { setTimeout(noop); }
  5052. };
  5053. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5054. isNative(MutationObserver) ||
  5055. // PhantomJS and iOS 7.x
  5056. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5057. )) {
  5058. // Use MutationObserver where native Promise is not available,
  5059. // e.g. PhantomJS, iOS7, Android 4.4
  5060. // (#6466 MutationObserver is unreliable in IE11)
  5061. var counter = 1;
  5062. var observer = new MutationObserver(flushCallbacks);
  5063. var textNode = document.createTextNode(String(counter));
  5064. observer.observe(textNode, {
  5065. characterData: true
  5066. });
  5067. timerFunc = function () {
  5068. counter = (counter + 1) % 2;
  5069. textNode.data = String(counter);
  5070. };
  5071. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5072. // Fallback to setImmediate.
  5073. // Technically it leverages the (macro) task queue,
  5074. // but it is still a better choice than setTimeout.
  5075. timerFunc = function () {
  5076. setImmediate(flushCallbacks);
  5077. };
  5078. } else {
  5079. // Fallback to setTimeout.
  5080. timerFunc = function () {
  5081. setTimeout(flushCallbacks, 0);
  5082. };
  5083. }
  5084. function nextTick (cb, ctx) {
  5085. var _resolve;
  5086. callbacks.push(function () {
  5087. if (cb) {
  5088. try {
  5089. cb.call(ctx);
  5090. } catch (e) {
  5091. handleError(e, ctx, 'nextTick');
  5092. }
  5093. } else if (_resolve) {
  5094. _resolve(ctx);
  5095. }
  5096. });
  5097. if (!pending) {
  5098. pending = true;
  5099. timerFunc();
  5100. }
  5101. // $flow-disable-line
  5102. if (!cb && typeof Promise !== 'undefined') {
  5103. return new Promise(function (resolve) {
  5104. _resolve = resolve;
  5105. })
  5106. }
  5107. }
  5108. /* */
  5109. /* not type checking this file because flow doesn't play well with Proxy */
  5110. var initProxy;
  5111. if (true) {
  5112. var allowedGlobals = makeMap(
  5113. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5114. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5115. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5116. 'require' // for Webpack/Browserify
  5117. );
  5118. var warnNonPresent = function (target, key) {
  5119. warn(
  5120. "Property or method \"" + key + "\" is not defined on the instance but " +
  5121. 'referenced during render. Make sure that this property is reactive, ' +
  5122. 'either in the data option, or for class-based components, by ' +
  5123. 'initializing the property. ' +
  5124. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5125. target
  5126. );
  5127. };
  5128. var warnReservedPrefix = function (target, key) {
  5129. warn(
  5130. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5131. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5132. 'prevent conflicts with Vue internals. ' +
  5133. 'See: https://vuejs.org/v2/api/#data',
  5134. target
  5135. );
  5136. };
  5137. var hasProxy =
  5138. typeof Proxy !== 'undefined' && isNative(Proxy);
  5139. if (hasProxy) {
  5140. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5141. config.keyCodes = new Proxy(config.keyCodes, {
  5142. set: function set (target, key, value) {
  5143. if (isBuiltInModifier(key)) {
  5144. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5145. return false
  5146. } else {
  5147. target[key] = value;
  5148. return true
  5149. }
  5150. }
  5151. });
  5152. }
  5153. var hasHandler = {
  5154. has: function has (target, key) {
  5155. var has = key in target;
  5156. var isAllowed = allowedGlobals(key) ||
  5157. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5158. if (!has && !isAllowed) {
  5159. if (key in target.$data) { warnReservedPrefix(target, key); }
  5160. else { warnNonPresent(target, key); }
  5161. }
  5162. return has || !isAllowed
  5163. }
  5164. };
  5165. var getHandler = {
  5166. get: function get (target, key) {
  5167. if (typeof key === 'string' && !(key in target)) {
  5168. if (key in target.$data) { warnReservedPrefix(target, key); }
  5169. else { warnNonPresent(target, key); }
  5170. }
  5171. return target[key]
  5172. }
  5173. };
  5174. initProxy = function initProxy (vm) {
  5175. if (hasProxy) {
  5176. // determine which proxy handler to use
  5177. var options = vm.$options;
  5178. var handlers = options.render && options.render._withStripped
  5179. ? getHandler
  5180. : hasHandler;
  5181. vm._renderProxy = new Proxy(vm, handlers);
  5182. } else {
  5183. vm._renderProxy = vm;
  5184. }
  5185. };
  5186. }
  5187. /* */
  5188. var seenObjects = new _Set();
  5189. /**
  5190. * Recursively traverse an object to evoke all converted
  5191. * getters, so that every nested property inside the object
  5192. * is collected as a "deep" dependency.
  5193. */
  5194. function traverse (val) {
  5195. _traverse(val, seenObjects);
  5196. seenObjects.clear();
  5197. }
  5198. function _traverse (val, seen) {
  5199. var i, keys;
  5200. var isA = Array.isArray(val);
  5201. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5202. return
  5203. }
  5204. if (val.__ob__) {
  5205. var depId = val.__ob__.dep.id;
  5206. if (seen.has(depId)) {
  5207. return
  5208. }
  5209. seen.add(depId);
  5210. }
  5211. if (isA) {
  5212. i = val.length;
  5213. while (i--) { _traverse(val[i], seen); }
  5214. } else {
  5215. keys = Object.keys(val);
  5216. i = keys.length;
  5217. while (i--) { _traverse(val[keys[i]], seen); }
  5218. }
  5219. }
  5220. var mark;
  5221. var measure;
  5222. if (true) {
  5223. var perf = inBrowser && window.performance;
  5224. /* istanbul ignore if */
  5225. if (
  5226. perf &&
  5227. perf.mark &&
  5228. perf.measure &&
  5229. perf.clearMarks &&
  5230. perf.clearMeasures
  5231. ) {
  5232. mark = function (tag) { return perf.mark(tag); };
  5233. measure = function (name, startTag, endTag) {
  5234. perf.measure(name, startTag, endTag);
  5235. perf.clearMarks(startTag);
  5236. perf.clearMarks(endTag);
  5237. // perf.clearMeasures(name)
  5238. };
  5239. }
  5240. }
  5241. /* */
  5242. var normalizeEvent = cached(function (name) {
  5243. var passive = name.charAt(0) === '&';
  5244. name = passive ? name.slice(1) : name;
  5245. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5246. name = once$$1 ? name.slice(1) : name;
  5247. var capture = name.charAt(0) === '!';
  5248. name = capture ? name.slice(1) : name;
  5249. return {
  5250. name: name,
  5251. once: once$$1,
  5252. capture: capture,
  5253. passive: passive
  5254. }
  5255. });
  5256. function createFnInvoker (fns, vm) {
  5257. function invoker () {
  5258. var arguments$1 = arguments;
  5259. var fns = invoker.fns;
  5260. if (Array.isArray(fns)) {
  5261. var cloned = fns.slice();
  5262. for (var i = 0; i < cloned.length; i++) {
  5263. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5264. }
  5265. } else {
  5266. // return handler return value for single handlers
  5267. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5268. }
  5269. }
  5270. invoker.fns = fns;
  5271. return invoker
  5272. }
  5273. function updateListeners (
  5274. on,
  5275. oldOn,
  5276. add,
  5277. remove$$1,
  5278. createOnceHandler,
  5279. vm
  5280. ) {
  5281. var name, def$$1, cur, old, event;
  5282. for (name in on) {
  5283. def$$1 = cur = on[name];
  5284. old = oldOn[name];
  5285. event = normalizeEvent(name);
  5286. if (isUndef(cur)) {
  5287. true && warn(
  5288. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5289. vm
  5290. );
  5291. } else if (isUndef(old)) {
  5292. if (isUndef(cur.fns)) {
  5293. cur = on[name] = createFnInvoker(cur, vm);
  5294. }
  5295. if (isTrue(event.once)) {
  5296. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5297. }
  5298. add(event.name, cur, event.capture, event.passive, event.params);
  5299. } else if (cur !== old) {
  5300. old.fns = cur;
  5301. on[name] = old;
  5302. }
  5303. }
  5304. for (name in oldOn) {
  5305. if (isUndef(on[name])) {
  5306. event = normalizeEvent(name);
  5307. remove$$1(event.name, oldOn[name], event.capture);
  5308. }
  5309. }
  5310. }
  5311. /* */
  5312. /* */
  5313. // fixed by xxxxxx (mp properties)
  5314. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5315. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5316. if (isUndef(propOptions)) {
  5317. return res
  5318. }
  5319. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5320. var attrs = data.attrs;
  5321. var props = data.props;
  5322. if (isDef(attrs) || isDef(props)) {
  5323. for (var key in propOptions) {
  5324. var altKey = hyphenate(key);
  5325. var result = checkProp(res, props, key, altKey, true) ||
  5326. checkProp(res, attrs, key, altKey, false);
  5327. // externalClass
  5328. if (
  5329. result &&
  5330. res[key] &&
  5331. externalClasses.indexOf(altKey) !== -1 &&
  5332. context[camelize(res[key])]
  5333. ) {
  5334. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5335. res[key] = context[camelize(res[key])];
  5336. }
  5337. }
  5338. }
  5339. return res
  5340. }
  5341. function extractPropsFromVNodeData (
  5342. data,
  5343. Ctor,
  5344. tag,
  5345. context// fixed by xxxxxx
  5346. ) {
  5347. // we are only extracting raw values here.
  5348. // validation and default values are handled in the child
  5349. // component itself.
  5350. var propOptions = Ctor.options.props;
  5351. if (isUndef(propOptions)) {
  5352. // fixed by xxxxxx
  5353. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5354. }
  5355. var res = {};
  5356. var attrs = data.attrs;
  5357. var props = data.props;
  5358. if (isDef(attrs) || isDef(props)) {
  5359. for (var key in propOptions) {
  5360. var altKey = hyphenate(key);
  5361. if (true) {
  5362. var keyInLowerCase = key.toLowerCase();
  5363. if (
  5364. key !== keyInLowerCase &&
  5365. attrs && hasOwn(attrs, keyInLowerCase)
  5366. ) {
  5367. tip(
  5368. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5369. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5370. " \"" + key + "\". " +
  5371. "Note that HTML attributes are case-insensitive and camelCased " +
  5372. "props need to use their kebab-case equivalents when using in-DOM " +
  5373. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5374. );
  5375. }
  5376. }
  5377. checkProp(res, props, key, altKey, true) ||
  5378. checkProp(res, attrs, key, altKey, false);
  5379. }
  5380. }
  5381. // fixed by xxxxxx
  5382. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5383. }
  5384. function checkProp (
  5385. res,
  5386. hash,
  5387. key,
  5388. altKey,
  5389. preserve
  5390. ) {
  5391. if (isDef(hash)) {
  5392. if (hasOwn(hash, key)) {
  5393. res[key] = hash[key];
  5394. if (!preserve) {
  5395. delete hash[key];
  5396. }
  5397. return true
  5398. } else if (hasOwn(hash, altKey)) {
  5399. res[key] = hash[altKey];
  5400. if (!preserve) {
  5401. delete hash[altKey];
  5402. }
  5403. return true
  5404. }
  5405. }
  5406. return false
  5407. }
  5408. /* */
  5409. // The template compiler attempts to minimize the need for normalization by
  5410. // statically analyzing the template at compile time.
  5411. //
  5412. // For plain HTML markup, normalization can be completely skipped because the
  5413. // generated render function is guaranteed to return Array<VNode>. There are
  5414. // two cases where extra normalization is needed:
  5415. // 1. When the children contains components - because a functional component
  5416. // may return an Array instead of a single root. In this case, just a simple
  5417. // normalization is needed - if any child is an Array, we flatten the whole
  5418. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5419. // because functional components already normalize their own children.
  5420. function simpleNormalizeChildren (children) {
  5421. for (var i = 0; i < children.length; i++) {
  5422. if (Array.isArray(children[i])) {
  5423. return Array.prototype.concat.apply([], children)
  5424. }
  5425. }
  5426. return children
  5427. }
  5428. // 2. When the children contains constructs that always generated nested Arrays,
  5429. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5430. // with hand-written render functions / JSX. In such cases a full normalization
  5431. // is needed to cater to all possible types of children values.
  5432. function normalizeChildren (children) {
  5433. return isPrimitive(children)
  5434. ? [createTextVNode(children)]
  5435. : Array.isArray(children)
  5436. ? normalizeArrayChildren(children)
  5437. : undefined
  5438. }
  5439. function isTextNode (node) {
  5440. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5441. }
  5442. function normalizeArrayChildren (children, nestedIndex) {
  5443. var res = [];
  5444. var i, c, lastIndex, last;
  5445. for (i = 0; i < children.length; i++) {
  5446. c = children[i];
  5447. if (isUndef(c) || typeof c === 'boolean') { continue }
  5448. lastIndex = res.length - 1;
  5449. last = res[lastIndex];
  5450. // nested
  5451. if (Array.isArray(c)) {
  5452. if (c.length > 0) {
  5453. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5454. // merge adjacent text nodes
  5455. if (isTextNode(c[0]) && isTextNode(last)) {
  5456. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5457. c.shift();
  5458. }
  5459. res.push.apply(res, c);
  5460. }
  5461. } else if (isPrimitive(c)) {
  5462. if (isTextNode(last)) {
  5463. // merge adjacent text nodes
  5464. // this is necessary for SSR hydration because text nodes are
  5465. // essentially merged when rendered to HTML strings
  5466. res[lastIndex] = createTextVNode(last.text + c);
  5467. } else if (c !== '') {
  5468. // convert primitive to vnode
  5469. res.push(createTextVNode(c));
  5470. }
  5471. } else {
  5472. if (isTextNode(c) && isTextNode(last)) {
  5473. // merge adjacent text nodes
  5474. res[lastIndex] = createTextVNode(last.text + c.text);
  5475. } else {
  5476. // default key for nested array children (likely generated by v-for)
  5477. if (isTrue(children._isVList) &&
  5478. isDef(c.tag) &&
  5479. isUndef(c.key) &&
  5480. isDef(nestedIndex)) {
  5481. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5482. }
  5483. res.push(c);
  5484. }
  5485. }
  5486. }
  5487. return res
  5488. }
  5489. /* */
  5490. function initProvide (vm) {
  5491. var provide = vm.$options.provide;
  5492. if (provide) {
  5493. vm._provided = typeof provide === 'function'
  5494. ? provide.call(vm)
  5495. : provide;
  5496. }
  5497. }
  5498. function initInjections (vm) {
  5499. var result = resolveInject(vm.$options.inject, vm);
  5500. if (result) {
  5501. toggleObserving(false);
  5502. Object.keys(result).forEach(function (key) {
  5503. /* istanbul ignore else */
  5504. if (true) {
  5505. defineReactive$$1(vm, key, result[key], function () {
  5506. warn(
  5507. "Avoid mutating an injected value directly since the changes will be " +
  5508. "overwritten whenever the provided component re-renders. " +
  5509. "injection being mutated: \"" + key + "\"",
  5510. vm
  5511. );
  5512. });
  5513. } else {}
  5514. });
  5515. toggleObserving(true);
  5516. }
  5517. }
  5518. function resolveInject (inject, vm) {
  5519. if (inject) {
  5520. // inject is :any because flow is not smart enough to figure out cached
  5521. var result = Object.create(null);
  5522. var keys = hasSymbol
  5523. ? Reflect.ownKeys(inject)
  5524. : Object.keys(inject);
  5525. for (var i = 0; i < keys.length; i++) {
  5526. var key = keys[i];
  5527. // #6574 in case the inject object is observed...
  5528. if (key === '__ob__') { continue }
  5529. var provideKey = inject[key].from;
  5530. var source = vm;
  5531. while (source) {
  5532. if (source._provided && hasOwn(source._provided, provideKey)) {
  5533. result[key] = source._provided[provideKey];
  5534. break
  5535. }
  5536. source = source.$parent;
  5537. }
  5538. if (!source) {
  5539. if ('default' in inject[key]) {
  5540. var provideDefault = inject[key].default;
  5541. result[key] = typeof provideDefault === 'function'
  5542. ? provideDefault.call(vm)
  5543. : provideDefault;
  5544. } else if (true) {
  5545. warn(("Injection \"" + key + "\" not found"), vm);
  5546. }
  5547. }
  5548. }
  5549. return result
  5550. }
  5551. }
  5552. /* */
  5553. /**
  5554. * Runtime helper for resolving raw children VNodes into a slot object.
  5555. */
  5556. function resolveSlots (
  5557. children,
  5558. context
  5559. ) {
  5560. if (!children || !children.length) {
  5561. return {}
  5562. }
  5563. var slots = {};
  5564. for (var i = 0, l = children.length; i < l; i++) {
  5565. var child = children[i];
  5566. var data = child.data;
  5567. // remove slot attribute if the node is resolved as a Vue slot node
  5568. if (data && data.attrs && data.attrs.slot) {
  5569. delete data.attrs.slot;
  5570. }
  5571. // named slots should only be respected if the vnode was rendered in the
  5572. // same context.
  5573. if ((child.context === context || child.fnContext === context) &&
  5574. data && data.slot != null
  5575. ) {
  5576. var name = data.slot;
  5577. var slot = (slots[name] || (slots[name] = []));
  5578. if (child.tag === 'template') {
  5579. slot.push.apply(slot, child.children || []);
  5580. } else {
  5581. slot.push(child);
  5582. }
  5583. } else {
  5584. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5585. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5586. (slots['page'] || (slots['page'] = [])).push(child);
  5587. }else{
  5588. (slots.default || (slots.default = [])).push(child);
  5589. }
  5590. }
  5591. }
  5592. // ignore slots that contains only whitespace
  5593. for (var name$1 in slots) {
  5594. if (slots[name$1].every(isWhitespace)) {
  5595. delete slots[name$1];
  5596. }
  5597. }
  5598. return slots
  5599. }
  5600. function isWhitespace (node) {
  5601. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5602. }
  5603. /* */
  5604. function normalizeScopedSlots (
  5605. slots,
  5606. normalSlots,
  5607. prevSlots
  5608. ) {
  5609. var res;
  5610. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5611. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5612. var key = slots && slots.$key;
  5613. if (!slots) {
  5614. res = {};
  5615. } else if (slots._normalized) {
  5616. // fast path 1: child component re-render only, parent did not change
  5617. return slots._normalized
  5618. } else if (
  5619. isStable &&
  5620. prevSlots &&
  5621. prevSlots !== emptyObject &&
  5622. key === prevSlots.$key &&
  5623. !hasNormalSlots &&
  5624. !prevSlots.$hasNormal
  5625. ) {
  5626. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5627. // only need to normalize once
  5628. return prevSlots
  5629. } else {
  5630. res = {};
  5631. for (var key$1 in slots) {
  5632. if (slots[key$1] && key$1[0] !== '$') {
  5633. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5634. }
  5635. }
  5636. }
  5637. // expose normal slots on scopedSlots
  5638. for (var key$2 in normalSlots) {
  5639. if (!(key$2 in res)) {
  5640. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5641. }
  5642. }
  5643. // avoriaz seems to mock a non-extensible $scopedSlots object
  5644. // and when that is passed down this would cause an error
  5645. if (slots && Object.isExtensible(slots)) {
  5646. (slots)._normalized = res;
  5647. }
  5648. def(res, '$stable', isStable);
  5649. def(res, '$key', key);
  5650. def(res, '$hasNormal', hasNormalSlots);
  5651. return res
  5652. }
  5653. function normalizeScopedSlot(normalSlots, key, fn) {
  5654. var normalized = function () {
  5655. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5656. res = res && typeof res === 'object' && !Array.isArray(res)
  5657. ? [res] // single vnode
  5658. : normalizeChildren(res);
  5659. return res && (
  5660. res.length === 0 ||
  5661. (res.length === 1 && res[0].isComment) // #9658
  5662. ) ? undefined
  5663. : res
  5664. };
  5665. // this is a slot using the new v-slot syntax without scope. although it is
  5666. // compiled as a scoped slot, render fn users would expect it to be present
  5667. // on this.$slots because the usage is semantically a normal slot.
  5668. if (fn.proxy) {
  5669. Object.defineProperty(normalSlots, key, {
  5670. get: normalized,
  5671. enumerable: true,
  5672. configurable: true
  5673. });
  5674. }
  5675. return normalized
  5676. }
  5677. function proxyNormalSlot(slots, key) {
  5678. return function () { return slots[key]; }
  5679. }
  5680. /* */
  5681. /**
  5682. * Runtime helper for rendering v-for lists.
  5683. */
  5684. function renderList (
  5685. val,
  5686. render
  5687. ) {
  5688. var ret, i, l, keys, key;
  5689. if (Array.isArray(val) || typeof val === 'string') {
  5690. ret = new Array(val.length);
  5691. for (i = 0, l = val.length; i < l; i++) {
  5692. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5693. }
  5694. } else if (typeof val === 'number') {
  5695. ret = new Array(val);
  5696. for (i = 0; i < val; i++) {
  5697. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5698. }
  5699. } else if (isObject(val)) {
  5700. if (hasSymbol && val[Symbol.iterator]) {
  5701. ret = [];
  5702. var iterator = val[Symbol.iterator]();
  5703. var result = iterator.next();
  5704. while (!result.done) {
  5705. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5706. result = iterator.next();
  5707. }
  5708. } else {
  5709. keys = Object.keys(val);
  5710. ret = new Array(keys.length);
  5711. for (i = 0, l = keys.length; i < l; i++) {
  5712. key = keys[i];
  5713. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5714. }
  5715. }
  5716. }
  5717. if (!isDef(ret)) {
  5718. ret = [];
  5719. }
  5720. (ret)._isVList = true;
  5721. return ret
  5722. }
  5723. /* */
  5724. /**
  5725. * Runtime helper for rendering <slot>
  5726. */
  5727. function renderSlot (
  5728. name,
  5729. fallback,
  5730. props,
  5731. bindObject
  5732. ) {
  5733. var scopedSlotFn = this.$scopedSlots[name];
  5734. var nodes;
  5735. if (scopedSlotFn) { // scoped slot
  5736. props = props || {};
  5737. if (bindObject) {
  5738. if ( true && !isObject(bindObject)) {
  5739. warn(
  5740. 'slot v-bind without argument expects an Object',
  5741. this
  5742. );
  5743. }
  5744. props = extend(extend({}, bindObject), props);
  5745. }
  5746. // fixed by xxxxxx app-plus scopedSlot
  5747. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5748. } else {
  5749. nodes = this.$slots[name] || fallback;
  5750. }
  5751. var target = props && props.slot;
  5752. if (target) {
  5753. return this.$createElement('template', { slot: target }, nodes)
  5754. } else {
  5755. return nodes
  5756. }
  5757. }
  5758. /* */
  5759. /**
  5760. * Runtime helper for resolving filters
  5761. */
  5762. function resolveFilter (id) {
  5763. return resolveAsset(this.$options, 'filters', id, true) || identity
  5764. }
  5765. /* */
  5766. function isKeyNotMatch (expect, actual) {
  5767. if (Array.isArray(expect)) {
  5768. return expect.indexOf(actual) === -1
  5769. } else {
  5770. return expect !== actual
  5771. }
  5772. }
  5773. /**
  5774. * Runtime helper for checking keyCodes from config.
  5775. * exposed as Vue.prototype._k
  5776. * passing in eventKeyName as last argument separately for backwards compat
  5777. */
  5778. function checkKeyCodes (
  5779. eventKeyCode,
  5780. key,
  5781. builtInKeyCode,
  5782. eventKeyName,
  5783. builtInKeyName
  5784. ) {
  5785. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5786. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5787. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5788. } else if (mappedKeyCode) {
  5789. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5790. } else if (eventKeyName) {
  5791. return hyphenate(eventKeyName) !== key
  5792. }
  5793. }
  5794. /* */
  5795. /**
  5796. * Runtime helper for merging v-bind="object" into a VNode's data.
  5797. */
  5798. function bindObjectProps (
  5799. data,
  5800. tag,
  5801. value,
  5802. asProp,
  5803. isSync
  5804. ) {
  5805. if (value) {
  5806. if (!isObject(value)) {
  5807. true && warn(
  5808. 'v-bind without argument expects an Object or Array value',
  5809. this
  5810. );
  5811. } else {
  5812. if (Array.isArray(value)) {
  5813. value = toObject(value);
  5814. }
  5815. var hash;
  5816. var loop = function ( key ) {
  5817. if (
  5818. key === 'class' ||
  5819. key === 'style' ||
  5820. isReservedAttribute(key)
  5821. ) {
  5822. hash = data;
  5823. } else {
  5824. var type = data.attrs && data.attrs.type;
  5825. hash = asProp || config.mustUseProp(tag, type, key)
  5826. ? data.domProps || (data.domProps = {})
  5827. : data.attrs || (data.attrs = {});
  5828. }
  5829. var camelizedKey = camelize(key);
  5830. var hyphenatedKey = hyphenate(key);
  5831. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5832. hash[key] = value[key];
  5833. if (isSync) {
  5834. var on = data.on || (data.on = {});
  5835. on[("update:" + key)] = function ($event) {
  5836. value[key] = $event;
  5837. };
  5838. }
  5839. }
  5840. };
  5841. for (var key in value) loop( key );
  5842. }
  5843. }
  5844. return data
  5845. }
  5846. /* */
  5847. /**
  5848. * Runtime helper for rendering static trees.
  5849. */
  5850. function renderStatic (
  5851. index,
  5852. isInFor
  5853. ) {
  5854. var cached = this._staticTrees || (this._staticTrees = []);
  5855. var tree = cached[index];
  5856. // if has already-rendered static tree and not inside v-for,
  5857. // we can reuse the same tree.
  5858. if (tree && !isInFor) {
  5859. return tree
  5860. }
  5861. // otherwise, render a fresh tree.
  5862. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5863. this._renderProxy,
  5864. null,
  5865. this // for render fns generated for functional component templates
  5866. );
  5867. markStatic(tree, ("__static__" + index), false);
  5868. return tree
  5869. }
  5870. /**
  5871. * Runtime helper for v-once.
  5872. * Effectively it means marking the node as static with a unique key.
  5873. */
  5874. function markOnce (
  5875. tree,
  5876. index,
  5877. key
  5878. ) {
  5879. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5880. return tree
  5881. }
  5882. function markStatic (
  5883. tree,
  5884. key,
  5885. isOnce
  5886. ) {
  5887. if (Array.isArray(tree)) {
  5888. for (var i = 0; i < tree.length; i++) {
  5889. if (tree[i] && typeof tree[i] !== 'string') {
  5890. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5891. }
  5892. }
  5893. } else {
  5894. markStaticNode(tree, key, isOnce);
  5895. }
  5896. }
  5897. function markStaticNode (node, key, isOnce) {
  5898. node.isStatic = true;
  5899. node.key = key;
  5900. node.isOnce = isOnce;
  5901. }
  5902. /* */
  5903. function bindObjectListeners (data, value) {
  5904. if (value) {
  5905. if (!isPlainObject(value)) {
  5906. true && warn(
  5907. 'v-on without argument expects an Object value',
  5908. this
  5909. );
  5910. } else {
  5911. var on = data.on = data.on ? extend({}, data.on) : {};
  5912. for (var key in value) {
  5913. var existing = on[key];
  5914. var ours = value[key];
  5915. on[key] = existing ? [].concat(existing, ours) : ours;
  5916. }
  5917. }
  5918. }
  5919. return data
  5920. }
  5921. /* */
  5922. function resolveScopedSlots (
  5923. fns, // see flow/vnode
  5924. res,
  5925. // the following are added in 2.6
  5926. hasDynamicKeys,
  5927. contentHashKey
  5928. ) {
  5929. res = res || { $stable: !hasDynamicKeys };
  5930. for (var i = 0; i < fns.length; i++) {
  5931. var slot = fns[i];
  5932. if (Array.isArray(slot)) {
  5933. resolveScopedSlots(slot, res, hasDynamicKeys);
  5934. } else if (slot) {
  5935. // marker for reverse proxying v-slot without scope on this.$slots
  5936. if (slot.proxy) {
  5937. slot.fn.proxy = true;
  5938. }
  5939. res[slot.key] = slot.fn;
  5940. }
  5941. }
  5942. if (contentHashKey) {
  5943. (res).$key = contentHashKey;
  5944. }
  5945. return res
  5946. }
  5947. /* */
  5948. function bindDynamicKeys (baseObj, values) {
  5949. for (var i = 0; i < values.length; i += 2) {
  5950. var key = values[i];
  5951. if (typeof key === 'string' && key) {
  5952. baseObj[values[i]] = values[i + 1];
  5953. } else if ( true && key !== '' && key !== null) {
  5954. // null is a special value for explicitly removing a binding
  5955. warn(
  5956. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5957. this
  5958. );
  5959. }
  5960. }
  5961. return baseObj
  5962. }
  5963. // helper to dynamically append modifier runtime markers to event names.
  5964. // ensure only append when value is already string, otherwise it will be cast
  5965. // to string and cause the type check to miss.
  5966. function prependModifier (value, symbol) {
  5967. return typeof value === 'string' ? symbol + value : value
  5968. }
  5969. /* */
  5970. function installRenderHelpers (target) {
  5971. target._o = markOnce;
  5972. target._n = toNumber;
  5973. target._s = toString;
  5974. target._l = renderList;
  5975. target._t = renderSlot;
  5976. target._q = looseEqual;
  5977. target._i = looseIndexOf;
  5978. target._m = renderStatic;
  5979. target._f = resolveFilter;
  5980. target._k = checkKeyCodes;
  5981. target._b = bindObjectProps;
  5982. target._v = createTextVNode;
  5983. target._e = createEmptyVNode;
  5984. target._u = resolveScopedSlots;
  5985. target._g = bindObjectListeners;
  5986. target._d = bindDynamicKeys;
  5987. target._p = prependModifier;
  5988. }
  5989. /* */
  5990. function FunctionalRenderContext (
  5991. data,
  5992. props,
  5993. children,
  5994. parent,
  5995. Ctor
  5996. ) {
  5997. var this$1 = this;
  5998. var options = Ctor.options;
  5999. // ensure the createElement function in functional components
  6000. // gets a unique context - this is necessary for correct named slot check
  6001. var contextVm;
  6002. if (hasOwn(parent, '_uid')) {
  6003. contextVm = Object.create(parent);
  6004. // $flow-disable-line
  6005. contextVm._original = parent;
  6006. } else {
  6007. // the context vm passed in is a functional context as well.
  6008. // in this case we want to make sure we are able to get a hold to the
  6009. // real context instance.
  6010. contextVm = parent;
  6011. // $flow-disable-line
  6012. parent = parent._original;
  6013. }
  6014. var isCompiled = isTrue(options._compiled);
  6015. var needNormalization = !isCompiled;
  6016. this.data = data;
  6017. this.props = props;
  6018. this.children = children;
  6019. this.parent = parent;
  6020. this.listeners = data.on || emptyObject;
  6021. this.injections = resolveInject(options.inject, parent);
  6022. this.slots = function () {
  6023. if (!this$1.$slots) {
  6024. normalizeScopedSlots(
  6025. data.scopedSlots,
  6026. this$1.$slots = resolveSlots(children, parent)
  6027. );
  6028. }
  6029. return this$1.$slots
  6030. };
  6031. Object.defineProperty(this, 'scopedSlots', ({
  6032. enumerable: true,
  6033. get: function get () {
  6034. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6035. }
  6036. }));
  6037. // support for compiled functional template
  6038. if (isCompiled) {
  6039. // exposing $options for renderStatic()
  6040. this.$options = options;
  6041. // pre-resolve slots for renderSlot()
  6042. this.$slots = this.slots();
  6043. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6044. }
  6045. if (options._scopeId) {
  6046. this._c = function (a, b, c, d) {
  6047. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6048. if (vnode && !Array.isArray(vnode)) {
  6049. vnode.fnScopeId = options._scopeId;
  6050. vnode.fnContext = parent;
  6051. }
  6052. return vnode
  6053. };
  6054. } else {
  6055. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6056. }
  6057. }
  6058. installRenderHelpers(FunctionalRenderContext.prototype);
  6059. function createFunctionalComponent (
  6060. Ctor,
  6061. propsData,
  6062. data,
  6063. contextVm,
  6064. children
  6065. ) {
  6066. var options = Ctor.options;
  6067. var props = {};
  6068. var propOptions = options.props;
  6069. if (isDef(propOptions)) {
  6070. for (var key in propOptions) {
  6071. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6072. }
  6073. } else {
  6074. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6075. if (isDef(data.props)) { mergeProps(props, data.props); }
  6076. }
  6077. var renderContext = new FunctionalRenderContext(
  6078. data,
  6079. props,
  6080. children,
  6081. contextVm,
  6082. Ctor
  6083. );
  6084. var vnode = options.render.call(null, renderContext._c, renderContext);
  6085. if (vnode instanceof VNode) {
  6086. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6087. } else if (Array.isArray(vnode)) {
  6088. var vnodes = normalizeChildren(vnode) || [];
  6089. var res = new Array(vnodes.length);
  6090. for (var i = 0; i < vnodes.length; i++) {
  6091. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6092. }
  6093. return res
  6094. }
  6095. }
  6096. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6097. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6098. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6099. // that should not be matched to match.
  6100. var clone = cloneVNode(vnode);
  6101. clone.fnContext = contextVm;
  6102. clone.fnOptions = options;
  6103. if (true) {
  6104. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6105. }
  6106. if (data.slot) {
  6107. (clone.data || (clone.data = {})).slot = data.slot;
  6108. }
  6109. return clone
  6110. }
  6111. function mergeProps (to, from) {
  6112. for (var key in from) {
  6113. to[camelize(key)] = from[key];
  6114. }
  6115. }
  6116. /* */
  6117. /* */
  6118. /* */
  6119. /* */
  6120. // inline hooks to be invoked on component VNodes during patch
  6121. var componentVNodeHooks = {
  6122. init: function init (vnode, hydrating) {
  6123. if (
  6124. vnode.componentInstance &&
  6125. !vnode.componentInstance._isDestroyed &&
  6126. vnode.data.keepAlive
  6127. ) {
  6128. // kept-alive components, treat as a patch
  6129. var mountedNode = vnode; // work around flow
  6130. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6131. } else {
  6132. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6133. vnode,
  6134. activeInstance
  6135. );
  6136. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6137. }
  6138. },
  6139. prepatch: function prepatch (oldVnode, vnode) {
  6140. var options = vnode.componentOptions;
  6141. var child = vnode.componentInstance = oldVnode.componentInstance;
  6142. updateChildComponent(
  6143. child,
  6144. options.propsData, // updated props
  6145. options.listeners, // updated listeners
  6146. vnode, // new parent vnode
  6147. options.children // new children
  6148. );
  6149. },
  6150. insert: function insert (vnode) {
  6151. var context = vnode.context;
  6152. var componentInstance = vnode.componentInstance;
  6153. if (!componentInstance._isMounted) {
  6154. callHook(componentInstance, 'onServiceCreated');
  6155. callHook(componentInstance, 'onServiceAttached');
  6156. componentInstance._isMounted = true;
  6157. callHook(componentInstance, 'mounted');
  6158. }
  6159. if (vnode.data.keepAlive) {
  6160. if (context._isMounted) {
  6161. // vue-router#1212
  6162. // During updates, a kept-alive component's child components may
  6163. // change, so directly walking the tree here may call activated hooks
  6164. // on incorrect children. Instead we push them into a queue which will
  6165. // be processed after the whole patch process ended.
  6166. queueActivatedComponent(componentInstance);
  6167. } else {
  6168. activateChildComponent(componentInstance, true /* direct */);
  6169. }
  6170. }
  6171. },
  6172. destroy: function destroy (vnode) {
  6173. var componentInstance = vnode.componentInstance;
  6174. if (!componentInstance._isDestroyed) {
  6175. if (!vnode.data.keepAlive) {
  6176. componentInstance.$destroy();
  6177. } else {
  6178. deactivateChildComponent(componentInstance, true /* direct */);
  6179. }
  6180. }
  6181. }
  6182. };
  6183. var hooksToMerge = Object.keys(componentVNodeHooks);
  6184. function createComponent (
  6185. Ctor,
  6186. data,
  6187. context,
  6188. children,
  6189. tag
  6190. ) {
  6191. if (isUndef(Ctor)) {
  6192. return
  6193. }
  6194. var baseCtor = context.$options._base;
  6195. // plain options object: turn it into a constructor
  6196. if (isObject(Ctor)) {
  6197. Ctor = baseCtor.extend(Ctor);
  6198. }
  6199. // if at this stage it's not a constructor or an async component factory,
  6200. // reject.
  6201. if (typeof Ctor !== 'function') {
  6202. if (true) {
  6203. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6204. }
  6205. return
  6206. }
  6207. // async component
  6208. var asyncFactory;
  6209. if (isUndef(Ctor.cid)) {
  6210. asyncFactory = Ctor;
  6211. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6212. if (Ctor === undefined) {
  6213. // return a placeholder node for async component, which is rendered
  6214. // as a comment node but preserves all the raw information for the node.
  6215. // the information will be used for async server-rendering and hydration.
  6216. return createAsyncPlaceholder(
  6217. asyncFactory,
  6218. data,
  6219. context,
  6220. children,
  6221. tag
  6222. )
  6223. }
  6224. }
  6225. data = data || {};
  6226. // resolve constructor options in case global mixins are applied after
  6227. // component constructor creation
  6228. resolveConstructorOptions(Ctor);
  6229. // transform component v-model data into props & events
  6230. if (isDef(data.model)) {
  6231. transformModel(Ctor.options, data);
  6232. }
  6233. // extract props
  6234. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6235. // functional component
  6236. if (isTrue(Ctor.options.functional)) {
  6237. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6238. }
  6239. // extract listeners, since these needs to be treated as
  6240. // child component listeners instead of DOM listeners
  6241. var listeners = data.on;
  6242. // replace with listeners with .native modifier
  6243. // so it gets processed during parent component patch.
  6244. data.on = data.nativeOn;
  6245. if (isTrue(Ctor.options.abstract)) {
  6246. // abstract components do not keep anything
  6247. // other than props & listeners & slot
  6248. // work around flow
  6249. var slot = data.slot;
  6250. data = {};
  6251. if (slot) {
  6252. data.slot = slot;
  6253. }
  6254. }
  6255. // install component management hooks onto the placeholder node
  6256. installComponentHooks(data);
  6257. // return a placeholder vnode
  6258. var name = Ctor.options.name || tag;
  6259. var vnode = new VNode(
  6260. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6261. data, undefined, undefined, undefined, context,
  6262. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6263. asyncFactory
  6264. );
  6265. return vnode
  6266. }
  6267. function createComponentInstanceForVnode (
  6268. vnode, // we know it's MountedComponentVNode but flow doesn't
  6269. parent // activeInstance in lifecycle state
  6270. ) {
  6271. var options = {
  6272. _isComponent: true,
  6273. _parentVnode: vnode,
  6274. parent: parent
  6275. };
  6276. // check inline-template render functions
  6277. var inlineTemplate = vnode.data.inlineTemplate;
  6278. if (isDef(inlineTemplate)) {
  6279. options.render = inlineTemplate.render;
  6280. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6281. }
  6282. return new vnode.componentOptions.Ctor(options)
  6283. }
  6284. function installComponentHooks (data) {
  6285. var hooks = data.hook || (data.hook = {});
  6286. for (var i = 0; i < hooksToMerge.length; i++) {
  6287. var key = hooksToMerge[i];
  6288. var existing = hooks[key];
  6289. var toMerge = componentVNodeHooks[key];
  6290. if (existing !== toMerge && !(existing && existing._merged)) {
  6291. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6292. }
  6293. }
  6294. }
  6295. function mergeHook$1 (f1, f2) {
  6296. var merged = function (a, b) {
  6297. // flow complains about extra args which is why we use any
  6298. f1(a, b);
  6299. f2(a, b);
  6300. };
  6301. merged._merged = true;
  6302. return merged
  6303. }
  6304. // transform component v-model info (value and callback) into
  6305. // prop and event handler respectively.
  6306. function transformModel (options, data) {
  6307. var prop = (options.model && options.model.prop) || 'value';
  6308. var event = (options.model && options.model.event) || 'input'
  6309. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6310. var on = data.on || (data.on = {});
  6311. var existing = on[event];
  6312. var callback = data.model.callback;
  6313. if (isDef(existing)) {
  6314. if (
  6315. Array.isArray(existing)
  6316. ? existing.indexOf(callback) === -1
  6317. : existing !== callback
  6318. ) {
  6319. on[event] = [callback].concat(existing);
  6320. }
  6321. } else {
  6322. on[event] = callback;
  6323. }
  6324. }
  6325. /* */
  6326. var SIMPLE_NORMALIZE = 1;
  6327. var ALWAYS_NORMALIZE = 2;
  6328. // wrapper function for providing a more flexible interface
  6329. // without getting yelled at by flow
  6330. function createElement (
  6331. context,
  6332. tag,
  6333. data,
  6334. children,
  6335. normalizationType,
  6336. alwaysNormalize
  6337. ) {
  6338. if (Array.isArray(data) || isPrimitive(data)) {
  6339. normalizationType = children;
  6340. children = data;
  6341. data = undefined;
  6342. }
  6343. if (isTrue(alwaysNormalize)) {
  6344. normalizationType = ALWAYS_NORMALIZE;
  6345. }
  6346. return _createElement(context, tag, data, children, normalizationType)
  6347. }
  6348. function _createElement (
  6349. context,
  6350. tag,
  6351. data,
  6352. children,
  6353. normalizationType
  6354. ) {
  6355. if (isDef(data) && isDef((data).__ob__)) {
  6356. true && warn(
  6357. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6358. 'Always create fresh vnode data objects in each render!',
  6359. context
  6360. );
  6361. return createEmptyVNode()
  6362. }
  6363. // object syntax in v-bind
  6364. if (isDef(data) && isDef(data.is)) {
  6365. tag = data.is;
  6366. }
  6367. if (!tag) {
  6368. // in case of component :is set to falsy value
  6369. return createEmptyVNode()
  6370. }
  6371. // warn against non-primitive key
  6372. if ( true &&
  6373. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6374. ) {
  6375. {
  6376. warn(
  6377. 'Avoid using non-primitive value as key, ' +
  6378. 'use string/number value instead.',
  6379. context
  6380. );
  6381. }
  6382. }
  6383. // support single function children as default scoped slot
  6384. if (Array.isArray(children) &&
  6385. typeof children[0] === 'function'
  6386. ) {
  6387. data = data || {};
  6388. data.scopedSlots = { default: children[0] };
  6389. children.length = 0;
  6390. }
  6391. if (normalizationType === ALWAYS_NORMALIZE) {
  6392. children = normalizeChildren(children);
  6393. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6394. children = simpleNormalizeChildren(children);
  6395. }
  6396. var vnode, ns;
  6397. if (typeof tag === 'string') {
  6398. var Ctor;
  6399. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6400. if (config.isReservedTag(tag)) {
  6401. // platform built-in elements
  6402. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6403. warn(
  6404. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6405. context
  6406. );
  6407. }
  6408. vnode = new VNode(
  6409. config.parsePlatformTagName(tag), data, children,
  6410. undefined, undefined, context
  6411. );
  6412. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6413. // component
  6414. vnode = createComponent(Ctor, data, context, children, tag);
  6415. } else {
  6416. // unknown or unlisted namespaced elements
  6417. // check at runtime because it may get assigned a namespace when its
  6418. // parent normalizes children
  6419. vnode = new VNode(
  6420. tag, data, children,
  6421. undefined, undefined, context
  6422. );
  6423. }
  6424. } else {
  6425. // direct component options / constructor
  6426. vnode = createComponent(tag, data, context, children);
  6427. }
  6428. if (Array.isArray(vnode)) {
  6429. return vnode
  6430. } else if (isDef(vnode)) {
  6431. if (isDef(ns)) { applyNS(vnode, ns); }
  6432. if (isDef(data)) { registerDeepBindings(data); }
  6433. return vnode
  6434. } else {
  6435. return createEmptyVNode()
  6436. }
  6437. }
  6438. function applyNS (vnode, ns, force) {
  6439. vnode.ns = ns;
  6440. if (vnode.tag === 'foreignObject') {
  6441. // use default namespace inside foreignObject
  6442. ns = undefined;
  6443. force = true;
  6444. }
  6445. if (isDef(vnode.children)) {
  6446. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6447. var child = vnode.children[i];
  6448. if (isDef(child.tag) && (
  6449. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6450. applyNS(child, ns, force);
  6451. }
  6452. }
  6453. }
  6454. }
  6455. // ref #5318
  6456. // necessary to ensure parent re-render when deep bindings like :style and
  6457. // :class are used on slot nodes
  6458. function registerDeepBindings (data) {
  6459. if (isObject(data.style)) {
  6460. traverse(data.style);
  6461. }
  6462. if (isObject(data.class)) {
  6463. traverse(data.class);
  6464. }
  6465. }
  6466. /* */
  6467. function initRender (vm) {
  6468. vm._vnode = null; // the root of the child tree
  6469. vm._staticTrees = null; // v-once cached trees
  6470. var options = vm.$options;
  6471. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6472. var renderContext = parentVnode && parentVnode.context;
  6473. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6474. vm.$scopedSlots = emptyObject;
  6475. // bind the createElement fn to this instance
  6476. // so that we get proper render context inside it.
  6477. // args order: tag, data, children, normalizationType, alwaysNormalize
  6478. // internal version is used by render functions compiled from templates
  6479. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6480. // normalization is always applied for the public version, used in
  6481. // user-written render functions.
  6482. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6483. // $attrs & $listeners are exposed for easier HOC creation.
  6484. // they need to be reactive so that HOCs using them are always updated
  6485. var parentData = parentVnode && parentVnode.data;
  6486. /* istanbul ignore else */
  6487. if (true) {
  6488. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6489. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6490. }, true);
  6491. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6492. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6493. }, true);
  6494. } else {}
  6495. }
  6496. var currentRenderingInstance = null;
  6497. function renderMixin (Vue) {
  6498. // install runtime convenience helpers
  6499. installRenderHelpers(Vue.prototype);
  6500. Vue.prototype.$nextTick = function (fn) {
  6501. return nextTick(fn, this)
  6502. };
  6503. Vue.prototype._render = function () {
  6504. var vm = this;
  6505. var ref = vm.$options;
  6506. var render = ref.render;
  6507. var _parentVnode = ref._parentVnode;
  6508. if (_parentVnode) {
  6509. vm.$scopedSlots = normalizeScopedSlots(
  6510. _parentVnode.data.scopedSlots,
  6511. vm.$slots,
  6512. vm.$scopedSlots
  6513. );
  6514. }
  6515. // set parent vnode. this allows render functions to have access
  6516. // to the data on the placeholder node.
  6517. vm.$vnode = _parentVnode;
  6518. // render self
  6519. var vnode;
  6520. try {
  6521. // There's no need to maintain a stack because all render fns are called
  6522. // separately from one another. Nested component's render fns are called
  6523. // when parent component is patched.
  6524. currentRenderingInstance = vm;
  6525. vnode = render.call(vm._renderProxy, vm.$createElement);
  6526. } catch (e) {
  6527. handleError(e, vm, "render");
  6528. // return error render result,
  6529. // or previous vnode to prevent render error causing blank component
  6530. /* istanbul ignore else */
  6531. if ( true && vm.$options.renderError) {
  6532. try {
  6533. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6534. } catch (e) {
  6535. handleError(e, vm, "renderError");
  6536. vnode = vm._vnode;
  6537. }
  6538. } else {
  6539. vnode = vm._vnode;
  6540. }
  6541. } finally {
  6542. currentRenderingInstance = null;
  6543. }
  6544. // if the returned array contains only a single node, allow it
  6545. if (Array.isArray(vnode) && vnode.length === 1) {
  6546. vnode = vnode[0];
  6547. }
  6548. // return empty vnode in case the render function errored out
  6549. if (!(vnode instanceof VNode)) {
  6550. if ( true && Array.isArray(vnode)) {
  6551. warn(
  6552. 'Multiple root nodes returned from render function. Render function ' +
  6553. 'should return a single root node.',
  6554. vm
  6555. );
  6556. }
  6557. vnode = createEmptyVNode();
  6558. }
  6559. // set parent
  6560. vnode.parent = _parentVnode;
  6561. return vnode
  6562. };
  6563. }
  6564. /* */
  6565. function ensureCtor (comp, base) {
  6566. if (
  6567. comp.__esModule ||
  6568. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6569. ) {
  6570. comp = comp.default;
  6571. }
  6572. return isObject(comp)
  6573. ? base.extend(comp)
  6574. : comp
  6575. }
  6576. function createAsyncPlaceholder (
  6577. factory,
  6578. data,
  6579. context,
  6580. children,
  6581. tag
  6582. ) {
  6583. var node = createEmptyVNode();
  6584. node.asyncFactory = factory;
  6585. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6586. return node
  6587. }
  6588. function resolveAsyncComponent (
  6589. factory,
  6590. baseCtor
  6591. ) {
  6592. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6593. return factory.errorComp
  6594. }
  6595. if (isDef(factory.resolved)) {
  6596. return factory.resolved
  6597. }
  6598. var owner = currentRenderingInstance;
  6599. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6600. // already pending
  6601. factory.owners.push(owner);
  6602. }
  6603. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6604. return factory.loadingComp
  6605. }
  6606. if (owner && !isDef(factory.owners)) {
  6607. var owners = factory.owners = [owner];
  6608. var sync = true;
  6609. var timerLoading = null;
  6610. var timerTimeout = null
  6611. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6612. var forceRender = function (renderCompleted) {
  6613. for (var i = 0, l = owners.length; i < l; i++) {
  6614. (owners[i]).$forceUpdate();
  6615. }
  6616. if (renderCompleted) {
  6617. owners.length = 0;
  6618. if (timerLoading !== null) {
  6619. clearTimeout(timerLoading);
  6620. timerLoading = null;
  6621. }
  6622. if (timerTimeout !== null) {
  6623. clearTimeout(timerTimeout);
  6624. timerTimeout = null;
  6625. }
  6626. }
  6627. };
  6628. var resolve = once(function (res) {
  6629. // cache resolved
  6630. factory.resolved = ensureCtor(res, baseCtor);
  6631. // invoke callbacks only if this is not a synchronous resolve
  6632. // (async resolves are shimmed as synchronous during SSR)
  6633. if (!sync) {
  6634. forceRender(true);
  6635. } else {
  6636. owners.length = 0;
  6637. }
  6638. });
  6639. var reject = once(function (reason) {
  6640. true && warn(
  6641. "Failed to resolve async component: " + (String(factory)) +
  6642. (reason ? ("\nReason: " + reason) : '')
  6643. );
  6644. if (isDef(factory.errorComp)) {
  6645. factory.error = true;
  6646. forceRender(true);
  6647. }
  6648. });
  6649. var res = factory(resolve, reject);
  6650. if (isObject(res)) {
  6651. if (isPromise(res)) {
  6652. // () => Promise
  6653. if (isUndef(factory.resolved)) {
  6654. res.then(resolve, reject);
  6655. }
  6656. } else if (isPromise(res.component)) {
  6657. res.component.then(resolve, reject);
  6658. if (isDef(res.error)) {
  6659. factory.errorComp = ensureCtor(res.error, baseCtor);
  6660. }
  6661. if (isDef(res.loading)) {
  6662. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6663. if (res.delay === 0) {
  6664. factory.loading = true;
  6665. } else {
  6666. timerLoading = setTimeout(function () {
  6667. timerLoading = null;
  6668. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6669. factory.loading = true;
  6670. forceRender(false);
  6671. }
  6672. }, res.delay || 200);
  6673. }
  6674. }
  6675. if (isDef(res.timeout)) {
  6676. timerTimeout = setTimeout(function () {
  6677. timerTimeout = null;
  6678. if (isUndef(factory.resolved)) {
  6679. reject(
  6680. true
  6681. ? ("timeout (" + (res.timeout) + "ms)")
  6682. : undefined
  6683. );
  6684. }
  6685. }, res.timeout);
  6686. }
  6687. }
  6688. }
  6689. sync = false;
  6690. // return in case resolved synchronously
  6691. return factory.loading
  6692. ? factory.loadingComp
  6693. : factory.resolved
  6694. }
  6695. }
  6696. /* */
  6697. function isAsyncPlaceholder (node) {
  6698. return node.isComment && node.asyncFactory
  6699. }
  6700. /* */
  6701. function getFirstComponentChild (children) {
  6702. if (Array.isArray(children)) {
  6703. for (var i = 0; i < children.length; i++) {
  6704. var c = children[i];
  6705. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6706. return c
  6707. }
  6708. }
  6709. }
  6710. }
  6711. /* */
  6712. /* */
  6713. function initEvents (vm) {
  6714. vm._events = Object.create(null);
  6715. vm._hasHookEvent = false;
  6716. // init parent attached events
  6717. var listeners = vm.$options._parentListeners;
  6718. if (listeners) {
  6719. updateComponentListeners(vm, listeners);
  6720. }
  6721. }
  6722. var target;
  6723. function add (event, fn) {
  6724. target.$on(event, fn);
  6725. }
  6726. function remove$1 (event, fn) {
  6727. target.$off(event, fn);
  6728. }
  6729. function createOnceHandler (event, fn) {
  6730. var _target = target;
  6731. return function onceHandler () {
  6732. var res = fn.apply(null, arguments);
  6733. if (res !== null) {
  6734. _target.$off(event, onceHandler);
  6735. }
  6736. }
  6737. }
  6738. function updateComponentListeners (
  6739. vm,
  6740. listeners,
  6741. oldListeners
  6742. ) {
  6743. target = vm;
  6744. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6745. target = undefined;
  6746. }
  6747. function eventsMixin (Vue) {
  6748. var hookRE = /^hook:/;
  6749. Vue.prototype.$on = function (event, fn) {
  6750. var vm = this;
  6751. if (Array.isArray(event)) {
  6752. for (var i = 0, l = event.length; i < l; i++) {
  6753. vm.$on(event[i], fn);
  6754. }
  6755. } else {
  6756. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6757. // optimize hook:event cost by using a boolean flag marked at registration
  6758. // instead of a hash lookup
  6759. if (hookRE.test(event)) {
  6760. vm._hasHookEvent = true;
  6761. }
  6762. }
  6763. return vm
  6764. };
  6765. Vue.prototype.$once = function (event, fn) {
  6766. var vm = this;
  6767. function on () {
  6768. vm.$off(event, on);
  6769. fn.apply(vm, arguments);
  6770. }
  6771. on.fn = fn;
  6772. vm.$on(event, on);
  6773. return vm
  6774. };
  6775. Vue.prototype.$off = function (event, fn) {
  6776. var vm = this;
  6777. // all
  6778. if (!arguments.length) {
  6779. vm._events = Object.create(null);
  6780. return vm
  6781. }
  6782. // array of events
  6783. if (Array.isArray(event)) {
  6784. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6785. vm.$off(event[i$1], fn);
  6786. }
  6787. return vm
  6788. }
  6789. // specific event
  6790. var cbs = vm._events[event];
  6791. if (!cbs) {
  6792. return vm
  6793. }
  6794. if (!fn) {
  6795. vm._events[event] = null;
  6796. return vm
  6797. }
  6798. // specific handler
  6799. var cb;
  6800. var i = cbs.length;
  6801. while (i--) {
  6802. cb = cbs[i];
  6803. if (cb === fn || cb.fn === fn) {
  6804. cbs.splice(i, 1);
  6805. break
  6806. }
  6807. }
  6808. return vm
  6809. };
  6810. Vue.prototype.$emit = function (event) {
  6811. var vm = this;
  6812. if (true) {
  6813. var lowerCaseEvent = event.toLowerCase();
  6814. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6815. tip(
  6816. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6817. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6818. "Note that HTML attributes are case-insensitive and you cannot use " +
  6819. "v-on to listen to camelCase events when using in-DOM templates. " +
  6820. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6821. );
  6822. }
  6823. }
  6824. var cbs = vm._events[event];
  6825. if (cbs) {
  6826. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6827. var args = toArray(arguments, 1);
  6828. var info = "event handler for \"" + event + "\"";
  6829. for (var i = 0, l = cbs.length; i < l; i++) {
  6830. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6831. }
  6832. }
  6833. return vm
  6834. };
  6835. }
  6836. /* */
  6837. var activeInstance = null;
  6838. var isUpdatingChildComponent = false;
  6839. function setActiveInstance(vm) {
  6840. var prevActiveInstance = activeInstance;
  6841. activeInstance = vm;
  6842. return function () {
  6843. activeInstance = prevActiveInstance;
  6844. }
  6845. }
  6846. function initLifecycle (vm) {
  6847. var options = vm.$options;
  6848. // locate first non-abstract parent
  6849. var parent = options.parent;
  6850. if (parent && !options.abstract) {
  6851. while (parent.$options.abstract && parent.$parent) {
  6852. parent = parent.$parent;
  6853. }
  6854. parent.$children.push(vm);
  6855. }
  6856. vm.$parent = parent;
  6857. vm.$root = parent ? parent.$root : vm;
  6858. vm.$children = [];
  6859. vm.$refs = {};
  6860. vm._watcher = null;
  6861. vm._inactive = null;
  6862. vm._directInactive = false;
  6863. vm._isMounted = false;
  6864. vm._isDestroyed = false;
  6865. vm._isBeingDestroyed = false;
  6866. }
  6867. function lifecycleMixin (Vue) {
  6868. Vue.prototype._update = function (vnode, hydrating) {
  6869. var vm = this;
  6870. var prevEl = vm.$el;
  6871. var prevVnode = vm._vnode;
  6872. var restoreActiveInstance = setActiveInstance(vm);
  6873. vm._vnode = vnode;
  6874. // Vue.prototype.__patch__ is injected in entry points
  6875. // based on the rendering backend used.
  6876. if (!prevVnode) {
  6877. // initial render
  6878. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6879. } else {
  6880. // updates
  6881. vm.$el = vm.__patch__(prevVnode, vnode);
  6882. }
  6883. restoreActiveInstance();
  6884. // update __vue__ reference
  6885. if (prevEl) {
  6886. prevEl.__vue__ = null;
  6887. }
  6888. if (vm.$el) {
  6889. vm.$el.__vue__ = vm;
  6890. }
  6891. // if parent is an HOC, update its $el as well
  6892. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6893. vm.$parent.$el = vm.$el;
  6894. }
  6895. // updated hook is called by the scheduler to ensure that children are
  6896. // updated in a parent's updated hook.
  6897. };
  6898. Vue.prototype.$forceUpdate = function () {
  6899. var vm = this;
  6900. if (vm._watcher) {
  6901. vm._watcher.update();
  6902. }
  6903. };
  6904. Vue.prototype.$destroy = function () {
  6905. var vm = this;
  6906. if (vm._isBeingDestroyed) {
  6907. return
  6908. }
  6909. callHook(vm, 'beforeDestroy');
  6910. vm._isBeingDestroyed = true;
  6911. // remove self from parent
  6912. var parent = vm.$parent;
  6913. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6914. remove(parent.$children, vm);
  6915. }
  6916. // teardown watchers
  6917. if (vm._watcher) {
  6918. vm._watcher.teardown();
  6919. }
  6920. var i = vm._watchers.length;
  6921. while (i--) {
  6922. vm._watchers[i].teardown();
  6923. }
  6924. // remove reference from data ob
  6925. // frozen object may not have observer.
  6926. if (vm._data.__ob__) {
  6927. vm._data.__ob__.vmCount--;
  6928. }
  6929. // call the last hook...
  6930. vm._isDestroyed = true;
  6931. // invoke destroy hooks on current rendered tree
  6932. vm.__patch__(vm._vnode, null);
  6933. // fire destroyed hook
  6934. callHook(vm, 'destroyed');
  6935. // turn off all instance listeners.
  6936. vm.$off();
  6937. // remove __vue__ reference
  6938. if (vm.$el) {
  6939. vm.$el.__vue__ = null;
  6940. }
  6941. // release circular reference (#6759)
  6942. if (vm.$vnode) {
  6943. vm.$vnode.parent = null;
  6944. }
  6945. };
  6946. }
  6947. function updateChildComponent (
  6948. vm,
  6949. propsData,
  6950. listeners,
  6951. parentVnode,
  6952. renderChildren
  6953. ) {
  6954. if (true) {
  6955. isUpdatingChildComponent = true;
  6956. }
  6957. // determine whether component has slot children
  6958. // we need to do this before overwriting $options._renderChildren.
  6959. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6960. // dynamic slot names). Static scoped slots compiled from template has the
  6961. // "$stable" marker.
  6962. var newScopedSlots = parentVnode.data.scopedSlots;
  6963. var oldScopedSlots = vm.$scopedSlots;
  6964. var hasDynamicScopedSlot = !!(
  6965. (newScopedSlots && !newScopedSlots.$stable) ||
  6966. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6967. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6968. );
  6969. // Any static slot children from the parent may have changed during parent's
  6970. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6971. // update is necessary to ensure correctness.
  6972. var needsForceUpdate = !!(
  6973. renderChildren || // has new static slots
  6974. vm.$options._renderChildren || // has old static slots
  6975. hasDynamicScopedSlot
  6976. );
  6977. vm.$options._parentVnode = parentVnode;
  6978. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6979. if (vm._vnode) { // update child tree's parent
  6980. vm._vnode.parent = parentVnode;
  6981. }
  6982. vm.$options._renderChildren = renderChildren;
  6983. // update $attrs and $listeners hash
  6984. // these are also reactive so they may trigger child update if the child
  6985. // used them during render
  6986. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6987. vm.$listeners = listeners || emptyObject;
  6988. // update props
  6989. if (propsData && vm.$options.props) {
  6990. toggleObserving(false);
  6991. var props = vm._props;
  6992. var propKeys = vm.$options._propKeys || [];
  6993. for (var i = 0; i < propKeys.length; i++) {
  6994. var key = propKeys[i];
  6995. var propOptions = vm.$options.props; // wtf flow?
  6996. props[key] = validateProp(key, propOptions, propsData, vm);
  6997. }
  6998. toggleObserving(true);
  6999. // keep a copy of raw propsData
  7000. vm.$options.propsData = propsData;
  7001. }
  7002. // fixed by xxxxxx update properties(mp runtime)
  7003. vm._$updateProperties && vm._$updateProperties(vm);
  7004. // update listeners
  7005. listeners = listeners || emptyObject;
  7006. var oldListeners = vm.$options._parentListeners;
  7007. vm.$options._parentListeners = listeners;
  7008. updateComponentListeners(vm, listeners, oldListeners);
  7009. // resolve slots + force update if has children
  7010. if (needsForceUpdate) {
  7011. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7012. vm.$forceUpdate();
  7013. }
  7014. if (true) {
  7015. isUpdatingChildComponent = false;
  7016. }
  7017. }
  7018. function isInInactiveTree (vm) {
  7019. while (vm && (vm = vm.$parent)) {
  7020. if (vm._inactive) { return true }
  7021. }
  7022. return false
  7023. }
  7024. function activateChildComponent (vm, direct) {
  7025. if (direct) {
  7026. vm._directInactive = false;
  7027. if (isInInactiveTree(vm)) {
  7028. return
  7029. }
  7030. } else if (vm._directInactive) {
  7031. return
  7032. }
  7033. if (vm._inactive || vm._inactive === null) {
  7034. vm._inactive = false;
  7035. for (var i = 0; i < vm.$children.length; i++) {
  7036. activateChildComponent(vm.$children[i]);
  7037. }
  7038. callHook(vm, 'activated');
  7039. }
  7040. }
  7041. function deactivateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = true;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. }
  7048. if (!vm._inactive) {
  7049. vm._inactive = true;
  7050. for (var i = 0; i < vm.$children.length; i++) {
  7051. deactivateChildComponent(vm.$children[i]);
  7052. }
  7053. callHook(vm, 'deactivated');
  7054. }
  7055. }
  7056. function callHook (vm, hook) {
  7057. // #7573 disable dep collection when invoking lifecycle hooks
  7058. pushTarget();
  7059. var handlers = vm.$options[hook];
  7060. var info = hook + " hook";
  7061. if (handlers) {
  7062. for (var i = 0, j = handlers.length; i < j; i++) {
  7063. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7064. }
  7065. }
  7066. if (vm._hasHookEvent) {
  7067. vm.$emit('hook:' + hook);
  7068. }
  7069. popTarget();
  7070. }
  7071. /* */
  7072. var MAX_UPDATE_COUNT = 100;
  7073. var queue = [];
  7074. var activatedChildren = [];
  7075. var has = {};
  7076. var circular = {};
  7077. var waiting = false;
  7078. var flushing = false;
  7079. var index = 0;
  7080. /**
  7081. * Reset the scheduler's state.
  7082. */
  7083. function resetSchedulerState () {
  7084. index = queue.length = activatedChildren.length = 0;
  7085. has = {};
  7086. if (true) {
  7087. circular = {};
  7088. }
  7089. waiting = flushing = false;
  7090. }
  7091. // Async edge case #6566 requires saving the timestamp when event listeners are
  7092. // attached. However, calling performance.now() has a perf overhead especially
  7093. // if the page has thousands of event listeners. Instead, we take a timestamp
  7094. // every time the scheduler flushes and use that for all event listeners
  7095. // attached during that flush.
  7096. var currentFlushTimestamp = 0;
  7097. // Async edge case fix requires storing an event listener's attach timestamp.
  7098. var getNow = Date.now;
  7099. // Determine what event timestamp the browser is using. Annoyingly, the
  7100. // timestamp can either be hi-res (relative to page load) or low-res
  7101. // (relative to UNIX epoch), so in order to compare time we have to use the
  7102. // same timestamp type when saving the flush timestamp.
  7103. // All IE versions use low-res event timestamps, and have problematic clock
  7104. // implementations (#9632)
  7105. if (inBrowser && !isIE) {
  7106. var performance = window.performance;
  7107. if (
  7108. performance &&
  7109. typeof performance.now === 'function' &&
  7110. getNow() > document.createEvent('Event').timeStamp
  7111. ) {
  7112. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7113. // smaller than it, it means the event is using a hi-res timestamp,
  7114. // and we need to use the hi-res version for event listener timestamps as
  7115. // well.
  7116. getNow = function () { return performance.now(); };
  7117. }
  7118. }
  7119. /**
  7120. * Flush both queues and run the watchers.
  7121. */
  7122. function flushSchedulerQueue () {
  7123. currentFlushTimestamp = getNow();
  7124. flushing = true;
  7125. var watcher, id;
  7126. // Sort queue before flush.
  7127. // This ensures that:
  7128. // 1. Components are updated from parent to child. (because parent is always
  7129. // created before the child)
  7130. // 2. A component's user watchers are run before its render watcher (because
  7131. // user watchers are created before the render watcher)
  7132. // 3. If a component is destroyed during a parent component's watcher run,
  7133. // its watchers can be skipped.
  7134. queue.sort(function (a, b) { return a.id - b.id; });
  7135. // do not cache length because more watchers might be pushed
  7136. // as we run existing watchers
  7137. for (index = 0; index < queue.length; index++) {
  7138. watcher = queue[index];
  7139. if (watcher.before) {
  7140. watcher.before();
  7141. }
  7142. id = watcher.id;
  7143. has[id] = null;
  7144. watcher.run();
  7145. // in dev build, check and stop circular updates.
  7146. if ( true && has[id] != null) {
  7147. circular[id] = (circular[id] || 0) + 1;
  7148. if (circular[id] > MAX_UPDATE_COUNT) {
  7149. warn(
  7150. 'You may have an infinite update loop ' + (
  7151. watcher.user
  7152. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7153. : "in a component render function."
  7154. ),
  7155. watcher.vm
  7156. );
  7157. break
  7158. }
  7159. }
  7160. }
  7161. // keep copies of post queues before resetting state
  7162. var activatedQueue = activatedChildren.slice();
  7163. var updatedQueue = queue.slice();
  7164. resetSchedulerState();
  7165. // call component updated and activated hooks
  7166. callActivatedHooks(activatedQueue);
  7167. callUpdatedHooks(updatedQueue);
  7168. // devtool hook
  7169. /* istanbul ignore if */
  7170. if (devtools && config.devtools) {
  7171. devtools.emit('flush');
  7172. }
  7173. }
  7174. function callUpdatedHooks (queue) {
  7175. var i = queue.length;
  7176. while (i--) {
  7177. var watcher = queue[i];
  7178. var vm = watcher.vm;
  7179. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7180. callHook(vm, 'updated');
  7181. }
  7182. }
  7183. }
  7184. /**
  7185. * Queue a kept-alive component that was activated during patch.
  7186. * The queue will be processed after the entire tree has been patched.
  7187. */
  7188. function queueActivatedComponent (vm) {
  7189. // setting _inactive to false here so that a render function can
  7190. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7191. vm._inactive = false;
  7192. activatedChildren.push(vm);
  7193. }
  7194. function callActivatedHooks (queue) {
  7195. for (var i = 0; i < queue.length; i++) {
  7196. queue[i]._inactive = true;
  7197. activateChildComponent(queue[i], true /* true */);
  7198. }
  7199. }
  7200. /**
  7201. * Push a watcher into the watcher queue.
  7202. * Jobs with duplicate IDs will be skipped unless it's
  7203. * pushed when the queue is being flushed.
  7204. */
  7205. function queueWatcher (watcher) {
  7206. var id = watcher.id;
  7207. if (has[id] == null) {
  7208. has[id] = true;
  7209. if (!flushing) {
  7210. queue.push(watcher);
  7211. } else {
  7212. // if already flushing, splice the watcher based on its id
  7213. // if already past its id, it will be run next immediately.
  7214. var i = queue.length - 1;
  7215. while (i > index && queue[i].id > watcher.id) {
  7216. i--;
  7217. }
  7218. queue.splice(i + 1, 0, watcher);
  7219. }
  7220. // queue the flush
  7221. if (!waiting) {
  7222. waiting = true;
  7223. if ( true && !config.async) {
  7224. flushSchedulerQueue();
  7225. return
  7226. }
  7227. nextTick(flushSchedulerQueue);
  7228. }
  7229. }
  7230. }
  7231. /* */
  7232. var uid$2 = 0;
  7233. /**
  7234. * A watcher parses an expression, collects dependencies,
  7235. * and fires callback when the expression value changes.
  7236. * This is used for both the $watch() api and directives.
  7237. */
  7238. var Watcher = function Watcher (
  7239. vm,
  7240. expOrFn,
  7241. cb,
  7242. options,
  7243. isRenderWatcher
  7244. ) {
  7245. this.vm = vm;
  7246. if (isRenderWatcher) {
  7247. vm._watcher = this;
  7248. }
  7249. vm._watchers.push(this);
  7250. // options
  7251. if (options) {
  7252. this.deep = !!options.deep;
  7253. this.user = !!options.user;
  7254. this.lazy = !!options.lazy;
  7255. this.sync = !!options.sync;
  7256. this.before = options.before;
  7257. } else {
  7258. this.deep = this.user = this.lazy = this.sync = false;
  7259. }
  7260. this.cb = cb;
  7261. this.id = ++uid$2; // uid for batching
  7262. this.active = true;
  7263. this.dirty = this.lazy; // for lazy watchers
  7264. this.deps = [];
  7265. this.newDeps = [];
  7266. this.depIds = new _Set();
  7267. this.newDepIds = new _Set();
  7268. this.expression = true
  7269. ? expOrFn.toString()
  7270. : undefined;
  7271. // parse expression for getter
  7272. if (typeof expOrFn === 'function') {
  7273. this.getter = expOrFn;
  7274. } else {
  7275. this.getter = parsePath(expOrFn);
  7276. if (!this.getter) {
  7277. this.getter = noop;
  7278. true && warn(
  7279. "Failed watching path: \"" + expOrFn + "\" " +
  7280. 'Watcher only accepts simple dot-delimited paths. ' +
  7281. 'For full control, use a function instead.',
  7282. vm
  7283. );
  7284. }
  7285. }
  7286. this.value = this.lazy
  7287. ? undefined
  7288. : this.get();
  7289. };
  7290. /**
  7291. * Evaluate the getter, and re-collect dependencies.
  7292. */
  7293. Watcher.prototype.get = function get () {
  7294. pushTarget(this);
  7295. var value;
  7296. var vm = this.vm;
  7297. try {
  7298. value = this.getter.call(vm, vm);
  7299. } catch (e) {
  7300. if (this.user) {
  7301. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7302. } else {
  7303. throw e
  7304. }
  7305. } finally {
  7306. // "touch" every property so they are all tracked as
  7307. // dependencies for deep watching
  7308. if (this.deep) {
  7309. traverse(value);
  7310. }
  7311. popTarget();
  7312. this.cleanupDeps();
  7313. }
  7314. return value
  7315. };
  7316. /**
  7317. * Add a dependency to this directive.
  7318. */
  7319. Watcher.prototype.addDep = function addDep (dep) {
  7320. var id = dep.id;
  7321. if (!this.newDepIds.has(id)) {
  7322. this.newDepIds.add(id);
  7323. this.newDeps.push(dep);
  7324. if (!this.depIds.has(id)) {
  7325. dep.addSub(this);
  7326. }
  7327. }
  7328. };
  7329. /**
  7330. * Clean up for dependency collection.
  7331. */
  7332. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7333. var i = this.deps.length;
  7334. while (i--) {
  7335. var dep = this.deps[i];
  7336. if (!this.newDepIds.has(dep.id)) {
  7337. dep.removeSub(this);
  7338. }
  7339. }
  7340. var tmp = this.depIds;
  7341. this.depIds = this.newDepIds;
  7342. this.newDepIds = tmp;
  7343. this.newDepIds.clear();
  7344. tmp = this.deps;
  7345. this.deps = this.newDeps;
  7346. this.newDeps = tmp;
  7347. this.newDeps.length = 0;
  7348. };
  7349. /**
  7350. * Subscriber interface.
  7351. * Will be called when a dependency changes.
  7352. */
  7353. Watcher.prototype.update = function update () {
  7354. /* istanbul ignore else */
  7355. if (this.lazy) {
  7356. this.dirty = true;
  7357. } else if (this.sync) {
  7358. this.run();
  7359. } else {
  7360. queueWatcher(this);
  7361. }
  7362. };
  7363. /**
  7364. * Scheduler job interface.
  7365. * Will be called by the scheduler.
  7366. */
  7367. Watcher.prototype.run = function run () {
  7368. if (this.active) {
  7369. var value = this.get();
  7370. if (
  7371. value !== this.value ||
  7372. // Deep watchers and watchers on Object/Arrays should fire even
  7373. // when the value is the same, because the value may
  7374. // have mutated.
  7375. isObject(value) ||
  7376. this.deep
  7377. ) {
  7378. // set new value
  7379. var oldValue = this.value;
  7380. this.value = value;
  7381. if (this.user) {
  7382. try {
  7383. this.cb.call(this.vm, value, oldValue);
  7384. } catch (e) {
  7385. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7386. }
  7387. } else {
  7388. this.cb.call(this.vm, value, oldValue);
  7389. }
  7390. }
  7391. }
  7392. };
  7393. /**
  7394. * Evaluate the value of the watcher.
  7395. * This only gets called for lazy watchers.
  7396. */
  7397. Watcher.prototype.evaluate = function evaluate () {
  7398. this.value = this.get();
  7399. this.dirty = false;
  7400. };
  7401. /**
  7402. * Depend on all deps collected by this watcher.
  7403. */
  7404. Watcher.prototype.depend = function depend () {
  7405. var i = this.deps.length;
  7406. while (i--) {
  7407. this.deps[i].depend();
  7408. }
  7409. };
  7410. /**
  7411. * Remove self from all dependencies' subscriber list.
  7412. */
  7413. Watcher.prototype.teardown = function teardown () {
  7414. if (this.active) {
  7415. // remove self from vm's watcher list
  7416. // this is a somewhat expensive operation so we skip it
  7417. // if the vm is being destroyed.
  7418. if (!this.vm._isBeingDestroyed) {
  7419. remove(this.vm._watchers, this);
  7420. }
  7421. var i = this.deps.length;
  7422. while (i--) {
  7423. this.deps[i].removeSub(this);
  7424. }
  7425. this.active = false;
  7426. }
  7427. };
  7428. /* */
  7429. var sharedPropertyDefinition = {
  7430. enumerable: true,
  7431. configurable: true,
  7432. get: noop,
  7433. set: noop
  7434. };
  7435. function proxy (target, sourceKey, key) {
  7436. sharedPropertyDefinition.get = function proxyGetter () {
  7437. return this[sourceKey][key]
  7438. };
  7439. sharedPropertyDefinition.set = function proxySetter (val) {
  7440. this[sourceKey][key] = val;
  7441. };
  7442. Object.defineProperty(target, key, sharedPropertyDefinition);
  7443. }
  7444. function initState (vm) {
  7445. vm._watchers = [];
  7446. var opts = vm.$options;
  7447. if (opts.props) { initProps(vm, opts.props); }
  7448. if (opts.methods) { initMethods(vm, opts.methods); }
  7449. if (opts.data) {
  7450. initData(vm);
  7451. } else {
  7452. observe(vm._data = {}, true /* asRootData */);
  7453. }
  7454. if (opts.computed) { initComputed(vm, opts.computed); }
  7455. if (opts.watch && opts.watch !== nativeWatch) {
  7456. initWatch(vm, opts.watch);
  7457. }
  7458. }
  7459. function initProps (vm, propsOptions) {
  7460. var propsData = vm.$options.propsData || {};
  7461. var props = vm._props = {};
  7462. // cache prop keys so that future props updates can iterate using Array
  7463. // instead of dynamic object key enumeration.
  7464. var keys = vm.$options._propKeys = [];
  7465. var isRoot = !vm.$parent;
  7466. // root instance props should be converted
  7467. if (!isRoot) {
  7468. toggleObserving(false);
  7469. }
  7470. var loop = function ( key ) {
  7471. keys.push(key);
  7472. var value = validateProp(key, propsOptions, propsData, vm);
  7473. /* istanbul ignore else */
  7474. if (true) {
  7475. var hyphenatedKey = hyphenate(key);
  7476. if (isReservedAttribute(hyphenatedKey) ||
  7477. config.isReservedAttr(hyphenatedKey)) {
  7478. warn(
  7479. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7480. vm
  7481. );
  7482. }
  7483. defineReactive$$1(props, key, value, function () {
  7484. if (!isRoot && !isUpdatingChildComponent) {
  7485. {
  7486. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7487. return
  7488. }
  7489. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7490. if(
  7491. key === 'value' &&
  7492. Array.isArray(vm.$options.behaviors) &&
  7493. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7494. ){
  7495. return
  7496. }
  7497. if(vm._getFormData){
  7498. return
  7499. }
  7500. var $parent = vm.$parent;
  7501. while($parent){
  7502. if($parent.__next_tick_pending){
  7503. return
  7504. }
  7505. $parent = $parent.$parent;
  7506. }
  7507. }
  7508. warn(
  7509. "Avoid mutating a prop directly since the value will be " +
  7510. "overwritten whenever the parent component re-renders. " +
  7511. "Instead, use a data or computed property based on the prop's " +
  7512. "value. Prop being mutated: \"" + key + "\"",
  7513. vm
  7514. );
  7515. }
  7516. });
  7517. } else {}
  7518. // static props are already proxied on the component's prototype
  7519. // during Vue.extend(). We only need to proxy props defined at
  7520. // instantiation here.
  7521. if (!(key in vm)) {
  7522. proxy(vm, "_props", key);
  7523. }
  7524. };
  7525. for (var key in propsOptions) loop( key );
  7526. toggleObserving(true);
  7527. }
  7528. function initData (vm) {
  7529. var data = vm.$options.data;
  7530. data = vm._data = typeof data === 'function'
  7531. ? getData(data, vm)
  7532. : data || {};
  7533. if (!isPlainObject(data)) {
  7534. data = {};
  7535. true && warn(
  7536. 'data functions should return an object:\n' +
  7537. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7538. vm
  7539. );
  7540. }
  7541. // proxy data on instance
  7542. var keys = Object.keys(data);
  7543. var props = vm.$options.props;
  7544. var methods = vm.$options.methods;
  7545. var i = keys.length;
  7546. while (i--) {
  7547. var key = keys[i];
  7548. if (true) {
  7549. if (methods && hasOwn(methods, key)) {
  7550. warn(
  7551. ("Method \"" + key + "\" has already been defined as a data property."),
  7552. vm
  7553. );
  7554. }
  7555. }
  7556. if (props && hasOwn(props, key)) {
  7557. true && warn(
  7558. "The data property \"" + key + "\" is already declared as a prop. " +
  7559. "Use prop default value instead.",
  7560. vm
  7561. );
  7562. } else if (!isReserved(key)) {
  7563. proxy(vm, "_data", key);
  7564. }
  7565. }
  7566. // observe data
  7567. observe(data, true /* asRootData */);
  7568. }
  7569. function getData (data, vm) {
  7570. // #7573 disable dep collection when invoking data getters
  7571. pushTarget();
  7572. try {
  7573. return data.call(vm, vm)
  7574. } catch (e) {
  7575. handleError(e, vm, "data()");
  7576. return {}
  7577. } finally {
  7578. popTarget();
  7579. }
  7580. }
  7581. var computedWatcherOptions = { lazy: true };
  7582. function initComputed (vm, computed) {
  7583. // $flow-disable-line
  7584. var watchers = vm._computedWatchers = Object.create(null);
  7585. // computed properties are just getters during SSR
  7586. var isSSR = isServerRendering();
  7587. for (var key in computed) {
  7588. var userDef = computed[key];
  7589. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7590. if ( true && getter == null) {
  7591. warn(
  7592. ("Getter is missing for computed property \"" + key + "\"."),
  7593. vm
  7594. );
  7595. }
  7596. if (!isSSR) {
  7597. // create internal watcher for the computed property.
  7598. watchers[key] = new Watcher(
  7599. vm,
  7600. getter || noop,
  7601. noop,
  7602. computedWatcherOptions
  7603. );
  7604. }
  7605. // component-defined computed properties are already defined on the
  7606. // component prototype. We only need to define computed properties defined
  7607. // at instantiation here.
  7608. if (!(key in vm)) {
  7609. defineComputed(vm, key, userDef);
  7610. } else if (true) {
  7611. if (key in vm.$data) {
  7612. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7613. } else if (vm.$options.props && key in vm.$options.props) {
  7614. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7615. }
  7616. }
  7617. }
  7618. }
  7619. function defineComputed (
  7620. target,
  7621. key,
  7622. userDef
  7623. ) {
  7624. var shouldCache = !isServerRendering();
  7625. if (typeof userDef === 'function') {
  7626. sharedPropertyDefinition.get = shouldCache
  7627. ? createComputedGetter(key)
  7628. : createGetterInvoker(userDef);
  7629. sharedPropertyDefinition.set = noop;
  7630. } else {
  7631. sharedPropertyDefinition.get = userDef.get
  7632. ? shouldCache && userDef.cache !== false
  7633. ? createComputedGetter(key)
  7634. : createGetterInvoker(userDef.get)
  7635. : noop;
  7636. sharedPropertyDefinition.set = userDef.set || noop;
  7637. }
  7638. if ( true &&
  7639. sharedPropertyDefinition.set === noop) {
  7640. sharedPropertyDefinition.set = function () {
  7641. warn(
  7642. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7643. this
  7644. );
  7645. };
  7646. }
  7647. Object.defineProperty(target, key, sharedPropertyDefinition);
  7648. }
  7649. function createComputedGetter (key) {
  7650. return function computedGetter () {
  7651. var watcher = this._computedWatchers && this._computedWatchers[key];
  7652. if (watcher) {
  7653. if (watcher.dirty) {
  7654. watcher.evaluate();
  7655. }
  7656. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7657. watcher.depend();
  7658. }
  7659. return watcher.value
  7660. }
  7661. }
  7662. }
  7663. function createGetterInvoker(fn) {
  7664. return function computedGetter () {
  7665. return fn.call(this, this)
  7666. }
  7667. }
  7668. function initMethods (vm, methods) {
  7669. var props = vm.$options.props;
  7670. for (var key in methods) {
  7671. if (true) {
  7672. if (typeof methods[key] !== 'function') {
  7673. warn(
  7674. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7675. "Did you reference the function correctly?",
  7676. vm
  7677. );
  7678. }
  7679. if (props && hasOwn(props, key)) {
  7680. warn(
  7681. ("Method \"" + key + "\" has already been defined as a prop."),
  7682. vm
  7683. );
  7684. }
  7685. if ((key in vm) && isReserved(key)) {
  7686. warn(
  7687. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7688. "Avoid defining component methods that start with _ or $."
  7689. );
  7690. }
  7691. }
  7692. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7693. }
  7694. }
  7695. function initWatch (vm, watch) {
  7696. for (var key in watch) {
  7697. var handler = watch[key];
  7698. if (Array.isArray(handler)) {
  7699. for (var i = 0; i < handler.length; i++) {
  7700. createWatcher(vm, key, handler[i]);
  7701. }
  7702. } else {
  7703. createWatcher(vm, key, handler);
  7704. }
  7705. }
  7706. }
  7707. function createWatcher (
  7708. vm,
  7709. expOrFn,
  7710. handler,
  7711. options
  7712. ) {
  7713. if (isPlainObject(handler)) {
  7714. options = handler;
  7715. handler = handler.handler;
  7716. }
  7717. if (typeof handler === 'string') {
  7718. handler = vm[handler];
  7719. }
  7720. return vm.$watch(expOrFn, handler, options)
  7721. }
  7722. function stateMixin (Vue) {
  7723. // flow somehow has problems with directly declared definition object
  7724. // when using Object.defineProperty, so we have to procedurally build up
  7725. // the object here.
  7726. var dataDef = {};
  7727. dataDef.get = function () { return this._data };
  7728. var propsDef = {};
  7729. propsDef.get = function () { return this._props };
  7730. if (true) {
  7731. dataDef.set = function () {
  7732. warn(
  7733. 'Avoid replacing instance root $data. ' +
  7734. 'Use nested data properties instead.',
  7735. this
  7736. );
  7737. };
  7738. propsDef.set = function () {
  7739. warn("$props is readonly.", this);
  7740. };
  7741. }
  7742. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7743. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7744. Vue.prototype.$set = set;
  7745. Vue.prototype.$delete = del;
  7746. Vue.prototype.$watch = function (
  7747. expOrFn,
  7748. cb,
  7749. options
  7750. ) {
  7751. var vm = this;
  7752. if (isPlainObject(cb)) {
  7753. return createWatcher(vm, expOrFn, cb, options)
  7754. }
  7755. options = options || {};
  7756. options.user = true;
  7757. var watcher = new Watcher(vm, expOrFn, cb, options);
  7758. if (options.immediate) {
  7759. try {
  7760. cb.call(vm, watcher.value);
  7761. } catch (error) {
  7762. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7763. }
  7764. }
  7765. return function unwatchFn () {
  7766. watcher.teardown();
  7767. }
  7768. };
  7769. }
  7770. /* */
  7771. var uid$3 = 0;
  7772. function initMixin (Vue) {
  7773. Vue.prototype._init = function (options) {
  7774. var vm = this;
  7775. // a uid
  7776. vm._uid = uid$3++;
  7777. var startTag, endTag;
  7778. /* istanbul ignore if */
  7779. if ( true && config.performance && mark) {
  7780. startTag = "vue-perf-start:" + (vm._uid);
  7781. endTag = "vue-perf-end:" + (vm._uid);
  7782. mark(startTag);
  7783. }
  7784. // a flag to avoid this being observed
  7785. vm._isVue = true;
  7786. // merge options
  7787. if (options && options._isComponent) {
  7788. // optimize internal component instantiation
  7789. // since dynamic options merging is pretty slow, and none of the
  7790. // internal component options needs special treatment.
  7791. initInternalComponent(vm, options);
  7792. } else {
  7793. vm.$options = mergeOptions(
  7794. resolveConstructorOptions(vm.constructor),
  7795. options || {},
  7796. vm
  7797. );
  7798. }
  7799. /* istanbul ignore else */
  7800. if (true) {
  7801. initProxy(vm);
  7802. } else {}
  7803. // expose real self
  7804. vm._self = vm;
  7805. initLifecycle(vm);
  7806. initEvents(vm);
  7807. initRender(vm);
  7808. callHook(vm, 'beforeCreate');
  7809. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7810. initState(vm);
  7811. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7812. !vm._$fallback && callHook(vm, 'created');
  7813. /* istanbul ignore if */
  7814. if ( true && config.performance && mark) {
  7815. vm._name = formatComponentName(vm, false);
  7816. mark(endTag);
  7817. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7818. }
  7819. if (vm.$options.el) {
  7820. vm.$mount(vm.$options.el);
  7821. }
  7822. };
  7823. }
  7824. function initInternalComponent (vm, options) {
  7825. var opts = vm.$options = Object.create(vm.constructor.options);
  7826. // doing this because it's faster than dynamic enumeration.
  7827. var parentVnode = options._parentVnode;
  7828. opts.parent = options.parent;
  7829. opts._parentVnode = parentVnode;
  7830. var vnodeComponentOptions = parentVnode.componentOptions;
  7831. opts.propsData = vnodeComponentOptions.propsData;
  7832. opts._parentListeners = vnodeComponentOptions.listeners;
  7833. opts._renderChildren = vnodeComponentOptions.children;
  7834. opts._componentTag = vnodeComponentOptions.tag;
  7835. if (options.render) {
  7836. opts.render = options.render;
  7837. opts.staticRenderFns = options.staticRenderFns;
  7838. }
  7839. }
  7840. function resolveConstructorOptions (Ctor) {
  7841. var options = Ctor.options;
  7842. if (Ctor.super) {
  7843. var superOptions = resolveConstructorOptions(Ctor.super);
  7844. var cachedSuperOptions = Ctor.superOptions;
  7845. if (superOptions !== cachedSuperOptions) {
  7846. // super option changed,
  7847. // need to resolve new options.
  7848. Ctor.superOptions = superOptions;
  7849. // check if there are any late-modified/attached options (#4976)
  7850. var modifiedOptions = resolveModifiedOptions(Ctor);
  7851. // update base extend options
  7852. if (modifiedOptions) {
  7853. extend(Ctor.extendOptions, modifiedOptions);
  7854. }
  7855. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7856. if (options.name) {
  7857. options.components[options.name] = Ctor;
  7858. }
  7859. }
  7860. }
  7861. return options
  7862. }
  7863. function resolveModifiedOptions (Ctor) {
  7864. var modified;
  7865. var latest = Ctor.options;
  7866. var sealed = Ctor.sealedOptions;
  7867. for (var key in latest) {
  7868. if (latest[key] !== sealed[key]) {
  7869. if (!modified) { modified = {}; }
  7870. modified[key] = latest[key];
  7871. }
  7872. }
  7873. return modified
  7874. }
  7875. function Vue (options) {
  7876. if ( true &&
  7877. !(this instanceof Vue)
  7878. ) {
  7879. warn('Vue is a constructor and should be called with the `new` keyword');
  7880. }
  7881. this._init(options);
  7882. }
  7883. initMixin(Vue);
  7884. stateMixin(Vue);
  7885. eventsMixin(Vue);
  7886. lifecycleMixin(Vue);
  7887. renderMixin(Vue);
  7888. /* */
  7889. function initUse (Vue) {
  7890. Vue.use = function (plugin) {
  7891. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7892. if (installedPlugins.indexOf(plugin) > -1) {
  7893. return this
  7894. }
  7895. // additional parameters
  7896. var args = toArray(arguments, 1);
  7897. args.unshift(this);
  7898. if (typeof plugin.install === 'function') {
  7899. plugin.install.apply(plugin, args);
  7900. } else if (typeof plugin === 'function') {
  7901. plugin.apply(null, args);
  7902. }
  7903. installedPlugins.push(plugin);
  7904. return this
  7905. };
  7906. }
  7907. /* */
  7908. function initMixin$1 (Vue) {
  7909. Vue.mixin = function (mixin) {
  7910. this.options = mergeOptions(this.options, mixin);
  7911. return this
  7912. };
  7913. }
  7914. /* */
  7915. function initExtend (Vue) {
  7916. /**
  7917. * Each instance constructor, including Vue, has a unique
  7918. * cid. This enables us to create wrapped "child
  7919. * constructors" for prototypal inheritance and cache them.
  7920. */
  7921. Vue.cid = 0;
  7922. var cid = 1;
  7923. /**
  7924. * Class inheritance
  7925. */
  7926. Vue.extend = function (extendOptions) {
  7927. extendOptions = extendOptions || {};
  7928. var Super = this;
  7929. var SuperId = Super.cid;
  7930. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7931. if (cachedCtors[SuperId]) {
  7932. return cachedCtors[SuperId]
  7933. }
  7934. var name = extendOptions.name || Super.options.name;
  7935. if ( true && name) {
  7936. validateComponentName(name);
  7937. }
  7938. var Sub = function VueComponent (options) {
  7939. this._init(options);
  7940. };
  7941. Sub.prototype = Object.create(Super.prototype);
  7942. Sub.prototype.constructor = Sub;
  7943. Sub.cid = cid++;
  7944. Sub.options = mergeOptions(
  7945. Super.options,
  7946. extendOptions
  7947. );
  7948. Sub['super'] = Super;
  7949. // For props and computed properties, we define the proxy getters on
  7950. // the Vue instances at extension time, on the extended prototype. This
  7951. // avoids Object.defineProperty calls for each instance created.
  7952. if (Sub.options.props) {
  7953. initProps$1(Sub);
  7954. }
  7955. if (Sub.options.computed) {
  7956. initComputed$1(Sub);
  7957. }
  7958. // allow further extension/mixin/plugin usage
  7959. Sub.extend = Super.extend;
  7960. Sub.mixin = Super.mixin;
  7961. Sub.use = Super.use;
  7962. // create asset registers, so extended classes
  7963. // can have their private assets too.
  7964. ASSET_TYPES.forEach(function (type) {
  7965. Sub[type] = Super[type];
  7966. });
  7967. // enable recursive self-lookup
  7968. if (name) {
  7969. Sub.options.components[name] = Sub;
  7970. }
  7971. // keep a reference to the super options at extension time.
  7972. // later at instantiation we can check if Super's options have
  7973. // been updated.
  7974. Sub.superOptions = Super.options;
  7975. Sub.extendOptions = extendOptions;
  7976. Sub.sealedOptions = extend({}, Sub.options);
  7977. // cache constructor
  7978. cachedCtors[SuperId] = Sub;
  7979. return Sub
  7980. };
  7981. }
  7982. function initProps$1 (Comp) {
  7983. var props = Comp.options.props;
  7984. for (var key in props) {
  7985. proxy(Comp.prototype, "_props", key);
  7986. }
  7987. }
  7988. function initComputed$1 (Comp) {
  7989. var computed = Comp.options.computed;
  7990. for (var key in computed) {
  7991. defineComputed(Comp.prototype, key, computed[key]);
  7992. }
  7993. }
  7994. /* */
  7995. function initAssetRegisters (Vue) {
  7996. /**
  7997. * Create asset registration methods.
  7998. */
  7999. ASSET_TYPES.forEach(function (type) {
  8000. Vue[type] = function (
  8001. id,
  8002. definition
  8003. ) {
  8004. if (!definition) {
  8005. return this.options[type + 's'][id]
  8006. } else {
  8007. /* istanbul ignore if */
  8008. if ( true && type === 'component') {
  8009. validateComponentName(id);
  8010. }
  8011. if (type === 'component' && isPlainObject(definition)) {
  8012. definition.name = definition.name || id;
  8013. definition = this.options._base.extend(definition);
  8014. }
  8015. if (type === 'directive' && typeof definition === 'function') {
  8016. definition = { bind: definition, update: definition };
  8017. }
  8018. this.options[type + 's'][id] = definition;
  8019. return definition
  8020. }
  8021. };
  8022. });
  8023. }
  8024. /* */
  8025. function getComponentName (opts) {
  8026. return opts && (opts.Ctor.options.name || opts.tag)
  8027. }
  8028. function matches (pattern, name) {
  8029. if (Array.isArray(pattern)) {
  8030. return pattern.indexOf(name) > -1
  8031. } else if (typeof pattern === 'string') {
  8032. return pattern.split(',').indexOf(name) > -1
  8033. } else if (isRegExp(pattern)) {
  8034. return pattern.test(name)
  8035. }
  8036. /* istanbul ignore next */
  8037. return false
  8038. }
  8039. function pruneCache (keepAliveInstance, filter) {
  8040. var cache = keepAliveInstance.cache;
  8041. var keys = keepAliveInstance.keys;
  8042. var _vnode = keepAliveInstance._vnode;
  8043. for (var key in cache) {
  8044. var cachedNode = cache[key];
  8045. if (cachedNode) {
  8046. var name = getComponentName(cachedNode.componentOptions);
  8047. if (name && !filter(name)) {
  8048. pruneCacheEntry(cache, key, keys, _vnode);
  8049. }
  8050. }
  8051. }
  8052. }
  8053. function pruneCacheEntry (
  8054. cache,
  8055. key,
  8056. keys,
  8057. current
  8058. ) {
  8059. var cached$$1 = cache[key];
  8060. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8061. cached$$1.componentInstance.$destroy();
  8062. }
  8063. cache[key] = null;
  8064. remove(keys, key);
  8065. }
  8066. var patternTypes = [String, RegExp, Array];
  8067. var KeepAlive = {
  8068. name: 'keep-alive',
  8069. abstract: true,
  8070. props: {
  8071. include: patternTypes,
  8072. exclude: patternTypes,
  8073. max: [String, Number]
  8074. },
  8075. created: function created () {
  8076. this.cache = Object.create(null);
  8077. this.keys = [];
  8078. },
  8079. destroyed: function destroyed () {
  8080. for (var key in this.cache) {
  8081. pruneCacheEntry(this.cache, key, this.keys);
  8082. }
  8083. },
  8084. mounted: function mounted () {
  8085. var this$1 = this;
  8086. this.$watch('include', function (val) {
  8087. pruneCache(this$1, function (name) { return matches(val, name); });
  8088. });
  8089. this.$watch('exclude', function (val) {
  8090. pruneCache(this$1, function (name) { return !matches(val, name); });
  8091. });
  8092. },
  8093. render: function render () {
  8094. var slot = this.$slots.default;
  8095. var vnode = getFirstComponentChild(slot);
  8096. var componentOptions = vnode && vnode.componentOptions;
  8097. if (componentOptions) {
  8098. // check pattern
  8099. var name = getComponentName(componentOptions);
  8100. var ref = this;
  8101. var include = ref.include;
  8102. var exclude = ref.exclude;
  8103. if (
  8104. // not included
  8105. (include && (!name || !matches(include, name))) ||
  8106. // excluded
  8107. (exclude && name && matches(exclude, name))
  8108. ) {
  8109. return vnode
  8110. }
  8111. var ref$1 = this;
  8112. var cache = ref$1.cache;
  8113. var keys = ref$1.keys;
  8114. var key = vnode.key == null
  8115. // same constructor may get registered as different local components
  8116. // so cid alone is not enough (#3269)
  8117. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8118. : vnode.key;
  8119. if (cache[key]) {
  8120. vnode.componentInstance = cache[key].componentInstance;
  8121. // make current key freshest
  8122. remove(keys, key);
  8123. keys.push(key);
  8124. } else {
  8125. cache[key] = vnode;
  8126. keys.push(key);
  8127. // prune oldest entry
  8128. if (this.max && keys.length > parseInt(this.max)) {
  8129. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8130. }
  8131. }
  8132. vnode.data.keepAlive = true;
  8133. }
  8134. return vnode || (slot && slot[0])
  8135. }
  8136. };
  8137. var builtInComponents = {
  8138. KeepAlive: KeepAlive
  8139. };
  8140. /* */
  8141. function initGlobalAPI (Vue) {
  8142. // config
  8143. var configDef = {};
  8144. configDef.get = function () { return config; };
  8145. if (true) {
  8146. configDef.set = function () {
  8147. warn(
  8148. 'Do not replace the Vue.config object, set individual fields instead.'
  8149. );
  8150. };
  8151. }
  8152. Object.defineProperty(Vue, 'config', configDef);
  8153. // exposed util methods.
  8154. // NOTE: these are not considered part of the public API - avoid relying on
  8155. // them unless you are aware of the risk.
  8156. Vue.util = {
  8157. warn: warn,
  8158. extend: extend,
  8159. mergeOptions: mergeOptions,
  8160. defineReactive: defineReactive$$1
  8161. };
  8162. Vue.set = set;
  8163. Vue.delete = del;
  8164. Vue.nextTick = nextTick;
  8165. // 2.6 explicit observable API
  8166. Vue.observable = function (obj) {
  8167. observe(obj);
  8168. return obj
  8169. };
  8170. Vue.options = Object.create(null);
  8171. ASSET_TYPES.forEach(function (type) {
  8172. Vue.options[type + 's'] = Object.create(null);
  8173. });
  8174. // this is used to identify the "base" constructor to extend all plain-object
  8175. // components with in Weex's multi-instance scenarios.
  8176. Vue.options._base = Vue;
  8177. extend(Vue.options.components, builtInComponents);
  8178. initUse(Vue);
  8179. initMixin$1(Vue);
  8180. initExtend(Vue);
  8181. initAssetRegisters(Vue);
  8182. }
  8183. initGlobalAPI(Vue);
  8184. Object.defineProperty(Vue.prototype, '$isServer', {
  8185. get: isServerRendering
  8186. });
  8187. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8188. get: function get () {
  8189. /* istanbul ignore next */
  8190. return this.$vnode && this.$vnode.ssrContext
  8191. }
  8192. });
  8193. // expose FunctionalRenderContext for ssr runtime helper installation
  8194. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8195. value: FunctionalRenderContext
  8196. });
  8197. Vue.version = '2.6.11';
  8198. /**
  8199. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8200. */
  8201. var ARRAYTYPE = '[object Array]';
  8202. var OBJECTTYPE = '[object Object]';
  8203. var NULLTYPE = '[object Null]';
  8204. var UNDEFINEDTYPE = '[object Undefined]';
  8205. // const FUNCTIONTYPE = '[object Function]'
  8206. function diff(current, pre) {
  8207. var result = {};
  8208. syncKeys(current, pre);
  8209. _diff(current, pre, '', result);
  8210. return result
  8211. }
  8212. function syncKeys(current, pre) {
  8213. if (current === pre) { return }
  8214. var rootCurrentType = type(current);
  8215. var rootPreType = type(pre);
  8216. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8217. if(Object.keys(current).length >= Object.keys(pre).length){
  8218. for (var key in pre) {
  8219. var currentValue = current[key];
  8220. if (currentValue === undefined) {
  8221. current[key] = null;
  8222. } else {
  8223. syncKeys(currentValue, pre[key]);
  8224. }
  8225. }
  8226. }
  8227. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8228. if (current.length >= pre.length) {
  8229. pre.forEach(function (item, index) {
  8230. syncKeys(current[index], item);
  8231. });
  8232. }
  8233. }
  8234. }
  8235. function nullOrUndefined(currentType, preType) {
  8236. if(
  8237. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8238. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8239. ) {
  8240. return false
  8241. }
  8242. return true
  8243. }
  8244. function _diff(current, pre, path, result) {
  8245. if (current === pre) { return }
  8246. var rootCurrentType = type(current);
  8247. var rootPreType = type(pre);
  8248. if (rootCurrentType == OBJECTTYPE) {
  8249. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8250. setResult(result, path, current);
  8251. } else {
  8252. var loop = function ( key ) {
  8253. var currentValue = current[key];
  8254. var preValue = pre[key];
  8255. var currentType = type(currentValue);
  8256. var preType = type(preValue);
  8257. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8258. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8259. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8260. }
  8261. } else if (currentType == ARRAYTYPE) {
  8262. if (preType != ARRAYTYPE) {
  8263. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8264. } else {
  8265. if (currentValue.length < preValue.length) {
  8266. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8267. } else {
  8268. currentValue.forEach(function (item, index) {
  8269. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8270. });
  8271. }
  8272. }
  8273. } else if (currentType == OBJECTTYPE) {
  8274. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8275. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8276. } else {
  8277. for (var subKey in currentValue) {
  8278. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8279. }
  8280. }
  8281. }
  8282. };
  8283. for (var key in current) loop( key );
  8284. }
  8285. } else if (rootCurrentType == ARRAYTYPE) {
  8286. if (rootPreType != ARRAYTYPE) {
  8287. setResult(result, path, current);
  8288. } else {
  8289. if (current.length < pre.length) {
  8290. setResult(result, path, current);
  8291. } else {
  8292. current.forEach(function (item, index) {
  8293. _diff(item, pre[index], path + '[' + index + ']', result);
  8294. });
  8295. }
  8296. }
  8297. } else {
  8298. setResult(result, path, current);
  8299. }
  8300. }
  8301. function setResult(result, k, v) {
  8302. // if (type(v) != FUNCTIONTYPE) {
  8303. result[k] = v;
  8304. // }
  8305. }
  8306. function type(obj) {
  8307. return Object.prototype.toString.call(obj)
  8308. }
  8309. /* */
  8310. function flushCallbacks$1(vm) {
  8311. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8312. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8313. var mpInstance = vm.$scope;
  8314. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8315. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8316. }
  8317. var copies = vm.__next_tick_callbacks.slice(0);
  8318. vm.__next_tick_callbacks.length = 0;
  8319. for (var i = 0; i < copies.length; i++) {
  8320. copies[i]();
  8321. }
  8322. }
  8323. }
  8324. function hasRenderWatcher(vm) {
  8325. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8326. }
  8327. function nextTick$1(vm, cb) {
  8328. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8329. //2.nextTick 之前存在 render watcher
  8330. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8331. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8332. var mpInstance = vm.$scope;
  8333. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8334. ']:nextVueTick');
  8335. }
  8336. return nextTick(cb, vm)
  8337. }else{
  8338. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8339. var mpInstance$1 = vm.$scope;
  8340. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8341. ']:nextMPTick');
  8342. }
  8343. }
  8344. var _resolve;
  8345. if (!vm.__next_tick_callbacks) {
  8346. vm.__next_tick_callbacks = [];
  8347. }
  8348. vm.__next_tick_callbacks.push(function () {
  8349. if (cb) {
  8350. try {
  8351. cb.call(vm);
  8352. } catch (e) {
  8353. handleError(e, vm, 'nextTick');
  8354. }
  8355. } else if (_resolve) {
  8356. _resolve(vm);
  8357. }
  8358. });
  8359. // $flow-disable-line
  8360. if (!cb && typeof Promise !== 'undefined') {
  8361. return new Promise(function (resolve) {
  8362. _resolve = resolve;
  8363. })
  8364. }
  8365. }
  8366. /* */
  8367. function clearInstance(key, value) {
  8368. // 简易去除 Vue 和小程序组件实例
  8369. if (value) {
  8370. if (value._isVue || value.__v_isMPComponent) {
  8371. return {}
  8372. }
  8373. }
  8374. return value
  8375. }
  8376. function cloneWithData(vm) {
  8377. // 确保当前 vm 所有数据被同步
  8378. var ret = Object.create(null);
  8379. var dataKeys = [].concat(
  8380. Object.keys(vm._data || {}),
  8381. Object.keys(vm._computedWatchers || {}));
  8382. dataKeys.reduce(function(ret, key) {
  8383. ret[key] = vm[key];
  8384. return ret
  8385. }, ret);
  8386. // vue-composition-api
  8387. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8388. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8389. if (rawBindings) {
  8390. Object.keys(rawBindings).forEach(function (key) {
  8391. ret[key] = vm[key];
  8392. });
  8393. }
  8394. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8395. Object.assign(ret, vm.$mp.data || {});
  8396. if (
  8397. Array.isArray(vm.$options.behaviors) &&
  8398. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8399. ) { //form-field
  8400. ret['name'] = vm.name;
  8401. ret['value'] = vm.value;
  8402. }
  8403. return JSON.parse(JSON.stringify(ret, clearInstance))
  8404. }
  8405. var patch = function(oldVnode, vnode) {
  8406. var this$1 = this;
  8407. if (vnode === null) { //destroy
  8408. return
  8409. }
  8410. if (this.mpType === 'page' || this.mpType === 'component') {
  8411. var mpInstance = this.$scope;
  8412. var data = Object.create(null);
  8413. try {
  8414. data = cloneWithData(this);
  8415. } catch (err) {
  8416. console.error(err);
  8417. }
  8418. data.__webviewId__ = mpInstance.data.__webviewId__;
  8419. var mpData = Object.create(null);
  8420. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8421. mpData[key] = mpInstance.data[key];
  8422. });
  8423. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8424. if (Object.keys(diffData).length) {
  8425. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8426. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8427. ']差量更新',
  8428. JSON.stringify(diffData));
  8429. }
  8430. this.__next_tick_pending = true;
  8431. mpInstance.setData(diffData, function () {
  8432. this$1.__next_tick_pending = false;
  8433. flushCallbacks$1(this$1);
  8434. });
  8435. } else {
  8436. flushCallbacks$1(this);
  8437. }
  8438. }
  8439. };
  8440. /* */
  8441. function createEmptyRender() {
  8442. }
  8443. function mountComponent$1(
  8444. vm,
  8445. el,
  8446. hydrating
  8447. ) {
  8448. if (!vm.mpType) {//main.js 中的 new Vue
  8449. return vm
  8450. }
  8451. if (vm.mpType === 'app') {
  8452. vm.$options.render = createEmptyRender;
  8453. }
  8454. if (!vm.$options.render) {
  8455. vm.$options.render = createEmptyRender;
  8456. if (true) {
  8457. /* istanbul ignore if */
  8458. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8459. vm.$options.el || el) {
  8460. warn(
  8461. 'You are using the runtime-only build of Vue where the template ' +
  8462. 'compiler is not available. Either pre-compile the templates into ' +
  8463. 'render functions, or use the compiler-included build.',
  8464. vm
  8465. );
  8466. } else {
  8467. warn(
  8468. 'Failed to mount component: template or render function not defined.',
  8469. vm
  8470. );
  8471. }
  8472. }
  8473. }
  8474. !vm._$fallback && callHook(vm, 'beforeMount');
  8475. var updateComponent = function () {
  8476. vm._update(vm._render(), hydrating);
  8477. };
  8478. // we set this to vm._watcher inside the watcher's constructor
  8479. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8480. // component's mounted hook), which relies on vm._watcher being already defined
  8481. new Watcher(vm, updateComponent, noop, {
  8482. before: function before() {
  8483. if (vm._isMounted && !vm._isDestroyed) {
  8484. callHook(vm, 'beforeUpdate');
  8485. }
  8486. }
  8487. }, true /* isRenderWatcher */);
  8488. hydrating = false;
  8489. return vm
  8490. }
  8491. /* */
  8492. function renderClass (
  8493. staticClass,
  8494. dynamicClass
  8495. ) {
  8496. if (isDef(staticClass) || isDef(dynamicClass)) {
  8497. return concat(staticClass, stringifyClass(dynamicClass))
  8498. }
  8499. /* istanbul ignore next */
  8500. return ''
  8501. }
  8502. function concat (a, b) {
  8503. return a ? b ? (a + ' ' + b) : a : (b || '')
  8504. }
  8505. function stringifyClass (value) {
  8506. if (Array.isArray(value)) {
  8507. return stringifyArray(value)
  8508. }
  8509. if (isObject(value)) {
  8510. return stringifyObject(value)
  8511. }
  8512. if (typeof value === 'string') {
  8513. return value
  8514. }
  8515. /* istanbul ignore next */
  8516. return ''
  8517. }
  8518. function stringifyArray (value) {
  8519. var res = '';
  8520. var stringified;
  8521. for (var i = 0, l = value.length; i < l; i++) {
  8522. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8523. if (res) { res += ' '; }
  8524. res += stringified;
  8525. }
  8526. }
  8527. return res
  8528. }
  8529. function stringifyObject (value) {
  8530. var res = '';
  8531. for (var key in value) {
  8532. if (value[key]) {
  8533. if (res) { res += ' '; }
  8534. res += key;
  8535. }
  8536. }
  8537. return res
  8538. }
  8539. /* */
  8540. var parseStyleText = cached(function (cssText) {
  8541. var res = {};
  8542. var listDelimiter = /;(?![^(]*\))/g;
  8543. var propertyDelimiter = /:(.+)/;
  8544. cssText.split(listDelimiter).forEach(function (item) {
  8545. if (item) {
  8546. var tmp = item.split(propertyDelimiter);
  8547. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8548. }
  8549. });
  8550. return res
  8551. });
  8552. // normalize possible array / string values into Object
  8553. function normalizeStyleBinding (bindingStyle) {
  8554. if (Array.isArray(bindingStyle)) {
  8555. return toObject(bindingStyle)
  8556. }
  8557. if (typeof bindingStyle === 'string') {
  8558. return parseStyleText(bindingStyle)
  8559. }
  8560. return bindingStyle
  8561. }
  8562. /* */
  8563. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8564. function getTarget(obj, path) {
  8565. var parts = path.split('.');
  8566. var key = parts[0];
  8567. if (key.indexOf('__$n') === 0) { //number index
  8568. key = parseInt(key.replace('__$n', ''));
  8569. }
  8570. if (parts.length === 1) {
  8571. return obj[key]
  8572. }
  8573. return getTarget(obj[key], parts.slice(1).join('.'))
  8574. }
  8575. function internalMixin(Vue) {
  8576. Vue.config.errorHandler = function(err, vm, info) {
  8577. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8578. console.error(err);
  8579. /* eslint-disable no-undef */
  8580. var app = typeof getApp === 'function' && getApp();
  8581. if (app && app.onError) {
  8582. app.onError(err);
  8583. }
  8584. };
  8585. var oldEmit = Vue.prototype.$emit;
  8586. Vue.prototype.$emit = function(event) {
  8587. if (this.$scope && event) {
  8588. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8589. if (triggerEvent) {
  8590. try {
  8591. triggerEvent.call(this.$scope, event, {
  8592. __args__: toArray(arguments, 1)
  8593. });
  8594. } catch (error) {
  8595. }
  8596. }
  8597. }
  8598. return oldEmit.apply(this, arguments)
  8599. };
  8600. Vue.prototype.$nextTick = function(fn) {
  8601. return nextTick$1(this, fn)
  8602. };
  8603. MP_METHODS.forEach(function (method) {
  8604. Vue.prototype[method] = function(args) {
  8605. if (this.$scope && this.$scope[method]) {
  8606. return this.$scope[method](args)
  8607. }
  8608. // mp-alipay
  8609. if (typeof my === 'undefined') {
  8610. return
  8611. }
  8612. if (method === 'createSelectorQuery') {
  8613. /* eslint-disable no-undef */
  8614. return my.createSelectorQuery(args)
  8615. } else if (method === 'createIntersectionObserver') {
  8616. /* eslint-disable no-undef */
  8617. return my.createIntersectionObserver(args)
  8618. }
  8619. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8620. };
  8621. });
  8622. Vue.prototype.__init_provide = initProvide;
  8623. Vue.prototype.__init_injections = initInjections;
  8624. Vue.prototype.__call_hook = function(hook, args) {
  8625. var vm = this;
  8626. // #7573 disable dep collection when invoking lifecycle hooks
  8627. pushTarget();
  8628. var handlers = vm.$options[hook];
  8629. var info = hook + " hook";
  8630. var ret;
  8631. if (handlers) {
  8632. for (var i = 0, j = handlers.length; i < j; i++) {
  8633. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8634. }
  8635. }
  8636. if (vm._hasHookEvent) {
  8637. vm.$emit('hook:' + hook, args);
  8638. }
  8639. popTarget();
  8640. return ret
  8641. };
  8642. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8643. if (Array.isArray(modifiers)) {
  8644. if (modifiers.indexOf('trim') !== -1) {
  8645. value = value.trim();
  8646. }
  8647. if (modifiers.indexOf('number') !== -1) {
  8648. value = this._n(value);
  8649. }
  8650. }
  8651. if (!target) {
  8652. target = this;
  8653. }
  8654. // 解决动态属性添加
  8655. Vue.set(target, key, value);
  8656. };
  8657. Vue.prototype.__set_sync = function(target, key, value) {
  8658. if (!target) {
  8659. target = this;
  8660. }
  8661. // 解决动态属性添加
  8662. Vue.set(target, key, value);
  8663. };
  8664. Vue.prototype.__get_orig = function(item) {
  8665. if (isPlainObject(item)) {
  8666. return item['$orig'] || item
  8667. }
  8668. return item
  8669. };
  8670. Vue.prototype.__get_value = function(dataPath, target) {
  8671. return getTarget(target || this, dataPath)
  8672. };
  8673. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8674. return renderClass(staticClass, dynamicClass)
  8675. };
  8676. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8677. if (!dynamicStyle && !staticStyle) {
  8678. return ''
  8679. }
  8680. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8681. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8682. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8683. };
  8684. Vue.prototype.__map = function(val, iteratee) {
  8685. //TODO 暂不考虑 string
  8686. var ret, i, l, keys, key;
  8687. if (Array.isArray(val)) {
  8688. ret = new Array(val.length);
  8689. for (i = 0, l = val.length; i < l; i++) {
  8690. ret[i] = iteratee(val[i], i);
  8691. }
  8692. return ret
  8693. } else if (isObject(val)) {
  8694. keys = Object.keys(val);
  8695. ret = Object.create(null);
  8696. for (i = 0, l = keys.length; i < l; i++) {
  8697. key = keys[i];
  8698. ret[key] = iteratee(val[key], key, i);
  8699. }
  8700. return ret
  8701. } else if (typeof val === 'number') {
  8702. ret = new Array(val);
  8703. for (i = 0, l = val; i < l; i++) {
  8704. // 第一个参数暂时仍和小程序一致
  8705. ret[i] = iteratee(i, i);
  8706. }
  8707. return ret
  8708. }
  8709. return []
  8710. };
  8711. }
  8712. /* */
  8713. var LIFECYCLE_HOOKS$1 = [
  8714. //App
  8715. 'onLaunch',
  8716. 'onShow',
  8717. 'onHide',
  8718. 'onUniNViewMessage',
  8719. 'onPageNotFound',
  8720. 'onThemeChange',
  8721. 'onError',
  8722. 'onUnhandledRejection',
  8723. //Page
  8724. 'onInit',
  8725. 'onLoad',
  8726. // 'onShow',
  8727. 'onReady',
  8728. // 'onHide',
  8729. 'onUnload',
  8730. 'onPullDownRefresh',
  8731. 'onReachBottom',
  8732. 'onTabItemTap',
  8733. 'onAddToFavorites',
  8734. 'onShareTimeline',
  8735. 'onShareAppMessage',
  8736. 'onResize',
  8737. 'onPageScroll',
  8738. 'onNavigationBarButtonTap',
  8739. 'onBackPress',
  8740. 'onNavigationBarSearchInputChanged',
  8741. 'onNavigationBarSearchInputConfirmed',
  8742. 'onNavigationBarSearchInputClicked',
  8743. //Component
  8744. // 'onReady', // 兼容旧版本,应该移除该事件
  8745. 'onPageShow',
  8746. 'onPageHide',
  8747. 'onPageResize',
  8748. 'onUploadDouyinVideo'
  8749. ];
  8750. function lifecycleMixin$1(Vue) {
  8751. //fixed vue-class-component
  8752. var oldExtend = Vue.extend;
  8753. Vue.extend = function(extendOptions) {
  8754. extendOptions = extendOptions || {};
  8755. var methods = extendOptions.methods;
  8756. if (methods) {
  8757. Object.keys(methods).forEach(function (methodName) {
  8758. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8759. extendOptions[methodName] = methods[methodName];
  8760. delete methods[methodName];
  8761. }
  8762. });
  8763. }
  8764. return oldExtend.call(this, extendOptions)
  8765. };
  8766. var strategies = Vue.config.optionMergeStrategies;
  8767. var mergeHook = strategies.created;
  8768. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8769. strategies[hook] = mergeHook;
  8770. });
  8771. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8772. }
  8773. /* */
  8774. // install platform patch function
  8775. Vue.prototype.__patch__ = patch;
  8776. // public mount method
  8777. Vue.prototype.$mount = function(
  8778. el ,
  8779. hydrating
  8780. ) {
  8781. return mountComponent$1(this, el, hydrating)
  8782. };
  8783. lifecycleMixin$1(Vue);
  8784. internalMixin(Vue);
  8785. /* */
  8786. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8787. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8788. /***/ }),
  8789. /* 26 */
  8790. /*!*******************************************************!*\
  8791. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json ***!
  8792. \*******************************************************/
  8793. /*! no static exports found */
  8794. /***/ (function(module, exports) {
  8795. /***/ }),
  8796. /* 27 */,
  8797. /* 28 */,
  8798. /* 29 */,
  8799. /* 30 */,
  8800. /* 31 */,
  8801. /* 32 */
  8802. /*!**********************************************************************************************************!*\
  8803. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8804. \**********************************************************************************************************/
  8805. /*! exports provided: default */
  8806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8807. "use strict";
  8808. __webpack_require__.r(__webpack_exports__);
  8809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8810. /* globals __VUE_SSR_CONTEXT__ */
  8811. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8812. // This module is a runtime utility for cleaner component module output and will
  8813. // be included in the final webpack user bundle.
  8814. function normalizeComponent (
  8815. scriptExports,
  8816. render,
  8817. staticRenderFns,
  8818. functionalTemplate,
  8819. injectStyles,
  8820. scopeId,
  8821. moduleIdentifier, /* server only */
  8822. shadowMode, /* vue-cli only */
  8823. components, // fixed by xxxxxx auto components
  8824. renderjs // fixed by xxxxxx renderjs
  8825. ) {
  8826. // Vue.extend constructor export interop
  8827. var options = typeof scriptExports === 'function'
  8828. ? scriptExports.options
  8829. : scriptExports
  8830. // fixed by xxxxxx auto components
  8831. if (components) {
  8832. if (!options.components) {
  8833. options.components = {}
  8834. }
  8835. var hasOwn = Object.prototype.hasOwnProperty
  8836. for (var name in components) {
  8837. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8838. options.components[name] = components[name]
  8839. }
  8840. }
  8841. }
  8842. // fixed by xxxxxx renderjs
  8843. if (renderjs) {
  8844. if(typeof renderjs.beforeCreate === 'function'){
  8845. renderjs.beforeCreate = [renderjs.beforeCreate]
  8846. }
  8847. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8848. this[renderjs.__module] = this
  8849. });
  8850. (options.mixins || (options.mixins = [])).push(renderjs)
  8851. }
  8852. // render functions
  8853. if (render) {
  8854. options.render = render
  8855. options.staticRenderFns = staticRenderFns
  8856. options._compiled = true
  8857. }
  8858. // functional template
  8859. if (functionalTemplate) {
  8860. options.functional = true
  8861. }
  8862. // scopedId
  8863. if (scopeId) {
  8864. options._scopeId = 'data-v-' + scopeId
  8865. }
  8866. var hook
  8867. if (moduleIdentifier) { // server build
  8868. hook = function (context) {
  8869. // 2.3 injection
  8870. context =
  8871. context || // cached call
  8872. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8873. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8874. // 2.2 with runInNewContext: true
  8875. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8876. context = __VUE_SSR_CONTEXT__
  8877. }
  8878. // inject component styles
  8879. if (injectStyles) {
  8880. injectStyles.call(this, context)
  8881. }
  8882. // register component module identifier for async chunk inferrence
  8883. if (context && context._registeredComponents) {
  8884. context._registeredComponents.add(moduleIdentifier)
  8885. }
  8886. }
  8887. // used by ssr in case component is cached and beforeCreate
  8888. // never gets called
  8889. options._ssrRegister = hook
  8890. } else if (injectStyles) {
  8891. hook = shadowMode
  8892. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8893. : injectStyles
  8894. }
  8895. if (hook) {
  8896. if (options.functional) {
  8897. // for template-only hot-reload because in that case the render fn doesn't
  8898. // go through the normalizer
  8899. options._injectStyles = hook
  8900. // register for functioal component in vue file
  8901. var originalRender = options.render
  8902. options.render = function renderWithStyleInjection (h, context) {
  8903. hook.call(context)
  8904. return originalRender(h, context)
  8905. }
  8906. } else {
  8907. // inject component registration as beforeCreate hook
  8908. var existing = options.beforeCreate
  8909. options.beforeCreate = existing
  8910. ? [].concat(existing, hook)
  8911. : [hook]
  8912. }
  8913. }
  8914. return {
  8915. exports: scriptExports,
  8916. options: options
  8917. }
  8918. }
  8919. /***/ }),
  8920. /* 33 */,
  8921. /* 34 */,
  8922. /* 35 */,
  8923. /* 36 */,
  8924. /* 37 */,
  8925. /* 38 */,
  8926. /* 39 */
  8927. /*!***********************************************************!*\
  8928. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/https.js ***!
  8929. \***********************************************************/
  8930. /*! no static exports found */
  8931. /***/ (function(module, exports, __webpack_require__) {
  8932. "use strict";
  8933. /* WEBPACK VAR INJECTION */(function(wx, uni) {
  8934. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8935. Object.defineProperty(exports, "__esModule", {
  8936. value: true
  8937. });
  8938. exports.default = void 0;
  8939. var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 40));
  8940. // 区分开发环境和生产环境 接口地址
  8941. var baseUrl = _config.default.baseUrl;
  8942. // let baseUrl = 'http://60.191.110.205:19099/';
  8943. // let baseUrl = 'https://ksfdc.zjugis.com:19099/';
  8944. function https(config) {
  8945. //显示loading
  8946. wx.showLoading({
  8947. title: '正在请求中'
  8948. });
  8949. //设置请求头
  8950. if (!config.header) {
  8951. config.header = {};
  8952. }
  8953. if (!config.header['content-type']) {
  8954. config.header['content-type'] = 'application/json';
  8955. }
  8956. config.url = baseUrl + config.url; // 请求地址
  8957. var promise = new Promise(function (resolve, reject) {
  8958. uni.request(config).then(function (res) {
  8959. wx.hideLoading(); //隐藏loading
  8960. if (res[0]) {
  8961. uni.showToast({
  8962. title: "数据获取失败",
  8963. icon: "none",
  8964. duration: 1500
  8965. });
  8966. reject(false);
  8967. } else {
  8968. var data = res[1].data;
  8969. if (data.code == 1) {
  8970. resolve(data);
  8971. } else {
  8972. resolve(data);
  8973. }
  8974. }
  8975. }).catch(function (error) {
  8976. wx.hideLoading(); //隐藏loading
  8977. reject(error);
  8978. });
  8979. });
  8980. return promise;
  8981. }
  8982. var _default = https;
  8983. exports.default = _default;
  8984. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  8985. /***/ }),
  8986. /* 40 */
  8987. /*!************************************************************!*\
  8988. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/config.js ***!
  8989. \************************************************************/
  8990. /*! no static exports found */
  8991. /***/ (function(module, exports, __webpack_require__) {
  8992. "use strict";
  8993. Object.defineProperty(exports, "__esModule", {
  8994. value: true
  8995. });
  8996. exports.default = void 0;
  8997. var config = {
  8998. //发布线上需要吧login里面地址跟这里替换掉
  8999. // baseUrl: "http://10.10.9.71:7089/ysgzybz/",
  9000. // webViewUrl: "http://10.10.9.58:8083/#/",
  9001. baseUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/ybz-api/",
  9002. webViewUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view/#/",
  9003. webViewUrl1: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view/#/",
  9004. webViewUrl2: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view2/#/",
  9005. bjdkgl: 'https://zlzd.zrzyt.zj.gov.cn/geoserver/sde'
  9006. };
  9007. var _default = config;
  9008. exports.default = _default;
  9009. /***/ }),
  9010. /* 41 */,
  9011. /* 42 */,
  9012. /* 43 */,
  9013. /* 44 */,
  9014. /* 45 */,
  9015. /* 46 */,
  9016. /* 47 */,
  9017. /* 48 */,
  9018. /* 49 */,
  9019. /* 50 */,
  9020. /* 51 */,
  9021. /* 52 */,
  9022. /* 53 */,
  9023. /* 54 */,
  9024. /* 55 */,
  9025. /* 56 */,
  9026. /* 57 */
  9027. /*!*******************************************************************!*\
  9028. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/mixins/CustomMixins.js ***!
  9029. \*******************************************************************/
  9030. /*! no static exports found */
  9031. /***/ (function(module, exports, __webpack_require__) {
  9032. "use strict";
  9033. /* WEBPACK VAR INJECTION */(function(wx) {
  9034. Object.defineProperty(exports, "__esModule", {
  9035. value: true
  9036. });
  9037. exports.default = void 0;
  9038. var _default = {
  9039. data: function data() {
  9040. return {
  9041. innerAudioContext: null,
  9042. address: ''
  9043. };
  9044. },
  9045. methods: {
  9046. getLocationInfoByLatLnt: function getLocationInfoByLatLnt(lat, lng) {
  9047. var that = this;
  9048. var locationInfoURL = "https://apis.map.qq.com/ws/geocoder/v1/?location=".concat(lat, ",").concat(lng, "&key=G4BBZ-YSMCJ-56AFX-KD4FQ-23RQZ-S7FX3");
  9049. wx.request({
  9050. url: locationInfoURL,
  9051. //仅为示例,并非真实的接口地址
  9052. success: function success(res) {
  9053. var resultData = res.data;
  9054. that.address = resultData['result'].address;
  9055. }
  9056. });
  9057. },
  9058. setTabBarIndex: function setTabBarIndex(index) {
  9059. if (typeof this.$scope.getTabBar === 'function' && this.$scope.getTabBar()) {
  9060. this.$scope.getTabBar().setData({
  9061. selected: index
  9062. });
  9063. }
  9064. },
  9065. getTimeFuns: function getTimeFuns(sTimeStr, eTimeStr) {
  9066. var sTime = new Date(sTimeStr);
  9067. var eTime = +new Date(eTimeStr); //返回的是用户输入时间总的毫秒数
  9068. var secondTime = (eTime - sTime) / 1000; //剩余时间总的秒数
  9069. var d = parseInt(secondTime / 60 / 60 / 24); //计算天数
  9070. var h = parseInt(secondTime / 60 / 60 % 24); //计算小时
  9071. var m = parseInt(secondTime / 60 % 60); //计算分
  9072. var s = parseInt(secondTime % 60); //计算当前秒数
  9073. return {
  9074. time: Math.abs(d) + '天' + Math.abs(h) + '时' + Math.abs(m) + '分',
  9075. time2: {
  9076. a: d,
  9077. b: h,
  9078. c: m
  9079. }
  9080. };
  9081. },
  9082. //播放语音
  9083. createAudio: function createAudio(srcMic) {
  9084. if (this.innerAudioContext) return;
  9085. var that = this;
  9086. //创建内部 audio 上下文 InnerAudioContext 对象。
  9087. that.innerAudioContext = wx.createInnerAudioContext();
  9088. that.innerAudioContext.onError(function (error) {
  9089. console.error("自定义报错(checkedDetail 137行):" + error);
  9090. });
  9091. that.innerAudioContext.src = srcMic; //设置音频地址
  9092. },
  9093. //播放
  9094. audioPlay: function audioPlay(srcMic) {
  9095. this.createAudio(srcMic);
  9096. this.innerAudioContext.play(); //播放音频
  9097. return this.innerAudioContext;
  9098. },
  9099. // 停止播放
  9100. audioPause: function audioPause() {
  9101. if (!this.innerAudioContext) return;
  9102. this.innerAudioContext.pause(); //播放音频
  9103. }
  9104. }
  9105. };
  9106. exports.default = _default;
  9107. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9108. /***/ }),
  9109. /* 58 */
  9110. /*!***********************************************************************!*\
  9111. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/formData.js ***!
  9112. \***********************************************************************/
  9113. /*! no static exports found */
  9114. /***/ (function(module, exports, __webpack_require__) {
  9115. /* WEBPACK VAR INJECTION */(function(wx) {var _toConsumableArray = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18);
  9116. var mimeMap = __webpack_require__(/*! ./mimeMap.js */ 59);
  9117. function FormData() {
  9118. var fileManager = wx.getFileSystemManager();
  9119. var data = {};
  9120. var files = [];
  9121. this.append = function (name, value) {
  9122. data[name] = value;
  9123. return true;
  9124. };
  9125. this.appendFile = function (name, path, fileName) {
  9126. var buffer = fileManager.readFileSync(path);
  9127. if (Object.prototype.toString.call(buffer).indexOf("ArrayBuffer") < 0) {
  9128. return false;
  9129. }
  9130. if (!fileName) {
  9131. fileName = getFileNameFromPath(path);
  9132. }
  9133. files.push({
  9134. name: name,
  9135. buffer: buffer,
  9136. fileName: fileName
  9137. });
  9138. return true;
  9139. };
  9140. this.getData = function () {
  9141. return convert(data, files);
  9142. };
  9143. }
  9144. function getFileNameFromPath(path) {
  9145. var idx = path.lastIndexOf("/");
  9146. return path.substr(idx + 1);
  9147. }
  9148. function convert(data, files) {
  9149. var boundaryKey = 'wxmpFormBoundary' + randString(); // 数据分割符,一般是随机的字符串
  9150. var boundary = '--' + boundaryKey;
  9151. var endBoundary = boundary + '--';
  9152. var postArray = [];
  9153. //拼接参数
  9154. if (data && Object.prototype.toString.call(data) == "[object Object]") {
  9155. for (var key in data) {
  9156. postArray = postArray.concat(formDataArray(boundary, key, data[key]));
  9157. }
  9158. }
  9159. //拼接文件
  9160. if (files && Object.prototype.toString.call(files) == "[object Array]") {
  9161. for (var i in files) {
  9162. var file = files[i];
  9163. postArray = postArray.concat(formDataArray(boundary, file.name, file.buffer, file.fileName));
  9164. }
  9165. }
  9166. //结尾
  9167. var endBoundaryArray = [];
  9168. endBoundaryArray.push.apply(endBoundaryArray, _toConsumableArray(endBoundary.toUtf8Bytes()));
  9169. postArray = postArray.concat(endBoundaryArray);
  9170. return {
  9171. contentType: 'multipart/form-data; boundary=' + boundaryKey,
  9172. buffer: new Uint8Array(postArray).buffer
  9173. };
  9174. }
  9175. function randString() {
  9176. var res = "";
  9177. for (var i = 0; i < 17; i++) {
  9178. var n = parseInt(Math.random() * 62);
  9179. if (n <= 9) {
  9180. res += n;
  9181. } else if (n <= 35) {
  9182. res += String.fromCharCode(n + 55);
  9183. } else {
  9184. res += String.fromCharCode(n + 61);
  9185. }
  9186. }
  9187. return res;
  9188. }
  9189. function formDataArray(boundary, name, value, fileName) {
  9190. var _dataArray, _dataArray2, _dataArray3;
  9191. var dataString = '';
  9192. var isFile = !!fileName;
  9193. dataString += boundary + '\r\n';
  9194. dataString += 'Content-Disposition: form-data; name="' + name + '"';
  9195. if (isFile) {
  9196. dataString += '; filename="' + fileName + '"' + '\r\n';
  9197. dataString += 'Content-Type: ' + getFileMime(fileName) + '\r\n\r\n';
  9198. } else {
  9199. dataString += '\r\n\r\n';
  9200. dataString += value;
  9201. }
  9202. var dataArray = [];
  9203. (_dataArray = dataArray).push.apply(_dataArray, _toConsumableArray(dataString.toUtf8Bytes()));
  9204. if (isFile) {
  9205. var fileArray = new Uint8Array(value);
  9206. dataArray = dataArray.concat(Array.prototype.slice.call(fileArray));
  9207. }
  9208. (_dataArray2 = dataArray).push.apply(_dataArray2, _toConsumableArray("\r".toUtf8Bytes()));
  9209. (_dataArray3 = dataArray).push.apply(_dataArray3, _toConsumableArray("\n".toUtf8Bytes()));
  9210. return dataArray;
  9211. }
  9212. function getFileMime(fileName) {
  9213. var idx = fileName.lastIndexOf(".");
  9214. var mime = mimeMap[fileName.substr(idx)];
  9215. return mime ? mime : "application/octet-stream";
  9216. }
  9217. String.prototype.toUtf8Bytes = function () {
  9218. var str = this;
  9219. var bytes = [];
  9220. for (var i = 0; i < str.length; i++) {
  9221. bytes.push.apply(bytes, _toConsumableArray(str.utf8CodeAt(i)));
  9222. if (str.codePointAt(i) > 0xffff) {
  9223. i++;
  9224. }
  9225. }
  9226. return bytes;
  9227. };
  9228. String.prototype.utf8CodeAt = function (i) {
  9229. var str = this;
  9230. var out = [],
  9231. p = 0;
  9232. var c = str.charCodeAt(i);
  9233. if (c < 128) {
  9234. out[p++] = c;
  9235. } else if (c < 2048) {
  9236. out[p++] = c >> 6 | 192;
  9237. out[p++] = c & 63 | 128;
  9238. } else if ((c & 0xFC00) == 0xD800 && i + 1 < str.length && (str.charCodeAt(i + 1) & 0xFC00) == 0xDC00) {
  9239. // Surrogate Pair
  9240. c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF);
  9241. out[p++] = c >> 18 | 240;
  9242. out[p++] = c >> 12 & 63 | 128;
  9243. out[p++] = c >> 6 & 63 | 128;
  9244. out[p++] = c & 63 | 128;
  9245. } else {
  9246. out[p++] = c >> 12 | 224;
  9247. out[p++] = c >> 6 & 63 | 128;
  9248. out[p++] = c & 63 | 128;
  9249. }
  9250. return out;
  9251. };
  9252. module.exports = FormData;
  9253. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9254. /***/ }),
  9255. /* 59 */
  9256. /*!**********************************************************************!*\
  9257. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/mimeMap.js ***!
  9258. \**********************************************************************/
  9259. /*! no static exports found */
  9260. /***/ (function(module, exports, __webpack_require__) {
  9261. var _defineProperty = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11);
  9262. var _module$exports;
  9263. module.exports = (_module$exports = {
  9264. "0.001": "application/x-001",
  9265. "0.323": "text/h323",
  9266. "0.907": "drawing/907",
  9267. ".acp": "audio/x-mei-aac",
  9268. ".aif": "audio/aiff",
  9269. ".aiff": "audio/aiff",
  9270. ".asa": "text/asa",
  9271. ".asp": "text/asp",
  9272. ".au": "audio/basic",
  9273. ".awf": "application/vnd.adobe.workflow",
  9274. ".bmp": "application/x-bmp",
  9275. ".c4t": "application/x-c4t",
  9276. ".cal": "application/x-cals",
  9277. ".cdf": "application/x-netcdf",
  9278. ".cel": "application/x-cel",
  9279. ".cg4": "application/x-g4",
  9280. ".cit": "application/x-cit",
  9281. ".cml": "text/xml",
  9282. ".cmx": "application/x-cmx",
  9283. ".crl": "application/pkix-crl",
  9284. ".csi": "application/x-csi",
  9285. ".cut": "application/x-cut",
  9286. ".dbm": "application/x-dbm",
  9287. ".dcd": "text/xml",
  9288. ".der": "application/x-x509-ca-cert",
  9289. ".dib": "application/x-dib",
  9290. ".doc": "application/msword",
  9291. ".drw": "application/x-drw",
  9292. ".dwf": "Model/vnd.dwf",
  9293. ".dwg": "application/x-dwg",
  9294. ".dxf": "application/x-dxf",
  9295. ".emf": "application/x-emf",
  9296. ".ent": "text/xml",
  9297. ".eps": "application/x-ps",
  9298. ".etd": "application/x-ebx",
  9299. ".fax": "image/fax",
  9300. ".fif": "application/fractals",
  9301. ".frm": "application/x-frm",
  9302. ".gbr": "application/x-gbr",
  9303. ".gif": "image/gif",
  9304. ".gp4": "application/x-gp4",
  9305. ".hmr": "application/x-hmr",
  9306. ".hpl": "application/x-hpl",
  9307. ".hrf": "application/x-hrf",
  9308. ".htc": "text/x-component",
  9309. ".html": "text/html",
  9310. ".htx": "text/html",
  9311. ".ico": "image/x-icon",
  9312. ".iff": "application/x-iff",
  9313. ".igs": "application/x-igs",
  9314. ".img": "application/x-img",
  9315. ".isp": "application/x-internet-signup",
  9316. ".java": "java/*",
  9317. ".jpe": "image/jpeg",
  9318. ".jpeg": "image/jpeg",
  9319. ".jpg": "application/x-jpg",
  9320. ".jsp": "text/html",
  9321. ".lar": "application/x-laplayer-reg",
  9322. ".lavs": "audio/x-liquid-secure",
  9323. ".lmsff": "audio/x-la-lms",
  9324. ".ltr": "application/x-ltr",
  9325. ".m2v": "video/x-mpeg",
  9326. ".m4e": "video/mpeg4",
  9327. ".man": "application/x-troff-man",
  9328. ".mdb": "application/msaccess",
  9329. ".mfp": "application/x-shockwave-flash",
  9330. ".mhtml": "message/rfc822",
  9331. ".mid": "audio/mid",
  9332. ".mil": "application/x-mil",
  9333. ".mnd": "audio/x-musicnet-download",
  9334. ".mocha": "application/x-javascript",
  9335. ".mp1": "audio/mp1",
  9336. ".mp2v": "video/mpeg",
  9337. ".mp4": "video/mpeg4",
  9338. ".mpd": "application/vnd.ms-project",
  9339. ".mpeg": "video/mpg",
  9340. ".mpga": "audio/rn-mpeg",
  9341. ".mps": "video/x-mpeg",
  9342. ".mpv": "video/mpg",
  9343. ".mpw": "application/vnd.ms-project",
  9344. ".mtx": "text/xml",
  9345. ".net": "image/pnetvue",
  9346. ".nws": "message/rfc822",
  9347. ".out": "application/x-out",
  9348. ".p12": "application/x-pkcs12",
  9349. ".p7c": "application/pkcs7-mime",
  9350. ".p7r": "application/x-pkcs7-certreqresp",
  9351. ".pc5": "application/x-pc5",
  9352. ".pcl": "application/x-pcl",
  9353. ".pdf": "application/pdf",
  9354. ".pdx": "application/vnd.adobe.pdx",
  9355. ".pgl": "application/x-pgl",
  9356. ".pko": "application/vnd.ms-pki.pko",
  9357. ".plg": "text/html",
  9358. ".plt": "application/x-plt",
  9359. ".png": "application/x-png",
  9360. ".ppa": "application/vnd.ms-powerpoint",
  9361. ".pps": "application/vnd.ms-powerpoint",
  9362. ".ppt": "application/x-ppt",
  9363. ".prf": "application/pics-rules",
  9364. ".prt": "application/x-prt",
  9365. ".ps": "application/postscript",
  9366. ".pwz": "application/vnd.ms-powerpoint",
  9367. ".ra": "audio/vnd.rn-realaudio",
  9368. ".ras": "application/x-ras",
  9369. ".rdf": "text/xml",
  9370. ".red": "application/x-red",
  9371. ".rjs": "application/vnd.rn-realsystem-rjs",
  9372. ".rlc": "application/x-rlc",
  9373. ".rm": "application/vnd.rn-realmedia",
  9374. ".rmi": "audio/mid",
  9375. ".rmm": "audio/x-pn-realaudio",
  9376. ".rms": "application/vnd.rn-realmedia-secure",
  9377. ".rmx": "application/vnd.rn-realsystem-rmx",
  9378. ".rp": "image/vnd.rn-realpix",
  9379. ".rsml": "application/vnd.rn-rsml",
  9380. ".rtf": "application/msword",
  9381. ".rv": "video/vnd.rn-realvideo",
  9382. ".sat": "application/x-sat",
  9383. ".sdw": "application/x-sdw",
  9384. ".slb": "application/x-slb",
  9385. ".slk": "drawing/x-slk",
  9386. ".smil": "application/smil",
  9387. ".snd": "audio/basic",
  9388. ".sor": "text/plain",
  9389. ".spl": "application/futuresplash",
  9390. ".ssm": "application/streamingmedia",
  9391. ".stl": "application/vnd.ms-pki.stl",
  9392. ".sty": "application/x-sty",
  9393. ".swf": "application/x-shockwave-flash",
  9394. ".tg4": "application/x-tg4",
  9395. ".tif": "image/tiff",
  9396. ".tiff": "image/tiff",
  9397. ".top": "drawing/x-top",
  9398. ".tsd": "text/xml",
  9399. ".uin": "application/x-icq",
  9400. ".vcf": "text/x-vcard",
  9401. ".vdx": "application/vnd.visio",
  9402. ".vpg": "application/x-vpeg005",
  9403. ".vsd": "application/x-vsd",
  9404. ".vst": "application/vnd.visio",
  9405. ".vsw": "application/vnd.visio",
  9406. ".vtx": "application/vnd.visio",
  9407. ".wav": "audio/wav",
  9408. ".wb1": "application/x-wb1",
  9409. ".wb3": "application/x-wb3",
  9410. ".wiz": "application/msword",
  9411. ".wk4": "application/x-wk4",
  9412. ".wks": "application/x-wks",
  9413. ".wma": "audio/x-ms-wma",
  9414. ".wmf": "application/x-wmf",
  9415. ".wmv": "video/x-ms-wmv",
  9416. ".wmz": "application/x-ms-wmz",
  9417. ".wpd": "application/x-wpd",
  9418. ".wpl": "application/vnd.ms-wpl",
  9419. ".wr1": "application/x-wr1",
  9420. ".wrk": "application/x-wrk",
  9421. ".ws2": "application/x-ws",
  9422. ".wsdl": "text/xml",
  9423. ".xdp": "application/vnd.adobe.xdp",
  9424. ".xfd": "application/vnd.adobe.xfd",
  9425. ".xhtml": "text/html",
  9426. ".xls": "application/x-xls",
  9427. ".xml": "text/xml",
  9428. ".xq": "text/xml",
  9429. ".xquery": "text/xml",
  9430. ".xsl": "text/xml",
  9431. ".xwd": "application/x-xwd",
  9432. ".sis": "application/vnd.symbian.install",
  9433. ".x_t": "application/x-x_t",
  9434. ".apk": "application/vnd.android.package-archive",
  9435. "0.301": "application/x-301",
  9436. "0.906": "application/x-906",
  9437. ".a11": "application/x-a11",
  9438. ".ai": "application/postscript",
  9439. ".aifc": "audio/aiff",
  9440. ".anv": "application/x-anv",
  9441. ".asf": "video/x-ms-asf",
  9442. ".asx": "video/x-ms-asf",
  9443. ".avi": "video/avi",
  9444. ".biz": "text/xml",
  9445. ".bot": "application/x-bot",
  9446. ".c90": "application/x-c90",
  9447. ".cat": "application/vnd.ms-pki.seccat",
  9448. ".cdr": "application/x-cdr",
  9449. ".cer": "application/x-x509-ca-cert",
  9450. ".cgm": "application/x-cgm",
  9451. ".class": "java/*",
  9452. ".cmp": "application/x-cmp",
  9453. ".cot": "application/x-cot",
  9454. ".crt": "application/x-x509-ca-cert",
  9455. ".css": "text/css",
  9456. ".dbf": "application/x-dbf",
  9457. ".dbx": "application/x-dbx",
  9458. ".dcx": "application/x-dcx",
  9459. ".dgn": "application/x-dgn",
  9460. ".dll": "application/x-msdownload",
  9461. ".dot": "application/msword",
  9462. ".dtd": "text/xml"
  9463. }, _defineProperty(_module$exports, ".dwf", "application/x-dwf"), _defineProperty(_module$exports, ".dxb", "application/x-dxb"), _defineProperty(_module$exports, ".edn", "application/vnd.adobe.edn"), _defineProperty(_module$exports, ".eml", "message/rfc822"), _defineProperty(_module$exports, ".epi", "application/x-epi"), _defineProperty(_module$exports, ".eps", "application/postscript"), _defineProperty(_module$exports, ".exe", "application/x-msdownload"), _defineProperty(_module$exports, ".fdf", "application/vnd.fdf"), _defineProperty(_module$exports, ".fo", "text/xml"), _defineProperty(_module$exports, ".g4", "application/x-g4"), _defineProperty(_module$exports, ".tif", "image/tiff"), _defineProperty(_module$exports, ".gl2", "application/x-gl2"), _defineProperty(_module$exports, ".hgl", "application/x-hgl"), _defineProperty(_module$exports, ".hpg", "application/x-hpgl"), _defineProperty(_module$exports, ".hqx", "application/mac-binhex40"), _defineProperty(_module$exports, ".hta", "application/hta"), _defineProperty(_module$exports, ".htm", "text/html"), _defineProperty(_module$exports, ".htt", "text/webviewhtml"), _defineProperty(_module$exports, ".icb", "application/x-icb"), _defineProperty(_module$exports, ".ico", "application/x-ico"), _defineProperty(_module$exports, ".ig4", "application/x-g4"), _defineProperty(_module$exports, ".iii", "application/x-iphone"), _defineProperty(_module$exports, ".ins", "application/x-internet-signup"), _defineProperty(_module$exports, ".IVF", "video/x-ivf"), _defineProperty(_module$exports, ".jfif", "image/jpeg"), _defineProperty(_module$exports, ".jpe", "application/x-jpe"), _defineProperty(_module$exports, ".jpg", "image/jpeg"), _defineProperty(_module$exports, ".js", "application/x-javascript"), _defineProperty(_module$exports, ".la1", "audio/x-liquid-file"), _defineProperty(_module$exports, ".latex", "application/x-latex"), _defineProperty(_module$exports, ".lbm", "application/x-lbm"), _defineProperty(_module$exports, ".ls", "application/x-javascript"), _defineProperty(_module$exports, ".m1v", "video/x-mpeg"), _defineProperty(_module$exports, ".m3u", "audio/mpegurl"), _defineProperty(_module$exports, ".mac", "application/x-mac"), _defineProperty(_module$exports, ".math", "text/xml"), _defineProperty(_module$exports, ".mdb", "application/x-mdb"), _defineProperty(_module$exports, ".mht", "message/rfc822"), _defineProperty(_module$exports, ".mi", "application/x-mi"), _defineProperty(_module$exports, ".midi", "audio/mid"), _defineProperty(_module$exports, ".mml", "text/xml"), _defineProperty(_module$exports, ".mns", "audio/x-musicnet-stream"), _defineProperty(_module$exports, ".movie", "video/x-sgi-movie"), _defineProperty(_module$exports, ".mp2", "audio/mp2"), _defineProperty(_module$exports, ".mp3", "audio/mp3"), _defineProperty(_module$exports, ".mpa", "video/x-mpg"), _defineProperty(_module$exports, ".mpe", "video/x-mpeg"), _defineProperty(_module$exports, ".mpg", "video/mpg"), _defineProperty(_module$exports, ".mpp", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpt", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpv2", "video/mpeg"), _defineProperty(_module$exports, ".mpx", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mxp", "application/x-mmxp"), _defineProperty(_module$exports, ".nrf", "application/x-nrf"), _defineProperty(_module$exports, ".odc", "text/x-ms-odc"), _defineProperty(_module$exports, ".p10", "application/pkcs10"), _defineProperty(_module$exports, ".p7b", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".p7m", "application/pkcs7-mime"), _defineProperty(_module$exports, ".p7s", "application/pkcs7-signature"), _defineProperty(_module$exports, ".pci", "application/x-pci"), _defineProperty(_module$exports, ".pcx", "application/x-pcx"), _defineProperty(_module$exports, ".pdf", "application/pdf"), _defineProperty(_module$exports, ".pfx", "application/x-pkcs12"), _defineProperty(_module$exports, ".pic", "application/x-pic"), _defineProperty(_module$exports, ".pl", "application/x-perl"), _defineProperty(_module$exports, ".pls", "audio/scpls"), _defineProperty(_module$exports, ".png", "image/png"), _defineProperty(_module$exports, ".pot", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".ppm", "application/x-ppm"), _defineProperty(_module$exports, ".ppt", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".pr", "application/x-pr"), _defineProperty(_module$exports, ".prn", "application/x-prn"), _defineProperty(_module$exports, ".ps", "application/x-ps"), _defineProperty(_module$exports, ".ptn", "application/x-ptn"), _defineProperty(_module$exports, ".r3t", "text/vnd.rn-realtext3d"), _defineProperty(_module$exports, ".ram", "audio/x-pn-realaudio"), _defineProperty(_module$exports, ".rat", "application/rat-file"), _defineProperty(_module$exports, ".rec", "application/vnd.rn-recording"), _defineProperty(_module$exports, ".rgb", "application/x-rgb"), _defineProperty(_module$exports, ".rjt", "application/vnd.rn-realsystem-rjt"), _defineProperty(_module$exports, ".rle", "application/x-rle"), _defineProperty(_module$exports, ".rmf", "application/vnd.adobe.rmf"), _defineProperty(_module$exports, ".rmj", "application/vnd.rn-realsystem-rmj"), _defineProperty(_module$exports, ".rmp", "application/vnd.rn-rn_music_package"), _defineProperty(_module$exports, ".rmvb", "application/vnd.rn-realmedia-vbr"), _defineProperty(_module$exports, ".rnx", "application/vnd.rn-realplayer"), _defineProperty(_module$exports, ".rpm", "audio/x-pn-realaudio-plugin"), _defineProperty(_module$exports, ".rt", "text/vnd.rn-realtext"), _defineProperty(_module$exports, ".rtf", "application/x-rtf"), _defineProperty(_module$exports, ".sam", "application/x-sam"), _defineProperty(_module$exports, ".sdp", "application/sdp"), _defineProperty(_module$exports, ".sit", "application/x-stuffit"), _defineProperty(_module$exports, ".sld", "application/x-sld"), _defineProperty(_module$exports, ".smi", "application/smil"), _defineProperty(_module$exports, ".smk", "application/x-smk"), _defineProperty(_module$exports, ".sol", "text/plain"), _defineProperty(_module$exports, ".spc", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".spp", "text/xml"), _defineProperty(_module$exports, ".sst", "application/vnd.ms-pki.certstore"), _defineProperty(_module$exports, ".stm", "text/html"), _defineProperty(_module$exports, ".svg", "text/xml"), _defineProperty(_module$exports, ".tdf", "application/x-tdf"), _defineProperty(_module$exports, ".tga", "application/x-tga"), _defineProperty(_module$exports, ".tif", "application/x-tif"), _defineProperty(_module$exports, ".tld", "text/xml"), _defineProperty(_module$exports, ".torrent", "application/x-bittorrent"), _defineProperty(_module$exports, ".txt", "text/plain"), _defineProperty(_module$exports, ".uls", "text/iuls"), _defineProperty(_module$exports, ".vda", "application/x-vda"), _defineProperty(_module$exports, ".vml", "text/xml"), _defineProperty(_module$exports, ".vsd", "application/vnd.visio"), _defineProperty(_module$exports, ".vss", "application/vnd.visio"), _defineProperty(_module$exports, ".vst", "application/x-vst"), _defineProperty(_module$exports, ".vsx", "application/vnd.visio"), _defineProperty(_module$exports, ".vxml", "text/xml"), _defineProperty(_module$exports, ".wax", "audio/x-ms-wax"), _defineProperty(_module$exports, ".wb2", "application/x-wb2"), _defineProperty(_module$exports, ".wbmp", "image/vnd.wap.wbmp"), _defineProperty(_module$exports, ".wk3", "application/x-wk3"), _defineProperty(_module$exports, ".wkq", "application/x-wkq"), _defineProperty(_module$exports, ".wm", "video/x-ms-wm"), _defineProperty(_module$exports, ".wmd", "application/x-ms-wmd"), _defineProperty(_module$exports, ".wml", "text/vnd.wap.wml"), _defineProperty(_module$exports, ".wmx", "video/x-ms-wmx"), _defineProperty(_module$exports, ".wp6", "application/x-wp6"), _defineProperty(_module$exports, ".wpg", "application/x-wpg"), _defineProperty(_module$exports, ".wq1", "application/x-wq1"), _defineProperty(_module$exports, ".wri", "application/x-wri"), _defineProperty(_module$exports, ".ws", "application/x-ws"), _defineProperty(_module$exports, ".wsc", "text/scriptlet"), _defineProperty(_module$exports, ".wvx", "video/x-ms-wvx"), _defineProperty(_module$exports, ".xdr", "text/xml"), _defineProperty(_module$exports, ".xfdf", "application/vnd.adobe.xfdf"), _defineProperty(_module$exports, ".xls", "application/vnd.ms-excel"), _defineProperty(_module$exports, ".xlw", "application/x-xlw"), _defineProperty(_module$exports, ".xpl", "audio/scpls"), _defineProperty(_module$exports, ".xql", "text/xml"), _defineProperty(_module$exports, ".xsd", "text/xml"), _defineProperty(_module$exports, ".xslt", "text/xml"), _defineProperty(_module$exports, ".x_b", "application/x-x_b"), _defineProperty(_module$exports, ".sisx", "application/vnd.symbian.install"), _defineProperty(_module$exports, ".ipa", "application/vnd.iphone"), _defineProperty(_module$exports, ".xap", "application/x-silverlight-app"), _defineProperty(_module$exports, ".zip", "application/x-zip-compressed"), _module$exports);
  9464. /***/ }),
  9465. /* 60 */,
  9466. /* 61 */,
  9467. /* 62 */,
  9468. /* 63 */,
  9469. /* 64 */,
  9470. /* 65 */,
  9471. /* 66 */,
  9472. /* 67 */,
  9473. /* 68 */,
  9474. /* 69 */,
  9475. /* 70 */,
  9476. /* 71 */,
  9477. /* 72 */,
  9478. /* 73 */,
  9479. /* 74 */,
  9480. /* 75 */,
  9481. /* 76 */
  9482. /*!************************************************************************************************!*\
  9483. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9484. \************************************************************************************************/
  9485. /*! no static exports found */
  9486. /***/ (function(module, exports, __webpack_require__) {
  9487. // TODO(Babel 8): Remove this file.
  9488. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 77)();
  9489. module.exports = runtime;
  9490. /***/ }),
  9491. /* 77 */
  9492. /*!*******************************************************************!*\
  9493. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9494. \*******************************************************************/
  9495. /*! no static exports found */
  9496. /***/ (function(module, exports, __webpack_require__) {
  9497. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9498. function _regeneratorRuntime() {
  9499. "use strict";
  9500. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9501. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9502. return exports;
  9503. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9504. var exports = {},
  9505. Op = Object.prototype,
  9506. hasOwn = Op.hasOwnProperty,
  9507. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9508. obj[key] = desc.value;
  9509. },
  9510. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9511. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9512. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9513. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9514. function define(obj, key, value) {
  9515. return Object.defineProperty(obj, key, {
  9516. value: value,
  9517. enumerable: !0,
  9518. configurable: !0,
  9519. writable: !0
  9520. }), obj[key];
  9521. }
  9522. try {
  9523. define({}, "");
  9524. } catch (err) {
  9525. define = function define(obj, key, value) {
  9526. return obj[key] = value;
  9527. };
  9528. }
  9529. function wrap(innerFn, outerFn, self, tryLocsList) {
  9530. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9531. generator = Object.create(protoGenerator.prototype),
  9532. context = new Context(tryLocsList || []);
  9533. return defineProperty(generator, "_invoke", {
  9534. value: makeInvokeMethod(innerFn, self, context)
  9535. }), generator;
  9536. }
  9537. function tryCatch(fn, obj, arg) {
  9538. try {
  9539. return {
  9540. type: "normal",
  9541. arg: fn.call(obj, arg)
  9542. };
  9543. } catch (err) {
  9544. return {
  9545. type: "throw",
  9546. arg: err
  9547. };
  9548. }
  9549. }
  9550. exports.wrap = wrap;
  9551. var ContinueSentinel = {};
  9552. function Generator() {}
  9553. function GeneratorFunction() {}
  9554. function GeneratorFunctionPrototype() {}
  9555. var IteratorPrototype = {};
  9556. define(IteratorPrototype, iteratorSymbol, function () {
  9557. return this;
  9558. });
  9559. var getProto = Object.getPrototypeOf,
  9560. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9561. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9562. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9563. function defineIteratorMethods(prototype) {
  9564. ["next", "throw", "return"].forEach(function (method) {
  9565. define(prototype, method, function (arg) {
  9566. return this._invoke(method, arg);
  9567. });
  9568. });
  9569. }
  9570. function AsyncIterator(generator, PromiseImpl) {
  9571. function invoke(method, arg, resolve, reject) {
  9572. var record = tryCatch(generator[method], generator, arg);
  9573. if ("throw" !== record.type) {
  9574. var result = record.arg,
  9575. value = result.value;
  9576. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9577. invoke("next", value, resolve, reject);
  9578. }, function (err) {
  9579. invoke("throw", err, resolve, reject);
  9580. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9581. result.value = unwrapped, resolve(result);
  9582. }, function (error) {
  9583. return invoke("throw", error, resolve, reject);
  9584. });
  9585. }
  9586. reject(record.arg);
  9587. }
  9588. var previousPromise;
  9589. defineProperty(this, "_invoke", {
  9590. value: function value(method, arg) {
  9591. function callInvokeWithMethodAndArg() {
  9592. return new PromiseImpl(function (resolve, reject) {
  9593. invoke(method, arg, resolve, reject);
  9594. });
  9595. }
  9596. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9597. }
  9598. });
  9599. }
  9600. function makeInvokeMethod(innerFn, self, context) {
  9601. var state = "suspendedStart";
  9602. return function (method, arg) {
  9603. if ("executing" === state) throw new Error("Generator is already running");
  9604. if ("completed" === state) {
  9605. if ("throw" === method) throw arg;
  9606. return doneResult();
  9607. }
  9608. for (context.method = method, context.arg = arg;;) {
  9609. var delegate = context.delegate;
  9610. if (delegate) {
  9611. var delegateResult = maybeInvokeDelegate(delegate, context);
  9612. if (delegateResult) {
  9613. if (delegateResult === ContinueSentinel) continue;
  9614. return delegateResult;
  9615. }
  9616. }
  9617. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9618. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9619. context.dispatchException(context.arg);
  9620. } else "return" === context.method && context.abrupt("return", context.arg);
  9621. state = "executing";
  9622. var record = tryCatch(innerFn, self, context);
  9623. if ("normal" === record.type) {
  9624. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9625. return {
  9626. value: record.arg,
  9627. done: context.done
  9628. };
  9629. }
  9630. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9631. }
  9632. };
  9633. }
  9634. function maybeInvokeDelegate(delegate, context) {
  9635. var methodName = context.method,
  9636. method = delegate.iterator[methodName];
  9637. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  9638. var record = tryCatch(method, delegate.iterator, context.arg);
  9639. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9640. var info = record.arg;
  9641. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  9642. }
  9643. function pushTryEntry(locs) {
  9644. var entry = {
  9645. tryLoc: locs[0]
  9646. };
  9647. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9648. }
  9649. function resetTryEntry(entry) {
  9650. var record = entry.completion || {};
  9651. record.type = "normal", delete record.arg, entry.completion = record;
  9652. }
  9653. function Context(tryLocsList) {
  9654. this.tryEntries = [{
  9655. tryLoc: "root"
  9656. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9657. }
  9658. function values(iterable) {
  9659. if (iterable) {
  9660. var iteratorMethod = iterable[iteratorSymbol];
  9661. if (iteratorMethod) return iteratorMethod.call(iterable);
  9662. if ("function" == typeof iterable.next) return iterable;
  9663. if (!isNaN(iterable.length)) {
  9664. var i = -1,
  9665. next = function next() {
  9666. for (; ++i < iterable.length;) {
  9667. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9668. }
  9669. return next.value = undefined, next.done = !0, next;
  9670. };
  9671. return next.next = next;
  9672. }
  9673. }
  9674. return {
  9675. next: doneResult
  9676. };
  9677. }
  9678. function doneResult() {
  9679. return {
  9680. value: undefined,
  9681. done: !0
  9682. };
  9683. }
  9684. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9685. value: GeneratorFunctionPrototype,
  9686. configurable: !0
  9687. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9688. value: GeneratorFunction,
  9689. configurable: !0
  9690. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9691. var ctor = "function" == typeof genFun && genFun.constructor;
  9692. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9693. }, exports.mark = function (genFun) {
  9694. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9695. }, exports.awrap = function (arg) {
  9696. return {
  9697. __await: arg
  9698. };
  9699. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9700. return this;
  9701. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9702. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9703. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9704. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9705. return result.done ? result.value : iter.next();
  9706. });
  9707. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9708. return this;
  9709. }), define(Gp, "toString", function () {
  9710. return "[object Generator]";
  9711. }), exports.keys = function (val) {
  9712. var object = Object(val),
  9713. keys = [];
  9714. for (var key in object) {
  9715. keys.push(key);
  9716. }
  9717. return keys.reverse(), function next() {
  9718. for (; keys.length;) {
  9719. var key = keys.pop();
  9720. if (key in object) return next.value = key, next.done = !1, next;
  9721. }
  9722. return next.done = !0, next;
  9723. };
  9724. }, exports.values = values, Context.prototype = {
  9725. constructor: Context,
  9726. reset: function reset(skipTempReset) {
  9727. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  9728. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9729. }
  9730. },
  9731. stop: function stop() {
  9732. this.done = !0;
  9733. var rootRecord = this.tryEntries[0].completion;
  9734. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9735. return this.rval;
  9736. },
  9737. dispatchException: function dispatchException(exception) {
  9738. if (this.done) throw exception;
  9739. var context = this;
  9740. function handle(loc, caught) {
  9741. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9742. }
  9743. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9744. var entry = this.tryEntries[i],
  9745. record = entry.completion;
  9746. if ("root" === entry.tryLoc) return handle("end");
  9747. if (entry.tryLoc <= this.prev) {
  9748. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9749. hasFinally = hasOwn.call(entry, "finallyLoc");
  9750. if (hasCatch && hasFinally) {
  9751. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9752. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9753. } else if (hasCatch) {
  9754. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9755. } else {
  9756. if (!hasFinally) throw new Error("try statement without catch or finally");
  9757. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9758. }
  9759. }
  9760. }
  9761. },
  9762. abrupt: function abrupt(type, arg) {
  9763. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9764. var entry = this.tryEntries[i];
  9765. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9766. var finallyEntry = entry;
  9767. break;
  9768. }
  9769. }
  9770. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9771. var record = finallyEntry ? finallyEntry.completion : {};
  9772. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9773. },
  9774. complete: function complete(record, afterLoc) {
  9775. if ("throw" === record.type) throw record.arg;
  9776. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  9777. },
  9778. finish: function finish(finallyLoc) {
  9779. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9780. var entry = this.tryEntries[i];
  9781. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9782. }
  9783. },
  9784. "catch": function _catch(tryLoc) {
  9785. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9786. var entry = this.tryEntries[i];
  9787. if (entry.tryLoc === tryLoc) {
  9788. var record = entry.completion;
  9789. if ("throw" === record.type) {
  9790. var thrown = record.arg;
  9791. resetTryEntry(entry);
  9792. }
  9793. return thrown;
  9794. }
  9795. }
  9796. throw new Error("illegal catch attempt");
  9797. },
  9798. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9799. return this.delegate = {
  9800. iterator: values(iterable),
  9801. resultName: resultName,
  9802. nextLoc: nextLoc
  9803. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9804. }
  9805. }, exports;
  9806. }
  9807. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9808. /***/ }),
  9809. /* 78 */
  9810. /*!*****************************************************************!*\
  9811. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9812. \*****************************************************************/
  9813. /*! no static exports found */
  9814. /***/ (function(module, exports) {
  9815. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9816. try {
  9817. var info = gen[key](arg);
  9818. var value = info.value;
  9819. } catch (error) {
  9820. reject(error);
  9821. return;
  9822. }
  9823. if (info.done) {
  9824. resolve(value);
  9825. } else {
  9826. Promise.resolve(value).then(_next, _throw);
  9827. }
  9828. }
  9829. function _asyncToGenerator(fn) {
  9830. return function () {
  9831. var self = this,
  9832. args = arguments;
  9833. return new Promise(function (resolve, reject) {
  9834. var gen = fn.apply(self, args);
  9835. function _next(value) {
  9836. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9837. }
  9838. function _throw(err) {
  9839. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9840. }
  9841. _next(undefined);
  9842. });
  9843. };
  9844. }
  9845. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9846. /***/ }),
  9847. /* 79 */,
  9848. /* 80 */,
  9849. /* 81 */,
  9850. /* 82 */,
  9851. /* 83 */,
  9852. /* 84 */,
  9853. /* 85 */,
  9854. /* 86 */,
  9855. /* 87 */,
  9856. /* 88 */,
  9857. /* 89 */,
  9858. /* 90 */,
  9859. /* 91 */,
  9860. /* 92 */,
  9861. /* 93 */,
  9862. /* 94 */,
  9863. /* 95 */,
  9864. /* 96 */,
  9865. /* 97 */,
  9866. /* 98 */,
  9867. /* 99 */,
  9868. /* 100 */,
  9869. /* 101 */,
  9870. /* 102 */,
  9871. /* 103 */,
  9872. /* 104 */,
  9873. /* 105 */,
  9874. /* 106 */,
  9875. /* 107 */,
  9876. /* 108 */,
  9877. /* 109 */,
  9878. /* 110 */,
  9879. /* 111 */,
  9880. /* 112 */,
  9881. /* 113 */,
  9882. /* 114 */,
  9883. /* 115 */,
  9884. /* 116 */,
  9885. /* 117 */,
  9886. /* 118 */,
  9887. /* 119 */,
  9888. /* 120 */,
  9889. /* 121 */,
  9890. /* 122 */,
  9891. /* 123 */,
  9892. /* 124 */,
  9893. /* 125 */,
  9894. /* 126 */,
  9895. /* 127 */,
  9896. /* 128 */,
  9897. /* 129 */,
  9898. /* 130 */,
  9899. /* 131 */,
  9900. /* 132 */,
  9901. /* 133 */,
  9902. /* 134 */,
  9903. /* 135 */,
  9904. /* 136 */,
  9905. /* 137 */,
  9906. /* 138 */,
  9907. /* 139 */,
  9908. /* 140 */,
  9909. /* 141 */,
  9910. /* 142 */
  9911. /*!************************************************************************************!*\
  9912. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  9913. \************************************************************************************/
  9914. /*! no static exports found */
  9915. /***/ (function(module, exports, __webpack_require__) {
  9916. "use strict";
  9917. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  9918. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9919. Object.defineProperty(exports, "__esModule", {
  9920. value: true
  9921. });
  9922. exports.default = void 0;
  9923. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 76));
  9924. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9925. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9926. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  9927. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 78));
  9928. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  9929. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 143));
  9930. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 144));
  9931. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 146));
  9932. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 147));
  9933. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9934. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9935. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  9936. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 149));
  9937. 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; } } }; }
  9938. 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); }
  9939. 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; }
  9940. 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; }
  9941. 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; }
  9942. 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); }; }
  9943. 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; } }
  9944. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  9945. function n(e) {
  9946. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  9947. }
  9948. function s(e, t, n) {
  9949. return e(n = {
  9950. path: t,
  9951. exports: {},
  9952. require: function require(e, t) {
  9953. return function () {
  9954. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  9955. }(null == t && n.path);
  9956. }
  9957. }, n.exports), n.exports;
  9958. }
  9959. var r = s(function (e, t) {
  9960. var n;
  9961. e.exports = (n = n || function (e, t) {
  9962. var n = Object.create || function () {
  9963. function e() {}
  9964. return function (t) {
  9965. var n;
  9966. return e.prototype = t, n = new e(), e.prototype = null, n;
  9967. };
  9968. }(),
  9969. s = {},
  9970. r = s.lib = {},
  9971. i = r.Base = {
  9972. extend: function extend(e) {
  9973. var t = n(this);
  9974. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  9975. t.$super.init.apply(this, arguments);
  9976. }), t.init.prototype = t, t.$super = this, t;
  9977. },
  9978. create: function create() {
  9979. var e = this.extend();
  9980. return e.init.apply(e, arguments), e;
  9981. },
  9982. init: function init() {},
  9983. mixIn: function mixIn(e) {
  9984. for (var t in e) {
  9985. e.hasOwnProperty(t) && (this[t] = e[t]);
  9986. }
  9987. e.hasOwnProperty("toString") && (this.toString = e.toString);
  9988. },
  9989. clone: function clone() {
  9990. return this.init.prototype.extend(this);
  9991. }
  9992. },
  9993. o = r.WordArray = i.extend({
  9994. init: function init(e, n) {
  9995. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  9996. },
  9997. toString: function toString(e) {
  9998. return (e || c).stringify(this);
  9999. },
  10000. concat: function concat(e) {
  10001. var t = this.words,
  10002. n = e.words,
  10003. s = this.sigBytes,
  10004. r = e.sigBytes;
  10005. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  10006. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  10007. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  10008. } else for (i = 0; i < r; i += 4) {
  10009. t[s + i >>> 2] = n[i >>> 2];
  10010. }
  10011. return this.sigBytes += r, this;
  10012. },
  10013. clamp: function clamp() {
  10014. var t = this.words,
  10015. n = this.sigBytes;
  10016. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  10017. },
  10018. clone: function clone() {
  10019. var e = i.clone.call(this);
  10020. return e.words = this.words.slice(0), e;
  10021. },
  10022. random: function random(t) {
  10023. for (var n, s = [], r = function r(t) {
  10024. t = t;
  10025. var n = 987654321,
  10026. s = 4294967295;
  10027. return function () {
  10028. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  10029. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  10030. };
  10031. }, i = 0; i < t; i += 4) {
  10032. var a = r(4294967296 * (n || e.random()));
  10033. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  10034. }
  10035. return new o.init(s, t);
  10036. }
  10037. }),
  10038. a = s.enc = {},
  10039. c = a.Hex = {
  10040. stringify: function stringify(e) {
  10041. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10042. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10043. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10044. }
  10045. return s.join("");
  10046. },
  10047. parse: function parse(e) {
  10048. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10049. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10050. }
  10051. return new o.init(n, t / 2);
  10052. }
  10053. },
  10054. u = a.Latin1 = {
  10055. stringify: function stringify(e) {
  10056. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10057. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10058. s.push(String.fromCharCode(i));
  10059. }
  10060. return s.join("");
  10061. },
  10062. parse: function parse(e) {
  10063. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10064. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10065. }
  10066. return new o.init(n, t);
  10067. }
  10068. },
  10069. l = a.Utf8 = {
  10070. stringify: function stringify(e) {
  10071. try {
  10072. return decodeURIComponent(escape(u.stringify(e)));
  10073. } catch (e) {
  10074. throw new Error("Malformed UTF-8 data");
  10075. }
  10076. },
  10077. parse: function parse(e) {
  10078. return u.parse(unescape(encodeURIComponent(e)));
  10079. }
  10080. },
  10081. h = r.BufferedBlockAlgorithm = i.extend({
  10082. reset: function reset() {
  10083. this._data = new o.init(), this._nDataBytes = 0;
  10084. },
  10085. _append: function _append(e) {
  10086. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10087. },
  10088. _process: function _process(t) {
  10089. var n = this._data,
  10090. s = n.words,
  10091. r = n.sigBytes,
  10092. i = this.blockSize,
  10093. a = r / (4 * i),
  10094. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10095. u = e.min(4 * c, r);
  10096. if (c) {
  10097. for (var l = 0; l < c; l += i) {
  10098. this._doProcessBlock(s, l);
  10099. }
  10100. var h = s.splice(0, c);
  10101. n.sigBytes -= u;
  10102. }
  10103. return new o.init(h, u);
  10104. },
  10105. clone: function clone() {
  10106. var e = i.clone.call(this);
  10107. return e._data = this._data.clone(), e;
  10108. },
  10109. _minBufferSize: 0
  10110. });
  10111. r.Hasher = h.extend({
  10112. cfg: i.extend(),
  10113. init: function init(e) {
  10114. this.cfg = this.cfg.extend(e), this.reset();
  10115. },
  10116. reset: function reset() {
  10117. h.reset.call(this), this._doReset();
  10118. },
  10119. update: function update(e) {
  10120. return this._append(e), this._process(), this;
  10121. },
  10122. finalize: function finalize(e) {
  10123. return e && this._append(e), this._doFinalize();
  10124. },
  10125. blockSize: 16,
  10126. _createHelper: function _createHelper(e) {
  10127. return function (t, n) {
  10128. return new e.init(n).finalize(t);
  10129. };
  10130. },
  10131. _createHmacHelper: function _createHmacHelper(e) {
  10132. return function (t, n) {
  10133. return new d.HMAC.init(e, n).finalize(t);
  10134. };
  10135. }
  10136. });
  10137. var d = s.algo = {};
  10138. return s;
  10139. }(Math), n);
  10140. }),
  10141. i = r,
  10142. o = (s(function (e, t) {
  10143. var n;
  10144. e.exports = (n = i, function (e) {
  10145. var t = n,
  10146. s = t.lib,
  10147. r = s.WordArray,
  10148. i = s.Hasher,
  10149. o = t.algo,
  10150. a = [];
  10151. !function () {
  10152. for (var t = 0; t < 64; t++) {
  10153. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10154. }
  10155. }();
  10156. var c = o.MD5 = i.extend({
  10157. _doReset: function _doReset() {
  10158. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10159. },
  10160. _doProcessBlock: function _doProcessBlock(e, t) {
  10161. for (var n = 0; n < 16; n++) {
  10162. var s = t + n,
  10163. r = e[s];
  10164. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10165. }
  10166. var i = this._hash.words,
  10167. o = e[t + 0],
  10168. c = e[t + 1],
  10169. p = e[t + 2],
  10170. f = e[t + 3],
  10171. g = e[t + 4],
  10172. m = e[t + 5],
  10173. y = e[t + 6],
  10174. _ = e[t + 7],
  10175. w = e[t + 8],
  10176. v = e[t + 9],
  10177. b = e[t + 10],
  10178. S = e[t + 11],
  10179. k = e[t + 12],
  10180. I = e[t + 13],
  10181. T = e[t + 14],
  10182. C = e[t + 15],
  10183. A = i[0],
  10184. P = i[1],
  10185. E = i[2],
  10186. O = i[3];
  10187. A = u(A, P, E, O, o, 7, a[0]), O = u(O, A, P, E, c, 12, a[1]), E = u(E, O, A, P, p, 17, a[2]), P = u(P, E, O, A, f, 22, a[3]), A = u(A, P, E, O, g, 7, a[4]), O = u(O, A, P, E, m, 12, a[5]), E = u(E, O, A, P, y, 17, a[6]), P = u(P, E, O, A, _, 22, a[7]), A = u(A, P, E, O, w, 7, a[8]), O = u(O, A, P, E, v, 12, a[9]), E = u(E, O, A, P, b, 17, a[10]), P = u(P, E, O, A, S, 22, a[11]), A = u(A, P, E, O, k, 7, a[12]), O = u(O, A, P, E, I, 12, a[13]), E = u(E, O, A, P, T, 17, a[14]), A = l(A, P = u(P, E, O, A, C, 22, a[15]), E, O, c, 5, a[16]), O = l(O, A, P, E, y, 9, a[17]), E = l(E, O, A, P, S, 14, a[18]), P = l(P, E, O, A, o, 20, a[19]), A = l(A, P, E, O, m, 5, a[20]), O = l(O, A, P, E, b, 9, a[21]), E = l(E, O, A, P, C, 14, a[22]), P = l(P, E, O, A, g, 20, a[23]), A = l(A, P, E, O, v, 5, a[24]), O = l(O, A, P, E, T, 9, a[25]), E = l(E, O, A, P, f, 14, a[26]), P = l(P, E, O, A, w, 20, a[27]), A = l(A, P, E, O, I, 5, a[28]), O = l(O, A, P, E, p, 9, a[29]), E = l(E, O, A, P, _, 14, a[30]), A = h(A, P = l(P, E, O, A, k, 20, a[31]), E, O, m, 4, a[32]), O = h(O, A, P, E, w, 11, a[33]), E = h(E, O, A, P, S, 16, a[34]), P = h(P, E, O, A, T, 23, a[35]), A = h(A, P, E, O, c, 4, a[36]), O = h(O, A, P, E, g, 11, a[37]), E = h(E, O, A, P, _, 16, a[38]), P = h(P, E, O, A, b, 23, a[39]), A = h(A, P, E, O, I, 4, a[40]), O = h(O, A, P, E, o, 11, a[41]), E = h(E, O, A, P, f, 16, a[42]), P = h(P, E, O, A, y, 23, a[43]), A = h(A, P, E, O, v, 4, a[44]), O = h(O, A, P, E, k, 11, a[45]), E = h(E, O, A, P, C, 16, a[46]), A = d(A, P = h(P, E, O, A, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, A, P, E, _, 10, a[49]), E = d(E, O, A, P, T, 15, a[50]), P = d(P, E, O, A, m, 21, a[51]), A = d(A, P, E, O, k, 6, a[52]), O = d(O, A, P, E, f, 10, a[53]), E = d(E, O, A, P, b, 15, a[54]), P = d(P, E, O, A, c, 21, a[55]), A = d(A, P, E, O, w, 6, a[56]), O = d(O, A, P, E, C, 10, a[57]), E = d(E, O, A, P, y, 15, a[58]), P = d(P, E, O, A, I, 21, a[59]), A = d(A, P, E, O, g, 6, a[60]), O = d(O, A, P, E, S, 10, a[61]), E = d(E, O, A, P, p, 15, a[62]), P = d(P, E, O, A, v, 21, a[63]), i[0] = i[0] + A | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  10188. },
  10189. _doFinalize: function _doFinalize() {
  10190. var t = this._data,
  10191. n = t.words,
  10192. s = 8 * this._nDataBytes,
  10193. r = 8 * t.sigBytes;
  10194. n[r >>> 5] |= 128 << 24 - r % 32;
  10195. var i = e.floor(s / 4294967296),
  10196. o = s;
  10197. 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();
  10198. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10199. var l = c[u];
  10200. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  10201. }
  10202. return a;
  10203. },
  10204. clone: function clone() {
  10205. var e = i.clone.call(this);
  10206. return e._hash = this._hash.clone(), e;
  10207. }
  10208. });
  10209. function u(e, t, n, s, r, i, o) {
  10210. var a = e + (t & n | ~t & s) + r + o;
  10211. return (a << i | a >>> 32 - i) + t;
  10212. }
  10213. function l(e, t, n, s, r, i, o) {
  10214. var a = e + (t & s | n & ~s) + r + o;
  10215. return (a << i | a >>> 32 - i) + t;
  10216. }
  10217. function h(e, t, n, s, r, i, o) {
  10218. var a = e + (t ^ n ^ s) + r + o;
  10219. return (a << i | a >>> 32 - i) + t;
  10220. }
  10221. function d(e, t, n, s, r, i, o) {
  10222. var a = e + (n ^ (t | ~s)) + r + o;
  10223. return (a << i | a >>> 32 - i) + t;
  10224. }
  10225. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  10226. }(Math), n.MD5);
  10227. }), s(function (e, t) {
  10228. var n;
  10229. e.exports = (n = i, void function () {
  10230. var e = n,
  10231. t = e.lib.Base,
  10232. s = e.enc.Utf8;
  10233. e.algo.HMAC = t.extend({
  10234. init: function init(e, t) {
  10235. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  10236. var n = e.blockSize,
  10237. r = 4 * n;
  10238. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  10239. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  10240. a[u] ^= 1549556828, c[u] ^= 909522486;
  10241. }
  10242. i.sigBytes = o.sigBytes = r, this.reset();
  10243. },
  10244. reset: function reset() {
  10245. var e = this._hasher;
  10246. e.reset(), e.update(this._iKey);
  10247. },
  10248. update: function update(e) {
  10249. return this._hasher.update(e), this;
  10250. },
  10251. finalize: function finalize(e) {
  10252. var t = this._hasher,
  10253. n = t.finalize(e);
  10254. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  10255. }
  10256. });
  10257. }());
  10258. }), s(function (e, t) {
  10259. e.exports = i.HmacMD5;
  10260. })),
  10261. a = s(function (e, t) {
  10262. e.exports = i.enc.Utf8;
  10263. }),
  10264. c = s(function (e, t) {
  10265. var n;
  10266. e.exports = (n = i, function () {
  10267. var e = n,
  10268. t = e.lib.WordArray;
  10269. function s(e, n, s) {
  10270. for (var r = [], i = 0, o = 0; o < n; o++) {
  10271. if (o % 4) {
  10272. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  10273. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  10274. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  10275. }
  10276. }
  10277. return t.create(r, i);
  10278. }
  10279. e.enc.Base64 = {
  10280. stringify: function stringify(e) {
  10281. var t = e.words,
  10282. n = e.sigBytes,
  10283. s = this._map;
  10284. e.clamp();
  10285. for (var r = [], i = 0; i < n; i += 3) {
  10286. 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++) {
  10287. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  10288. }
  10289. }
  10290. var c = s.charAt(64);
  10291. if (c) for (; r.length % 4;) {
  10292. r.push(c);
  10293. }
  10294. return r.join("");
  10295. },
  10296. parse: function parse(e) {
  10297. var t = e.length,
  10298. n = this._map,
  10299. r = this._reverseMap;
  10300. if (!r) {
  10301. r = this._reverseMap = [];
  10302. for (var i = 0; i < n.length; i++) {
  10303. r[n.charCodeAt(i)] = i;
  10304. }
  10305. }
  10306. var o = n.charAt(64);
  10307. if (o) {
  10308. var a = e.indexOf(o);
  10309. -1 !== a && (t = a);
  10310. }
  10311. return s(e, t, r);
  10312. },
  10313. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  10314. };
  10315. }(), n.enc.Base64);
  10316. });
  10317. var u = "FUNCTION",
  10318. l = "OBJECT",
  10319. h = "CLIENT_DB",
  10320. d = "pending",
  10321. p = "fullfilled",
  10322. f = "rejected";
  10323. function g(e) {
  10324. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  10325. }
  10326. function m(e) {
  10327. return "object" === g(e);
  10328. }
  10329. function y(e) {
  10330. return "function" == typeof e;
  10331. }
  10332. function _(e) {
  10333. return function () {
  10334. try {
  10335. return e.apply(e, arguments);
  10336. } catch (e) {
  10337. console.error(e);
  10338. }
  10339. };
  10340. }
  10341. var w = "REJECTED",
  10342. v = "NOT_PENDING";
  10343. var b = /*#__PURE__*/function () {
  10344. function b() {
  10345. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10346. e = _ref.createPromise,
  10347. _ref$retryRule = _ref.retryRule,
  10348. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  10349. (0, _classCallCheck2.default)(this, b);
  10350. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  10351. }
  10352. (0, _createClass2.default)(b, [{
  10353. key: "needRetry",
  10354. get: function get() {
  10355. if (!this.status) return !0;
  10356. switch (this.retryRule) {
  10357. case w:
  10358. return this.status === f;
  10359. case v:
  10360. return this.status !== d;
  10361. }
  10362. }
  10363. }, {
  10364. key: "exec",
  10365. value: function exec() {
  10366. var _this = this;
  10367. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  10368. return _this.status = p, Promise.resolve(e);
  10369. }, function (e) {
  10370. return _this.status = f, Promise.reject(e);
  10371. }), this.promise) : this.promise;
  10372. }
  10373. }]);
  10374. return b;
  10375. }();
  10376. function S(e) {
  10377. return e && "string" == typeof e ? JSON.parse(e) : e;
  10378. }
  10379. var k = "development" === "development",
  10380. I = "mp-weixin",
  10381. T = "true" === undefined || !0 === undefined,
  10382. C = S([]),
  10383. A = "h5" === I ? "web" : "app-plus" === I ? "app" : I,
  10384. P = S(undefined),
  10385. E = S(undefined) || [],
  10386. O = true;
  10387. var x = "";
  10388. try {
  10389. x = (__webpack_require__(/*! uni-stat-config */ 150).default || __webpack_require__(/*! uni-stat-config */ 150)).appid;
  10390. } catch (e) {}
  10391. var R = {};
  10392. function U(e) {
  10393. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10394. var n, s;
  10395. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  10396. }
  10397. "app" === A && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  10398. var L = ["invoke", "success", "fail", "complete"],
  10399. N = U("_globalUniCloudInterceptor");
  10400. function D(e, t) {
  10401. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  10402. L.indexOf(n) > -1 && function (e, t, n) {
  10403. var s = N[e][t];
  10404. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  10405. }(e, n, t[n]);
  10406. });
  10407. }
  10408. function F(e, t) {
  10409. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  10410. L.indexOf(n) > -1 && function (e, t, n) {
  10411. var s = N[e][t];
  10412. if (!s) return;
  10413. var r = s.indexOf(n);
  10414. r > -1 && s.splice(r, 1);
  10415. }(e, n, t[n]);
  10416. }) : delete N[e];
  10417. }
  10418. function q(e, t) {
  10419. return e && 0 !== e.length ? e.reduce(function (e, n) {
  10420. return e.then(function () {
  10421. return n(t);
  10422. });
  10423. }, Promise.resolve()) : Promise.resolve();
  10424. }
  10425. function K(e, t) {
  10426. return N[e] && N[e][t] || [];
  10427. }
  10428. function M(e) {
  10429. D("callObject", e);
  10430. }
  10431. var j = U("_globalUniCloudListener"),
  10432. B = "response",
  10433. $ = "needLogin",
  10434. W = "refreshToken",
  10435. z = "clientdb",
  10436. J = "cloudfunction",
  10437. H = "cloudobject";
  10438. function G(e) {
  10439. return j[e] || (j[e] = []), j[e];
  10440. }
  10441. function V(e, t) {
  10442. var n = G(e);
  10443. n.includes(t) || n.push(t);
  10444. }
  10445. function Y(e, t) {
  10446. var n = G(e),
  10447. s = n.indexOf(t);
  10448. -1 !== s && n.splice(s, 1);
  10449. }
  10450. function Q(e, t) {
  10451. var n = G(e);
  10452. for (var _e2 = 0; _e2 < n.length; _e2++) {
  10453. (0, n[_e2])(t);
  10454. }
  10455. }
  10456. var X,
  10457. Z = !1;
  10458. function ee() {
  10459. return X || (X = new Promise(function (e) {
  10460. Z && e(), function t() {
  10461. if ("function" == typeof getCurrentPages) {
  10462. var _t2 = getCurrentPages();
  10463. _t2 && _t2[0] && (Z = !0, e());
  10464. }
  10465. Z || setTimeout(function () {
  10466. t();
  10467. }, 30);
  10468. }();
  10469. }), X);
  10470. }
  10471. function te(e) {
  10472. var t = {};
  10473. for (var _n2 in e) {
  10474. var _s2 = e[_n2];
  10475. y(_s2) && (t[_n2] = _(_s2));
  10476. }
  10477. return t;
  10478. }
  10479. var ne = /*#__PURE__*/function (_Error) {
  10480. (0, _inherits2.default)(ne, _Error);
  10481. var _super = _createSuper(ne);
  10482. function ne(e) {
  10483. var _this2;
  10484. (0, _classCallCheck2.default)(this, ne);
  10485. _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;
  10486. return _this2;
  10487. }
  10488. (0, _createClass2.default)(ne, [{
  10489. key: "toJson",
  10490. value: function toJson() {
  10491. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10492. if (!(e >= 10)) return e++, {
  10493. errCode: this.errCode,
  10494. errMsg: this.errMsg,
  10495. errSubject: this.errSubject,
  10496. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  10497. };
  10498. }
  10499. }]);
  10500. return ne;
  10501. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  10502. var se = {
  10503. request: function request(e) {
  10504. return uni.request(e);
  10505. },
  10506. uploadFile: function uploadFile(e) {
  10507. return uni.uploadFile(e);
  10508. },
  10509. setStorageSync: function setStorageSync(e, t) {
  10510. return uni.setStorageSync(e, t);
  10511. },
  10512. getStorageSync: function getStorageSync(e) {
  10513. return uni.getStorageSync(e);
  10514. },
  10515. removeStorageSync: function removeStorageSync(e) {
  10516. return uni.removeStorageSync(e);
  10517. },
  10518. clearStorageSync: function clearStorageSync() {
  10519. return uni.clearStorageSync();
  10520. }
  10521. };
  10522. function re() {
  10523. return {
  10524. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  10525. tokenExpired: se.getStorageSync("uni_id_token_expired")
  10526. };
  10527. }
  10528. function ie() {
  10529. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10530. e = _ref2.token,
  10531. t = _ref2.tokenExpired;
  10532. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  10533. }
  10534. var oe, ae;
  10535. function ce() {
  10536. return oe || (oe = uni.getSystemInfoSync()), oe;
  10537. }
  10538. function ue() {
  10539. var e, t;
  10540. try {
  10541. if (uni.getLaunchOptionsSync) {
  10542. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  10543. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  10544. _n3 = _uni$getLaunchOptions.scene,
  10545. _s3 = _uni$getLaunchOptions.channel;
  10546. e = _s3, t = _n3;
  10547. }
  10548. } catch (e) {}
  10549. return {
  10550. channel: e,
  10551. scene: t
  10552. };
  10553. }
  10554. function le() {
  10555. var e = uni.getLocale && uni.getLocale() || "en";
  10556. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  10557. locale: e,
  10558. LOCALE: e
  10559. });
  10560. var t = ce(),
  10561. n = t.deviceId,
  10562. s = t.osName,
  10563. r = t.uniPlatform,
  10564. i = t.appId,
  10565. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10566. for (var _e3 = 0; _e3 < o.length; _e3++) {
  10567. delete t[o[_e3]];
  10568. }
  10569. return ae = _objectSpread(_objectSpread({
  10570. PLATFORM: r,
  10571. OS: s,
  10572. APPID: i,
  10573. DEVICEID: n
  10574. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  10575. locale: e,
  10576. LOCALE: e
  10577. });
  10578. }
  10579. var he = {
  10580. sign: function sign(e, t) {
  10581. var n = "";
  10582. return Object.keys(e).sort().forEach(function (t) {
  10583. e[t] && (n = n + "&" + t + "=" + e[t]);
  10584. }), n = n.slice(1), o(n, t).toString();
  10585. },
  10586. wrappedRequest: function wrappedRequest(e, t) {
  10587. return new Promise(function (n, s) {
  10588. t(Object.assign(e, {
  10589. complete: function complete(e) {
  10590. e || (e = {}), k && "web" === A && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  10591. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  10592. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  10593. code: "SYS_ERR",
  10594. message: e.errMsg || "request:fail",
  10595. requestId: t
  10596. }));
  10597. var r = e.data;
  10598. if (r.error) return s(new ne({
  10599. code: r.error.code,
  10600. message: r.error.message,
  10601. requestId: t
  10602. }));
  10603. r.result = r.data, r.requestId = t, delete r.data, n(r);
  10604. }
  10605. }));
  10606. });
  10607. },
  10608. toBase64: function toBase64(e) {
  10609. return c.stringify(a.parse(e));
  10610. }
  10611. },
  10612. de = {
  10613. "uniCloud.init.paramRequired": "{param} required",
  10614. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10615. };
  10616. var _e4 = (0, _uniI18n.initVueI18n)({
  10617. "zh-Hans": {
  10618. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10619. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10620. },
  10621. "zh-Hant": {
  10622. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10623. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10624. },
  10625. en: de,
  10626. fr: {
  10627. "uniCloud.init.paramRequired": "{param} required",
  10628. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10629. },
  10630. es: {
  10631. "uniCloud.init.paramRequired": "{param} required",
  10632. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10633. },
  10634. ja: de
  10635. }, "zh-Hans"),
  10636. pe = _e4.t;
  10637. var fe = /*#__PURE__*/function () {
  10638. function fe(e) {
  10639. var _this3 = this;
  10640. (0, _classCallCheck2.default)(this, fe);
  10641. ["spaceId", "clientSecret"].forEach(function (t) {
  10642. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  10643. param: t
  10644. }));
  10645. }), this.config = Object.assign({}, {
  10646. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  10647. }, 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 = se, this._getAccessTokenPromiseHub = new b({
  10648. createPromise: function createPromise() {
  10649. return _this3.requestAuth(_this3.setupRequest({
  10650. method: "serverless.auth.user.anonymousAuthorize",
  10651. params: "{}"
  10652. }, "auth")).then(function (e) {
  10653. if (!e.result || !e.result.accessToken) throw new ne({
  10654. code: "AUTH_FAILED",
  10655. message: "获取accessToken失败"
  10656. });
  10657. _this3.setAccessToken(e.result.accessToken);
  10658. });
  10659. },
  10660. retryRule: v
  10661. });
  10662. }
  10663. (0, _createClass2.default)(fe, [{
  10664. key: "hasAccessToken",
  10665. get: function get() {
  10666. return !!this.accessToken;
  10667. }
  10668. }, {
  10669. key: "setAccessToken",
  10670. value: function setAccessToken(e) {
  10671. this.accessToken = e;
  10672. }
  10673. }, {
  10674. key: "requestWrapped",
  10675. value: function requestWrapped(e) {
  10676. return he.wrappedRequest(e, this.adapter.request);
  10677. }
  10678. }, {
  10679. key: "requestAuth",
  10680. value: function requestAuth(e) {
  10681. return this.requestWrapped(e);
  10682. }
  10683. }, {
  10684. key: "request",
  10685. value: function request(e, t) {
  10686. var _this4 = this;
  10687. return Promise.resolve().then(function () {
  10688. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  10689. return new Promise(function (e, n) {
  10690. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  10691. }).then(function () {
  10692. return _this4.getAccessToken();
  10693. }).then(function () {
  10694. var t = _this4.rebuildRequest(e);
  10695. return _this4.request(t, !0);
  10696. });
  10697. }) : _this4.getAccessToken().then(function () {
  10698. var t = _this4.rebuildRequest(e);
  10699. return _this4.request(t, !0);
  10700. });
  10701. });
  10702. }
  10703. }, {
  10704. key: "rebuildRequest",
  10705. value: function rebuildRequest(e) {
  10706. var t = Object.assign({}, e);
  10707. 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;
  10708. }
  10709. }, {
  10710. key: "setupRequest",
  10711. value: function setupRequest(e, t) {
  10712. var n = Object.assign({}, e, {
  10713. spaceId: this.config.spaceId,
  10714. timestamp: Date.now()
  10715. }),
  10716. s = {
  10717. "Content-Type": "application/json"
  10718. };
  10719. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  10720. url: this.config.requestUrl,
  10721. method: "POST",
  10722. data: n,
  10723. dataType: "json",
  10724. header: s
  10725. };
  10726. }
  10727. }, {
  10728. key: "getAccessToken",
  10729. value: function getAccessToken() {
  10730. return this._getAccessTokenPromiseHub.exec();
  10731. }
  10732. }, {
  10733. key: "authorize",
  10734. value: function () {
  10735. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10736. return _regenerator.default.wrap(function _callee$(_context) {
  10737. while (1) {
  10738. switch (_context.prev = _context.next) {
  10739. case 0:
  10740. _context.next = 2;
  10741. return this.getAccessToken();
  10742. case 2:
  10743. case "end":
  10744. return _context.stop();
  10745. }
  10746. }
  10747. }, _callee, this);
  10748. }));
  10749. function authorize() {
  10750. return _authorize.apply(this, arguments);
  10751. }
  10752. return authorize;
  10753. }()
  10754. }, {
  10755. key: "callFunction",
  10756. value: function callFunction(e) {
  10757. var t = {
  10758. method: "serverless.function.runtime.invoke",
  10759. params: JSON.stringify({
  10760. functionTarget: e.name,
  10761. functionArgs: e.data || {}
  10762. })
  10763. };
  10764. return this.request(this.setupRequest(t));
  10765. }
  10766. }, {
  10767. key: "getOSSUploadOptionsFromPath",
  10768. value: function getOSSUploadOptionsFromPath(e) {
  10769. var t = {
  10770. method: "serverless.file.resource.generateProximalSign",
  10771. params: JSON.stringify(e)
  10772. };
  10773. return this.request(this.setupRequest(t));
  10774. }
  10775. }, {
  10776. key: "uploadFileToOSS",
  10777. value: function uploadFileToOSS(_ref3) {
  10778. var _this5 = this;
  10779. var e = _ref3.url,
  10780. t = _ref3.formData,
  10781. n = _ref3.name,
  10782. s = _ref3.filePath,
  10783. r = _ref3.fileType,
  10784. i = _ref3.onUploadProgress;
  10785. return new Promise(function (o, a) {
  10786. var c = _this5.adapter.uploadFile({
  10787. url: e,
  10788. formData: t,
  10789. name: n,
  10790. filePath: s,
  10791. fileType: r,
  10792. header: {
  10793. "X-OSS-server-side-encrpytion": "AES256"
  10794. },
  10795. success: function success(e) {
  10796. e && e.statusCode < 400 ? o(e) : a(new ne({
  10797. code: "UPLOAD_FAILED",
  10798. message: "文件上传失败"
  10799. }));
  10800. },
  10801. fail: function fail(e) {
  10802. a(new ne({
  10803. code: e.code || "UPLOAD_FAILED",
  10804. message: e.message || e.errMsg || "文件上传失败"
  10805. }));
  10806. }
  10807. });
  10808. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  10809. i({
  10810. loaded: e.totalBytesSent,
  10811. total: e.totalBytesExpectedToSend
  10812. });
  10813. });
  10814. });
  10815. }
  10816. }, {
  10817. key: "reportOSSUpload",
  10818. value: function reportOSSUpload(e) {
  10819. var t = {
  10820. method: "serverless.file.resource.report",
  10821. params: JSON.stringify(e)
  10822. };
  10823. return this.request(this.setupRequest(t));
  10824. }
  10825. }, {
  10826. key: "uploadFile",
  10827. value: function () {
  10828. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  10829. var e, t, _ref4$fileType, n, s, r, i, o, a, c, u, l, h, d, p, f, m, y, _e5, _;
  10830. return _regenerator.default.wrap(function _callee2$(_context2) {
  10831. while (1) {
  10832. switch (_context2.prev = _context2.next) {
  10833. case 0:
  10834. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, s = _ref4.onUploadProgress, r = _ref4.config;
  10835. if (!("string" !== g(t))) {
  10836. _context2.next = 3;
  10837. break;
  10838. }
  10839. throw new ne({
  10840. code: "INVALID_PARAM",
  10841. message: "cloudPath必须为字符串类型"
  10842. });
  10843. case 3:
  10844. if (t = t.trim()) {
  10845. _context2.next = 5;
  10846. break;
  10847. }
  10848. throw new ne({
  10849. code: "CLOUDPATH_REQUIRED",
  10850. message: "cloudPath不可为空"
  10851. });
  10852. case 5:
  10853. if (!/:\/\//.test(t)) {
  10854. _context2.next = 7;
  10855. break;
  10856. }
  10857. throw new ne({
  10858. code: "INVALID_PARAM",
  10859. message: "cloudPath不合法"
  10860. });
  10861. case 7:
  10862. i = r && r.envType || this.config.envType;
  10863. _context2.next = 10;
  10864. return this.getOSSUploadOptionsFromPath({
  10865. env: i,
  10866. filename: t
  10867. });
  10868. case 10:
  10869. o = _context2.sent.result;
  10870. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  10871. c = o.securityToken;
  10872. u = o.accessKeyId;
  10873. l = o.signature;
  10874. h = o.host;
  10875. d = o.ossPath;
  10876. p = o.id;
  10877. f = o.policy;
  10878. m = o.ossCallbackUrl;
  10879. y = {
  10880. "Cache-Control": "max-age=2592000",
  10881. "Content-Disposition": "attachment",
  10882. OSSAccessKeyId: u,
  10883. Signature: l,
  10884. host: h,
  10885. id: p,
  10886. key: d,
  10887. policy: f,
  10888. success_action_status: 200
  10889. };
  10890. if (c && (y["x-oss-security-token"] = c), m) {
  10891. _e5 = JSON.stringify({
  10892. callbackUrl: m,
  10893. callbackBody: JSON.stringify({
  10894. fileId: p,
  10895. spaceId: this.config.spaceId
  10896. }),
  10897. callbackBodyType: "application/json"
  10898. });
  10899. y.callback = he.toBase64(_e5);
  10900. }
  10901. _ = {
  10902. url: "https://" + o.host,
  10903. formData: y,
  10904. fileName: "file",
  10905. name: "file",
  10906. filePath: e,
  10907. fileType: n
  10908. };
  10909. _context2.next = 25;
  10910. return this.uploadFileToOSS(Object.assign({}, _, {
  10911. onUploadProgress: s
  10912. }));
  10913. case 25:
  10914. if (!m) {
  10915. _context2.next = 27;
  10916. break;
  10917. }
  10918. return _context2.abrupt("return", {
  10919. success: !0,
  10920. filePath: e,
  10921. fileID: a
  10922. });
  10923. case 27:
  10924. _context2.next = 29;
  10925. return this.reportOSSUpload({
  10926. id: p
  10927. });
  10928. case 29:
  10929. if (!_context2.sent.success) {
  10930. _context2.next = 31;
  10931. break;
  10932. }
  10933. return _context2.abrupt("return", {
  10934. success: !0,
  10935. filePath: e,
  10936. fileID: a
  10937. });
  10938. case 31:
  10939. throw new ne({
  10940. code: "UPLOAD_FAILED",
  10941. message: "文件上传失败"
  10942. });
  10943. case 32:
  10944. case "end":
  10945. return _context2.stop();
  10946. }
  10947. }
  10948. }, _callee2, this);
  10949. }));
  10950. function uploadFile(_x) {
  10951. return _uploadFile.apply(this, arguments);
  10952. }
  10953. return uploadFile;
  10954. }()
  10955. }, {
  10956. key: "getTempFileURL",
  10957. value: function getTempFileURL() {
  10958. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10959. e = _ref5.fileList;
  10960. return new Promise(function (t, n) {
  10961. Array.isArray(e) && 0 !== e.length || n(new ne({
  10962. code: "INVALID_PARAM",
  10963. message: "fileList的元素必须是非空的字符串"
  10964. })), t({
  10965. fileList: e.map(function (e) {
  10966. return {
  10967. fileID: e,
  10968. tempFileURL: e
  10969. };
  10970. })
  10971. });
  10972. });
  10973. }
  10974. }, {
  10975. key: "getFileInfo",
  10976. value: function () {
  10977. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  10978. var _ref6,
  10979. e,
  10980. t,
  10981. _args3 = arguments;
  10982. return _regenerator.default.wrap(function _callee3$(_context3) {
  10983. while (1) {
  10984. switch (_context3.prev = _context3.next) {
  10985. case 0:
  10986. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  10987. if (!(!Array.isArray(e) || 0 === e.length)) {
  10988. _context3.next = 3;
  10989. break;
  10990. }
  10991. throw new ne({
  10992. code: "INVALID_PARAM",
  10993. message: "fileList的元素必须是非空的字符串"
  10994. });
  10995. case 3:
  10996. t = {
  10997. method: "serverless.file.resource.info",
  10998. params: JSON.stringify({
  10999. id: e.map(function (e) {
  11000. return e.split("?")[0];
  11001. }).join(",")
  11002. })
  11003. };
  11004. _context3.next = 6;
  11005. return this.request(this.setupRequest(t));
  11006. case 6:
  11007. _context3.t0 = _context3.sent.result;
  11008. return _context3.abrupt("return", {
  11009. fileList: _context3.t0
  11010. });
  11011. case 8:
  11012. case "end":
  11013. return _context3.stop();
  11014. }
  11015. }
  11016. }, _callee3, this);
  11017. }));
  11018. function getFileInfo() {
  11019. return _getFileInfo.apply(this, arguments);
  11020. }
  11021. return getFileInfo;
  11022. }()
  11023. }]);
  11024. return fe;
  11025. }();
  11026. var ge = {
  11027. init: function init(e) {
  11028. var t = new fe(e),
  11029. n = {
  11030. signInAnonymously: function signInAnonymously() {
  11031. return t.authorize();
  11032. },
  11033. getLoginState: function getLoginState() {
  11034. return Promise.resolve(!1);
  11035. }
  11036. };
  11037. return t.auth = function () {
  11038. return n;
  11039. }, t.customAuth = t.auth, t;
  11040. }
  11041. };
  11042. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11043. var ye;
  11044. !function (e) {
  11045. e.local = "local", e.none = "none", e.session = "session";
  11046. }(ye || (ye = {}));
  11047. var _e = function _e() {};
  11048. var we = function we() {
  11049. var e;
  11050. if (!Promise) {
  11051. e = function e() {}, e.promise = {};
  11052. var _t3 = function _t3() {
  11053. throw new ne({
  11054. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11055. });
  11056. };
  11057. return Object.defineProperty(e.promise, "then", {
  11058. get: _t3
  11059. }), Object.defineProperty(e.promise, "catch", {
  11060. get: _t3
  11061. }), e;
  11062. }
  11063. var t = new Promise(function (t, n) {
  11064. e = function e(_e6, s) {
  11065. return _e6 ? n(_e6) : t(s);
  11066. };
  11067. });
  11068. return e.promise = t, e;
  11069. };
  11070. function ve(e) {
  11071. return void 0 === e;
  11072. }
  11073. function be(e) {
  11074. return "[object Null]" === Object.prototype.toString.call(e);
  11075. }
  11076. var Se;
  11077. function ke(e) {
  11078. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11079. var n;
  11080. var _iterator = _createForOfIteratorHelper(t),
  11081. _step;
  11082. try {
  11083. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11084. var _e7 = _step.value;
  11085. var _t4 = _e7.isMatch,
  11086. _n4 = _e7.genAdapter,
  11087. _s4 = _e7.runtime;
  11088. if (_t4()) return {
  11089. adapter: _n4(),
  11090. runtime: _s4
  11091. };
  11092. }
  11093. } catch (err) {
  11094. _iterator.e(err);
  11095. } finally {
  11096. _iterator.f();
  11097. }
  11098. }
  11099. !function (e) {
  11100. e.WEB = "web", e.WX_MP = "wx_mp";
  11101. }(Se || (Se = {}));
  11102. var Ie = {
  11103. adapter: null,
  11104. runtime: void 0
  11105. },
  11106. Te = ["anonymousUuidKey"];
  11107. var Ce = /*#__PURE__*/function (_e8) {
  11108. (0, _inherits2.default)(Ce, _e8);
  11109. var _super2 = _createSuper(Ce);
  11110. function Ce() {
  11111. var _this6;
  11112. (0, _classCallCheck2.default)(this, Ce);
  11113. _this6 = _super2.call(this), Ie.adapter.root.tcbObject || (Ie.adapter.root.tcbObject = {});
  11114. return _this6;
  11115. }
  11116. (0, _createClass2.default)(Ce, [{
  11117. key: "setItem",
  11118. value: function setItem(e, t) {
  11119. Ie.adapter.root.tcbObject[e] = t;
  11120. }
  11121. }, {
  11122. key: "getItem",
  11123. value: function getItem(e) {
  11124. return Ie.adapter.root.tcbObject[e];
  11125. }
  11126. }, {
  11127. key: "removeItem",
  11128. value: function removeItem(e) {
  11129. delete Ie.adapter.root.tcbObject[e];
  11130. }
  11131. }, {
  11132. key: "clear",
  11133. value: function clear() {
  11134. delete Ie.adapter.root.tcbObject;
  11135. }
  11136. }]);
  11137. return Ce;
  11138. }(_e);
  11139. function Ae(e, t) {
  11140. switch (e) {
  11141. case "local":
  11142. return t.localStorage || new Ce();
  11143. case "none":
  11144. return new Ce();
  11145. default:
  11146. return t.sessionStorage || new Ce();
  11147. }
  11148. }
  11149. var Pe = /*#__PURE__*/function () {
  11150. function Pe(e) {
  11151. (0, _classCallCheck2.default)(this, Pe);
  11152. if (!this._storage) {
  11153. this._persistence = Ie.adapter.primaryStorage || e.persistence, this._storage = Ae(this._persistence, Ie.adapter);
  11154. var _t5 = "access_token_".concat(e.env),
  11155. _n5 = "access_token_expire_".concat(e.env),
  11156. _s5 = "refresh_token_".concat(e.env),
  11157. _r = "anonymous_uuid_".concat(e.env),
  11158. _i = "login_type_".concat(e.env),
  11159. _o = "user_info_".concat(e.env);
  11160. this.keys = {
  11161. accessTokenKey: _t5,
  11162. accessTokenExpireKey: _n5,
  11163. refreshTokenKey: _s5,
  11164. anonymousUuidKey: _r,
  11165. loginTypeKey: _i,
  11166. userInfoKey: _o
  11167. };
  11168. }
  11169. }
  11170. (0, _createClass2.default)(Pe, [{
  11171. key: "updatePersistence",
  11172. value: function updatePersistence(e) {
  11173. if (e === this._persistence) return;
  11174. var t = "local" === this._persistence;
  11175. this._persistence = e;
  11176. var n = Ae(e, Ie.adapter);
  11177. for (var _e9 in this.keys) {
  11178. var _s6 = this.keys[_e9];
  11179. if (t && Te.includes(_e9)) continue;
  11180. var _r2 = this._storage.getItem(_s6);
  11181. ve(_r2) || be(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  11182. }
  11183. this._storage = n;
  11184. }
  11185. }, {
  11186. key: "setStore",
  11187. value: function setStore(e, t, n) {
  11188. if (!this._storage) return;
  11189. var s = {
  11190. version: n || "localCachev1",
  11191. content: t
  11192. },
  11193. r = JSON.stringify(s);
  11194. try {
  11195. this._storage.setItem(e, r);
  11196. } catch (e) {
  11197. throw e;
  11198. }
  11199. }
  11200. }, {
  11201. key: "getStore",
  11202. value: function getStore(e, t) {
  11203. try {
  11204. if (!this._storage) return;
  11205. } catch (e) {
  11206. return "";
  11207. }
  11208. t = t || "localCachev1";
  11209. var n = this._storage.getItem(e);
  11210. if (!n) return "";
  11211. if (n.indexOf(t) >= 0) {
  11212. return JSON.parse(n).content;
  11213. }
  11214. return "";
  11215. }
  11216. }, {
  11217. key: "removeStore",
  11218. value: function removeStore(e) {
  11219. this._storage.removeItem(e);
  11220. }
  11221. }]);
  11222. return Pe;
  11223. }();
  11224. var Ee = {},
  11225. Oe = {};
  11226. function xe(e) {
  11227. return Ee[e];
  11228. }
  11229. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  11230. (0, _classCallCheck2.default)(this, Re);
  11231. this.data = t || null, this.name = e;
  11232. });
  11233. var Ue = /*#__PURE__*/function (_Re) {
  11234. (0, _inherits2.default)(Ue, _Re);
  11235. var _super3 = _createSuper(Ue);
  11236. function Ue(e, t) {
  11237. var _this7;
  11238. (0, _classCallCheck2.default)(this, Ue);
  11239. _this7 = _super3.call(this, "error", {
  11240. error: e,
  11241. data: t
  11242. }), _this7.error = e;
  11243. return _this7;
  11244. }
  11245. return (0, _createClass2.default)(Ue);
  11246. }(Re);
  11247. var Le = new ( /*#__PURE__*/function () {
  11248. function _class() {
  11249. (0, _classCallCheck2.default)(this, _class);
  11250. this._listeners = {};
  11251. }
  11252. (0, _createClass2.default)(_class, [{
  11253. key: "on",
  11254. value: function on(e, t) {
  11255. return function (e, t, n) {
  11256. n[e] = n[e] || [], n[e].push(t);
  11257. }(e, t, this._listeners), this;
  11258. }
  11259. }, {
  11260. key: "off",
  11261. value: function off(e, t) {
  11262. return function (e, t, n) {
  11263. if (n && n[e]) {
  11264. var _s7 = n[e].indexOf(t);
  11265. -1 !== _s7 && n[e].splice(_s7, 1);
  11266. }
  11267. }(e, t, this._listeners), this;
  11268. }
  11269. }, {
  11270. key: "fire",
  11271. value: function fire(e, t) {
  11272. if (e instanceof Ue) return console.error(e.error), this;
  11273. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  11274. var s = n.name;
  11275. if (this._listens(s)) {
  11276. n.target = this;
  11277. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  11278. var _iterator2 = _createForOfIteratorHelper(_e10),
  11279. _step2;
  11280. try {
  11281. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  11282. var _t6 = _step2.value;
  11283. _t6.call(this, n);
  11284. }
  11285. } catch (err) {
  11286. _iterator2.e(err);
  11287. } finally {
  11288. _iterator2.f();
  11289. }
  11290. }
  11291. return this;
  11292. }
  11293. }, {
  11294. key: "_listens",
  11295. value: function _listens(e) {
  11296. return this._listeners[e] && this._listeners[e].length > 0;
  11297. }
  11298. }]);
  11299. return _class;
  11300. }())();
  11301. function Ne(e, t) {
  11302. Le.on(e, t);
  11303. }
  11304. function De(e) {
  11305. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11306. Le.fire(e, t);
  11307. }
  11308. function Fe(e, t) {
  11309. Le.off(e, t);
  11310. }
  11311. var qe = "loginStateChanged",
  11312. Ke = "loginStateExpire",
  11313. Me = "loginTypeChanged",
  11314. je = "anonymousConverted",
  11315. Be = "refreshAccessToken";
  11316. var $e;
  11317. !function (e) {
  11318. 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";
  11319. }($e || ($e = {}));
  11320. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  11321. ze = {
  11322. "X-SDK-Version": "1.3.5"
  11323. };
  11324. function Je(e, t, n) {
  11325. var s = e[t];
  11326. e[t] = function (t) {
  11327. var r = {},
  11328. i = {};
  11329. n.forEach(function (n) {
  11330. var _n$call = n.call(e, t),
  11331. s = _n$call.data,
  11332. o = _n$call.headers;
  11333. Object.assign(r, s), Object.assign(i, o);
  11334. });
  11335. var o = t.data;
  11336. return o && function () {
  11337. var e;
  11338. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  11339. o.append(_e11, r[_e11]);
  11340. }
  11341. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  11342. };
  11343. }
  11344. function He() {
  11345. var e = Math.random().toString(16).slice(2);
  11346. return {
  11347. data: {
  11348. seqId: e
  11349. },
  11350. headers: _objectSpread(_objectSpread({}, ze), {}, {
  11351. "x-seqid": e
  11352. })
  11353. };
  11354. }
  11355. var Ge = /*#__PURE__*/function () {
  11356. function Ge() {
  11357. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11358. (0, _classCallCheck2.default)(this, Ge);
  11359. var t;
  11360. this.config = e, this._reqClass = new Ie.adapter.reqClass({
  11361. timeout: this.config.timeout,
  11362. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  11363. restrictedMethods: ["post"]
  11364. }), this._cache = xe(this.config.env), this._localCache = (t = this.config.env, Oe[t]), Je(this._reqClass, "post", [He]), Je(this._reqClass, "upload", [He]), Je(this._reqClass, "download", [He]);
  11365. }
  11366. (0, _createClass2.default)(Ge, [{
  11367. key: "post",
  11368. value: function () {
  11369. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  11370. return _regenerator.default.wrap(function _callee4$(_context4) {
  11371. while (1) {
  11372. switch (_context4.prev = _context4.next) {
  11373. case 0:
  11374. _context4.next = 2;
  11375. return this._reqClass.post(e);
  11376. case 2:
  11377. return _context4.abrupt("return", _context4.sent);
  11378. case 3:
  11379. case "end":
  11380. return _context4.stop();
  11381. }
  11382. }
  11383. }, _callee4, this);
  11384. }));
  11385. function post(_x2) {
  11386. return _post.apply(this, arguments);
  11387. }
  11388. return post;
  11389. }()
  11390. }, {
  11391. key: "upload",
  11392. value: function () {
  11393. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  11394. return _regenerator.default.wrap(function _callee5$(_context5) {
  11395. while (1) {
  11396. switch (_context5.prev = _context5.next) {
  11397. case 0:
  11398. _context5.next = 2;
  11399. return this._reqClass.upload(e);
  11400. case 2:
  11401. return _context5.abrupt("return", _context5.sent);
  11402. case 3:
  11403. case "end":
  11404. return _context5.stop();
  11405. }
  11406. }
  11407. }, _callee5, this);
  11408. }));
  11409. function upload(_x3) {
  11410. return _upload.apply(this, arguments);
  11411. }
  11412. return upload;
  11413. }()
  11414. }, {
  11415. key: "download",
  11416. value: function () {
  11417. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  11418. return _regenerator.default.wrap(function _callee6$(_context6) {
  11419. while (1) {
  11420. switch (_context6.prev = _context6.next) {
  11421. case 0:
  11422. _context6.next = 2;
  11423. return this._reqClass.download(e);
  11424. case 2:
  11425. return _context6.abrupt("return", _context6.sent);
  11426. case 3:
  11427. case "end":
  11428. return _context6.stop();
  11429. }
  11430. }
  11431. }, _callee6, this);
  11432. }));
  11433. function download(_x4) {
  11434. return _download.apply(this, arguments);
  11435. }
  11436. return download;
  11437. }()
  11438. }, {
  11439. key: "refreshAccessToken",
  11440. value: function () {
  11441. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  11442. var e, t;
  11443. return _regenerator.default.wrap(function _callee7$(_context7) {
  11444. while (1) {
  11445. switch (_context7.prev = _context7.next) {
  11446. case 0:
  11447. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11448. _context7.prev = 1;
  11449. _context7.next = 4;
  11450. return this._refreshAccessTokenPromise;
  11451. case 4:
  11452. e = _context7.sent;
  11453. _context7.next = 10;
  11454. break;
  11455. case 7:
  11456. _context7.prev = 7;
  11457. _context7.t0 = _context7["catch"](1);
  11458. t = _context7.t0;
  11459. case 10:
  11460. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  11461. _context7.next = 12;
  11462. break;
  11463. }
  11464. throw t;
  11465. case 12:
  11466. return _context7.abrupt("return", e);
  11467. case 13:
  11468. case "end":
  11469. return _context7.stop();
  11470. }
  11471. }
  11472. }, _callee7, this, [[1, 7]]);
  11473. }));
  11474. function refreshAccessToken() {
  11475. return _refreshAccessToken2.apply(this, arguments);
  11476. }
  11477. return refreshAccessToken;
  11478. }()
  11479. }, {
  11480. key: "_refreshAccessToken",
  11481. value: function () {
  11482. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  11483. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  11484. return _regenerator.default.wrap(function _callee8$(_context8) {
  11485. while (1) {
  11486. switch (_context8.prev = _context8.next) {
  11487. case 0:
  11488. _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;
  11489. this._cache.removeStore(e), this._cache.removeStore(t);
  11490. i = this._cache.getStore(n);
  11491. if (i) {
  11492. _context8.next = 5;
  11493. break;
  11494. }
  11495. throw new ne({
  11496. message: "未登录CloudBase"
  11497. });
  11498. case 5:
  11499. o = {
  11500. refresh_token: i
  11501. };
  11502. _context8.next = 8;
  11503. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  11504. case 8:
  11505. a = _context8.sent;
  11506. if (!a.data.code) {
  11507. _context8.next = 21;
  11508. break;
  11509. }
  11510. _e12 = a.data.code;
  11511. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  11512. _context8.next = 20;
  11513. break;
  11514. }
  11515. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  11516. _context8.next = 19;
  11517. break;
  11518. }
  11519. _e13 = this._cache.getStore(r);
  11520. _t7 = this._cache.getStore(n);
  11521. _context8.next = 17;
  11522. return this.send("auth.signInAnonymously", {
  11523. anonymous_uuid: _e13,
  11524. refresh_token: _t7
  11525. });
  11526. case 17:
  11527. _s8 = _context8.sent;
  11528. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  11529. case 19:
  11530. De(Ke), this._cache.removeStore(n);
  11531. case 20:
  11532. throw new ne({
  11533. code: a.data.code,
  11534. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  11535. });
  11536. case 21:
  11537. if (!a.data.access_token) {
  11538. _context8.next = 23;
  11539. break;
  11540. }
  11541. return _context8.abrupt("return", (De(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  11542. accessToken: a.data.access_token,
  11543. accessTokenExpire: a.data.access_token_expire
  11544. }));
  11545. case 23:
  11546. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  11547. case 24:
  11548. case "end":
  11549. return _context8.stop();
  11550. }
  11551. }
  11552. }, _callee8, this);
  11553. }));
  11554. function _refreshAccessToken() {
  11555. return _refreshAccessToken3.apply(this, arguments);
  11556. }
  11557. return _refreshAccessToken;
  11558. }()
  11559. }, {
  11560. key: "getAccessToken",
  11561. value: function () {
  11562. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  11563. var _this$_cache$keys2, e, t, n, s, r, i;
  11564. return _regenerator.default.wrap(function _callee9$(_context9) {
  11565. while (1) {
  11566. switch (_context9.prev = _context9.next) {
  11567. case 0:
  11568. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  11569. if (this._cache.getStore(n)) {
  11570. _context9.next = 3;
  11571. break;
  11572. }
  11573. throw new ne({
  11574. message: "refresh token不存在,登录状态异常"
  11575. });
  11576. case 3:
  11577. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  11578. _context9.t0 = this._shouldRefreshAccessTokenHook;
  11579. if (!_context9.t0) {
  11580. _context9.next = 9;
  11581. break;
  11582. }
  11583. _context9.next = 8;
  11584. return this._shouldRefreshAccessTokenHook(s, r);
  11585. case 8:
  11586. _context9.t0 = !_context9.sent;
  11587. case 9:
  11588. _context9.t1 = _context9.t0;
  11589. if (!_context9.t1) {
  11590. _context9.next = 12;
  11591. break;
  11592. }
  11593. i = !1;
  11594. case 12:
  11595. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  11596. accessToken: s,
  11597. accessTokenExpire: r
  11598. });
  11599. case 13:
  11600. case "end":
  11601. return _context9.stop();
  11602. }
  11603. }
  11604. }, _callee9, this);
  11605. }));
  11606. function getAccessToken() {
  11607. return _getAccessToken.apply(this, arguments);
  11608. }
  11609. return getAccessToken;
  11610. }()
  11611. }, {
  11612. key: "request",
  11613. value: function () {
  11614. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  11615. var s, r, i, _e14, o, _e15, _e16, a, c, u, l, h, d, p, f, g;
  11616. return _regenerator.default.wrap(function _callee10$(_context10) {
  11617. while (1) {
  11618. switch (_context10.prev = _context10.next) {
  11619. case 0:
  11620. s = "x-tcb-trace_".concat(this.config.env);
  11621. r = "application/x-www-form-urlencoded";
  11622. i = _objectSpread({
  11623. action: e,
  11624. env: this.config.env,
  11625. dataVersion: "2019-08-16"
  11626. }, t);
  11627. if (!(-1 === We.indexOf(e))) {
  11628. _context10.next = 10;
  11629. break;
  11630. }
  11631. _e14 = this._cache.keys.refreshTokenKey;
  11632. _context10.t0 = this._cache.getStore(_e14);
  11633. if (!_context10.t0) {
  11634. _context10.next = 10;
  11635. break;
  11636. }
  11637. _context10.next = 9;
  11638. return this.getAccessToken();
  11639. case 9:
  11640. i.access_token = _context10.sent.accessToken;
  11641. case 10:
  11642. if ("storage.uploadFile" === e) {
  11643. o = new FormData();
  11644. for (_e15 in o) {
  11645. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  11646. }
  11647. r = "multipart/form-data";
  11648. } else {
  11649. r = "application/json", o = {};
  11650. for (_e16 in i) {
  11651. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  11652. }
  11653. }
  11654. a = {
  11655. headers: {
  11656. "content-type": r
  11657. }
  11658. };
  11659. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  11660. c = this._localCache.getStore(s);
  11661. c && (a.headers["X-TCB-Trace"] = c);
  11662. u = t.parse, l = t.inQuery, h = t.search;
  11663. d = {
  11664. env: this.config.env
  11665. };
  11666. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  11667. p = function (e, t) {
  11668. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  11669. var s = /\?/.test(t);
  11670. var r = "";
  11671. for (var _e17 in n) {
  11672. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  11673. }
  11674. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  11675. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  11676. h && (p += h);
  11677. _context10.next = 22;
  11678. return this.post(_objectSpread({
  11679. url: p,
  11680. data: o
  11681. }, a));
  11682. case 22:
  11683. f = _context10.sent;
  11684. g = f.header && f.header["x-tcb-trace"];
  11685. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  11686. _context10.next = 26;
  11687. break;
  11688. }
  11689. throw new ne({
  11690. code: "NETWORK_ERROR",
  11691. message: "network request error"
  11692. });
  11693. case 26:
  11694. return _context10.abrupt("return", f);
  11695. case 27:
  11696. case "end":
  11697. return _context10.stop();
  11698. }
  11699. }
  11700. }, _callee10, this);
  11701. }));
  11702. function request(_x5, _x6, _x7) {
  11703. return _request.apply(this, arguments);
  11704. }
  11705. return request;
  11706. }()
  11707. }, {
  11708. key: "send",
  11709. value: function () {
  11710. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  11711. var t,
  11712. n,
  11713. _n6,
  11714. _args11 = arguments;
  11715. return _regenerator.default.wrap(function _callee11$(_context11) {
  11716. while (1) {
  11717. switch (_context11.prev = _context11.next) {
  11718. case 0:
  11719. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  11720. _context11.next = 3;
  11721. return this.request(e, t, {
  11722. onUploadProgress: t.onUploadProgress
  11723. });
  11724. case 3:
  11725. n = _context11.sent;
  11726. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  11727. _context11.next = 13;
  11728. break;
  11729. }
  11730. _context11.next = 7;
  11731. return this.refreshAccessToken();
  11732. case 7:
  11733. _context11.next = 9;
  11734. return this.request(e, t, {
  11735. onUploadProgress: t.onUploadProgress
  11736. });
  11737. case 9:
  11738. _n6 = _context11.sent;
  11739. if (!_n6.data.code) {
  11740. _context11.next = 12;
  11741. break;
  11742. }
  11743. throw new ne({
  11744. code: _n6.data.code,
  11745. message: _n6.data.message
  11746. });
  11747. case 12:
  11748. return _context11.abrupt("return", _n6.data);
  11749. case 13:
  11750. if (!n.data.code) {
  11751. _context11.next = 15;
  11752. break;
  11753. }
  11754. throw new ne({
  11755. code: n.data.code,
  11756. message: n.data.message
  11757. });
  11758. case 15:
  11759. return _context11.abrupt("return", n.data);
  11760. case 16:
  11761. case "end":
  11762. return _context11.stop();
  11763. }
  11764. }
  11765. }, _callee11, this);
  11766. }));
  11767. function send(_x8) {
  11768. return _send.apply(this, arguments);
  11769. }
  11770. return send;
  11771. }()
  11772. }, {
  11773. key: "setRefreshToken",
  11774. value: function setRefreshToken(e) {
  11775. var _this$_cache$keys3 = this._cache.keys,
  11776. t = _this$_cache$keys3.accessTokenKey,
  11777. n = _this$_cache$keys3.accessTokenExpireKey,
  11778. s = _this$_cache$keys3.refreshTokenKey;
  11779. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11780. }
  11781. }]);
  11782. return Ge;
  11783. }();
  11784. var Ve = {};
  11785. function Ye(e) {
  11786. return Ve[e];
  11787. }
  11788. var Qe = /*#__PURE__*/function () {
  11789. function Qe(e) {
  11790. (0, _classCallCheck2.default)(this, Qe);
  11791. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  11792. }
  11793. (0, _createClass2.default)(Qe, [{
  11794. key: "setRefreshToken",
  11795. value: function setRefreshToken(e) {
  11796. var _this$_cache$keys4 = this._cache.keys,
  11797. t = _this$_cache$keys4.accessTokenKey,
  11798. n = _this$_cache$keys4.accessTokenExpireKey,
  11799. s = _this$_cache$keys4.refreshTokenKey;
  11800. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11801. }
  11802. }, {
  11803. key: "setAccessToken",
  11804. value: function setAccessToken(e, t) {
  11805. var _this$_cache$keys5 = this._cache.keys,
  11806. n = _this$_cache$keys5.accessTokenKey,
  11807. s = _this$_cache$keys5.accessTokenExpireKey;
  11808. this._cache.setStore(n, e), this._cache.setStore(s, t);
  11809. }
  11810. }, {
  11811. key: "refreshUserInfo",
  11812. value: function () {
  11813. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  11814. var _yield$this$_request$, e;
  11815. return _regenerator.default.wrap(function _callee12$(_context12) {
  11816. while (1) {
  11817. switch (_context12.prev = _context12.next) {
  11818. case 0:
  11819. _context12.next = 2;
  11820. return this._request.send("auth.getUserInfo", {});
  11821. case 2:
  11822. _yield$this$_request$ = _context12.sent;
  11823. e = _yield$this$_request$.data;
  11824. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  11825. case 5:
  11826. case "end":
  11827. return _context12.stop();
  11828. }
  11829. }
  11830. }, _callee12, this);
  11831. }));
  11832. function refreshUserInfo() {
  11833. return _refreshUserInfo.apply(this, arguments);
  11834. }
  11835. return refreshUserInfo;
  11836. }()
  11837. }, {
  11838. key: "setLocalUserInfo",
  11839. value: function setLocalUserInfo(e) {
  11840. var t = this._cache.keys.userInfoKey;
  11841. this._cache.setStore(t, e);
  11842. }
  11843. }]);
  11844. return Qe;
  11845. }();
  11846. var Xe = /*#__PURE__*/function () {
  11847. function Xe(e) {
  11848. (0, _classCallCheck2.default)(this, Xe);
  11849. if (!e) throw new ne({
  11850. code: "PARAM_ERROR",
  11851. message: "envId is not defined"
  11852. });
  11853. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  11854. }
  11855. (0, _createClass2.default)(Xe, [{
  11856. key: "linkWithTicket",
  11857. value: function linkWithTicket(e) {
  11858. if ("string" != typeof e) throw new ne({
  11859. code: "PARAM_ERROR",
  11860. message: "ticket must be string"
  11861. });
  11862. return this._request.send("auth.linkWithTicket", {
  11863. ticket: e
  11864. });
  11865. }
  11866. }, {
  11867. key: "linkWithRedirect",
  11868. value: function linkWithRedirect(e) {
  11869. e.signInWithRedirect();
  11870. }
  11871. }, {
  11872. key: "updatePassword",
  11873. value: function updatePassword(e, t) {
  11874. return this._request.send("auth.updatePassword", {
  11875. oldPassword: t,
  11876. newPassword: e
  11877. });
  11878. }
  11879. }, {
  11880. key: "updateEmail",
  11881. value: function updateEmail(e) {
  11882. return this._request.send("auth.updateEmail", {
  11883. newEmail: e
  11884. });
  11885. }
  11886. }, {
  11887. key: "updateUsername",
  11888. value: function updateUsername(e) {
  11889. if ("string" != typeof e) throw new ne({
  11890. code: "PARAM_ERROR",
  11891. message: "username must be a string"
  11892. });
  11893. return this._request.send("auth.updateUsername", {
  11894. username: e
  11895. });
  11896. }
  11897. }, {
  11898. key: "getLinkedUidList",
  11899. value: function () {
  11900. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  11901. var _yield$this$_request$2, e, t, n;
  11902. return _regenerator.default.wrap(function _callee13$(_context13) {
  11903. while (1) {
  11904. switch (_context13.prev = _context13.next) {
  11905. case 0:
  11906. _context13.next = 2;
  11907. return this._request.send("auth.getLinkedUidList", {});
  11908. case 2:
  11909. _yield$this$_request$2 = _context13.sent;
  11910. e = _yield$this$_request$2.data;
  11911. t = !1;
  11912. n = e.users;
  11913. return _context13.abrupt("return", (n.forEach(function (e) {
  11914. e.wxOpenId && e.wxPublicId && (t = !0);
  11915. }), {
  11916. users: n,
  11917. hasPrimaryUid: t
  11918. }));
  11919. case 7:
  11920. case "end":
  11921. return _context13.stop();
  11922. }
  11923. }
  11924. }, _callee13, this);
  11925. }));
  11926. function getLinkedUidList() {
  11927. return _getLinkedUidList.apply(this, arguments);
  11928. }
  11929. return getLinkedUidList;
  11930. }()
  11931. }, {
  11932. key: "setPrimaryUid",
  11933. value: function setPrimaryUid(e) {
  11934. return this._request.send("auth.setPrimaryUid", {
  11935. uid: e
  11936. });
  11937. }
  11938. }, {
  11939. key: "unlink",
  11940. value: function unlink(e) {
  11941. return this._request.send("auth.unlink", {
  11942. platform: e
  11943. });
  11944. }
  11945. }, {
  11946. key: "update",
  11947. value: function () {
  11948. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  11949. var t, n, s, r, i, o, _yield$this$_request$3, a;
  11950. return _regenerator.default.wrap(function _callee14$(_context14) {
  11951. while (1) {
  11952. switch (_context14.prev = _context14.next) {
  11953. case 0:
  11954. t = e.nickName;
  11955. n = e.gender;
  11956. s = e.avatarUrl;
  11957. r = e.province;
  11958. i = e.country;
  11959. o = e.city;
  11960. _context14.next = 8;
  11961. return this._request.send("auth.updateUserInfo", {
  11962. nickName: t,
  11963. gender: n,
  11964. avatarUrl: s,
  11965. province: r,
  11966. country: i,
  11967. city: o
  11968. });
  11969. case 8:
  11970. _yield$this$_request$3 = _context14.sent;
  11971. a = _yield$this$_request$3.data;
  11972. this.setLocalUserInfo(a);
  11973. case 11:
  11974. case "end":
  11975. return _context14.stop();
  11976. }
  11977. }
  11978. }, _callee14, this);
  11979. }));
  11980. function update(_x9) {
  11981. return _update.apply(this, arguments);
  11982. }
  11983. return update;
  11984. }()
  11985. }, {
  11986. key: "refresh",
  11987. value: function () {
  11988. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  11989. var _yield$this$_request$4, e;
  11990. return _regenerator.default.wrap(function _callee15$(_context15) {
  11991. while (1) {
  11992. switch (_context15.prev = _context15.next) {
  11993. case 0:
  11994. _context15.next = 2;
  11995. return this._request.send("auth.getUserInfo", {});
  11996. case 2:
  11997. _yield$this$_request$4 = _context15.sent;
  11998. e = _yield$this$_request$4.data;
  11999. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  12000. case 5:
  12001. case "end":
  12002. return _context15.stop();
  12003. }
  12004. }
  12005. }, _callee15, this);
  12006. }));
  12007. function refresh() {
  12008. return _refresh.apply(this, arguments);
  12009. }
  12010. return refresh;
  12011. }()
  12012. }, {
  12013. key: "setUserInfo",
  12014. value: function setUserInfo() {
  12015. var _this8 = this;
  12016. var e = this._cache.keys.userInfoKey,
  12017. t = this._cache.getStore(e);
  12018. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  12019. _this8[e] = t[e];
  12020. }), this.location = {
  12021. country: t.country,
  12022. province: t.province,
  12023. city: t.city
  12024. };
  12025. }
  12026. }, {
  12027. key: "setLocalUserInfo",
  12028. value: function setLocalUserInfo(e) {
  12029. var t = this._cache.keys.userInfoKey;
  12030. this._cache.setStore(t, e), this.setUserInfo();
  12031. }
  12032. }]);
  12033. return Xe;
  12034. }();
  12035. var Ze = /*#__PURE__*/function () {
  12036. function Ze(e) {
  12037. (0, _classCallCheck2.default)(this, Ze);
  12038. if (!e) throw new ne({
  12039. code: "PARAM_ERROR",
  12040. message: "envId is not defined"
  12041. });
  12042. this._cache = xe(e);
  12043. var _this$_cache$keys6 = this._cache.keys,
  12044. t = _this$_cache$keys6.refreshTokenKey,
  12045. n = _this$_cache$keys6.accessTokenKey,
  12046. s = _this$_cache$keys6.accessTokenExpireKey,
  12047. r = this._cache.getStore(t),
  12048. i = this._cache.getStore(n),
  12049. o = this._cache.getStore(s);
  12050. this.credential = {
  12051. refreshToken: r,
  12052. accessToken: i,
  12053. accessTokenExpire: o
  12054. }, this.user = new Xe(e);
  12055. }
  12056. (0, _createClass2.default)(Ze, [{
  12057. key: "isAnonymousAuth",
  12058. get: function get() {
  12059. return this.loginType === $e.ANONYMOUS;
  12060. }
  12061. }, {
  12062. key: "isCustomAuth",
  12063. get: function get() {
  12064. return this.loginType === $e.CUSTOM;
  12065. }
  12066. }, {
  12067. key: "isWeixinAuth",
  12068. get: function get() {
  12069. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  12070. }
  12071. }, {
  12072. key: "loginType",
  12073. get: function get() {
  12074. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12075. }
  12076. }]);
  12077. return Ze;
  12078. }();
  12079. var et = /*#__PURE__*/function (_Qe) {
  12080. (0, _inherits2.default)(et, _Qe);
  12081. var _super4 = _createSuper(et);
  12082. function et() {
  12083. (0, _classCallCheck2.default)(this, et);
  12084. return _super4.apply(this, arguments);
  12085. }
  12086. (0, _createClass2.default)(et, [{
  12087. key: "signIn",
  12088. value: function () {
  12089. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12090. var _this$_cache$keys7, e, t, n, s, r, _e18;
  12091. return _regenerator.default.wrap(function _callee16$(_context16) {
  12092. while (1) {
  12093. switch (_context16.prev = _context16.next) {
  12094. case 0:
  12095. this._cache.updatePersistence("local");
  12096. _this$_cache$keys7 = this._cache.keys;
  12097. e = _this$_cache$keys7.anonymousUuidKey;
  12098. t = _this$_cache$keys7.refreshTokenKey;
  12099. n = this._cache.getStore(e) || void 0;
  12100. s = this._cache.getStore(t) || void 0;
  12101. _context16.next = 8;
  12102. return this._request.send("auth.signInAnonymously", {
  12103. anonymous_uuid: n,
  12104. refresh_token: s
  12105. });
  12106. case 8:
  12107. r = _context16.sent;
  12108. if (!(r.uuid && r.refresh_token)) {
  12109. _context16.next = 20;
  12110. break;
  12111. }
  12112. this._setAnonymousUUID(r.uuid);
  12113. this.setRefreshToken(r.refresh_token);
  12114. _context16.next = 14;
  12115. return this._request.refreshAccessToken();
  12116. case 14:
  12117. De(qe);
  12118. De(Me, {
  12119. env: this.config.env,
  12120. loginType: $e.ANONYMOUS,
  12121. persistence: "local"
  12122. });
  12123. _e18 = new Ze(this.config.env);
  12124. _context16.next = 19;
  12125. return _e18.user.refresh();
  12126. case 19:
  12127. return _context16.abrupt("return", _e18);
  12128. case 20:
  12129. throw new ne({
  12130. message: "匿名登录失败"
  12131. });
  12132. case 21:
  12133. case "end":
  12134. return _context16.stop();
  12135. }
  12136. }
  12137. }, _callee16, this);
  12138. }));
  12139. function signIn() {
  12140. return _signIn.apply(this, arguments);
  12141. }
  12142. return signIn;
  12143. }()
  12144. }, {
  12145. key: "linkAndRetrieveDataWithTicket",
  12146. value: function () {
  12147. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12148. var _this$_cache$keys8, t, n, s, r, i;
  12149. return _regenerator.default.wrap(function _callee17$(_context17) {
  12150. while (1) {
  12151. switch (_context17.prev = _context17.next) {
  12152. case 0:
  12153. _this$_cache$keys8 = this._cache.keys;
  12154. t = _this$_cache$keys8.anonymousUuidKey;
  12155. n = _this$_cache$keys8.refreshTokenKey;
  12156. s = this._cache.getStore(t);
  12157. r = this._cache.getStore(n);
  12158. _context17.next = 7;
  12159. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12160. anonymous_uuid: s,
  12161. refresh_token: r,
  12162. ticket: e
  12163. });
  12164. case 7:
  12165. i = _context17.sent;
  12166. if (!i.refresh_token) {
  12167. _context17.next = 16;
  12168. break;
  12169. }
  12170. this._clearAnonymousUUID();
  12171. this.setRefreshToken(i.refresh_token);
  12172. _context17.next = 13;
  12173. return this._request.refreshAccessToken();
  12174. case 13:
  12175. De(je, {
  12176. env: this.config.env
  12177. });
  12178. De(Me, {
  12179. loginType: $e.CUSTOM,
  12180. persistence: "local"
  12181. });
  12182. return _context17.abrupt("return", {
  12183. credential: {
  12184. refreshToken: i.refresh_token
  12185. }
  12186. });
  12187. case 16:
  12188. throw new ne({
  12189. message: "匿名转化失败"
  12190. });
  12191. case 17:
  12192. case "end":
  12193. return _context17.stop();
  12194. }
  12195. }
  12196. }, _callee17, this);
  12197. }));
  12198. function linkAndRetrieveDataWithTicket(_x10) {
  12199. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  12200. }
  12201. return linkAndRetrieveDataWithTicket;
  12202. }()
  12203. }, {
  12204. key: "_setAnonymousUUID",
  12205. value: function _setAnonymousUUID(e) {
  12206. var _this$_cache$keys9 = this._cache.keys,
  12207. t = _this$_cache$keys9.anonymousUuidKey,
  12208. n = _this$_cache$keys9.loginTypeKey;
  12209. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  12210. }
  12211. }, {
  12212. key: "_clearAnonymousUUID",
  12213. value: function _clearAnonymousUUID() {
  12214. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12215. }
  12216. }]);
  12217. return et;
  12218. }(Qe);
  12219. var tt = /*#__PURE__*/function (_Qe2) {
  12220. (0, _inherits2.default)(tt, _Qe2);
  12221. var _super5 = _createSuper(tt);
  12222. function tt() {
  12223. (0, _classCallCheck2.default)(this, tt);
  12224. return _super5.apply(this, arguments);
  12225. }
  12226. (0, _createClass2.default)(tt, [{
  12227. key: "signIn",
  12228. value: function () {
  12229. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  12230. var t, n;
  12231. return _regenerator.default.wrap(function _callee18$(_context18) {
  12232. while (1) {
  12233. switch (_context18.prev = _context18.next) {
  12234. case 0:
  12235. if (!("string" != typeof e)) {
  12236. _context18.next = 2;
  12237. break;
  12238. }
  12239. throw new ne({
  12240. code: "PARAM_ERROR",
  12241. message: "ticket must be a string"
  12242. });
  12243. case 2:
  12244. t = this._cache.keys.refreshTokenKey;
  12245. _context18.next = 5;
  12246. return this._request.send("auth.signInWithTicket", {
  12247. ticket: e,
  12248. refresh_token: this._cache.getStore(t) || ""
  12249. });
  12250. case 5:
  12251. n = _context18.sent;
  12252. if (!n.refresh_token) {
  12253. _context18.next = 15;
  12254. break;
  12255. }
  12256. this.setRefreshToken(n.refresh_token);
  12257. _context18.next = 10;
  12258. return this._request.refreshAccessToken();
  12259. case 10:
  12260. De(qe);
  12261. De(Me, {
  12262. env: this.config.env,
  12263. loginType: $e.CUSTOM,
  12264. persistence: this.config.persistence
  12265. });
  12266. _context18.next = 14;
  12267. return this.refreshUserInfo();
  12268. case 14:
  12269. return _context18.abrupt("return", new Ze(this.config.env));
  12270. case 15:
  12271. throw new ne({
  12272. message: "自定义登录失败"
  12273. });
  12274. case 16:
  12275. case "end":
  12276. return _context18.stop();
  12277. }
  12278. }
  12279. }, _callee18, this);
  12280. }));
  12281. function signIn(_x11) {
  12282. return _signIn2.apply(this, arguments);
  12283. }
  12284. return signIn;
  12285. }()
  12286. }]);
  12287. return tt;
  12288. }(Qe);
  12289. var nt = /*#__PURE__*/function (_Qe3) {
  12290. (0, _inherits2.default)(nt, _Qe3);
  12291. var _super6 = _createSuper(nt);
  12292. function nt() {
  12293. (0, _classCallCheck2.default)(this, nt);
  12294. return _super6.apply(this, arguments);
  12295. }
  12296. (0, _createClass2.default)(nt, [{
  12297. key: "signIn",
  12298. value: function () {
  12299. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  12300. var n, s, r, i, o;
  12301. return _regenerator.default.wrap(function _callee19$(_context19) {
  12302. while (1) {
  12303. switch (_context19.prev = _context19.next) {
  12304. case 0:
  12305. if (!("string" != typeof e)) {
  12306. _context19.next = 2;
  12307. break;
  12308. }
  12309. throw new ne({
  12310. code: "PARAM_ERROR",
  12311. message: "email must be a string"
  12312. });
  12313. case 2:
  12314. n = this._cache.keys.refreshTokenKey;
  12315. _context19.next = 5;
  12316. return this._request.send("auth.signIn", {
  12317. loginType: "EMAIL",
  12318. email: e,
  12319. password: t,
  12320. refresh_token: this._cache.getStore(n) || ""
  12321. });
  12322. case 5:
  12323. s = _context19.sent;
  12324. r = s.refresh_token;
  12325. i = s.access_token;
  12326. o = s.access_token_expire;
  12327. if (!r) {
  12328. _context19.next = 22;
  12329. break;
  12330. }
  12331. this.setRefreshToken(r);
  12332. if (!(i && o)) {
  12333. _context19.next = 15;
  12334. break;
  12335. }
  12336. this.setAccessToken(i, o);
  12337. _context19.next = 17;
  12338. break;
  12339. case 15:
  12340. _context19.next = 17;
  12341. return this._request.refreshAccessToken();
  12342. case 17:
  12343. _context19.next = 19;
  12344. return this.refreshUserInfo();
  12345. case 19:
  12346. De(qe);
  12347. De(Me, {
  12348. env: this.config.env,
  12349. loginType: $e.EMAIL,
  12350. persistence: this.config.persistence
  12351. });
  12352. return _context19.abrupt("return", new Ze(this.config.env));
  12353. case 22:
  12354. throw s.code ? new ne({
  12355. code: s.code,
  12356. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12357. }) : new ne({
  12358. message: "邮箱登录失败"
  12359. });
  12360. case 23:
  12361. case "end":
  12362. return _context19.stop();
  12363. }
  12364. }
  12365. }, _callee19, this);
  12366. }));
  12367. function signIn(_x12, _x13) {
  12368. return _signIn3.apply(this, arguments);
  12369. }
  12370. return signIn;
  12371. }()
  12372. }, {
  12373. key: "activate",
  12374. value: function () {
  12375. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  12376. return _regenerator.default.wrap(function _callee20$(_context20) {
  12377. while (1) {
  12378. switch (_context20.prev = _context20.next) {
  12379. case 0:
  12380. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  12381. token: e
  12382. }));
  12383. case 1:
  12384. case "end":
  12385. return _context20.stop();
  12386. }
  12387. }
  12388. }, _callee20, this);
  12389. }));
  12390. function activate(_x14) {
  12391. return _activate.apply(this, arguments);
  12392. }
  12393. return activate;
  12394. }()
  12395. }, {
  12396. key: "resetPasswordWithToken",
  12397. value: function () {
  12398. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  12399. return _regenerator.default.wrap(function _callee21$(_context21) {
  12400. while (1) {
  12401. switch (_context21.prev = _context21.next) {
  12402. case 0:
  12403. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  12404. token: e,
  12405. newPassword: t
  12406. }));
  12407. case 1:
  12408. case "end":
  12409. return _context21.stop();
  12410. }
  12411. }
  12412. }, _callee21, this);
  12413. }));
  12414. function resetPasswordWithToken(_x15, _x16) {
  12415. return _resetPasswordWithToken.apply(this, arguments);
  12416. }
  12417. return resetPasswordWithToken;
  12418. }()
  12419. }]);
  12420. return nt;
  12421. }(Qe);
  12422. var st = /*#__PURE__*/function (_Qe4) {
  12423. (0, _inherits2.default)(st, _Qe4);
  12424. var _super7 = _createSuper(st);
  12425. function st() {
  12426. (0, _classCallCheck2.default)(this, st);
  12427. return _super7.apply(this, arguments);
  12428. }
  12429. (0, _createClass2.default)(st, [{
  12430. key: "signIn",
  12431. value: function () {
  12432. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  12433. var n, s, r, i, o;
  12434. return _regenerator.default.wrap(function _callee22$(_context22) {
  12435. while (1) {
  12436. switch (_context22.prev = _context22.next) {
  12437. case 0:
  12438. if (!("string" != typeof e)) {
  12439. _context22.next = 2;
  12440. break;
  12441. }
  12442. throw new ne({
  12443. code: "PARAM_ERROR",
  12444. message: "username must be a string"
  12445. });
  12446. case 2:
  12447. "string" != typeof t && (t = "", console.warn("password is empty"));
  12448. n = this._cache.keys.refreshTokenKey;
  12449. _context22.next = 6;
  12450. return this._request.send("auth.signIn", {
  12451. loginType: $e.USERNAME,
  12452. username: e,
  12453. password: t,
  12454. refresh_token: this._cache.getStore(n) || ""
  12455. });
  12456. case 6:
  12457. s = _context22.sent;
  12458. r = s.refresh_token;
  12459. i = s.access_token_expire;
  12460. o = s.access_token;
  12461. if (!r) {
  12462. _context22.next = 23;
  12463. break;
  12464. }
  12465. this.setRefreshToken(r);
  12466. if (!(o && i)) {
  12467. _context22.next = 16;
  12468. break;
  12469. }
  12470. this.setAccessToken(o, i);
  12471. _context22.next = 18;
  12472. break;
  12473. case 16:
  12474. _context22.next = 18;
  12475. return this._request.refreshAccessToken();
  12476. case 18:
  12477. _context22.next = 20;
  12478. return this.refreshUserInfo();
  12479. case 20:
  12480. De(qe);
  12481. De(Me, {
  12482. env: this.config.env,
  12483. loginType: $e.USERNAME,
  12484. persistence: this.config.persistence
  12485. });
  12486. return _context22.abrupt("return", new Ze(this.config.env));
  12487. case 23:
  12488. throw s.code ? new ne({
  12489. code: s.code,
  12490. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12491. }) : new ne({
  12492. message: "用户名密码登录失败"
  12493. });
  12494. case 24:
  12495. case "end":
  12496. return _context22.stop();
  12497. }
  12498. }
  12499. }, _callee22, this);
  12500. }));
  12501. function signIn(_x17, _x18) {
  12502. return _signIn4.apply(this, arguments);
  12503. }
  12504. return signIn;
  12505. }()
  12506. }]);
  12507. return st;
  12508. }(Qe);
  12509. var rt = /*#__PURE__*/function () {
  12510. function rt(e) {
  12511. (0, _classCallCheck2.default)(this, rt);
  12512. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Me, this._onLoginTypeChanged);
  12513. }
  12514. (0, _createClass2.default)(rt, [{
  12515. key: "currentUser",
  12516. get: function get() {
  12517. var e = this.hasLoginState();
  12518. return e && e.user || null;
  12519. }
  12520. }, {
  12521. key: "loginType",
  12522. get: function get() {
  12523. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12524. }
  12525. }, {
  12526. key: "anonymousAuthProvider",
  12527. value: function anonymousAuthProvider() {
  12528. return new et(this.config);
  12529. }
  12530. }, {
  12531. key: "customAuthProvider",
  12532. value: function customAuthProvider() {
  12533. return new tt(this.config);
  12534. }
  12535. }, {
  12536. key: "emailAuthProvider",
  12537. value: function emailAuthProvider() {
  12538. return new nt(this.config);
  12539. }
  12540. }, {
  12541. key: "usernameAuthProvider",
  12542. value: function usernameAuthProvider() {
  12543. return new st(this.config);
  12544. }
  12545. }, {
  12546. key: "signInAnonymously",
  12547. value: function () {
  12548. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  12549. return _regenerator.default.wrap(function _callee23$(_context23) {
  12550. while (1) {
  12551. switch (_context23.prev = _context23.next) {
  12552. case 0:
  12553. return _context23.abrupt("return", new et(this.config).signIn());
  12554. case 1:
  12555. case "end":
  12556. return _context23.stop();
  12557. }
  12558. }
  12559. }, _callee23, this);
  12560. }));
  12561. function signInAnonymously() {
  12562. return _signInAnonymously.apply(this, arguments);
  12563. }
  12564. return signInAnonymously;
  12565. }()
  12566. }, {
  12567. key: "signInWithEmailAndPassword",
  12568. value: function () {
  12569. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  12570. return _regenerator.default.wrap(function _callee24$(_context24) {
  12571. while (1) {
  12572. switch (_context24.prev = _context24.next) {
  12573. case 0:
  12574. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  12575. case 1:
  12576. case "end":
  12577. return _context24.stop();
  12578. }
  12579. }
  12580. }, _callee24, this);
  12581. }));
  12582. function signInWithEmailAndPassword(_x19, _x20) {
  12583. return _signInWithEmailAndPassword.apply(this, arguments);
  12584. }
  12585. return signInWithEmailAndPassword;
  12586. }()
  12587. }, {
  12588. key: "signInWithUsernameAndPassword",
  12589. value: function signInWithUsernameAndPassword(e, t) {
  12590. return new st(this.config).signIn(e, t);
  12591. }
  12592. }, {
  12593. key: "linkAndRetrieveDataWithTicket",
  12594. value: function () {
  12595. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  12596. return _regenerator.default.wrap(function _callee25$(_context25) {
  12597. while (1) {
  12598. switch (_context25.prev = _context25.next) {
  12599. case 0:
  12600. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  12601. _context25.next = 3;
  12602. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  12603. case 3:
  12604. return _context25.abrupt("return", _context25.sent);
  12605. case 4:
  12606. case "end":
  12607. return _context25.stop();
  12608. }
  12609. }
  12610. }, _callee25, this);
  12611. }));
  12612. function linkAndRetrieveDataWithTicket(_x21) {
  12613. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  12614. }
  12615. return linkAndRetrieveDataWithTicket;
  12616. }()
  12617. }, {
  12618. key: "signOut",
  12619. value: function () {
  12620. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  12621. var _this$_cache$keys10, e, t, n, s, r;
  12622. return _regenerator.default.wrap(function _callee26$(_context26) {
  12623. while (1) {
  12624. switch (_context26.prev = _context26.next) {
  12625. case 0:
  12626. if (!(this.loginType === $e.ANONYMOUS)) {
  12627. _context26.next = 2;
  12628. break;
  12629. }
  12630. throw new ne({
  12631. message: "匿名用户不支持登出操作"
  12632. });
  12633. case 2:
  12634. _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);
  12635. if (s) {
  12636. _context26.next = 5;
  12637. break;
  12638. }
  12639. return _context26.abrupt("return");
  12640. case 5:
  12641. _context26.next = 7;
  12642. return this._request.send("auth.logout", {
  12643. refresh_token: s
  12644. });
  12645. case 7:
  12646. r = _context26.sent;
  12647. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Me, {
  12648. env: this.config.env,
  12649. loginType: $e.NULL,
  12650. persistence: this.config.persistence
  12651. }), r));
  12652. case 9:
  12653. case "end":
  12654. return _context26.stop();
  12655. }
  12656. }
  12657. }, _callee26, this);
  12658. }));
  12659. function signOut() {
  12660. return _signOut.apply(this, arguments);
  12661. }
  12662. return signOut;
  12663. }()
  12664. }, {
  12665. key: "signUpWithEmailAndPassword",
  12666. value: function () {
  12667. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  12668. return _regenerator.default.wrap(function _callee27$(_context27) {
  12669. while (1) {
  12670. switch (_context27.prev = _context27.next) {
  12671. case 0:
  12672. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  12673. email: e,
  12674. password: t
  12675. }));
  12676. case 1:
  12677. case "end":
  12678. return _context27.stop();
  12679. }
  12680. }
  12681. }, _callee27, this);
  12682. }));
  12683. function signUpWithEmailAndPassword(_x22, _x23) {
  12684. return _signUpWithEmailAndPassword.apply(this, arguments);
  12685. }
  12686. return signUpWithEmailAndPassword;
  12687. }()
  12688. }, {
  12689. key: "sendPasswordResetEmail",
  12690. value: function () {
  12691. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  12692. return _regenerator.default.wrap(function _callee28$(_context28) {
  12693. while (1) {
  12694. switch (_context28.prev = _context28.next) {
  12695. case 0:
  12696. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  12697. email: e
  12698. }));
  12699. case 1:
  12700. case "end":
  12701. return _context28.stop();
  12702. }
  12703. }
  12704. }, _callee28, this);
  12705. }));
  12706. function sendPasswordResetEmail(_x24) {
  12707. return _sendPasswordResetEmail.apply(this, arguments);
  12708. }
  12709. return sendPasswordResetEmail;
  12710. }()
  12711. }, {
  12712. key: "onLoginStateChanged",
  12713. value: function onLoginStateChanged(e) {
  12714. var _this9 = this;
  12715. Ne(qe, function () {
  12716. var t = _this9.hasLoginState();
  12717. e.call(_this9, t);
  12718. });
  12719. var t = this.hasLoginState();
  12720. e.call(this, t);
  12721. }
  12722. }, {
  12723. key: "onLoginStateExpired",
  12724. value: function onLoginStateExpired(e) {
  12725. Ne(Ke, e.bind(this));
  12726. }
  12727. }, {
  12728. key: "onAccessTokenRefreshed",
  12729. value: function onAccessTokenRefreshed(e) {
  12730. Ne(Be, e.bind(this));
  12731. }
  12732. }, {
  12733. key: "onAnonymousConverted",
  12734. value: function onAnonymousConverted(e) {
  12735. Ne(je, e.bind(this));
  12736. }
  12737. }, {
  12738. key: "onLoginTypeChanged",
  12739. value: function onLoginTypeChanged(e) {
  12740. var _this10 = this;
  12741. Ne(Me, function () {
  12742. var t = _this10.hasLoginState();
  12743. e.call(_this10, t);
  12744. });
  12745. }
  12746. }, {
  12747. key: "getAccessToken",
  12748. value: function () {
  12749. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  12750. return _regenerator.default.wrap(function _callee29$(_context29) {
  12751. while (1) {
  12752. switch (_context29.prev = _context29.next) {
  12753. case 0:
  12754. _context29.next = 2;
  12755. return this._request.getAccessToken();
  12756. case 2:
  12757. _context29.t0 = _context29.sent.accessToken;
  12758. _context29.t1 = this.config.env;
  12759. return _context29.abrupt("return", {
  12760. accessToken: _context29.t0,
  12761. env: _context29.t1
  12762. });
  12763. case 5:
  12764. case "end":
  12765. return _context29.stop();
  12766. }
  12767. }
  12768. }, _callee29, this);
  12769. }));
  12770. function getAccessToken() {
  12771. return _getAccessToken2.apply(this, arguments);
  12772. }
  12773. return getAccessToken;
  12774. }()
  12775. }, {
  12776. key: "hasLoginState",
  12777. value: function hasLoginState() {
  12778. var e = this._cache.keys.refreshTokenKey;
  12779. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  12780. }
  12781. }, {
  12782. key: "isUsernameRegistered",
  12783. value: function () {
  12784. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  12785. var _yield$this$_request$5, t;
  12786. return _regenerator.default.wrap(function _callee30$(_context30) {
  12787. while (1) {
  12788. switch (_context30.prev = _context30.next) {
  12789. case 0:
  12790. if (!("string" != typeof e)) {
  12791. _context30.next = 2;
  12792. break;
  12793. }
  12794. throw new ne({
  12795. code: "PARAM_ERROR",
  12796. message: "username must be a string"
  12797. });
  12798. case 2:
  12799. _context30.next = 4;
  12800. return this._request.send("auth.isUsernameRegistered", {
  12801. username: e
  12802. });
  12803. case 4:
  12804. _yield$this$_request$5 = _context30.sent;
  12805. t = _yield$this$_request$5.data;
  12806. return _context30.abrupt("return", t && t.isRegistered);
  12807. case 7:
  12808. case "end":
  12809. return _context30.stop();
  12810. }
  12811. }
  12812. }, _callee30, this);
  12813. }));
  12814. function isUsernameRegistered(_x25) {
  12815. return _isUsernameRegistered.apply(this, arguments);
  12816. }
  12817. return isUsernameRegistered;
  12818. }()
  12819. }, {
  12820. key: "getLoginState",
  12821. value: function getLoginState() {
  12822. return Promise.resolve(this.hasLoginState());
  12823. }
  12824. }, {
  12825. key: "signInWithTicket",
  12826. value: function () {
  12827. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  12828. return _regenerator.default.wrap(function _callee31$(_context31) {
  12829. while (1) {
  12830. switch (_context31.prev = _context31.next) {
  12831. case 0:
  12832. return _context31.abrupt("return", new tt(this.config).signIn(e));
  12833. case 1:
  12834. case "end":
  12835. return _context31.stop();
  12836. }
  12837. }
  12838. }, _callee31, this);
  12839. }));
  12840. function signInWithTicket(_x26) {
  12841. return _signInWithTicket.apply(this, arguments);
  12842. }
  12843. return signInWithTicket;
  12844. }()
  12845. }, {
  12846. key: "shouldRefreshAccessToken",
  12847. value: function shouldRefreshAccessToken(e) {
  12848. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  12849. }
  12850. }, {
  12851. key: "getUserInfo",
  12852. value: function getUserInfo() {
  12853. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  12854. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  12855. requestId: e.seqId
  12856. });
  12857. });
  12858. }
  12859. }, {
  12860. key: "getAuthHeader",
  12861. value: function getAuthHeader() {
  12862. var _this$_cache$keys11 = this._cache.keys,
  12863. e = _this$_cache$keys11.refreshTokenKey,
  12864. t = _this$_cache$keys11.accessTokenKey,
  12865. n = this._cache.getStore(e);
  12866. return {
  12867. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  12868. };
  12869. }
  12870. }, {
  12871. key: "_onAnonymousConverted",
  12872. value: function _onAnonymousConverted(e) {
  12873. var t = e.data.env;
  12874. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  12875. }
  12876. }, {
  12877. key: "_onLoginTypeChanged",
  12878. value: function _onLoginTypeChanged(e) {
  12879. var _e$data = e.data,
  12880. t = _e$data.loginType,
  12881. n = _e$data.persistence,
  12882. s = _e$data.env;
  12883. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  12884. }
  12885. }]);
  12886. return rt;
  12887. }();
  12888. var it = function it(e, t) {
  12889. t = t || we();
  12890. var n = Ye(this.config.env),
  12891. s = e.cloudPath,
  12892. r = e.filePath,
  12893. i = e.onUploadProgress,
  12894. _e$fileType = e.fileType,
  12895. o = _e$fileType === void 0 ? "image" : _e$fileType;
  12896. return n.send("storage.getUploadMetadata", {
  12897. path: s
  12898. }).then(function (e) {
  12899. var _e$data2 = e.data,
  12900. a = _e$data2.url,
  12901. c = _e$data2.authorization,
  12902. u = _e$data2.token,
  12903. l = _e$data2.fileId,
  12904. h = _e$data2.cosFileId,
  12905. d = e.requestId,
  12906. p = {
  12907. key: s,
  12908. signature: c,
  12909. "x-cos-meta-fileid": h,
  12910. success_action_status: "201",
  12911. "x-cos-security-token": u
  12912. };
  12913. n.upload({
  12914. url: a,
  12915. data: p,
  12916. file: r,
  12917. name: s,
  12918. fileType: o,
  12919. onUploadProgress: i
  12920. }).then(function (e) {
  12921. 201 === e.statusCode ? t(null, {
  12922. fileID: l,
  12923. requestId: d
  12924. }) : t(new ne({
  12925. code: "STORAGE_REQUEST_FAIL",
  12926. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  12927. }));
  12928. }).catch(function (e) {
  12929. t(e);
  12930. });
  12931. }).catch(function (e) {
  12932. t(e);
  12933. }), t.promise;
  12934. },
  12935. ot = function ot(e, t) {
  12936. t = t || we();
  12937. var n = Ye(this.config.env),
  12938. s = e.cloudPath;
  12939. return n.send("storage.getUploadMetadata", {
  12940. path: s
  12941. }).then(function (e) {
  12942. t(null, e);
  12943. }).catch(function (e) {
  12944. t(e);
  12945. }), t.promise;
  12946. },
  12947. at = function at(_ref7, t) {
  12948. var e = _ref7.fileList;
  12949. if (t = t || we(), !e || !Array.isArray(e)) return {
  12950. code: "INVALID_PARAM",
  12951. message: "fileList必须是非空的数组"
  12952. };
  12953. var _iterator3 = _createForOfIteratorHelper(e),
  12954. _step3;
  12955. try {
  12956. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  12957. var _t8 = _step3.value;
  12958. if (!_t8 || "string" != typeof _t8) return {
  12959. code: "INVALID_PARAM",
  12960. message: "fileList的元素必须是非空的字符串"
  12961. };
  12962. }
  12963. } catch (err) {
  12964. _iterator3.e(err);
  12965. } finally {
  12966. _iterator3.f();
  12967. }
  12968. var n = {
  12969. fileid_list: e
  12970. };
  12971. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  12972. e.code ? t(null, e) : t(null, {
  12973. fileList: e.data.delete_list,
  12974. requestId: e.requestId
  12975. });
  12976. }).catch(function (e) {
  12977. t(e);
  12978. }), t.promise;
  12979. },
  12980. ct = function ct(_ref8, t) {
  12981. var e = _ref8.fileList;
  12982. t = t || we(), e && Array.isArray(e) || t(null, {
  12983. code: "INVALID_PARAM",
  12984. message: "fileList必须是非空的数组"
  12985. });
  12986. var n = [];
  12987. var _iterator4 = _createForOfIteratorHelper(e),
  12988. _step4;
  12989. try {
  12990. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  12991. var _s9 = _step4.value;
  12992. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  12993. code: "INVALID_PARAM",
  12994. message: "fileList的元素必须是包含fileID和maxAge的对象"
  12995. }), n.push({
  12996. fileid: _s9.fileID,
  12997. max_age: _s9.maxAge
  12998. })) : "string" == typeof _s9 ? n.push({
  12999. fileid: _s9
  13000. }) : t(null, {
  13001. code: "INVALID_PARAM",
  13002. message: "fileList的元素必须是字符串"
  13003. });
  13004. }
  13005. } catch (err) {
  13006. _iterator4.e(err);
  13007. } finally {
  13008. _iterator4.f();
  13009. }
  13010. var s = {
  13011. file_list: n
  13012. };
  13013. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  13014. e.code ? t(null, e) : t(null, {
  13015. fileList: e.data.download_list,
  13016. requestId: e.requestId
  13017. });
  13018. }).catch(function (e) {
  13019. t(e);
  13020. }), t.promise;
  13021. },
  13022. ut = /*#__PURE__*/function () {
  13023. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  13024. var e, n, s, r;
  13025. return _regenerator.default.wrap(function _callee32$(_context32) {
  13026. while (1) {
  13027. switch (_context32.prev = _context32.next) {
  13028. case 0:
  13029. e = _ref9.fileID;
  13030. _context32.next = 3;
  13031. return ct.call(this, {
  13032. fileList: [{
  13033. fileID: e,
  13034. maxAge: 600
  13035. }]
  13036. });
  13037. case 3:
  13038. n = _context32.sent.fileList[0];
  13039. if (!("SUCCESS" !== n.code)) {
  13040. _context32.next = 6;
  13041. break;
  13042. }
  13043. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13044. e(n);
  13045. }));
  13046. case 6:
  13047. s = Ye(this.config.env);
  13048. r = n.download_url;
  13049. if (!(r = encodeURI(r), !t)) {
  13050. _context32.next = 10;
  13051. break;
  13052. }
  13053. return _context32.abrupt("return", s.download({
  13054. url: r
  13055. }));
  13056. case 10:
  13057. _context32.t0 = t;
  13058. _context32.next = 13;
  13059. return s.download({
  13060. url: r
  13061. });
  13062. case 13:
  13063. _context32.t1 = _context32.sent;
  13064. (0, _context32.t0)(_context32.t1);
  13065. case 15:
  13066. case "end":
  13067. return _context32.stop();
  13068. }
  13069. }
  13070. }, _callee32, this);
  13071. }));
  13072. return function ut(_x27, _x28) {
  13073. return _ref10.apply(this, arguments);
  13074. };
  13075. }(),
  13076. lt = function lt(_ref11, i) {
  13077. var e = _ref11.name,
  13078. t = _ref11.data,
  13079. n = _ref11.query,
  13080. s = _ref11.parse,
  13081. r = _ref11.search;
  13082. var o = i || we();
  13083. var a;
  13084. try {
  13085. a = t ? JSON.stringify(t) : "";
  13086. } catch (e) {
  13087. return Promise.reject(e);
  13088. }
  13089. if (!e) return Promise.reject(new ne({
  13090. code: "PARAM_ERROR",
  13091. message: "函数名不能为空"
  13092. }));
  13093. var c = {
  13094. inQuery: n,
  13095. parse: s,
  13096. search: r,
  13097. function_name: e,
  13098. request_data: a
  13099. };
  13100. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13101. if (e.code) o(null, e);else {
  13102. var _t9 = e.data.response_data;
  13103. if (s) o(null, {
  13104. result: _t9,
  13105. requestId: e.requestId
  13106. });else try {
  13107. _t9 = JSON.parse(e.data.response_data), o(null, {
  13108. result: _t9,
  13109. requestId: e.requestId
  13110. });
  13111. } catch (e) {
  13112. o(new ne({
  13113. message: "response data must be json"
  13114. }));
  13115. }
  13116. }
  13117. return o.promise;
  13118. }).catch(function (e) {
  13119. o(e);
  13120. }), o.promise;
  13121. },
  13122. ht = {
  13123. timeout: 15e3,
  13124. persistence: "session"
  13125. },
  13126. dt = {};
  13127. var pt = /*#__PURE__*/function () {
  13128. function pt(e) {
  13129. (0, _classCallCheck2.default)(this, pt);
  13130. this.config = e || this.config, this.authObj = void 0;
  13131. }
  13132. (0, _createClass2.default)(pt, [{
  13133. key: "init",
  13134. value: function init(e) {
  13135. switch (Ie.adapter || (this.requestClient = new Ie.adapter.reqClass({
  13136. timeout: e.timeout || 5e3,
  13137. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13138. })), this.config = _objectSpread(_objectSpread({}, ht), e), !0) {
  13139. case this.config.timeout > 6e5:
  13140. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13141. break;
  13142. case this.config.timeout < 100:
  13143. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13144. }
  13145. return new pt(this.config);
  13146. }
  13147. }, {
  13148. key: "auth",
  13149. value: function auth() {
  13150. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13151. e = _ref12.persistence;
  13152. if (this.authObj) return this.authObj;
  13153. var t = e || Ie.adapter.primaryStorage || ht.persistence;
  13154. var n;
  13155. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13156. var t = e.env;
  13157. Ee[t] = new Pe(e), Oe[t] = new Pe(_objectSpread(_objectSpread({}, e), {}, {
  13158. persistence: "local"
  13159. }));
  13160. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  13161. }
  13162. }, {
  13163. key: "on",
  13164. value: function on(e, t) {
  13165. return Ne.apply(this, [e, t]);
  13166. }
  13167. }, {
  13168. key: "off",
  13169. value: function off(e, t) {
  13170. return Fe.apply(this, [e, t]);
  13171. }
  13172. }, {
  13173. key: "callFunction",
  13174. value: function callFunction(e, t) {
  13175. return lt.apply(this, [e, t]);
  13176. }
  13177. }, {
  13178. key: "deleteFile",
  13179. value: function deleteFile(e, t) {
  13180. return at.apply(this, [e, t]);
  13181. }
  13182. }, {
  13183. key: "getTempFileURL",
  13184. value: function getTempFileURL(e, t) {
  13185. return ct.apply(this, [e, t]);
  13186. }
  13187. }, {
  13188. key: "downloadFile",
  13189. value: function downloadFile(e, t) {
  13190. return ut.apply(this, [e, t]);
  13191. }
  13192. }, {
  13193. key: "uploadFile",
  13194. value: function uploadFile(e, t) {
  13195. return it.apply(this, [e, t]);
  13196. }
  13197. }, {
  13198. key: "getUploadMetadata",
  13199. value: function getUploadMetadata(e, t) {
  13200. return ot.apply(this, [e, t]);
  13201. }
  13202. }, {
  13203. key: "registerExtension",
  13204. value: function registerExtension(e) {
  13205. dt[e.name] = e;
  13206. }
  13207. }, {
  13208. key: "invokeExtension",
  13209. value: function () {
  13210. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  13211. var n;
  13212. return _regenerator.default.wrap(function _callee33$(_context33) {
  13213. while (1) {
  13214. switch (_context33.prev = _context33.next) {
  13215. case 0:
  13216. n = dt[e];
  13217. if (n) {
  13218. _context33.next = 3;
  13219. break;
  13220. }
  13221. throw new ne({
  13222. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  13223. });
  13224. case 3:
  13225. _context33.next = 5;
  13226. return n.invoke(t, this);
  13227. case 5:
  13228. return _context33.abrupt("return", _context33.sent);
  13229. case 6:
  13230. case "end":
  13231. return _context33.stop();
  13232. }
  13233. }
  13234. }, _callee33, this);
  13235. }));
  13236. function invokeExtension(_x29, _x30) {
  13237. return _invokeExtension.apply(this, arguments);
  13238. }
  13239. return invokeExtension;
  13240. }()
  13241. }, {
  13242. key: "useAdapters",
  13243. value: function useAdapters(e) {
  13244. var _ref13 = ke(e) || {},
  13245. t = _ref13.adapter,
  13246. n = _ref13.runtime;
  13247. t && (Ie.adapter = t), n && (Ie.runtime = n);
  13248. }
  13249. }]);
  13250. return pt;
  13251. }();
  13252. var ft = new pt();
  13253. function gt(e, t, n) {
  13254. void 0 === n && (n = {});
  13255. var s = /\?/.test(t),
  13256. r = "";
  13257. for (var i in n) {
  13258. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  13259. }
  13260. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  13261. }
  13262. var mt = /*#__PURE__*/function () {
  13263. function mt() {
  13264. (0, _classCallCheck2.default)(this, mt);
  13265. }
  13266. (0, _createClass2.default)(mt, [{
  13267. key: "post",
  13268. value: function post(e) {
  13269. var t = e.url,
  13270. n = e.data,
  13271. s = e.headers;
  13272. return new Promise(function (e, r) {
  13273. se.request({
  13274. url: gt("https:", t),
  13275. data: n,
  13276. method: "POST",
  13277. header: s,
  13278. success: function success(t) {
  13279. e(t);
  13280. },
  13281. fail: function fail(e) {
  13282. r(e);
  13283. }
  13284. });
  13285. });
  13286. }
  13287. }, {
  13288. key: "upload",
  13289. value: function upload(e) {
  13290. return new Promise(function (t, n) {
  13291. var s = e.url,
  13292. r = e.file,
  13293. i = e.data,
  13294. o = e.headers,
  13295. a = e.fileType,
  13296. c = se.uploadFile({
  13297. url: gt("https:", s),
  13298. name: "file",
  13299. formData: Object.assign({}, i),
  13300. filePath: r,
  13301. fileType: a,
  13302. header: o,
  13303. success: function success(e) {
  13304. var n = {
  13305. statusCode: e.statusCode,
  13306. data: e.data || {}
  13307. };
  13308. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  13309. },
  13310. fail: function fail(e) {
  13311. n(new Error(e.errMsg || "uploadFile:fail"));
  13312. }
  13313. });
  13314. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  13315. e.onUploadProgress({
  13316. loaded: t.totalBytesSent,
  13317. total: t.totalBytesExpectedToSend
  13318. });
  13319. });
  13320. });
  13321. }
  13322. }]);
  13323. return mt;
  13324. }();
  13325. var yt = {
  13326. setItem: function setItem(e, t) {
  13327. se.setStorageSync(e, t);
  13328. },
  13329. getItem: function getItem(e) {
  13330. return se.getStorageSync(e);
  13331. },
  13332. removeItem: function removeItem(e) {
  13333. se.removeStorageSync(e);
  13334. },
  13335. clear: function clear() {
  13336. se.clearStorageSync();
  13337. }
  13338. };
  13339. var _t = {
  13340. genAdapter: function genAdapter() {
  13341. return {
  13342. root: {},
  13343. reqClass: mt,
  13344. localStorage: yt,
  13345. primaryStorage: "local"
  13346. };
  13347. },
  13348. isMatch: function isMatch() {
  13349. return !0;
  13350. },
  13351. runtime: "uni_app"
  13352. };
  13353. ft.useAdapters(_t);
  13354. var wt = ft,
  13355. vt = wt.init;
  13356. wt.init = function (e) {
  13357. e.env = e.spaceId;
  13358. var t = vt.call(this, e);
  13359. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  13360. var n = t.auth;
  13361. return t.auth = function (e) {
  13362. var t = n.call(this, e);
  13363. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  13364. var n;
  13365. t[e] = (n = t[e], function (e) {
  13366. e = e || {};
  13367. var _te = te(e),
  13368. t = _te.success,
  13369. s = _te.fail,
  13370. r = _te.complete;
  13371. if (!(t || s || r)) return n.call(this, e);
  13372. n.call(this, e).then(function (e) {
  13373. t && t(e), r && r(e);
  13374. }, function (e) {
  13375. s && s(e), r && r(e);
  13376. });
  13377. }).bind(t);
  13378. }), t;
  13379. }, t.customAuth = t.auth, t;
  13380. };
  13381. var bt = wt;
  13382. var St = /*#__PURE__*/function (_fe) {
  13383. (0, _inherits2.default)(St, _fe);
  13384. var _super8 = _createSuper(St);
  13385. function St() {
  13386. (0, _classCallCheck2.default)(this, St);
  13387. return _super8.apply(this, arguments);
  13388. }
  13389. (0, _createClass2.default)(St, [{
  13390. key: "getAccessToken",
  13391. value: function getAccessToken() {
  13392. var _this11 = this;
  13393. return new Promise(function (e, t) {
  13394. var n = "Anonymous_Access_token";
  13395. _this11.setAccessToken(n), e(n);
  13396. });
  13397. }
  13398. }, {
  13399. key: "setupRequest",
  13400. value: function setupRequest(e, t) {
  13401. var n = Object.assign({}, e, {
  13402. spaceId: this.config.spaceId,
  13403. timestamp: Date.now()
  13404. }),
  13405. s = {
  13406. "Content-Type": "application/json"
  13407. };
  13408. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret);
  13409. var r = le();
  13410. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  13411. var _re = re(),
  13412. i = _re.token;
  13413. return s["x-client-token"] = i, {
  13414. url: this.config.requestUrl,
  13415. method: "POST",
  13416. data: n,
  13417. dataType: "json",
  13418. header: JSON.parse(JSON.stringify(s))
  13419. };
  13420. }
  13421. }, {
  13422. key: "uploadFileToOSS",
  13423. value: function uploadFileToOSS(_ref14) {
  13424. var _this12 = this;
  13425. var e = _ref14.url,
  13426. t = _ref14.formData,
  13427. n = _ref14.name,
  13428. s = _ref14.filePath,
  13429. r = _ref14.fileType,
  13430. i = _ref14.onUploadProgress;
  13431. return new Promise(function (o, a) {
  13432. var c = _this12.adapter.uploadFile({
  13433. url: e,
  13434. formData: t,
  13435. name: n,
  13436. filePath: s,
  13437. fileType: r,
  13438. success: function success(e) {
  13439. e && e.statusCode < 400 ? o(e) : a(new ne({
  13440. code: "UPLOAD_FAILED",
  13441. message: "文件上传失败"
  13442. }));
  13443. },
  13444. fail: function fail(e) {
  13445. a(new ne({
  13446. code: e.code || "UPLOAD_FAILED",
  13447. message: e.message || e.errMsg || "文件上传失败"
  13448. }));
  13449. }
  13450. });
  13451. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  13452. i({
  13453. loaded: e.totalBytesSent,
  13454. total: e.totalBytesExpectedToSend
  13455. });
  13456. });
  13457. });
  13458. }
  13459. }, {
  13460. key: "uploadFile",
  13461. value: function uploadFile(_ref15) {
  13462. var _this13 = this;
  13463. var e = _ref15.filePath,
  13464. t = _ref15.cloudPath,
  13465. _ref15$fileType = _ref15.fileType,
  13466. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  13467. s = _ref15.onUploadProgress;
  13468. if (!t) throw new ne({
  13469. code: "CLOUDPATH_REQUIRED",
  13470. message: "cloudPath不可为空"
  13471. });
  13472. var r;
  13473. return this.getOSSUploadOptionsFromPath({
  13474. cloudPath: t
  13475. }).then(function (t) {
  13476. var _t$result = t.result,
  13477. i = _t$result.url,
  13478. o = _t$result.formData,
  13479. a = _t$result.name;
  13480. r = t.result.fileUrl;
  13481. var c = {
  13482. url: i,
  13483. formData: o,
  13484. name: a,
  13485. filePath: e,
  13486. fileType: n
  13487. };
  13488. return _this13.uploadFileToOSS(Object.assign({}, c, {
  13489. onUploadProgress: s
  13490. }));
  13491. }).then(function () {
  13492. return _this13.reportOSSUpload({
  13493. cloudPath: t
  13494. });
  13495. }).then(function (t) {
  13496. return new Promise(function (n, s) {
  13497. t.success ? n({
  13498. success: !0,
  13499. filePath: e,
  13500. fileID: r
  13501. }) : s(new ne({
  13502. code: "UPLOAD_FAILED",
  13503. message: "文件上传失败"
  13504. }));
  13505. });
  13506. });
  13507. }
  13508. }, {
  13509. key: "deleteFile",
  13510. value: function deleteFile(_ref16) {
  13511. var e = _ref16.fileList;
  13512. var t = {
  13513. method: "serverless.file.resource.delete",
  13514. params: JSON.stringify({
  13515. fileList: e
  13516. })
  13517. };
  13518. return this.request(this.setupRequest(t)).then(function (e) {
  13519. if (e.success) return e.result;
  13520. throw new ne({
  13521. code: "DELETE_FILE_FAILED",
  13522. message: "删除文件失败"
  13523. });
  13524. });
  13525. }
  13526. }, {
  13527. key: "getTempFileURL",
  13528. value: function getTempFileURL() {
  13529. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13530. e = _ref17.fileList;
  13531. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  13532. code: "INVALID_PARAM",
  13533. message: "fileList的元素必须是非空的字符串"
  13534. });
  13535. var t = {
  13536. method: "serverless.file.resource.getTempFileURL",
  13537. params: JSON.stringify({
  13538. fileList: e
  13539. })
  13540. };
  13541. return this.request(this.setupRequest(t)).then(function (e) {
  13542. if (e.success) return {
  13543. fileList: e.result.fileList.map(function (e) {
  13544. return {
  13545. fileID: e.fileID,
  13546. tempFileURL: e.tempFileURL
  13547. };
  13548. })
  13549. };
  13550. throw new ne({
  13551. code: "GET_TEMP_FILE_URL_FAILED",
  13552. message: "获取临时文件链接失败"
  13553. });
  13554. });
  13555. }
  13556. }]);
  13557. return St;
  13558. }(fe);
  13559. var kt = {
  13560. init: function init(e) {
  13561. var t = new St(e),
  13562. n = {
  13563. signInAnonymously: function signInAnonymously() {
  13564. return t.authorize();
  13565. },
  13566. getLoginState: function getLoginState() {
  13567. return Promise.resolve(!1);
  13568. }
  13569. };
  13570. return t.auth = function () {
  13571. return n;
  13572. }, t.customAuth = t.auth, t;
  13573. }
  13574. };
  13575. function It(_ref18) {
  13576. var e = _ref18.data;
  13577. var t;
  13578. t = le();
  13579. var n = JSON.parse(JSON.stringify(e || {}));
  13580. if (Object.assign(n, {
  13581. clientInfo: t
  13582. }), !n.uniIdToken) {
  13583. var _re2 = re(),
  13584. _e19 = _re2.token;
  13585. _e19 && (n.uniIdToken = _e19);
  13586. }
  13587. return n;
  13588. }
  13589. function Tt() {
  13590. return _Tt.apply(this, arguments);
  13591. }
  13592. function _Tt() {
  13593. _Tt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  13594. var _this23 = this;
  13595. var _ref55,
  13596. e,
  13597. t,
  13598. _this$__dev__,
  13599. n,
  13600. s,
  13601. r,
  13602. i,
  13603. o,
  13604. a,
  13605. _args5 = arguments;
  13606. return _regenerator.default.wrap(function _callee53$(_context53) {
  13607. while (1) {
  13608. switch (_context53.prev = _context53.next) {
  13609. case 0:
  13610. _ref55 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, e = _ref55.name, t = _ref55.data;
  13611. _context53.next = 3;
  13612. return this.__dev__.initLocalNetwork();
  13613. case 3:
  13614. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  13615. aliyun: "aliyun",
  13616. tencent: "tcb"
  13617. }[this.config.provider], i = this.config.spaceId, o = "http://".concat(n, ":").concat(s, "/system/check-function"), a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  13618. return _context53.abrupt("return", new Promise(function (t, n) {
  13619. se.request({
  13620. method: "POST",
  13621. url: o,
  13622. data: {
  13623. name: e,
  13624. platform: A,
  13625. provider: r,
  13626. spaceId: i
  13627. },
  13628. timeout: 3e3,
  13629. success: function success(e) {
  13630. t(e);
  13631. },
  13632. fail: function fail() {
  13633. t({
  13634. data: {
  13635. code: "NETWORK_ERROR",
  13636. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  13637. }
  13638. });
  13639. }
  13640. });
  13641. }).then(function () {
  13642. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13643. e = _ref56.data;
  13644. var _ref57 = e || {},
  13645. t = _ref57.code,
  13646. n = _ref57.message;
  13647. return {
  13648. code: 0 === t ? 0 : t || "SYS_ERR",
  13649. message: n || "SYS_ERR"
  13650. };
  13651. }).then(function (_ref58) {
  13652. var n = _ref58.code,
  13653. s = _ref58.message;
  13654. if (0 !== n) {
  13655. switch (n) {
  13656. case "MODULE_ENCRYPTED":
  13657. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  13658. break;
  13659. case "FUNCTION_ENCRYPTED":
  13660. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  13661. break;
  13662. case "ACTION_ENCRYPTED":
  13663. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  13664. break;
  13665. case "NETWORK_ERROR":
  13666. {
  13667. var _e29 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  13668. throw console.error(_e29), new Error(_e29);
  13669. }
  13670. case "SWITCH_TO_CLOUD":
  13671. break;
  13672. default:
  13673. {
  13674. var _e30 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");
  13675. throw console.error(_e30), new Error(_e30);
  13676. }
  13677. }
  13678. return _this23._callCloudFunction({
  13679. name: e,
  13680. data: t
  13681. });
  13682. }
  13683. return new Promise(function (e, n) {
  13684. var s = It.call(_this23, {
  13685. data: t
  13686. });
  13687. se.request({
  13688. method: "POST",
  13689. url: a,
  13690. data: {
  13691. provider: r,
  13692. platform: A,
  13693. param: s
  13694. },
  13695. success: function success() {
  13696. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13697. t = _ref59.statusCode,
  13698. s = _ref59.data;
  13699. return !t || t >= 400 ? n(new ne({
  13700. code: s.code || "SYS_ERR",
  13701. message: s.message || "request:fail"
  13702. })) : e({
  13703. result: s
  13704. });
  13705. },
  13706. fail: function fail(e) {
  13707. n(new ne({
  13708. code: e.code || e.errCode || "SYS_ERR",
  13709. message: e.message || e.errMsg || "request:fail"
  13710. }));
  13711. }
  13712. });
  13713. });
  13714. }));
  13715. case 5:
  13716. case "end":
  13717. return _context53.stop();
  13718. }
  13719. }
  13720. }, _callee53, this);
  13721. }));
  13722. return _Tt.apply(this, arguments);
  13723. }
  13724. var Ct = [{
  13725. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  13726. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  13727. mode: "append"
  13728. }];
  13729. var At = /[\\^$.*+?()[\]{}|]/g,
  13730. Pt = RegExp(At.source);
  13731. function Et(e, t, n) {
  13732. return e.replace(new RegExp((s = t) && Pt.test(s) ? s.replace(At, "\\$&") : s, "g"), n);
  13733. var s;
  13734. }
  13735. var Ot = "none",
  13736. xt = "request",
  13737. Rt = "response",
  13738. Ut = "both";
  13739. var Lt = /*#__PURE__*/function () {
  13740. function Lt() {
  13741. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13742. e = _ref19.secretType,
  13743. t = _ref19.uniCloudIns;
  13744. (0, _classCallCheck2.default)(this, Lt);
  13745. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  13746. var _this$uniCloudIns$con = this.uniCloudIns.config,
  13747. n = _this$uniCloudIns$con.provider,
  13748. s = _this$uniCloudIns$con.spaceId;
  13749. var r;
  13750. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  13751. }
  13752. (0, _createClass2.default)(Lt, [{
  13753. key: "getSystemInfo",
  13754. value: function getSystemInfo() {
  13755. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  13756. }
  13757. }, {
  13758. key: "appId",
  13759. get: function get() {
  13760. return this.getSystemInfo().appId;
  13761. }
  13762. }, {
  13763. key: "deviceId",
  13764. get: function get() {
  13765. return this.getSystemInfo().deviceId;
  13766. }
  13767. }, {
  13768. key: "encryptData",
  13769. value: function () {
  13770. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  13771. return _regenerator.default.wrap(function _callee34$(_context34) {
  13772. while (1) {
  13773. switch (_context34.prev = _context34.next) {
  13774. case 0:
  13775. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  13776. case 1:
  13777. case "end":
  13778. return _context34.stop();
  13779. }
  13780. }
  13781. }, _callee34, this);
  13782. }));
  13783. function encryptData(_x31) {
  13784. return _encryptData.apply(this, arguments);
  13785. }
  13786. return encryptData;
  13787. }()
  13788. }, {
  13789. key: "decryptResult",
  13790. value: function () {
  13791. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  13792. var _ref20, t, n;
  13793. return _regenerator.default.wrap(function _callee35$(_context35) {
  13794. while (1) {
  13795. switch (_context35.prev = _context35.next) {
  13796. case 0:
  13797. if (!(this.secretType === Ot)) {
  13798. _context35.next = 2;
  13799. break;
  13800. }
  13801. return _context35.abrupt("return", e);
  13802. case 2:
  13803. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  13804. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  13805. case 4:
  13806. case "end":
  13807. return _context35.stop();
  13808. }
  13809. }
  13810. }, _callee35, this);
  13811. }));
  13812. function decryptResult(_x32) {
  13813. return _decryptResult.apply(this, arguments);
  13814. }
  13815. return decryptResult;
  13816. }()
  13817. }, {
  13818. key: "wrapVerifyClientCallFunction",
  13819. value: function wrapVerifyClientCallFunction(e) {
  13820. var t = this;
  13821. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  13822. var _ref22,
  13823. n,
  13824. _ref22$data,
  13825. s,
  13826. r,
  13827. _args36 = arguments;
  13828. return _regenerator.default.wrap(function _callee36$(_context36) {
  13829. while (1) {
  13830. switch (_context36.prev = _context36.next) {
  13831. case 0:
  13832. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  13833. _context36.next = 3;
  13834. return t.prepare();
  13835. case 3:
  13836. _context36.next = 5;
  13837. return t.platformGetSignOption();
  13838. case 5:
  13839. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  13840. _context36.next = 8;
  13841. return e({
  13842. name: n,
  13843. data: s
  13844. });
  13845. case 8:
  13846. r = _context36.sent;
  13847. _context36.t0 = t.isClientKeyNotFound(r);
  13848. if (!_context36.t0) {
  13849. _context36.next = 19;
  13850. break;
  13851. }
  13852. _context36.next = 13;
  13853. return t.prepare({
  13854. forceUpdate: !0
  13855. });
  13856. case 13:
  13857. _context36.next = 15;
  13858. return t.platformGetSignOption();
  13859. case 15:
  13860. s._uniCloudOptions = _context36.sent;
  13861. _context36.next = 18;
  13862. return e({
  13863. name: n,
  13864. data: s
  13865. });
  13866. case 18:
  13867. r = _context36.sent;
  13868. case 19:
  13869. return _context36.abrupt("return", r);
  13870. case 20:
  13871. case "end":
  13872. return _context36.stop();
  13873. }
  13874. }
  13875. }, _callee36);
  13876. }));
  13877. }
  13878. }, {
  13879. key: "wrapEncryptDataCallFunction",
  13880. value: function wrapEncryptDataCallFunction(e) {
  13881. var t = this;
  13882. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  13883. var _ref24,
  13884. n,
  13885. _ref24$data,
  13886. s,
  13887. r,
  13888. i,
  13889. _r3,
  13890. _args37 = arguments;
  13891. return _regenerator.default.wrap(function _callee37$(_context37) {
  13892. while (1) {
  13893. switch (_context37.prev = _context37.next) {
  13894. case 0:
  13895. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  13896. _context37.next = 3;
  13897. return t.prepare();
  13898. case 3:
  13899. _context37.next = 5;
  13900. return t.encryptData(s);
  13901. case 5:
  13902. r = _context37.sent;
  13903. _context37.next = 8;
  13904. return e({
  13905. name: n,
  13906. data: r
  13907. });
  13908. case 8:
  13909. i = _context37.sent;
  13910. if (!t.isClientKeyNotFound(i)) {
  13911. _context37.next = 21;
  13912. break;
  13913. }
  13914. _context37.next = 12;
  13915. return t.prepare({
  13916. forceUpdate: !0
  13917. });
  13918. case 12:
  13919. _context37.next = 14;
  13920. return t.encryptData(s);
  13921. case 14:
  13922. _r3 = _context37.sent;
  13923. _context37.next = 17;
  13924. return t.platformGetSignOption();
  13925. case 17:
  13926. s._uniCloudOptions = _context37.sent;
  13927. _context37.next = 20;
  13928. return e({
  13929. name: n,
  13930. data: _r3
  13931. });
  13932. case 20:
  13933. i = _context37.sent;
  13934. case 21:
  13935. _context37.next = 23;
  13936. return t.decryptResult(i.result);
  13937. case 23:
  13938. i.result = _context37.sent;
  13939. return _context37.abrupt("return", i);
  13940. case 25:
  13941. case "end":
  13942. return _context37.stop();
  13943. }
  13944. }
  13945. }, _callee37);
  13946. }));
  13947. }
  13948. }]);
  13949. return Lt;
  13950. }();
  13951. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  13952. function Nt(e) {
  13953. return parseInt(e) === e;
  13954. }
  13955. function Dt(e) {
  13956. if (!Nt(e.length)) return !1;
  13957. for (var t = 0; t < e.length; t++) {
  13958. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  13959. }
  13960. return !0;
  13961. }
  13962. function Ft(e, t) {
  13963. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  13964. if (Array.isArray(e)) {
  13965. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  13966. return new Uint8Array(e);
  13967. }
  13968. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  13969. throw new Error("unsupported array-like object");
  13970. }
  13971. function qt(e) {
  13972. return new Uint8Array(e);
  13973. }
  13974. function Kt(e, t, n, s, r) {
  13975. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  13976. }
  13977. var Mt,
  13978. jt = {
  13979. toBytes: function toBytes(e) {
  13980. var t = [],
  13981. n = 0;
  13982. for (e = encodeURI(e); n < e.length;) {
  13983. var s = e.charCodeAt(n++);
  13984. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  13985. }
  13986. return Ft(t);
  13987. },
  13988. fromBytes: function fromBytes(e) {
  13989. for (var t = [], n = 0; n < e.length;) {
  13990. var s = e[n];
  13991. 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);
  13992. }
  13993. return t.join("");
  13994. }
  13995. },
  13996. Bt = (Mt = "0123456789abcdef", {
  13997. toBytes: function toBytes(e) {
  13998. for (var t = [], n = 0; n < e.length; n += 2) {
  13999. t.push(parseInt(e.substr(n, 2), 16));
  14000. }
  14001. return t;
  14002. },
  14003. fromBytes: function fromBytes(e) {
  14004. for (var t = [], n = 0; n < e.length; n++) {
  14005. var s = e[n];
  14006. t.push(Mt[(240 & s) >> 4] + Mt[15 & s]);
  14007. }
  14008. return t.join("");
  14009. }
  14010. }),
  14011. $t = {
  14012. 16: 10,
  14013. 24: 12,
  14014. 32: 14
  14015. },
  14016. Wt = [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],
  14017. zt = [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],
  14018. Jt = [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],
  14019. Ht = [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],
  14020. Gt = [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],
  14021. Vt = [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],
  14022. Yt = [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],
  14023. Qt = [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],
  14024. Xt = [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],
  14025. Zt = [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],
  14026. en = [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],
  14027. tn = [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],
  14028. nn = [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],
  14029. sn = [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],
  14030. rn = [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];
  14031. function on(e) {
  14032. for (var t = [], n = 0; n < e.length; n += 4) {
  14033. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  14034. }
  14035. return t;
  14036. }
  14037. var an = /*#__PURE__*/function () {
  14038. function an(e) {
  14039. (0, _classCallCheck2.default)(this, an);
  14040. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  14041. Object.defineProperty(this, "key", {
  14042. value: Ft(e, !0)
  14043. }), this._prepare();
  14044. }
  14045. (0, _createClass2.default)(an, [{
  14046. key: "_prepare",
  14047. value: function _prepare() {
  14048. var e = $t[this.key.length];
  14049. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  14050. this._Ke = [], this._Kd = [];
  14051. for (var t = 0; t <= e; t++) {
  14052. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  14053. }
  14054. var n,
  14055. s = 4 * (e + 1),
  14056. r = this.key.length / 4,
  14057. i = on(this.key);
  14058. for (t = 0; t < r; t++) {
  14059. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  14060. }
  14061. for (var o, a = 0, c = r; c < s;) {
  14062. if (o = i[r - 1], i[0] ^= zt[o >> 16 & 255] << 24 ^ zt[o >> 8 & 255] << 16 ^ zt[255 & o] << 8 ^ zt[o >> 24 & 255] ^ Wt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  14063. i[t] ^= i[t - 1];
  14064. } else {
  14065. for (t = 1; t < r / 2; t++) {
  14066. i[t] ^= i[t - 1];
  14067. }
  14068. o = i[r / 2 - 1], i[r / 2] ^= zt[255 & o] ^ zt[o >> 8 & 255] << 8 ^ zt[o >> 16 & 255] << 16 ^ zt[o >> 24 & 255] << 24;
  14069. for (t = r / 2 + 1; t < r; t++) {
  14070. i[t] ^= i[t - 1];
  14071. }
  14072. }
  14073. for (t = 0; t < r && c < s;) {
  14074. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  14075. }
  14076. }
  14077. for (var u = 1; u < e; u++) {
  14078. for (var l = 0; l < 4; l++) {
  14079. o = this._Kd[u][l], this._Kd[u][l] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  14080. }
  14081. }
  14082. }
  14083. }, {
  14084. key: "encrypt",
  14085. value: function encrypt(e) {
  14086. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  14087. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14088. s[r] ^= this._Ke[0][r];
  14089. }
  14090. for (var i = 1; i < t; i++) {
  14091. for (r = 0; r < 4; r++) {
  14092. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 1) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  14093. }
  14094. s = n.slice();
  14095. }
  14096. var o,
  14097. a = qt(16);
  14098. for (r = 0; r < 4; r++) {
  14099. o = this._Ke[t][r], a[4 * r] = 255 & (zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (zt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (zt[255 & s[(r + 3) % 4]] ^ o);
  14100. }
  14101. return a;
  14102. }
  14103. }, {
  14104. key: "decrypt",
  14105. value: function decrypt(e) {
  14106. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  14107. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14108. s[r] ^= this._Kd[0][r];
  14109. }
  14110. for (var i = 1; i < t; i++) {
  14111. for (r = 0; r < 4; r++) {
  14112. n[r] = Qt[s[r] >> 24 & 255] ^ Xt[s[(r + 3) % 4] >> 16 & 255] ^ Zt[s[(r + 2) % 4] >> 8 & 255] ^ en[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  14113. }
  14114. s = n.slice();
  14115. }
  14116. var o,
  14117. a = qt(16);
  14118. for (r = 0; r < 4; r++) {
  14119. o = this._Kd[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 1) % 4]] ^ o);
  14120. }
  14121. return a;
  14122. }
  14123. }]);
  14124. return an;
  14125. }();
  14126. var cn = /*#__PURE__*/function () {
  14127. function cn(e) {
  14128. (0, _classCallCheck2.default)(this, cn);
  14129. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  14130. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  14131. }
  14132. (0, _createClass2.default)(cn, [{
  14133. key: "encrypt",
  14134. value: function encrypt(e) {
  14135. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14136. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14137. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.encrypt(n), t, s);
  14138. }
  14139. return t;
  14140. }
  14141. }, {
  14142. key: "decrypt",
  14143. value: function decrypt(e) {
  14144. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14145. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14146. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.decrypt(n), t, s);
  14147. }
  14148. return t;
  14149. }
  14150. }]);
  14151. return cn;
  14152. }();
  14153. var un = /*#__PURE__*/function () {
  14154. function un(e, t) {
  14155. (0, _classCallCheck2.default)(this, un);
  14156. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  14157. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  14158. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14159. } else t = qt(16);
  14160. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  14161. }
  14162. (0, _createClass2.default)(un, [{
  14163. key: "encrypt",
  14164. value: function encrypt(e) {
  14165. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14166. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14167. Kt(e, n, 0, s, s + 16);
  14168. for (var r = 0; r < 16; r++) {
  14169. n[r] ^= this._lastCipherblock[r];
  14170. }
  14171. this._lastCipherblock = this._aes.encrypt(n), Kt(this._lastCipherblock, t, s);
  14172. }
  14173. return t;
  14174. }
  14175. }, {
  14176. key: "decrypt",
  14177. value: function decrypt(e) {
  14178. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14179. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14180. Kt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  14181. for (var r = 0; r < 16; r++) {
  14182. t[s + r] = n[r] ^ this._lastCipherblock[r];
  14183. }
  14184. Kt(e, this._lastCipherblock, 0, s, s + 16);
  14185. }
  14186. return t;
  14187. }
  14188. }]);
  14189. return un;
  14190. }();
  14191. var ln = /*#__PURE__*/function () {
  14192. function ln(e, t, n) {
  14193. (0, _classCallCheck2.default)(this, ln);
  14194. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  14195. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  14196. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  14197. } else t = qt(16);
  14198. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  14199. }
  14200. (0, _createClass2.default)(ln, [{
  14201. key: "encrypt",
  14202. value: function encrypt(e) {
  14203. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  14204. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14205. t = this._aes.encrypt(this._shiftRegister);
  14206. for (var r = 0; r < this.segmentSize; r++) {
  14207. n[s + r] ^= t[r];
  14208. }
  14209. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14210. }
  14211. return n;
  14212. }
  14213. }, {
  14214. key: "decrypt",
  14215. value: function decrypt(e) {
  14216. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  14217. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14218. t = this._aes.encrypt(this._shiftRegister);
  14219. for (var r = 0; r < this.segmentSize; r++) {
  14220. n[s + r] ^= t[r];
  14221. }
  14222. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14223. }
  14224. return n;
  14225. }
  14226. }]);
  14227. return ln;
  14228. }();
  14229. var hn = /*#__PURE__*/function () {
  14230. function hn(e, t) {
  14231. (0, _classCallCheck2.default)(this, hn);
  14232. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  14233. if (this.description = "Output Feedback", this.name = "ofb", t) {
  14234. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14235. } else t = qt(16);
  14236. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  14237. }
  14238. (0, _createClass2.default)(hn, [{
  14239. key: "encrypt",
  14240. value: function encrypt(e) {
  14241. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14242. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  14243. }
  14244. return t;
  14245. }
  14246. }, {
  14247. key: "decrypt",
  14248. value: function decrypt(e) {
  14249. return this.encrypt(e);
  14250. }
  14251. }]);
  14252. return hn;
  14253. }();
  14254. var dn = /*#__PURE__*/function () {
  14255. function dn(e) {
  14256. (0, _classCallCheck2.default)(this, dn);
  14257. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  14258. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  14259. }
  14260. (0, _createClass2.default)(dn, [{
  14261. key: "setValue",
  14262. value: function setValue(e) {
  14263. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  14264. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  14265. for (var t = 15; t >= 0; --t) {
  14266. this._counter[t] = e % 256, e = parseInt(e / 256);
  14267. }
  14268. }
  14269. }, {
  14270. key: "setBytes",
  14271. value: function setBytes(e) {
  14272. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  14273. this._counter = e;
  14274. }
  14275. }, {
  14276. key: "increment",
  14277. value: function increment() {
  14278. for (var e = 15; e >= 0; e--) {
  14279. if (255 !== this._counter[e]) {
  14280. this._counter[e]++;
  14281. break;
  14282. }
  14283. this._counter[e] = 0;
  14284. }
  14285. }
  14286. }]);
  14287. return dn;
  14288. }();
  14289. var pn = /*#__PURE__*/function () {
  14290. function pn(e, t) {
  14291. (0, _classCallCheck2.default)(this, pn);
  14292. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  14293. this.description = "Counter", this.name = "ctr", t instanceof dn || (t = new dn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new an(e);
  14294. }
  14295. (0, _createClass2.default)(pn, [{
  14296. key: "encrypt",
  14297. value: function encrypt(e) {
  14298. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14299. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  14300. }
  14301. return t;
  14302. }
  14303. }, {
  14304. key: "decrypt",
  14305. value: function decrypt(e) {
  14306. return this.encrypt(e);
  14307. }
  14308. }]);
  14309. return pn;
  14310. }();
  14311. var fn = {
  14312. AES: an,
  14313. Counter: dn,
  14314. ModeOfOperation: {
  14315. ecb: cn,
  14316. cbc: un,
  14317. cfb: ln,
  14318. ofb: hn,
  14319. ctr: pn
  14320. },
  14321. utils: {
  14322. hex: Bt,
  14323. utf8: jt
  14324. },
  14325. padding: {
  14326. pkcs7: {
  14327. pad: function pad(e) {
  14328. var t = 16 - (e = Ft(e, !0)).length % 16,
  14329. n = qt(e.length + t);
  14330. Kt(e, n);
  14331. for (var s = e.length; s < n.length; s++) {
  14332. n[s] = t;
  14333. }
  14334. return n;
  14335. },
  14336. strip: function strip(e) {
  14337. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  14338. var t = e[e.length - 1];
  14339. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  14340. for (var n = e.length - t, s = 0; s < t; s++) {
  14341. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  14342. }
  14343. var r = qt(n);
  14344. return Kt(e, r, 0, 0, n), r;
  14345. }
  14346. }
  14347. },
  14348. _arrayTest: {
  14349. coerceArray: Ft,
  14350. createArray: qt,
  14351. copyArray: Kt
  14352. }
  14353. };
  14354. function gn(e, t, n) {
  14355. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14356. r = fn.utils.utf8.toBytes(n),
  14357. i = fn.utils.utf8.toBytes(e),
  14358. o = new fn.ModeOfOperation.cbc(s, r),
  14359. a = fn.padding.pkcs7.pad(i),
  14360. c = o.encrypt(a);
  14361. return uni.arrayBufferToBase64(c);
  14362. }
  14363. var mn = {
  14364. code: 2e4,
  14365. message: "System error"
  14366. },
  14367. yn = {
  14368. code: 20101,
  14369. message: "Invalid client"
  14370. },
  14371. _n = {
  14372. code: 20102,
  14373. message: "Get encrypt key failed"
  14374. },
  14375. wn = {
  14376. 10001: "Secure network is not supported on current playground or unimpsdk",
  14377. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  14378. 10009: "Encrypt payload failed",
  14379. 10010: "Decrypt response failed"
  14380. };
  14381. function vn(e) {
  14382. var _ref25 = e || {},
  14383. t = _ref25.errSubject,
  14384. n = _ref25.subject,
  14385. s = _ref25.errCode,
  14386. r = _ref25.errMsg,
  14387. i = _ref25.code,
  14388. o = _ref25.message,
  14389. a = _ref25.cause;
  14390. return new ne({
  14391. subject: t || n || "uni-secure-network",
  14392. code: s || i || mn.code,
  14393. message: r || o,
  14394. cause: a
  14395. });
  14396. }
  14397. var bn,
  14398. Sn,
  14399. kn = null;
  14400. var In = /*#__PURE__*/function (_Lt) {
  14401. (0, _inherits2.default)(In, _Lt);
  14402. var _super9 = _createSuper(In);
  14403. function In(e) {
  14404. var _this14;
  14405. (0, _classCallCheck2.default)(this, In);
  14406. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  14407. return _this14;
  14408. }
  14409. (0, _createClass2.default)(In, [{
  14410. key: "isLogin",
  14411. value: function isLogin() {
  14412. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  14413. }
  14414. }, {
  14415. key: "prepare",
  14416. value: function () {
  14417. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  14418. return _regenerator.default.wrap(function _callee38$(_context38) {
  14419. while (1) {
  14420. switch (_context38.prev = _context38.next) {
  14421. case 0:
  14422. if (this.isLogin()) {
  14423. _context38.next = 7;
  14424. break;
  14425. }
  14426. if (this.scopedGlobalCache.initPromise) {
  14427. _context38.next = 3;
  14428. break;
  14429. }
  14430. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  14431. case 3:
  14432. _context38.next = 5;
  14433. return this.scopedGlobalCache.initPromise;
  14434. case 5:
  14435. if (this.isLogin()) {
  14436. _context38.next = 7;
  14437. break;
  14438. }
  14439. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  14440. case 7:
  14441. case "end":
  14442. return _context38.stop();
  14443. }
  14444. }
  14445. }, _callee38, this);
  14446. }));
  14447. function prepare() {
  14448. return _prepare2.apply(this, arguments);
  14449. }
  14450. return prepare;
  14451. }()
  14452. }, {
  14453. key: "getUserEncryptKey",
  14454. value: function () {
  14455. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  14456. var _this15 = this;
  14457. var e;
  14458. return _regenerator.default.wrap(function _callee39$(_context39) {
  14459. while (1) {
  14460. switch (_context39.prev = _context39.next) {
  14461. case 0:
  14462. if (!this.userEncryptKey) {
  14463. _context39.next = 2;
  14464. break;
  14465. }
  14466. return _context39.abrupt("return", this.userEncryptKey);
  14467. case 2:
  14468. if (!(kn && kn.expireTime)) {
  14469. _context39.next = 6;
  14470. break;
  14471. }
  14472. e = Date.now();
  14473. if (!(kn.expireTime - e > 0)) {
  14474. _context39.next = 6;
  14475. break;
  14476. }
  14477. return _context39.abrupt("return", (this.userEncryptKey = kn, this.userEncryptKey));
  14478. case 6:
  14479. return _context39.abrupt("return", new Promise(function (e, t) {
  14480. uni.getUserCryptoManager().getLatestUserKey({
  14481. success: function success(t) {
  14482. kn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  14483. },
  14484. fail: function fail(e) {
  14485. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  14486. cause: e
  14487. })));
  14488. }
  14489. });
  14490. }));
  14491. case 7:
  14492. case "end":
  14493. return _context39.stop();
  14494. }
  14495. }
  14496. }, _callee39, this);
  14497. }));
  14498. function getUserEncryptKey() {
  14499. return _getUserEncryptKey.apply(this, arguments);
  14500. }
  14501. return getUserEncryptKey;
  14502. }()
  14503. }, {
  14504. key: "getWxAppId",
  14505. value: function getWxAppId() {
  14506. return wx.getAccountInfoSync().miniProgram.appId;
  14507. }
  14508. }, {
  14509. key: "platformGetSignOption",
  14510. value: function () {
  14511. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  14512. var _yield$this$getUserEn, e, t, n;
  14513. return _regenerator.default.wrap(function _callee40$(_context40) {
  14514. while (1) {
  14515. switch (_context40.prev = _context40.next) {
  14516. case 0:
  14517. _context40.next = 2;
  14518. return this.getUserEncryptKey();
  14519. case 2:
  14520. _yield$this$getUserEn = _context40.sent;
  14521. e = _yield$this$getUserEn.encryptKey;
  14522. t = _yield$this$getUserEn.iv;
  14523. n = _yield$this$getUserEn.version;
  14524. return _context40.abrupt("return", {
  14525. verifyClientSign: gn(JSON.stringify({
  14526. data: JSON.stringify({}),
  14527. appId: this.appId,
  14528. deviceId: this.deviceId,
  14529. wxAppId: this.getWxAppId(),
  14530. simulator: "devtools" === ce().platform,
  14531. timestamp: Date.now()
  14532. }), e, t),
  14533. encryptKeyId: n,
  14534. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14535. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14536. });
  14537. case 7:
  14538. case "end":
  14539. return _context40.stop();
  14540. }
  14541. }
  14542. }, _callee40, this);
  14543. }));
  14544. function platformGetSignOption() {
  14545. return _platformGetSignOption.apply(this, arguments);
  14546. }
  14547. return platformGetSignOption;
  14548. }()
  14549. }, {
  14550. key: "platformEncryptData",
  14551. value: function () {
  14552. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  14553. var _yield$this$getUserEn2, t, n, s, r;
  14554. return _regenerator.default.wrap(function _callee41$(_context41) {
  14555. while (1) {
  14556. switch (_context41.prev = _context41.next) {
  14557. case 0:
  14558. _context41.next = 2;
  14559. return this.getUserEncryptKey();
  14560. case 2:
  14561. _yield$this$getUserEn2 = _context41.sent;
  14562. t = _yield$this$getUserEn2.encryptKey;
  14563. n = _yield$this$getUserEn2.iv;
  14564. s = _yield$this$getUserEn2.version;
  14565. r = {
  14566. secretType: this.secretType,
  14567. encryptKeyId: s,
  14568. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14569. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14570. };
  14571. return _context41.abrupt("return", this.secretType === Rt ? {
  14572. content: e,
  14573. _uniCloudOptions: r
  14574. } : {
  14575. content: gn(JSON.stringify({
  14576. data: JSON.stringify(e),
  14577. appId: this.appId,
  14578. deviceId: this.deviceId,
  14579. wxAppId: this.getWxAppId(),
  14580. simulator: "devtools" === ce().platform,
  14581. timestamp: Date.now()
  14582. }), t, n),
  14583. _uniCloudOptions: r
  14584. });
  14585. case 8:
  14586. case "end":
  14587. return _context41.stop();
  14588. }
  14589. }
  14590. }, _callee41, this);
  14591. }));
  14592. function platformEncryptData(_x33) {
  14593. return _platformEncryptData.apply(this, arguments);
  14594. }
  14595. return platformEncryptData;
  14596. }()
  14597. }, {
  14598. key: "platformDecryptResult",
  14599. value: function () {
  14600. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  14601. var t, _yield$this$getUserEn3, n, s;
  14602. return _regenerator.default.wrap(function _callee42$(_context42) {
  14603. while (1) {
  14604. switch (_context42.prev = _context42.next) {
  14605. case 0:
  14606. t = e.content;
  14607. _context42.next = 3;
  14608. return this.getUserEncryptKey();
  14609. case 3:
  14610. _yield$this$getUserEn3 = _context42.sent;
  14611. n = _yield$this$getUserEn3.encryptKey;
  14612. s = _yield$this$getUserEn3.iv;
  14613. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  14614. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  14615. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14616. i = fn.utils.utf8.toBytes(n),
  14617. o = new fn.ModeOfOperation.cbc(r, i),
  14618. a = fn.padding.pkcs7.strip(o.decrypt(s));
  14619. return fn.utils.utf8.fromBytes(a);
  14620. }(t, n, s)));
  14621. case 7:
  14622. case "end":
  14623. return _context42.stop();
  14624. }
  14625. }
  14626. }, _callee42, this);
  14627. }));
  14628. function platformDecryptResult(_x34) {
  14629. return _platformDecryptResult.apply(this, arguments);
  14630. }
  14631. return platformDecryptResult;
  14632. }()
  14633. }, {
  14634. key: "isClientKeyNotFound",
  14635. value: function isClientKeyNotFound() {
  14636. return !1;
  14637. }
  14638. }]);
  14639. return In;
  14640. }(Lt);
  14641. function Tn(e) {
  14642. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  14643. n = {};
  14644. var _loop = function _loop(_s10) {
  14645. var r = t[_s10];
  14646. n[r] = function () {
  14647. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  14648. t[_key] = arguments[_key];
  14649. }
  14650. return new Promise(function (n, s) {
  14651. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  14652. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14653. e = _ref26.type,
  14654. t = _ref26.data,
  14655. r = _ref26.errCode,
  14656. i = _ref26.errMsg,
  14657. o = _ref26.errSubject,
  14658. a = _ref26.message;
  14659. "success" === e ? n(t) : s(vn({
  14660. errCode: r,
  14661. errMsg: wn[r] || i || a,
  14662. errSubject: o
  14663. }));
  14664. }])) : s(vn({
  14665. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  14666. }));
  14667. });
  14668. };
  14669. };
  14670. for (var _s10 = 0; _s10 < t.length; _s10++) {
  14671. _loop(_s10);
  14672. }
  14673. return n;
  14674. }
  14675. var Cn = /*#__PURE__*/function (_Lt2) {
  14676. (0, _inherits2.default)(Cn, _Lt2);
  14677. var _super10 = _createSuper(Cn);
  14678. function Cn(e) {
  14679. var _this16;
  14680. (0, _classCallCheck2.default)(this, Cn);
  14681. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Tn(uni.requireNativePlugin("plus"))), _this16.systemInfo = bn || (bn = ce());
  14682. return _this16;
  14683. }
  14684. (0, _createClass2.default)(Cn, [{
  14685. key: "hasClientKey",
  14686. value: function () {
  14687. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  14688. return _regenerator.default.wrap(function _callee43$(_context43) {
  14689. while (1) {
  14690. switch (_context43.prev = _context43.next) {
  14691. case 0:
  14692. _context43.next = 2;
  14693. return this.appUtils.hasClientKey({
  14694. provider: this.provider,
  14695. spaceId: this.spaceId
  14696. });
  14697. case 2:
  14698. this._hasClientKey = _context43.sent;
  14699. return _context43.abrupt("return", this._hasClientKey);
  14700. case 4:
  14701. case "end":
  14702. return _context43.stop();
  14703. }
  14704. }
  14705. }, _callee43, this);
  14706. }));
  14707. function hasClientKey() {
  14708. return _hasClientKey.apply(this, arguments);
  14709. }
  14710. return hasClientKey;
  14711. }()
  14712. }, {
  14713. key: "getAppClientKey",
  14714. value: function () {
  14715. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  14716. var _yield$this$appUtils$, e, t, n, s, r;
  14717. return _regenerator.default.wrap(function _callee44$(_context44) {
  14718. while (1) {
  14719. switch (_context44.prev = _context44.next) {
  14720. case 0:
  14721. _context44.next = 2;
  14722. return this.appUtils.encryptGetClientKeyPayload({
  14723. data: JSON.stringify({})
  14724. });
  14725. case 2:
  14726. _yield$this$appUtils$ = _context44.sent;
  14727. e = _yield$this$appUtils$.data;
  14728. t = _yield$this$appUtils$.key;
  14729. _context44.next = 7;
  14730. return this.uniCloudIns.callFunction({
  14731. name: "DCloud-clientDB",
  14732. data: {
  14733. redirectTo: "encryption",
  14734. action: "getAppClientKey",
  14735. data: e,
  14736. key: t
  14737. }
  14738. });
  14739. case 7:
  14740. _context44.t0 = _context44.sent.result;
  14741. if (_context44.t0) {
  14742. _context44.next = 10;
  14743. break;
  14744. }
  14745. _context44.t0 = {};
  14746. case 10:
  14747. n = _context44.t0;
  14748. if (!(0 !== n.errCode)) {
  14749. _context44.next = 13;
  14750. break;
  14751. }
  14752. throw function (e) {
  14753. return new ne({
  14754. subject: e.errSubject || "uni-secure-network",
  14755. code: e.errCode || e.code || mn.code,
  14756. message: e.errMsg || e.message
  14757. });
  14758. }(n);
  14759. case 13:
  14760. s = n.clientKey, r = n.key;
  14761. _context44.next = 16;
  14762. return this.appUtils.setClientKey({
  14763. provider: this.provider,
  14764. spaceId: this.spaceId,
  14765. clientKey: s,
  14766. key: r
  14767. });
  14768. case 16:
  14769. case "end":
  14770. return _context44.stop();
  14771. }
  14772. }
  14773. }, _callee44, this);
  14774. }));
  14775. function getAppClientKey() {
  14776. return _getAppClientKey.apply(this, arguments);
  14777. }
  14778. return getAppClientKey;
  14779. }()
  14780. }, {
  14781. key: "ensureClientKey",
  14782. value: function () {
  14783. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  14784. var _this17 = this;
  14785. var _ref27,
  14786. _ref27$forceUpdate,
  14787. e,
  14788. _args45 = arguments;
  14789. return _regenerator.default.wrap(function _callee45$(_context45) {
  14790. while (1) {
  14791. switch (_context45.prev = _context45.next) {
  14792. case 0:
  14793. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  14794. _context45.t1 = !0;
  14795. _context45.next = 4;
  14796. return this.hasClientKey();
  14797. case 4:
  14798. _context45.t2 = _context45.sent;
  14799. _context45.t0 = _context45.t1 !== _context45.t2;
  14800. if (_context45.t0) {
  14801. _context45.next = 8;
  14802. break;
  14803. }
  14804. _context45.t0 = e;
  14805. case 8:
  14806. if (!_context45.t0) {
  14807. _context45.next = 10;
  14808. break;
  14809. }
  14810. return _context45.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === d || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== f || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  14811. _this17.scopedGlobalCache.initStatus = p;
  14812. }).catch(function (e) {
  14813. throw _this17.scopedGlobalCache.initStatus = f, e;
  14814. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  14815. case 10:
  14816. case "end":
  14817. return _context45.stop();
  14818. }
  14819. }
  14820. }, _callee45, this);
  14821. }));
  14822. function ensureClientKey() {
  14823. return _ensureClientKey.apply(this, arguments);
  14824. }
  14825. return ensureClientKey;
  14826. }()
  14827. }, {
  14828. key: "prepare",
  14829. value: function () {
  14830. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  14831. var _ref28,
  14832. _ref28$forceUpdate,
  14833. e,
  14834. _args46 = arguments;
  14835. return _regenerator.default.wrap(function _callee46$(_context46) {
  14836. while (1) {
  14837. switch (_context46.prev = _context46.next) {
  14838. case 0:
  14839. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  14840. _context46.next = 3;
  14841. return this.ensureClientKey({
  14842. forceUpdate: e
  14843. });
  14844. case 3:
  14845. case "end":
  14846. return _context46.stop();
  14847. }
  14848. }
  14849. }, _callee46, this);
  14850. }));
  14851. function prepare() {
  14852. return _prepare3.apply(this, arguments);
  14853. }
  14854. return prepare;
  14855. }()
  14856. }, {
  14857. key: "platformGetSignOption",
  14858. value: function () {
  14859. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  14860. var _yield$this$appUtils$2, e, t;
  14861. return _regenerator.default.wrap(function _callee47$(_context47) {
  14862. while (1) {
  14863. switch (_context47.prev = _context47.next) {
  14864. case 0:
  14865. _context47.next = 2;
  14866. return this.appUtils.encrypt({
  14867. provider: this.provider,
  14868. spaceId: this.spaceId,
  14869. data: JSON.stringify({})
  14870. });
  14871. case 2:
  14872. _yield$this$appUtils$2 = _context47.sent;
  14873. e = _yield$this$appUtils$2.data;
  14874. t = _yield$this$appUtils$2.key;
  14875. return _context47.abrupt("return", {
  14876. verifyClientSign: e,
  14877. encryptKeyId: t
  14878. });
  14879. case 6:
  14880. case "end":
  14881. return _context47.stop();
  14882. }
  14883. }
  14884. }, _callee47, this);
  14885. }));
  14886. function platformGetSignOption() {
  14887. return _platformGetSignOption2.apply(this, arguments);
  14888. }
  14889. return platformGetSignOption;
  14890. }()
  14891. }, {
  14892. key: "platformEncryptData",
  14893. value: function () {
  14894. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  14895. var _yield$this$appUtils$3, t, n, s;
  14896. return _regenerator.default.wrap(function _callee48$(_context48) {
  14897. while (1) {
  14898. switch (_context48.prev = _context48.next) {
  14899. case 0:
  14900. _context48.next = 2;
  14901. return this.appUtils.encrypt({
  14902. provider: this.provider,
  14903. spaceId: this.spaceId,
  14904. data: JSON.stringify(e)
  14905. });
  14906. case 2:
  14907. _yield$this$appUtils$3 = _context48.sent;
  14908. t = _yield$this$appUtils$3.data;
  14909. n = _yield$this$appUtils$3.key;
  14910. s = {
  14911. secretType: this.secretType,
  14912. encryptKeyId: n
  14913. };
  14914. return _context48.abrupt("return", this.secretType === Rt ? {
  14915. content: e,
  14916. _uniCloudOptions: s
  14917. } : {
  14918. content: t,
  14919. _uniCloudOptions: s
  14920. });
  14921. case 7:
  14922. case "end":
  14923. return _context48.stop();
  14924. }
  14925. }
  14926. }, _callee48, this);
  14927. }));
  14928. function platformEncryptData(_x35) {
  14929. return _platformEncryptData2.apply(this, arguments);
  14930. }
  14931. return platformEncryptData;
  14932. }()
  14933. }, {
  14934. key: "platformDecryptResult",
  14935. value: function () {
  14936. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  14937. var t, _e$_uniCloudOptions, n, s, r;
  14938. return _regenerator.default.wrap(function _callee49$(_context49) {
  14939. while (1) {
  14940. switch (_context49.prev = _context49.next) {
  14941. case 0:
  14942. t = e.content;
  14943. _e$_uniCloudOptions = e._uniCloudOptions;
  14944. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  14945. s = n.encryptKeyId;
  14946. _context49.next = 6;
  14947. return this.appUtils.decrypt({
  14948. provider: this.provider,
  14949. spaceId: this.spaceId,
  14950. data: t,
  14951. key: s
  14952. });
  14953. case 6:
  14954. r = _context49.sent;
  14955. return _context49.abrupt("return", JSON.parse(r.data));
  14956. case 8:
  14957. case "end":
  14958. return _context49.stop();
  14959. }
  14960. }
  14961. }, _callee49, this);
  14962. }));
  14963. function platformDecryptResult(_x36) {
  14964. return _platformDecryptResult2.apply(this, arguments);
  14965. }
  14966. return platformDecryptResult;
  14967. }()
  14968. }, {
  14969. key: "isClientKeyNotFound",
  14970. value: function isClientKeyNotFound() {
  14971. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14972. var t = e.result || {};
  14973. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  14974. }
  14975. }]);
  14976. return Cn;
  14977. }(Lt);
  14978. function An() {
  14979. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14980. e = _ref29.secretType;
  14981. return e === xt || e === Rt || e === Ut;
  14982. }
  14983. function Pn() {
  14984. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14985. e = _ref30.name,
  14986. _ref30$data = _ref30.data,
  14987. t = _ref30$data === void 0 ? {} : _ref30$data;
  14988. return "app" === A && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  14989. }
  14990. function En() {
  14991. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14992. e = _ref31.provider,
  14993. t = _ref31.spaceId,
  14994. n = _ref31.functionName;
  14995. var _ce = ce(),
  14996. s = _ce.appId,
  14997. r = _ce.uniPlatform,
  14998. i = _ce.osName;
  14999. var o = r;
  15000. "app" === r && (o = i);
  15001. var a = function () {
  15002. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15003. e = _ref32.provider,
  15004. t = _ref32.spaceId;
  15005. var n = C;
  15006. if (!n) return {};
  15007. e = function (e) {
  15008. return "tencent" === e ? "tcb" : e;
  15009. }(e);
  15010. var s = n.find(function (n) {
  15011. return n.provider === e && n.spaceId === t;
  15012. });
  15013. return s && s.config;
  15014. }({
  15015. provider: e,
  15016. spaceId: t
  15017. });
  15018. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  15019. var c = a.accessControl.function || {},
  15020. u = Object.keys(c);
  15021. if (0 === u.length) return !0;
  15022. var l = function (e, t) {
  15023. var n, s, r;
  15024. for (var _i2 = 0; _i2 < e.length; _i2++) {
  15025. var _o2 = e[_i2];
  15026. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  15027. return e.trim();
  15028. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  15029. }
  15030. return n || s || r;
  15031. }(u, n);
  15032. if (!l) return !1;
  15033. if ((c[l] || []).find(function () {
  15034. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15035. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  15036. })) return !0;
  15037. 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")), vn(yn);
  15038. }
  15039. function On(_ref33) {
  15040. var e = _ref33.functionName,
  15041. t = _ref33.result,
  15042. n = _ref33.logPvd;
  15043. if (k && this.__dev__.debugLog && t && t.requestId) {
  15044. var _s11 = JSON.stringify({
  15045. spaceId: this.config.spaceId,
  15046. functionName: e,
  15047. requestId: t.requestId
  15048. });
  15049. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  15050. }
  15051. }
  15052. function xn(e) {
  15053. var t = e.callFunction,
  15054. n = function n(_n7) {
  15055. var _this18 = this;
  15056. var s = _n7.name;
  15057. _n7.data = It.call(e, {
  15058. data: _n7.data
  15059. });
  15060. var r = {
  15061. aliyun: "aliyun",
  15062. tencent: "tcb",
  15063. tcb: "tcb"
  15064. }[this.config.provider],
  15065. i = An(_n7),
  15066. o = Pn(_n7),
  15067. a = i || o;
  15068. return t.call(this, _n7).then(function (e) {
  15069. return e.errCode = 0, !a && On.call(_this18, {
  15070. functionName: s,
  15071. result: e,
  15072. logPvd: r
  15073. }), Promise.resolve(e);
  15074. }, function (e) {
  15075. return !a && On.call(_this18, {
  15076. functionName: s,
  15077. result: e,
  15078. logPvd: r
  15079. }), e && e.message && (e.message = function () {
  15080. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15081. _ref34$message = _ref34.message,
  15082. e = _ref34$message === void 0 ? "" : _ref34$message,
  15083. _ref34$extraInfo = _ref34.extraInfo,
  15084. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  15085. _ref34$formatter = _ref34.formatter,
  15086. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  15087. for (var _s12 = 0; _s12 < n.length; _s12++) {
  15088. var _n$_s = n[_s12],
  15089. _r4 = _n$_s.rule,
  15090. _i3 = _n$_s.content,
  15091. _o3 = _n$_s.mode,
  15092. _a = e.match(_r4);
  15093. if (!_a) continue;
  15094. var _c = _i3;
  15095. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  15096. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  15097. }
  15098. for (var _e21 in t) {
  15099. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  15100. }
  15101. return "replace" === _o3 ? _c : e + _c;
  15102. }
  15103. return e;
  15104. }({
  15105. message: "[".concat(_n7.name, "]: ").concat(e.message),
  15106. formatter: Ct,
  15107. extraInfo: {
  15108. functionName: s
  15109. }
  15110. })), Promise.reject(e);
  15111. });
  15112. };
  15113. e.callFunction = function (t) {
  15114. var _e$config = e.config,
  15115. s = _e$config.provider,
  15116. r = _e$config.spaceId,
  15117. i = t.name;
  15118. var o, a;
  15119. if (t.data = t.data || {}, k && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && E ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Tt), o = Tt) : o = n, o = o.bind(e), Pn(t)) a = n.call(e, t);else if (function (_ref35) {
  15120. var e = _ref35.name,
  15121. _ref35$data = _ref35.data,
  15122. t = _ref35$data === void 0 ? {} : _ref35$data;
  15123. return "mp-weixin" === A && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  15124. }(t)) a = o.call(e, t);else if (An(t)) {
  15125. a = new Sn({
  15126. secretType: t.secretType,
  15127. uniCloudIns: e
  15128. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  15129. } else if (En({
  15130. provider: s,
  15131. spaceId: r,
  15132. functionName: i
  15133. })) {
  15134. a = new Sn({
  15135. secretType: t.secretType,
  15136. uniCloudIns: e
  15137. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  15138. } else a = o(t);
  15139. return Object.defineProperty(a, "result", {
  15140. get: function get() {
  15141. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  15142. }
  15143. }), a;
  15144. };
  15145. }
  15146. Sn = "mp-weixin" !== A && "app" !== A ? /*#__PURE__*/function () {
  15147. function _class2() {
  15148. (0, _classCallCheck2.default)(this, _class2);
  15149. throw vn({
  15150. message: "Platform ".concat(A, " is not supported by secure network")
  15151. });
  15152. }
  15153. return (0, _createClass2.default)(_class2);
  15154. }() : T ? "mp-weixin" === A ? In : Cn : /*#__PURE__*/function () {
  15155. function _class3() {
  15156. (0, _classCallCheck2.default)(this, _class3);
  15157. throw vn({
  15158. message: "Platform ".concat(A, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  15159. });
  15160. }
  15161. return (0, _createClass2.default)(_class3);
  15162. }();
  15163. var Rn = Symbol("CLIENT_DB_INTERNAL");
  15164. function Un(e, t) {
  15165. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  15166. get: function get(e, n, s) {
  15167. if ("_uniClient" === n) return null;
  15168. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  15169. if (n in e || "string" != typeof n) {
  15170. var _t10 = e[n];
  15171. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  15172. }
  15173. return t.get(e, n, s);
  15174. }
  15175. });
  15176. }
  15177. function Ln(e) {
  15178. return {
  15179. on: function on(t, n) {
  15180. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  15181. },
  15182. off: function off(t, n) {
  15183. e[t] = e[t] || [];
  15184. var s = e[t].indexOf(n);
  15185. -1 !== s && e[t].splice(s, 1);
  15186. }
  15187. };
  15188. }
  15189. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  15190. function Dn(e, t) {
  15191. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  15192. }
  15193. function Fn(e) {
  15194. switch (g(e)) {
  15195. case "array":
  15196. return e.map(function (e) {
  15197. return Fn(e);
  15198. });
  15199. case "object":
  15200. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  15201. e[t] = Fn(e[t]);
  15202. }), e;
  15203. case "regexp":
  15204. return {
  15205. $regexp: {
  15206. source: e.source,
  15207. flags: e.flags
  15208. }
  15209. };
  15210. case "date":
  15211. return {
  15212. $date: e.toISOString()
  15213. };
  15214. default:
  15215. return e;
  15216. }
  15217. }
  15218. function qn(e) {
  15219. return e && e.content && e.content.$method;
  15220. }
  15221. var Kn = /*#__PURE__*/function () {
  15222. function Kn(e, t, n) {
  15223. (0, _classCallCheck2.default)(this, Kn);
  15224. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  15225. }
  15226. (0, _createClass2.default)(Kn, [{
  15227. key: "toJSON",
  15228. value: function toJSON() {
  15229. var e = this;
  15230. var t = [e.content];
  15231. for (; e.prevStage;) {
  15232. e = e.prevStage, t.push(e.content);
  15233. }
  15234. return {
  15235. $db: t.reverse().map(function (e) {
  15236. return {
  15237. $method: e.$method,
  15238. $param: Fn(e.$param)
  15239. };
  15240. })
  15241. };
  15242. }
  15243. }, {
  15244. key: "getAction",
  15245. value: function getAction() {
  15246. var e = this.toJSON().$db.find(function (e) {
  15247. return "action" === e.$method;
  15248. });
  15249. return e && e.$param && e.$param[0];
  15250. }
  15251. }, {
  15252. key: "getCommand",
  15253. value: function getCommand() {
  15254. return {
  15255. $db: this.toJSON().$db.filter(function (e) {
  15256. return "action" !== e.$method;
  15257. })
  15258. };
  15259. }
  15260. }, {
  15261. key: "isAggregate",
  15262. get: function get() {
  15263. var e = this;
  15264. for (; e;) {
  15265. var t = qn(e),
  15266. _n8 = qn(e.prevStage);
  15267. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  15268. e = e.prevStage;
  15269. }
  15270. return !1;
  15271. }
  15272. }, {
  15273. key: "isCommand",
  15274. get: function get() {
  15275. var e = this;
  15276. for (; e;) {
  15277. if ("command" === qn(e)) return !0;
  15278. e = e.prevStage;
  15279. }
  15280. return !1;
  15281. }
  15282. }, {
  15283. key: "isAggregateCommand",
  15284. get: function get() {
  15285. var e = this;
  15286. for (; e;) {
  15287. var t = qn(e),
  15288. _n9 = qn(e.prevStage);
  15289. if ("aggregate" === t && "command" === _n9) return !0;
  15290. e = e.prevStage;
  15291. }
  15292. return !1;
  15293. }
  15294. }, {
  15295. key: "getNextStageFn",
  15296. value: function getNextStageFn(e) {
  15297. var t = this;
  15298. return function () {
  15299. return Mn({
  15300. $method: e,
  15301. $param: Fn(Array.from(arguments))
  15302. }, t, t._database);
  15303. };
  15304. }
  15305. }, {
  15306. key: "count",
  15307. get: function get() {
  15308. return this.isAggregate ? this.getNextStageFn("count") : function () {
  15309. return this._send("count", Array.from(arguments));
  15310. };
  15311. }
  15312. }, {
  15313. key: "remove",
  15314. get: function get() {
  15315. return this.isCommand ? this.getNextStageFn("remove") : function () {
  15316. return this._send("remove", Array.from(arguments));
  15317. };
  15318. }
  15319. }, {
  15320. key: "get",
  15321. value: function get() {
  15322. return this._send("get", Array.from(arguments));
  15323. }
  15324. }, {
  15325. key: "add",
  15326. get: function get() {
  15327. return this.isCommand ? this.getNextStageFn("add") : function () {
  15328. return this._send("add", Array.from(arguments));
  15329. };
  15330. }
  15331. }, {
  15332. key: "update",
  15333. value: function update() {
  15334. return this._send("update", Array.from(arguments));
  15335. }
  15336. }, {
  15337. key: "end",
  15338. value: function end() {
  15339. return this._send("end", Array.from(arguments));
  15340. }
  15341. }, {
  15342. key: "set",
  15343. get: function get() {
  15344. return this.isCommand ? this.getNextStageFn("set") : function () {
  15345. throw new Error("JQL禁止使用set方法");
  15346. };
  15347. }
  15348. }, {
  15349. key: "_send",
  15350. value: function _send(e, t) {
  15351. var n = this.getAction(),
  15352. s = this.getCommand();
  15353. if (s.$db.push({
  15354. $method: e,
  15355. $param: Fn(t)
  15356. }), k) {
  15357. var _e22 = s.$db.find(function (e) {
  15358. return "collection" === e.$method;
  15359. }),
  15360. _t11 = _e22 && _e22.$param;
  15361. _t11 && 1 === _t11.length && "string" == typeof _e22.$param[0] && _e22.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  15362. }
  15363. return this._database._callCloudFunction({
  15364. action: n,
  15365. command: s
  15366. });
  15367. }
  15368. }]);
  15369. return Kn;
  15370. }();
  15371. function Mn(e, t, n) {
  15372. return Un(new Kn(e, t, n), {
  15373. get: function get(e, t) {
  15374. var s = "db";
  15375. return e && e.content && (s = e.content.$method), Dn(s, t) ? Mn({
  15376. $method: t
  15377. }, e, n) : function () {
  15378. return Mn({
  15379. $method: t,
  15380. $param: Fn(Array.from(arguments))
  15381. }, e, n);
  15382. };
  15383. }
  15384. });
  15385. }
  15386. function jn(_ref36) {
  15387. var e = _ref36.path,
  15388. t = _ref36.method;
  15389. return /*#__PURE__*/function () {
  15390. function _class4() {
  15391. (0, _classCallCheck2.default)(this, _class4);
  15392. this.param = Array.from(arguments);
  15393. }
  15394. (0, _createClass2.default)(_class4, [{
  15395. key: "toJSON",
  15396. value: function toJSON() {
  15397. return {
  15398. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  15399. return {
  15400. $method: e
  15401. };
  15402. })), [{
  15403. $method: t,
  15404. $param: this.param
  15405. }])
  15406. };
  15407. }
  15408. }]);
  15409. return _class4;
  15410. }();
  15411. }
  15412. function Bn(e) {
  15413. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15414. return Un(new e(t), {
  15415. get: function get(e, t) {
  15416. return Dn("db", t) ? Mn({
  15417. $method: t
  15418. }, null, e) : function () {
  15419. return Mn({
  15420. $method: t,
  15421. $param: Fn(Array.from(arguments))
  15422. }, null, e);
  15423. };
  15424. }
  15425. });
  15426. }
  15427. var $n = /*#__PURE__*/function (_ref37) {
  15428. (0, _inherits2.default)($n, _ref37);
  15429. var _super11 = _createSuper($n);
  15430. function $n() {
  15431. (0, _classCallCheck2.default)(this, $n);
  15432. return _super11.apply(this, arguments);
  15433. }
  15434. (0, _createClass2.default)($n, [{
  15435. key: "_parseResult",
  15436. value: function _parseResult(e) {
  15437. return this._isJQL ? e.result : e;
  15438. }
  15439. }, {
  15440. key: "_callCloudFunction",
  15441. value: function _callCloudFunction(_ref38) {
  15442. var _this19 = this;
  15443. var e = _ref38.action,
  15444. t = _ref38.command,
  15445. n = _ref38.multiCommand,
  15446. s = _ref38.queryList;
  15447. function r(e, t) {
  15448. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  15449. var _r5 = s[_n10];
  15450. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  15451. }
  15452. }
  15453. var i = this,
  15454. o = this._isJQL ? "databaseForJQL" : "database";
  15455. function a(e) {
  15456. return i._callback("error", [e]), q(K(o, "fail"), e).then(function () {
  15457. return q(K(o, "complete"), e);
  15458. }).then(function () {
  15459. return r(null, e), Q(B, {
  15460. type: z,
  15461. content: e
  15462. }), Promise.reject(e);
  15463. });
  15464. }
  15465. var c = q(K(o, "invoke")),
  15466. u = this._uniClient;
  15467. return c.then(function () {
  15468. return u.callFunction({
  15469. name: "DCloud-clientDB",
  15470. type: h,
  15471. data: {
  15472. action: e,
  15473. command: t,
  15474. multiCommand: n
  15475. }
  15476. });
  15477. }).then(function (e) {
  15478. var _e$result = e.result,
  15479. t = _e$result.code,
  15480. n = _e$result.message,
  15481. s = _e$result.token,
  15482. c = _e$result.tokenExpired,
  15483. _e$result$systemInfo = _e$result.systemInfo,
  15484. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  15485. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  15486. var _u$_e = u[_e23],
  15487. _t12 = _u$_e.level,
  15488. _n11 = _u$_e.message,
  15489. _s13 = _u$_e.detail,
  15490. _r6 = console["app" === A && "warn" === _t12 ? "error" : _t12] || console.log;
  15491. var _i4 = "[System Info]" + _n11;
  15492. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  15493. }
  15494. if (t) {
  15495. return a(new ne({
  15496. code: t,
  15497. message: n,
  15498. requestId: e.requestId
  15499. }));
  15500. }
  15501. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  15502. token: s,
  15503. tokenExpired: c
  15504. }), _this19._callbackAuth("refreshToken", [{
  15505. token: s,
  15506. tokenExpired: c
  15507. }]), _this19._callback("refreshToken", [{
  15508. token: s,
  15509. tokenExpired: c
  15510. }]), Q(W, {
  15511. token: s,
  15512. tokenExpired: c
  15513. }));
  15514. var l = [{
  15515. prop: "affectedDocs",
  15516. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  15517. }, {
  15518. prop: "code",
  15519. tips: "code不再推荐使用,请使用errCode替代"
  15520. }, {
  15521. prop: "message",
  15522. tips: "message不再推荐使用,请使用errMsg替代"
  15523. }];
  15524. var _loop2 = function _loop2(_t13) {
  15525. var _l$_t = l[_t13],
  15526. n = _l$_t.prop,
  15527. s = _l$_t.tips;
  15528. if (n in e.result) {
  15529. var _t14 = e.result[n];
  15530. Object.defineProperty(e.result, n, {
  15531. get: function get() {
  15532. return console.warn(s), _t14;
  15533. }
  15534. });
  15535. }
  15536. };
  15537. for (var _t13 = 0; _t13 < l.length; _t13++) {
  15538. _loop2(_t13);
  15539. }
  15540. return function (e) {
  15541. return q(K(o, "success"), e).then(function () {
  15542. return q(K(o, "complete"), e);
  15543. }).then(function () {
  15544. r(e, null);
  15545. var t = i._parseResult(e);
  15546. return Q(B, {
  15547. type: z,
  15548. content: t
  15549. }), Promise.resolve(t);
  15550. });
  15551. }(e);
  15552. }, function (e) {
  15553. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  15554. return a(new ne({
  15555. code: e.code || "SYSTEM_ERROR",
  15556. message: e.message,
  15557. requestId: e.requestId
  15558. }));
  15559. });
  15560. }
  15561. }]);
  15562. return $n;
  15563. }( /*#__PURE__*/function () {
  15564. function _class5() {
  15565. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15566. _ref39$uniClient = _ref39.uniClient,
  15567. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  15568. _ref39$isJQL = _ref39.isJQL,
  15569. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  15570. (0, _classCallCheck2.default)(this, _class5);
  15571. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t || (this.auth = Ln(this._authCallBacks)), this._isJQL = t, Object.assign(this, Ln(this._dbCallBacks)), this.env = Un({}, {
  15572. get: function get(e, t) {
  15573. return {
  15574. $env: t
  15575. };
  15576. }
  15577. }), this.Geo = Un({}, {
  15578. get: function get(e, t) {
  15579. return jn({
  15580. path: ["Geo"],
  15581. method: t
  15582. });
  15583. }
  15584. }), this.serverDate = jn({
  15585. path: [],
  15586. method: "serverDate"
  15587. }), this.RegExp = jn({
  15588. path: [],
  15589. method: "RegExp"
  15590. });
  15591. }
  15592. (0, _createClass2.default)(_class5, [{
  15593. key: "getCloudEnv",
  15594. value: function getCloudEnv(e) {
  15595. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  15596. return {
  15597. $env: e.replace("$cloudEnv_", "")
  15598. };
  15599. }
  15600. }, {
  15601. key: "_callback",
  15602. value: function _callback(e, t) {
  15603. var n = this._dbCallBacks;
  15604. n[e] && n[e].forEach(function (e) {
  15605. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15606. });
  15607. }
  15608. }, {
  15609. key: "_callbackAuth",
  15610. value: function _callbackAuth(e, t) {
  15611. var n = this._authCallBacks;
  15612. n[e] && n[e].forEach(function (e) {
  15613. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15614. });
  15615. }
  15616. }, {
  15617. key: "multiSend",
  15618. value: function multiSend() {
  15619. var e = Array.from(arguments),
  15620. t = e.map(function (e) {
  15621. var t = e.getAction(),
  15622. n = e.getCommand();
  15623. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  15624. return {
  15625. action: t,
  15626. command: n
  15627. };
  15628. });
  15629. return this._callCloudFunction({
  15630. multiCommand: t,
  15631. queryList: e
  15632. });
  15633. }
  15634. }]);
  15635. return _class5;
  15636. }());
  15637. var Wn = "token无效,跳转登录页面",
  15638. zn = "token过期,跳转登录页面",
  15639. Jn = {
  15640. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  15641. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  15642. TOKEN_INVALID: Wn,
  15643. TOKEN_INVALID_WRONG_TOKEN: Wn,
  15644. TOKEN_INVALID_ANONYMOUS_USER: Wn
  15645. },
  15646. Hn = {
  15647. "uni-id-token-expired": zn,
  15648. "uni-id-check-token-failed": Wn,
  15649. "uni-id-token-not-exist": Wn,
  15650. "uni-id-check-device-feature-failed": Wn
  15651. };
  15652. function Gn(e, t) {
  15653. var n = "";
  15654. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  15655. }
  15656. function Vn() {
  15657. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15658. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  15659. var n = [],
  15660. s = [];
  15661. return e.forEach(function (e) {
  15662. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  15663. }), {
  15664. needLoginPage: n,
  15665. notNeedLoginPage: s
  15666. };
  15667. }
  15668. function Yn(e) {
  15669. return e.split("?")[0].replace(/^\//, "");
  15670. }
  15671. function Qn() {
  15672. return function (e) {
  15673. var t = e && e.$page && e.$page.fullPath || "";
  15674. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  15675. }(function () {
  15676. var e = getCurrentPages();
  15677. return e[e.length - 1];
  15678. }());
  15679. }
  15680. function Xn() {
  15681. return Yn(Qn());
  15682. }
  15683. function Zn() {
  15684. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15685. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15686. if (!e) return !1;
  15687. if (!(t && t.list && t.list.length)) return !1;
  15688. var n = t.list,
  15689. s = Yn(e);
  15690. return n.some(function (e) {
  15691. return e.pagePath === s;
  15692. });
  15693. }
  15694. var es = !!_pages.default.uniIdRouter;
  15695. var _ref40 = function () {
  15696. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  15697. _ref21$pages = _ref21.pages,
  15698. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  15699. _ref21$subPackages = _ref21.subPackages,
  15700. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  15701. _ref21$uniIdRouter = _ref21.uniIdRouter,
  15702. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  15703. _ref21$tabBar = _ref21.tabBar,
  15704. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  15705. var i = s.loginPage,
  15706. _s$needLogin = s.needLogin,
  15707. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  15708. _s$resToLogin = s.resToLogin,
  15709. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  15710. _Vn = Vn(e),
  15711. c = _Vn.needLoginPage,
  15712. u = _Vn.notNeedLoginPage,
  15713. _ref23 = function () {
  15714. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15715. var t = [],
  15716. n = [];
  15717. return e.forEach(function (e) {
  15718. var s = e.root,
  15719. _e$pages = e.pages,
  15720. r = _e$pages === void 0 ? [] : _e$pages,
  15721. _Vn2 = Vn(r, s),
  15722. i = _Vn2.needLoginPage,
  15723. o = _Vn2.notNeedLoginPage;
  15724. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  15725. }), {
  15726. needLoginPage: t,
  15727. notNeedLoginPage: n
  15728. };
  15729. }(n),
  15730. l = _ref23.needLoginPage,
  15731. h = _ref23.notNeedLoginPage;
  15732. return {
  15733. loginPage: i,
  15734. routerNeedLogin: o,
  15735. resToLogin: a,
  15736. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  15737. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  15738. loginPageInTabBar: Zn(i, r)
  15739. };
  15740. }(),
  15741. ts = _ref40.loginPage,
  15742. ns = _ref40.routerNeedLogin,
  15743. ss = _ref40.resToLogin,
  15744. rs = _ref40.needLoginPage,
  15745. is = _ref40.notNeedLoginPage,
  15746. os = _ref40.loginPageInTabBar;
  15747. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  15748. function as(e) {
  15749. var t = Xn();
  15750. if ("/" === e.charAt(0)) return e;
  15751. var _e$split = e.split("?"),
  15752. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  15753. n = _e$split2[0],
  15754. s = _e$split2[1],
  15755. r = n.replace(/^\//, "").split("/"),
  15756. i = t.split("/");
  15757. i.pop();
  15758. for (var _e24 = 0; _e24 < r.length; _e24++) {
  15759. var _t15 = r[_e24];
  15760. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  15761. }
  15762. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  15763. }
  15764. function cs(e) {
  15765. var t = Yn(as(e));
  15766. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  15767. return function (e, t) {
  15768. return new RegExp(t).test(e);
  15769. }(e, t);
  15770. }));
  15771. }
  15772. function us(_ref41) {
  15773. var e = _ref41.redirect;
  15774. var t = Yn(e),
  15775. n = Yn(ts);
  15776. return Xn() !== n && t !== n;
  15777. }
  15778. function ls() {
  15779. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15780. e = _ref42.api,
  15781. t = _ref42.redirect;
  15782. if (!t || !us({
  15783. redirect: t
  15784. })) return;
  15785. var n = function (e, t) {
  15786. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  15787. }(ts, t);
  15788. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  15789. var s = {
  15790. navigateTo: uni.navigateTo,
  15791. redirectTo: uni.redirectTo,
  15792. switchTab: uni.switchTab,
  15793. reLaunch: uni.reLaunch
  15794. };
  15795. setTimeout(function () {
  15796. s[e]({
  15797. url: n
  15798. });
  15799. });
  15800. }
  15801. function hs() {
  15802. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15803. e = _ref43.url;
  15804. var t = {
  15805. abortLoginPageJump: !1,
  15806. autoToLoginPage: !1
  15807. },
  15808. n = function () {
  15809. var _re3 = re(),
  15810. e = _re3.token,
  15811. t = _re3.tokenExpired;
  15812. var n;
  15813. if (e) {
  15814. if (t < Date.now()) {
  15815. var _e25 = "uni-id-token-expired";
  15816. n = {
  15817. errCode: _e25,
  15818. errMsg: Hn[_e25]
  15819. };
  15820. }
  15821. } else {
  15822. var _e26 = "uni-id-check-token-failed";
  15823. n = {
  15824. errCode: _e26,
  15825. errMsg: Hn[_e26]
  15826. };
  15827. }
  15828. return n;
  15829. }();
  15830. if (cs(e) && n) {
  15831. n.uniIdRedirectUrl = e;
  15832. if (G($).length > 0) return setTimeout(function () {
  15833. Q($, n);
  15834. }, 0), t.abortLoginPageJump = !0, t;
  15835. t.autoToLoginPage = !0;
  15836. }
  15837. return t;
  15838. }
  15839. function ds() {
  15840. !function () {
  15841. var e = Qn(),
  15842. _hs = hs({
  15843. url: e
  15844. }),
  15845. t = _hs.abortLoginPageJump,
  15846. n = _hs.autoToLoginPage;
  15847. t || n && ls({
  15848. api: "redirectTo",
  15849. redirect: e
  15850. });
  15851. }();
  15852. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  15853. var _loop3 = function _loop3(_t16) {
  15854. var n = e[_t16];
  15855. uni.addInterceptor(n, {
  15856. invoke: function invoke(e) {
  15857. var _hs2 = hs({
  15858. url: e.url
  15859. }),
  15860. t = _hs2.abortLoginPageJump,
  15861. s = _hs2.autoToLoginPage;
  15862. return t ? e : s ? (ls({
  15863. api: n,
  15864. redirect: as(e.url)
  15865. }), !1) : e;
  15866. }
  15867. });
  15868. };
  15869. for (var _t16 = 0; _t16 < e.length; _t16++) {
  15870. _loop3(_t16);
  15871. }
  15872. }
  15873. function ps() {
  15874. this.onResponse(function (e) {
  15875. var t = e.type,
  15876. n = e.content;
  15877. var s = !1;
  15878. switch (t) {
  15879. case "cloudobject":
  15880. s = function (e) {
  15881. if ("object" != (0, _typeof2.default)(e)) return !1;
  15882. var _ref44 = e || {},
  15883. t = _ref44.errCode;
  15884. return t in Hn;
  15885. }(n);
  15886. break;
  15887. case "clientdb":
  15888. s = function (e) {
  15889. if ("object" != (0, _typeof2.default)(e)) return !1;
  15890. var _ref45 = e || {},
  15891. t = _ref45.errCode;
  15892. return t in Jn;
  15893. }(n);
  15894. }
  15895. s && function () {
  15896. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15897. var t = G($);
  15898. ee().then(function () {
  15899. var n = Qn();
  15900. if (n && us({
  15901. redirect: n
  15902. })) return t.length > 0 ? Q($, Object.assign({
  15903. uniIdRedirectUrl: n
  15904. }, e)) : void (ts && ls({
  15905. api: "navigateTo",
  15906. redirect: n
  15907. }));
  15908. });
  15909. }(n);
  15910. });
  15911. }
  15912. function fs(e) {
  15913. !function (e) {
  15914. e.onResponse = function (e) {
  15915. V(B, e);
  15916. }, e.offResponse = function (e) {
  15917. Y(B, e);
  15918. };
  15919. }(e), function (e) {
  15920. e.onNeedLogin = function (e) {
  15921. V($, e);
  15922. }, e.offNeedLogin = function (e) {
  15923. Y($, e);
  15924. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  15925. ds.call(e);
  15926. }), ss && ps.call(e)));
  15927. }(e), function (e) {
  15928. e.onRefreshToken = function (e) {
  15929. V(W, e);
  15930. }, e.offRefreshToken = function (e) {
  15931. Y(W, e);
  15932. };
  15933. }(e);
  15934. }
  15935. var gs;
  15936. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  15937. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15938. function _s() {
  15939. var e = re().token || "",
  15940. t = e.split(".");
  15941. if (!e || 3 !== t.length) return {
  15942. uid: null,
  15943. role: [],
  15944. permission: [],
  15945. tokenExpired: 0
  15946. };
  15947. var n;
  15948. try {
  15949. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  15950. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  15951. }).join(""))));
  15952. } catch (e) {
  15953. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  15954. }
  15955. var s;
  15956. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  15957. }
  15958. gs = "function" != typeof atob ? function (e) {
  15959. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !ys.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  15960. var t;
  15961. e += "==".slice(2 - (3 & e.length));
  15962. for (var n, s, r = "", i = 0; i < e.length;) {
  15963. t = ms.indexOf(e.charAt(i++)) << 18 | ms.indexOf(e.charAt(i++)) << 12 | (n = ms.indexOf(e.charAt(i++))) << 6 | (s = ms.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);
  15964. }
  15965. return r;
  15966. } : atob;
  15967. var ws = s(function (e, t) {
  15968. Object.defineProperty(t, "__esModule", {
  15969. value: !0
  15970. });
  15971. var n = "chooseAndUploadFile:ok",
  15972. s = "chooseAndUploadFile:fail";
  15973. function r(e, t) {
  15974. return e.tempFiles.forEach(function (e, n) {
  15975. 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("."));
  15976. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  15977. return e.path;
  15978. })), e;
  15979. }
  15980. function i(e, t, _ref46) {
  15981. var s = _ref46.onChooseFile,
  15982. r = _ref46.onUploadProgress;
  15983. return t.then(function (e) {
  15984. if (s) {
  15985. var _t17 = s(e);
  15986. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  15987. return void 0 === t ? e : t;
  15988. });
  15989. }
  15990. return e;
  15991. }).then(function (t) {
  15992. return !1 === t ? {
  15993. errMsg: n,
  15994. tempFilePaths: [],
  15995. tempFiles: []
  15996. } : function (e, t) {
  15997. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  15998. var r = arguments.length > 3 ? arguments[3] : undefined;
  15999. (t = Object.assign({}, t)).errMsg = n;
  16000. var i = t.tempFiles,
  16001. o = i.length;
  16002. var a = 0;
  16003. return new Promise(function (n) {
  16004. for (; a < s;) {
  16005. c();
  16006. }
  16007. function c() {
  16008. var s = a++;
  16009. if (s >= o) return void (!i.find(function (e) {
  16010. return !e.url && !e.errMsg;
  16011. }) && n(t));
  16012. var u = i[s];
  16013. e.uploadFile({
  16014. filePath: u.path,
  16015. cloudPath: u.cloudPath,
  16016. fileType: u.fileType,
  16017. onUploadProgress: function onUploadProgress(e) {
  16018. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  16019. }
  16020. }).then(function (e) {
  16021. u.url = e.fileID, s < o && c();
  16022. }).catch(function (e) {
  16023. u.errMsg = e.errMsg || e.message, s < o && c();
  16024. });
  16025. }
  16026. });
  16027. }(e, t, 5, r);
  16028. });
  16029. }
  16030. t.initChooseAndUploadFile = function (e) {
  16031. return function () {
  16032. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  16033. type: "all"
  16034. };
  16035. return "image" === t.type ? i(e, function (e) {
  16036. var t = e.count,
  16037. n = e.sizeType,
  16038. _e$sourceType = e.sourceType,
  16039. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  16040. o = e.extension;
  16041. return new Promise(function (e, a) {
  16042. uni.chooseImage({
  16043. count: t,
  16044. sizeType: n,
  16045. sourceType: i,
  16046. extension: o,
  16047. success: function success(t) {
  16048. e(r(t, "image"));
  16049. },
  16050. fail: function fail(e) {
  16051. a({
  16052. errMsg: e.errMsg.replace("chooseImage:fail", s)
  16053. });
  16054. }
  16055. });
  16056. });
  16057. }(t), t) : "video" === t.type ? i(e, function (e) {
  16058. var t = e.camera,
  16059. n = e.compressed,
  16060. i = e.maxDuration,
  16061. _e$sourceType2 = e.sourceType,
  16062. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  16063. a = e.extension;
  16064. return new Promise(function (e, c) {
  16065. uni.chooseVideo({
  16066. camera: t,
  16067. compressed: n,
  16068. maxDuration: i,
  16069. sourceType: o,
  16070. extension: a,
  16071. success: function success(t) {
  16072. var n = t.tempFilePath,
  16073. s = t.duration,
  16074. i = t.size,
  16075. o = t.height,
  16076. a = t.width;
  16077. e(r({
  16078. errMsg: "chooseVideo:ok",
  16079. tempFilePaths: [n],
  16080. tempFiles: [{
  16081. name: t.tempFile && t.tempFile.name || "",
  16082. path: n,
  16083. size: i,
  16084. type: t.tempFile && t.tempFile.type || "",
  16085. width: a,
  16086. height: o,
  16087. duration: s,
  16088. fileType: "video",
  16089. cloudPath: ""
  16090. }]
  16091. }, "video"));
  16092. },
  16093. fail: function fail(e) {
  16094. c({
  16095. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  16096. });
  16097. }
  16098. });
  16099. });
  16100. }(t), t) : i(e, function (e) {
  16101. var t = e.count,
  16102. n = e.extension;
  16103. return new Promise(function (e, i) {
  16104. var o = uni.chooseFile;
  16105. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  16106. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  16107. });
  16108. o({
  16109. type: "all",
  16110. count: t,
  16111. extension: n,
  16112. success: function success(t) {
  16113. e(r(t));
  16114. },
  16115. fail: function fail(e) {
  16116. i({
  16117. errMsg: e.errMsg.replace("chooseFile:fail", s)
  16118. });
  16119. }
  16120. });
  16121. });
  16122. }(t), t);
  16123. };
  16124. };
  16125. }),
  16126. vs = n(ws);
  16127. var bs = "manual";
  16128. function Ss(e) {
  16129. return {
  16130. props: {
  16131. localdata: {
  16132. type: Array,
  16133. default: function _default() {
  16134. return [];
  16135. }
  16136. },
  16137. options: {
  16138. type: [Object, Array],
  16139. default: function _default() {
  16140. return {};
  16141. }
  16142. },
  16143. spaceInfo: {
  16144. type: Object,
  16145. default: function _default() {
  16146. return {};
  16147. }
  16148. },
  16149. collection: {
  16150. type: [String, Array],
  16151. default: ""
  16152. },
  16153. action: {
  16154. type: String,
  16155. default: ""
  16156. },
  16157. field: {
  16158. type: String,
  16159. default: ""
  16160. },
  16161. orderby: {
  16162. type: String,
  16163. default: ""
  16164. },
  16165. where: {
  16166. type: [String, Object],
  16167. default: ""
  16168. },
  16169. pageData: {
  16170. type: String,
  16171. default: "add"
  16172. },
  16173. pageCurrent: {
  16174. type: Number,
  16175. default: 1
  16176. },
  16177. pageSize: {
  16178. type: Number,
  16179. default: 20
  16180. },
  16181. getcount: {
  16182. type: [Boolean, String],
  16183. default: !1
  16184. },
  16185. gettree: {
  16186. type: [Boolean, String],
  16187. default: !1
  16188. },
  16189. gettreepath: {
  16190. type: [Boolean, String],
  16191. default: !1
  16192. },
  16193. startwith: {
  16194. type: String,
  16195. default: ""
  16196. },
  16197. limitlevel: {
  16198. type: Number,
  16199. default: 10
  16200. },
  16201. groupby: {
  16202. type: String,
  16203. default: ""
  16204. },
  16205. groupField: {
  16206. type: String,
  16207. default: ""
  16208. },
  16209. distinct: {
  16210. type: [Boolean, String],
  16211. default: !1
  16212. },
  16213. foreignKey: {
  16214. type: String,
  16215. default: ""
  16216. },
  16217. loadtime: {
  16218. type: String,
  16219. default: "auto"
  16220. },
  16221. manual: {
  16222. type: Boolean,
  16223. default: !1
  16224. }
  16225. },
  16226. data: function data() {
  16227. return {
  16228. mixinDatacomLoading: !1,
  16229. mixinDatacomHasMore: !1,
  16230. mixinDatacomResData: [],
  16231. mixinDatacomErrorMessage: "",
  16232. mixinDatacomPage: {}
  16233. };
  16234. },
  16235. created: function created() {
  16236. var _this20 = this;
  16237. this.mixinDatacomPage = {
  16238. current: this.pageCurrent,
  16239. size: this.pageSize,
  16240. count: 0
  16241. }, this.$watch(function () {
  16242. var e = [];
  16243. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  16244. e.push(_this20[t]);
  16245. }), e;
  16246. }, function (e, t) {
  16247. if (_this20.loadtime === bs) return;
  16248. var n = !1;
  16249. var s = [];
  16250. for (var _r7 = 2; _r7 < e.length; _r7++) {
  16251. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  16252. }
  16253. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  16254. });
  16255. },
  16256. methods: {
  16257. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  16258. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  16259. var _this21 = this;
  16260. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16261. _ref47$getone = _ref47.getone,
  16262. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  16263. t = _ref47.success,
  16264. n = _ref47.fail;
  16265. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  16266. _this21.mixinDatacomLoading = !1;
  16267. var _n$result = n.result,
  16268. s = _n$result.data,
  16269. r = _n$result.count;
  16270. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  16271. var i = e ? s.length ? s[0] : void 0 : s;
  16272. _this21.mixinDatacomResData = i, t && t(i);
  16273. }).catch(function (e) {
  16274. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  16275. }));
  16276. },
  16277. mixinDatacomGet: function mixinDatacomGet() {
  16278. var _n12;
  16279. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16280. var n = e.database(this.spaceInfo);
  16281. var s = t.action || this.action;
  16282. s && (n = n.action(s));
  16283. var r = t.collection || this.collection;
  16284. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  16285. var i = t.where || this.where;
  16286. i && Object.keys(i).length && (n = n.where(i));
  16287. var o = t.field || this.field;
  16288. o && (n = n.field(o));
  16289. var a = t.foreignKey || this.foreignKey;
  16290. a && (n = n.foreignKey(a));
  16291. var c = t.groupby || this.groupby;
  16292. c && (n = n.groupBy(c));
  16293. var u = t.groupField || this.groupField;
  16294. u && (n = n.groupField(u));
  16295. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  16296. var l = t.orderby || this.orderby;
  16297. l && (n = n.orderBy(l));
  16298. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  16299. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  16300. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  16301. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  16302. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  16303. m = {
  16304. getCount: p
  16305. },
  16306. y = {
  16307. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  16308. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  16309. };
  16310. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  16311. }
  16312. }
  16313. };
  16314. }
  16315. function ks(e) {
  16316. return function (t) {
  16317. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16318. n = function (e) {
  16319. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16320. 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;
  16321. }({
  16322. customUI: !1,
  16323. loadingOptions: {
  16324. title: "加载中...",
  16325. mask: !0
  16326. },
  16327. errorOptions: {
  16328. type: "modal",
  16329. retry: !1
  16330. }
  16331. }, n);
  16332. var _n13 = n,
  16333. s = _n13.customUI,
  16334. r = _n13.loadingOptions,
  16335. i = _n13.errorOptions,
  16336. o = _n13.parseSystemError,
  16337. a = !s;
  16338. return new Proxy({}, {
  16339. get: function get(s, c) {
  16340. return function () {
  16341. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16342. e = _ref48.fn,
  16343. t = _ref48.interceptorName,
  16344. n = _ref48.getCallbackArgs;
  16345. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16346. var _len2,
  16347. s,
  16348. _key2,
  16349. r,
  16350. i,
  16351. o,
  16352. _args = arguments;
  16353. return _regenerator.default.wrap(function _callee50$(_context50) {
  16354. while (1) {
  16355. switch (_context50.prev = _context50.next) {
  16356. case 0:
  16357. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  16358. s[_key2] = _args[_key2];
  16359. }
  16360. r = n ? n({
  16361. params: s
  16362. }) : {};
  16363. _context50.prev = 2;
  16364. _context50.next = 5;
  16365. return q(K(t, "invoke"), _objectSpread({}, r));
  16366. case 5:
  16367. _context50.next = 7;
  16368. return e.apply(void 0, s);
  16369. case 7:
  16370. i = _context50.sent;
  16371. _context50.next = 10;
  16372. return q(K(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  16373. result: i
  16374. }));
  16375. case 10:
  16376. return _context50.abrupt("return", i);
  16377. case 13:
  16378. _context50.prev = 13;
  16379. _context50.t0 = _context50["catch"](2);
  16380. o = _context50.t0;
  16381. _context50.next = 18;
  16382. return q(K(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  16383. error: o
  16384. }));
  16385. case 18:
  16386. throw o;
  16387. case 19:
  16388. _context50.prev = 19;
  16389. _context50.next = 22;
  16390. return q(K(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  16391. error: o
  16392. }) : _objectSpread(_objectSpread({}, r), {}, {
  16393. result: i
  16394. }));
  16395. case 22:
  16396. return _context50.finish(19);
  16397. case 23:
  16398. case "end":
  16399. return _context50.stop();
  16400. }
  16401. }
  16402. }, _callee50, null, [[2, 13, 19, 23]]);
  16403. }));
  16404. }({
  16405. fn: function () {
  16406. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  16407. var h,
  16408. _len3,
  16409. u,
  16410. _key3,
  16411. d,
  16412. p,
  16413. _ref50,
  16414. f,
  16415. g,
  16416. m,
  16417. y,
  16418. _e27,
  16419. _yield,
  16420. _t18,
  16421. _n14,
  16422. _args4 = arguments;
  16423. return _regenerator.default.wrap(function _callee52$(_context52) {
  16424. while (1) {
  16425. switch (_context52.prev = _context52.next) {
  16426. case 0:
  16427. a && uni.showLoading({
  16428. title: r.title,
  16429. mask: r.mask
  16430. });
  16431. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  16432. u[_key3] = _args4[_key3];
  16433. }
  16434. d = {
  16435. name: t,
  16436. type: l,
  16437. data: {
  16438. method: c,
  16439. params: u
  16440. }
  16441. };
  16442. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  16443. var n = t.data.method,
  16444. s = e.secretMethods || {},
  16445. r = s[n] || s["*"];
  16446. r && (t.secretType = r);
  16447. }(n, d);
  16448. p = !1;
  16449. _context52.prev = 5;
  16450. _context52.next = 8;
  16451. return e.callFunction(d);
  16452. case 8:
  16453. h = _context52.sent;
  16454. _context52.next = 14;
  16455. break;
  16456. case 11:
  16457. _context52.prev = 11;
  16458. _context52.t0 = _context52["catch"](5);
  16459. p = !0, h = {
  16460. result: new ne(_context52.t0)
  16461. };
  16462. case 14:
  16463. _ref50 = h.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  16464. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  16465. _context52.next = 39;
  16466. break;
  16467. }
  16468. _e27 = m;
  16469. if (!(p && o)) {
  16470. _context52.next = 24;
  16471. break;
  16472. }
  16473. _context52.next = 20;
  16474. return o({
  16475. objectName: t,
  16476. methodName: c,
  16477. params: u,
  16478. errSubject: f,
  16479. errCode: g,
  16480. errMsg: m
  16481. });
  16482. case 20:
  16483. _context52.t1 = _context52.sent.errMsg;
  16484. if (_context52.t1) {
  16485. _context52.next = 23;
  16486. break;
  16487. }
  16488. _context52.t1 = m;
  16489. case 23:
  16490. _e27 = _context52.t1;
  16491. case 24:
  16492. if (!a) {
  16493. _context52.next = 37;
  16494. break;
  16495. }
  16496. if (!("toast" === i.type)) {
  16497. _context52.next = 29;
  16498. break;
  16499. }
  16500. uni.showToast({
  16501. title: _e27,
  16502. icon: "none"
  16503. });
  16504. _context52.next = 37;
  16505. break;
  16506. case 29:
  16507. if (!("modal" !== i.type)) {
  16508. _context52.next = 31;
  16509. break;
  16510. }
  16511. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  16512. case 31:
  16513. _context52.next = 33;
  16514. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  16515. var _ref52,
  16516. e,
  16517. t,
  16518. n,
  16519. s,
  16520. r,
  16521. _args2 = arguments;
  16522. return _regenerator.default.wrap(function _callee51$(_context51) {
  16523. while (1) {
  16524. switch (_context51.prev = _context51.next) {
  16525. case 0:
  16526. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  16527. return _context51.abrupt("return", new Promise(function (i, o) {
  16528. uni.showModal({
  16529. title: e,
  16530. content: t,
  16531. showCancel: n,
  16532. cancelText: s,
  16533. confirmText: r,
  16534. success: function success(e) {
  16535. i(e);
  16536. },
  16537. fail: function fail() {
  16538. i({
  16539. confirm: !1,
  16540. cancel: !0
  16541. });
  16542. }
  16543. });
  16544. }));
  16545. case 2:
  16546. case "end":
  16547. return _context51.stop();
  16548. }
  16549. }
  16550. }, _callee51);
  16551. }))({
  16552. title: "提示",
  16553. content: _e27,
  16554. showCancel: i.retry,
  16555. cancelText: "取消",
  16556. confirmText: i.retry ? "重试" : "确定"
  16557. });
  16558. case 33:
  16559. _yield = _context52.sent;
  16560. _t18 = _yield.confirm;
  16561. if (!(i.retry && _t18)) {
  16562. _context52.next = 37;
  16563. break;
  16564. }
  16565. return _context52.abrupt("return", s.apply(void 0, u));
  16566. case 37:
  16567. _n14 = new ne({
  16568. subject: f,
  16569. code: g,
  16570. message: m,
  16571. requestId: h.requestId
  16572. });
  16573. throw _n14.detail = h.result, Q(B, {
  16574. type: H,
  16575. content: _n14
  16576. }), _n14;
  16577. case 39:
  16578. return _context52.abrupt("return", (Q(B, {
  16579. type: H,
  16580. content: h.result
  16581. }), h.result));
  16582. case 40:
  16583. case "end":
  16584. return _context52.stop();
  16585. }
  16586. }
  16587. }, _callee52, null, [[5, 11]]);
  16588. }));
  16589. function s() {
  16590. return _s14.apply(this, arguments);
  16591. }
  16592. return s;
  16593. }(),
  16594. interceptorName: "callObject",
  16595. getCallbackArgs: function getCallbackArgs() {
  16596. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16597. e = _ref53.params;
  16598. return {
  16599. objectName: t,
  16600. methodName: c,
  16601. params: e
  16602. };
  16603. }
  16604. });
  16605. }
  16606. });
  16607. };
  16608. }
  16609. function Is(e) {
  16610. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  16611. }
  16612. function Ts() {
  16613. return _Ts.apply(this, arguments);
  16614. }
  16615. function _Ts() {
  16616. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  16617. var _ref60,
  16618. e,
  16619. _ref60$callLoginByWei,
  16620. t,
  16621. n,
  16622. s,
  16623. r,
  16624. _args6 = arguments;
  16625. return _regenerator.default.wrap(function _callee54$(_context54) {
  16626. while (1) {
  16627. switch (_context54.prev = _context54.next) {
  16628. case 0:
  16629. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.openid, _ref60$callLoginByWei = _ref60.callLoginByWeixin, t = _ref60$callLoginByWei === void 0 ? !1 : _ref60$callLoginByWei;
  16630. n = Is(this);
  16631. if (!("mp-weixin" !== A)) {
  16632. _context54.next = 4;
  16633. break;
  16634. }
  16635. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(A, "`"));
  16636. case 4:
  16637. if (!(e && t)) {
  16638. _context54.next = 6;
  16639. break;
  16640. }
  16641. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  16642. case 6:
  16643. if (!e) {
  16644. _context54.next = 8;
  16645. break;
  16646. }
  16647. return _context54.abrupt("return", (n.mpWeixinOpenid = e, {}));
  16648. case 8:
  16649. _context54.next = 10;
  16650. return new Promise(function (e, t) {
  16651. uni.login({
  16652. success: function success(t) {
  16653. e(t.code);
  16654. },
  16655. fail: function fail(e) {
  16656. t(new Error(e.errMsg));
  16657. }
  16658. });
  16659. });
  16660. case 10:
  16661. s = _context54.sent;
  16662. r = this.importObject("uni-id-co", {
  16663. customUI: !0
  16664. });
  16665. _context54.next = 14;
  16666. return r.secureNetworkHandshakeByWeixin({
  16667. code: s,
  16668. callLoginByWeixin: t
  16669. });
  16670. case 14:
  16671. n.mpWeixinCode = s;
  16672. return _context54.abrupt("return", {
  16673. code: s
  16674. });
  16675. case 16:
  16676. case "end":
  16677. return _context54.stop();
  16678. }
  16679. }
  16680. }, _callee54, this);
  16681. }));
  16682. return _Ts.apply(this, arguments);
  16683. }
  16684. function Cs(_x37) {
  16685. return _Cs.apply(this, arguments);
  16686. }
  16687. function _Cs() {
  16688. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e) {
  16689. var t;
  16690. return _regenerator.default.wrap(function _callee55$(_context55) {
  16691. while (1) {
  16692. switch (_context55.prev = _context55.next) {
  16693. case 0:
  16694. t = Is(this);
  16695. return _context55.abrupt("return", (t.initPromise || (t.initPromise = Ts.call(this, e)), t.initPromise));
  16696. case 2:
  16697. case "end":
  16698. return _context55.stop();
  16699. }
  16700. }
  16701. }, _callee55, this);
  16702. }));
  16703. return _Cs.apply(this, arguments);
  16704. }
  16705. function As(e) {
  16706. return function () {
  16707. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16708. t = _ref54.openid,
  16709. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  16710. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  16711. return Cs.call(e, {
  16712. openid: t,
  16713. callLoginByWeixin: n
  16714. });
  16715. };
  16716. }
  16717. function Ps(_x38, _x39) {
  16718. return _Ps.apply(this, arguments);
  16719. }
  16720. function _Ps() {
  16721. _Ps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e, t) {
  16722. var n, _e31, s;
  16723. return _regenerator.default.wrap(function _callee56$(_context56) {
  16724. while (1) {
  16725. switch (_context56.prev = _context56.next) {
  16726. case 0:
  16727. n = "http://".concat(e, ":").concat(t, "/system/ping");
  16728. _context56.prev = 1;
  16729. _context56.next = 4;
  16730. return s = {
  16731. url: n,
  16732. timeout: 500
  16733. }, new Promise(function (e, t) {
  16734. se.request(_objectSpread(_objectSpread({}, s), {}, {
  16735. success: function success(t) {
  16736. e(t);
  16737. },
  16738. fail: function fail(e) {
  16739. t(e);
  16740. }
  16741. }));
  16742. });
  16743. case 4:
  16744. _e31 = _context56.sent;
  16745. return _context56.abrupt("return", !(!_e31.data || 0 !== _e31.data.code));
  16746. case 8:
  16747. _context56.prev = 8;
  16748. _context56.t0 = _context56["catch"](1);
  16749. return _context56.abrupt("return", !1);
  16750. case 11:
  16751. case "end":
  16752. return _context56.stop();
  16753. }
  16754. }
  16755. }, _callee56, null, [[1, 8]]);
  16756. }));
  16757. return _Ps.apply(this, arguments);
  16758. }
  16759. function Es(_x40) {
  16760. return _Es.apply(this, arguments);
  16761. }
  16762. function _Es() {
  16763. _Es = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e) {
  16764. var _ce2, _e32, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  16765. return _regenerator.default.wrap(function _callee58$(_context58) {
  16766. while (1) {
  16767. switch (_context58.prev = _context58.next) {
  16768. case 0:
  16769. if (k) {
  16770. _context58.next = 2;
  16771. break;
  16772. }
  16773. return _context58.abrupt("return", Promise.resolve());
  16774. case 2:
  16775. if ("app" === A) {
  16776. _ce2 = ce(), _e32 = _ce2.osName, _t20 = _ce2.osVersion;
  16777. "ios" === _e32 && function (e) {
  16778. if (!e || "string" != typeof e) return 0;
  16779. var t = e.match(/^(\d+)./);
  16780. return t && t[1] ? parseInt(t[1]) : 0;
  16781. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  16782. }
  16783. t = e.__dev__;
  16784. if (t.debugInfo) {
  16785. _context58.next = 6;
  16786. break;
  16787. }
  16788. return _context58.abrupt("return");
  16789. case 6:
  16790. _t$debugInfo = t.debugInfo;
  16791. n = _t$debugInfo.address;
  16792. s = _t$debugInfo.servePort;
  16793. _context58.next = 11;
  16794. return function () {
  16795. var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  16796. var n, _s15, _r8;
  16797. return _regenerator.default.wrap(function _callee57$(_context57) {
  16798. while (1) {
  16799. switch (_context57.prev = _context57.next) {
  16800. case 0:
  16801. _s15 = 0;
  16802. case 1:
  16803. if (!(_s15 < e.length)) {
  16804. _context57.next = 11;
  16805. break;
  16806. }
  16807. _r8 = e[_s15];
  16808. _context57.next = 5;
  16809. return Ps(_r8, t);
  16810. case 5:
  16811. if (!_context57.sent) {
  16812. _context57.next = 8;
  16813. break;
  16814. }
  16815. n = _r8;
  16816. return _context57.abrupt("break", 11);
  16817. case 8:
  16818. _s15++;
  16819. _context57.next = 1;
  16820. break;
  16821. case 11:
  16822. return _context57.abrupt("return", {
  16823. address: n,
  16824. port: t
  16825. });
  16826. case 12:
  16827. case "end":
  16828. return _context57.stop();
  16829. }
  16830. }
  16831. }, _callee57);
  16832. }));
  16833. return function (_x41, _x42) {
  16834. return _ref61.apply(this, arguments);
  16835. };
  16836. }()(n, s);
  16837. case 11:
  16838. _yield2 = _context58.sent;
  16839. r = _yield2.address;
  16840. if (!r) {
  16841. _context58.next = 15;
  16842. break;
  16843. }
  16844. return _context58.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  16845. case 15:
  16846. i = console["app" === A ? "error" : "warn"];
  16847. o = "";
  16848. 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" === A && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === A.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  16849. _context58.next = 19;
  16850. break;
  16851. }
  16852. throw new Error(o);
  16853. case 19:
  16854. i(o);
  16855. case 20:
  16856. case "end":
  16857. return _context58.stop();
  16858. }
  16859. }
  16860. }, _callee58);
  16861. }));
  16862. return _Es.apply(this, arguments);
  16863. }
  16864. function Os(e) {
  16865. e._initPromiseHub || (e._initPromiseHub = new b({
  16866. createPromise: function createPromise() {
  16867. var t = Promise.resolve();
  16868. var n;
  16869. n = 1, t = new Promise(function (e) {
  16870. setTimeout(function () {
  16871. e();
  16872. }, n);
  16873. });
  16874. var s = e.auth();
  16875. return t.then(function () {
  16876. return s.getLoginState();
  16877. }).then(function (e) {
  16878. return e ? Promise.resolve() : s.signInAnonymously();
  16879. });
  16880. }
  16881. }));
  16882. }
  16883. var xs = {
  16884. tcb: bt,
  16885. tencent: bt,
  16886. aliyun: ge,
  16887. private: kt
  16888. };
  16889. var Rs = new ( /*#__PURE__*/function () {
  16890. function _class6() {
  16891. (0, _classCallCheck2.default)(this, _class6);
  16892. }
  16893. (0, _createClass2.default)(_class6, [{
  16894. key: "init",
  16895. value: function init(e) {
  16896. var t = {};
  16897. var n = xs[e.provider];
  16898. if (!n) throw new Error("未提供正确的provider参数");
  16899. t = n.init(e), k && function (e) {
  16900. if (!k) return;
  16901. var t = {};
  16902. e.__dev__ = t, t.debugLog = k && ("web" === A && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === A);
  16903. var n = P;
  16904. n && !n.code && (t.debugInfo = n);
  16905. var s = new b({
  16906. createPromise: function createPromise() {
  16907. return Es(e);
  16908. }
  16909. });
  16910. t.initLocalNetwork = function () {
  16911. return s.exec();
  16912. };
  16913. }(t), Os(t), xn(t), function (e) {
  16914. var t = e.uploadFile;
  16915. e.uploadFile = function (e) {
  16916. return t.call(this, e);
  16917. };
  16918. }(t), function (e) {
  16919. e.database = function (t) {
  16920. if (t && Object.keys(t).length > 0) return e.init(t).database();
  16921. if (this._database) return this._database;
  16922. var n = Bn($n, {
  16923. uniClient: e
  16924. });
  16925. return this._database = n, n;
  16926. }, e.databaseForJQL = function (t) {
  16927. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  16928. if (this._databaseForJQL) return this._databaseForJQL;
  16929. var n = Bn($n, {
  16930. uniClient: e,
  16931. isJQL: !0
  16932. });
  16933. return this._databaseForJQL = n, n;
  16934. };
  16935. }(t), function (e) {
  16936. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  16937. get mixinDatacom() {
  16938. return Ss(e);
  16939. }
  16940. }), e.importObject = ks(e), e.initSecureNetworkByWeixin = As(e);
  16941. }(t);
  16942. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  16943. if (!t[e]) return;
  16944. var n = t[e];
  16945. t[e] = function () {
  16946. return n.apply(t, Array.from(arguments));
  16947. }, t[e] = function (e, t) {
  16948. return function (n) {
  16949. var _this22 = this;
  16950. var s = !1;
  16951. if ("callFunction" === t) {
  16952. var _e28 = n && n.type || u;
  16953. s = _e28 !== u;
  16954. }
  16955. var r = "callFunction" === t && !s,
  16956. i = this._initPromiseHub.exec();
  16957. n = n || {};
  16958. var _te2 = te(n),
  16959. o = _te2.success,
  16960. a = _te2.fail,
  16961. c = _te2.complete,
  16962. l = i.then(function () {
  16963. return s ? Promise.resolve() : q(K(t, "invoke"), n);
  16964. }).then(function () {
  16965. return e.call(_this22, n);
  16966. }).then(function (e) {
  16967. return s ? Promise.resolve(e) : q(K(t, "success"), e).then(function () {
  16968. return q(K(t, "complete"), e);
  16969. }).then(function () {
  16970. return r && Q(B, {
  16971. type: J,
  16972. content: e
  16973. }), Promise.resolve(e);
  16974. });
  16975. }, function (e) {
  16976. return s ? Promise.reject(e) : q(K(t, "fail"), e).then(function () {
  16977. return q(K(t, "complete"), e);
  16978. }).then(function () {
  16979. return Q(B, {
  16980. type: J,
  16981. content: e
  16982. }), Promise.reject(e);
  16983. });
  16984. });
  16985. if (!(o || a || c)) return l;
  16986. l.then(function (e) {
  16987. o && o(e), c && c(e), r && Q(B, {
  16988. type: J,
  16989. content: e
  16990. });
  16991. }, function (e) {
  16992. a && a(e), c && c(e), r && Q(B, {
  16993. type: J,
  16994. content: e
  16995. });
  16996. });
  16997. };
  16998. }(t[e], e).bind(t);
  16999. }), t.init = this.init, t;
  17000. }
  17001. }]);
  17002. return _class6;
  17003. }())();
  17004. (function () {
  17005. var e = E;
  17006. var t = {};
  17007. if (e && 1 === e.length) t = e[0], Rs = Rs.init(t), Rs._isDefault = !0;else {
  17008. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  17009. var _n15;
  17010. _n15 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  17011. Rs[e] = function () {
  17012. return console.error(_n15), Promise.reject(new ne({
  17013. code: "SYS_ERR",
  17014. message: _n15
  17015. }));
  17016. };
  17017. });
  17018. }
  17019. Object.assign(Rs, {
  17020. get mixinDatacom() {
  17021. return Ss(Rs);
  17022. }
  17023. }), fs(Rs), Rs.addInterceptor = D, Rs.removeInterceptor = F, Rs.interceptObject = M, k && "web" === A && (window.uniCloud = Rs);
  17024. })();
  17025. var Us = Rs;
  17026. exports.default = Us;
  17027. /* 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"]))
  17028. /***/ }),
  17029. /* 143 */
  17030. /*!*********************************************************!*\
  17031. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  17032. \*********************************************************/
  17033. /*! no static exports found */
  17034. /***/ (function(module, exports, __webpack_require__) {
  17035. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  17036. function _inherits(subClass, superClass) {
  17037. if (typeof superClass !== "function" && superClass !== null) {
  17038. throw new TypeError("Super expression must either be null or a function");
  17039. }
  17040. subClass.prototype = Object.create(superClass && superClass.prototype, {
  17041. constructor: {
  17042. value: subClass,
  17043. writable: true,
  17044. configurable: true
  17045. }
  17046. });
  17047. Object.defineProperty(subClass, "prototype", {
  17048. writable: false
  17049. });
  17050. if (superClass) setPrototypeOf(subClass, superClass);
  17051. }
  17052. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17053. /***/ }),
  17054. /* 144 */
  17055. /*!**************************************************************************!*\
  17056. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  17057. \**************************************************************************/
  17058. /*! no static exports found */
  17059. /***/ (function(module, exports, __webpack_require__) {
  17060. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  17061. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 145);
  17062. function _possibleConstructorReturn(self, call) {
  17063. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  17064. return call;
  17065. } else if (call !== void 0) {
  17066. throw new TypeError("Derived constructors may only return object or undefined");
  17067. }
  17068. return assertThisInitialized(self);
  17069. }
  17070. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17071. /***/ }),
  17072. /* 145 */
  17073. /*!**********************************************************************!*\
  17074. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  17075. \**********************************************************************/
  17076. /*! no static exports found */
  17077. /***/ (function(module, exports) {
  17078. function _assertThisInitialized(self) {
  17079. if (self === void 0) {
  17080. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  17081. }
  17082. return self;
  17083. }
  17084. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17085. /***/ }),
  17086. /* 146 */
  17087. /*!***************************************************************!*\
  17088. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  17089. \***************************************************************/
  17090. /*! no static exports found */
  17091. /***/ (function(module, exports) {
  17092. function _getPrototypeOf(o) {
  17093. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  17094. return o.__proto__ || Object.getPrototypeOf(o);
  17095. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17096. return _getPrototypeOf(o);
  17097. }
  17098. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17099. /***/ }),
  17100. /* 147 */
  17101. /*!****************************************************************!*\
  17102. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  17103. \****************************************************************/
  17104. /*! no static exports found */
  17105. /***/ (function(module, exports, __webpack_require__) {
  17106. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 146);
  17107. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  17108. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 148);
  17109. var construct = __webpack_require__(/*! ./construct.js */ 15);
  17110. function _wrapNativeSuper(Class) {
  17111. var _cache = typeof Map === "function" ? new Map() : undefined;
  17112. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  17113. if (Class === null || !isNativeFunction(Class)) return Class;
  17114. if (typeof Class !== "function") {
  17115. throw new TypeError("Super expression must either be null or a function");
  17116. }
  17117. if (typeof _cache !== "undefined") {
  17118. if (_cache.has(Class)) return _cache.get(Class);
  17119. _cache.set(Class, Wrapper);
  17120. }
  17121. function Wrapper() {
  17122. return construct(Class, arguments, getPrototypeOf(this).constructor);
  17123. }
  17124. Wrapper.prototype = Object.create(Class.prototype, {
  17125. constructor: {
  17126. value: Wrapper,
  17127. enumerable: false,
  17128. writable: true,
  17129. configurable: true
  17130. }
  17131. });
  17132. return setPrototypeOf(Wrapper, Class);
  17133. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17134. return _wrapNativeSuper(Class);
  17135. }
  17136. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17137. /***/ }),
  17138. /* 148 */
  17139. /*!*****************************************************************!*\
  17140. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  17141. \*****************************************************************/
  17142. /*! no static exports found */
  17143. /***/ (function(module, exports) {
  17144. function _isNativeFunction(fn) {
  17145. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  17146. }
  17147. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17148. /***/ }),
  17149. /* 149 */
  17150. /*!************************************************************************************!*\
  17151. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"origin-pages-json"} ***!
  17152. \************************************************************************************/
  17153. /*! no static exports found */
  17154. /***/ (function(module, exports, __webpack_require__) {
  17155. "use strict";
  17156. Object.defineProperty(exports, "__esModule", {
  17157. value: true
  17158. });
  17159. exports.default = void 0;
  17160. var _default = {
  17161. "pages": [{
  17162. "path": "pages/login/index",
  17163. "style": {
  17164. "navigationBarTitleText": "地块管护",
  17165. "navigationStyle": "custom"
  17166. }
  17167. }, {
  17168. "path": "pages/main/index",
  17169. "style": {
  17170. "navigationBarTitleText": "地块管护",
  17171. "navigationStyle": "custom"
  17172. }
  17173. }, {
  17174. "path": "pages/receivedDetail/index",
  17175. "style": {
  17176. "navigationBarTitleText": "地块管护",
  17177. "navigationStyle": "custom"
  17178. }
  17179. }, {
  17180. "path": "pages/receivedDetail2/index",
  17181. "style": {
  17182. "navigationBarTitleText": "要素一本账",
  17183. "navigationStyle": "custom"
  17184. }
  17185. }, {
  17186. "path": "pages/nocheckDetail/index",
  17187. "style": {
  17188. "navigationBarTitleText": "地块管护",
  17189. "navigationStyle": "custom"
  17190. }
  17191. }],
  17192. "globalStyle": {
  17193. "navigationBarTextStyle": "black",
  17194. "navigationBarTitleText": "uni-app",
  17195. "navigationBarBackgroundColor": "#F8F8F8",
  17196. "backgroundColor": "#F8F8F8"
  17197. },
  17198. "uniIdRouter": {},
  17199. "condition": {
  17200. "current": 0,
  17201. "list": [{
  17202. "name": "",
  17203. "path": "",
  17204. "query": ""
  17205. }]
  17206. }
  17207. };
  17208. exports.default = _default;
  17209. /***/ }),
  17210. /* 150 */
  17211. /*!***********************************************************************!*\
  17212. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"stat"} ***!
  17213. \***********************************************************************/
  17214. /*! no static exports found */
  17215. /***/ (function(module, exports, __webpack_require__) {
  17216. "use strict";
  17217. Object.defineProperty(exports, "__esModule", {
  17218. value: true
  17219. });
  17220. exports.default = void 0;
  17221. var _default = {
  17222. "appid": "__UNI__50B3EE1"
  17223. };
  17224. exports.default = _default;
  17225. /***/ }),
  17226. /* 151 */
  17227. /*!*****************************************************************************************************************************!*\
  17228. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  17229. \*****************************************************************************************************************************/
  17230. /*! no static exports found */
  17231. /***/ (function(module, exports, __webpack_require__) {
  17232. "use strict";
  17233. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  17234. Object.defineProperty(exports, "__esModule", {
  17235. value: true
  17236. });
  17237. exports.chooseAndUploadFile = chooseAndUploadFile;
  17238. exports.uploadCloudFiles = uploadCloudFiles;
  17239. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  17240. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  17241. function chooseImage(opts) {
  17242. var count = opts.count,
  17243. _opts$sizeType = opts.sizeType,
  17244. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  17245. sourceType = opts.sourceType,
  17246. extension = opts.extension;
  17247. return new Promise(function (resolve, reject) {
  17248. uni.chooseImage({
  17249. count: count,
  17250. sizeType: sizeType,
  17251. sourceType: sourceType,
  17252. extension: extension,
  17253. success: function success(res) {
  17254. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  17255. },
  17256. fail: function fail(res) {
  17257. reject({
  17258. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  17259. });
  17260. }
  17261. });
  17262. });
  17263. }
  17264. function chooseVideo(opts) {
  17265. var camera = opts.camera,
  17266. compressed = opts.compressed,
  17267. maxDuration = opts.maxDuration,
  17268. sourceType = opts.sourceType,
  17269. extension = opts.extension;
  17270. return new Promise(function (resolve, reject) {
  17271. uni.chooseVideo({
  17272. camera: camera,
  17273. compressed: compressed,
  17274. maxDuration: maxDuration,
  17275. sourceType: sourceType,
  17276. extension: extension,
  17277. success: function success(res) {
  17278. var tempFilePath = res.tempFilePath,
  17279. duration = res.duration,
  17280. size = res.size,
  17281. height = res.height,
  17282. width = res.width;
  17283. resolve(normalizeChooseAndUploadFileRes({
  17284. errMsg: 'chooseVideo:ok',
  17285. tempFilePaths: [tempFilePath],
  17286. tempFiles: [{
  17287. name: res.tempFile && res.tempFile.name || '',
  17288. path: tempFilePath,
  17289. size: size,
  17290. type: res.tempFile && res.tempFile.type || '',
  17291. width: width,
  17292. height: height,
  17293. duration: duration,
  17294. fileType: 'video',
  17295. cloudPath: ''
  17296. }]
  17297. }, 'video'));
  17298. },
  17299. fail: function fail(res) {
  17300. reject({
  17301. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  17302. });
  17303. }
  17304. });
  17305. });
  17306. }
  17307. function chooseAll(opts) {
  17308. var count = opts.count,
  17309. extension = opts.extension;
  17310. return new Promise(function (resolve, reject) {
  17311. var chooseFile = uni.chooseFile;
  17312. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  17313. chooseFile = wx.chooseMessageFile;
  17314. }
  17315. if (typeof chooseFile !== 'function') {
  17316. return reject({
  17317. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  17318. });
  17319. }
  17320. chooseFile({
  17321. type: 'all',
  17322. count: count,
  17323. extension: extension,
  17324. success: function success(res) {
  17325. resolve(normalizeChooseAndUploadFileRes(res));
  17326. },
  17327. fail: function fail(res) {
  17328. reject({
  17329. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  17330. });
  17331. }
  17332. });
  17333. });
  17334. }
  17335. function normalizeChooseAndUploadFileRes(res, fileType) {
  17336. res.tempFiles.forEach(function (item, index) {
  17337. if (!item.name) {
  17338. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  17339. }
  17340. if (fileType) {
  17341. item.fileType = fileType;
  17342. }
  17343. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  17344. });
  17345. if (!res.tempFilePaths) {
  17346. res.tempFilePaths = res.tempFiles.map(function (file) {
  17347. return file.path;
  17348. });
  17349. }
  17350. return res;
  17351. }
  17352. function uploadCloudFiles(files) {
  17353. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  17354. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  17355. files = JSON.parse(JSON.stringify(files));
  17356. var len = files.length;
  17357. var count = 0;
  17358. var self = this;
  17359. return new Promise(function (resolve) {
  17360. while (count < max) {
  17361. next();
  17362. }
  17363. function next() {
  17364. var cur = count++;
  17365. if (cur >= len) {
  17366. !files.find(function (item) {
  17367. return !item.url && !item.errMsg;
  17368. }) && resolve(files);
  17369. return;
  17370. }
  17371. var fileItem = files[cur];
  17372. var index = self.files.findIndex(function (v) {
  17373. return v.uuid === fileItem.uuid;
  17374. });
  17375. fileItem.url = '';
  17376. delete fileItem.errMsg;
  17377. uniCloud.uploadFile({
  17378. filePath: fileItem.path,
  17379. cloudPath: fileItem.cloudPath,
  17380. fileType: fileItem.fileType,
  17381. onUploadProgress: function onUploadProgress(res) {
  17382. res.index = index;
  17383. _onUploadProgress && _onUploadProgress(res);
  17384. }
  17385. }).then(function (res) {
  17386. fileItem.url = res.fileID;
  17387. fileItem.index = index;
  17388. if (cur < len) {
  17389. next();
  17390. }
  17391. }).catch(function (res) {
  17392. fileItem.errMsg = res.errMsg || res.message;
  17393. fileItem.index = index;
  17394. if (cur < len) {
  17395. next();
  17396. }
  17397. });
  17398. }
  17399. });
  17400. }
  17401. function uploadFiles(choosePromise, _ref) {
  17402. var onChooseFile = _ref.onChooseFile,
  17403. onUploadProgress = _ref.onUploadProgress;
  17404. return choosePromise.then(function (res) {
  17405. if (onChooseFile) {
  17406. var customChooseRes = onChooseFile(res);
  17407. if (typeof customChooseRes !== 'undefined') {
  17408. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  17409. return typeof chooseRes === 'undefined' ? res : chooseRes;
  17410. });
  17411. }
  17412. }
  17413. return res;
  17414. }).then(function (res) {
  17415. if (res === false) {
  17416. return {
  17417. errMsg: ERR_MSG_OK,
  17418. tempFilePaths: [],
  17419. tempFiles: []
  17420. };
  17421. }
  17422. return res;
  17423. });
  17424. }
  17425. function chooseAndUploadFile() {
  17426. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17427. type: 'all'
  17428. };
  17429. if (opts.type === 'image') {
  17430. return uploadFiles(chooseImage(opts), opts);
  17431. } else if (opts.type === 'video') {
  17432. return uploadFiles(chooseVideo(opts), opts);
  17433. }
  17434. return uploadFiles(chooseAll(opts), opts);
  17435. }
  17436. /* 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 */ 142)["default"]))
  17437. /***/ }),
  17438. /* 152 */
  17439. /*!************************************************************************************************************!*\
  17440. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  17441. \************************************************************************************************************/
  17442. /*! no static exports found */
  17443. /***/ (function(module, exports, __webpack_require__) {
  17444. "use strict";
  17445. /* WEBPACK VAR INJECTION */(function(uni) {
  17446. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17447. Object.defineProperty(exports, "__esModule", {
  17448. value: true
  17449. });
  17450. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  17451. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 76));
  17452. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 78));
  17453. /**
  17454. * 获取文件名和后缀
  17455. * @param {String} name
  17456. */
  17457. var get_file_ext = function get_file_ext(name) {
  17458. var last_len = name.lastIndexOf('.');
  17459. var len = name.length;
  17460. return {
  17461. name: name.substring(0, last_len),
  17462. ext: name.substring(last_len + 1, len)
  17463. };
  17464. };
  17465. /**
  17466. * 获取扩展名
  17467. * @param {Array} fileExtname
  17468. */
  17469. exports.get_file_ext = get_file_ext;
  17470. var get_extname = function get_extname(fileExtname) {
  17471. if (!Array.isArray(fileExtname)) {
  17472. var extname = fileExtname.replace(/(\[|\])/g, '');
  17473. return extname.split(',');
  17474. } else {
  17475. return fileExtname;
  17476. }
  17477. return [];
  17478. };
  17479. /**
  17480. * 获取文件和检测是否可选
  17481. */
  17482. exports.get_extname = get_extname;
  17483. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  17484. var filePaths = [];
  17485. var files = [];
  17486. if (!_extname || _extname.length === 0) {
  17487. return {
  17488. filePaths: filePaths,
  17489. files: files
  17490. };
  17491. }
  17492. res.tempFiles.forEach(function (v) {
  17493. var fileFullName = get_file_ext(v.name);
  17494. var extname = fileFullName.ext.toLowerCase();
  17495. if (_extname.indexOf(extname) !== -1) {
  17496. files.push(v);
  17497. filePaths.push(v.path);
  17498. }
  17499. });
  17500. if (files.length !== res.tempFiles.length) {
  17501. uni.showToast({
  17502. 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"),
  17503. icon: 'none',
  17504. duration: 5000
  17505. });
  17506. }
  17507. return {
  17508. filePaths: filePaths,
  17509. files: files
  17510. };
  17511. };
  17512. /**
  17513. * 获取图片信息
  17514. * @param {Object} filepath
  17515. */
  17516. exports.get_files_and_is_max = get_files_and_is_max;
  17517. var get_file_info = function get_file_info(filepath) {
  17518. return new Promise(function (resolve, reject) {
  17519. uni.getImageInfo({
  17520. src: filepath,
  17521. success: function success(res) {
  17522. resolve(res);
  17523. },
  17524. fail: function fail(err) {
  17525. reject(err);
  17526. }
  17527. });
  17528. });
  17529. };
  17530. /**
  17531. * 获取封装数据
  17532. */
  17533. exports.get_file_info = get_file_info;
  17534. var get_file_data = /*#__PURE__*/function () {
  17535. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  17536. var type,
  17537. fileFullName,
  17538. extname,
  17539. filedata,
  17540. imageinfo,
  17541. _args = arguments;
  17542. return _regenerator.default.wrap(function _callee$(_context) {
  17543. while (1) {
  17544. switch (_context.prev = _context.next) {
  17545. case 0:
  17546. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  17547. // 最终需要上传数据库的数据
  17548. fileFullName = get_file_ext(files.name);
  17549. extname = fileFullName.ext.toLowerCase();
  17550. filedata = {
  17551. name: files.name,
  17552. uuid: files.uuid,
  17553. extname: extname || '',
  17554. cloudPath: files.cloudPath,
  17555. fileType: files.fileType,
  17556. url: files.path || files.path,
  17557. size: files.size,
  17558. //单位是字节
  17559. image: {},
  17560. path: files.path,
  17561. video: {}
  17562. };
  17563. if (!(type === 'image')) {
  17564. _context.next = 14;
  17565. break;
  17566. }
  17567. _context.next = 7;
  17568. return get_file_info(files.path);
  17569. case 7:
  17570. imageinfo = _context.sent;
  17571. delete filedata.video;
  17572. filedata.image.width = imageinfo.width;
  17573. filedata.image.height = imageinfo.height;
  17574. filedata.image.location = imageinfo.path;
  17575. _context.next = 15;
  17576. break;
  17577. case 14:
  17578. delete filedata.image;
  17579. case 15:
  17580. return _context.abrupt("return", filedata);
  17581. case 16:
  17582. case "end":
  17583. return _context.stop();
  17584. }
  17585. }
  17586. }, _callee);
  17587. }));
  17588. return function get_file_data(_x) {
  17589. return _ref.apply(this, arguments);
  17590. };
  17591. }();
  17592. exports.get_file_data = get_file_data;
  17593. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  17594. /***/ }),
  17595. /* 153 */,
  17596. /* 154 */,
  17597. /* 155 */,
  17598. /* 156 */,
  17599. /* 157 */,
  17600. /* 158 */,
  17601. /* 159 */,
  17602. /* 160 */,
  17603. /* 161 */,
  17604. /* 162 */,
  17605. /* 163 */,
  17606. /* 164 */,
  17607. /* 165 */,
  17608. /* 166 */,
  17609. /* 167 */,
  17610. /* 168 */,
  17611. /* 169 */,
  17612. /* 170 */,
  17613. /* 171 */,
  17614. /* 172 */
  17615. /*!************************************************************************************************!*\
  17616. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  17617. \************************************************************************************************/
  17618. /*! no static exports found */
  17619. /***/ (function(module, exports, __webpack_require__) {
  17620. "use strict";
  17621. Object.defineProperty(exports, "__esModule", {
  17622. value: true
  17623. });
  17624. exports.default = void 0;
  17625. var _default = {
  17626. "id": "2852637",
  17627. "name": "uniui图标库",
  17628. "font_family": "uniicons",
  17629. "css_prefix_text": "uniui-",
  17630. "description": "",
  17631. "glyphs": [{
  17632. "icon_id": "25027049",
  17633. "name": "yanse",
  17634. "font_class": "color",
  17635. "unicode": "e6cf",
  17636. "unicode_decimal": 59087
  17637. }, {
  17638. "icon_id": "25027048",
  17639. "name": "wallet",
  17640. "font_class": "wallet",
  17641. "unicode": "e6b1",
  17642. "unicode_decimal": 59057
  17643. }, {
  17644. "icon_id": "25015720",
  17645. "name": "settings-filled",
  17646. "font_class": "settings-filled",
  17647. "unicode": "e6ce",
  17648. "unicode_decimal": 59086
  17649. }, {
  17650. "icon_id": "25015434",
  17651. "name": "shimingrenzheng-filled",
  17652. "font_class": "auth-filled",
  17653. "unicode": "e6cc",
  17654. "unicode_decimal": 59084
  17655. }, {
  17656. "icon_id": "24934246",
  17657. "name": "shop-filled",
  17658. "font_class": "shop-filled",
  17659. "unicode": "e6cd",
  17660. "unicode_decimal": 59085
  17661. }, {
  17662. "icon_id": "24934159",
  17663. "name": "staff-filled-01",
  17664. "font_class": "staff-filled",
  17665. "unicode": "e6cb",
  17666. "unicode_decimal": 59083
  17667. }, {
  17668. "icon_id": "24932461",
  17669. "name": "VIP-filled",
  17670. "font_class": "vip-filled",
  17671. "unicode": "e6c6",
  17672. "unicode_decimal": 59078
  17673. }, {
  17674. "icon_id": "24932462",
  17675. "name": "plus_circle_fill",
  17676. "font_class": "plus-filled",
  17677. "unicode": "e6c7",
  17678. "unicode_decimal": 59079
  17679. }, {
  17680. "icon_id": "24932463",
  17681. "name": "folder_add-filled",
  17682. "font_class": "folder-add-filled",
  17683. "unicode": "e6c8",
  17684. "unicode_decimal": 59080
  17685. }, {
  17686. "icon_id": "24932464",
  17687. "name": "yanse-filled",
  17688. "font_class": "color-filled",
  17689. "unicode": "e6c9",
  17690. "unicode_decimal": 59081
  17691. }, {
  17692. "icon_id": "24932465",
  17693. "name": "tune-filled",
  17694. "font_class": "tune-filled",
  17695. "unicode": "e6ca",
  17696. "unicode_decimal": 59082
  17697. }, {
  17698. "icon_id": "24932455",
  17699. "name": "a-rilidaka-filled",
  17700. "font_class": "calendar-filled",
  17701. "unicode": "e6c0",
  17702. "unicode_decimal": 59072
  17703. }, {
  17704. "icon_id": "24932456",
  17705. "name": "notification-filled",
  17706. "font_class": "notification-filled",
  17707. "unicode": "e6c1",
  17708. "unicode_decimal": 59073
  17709. }, {
  17710. "icon_id": "24932457",
  17711. "name": "wallet-filled",
  17712. "font_class": "wallet-filled",
  17713. "unicode": "e6c2",
  17714. "unicode_decimal": 59074
  17715. }, {
  17716. "icon_id": "24932458",
  17717. "name": "paihangbang-filled",
  17718. "font_class": "medal-filled",
  17719. "unicode": "e6c3",
  17720. "unicode_decimal": 59075
  17721. }, {
  17722. "icon_id": "24932459",
  17723. "name": "gift-filled",
  17724. "font_class": "gift-filled",
  17725. "unicode": "e6c4",
  17726. "unicode_decimal": 59076
  17727. }, {
  17728. "icon_id": "24932460",
  17729. "name": "fire-filled",
  17730. "font_class": "fire-filled",
  17731. "unicode": "e6c5",
  17732. "unicode_decimal": 59077
  17733. }, {
  17734. "icon_id": "24928001",
  17735. "name": "refreshempty",
  17736. "font_class": "refreshempty",
  17737. "unicode": "e6bf",
  17738. "unicode_decimal": 59071
  17739. }, {
  17740. "icon_id": "24926853",
  17741. "name": "location-ellipse",
  17742. "font_class": "location-filled",
  17743. "unicode": "e6af",
  17744. "unicode_decimal": 59055
  17745. }, {
  17746. "icon_id": "24926735",
  17747. "name": "person-filled",
  17748. "font_class": "person-filled",
  17749. "unicode": "e69d",
  17750. "unicode_decimal": 59037
  17751. }, {
  17752. "icon_id": "24926703",
  17753. "name": "personadd-filled",
  17754. "font_class": "personadd-filled",
  17755. "unicode": "e698",
  17756. "unicode_decimal": 59032
  17757. }, {
  17758. "icon_id": "24923351",
  17759. "name": "back",
  17760. "font_class": "back",
  17761. "unicode": "e6b9",
  17762. "unicode_decimal": 59065
  17763. }, {
  17764. "icon_id": "24923352",
  17765. "name": "forward",
  17766. "font_class": "forward",
  17767. "unicode": "e6ba",
  17768. "unicode_decimal": 59066
  17769. }, {
  17770. "icon_id": "24923353",
  17771. "name": "arrowthinright",
  17772. "font_class": "arrow-right",
  17773. "unicode": "e6bb",
  17774. "unicode_decimal": 59067
  17775. }, {
  17776. "icon_id": "24923353",
  17777. "name": "arrowthinright",
  17778. "font_class": "arrowthinright",
  17779. "unicode": "e6bb",
  17780. "unicode_decimal": 59067
  17781. }, {
  17782. "icon_id": "24923354",
  17783. "name": "arrowthinleft",
  17784. "font_class": "arrow-left",
  17785. "unicode": "e6bc",
  17786. "unicode_decimal": 59068
  17787. }, {
  17788. "icon_id": "24923354",
  17789. "name": "arrowthinleft",
  17790. "font_class": "arrowthinleft",
  17791. "unicode": "e6bc",
  17792. "unicode_decimal": 59068
  17793. }, {
  17794. "icon_id": "24923355",
  17795. "name": "arrowthinup",
  17796. "font_class": "arrow-up",
  17797. "unicode": "e6bd",
  17798. "unicode_decimal": 59069
  17799. }, {
  17800. "icon_id": "24923355",
  17801. "name": "arrowthinup",
  17802. "font_class": "arrowthinup",
  17803. "unicode": "e6bd",
  17804. "unicode_decimal": 59069
  17805. }, {
  17806. "icon_id": "24923356",
  17807. "name": "arrowthindown",
  17808. "font_class": "arrow-down",
  17809. "unicode": "e6be",
  17810. "unicode_decimal": 59070
  17811. }, {
  17812. "icon_id": "24923356",
  17813. "name": "arrowthindown",
  17814. "font_class": "arrowthindown",
  17815. "unicode": "e6be",
  17816. "unicode_decimal": 59070
  17817. }, {
  17818. "icon_id": "24923349",
  17819. "name": "arrowdown",
  17820. "font_class": "bottom",
  17821. "unicode": "e6b8",
  17822. "unicode_decimal": 59064
  17823. }, {
  17824. "icon_id": "24923349",
  17825. "name": "arrowdown",
  17826. "font_class": "arrowdown",
  17827. "unicode": "e6b8",
  17828. "unicode_decimal": 59064
  17829. }, {
  17830. "icon_id": "24923346",
  17831. "name": "arrowright",
  17832. "font_class": "right",
  17833. "unicode": "e6b5",
  17834. "unicode_decimal": 59061
  17835. }, {
  17836. "icon_id": "24923346",
  17837. "name": "arrowright",
  17838. "font_class": "arrowright",
  17839. "unicode": "e6b5",
  17840. "unicode_decimal": 59061
  17841. }, {
  17842. "icon_id": "24923347",
  17843. "name": "arrowup",
  17844. "font_class": "top",
  17845. "unicode": "e6b6",
  17846. "unicode_decimal": 59062
  17847. }, {
  17848. "icon_id": "24923347",
  17849. "name": "arrowup",
  17850. "font_class": "arrowup",
  17851. "unicode": "e6b6",
  17852. "unicode_decimal": 59062
  17853. }, {
  17854. "icon_id": "24923348",
  17855. "name": "arrowleft",
  17856. "font_class": "left",
  17857. "unicode": "e6b7",
  17858. "unicode_decimal": 59063
  17859. }, {
  17860. "icon_id": "24923348",
  17861. "name": "arrowleft",
  17862. "font_class": "arrowleft",
  17863. "unicode": "e6b7",
  17864. "unicode_decimal": 59063
  17865. }, {
  17866. "icon_id": "24923334",
  17867. "name": "eye",
  17868. "font_class": "eye",
  17869. "unicode": "e651",
  17870. "unicode_decimal": 58961
  17871. }, {
  17872. "icon_id": "24923335",
  17873. "name": "eye-filled",
  17874. "font_class": "eye-filled",
  17875. "unicode": "e66a",
  17876. "unicode_decimal": 58986
  17877. }, {
  17878. "icon_id": "24923336",
  17879. "name": "eye-slash",
  17880. "font_class": "eye-slash",
  17881. "unicode": "e6b3",
  17882. "unicode_decimal": 59059
  17883. }, {
  17884. "icon_id": "24923337",
  17885. "name": "eye-slash-filled",
  17886. "font_class": "eye-slash-filled",
  17887. "unicode": "e6b4",
  17888. "unicode_decimal": 59060
  17889. }, {
  17890. "icon_id": "24923305",
  17891. "name": "info-filled",
  17892. "font_class": "info-filled",
  17893. "unicode": "e649",
  17894. "unicode_decimal": 58953
  17895. }, {
  17896. "icon_id": "24923299",
  17897. "name": "reload-01",
  17898. "font_class": "reload",
  17899. "unicode": "e6b2",
  17900. "unicode_decimal": 59058
  17901. }, {
  17902. "icon_id": "24923195",
  17903. "name": "mic_slash_fill",
  17904. "font_class": "micoff-filled",
  17905. "unicode": "e6b0",
  17906. "unicode_decimal": 59056
  17907. }, {
  17908. "icon_id": "24923165",
  17909. "name": "map-pin-ellipse",
  17910. "font_class": "map-pin-ellipse",
  17911. "unicode": "e6ac",
  17912. "unicode_decimal": 59052
  17913. }, {
  17914. "icon_id": "24923166",
  17915. "name": "map-pin",
  17916. "font_class": "map-pin",
  17917. "unicode": "e6ad",
  17918. "unicode_decimal": 59053
  17919. }, {
  17920. "icon_id": "24923167",
  17921. "name": "location",
  17922. "font_class": "location",
  17923. "unicode": "e6ae",
  17924. "unicode_decimal": 59054
  17925. }, {
  17926. "icon_id": "24923064",
  17927. "name": "starhalf",
  17928. "font_class": "starhalf",
  17929. "unicode": "e683",
  17930. "unicode_decimal": 59011
  17931. }, {
  17932. "icon_id": "24923065",
  17933. "name": "star",
  17934. "font_class": "star",
  17935. "unicode": "e688",
  17936. "unicode_decimal": 59016
  17937. }, {
  17938. "icon_id": "24923066",
  17939. "name": "star-filled",
  17940. "font_class": "star-filled",
  17941. "unicode": "e68f",
  17942. "unicode_decimal": 59023
  17943. }, {
  17944. "icon_id": "24899646",
  17945. "name": "a-rilidaka",
  17946. "font_class": "calendar",
  17947. "unicode": "e6a0",
  17948. "unicode_decimal": 59040
  17949. }, {
  17950. "icon_id": "24899647",
  17951. "name": "fire",
  17952. "font_class": "fire",
  17953. "unicode": "e6a1",
  17954. "unicode_decimal": 59041
  17955. }, {
  17956. "icon_id": "24899648",
  17957. "name": "paihangbang",
  17958. "font_class": "medal",
  17959. "unicode": "e6a2",
  17960. "unicode_decimal": 59042
  17961. }, {
  17962. "icon_id": "24899649",
  17963. "name": "font",
  17964. "font_class": "font",
  17965. "unicode": "e6a3",
  17966. "unicode_decimal": 59043
  17967. }, {
  17968. "icon_id": "24899650",
  17969. "name": "gift",
  17970. "font_class": "gift",
  17971. "unicode": "e6a4",
  17972. "unicode_decimal": 59044
  17973. }, {
  17974. "icon_id": "24899651",
  17975. "name": "link",
  17976. "font_class": "link",
  17977. "unicode": "e6a5",
  17978. "unicode_decimal": 59045
  17979. }, {
  17980. "icon_id": "24899652",
  17981. "name": "notification",
  17982. "font_class": "notification",
  17983. "unicode": "e6a6",
  17984. "unicode_decimal": 59046
  17985. }, {
  17986. "icon_id": "24899653",
  17987. "name": "staff",
  17988. "font_class": "staff",
  17989. "unicode": "e6a7",
  17990. "unicode_decimal": 59047
  17991. }, {
  17992. "icon_id": "24899654",
  17993. "name": "VIP",
  17994. "font_class": "vip",
  17995. "unicode": "e6a8",
  17996. "unicode_decimal": 59048
  17997. }, {
  17998. "icon_id": "24899655",
  17999. "name": "folder_add",
  18000. "font_class": "folder-add",
  18001. "unicode": "e6a9",
  18002. "unicode_decimal": 59049
  18003. }, {
  18004. "icon_id": "24899656",
  18005. "name": "tune",
  18006. "font_class": "tune",
  18007. "unicode": "e6aa",
  18008. "unicode_decimal": 59050
  18009. }, {
  18010. "icon_id": "24899657",
  18011. "name": "shimingrenzheng",
  18012. "font_class": "auth",
  18013. "unicode": "e6ab",
  18014. "unicode_decimal": 59051
  18015. }, {
  18016. "icon_id": "24899565",
  18017. "name": "person",
  18018. "font_class": "person",
  18019. "unicode": "e699",
  18020. "unicode_decimal": 59033
  18021. }, {
  18022. "icon_id": "24899566",
  18023. "name": "email-filled",
  18024. "font_class": "email-filled",
  18025. "unicode": "e69a",
  18026. "unicode_decimal": 59034
  18027. }, {
  18028. "icon_id": "24899567",
  18029. "name": "phone-filled",
  18030. "font_class": "phone-filled",
  18031. "unicode": "e69b",
  18032. "unicode_decimal": 59035
  18033. }, {
  18034. "icon_id": "24899568",
  18035. "name": "phone",
  18036. "font_class": "phone",
  18037. "unicode": "e69c",
  18038. "unicode_decimal": 59036
  18039. }, {
  18040. "icon_id": "24899570",
  18041. "name": "email",
  18042. "font_class": "email",
  18043. "unicode": "e69e",
  18044. "unicode_decimal": 59038
  18045. }, {
  18046. "icon_id": "24899571",
  18047. "name": "personadd",
  18048. "font_class": "personadd",
  18049. "unicode": "e69f",
  18050. "unicode_decimal": 59039
  18051. }, {
  18052. "icon_id": "24899558",
  18053. "name": "chatboxes-filled",
  18054. "font_class": "chatboxes-filled",
  18055. "unicode": "e692",
  18056. "unicode_decimal": 59026
  18057. }, {
  18058. "icon_id": "24899559",
  18059. "name": "contact",
  18060. "font_class": "contact",
  18061. "unicode": "e693",
  18062. "unicode_decimal": 59027
  18063. }, {
  18064. "icon_id": "24899560",
  18065. "name": "chatbubble-filled",
  18066. "font_class": "chatbubble-filled",
  18067. "unicode": "e694",
  18068. "unicode_decimal": 59028
  18069. }, {
  18070. "icon_id": "24899561",
  18071. "name": "contact-filled",
  18072. "font_class": "contact-filled",
  18073. "unicode": "e695",
  18074. "unicode_decimal": 59029
  18075. }, {
  18076. "icon_id": "24899562",
  18077. "name": "chatboxes",
  18078. "font_class": "chatboxes",
  18079. "unicode": "e696",
  18080. "unicode_decimal": 59030
  18081. }, {
  18082. "icon_id": "24899563",
  18083. "name": "chatbubble",
  18084. "font_class": "chatbubble",
  18085. "unicode": "e697",
  18086. "unicode_decimal": 59031
  18087. }, {
  18088. "icon_id": "24881290",
  18089. "name": "upload-filled",
  18090. "font_class": "upload-filled",
  18091. "unicode": "e68e",
  18092. "unicode_decimal": 59022
  18093. }, {
  18094. "icon_id": "24881292",
  18095. "name": "upload",
  18096. "font_class": "upload",
  18097. "unicode": "e690",
  18098. "unicode_decimal": 59024
  18099. }, {
  18100. "icon_id": "24881293",
  18101. "name": "weixin",
  18102. "font_class": "weixin",
  18103. "unicode": "e691",
  18104. "unicode_decimal": 59025
  18105. }, {
  18106. "icon_id": "24881274",
  18107. "name": "compose",
  18108. "font_class": "compose",
  18109. "unicode": "e67f",
  18110. "unicode_decimal": 59007
  18111. }, {
  18112. "icon_id": "24881275",
  18113. "name": "qq",
  18114. "font_class": "qq",
  18115. "unicode": "e680",
  18116. "unicode_decimal": 59008
  18117. }, {
  18118. "icon_id": "24881276",
  18119. "name": "download-filled",
  18120. "font_class": "download-filled",
  18121. "unicode": "e681",
  18122. "unicode_decimal": 59009
  18123. }, {
  18124. "icon_id": "24881277",
  18125. "name": "pengyouquan",
  18126. "font_class": "pyq",
  18127. "unicode": "e682",
  18128. "unicode_decimal": 59010
  18129. }, {
  18130. "icon_id": "24881279",
  18131. "name": "sound",
  18132. "font_class": "sound",
  18133. "unicode": "e684",
  18134. "unicode_decimal": 59012
  18135. }, {
  18136. "icon_id": "24881280",
  18137. "name": "trash-filled",
  18138. "font_class": "trash-filled",
  18139. "unicode": "e685",
  18140. "unicode_decimal": 59013
  18141. }, {
  18142. "icon_id": "24881281",
  18143. "name": "sound-filled",
  18144. "font_class": "sound-filled",
  18145. "unicode": "e686",
  18146. "unicode_decimal": 59014
  18147. }, {
  18148. "icon_id": "24881282",
  18149. "name": "trash",
  18150. "font_class": "trash",
  18151. "unicode": "e687",
  18152. "unicode_decimal": 59015
  18153. }, {
  18154. "icon_id": "24881284",
  18155. "name": "videocam-filled",
  18156. "font_class": "videocam-filled",
  18157. "unicode": "e689",
  18158. "unicode_decimal": 59017
  18159. }, {
  18160. "icon_id": "24881285",
  18161. "name": "spinner-cycle",
  18162. "font_class": "spinner-cycle",
  18163. "unicode": "e68a",
  18164. "unicode_decimal": 59018
  18165. }, {
  18166. "icon_id": "24881286",
  18167. "name": "weibo",
  18168. "font_class": "weibo",
  18169. "unicode": "e68b",
  18170. "unicode_decimal": 59019
  18171. }, {
  18172. "icon_id": "24881288",
  18173. "name": "videocam",
  18174. "font_class": "videocam",
  18175. "unicode": "e68c",
  18176. "unicode_decimal": 59020
  18177. }, {
  18178. "icon_id": "24881289",
  18179. "name": "download",
  18180. "font_class": "download",
  18181. "unicode": "e68d",
  18182. "unicode_decimal": 59021
  18183. }, {
  18184. "icon_id": "24879601",
  18185. "name": "help",
  18186. "font_class": "help",
  18187. "unicode": "e679",
  18188. "unicode_decimal": 59001
  18189. }, {
  18190. "icon_id": "24879602",
  18191. "name": "navigate-filled",
  18192. "font_class": "navigate-filled",
  18193. "unicode": "e67a",
  18194. "unicode_decimal": 59002
  18195. }, {
  18196. "icon_id": "24879603",
  18197. "name": "plusempty",
  18198. "font_class": "plusempty",
  18199. "unicode": "e67b",
  18200. "unicode_decimal": 59003
  18201. }, {
  18202. "icon_id": "24879604",
  18203. "name": "smallcircle",
  18204. "font_class": "smallcircle",
  18205. "unicode": "e67c",
  18206. "unicode_decimal": 59004
  18207. }, {
  18208. "icon_id": "24879605",
  18209. "name": "minus-filled",
  18210. "font_class": "minus-filled",
  18211. "unicode": "e67d",
  18212. "unicode_decimal": 59005
  18213. }, {
  18214. "icon_id": "24879606",
  18215. "name": "micoff",
  18216. "font_class": "micoff",
  18217. "unicode": "e67e",
  18218. "unicode_decimal": 59006
  18219. }, {
  18220. "icon_id": "24879588",
  18221. "name": "closeempty",
  18222. "font_class": "closeempty",
  18223. "unicode": "e66c",
  18224. "unicode_decimal": 58988
  18225. }, {
  18226. "icon_id": "24879589",
  18227. "name": "clear",
  18228. "font_class": "clear",
  18229. "unicode": "e66d",
  18230. "unicode_decimal": 58989
  18231. }, {
  18232. "icon_id": "24879590",
  18233. "name": "navigate",
  18234. "font_class": "navigate",
  18235. "unicode": "e66e",
  18236. "unicode_decimal": 58990
  18237. }, {
  18238. "icon_id": "24879591",
  18239. "name": "minus",
  18240. "font_class": "minus",
  18241. "unicode": "e66f",
  18242. "unicode_decimal": 58991
  18243. }, {
  18244. "icon_id": "24879592",
  18245. "name": "image",
  18246. "font_class": "image",
  18247. "unicode": "e670",
  18248. "unicode_decimal": 58992
  18249. }, {
  18250. "icon_id": "24879593",
  18251. "name": "mic",
  18252. "font_class": "mic",
  18253. "unicode": "e671",
  18254. "unicode_decimal": 58993
  18255. }, {
  18256. "icon_id": "24879594",
  18257. "name": "paperplane",
  18258. "font_class": "paperplane",
  18259. "unicode": "e672",
  18260. "unicode_decimal": 58994
  18261. }, {
  18262. "icon_id": "24879595",
  18263. "name": "close",
  18264. "font_class": "close",
  18265. "unicode": "e673",
  18266. "unicode_decimal": 58995
  18267. }, {
  18268. "icon_id": "24879596",
  18269. "name": "help-filled",
  18270. "font_class": "help-filled",
  18271. "unicode": "e674",
  18272. "unicode_decimal": 58996
  18273. }, {
  18274. "icon_id": "24879597",
  18275. "name": "plus-filled",
  18276. "font_class": "paperplane-filled",
  18277. "unicode": "e675",
  18278. "unicode_decimal": 58997
  18279. }, {
  18280. "icon_id": "24879598",
  18281. "name": "plus",
  18282. "font_class": "plus",
  18283. "unicode": "e676",
  18284. "unicode_decimal": 58998
  18285. }, {
  18286. "icon_id": "24879599",
  18287. "name": "mic-filled",
  18288. "font_class": "mic-filled",
  18289. "unicode": "e677",
  18290. "unicode_decimal": 58999
  18291. }, {
  18292. "icon_id": "24879600",
  18293. "name": "image-filled",
  18294. "font_class": "image-filled",
  18295. "unicode": "e678",
  18296. "unicode_decimal": 59000
  18297. }, {
  18298. "icon_id": "24855900",
  18299. "name": "locked-filled",
  18300. "font_class": "locked-filled",
  18301. "unicode": "e668",
  18302. "unicode_decimal": 58984
  18303. }, {
  18304. "icon_id": "24855901",
  18305. "name": "info",
  18306. "font_class": "info",
  18307. "unicode": "e669",
  18308. "unicode_decimal": 58985
  18309. }, {
  18310. "icon_id": "24855903",
  18311. "name": "locked",
  18312. "font_class": "locked",
  18313. "unicode": "e66b",
  18314. "unicode_decimal": 58987
  18315. }, {
  18316. "icon_id": "24855884",
  18317. "name": "camera-filled",
  18318. "font_class": "camera-filled",
  18319. "unicode": "e658",
  18320. "unicode_decimal": 58968
  18321. }, {
  18322. "icon_id": "24855885",
  18323. "name": "chat-filled",
  18324. "font_class": "chat-filled",
  18325. "unicode": "e659",
  18326. "unicode_decimal": 58969
  18327. }, {
  18328. "icon_id": "24855886",
  18329. "name": "camera",
  18330. "font_class": "camera",
  18331. "unicode": "e65a",
  18332. "unicode_decimal": 58970
  18333. }, {
  18334. "icon_id": "24855887",
  18335. "name": "circle",
  18336. "font_class": "circle",
  18337. "unicode": "e65b",
  18338. "unicode_decimal": 58971
  18339. }, {
  18340. "icon_id": "24855888",
  18341. "name": "checkmarkempty",
  18342. "font_class": "checkmarkempty",
  18343. "unicode": "e65c",
  18344. "unicode_decimal": 58972
  18345. }, {
  18346. "icon_id": "24855889",
  18347. "name": "chat",
  18348. "font_class": "chat",
  18349. "unicode": "e65d",
  18350. "unicode_decimal": 58973
  18351. }, {
  18352. "icon_id": "24855890",
  18353. "name": "circle-filled",
  18354. "font_class": "circle-filled",
  18355. "unicode": "e65e",
  18356. "unicode_decimal": 58974
  18357. }, {
  18358. "icon_id": "24855891",
  18359. "name": "flag",
  18360. "font_class": "flag",
  18361. "unicode": "e65f",
  18362. "unicode_decimal": 58975
  18363. }, {
  18364. "icon_id": "24855892",
  18365. "name": "flag-filled",
  18366. "font_class": "flag-filled",
  18367. "unicode": "e660",
  18368. "unicode_decimal": 58976
  18369. }, {
  18370. "icon_id": "24855893",
  18371. "name": "gear-filled",
  18372. "font_class": "gear-filled",
  18373. "unicode": "e661",
  18374. "unicode_decimal": 58977
  18375. }, {
  18376. "icon_id": "24855894",
  18377. "name": "home",
  18378. "font_class": "home",
  18379. "unicode": "e662",
  18380. "unicode_decimal": 58978
  18381. }, {
  18382. "icon_id": "24855895",
  18383. "name": "home-filled",
  18384. "font_class": "home-filled",
  18385. "unicode": "e663",
  18386. "unicode_decimal": 58979
  18387. }, {
  18388. "icon_id": "24855896",
  18389. "name": "gear",
  18390. "font_class": "gear",
  18391. "unicode": "e664",
  18392. "unicode_decimal": 58980
  18393. }, {
  18394. "icon_id": "24855897",
  18395. "name": "smallcircle-filled",
  18396. "font_class": "smallcircle-filled",
  18397. "unicode": "e665",
  18398. "unicode_decimal": 58981
  18399. }, {
  18400. "icon_id": "24855898",
  18401. "name": "map-filled",
  18402. "font_class": "map-filled",
  18403. "unicode": "e666",
  18404. "unicode_decimal": 58982
  18405. }, {
  18406. "icon_id": "24855899",
  18407. "name": "map",
  18408. "font_class": "map",
  18409. "unicode": "e667",
  18410. "unicode_decimal": 58983
  18411. }, {
  18412. "icon_id": "24855825",
  18413. "name": "refresh-filled",
  18414. "font_class": "refresh-filled",
  18415. "unicode": "e656",
  18416. "unicode_decimal": 58966
  18417. }, {
  18418. "icon_id": "24855826",
  18419. "name": "refresh",
  18420. "font_class": "refresh",
  18421. "unicode": "e657",
  18422. "unicode_decimal": 58967
  18423. }, {
  18424. "icon_id": "24855808",
  18425. "name": "cloud-upload",
  18426. "font_class": "cloud-upload",
  18427. "unicode": "e645",
  18428. "unicode_decimal": 58949
  18429. }, {
  18430. "icon_id": "24855809",
  18431. "name": "cloud-download-filled",
  18432. "font_class": "cloud-download-filled",
  18433. "unicode": "e646",
  18434. "unicode_decimal": 58950
  18435. }, {
  18436. "icon_id": "24855810",
  18437. "name": "cloud-download",
  18438. "font_class": "cloud-download",
  18439. "unicode": "e647",
  18440. "unicode_decimal": 58951
  18441. }, {
  18442. "icon_id": "24855811",
  18443. "name": "cloud-upload-filled",
  18444. "font_class": "cloud-upload-filled",
  18445. "unicode": "e648",
  18446. "unicode_decimal": 58952
  18447. }, {
  18448. "icon_id": "24855813",
  18449. "name": "redo",
  18450. "font_class": "redo",
  18451. "unicode": "e64a",
  18452. "unicode_decimal": 58954
  18453. }, {
  18454. "icon_id": "24855814",
  18455. "name": "images-filled",
  18456. "font_class": "images-filled",
  18457. "unicode": "e64b",
  18458. "unicode_decimal": 58955
  18459. }, {
  18460. "icon_id": "24855815",
  18461. "name": "undo-filled",
  18462. "font_class": "undo-filled",
  18463. "unicode": "e64c",
  18464. "unicode_decimal": 58956
  18465. }, {
  18466. "icon_id": "24855816",
  18467. "name": "more",
  18468. "font_class": "more",
  18469. "unicode": "e64d",
  18470. "unicode_decimal": 58957
  18471. }, {
  18472. "icon_id": "24855817",
  18473. "name": "more-filled",
  18474. "font_class": "more-filled",
  18475. "unicode": "e64e",
  18476. "unicode_decimal": 58958
  18477. }, {
  18478. "icon_id": "24855818",
  18479. "name": "undo",
  18480. "font_class": "undo",
  18481. "unicode": "e64f",
  18482. "unicode_decimal": 58959
  18483. }, {
  18484. "icon_id": "24855819",
  18485. "name": "images",
  18486. "font_class": "images",
  18487. "unicode": "e650",
  18488. "unicode_decimal": 58960
  18489. }, {
  18490. "icon_id": "24855821",
  18491. "name": "paperclip",
  18492. "font_class": "paperclip",
  18493. "unicode": "e652",
  18494. "unicode_decimal": 58962
  18495. }, {
  18496. "icon_id": "24855822",
  18497. "name": "settings",
  18498. "font_class": "settings",
  18499. "unicode": "e653",
  18500. "unicode_decimal": 58963
  18501. }, {
  18502. "icon_id": "24855823",
  18503. "name": "search",
  18504. "font_class": "search",
  18505. "unicode": "e654",
  18506. "unicode_decimal": 58964
  18507. }, {
  18508. "icon_id": "24855824",
  18509. "name": "redo-filled",
  18510. "font_class": "redo-filled",
  18511. "unicode": "e655",
  18512. "unicode_decimal": 58965
  18513. }, {
  18514. "icon_id": "24841702",
  18515. "name": "list",
  18516. "font_class": "list",
  18517. "unicode": "e644",
  18518. "unicode_decimal": 58948
  18519. }, {
  18520. "icon_id": "24841489",
  18521. "name": "mail-open-filled",
  18522. "font_class": "mail-open-filled",
  18523. "unicode": "e63a",
  18524. "unicode_decimal": 58938
  18525. }, {
  18526. "icon_id": "24841491",
  18527. "name": "hand-thumbsdown-filled",
  18528. "font_class": "hand-down-filled",
  18529. "unicode": "e63c",
  18530. "unicode_decimal": 58940
  18531. }, {
  18532. "icon_id": "24841492",
  18533. "name": "hand-thumbsdown",
  18534. "font_class": "hand-down",
  18535. "unicode": "e63d",
  18536. "unicode_decimal": 58941
  18537. }, {
  18538. "icon_id": "24841493",
  18539. "name": "hand-thumbsup-filled",
  18540. "font_class": "hand-up-filled",
  18541. "unicode": "e63e",
  18542. "unicode_decimal": 58942
  18543. }, {
  18544. "icon_id": "24841494",
  18545. "name": "hand-thumbsup",
  18546. "font_class": "hand-up",
  18547. "unicode": "e63f",
  18548. "unicode_decimal": 58943
  18549. }, {
  18550. "icon_id": "24841496",
  18551. "name": "heart-filled",
  18552. "font_class": "heart-filled",
  18553. "unicode": "e641",
  18554. "unicode_decimal": 58945
  18555. }, {
  18556. "icon_id": "24841498",
  18557. "name": "mail-open",
  18558. "font_class": "mail-open",
  18559. "unicode": "e643",
  18560. "unicode_decimal": 58947
  18561. }, {
  18562. "icon_id": "24841488",
  18563. "name": "heart",
  18564. "font_class": "heart",
  18565. "unicode": "e639",
  18566. "unicode_decimal": 58937
  18567. }, {
  18568. "icon_id": "24839963",
  18569. "name": "loop",
  18570. "font_class": "loop",
  18571. "unicode": "e633",
  18572. "unicode_decimal": 58931
  18573. }, {
  18574. "icon_id": "24839866",
  18575. "name": "pulldown",
  18576. "font_class": "pulldown",
  18577. "unicode": "e632",
  18578. "unicode_decimal": 58930
  18579. }, {
  18580. "icon_id": "24813798",
  18581. "name": "scan",
  18582. "font_class": "scan",
  18583. "unicode": "e62a",
  18584. "unicode_decimal": 58922
  18585. }, {
  18586. "icon_id": "24813786",
  18587. "name": "bars",
  18588. "font_class": "bars",
  18589. "unicode": "e627",
  18590. "unicode_decimal": 58919
  18591. }, {
  18592. "icon_id": "24813788",
  18593. "name": "cart-filled",
  18594. "font_class": "cart-filled",
  18595. "unicode": "e629",
  18596. "unicode_decimal": 58921
  18597. }, {
  18598. "icon_id": "24813790",
  18599. "name": "checkbox",
  18600. "font_class": "checkbox",
  18601. "unicode": "e62b",
  18602. "unicode_decimal": 58923
  18603. }, {
  18604. "icon_id": "24813791",
  18605. "name": "checkbox-filled",
  18606. "font_class": "checkbox-filled",
  18607. "unicode": "e62c",
  18608. "unicode_decimal": 58924
  18609. }, {
  18610. "icon_id": "24813794",
  18611. "name": "shop",
  18612. "font_class": "shop",
  18613. "unicode": "e62f",
  18614. "unicode_decimal": 58927
  18615. }, {
  18616. "icon_id": "24813795",
  18617. "name": "headphones",
  18618. "font_class": "headphones",
  18619. "unicode": "e630",
  18620. "unicode_decimal": 58928
  18621. }, {
  18622. "icon_id": "24813796",
  18623. "name": "cart",
  18624. "font_class": "cart",
  18625. "unicode": "e631",
  18626. "unicode_decimal": 58929
  18627. }]
  18628. };
  18629. exports.default = _default;
  18630. /***/ })
  18631. ]]);
  18632. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map