vendor.js 884 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function toPropertyKey(t) {
  84. var i = toPrimitive(t, "string");
  85. return "symbol" == _typeof(i) ? i : i + "";
  86. }
  87. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(o) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  98. return typeof o;
  99. } : function (o) {
  100. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 14:
  106. /*!************************************************************!*\
  107. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  108. \************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  112. function toPrimitive(t, r) {
  113. if ("object" != _typeof(t) || !t) return t;
  114. var e = t[Symbol.toPrimitive];
  115. if (void 0 !== e) {
  116. var i = e.call(t, r || "default");
  117. if ("object" != _typeof(i)) return i;
  118. throw new TypeError("@@toPrimitive must return a primitive value.");
  119. }
  120. return ("string" === r ? String : Number)(t);
  121. }
  122. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  123. /***/ }),
  124. /***/ 15:
  125. /*!**********************************************************!*\
  126. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  127. \**********************************************************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  131. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  132. function _construct(t, e, r) {
  133. if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  134. var o = [null];
  135. o.push.apply(o, e);
  136. var p = new (t.bind.apply(t, o))();
  137. return r && setPrototypeOf(p, r.prototype), p;
  138. }
  139. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  140. /***/ }),
  141. /***/ 16:
  142. /*!***************************************************************!*\
  143. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  144. \***************************************************************/
  145. /*! no static exports found */
  146. /***/ (function(module, exports) {
  147. function _setPrototypeOf(o, p) {
  148. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  149. o.__proto__ = p;
  150. return o;
  151. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  152. return _setPrototypeOf(o, p);
  153. }
  154. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  155. /***/ }),
  156. /***/ 17:
  157. /*!*************************************************************************!*\
  158. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  159. \*************************************************************************/
  160. /*! no static exports found */
  161. /***/ (function(module, exports) {
  162. function _isNativeReflectConstruct() {
  163. try {
  164. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  165. } catch (t) {}
  166. return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
  167. return !!t;
  168. }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
  169. }
  170. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  171. /***/ }),
  172. /***/ 18:
  173. /*!******************************************************************!*\
  174. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  175. \******************************************************************/
  176. /*! no static exports found */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  179. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  180. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  181. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  182. function _toConsumableArray(arr) {
  183. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  184. }
  185. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  186. /***/ }),
  187. /***/ 19:
  188. /*!******************************************************************!*\
  189. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  190. \******************************************************************/
  191. /*! no static exports found */
  192. /***/ (function(module, exports, __webpack_require__) {
  193. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  194. function _arrayWithoutHoles(arr) {
  195. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  196. }
  197. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  198. /***/ }),
  199. /***/ 2:
  200. /*!************************************************************!*\
  201. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  202. \************************************************************/
  203. /*! no static exports found */
  204. /***/ (function(module, exports, __webpack_require__) {
  205. "use strict";
  206. /* WEBPACK VAR INJECTION */(function(wx, global) {
  207. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  208. Object.defineProperty(exports, "__esModule", {
  209. value: true
  210. });
  211. exports.createApp = createApp;
  212. exports.createComponent = createComponent;
  213. exports.createPage = createPage;
  214. exports.createPlugin = createPlugin;
  215. exports.createSubpackageApp = createSubpackageApp;
  216. exports.default = void 0;
  217. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  218. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  219. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  220. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  221. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  222. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  223. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  224. 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; }
  225. 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; }
  226. var realAtob;
  227. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  228. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  229. if (typeof atob !== 'function') {
  230. realAtob = function realAtob(str) {
  231. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  232. if (!b64re.test(str)) {
  233. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  234. }
  235. // Adding the padding if missing, for semplicity
  236. str += '=='.slice(2 - (str.length & 3));
  237. var bitmap;
  238. var result = '';
  239. var r1;
  240. var r2;
  241. var i = 0;
  242. for (; i < str.length;) {
  243. 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++)));
  244. 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);
  245. }
  246. return result;
  247. };
  248. } else {
  249. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  250. realAtob = atob;
  251. }
  252. function b64DecodeUnicode(str) {
  253. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  254. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  255. }).join(''));
  256. }
  257. function getCurrentUserInfo() {
  258. var token = wx.getStorageSync('uni_id_token') || '';
  259. var tokenArr = token.split('.');
  260. if (!token || tokenArr.length !== 3) {
  261. return {
  262. uid: null,
  263. role: [],
  264. permission: [],
  265. tokenExpired: 0
  266. };
  267. }
  268. var userInfo;
  269. try {
  270. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  271. } catch (error) {
  272. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  273. }
  274. userInfo.tokenExpired = userInfo.exp * 1000;
  275. delete userInfo.exp;
  276. delete userInfo.iat;
  277. return userInfo;
  278. }
  279. function uniIdMixin(Vue) {
  280. Vue.prototype.uniIDHasRole = function (roleId) {
  281. var _getCurrentUserInfo = getCurrentUserInfo(),
  282. role = _getCurrentUserInfo.role;
  283. return role.indexOf(roleId) > -1;
  284. };
  285. Vue.prototype.uniIDHasPermission = function (permissionId) {
  286. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  287. permission = _getCurrentUserInfo2.permission;
  288. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  289. };
  290. Vue.prototype.uniIDTokenValid = function () {
  291. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  292. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  293. return tokenExpired > Date.now();
  294. };
  295. }
  296. var _toString = Object.prototype.toString;
  297. var hasOwnProperty = Object.prototype.hasOwnProperty;
  298. function isFn(fn) {
  299. return typeof fn === 'function';
  300. }
  301. function isStr(str) {
  302. return typeof str === 'string';
  303. }
  304. function isObject(obj) {
  305. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  306. }
  307. function isPlainObject(obj) {
  308. return _toString.call(obj) === '[object Object]';
  309. }
  310. function hasOwn(obj, key) {
  311. return hasOwnProperty.call(obj, key);
  312. }
  313. function noop() {}
  314. /**
  315. * Create a cached version of a pure function.
  316. */
  317. function cached(fn) {
  318. var cache = Object.create(null);
  319. return function cachedFn(str) {
  320. var hit = cache[str];
  321. return hit || (cache[str] = fn(str));
  322. };
  323. }
  324. /**
  325. * Camelize a hyphen-delimited string.
  326. */
  327. var camelizeRE = /-(\w)/g;
  328. var camelize = cached(function (str) {
  329. return str.replace(camelizeRE, function (_, c) {
  330. return c ? c.toUpperCase() : '';
  331. });
  332. });
  333. function sortObject(obj) {
  334. var sortObj = {};
  335. if (isPlainObject(obj)) {
  336. Object.keys(obj).sort().forEach(function (key) {
  337. sortObj[key] = obj[key];
  338. });
  339. }
  340. return !Object.keys(sortObj) ? obj : sortObj;
  341. }
  342. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  343. var globalInterceptors = {};
  344. var scopedInterceptors = {};
  345. function mergeHook(parentVal, childVal) {
  346. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  347. return res ? dedupeHooks(res) : res;
  348. }
  349. function dedupeHooks(hooks) {
  350. var res = [];
  351. for (var i = 0; i < hooks.length; i++) {
  352. if (res.indexOf(hooks[i]) === -1) {
  353. res.push(hooks[i]);
  354. }
  355. }
  356. return res;
  357. }
  358. function removeHook(hooks, hook) {
  359. var index = hooks.indexOf(hook);
  360. if (index !== -1) {
  361. hooks.splice(index, 1);
  362. }
  363. }
  364. function mergeInterceptorHook(interceptor, option) {
  365. Object.keys(option).forEach(function (hook) {
  366. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  367. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  368. }
  369. });
  370. }
  371. function removeInterceptorHook(interceptor, option) {
  372. if (!interceptor || !option) {
  373. return;
  374. }
  375. Object.keys(option).forEach(function (hook) {
  376. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  377. removeHook(interceptor[hook], option[hook]);
  378. }
  379. });
  380. }
  381. function addInterceptor(method, option) {
  382. if (typeof method === 'string' && isPlainObject(option)) {
  383. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  384. } else if (isPlainObject(method)) {
  385. mergeInterceptorHook(globalInterceptors, method);
  386. }
  387. }
  388. function removeInterceptor(method, option) {
  389. if (typeof method === 'string') {
  390. if (isPlainObject(option)) {
  391. removeInterceptorHook(scopedInterceptors[method], option);
  392. } else {
  393. delete scopedInterceptors[method];
  394. }
  395. } else if (isPlainObject(method)) {
  396. removeInterceptorHook(globalInterceptors, method);
  397. }
  398. }
  399. function wrapperHook(hook, params) {
  400. return function (data) {
  401. return hook(data, params) || data;
  402. };
  403. }
  404. function isPromise(obj) {
  405. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  406. }
  407. function queue(hooks, data, params) {
  408. var promise = false;
  409. for (var i = 0; i < hooks.length; i++) {
  410. var hook = hooks[i];
  411. if (promise) {
  412. promise = Promise.resolve(wrapperHook(hook, params));
  413. } else {
  414. var res = hook(data, params);
  415. if (isPromise(res)) {
  416. promise = Promise.resolve(res);
  417. }
  418. if (res === false) {
  419. return {
  420. then: function then() {}
  421. };
  422. }
  423. }
  424. }
  425. return promise || {
  426. then: function then(callback) {
  427. return callback(data);
  428. }
  429. };
  430. }
  431. function wrapperOptions(interceptor) {
  432. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  433. ['success', 'fail', 'complete'].forEach(function (name) {
  434. if (Array.isArray(interceptor[name])) {
  435. var oldCallback = options[name];
  436. options[name] = function callbackInterceptor(res) {
  437. queue(interceptor[name], res, options).then(function (res) {
  438. /* eslint-disable no-mixed-operators */
  439. return isFn(oldCallback) && oldCallback(res) || res;
  440. });
  441. };
  442. }
  443. });
  444. return options;
  445. }
  446. function wrapperReturnValue(method, returnValue) {
  447. var returnValueHooks = [];
  448. if (Array.isArray(globalInterceptors.returnValue)) {
  449. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  450. }
  451. var interceptor = scopedInterceptors[method];
  452. if (interceptor && Array.isArray(interceptor.returnValue)) {
  453. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  454. }
  455. returnValueHooks.forEach(function (hook) {
  456. returnValue = hook(returnValue) || returnValue;
  457. });
  458. return returnValue;
  459. }
  460. function getApiInterceptorHooks(method) {
  461. var interceptor = Object.create(null);
  462. Object.keys(globalInterceptors).forEach(function (hook) {
  463. if (hook !== 'returnValue') {
  464. interceptor[hook] = globalInterceptors[hook].slice();
  465. }
  466. });
  467. var scopedInterceptor = scopedInterceptors[method];
  468. if (scopedInterceptor) {
  469. Object.keys(scopedInterceptor).forEach(function (hook) {
  470. if (hook !== 'returnValue') {
  471. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  472. }
  473. });
  474. }
  475. return interceptor;
  476. }
  477. function invokeApi(method, api, options) {
  478. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  479. params[_key - 3] = arguments[_key];
  480. }
  481. var interceptor = getApiInterceptorHooks(method);
  482. if (interceptor && Object.keys(interceptor).length) {
  483. if (Array.isArray(interceptor.invoke)) {
  484. var res = queue(interceptor.invoke, options);
  485. return res.then(function (options) {
  486. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  487. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  488. });
  489. } else {
  490. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  491. }
  492. }
  493. return api.apply(void 0, [options].concat(params));
  494. }
  495. var promiseInterceptor = {
  496. returnValue: function returnValue(res) {
  497. if (!isPromise(res)) {
  498. return res;
  499. }
  500. return new Promise(function (resolve, reject) {
  501. res.then(function (res) {
  502. if (res[0]) {
  503. reject(res[0]);
  504. } else {
  505. resolve(res[1]);
  506. }
  507. });
  508. });
  509. }
  510. };
  511. 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/;
  512. var CONTEXT_API_RE = /^create|Manager$/;
  513. // Context例外情况
  514. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  515. // 同步例外情况
  516. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  517. var CALLBACK_API_RE = /^on|^off/;
  518. function isContextApi(name) {
  519. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  520. }
  521. function isSyncApi(name) {
  522. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  523. }
  524. function isCallbackApi(name) {
  525. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  526. }
  527. function handlePromise(promise) {
  528. return promise.then(function (data) {
  529. return [null, data];
  530. }).catch(function (err) {
  531. return [err];
  532. });
  533. }
  534. function shouldPromise(name) {
  535. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  536. return false;
  537. }
  538. return true;
  539. }
  540. /* eslint-disable no-extend-native */
  541. if (!Promise.prototype.finally) {
  542. Promise.prototype.finally = function (callback) {
  543. var promise = this.constructor;
  544. return this.then(function (value) {
  545. return promise.resolve(callback()).then(function () {
  546. return value;
  547. });
  548. }, function (reason) {
  549. return promise.resolve(callback()).then(function () {
  550. throw reason;
  551. });
  552. });
  553. };
  554. }
  555. function promisify(name, api) {
  556. if (!shouldPromise(name) || !isFn(api)) {
  557. return api;
  558. }
  559. return function promiseApi() {
  560. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  561. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  562. params[_key2 - 1] = arguments[_key2];
  563. }
  564. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  565. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  566. }
  567. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  568. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  569. success: resolve,
  570. fail: reject
  571. })].concat(params));
  572. })));
  573. };
  574. }
  575. var EPS = 1e-4;
  576. var BASE_DEVICE_WIDTH = 750;
  577. var isIOS = false;
  578. var deviceWidth = 0;
  579. var deviceDPR = 0;
  580. function checkDeviceWidth() {
  581. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  582. platform = _wx$getSystemInfoSync.platform,
  583. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  584. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  585. deviceWidth = windowWidth;
  586. deviceDPR = pixelRatio;
  587. isIOS = platform === 'ios';
  588. }
  589. function upx2px(number, newDeviceWidth) {
  590. if (deviceWidth === 0) {
  591. checkDeviceWidth();
  592. }
  593. number = Number(number);
  594. if (number === 0) {
  595. return 0;
  596. }
  597. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  598. if (result < 0) {
  599. result = -result;
  600. }
  601. result = Math.floor(result + EPS);
  602. if (result === 0) {
  603. if (deviceDPR === 1 || !isIOS) {
  604. result = 1;
  605. } else {
  606. result = 0.5;
  607. }
  608. }
  609. return number < 0 ? -result : result;
  610. }
  611. var LOCALE_ZH_HANS = 'zh-Hans';
  612. var LOCALE_ZH_HANT = 'zh-Hant';
  613. var LOCALE_EN = 'en';
  614. var LOCALE_FR = 'fr';
  615. var LOCALE_ES = 'es';
  616. var messages = {};
  617. var locale;
  618. {
  619. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  620. }
  621. function initI18nMessages() {
  622. if (!isEnableLocale()) {
  623. return;
  624. }
  625. var localeKeys = Object.keys(__uniConfig.locales);
  626. if (localeKeys.length) {
  627. localeKeys.forEach(function (locale) {
  628. var curMessages = messages[locale];
  629. var userMessages = __uniConfig.locales[locale];
  630. if (curMessages) {
  631. Object.assign(curMessages, userMessages);
  632. } else {
  633. messages[locale] = userMessages;
  634. }
  635. });
  636. }
  637. }
  638. initI18nMessages();
  639. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  640. var t = i18n.t;
  641. var i18nMixin = i18n.mixin = {
  642. beforeCreate: function beforeCreate() {
  643. var _this = this;
  644. var unwatch = i18n.i18n.watchLocale(function () {
  645. _this.$forceUpdate();
  646. });
  647. this.$once('hook:beforeDestroy', function () {
  648. unwatch();
  649. });
  650. },
  651. methods: {
  652. $$t: function $$t(key, values) {
  653. return t(key, values);
  654. }
  655. }
  656. };
  657. var setLocale = i18n.setLocale;
  658. var getLocale = i18n.getLocale;
  659. function initAppLocale(Vue, appVm, locale) {
  660. var state = Vue.observable({
  661. locale: locale || i18n.getLocale()
  662. });
  663. var localeWatchers = [];
  664. appVm.$watchLocale = function (fn) {
  665. localeWatchers.push(fn);
  666. };
  667. Object.defineProperty(appVm, '$locale', {
  668. get: function get() {
  669. return state.locale;
  670. },
  671. set: function set(v) {
  672. state.locale = v;
  673. localeWatchers.forEach(function (watch) {
  674. return watch(v);
  675. });
  676. }
  677. });
  678. }
  679. function isEnableLocale() {
  680. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  681. }
  682. function include(str, parts) {
  683. return !!parts.find(function (part) {
  684. return str.indexOf(part) !== -1;
  685. });
  686. }
  687. function startsWith(str, parts) {
  688. return parts.find(function (part) {
  689. return str.indexOf(part) === 0;
  690. });
  691. }
  692. function normalizeLocale(locale, messages) {
  693. if (!locale) {
  694. return;
  695. }
  696. locale = locale.trim().replace(/_/g, '-');
  697. if (messages && messages[locale]) {
  698. return locale;
  699. }
  700. locale = locale.toLowerCase();
  701. if (locale === 'chinese') {
  702. // 支付宝
  703. return LOCALE_ZH_HANS;
  704. }
  705. if (locale.indexOf('zh') === 0) {
  706. if (locale.indexOf('-hans') > -1) {
  707. return LOCALE_ZH_HANS;
  708. }
  709. if (locale.indexOf('-hant') > -1) {
  710. return LOCALE_ZH_HANT;
  711. }
  712. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  713. return LOCALE_ZH_HANT;
  714. }
  715. return LOCALE_ZH_HANS;
  716. }
  717. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  718. if (lang) {
  719. return lang;
  720. }
  721. }
  722. // export function initI18n() {
  723. // const localeKeys = Object.keys(__uniConfig.locales || {})
  724. // if (localeKeys.length) {
  725. // localeKeys.forEach((locale) =>
  726. // i18n.add(locale, __uniConfig.locales[locale])
  727. // )
  728. // }
  729. // }
  730. function getLocale$1() {
  731. // 优先使用 $locale
  732. if (isFn(getApp)) {
  733. var app = getApp({
  734. allowDefault: true
  735. });
  736. if (app && app.$vm) {
  737. return app.$vm.$locale;
  738. }
  739. }
  740. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  741. }
  742. function setLocale$1(locale) {
  743. var app = isFn(getApp) ? getApp() : false;
  744. if (!app) {
  745. return false;
  746. }
  747. var oldLocale = app.$vm.$locale;
  748. if (oldLocale !== locale) {
  749. app.$vm.$locale = locale;
  750. onLocaleChangeCallbacks.forEach(function (fn) {
  751. return fn({
  752. locale: locale
  753. });
  754. });
  755. return true;
  756. }
  757. return false;
  758. }
  759. var onLocaleChangeCallbacks = [];
  760. function onLocaleChange(fn) {
  761. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  762. onLocaleChangeCallbacks.push(fn);
  763. }
  764. }
  765. if (typeof global !== 'undefined') {
  766. global.getLocale = getLocale$1;
  767. }
  768. var interceptors = {
  769. promiseInterceptor: promiseInterceptor
  770. };
  771. var baseApi = /*#__PURE__*/Object.freeze({
  772. __proto__: null,
  773. upx2px: upx2px,
  774. getLocale: getLocale$1,
  775. setLocale: setLocale$1,
  776. onLocaleChange: onLocaleChange,
  777. addInterceptor: addInterceptor,
  778. removeInterceptor: removeInterceptor,
  779. interceptors: interceptors
  780. });
  781. function findExistsPageIndex(url) {
  782. var pages = getCurrentPages();
  783. var len = pages.length;
  784. while (len--) {
  785. var page = pages[len];
  786. if (page.$page && page.$page.fullPath === url) {
  787. return len;
  788. }
  789. }
  790. return -1;
  791. }
  792. var redirectTo = {
  793. name: function name(fromArgs) {
  794. if (fromArgs.exists === 'back' && fromArgs.delta) {
  795. return 'navigateBack';
  796. }
  797. return 'redirectTo';
  798. },
  799. args: function args(fromArgs) {
  800. if (fromArgs.exists === 'back' && fromArgs.url) {
  801. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  802. if (existsPageIndex !== -1) {
  803. var delta = getCurrentPages().length - 1 - existsPageIndex;
  804. if (delta > 0) {
  805. fromArgs.delta = delta;
  806. }
  807. }
  808. }
  809. }
  810. };
  811. var previewImage = {
  812. args: function args(fromArgs) {
  813. var currentIndex = parseInt(fromArgs.current);
  814. if (isNaN(currentIndex)) {
  815. return;
  816. }
  817. var urls = fromArgs.urls;
  818. if (!Array.isArray(urls)) {
  819. return;
  820. }
  821. var len = urls.length;
  822. if (!len) {
  823. return;
  824. }
  825. if (currentIndex < 0) {
  826. currentIndex = 0;
  827. } else if (currentIndex >= len) {
  828. currentIndex = len - 1;
  829. }
  830. if (currentIndex > 0) {
  831. fromArgs.current = urls[currentIndex];
  832. fromArgs.urls = urls.filter(function (item, index) {
  833. return index < currentIndex ? item !== urls[currentIndex] : true;
  834. });
  835. } else {
  836. fromArgs.current = urls[0];
  837. }
  838. return {
  839. indicator: false,
  840. loop: false
  841. };
  842. }
  843. };
  844. var UUID_KEY = '__DC_STAT_UUID';
  845. var deviceId;
  846. function useDeviceId(result) {
  847. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  848. if (!deviceId) {
  849. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  850. wx.setStorage({
  851. key: UUID_KEY,
  852. data: deviceId
  853. });
  854. }
  855. result.deviceId = deviceId;
  856. }
  857. function addSafeAreaInsets(result) {
  858. if (result.safeArea) {
  859. var safeArea = result.safeArea;
  860. result.safeAreaInsets = {
  861. top: safeArea.top,
  862. left: safeArea.left,
  863. right: result.windowWidth - safeArea.right,
  864. bottom: result.screenHeight - safeArea.bottom
  865. };
  866. }
  867. }
  868. function populateParameters(result) {
  869. var _result$brand = result.brand,
  870. brand = _result$brand === void 0 ? '' : _result$brand,
  871. _result$model = result.model,
  872. model = _result$model === void 0 ? '' : _result$model,
  873. _result$system = result.system,
  874. system = _result$system === void 0 ? '' : _result$system,
  875. _result$language = result.language,
  876. language = _result$language === void 0 ? '' : _result$language,
  877. theme = result.theme,
  878. version = result.version,
  879. platform = result.platform,
  880. fontSizeSetting = result.fontSizeSetting,
  881. SDKVersion = result.SDKVersion,
  882. pixelRatio = result.pixelRatio,
  883. deviceOrientation = result.deviceOrientation;
  884. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  885. var extraParam = {};
  886. // osName osVersion
  887. var osName = '';
  888. var osVersion = '';
  889. {
  890. osName = system.split(' ')[0] || '';
  891. osVersion = system.split(' ')[1] || '';
  892. }
  893. var hostVersion = version;
  894. // deviceType
  895. var deviceType = getGetDeviceType(result, model);
  896. // deviceModel
  897. var deviceBrand = getDeviceBrand(brand);
  898. // hostName
  899. var _hostName = getHostName(result);
  900. // deviceOrientation
  901. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  902. // devicePixelRatio
  903. var _devicePixelRatio = pixelRatio;
  904. // SDKVersion
  905. var _SDKVersion = SDKVersion;
  906. // hostLanguage
  907. var hostLanguage = language.replace(/_/g, '-');
  908. // wx.getAccountInfoSync
  909. var parameters = {
  910. appId: "__UNI__1EF8770",
  911. appName: "速立保",
  912. appVersion: "1.0.0",
  913. appVersionCode: "100",
  914. appLanguage: getAppLanguage(hostLanguage),
  915. uniCompileVersion: "4.29",
  916. uniRuntimeVersion: "4.29",
  917. uniPlatform: undefined || "mp-weixin",
  918. deviceBrand: deviceBrand,
  919. deviceModel: model,
  920. deviceType: deviceType,
  921. devicePixelRatio: _devicePixelRatio,
  922. deviceOrientation: _deviceOrientation,
  923. osName: osName.toLocaleLowerCase(),
  924. osVersion: osVersion,
  925. hostTheme: theme,
  926. hostVersion: hostVersion,
  927. hostLanguage: hostLanguage,
  928. hostName: _hostName,
  929. hostSDKVersion: _SDKVersion,
  930. hostFontSizeSetting: fontSizeSetting,
  931. windowTop: 0,
  932. windowBottom: 0,
  933. // TODO
  934. osLanguage: undefined,
  935. osTheme: undefined,
  936. ua: undefined,
  937. hostPackageName: undefined,
  938. browserName: undefined,
  939. browserVersion: undefined
  940. };
  941. Object.assign(result, parameters, extraParam);
  942. }
  943. function getGetDeviceType(result, model) {
  944. var deviceType = result.deviceType || 'phone';
  945. {
  946. var deviceTypeMaps = {
  947. ipad: 'pad',
  948. windows: 'pc',
  949. mac: 'pc'
  950. };
  951. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  952. var _model = model.toLocaleLowerCase();
  953. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  954. var _m = deviceTypeMapsKeys[index];
  955. if (_model.indexOf(_m) !== -1) {
  956. deviceType = deviceTypeMaps[_m];
  957. break;
  958. }
  959. }
  960. }
  961. return deviceType;
  962. }
  963. function getDeviceBrand(brand) {
  964. var deviceBrand = brand;
  965. if (deviceBrand) {
  966. deviceBrand = brand.toLocaleLowerCase();
  967. }
  968. return deviceBrand;
  969. }
  970. function getAppLanguage(defaultLanguage) {
  971. return getLocale$1 ? getLocale$1() : defaultLanguage;
  972. }
  973. function getHostName(result) {
  974. var _platform = 'WeChat';
  975. var _hostName = result.hostName || _platform; // mp-jd
  976. {
  977. if (result.environment) {
  978. _hostName = result.environment;
  979. } else if (result.host && result.host.env) {
  980. _hostName = result.host.env;
  981. }
  982. }
  983. return _hostName;
  984. }
  985. var getSystemInfo = {
  986. returnValue: function returnValue(result) {
  987. useDeviceId(result);
  988. addSafeAreaInsets(result);
  989. populateParameters(result);
  990. }
  991. };
  992. var showActionSheet = {
  993. args: function args(fromArgs) {
  994. if ((0, _typeof2.default)(fromArgs) === 'object') {
  995. fromArgs.alertText = fromArgs.title;
  996. }
  997. }
  998. };
  999. var getAppBaseInfo = {
  1000. returnValue: function returnValue(result) {
  1001. var _result = result,
  1002. version = _result.version,
  1003. language = _result.language,
  1004. SDKVersion = _result.SDKVersion,
  1005. theme = _result.theme;
  1006. var _hostName = getHostName(result);
  1007. var hostLanguage = language.replace('_', '-');
  1008. result = sortObject(Object.assign(result, {
  1009. appId: "__UNI__1EF8770",
  1010. appName: "速立保",
  1011. appVersion: "1.0.0",
  1012. appVersionCode: "100",
  1013. appLanguage: getAppLanguage(hostLanguage),
  1014. hostVersion: version,
  1015. hostLanguage: hostLanguage,
  1016. hostName: _hostName,
  1017. hostSDKVersion: SDKVersion,
  1018. hostTheme: theme
  1019. }));
  1020. }
  1021. };
  1022. var getDeviceInfo = {
  1023. returnValue: function returnValue(result) {
  1024. var _result2 = result,
  1025. brand = _result2.brand,
  1026. model = _result2.model;
  1027. var deviceType = getGetDeviceType(result, model);
  1028. var deviceBrand = getDeviceBrand(brand);
  1029. useDeviceId(result);
  1030. result = sortObject(Object.assign(result, {
  1031. deviceType: deviceType,
  1032. deviceBrand: deviceBrand,
  1033. deviceModel: model
  1034. }));
  1035. }
  1036. };
  1037. var getWindowInfo = {
  1038. returnValue: function returnValue(result) {
  1039. addSafeAreaInsets(result);
  1040. result = sortObject(Object.assign(result, {
  1041. windowTop: 0,
  1042. windowBottom: 0
  1043. }));
  1044. }
  1045. };
  1046. var getAppAuthorizeSetting = {
  1047. returnValue: function returnValue(result) {
  1048. var locationReducedAccuracy = result.locationReducedAccuracy;
  1049. result.locationAccuracy = 'unsupported';
  1050. if (locationReducedAccuracy === true) {
  1051. result.locationAccuracy = 'reduced';
  1052. } else if (locationReducedAccuracy === false) {
  1053. result.locationAccuracy = 'full';
  1054. }
  1055. }
  1056. };
  1057. // import navigateTo from 'uni-helpers/navigate-to'
  1058. var compressImage = {
  1059. args: function args(fromArgs) {
  1060. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1061. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1062. fromArgs.compressHeight = fromArgs.compressedHeight;
  1063. }
  1064. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1065. fromArgs.compressWidth = fromArgs.compressedWidth;
  1066. }
  1067. }
  1068. };
  1069. var protocols = {
  1070. redirectTo: redirectTo,
  1071. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1072. previewImage: previewImage,
  1073. getSystemInfo: getSystemInfo,
  1074. getSystemInfoSync: getSystemInfo,
  1075. showActionSheet: showActionSheet,
  1076. getAppBaseInfo: getAppBaseInfo,
  1077. getDeviceInfo: getDeviceInfo,
  1078. getWindowInfo: getWindowInfo,
  1079. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1080. compressImage: compressImage
  1081. };
  1082. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1083. var canIUses = [];
  1084. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1085. function processCallback(methodName, method, returnValue) {
  1086. return function (res) {
  1087. return method(processReturnValue(methodName, res, returnValue));
  1088. };
  1089. }
  1090. function processArgs(methodName, fromArgs) {
  1091. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1092. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1093. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1094. if (isPlainObject(fromArgs)) {
  1095. // 一般 api 的参数解析
  1096. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1097. if (isFn(argsOption)) {
  1098. argsOption = argsOption(fromArgs, toArgs) || {};
  1099. }
  1100. for (var key in fromArgs) {
  1101. if (hasOwn(argsOption, key)) {
  1102. var keyOption = argsOption[key];
  1103. if (isFn(keyOption)) {
  1104. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1105. }
  1106. if (!keyOption) {
  1107. // 不支持的参数
  1108. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1109. } else if (isStr(keyOption)) {
  1110. // 重写参数 key
  1111. toArgs[keyOption] = fromArgs[key];
  1112. } else if (isPlainObject(keyOption)) {
  1113. // {name:newName,value:value}可重新指定参数 key:value
  1114. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1115. }
  1116. } else if (CALLBACKS.indexOf(key) !== -1) {
  1117. if (isFn(fromArgs[key])) {
  1118. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1119. }
  1120. } else {
  1121. if (!keepFromArgs) {
  1122. toArgs[key] = fromArgs[key];
  1123. }
  1124. }
  1125. }
  1126. return toArgs;
  1127. } else if (isFn(fromArgs)) {
  1128. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1129. }
  1130. return fromArgs;
  1131. }
  1132. function processReturnValue(methodName, res, returnValue) {
  1133. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1134. if (isFn(protocols.returnValue)) {
  1135. // 处理通用 returnValue
  1136. res = protocols.returnValue(methodName, res);
  1137. }
  1138. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1139. }
  1140. function wrapper(methodName, method) {
  1141. if (hasOwn(protocols, methodName)) {
  1142. var protocol = protocols[methodName];
  1143. if (!protocol) {
  1144. // 暂不支持的 api
  1145. return function () {
  1146. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1147. };
  1148. }
  1149. return function (arg1, arg2) {
  1150. // 目前 api 最多两个参数
  1151. var options = protocol;
  1152. if (isFn(protocol)) {
  1153. options = protocol(arg1);
  1154. }
  1155. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1156. var args = [arg1];
  1157. if (typeof arg2 !== 'undefined') {
  1158. args.push(arg2);
  1159. }
  1160. if (isFn(options.name)) {
  1161. methodName = options.name(arg1);
  1162. } else if (isStr(options.name)) {
  1163. methodName = options.name;
  1164. }
  1165. var returnValue = wx[methodName].apply(wx, args);
  1166. if (isSyncApi(methodName)) {
  1167. // 同步 api
  1168. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1169. }
  1170. return returnValue;
  1171. };
  1172. }
  1173. return method;
  1174. }
  1175. var todoApis = Object.create(null);
  1176. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1177. function createTodoApi(name) {
  1178. return function todoApi(_ref) {
  1179. var fail = _ref.fail,
  1180. complete = _ref.complete;
  1181. var res = {
  1182. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1183. };
  1184. isFn(fail) && fail(res);
  1185. isFn(complete) && complete(res);
  1186. };
  1187. }
  1188. TODOS.forEach(function (name) {
  1189. todoApis[name] = createTodoApi(name);
  1190. });
  1191. var providers = {
  1192. oauth: ['weixin'],
  1193. share: ['weixin'],
  1194. payment: ['wxpay'],
  1195. push: ['weixin']
  1196. };
  1197. function getProvider(_ref2) {
  1198. var service = _ref2.service,
  1199. success = _ref2.success,
  1200. fail = _ref2.fail,
  1201. complete = _ref2.complete;
  1202. var res = false;
  1203. if (providers[service]) {
  1204. res = {
  1205. errMsg: 'getProvider:ok',
  1206. service: service,
  1207. provider: providers[service]
  1208. };
  1209. isFn(success) && success(res);
  1210. } else {
  1211. res = {
  1212. errMsg: 'getProvider:fail service not found'
  1213. };
  1214. isFn(fail) && fail(res);
  1215. }
  1216. isFn(complete) && complete(res);
  1217. }
  1218. var extraApi = /*#__PURE__*/Object.freeze({
  1219. __proto__: null,
  1220. getProvider: getProvider
  1221. });
  1222. var getEmitter = function () {
  1223. var Emitter;
  1224. return function getUniEmitter() {
  1225. if (!Emitter) {
  1226. Emitter = new _vue.default();
  1227. }
  1228. return Emitter;
  1229. };
  1230. }();
  1231. function apply(ctx, method, args) {
  1232. return ctx[method].apply(ctx, args);
  1233. }
  1234. function $on() {
  1235. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1236. }
  1237. function $off() {
  1238. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1239. }
  1240. function $once() {
  1241. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1242. }
  1243. function $emit() {
  1244. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1245. }
  1246. var eventApi = /*#__PURE__*/Object.freeze({
  1247. __proto__: null,
  1248. $on: $on,
  1249. $off: $off,
  1250. $once: $once,
  1251. $emit: $emit
  1252. });
  1253. /**
  1254. * 框架内 try-catch
  1255. */
  1256. /**
  1257. * 开发者 try-catch
  1258. */
  1259. function tryCatch(fn) {
  1260. return function () {
  1261. try {
  1262. return fn.apply(fn, arguments);
  1263. } catch (e) {
  1264. // TODO
  1265. console.error(e);
  1266. }
  1267. };
  1268. }
  1269. function getApiCallbacks(params) {
  1270. var apiCallbacks = {};
  1271. for (var name in params) {
  1272. var param = params[name];
  1273. if (isFn(param)) {
  1274. apiCallbacks[name] = tryCatch(param);
  1275. delete params[name];
  1276. }
  1277. }
  1278. return apiCallbacks;
  1279. }
  1280. var cid;
  1281. var cidErrMsg;
  1282. var enabled;
  1283. function normalizePushMessage(message) {
  1284. try {
  1285. return JSON.parse(message);
  1286. } catch (e) {}
  1287. return message;
  1288. }
  1289. function invokePushCallback(args) {
  1290. if (args.type === 'enabled') {
  1291. enabled = true;
  1292. } else if (args.type === 'clientId') {
  1293. cid = args.cid;
  1294. cidErrMsg = args.errMsg;
  1295. invokeGetPushCidCallbacks(cid, args.errMsg);
  1296. } else if (args.type === 'pushMsg') {
  1297. var message = {
  1298. type: 'receive',
  1299. data: normalizePushMessage(args.message)
  1300. };
  1301. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1302. var callback = onPushMessageCallbacks[i];
  1303. callback(message);
  1304. // 该消息已被阻止
  1305. if (message.stopped) {
  1306. break;
  1307. }
  1308. }
  1309. } else if (args.type === 'click') {
  1310. onPushMessageCallbacks.forEach(function (callback) {
  1311. callback({
  1312. type: 'click',
  1313. data: normalizePushMessage(args.message)
  1314. });
  1315. });
  1316. }
  1317. }
  1318. var getPushCidCallbacks = [];
  1319. function invokeGetPushCidCallbacks(cid, errMsg) {
  1320. getPushCidCallbacks.forEach(function (callback) {
  1321. callback(cid, errMsg);
  1322. });
  1323. getPushCidCallbacks.length = 0;
  1324. }
  1325. function getPushClientId(args) {
  1326. if (!isPlainObject(args)) {
  1327. args = {};
  1328. }
  1329. var _getApiCallbacks = getApiCallbacks(args),
  1330. success = _getApiCallbacks.success,
  1331. fail = _getApiCallbacks.fail,
  1332. complete = _getApiCallbacks.complete;
  1333. var hasSuccess = isFn(success);
  1334. var hasFail = isFn(fail);
  1335. var hasComplete = isFn(complete);
  1336. Promise.resolve().then(function () {
  1337. if (typeof enabled === 'undefined') {
  1338. enabled = false;
  1339. cid = '';
  1340. cidErrMsg = 'uniPush is not enabled';
  1341. }
  1342. getPushCidCallbacks.push(function (cid, errMsg) {
  1343. var res;
  1344. if (cid) {
  1345. res = {
  1346. errMsg: 'getPushClientId:ok',
  1347. cid: cid
  1348. };
  1349. hasSuccess && success(res);
  1350. } else {
  1351. res = {
  1352. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1353. };
  1354. hasFail && fail(res);
  1355. }
  1356. hasComplete && complete(res);
  1357. });
  1358. if (typeof cid !== 'undefined') {
  1359. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1360. }
  1361. });
  1362. }
  1363. var onPushMessageCallbacks = [];
  1364. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1365. var onPushMessage = function onPushMessage(fn) {
  1366. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1367. onPushMessageCallbacks.push(fn);
  1368. }
  1369. };
  1370. var offPushMessage = function offPushMessage(fn) {
  1371. if (!fn) {
  1372. onPushMessageCallbacks.length = 0;
  1373. } else {
  1374. var index = onPushMessageCallbacks.indexOf(fn);
  1375. if (index > -1) {
  1376. onPushMessageCallbacks.splice(index, 1);
  1377. }
  1378. }
  1379. };
  1380. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1381. if (!baseInfo) {
  1382. baseInfo = wx.getSystemInfoSync();
  1383. }
  1384. var host = baseInfo ? baseInfo.host : null;
  1385. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1386. var api = /*#__PURE__*/Object.freeze({
  1387. __proto__: null,
  1388. shareVideoMessage: shareVideoMessage,
  1389. getPushClientId: getPushClientId,
  1390. onPushMessage: onPushMessage,
  1391. offPushMessage: offPushMessage,
  1392. invokePushCallback: invokePushCallback
  1393. });
  1394. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1395. function findVmByVueId(vm, vuePid) {
  1396. var $children = vm.$children;
  1397. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1398. for (var i = $children.length - 1; i >= 0; i--) {
  1399. var childVm = $children[i];
  1400. if (childVm.$scope._$vueId === vuePid) {
  1401. return childVm;
  1402. }
  1403. }
  1404. // 反向递归查找
  1405. var parentVm;
  1406. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1407. parentVm = findVmByVueId($children[_i], vuePid);
  1408. if (parentVm) {
  1409. return parentVm;
  1410. }
  1411. }
  1412. }
  1413. function initBehavior(options) {
  1414. return Behavior(options);
  1415. }
  1416. function isPage() {
  1417. return !!this.route;
  1418. }
  1419. function initRelation(detail) {
  1420. this.triggerEvent('__l', detail);
  1421. }
  1422. function selectAllComponents(mpInstance, selector, $refs) {
  1423. var components = mpInstance.selectAllComponents(selector) || [];
  1424. components.forEach(function (component) {
  1425. var ref = component.dataset.ref;
  1426. $refs[ref] = component.$vm || toSkip(component);
  1427. {
  1428. if (component.dataset.vueGeneric === 'scoped') {
  1429. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1430. selectAllComponents(scopedComponent, selector, $refs);
  1431. });
  1432. }
  1433. }
  1434. });
  1435. }
  1436. function syncRefs(refs, newRefs) {
  1437. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1438. var newKeys = Object.keys(newRefs);
  1439. newKeys.forEach(function (key) {
  1440. var oldValue = refs[key];
  1441. var newValue = newRefs[key];
  1442. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1443. return oldValue.includes(value);
  1444. })) {
  1445. return;
  1446. }
  1447. refs[key] = newValue;
  1448. oldKeys.delete(key);
  1449. });
  1450. oldKeys.forEach(function (key) {
  1451. delete refs[key];
  1452. });
  1453. return refs;
  1454. }
  1455. function initRefs(vm) {
  1456. var mpInstance = vm.$scope;
  1457. var refs = {};
  1458. Object.defineProperty(vm, '$refs', {
  1459. get: function get() {
  1460. var $refs = {};
  1461. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1462. // TODO 暂不考虑 for 中的 scoped
  1463. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1464. forComponents.forEach(function (component) {
  1465. var ref = component.dataset.ref;
  1466. if (!$refs[ref]) {
  1467. $refs[ref] = [];
  1468. }
  1469. $refs[ref].push(component.$vm || toSkip(component));
  1470. });
  1471. return syncRefs(refs, $refs);
  1472. }
  1473. });
  1474. }
  1475. function handleLink(event) {
  1476. var _ref3 = event.detail || event.value,
  1477. vuePid = _ref3.vuePid,
  1478. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1479. var parentVm;
  1480. if (vuePid) {
  1481. parentVm = findVmByVueId(this.$vm, vuePid);
  1482. }
  1483. if (!parentVm) {
  1484. parentVm = this.$vm;
  1485. }
  1486. vueOptions.parent = parentVm;
  1487. }
  1488. function markMPComponent(component) {
  1489. // 在 Vue 中标记为小程序组件
  1490. var IS_MP = '__v_isMPComponent';
  1491. Object.defineProperty(component, IS_MP, {
  1492. configurable: true,
  1493. enumerable: false,
  1494. value: true
  1495. });
  1496. return component;
  1497. }
  1498. function toSkip(obj) {
  1499. var OB = '__ob__';
  1500. var SKIP = '__v_skip';
  1501. if (isObject(obj) && Object.isExtensible(obj)) {
  1502. // 避免被 @vue/composition-api 观测
  1503. Object.defineProperty(obj, OB, {
  1504. configurable: true,
  1505. enumerable: false,
  1506. value: (0, _defineProperty2.default)({}, SKIP, true)
  1507. });
  1508. }
  1509. return obj;
  1510. }
  1511. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1512. function initWorkletMethods(mpMethods, vueMethods) {
  1513. if (vueMethods) {
  1514. Object.keys(vueMethods).forEach(function (name) {
  1515. var matches = name.match(WORKLET_RE);
  1516. if (matches) {
  1517. var workletName = matches[1];
  1518. mpMethods[name] = vueMethods[name];
  1519. mpMethods[workletName] = vueMethods[workletName];
  1520. }
  1521. });
  1522. }
  1523. }
  1524. var MPPage = Page;
  1525. var MPComponent = Component;
  1526. var customizeRE = /:/g;
  1527. var customize = cached(function (str) {
  1528. return camelize(str.replace(customizeRE, '-'));
  1529. });
  1530. function initTriggerEvent(mpInstance) {
  1531. var oldTriggerEvent = mpInstance.triggerEvent;
  1532. var newTriggerEvent = function newTriggerEvent(event) {
  1533. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1534. args[_key3 - 1] = arguments[_key3];
  1535. }
  1536. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1537. if (this.$vm || this.dataset && this.dataset.comType) {
  1538. event = customize(event);
  1539. } else {
  1540. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1541. var newEvent = customize(event);
  1542. if (newEvent !== event) {
  1543. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1544. }
  1545. }
  1546. return oldTriggerEvent.apply(this, [event].concat(args));
  1547. };
  1548. try {
  1549. // 京东小程序 triggerEvent 为只读
  1550. mpInstance.triggerEvent = newTriggerEvent;
  1551. } catch (error) {
  1552. mpInstance._triggerEvent = newTriggerEvent;
  1553. }
  1554. }
  1555. function initHook(name, options, isComponent) {
  1556. var oldHook = options[name];
  1557. options[name] = function () {
  1558. markMPComponent(this);
  1559. initTriggerEvent(this);
  1560. if (oldHook) {
  1561. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1562. args[_key4] = arguments[_key4];
  1563. }
  1564. return oldHook.apply(this, args);
  1565. }
  1566. };
  1567. }
  1568. if (!MPPage.__$wrappered) {
  1569. MPPage.__$wrappered = true;
  1570. Page = function Page() {
  1571. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1572. initHook('onLoad', options);
  1573. return MPPage(options);
  1574. };
  1575. Page.after = MPPage.after;
  1576. Component = function Component() {
  1577. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1578. initHook('created', options);
  1579. return MPComponent(options);
  1580. };
  1581. }
  1582. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1583. function initMocks(vm, mocks) {
  1584. var mpInstance = vm.$mp[vm.mpType];
  1585. mocks.forEach(function (mock) {
  1586. if (hasOwn(mpInstance, mock)) {
  1587. vm[mock] = mpInstance[mock];
  1588. }
  1589. });
  1590. }
  1591. function hasHook(hook, vueOptions) {
  1592. if (!vueOptions) {
  1593. return true;
  1594. }
  1595. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1596. return true;
  1597. }
  1598. vueOptions = vueOptions.default || vueOptions;
  1599. if (isFn(vueOptions)) {
  1600. if (isFn(vueOptions.extendOptions[hook])) {
  1601. return true;
  1602. }
  1603. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1604. return true;
  1605. }
  1606. return false;
  1607. }
  1608. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1609. return true;
  1610. }
  1611. var mixins = vueOptions.mixins;
  1612. if (Array.isArray(mixins)) {
  1613. return !!mixins.find(function (mixin) {
  1614. return hasHook(hook, mixin);
  1615. });
  1616. }
  1617. }
  1618. function initHooks(mpOptions, hooks, vueOptions) {
  1619. hooks.forEach(function (hook) {
  1620. if (hasHook(hook, vueOptions)) {
  1621. mpOptions[hook] = function (args) {
  1622. return this.$vm && this.$vm.__call_hook(hook, args);
  1623. };
  1624. }
  1625. });
  1626. }
  1627. function initUnknownHooks(mpOptions, vueOptions) {
  1628. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1629. findHooks(vueOptions).forEach(function (hook) {
  1630. return initHook$1(mpOptions, hook, excludes);
  1631. });
  1632. }
  1633. function findHooks(vueOptions) {
  1634. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1635. if (vueOptions) {
  1636. Object.keys(vueOptions).forEach(function (name) {
  1637. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1638. hooks.push(name);
  1639. }
  1640. });
  1641. }
  1642. return hooks;
  1643. }
  1644. function initHook$1(mpOptions, hook, excludes) {
  1645. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1646. mpOptions[hook] = function (args) {
  1647. return this.$vm && this.$vm.__call_hook(hook, args);
  1648. };
  1649. }
  1650. }
  1651. function initVueComponent(Vue, vueOptions) {
  1652. vueOptions = vueOptions.default || vueOptions;
  1653. var VueComponent;
  1654. if (isFn(vueOptions)) {
  1655. VueComponent = vueOptions;
  1656. } else {
  1657. VueComponent = Vue.extend(vueOptions);
  1658. }
  1659. vueOptions = VueComponent.options;
  1660. return [VueComponent, vueOptions];
  1661. }
  1662. function initSlots(vm, vueSlots) {
  1663. if (Array.isArray(vueSlots) && vueSlots.length) {
  1664. var $slots = Object.create(null);
  1665. vueSlots.forEach(function (slotName) {
  1666. $slots[slotName] = true;
  1667. });
  1668. vm.$scopedSlots = vm.$slots = $slots;
  1669. }
  1670. }
  1671. function initVueIds(vueIds, mpInstance) {
  1672. vueIds = (vueIds || '').split(',');
  1673. var len = vueIds.length;
  1674. if (len === 1) {
  1675. mpInstance._$vueId = vueIds[0];
  1676. } else if (len === 2) {
  1677. mpInstance._$vueId = vueIds[0];
  1678. mpInstance._$vuePid = vueIds[1];
  1679. }
  1680. }
  1681. function initData(vueOptions, context) {
  1682. var data = vueOptions.data || {};
  1683. var methods = vueOptions.methods || {};
  1684. if (typeof data === 'function') {
  1685. try {
  1686. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1687. } catch (e) {
  1688. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"速立保","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1689. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1690. }
  1691. }
  1692. } else {
  1693. try {
  1694. // 对 data 格式化
  1695. data = JSON.parse(JSON.stringify(data));
  1696. } catch (e) {}
  1697. }
  1698. if (!isPlainObject(data)) {
  1699. data = {};
  1700. }
  1701. Object.keys(methods).forEach(function (methodName) {
  1702. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1703. data[methodName] = methods[methodName];
  1704. }
  1705. });
  1706. return data;
  1707. }
  1708. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1709. function createObserver(name) {
  1710. return function observer(newVal, oldVal) {
  1711. if (this.$vm) {
  1712. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1713. }
  1714. };
  1715. }
  1716. function initBehaviors(vueOptions, initBehavior) {
  1717. var vueBehaviors = vueOptions.behaviors;
  1718. var vueExtends = vueOptions.extends;
  1719. var vueMixins = vueOptions.mixins;
  1720. var vueProps = vueOptions.props;
  1721. if (!vueProps) {
  1722. vueOptions.props = vueProps = [];
  1723. }
  1724. var behaviors = [];
  1725. if (Array.isArray(vueBehaviors)) {
  1726. vueBehaviors.forEach(function (behavior) {
  1727. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1728. if (behavior === 'uni://form-field') {
  1729. if (Array.isArray(vueProps)) {
  1730. vueProps.push('name');
  1731. vueProps.push('value');
  1732. } else {
  1733. vueProps.name = {
  1734. type: String,
  1735. default: ''
  1736. };
  1737. vueProps.value = {
  1738. type: [String, Number, Boolean, Array, Object, Date],
  1739. default: ''
  1740. };
  1741. }
  1742. }
  1743. });
  1744. }
  1745. if (isPlainObject(vueExtends) && vueExtends.props) {
  1746. behaviors.push(initBehavior({
  1747. properties: initProperties(vueExtends.props, true)
  1748. }));
  1749. }
  1750. if (Array.isArray(vueMixins)) {
  1751. vueMixins.forEach(function (vueMixin) {
  1752. if (isPlainObject(vueMixin) && vueMixin.props) {
  1753. behaviors.push(initBehavior({
  1754. properties: initProperties(vueMixin.props, true)
  1755. }));
  1756. }
  1757. });
  1758. }
  1759. return behaviors;
  1760. }
  1761. function parsePropType(key, type, defaultValue, file) {
  1762. // [String]=>String
  1763. if (Array.isArray(type) && type.length === 1) {
  1764. return type[0];
  1765. }
  1766. return type;
  1767. }
  1768. function initProperties(props) {
  1769. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1770. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1771. var options = arguments.length > 3 ? arguments[3] : undefined;
  1772. var properties = {};
  1773. if (!isBehavior) {
  1774. properties.vueId = {
  1775. type: String,
  1776. value: ''
  1777. };
  1778. {
  1779. if (options.virtualHost) {
  1780. properties.virtualHostStyle = {
  1781. type: null,
  1782. value: ''
  1783. };
  1784. properties.virtualHostClass = {
  1785. type: null,
  1786. value: ''
  1787. };
  1788. }
  1789. }
  1790. // scopedSlotsCompiler auto
  1791. properties.scopedSlotsCompiler = {
  1792. type: String,
  1793. value: ''
  1794. };
  1795. properties.vueSlots = {
  1796. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1797. type: null,
  1798. value: [],
  1799. observer: function observer(newVal, oldVal) {
  1800. var $slots = Object.create(null);
  1801. newVal.forEach(function (slotName) {
  1802. $slots[slotName] = true;
  1803. });
  1804. this.setData({
  1805. $slots: $slots
  1806. });
  1807. }
  1808. };
  1809. }
  1810. if (Array.isArray(props)) {
  1811. // ['title']
  1812. props.forEach(function (key) {
  1813. properties[key] = {
  1814. type: null,
  1815. observer: createObserver(key)
  1816. };
  1817. });
  1818. } else if (isPlainObject(props)) {
  1819. // {title:{type:String,default:''},content:String}
  1820. Object.keys(props).forEach(function (key) {
  1821. var opts = props[key];
  1822. if (isPlainObject(opts)) {
  1823. // title:{type:String,default:''}
  1824. var value = opts.default;
  1825. if (isFn(value)) {
  1826. value = value();
  1827. }
  1828. opts.type = parsePropType(key, opts.type);
  1829. properties[key] = {
  1830. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1831. value: value,
  1832. observer: createObserver(key)
  1833. };
  1834. } else {
  1835. // content:String
  1836. var type = parsePropType(key, opts);
  1837. properties[key] = {
  1838. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1839. observer: createObserver(key)
  1840. };
  1841. }
  1842. });
  1843. }
  1844. return properties;
  1845. }
  1846. function wrapper$1(event) {
  1847. // TODO 又得兼容 mpvue 的 mp 对象
  1848. try {
  1849. event.mp = JSON.parse(JSON.stringify(event));
  1850. } catch (e) {}
  1851. event.stopPropagation = noop;
  1852. event.preventDefault = noop;
  1853. event.target = event.target || {};
  1854. if (!hasOwn(event, 'detail')) {
  1855. event.detail = {};
  1856. }
  1857. if (hasOwn(event, 'markerId')) {
  1858. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1859. event.detail.markerId = event.markerId;
  1860. }
  1861. if (isPlainObject(event.detail)) {
  1862. event.target = Object.assign({}, event.target, event.detail);
  1863. }
  1864. return event;
  1865. }
  1866. function getExtraValue(vm, dataPathsArray) {
  1867. var context = vm;
  1868. dataPathsArray.forEach(function (dataPathArray) {
  1869. var dataPath = dataPathArray[0];
  1870. var value = dataPathArray[2];
  1871. if (dataPath || typeof value !== 'undefined') {
  1872. // ['','',index,'disable']
  1873. var propPath = dataPathArray[1];
  1874. var valuePath = dataPathArray[3];
  1875. var vFor;
  1876. if (Number.isInteger(dataPath)) {
  1877. vFor = dataPath;
  1878. } else if (!dataPath) {
  1879. vFor = context;
  1880. } else if (typeof dataPath === 'string' && dataPath) {
  1881. if (dataPath.indexOf('#s#') === 0) {
  1882. vFor = dataPath.substr(3);
  1883. } else {
  1884. vFor = vm.__get_value(dataPath, context);
  1885. }
  1886. }
  1887. if (Number.isInteger(vFor)) {
  1888. context = value;
  1889. } else if (!propPath) {
  1890. context = vFor[value];
  1891. } else {
  1892. if (Array.isArray(vFor)) {
  1893. context = vFor.find(function (vForItem) {
  1894. return vm.__get_value(propPath, vForItem) === value;
  1895. });
  1896. } else if (isPlainObject(vFor)) {
  1897. context = Object.keys(vFor).find(function (vForKey) {
  1898. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1899. });
  1900. } else {
  1901. console.error('v-for 暂不支持循环数据:', vFor);
  1902. }
  1903. }
  1904. if (valuePath) {
  1905. context = vm.__get_value(valuePath, context);
  1906. }
  1907. }
  1908. });
  1909. return context;
  1910. }
  1911. function processEventExtra(vm, extra, event, __args__) {
  1912. var extraObj = {};
  1913. if (Array.isArray(extra) && extra.length) {
  1914. /**
  1915. *[
  1916. * ['data.items', 'data.id', item.data.id],
  1917. * ['metas', 'id', meta.id]
  1918. *],
  1919. *[
  1920. * ['data.items', 'data.id', item.data.id],
  1921. * ['metas', 'id', meta.id]
  1922. *],
  1923. *'test'
  1924. */
  1925. extra.forEach(function (dataPath, index) {
  1926. if (typeof dataPath === 'string') {
  1927. if (!dataPath) {
  1928. // model,prop.sync
  1929. extraObj['$' + index] = vm;
  1930. } else {
  1931. if (dataPath === '$event') {
  1932. // $event
  1933. extraObj['$' + index] = event;
  1934. } else if (dataPath === 'arguments') {
  1935. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1936. } else if (dataPath.indexOf('$event.') === 0) {
  1937. // $event.target.value
  1938. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1939. } else {
  1940. extraObj['$' + index] = vm.__get_value(dataPath);
  1941. }
  1942. }
  1943. } else {
  1944. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1945. }
  1946. });
  1947. }
  1948. return extraObj;
  1949. }
  1950. function getObjByArray(arr) {
  1951. var obj = {};
  1952. for (var i = 1; i < arr.length; i++) {
  1953. var element = arr[i];
  1954. obj[element[0]] = element[1];
  1955. }
  1956. return obj;
  1957. }
  1958. function processEventArgs(vm, event) {
  1959. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1960. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1961. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1962. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1963. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1964. // fixed 用户直接触发 mpInstance.triggerEvent
  1965. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1966. if (isCustom) {
  1967. // 自定义事件
  1968. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1969. if (!args.length) {
  1970. // 无参数,直接传入 event 或 detail 数组
  1971. if (isCustomMPEvent) {
  1972. return [event];
  1973. }
  1974. return __args__;
  1975. }
  1976. }
  1977. var extraObj = processEventExtra(vm, extra, event, __args__);
  1978. var ret = [];
  1979. args.forEach(function (arg) {
  1980. if (arg === '$event') {
  1981. if (methodName === '__set_model' && !isCustom) {
  1982. // input v-model value
  1983. ret.push(event.target.value);
  1984. } else {
  1985. if (isCustom && !isCustomMPEvent) {
  1986. ret.push(__args__[0]);
  1987. } else {
  1988. // wxcomponent 组件或内置组件
  1989. ret.push(event);
  1990. }
  1991. }
  1992. } else {
  1993. if (Array.isArray(arg) && arg[0] === 'o') {
  1994. ret.push(getObjByArray(arg));
  1995. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1996. ret.push(extraObj[arg]);
  1997. } else {
  1998. ret.push(arg);
  1999. }
  2000. }
  2001. });
  2002. return ret;
  2003. }
  2004. var ONCE = '~';
  2005. var CUSTOM = '^';
  2006. function isMatchEventType(eventType, optType) {
  2007. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2008. }
  2009. function getContextVm(vm) {
  2010. var $parent = vm.$parent;
  2011. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2012. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2013. $parent = $parent.$parent;
  2014. }
  2015. return $parent && $parent.$parent;
  2016. }
  2017. function handleEvent(event) {
  2018. var _this2 = this;
  2019. event = wrapper$1(event);
  2020. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2021. var dataset = (event.currentTarget || event.target).dataset;
  2022. if (!dataset) {
  2023. return console.warn('事件信息不存在');
  2024. }
  2025. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2026. if (!eventOpts) {
  2027. return console.warn('事件信息不存在');
  2028. }
  2029. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2030. var eventType = event.type;
  2031. var ret = [];
  2032. eventOpts.forEach(function (eventOpt) {
  2033. var type = eventOpt[0];
  2034. var eventsArray = eventOpt[1];
  2035. var isCustom = type.charAt(0) === CUSTOM;
  2036. type = isCustom ? type.slice(1) : type;
  2037. var isOnce = type.charAt(0) === ONCE;
  2038. type = isOnce ? type.slice(1) : type;
  2039. if (eventsArray && isMatchEventType(eventType, type)) {
  2040. eventsArray.forEach(function (eventArray) {
  2041. var methodName = eventArray[0];
  2042. if (methodName) {
  2043. var handlerCtx = _this2.$vm;
  2044. if (handlerCtx.$options.generic) {
  2045. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2046. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2047. }
  2048. if (methodName === '$emit') {
  2049. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2050. return;
  2051. }
  2052. var handler = handlerCtx[methodName];
  2053. if (!isFn(handler)) {
  2054. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2055. var path = _this2.route || _this2.is;
  2056. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2057. }
  2058. if (isOnce) {
  2059. if (handler.once) {
  2060. return;
  2061. }
  2062. handler.once = true;
  2063. }
  2064. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2065. params = Array.isArray(params) ? params : [];
  2066. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2067. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2068. // eslint-disable-next-line no-sparse-arrays
  2069. params = params.concat([,,,,,,,,,, event]);
  2070. }
  2071. ret.push(handler.apply(handlerCtx, params));
  2072. }
  2073. });
  2074. }
  2075. });
  2076. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2077. return ret[0];
  2078. }
  2079. }
  2080. var eventChannels = {};
  2081. function getEventChannel(id) {
  2082. var eventChannel = eventChannels[id];
  2083. delete eventChannels[id];
  2084. return eventChannel;
  2085. }
  2086. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2087. function initEventChannel() {
  2088. _vue.default.prototype.getOpenerEventChannel = function () {
  2089. // 微信小程序使用自身getOpenerEventChannel
  2090. {
  2091. return this.$scope.getOpenerEventChannel();
  2092. }
  2093. };
  2094. var callHook = _vue.default.prototype.__call_hook;
  2095. _vue.default.prototype.__call_hook = function (hook, args) {
  2096. if (hook === 'onLoad' && args && args.__id__) {
  2097. this.__eventChannel__ = getEventChannel(args.__id__);
  2098. delete args.__id__;
  2099. }
  2100. return callHook.call(this, hook, args);
  2101. };
  2102. }
  2103. function initScopedSlotsParams() {
  2104. var center = {};
  2105. var parents = {};
  2106. function currentId(fn) {
  2107. var vueIds = this.$options.propsData.vueId;
  2108. if (vueIds) {
  2109. var vueId = vueIds.split(',')[0];
  2110. fn(vueId);
  2111. }
  2112. }
  2113. _vue.default.prototype.$hasSSP = function (vueId) {
  2114. var slot = center[vueId];
  2115. if (!slot) {
  2116. parents[vueId] = this;
  2117. this.$on('hook:destroyed', function () {
  2118. delete parents[vueId];
  2119. });
  2120. }
  2121. return slot;
  2122. };
  2123. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2124. var slot = center[vueId];
  2125. if (slot) {
  2126. var params = slot[name] || [];
  2127. if (needAll) {
  2128. return params;
  2129. }
  2130. return params[0];
  2131. }
  2132. };
  2133. _vue.default.prototype.$setSSP = function (name, value) {
  2134. var index = 0;
  2135. currentId.call(this, function (vueId) {
  2136. var slot = center[vueId];
  2137. var params = slot[name] = slot[name] || [];
  2138. params.push(value);
  2139. index = params.length - 1;
  2140. });
  2141. return index;
  2142. };
  2143. _vue.default.prototype.$initSSP = function () {
  2144. currentId.call(this, function (vueId) {
  2145. center[vueId] = {};
  2146. });
  2147. };
  2148. _vue.default.prototype.$callSSP = function () {
  2149. currentId.call(this, function (vueId) {
  2150. if (parents[vueId]) {
  2151. parents[vueId].$forceUpdate();
  2152. }
  2153. });
  2154. };
  2155. _vue.default.mixin({
  2156. destroyed: function destroyed() {
  2157. var propsData = this.$options.propsData;
  2158. var vueId = propsData && propsData.vueId;
  2159. if (vueId) {
  2160. delete center[vueId];
  2161. delete parents[vueId];
  2162. }
  2163. }
  2164. });
  2165. }
  2166. function parseBaseApp(vm, _ref4) {
  2167. var mocks = _ref4.mocks,
  2168. initRefs = _ref4.initRefs;
  2169. initEventChannel();
  2170. {
  2171. initScopedSlotsParams();
  2172. }
  2173. if (vm.$options.store) {
  2174. _vue.default.prototype.$store = vm.$options.store;
  2175. }
  2176. uniIdMixin(_vue.default);
  2177. _vue.default.prototype.mpHost = "mp-weixin";
  2178. _vue.default.mixin({
  2179. beforeCreate: function beforeCreate() {
  2180. if (!this.$options.mpType) {
  2181. return;
  2182. }
  2183. this.mpType = this.$options.mpType;
  2184. this.$mp = (0, _defineProperty2.default)({
  2185. data: {}
  2186. }, this.mpType, this.$options.mpInstance);
  2187. this.$scope = this.$options.mpInstance;
  2188. delete this.$options.mpType;
  2189. delete this.$options.mpInstance;
  2190. if (this.mpType === 'page' && typeof getApp === 'function') {
  2191. // hack vue-i18n
  2192. var app = getApp();
  2193. if (app.$vm && app.$vm.$i18n) {
  2194. this._i18n = app.$vm.$i18n;
  2195. }
  2196. }
  2197. if (this.mpType !== 'app') {
  2198. initRefs(this);
  2199. initMocks(this, mocks);
  2200. }
  2201. }
  2202. });
  2203. var appOptions = {
  2204. onLaunch: function onLaunch(args) {
  2205. if (this.$vm) {
  2206. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2207. return;
  2208. }
  2209. {
  2210. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2211. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2212. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2213. }
  2214. }
  2215. this.$vm = vm;
  2216. this.$vm.$mp = {
  2217. app: this
  2218. };
  2219. this.$vm.$scope = this;
  2220. // vm 上也挂载 globalData
  2221. this.$vm.globalData = this.globalData;
  2222. this.$vm._isMounted = true;
  2223. this.$vm.__call_hook('mounted', args);
  2224. this.$vm.__call_hook('onLaunch', args);
  2225. }
  2226. };
  2227. // 兼容旧版本 globalData
  2228. appOptions.globalData = vm.$options.globalData || {};
  2229. // 将 methods 中的方法挂在 getApp() 中
  2230. var methods = vm.$options.methods;
  2231. if (methods) {
  2232. Object.keys(methods).forEach(function (name) {
  2233. appOptions[name] = methods[name];
  2234. });
  2235. }
  2236. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2237. initHooks(appOptions, hooks);
  2238. initUnknownHooks(appOptions, vm.$options);
  2239. return appOptions;
  2240. }
  2241. function parseApp(vm) {
  2242. return parseBaseApp(vm, {
  2243. mocks: mocks,
  2244. initRefs: initRefs
  2245. });
  2246. }
  2247. function createApp(vm) {
  2248. App(parseApp(vm));
  2249. return vm;
  2250. }
  2251. var encodeReserveRE = /[!'()*]/g;
  2252. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2253. return '%' + c.charCodeAt(0).toString(16);
  2254. };
  2255. var commaRE = /%2C/g;
  2256. // fixed encodeURIComponent which is more conformant to RFC3986:
  2257. // - escapes [!'()*]
  2258. // - preserve commas
  2259. var encode = function encode(str) {
  2260. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2261. };
  2262. function stringifyQuery(obj) {
  2263. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2264. var res = obj ? Object.keys(obj).map(function (key) {
  2265. var val = obj[key];
  2266. if (val === undefined) {
  2267. return '';
  2268. }
  2269. if (val === null) {
  2270. return encodeStr(key);
  2271. }
  2272. if (Array.isArray(val)) {
  2273. var result = [];
  2274. val.forEach(function (val2) {
  2275. if (val2 === undefined) {
  2276. return;
  2277. }
  2278. if (val2 === null) {
  2279. result.push(encodeStr(key));
  2280. } else {
  2281. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2282. }
  2283. });
  2284. return result.join('&');
  2285. }
  2286. return encodeStr(key) + '=' + encodeStr(val);
  2287. }).filter(function (x) {
  2288. return x.length > 0;
  2289. }).join('&') : null;
  2290. return res ? "?".concat(res) : '';
  2291. }
  2292. function parseBaseComponent(vueComponentOptions) {
  2293. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2294. isPage = _ref5.isPage,
  2295. initRelation = _ref5.initRelation;
  2296. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2297. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2298. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2299. VueComponent = _initVueComponent2[0],
  2300. vueOptions = _initVueComponent2[1];
  2301. var options = _objectSpread({
  2302. multipleSlots: true,
  2303. // styleIsolation: 'apply-shared',
  2304. addGlobalClass: true
  2305. }, vueOptions.options || {});
  2306. {
  2307. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2308. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2309. Object.assign(options, vueOptions['mp-weixin'].options);
  2310. }
  2311. }
  2312. var componentOptions = {
  2313. options: options,
  2314. data: initData(vueOptions, _vue.default.prototype),
  2315. behaviors: initBehaviors(vueOptions, initBehavior),
  2316. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2317. lifetimes: {
  2318. attached: function attached() {
  2319. var properties = this.properties;
  2320. var options = {
  2321. mpType: isPage.call(this) ? 'page' : 'component',
  2322. mpInstance: this,
  2323. propsData: properties
  2324. };
  2325. initVueIds(properties.vueId, this);
  2326. // 处理父子关系
  2327. initRelation.call(this, {
  2328. vuePid: this._$vuePid,
  2329. vueOptions: options
  2330. });
  2331. // 初始化 vue 实例
  2332. this.$vm = new VueComponent(options);
  2333. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2334. initSlots(this.$vm, properties.vueSlots);
  2335. // 触发首次 setData
  2336. this.$vm.$mount();
  2337. },
  2338. ready: function ready() {
  2339. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2340. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2341. if (this.$vm) {
  2342. this.$vm._isMounted = true;
  2343. this.$vm.__call_hook('mounted');
  2344. this.$vm.__call_hook('onReady');
  2345. }
  2346. },
  2347. detached: function detached() {
  2348. this.$vm && this.$vm.$destroy();
  2349. }
  2350. },
  2351. pageLifetimes: {
  2352. show: function show(args) {
  2353. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2354. },
  2355. hide: function hide() {
  2356. this.$vm && this.$vm.__call_hook('onPageHide');
  2357. },
  2358. resize: function resize(size) {
  2359. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2360. }
  2361. },
  2362. methods: {
  2363. __l: handleLink,
  2364. __e: handleEvent
  2365. }
  2366. };
  2367. // externalClasses
  2368. if (vueOptions.externalClasses) {
  2369. componentOptions.externalClasses = vueOptions.externalClasses;
  2370. }
  2371. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2372. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2373. componentOptions.methods[callMethod] = function (args) {
  2374. return this.$vm[callMethod](args);
  2375. };
  2376. });
  2377. }
  2378. if (needVueOptions) {
  2379. return [componentOptions, vueOptions, VueComponent];
  2380. }
  2381. if (isPage) {
  2382. return componentOptions;
  2383. }
  2384. return [componentOptions, VueComponent];
  2385. }
  2386. function parseComponent(vueComponentOptions, needVueOptions) {
  2387. return parseBaseComponent(vueComponentOptions, {
  2388. isPage: isPage,
  2389. initRelation: initRelation
  2390. }, needVueOptions);
  2391. }
  2392. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2393. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2394. function parseBasePage(vuePageOptions) {
  2395. var _parseComponent = parseComponent(vuePageOptions, true),
  2396. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2397. pageOptions = _parseComponent2[0],
  2398. vueOptions = _parseComponent2[1];
  2399. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2400. pageOptions.methods.onLoad = function (query) {
  2401. this.options = query;
  2402. var copyQuery = Object.assign({}, query);
  2403. delete copyQuery.__id__;
  2404. this.$page = {
  2405. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2406. };
  2407. this.$vm.$mp.query = query; // 兼容 mpvue
  2408. this.$vm.__call_hook('onLoad', query);
  2409. };
  2410. {
  2411. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2412. }
  2413. {
  2414. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2415. }
  2416. return pageOptions;
  2417. }
  2418. function parsePage(vuePageOptions) {
  2419. return parseBasePage(vuePageOptions);
  2420. }
  2421. function createPage(vuePageOptions) {
  2422. {
  2423. return Component(parsePage(vuePageOptions));
  2424. }
  2425. }
  2426. function createComponent(vueOptions) {
  2427. {
  2428. return Component(parseComponent(vueOptions));
  2429. }
  2430. }
  2431. function createSubpackageApp(vm) {
  2432. var appOptions = parseApp(vm);
  2433. var app = getApp({
  2434. allowDefault: true
  2435. });
  2436. vm.$scope = app;
  2437. var globalData = app.globalData;
  2438. if (globalData) {
  2439. Object.keys(appOptions.globalData).forEach(function (name) {
  2440. if (!hasOwn(globalData, name)) {
  2441. globalData[name] = appOptions.globalData[name];
  2442. }
  2443. });
  2444. }
  2445. Object.keys(appOptions).forEach(function (name) {
  2446. if (!hasOwn(app, name)) {
  2447. app[name] = appOptions[name];
  2448. }
  2449. });
  2450. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2451. wx.onAppShow(function () {
  2452. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2453. args[_key5] = arguments[_key5];
  2454. }
  2455. vm.__call_hook('onShow', args);
  2456. });
  2457. }
  2458. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2459. wx.onAppHide(function () {
  2460. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2461. args[_key6] = arguments[_key6];
  2462. }
  2463. vm.__call_hook('onHide', args);
  2464. });
  2465. }
  2466. if (isFn(appOptions.onLaunch)) {
  2467. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2468. vm.__call_hook('onLaunch', args);
  2469. }
  2470. return vm;
  2471. }
  2472. function createPlugin(vm) {
  2473. var appOptions = parseApp(vm);
  2474. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2475. wx.onAppShow(function () {
  2476. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2477. args[_key7] = arguments[_key7];
  2478. }
  2479. vm.__call_hook('onShow', args);
  2480. });
  2481. }
  2482. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2483. wx.onAppHide(function () {
  2484. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2485. args[_key8] = arguments[_key8];
  2486. }
  2487. vm.__call_hook('onHide', args);
  2488. });
  2489. }
  2490. if (isFn(appOptions.onLaunch)) {
  2491. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2492. vm.__call_hook('onLaunch', args);
  2493. }
  2494. return vm;
  2495. }
  2496. todos.forEach(function (todoApi) {
  2497. protocols[todoApi] = false;
  2498. });
  2499. canIUses.forEach(function (canIUseApi) {
  2500. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2501. if (!wx.canIUse(apiName)) {
  2502. protocols[canIUseApi] = false;
  2503. }
  2504. });
  2505. var uni = {};
  2506. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2507. uni = new Proxy({}, {
  2508. get: function get(target, name) {
  2509. if (hasOwn(target, name)) {
  2510. return target[name];
  2511. }
  2512. if (baseApi[name]) {
  2513. return baseApi[name];
  2514. }
  2515. if (api[name]) {
  2516. return promisify(name, api[name]);
  2517. }
  2518. {
  2519. if (extraApi[name]) {
  2520. return promisify(name, extraApi[name]);
  2521. }
  2522. if (todoApis[name]) {
  2523. return promisify(name, todoApis[name]);
  2524. }
  2525. }
  2526. if (eventApi[name]) {
  2527. return eventApi[name];
  2528. }
  2529. return promisify(name, wrapper(name, wx[name]));
  2530. },
  2531. set: function set(target, name, value) {
  2532. target[name] = value;
  2533. return true;
  2534. }
  2535. });
  2536. } else {
  2537. Object.keys(baseApi).forEach(function (name) {
  2538. uni[name] = baseApi[name];
  2539. });
  2540. {
  2541. Object.keys(todoApis).forEach(function (name) {
  2542. uni[name] = promisify(name, todoApis[name]);
  2543. });
  2544. Object.keys(extraApi).forEach(function (name) {
  2545. uni[name] = promisify(name, extraApi[name]);
  2546. });
  2547. }
  2548. Object.keys(eventApi).forEach(function (name) {
  2549. uni[name] = eventApi[name];
  2550. });
  2551. Object.keys(api).forEach(function (name) {
  2552. uni[name] = promisify(name, api[name]);
  2553. });
  2554. Object.keys(wx).forEach(function (name) {
  2555. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2556. uni[name] = promisify(name, wrapper(name, wx[name]));
  2557. }
  2558. });
  2559. }
  2560. wx.createApp = createApp;
  2561. wx.createPage = createPage;
  2562. wx.createComponent = createComponent;
  2563. wx.createSubpackageApp = createSubpackageApp;
  2564. wx.createPlugin = createPlugin;
  2565. var uni$1 = uni;
  2566. var _default = uni$1;
  2567. exports.default = _default;
  2568. /* 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)))
  2569. /***/ }),
  2570. /***/ 20:
  2571. /*!****************************************************************!*\
  2572. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2573. \****************************************************************/
  2574. /*! no static exports found */
  2575. /***/ (function(module, exports) {
  2576. function _iterableToArray(iter) {
  2577. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2578. }
  2579. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2580. /***/ }),
  2581. /***/ 209:
  2582. /*!************************************************************!*\
  2583. !*** E:/盈通/sulibao-mini/libs/mixin/template_page_mixin.js ***!
  2584. \************************************************************/
  2585. /*! no static exports found */
  2586. /***/ (function(module, exports, __webpack_require__) {
  2587. /* WEBPACK VAR INJECTION */(function(uni) {var _regeneratorRuntime = __webpack_require__(/*! @babel/runtime/regenerator */ 63);
  2588. var _asyncToGenerator = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65);
  2589. /**
  2590. * 演示页面mixin
  2591. */
  2592. module.exports = {
  2593. data: function data() {
  2594. return {};
  2595. },
  2596. onLoad: function onLoad() {
  2597. // 更新顶部导航栏信息
  2598. this.updateCustomBarInfo();
  2599. },
  2600. methods: {
  2601. // 点击左上角返回按钮时触发事件
  2602. goBack: function goBack() {
  2603. // 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
  2604. var pages = getCurrentPages();
  2605. if (pages && pages.length > 0) {
  2606. var firstPage = pages[0];
  2607. if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/index')) {
  2608. uni.reLaunch({
  2609. url: '/pages/index'
  2610. });
  2611. } else {
  2612. uni.navigateBack({
  2613. delta: 1
  2614. });
  2615. }
  2616. } else {
  2617. uni.reLaunch({
  2618. url: '/pages/index'
  2619. });
  2620. }
  2621. },
  2622. // 更新顶部导航栏信息
  2623. updateCustomBarInfo: function updateCustomBarInfo() {
  2624. var _this = this;
  2625. return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
  2626. var customBarHeight, statusBarHeight, navBarInfo;
  2627. return _regeneratorRuntime.wrap(function _callee$(_context) {
  2628. while (1) {
  2629. switch (_context.prev = _context.next) {
  2630. case 0:
  2631. // 获取vuex中的自定义顶栏的高度
  2632. customBarHeight = _this.vuex_custom_bar_height;
  2633. statusBarHeight = _this.vuex_status_bar_height; // 如果获取失败则重新获取
  2634. if (customBarHeight) {
  2635. _context.next = 15;
  2636. break;
  2637. }
  2638. _context.prev = 3;
  2639. _context.next = 6;
  2640. return _this.$t.updateCustomBar();
  2641. case 6:
  2642. navBarInfo = _context.sent;
  2643. customBarHeight = navBarInfo.customBarHeight;
  2644. statusBarHeight = navBarInfo.statusBarHeight;
  2645. _context.next = 15;
  2646. break;
  2647. case 11:
  2648. _context.prev = 11;
  2649. _context.t0 = _context["catch"](3);
  2650. setTimeout(function () {
  2651. _this.updateCustomBarInfo();
  2652. }, 10);
  2653. return _context.abrupt("return");
  2654. case 15:
  2655. // 更新vuex中的导航栏信息
  2656. _this.$t.vuex('vuex_status_bar_height', statusBarHeight);
  2657. _this.$t.vuex('vuex_custom_bar_height', customBarHeight);
  2658. case 17:
  2659. case "end":
  2660. return _context.stop();
  2661. }
  2662. }
  2663. }, _callee, null, [[3, 11]]);
  2664. }))();
  2665. }
  2666. }
  2667. };
  2668. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  2669. /***/ }),
  2670. /***/ 21:
  2671. /*!******************************************************************!*\
  2672. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2673. \******************************************************************/
  2674. /*! no static exports found */
  2675. /***/ (function(module, exports) {
  2676. function _nonIterableSpread() {
  2677. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2678. }
  2679. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2680. /***/ }),
  2681. /***/ 22:
  2682. /*!*************************************************************!*\
  2683. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2684. \*************************************************************/
  2685. /*! no static exports found */
  2686. /***/ (function(module, exports, __webpack_require__) {
  2687. "use strict";
  2688. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2689. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2690. Object.defineProperty(exports, "__esModule", {
  2691. value: true
  2692. });
  2693. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2694. exports.compileI18nJsonStr = compileI18nJsonStr;
  2695. exports.hasI18nJson = hasI18nJson;
  2696. exports.initVueI18n = initVueI18n;
  2697. exports.isI18nStr = isI18nStr;
  2698. exports.isString = void 0;
  2699. exports.normalizeLocale = normalizeLocale;
  2700. exports.parseI18nJson = parseI18nJson;
  2701. exports.resolveLocale = resolveLocale;
  2702. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2703. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2704. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2705. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2706. var isObject = function isObject(val) {
  2707. return val !== null && (0, _typeof2.default)(val) === 'object';
  2708. };
  2709. var defaultDelimiters = ['{', '}'];
  2710. var BaseFormatter = /*#__PURE__*/function () {
  2711. function BaseFormatter() {
  2712. (0, _classCallCheck2.default)(this, BaseFormatter);
  2713. this._caches = Object.create(null);
  2714. }
  2715. (0, _createClass2.default)(BaseFormatter, [{
  2716. key: "interpolate",
  2717. value: function interpolate(message, values) {
  2718. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2719. if (!values) {
  2720. return [message];
  2721. }
  2722. var tokens = this._caches[message];
  2723. if (!tokens) {
  2724. tokens = parse(message, delimiters);
  2725. this._caches[message] = tokens;
  2726. }
  2727. return compile(tokens, values);
  2728. }
  2729. }]);
  2730. return BaseFormatter;
  2731. }();
  2732. exports.Formatter = BaseFormatter;
  2733. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2734. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2735. function parse(format, _ref) {
  2736. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2737. startDelimiter = _ref2[0],
  2738. endDelimiter = _ref2[1];
  2739. var tokens = [];
  2740. var position = 0;
  2741. var text = '';
  2742. while (position < format.length) {
  2743. var char = format[position++];
  2744. if (char === startDelimiter) {
  2745. if (text) {
  2746. tokens.push({
  2747. type: 'text',
  2748. value: text
  2749. });
  2750. }
  2751. text = '';
  2752. var sub = '';
  2753. char = format[position++];
  2754. while (char !== undefined && char !== endDelimiter) {
  2755. sub += char;
  2756. char = format[position++];
  2757. }
  2758. var isClosed = char === endDelimiter;
  2759. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2760. tokens.push({
  2761. value: sub,
  2762. type: type
  2763. });
  2764. }
  2765. // else if (char === '%') {
  2766. // // when found rails i18n syntax, skip text capture
  2767. // if (format[position] !== '{') {
  2768. // text += char
  2769. // }
  2770. // }
  2771. else {
  2772. text += char;
  2773. }
  2774. }
  2775. text && tokens.push({
  2776. type: 'text',
  2777. value: text
  2778. });
  2779. return tokens;
  2780. }
  2781. function compile(tokens, values) {
  2782. var compiled = [];
  2783. var index = 0;
  2784. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2785. if (mode === 'unknown') {
  2786. return compiled;
  2787. }
  2788. while (index < tokens.length) {
  2789. var token = tokens[index];
  2790. switch (token.type) {
  2791. case 'text':
  2792. compiled.push(token.value);
  2793. break;
  2794. case 'list':
  2795. compiled.push(values[parseInt(token.value, 10)]);
  2796. break;
  2797. case 'named':
  2798. if (mode === 'named') {
  2799. compiled.push(values[token.value]);
  2800. } else {
  2801. if (true) {
  2802. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2803. }
  2804. }
  2805. break;
  2806. case 'unknown':
  2807. if (true) {
  2808. console.warn("Detect 'unknown' type of token!");
  2809. }
  2810. break;
  2811. }
  2812. index++;
  2813. }
  2814. return compiled;
  2815. }
  2816. var LOCALE_ZH_HANS = 'zh-Hans';
  2817. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2818. var LOCALE_ZH_HANT = 'zh-Hant';
  2819. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2820. var LOCALE_EN = 'en';
  2821. exports.LOCALE_EN = LOCALE_EN;
  2822. var LOCALE_FR = 'fr';
  2823. exports.LOCALE_FR = LOCALE_FR;
  2824. var LOCALE_ES = 'es';
  2825. exports.LOCALE_ES = LOCALE_ES;
  2826. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2827. var hasOwn = function hasOwn(val, key) {
  2828. return hasOwnProperty.call(val, key);
  2829. };
  2830. var defaultFormatter = new BaseFormatter();
  2831. function include(str, parts) {
  2832. return !!parts.find(function (part) {
  2833. return str.indexOf(part) !== -1;
  2834. });
  2835. }
  2836. function startsWith(str, parts) {
  2837. return parts.find(function (part) {
  2838. return str.indexOf(part) === 0;
  2839. });
  2840. }
  2841. function normalizeLocale(locale, messages) {
  2842. if (!locale) {
  2843. return;
  2844. }
  2845. locale = locale.trim().replace(/_/g, '-');
  2846. if (messages && messages[locale]) {
  2847. return locale;
  2848. }
  2849. locale = locale.toLowerCase();
  2850. if (locale === 'chinese') {
  2851. // 支付宝
  2852. return LOCALE_ZH_HANS;
  2853. }
  2854. if (locale.indexOf('zh') === 0) {
  2855. if (locale.indexOf('-hans') > -1) {
  2856. return LOCALE_ZH_HANS;
  2857. }
  2858. if (locale.indexOf('-hant') > -1) {
  2859. return LOCALE_ZH_HANT;
  2860. }
  2861. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2862. return LOCALE_ZH_HANT;
  2863. }
  2864. return LOCALE_ZH_HANS;
  2865. }
  2866. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  2867. if (messages && Object.keys(messages).length > 0) {
  2868. locales = Object.keys(messages);
  2869. }
  2870. var lang = startsWith(locale, locales);
  2871. if (lang) {
  2872. return lang;
  2873. }
  2874. }
  2875. var I18n = /*#__PURE__*/function () {
  2876. function I18n(_ref3) {
  2877. var locale = _ref3.locale,
  2878. fallbackLocale = _ref3.fallbackLocale,
  2879. messages = _ref3.messages,
  2880. watcher = _ref3.watcher,
  2881. formater = _ref3.formater;
  2882. (0, _classCallCheck2.default)(this, I18n);
  2883. this.locale = LOCALE_EN;
  2884. this.fallbackLocale = LOCALE_EN;
  2885. this.message = {};
  2886. this.messages = {};
  2887. this.watchers = [];
  2888. if (fallbackLocale) {
  2889. this.fallbackLocale = fallbackLocale;
  2890. }
  2891. this.formater = formater || defaultFormatter;
  2892. this.messages = messages || {};
  2893. this.setLocale(locale || LOCALE_EN);
  2894. if (watcher) {
  2895. this.watchLocale(watcher);
  2896. }
  2897. }
  2898. (0, _createClass2.default)(I18n, [{
  2899. key: "setLocale",
  2900. value: function setLocale(locale) {
  2901. var _this = this;
  2902. var oldLocale = this.locale;
  2903. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2904. if (!this.messages[this.locale]) {
  2905. // 可能初始化时不存在
  2906. this.messages[this.locale] = {};
  2907. }
  2908. this.message = this.messages[this.locale];
  2909. // 仅发生变化时,通知
  2910. if (oldLocale !== this.locale) {
  2911. this.watchers.forEach(function (watcher) {
  2912. watcher(_this.locale, oldLocale);
  2913. });
  2914. }
  2915. }
  2916. }, {
  2917. key: "getLocale",
  2918. value: function getLocale() {
  2919. return this.locale;
  2920. }
  2921. }, {
  2922. key: "watchLocale",
  2923. value: function watchLocale(fn) {
  2924. var _this2 = this;
  2925. var index = this.watchers.push(fn) - 1;
  2926. return function () {
  2927. _this2.watchers.splice(index, 1);
  2928. };
  2929. }
  2930. }, {
  2931. key: "add",
  2932. value: function add(locale, message) {
  2933. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2934. var curMessages = this.messages[locale];
  2935. if (curMessages) {
  2936. if (override) {
  2937. Object.assign(curMessages, message);
  2938. } else {
  2939. Object.keys(message).forEach(function (key) {
  2940. if (!hasOwn(curMessages, key)) {
  2941. curMessages[key] = message[key];
  2942. }
  2943. });
  2944. }
  2945. } else {
  2946. this.messages[locale] = message;
  2947. }
  2948. }
  2949. }, {
  2950. key: "f",
  2951. value: function f(message, values, delimiters) {
  2952. return this.formater.interpolate(message, values, delimiters).join('');
  2953. }
  2954. }, {
  2955. key: "t",
  2956. value: function t(key, locale, values) {
  2957. var message = this.message;
  2958. if (typeof locale === 'string') {
  2959. locale = normalizeLocale(locale, this.messages);
  2960. locale && (message = this.messages[locale]);
  2961. } else {
  2962. values = locale;
  2963. }
  2964. if (!hasOwn(message, key)) {
  2965. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2966. return key;
  2967. }
  2968. return this.formater.interpolate(message[key], values).join('');
  2969. }
  2970. }]);
  2971. return I18n;
  2972. }();
  2973. exports.I18n = I18n;
  2974. function watchAppLocale(appVm, i18n) {
  2975. // 需要保证 watch 的触发在组件渲染之前
  2976. if (appVm.$watchLocale) {
  2977. // vue2
  2978. appVm.$watchLocale(function (newLocale) {
  2979. i18n.setLocale(newLocale);
  2980. });
  2981. } else {
  2982. appVm.$watch(function () {
  2983. return appVm.$locale;
  2984. }, function (newLocale) {
  2985. i18n.setLocale(newLocale);
  2986. });
  2987. }
  2988. }
  2989. function getDefaultLocale() {
  2990. if (typeof uni !== 'undefined' && uni.getLocale) {
  2991. return uni.getLocale();
  2992. }
  2993. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2994. if (typeof global !== 'undefined' && global.getLocale) {
  2995. return global.getLocale();
  2996. }
  2997. return LOCALE_EN;
  2998. }
  2999. function initVueI18n(locale) {
  3000. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3001. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3002. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3003. // 兼容旧版本入参
  3004. if (typeof locale !== 'string') {
  3005. var _ref4 = [messages, locale];
  3006. locale = _ref4[0];
  3007. messages = _ref4[1];
  3008. }
  3009. if (typeof locale !== 'string') {
  3010. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3011. locale = getDefaultLocale();
  3012. }
  3013. if (typeof fallbackLocale !== 'string') {
  3014. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3015. }
  3016. var i18n = new I18n({
  3017. locale: locale,
  3018. fallbackLocale: fallbackLocale,
  3019. messages: messages,
  3020. watcher: watcher
  3021. });
  3022. var _t = function t(key, values) {
  3023. if (typeof getApp !== 'function') {
  3024. // app view
  3025. /* eslint-disable no-func-assign */
  3026. _t = function t(key, values) {
  3027. return i18n.t(key, values);
  3028. };
  3029. } else {
  3030. var isWatchedAppLocale = false;
  3031. _t = function t(key, values) {
  3032. var appVm = getApp().$vm;
  3033. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3034. // options: {
  3035. // type: Array,
  3036. // default () {
  3037. // return [{
  3038. // icon: 'shop',
  3039. // text: t("uni-goods-nav.options.shop"),
  3040. // }, {
  3041. // icon: 'cart',
  3042. // text: t("uni-goods-nav.options.cart")
  3043. // }]
  3044. // }
  3045. // },
  3046. if (appVm) {
  3047. // 触发响应式
  3048. appVm.$locale;
  3049. if (!isWatchedAppLocale) {
  3050. isWatchedAppLocale = true;
  3051. watchAppLocale(appVm, i18n);
  3052. }
  3053. }
  3054. return i18n.t(key, values);
  3055. };
  3056. }
  3057. return _t(key, values);
  3058. };
  3059. return {
  3060. i18n: i18n,
  3061. f: function f(message, values, delimiters) {
  3062. return i18n.f(message, values, delimiters);
  3063. },
  3064. t: function t(key, values) {
  3065. return _t(key, values);
  3066. },
  3067. add: function add(locale, message) {
  3068. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3069. return i18n.add(locale, message, override);
  3070. },
  3071. watch: function watch(fn) {
  3072. return i18n.watchLocale(fn);
  3073. },
  3074. getLocale: function getLocale() {
  3075. return i18n.getLocale();
  3076. },
  3077. setLocale: function setLocale(newLocale) {
  3078. return i18n.setLocale(newLocale);
  3079. }
  3080. };
  3081. }
  3082. var isString = function isString(val) {
  3083. return typeof val === 'string';
  3084. };
  3085. exports.isString = isString;
  3086. var formater;
  3087. function hasI18nJson(jsonObj, delimiters) {
  3088. if (!formater) {
  3089. formater = new BaseFormatter();
  3090. }
  3091. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3092. var value = jsonObj[key];
  3093. if (isString(value)) {
  3094. if (isI18nStr(value, delimiters)) {
  3095. return true;
  3096. }
  3097. } else {
  3098. return hasI18nJson(value, delimiters);
  3099. }
  3100. });
  3101. }
  3102. function parseI18nJson(jsonObj, values, delimiters) {
  3103. if (!formater) {
  3104. formater = new BaseFormatter();
  3105. }
  3106. walkJsonObj(jsonObj, function (jsonObj, key) {
  3107. var value = jsonObj[key];
  3108. if (isString(value)) {
  3109. if (isI18nStr(value, delimiters)) {
  3110. jsonObj[key] = compileStr(value, values, delimiters);
  3111. }
  3112. } else {
  3113. parseI18nJson(value, values, delimiters);
  3114. }
  3115. });
  3116. return jsonObj;
  3117. }
  3118. function compileI18nJsonStr(jsonStr, _ref5) {
  3119. var locale = _ref5.locale,
  3120. locales = _ref5.locales,
  3121. delimiters = _ref5.delimiters;
  3122. if (!isI18nStr(jsonStr, delimiters)) {
  3123. return jsonStr;
  3124. }
  3125. if (!formater) {
  3126. formater = new BaseFormatter();
  3127. }
  3128. var localeValues = [];
  3129. Object.keys(locales).forEach(function (name) {
  3130. if (name !== locale) {
  3131. localeValues.push({
  3132. locale: name,
  3133. values: locales[name]
  3134. });
  3135. }
  3136. });
  3137. localeValues.unshift({
  3138. locale: locale,
  3139. values: locales[locale]
  3140. });
  3141. try {
  3142. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3143. } catch (e) {}
  3144. return jsonStr;
  3145. }
  3146. function isI18nStr(value, delimiters) {
  3147. return value.indexOf(delimiters[0]) > -1;
  3148. }
  3149. function compileStr(value, values, delimiters) {
  3150. return formater.interpolate(value, values, delimiters).join('');
  3151. }
  3152. function compileValue(jsonObj, key, localeValues, delimiters) {
  3153. var value = jsonObj[key];
  3154. if (isString(value)) {
  3155. // 存在国际化
  3156. if (isI18nStr(value, delimiters)) {
  3157. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3158. if (localeValues.length > 1) {
  3159. // 格式化国际化语言
  3160. var valueLocales = jsonObj[key + 'Locales'] = {};
  3161. localeValues.forEach(function (localValue) {
  3162. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3163. });
  3164. }
  3165. }
  3166. } else {
  3167. compileJsonObj(value, localeValues, delimiters);
  3168. }
  3169. }
  3170. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3171. walkJsonObj(jsonObj, function (jsonObj, key) {
  3172. compileValue(jsonObj, key, localeValues, delimiters);
  3173. });
  3174. return jsonObj;
  3175. }
  3176. function walkJsonObj(jsonObj, walk) {
  3177. if (Array.isArray(jsonObj)) {
  3178. for (var i = 0; i < jsonObj.length; i++) {
  3179. if (walk(jsonObj, i)) {
  3180. return true;
  3181. }
  3182. }
  3183. } else if (isObject(jsonObj)) {
  3184. for (var key in jsonObj) {
  3185. if (walk(jsonObj, key)) {
  3186. return true;
  3187. }
  3188. }
  3189. }
  3190. return false;
  3191. }
  3192. function resolveLocale(locales) {
  3193. return function (locale) {
  3194. if (!locale) {
  3195. return locale;
  3196. }
  3197. locale = normalizeLocale(locale) || locale;
  3198. return resolveLocaleChain(locale).find(function (locale) {
  3199. return locales.indexOf(locale) > -1;
  3200. });
  3201. };
  3202. }
  3203. function resolveLocaleChain(locale) {
  3204. var chain = [];
  3205. var tokens = locale.split('-');
  3206. while (tokens.length) {
  3207. chain.push(tokens.join('-'));
  3208. tokens.pop();
  3209. }
  3210. return chain;
  3211. }
  3212. /* 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)))
  3213. /***/ }),
  3214. /***/ 23:
  3215. /*!***************************************************************!*\
  3216. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3217. \***************************************************************/
  3218. /*! no static exports found */
  3219. /***/ (function(module, exports) {
  3220. function _classCallCheck(instance, Constructor) {
  3221. if (!(instance instanceof Constructor)) {
  3222. throw new TypeError("Cannot call a class as a function");
  3223. }
  3224. }
  3225. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3226. /***/ }),
  3227. /***/ 233:
  3228. /*!*******************************************************************!*\
  3229. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/mixin/components_color.js ***!
  3230. \*******************************************************************/
  3231. /*! no static exports found */
  3232. /***/ (function(module, exports) {
  3233. module.exports = {
  3234. data: function data() {},
  3235. props: {
  3236. // 背景颜色
  3237. backgroundColor: {
  3238. type: String,
  3239. default: ''
  3240. },
  3241. // 字体颜色
  3242. fontColor: {
  3243. type: String,
  3244. default: ''
  3245. },
  3246. // 字体大小
  3247. fontSize: {
  3248. type: Number,
  3249. default: 0
  3250. },
  3251. // 字体大小单位
  3252. fontUnit: {
  3253. type: String,
  3254. default: 'rpx'
  3255. }
  3256. },
  3257. computed: {
  3258. backgroundColorStyle: function backgroundColorStyle() {
  3259. return this.$t.color.getBackgroundColorStyle(this.backgroundColor);
  3260. },
  3261. backgroundColorClass: function backgroundColorClass() {
  3262. return this.$t.color.getBackgroundColorInternalClass(this.backgroundColor);
  3263. },
  3264. fontColorStyle: function fontColorStyle() {
  3265. return this.$t.color.getFontColorStyle(this.fontColor);
  3266. },
  3267. fontColorClass: function fontColorClass() {
  3268. return this.$t.color.getFontColorInternalClass(this.fontColor);
  3269. },
  3270. fontSizeStyle: function fontSizeStyle() {
  3271. return this.$t.string.getLengthUnitValue(this.fontSize, this.fontUnit);
  3272. }
  3273. },
  3274. methods: {}
  3275. };
  3276. /***/ }),
  3277. /***/ 24:
  3278. /*!************************************************************!*\
  3279. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3280. \************************************************************/
  3281. /*! no static exports found */
  3282. /***/ (function(module, exports, __webpack_require__) {
  3283. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3284. function _defineProperties(target, props) {
  3285. for (var i = 0; i < props.length; i++) {
  3286. var descriptor = props[i];
  3287. descriptor.enumerable = descriptor.enumerable || false;
  3288. descriptor.configurable = true;
  3289. if ("value" in descriptor) descriptor.writable = true;
  3290. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3291. }
  3292. }
  3293. function _createClass(Constructor, protoProps, staticProps) {
  3294. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3295. if (staticProps) _defineProperties(Constructor, staticProps);
  3296. Object.defineProperty(Constructor, "prototype", {
  3297. writable: false
  3298. });
  3299. return Constructor;
  3300. }
  3301. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3302. /***/ }),
  3303. /***/ 25:
  3304. /*!******************************************************************************************!*\
  3305. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3306. \******************************************************************************************/
  3307. /*! exports provided: default */
  3308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3309. "use strict";
  3310. __webpack_require__.r(__webpack_exports__);
  3311. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3312. * Vue.js v2.6.11
  3313. * (c) 2014-2023 Evan You
  3314. * Released under the MIT License.
  3315. */
  3316. /* */
  3317. var emptyObject = Object.freeze({});
  3318. // These helpers produce better VM code in JS engines due to their
  3319. // explicitness and function inlining.
  3320. function isUndef (v) {
  3321. return v === undefined || v === null
  3322. }
  3323. function isDef (v) {
  3324. return v !== undefined && v !== null
  3325. }
  3326. function isTrue (v) {
  3327. return v === true
  3328. }
  3329. function isFalse (v) {
  3330. return v === false
  3331. }
  3332. /**
  3333. * Check if value is primitive.
  3334. */
  3335. function isPrimitive (value) {
  3336. return (
  3337. typeof value === 'string' ||
  3338. typeof value === 'number' ||
  3339. // $flow-disable-line
  3340. typeof value === 'symbol' ||
  3341. typeof value === 'boolean'
  3342. )
  3343. }
  3344. /**
  3345. * Quick object check - this is primarily used to tell
  3346. * Objects from primitive values when we know the value
  3347. * is a JSON-compliant type.
  3348. */
  3349. function isObject (obj) {
  3350. return obj !== null && typeof obj === 'object'
  3351. }
  3352. /**
  3353. * Get the raw type string of a value, e.g., [object Object].
  3354. */
  3355. var _toString = Object.prototype.toString;
  3356. function toRawType (value) {
  3357. return _toString.call(value).slice(8, -1)
  3358. }
  3359. /**
  3360. * Strict object type check. Only returns true
  3361. * for plain JavaScript objects.
  3362. */
  3363. function isPlainObject (obj) {
  3364. return _toString.call(obj) === '[object Object]'
  3365. }
  3366. function isRegExp (v) {
  3367. return _toString.call(v) === '[object RegExp]'
  3368. }
  3369. /**
  3370. * Check if val is a valid array index.
  3371. */
  3372. function isValidArrayIndex (val) {
  3373. var n = parseFloat(String(val));
  3374. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3375. }
  3376. function isPromise (val) {
  3377. return (
  3378. isDef(val) &&
  3379. typeof val.then === 'function' &&
  3380. typeof val.catch === 'function'
  3381. )
  3382. }
  3383. /**
  3384. * Convert a value to a string that is actually rendered.
  3385. */
  3386. function toString (val) {
  3387. return val == null
  3388. ? ''
  3389. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3390. ? JSON.stringify(val, null, 2)
  3391. : String(val)
  3392. }
  3393. /**
  3394. * Convert an input value to a number for persistence.
  3395. * If the conversion fails, return original string.
  3396. */
  3397. function toNumber (val) {
  3398. var n = parseFloat(val);
  3399. return isNaN(n) ? val : n
  3400. }
  3401. /**
  3402. * Make a map and return a function for checking if a key
  3403. * is in that map.
  3404. */
  3405. function makeMap (
  3406. str,
  3407. expectsLowerCase
  3408. ) {
  3409. var map = Object.create(null);
  3410. var list = str.split(',');
  3411. for (var i = 0; i < list.length; i++) {
  3412. map[list[i]] = true;
  3413. }
  3414. return expectsLowerCase
  3415. ? function (val) { return map[val.toLowerCase()]; }
  3416. : function (val) { return map[val]; }
  3417. }
  3418. /**
  3419. * Check if a tag is a built-in tag.
  3420. */
  3421. var isBuiltInTag = makeMap('slot,component', true);
  3422. /**
  3423. * Check if an attribute is a reserved attribute.
  3424. */
  3425. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3426. /**
  3427. * Remove an item from an array.
  3428. */
  3429. function remove (arr, item) {
  3430. if (arr.length) {
  3431. var index = arr.indexOf(item);
  3432. if (index > -1) {
  3433. return arr.splice(index, 1)
  3434. }
  3435. }
  3436. }
  3437. /**
  3438. * Check whether an object has the property.
  3439. */
  3440. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3441. function hasOwn (obj, key) {
  3442. return hasOwnProperty.call(obj, key)
  3443. }
  3444. /**
  3445. * Create a cached version of a pure function.
  3446. */
  3447. function cached (fn) {
  3448. var cache = Object.create(null);
  3449. return (function cachedFn (str) {
  3450. var hit = cache[str];
  3451. return hit || (cache[str] = fn(str))
  3452. })
  3453. }
  3454. /**
  3455. * Camelize a hyphen-delimited string.
  3456. */
  3457. var camelizeRE = /-(\w)/g;
  3458. var camelize = cached(function (str) {
  3459. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3460. });
  3461. /**
  3462. * Capitalize a string.
  3463. */
  3464. var capitalize = cached(function (str) {
  3465. return str.charAt(0).toUpperCase() + str.slice(1)
  3466. });
  3467. /**
  3468. * Hyphenate a camelCase string.
  3469. */
  3470. var hyphenateRE = /\B([A-Z])/g;
  3471. var hyphenate = cached(function (str) {
  3472. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3473. });
  3474. /**
  3475. * Simple bind polyfill for environments that do not support it,
  3476. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3477. * since native bind is now performant enough in most browsers.
  3478. * But removing it would mean breaking code that was able to run in
  3479. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3480. */
  3481. /* istanbul ignore next */
  3482. function polyfillBind (fn, ctx) {
  3483. function boundFn (a) {
  3484. var l = arguments.length;
  3485. return l
  3486. ? l > 1
  3487. ? fn.apply(ctx, arguments)
  3488. : fn.call(ctx, a)
  3489. : fn.call(ctx)
  3490. }
  3491. boundFn._length = fn.length;
  3492. return boundFn
  3493. }
  3494. function nativeBind (fn, ctx) {
  3495. return fn.bind(ctx)
  3496. }
  3497. var bind = Function.prototype.bind
  3498. ? nativeBind
  3499. : polyfillBind;
  3500. /**
  3501. * Convert an Array-like object to a real Array.
  3502. */
  3503. function toArray (list, start) {
  3504. start = start || 0;
  3505. var i = list.length - start;
  3506. var ret = new Array(i);
  3507. while (i--) {
  3508. ret[i] = list[i + start];
  3509. }
  3510. return ret
  3511. }
  3512. /**
  3513. * Mix properties into target object.
  3514. */
  3515. function extend (to, _from) {
  3516. for (var key in _from) {
  3517. to[key] = _from[key];
  3518. }
  3519. return to
  3520. }
  3521. /**
  3522. * Merge an Array of Objects into a single Object.
  3523. */
  3524. function toObject (arr) {
  3525. var res = {};
  3526. for (var i = 0; i < arr.length; i++) {
  3527. if (arr[i]) {
  3528. extend(res, arr[i]);
  3529. }
  3530. }
  3531. return res
  3532. }
  3533. /* eslint-disable no-unused-vars */
  3534. /**
  3535. * Perform no operation.
  3536. * Stubbing args to make Flow happy without leaving useless transpiled code
  3537. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3538. */
  3539. function noop (a, b, c) {}
  3540. /**
  3541. * Always return false.
  3542. */
  3543. var no = function (a, b, c) { return false; };
  3544. /* eslint-enable no-unused-vars */
  3545. /**
  3546. * Return the same value.
  3547. */
  3548. var identity = function (_) { return _; };
  3549. /**
  3550. * Check if two values are loosely equal - that is,
  3551. * if they are plain objects, do they have the same shape?
  3552. */
  3553. function looseEqual (a, b) {
  3554. if (a === b) { return true }
  3555. var isObjectA = isObject(a);
  3556. var isObjectB = isObject(b);
  3557. if (isObjectA && isObjectB) {
  3558. try {
  3559. var isArrayA = Array.isArray(a);
  3560. var isArrayB = Array.isArray(b);
  3561. if (isArrayA && isArrayB) {
  3562. return a.length === b.length && a.every(function (e, i) {
  3563. return looseEqual(e, b[i])
  3564. })
  3565. } else if (a instanceof Date && b instanceof Date) {
  3566. return a.getTime() === b.getTime()
  3567. } else if (!isArrayA && !isArrayB) {
  3568. var keysA = Object.keys(a);
  3569. var keysB = Object.keys(b);
  3570. return keysA.length === keysB.length && keysA.every(function (key) {
  3571. return looseEqual(a[key], b[key])
  3572. })
  3573. } else {
  3574. /* istanbul ignore next */
  3575. return false
  3576. }
  3577. } catch (e) {
  3578. /* istanbul ignore next */
  3579. return false
  3580. }
  3581. } else if (!isObjectA && !isObjectB) {
  3582. return String(a) === String(b)
  3583. } else {
  3584. return false
  3585. }
  3586. }
  3587. /**
  3588. * Return the first index at which a loosely equal value can be
  3589. * found in the array (if value is a plain object, the array must
  3590. * contain an object of the same shape), or -1 if it is not present.
  3591. */
  3592. function looseIndexOf (arr, val) {
  3593. for (var i = 0; i < arr.length; i++) {
  3594. if (looseEqual(arr[i], val)) { return i }
  3595. }
  3596. return -1
  3597. }
  3598. /**
  3599. * Ensure a function is called only once.
  3600. */
  3601. function once (fn) {
  3602. var called = false;
  3603. return function () {
  3604. if (!called) {
  3605. called = true;
  3606. fn.apply(this, arguments);
  3607. }
  3608. }
  3609. }
  3610. var ASSET_TYPES = [
  3611. 'component',
  3612. 'directive',
  3613. 'filter'
  3614. ];
  3615. var LIFECYCLE_HOOKS = [
  3616. 'beforeCreate',
  3617. 'created',
  3618. 'beforeMount',
  3619. 'mounted',
  3620. 'beforeUpdate',
  3621. 'updated',
  3622. 'beforeDestroy',
  3623. 'destroyed',
  3624. 'activated',
  3625. 'deactivated',
  3626. 'errorCaptured',
  3627. 'serverPrefetch'
  3628. ];
  3629. /* */
  3630. var config = ({
  3631. /**
  3632. * Option merge strategies (used in core/util/options)
  3633. */
  3634. // $flow-disable-line
  3635. optionMergeStrategies: Object.create(null),
  3636. /**
  3637. * Whether to suppress warnings.
  3638. */
  3639. silent: false,
  3640. /**
  3641. * Show production mode tip message on boot?
  3642. */
  3643. productionTip: "development" !== 'production',
  3644. /**
  3645. * Whether to enable devtools
  3646. */
  3647. devtools: "development" !== 'production',
  3648. /**
  3649. * Whether to record perf
  3650. */
  3651. performance: false,
  3652. /**
  3653. * Error handler for watcher errors
  3654. */
  3655. errorHandler: null,
  3656. /**
  3657. * Warn handler for watcher warns
  3658. */
  3659. warnHandler: null,
  3660. /**
  3661. * Ignore certain custom elements
  3662. */
  3663. ignoredElements: [],
  3664. /**
  3665. * Custom user key aliases for v-on
  3666. */
  3667. // $flow-disable-line
  3668. keyCodes: Object.create(null),
  3669. /**
  3670. * Check if a tag is reserved so that it cannot be registered as a
  3671. * component. This is platform-dependent and may be overwritten.
  3672. */
  3673. isReservedTag: no,
  3674. /**
  3675. * Check if an attribute is reserved so that it cannot be used as a component
  3676. * prop. This is platform-dependent and may be overwritten.
  3677. */
  3678. isReservedAttr: no,
  3679. /**
  3680. * Check if a tag is an unknown element.
  3681. * Platform-dependent.
  3682. */
  3683. isUnknownElement: no,
  3684. /**
  3685. * Get the namespace of an element
  3686. */
  3687. getTagNamespace: noop,
  3688. /**
  3689. * Parse the real tag name for the specific platform.
  3690. */
  3691. parsePlatformTagName: identity,
  3692. /**
  3693. * Check if an attribute must be bound using property, e.g. value
  3694. * Platform-dependent.
  3695. */
  3696. mustUseProp: no,
  3697. /**
  3698. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3699. * This will significantly reduce performance if set to false.
  3700. */
  3701. async: true,
  3702. /**
  3703. * Exposed for legacy reasons
  3704. */
  3705. _lifecycleHooks: LIFECYCLE_HOOKS
  3706. });
  3707. /* */
  3708. /**
  3709. * unicode letters used for parsing html tags, component names and property paths.
  3710. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3711. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3712. */
  3713. 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/;
  3714. /**
  3715. * Check if a string starts with $ or _
  3716. */
  3717. function isReserved (str) {
  3718. var c = (str + '').charCodeAt(0);
  3719. return c === 0x24 || c === 0x5F
  3720. }
  3721. /**
  3722. * Define a property.
  3723. */
  3724. function def (obj, key, val, enumerable) {
  3725. Object.defineProperty(obj, key, {
  3726. value: val,
  3727. enumerable: !!enumerable,
  3728. writable: true,
  3729. configurable: true
  3730. });
  3731. }
  3732. /**
  3733. * Parse simple path.
  3734. */
  3735. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3736. function parsePath (path) {
  3737. if (bailRE.test(path)) {
  3738. return
  3739. }
  3740. var segments = path.split('.');
  3741. return function (obj) {
  3742. for (var i = 0; i < segments.length; i++) {
  3743. if (!obj) { return }
  3744. obj = obj[segments[i]];
  3745. }
  3746. return obj
  3747. }
  3748. }
  3749. /* */
  3750. // can we use __proto__?
  3751. var hasProto = '__proto__' in {};
  3752. // Browser environment sniffing
  3753. var inBrowser = typeof window !== 'undefined';
  3754. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3755. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3756. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3757. var isIE = UA && /msie|trident/.test(UA);
  3758. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3759. var isEdge = UA && UA.indexOf('edge/') > 0;
  3760. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3761. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3762. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3763. var isPhantomJS = UA && /phantomjs/.test(UA);
  3764. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3765. // Firefox has a "watch" function on Object.prototype...
  3766. var nativeWatch = ({}).watch;
  3767. if (inBrowser) {
  3768. try {
  3769. var opts = {};
  3770. Object.defineProperty(opts, 'passive', ({
  3771. get: function get () {
  3772. }
  3773. })); // https://github.com/facebook/flow/issues/285
  3774. window.addEventListener('test-passive', null, opts);
  3775. } catch (e) {}
  3776. }
  3777. // this needs to be lazy-evaled because vue may be required before
  3778. // vue-server-renderer can set VUE_ENV
  3779. var _isServer;
  3780. var isServerRendering = function () {
  3781. if (_isServer === undefined) {
  3782. /* istanbul ignore if */
  3783. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3784. // detect presence of vue-server-renderer and avoid
  3785. // Webpack shimming the process
  3786. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3787. } else {
  3788. _isServer = false;
  3789. }
  3790. }
  3791. return _isServer
  3792. };
  3793. // detect devtools
  3794. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3795. /* istanbul ignore next */
  3796. function isNative (Ctor) {
  3797. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3798. }
  3799. var hasSymbol =
  3800. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3801. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3802. var _Set;
  3803. /* istanbul ignore if */ // $flow-disable-line
  3804. if (typeof Set !== 'undefined' && isNative(Set)) {
  3805. // use native Set when available.
  3806. _Set = Set;
  3807. } else {
  3808. // a non-standard Set polyfill that only works with primitive keys.
  3809. _Set = /*@__PURE__*/(function () {
  3810. function Set () {
  3811. this.set = Object.create(null);
  3812. }
  3813. Set.prototype.has = function has (key) {
  3814. return this.set[key] === true
  3815. };
  3816. Set.prototype.add = function add (key) {
  3817. this.set[key] = true;
  3818. };
  3819. Set.prototype.clear = function clear () {
  3820. this.set = Object.create(null);
  3821. };
  3822. return Set;
  3823. }());
  3824. }
  3825. /* */
  3826. var warn = noop;
  3827. var tip = noop;
  3828. var generateComponentTrace = (noop); // work around flow check
  3829. var formatComponentName = (noop);
  3830. if (true) {
  3831. var hasConsole = typeof console !== 'undefined';
  3832. var classifyRE = /(?:^|[-_])(\w)/g;
  3833. var classify = function (str) { return str
  3834. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3835. .replace(/[-_]/g, ''); };
  3836. warn = function (msg, vm) {
  3837. var trace = vm ? generateComponentTrace(vm) : '';
  3838. if (config.warnHandler) {
  3839. config.warnHandler.call(null, msg, vm, trace);
  3840. } else if (hasConsole && (!config.silent)) {
  3841. console.error(("[Vue warn]: " + msg + trace));
  3842. }
  3843. };
  3844. tip = function (msg, vm) {
  3845. if (hasConsole && (!config.silent)) {
  3846. console.warn("[Vue tip]: " + msg + (
  3847. vm ? generateComponentTrace(vm) : ''
  3848. ));
  3849. }
  3850. };
  3851. formatComponentName = function (vm, includeFile) {
  3852. if (vm.$root === vm) {
  3853. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3854. return ('') + vm.$options.__file
  3855. }
  3856. return '<Root>'
  3857. }
  3858. var options = typeof vm === 'function' && vm.cid != null
  3859. ? vm.options
  3860. : vm._isVue
  3861. ? vm.$options || vm.constructor.options
  3862. : vm;
  3863. var name = options.name || options._componentTag;
  3864. var file = options.__file;
  3865. if (!name && file) {
  3866. var match = file.match(/([^/\\]+)\.vue$/);
  3867. name = match && match[1];
  3868. }
  3869. return (
  3870. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3871. (file && includeFile !== false ? (" at " + file) : '')
  3872. )
  3873. };
  3874. var repeat = function (str, n) {
  3875. var res = '';
  3876. while (n) {
  3877. if (n % 2 === 1) { res += str; }
  3878. if (n > 1) { str += str; }
  3879. n >>= 1;
  3880. }
  3881. return res
  3882. };
  3883. generateComponentTrace = function (vm) {
  3884. if (vm._isVue && vm.$parent) {
  3885. var tree = [];
  3886. var currentRecursiveSequence = 0;
  3887. while (vm && vm.$options.name !== 'PageBody') {
  3888. if (tree.length > 0) {
  3889. var last = tree[tree.length - 1];
  3890. if (last.constructor === vm.constructor) {
  3891. currentRecursiveSequence++;
  3892. vm = vm.$parent;
  3893. continue
  3894. } else if (currentRecursiveSequence > 0) {
  3895. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3896. currentRecursiveSequence = 0;
  3897. }
  3898. }
  3899. !vm.$options.isReserved && tree.push(vm);
  3900. vm = vm.$parent;
  3901. }
  3902. return '\n\nfound in\n\n' + tree
  3903. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3904. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3905. : formatComponentName(vm))); })
  3906. .join('\n')
  3907. } else {
  3908. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3909. }
  3910. };
  3911. }
  3912. /* */
  3913. var uid = 0;
  3914. /**
  3915. * A dep is an observable that can have multiple
  3916. * directives subscribing to it.
  3917. */
  3918. var Dep = function Dep () {
  3919. this.id = uid++;
  3920. this.subs = [];
  3921. };
  3922. Dep.prototype.addSub = function addSub (sub) {
  3923. this.subs.push(sub);
  3924. };
  3925. Dep.prototype.removeSub = function removeSub (sub) {
  3926. remove(this.subs, sub);
  3927. };
  3928. Dep.prototype.depend = function depend () {
  3929. if (Dep.SharedObject.target) {
  3930. Dep.SharedObject.target.addDep(this);
  3931. }
  3932. };
  3933. Dep.prototype.notify = function notify () {
  3934. // stabilize the subscriber list first
  3935. var subs = this.subs.slice();
  3936. if ( true && !config.async) {
  3937. // subs aren't sorted in scheduler if not running async
  3938. // we need to sort them now to make sure they fire in correct
  3939. // order
  3940. subs.sort(function (a, b) { return a.id - b.id; });
  3941. }
  3942. for (var i = 0, l = subs.length; i < l; i++) {
  3943. subs[i].update();
  3944. }
  3945. };
  3946. // The current target watcher being evaluated.
  3947. // This is globally unique because only one watcher
  3948. // can be evaluated at a time.
  3949. // fixed by xxxxxx (nvue shared vuex)
  3950. /* eslint-disable no-undef */
  3951. Dep.SharedObject = {};
  3952. Dep.SharedObject.target = null;
  3953. Dep.SharedObject.targetStack = [];
  3954. function pushTarget (target) {
  3955. Dep.SharedObject.targetStack.push(target);
  3956. Dep.SharedObject.target = target;
  3957. Dep.target = target;
  3958. }
  3959. function popTarget () {
  3960. Dep.SharedObject.targetStack.pop();
  3961. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3962. Dep.target = Dep.SharedObject.target;
  3963. }
  3964. /* */
  3965. var VNode = function VNode (
  3966. tag,
  3967. data,
  3968. children,
  3969. text,
  3970. elm,
  3971. context,
  3972. componentOptions,
  3973. asyncFactory
  3974. ) {
  3975. this.tag = tag;
  3976. this.data = data;
  3977. this.children = children;
  3978. this.text = text;
  3979. this.elm = elm;
  3980. this.ns = undefined;
  3981. this.context = context;
  3982. this.fnContext = undefined;
  3983. this.fnOptions = undefined;
  3984. this.fnScopeId = undefined;
  3985. this.key = data && data.key;
  3986. this.componentOptions = componentOptions;
  3987. this.componentInstance = undefined;
  3988. this.parent = undefined;
  3989. this.raw = false;
  3990. this.isStatic = false;
  3991. this.isRootInsert = true;
  3992. this.isComment = false;
  3993. this.isCloned = false;
  3994. this.isOnce = false;
  3995. this.asyncFactory = asyncFactory;
  3996. this.asyncMeta = undefined;
  3997. this.isAsyncPlaceholder = false;
  3998. };
  3999. var prototypeAccessors = { child: { configurable: true } };
  4000. // DEPRECATED: alias for componentInstance for backwards compat.
  4001. /* istanbul ignore next */
  4002. prototypeAccessors.child.get = function () {
  4003. return this.componentInstance
  4004. };
  4005. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4006. var createEmptyVNode = function (text) {
  4007. if ( text === void 0 ) text = '';
  4008. var node = new VNode();
  4009. node.text = text;
  4010. node.isComment = true;
  4011. return node
  4012. };
  4013. function createTextVNode (val) {
  4014. return new VNode(undefined, undefined, undefined, String(val))
  4015. }
  4016. // optimized shallow clone
  4017. // used for static nodes and slot nodes because they may be reused across
  4018. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4019. // on their elm reference.
  4020. function cloneVNode (vnode) {
  4021. var cloned = new VNode(
  4022. vnode.tag,
  4023. vnode.data,
  4024. // #7975
  4025. // clone children array to avoid mutating original in case of cloning
  4026. // a child.
  4027. vnode.children && vnode.children.slice(),
  4028. vnode.text,
  4029. vnode.elm,
  4030. vnode.context,
  4031. vnode.componentOptions,
  4032. vnode.asyncFactory
  4033. );
  4034. cloned.ns = vnode.ns;
  4035. cloned.isStatic = vnode.isStatic;
  4036. cloned.key = vnode.key;
  4037. cloned.isComment = vnode.isComment;
  4038. cloned.fnContext = vnode.fnContext;
  4039. cloned.fnOptions = vnode.fnOptions;
  4040. cloned.fnScopeId = vnode.fnScopeId;
  4041. cloned.asyncMeta = vnode.asyncMeta;
  4042. cloned.isCloned = true;
  4043. return cloned
  4044. }
  4045. /*
  4046. * not type checking this file because flow doesn't play well with
  4047. * dynamically accessing methods on Array prototype
  4048. */
  4049. var arrayProto = Array.prototype;
  4050. var arrayMethods = Object.create(arrayProto);
  4051. var methodsToPatch = [
  4052. 'push',
  4053. 'pop',
  4054. 'shift',
  4055. 'unshift',
  4056. 'splice',
  4057. 'sort',
  4058. 'reverse'
  4059. ];
  4060. /**
  4061. * Intercept mutating methods and emit events
  4062. */
  4063. methodsToPatch.forEach(function (method) {
  4064. // cache original method
  4065. var original = arrayProto[method];
  4066. def(arrayMethods, method, function mutator () {
  4067. var args = [], len = arguments.length;
  4068. while ( len-- ) args[ len ] = arguments[ len ];
  4069. var result = original.apply(this, args);
  4070. var ob = this.__ob__;
  4071. var inserted;
  4072. switch (method) {
  4073. case 'push':
  4074. case 'unshift':
  4075. inserted = args;
  4076. break
  4077. case 'splice':
  4078. inserted = args.slice(2);
  4079. break
  4080. }
  4081. if (inserted) { ob.observeArray(inserted); }
  4082. // notify change
  4083. ob.dep.notify();
  4084. return result
  4085. });
  4086. });
  4087. /* */
  4088. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4089. /**
  4090. * In some cases we may want to disable observation inside a component's
  4091. * update computation.
  4092. */
  4093. var shouldObserve = true;
  4094. function toggleObserving (value) {
  4095. shouldObserve = value;
  4096. }
  4097. /**
  4098. * Observer class that is attached to each observed
  4099. * object. Once attached, the observer converts the target
  4100. * object's property keys into getter/setters that
  4101. * collect dependencies and dispatch updates.
  4102. */
  4103. var Observer = function Observer (value) {
  4104. this.value = value;
  4105. this.dep = new Dep();
  4106. this.vmCount = 0;
  4107. def(value, '__ob__', this);
  4108. if (Array.isArray(value)) {
  4109. if (hasProto) {
  4110. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4111. if(value.push !== value.__proto__.push){
  4112. copyAugment(value, arrayMethods, arrayKeys);
  4113. } else {
  4114. protoAugment(value, arrayMethods);
  4115. }
  4116. }
  4117. } else {
  4118. copyAugment(value, arrayMethods, arrayKeys);
  4119. }
  4120. this.observeArray(value);
  4121. } else {
  4122. this.walk(value);
  4123. }
  4124. };
  4125. /**
  4126. * Walk through all properties and convert them into
  4127. * getter/setters. This method should only be called when
  4128. * value type is Object.
  4129. */
  4130. Observer.prototype.walk = function walk (obj) {
  4131. var keys = Object.keys(obj);
  4132. for (var i = 0; i < keys.length; i++) {
  4133. defineReactive$$1(obj, keys[i]);
  4134. }
  4135. };
  4136. /**
  4137. * Observe a list of Array items.
  4138. */
  4139. Observer.prototype.observeArray = function observeArray (items) {
  4140. for (var i = 0, l = items.length; i < l; i++) {
  4141. observe(items[i]);
  4142. }
  4143. };
  4144. // helpers
  4145. /**
  4146. * Augment a target Object or Array by intercepting
  4147. * the prototype chain using __proto__
  4148. */
  4149. function protoAugment (target, src) {
  4150. /* eslint-disable no-proto */
  4151. target.__proto__ = src;
  4152. /* eslint-enable no-proto */
  4153. }
  4154. /**
  4155. * Augment a target Object or Array by defining
  4156. * hidden properties.
  4157. */
  4158. /* istanbul ignore next */
  4159. function copyAugment (target, src, keys) {
  4160. for (var i = 0, l = keys.length; i < l; i++) {
  4161. var key = keys[i];
  4162. def(target, key, src[key]);
  4163. }
  4164. }
  4165. /**
  4166. * Attempt to create an observer instance for a value,
  4167. * returns the new observer if successfully observed,
  4168. * or the existing observer if the value already has one.
  4169. */
  4170. function observe (value, asRootData) {
  4171. if (!isObject(value) || value instanceof VNode) {
  4172. return
  4173. }
  4174. var ob;
  4175. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4176. ob = value.__ob__;
  4177. } else if (
  4178. shouldObserve &&
  4179. !isServerRendering() &&
  4180. (Array.isArray(value) || isPlainObject(value)) &&
  4181. Object.isExtensible(value) &&
  4182. !value._isVue &&
  4183. !value.__v_isMPComponent
  4184. ) {
  4185. ob = new Observer(value);
  4186. }
  4187. if (asRootData && ob) {
  4188. ob.vmCount++;
  4189. }
  4190. return ob
  4191. }
  4192. /**
  4193. * Define a reactive property on an Object.
  4194. */
  4195. function defineReactive$$1 (
  4196. obj,
  4197. key,
  4198. val,
  4199. customSetter,
  4200. shallow
  4201. ) {
  4202. var dep = new Dep();
  4203. var property = Object.getOwnPropertyDescriptor(obj, key);
  4204. if (property && property.configurable === false) {
  4205. return
  4206. }
  4207. // cater for pre-defined getter/setters
  4208. var getter = property && property.get;
  4209. var setter = property && property.set;
  4210. if ((!getter || setter) && arguments.length === 2) {
  4211. val = obj[key];
  4212. }
  4213. var childOb = !shallow && observe(val);
  4214. Object.defineProperty(obj, key, {
  4215. enumerable: true,
  4216. configurable: true,
  4217. get: function reactiveGetter () {
  4218. var value = getter ? getter.call(obj) : val;
  4219. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4220. dep.depend();
  4221. if (childOb) {
  4222. childOb.dep.depend();
  4223. if (Array.isArray(value)) {
  4224. dependArray(value);
  4225. }
  4226. }
  4227. }
  4228. return value
  4229. },
  4230. set: function reactiveSetter (newVal) {
  4231. var value = getter ? getter.call(obj) : val;
  4232. /* eslint-disable no-self-compare */
  4233. if (newVal === value || (newVal !== newVal && value !== value)) {
  4234. return
  4235. }
  4236. /* eslint-enable no-self-compare */
  4237. if ( true && customSetter) {
  4238. customSetter();
  4239. }
  4240. // #7981: for accessor properties without setter
  4241. if (getter && !setter) { return }
  4242. if (setter) {
  4243. setter.call(obj, newVal);
  4244. } else {
  4245. val = newVal;
  4246. }
  4247. childOb = !shallow && observe(newVal);
  4248. dep.notify();
  4249. }
  4250. });
  4251. }
  4252. /**
  4253. * Set a property on an object. Adds the new property and
  4254. * triggers change notification if the property doesn't
  4255. * already exist.
  4256. */
  4257. function set (target, key, val) {
  4258. if ( true &&
  4259. (isUndef(target) || isPrimitive(target))
  4260. ) {
  4261. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4262. }
  4263. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4264. target.length = Math.max(target.length, key);
  4265. target.splice(key, 1, val);
  4266. return val
  4267. }
  4268. if (key in target && !(key in Object.prototype)) {
  4269. target[key] = val;
  4270. return val
  4271. }
  4272. var ob = (target).__ob__;
  4273. if (target._isVue || (ob && ob.vmCount)) {
  4274. true && warn(
  4275. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4276. 'at runtime - declare it upfront in the data option.'
  4277. );
  4278. return val
  4279. }
  4280. if (!ob) {
  4281. target[key] = val;
  4282. return val
  4283. }
  4284. defineReactive$$1(ob.value, key, val);
  4285. ob.dep.notify();
  4286. return val
  4287. }
  4288. /**
  4289. * Delete a property and trigger change if necessary.
  4290. */
  4291. function del (target, key) {
  4292. if ( true &&
  4293. (isUndef(target) || isPrimitive(target))
  4294. ) {
  4295. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4296. }
  4297. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4298. target.splice(key, 1);
  4299. return
  4300. }
  4301. var ob = (target).__ob__;
  4302. if (target._isVue || (ob && ob.vmCount)) {
  4303. true && warn(
  4304. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4305. '- just set it to null.'
  4306. );
  4307. return
  4308. }
  4309. if (!hasOwn(target, key)) {
  4310. return
  4311. }
  4312. delete target[key];
  4313. if (!ob) {
  4314. return
  4315. }
  4316. ob.dep.notify();
  4317. }
  4318. /**
  4319. * Collect dependencies on array elements when the array is touched, since
  4320. * we cannot intercept array element access like property getters.
  4321. */
  4322. function dependArray (value) {
  4323. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4324. e = value[i];
  4325. e && e.__ob__ && e.__ob__.dep.depend();
  4326. if (Array.isArray(e)) {
  4327. dependArray(e);
  4328. }
  4329. }
  4330. }
  4331. /* */
  4332. /**
  4333. * Option overwriting strategies are functions that handle
  4334. * how to merge a parent option value and a child option
  4335. * value into the final value.
  4336. */
  4337. var strats = config.optionMergeStrategies;
  4338. /**
  4339. * Options with restrictions
  4340. */
  4341. if (true) {
  4342. strats.el = strats.propsData = function (parent, child, vm, key) {
  4343. if (!vm) {
  4344. warn(
  4345. "option \"" + key + "\" can only be used during instance " +
  4346. 'creation with the `new` keyword.'
  4347. );
  4348. }
  4349. return defaultStrat(parent, child)
  4350. };
  4351. }
  4352. /**
  4353. * Helper that recursively merges two data objects together.
  4354. */
  4355. function mergeData (to, from) {
  4356. if (!from) { return to }
  4357. var key, toVal, fromVal;
  4358. var keys = hasSymbol
  4359. ? Reflect.ownKeys(from)
  4360. : Object.keys(from);
  4361. for (var i = 0; i < keys.length; i++) {
  4362. key = keys[i];
  4363. // in case the object is already observed...
  4364. if (key === '__ob__') { continue }
  4365. toVal = to[key];
  4366. fromVal = from[key];
  4367. if (!hasOwn(to, key)) {
  4368. set(to, key, fromVal);
  4369. } else if (
  4370. toVal !== fromVal &&
  4371. isPlainObject(toVal) &&
  4372. isPlainObject(fromVal)
  4373. ) {
  4374. mergeData(toVal, fromVal);
  4375. }
  4376. }
  4377. return to
  4378. }
  4379. /**
  4380. * Data
  4381. */
  4382. function mergeDataOrFn (
  4383. parentVal,
  4384. childVal,
  4385. vm
  4386. ) {
  4387. if (!vm) {
  4388. // in a Vue.extend merge, both should be functions
  4389. if (!childVal) {
  4390. return parentVal
  4391. }
  4392. if (!parentVal) {
  4393. return childVal
  4394. }
  4395. // when parentVal & childVal are both present,
  4396. // we need to return a function that returns the
  4397. // merged result of both functions... no need to
  4398. // check if parentVal is a function here because
  4399. // it has to be a function to pass previous merges.
  4400. return function mergedDataFn () {
  4401. return mergeData(
  4402. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4403. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4404. )
  4405. }
  4406. } else {
  4407. return function mergedInstanceDataFn () {
  4408. // instance merge
  4409. var instanceData = typeof childVal === 'function'
  4410. ? childVal.call(vm, vm)
  4411. : childVal;
  4412. var defaultData = typeof parentVal === 'function'
  4413. ? parentVal.call(vm, vm)
  4414. : parentVal;
  4415. if (instanceData) {
  4416. return mergeData(instanceData, defaultData)
  4417. } else {
  4418. return defaultData
  4419. }
  4420. }
  4421. }
  4422. }
  4423. strats.data = function (
  4424. parentVal,
  4425. childVal,
  4426. vm
  4427. ) {
  4428. if (!vm) {
  4429. if (childVal && typeof childVal !== 'function') {
  4430. true && warn(
  4431. 'The "data" option should be a function ' +
  4432. 'that returns a per-instance value in component ' +
  4433. 'definitions.',
  4434. vm
  4435. );
  4436. return parentVal
  4437. }
  4438. return mergeDataOrFn(parentVal, childVal)
  4439. }
  4440. return mergeDataOrFn(parentVal, childVal, vm)
  4441. };
  4442. /**
  4443. * Hooks and props are merged as arrays.
  4444. */
  4445. function mergeHook (
  4446. parentVal,
  4447. childVal
  4448. ) {
  4449. var res = childVal
  4450. ? parentVal
  4451. ? parentVal.concat(childVal)
  4452. : Array.isArray(childVal)
  4453. ? childVal
  4454. : [childVal]
  4455. : parentVal;
  4456. return res
  4457. ? dedupeHooks(res)
  4458. : res
  4459. }
  4460. function dedupeHooks (hooks) {
  4461. var res = [];
  4462. for (var i = 0; i < hooks.length; i++) {
  4463. if (res.indexOf(hooks[i]) === -1) {
  4464. res.push(hooks[i]);
  4465. }
  4466. }
  4467. return res
  4468. }
  4469. LIFECYCLE_HOOKS.forEach(function (hook) {
  4470. strats[hook] = mergeHook;
  4471. });
  4472. /**
  4473. * Assets
  4474. *
  4475. * When a vm is present (instance creation), we need to do
  4476. * a three-way merge between constructor options, instance
  4477. * options and parent options.
  4478. */
  4479. function mergeAssets (
  4480. parentVal,
  4481. childVal,
  4482. vm,
  4483. key
  4484. ) {
  4485. var res = Object.create(parentVal || null);
  4486. if (childVal) {
  4487. true && assertObjectType(key, childVal, vm);
  4488. return extend(res, childVal)
  4489. } else {
  4490. return res
  4491. }
  4492. }
  4493. ASSET_TYPES.forEach(function (type) {
  4494. strats[type + 's'] = mergeAssets;
  4495. });
  4496. /**
  4497. * Watchers.
  4498. *
  4499. * Watchers hashes should not overwrite one
  4500. * another, so we merge them as arrays.
  4501. */
  4502. strats.watch = function (
  4503. parentVal,
  4504. childVal,
  4505. vm,
  4506. key
  4507. ) {
  4508. // work around Firefox's Object.prototype.watch...
  4509. if (parentVal === nativeWatch) { parentVal = undefined; }
  4510. if (childVal === nativeWatch) { childVal = undefined; }
  4511. /* istanbul ignore if */
  4512. if (!childVal) { return Object.create(parentVal || null) }
  4513. if (true) {
  4514. assertObjectType(key, childVal, vm);
  4515. }
  4516. if (!parentVal) { return childVal }
  4517. var ret = {};
  4518. extend(ret, parentVal);
  4519. for (var key$1 in childVal) {
  4520. var parent = ret[key$1];
  4521. var child = childVal[key$1];
  4522. if (parent && !Array.isArray(parent)) {
  4523. parent = [parent];
  4524. }
  4525. ret[key$1] = parent
  4526. ? parent.concat(child)
  4527. : Array.isArray(child) ? child : [child];
  4528. }
  4529. return ret
  4530. };
  4531. /**
  4532. * Other object hashes.
  4533. */
  4534. strats.props =
  4535. strats.methods =
  4536. strats.inject =
  4537. strats.computed = function (
  4538. parentVal,
  4539. childVal,
  4540. vm,
  4541. key
  4542. ) {
  4543. if (childVal && "development" !== 'production') {
  4544. assertObjectType(key, childVal, vm);
  4545. }
  4546. if (!parentVal) { return childVal }
  4547. var ret = Object.create(null);
  4548. extend(ret, parentVal);
  4549. if (childVal) { extend(ret, childVal); }
  4550. return ret
  4551. };
  4552. strats.provide = mergeDataOrFn;
  4553. /**
  4554. * Default strategy.
  4555. */
  4556. var defaultStrat = function (parentVal, childVal) {
  4557. return childVal === undefined
  4558. ? parentVal
  4559. : childVal
  4560. };
  4561. /**
  4562. * Validate component names
  4563. */
  4564. function checkComponents (options) {
  4565. for (var key in options.components) {
  4566. validateComponentName(key);
  4567. }
  4568. }
  4569. function validateComponentName (name) {
  4570. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4571. warn(
  4572. 'Invalid component name: "' + name + '". Component names ' +
  4573. 'should conform to valid custom element name in html5 specification.'
  4574. );
  4575. }
  4576. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4577. warn(
  4578. 'Do not use built-in or reserved HTML elements as component ' +
  4579. 'id: ' + name
  4580. );
  4581. }
  4582. }
  4583. /**
  4584. * Ensure all props option syntax are normalized into the
  4585. * Object-based format.
  4586. */
  4587. function normalizeProps (options, vm) {
  4588. var props = options.props;
  4589. if (!props) { return }
  4590. var res = {};
  4591. var i, val, name;
  4592. if (Array.isArray(props)) {
  4593. i = props.length;
  4594. while (i--) {
  4595. val = props[i];
  4596. if (typeof val === 'string') {
  4597. name = camelize(val);
  4598. res[name] = { type: null };
  4599. } else if (true) {
  4600. warn('props must be strings when using array syntax.');
  4601. }
  4602. }
  4603. } else if (isPlainObject(props)) {
  4604. for (var key in props) {
  4605. val = props[key];
  4606. name = camelize(key);
  4607. res[name] = isPlainObject(val)
  4608. ? val
  4609. : { type: val };
  4610. }
  4611. } else if (true) {
  4612. warn(
  4613. "Invalid value for option \"props\": expected an Array or an Object, " +
  4614. "but got " + (toRawType(props)) + ".",
  4615. vm
  4616. );
  4617. }
  4618. options.props = res;
  4619. }
  4620. /**
  4621. * Normalize all injections into Object-based format
  4622. */
  4623. function normalizeInject (options, vm) {
  4624. var inject = options.inject;
  4625. if (!inject) { return }
  4626. var normalized = options.inject = {};
  4627. if (Array.isArray(inject)) {
  4628. for (var i = 0; i < inject.length; i++) {
  4629. normalized[inject[i]] = { from: inject[i] };
  4630. }
  4631. } else if (isPlainObject(inject)) {
  4632. for (var key in inject) {
  4633. var val = inject[key];
  4634. normalized[key] = isPlainObject(val)
  4635. ? extend({ from: key }, val)
  4636. : { from: val };
  4637. }
  4638. } else if (true) {
  4639. warn(
  4640. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4641. "but got " + (toRawType(inject)) + ".",
  4642. vm
  4643. );
  4644. }
  4645. }
  4646. /**
  4647. * Normalize raw function directives into object format.
  4648. */
  4649. function normalizeDirectives (options) {
  4650. var dirs = options.directives;
  4651. if (dirs) {
  4652. for (var key in dirs) {
  4653. var def$$1 = dirs[key];
  4654. if (typeof def$$1 === 'function') {
  4655. dirs[key] = { bind: def$$1, update: def$$1 };
  4656. }
  4657. }
  4658. }
  4659. }
  4660. function assertObjectType (name, value, vm) {
  4661. if (!isPlainObject(value)) {
  4662. warn(
  4663. "Invalid value for option \"" + name + "\": expected an Object, " +
  4664. "but got " + (toRawType(value)) + ".",
  4665. vm
  4666. );
  4667. }
  4668. }
  4669. /**
  4670. * Merge two option objects into a new one.
  4671. * Core utility used in both instantiation and inheritance.
  4672. */
  4673. function mergeOptions (
  4674. parent,
  4675. child,
  4676. vm
  4677. ) {
  4678. if (true) {
  4679. checkComponents(child);
  4680. }
  4681. if (typeof child === 'function') {
  4682. child = child.options;
  4683. }
  4684. normalizeProps(child, vm);
  4685. normalizeInject(child, vm);
  4686. normalizeDirectives(child);
  4687. // Apply extends and mixins on the child options,
  4688. // but only if it is a raw options object that isn't
  4689. // the result of another mergeOptions call.
  4690. // Only merged options has the _base property.
  4691. if (!child._base) {
  4692. if (child.extends) {
  4693. parent = mergeOptions(parent, child.extends, vm);
  4694. }
  4695. if (child.mixins) {
  4696. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4697. parent = mergeOptions(parent, child.mixins[i], vm);
  4698. }
  4699. }
  4700. }
  4701. var options = {};
  4702. var key;
  4703. for (key in parent) {
  4704. mergeField(key);
  4705. }
  4706. for (key in child) {
  4707. if (!hasOwn(parent, key)) {
  4708. mergeField(key);
  4709. }
  4710. }
  4711. function mergeField (key) {
  4712. var strat = strats[key] || defaultStrat;
  4713. options[key] = strat(parent[key], child[key], vm, key);
  4714. }
  4715. return options
  4716. }
  4717. /**
  4718. * Resolve an asset.
  4719. * This function is used because child instances need access
  4720. * to assets defined in its ancestor chain.
  4721. */
  4722. function resolveAsset (
  4723. options,
  4724. type,
  4725. id,
  4726. warnMissing
  4727. ) {
  4728. /* istanbul ignore if */
  4729. if (typeof id !== 'string') {
  4730. return
  4731. }
  4732. var assets = options[type];
  4733. // check local registration variations first
  4734. if (hasOwn(assets, id)) { return assets[id] }
  4735. var camelizedId = camelize(id);
  4736. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4737. var PascalCaseId = capitalize(camelizedId);
  4738. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4739. // fallback to prototype chain
  4740. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4741. if ( true && warnMissing && !res) {
  4742. warn(
  4743. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4744. options
  4745. );
  4746. }
  4747. return res
  4748. }
  4749. /* */
  4750. function validateProp (
  4751. key,
  4752. propOptions,
  4753. propsData,
  4754. vm
  4755. ) {
  4756. var prop = propOptions[key];
  4757. var absent = !hasOwn(propsData, key);
  4758. var value = propsData[key];
  4759. // boolean casting
  4760. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4761. if (booleanIndex > -1) {
  4762. if (absent && !hasOwn(prop, 'default')) {
  4763. value = false;
  4764. } else if (value === '' || value === hyphenate(key)) {
  4765. // only cast empty string / same name to boolean if
  4766. // boolean has higher priority
  4767. var stringIndex = getTypeIndex(String, prop.type);
  4768. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4769. value = true;
  4770. }
  4771. }
  4772. }
  4773. // check default value
  4774. if (value === undefined) {
  4775. value = getPropDefaultValue(vm, prop, key);
  4776. // since the default value is a fresh copy,
  4777. // make sure to observe it.
  4778. var prevShouldObserve = shouldObserve;
  4779. toggleObserving(true);
  4780. observe(value);
  4781. toggleObserving(prevShouldObserve);
  4782. }
  4783. if (
  4784. true
  4785. ) {
  4786. assertProp(prop, key, value, vm, absent);
  4787. }
  4788. return value
  4789. }
  4790. /**
  4791. * Get the default value of a prop.
  4792. */
  4793. function getPropDefaultValue (vm, prop, key) {
  4794. // no default, return undefined
  4795. if (!hasOwn(prop, 'default')) {
  4796. return undefined
  4797. }
  4798. var def = prop.default;
  4799. // warn against non-factory defaults for Object & Array
  4800. if ( true && isObject(def)) {
  4801. warn(
  4802. 'Invalid default value for prop "' + key + '": ' +
  4803. 'Props with type Object/Array must use a factory function ' +
  4804. 'to return the default value.',
  4805. vm
  4806. );
  4807. }
  4808. // the raw prop value was also undefined from previous render,
  4809. // return previous default value to avoid unnecessary watcher trigger
  4810. if (vm && vm.$options.propsData &&
  4811. vm.$options.propsData[key] === undefined &&
  4812. vm._props[key] !== undefined
  4813. ) {
  4814. return vm._props[key]
  4815. }
  4816. // call factory function for non-Function types
  4817. // a value is Function if its prototype is function even across different execution context
  4818. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4819. ? def.call(vm)
  4820. : def
  4821. }
  4822. /**
  4823. * Assert whether a prop is valid.
  4824. */
  4825. function assertProp (
  4826. prop,
  4827. name,
  4828. value,
  4829. vm,
  4830. absent
  4831. ) {
  4832. if (prop.required && absent) {
  4833. warn(
  4834. 'Missing required prop: "' + name + '"',
  4835. vm
  4836. );
  4837. return
  4838. }
  4839. if (value == null && !prop.required) {
  4840. return
  4841. }
  4842. var type = prop.type;
  4843. var valid = !type || type === true;
  4844. var expectedTypes = [];
  4845. if (type) {
  4846. if (!Array.isArray(type)) {
  4847. type = [type];
  4848. }
  4849. for (var i = 0; i < type.length && !valid; i++) {
  4850. var assertedType = assertType(value, type[i]);
  4851. expectedTypes.push(assertedType.expectedType || '');
  4852. valid = assertedType.valid;
  4853. }
  4854. }
  4855. if (!valid) {
  4856. warn(
  4857. getInvalidTypeMessage(name, value, expectedTypes),
  4858. vm
  4859. );
  4860. return
  4861. }
  4862. var validator = prop.validator;
  4863. if (validator) {
  4864. if (!validator(value)) {
  4865. warn(
  4866. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4867. vm
  4868. );
  4869. }
  4870. }
  4871. }
  4872. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4873. function assertType (value, type) {
  4874. var valid;
  4875. var expectedType = getType(type);
  4876. if (simpleCheckRE.test(expectedType)) {
  4877. var t = typeof value;
  4878. valid = t === expectedType.toLowerCase();
  4879. // for primitive wrapper objects
  4880. if (!valid && t === 'object') {
  4881. valid = value instanceof type;
  4882. }
  4883. } else if (expectedType === 'Object') {
  4884. valid = isPlainObject(value);
  4885. } else if (expectedType === 'Array') {
  4886. valid = Array.isArray(value);
  4887. } else {
  4888. valid = value instanceof type;
  4889. }
  4890. return {
  4891. valid: valid,
  4892. expectedType: expectedType
  4893. }
  4894. }
  4895. /**
  4896. * Use function string name to check built-in types,
  4897. * because a simple equality check will fail when running
  4898. * across different vms / iframes.
  4899. */
  4900. function getType (fn) {
  4901. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4902. return match ? match[1] : ''
  4903. }
  4904. function isSameType (a, b) {
  4905. return getType(a) === getType(b)
  4906. }
  4907. function getTypeIndex (type, expectedTypes) {
  4908. if (!Array.isArray(expectedTypes)) {
  4909. return isSameType(expectedTypes, type) ? 0 : -1
  4910. }
  4911. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4912. if (isSameType(expectedTypes[i], type)) {
  4913. return i
  4914. }
  4915. }
  4916. return -1
  4917. }
  4918. function getInvalidTypeMessage (name, value, expectedTypes) {
  4919. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4920. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4921. var expectedType = expectedTypes[0];
  4922. var receivedType = toRawType(value);
  4923. var expectedValue = styleValue(value, expectedType);
  4924. var receivedValue = styleValue(value, receivedType);
  4925. // check if we need to specify expected value
  4926. if (expectedTypes.length === 1 &&
  4927. isExplicable(expectedType) &&
  4928. !isBoolean(expectedType, receivedType)) {
  4929. message += " with value " + expectedValue;
  4930. }
  4931. message += ", got " + receivedType + " ";
  4932. // check if we need to specify received value
  4933. if (isExplicable(receivedType)) {
  4934. message += "with value " + receivedValue + ".";
  4935. }
  4936. return message
  4937. }
  4938. function styleValue (value, type) {
  4939. if (type === 'String') {
  4940. return ("\"" + value + "\"")
  4941. } else if (type === 'Number') {
  4942. return ("" + (Number(value)))
  4943. } else {
  4944. return ("" + value)
  4945. }
  4946. }
  4947. function isExplicable (value) {
  4948. var explicitTypes = ['string', 'number', 'boolean'];
  4949. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4950. }
  4951. function isBoolean () {
  4952. var args = [], len = arguments.length;
  4953. while ( len-- ) args[ len ] = arguments[ len ];
  4954. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4955. }
  4956. /* */
  4957. function handleError (err, vm, info) {
  4958. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4959. // See: https://github.com/vuejs/vuex/issues/1505
  4960. pushTarget();
  4961. try {
  4962. if (vm) {
  4963. var cur = vm;
  4964. while ((cur = cur.$parent)) {
  4965. var hooks = cur.$options.errorCaptured;
  4966. if (hooks) {
  4967. for (var i = 0; i < hooks.length; i++) {
  4968. try {
  4969. var capture = hooks[i].call(cur, err, vm, info) === false;
  4970. if (capture) { return }
  4971. } catch (e) {
  4972. globalHandleError(e, cur, 'errorCaptured hook');
  4973. }
  4974. }
  4975. }
  4976. }
  4977. }
  4978. globalHandleError(err, vm, info);
  4979. } finally {
  4980. popTarget();
  4981. }
  4982. }
  4983. function invokeWithErrorHandling (
  4984. handler,
  4985. context,
  4986. args,
  4987. vm,
  4988. info
  4989. ) {
  4990. var res;
  4991. try {
  4992. res = args ? handler.apply(context, args) : handler.call(context);
  4993. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4994. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4995. // issue #9511
  4996. // avoid catch triggering multiple times when nested calls
  4997. res._handled = true;
  4998. }
  4999. } catch (e) {
  5000. handleError(e, vm, info);
  5001. }
  5002. return res
  5003. }
  5004. function globalHandleError (err, vm, info) {
  5005. if (config.errorHandler) {
  5006. try {
  5007. return config.errorHandler.call(null, err, vm, info)
  5008. } catch (e) {
  5009. // if the user intentionally throws the original error in the handler,
  5010. // do not log it twice
  5011. if (e !== err) {
  5012. logError(e, null, 'config.errorHandler');
  5013. }
  5014. }
  5015. }
  5016. logError(err, vm, info);
  5017. }
  5018. function logError (err, vm, info) {
  5019. if (true) {
  5020. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5021. }
  5022. /* istanbul ignore else */
  5023. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5024. console.error(err);
  5025. } else {
  5026. throw err
  5027. }
  5028. }
  5029. /* */
  5030. var callbacks = [];
  5031. var pending = false;
  5032. function flushCallbacks () {
  5033. pending = false;
  5034. var copies = callbacks.slice(0);
  5035. callbacks.length = 0;
  5036. for (var i = 0; i < copies.length; i++) {
  5037. copies[i]();
  5038. }
  5039. }
  5040. // Here we have async deferring wrappers using microtasks.
  5041. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5042. // However, it has subtle problems when state is changed right before repaint
  5043. // (e.g. #6813, out-in transitions).
  5044. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5045. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5046. // So we now use microtasks everywhere, again.
  5047. // A major drawback of this tradeoff is that there are some scenarios
  5048. // where microtasks have too high a priority and fire in between supposedly
  5049. // sequential events (e.g. #4521, #6690, which have workarounds)
  5050. // or even between bubbling of the same event (#6566).
  5051. var timerFunc;
  5052. // The nextTick behavior leverages the microtask queue, which can be accessed
  5053. // via either native Promise.then or MutationObserver.
  5054. // MutationObserver has wider support, however it is seriously bugged in
  5055. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5056. // completely stops working after triggering a few times... so, if native
  5057. // Promise is available, we will use it:
  5058. /* istanbul ignore next, $flow-disable-line */
  5059. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5060. var p = Promise.resolve();
  5061. timerFunc = function () {
  5062. p.then(flushCallbacks);
  5063. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5064. // it can get stuck in a weird state where callbacks are pushed into the
  5065. // microtask queue but the queue isn't being flushed, until the browser
  5066. // needs to do some other work, e.g. handle a timer. Therefore we can
  5067. // "force" the microtask queue to be flushed by adding an empty timer.
  5068. if (isIOS) { setTimeout(noop); }
  5069. };
  5070. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5071. isNative(MutationObserver) ||
  5072. // PhantomJS and iOS 7.x
  5073. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5074. )) {
  5075. // Use MutationObserver where native Promise is not available,
  5076. // e.g. PhantomJS, iOS7, Android 4.4
  5077. // (#6466 MutationObserver is unreliable in IE11)
  5078. var counter = 1;
  5079. var observer = new MutationObserver(flushCallbacks);
  5080. var textNode = document.createTextNode(String(counter));
  5081. observer.observe(textNode, {
  5082. characterData: true
  5083. });
  5084. timerFunc = function () {
  5085. counter = (counter + 1) % 2;
  5086. textNode.data = String(counter);
  5087. };
  5088. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5089. // Fallback to setImmediate.
  5090. // Technically it leverages the (macro) task queue,
  5091. // but it is still a better choice than setTimeout.
  5092. timerFunc = function () {
  5093. setImmediate(flushCallbacks);
  5094. };
  5095. } else {
  5096. // Fallback to setTimeout.
  5097. timerFunc = function () {
  5098. setTimeout(flushCallbacks, 0);
  5099. };
  5100. }
  5101. function nextTick (cb, ctx) {
  5102. var _resolve;
  5103. callbacks.push(function () {
  5104. if (cb) {
  5105. try {
  5106. cb.call(ctx);
  5107. } catch (e) {
  5108. handleError(e, ctx, 'nextTick');
  5109. }
  5110. } else if (_resolve) {
  5111. _resolve(ctx);
  5112. }
  5113. });
  5114. if (!pending) {
  5115. pending = true;
  5116. timerFunc();
  5117. }
  5118. // $flow-disable-line
  5119. if (!cb && typeof Promise !== 'undefined') {
  5120. return new Promise(function (resolve) {
  5121. _resolve = resolve;
  5122. })
  5123. }
  5124. }
  5125. /* */
  5126. /* not type checking this file because flow doesn't play well with Proxy */
  5127. var initProxy;
  5128. if (true) {
  5129. var allowedGlobals = makeMap(
  5130. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5131. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5132. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5133. 'require' // for Webpack/Browserify
  5134. );
  5135. var warnNonPresent = function (target, key) {
  5136. warn(
  5137. "Property or method \"" + key + "\" is not defined on the instance but " +
  5138. 'referenced during render. Make sure that this property is reactive, ' +
  5139. 'either in the data option, or for class-based components, by ' +
  5140. 'initializing the property. ' +
  5141. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5142. target
  5143. );
  5144. };
  5145. var warnReservedPrefix = function (target, key) {
  5146. warn(
  5147. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5148. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5149. 'prevent conflicts with Vue internals. ' +
  5150. 'See: https://vuejs.org/v2/api/#data',
  5151. target
  5152. );
  5153. };
  5154. var hasProxy =
  5155. typeof Proxy !== 'undefined' && isNative(Proxy);
  5156. if (hasProxy) {
  5157. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5158. config.keyCodes = new Proxy(config.keyCodes, {
  5159. set: function set (target, key, value) {
  5160. if (isBuiltInModifier(key)) {
  5161. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5162. return false
  5163. } else {
  5164. target[key] = value;
  5165. return true
  5166. }
  5167. }
  5168. });
  5169. }
  5170. var hasHandler = {
  5171. has: function has (target, key) {
  5172. var has = key in target;
  5173. var isAllowed = allowedGlobals(key) ||
  5174. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5175. if (!has && !isAllowed) {
  5176. if (key in target.$data) { warnReservedPrefix(target, key); }
  5177. else { warnNonPresent(target, key); }
  5178. }
  5179. return has || !isAllowed
  5180. }
  5181. };
  5182. var getHandler = {
  5183. get: function get (target, key) {
  5184. if (typeof key === 'string' && !(key in target)) {
  5185. if (key in target.$data) { warnReservedPrefix(target, key); }
  5186. else { warnNonPresent(target, key); }
  5187. }
  5188. return target[key]
  5189. }
  5190. };
  5191. initProxy = function initProxy (vm) {
  5192. if (hasProxy) {
  5193. // determine which proxy handler to use
  5194. var options = vm.$options;
  5195. var handlers = options.render && options.render._withStripped
  5196. ? getHandler
  5197. : hasHandler;
  5198. vm._renderProxy = new Proxy(vm, handlers);
  5199. } else {
  5200. vm._renderProxy = vm;
  5201. }
  5202. };
  5203. }
  5204. /* */
  5205. var seenObjects = new _Set();
  5206. /**
  5207. * Recursively traverse an object to evoke all converted
  5208. * getters, so that every nested property inside the object
  5209. * is collected as a "deep" dependency.
  5210. */
  5211. function traverse (val) {
  5212. _traverse(val, seenObjects);
  5213. seenObjects.clear();
  5214. }
  5215. function _traverse (val, seen) {
  5216. var i, keys;
  5217. var isA = Array.isArray(val);
  5218. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5219. return
  5220. }
  5221. if (val.__ob__) {
  5222. var depId = val.__ob__.dep.id;
  5223. if (seen.has(depId)) {
  5224. return
  5225. }
  5226. seen.add(depId);
  5227. }
  5228. if (isA) {
  5229. i = val.length;
  5230. while (i--) { _traverse(val[i], seen); }
  5231. } else {
  5232. keys = Object.keys(val);
  5233. i = keys.length;
  5234. while (i--) { _traverse(val[keys[i]], seen); }
  5235. }
  5236. }
  5237. var mark;
  5238. var measure;
  5239. if (true) {
  5240. var perf = inBrowser && window.performance;
  5241. /* istanbul ignore if */
  5242. if (
  5243. perf &&
  5244. perf.mark &&
  5245. perf.measure &&
  5246. perf.clearMarks &&
  5247. perf.clearMeasures
  5248. ) {
  5249. mark = function (tag) { return perf.mark(tag); };
  5250. measure = function (name, startTag, endTag) {
  5251. perf.measure(name, startTag, endTag);
  5252. perf.clearMarks(startTag);
  5253. perf.clearMarks(endTag);
  5254. // perf.clearMeasures(name)
  5255. };
  5256. }
  5257. }
  5258. /* */
  5259. var normalizeEvent = cached(function (name) {
  5260. var passive = name.charAt(0) === '&';
  5261. name = passive ? name.slice(1) : name;
  5262. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5263. name = once$$1 ? name.slice(1) : name;
  5264. var capture = name.charAt(0) === '!';
  5265. name = capture ? name.slice(1) : name;
  5266. return {
  5267. name: name,
  5268. once: once$$1,
  5269. capture: capture,
  5270. passive: passive
  5271. }
  5272. });
  5273. function createFnInvoker (fns, vm) {
  5274. function invoker () {
  5275. var arguments$1 = arguments;
  5276. var fns = invoker.fns;
  5277. if (Array.isArray(fns)) {
  5278. var cloned = fns.slice();
  5279. for (var i = 0; i < cloned.length; i++) {
  5280. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5281. }
  5282. } else {
  5283. // return handler return value for single handlers
  5284. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5285. }
  5286. }
  5287. invoker.fns = fns;
  5288. return invoker
  5289. }
  5290. function updateListeners (
  5291. on,
  5292. oldOn,
  5293. add,
  5294. remove$$1,
  5295. createOnceHandler,
  5296. vm
  5297. ) {
  5298. var name, def$$1, cur, old, event;
  5299. for (name in on) {
  5300. def$$1 = cur = on[name];
  5301. old = oldOn[name];
  5302. event = normalizeEvent(name);
  5303. if (isUndef(cur)) {
  5304. true && warn(
  5305. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5306. vm
  5307. );
  5308. } else if (isUndef(old)) {
  5309. if (isUndef(cur.fns)) {
  5310. cur = on[name] = createFnInvoker(cur, vm);
  5311. }
  5312. if (isTrue(event.once)) {
  5313. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5314. }
  5315. add(event.name, cur, event.capture, event.passive, event.params);
  5316. } else if (cur !== old) {
  5317. old.fns = cur;
  5318. on[name] = old;
  5319. }
  5320. }
  5321. for (name in oldOn) {
  5322. if (isUndef(on[name])) {
  5323. event = normalizeEvent(name);
  5324. remove$$1(event.name, oldOn[name], event.capture);
  5325. }
  5326. }
  5327. }
  5328. /* */
  5329. /* */
  5330. // fixed by xxxxxx (mp properties)
  5331. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5332. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5333. if (isUndef(propOptions)) {
  5334. return res
  5335. }
  5336. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5337. var attrs = data.attrs;
  5338. var props = data.props;
  5339. if (isDef(attrs) || isDef(props)) {
  5340. for (var key in propOptions) {
  5341. var altKey = hyphenate(key);
  5342. var result = checkProp(res, props, key, altKey, true) ||
  5343. checkProp(res, attrs, key, altKey, false);
  5344. // externalClass
  5345. if (
  5346. result &&
  5347. res[key] &&
  5348. externalClasses.indexOf(altKey) !== -1 &&
  5349. context[camelize(res[key])]
  5350. ) {
  5351. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5352. res[key] = context[camelize(res[key])];
  5353. }
  5354. }
  5355. }
  5356. return res
  5357. }
  5358. function extractPropsFromVNodeData (
  5359. data,
  5360. Ctor,
  5361. tag,
  5362. context// fixed by xxxxxx
  5363. ) {
  5364. // we are only extracting raw values here.
  5365. // validation and default values are handled in the child
  5366. // component itself.
  5367. var propOptions = Ctor.options.props;
  5368. if (isUndef(propOptions)) {
  5369. // fixed by xxxxxx
  5370. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5371. }
  5372. var res = {};
  5373. var attrs = data.attrs;
  5374. var props = data.props;
  5375. if (isDef(attrs) || isDef(props)) {
  5376. for (var key in propOptions) {
  5377. var altKey = hyphenate(key);
  5378. if (true) {
  5379. var keyInLowerCase = key.toLowerCase();
  5380. if (
  5381. key !== keyInLowerCase &&
  5382. attrs && hasOwn(attrs, keyInLowerCase)
  5383. ) {
  5384. tip(
  5385. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5386. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5387. " \"" + key + "\". " +
  5388. "Note that HTML attributes are case-insensitive and camelCased " +
  5389. "props need to use their kebab-case equivalents when using in-DOM " +
  5390. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5391. );
  5392. }
  5393. }
  5394. checkProp(res, props, key, altKey, true) ||
  5395. checkProp(res, attrs, key, altKey, false);
  5396. }
  5397. }
  5398. // fixed by xxxxxx
  5399. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5400. }
  5401. function checkProp (
  5402. res,
  5403. hash,
  5404. key,
  5405. altKey,
  5406. preserve
  5407. ) {
  5408. if (isDef(hash)) {
  5409. if (hasOwn(hash, key)) {
  5410. res[key] = hash[key];
  5411. if (!preserve) {
  5412. delete hash[key];
  5413. }
  5414. return true
  5415. } else if (hasOwn(hash, altKey)) {
  5416. res[key] = hash[altKey];
  5417. if (!preserve) {
  5418. delete hash[altKey];
  5419. }
  5420. return true
  5421. }
  5422. }
  5423. return false
  5424. }
  5425. /* */
  5426. // The template compiler attempts to minimize the need for normalization by
  5427. // statically analyzing the template at compile time.
  5428. //
  5429. // For plain HTML markup, normalization can be completely skipped because the
  5430. // generated render function is guaranteed to return Array<VNode>. There are
  5431. // two cases where extra normalization is needed:
  5432. // 1. When the children contains components - because a functional component
  5433. // may return an Array instead of a single root. In this case, just a simple
  5434. // normalization is needed - if any child is an Array, we flatten the whole
  5435. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5436. // because functional components already normalize their own children.
  5437. function simpleNormalizeChildren (children) {
  5438. for (var i = 0; i < children.length; i++) {
  5439. if (Array.isArray(children[i])) {
  5440. return Array.prototype.concat.apply([], children)
  5441. }
  5442. }
  5443. return children
  5444. }
  5445. // 2. When the children contains constructs that always generated nested Arrays,
  5446. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5447. // with hand-written render functions / JSX. In such cases a full normalization
  5448. // is needed to cater to all possible types of children values.
  5449. function normalizeChildren (children) {
  5450. return isPrimitive(children)
  5451. ? [createTextVNode(children)]
  5452. : Array.isArray(children)
  5453. ? normalizeArrayChildren(children)
  5454. : undefined
  5455. }
  5456. function isTextNode (node) {
  5457. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5458. }
  5459. function normalizeArrayChildren (children, nestedIndex) {
  5460. var res = [];
  5461. var i, c, lastIndex, last;
  5462. for (i = 0; i < children.length; i++) {
  5463. c = children[i];
  5464. if (isUndef(c) || typeof c === 'boolean') { continue }
  5465. lastIndex = res.length - 1;
  5466. last = res[lastIndex];
  5467. // nested
  5468. if (Array.isArray(c)) {
  5469. if (c.length > 0) {
  5470. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5471. // merge adjacent text nodes
  5472. if (isTextNode(c[0]) && isTextNode(last)) {
  5473. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5474. c.shift();
  5475. }
  5476. res.push.apply(res, c);
  5477. }
  5478. } else if (isPrimitive(c)) {
  5479. if (isTextNode(last)) {
  5480. // merge adjacent text nodes
  5481. // this is necessary for SSR hydration because text nodes are
  5482. // essentially merged when rendered to HTML strings
  5483. res[lastIndex] = createTextVNode(last.text + c);
  5484. } else if (c !== '') {
  5485. // convert primitive to vnode
  5486. res.push(createTextVNode(c));
  5487. }
  5488. } else {
  5489. if (isTextNode(c) && isTextNode(last)) {
  5490. // merge adjacent text nodes
  5491. res[lastIndex] = createTextVNode(last.text + c.text);
  5492. } else {
  5493. // default key for nested array children (likely generated by v-for)
  5494. if (isTrue(children._isVList) &&
  5495. isDef(c.tag) &&
  5496. isUndef(c.key) &&
  5497. isDef(nestedIndex)) {
  5498. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5499. }
  5500. res.push(c);
  5501. }
  5502. }
  5503. }
  5504. return res
  5505. }
  5506. /* */
  5507. function initProvide (vm) {
  5508. var provide = vm.$options.provide;
  5509. if (provide) {
  5510. vm._provided = typeof provide === 'function'
  5511. ? provide.call(vm)
  5512. : provide;
  5513. }
  5514. }
  5515. function initInjections (vm) {
  5516. var result = resolveInject(vm.$options.inject, vm);
  5517. if (result) {
  5518. toggleObserving(false);
  5519. Object.keys(result).forEach(function (key) {
  5520. /* istanbul ignore else */
  5521. if (true) {
  5522. defineReactive$$1(vm, key, result[key], function () {
  5523. warn(
  5524. "Avoid mutating an injected value directly since the changes will be " +
  5525. "overwritten whenever the provided component re-renders. " +
  5526. "injection being mutated: \"" + key + "\"",
  5527. vm
  5528. );
  5529. });
  5530. } else {}
  5531. });
  5532. toggleObserving(true);
  5533. }
  5534. }
  5535. function resolveInject (inject, vm) {
  5536. if (inject) {
  5537. // inject is :any because flow is not smart enough to figure out cached
  5538. var result = Object.create(null);
  5539. var keys = hasSymbol
  5540. ? Reflect.ownKeys(inject)
  5541. : Object.keys(inject);
  5542. for (var i = 0; i < keys.length; i++) {
  5543. var key = keys[i];
  5544. // #6574 in case the inject object is observed...
  5545. if (key === '__ob__') { continue }
  5546. var provideKey = inject[key].from;
  5547. var source = vm;
  5548. while (source) {
  5549. if (source._provided && hasOwn(source._provided, provideKey)) {
  5550. result[key] = source._provided[provideKey];
  5551. break
  5552. }
  5553. source = source.$parent;
  5554. }
  5555. if (!source) {
  5556. if ('default' in inject[key]) {
  5557. var provideDefault = inject[key].default;
  5558. result[key] = typeof provideDefault === 'function'
  5559. ? provideDefault.call(vm)
  5560. : provideDefault;
  5561. } else if (true) {
  5562. warn(("Injection \"" + key + "\" not found"), vm);
  5563. }
  5564. }
  5565. }
  5566. return result
  5567. }
  5568. }
  5569. /* */
  5570. /**
  5571. * Runtime helper for resolving raw children VNodes into a slot object.
  5572. */
  5573. function resolveSlots (
  5574. children,
  5575. context
  5576. ) {
  5577. if (!children || !children.length) {
  5578. return {}
  5579. }
  5580. var slots = {};
  5581. for (var i = 0, l = children.length; i < l; i++) {
  5582. var child = children[i];
  5583. var data = child.data;
  5584. // remove slot attribute if the node is resolved as a Vue slot node
  5585. if (data && data.attrs && data.attrs.slot) {
  5586. delete data.attrs.slot;
  5587. }
  5588. // named slots should only be respected if the vnode was rendered in the
  5589. // same context.
  5590. if ((child.context === context || child.fnContext === context) &&
  5591. data && data.slot != null
  5592. ) {
  5593. var name = data.slot;
  5594. var slot = (slots[name] || (slots[name] = []));
  5595. if (child.tag === 'template') {
  5596. slot.push.apply(slot, child.children || []);
  5597. } else {
  5598. slot.push(child);
  5599. }
  5600. } else {
  5601. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5602. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5603. (slots['page'] || (slots['page'] = [])).push(child);
  5604. }else{
  5605. (slots.default || (slots.default = [])).push(child);
  5606. }
  5607. }
  5608. }
  5609. // ignore slots that contains only whitespace
  5610. for (var name$1 in slots) {
  5611. if (slots[name$1].every(isWhitespace)) {
  5612. delete slots[name$1];
  5613. }
  5614. }
  5615. return slots
  5616. }
  5617. function isWhitespace (node) {
  5618. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5619. }
  5620. /* */
  5621. function normalizeScopedSlots (
  5622. slots,
  5623. normalSlots,
  5624. prevSlots
  5625. ) {
  5626. var res;
  5627. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5628. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5629. var key = slots && slots.$key;
  5630. if (!slots) {
  5631. res = {};
  5632. } else if (slots._normalized) {
  5633. // fast path 1: child component re-render only, parent did not change
  5634. return slots._normalized
  5635. } else if (
  5636. isStable &&
  5637. prevSlots &&
  5638. prevSlots !== emptyObject &&
  5639. key === prevSlots.$key &&
  5640. !hasNormalSlots &&
  5641. !prevSlots.$hasNormal
  5642. ) {
  5643. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5644. // only need to normalize once
  5645. return prevSlots
  5646. } else {
  5647. res = {};
  5648. for (var key$1 in slots) {
  5649. if (slots[key$1] && key$1[0] !== '$') {
  5650. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5651. }
  5652. }
  5653. }
  5654. // expose normal slots on scopedSlots
  5655. for (var key$2 in normalSlots) {
  5656. if (!(key$2 in res)) {
  5657. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5658. }
  5659. }
  5660. // avoriaz seems to mock a non-extensible $scopedSlots object
  5661. // and when that is passed down this would cause an error
  5662. if (slots && Object.isExtensible(slots)) {
  5663. (slots)._normalized = res;
  5664. }
  5665. def(res, '$stable', isStable);
  5666. def(res, '$key', key);
  5667. def(res, '$hasNormal', hasNormalSlots);
  5668. return res
  5669. }
  5670. function normalizeScopedSlot(normalSlots, key, fn) {
  5671. var normalized = function () {
  5672. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5673. res = res && typeof res === 'object' && !Array.isArray(res)
  5674. ? [res] // single vnode
  5675. : normalizeChildren(res);
  5676. return res && (
  5677. res.length === 0 ||
  5678. (res.length === 1 && res[0].isComment) // #9658
  5679. ) ? undefined
  5680. : res
  5681. };
  5682. // this is a slot using the new v-slot syntax without scope. although it is
  5683. // compiled as a scoped slot, render fn users would expect it to be present
  5684. // on this.$slots because the usage is semantically a normal slot.
  5685. if (fn.proxy) {
  5686. Object.defineProperty(normalSlots, key, {
  5687. get: normalized,
  5688. enumerable: true,
  5689. configurable: true
  5690. });
  5691. }
  5692. return normalized
  5693. }
  5694. function proxyNormalSlot(slots, key) {
  5695. return function () { return slots[key]; }
  5696. }
  5697. /* */
  5698. /**
  5699. * Runtime helper for rendering v-for lists.
  5700. */
  5701. function renderList (
  5702. val,
  5703. render
  5704. ) {
  5705. var ret, i, l, keys, key;
  5706. if (Array.isArray(val) || typeof val === 'string') {
  5707. ret = new Array(val.length);
  5708. for (i = 0, l = val.length; i < l; i++) {
  5709. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5710. }
  5711. } else if (typeof val === 'number') {
  5712. ret = new Array(val);
  5713. for (i = 0; i < val; i++) {
  5714. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5715. }
  5716. } else if (isObject(val)) {
  5717. if (hasSymbol && val[Symbol.iterator]) {
  5718. ret = [];
  5719. var iterator = val[Symbol.iterator]();
  5720. var result = iterator.next();
  5721. while (!result.done) {
  5722. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5723. result = iterator.next();
  5724. }
  5725. } else {
  5726. keys = Object.keys(val);
  5727. ret = new Array(keys.length);
  5728. for (i = 0, l = keys.length; i < l; i++) {
  5729. key = keys[i];
  5730. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5731. }
  5732. }
  5733. }
  5734. if (!isDef(ret)) {
  5735. ret = [];
  5736. }
  5737. (ret)._isVList = true;
  5738. return ret
  5739. }
  5740. /* */
  5741. /**
  5742. * Runtime helper for rendering <slot>
  5743. */
  5744. function renderSlot (
  5745. name,
  5746. fallback,
  5747. props,
  5748. bindObject
  5749. ) {
  5750. var scopedSlotFn = this.$scopedSlots[name];
  5751. var nodes;
  5752. if (scopedSlotFn) { // scoped slot
  5753. props = props || {};
  5754. if (bindObject) {
  5755. if ( true && !isObject(bindObject)) {
  5756. warn(
  5757. 'slot v-bind without argument expects an Object',
  5758. this
  5759. );
  5760. }
  5761. props = extend(extend({}, bindObject), props);
  5762. }
  5763. // fixed by xxxxxx app-plus scopedSlot
  5764. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5765. } else {
  5766. nodes = this.$slots[name] || fallback;
  5767. }
  5768. var target = props && props.slot;
  5769. if (target) {
  5770. return this.$createElement('template', { slot: target }, nodes)
  5771. } else {
  5772. return nodes
  5773. }
  5774. }
  5775. /* */
  5776. /**
  5777. * Runtime helper for resolving filters
  5778. */
  5779. function resolveFilter (id) {
  5780. return resolveAsset(this.$options, 'filters', id, true) || identity
  5781. }
  5782. /* */
  5783. function isKeyNotMatch (expect, actual) {
  5784. if (Array.isArray(expect)) {
  5785. return expect.indexOf(actual) === -1
  5786. } else {
  5787. return expect !== actual
  5788. }
  5789. }
  5790. /**
  5791. * Runtime helper for checking keyCodes from config.
  5792. * exposed as Vue.prototype._k
  5793. * passing in eventKeyName as last argument separately for backwards compat
  5794. */
  5795. function checkKeyCodes (
  5796. eventKeyCode,
  5797. key,
  5798. builtInKeyCode,
  5799. eventKeyName,
  5800. builtInKeyName
  5801. ) {
  5802. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5803. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5804. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5805. } else if (mappedKeyCode) {
  5806. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5807. } else if (eventKeyName) {
  5808. return hyphenate(eventKeyName) !== key
  5809. }
  5810. }
  5811. /* */
  5812. /**
  5813. * Runtime helper for merging v-bind="object" into a VNode's data.
  5814. */
  5815. function bindObjectProps (
  5816. data,
  5817. tag,
  5818. value,
  5819. asProp,
  5820. isSync
  5821. ) {
  5822. if (value) {
  5823. if (!isObject(value)) {
  5824. true && warn(
  5825. 'v-bind without argument expects an Object or Array value',
  5826. this
  5827. );
  5828. } else {
  5829. if (Array.isArray(value)) {
  5830. value = toObject(value);
  5831. }
  5832. var hash;
  5833. var loop = function ( key ) {
  5834. if (
  5835. key === 'class' ||
  5836. key === 'style' ||
  5837. isReservedAttribute(key)
  5838. ) {
  5839. hash = data;
  5840. } else {
  5841. var type = data.attrs && data.attrs.type;
  5842. hash = asProp || config.mustUseProp(tag, type, key)
  5843. ? data.domProps || (data.domProps = {})
  5844. : data.attrs || (data.attrs = {});
  5845. }
  5846. var camelizedKey = camelize(key);
  5847. var hyphenatedKey = hyphenate(key);
  5848. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5849. hash[key] = value[key];
  5850. if (isSync) {
  5851. var on = data.on || (data.on = {});
  5852. on[("update:" + key)] = function ($event) {
  5853. value[key] = $event;
  5854. };
  5855. }
  5856. }
  5857. };
  5858. for (var key in value) loop( key );
  5859. }
  5860. }
  5861. return data
  5862. }
  5863. /* */
  5864. /**
  5865. * Runtime helper for rendering static trees.
  5866. */
  5867. function renderStatic (
  5868. index,
  5869. isInFor
  5870. ) {
  5871. var cached = this._staticTrees || (this._staticTrees = []);
  5872. var tree = cached[index];
  5873. // if has already-rendered static tree and not inside v-for,
  5874. // we can reuse the same tree.
  5875. if (tree && !isInFor) {
  5876. return tree
  5877. }
  5878. // otherwise, render a fresh tree.
  5879. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5880. this._renderProxy,
  5881. null,
  5882. this // for render fns generated for functional component templates
  5883. );
  5884. markStatic(tree, ("__static__" + index), false);
  5885. return tree
  5886. }
  5887. /**
  5888. * Runtime helper for v-once.
  5889. * Effectively it means marking the node as static with a unique key.
  5890. */
  5891. function markOnce (
  5892. tree,
  5893. index,
  5894. key
  5895. ) {
  5896. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5897. return tree
  5898. }
  5899. function markStatic (
  5900. tree,
  5901. key,
  5902. isOnce
  5903. ) {
  5904. if (Array.isArray(tree)) {
  5905. for (var i = 0; i < tree.length; i++) {
  5906. if (tree[i] && typeof tree[i] !== 'string') {
  5907. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5908. }
  5909. }
  5910. } else {
  5911. markStaticNode(tree, key, isOnce);
  5912. }
  5913. }
  5914. function markStaticNode (node, key, isOnce) {
  5915. node.isStatic = true;
  5916. node.key = key;
  5917. node.isOnce = isOnce;
  5918. }
  5919. /* */
  5920. function bindObjectListeners (data, value) {
  5921. if (value) {
  5922. if (!isPlainObject(value)) {
  5923. true && warn(
  5924. 'v-on without argument expects an Object value',
  5925. this
  5926. );
  5927. } else {
  5928. var on = data.on = data.on ? extend({}, data.on) : {};
  5929. for (var key in value) {
  5930. var existing = on[key];
  5931. var ours = value[key];
  5932. on[key] = existing ? [].concat(existing, ours) : ours;
  5933. }
  5934. }
  5935. }
  5936. return data
  5937. }
  5938. /* */
  5939. function resolveScopedSlots (
  5940. fns, // see flow/vnode
  5941. res,
  5942. // the following are added in 2.6
  5943. hasDynamicKeys,
  5944. contentHashKey
  5945. ) {
  5946. res = res || { $stable: !hasDynamicKeys };
  5947. for (var i = 0; i < fns.length; i++) {
  5948. var slot = fns[i];
  5949. if (Array.isArray(slot)) {
  5950. resolveScopedSlots(slot, res, hasDynamicKeys);
  5951. } else if (slot) {
  5952. // marker for reverse proxying v-slot without scope on this.$slots
  5953. if (slot.proxy) {
  5954. slot.fn.proxy = true;
  5955. }
  5956. res[slot.key] = slot.fn;
  5957. }
  5958. }
  5959. if (contentHashKey) {
  5960. (res).$key = contentHashKey;
  5961. }
  5962. return res
  5963. }
  5964. /* */
  5965. function bindDynamicKeys (baseObj, values) {
  5966. for (var i = 0; i < values.length; i += 2) {
  5967. var key = values[i];
  5968. if (typeof key === 'string' && key) {
  5969. baseObj[values[i]] = values[i + 1];
  5970. } else if ( true && key !== '' && key !== null) {
  5971. // null is a special value for explicitly removing a binding
  5972. warn(
  5973. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5974. this
  5975. );
  5976. }
  5977. }
  5978. return baseObj
  5979. }
  5980. // helper to dynamically append modifier runtime markers to event names.
  5981. // ensure only append when value is already string, otherwise it will be cast
  5982. // to string and cause the type check to miss.
  5983. function prependModifier (value, symbol) {
  5984. return typeof value === 'string' ? symbol + value : value
  5985. }
  5986. /* */
  5987. function installRenderHelpers (target) {
  5988. target._o = markOnce;
  5989. target._n = toNumber;
  5990. target._s = toString;
  5991. target._l = renderList;
  5992. target._t = renderSlot;
  5993. target._q = looseEqual;
  5994. target._i = looseIndexOf;
  5995. target._m = renderStatic;
  5996. target._f = resolveFilter;
  5997. target._k = checkKeyCodes;
  5998. target._b = bindObjectProps;
  5999. target._v = createTextVNode;
  6000. target._e = createEmptyVNode;
  6001. target._u = resolveScopedSlots;
  6002. target._g = bindObjectListeners;
  6003. target._d = bindDynamicKeys;
  6004. target._p = prependModifier;
  6005. }
  6006. /* */
  6007. function FunctionalRenderContext (
  6008. data,
  6009. props,
  6010. children,
  6011. parent,
  6012. Ctor
  6013. ) {
  6014. var this$1 = this;
  6015. var options = Ctor.options;
  6016. // ensure the createElement function in functional components
  6017. // gets a unique context - this is necessary for correct named slot check
  6018. var contextVm;
  6019. if (hasOwn(parent, '_uid')) {
  6020. contextVm = Object.create(parent);
  6021. // $flow-disable-line
  6022. contextVm._original = parent;
  6023. } else {
  6024. // the context vm passed in is a functional context as well.
  6025. // in this case we want to make sure we are able to get a hold to the
  6026. // real context instance.
  6027. contextVm = parent;
  6028. // $flow-disable-line
  6029. parent = parent._original;
  6030. }
  6031. var isCompiled = isTrue(options._compiled);
  6032. var needNormalization = !isCompiled;
  6033. this.data = data;
  6034. this.props = props;
  6035. this.children = children;
  6036. this.parent = parent;
  6037. this.listeners = data.on || emptyObject;
  6038. this.injections = resolveInject(options.inject, parent);
  6039. this.slots = function () {
  6040. if (!this$1.$slots) {
  6041. normalizeScopedSlots(
  6042. data.scopedSlots,
  6043. this$1.$slots = resolveSlots(children, parent)
  6044. );
  6045. }
  6046. return this$1.$slots
  6047. };
  6048. Object.defineProperty(this, 'scopedSlots', ({
  6049. enumerable: true,
  6050. get: function get () {
  6051. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6052. }
  6053. }));
  6054. // support for compiled functional template
  6055. if (isCompiled) {
  6056. // exposing $options for renderStatic()
  6057. this.$options = options;
  6058. // pre-resolve slots for renderSlot()
  6059. this.$slots = this.slots();
  6060. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6061. }
  6062. if (options._scopeId) {
  6063. this._c = function (a, b, c, d) {
  6064. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6065. if (vnode && !Array.isArray(vnode)) {
  6066. vnode.fnScopeId = options._scopeId;
  6067. vnode.fnContext = parent;
  6068. }
  6069. return vnode
  6070. };
  6071. } else {
  6072. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6073. }
  6074. }
  6075. installRenderHelpers(FunctionalRenderContext.prototype);
  6076. function createFunctionalComponent (
  6077. Ctor,
  6078. propsData,
  6079. data,
  6080. contextVm,
  6081. children
  6082. ) {
  6083. var options = Ctor.options;
  6084. var props = {};
  6085. var propOptions = options.props;
  6086. if (isDef(propOptions)) {
  6087. for (var key in propOptions) {
  6088. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6089. }
  6090. } else {
  6091. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6092. if (isDef(data.props)) { mergeProps(props, data.props); }
  6093. }
  6094. var renderContext = new FunctionalRenderContext(
  6095. data,
  6096. props,
  6097. children,
  6098. contextVm,
  6099. Ctor
  6100. );
  6101. var vnode = options.render.call(null, renderContext._c, renderContext);
  6102. if (vnode instanceof VNode) {
  6103. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6104. } else if (Array.isArray(vnode)) {
  6105. var vnodes = normalizeChildren(vnode) || [];
  6106. var res = new Array(vnodes.length);
  6107. for (var i = 0; i < vnodes.length; i++) {
  6108. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6109. }
  6110. return res
  6111. }
  6112. }
  6113. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6114. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6115. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6116. // that should not be matched to match.
  6117. var clone = cloneVNode(vnode);
  6118. clone.fnContext = contextVm;
  6119. clone.fnOptions = options;
  6120. if (true) {
  6121. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6122. }
  6123. if (data.slot) {
  6124. (clone.data || (clone.data = {})).slot = data.slot;
  6125. }
  6126. return clone
  6127. }
  6128. function mergeProps (to, from) {
  6129. for (var key in from) {
  6130. to[camelize(key)] = from[key];
  6131. }
  6132. }
  6133. /* */
  6134. /* */
  6135. /* */
  6136. /* */
  6137. // inline hooks to be invoked on component VNodes during patch
  6138. var componentVNodeHooks = {
  6139. init: function init (vnode, hydrating) {
  6140. if (
  6141. vnode.componentInstance &&
  6142. !vnode.componentInstance._isDestroyed &&
  6143. vnode.data.keepAlive
  6144. ) {
  6145. // kept-alive components, treat as a patch
  6146. var mountedNode = vnode; // work around flow
  6147. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6148. } else {
  6149. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6150. vnode,
  6151. activeInstance
  6152. );
  6153. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6154. }
  6155. },
  6156. prepatch: function prepatch (oldVnode, vnode) {
  6157. var options = vnode.componentOptions;
  6158. var child = vnode.componentInstance = oldVnode.componentInstance;
  6159. updateChildComponent(
  6160. child,
  6161. options.propsData, // updated props
  6162. options.listeners, // updated listeners
  6163. vnode, // new parent vnode
  6164. options.children // new children
  6165. );
  6166. },
  6167. insert: function insert (vnode) {
  6168. var context = vnode.context;
  6169. var componentInstance = vnode.componentInstance;
  6170. if (!componentInstance._isMounted) {
  6171. callHook(componentInstance, 'onServiceCreated');
  6172. callHook(componentInstance, 'onServiceAttached');
  6173. componentInstance._isMounted = true;
  6174. callHook(componentInstance, 'mounted');
  6175. }
  6176. if (vnode.data.keepAlive) {
  6177. if (context._isMounted) {
  6178. // vue-router#1212
  6179. // During updates, a kept-alive component's child components may
  6180. // change, so directly walking the tree here may call activated hooks
  6181. // on incorrect children. Instead we push them into a queue which will
  6182. // be processed after the whole patch process ended.
  6183. queueActivatedComponent(componentInstance);
  6184. } else {
  6185. activateChildComponent(componentInstance, true /* direct */);
  6186. }
  6187. }
  6188. },
  6189. destroy: function destroy (vnode) {
  6190. var componentInstance = vnode.componentInstance;
  6191. if (!componentInstance._isDestroyed) {
  6192. if (!vnode.data.keepAlive) {
  6193. componentInstance.$destroy();
  6194. } else {
  6195. deactivateChildComponent(componentInstance, true /* direct */);
  6196. }
  6197. }
  6198. }
  6199. };
  6200. var hooksToMerge = Object.keys(componentVNodeHooks);
  6201. function createComponent (
  6202. Ctor,
  6203. data,
  6204. context,
  6205. children,
  6206. tag
  6207. ) {
  6208. if (isUndef(Ctor)) {
  6209. return
  6210. }
  6211. var baseCtor = context.$options._base;
  6212. // plain options object: turn it into a constructor
  6213. if (isObject(Ctor)) {
  6214. Ctor = baseCtor.extend(Ctor);
  6215. }
  6216. // if at this stage it's not a constructor or an async component factory,
  6217. // reject.
  6218. if (typeof Ctor !== 'function') {
  6219. if (true) {
  6220. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6221. }
  6222. return
  6223. }
  6224. // async component
  6225. var asyncFactory;
  6226. if (isUndef(Ctor.cid)) {
  6227. asyncFactory = Ctor;
  6228. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6229. if (Ctor === undefined) {
  6230. // return a placeholder node for async component, which is rendered
  6231. // as a comment node but preserves all the raw information for the node.
  6232. // the information will be used for async server-rendering and hydration.
  6233. return createAsyncPlaceholder(
  6234. asyncFactory,
  6235. data,
  6236. context,
  6237. children,
  6238. tag
  6239. )
  6240. }
  6241. }
  6242. data = data || {};
  6243. // resolve constructor options in case global mixins are applied after
  6244. // component constructor creation
  6245. resolveConstructorOptions(Ctor);
  6246. // transform component v-model data into props & events
  6247. if (isDef(data.model)) {
  6248. transformModel(Ctor.options, data);
  6249. }
  6250. // extract props
  6251. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6252. // functional component
  6253. if (isTrue(Ctor.options.functional)) {
  6254. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6255. }
  6256. // extract listeners, since these needs to be treated as
  6257. // child component listeners instead of DOM listeners
  6258. var listeners = data.on;
  6259. // replace with listeners with .native modifier
  6260. // so it gets processed during parent component patch.
  6261. data.on = data.nativeOn;
  6262. if (isTrue(Ctor.options.abstract)) {
  6263. // abstract components do not keep anything
  6264. // other than props & listeners & slot
  6265. // work around flow
  6266. var slot = data.slot;
  6267. data = {};
  6268. if (slot) {
  6269. data.slot = slot;
  6270. }
  6271. }
  6272. // install component management hooks onto the placeholder node
  6273. installComponentHooks(data);
  6274. // return a placeholder vnode
  6275. var name = Ctor.options.name || tag;
  6276. var vnode = new VNode(
  6277. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6278. data, undefined, undefined, undefined, context,
  6279. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6280. asyncFactory
  6281. );
  6282. return vnode
  6283. }
  6284. function createComponentInstanceForVnode (
  6285. vnode, // we know it's MountedComponentVNode but flow doesn't
  6286. parent // activeInstance in lifecycle state
  6287. ) {
  6288. var options = {
  6289. _isComponent: true,
  6290. _parentVnode: vnode,
  6291. parent: parent
  6292. };
  6293. // check inline-template render functions
  6294. var inlineTemplate = vnode.data.inlineTemplate;
  6295. if (isDef(inlineTemplate)) {
  6296. options.render = inlineTemplate.render;
  6297. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6298. }
  6299. return new vnode.componentOptions.Ctor(options)
  6300. }
  6301. function installComponentHooks (data) {
  6302. var hooks = data.hook || (data.hook = {});
  6303. for (var i = 0; i < hooksToMerge.length; i++) {
  6304. var key = hooksToMerge[i];
  6305. var existing = hooks[key];
  6306. var toMerge = componentVNodeHooks[key];
  6307. if (existing !== toMerge && !(existing && existing._merged)) {
  6308. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6309. }
  6310. }
  6311. }
  6312. function mergeHook$1 (f1, f2) {
  6313. var merged = function (a, b) {
  6314. // flow complains about extra args which is why we use any
  6315. f1(a, b);
  6316. f2(a, b);
  6317. };
  6318. merged._merged = true;
  6319. return merged
  6320. }
  6321. // transform component v-model info (value and callback) into
  6322. // prop and event handler respectively.
  6323. function transformModel (options, data) {
  6324. var prop = (options.model && options.model.prop) || 'value';
  6325. var event = (options.model && options.model.event) || 'input'
  6326. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6327. var on = data.on || (data.on = {});
  6328. var existing = on[event];
  6329. var callback = data.model.callback;
  6330. if (isDef(existing)) {
  6331. if (
  6332. Array.isArray(existing)
  6333. ? existing.indexOf(callback) === -1
  6334. : existing !== callback
  6335. ) {
  6336. on[event] = [callback].concat(existing);
  6337. }
  6338. } else {
  6339. on[event] = callback;
  6340. }
  6341. }
  6342. /* */
  6343. var SIMPLE_NORMALIZE = 1;
  6344. var ALWAYS_NORMALIZE = 2;
  6345. // wrapper function for providing a more flexible interface
  6346. // without getting yelled at by flow
  6347. function createElement (
  6348. context,
  6349. tag,
  6350. data,
  6351. children,
  6352. normalizationType,
  6353. alwaysNormalize
  6354. ) {
  6355. if (Array.isArray(data) || isPrimitive(data)) {
  6356. normalizationType = children;
  6357. children = data;
  6358. data = undefined;
  6359. }
  6360. if (isTrue(alwaysNormalize)) {
  6361. normalizationType = ALWAYS_NORMALIZE;
  6362. }
  6363. return _createElement(context, tag, data, children, normalizationType)
  6364. }
  6365. function _createElement (
  6366. context,
  6367. tag,
  6368. data,
  6369. children,
  6370. normalizationType
  6371. ) {
  6372. if (isDef(data) && isDef((data).__ob__)) {
  6373. true && warn(
  6374. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6375. 'Always create fresh vnode data objects in each render!',
  6376. context
  6377. );
  6378. return createEmptyVNode()
  6379. }
  6380. // object syntax in v-bind
  6381. if (isDef(data) && isDef(data.is)) {
  6382. tag = data.is;
  6383. }
  6384. if (!tag) {
  6385. // in case of component :is set to falsy value
  6386. return createEmptyVNode()
  6387. }
  6388. // warn against non-primitive key
  6389. if ( true &&
  6390. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6391. ) {
  6392. {
  6393. warn(
  6394. 'Avoid using non-primitive value as key, ' +
  6395. 'use string/number value instead.',
  6396. context
  6397. );
  6398. }
  6399. }
  6400. // support single function children as default scoped slot
  6401. if (Array.isArray(children) &&
  6402. typeof children[0] === 'function'
  6403. ) {
  6404. data = data || {};
  6405. data.scopedSlots = { default: children[0] };
  6406. children.length = 0;
  6407. }
  6408. if (normalizationType === ALWAYS_NORMALIZE) {
  6409. children = normalizeChildren(children);
  6410. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6411. children = simpleNormalizeChildren(children);
  6412. }
  6413. var vnode, ns;
  6414. if (typeof tag === 'string') {
  6415. var Ctor;
  6416. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6417. if (config.isReservedTag(tag)) {
  6418. // platform built-in elements
  6419. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6420. warn(
  6421. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6422. context
  6423. );
  6424. }
  6425. vnode = new VNode(
  6426. config.parsePlatformTagName(tag), data, children,
  6427. undefined, undefined, context
  6428. );
  6429. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6430. // component
  6431. vnode = createComponent(Ctor, data, context, children, tag);
  6432. } else {
  6433. // unknown or unlisted namespaced elements
  6434. // check at runtime because it may get assigned a namespace when its
  6435. // parent normalizes children
  6436. vnode = new VNode(
  6437. tag, data, children,
  6438. undefined, undefined, context
  6439. );
  6440. }
  6441. } else {
  6442. // direct component options / constructor
  6443. vnode = createComponent(tag, data, context, children);
  6444. }
  6445. if (Array.isArray(vnode)) {
  6446. return vnode
  6447. } else if (isDef(vnode)) {
  6448. if (isDef(ns)) { applyNS(vnode, ns); }
  6449. if (isDef(data)) { registerDeepBindings(data); }
  6450. return vnode
  6451. } else {
  6452. return createEmptyVNode()
  6453. }
  6454. }
  6455. function applyNS (vnode, ns, force) {
  6456. vnode.ns = ns;
  6457. if (vnode.tag === 'foreignObject') {
  6458. // use default namespace inside foreignObject
  6459. ns = undefined;
  6460. force = true;
  6461. }
  6462. if (isDef(vnode.children)) {
  6463. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6464. var child = vnode.children[i];
  6465. if (isDef(child.tag) && (
  6466. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6467. applyNS(child, ns, force);
  6468. }
  6469. }
  6470. }
  6471. }
  6472. // ref #5318
  6473. // necessary to ensure parent re-render when deep bindings like :style and
  6474. // :class are used on slot nodes
  6475. function registerDeepBindings (data) {
  6476. if (isObject(data.style)) {
  6477. traverse(data.style);
  6478. }
  6479. if (isObject(data.class)) {
  6480. traverse(data.class);
  6481. }
  6482. }
  6483. /* */
  6484. function initRender (vm) {
  6485. vm._vnode = null; // the root of the child tree
  6486. vm._staticTrees = null; // v-once cached trees
  6487. var options = vm.$options;
  6488. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6489. var renderContext = parentVnode && parentVnode.context;
  6490. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6491. vm.$scopedSlots = emptyObject;
  6492. // bind the createElement fn to this instance
  6493. // so that we get proper render context inside it.
  6494. // args order: tag, data, children, normalizationType, alwaysNormalize
  6495. // internal version is used by render functions compiled from templates
  6496. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6497. // normalization is always applied for the public version, used in
  6498. // user-written render functions.
  6499. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6500. // $attrs & $listeners are exposed for easier HOC creation.
  6501. // they need to be reactive so that HOCs using them are always updated
  6502. var parentData = parentVnode && parentVnode.data;
  6503. /* istanbul ignore else */
  6504. if (true) {
  6505. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6506. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6507. }, true);
  6508. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6509. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6510. }, true);
  6511. } else {}
  6512. }
  6513. var currentRenderingInstance = null;
  6514. function renderMixin (Vue) {
  6515. // install runtime convenience helpers
  6516. installRenderHelpers(Vue.prototype);
  6517. Vue.prototype.$nextTick = function (fn) {
  6518. return nextTick(fn, this)
  6519. };
  6520. Vue.prototype._render = function () {
  6521. var vm = this;
  6522. var ref = vm.$options;
  6523. var render = ref.render;
  6524. var _parentVnode = ref._parentVnode;
  6525. if (_parentVnode) {
  6526. vm.$scopedSlots = normalizeScopedSlots(
  6527. _parentVnode.data.scopedSlots,
  6528. vm.$slots,
  6529. vm.$scopedSlots
  6530. );
  6531. }
  6532. // set parent vnode. this allows render functions to have access
  6533. // to the data on the placeholder node.
  6534. vm.$vnode = _parentVnode;
  6535. // render self
  6536. var vnode;
  6537. try {
  6538. // There's no need to maintain a stack because all render fns are called
  6539. // separately from one another. Nested component's render fns are called
  6540. // when parent component is patched.
  6541. currentRenderingInstance = vm;
  6542. vnode = render.call(vm._renderProxy, vm.$createElement);
  6543. } catch (e) {
  6544. handleError(e, vm, "render");
  6545. // return error render result,
  6546. // or previous vnode to prevent render error causing blank component
  6547. /* istanbul ignore else */
  6548. if ( true && vm.$options.renderError) {
  6549. try {
  6550. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6551. } catch (e) {
  6552. handleError(e, vm, "renderError");
  6553. vnode = vm._vnode;
  6554. }
  6555. } else {
  6556. vnode = vm._vnode;
  6557. }
  6558. } finally {
  6559. currentRenderingInstance = null;
  6560. }
  6561. // if the returned array contains only a single node, allow it
  6562. if (Array.isArray(vnode) && vnode.length === 1) {
  6563. vnode = vnode[0];
  6564. }
  6565. // return empty vnode in case the render function errored out
  6566. if (!(vnode instanceof VNode)) {
  6567. if ( true && Array.isArray(vnode)) {
  6568. warn(
  6569. 'Multiple root nodes returned from render function. Render function ' +
  6570. 'should return a single root node.',
  6571. vm
  6572. );
  6573. }
  6574. vnode = createEmptyVNode();
  6575. }
  6576. // set parent
  6577. vnode.parent = _parentVnode;
  6578. return vnode
  6579. };
  6580. }
  6581. /* */
  6582. function ensureCtor (comp, base) {
  6583. if (
  6584. comp.__esModule ||
  6585. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6586. ) {
  6587. comp = comp.default;
  6588. }
  6589. return isObject(comp)
  6590. ? base.extend(comp)
  6591. : comp
  6592. }
  6593. function createAsyncPlaceholder (
  6594. factory,
  6595. data,
  6596. context,
  6597. children,
  6598. tag
  6599. ) {
  6600. var node = createEmptyVNode();
  6601. node.asyncFactory = factory;
  6602. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6603. return node
  6604. }
  6605. function resolveAsyncComponent (
  6606. factory,
  6607. baseCtor
  6608. ) {
  6609. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6610. return factory.errorComp
  6611. }
  6612. if (isDef(factory.resolved)) {
  6613. return factory.resolved
  6614. }
  6615. var owner = currentRenderingInstance;
  6616. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6617. // already pending
  6618. factory.owners.push(owner);
  6619. }
  6620. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6621. return factory.loadingComp
  6622. }
  6623. if (owner && !isDef(factory.owners)) {
  6624. var owners = factory.owners = [owner];
  6625. var sync = true;
  6626. var timerLoading = null;
  6627. var timerTimeout = null
  6628. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6629. var forceRender = function (renderCompleted) {
  6630. for (var i = 0, l = owners.length; i < l; i++) {
  6631. (owners[i]).$forceUpdate();
  6632. }
  6633. if (renderCompleted) {
  6634. owners.length = 0;
  6635. if (timerLoading !== null) {
  6636. clearTimeout(timerLoading);
  6637. timerLoading = null;
  6638. }
  6639. if (timerTimeout !== null) {
  6640. clearTimeout(timerTimeout);
  6641. timerTimeout = null;
  6642. }
  6643. }
  6644. };
  6645. var resolve = once(function (res) {
  6646. // cache resolved
  6647. factory.resolved = ensureCtor(res, baseCtor);
  6648. // invoke callbacks only if this is not a synchronous resolve
  6649. // (async resolves are shimmed as synchronous during SSR)
  6650. if (!sync) {
  6651. forceRender(true);
  6652. } else {
  6653. owners.length = 0;
  6654. }
  6655. });
  6656. var reject = once(function (reason) {
  6657. true && warn(
  6658. "Failed to resolve async component: " + (String(factory)) +
  6659. (reason ? ("\nReason: " + reason) : '')
  6660. );
  6661. if (isDef(factory.errorComp)) {
  6662. factory.error = true;
  6663. forceRender(true);
  6664. }
  6665. });
  6666. var res = factory(resolve, reject);
  6667. if (isObject(res)) {
  6668. if (isPromise(res)) {
  6669. // () => Promise
  6670. if (isUndef(factory.resolved)) {
  6671. res.then(resolve, reject);
  6672. }
  6673. } else if (isPromise(res.component)) {
  6674. res.component.then(resolve, reject);
  6675. if (isDef(res.error)) {
  6676. factory.errorComp = ensureCtor(res.error, baseCtor);
  6677. }
  6678. if (isDef(res.loading)) {
  6679. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6680. if (res.delay === 0) {
  6681. factory.loading = true;
  6682. } else {
  6683. timerLoading = setTimeout(function () {
  6684. timerLoading = null;
  6685. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6686. factory.loading = true;
  6687. forceRender(false);
  6688. }
  6689. }, res.delay || 200);
  6690. }
  6691. }
  6692. if (isDef(res.timeout)) {
  6693. timerTimeout = setTimeout(function () {
  6694. timerTimeout = null;
  6695. if (isUndef(factory.resolved)) {
  6696. reject(
  6697. true
  6698. ? ("timeout (" + (res.timeout) + "ms)")
  6699. : undefined
  6700. );
  6701. }
  6702. }, res.timeout);
  6703. }
  6704. }
  6705. }
  6706. sync = false;
  6707. // return in case resolved synchronously
  6708. return factory.loading
  6709. ? factory.loadingComp
  6710. : factory.resolved
  6711. }
  6712. }
  6713. /* */
  6714. function isAsyncPlaceholder (node) {
  6715. return node.isComment && node.asyncFactory
  6716. }
  6717. /* */
  6718. function getFirstComponentChild (children) {
  6719. if (Array.isArray(children)) {
  6720. for (var i = 0; i < children.length; i++) {
  6721. var c = children[i];
  6722. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6723. return c
  6724. }
  6725. }
  6726. }
  6727. }
  6728. /* */
  6729. /* */
  6730. function initEvents (vm) {
  6731. vm._events = Object.create(null);
  6732. vm._hasHookEvent = false;
  6733. // init parent attached events
  6734. var listeners = vm.$options._parentListeners;
  6735. if (listeners) {
  6736. updateComponentListeners(vm, listeners);
  6737. }
  6738. }
  6739. var target;
  6740. function add (event, fn) {
  6741. target.$on(event, fn);
  6742. }
  6743. function remove$1 (event, fn) {
  6744. target.$off(event, fn);
  6745. }
  6746. function createOnceHandler (event, fn) {
  6747. var _target = target;
  6748. return function onceHandler () {
  6749. var res = fn.apply(null, arguments);
  6750. if (res !== null) {
  6751. _target.$off(event, onceHandler);
  6752. }
  6753. }
  6754. }
  6755. function updateComponentListeners (
  6756. vm,
  6757. listeners,
  6758. oldListeners
  6759. ) {
  6760. target = vm;
  6761. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6762. target = undefined;
  6763. }
  6764. function eventsMixin (Vue) {
  6765. var hookRE = /^hook:/;
  6766. Vue.prototype.$on = function (event, fn) {
  6767. var vm = this;
  6768. if (Array.isArray(event)) {
  6769. for (var i = 0, l = event.length; i < l; i++) {
  6770. vm.$on(event[i], fn);
  6771. }
  6772. } else {
  6773. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6774. // optimize hook:event cost by using a boolean flag marked at registration
  6775. // instead of a hash lookup
  6776. if (hookRE.test(event)) {
  6777. vm._hasHookEvent = true;
  6778. }
  6779. }
  6780. return vm
  6781. };
  6782. Vue.prototype.$once = function (event, fn) {
  6783. var vm = this;
  6784. function on () {
  6785. vm.$off(event, on);
  6786. fn.apply(vm, arguments);
  6787. }
  6788. on.fn = fn;
  6789. vm.$on(event, on);
  6790. return vm
  6791. };
  6792. Vue.prototype.$off = function (event, fn) {
  6793. var vm = this;
  6794. // all
  6795. if (!arguments.length) {
  6796. vm._events = Object.create(null);
  6797. return vm
  6798. }
  6799. // array of events
  6800. if (Array.isArray(event)) {
  6801. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6802. vm.$off(event[i$1], fn);
  6803. }
  6804. return vm
  6805. }
  6806. // specific event
  6807. var cbs = vm._events[event];
  6808. if (!cbs) {
  6809. return vm
  6810. }
  6811. if (!fn) {
  6812. vm._events[event] = null;
  6813. return vm
  6814. }
  6815. // specific handler
  6816. var cb;
  6817. var i = cbs.length;
  6818. while (i--) {
  6819. cb = cbs[i];
  6820. if (cb === fn || cb.fn === fn) {
  6821. cbs.splice(i, 1);
  6822. break
  6823. }
  6824. }
  6825. return vm
  6826. };
  6827. Vue.prototype.$emit = function (event) {
  6828. var vm = this;
  6829. if (true) {
  6830. var lowerCaseEvent = event.toLowerCase();
  6831. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6832. tip(
  6833. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6834. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6835. "Note that HTML attributes are case-insensitive and you cannot use " +
  6836. "v-on to listen to camelCase events when using in-DOM templates. " +
  6837. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6838. );
  6839. }
  6840. }
  6841. var cbs = vm._events[event];
  6842. if (cbs) {
  6843. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6844. var args = toArray(arguments, 1);
  6845. var info = "event handler for \"" + event + "\"";
  6846. for (var i = 0, l = cbs.length; i < l; i++) {
  6847. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6848. }
  6849. }
  6850. return vm
  6851. };
  6852. }
  6853. /* */
  6854. var activeInstance = null;
  6855. var isUpdatingChildComponent = false;
  6856. function setActiveInstance(vm) {
  6857. var prevActiveInstance = activeInstance;
  6858. activeInstance = vm;
  6859. return function () {
  6860. activeInstance = prevActiveInstance;
  6861. }
  6862. }
  6863. function initLifecycle (vm) {
  6864. var options = vm.$options;
  6865. // locate first non-abstract parent
  6866. var parent = options.parent;
  6867. if (parent && !options.abstract) {
  6868. while (parent.$options.abstract && parent.$parent) {
  6869. parent = parent.$parent;
  6870. }
  6871. parent.$children.push(vm);
  6872. }
  6873. vm.$parent = parent;
  6874. vm.$root = parent ? parent.$root : vm;
  6875. vm.$children = [];
  6876. vm.$refs = {};
  6877. vm._watcher = null;
  6878. vm._inactive = null;
  6879. vm._directInactive = false;
  6880. vm._isMounted = false;
  6881. vm._isDestroyed = false;
  6882. vm._isBeingDestroyed = false;
  6883. }
  6884. function lifecycleMixin (Vue) {
  6885. Vue.prototype._update = function (vnode, hydrating) {
  6886. var vm = this;
  6887. var prevEl = vm.$el;
  6888. var prevVnode = vm._vnode;
  6889. var restoreActiveInstance = setActiveInstance(vm);
  6890. vm._vnode = vnode;
  6891. // Vue.prototype.__patch__ is injected in entry points
  6892. // based on the rendering backend used.
  6893. if (!prevVnode) {
  6894. // initial render
  6895. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6896. } else {
  6897. // updates
  6898. vm.$el = vm.__patch__(prevVnode, vnode);
  6899. }
  6900. restoreActiveInstance();
  6901. // update __vue__ reference
  6902. if (prevEl) {
  6903. prevEl.__vue__ = null;
  6904. }
  6905. if (vm.$el) {
  6906. vm.$el.__vue__ = vm;
  6907. }
  6908. // if parent is an HOC, update its $el as well
  6909. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6910. vm.$parent.$el = vm.$el;
  6911. }
  6912. // updated hook is called by the scheduler to ensure that children are
  6913. // updated in a parent's updated hook.
  6914. };
  6915. Vue.prototype.$forceUpdate = function () {
  6916. var vm = this;
  6917. if (vm._watcher) {
  6918. vm._watcher.update();
  6919. }
  6920. };
  6921. Vue.prototype.$destroy = function () {
  6922. var vm = this;
  6923. if (vm._isBeingDestroyed) {
  6924. return
  6925. }
  6926. callHook(vm, 'beforeDestroy');
  6927. vm._isBeingDestroyed = true;
  6928. // remove self from parent
  6929. var parent = vm.$parent;
  6930. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6931. remove(parent.$children, vm);
  6932. }
  6933. // teardown watchers
  6934. if (vm._watcher) {
  6935. vm._watcher.teardown();
  6936. }
  6937. var i = vm._watchers.length;
  6938. while (i--) {
  6939. vm._watchers[i].teardown();
  6940. }
  6941. // remove reference from data ob
  6942. // frozen object may not have observer.
  6943. if (vm._data.__ob__) {
  6944. vm._data.__ob__.vmCount--;
  6945. }
  6946. // call the last hook...
  6947. vm._isDestroyed = true;
  6948. // invoke destroy hooks on current rendered tree
  6949. vm.__patch__(vm._vnode, null);
  6950. // fire destroyed hook
  6951. callHook(vm, 'destroyed');
  6952. // turn off all instance listeners.
  6953. vm.$off();
  6954. // remove __vue__ reference
  6955. if (vm.$el) {
  6956. vm.$el.__vue__ = null;
  6957. }
  6958. // release circular reference (#6759)
  6959. if (vm.$vnode) {
  6960. vm.$vnode.parent = null;
  6961. }
  6962. };
  6963. }
  6964. function updateChildComponent (
  6965. vm,
  6966. propsData,
  6967. listeners,
  6968. parentVnode,
  6969. renderChildren
  6970. ) {
  6971. if (true) {
  6972. isUpdatingChildComponent = true;
  6973. }
  6974. // determine whether component has slot children
  6975. // we need to do this before overwriting $options._renderChildren.
  6976. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6977. // dynamic slot names). Static scoped slots compiled from template has the
  6978. // "$stable" marker.
  6979. var newScopedSlots = parentVnode.data.scopedSlots;
  6980. var oldScopedSlots = vm.$scopedSlots;
  6981. var hasDynamicScopedSlot = !!(
  6982. (newScopedSlots && !newScopedSlots.$stable) ||
  6983. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6984. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6985. );
  6986. // Any static slot children from the parent may have changed during parent's
  6987. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6988. // update is necessary to ensure correctness.
  6989. var needsForceUpdate = !!(
  6990. renderChildren || // has new static slots
  6991. vm.$options._renderChildren || // has old static slots
  6992. hasDynamicScopedSlot
  6993. );
  6994. vm.$options._parentVnode = parentVnode;
  6995. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6996. if (vm._vnode) { // update child tree's parent
  6997. vm._vnode.parent = parentVnode;
  6998. }
  6999. vm.$options._renderChildren = renderChildren;
  7000. // update $attrs and $listeners hash
  7001. // these are also reactive so they may trigger child update if the child
  7002. // used them during render
  7003. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7004. vm.$listeners = listeners || emptyObject;
  7005. // update props
  7006. if (propsData && vm.$options.props) {
  7007. toggleObserving(false);
  7008. var props = vm._props;
  7009. var propKeys = vm.$options._propKeys || [];
  7010. for (var i = 0; i < propKeys.length; i++) {
  7011. var key = propKeys[i];
  7012. var propOptions = vm.$options.props; // wtf flow?
  7013. props[key] = validateProp(key, propOptions, propsData, vm);
  7014. }
  7015. toggleObserving(true);
  7016. // keep a copy of raw propsData
  7017. vm.$options.propsData = propsData;
  7018. }
  7019. // fixed by xxxxxx update properties(mp runtime)
  7020. vm._$updateProperties && vm._$updateProperties(vm);
  7021. // update listeners
  7022. listeners = listeners || emptyObject;
  7023. var oldListeners = vm.$options._parentListeners;
  7024. vm.$options._parentListeners = listeners;
  7025. updateComponentListeners(vm, listeners, oldListeners);
  7026. // resolve slots + force update if has children
  7027. if (needsForceUpdate) {
  7028. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7029. vm.$forceUpdate();
  7030. }
  7031. if (true) {
  7032. isUpdatingChildComponent = false;
  7033. }
  7034. }
  7035. function isInInactiveTree (vm) {
  7036. while (vm && (vm = vm.$parent)) {
  7037. if (vm._inactive) { return true }
  7038. }
  7039. return false
  7040. }
  7041. function activateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = false;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. } else if (vm._directInactive) {
  7048. return
  7049. }
  7050. if (vm._inactive || vm._inactive === null) {
  7051. vm._inactive = false;
  7052. for (var i = 0; i < vm.$children.length; i++) {
  7053. activateChildComponent(vm.$children[i]);
  7054. }
  7055. callHook(vm, 'activated');
  7056. }
  7057. }
  7058. function deactivateChildComponent (vm, direct) {
  7059. if (direct) {
  7060. vm._directInactive = true;
  7061. if (isInInactiveTree(vm)) {
  7062. return
  7063. }
  7064. }
  7065. if (!vm._inactive) {
  7066. vm._inactive = true;
  7067. for (var i = 0; i < vm.$children.length; i++) {
  7068. deactivateChildComponent(vm.$children[i]);
  7069. }
  7070. callHook(vm, 'deactivated');
  7071. }
  7072. }
  7073. function callHook (vm, hook) {
  7074. // #7573 disable dep collection when invoking lifecycle hooks
  7075. pushTarget();
  7076. var handlers = vm.$options[hook];
  7077. var info = hook + " hook";
  7078. if (handlers) {
  7079. for (var i = 0, j = handlers.length; i < j; i++) {
  7080. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7081. }
  7082. }
  7083. if (vm._hasHookEvent) {
  7084. vm.$emit('hook:' + hook);
  7085. }
  7086. popTarget();
  7087. }
  7088. /* */
  7089. var MAX_UPDATE_COUNT = 100;
  7090. var queue = [];
  7091. var activatedChildren = [];
  7092. var has = {};
  7093. var circular = {};
  7094. var waiting = false;
  7095. var flushing = false;
  7096. var index = 0;
  7097. /**
  7098. * Reset the scheduler's state.
  7099. */
  7100. function resetSchedulerState () {
  7101. index = queue.length = activatedChildren.length = 0;
  7102. has = {};
  7103. if (true) {
  7104. circular = {};
  7105. }
  7106. waiting = flushing = false;
  7107. }
  7108. // Async edge case #6566 requires saving the timestamp when event listeners are
  7109. // attached. However, calling performance.now() has a perf overhead especially
  7110. // if the page has thousands of event listeners. Instead, we take a timestamp
  7111. // every time the scheduler flushes and use that for all event listeners
  7112. // attached during that flush.
  7113. var currentFlushTimestamp = 0;
  7114. // Async edge case fix requires storing an event listener's attach timestamp.
  7115. var getNow = Date.now;
  7116. // Determine what event timestamp the browser is using. Annoyingly, the
  7117. // timestamp can either be hi-res (relative to page load) or low-res
  7118. // (relative to UNIX epoch), so in order to compare time we have to use the
  7119. // same timestamp type when saving the flush timestamp.
  7120. // All IE versions use low-res event timestamps, and have problematic clock
  7121. // implementations (#9632)
  7122. if (inBrowser && !isIE) {
  7123. var performance = window.performance;
  7124. if (
  7125. performance &&
  7126. typeof performance.now === 'function' &&
  7127. getNow() > document.createEvent('Event').timeStamp
  7128. ) {
  7129. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7130. // smaller than it, it means the event is using a hi-res timestamp,
  7131. // and we need to use the hi-res version for event listener timestamps as
  7132. // well.
  7133. getNow = function () { return performance.now(); };
  7134. }
  7135. }
  7136. /**
  7137. * Flush both queues and run the watchers.
  7138. */
  7139. function flushSchedulerQueue () {
  7140. currentFlushTimestamp = getNow();
  7141. flushing = true;
  7142. var watcher, id;
  7143. // Sort queue before flush.
  7144. // This ensures that:
  7145. // 1. Components are updated from parent to child. (because parent is always
  7146. // created before the child)
  7147. // 2. A component's user watchers are run before its render watcher (because
  7148. // user watchers are created before the render watcher)
  7149. // 3. If a component is destroyed during a parent component's watcher run,
  7150. // its watchers can be skipped.
  7151. queue.sort(function (a, b) { return a.id - b.id; });
  7152. // do not cache length because more watchers might be pushed
  7153. // as we run existing watchers
  7154. for (index = 0; index < queue.length; index++) {
  7155. watcher = queue[index];
  7156. if (watcher.before) {
  7157. watcher.before();
  7158. }
  7159. id = watcher.id;
  7160. has[id] = null;
  7161. watcher.run();
  7162. // in dev build, check and stop circular updates.
  7163. if ( true && has[id] != null) {
  7164. circular[id] = (circular[id] || 0) + 1;
  7165. if (circular[id] > MAX_UPDATE_COUNT) {
  7166. warn(
  7167. 'You may have an infinite update loop ' + (
  7168. watcher.user
  7169. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7170. : "in a component render function."
  7171. ),
  7172. watcher.vm
  7173. );
  7174. break
  7175. }
  7176. }
  7177. }
  7178. // keep copies of post queues before resetting state
  7179. var activatedQueue = activatedChildren.slice();
  7180. var updatedQueue = queue.slice();
  7181. resetSchedulerState();
  7182. // call component updated and activated hooks
  7183. callActivatedHooks(activatedQueue);
  7184. callUpdatedHooks(updatedQueue);
  7185. // devtool hook
  7186. /* istanbul ignore if */
  7187. if (devtools && config.devtools) {
  7188. devtools.emit('flush');
  7189. }
  7190. }
  7191. function callUpdatedHooks (queue) {
  7192. var i = queue.length;
  7193. while (i--) {
  7194. var watcher = queue[i];
  7195. var vm = watcher.vm;
  7196. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7197. callHook(vm, 'updated');
  7198. }
  7199. }
  7200. }
  7201. /**
  7202. * Queue a kept-alive component that was activated during patch.
  7203. * The queue will be processed after the entire tree has been patched.
  7204. */
  7205. function queueActivatedComponent (vm) {
  7206. // setting _inactive to false here so that a render function can
  7207. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7208. vm._inactive = false;
  7209. activatedChildren.push(vm);
  7210. }
  7211. function callActivatedHooks (queue) {
  7212. for (var i = 0; i < queue.length; i++) {
  7213. queue[i]._inactive = true;
  7214. activateChildComponent(queue[i], true /* true */);
  7215. }
  7216. }
  7217. /**
  7218. * Push a watcher into the watcher queue.
  7219. * Jobs with duplicate IDs will be skipped unless it's
  7220. * pushed when the queue is being flushed.
  7221. */
  7222. function queueWatcher (watcher) {
  7223. var id = watcher.id;
  7224. if (has[id] == null) {
  7225. has[id] = true;
  7226. if (!flushing) {
  7227. queue.push(watcher);
  7228. } else {
  7229. // if already flushing, splice the watcher based on its id
  7230. // if already past its id, it will be run next immediately.
  7231. var i = queue.length - 1;
  7232. while (i > index && queue[i].id > watcher.id) {
  7233. i--;
  7234. }
  7235. queue.splice(i + 1, 0, watcher);
  7236. }
  7237. // queue the flush
  7238. if (!waiting) {
  7239. waiting = true;
  7240. if ( true && !config.async) {
  7241. flushSchedulerQueue();
  7242. return
  7243. }
  7244. nextTick(flushSchedulerQueue);
  7245. }
  7246. }
  7247. }
  7248. /* */
  7249. var uid$2 = 0;
  7250. /**
  7251. * A watcher parses an expression, collects dependencies,
  7252. * and fires callback when the expression value changes.
  7253. * This is used for both the $watch() api and directives.
  7254. */
  7255. var Watcher = function Watcher (
  7256. vm,
  7257. expOrFn,
  7258. cb,
  7259. options,
  7260. isRenderWatcher
  7261. ) {
  7262. this.vm = vm;
  7263. if (isRenderWatcher) {
  7264. vm._watcher = this;
  7265. }
  7266. vm._watchers.push(this);
  7267. // options
  7268. if (options) {
  7269. this.deep = !!options.deep;
  7270. this.user = !!options.user;
  7271. this.lazy = !!options.lazy;
  7272. this.sync = !!options.sync;
  7273. this.before = options.before;
  7274. } else {
  7275. this.deep = this.user = this.lazy = this.sync = false;
  7276. }
  7277. this.cb = cb;
  7278. this.id = ++uid$2; // uid for batching
  7279. this.active = true;
  7280. this.dirty = this.lazy; // for lazy watchers
  7281. this.deps = [];
  7282. this.newDeps = [];
  7283. this.depIds = new _Set();
  7284. this.newDepIds = new _Set();
  7285. this.expression = true
  7286. ? expOrFn.toString()
  7287. : undefined;
  7288. // parse expression for getter
  7289. if (typeof expOrFn === 'function') {
  7290. this.getter = expOrFn;
  7291. } else {
  7292. this.getter = parsePath(expOrFn);
  7293. if (!this.getter) {
  7294. this.getter = noop;
  7295. true && warn(
  7296. "Failed watching path: \"" + expOrFn + "\" " +
  7297. 'Watcher only accepts simple dot-delimited paths. ' +
  7298. 'For full control, use a function instead.',
  7299. vm
  7300. );
  7301. }
  7302. }
  7303. this.value = this.lazy
  7304. ? undefined
  7305. : this.get();
  7306. };
  7307. /**
  7308. * Evaluate the getter, and re-collect dependencies.
  7309. */
  7310. Watcher.prototype.get = function get () {
  7311. pushTarget(this);
  7312. var value;
  7313. var vm = this.vm;
  7314. try {
  7315. value = this.getter.call(vm, vm);
  7316. } catch (e) {
  7317. if (this.user) {
  7318. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7319. } else {
  7320. throw e
  7321. }
  7322. } finally {
  7323. // "touch" every property so they are all tracked as
  7324. // dependencies for deep watching
  7325. if (this.deep) {
  7326. traverse(value);
  7327. }
  7328. popTarget();
  7329. this.cleanupDeps();
  7330. }
  7331. return value
  7332. };
  7333. /**
  7334. * Add a dependency to this directive.
  7335. */
  7336. Watcher.prototype.addDep = function addDep (dep) {
  7337. var id = dep.id;
  7338. if (!this.newDepIds.has(id)) {
  7339. this.newDepIds.add(id);
  7340. this.newDeps.push(dep);
  7341. if (!this.depIds.has(id)) {
  7342. dep.addSub(this);
  7343. }
  7344. }
  7345. };
  7346. /**
  7347. * Clean up for dependency collection.
  7348. */
  7349. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7350. var i = this.deps.length;
  7351. while (i--) {
  7352. var dep = this.deps[i];
  7353. if (!this.newDepIds.has(dep.id)) {
  7354. dep.removeSub(this);
  7355. }
  7356. }
  7357. var tmp = this.depIds;
  7358. this.depIds = this.newDepIds;
  7359. this.newDepIds = tmp;
  7360. this.newDepIds.clear();
  7361. tmp = this.deps;
  7362. this.deps = this.newDeps;
  7363. this.newDeps = tmp;
  7364. this.newDeps.length = 0;
  7365. };
  7366. /**
  7367. * Subscriber interface.
  7368. * Will be called when a dependency changes.
  7369. */
  7370. Watcher.prototype.update = function update () {
  7371. /* istanbul ignore else */
  7372. if (this.lazy) {
  7373. this.dirty = true;
  7374. } else if (this.sync) {
  7375. this.run();
  7376. } else {
  7377. queueWatcher(this);
  7378. }
  7379. };
  7380. /**
  7381. * Scheduler job interface.
  7382. * Will be called by the scheduler.
  7383. */
  7384. Watcher.prototype.run = function run () {
  7385. if (this.active) {
  7386. var value = this.get();
  7387. if (
  7388. value !== this.value ||
  7389. // Deep watchers and watchers on Object/Arrays should fire even
  7390. // when the value is the same, because the value may
  7391. // have mutated.
  7392. isObject(value) ||
  7393. this.deep
  7394. ) {
  7395. // set new value
  7396. var oldValue = this.value;
  7397. this.value = value;
  7398. if (this.user) {
  7399. try {
  7400. this.cb.call(this.vm, value, oldValue);
  7401. } catch (e) {
  7402. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7403. }
  7404. } else {
  7405. this.cb.call(this.vm, value, oldValue);
  7406. }
  7407. }
  7408. }
  7409. };
  7410. /**
  7411. * Evaluate the value of the watcher.
  7412. * This only gets called for lazy watchers.
  7413. */
  7414. Watcher.prototype.evaluate = function evaluate () {
  7415. this.value = this.get();
  7416. this.dirty = false;
  7417. };
  7418. /**
  7419. * Depend on all deps collected by this watcher.
  7420. */
  7421. Watcher.prototype.depend = function depend () {
  7422. var i = this.deps.length;
  7423. while (i--) {
  7424. this.deps[i].depend();
  7425. }
  7426. };
  7427. /**
  7428. * Remove self from all dependencies' subscriber list.
  7429. */
  7430. Watcher.prototype.teardown = function teardown () {
  7431. if (this.active) {
  7432. // remove self from vm's watcher list
  7433. // this is a somewhat expensive operation so we skip it
  7434. // if the vm is being destroyed.
  7435. if (!this.vm._isBeingDestroyed) {
  7436. remove(this.vm._watchers, this);
  7437. }
  7438. var i = this.deps.length;
  7439. while (i--) {
  7440. this.deps[i].removeSub(this);
  7441. }
  7442. this.active = false;
  7443. }
  7444. };
  7445. /* */
  7446. var sharedPropertyDefinition = {
  7447. enumerable: true,
  7448. configurable: true,
  7449. get: noop,
  7450. set: noop
  7451. };
  7452. function proxy (target, sourceKey, key) {
  7453. sharedPropertyDefinition.get = function proxyGetter () {
  7454. return this[sourceKey][key]
  7455. };
  7456. sharedPropertyDefinition.set = function proxySetter (val) {
  7457. this[sourceKey][key] = val;
  7458. };
  7459. Object.defineProperty(target, key, sharedPropertyDefinition);
  7460. }
  7461. function initState (vm) {
  7462. vm._watchers = [];
  7463. var opts = vm.$options;
  7464. if (opts.props) { initProps(vm, opts.props); }
  7465. if (opts.methods) { initMethods(vm, opts.methods); }
  7466. if (opts.data) {
  7467. initData(vm);
  7468. } else {
  7469. observe(vm._data = {}, true /* asRootData */);
  7470. }
  7471. if (opts.computed) { initComputed(vm, opts.computed); }
  7472. if (opts.watch && opts.watch !== nativeWatch) {
  7473. initWatch(vm, opts.watch);
  7474. }
  7475. }
  7476. function initProps (vm, propsOptions) {
  7477. var propsData = vm.$options.propsData || {};
  7478. var props = vm._props = {};
  7479. // cache prop keys so that future props updates can iterate using Array
  7480. // instead of dynamic object key enumeration.
  7481. var keys = vm.$options._propKeys = [];
  7482. var isRoot = !vm.$parent;
  7483. // root instance props should be converted
  7484. if (!isRoot) {
  7485. toggleObserving(false);
  7486. }
  7487. var loop = function ( key ) {
  7488. keys.push(key);
  7489. var value = validateProp(key, propsOptions, propsData, vm);
  7490. /* istanbul ignore else */
  7491. if (true) {
  7492. var hyphenatedKey = hyphenate(key);
  7493. if (isReservedAttribute(hyphenatedKey) ||
  7494. config.isReservedAttr(hyphenatedKey)) {
  7495. warn(
  7496. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7497. vm
  7498. );
  7499. }
  7500. defineReactive$$1(props, key, value, function () {
  7501. if (!isRoot && !isUpdatingChildComponent) {
  7502. {
  7503. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7504. return
  7505. }
  7506. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7507. if(
  7508. key === 'value' &&
  7509. Array.isArray(vm.$options.behaviors) &&
  7510. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7511. ){
  7512. return
  7513. }
  7514. if(vm._getFormData){
  7515. return
  7516. }
  7517. var $parent = vm.$parent;
  7518. while($parent){
  7519. if($parent.__next_tick_pending){
  7520. return
  7521. }
  7522. $parent = $parent.$parent;
  7523. }
  7524. }
  7525. warn(
  7526. "Avoid mutating a prop directly since the value will be " +
  7527. "overwritten whenever the parent component re-renders. " +
  7528. "Instead, use a data or computed property based on the prop's " +
  7529. "value. Prop being mutated: \"" + key + "\"",
  7530. vm
  7531. );
  7532. }
  7533. });
  7534. } else {}
  7535. // static props are already proxied on the component's prototype
  7536. // during Vue.extend(). We only need to proxy props defined at
  7537. // instantiation here.
  7538. if (!(key in vm)) {
  7539. proxy(vm, "_props", key);
  7540. }
  7541. };
  7542. for (var key in propsOptions) loop( key );
  7543. toggleObserving(true);
  7544. }
  7545. function initData (vm) {
  7546. var data = vm.$options.data;
  7547. data = vm._data = typeof data === 'function'
  7548. ? getData(data, vm)
  7549. : data || {};
  7550. if (!isPlainObject(data)) {
  7551. data = {};
  7552. true && warn(
  7553. 'data functions should return an object:\n' +
  7554. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7555. vm
  7556. );
  7557. }
  7558. // proxy data on instance
  7559. var keys = Object.keys(data);
  7560. var props = vm.$options.props;
  7561. var methods = vm.$options.methods;
  7562. var i = keys.length;
  7563. while (i--) {
  7564. var key = keys[i];
  7565. if (true) {
  7566. if (methods && hasOwn(methods, key)) {
  7567. warn(
  7568. ("Method \"" + key + "\" has already been defined as a data property."),
  7569. vm
  7570. );
  7571. }
  7572. }
  7573. if (props && hasOwn(props, key)) {
  7574. true && warn(
  7575. "The data property \"" + key + "\" is already declared as a prop. " +
  7576. "Use prop default value instead.",
  7577. vm
  7578. );
  7579. } else if (!isReserved(key)) {
  7580. proxy(vm, "_data", key);
  7581. }
  7582. }
  7583. // observe data
  7584. observe(data, true /* asRootData */);
  7585. }
  7586. function getData (data, vm) {
  7587. // #7573 disable dep collection when invoking data getters
  7588. pushTarget();
  7589. try {
  7590. return data.call(vm, vm)
  7591. } catch (e) {
  7592. handleError(e, vm, "data()");
  7593. return {}
  7594. } finally {
  7595. popTarget();
  7596. }
  7597. }
  7598. var computedWatcherOptions = { lazy: true };
  7599. function initComputed (vm, computed) {
  7600. // $flow-disable-line
  7601. var watchers = vm._computedWatchers = Object.create(null);
  7602. // computed properties are just getters during SSR
  7603. var isSSR = isServerRendering();
  7604. for (var key in computed) {
  7605. var userDef = computed[key];
  7606. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7607. if ( true && getter == null) {
  7608. warn(
  7609. ("Getter is missing for computed property \"" + key + "\"."),
  7610. vm
  7611. );
  7612. }
  7613. if (!isSSR) {
  7614. // create internal watcher for the computed property.
  7615. watchers[key] = new Watcher(
  7616. vm,
  7617. getter || noop,
  7618. noop,
  7619. computedWatcherOptions
  7620. );
  7621. }
  7622. // component-defined computed properties are already defined on the
  7623. // component prototype. We only need to define computed properties defined
  7624. // at instantiation here.
  7625. if (!(key in vm)) {
  7626. defineComputed(vm, key, userDef);
  7627. } else if (true) {
  7628. if (key in vm.$data) {
  7629. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7630. } else if (vm.$options.props && key in vm.$options.props) {
  7631. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7632. }
  7633. }
  7634. }
  7635. }
  7636. function defineComputed (
  7637. target,
  7638. key,
  7639. userDef
  7640. ) {
  7641. var shouldCache = !isServerRendering();
  7642. if (typeof userDef === 'function') {
  7643. sharedPropertyDefinition.get = shouldCache
  7644. ? createComputedGetter(key)
  7645. : createGetterInvoker(userDef);
  7646. sharedPropertyDefinition.set = noop;
  7647. } else {
  7648. sharedPropertyDefinition.get = userDef.get
  7649. ? shouldCache && userDef.cache !== false
  7650. ? createComputedGetter(key)
  7651. : createGetterInvoker(userDef.get)
  7652. : noop;
  7653. sharedPropertyDefinition.set = userDef.set || noop;
  7654. }
  7655. if ( true &&
  7656. sharedPropertyDefinition.set === noop) {
  7657. sharedPropertyDefinition.set = function () {
  7658. warn(
  7659. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7660. this
  7661. );
  7662. };
  7663. }
  7664. Object.defineProperty(target, key, sharedPropertyDefinition);
  7665. }
  7666. function createComputedGetter (key) {
  7667. return function computedGetter () {
  7668. var watcher = this._computedWatchers && this._computedWatchers[key];
  7669. if (watcher) {
  7670. if (watcher.dirty) {
  7671. watcher.evaluate();
  7672. }
  7673. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7674. watcher.depend();
  7675. }
  7676. return watcher.value
  7677. }
  7678. }
  7679. }
  7680. function createGetterInvoker(fn) {
  7681. return function computedGetter () {
  7682. return fn.call(this, this)
  7683. }
  7684. }
  7685. function initMethods (vm, methods) {
  7686. var props = vm.$options.props;
  7687. for (var key in methods) {
  7688. if (true) {
  7689. if (typeof methods[key] !== 'function') {
  7690. warn(
  7691. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7692. "Did you reference the function correctly?",
  7693. vm
  7694. );
  7695. }
  7696. if (props && hasOwn(props, key)) {
  7697. warn(
  7698. ("Method \"" + key + "\" has already been defined as a prop."),
  7699. vm
  7700. );
  7701. }
  7702. if ((key in vm) && isReserved(key)) {
  7703. warn(
  7704. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7705. "Avoid defining component methods that start with _ or $."
  7706. );
  7707. }
  7708. }
  7709. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7710. }
  7711. }
  7712. function initWatch (vm, watch) {
  7713. for (var key in watch) {
  7714. var handler = watch[key];
  7715. if (Array.isArray(handler)) {
  7716. for (var i = 0; i < handler.length; i++) {
  7717. createWatcher(vm, key, handler[i]);
  7718. }
  7719. } else {
  7720. createWatcher(vm, key, handler);
  7721. }
  7722. }
  7723. }
  7724. function createWatcher (
  7725. vm,
  7726. expOrFn,
  7727. handler,
  7728. options
  7729. ) {
  7730. if (isPlainObject(handler)) {
  7731. options = handler;
  7732. handler = handler.handler;
  7733. }
  7734. if (typeof handler === 'string') {
  7735. handler = vm[handler];
  7736. }
  7737. return vm.$watch(expOrFn, handler, options)
  7738. }
  7739. function stateMixin (Vue) {
  7740. // flow somehow has problems with directly declared definition object
  7741. // when using Object.defineProperty, so we have to procedurally build up
  7742. // the object here.
  7743. var dataDef = {};
  7744. dataDef.get = function () { return this._data };
  7745. var propsDef = {};
  7746. propsDef.get = function () { return this._props };
  7747. if (true) {
  7748. dataDef.set = function () {
  7749. warn(
  7750. 'Avoid replacing instance root $data. ' +
  7751. 'Use nested data properties instead.',
  7752. this
  7753. );
  7754. };
  7755. propsDef.set = function () {
  7756. warn("$props is readonly.", this);
  7757. };
  7758. }
  7759. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7760. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7761. Vue.prototype.$set = set;
  7762. Vue.prototype.$delete = del;
  7763. Vue.prototype.$watch = function (
  7764. expOrFn,
  7765. cb,
  7766. options
  7767. ) {
  7768. var vm = this;
  7769. if (isPlainObject(cb)) {
  7770. return createWatcher(vm, expOrFn, cb, options)
  7771. }
  7772. options = options || {};
  7773. options.user = true;
  7774. var watcher = new Watcher(vm, expOrFn, cb, options);
  7775. if (options.immediate) {
  7776. try {
  7777. cb.call(vm, watcher.value);
  7778. } catch (error) {
  7779. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7780. }
  7781. }
  7782. return function unwatchFn () {
  7783. watcher.teardown();
  7784. }
  7785. };
  7786. }
  7787. /* */
  7788. var uid$3 = 0;
  7789. function initMixin (Vue) {
  7790. Vue.prototype._init = function (options) {
  7791. var vm = this;
  7792. // a uid
  7793. vm._uid = uid$3++;
  7794. var startTag, endTag;
  7795. /* istanbul ignore if */
  7796. if ( true && config.performance && mark) {
  7797. startTag = "vue-perf-start:" + (vm._uid);
  7798. endTag = "vue-perf-end:" + (vm._uid);
  7799. mark(startTag);
  7800. }
  7801. // a flag to avoid this being observed
  7802. vm._isVue = true;
  7803. // merge options
  7804. if (options && options._isComponent) {
  7805. // optimize internal component instantiation
  7806. // since dynamic options merging is pretty slow, and none of the
  7807. // internal component options needs special treatment.
  7808. initInternalComponent(vm, options);
  7809. } else {
  7810. vm.$options = mergeOptions(
  7811. resolveConstructorOptions(vm.constructor),
  7812. options || {},
  7813. vm
  7814. );
  7815. }
  7816. /* istanbul ignore else */
  7817. if (true) {
  7818. initProxy(vm);
  7819. } else {}
  7820. // expose real self
  7821. vm._self = vm;
  7822. initLifecycle(vm);
  7823. initEvents(vm);
  7824. initRender(vm);
  7825. callHook(vm, 'beforeCreate');
  7826. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7827. initState(vm);
  7828. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7829. !vm._$fallback && callHook(vm, 'created');
  7830. /* istanbul ignore if */
  7831. if ( true && config.performance && mark) {
  7832. vm._name = formatComponentName(vm, false);
  7833. mark(endTag);
  7834. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7835. }
  7836. if (vm.$options.el) {
  7837. vm.$mount(vm.$options.el);
  7838. }
  7839. };
  7840. }
  7841. function initInternalComponent (vm, options) {
  7842. var opts = vm.$options = Object.create(vm.constructor.options);
  7843. // doing this because it's faster than dynamic enumeration.
  7844. var parentVnode = options._parentVnode;
  7845. opts.parent = options.parent;
  7846. opts._parentVnode = parentVnode;
  7847. var vnodeComponentOptions = parentVnode.componentOptions;
  7848. opts.propsData = vnodeComponentOptions.propsData;
  7849. opts._parentListeners = vnodeComponentOptions.listeners;
  7850. opts._renderChildren = vnodeComponentOptions.children;
  7851. opts._componentTag = vnodeComponentOptions.tag;
  7852. if (options.render) {
  7853. opts.render = options.render;
  7854. opts.staticRenderFns = options.staticRenderFns;
  7855. }
  7856. }
  7857. function resolveConstructorOptions (Ctor) {
  7858. var options = Ctor.options;
  7859. if (Ctor.super) {
  7860. var superOptions = resolveConstructorOptions(Ctor.super);
  7861. var cachedSuperOptions = Ctor.superOptions;
  7862. if (superOptions !== cachedSuperOptions) {
  7863. // super option changed,
  7864. // need to resolve new options.
  7865. Ctor.superOptions = superOptions;
  7866. // check if there are any late-modified/attached options (#4976)
  7867. var modifiedOptions = resolveModifiedOptions(Ctor);
  7868. // update base extend options
  7869. if (modifiedOptions) {
  7870. extend(Ctor.extendOptions, modifiedOptions);
  7871. }
  7872. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7873. if (options.name) {
  7874. options.components[options.name] = Ctor;
  7875. }
  7876. }
  7877. }
  7878. return options
  7879. }
  7880. function resolveModifiedOptions (Ctor) {
  7881. var modified;
  7882. var latest = Ctor.options;
  7883. var sealed = Ctor.sealedOptions;
  7884. for (var key in latest) {
  7885. if (latest[key] !== sealed[key]) {
  7886. if (!modified) { modified = {}; }
  7887. modified[key] = latest[key];
  7888. }
  7889. }
  7890. return modified
  7891. }
  7892. function Vue (options) {
  7893. if ( true &&
  7894. !(this instanceof Vue)
  7895. ) {
  7896. warn('Vue is a constructor and should be called with the `new` keyword');
  7897. }
  7898. this._init(options);
  7899. }
  7900. initMixin(Vue);
  7901. stateMixin(Vue);
  7902. eventsMixin(Vue);
  7903. lifecycleMixin(Vue);
  7904. renderMixin(Vue);
  7905. /* */
  7906. function initUse (Vue) {
  7907. Vue.use = function (plugin) {
  7908. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7909. if (installedPlugins.indexOf(plugin) > -1) {
  7910. return this
  7911. }
  7912. // additional parameters
  7913. var args = toArray(arguments, 1);
  7914. args.unshift(this);
  7915. if (typeof plugin.install === 'function') {
  7916. plugin.install.apply(plugin, args);
  7917. } else if (typeof plugin === 'function') {
  7918. plugin.apply(null, args);
  7919. }
  7920. installedPlugins.push(plugin);
  7921. return this
  7922. };
  7923. }
  7924. /* */
  7925. function initMixin$1 (Vue) {
  7926. Vue.mixin = function (mixin) {
  7927. this.options = mergeOptions(this.options, mixin);
  7928. return this
  7929. };
  7930. }
  7931. /* */
  7932. function initExtend (Vue) {
  7933. /**
  7934. * Each instance constructor, including Vue, has a unique
  7935. * cid. This enables us to create wrapped "child
  7936. * constructors" for prototypal inheritance and cache them.
  7937. */
  7938. Vue.cid = 0;
  7939. var cid = 1;
  7940. /**
  7941. * Class inheritance
  7942. */
  7943. Vue.extend = function (extendOptions) {
  7944. extendOptions = extendOptions || {};
  7945. var Super = this;
  7946. var SuperId = Super.cid;
  7947. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7948. if (cachedCtors[SuperId]) {
  7949. return cachedCtors[SuperId]
  7950. }
  7951. var name = extendOptions.name || Super.options.name;
  7952. if ( true && name) {
  7953. validateComponentName(name);
  7954. }
  7955. var Sub = function VueComponent (options) {
  7956. this._init(options);
  7957. };
  7958. Sub.prototype = Object.create(Super.prototype);
  7959. Sub.prototype.constructor = Sub;
  7960. Sub.cid = cid++;
  7961. Sub.options = mergeOptions(
  7962. Super.options,
  7963. extendOptions
  7964. );
  7965. Sub['super'] = Super;
  7966. // For props and computed properties, we define the proxy getters on
  7967. // the Vue instances at extension time, on the extended prototype. This
  7968. // avoids Object.defineProperty calls for each instance created.
  7969. if (Sub.options.props) {
  7970. initProps$1(Sub);
  7971. }
  7972. if (Sub.options.computed) {
  7973. initComputed$1(Sub);
  7974. }
  7975. // allow further extension/mixin/plugin usage
  7976. Sub.extend = Super.extend;
  7977. Sub.mixin = Super.mixin;
  7978. Sub.use = Super.use;
  7979. // create asset registers, so extended classes
  7980. // can have their private assets too.
  7981. ASSET_TYPES.forEach(function (type) {
  7982. Sub[type] = Super[type];
  7983. });
  7984. // enable recursive self-lookup
  7985. if (name) {
  7986. Sub.options.components[name] = Sub;
  7987. }
  7988. // keep a reference to the super options at extension time.
  7989. // later at instantiation we can check if Super's options have
  7990. // been updated.
  7991. Sub.superOptions = Super.options;
  7992. Sub.extendOptions = extendOptions;
  7993. Sub.sealedOptions = extend({}, Sub.options);
  7994. // cache constructor
  7995. cachedCtors[SuperId] = Sub;
  7996. return Sub
  7997. };
  7998. }
  7999. function initProps$1 (Comp) {
  8000. var props = Comp.options.props;
  8001. for (var key in props) {
  8002. proxy(Comp.prototype, "_props", key);
  8003. }
  8004. }
  8005. function initComputed$1 (Comp) {
  8006. var computed = Comp.options.computed;
  8007. for (var key in computed) {
  8008. defineComputed(Comp.prototype, key, computed[key]);
  8009. }
  8010. }
  8011. /* */
  8012. function initAssetRegisters (Vue) {
  8013. /**
  8014. * Create asset registration methods.
  8015. */
  8016. ASSET_TYPES.forEach(function (type) {
  8017. Vue[type] = function (
  8018. id,
  8019. definition
  8020. ) {
  8021. if (!definition) {
  8022. return this.options[type + 's'][id]
  8023. } else {
  8024. /* istanbul ignore if */
  8025. if ( true && type === 'component') {
  8026. validateComponentName(id);
  8027. }
  8028. if (type === 'component' && isPlainObject(definition)) {
  8029. definition.name = definition.name || id;
  8030. definition = this.options._base.extend(definition);
  8031. }
  8032. if (type === 'directive' && typeof definition === 'function') {
  8033. definition = { bind: definition, update: definition };
  8034. }
  8035. this.options[type + 's'][id] = definition;
  8036. return definition
  8037. }
  8038. };
  8039. });
  8040. }
  8041. /* */
  8042. function getComponentName (opts) {
  8043. return opts && (opts.Ctor.options.name || opts.tag)
  8044. }
  8045. function matches (pattern, name) {
  8046. if (Array.isArray(pattern)) {
  8047. return pattern.indexOf(name) > -1
  8048. } else if (typeof pattern === 'string') {
  8049. return pattern.split(',').indexOf(name) > -1
  8050. } else if (isRegExp(pattern)) {
  8051. return pattern.test(name)
  8052. }
  8053. /* istanbul ignore next */
  8054. return false
  8055. }
  8056. function pruneCache (keepAliveInstance, filter) {
  8057. var cache = keepAliveInstance.cache;
  8058. var keys = keepAliveInstance.keys;
  8059. var _vnode = keepAliveInstance._vnode;
  8060. for (var key in cache) {
  8061. var cachedNode = cache[key];
  8062. if (cachedNode) {
  8063. var name = getComponentName(cachedNode.componentOptions);
  8064. if (name && !filter(name)) {
  8065. pruneCacheEntry(cache, key, keys, _vnode);
  8066. }
  8067. }
  8068. }
  8069. }
  8070. function pruneCacheEntry (
  8071. cache,
  8072. key,
  8073. keys,
  8074. current
  8075. ) {
  8076. var cached$$1 = cache[key];
  8077. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8078. cached$$1.componentInstance.$destroy();
  8079. }
  8080. cache[key] = null;
  8081. remove(keys, key);
  8082. }
  8083. var patternTypes = [String, RegExp, Array];
  8084. var KeepAlive = {
  8085. name: 'keep-alive',
  8086. abstract: true,
  8087. props: {
  8088. include: patternTypes,
  8089. exclude: patternTypes,
  8090. max: [String, Number]
  8091. },
  8092. created: function created () {
  8093. this.cache = Object.create(null);
  8094. this.keys = [];
  8095. },
  8096. destroyed: function destroyed () {
  8097. for (var key in this.cache) {
  8098. pruneCacheEntry(this.cache, key, this.keys);
  8099. }
  8100. },
  8101. mounted: function mounted () {
  8102. var this$1 = this;
  8103. this.$watch('include', function (val) {
  8104. pruneCache(this$1, function (name) { return matches(val, name); });
  8105. });
  8106. this.$watch('exclude', function (val) {
  8107. pruneCache(this$1, function (name) { return !matches(val, name); });
  8108. });
  8109. },
  8110. render: function render () {
  8111. var slot = this.$slots.default;
  8112. var vnode = getFirstComponentChild(slot);
  8113. var componentOptions = vnode && vnode.componentOptions;
  8114. if (componentOptions) {
  8115. // check pattern
  8116. var name = getComponentName(componentOptions);
  8117. var ref = this;
  8118. var include = ref.include;
  8119. var exclude = ref.exclude;
  8120. if (
  8121. // not included
  8122. (include && (!name || !matches(include, name))) ||
  8123. // excluded
  8124. (exclude && name && matches(exclude, name))
  8125. ) {
  8126. return vnode
  8127. }
  8128. var ref$1 = this;
  8129. var cache = ref$1.cache;
  8130. var keys = ref$1.keys;
  8131. var key = vnode.key == null
  8132. // same constructor may get registered as different local components
  8133. // so cid alone is not enough (#3269)
  8134. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8135. : vnode.key;
  8136. if (cache[key]) {
  8137. vnode.componentInstance = cache[key].componentInstance;
  8138. // make current key freshest
  8139. remove(keys, key);
  8140. keys.push(key);
  8141. } else {
  8142. cache[key] = vnode;
  8143. keys.push(key);
  8144. // prune oldest entry
  8145. if (this.max && keys.length > parseInt(this.max)) {
  8146. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8147. }
  8148. }
  8149. vnode.data.keepAlive = true;
  8150. }
  8151. return vnode || (slot && slot[0])
  8152. }
  8153. };
  8154. var builtInComponents = {
  8155. KeepAlive: KeepAlive
  8156. };
  8157. /* */
  8158. function initGlobalAPI (Vue) {
  8159. // config
  8160. var configDef = {};
  8161. configDef.get = function () { return config; };
  8162. if (true) {
  8163. configDef.set = function () {
  8164. warn(
  8165. 'Do not replace the Vue.config object, set individual fields instead.'
  8166. );
  8167. };
  8168. }
  8169. Object.defineProperty(Vue, 'config', configDef);
  8170. // exposed util methods.
  8171. // NOTE: these are not considered part of the public API - avoid relying on
  8172. // them unless you are aware of the risk.
  8173. Vue.util = {
  8174. warn: warn,
  8175. extend: extend,
  8176. mergeOptions: mergeOptions,
  8177. defineReactive: defineReactive$$1
  8178. };
  8179. Vue.set = set;
  8180. Vue.delete = del;
  8181. Vue.nextTick = nextTick;
  8182. // 2.6 explicit observable API
  8183. Vue.observable = function (obj) {
  8184. observe(obj);
  8185. return obj
  8186. };
  8187. Vue.options = Object.create(null);
  8188. ASSET_TYPES.forEach(function (type) {
  8189. Vue.options[type + 's'] = Object.create(null);
  8190. });
  8191. // this is used to identify the "base" constructor to extend all plain-object
  8192. // components with in Weex's multi-instance scenarios.
  8193. Vue.options._base = Vue;
  8194. extend(Vue.options.components, builtInComponents);
  8195. initUse(Vue);
  8196. initMixin$1(Vue);
  8197. initExtend(Vue);
  8198. initAssetRegisters(Vue);
  8199. }
  8200. initGlobalAPI(Vue);
  8201. Object.defineProperty(Vue.prototype, '$isServer', {
  8202. get: isServerRendering
  8203. });
  8204. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8205. get: function get () {
  8206. /* istanbul ignore next */
  8207. return this.$vnode && this.$vnode.ssrContext
  8208. }
  8209. });
  8210. // expose FunctionalRenderContext for ssr runtime helper installation
  8211. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8212. value: FunctionalRenderContext
  8213. });
  8214. Vue.version = '2.6.11';
  8215. /**
  8216. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8217. */
  8218. var ARRAYTYPE = '[object Array]';
  8219. var OBJECTTYPE = '[object Object]';
  8220. var NULLTYPE = '[object Null]';
  8221. var UNDEFINEDTYPE = '[object Undefined]';
  8222. // const FUNCTIONTYPE = '[object Function]'
  8223. function diff(current, pre) {
  8224. var result = {};
  8225. syncKeys(current, pre);
  8226. _diff(current, pre, '', result);
  8227. return result
  8228. }
  8229. function syncKeys(current, pre) {
  8230. if (current === pre) { return }
  8231. var rootCurrentType = type(current);
  8232. var rootPreType = type(pre);
  8233. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8234. if(Object.keys(current).length >= Object.keys(pre).length){
  8235. for (var key in pre) {
  8236. var currentValue = current[key];
  8237. if (currentValue === undefined) {
  8238. current[key] = null;
  8239. } else {
  8240. syncKeys(currentValue, pre[key]);
  8241. }
  8242. }
  8243. }
  8244. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8245. if (current.length >= pre.length) {
  8246. pre.forEach(function (item, index) {
  8247. syncKeys(current[index], item);
  8248. });
  8249. }
  8250. }
  8251. }
  8252. function nullOrUndefined(currentType, preType) {
  8253. if(
  8254. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8255. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8256. ) {
  8257. return false
  8258. }
  8259. return true
  8260. }
  8261. function _diff(current, pre, path, result) {
  8262. if (current === pre) { return }
  8263. var rootCurrentType = type(current);
  8264. var rootPreType = type(pre);
  8265. if (rootCurrentType == OBJECTTYPE) {
  8266. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8267. setResult(result, path, current);
  8268. } else {
  8269. var loop = function ( key ) {
  8270. var currentValue = current[key];
  8271. var preValue = pre[key];
  8272. var currentType = type(currentValue);
  8273. var preType = type(preValue);
  8274. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8275. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8276. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8277. }
  8278. } else if (currentType == ARRAYTYPE) {
  8279. if (preType != ARRAYTYPE) {
  8280. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8281. } else {
  8282. if (currentValue.length < preValue.length) {
  8283. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8284. } else {
  8285. currentValue.forEach(function (item, index) {
  8286. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8287. });
  8288. }
  8289. }
  8290. } else if (currentType == OBJECTTYPE) {
  8291. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8292. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8293. } else {
  8294. for (var subKey in currentValue) {
  8295. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8296. }
  8297. }
  8298. }
  8299. };
  8300. for (var key in current) loop( key );
  8301. }
  8302. } else if (rootCurrentType == ARRAYTYPE) {
  8303. if (rootPreType != ARRAYTYPE) {
  8304. setResult(result, path, current);
  8305. } else {
  8306. if (current.length < pre.length) {
  8307. setResult(result, path, current);
  8308. } else {
  8309. current.forEach(function (item, index) {
  8310. _diff(item, pre[index], path + '[' + index + ']', result);
  8311. });
  8312. }
  8313. }
  8314. } else {
  8315. setResult(result, path, current);
  8316. }
  8317. }
  8318. function setResult(result, k, v) {
  8319. // if (type(v) != FUNCTIONTYPE) {
  8320. result[k] = v;
  8321. // }
  8322. }
  8323. function type(obj) {
  8324. return Object.prototype.toString.call(obj)
  8325. }
  8326. /* */
  8327. function flushCallbacks$1(vm) {
  8328. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8329. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"速立保","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8330. var mpInstance = vm.$scope;
  8331. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8332. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8333. }
  8334. var copies = vm.__next_tick_callbacks.slice(0);
  8335. vm.__next_tick_callbacks.length = 0;
  8336. for (var i = 0; i < copies.length; i++) {
  8337. copies[i]();
  8338. }
  8339. }
  8340. }
  8341. function hasRenderWatcher(vm) {
  8342. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8343. }
  8344. function nextTick$1(vm, cb) {
  8345. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8346. //2.nextTick 之前存在 render watcher
  8347. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8348. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"速立保","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8349. var mpInstance = vm.$scope;
  8350. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8351. ']:nextVueTick');
  8352. }
  8353. return nextTick(cb, vm)
  8354. }else{
  8355. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"速立保","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8356. var mpInstance$1 = vm.$scope;
  8357. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8358. ']:nextMPTick');
  8359. }
  8360. }
  8361. var _resolve;
  8362. if (!vm.__next_tick_callbacks) {
  8363. vm.__next_tick_callbacks = [];
  8364. }
  8365. vm.__next_tick_callbacks.push(function () {
  8366. if (cb) {
  8367. try {
  8368. cb.call(vm);
  8369. } catch (e) {
  8370. handleError(e, vm, 'nextTick');
  8371. }
  8372. } else if (_resolve) {
  8373. _resolve(vm);
  8374. }
  8375. });
  8376. // $flow-disable-line
  8377. if (!cb && typeof Promise !== 'undefined') {
  8378. return new Promise(function (resolve) {
  8379. _resolve = resolve;
  8380. })
  8381. }
  8382. }
  8383. /* */
  8384. function clearInstance(key, value) {
  8385. // 简易去除 Vue 和小程序组件实例
  8386. if (value) {
  8387. if (value._isVue || value.__v_isMPComponent) {
  8388. return {}
  8389. }
  8390. }
  8391. return value
  8392. }
  8393. function cloneWithData(vm) {
  8394. // 确保当前 vm 所有数据被同步
  8395. var ret = Object.create(null);
  8396. var dataKeys = [].concat(
  8397. Object.keys(vm._data || {}),
  8398. Object.keys(vm._computedWatchers || {}));
  8399. dataKeys.reduce(function(ret, key) {
  8400. ret[key] = vm[key];
  8401. return ret
  8402. }, ret);
  8403. // vue-composition-api
  8404. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8405. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8406. if (rawBindings) {
  8407. Object.keys(rawBindings).forEach(function (key) {
  8408. ret[key] = vm[key];
  8409. });
  8410. }
  8411. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8412. Object.assign(ret, vm.$mp.data || {});
  8413. if (
  8414. Array.isArray(vm.$options.behaviors) &&
  8415. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8416. ) { //form-field
  8417. ret['name'] = vm.name;
  8418. ret['value'] = vm.value;
  8419. }
  8420. return JSON.parse(JSON.stringify(ret, clearInstance))
  8421. }
  8422. var patch = function(oldVnode, vnode) {
  8423. var this$1 = this;
  8424. if (vnode === null) { //destroy
  8425. return
  8426. }
  8427. if (this.mpType === 'page' || this.mpType === 'component') {
  8428. var mpInstance = this.$scope;
  8429. var data = Object.create(null);
  8430. try {
  8431. data = cloneWithData(this);
  8432. } catch (err) {
  8433. console.error(err);
  8434. }
  8435. data.__webviewId__ = mpInstance.data.__webviewId__;
  8436. var mpData = Object.create(null);
  8437. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8438. mpData[key] = mpInstance.data[key];
  8439. });
  8440. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8441. if (Object.keys(diffData).length) {
  8442. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"速立保","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8443. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8444. ']差量更新',
  8445. JSON.stringify(diffData));
  8446. }
  8447. this.__next_tick_pending = true;
  8448. mpInstance.setData(diffData, function () {
  8449. this$1.__next_tick_pending = false;
  8450. flushCallbacks$1(this$1);
  8451. });
  8452. } else {
  8453. flushCallbacks$1(this);
  8454. }
  8455. }
  8456. };
  8457. /* */
  8458. function createEmptyRender() {
  8459. }
  8460. function mountComponent$1(
  8461. vm,
  8462. el,
  8463. hydrating
  8464. ) {
  8465. if (!vm.mpType) {//main.js 中的 new Vue
  8466. return vm
  8467. }
  8468. if (vm.mpType === 'app') {
  8469. vm.$options.render = createEmptyRender;
  8470. }
  8471. if (!vm.$options.render) {
  8472. vm.$options.render = createEmptyRender;
  8473. if (true) {
  8474. /* istanbul ignore if */
  8475. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8476. vm.$options.el || el) {
  8477. warn(
  8478. 'You are using the runtime-only build of Vue where the template ' +
  8479. 'compiler is not available. Either pre-compile the templates into ' +
  8480. 'render functions, or use the compiler-included build.',
  8481. vm
  8482. );
  8483. } else {
  8484. warn(
  8485. 'Failed to mount component: template or render function not defined.',
  8486. vm
  8487. );
  8488. }
  8489. }
  8490. }
  8491. !vm._$fallback && callHook(vm, 'beforeMount');
  8492. var updateComponent = function () {
  8493. vm._update(vm._render(), hydrating);
  8494. };
  8495. // we set this to vm._watcher inside the watcher's constructor
  8496. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8497. // component's mounted hook), which relies on vm._watcher being already defined
  8498. new Watcher(vm, updateComponent, noop, {
  8499. before: function before() {
  8500. if (vm._isMounted && !vm._isDestroyed) {
  8501. callHook(vm, 'beforeUpdate');
  8502. }
  8503. }
  8504. }, true /* isRenderWatcher */);
  8505. hydrating = false;
  8506. return vm
  8507. }
  8508. /* */
  8509. function renderClass (
  8510. staticClass,
  8511. dynamicClass
  8512. ) {
  8513. if (isDef(staticClass) || isDef(dynamicClass)) {
  8514. return concat(staticClass, stringifyClass(dynamicClass))
  8515. }
  8516. /* istanbul ignore next */
  8517. return ''
  8518. }
  8519. function concat (a, b) {
  8520. return a ? b ? (a + ' ' + b) : a : (b || '')
  8521. }
  8522. function stringifyClass (value) {
  8523. if (Array.isArray(value)) {
  8524. return stringifyArray(value)
  8525. }
  8526. if (isObject(value)) {
  8527. return stringifyObject(value)
  8528. }
  8529. if (typeof value === 'string') {
  8530. return value
  8531. }
  8532. /* istanbul ignore next */
  8533. return ''
  8534. }
  8535. function stringifyArray (value) {
  8536. var res = '';
  8537. var stringified;
  8538. for (var i = 0, l = value.length; i < l; i++) {
  8539. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8540. if (res) { res += ' '; }
  8541. res += stringified;
  8542. }
  8543. }
  8544. return res
  8545. }
  8546. function stringifyObject (value) {
  8547. var res = '';
  8548. for (var key in value) {
  8549. if (value[key]) {
  8550. if (res) { res += ' '; }
  8551. res += key;
  8552. }
  8553. }
  8554. return res
  8555. }
  8556. /* */
  8557. var parseStyleText = cached(function (cssText) {
  8558. var res = {};
  8559. var listDelimiter = /;(?![^(]*\))/g;
  8560. var propertyDelimiter = /:(.+)/;
  8561. cssText.split(listDelimiter).forEach(function (item) {
  8562. if (item) {
  8563. var tmp = item.split(propertyDelimiter);
  8564. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8565. }
  8566. });
  8567. return res
  8568. });
  8569. // normalize possible array / string values into Object
  8570. function normalizeStyleBinding (bindingStyle) {
  8571. if (Array.isArray(bindingStyle)) {
  8572. return toObject(bindingStyle)
  8573. }
  8574. if (typeof bindingStyle === 'string') {
  8575. return parseStyleText(bindingStyle)
  8576. }
  8577. return bindingStyle
  8578. }
  8579. /* */
  8580. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8581. function getTarget(obj, path) {
  8582. var parts = path.split('.');
  8583. var key = parts[0];
  8584. if (key.indexOf('__$n') === 0) { //number index
  8585. key = parseInt(key.replace('__$n', ''));
  8586. }
  8587. if (parts.length === 1) {
  8588. return obj[key]
  8589. }
  8590. return getTarget(obj[key], parts.slice(1).join('.'))
  8591. }
  8592. function internalMixin(Vue) {
  8593. Vue.config.errorHandler = function(err, vm, info) {
  8594. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8595. console.error(err);
  8596. /* eslint-disable no-undef */
  8597. var app = typeof getApp === 'function' && getApp();
  8598. if (app && app.onError) {
  8599. app.onError(err);
  8600. }
  8601. };
  8602. var oldEmit = Vue.prototype.$emit;
  8603. Vue.prototype.$emit = function(event) {
  8604. if (this.$scope && event) {
  8605. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8606. if (triggerEvent) {
  8607. try {
  8608. triggerEvent.call(this.$scope, event, {
  8609. __args__: toArray(arguments, 1)
  8610. });
  8611. } catch (error) {
  8612. }
  8613. }
  8614. }
  8615. return oldEmit.apply(this, arguments)
  8616. };
  8617. Vue.prototype.$nextTick = function(fn) {
  8618. return nextTick$1(this, fn)
  8619. };
  8620. MP_METHODS.forEach(function (method) {
  8621. Vue.prototype[method] = function(args) {
  8622. if (this.$scope && this.$scope[method]) {
  8623. return this.$scope[method](args)
  8624. }
  8625. // mp-alipay
  8626. if (typeof my === 'undefined') {
  8627. return
  8628. }
  8629. if (method === 'createSelectorQuery') {
  8630. /* eslint-disable no-undef */
  8631. return my.createSelectorQuery(args)
  8632. } else if (method === 'createIntersectionObserver') {
  8633. /* eslint-disable no-undef */
  8634. return my.createIntersectionObserver(args)
  8635. }
  8636. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8637. };
  8638. });
  8639. Vue.prototype.__init_provide = initProvide;
  8640. Vue.prototype.__init_injections = initInjections;
  8641. Vue.prototype.__call_hook = function(hook, args) {
  8642. var vm = this;
  8643. // #7573 disable dep collection when invoking lifecycle hooks
  8644. pushTarget();
  8645. var handlers = vm.$options[hook];
  8646. var info = hook + " hook";
  8647. var ret;
  8648. if (handlers) {
  8649. for (var i = 0, j = handlers.length; i < j; i++) {
  8650. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8651. }
  8652. }
  8653. if (vm._hasHookEvent) {
  8654. vm.$emit('hook:' + hook, args);
  8655. }
  8656. popTarget();
  8657. return ret
  8658. };
  8659. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8660. if (Array.isArray(modifiers)) {
  8661. if (modifiers.indexOf('trim') !== -1) {
  8662. value = value.trim();
  8663. }
  8664. if (modifiers.indexOf('number') !== -1) {
  8665. value = this._n(value);
  8666. }
  8667. }
  8668. if (!target) {
  8669. target = this;
  8670. }
  8671. // 解决动态属性添加
  8672. Vue.set(target, key, value);
  8673. };
  8674. Vue.prototype.__set_sync = function(target, key, value) {
  8675. if (!target) {
  8676. target = this;
  8677. }
  8678. // 解决动态属性添加
  8679. Vue.set(target, key, value);
  8680. };
  8681. Vue.prototype.__get_orig = function(item) {
  8682. if (isPlainObject(item)) {
  8683. return item['$orig'] || item
  8684. }
  8685. return item
  8686. };
  8687. Vue.prototype.__get_value = function(dataPath, target) {
  8688. return getTarget(target || this, dataPath)
  8689. };
  8690. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8691. return renderClass(staticClass, dynamicClass)
  8692. };
  8693. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8694. if (!dynamicStyle && !staticStyle) {
  8695. return ''
  8696. }
  8697. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8698. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8699. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8700. };
  8701. Vue.prototype.__map = function(val, iteratee) {
  8702. //TODO 暂不考虑 string
  8703. var ret, i, l, keys, key;
  8704. if (Array.isArray(val)) {
  8705. ret = new Array(val.length);
  8706. for (i = 0, l = val.length; i < l; i++) {
  8707. ret[i] = iteratee(val[i], i);
  8708. }
  8709. return ret
  8710. } else if (isObject(val)) {
  8711. keys = Object.keys(val);
  8712. ret = Object.create(null);
  8713. for (i = 0, l = keys.length; i < l; i++) {
  8714. key = keys[i];
  8715. ret[key] = iteratee(val[key], key, i);
  8716. }
  8717. return ret
  8718. } else if (typeof val === 'number') {
  8719. ret = new Array(val);
  8720. for (i = 0, l = val; i < l; i++) {
  8721. // 第一个参数暂时仍和小程序一致
  8722. ret[i] = iteratee(i, i);
  8723. }
  8724. return ret
  8725. }
  8726. return []
  8727. };
  8728. }
  8729. /* */
  8730. var LIFECYCLE_HOOKS$1 = [
  8731. //App
  8732. 'onLaunch',
  8733. 'onShow',
  8734. 'onHide',
  8735. 'onUniNViewMessage',
  8736. 'onPageNotFound',
  8737. 'onThemeChange',
  8738. 'onError',
  8739. 'onUnhandledRejection',
  8740. //Page
  8741. 'onInit',
  8742. 'onLoad',
  8743. // 'onShow',
  8744. 'onReady',
  8745. // 'onHide',
  8746. 'onUnload',
  8747. 'onPullDownRefresh',
  8748. 'onReachBottom',
  8749. 'onTabItemTap',
  8750. 'onAddToFavorites',
  8751. 'onShareTimeline',
  8752. 'onShareAppMessage',
  8753. 'onResize',
  8754. 'onPageScroll',
  8755. 'onNavigationBarButtonTap',
  8756. 'onBackPress',
  8757. 'onNavigationBarSearchInputChanged',
  8758. 'onNavigationBarSearchInputConfirmed',
  8759. 'onNavigationBarSearchInputClicked',
  8760. 'onUploadDouyinVideo',
  8761. 'onNFCReadMessage',
  8762. //Component
  8763. // 'onReady', // 兼容旧版本,应该移除该事件
  8764. 'onPageShow',
  8765. 'onPageHide',
  8766. 'onPageResize'
  8767. ];
  8768. function lifecycleMixin$1(Vue) {
  8769. //fixed vue-class-component
  8770. var oldExtend = Vue.extend;
  8771. Vue.extend = function(extendOptions) {
  8772. extendOptions = extendOptions || {};
  8773. var methods = extendOptions.methods;
  8774. if (methods) {
  8775. Object.keys(methods).forEach(function (methodName) {
  8776. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8777. extendOptions[methodName] = methods[methodName];
  8778. delete methods[methodName];
  8779. }
  8780. });
  8781. }
  8782. return oldExtend.call(this, extendOptions)
  8783. };
  8784. var strategies = Vue.config.optionMergeStrategies;
  8785. var mergeHook = strategies.created;
  8786. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8787. strategies[hook] = mergeHook;
  8788. });
  8789. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8790. }
  8791. /* */
  8792. // install platform patch function
  8793. Vue.prototype.__patch__ = patch;
  8794. // public mount method
  8795. Vue.prototype.$mount = function(
  8796. el ,
  8797. hydrating
  8798. ) {
  8799. return mountComponent$1(this, el, hydrating)
  8800. };
  8801. lifecycleMixin$1(Vue);
  8802. internalMixin(Vue);
  8803. /* */
  8804. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8805. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8806. /***/ }),
  8807. /***/ 253:
  8808. /*!************************************************************************!*\
  8809. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js ***!
  8810. \************************************************************************/
  8811. /*! no static exports found */
  8812. /***/ (function(module, exports, __webpack_require__) {
  8813. "use strict";
  8814. Object.defineProperty(exports, "__esModule", {
  8815. value: true
  8816. });
  8817. exports.default = void 0;
  8818. var _default = {
  8819. // 将自定义节点设置成虚拟的(去掉自定义组件包裹层),更加接近Vue组件的表现,能更好的使用flex属性
  8820. options: {
  8821. virtualHost: true
  8822. }
  8823. };
  8824. exports.default = _default;
  8825. /***/ }),
  8826. /***/ 254:
  8827. /*!**********************************************************************!*\
  8828. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/mixin/mixin.js ***!
  8829. \**********************************************************************/
  8830. /*! no static exports found */
  8831. /***/ (function(module, exports, __webpack_require__) {
  8832. "use strict";
  8833. /* WEBPACK VAR INJECTION */(function(uni) {
  8834. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8835. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  8836. Object.defineProperty(exports, "__esModule", {
  8837. value: true
  8838. });
  8839. exports.default = void 0;
  8840. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  8841. var index = _interopRequireWildcard(__webpack_require__(/*! ../function/index.js */ 255));
  8842. var test = _interopRequireWildcard(__webpack_require__(/*! ../function/test.js */ 256));
  8843. var _route = _interopRequireDefault(__webpack_require__(/*! ../util/route.js */ 259));
  8844. var _debounce = _interopRequireDefault(__webpack_require__(/*! ../function/debounce.js */ 260));
  8845. var _throttle = _interopRequireDefault(__webpack_require__(/*! ../function/throttle.js */ 261));
  8846. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  8847. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  8848. 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; }
  8849. 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; }
  8850. var _default2 = {
  8851. // 定义每个组件都可能需要用到的外部样式以及类名
  8852. props: {
  8853. // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
  8854. customStyle: {
  8855. type: [Object, String],
  8856. default: function _default() {
  8857. return {};
  8858. }
  8859. },
  8860. customClass: {
  8861. type: String,
  8862. default: ''
  8863. },
  8864. // 跳转的页面路径
  8865. url: {
  8866. type: String,
  8867. default: ''
  8868. },
  8869. // 页面跳转的类型
  8870. linkType: {
  8871. type: String,
  8872. default: 'navigateTo'
  8873. }
  8874. },
  8875. data: function data() {
  8876. return {};
  8877. },
  8878. onLoad: function onLoad() {
  8879. // getRect挂载到$uv上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  8880. this.$uv.getRect = this.$uvGetRect;
  8881. },
  8882. created: function created() {
  8883. // 组件当中,只有created声明周期,为了能在组件使用,故也在created中将方法挂载到$uv
  8884. this.$uv.getRect = this.$uvGetRect;
  8885. },
  8886. computed: {
  8887. $uv: function $uv() {
  8888. var _uni, _uni$$uv, _uni$$uv$config;
  8889. return _objectSpread(_objectSpread({}, index), {}, {
  8890. test: test,
  8891. route: _route.default,
  8892. debounce: _debounce.default,
  8893. throttle: _throttle.default,
  8894. unit: (_uni = uni) === null || _uni === void 0 ? void 0 : (_uni$$uv = _uni.$uv) === null || _uni$$uv === void 0 ? void 0 : (_uni$$uv$config = _uni$$uv.config) === null || _uni$$uv$config === void 0 ? void 0 : _uni$$uv$config.unit
  8895. });
  8896. },
  8897. /**
  8898. * 生成bem规则类名
  8899. * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
  8900. * 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
  8901. * @param {String} name 组件名称
  8902. * @param {Array} fixed 一直会存在的类名
  8903. * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
  8904. * @returns {Array|string}
  8905. */
  8906. bem: function bem() {
  8907. return function (name, fixed, change) {
  8908. var _this = this;
  8909. // 类名前缀
  8910. var prefix = "uv-".concat(name, "--");
  8911. var classes = {};
  8912. if (fixed) {
  8913. fixed.map(function (item) {
  8914. // 这里的类名,会一直存在
  8915. classes[prefix + _this[item]] = true;
  8916. });
  8917. }
  8918. if (change) {
  8919. change.map(function (item) {
  8920. // 这里的类名,会根据this[item]的值为true或者false,而进行添加或者移除某一个类
  8921. _this[item] ? classes[prefix + item] = _this[item] : delete classes[prefix + item];
  8922. });
  8923. }
  8924. return Object.keys(classes);
  8925. // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
  8926. };
  8927. }
  8928. },
  8929. methods: {
  8930. // 跳转某一个页面
  8931. openPage: function openPage() {
  8932. var urlKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'url';
  8933. var url = this[urlKey];
  8934. if (url) {
  8935. // 执行类似uni.navigateTo的方法
  8936. uni[this.linkType]({
  8937. url: url
  8938. });
  8939. }
  8940. },
  8941. // 查询节点信息
  8942. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  8943. // 解决办法为在组件根部再套一个没有任何作用的view元素
  8944. $uvGetRect: function $uvGetRect(selector, all) {
  8945. var _this2 = this;
  8946. return new Promise(function (resolve) {
  8947. uni.createSelectorQuery().in(_this2)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  8948. if (all && Array.isArray(rect) && rect.length) {
  8949. resolve(rect);
  8950. }
  8951. if (!all && rect) {
  8952. resolve(rect);
  8953. }
  8954. }).exec();
  8955. });
  8956. },
  8957. getParentData: function getParentData() {
  8958. var _this3 = this;
  8959. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  8960. // 避免在created中去定义parent变量
  8961. if (!this.parent) this.parent = {};
  8962. // 这里的本质原理是,通过获取父组件实例(也即类似uv-radio的父组件uv-radio-group的this)
  8963. // 将父组件this中对应的参数,赋值给本组件(uv-radio的this)的parentData对象中对应的属性
  8964. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  8965. // 此处并不会自动更新子组件的数据,而是依赖父组件uv-radio-group去监听data的变化,手动调用更新子组件的方法去重新获取
  8966. this.parent = this.$uv.$parent.call(this, parentName);
  8967. if (this.parent.children) {
  8968. // 如果父组件的children不存在本组件的实例,才将本实例添加到父组件的children中
  8969. this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
  8970. }
  8971. if (this.parent && this.parentData) {
  8972. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  8973. Object.keys(this.parentData).map(function (key) {
  8974. _this3.parentData[key] = _this3.parent[key];
  8975. });
  8976. }
  8977. },
  8978. // 阻止事件冒泡
  8979. preventEvent: function preventEvent(e) {
  8980. e && typeof e.stopPropagation === 'function' && e.stopPropagation();
  8981. },
  8982. // 空操作
  8983. noop: function noop(e) {
  8984. this.preventEvent(e);
  8985. }
  8986. },
  8987. onReachBottom: function onReachBottom() {
  8988. uni.$emit('uvOnReachBottom');
  8989. },
  8990. beforeDestroy: function beforeDestroy() {
  8991. var _this4 = this;
  8992. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  8993. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  8994. if (this.parent && test.array(this.parent.children)) {
  8995. // 组件销毁时,移除父组件中的children数组中对应的实例
  8996. var childrenList = this.parent.children;
  8997. childrenList.map(function (child, index) {
  8998. // 如果相等,则移除
  8999. if (child === _this4) {
  9000. childrenList.splice(index, 1);
  9001. }
  9002. });
  9003. }
  9004. },
  9005. // 兼容vue3
  9006. unmounted: function unmounted() {
  9007. var _this5 = this;
  9008. if (this.parent && test.array(this.parent.children)) {
  9009. // 组件销毁时,移除父组件中的children数组中对应的实例
  9010. var childrenList = this.parent.children;
  9011. childrenList.map(function (child, index) {
  9012. // 如果相等,则移除
  9013. if (child === _this5) {
  9014. childrenList.splice(index, 1);
  9015. }
  9016. });
  9017. }
  9018. }
  9019. };
  9020. exports.default = _default2;
  9021. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9022. /***/ }),
  9023. /***/ 255:
  9024. /*!*************************************************************************!*\
  9025. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/function/index.js ***!
  9026. \*************************************************************************/
  9027. /*! no static exports found */
  9028. /***/ (function(module, exports, __webpack_require__) {
  9029. "use strict";
  9030. /* WEBPACK VAR INJECTION */(function(uni) {
  9031. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9032. Object.defineProperty(exports, "__esModule", {
  9033. value: true
  9034. });
  9035. exports.$parent = $parent;
  9036. exports.addStyle = addStyle;
  9037. exports.addUnit = addUnit;
  9038. exports.deepClone = deepClone;
  9039. exports.deepMerge = deepMerge;
  9040. exports.error = error;
  9041. exports.formValidate = formValidate;
  9042. exports.getDuration = getDuration;
  9043. exports.getHistoryPage = getHistoryPage;
  9044. exports.getProperty = getProperty;
  9045. exports.getPx = getPx;
  9046. exports.guid = guid;
  9047. exports.os = os;
  9048. exports.padZero = padZero;
  9049. exports.page = page;
  9050. exports.pages = pages;
  9051. exports.priceFormat = priceFormat;
  9052. exports.queryParams = queryParams;
  9053. exports.random = random;
  9054. exports.randomArray = randomArray;
  9055. exports.range = range;
  9056. exports.setConfig = setConfig;
  9057. exports.setProperty = setProperty;
  9058. exports.sleep = sleep;
  9059. exports.sys = sys;
  9060. exports.timeFormat = timeFormat;
  9061. exports.timeFrom = timeFrom;
  9062. exports.toast = toast;
  9063. exports.trim = trim;
  9064. exports.type2icon = type2icon;
  9065. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9066. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9067. var _test = __webpack_require__(/*! ./test.js */ 256);
  9068. var _digit = __webpack_require__(/*! ./digit.js */ 257);
  9069. /**
  9070. * @description 如果value小于min,取min;如果value大于max,取max
  9071. * @param {number} min
  9072. * @param {number} max
  9073. * @param {number} value
  9074. */
  9075. function range() {
  9076. var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  9077. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9078. var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  9079. return Math.max(min, Math.min(max, Number(value)));
  9080. }
  9081. /**
  9082. * @description 用于获取用户传递值的px值 如果用户传递了"xxpx"或者"xxrpx",取出其数值部分,如果是"xxxrpx"还需要用过uni.upx2px进行转换
  9083. * @param {number|string} value 用户传递值的px值
  9084. * @param {boolean} unit
  9085. * @returns {number|string}
  9086. */
  9087. function getPx(value) {
  9088. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9089. if ((0, _test.number)(value)) {
  9090. return unit ? "".concat(value, "px") : Number(value);
  9091. }
  9092. // 如果带有rpx,先取出其数值部分,再转为px值
  9093. if (/(rpx|upx)$/.test(value)) {
  9094. return unit ? "".concat(uni.upx2px(parseInt(value)), "px") : Number(uni.upx2px(parseInt(value)));
  9095. }
  9096. return unit ? "".concat(parseInt(value), "px") : parseInt(value);
  9097. }
  9098. /**
  9099. * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$uv.sleep(20)将会阻塞20ms
  9100. * @param {number} value 堵塞时间 单位ms 毫秒
  9101. * @returns {Promise} 返回promise
  9102. */
  9103. function sleep() {
  9104. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;
  9105. return new Promise(function (resolve) {
  9106. setTimeout(function () {
  9107. resolve();
  9108. }, value);
  9109. });
  9110. }
  9111. /**
  9112. * @description 运行期判断平台
  9113. * @returns {string} 返回所在平台(小写)
  9114. * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
  9115. */
  9116. function os() {
  9117. return uni.getSystemInfoSync().platform.toLowerCase();
  9118. }
  9119. /**
  9120. * @description 获取系统信息同步接口
  9121. * @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
  9122. */
  9123. function sys() {
  9124. return uni.getSystemInfoSync();
  9125. }
  9126. /**
  9127. * @description 取一个区间数
  9128. * @param {Number} min 最小值
  9129. * @param {Number} max 最大值
  9130. */
  9131. function random(min, max) {
  9132. if (min >= 0 && max > 0 && max >= min) {
  9133. var gab = max - min + 1;
  9134. return Math.floor(Math.random() * gab + min);
  9135. }
  9136. return 0;
  9137. }
  9138. /**
  9139. * @param {Number} len uuid的长度
  9140. * @param {Boolean} firstU 将返回的首字母置为"u"
  9141. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  9142. */
  9143. function guid() {
  9144. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  9145. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9146. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  9147. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  9148. var uuid = [];
  9149. radix = radix || chars.length;
  9150. if (len) {
  9151. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  9152. for (var i = 0; i < len; i++) {
  9153. uuid[i] = chars[0 | Math.random() * radix];
  9154. }
  9155. } else {
  9156. var r;
  9157. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  9158. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  9159. uuid[14] = '4';
  9160. for (var _i = 0; _i < 36; _i++) {
  9161. if (!uuid[_i]) {
  9162. r = 0 | Math.random() * 16;
  9163. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  9164. }
  9165. }
  9166. }
  9167. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  9168. if (firstU) {
  9169. uuid.shift();
  9170. return "u".concat(uuid.join(''));
  9171. }
  9172. return uuid.join('');
  9173. }
  9174. /**
  9175. * @description 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9176. this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9177. 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  9178. 值(默认为undefined),就是查找最顶层的$parent
  9179. * @param {string|undefined} name 父组件的参数名
  9180. */
  9181. function $parent() {
  9182. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  9183. var parent = this.$parent;
  9184. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9185. while (parent) {
  9186. // 父组件
  9187. if (parent.$options && parent.$options.name !== name) {
  9188. // 如果组件的name不相等,继续上一级寻找
  9189. parent = parent.$parent;
  9190. } else {
  9191. return parent;
  9192. }
  9193. }
  9194. return false;
  9195. }
  9196. /**
  9197. * @description 样式转换
  9198. * 对象转字符串,或者字符串转对象
  9199. * @param {object | string} customStyle 需要转换的目标
  9200. * @param {String} target 转换的目的,object-转为对象,string-转为字符串
  9201. * @returns {object|string}
  9202. */
  9203. function addStyle(customStyle) {
  9204. var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'object';
  9205. // 字符串转字符串,对象转对象情形,直接返回
  9206. if ((0, _test.empty)(customStyle) || (0, _typeof2.default)(customStyle) === 'object' && target === 'object' || target === 'string' && typeof customStyle === 'string') {
  9207. return customStyle;
  9208. }
  9209. // 字符串转对象
  9210. if (target === 'object') {
  9211. // 去除字符串样式中的两端空格(中间的空格不能去掉,比如padding: 20px 0如果去掉了就错了),空格是无用的
  9212. customStyle = trim(customStyle);
  9213. // 根据";"将字符串转为数组形式
  9214. var styleArray = customStyle.split(';');
  9215. var style = {};
  9216. // 历遍数组,拼接成对象
  9217. for (var i = 0; i < styleArray.length; i++) {
  9218. // 'font-size:20px;color:red;',如此最后字符串有";"的话,会导致styleArray最后一个元素为空字符串,这里需要过滤
  9219. if (styleArray[i]) {
  9220. var item = styleArray[i].split(':');
  9221. style[trim(item[0])] = trim(item[1]);
  9222. }
  9223. }
  9224. return style;
  9225. }
  9226. // 这里为对象转字符串形式
  9227. var string = '';
  9228. for (var _i2 in customStyle) {
  9229. // 驼峰转为中划线的形式,否则css内联样式,无法识别驼峰样式属性名
  9230. var key = _i2.replace(/([A-Z])/g, '-$1').toLowerCase();
  9231. string += "".concat(key, ":").concat(customStyle[_i2], ";");
  9232. }
  9233. // 去除两端空格
  9234. return trim(string);
  9235. }
  9236. /**
  9237. * @description 添加单位,如果有rpx,upx,%,px等单位结尾或者值为auto,直接返回,否则加上px单位结尾
  9238. * @param {string|number} value 需要添加单位的值
  9239. * @param {string} unit 添加的单位名 比如px
  9240. */
  9241. function addUnit() {
  9242. var _uni, _uni$$uv, _uni$$uv$config, _uni2, _uni2$$uv, _uni2$$uv$config;
  9243. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  9244. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_uni = uni) !== null && _uni !== void 0 && (_uni$$uv = _uni.$uv) !== null && _uni$$uv !== void 0 && (_uni$$uv$config = _uni$$uv.config) !== null && _uni$$uv$config !== void 0 && _uni$$uv$config.unit ? (_uni2 = uni) === null || _uni2 === void 0 ? void 0 : (_uni2$$uv = _uni2.$uv) === null || _uni2$$uv === void 0 ? void 0 : (_uni2$$uv$config = _uni2$$uv.config) === null || _uni2$$uv$config === void 0 ? void 0 : _uni2$$uv$config.unit : 'px';
  9245. value = String(value);
  9246. // 用uvui内置验证规则中的number判断是否为数值
  9247. return (0, _test.number)(value) ? "".concat(value).concat(unit) : value;
  9248. }
  9249. /**
  9250. * @description 深度克隆
  9251. * @param {object} obj 需要深度克隆的对象
  9252. * @param cache 缓存
  9253. * @returns {*} 克隆后的对象或者原值(不是对象)
  9254. */
  9255. function deepClone(obj) {
  9256. var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakMap();
  9257. if (obj === null || (0, _typeof2.default)(obj) !== 'object') return obj;
  9258. if (cache.has(obj)) return cache.get(obj);
  9259. var clone;
  9260. if (obj instanceof Date) {
  9261. clone = new Date(obj.getTime());
  9262. } else if (obj instanceof RegExp) {
  9263. clone = new RegExp(obj);
  9264. } else if (obj instanceof Map) {
  9265. clone = new Map(Array.from(obj, function (_ref) {
  9266. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  9267. key = _ref2[0],
  9268. value = _ref2[1];
  9269. return [key, deepClone(value, cache)];
  9270. }));
  9271. } else if (obj instanceof Set) {
  9272. clone = new Set(Array.from(obj, function (value) {
  9273. return deepClone(value, cache);
  9274. }));
  9275. } else if (Array.isArray(obj)) {
  9276. clone = obj.map(function (value) {
  9277. return deepClone(value, cache);
  9278. });
  9279. } else if (Object.prototype.toString.call(obj) === '[object Object]') {
  9280. clone = Object.create(Object.getPrototypeOf(obj));
  9281. cache.set(obj, clone);
  9282. for (var _i3 = 0, _Object$entries = Object.entries(obj); _i3 < _Object$entries.length; _i3++) {
  9283. var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i3], 2),
  9284. key = _Object$entries$_i[0],
  9285. value = _Object$entries$_i[1];
  9286. clone[key] = deepClone(value, cache);
  9287. }
  9288. } else {
  9289. clone = Object.assign({}, obj);
  9290. }
  9291. cache.set(obj, clone);
  9292. return clone;
  9293. }
  9294. /**
  9295. * @description JS对象深度合并
  9296. * @param {object} target 需要拷贝的对象
  9297. * @param {object} source 拷贝的来源对象
  9298. * @returns {object|boolean} 深度合并后的对象或者false(入参有不是对象)
  9299. */
  9300. function deepMerge() {
  9301. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9302. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9303. target = deepClone(target);
  9304. if ((0, _typeof2.default)(target) !== 'object' || target === null || (0, _typeof2.default)(source) !== 'object' || source === null) return target;
  9305. var merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
  9306. for (var prop in source) {
  9307. if (!source.hasOwnProperty(prop)) continue;
  9308. var sourceValue = source[prop];
  9309. var targetValue = merged[prop];
  9310. if (sourceValue instanceof Date) {
  9311. merged[prop] = new Date(sourceValue);
  9312. } else if (sourceValue instanceof RegExp) {
  9313. merged[prop] = new RegExp(sourceValue);
  9314. } else if (sourceValue instanceof Map) {
  9315. merged[prop] = new Map(sourceValue);
  9316. } else if (sourceValue instanceof Set) {
  9317. merged[prop] = new Set(sourceValue);
  9318. } else if ((0, _typeof2.default)(sourceValue) === 'object' && sourceValue !== null) {
  9319. merged[prop] = deepMerge(targetValue, sourceValue);
  9320. } else {
  9321. merged[prop] = sourceValue;
  9322. }
  9323. }
  9324. return merged;
  9325. }
  9326. /**
  9327. * @description error提示
  9328. * @param {*} err 错误内容
  9329. */
  9330. function error(err) {
  9331. // 开发环境才提示,生产环境不会提示
  9332. if (true) {
  9333. console.error("uvui\u63D0\u793A\uFF1A".concat(err));
  9334. }
  9335. }
  9336. /**
  9337. * @description 打乱数组
  9338. * @param {array} array 需要打乱的数组
  9339. * @returns {array} 打乱后的数组
  9340. */
  9341. function randomArray() {
  9342. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9343. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  9344. return array.sort(function () {
  9345. return Math.random() - 0.5;
  9346. });
  9347. }
  9348. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  9349. // 所以这里做一个兼容polyfill的兼容处理
  9350. if (!String.prototype.padStart) {
  9351. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  9352. String.prototype.padStart = function (maxLength) {
  9353. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  9354. if (Object.prototype.toString.call(fillString) !== '[object String]') {
  9355. throw new TypeError('fillString must be String');
  9356. }
  9357. var str = this;
  9358. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  9359. if (str.length >= maxLength) return String(str);
  9360. var fillLength = maxLength - str.length;
  9361. var times = Math.ceil(fillLength / fillString.length);
  9362. while (times >>= 1) {
  9363. fillString += fillString;
  9364. if (times === 1) {
  9365. fillString += fillString;
  9366. }
  9367. }
  9368. return fillString.slice(0, fillLength) + str;
  9369. };
  9370. }
  9371. /**
  9372. * @description 格式化时间
  9373. * @param {String|Number} dateTime 需要格式化的时间戳
  9374. * @param {String} fmt 格式化规则 yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 默认yyyy-mm-dd
  9375. * @returns {string} 返回格式化后的字符串
  9376. */
  9377. function timeFormat() {
  9378. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  9379. var formatStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9380. var date;
  9381. // 若传入时间为假值,则取当前时间
  9382. if (!dateTime) {
  9383. date = new Date();
  9384. }
  9385. // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容)
  9386. else if (/^\d{10}$/.test(dateTime === null || dateTime === void 0 ? void 0 : dateTime.toString().trim())) {
  9387. date = new Date(dateTime * 1000);
  9388. }
  9389. // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容
  9390. else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
  9391. date = new Date(Number(dateTime));
  9392. }
  9393. // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间
  9394. // 处理 '2022-07-10 01:02:03',跳过 '2022-07-10T01:02:03'
  9395. else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) {
  9396. date = new Date(dateTime.replace(/-/g, '/'));
  9397. }
  9398. // 其他都认为符合 RFC 2822 规范
  9399. else {
  9400. date = new Date(dateTime);
  9401. }
  9402. var timeSource = {
  9403. 'y': date.getFullYear().toString(),
  9404. // 年
  9405. 'm': (date.getMonth() + 1).toString().padStart(2, '0'),
  9406. // 月
  9407. 'd': date.getDate().toString().padStart(2, '0'),
  9408. // 日
  9409. 'h': date.getHours().toString().padStart(2, '0'),
  9410. // 时
  9411. 'M': date.getMinutes().toString().padStart(2, '0'),
  9412. // 分
  9413. 's': date.getSeconds().toString().padStart(2, '0') // 秒
  9414. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  9415. };
  9416. for (var key in timeSource) {
  9417. var _ref3 = new RegExp("".concat(key, "+")).exec(formatStr) || [],
  9418. _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
  9419. ret = _ref4[0];
  9420. if (ret) {
  9421. // 年可能只需展示两位
  9422. var beginIndex = key === 'y' && ret.length === 2 ? 2 : 0;
  9423. formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
  9424. }
  9425. }
  9426. return formatStr;
  9427. }
  9428. /**
  9429. * @description 时间戳转为多久之前
  9430. * @param {String|Number} timestamp 时间戳
  9431. * @param {String|Boolean} format
  9432. * 格式化规则如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  9433. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  9434. * @returns {string} 转化后的内容
  9435. */
  9436. function timeFrom() {
  9437. var timestamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  9438. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9439. if (timestamp == null) timestamp = Number(new Date());
  9440. timestamp = parseInt(timestamp);
  9441. // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
  9442. if (timestamp.toString().length == 10) timestamp *= 1000;
  9443. var timer = new Date().getTime() - timestamp;
  9444. timer = parseInt(timer / 1000);
  9445. // 如果小于5分钟,则返回"刚刚",其他以此类推
  9446. var tips = '';
  9447. switch (true) {
  9448. case timer < 300:
  9449. tips = '刚刚';
  9450. break;
  9451. case timer >= 300 && timer < 3600:
  9452. tips = "".concat(parseInt(timer / 60), "\u5206\u949F\u524D");
  9453. break;
  9454. case timer >= 3600 && timer < 86400:
  9455. tips = "".concat(parseInt(timer / 3600), "\u5C0F\u65F6\u524D");
  9456. break;
  9457. case timer >= 86400 && timer < 2592000:
  9458. tips = "".concat(parseInt(timer / 86400), "\u5929\u524D");
  9459. break;
  9460. default:
  9461. // 如果format为false,则无论什么时间戳,都显示xx之前
  9462. if (format === false) {
  9463. if (timer >= 2592000 && timer < 365 * 86400) {
  9464. tips = "".concat(parseInt(timer / (86400 * 30)), "\u4E2A\u6708\u524D");
  9465. } else {
  9466. tips = "".concat(parseInt(timer / (86400 * 365)), "\u5E74\u524D");
  9467. }
  9468. } else {
  9469. tips = timeFormat(timestamp, format);
  9470. }
  9471. }
  9472. return tips;
  9473. }
  9474. /**
  9475. * @description 去除空格
  9476. * @param String str 需要去除空格的字符串
  9477. * @param String pos both(左右)|left|right|all 默认both
  9478. */
  9479. function trim(str) {
  9480. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  9481. str = String(str);
  9482. if (pos == 'both') {
  9483. return str.replace(/^\s+|\s+$/g, '');
  9484. }
  9485. if (pos == 'left') {
  9486. return str.replace(/^\s*/, '');
  9487. }
  9488. if (pos == 'right') {
  9489. return str.replace(/(\s*$)/g, '');
  9490. }
  9491. if (pos == 'all') {
  9492. return str.replace(/\s+/g, '');
  9493. }
  9494. return str;
  9495. }
  9496. /**
  9497. * @description 对象转url参数
  9498. * @param {object} data,对象
  9499. * @param {Boolean} isPrefix,是否自动加上"?"
  9500. * @param {string} arrayFormat 规则 indices|brackets|repeat|comma
  9501. */
  9502. function queryParams() {
  9503. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9504. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9505. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  9506. var prefix = isPrefix ? '?' : '';
  9507. var _result = [];
  9508. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  9509. var _loop = function _loop(key) {
  9510. var value = data[key];
  9511. // 去掉为空的参数
  9512. if (['', undefined, null].indexOf(value) >= 0) {
  9513. return "continue";
  9514. }
  9515. // 如果值为数组,另行处理
  9516. if (value.constructor === Array) {
  9517. // e.g. {ids: [1, 2, 3]}
  9518. switch (arrayFormat) {
  9519. case 'indices':
  9520. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  9521. for (var i = 0; i < value.length; i++) {
  9522. _result.push("".concat(key, "[").concat(i, "]=").concat(value[i]));
  9523. }
  9524. break;
  9525. case 'brackets':
  9526. // 结果: ids[]=1&ids[]=2&ids[]=3
  9527. value.forEach(function (_value) {
  9528. _result.push("".concat(key, "[]=").concat(_value));
  9529. });
  9530. break;
  9531. case 'repeat':
  9532. // 结果: ids=1&ids=2&ids=3
  9533. value.forEach(function (_value) {
  9534. _result.push("".concat(key, "=").concat(_value));
  9535. });
  9536. break;
  9537. case 'comma':
  9538. // 结果: ids=1,2,3
  9539. var commaStr = '';
  9540. value.forEach(function (_value) {
  9541. commaStr += (commaStr ? ',' : '') + _value;
  9542. });
  9543. _result.push("".concat(key, "=").concat(commaStr));
  9544. break;
  9545. default:
  9546. value.forEach(function (_value) {
  9547. _result.push("".concat(key, "[]=").concat(_value));
  9548. });
  9549. }
  9550. } else {
  9551. _result.push("".concat(key, "=").concat(value));
  9552. }
  9553. };
  9554. for (var key in data) {
  9555. var _ret = _loop(key);
  9556. if (_ret === "continue") continue;
  9557. }
  9558. return _result.length ? prefix + _result.join('&') : '';
  9559. }
  9560. /**
  9561. * 显示消息提示框
  9562. * @param {String} title 提示的内容,长度与 icon 取值有关。
  9563. * @param {Number} duration 提示的延迟时间,单位毫秒,默认:2000
  9564. */
  9565. function toast(title) {
  9566. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
  9567. uni.showToast({
  9568. title: String(title),
  9569. icon: 'none',
  9570. duration: duration
  9571. });
  9572. }
  9573. /**
  9574. * @description 根据主题type值,获取对应的图标
  9575. * @param {String} type 主题名称,primary|info|error|warning|success
  9576. * @param {boolean} fill 是否使用fill填充实体的图标
  9577. */
  9578. function type2icon() {
  9579. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  9580. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9581. // 如果非预置值,默认为success
  9582. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  9583. var iconName = '';
  9584. // 目前(2019-12-12),info和primary使用同一个图标
  9585. switch (type) {
  9586. case 'primary':
  9587. iconName = 'info-circle';
  9588. break;
  9589. case 'info':
  9590. iconName = 'info-circle';
  9591. break;
  9592. case 'error':
  9593. iconName = 'close-circle';
  9594. break;
  9595. case 'warning':
  9596. iconName = 'error-circle';
  9597. break;
  9598. case 'success':
  9599. iconName = 'checkmark-circle';
  9600. break;
  9601. default:
  9602. iconName = 'checkmark-circle';
  9603. }
  9604. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  9605. if (fill) iconName += '-fill';
  9606. return iconName;
  9607. }
  9608. /**
  9609. * @description 数字格式化
  9610. * @param {number|string} number 要格式化的数字
  9611. * @param {number} decimals 保留几位小数
  9612. * @param {string} decimalPoint 小数点符号
  9613. * @param {string} thousandsSeparator 千分位符号
  9614. * @returns {string} 格式化后的数字
  9615. */
  9616. function priceFormat(number) {
  9617. var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9618. var decimalPoint = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
  9619. var thousandsSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ',';
  9620. number = "".concat(number).replace(/[^0-9+-Ee.]/g, '');
  9621. var n = !isFinite(+number) ? 0 : +number;
  9622. var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
  9623. var sep = typeof thousandsSeparator === 'undefined' ? ',' : thousandsSeparator;
  9624. var dec = typeof decimalPoint === 'undefined' ? '.' : decimalPoint;
  9625. var s = '';
  9626. s = (prec ? (0, _digit.round)(n, prec) + '' : "".concat(Math.round(n))).split('.');
  9627. var re = /(-?\d+)(\d{3})/;
  9628. while (re.test(s[0])) {
  9629. s[0] = s[0].replace(re, "$1".concat(sep, "$2"));
  9630. }
  9631. if ((s[1] || '').length < prec) {
  9632. s[1] = s[1] || '';
  9633. s[1] += new Array(prec - s[1].length + 1).join('0');
  9634. }
  9635. return s.join(dec);
  9636. }
  9637. /**
  9638. * @description 获取duration值
  9639. * 如果带有ms或者s直接返回,如果大于一定值,认为是ms单位,小于一定值,认为是s单位
  9640. * 比如以30位阈值,那么300大于30,可以理解为用户想要的是300ms,而不是想花300s去执行一个动画
  9641. * @param {String|number} value 比如: "1s"|"100ms"|1|100
  9642. * @param {boolean} unit 提示: 如果是false 默认返回number
  9643. * @return {string|number}
  9644. */
  9645. function getDuration(value) {
  9646. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9647. var valueNum = parseInt(value);
  9648. if (unit) {
  9649. if (/s$/.test(value)) return value;
  9650. return value > 30 ? "".concat(value, "ms") : "".concat(value, "s");
  9651. }
  9652. if (/ms$/.test(value)) return valueNum;
  9653. if (/s$/.test(value)) return valueNum > 30 ? valueNum : valueNum * 1000;
  9654. return valueNum;
  9655. }
  9656. /**
  9657. * @description 日期的月或日补零操作
  9658. * @param {String} value 需要补零的值
  9659. */
  9660. function padZero(value) {
  9661. return "00".concat(value).slice(-2);
  9662. }
  9663. /**
  9664. * @description 在uv-form的子组件内容发生变化,或者失去焦点时,尝试通知uv-form执行校验方法
  9665. * @param {*} instance
  9666. * @param {*} event
  9667. */
  9668. function formValidate(instance, event) {
  9669. var formItem = $parent.call(instance, 'uv-form-item');
  9670. var form = $parent.call(instance, 'uv-form');
  9671. // 如果发生变化的input或者textarea等,其父组件中有uv-form-item或者uv-form等,就执行form的validate方法
  9672. // 同时将form-item的pros传递给form,让其进行精确对象验证
  9673. if (formItem && form) {
  9674. form.validateField(formItem.prop, function () {}, event);
  9675. }
  9676. }
  9677. /**
  9678. * @description 获取某个对象下的属性,用于通过类似'a.b.c'的形式去获取一个对象的的属性的形式
  9679. * @param {object} obj 对象
  9680. * @param {string} key 需要获取的属性字段
  9681. * @returns {*}
  9682. */
  9683. function getProperty(obj, key) {
  9684. if (!obj) {
  9685. return;
  9686. }
  9687. if (typeof key !== 'string' || key === '') {
  9688. return '';
  9689. }
  9690. if (key.indexOf('.') !== -1) {
  9691. var keys = key.split('.');
  9692. var firstObj = obj[keys[0]] || {};
  9693. for (var i = 1; i < keys.length; i++) {
  9694. if (firstObj) {
  9695. firstObj = firstObj[keys[i]];
  9696. }
  9697. }
  9698. return firstObj;
  9699. }
  9700. return obj[key];
  9701. }
  9702. /**
  9703. * @description 设置对象的属性值,如果'a.b.c'的形式进行设置
  9704. * @param {object} obj 对象
  9705. * @param {string} key 需要设置的属性
  9706. * @param {string} value 设置的值
  9707. */
  9708. function setProperty(obj, key, value) {
  9709. if (!obj) {
  9710. return;
  9711. }
  9712. // 递归赋值
  9713. var inFn = function inFn(_obj, keys, v) {
  9714. // 最后一个属性key
  9715. if (keys.length === 1) {
  9716. _obj[keys[0]] = v;
  9717. return;
  9718. }
  9719. // 0~length-1个key
  9720. while (keys.length > 1) {
  9721. var k = keys[0];
  9722. if (!_obj[k] || (0, _typeof2.default)(_obj[k]) !== 'object') {
  9723. _obj[k] = {};
  9724. }
  9725. var _key = keys.shift();
  9726. // 自调用判断是否存在属性,不存在则自动创建对象
  9727. inFn(_obj[k], keys, v);
  9728. }
  9729. };
  9730. if (typeof key !== 'string' || key === '') {} else if (key.indexOf('.') !== -1) {
  9731. // 支持多层级赋值操作
  9732. var keys = key.split('.');
  9733. inFn(obj, keys, value);
  9734. } else {
  9735. obj[key] = value;
  9736. }
  9737. }
  9738. /**
  9739. * @description 获取当前页面路径
  9740. */
  9741. function page() {
  9742. var _pages;
  9743. var pages = getCurrentPages();
  9744. var route = (_pages = pages[pages.length - 1]) === null || _pages === void 0 ? void 0 : _pages.route;
  9745. // 某些特殊情况下(比如页面进行redirectTo时的一些时机),pages可能为空数组
  9746. return "/".concat(route ? route : '');
  9747. }
  9748. /**
  9749. * @description 获取当前路由栈实例数组
  9750. */
  9751. function pages() {
  9752. var pages = getCurrentPages();
  9753. return pages;
  9754. }
  9755. /**
  9756. * 获取页面历史栈指定层实例
  9757. * @param back {number} [0] - 0或者负数,表示获取历史栈的哪一层,0表示获取当前页面实例,-1 表示获取上一个页面实例。默认0。
  9758. */
  9759. function getHistoryPage() {
  9760. var back = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  9761. var pages = getCurrentPages();
  9762. var len = pages.length;
  9763. return pages[len - 1 + back];
  9764. }
  9765. /**
  9766. * @description 修改uvui内置属性值
  9767. * @param {object} props 修改内置props属性
  9768. * @param {object} config 修改内置config属性
  9769. * @param {object} color 修改内置color属性
  9770. * @param {object} zIndex 修改内置zIndex属性
  9771. */
  9772. function setConfig(_ref5) {
  9773. var _ref5$props = _ref5.props,
  9774. props = _ref5$props === void 0 ? {} : _ref5$props,
  9775. _ref5$config = _ref5.config,
  9776. config = _ref5$config === void 0 ? {} : _ref5$config,
  9777. _ref5$color = _ref5.color,
  9778. color = _ref5$color === void 0 ? {} : _ref5$color,
  9779. _ref5$zIndex = _ref5.zIndex,
  9780. zIndex = _ref5$zIndex === void 0 ? {} : _ref5$zIndex;
  9781. var deepMerge = uni.$uv.deepMerge;
  9782. uni.$uv.config = deepMerge(uni.$uv.config, config);
  9783. uni.$uv.props = deepMerge(uni.$uv.props, props);
  9784. uni.$uv.color = deepMerge(uni.$uv.color, color);
  9785. uni.$uv.zIndex = deepMerge(uni.$uv.zIndex, zIndex);
  9786. }
  9787. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9788. /***/ }),
  9789. /***/ 256:
  9790. /*!************************************************************************!*\
  9791. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/function/test.js ***!
  9792. \************************************************************************/
  9793. /*! no static exports found */
  9794. /***/ (function(module, exports, __webpack_require__) {
  9795. "use strict";
  9796. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9797. Object.defineProperty(exports, "__esModule", {
  9798. value: true
  9799. });
  9800. exports.amount = amount;
  9801. exports.array = array;
  9802. exports.carNo = carNo;
  9803. exports.chinese = chinese;
  9804. exports.code = code;
  9805. exports.contains = contains;
  9806. exports.date = date;
  9807. exports.dateISO = dateISO;
  9808. exports.digits = digits;
  9809. exports.email = email;
  9810. exports.empty = empty;
  9811. exports.enOrNum = enOrNum;
  9812. exports.func = func;
  9813. exports.idCard = idCard;
  9814. exports.image = image;
  9815. exports.jsonString = jsonString;
  9816. exports.landline = landline;
  9817. exports.letter = letter;
  9818. exports.mobile = mobile;
  9819. exports.number = number;
  9820. exports.object = object;
  9821. exports.promise = promise;
  9822. exports.range = range;
  9823. exports.rangeLength = rangeLength;
  9824. exports.regExp = regExp;
  9825. exports.string = string;
  9826. exports.url = url;
  9827. exports.video = video;
  9828. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9829. /**
  9830. * 验证电子邮箱格式
  9831. */
  9832. function email(value) {
  9833. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  9834. }
  9835. /**
  9836. * 验证手机格式
  9837. */
  9838. function mobile(value) {
  9839. return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value);
  9840. }
  9841. /**
  9842. * 验证URL格式
  9843. */
  9844. function url(value) {
  9845. return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(value);
  9846. }
  9847. /**
  9848. * 验证日期格式
  9849. */
  9850. function date(value) {
  9851. if (!value) return false;
  9852. // 判断是否数值或者字符串数值(意味着为时间戳),转为数值,否则new Date无法识别字符串时间戳
  9853. if (number(value)) value = +value;
  9854. return !/Invalid|NaN/.test(new Date(value).toString());
  9855. }
  9856. /**
  9857. * 验证ISO类型的日期格式
  9858. */
  9859. function dateISO(value) {
  9860. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  9861. }
  9862. /**
  9863. * 验证十进制数字
  9864. */
  9865. function number(value) {
  9866. return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value);
  9867. }
  9868. /**
  9869. * 验证字符串
  9870. */
  9871. function string(value) {
  9872. return typeof value === 'string';
  9873. }
  9874. /**
  9875. * 验证整数
  9876. */
  9877. function digits(value) {
  9878. return /^\d+$/.test(value);
  9879. }
  9880. /**
  9881. * 验证身份证号码
  9882. */
  9883. function idCard(value) {
  9884. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value);
  9885. }
  9886. /**
  9887. * 是否车牌号
  9888. */
  9889. function carNo(value) {
  9890. // 新能源车牌
  9891. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  9892. // 旧车牌
  9893. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  9894. if (value.length === 7) {
  9895. return creg.test(value);
  9896. }
  9897. if (value.length === 8) {
  9898. return xreg.test(value);
  9899. }
  9900. return false;
  9901. }
  9902. /**
  9903. * 金额,只允许2位小数
  9904. */
  9905. function amount(value) {
  9906. // 金额,只允许保留两位小数
  9907. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  9908. }
  9909. /**
  9910. * 中文
  9911. */
  9912. function chinese(value) {
  9913. var reg = /^[\u4e00-\u9fa5]+$/gi;
  9914. return reg.test(value);
  9915. }
  9916. /**
  9917. * 只能输入字母
  9918. */
  9919. function letter(value) {
  9920. return /^[a-zA-Z]*$/.test(value);
  9921. }
  9922. /**
  9923. * 只能是字母或者数字
  9924. */
  9925. function enOrNum(value) {
  9926. // 英文或者数字
  9927. var reg = /^[0-9a-zA-Z]*$/g;
  9928. return reg.test(value);
  9929. }
  9930. /**
  9931. * 验证是否包含某个值
  9932. */
  9933. function contains(value, param) {
  9934. return value.indexOf(param) >= 0;
  9935. }
  9936. /**
  9937. * 验证一个值范围[min, max]
  9938. */
  9939. function range(value, param) {
  9940. return value >= param[0] && value <= param[1];
  9941. }
  9942. /**
  9943. * 验证一个长度范围[min, max]
  9944. */
  9945. function rangeLength(value, param) {
  9946. return value.length >= param[0] && value.length <= param[1];
  9947. }
  9948. /**
  9949. * 是否固定电话
  9950. */
  9951. function landline(value) {
  9952. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  9953. return reg.test(value);
  9954. }
  9955. /**
  9956. * 判断是否为空
  9957. */
  9958. function empty(value) {
  9959. switch ((0, _typeof2.default)(value)) {
  9960. case 'undefined':
  9961. return true;
  9962. case 'string':
  9963. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  9964. break;
  9965. case 'boolean':
  9966. if (!value) return true;
  9967. break;
  9968. case 'number':
  9969. if (value === 0 || isNaN(value)) return true;
  9970. break;
  9971. case 'object':
  9972. if (value === null || value.length === 0) return true;
  9973. for (var i in value) {
  9974. return false;
  9975. }
  9976. return true;
  9977. }
  9978. return false;
  9979. }
  9980. /**
  9981. * 是否json字符串
  9982. */
  9983. function jsonString(value) {
  9984. if (typeof value === 'string') {
  9985. try {
  9986. var obj = JSON.parse(value);
  9987. if ((0, _typeof2.default)(obj) === 'object' && obj) {
  9988. return true;
  9989. }
  9990. return false;
  9991. } catch (e) {
  9992. return false;
  9993. }
  9994. }
  9995. return false;
  9996. }
  9997. /**
  9998. * 是否数组
  9999. */
  10000. function array(value) {
  10001. if (typeof Array.isArray === 'function') {
  10002. return Array.isArray(value);
  10003. }
  10004. return Object.prototype.toString.call(value) === '[object Array]';
  10005. }
  10006. /**
  10007. * 是否对象
  10008. */
  10009. function object(value) {
  10010. return Object.prototype.toString.call(value) === '[object Object]';
  10011. }
  10012. /**
  10013. * 是否短信验证码
  10014. */
  10015. function code(value) {
  10016. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  10017. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  10018. }
  10019. /**
  10020. * 是否函数方法
  10021. * @param {Object} value
  10022. */
  10023. function func(value) {
  10024. return typeof value === 'function';
  10025. }
  10026. /**
  10027. * 是否promise对象
  10028. * @param {Object} value
  10029. */
  10030. function promise(value) {
  10031. return object(value) && func(value.then) && func(value.catch);
  10032. }
  10033. /** 是否图片格式
  10034. * @param {Object} value
  10035. */
  10036. function image(value) {
  10037. var newValue = value.split('?')[0];
  10038. var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
  10039. return IMAGE_REGEXP.test(newValue);
  10040. }
  10041. /**
  10042. * 是否视频格式
  10043. * @param {Object} value
  10044. */
  10045. function video(value) {
  10046. var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
  10047. return VIDEO_REGEXP.test(value);
  10048. }
  10049. /**
  10050. * 是否为正则对象
  10051. * @param {Object}
  10052. * @return {Boolean}
  10053. */
  10054. function regExp(o) {
  10055. return o && Object.prototype.toString.call(o) === '[object RegExp]';
  10056. }
  10057. /***/ }),
  10058. /***/ 257:
  10059. /*!*************************************************************************!*\
  10060. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/function/digit.js ***!
  10061. \*************************************************************************/
  10062. /*! no static exports found */
  10063. /***/ (function(module, exports, __webpack_require__) {
  10064. "use strict";
  10065. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10066. Object.defineProperty(exports, "__esModule", {
  10067. value: true
  10068. });
  10069. exports.default = void 0;
  10070. exports.divide = divide;
  10071. exports.enableBoundaryChecking = enableBoundaryChecking;
  10072. exports.minus = minus;
  10073. exports.plus = plus;
  10074. exports.round = round;
  10075. exports.times = times;
  10076. var _toArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toArray */ 258));
  10077. var _boundaryCheckingState = true; // 是否进行越界检查的全局开关
  10078. /**
  10079. * 把错误的数据转正
  10080. * @private
  10081. * @example strip(0.09999999999999998)=0.1
  10082. */
  10083. function strip(num) {
  10084. var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15;
  10085. return +parseFloat(Number(num).toPrecision(precision));
  10086. }
  10087. /**
  10088. * Return digits length of a number
  10089. * @private
  10090. * @param {*number} num Input number
  10091. */
  10092. function digitLength(num) {
  10093. // Get digit length of e
  10094. var eSplit = num.toString().split(/[eE]/);
  10095. var len = (eSplit[0].split('.')[1] || '').length - +(eSplit[1] || 0);
  10096. return len > 0 ? len : 0;
  10097. }
  10098. /**
  10099. * 把小数转成整数,如果是小数则放大成整数
  10100. * @private
  10101. * @param {*number} num 输入数
  10102. */
  10103. function float2Fixed(num) {
  10104. if (num.toString().indexOf('e') === -1) {
  10105. return Number(num.toString().replace('.', ''));
  10106. }
  10107. var dLen = digitLength(num);
  10108. return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
  10109. }
  10110. /**
  10111. * 检测数字是否越界,如果越界给出提示
  10112. * @private
  10113. * @param {*number} num 输入数
  10114. */
  10115. function checkBoundary(num) {
  10116. if (_boundaryCheckingState) {
  10117. if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
  10118. console.warn("".concat(num, " \u8D85\u51FA\u4E86\u7CBE\u5EA6\u9650\u5236\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u6B63\u786E"));
  10119. }
  10120. }
  10121. }
  10122. /**
  10123. * 把递归操作扁平迭代化
  10124. * @param {number[]} arr 要操作的数字数组
  10125. * @param {function} operation 迭代操作
  10126. * @private
  10127. */
  10128. function iteratorOperation(arr, operation) {
  10129. var _arr = (0, _toArray2.default)(arr),
  10130. num1 = _arr[0],
  10131. num2 = _arr[1],
  10132. others = _arr.slice(2);
  10133. var res = operation(num1, num2);
  10134. others.forEach(function (num) {
  10135. res = operation(res, num);
  10136. });
  10137. return res;
  10138. }
  10139. /**
  10140. * 高精度乘法
  10141. * @export
  10142. */
  10143. function times() {
  10144. for (var _len = arguments.length, nums = new Array(_len), _key = 0; _key < _len; _key++) {
  10145. nums[_key] = arguments[_key];
  10146. }
  10147. if (nums.length > 2) {
  10148. return iteratorOperation(nums, times);
  10149. }
  10150. var num1 = nums[0],
  10151. num2 = nums[1];
  10152. var num1Changed = float2Fixed(num1);
  10153. var num2Changed = float2Fixed(num2);
  10154. var baseNum = digitLength(num1) + digitLength(num2);
  10155. var leftValue = num1Changed * num2Changed;
  10156. checkBoundary(leftValue);
  10157. return leftValue / Math.pow(10, baseNum);
  10158. }
  10159. /**
  10160. * 高精度加法
  10161. * @export
  10162. */
  10163. function plus() {
  10164. for (var _len2 = arguments.length, nums = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  10165. nums[_key2] = arguments[_key2];
  10166. }
  10167. if (nums.length > 2) {
  10168. return iteratorOperation(nums, plus);
  10169. }
  10170. var num1 = nums[0],
  10171. num2 = nums[1];
  10172. // 取最大的小数位
  10173. var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
  10174. // 把小数都转为整数然后再计算
  10175. return (times(num1, baseNum) + times(num2, baseNum)) / baseNum;
  10176. }
  10177. /**
  10178. * 高精度减法
  10179. * @export
  10180. */
  10181. function minus() {
  10182. for (var _len3 = arguments.length, nums = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  10183. nums[_key3] = arguments[_key3];
  10184. }
  10185. if (nums.length > 2) {
  10186. return iteratorOperation(nums, minus);
  10187. }
  10188. var num1 = nums[0],
  10189. num2 = nums[1];
  10190. var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
  10191. return (times(num1, baseNum) - times(num2, baseNum)) / baseNum;
  10192. }
  10193. /**
  10194. * 高精度除法
  10195. * @export
  10196. */
  10197. function divide() {
  10198. for (var _len4 = arguments.length, nums = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  10199. nums[_key4] = arguments[_key4];
  10200. }
  10201. if (nums.length > 2) {
  10202. return iteratorOperation(nums, divide);
  10203. }
  10204. var num1 = nums[0],
  10205. num2 = nums[1];
  10206. var num1Changed = float2Fixed(num1);
  10207. var num2Changed = float2Fixed(num2);
  10208. checkBoundary(num1Changed);
  10209. checkBoundary(num2Changed);
  10210. // 重要,这里必须用strip进行修正
  10211. return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
  10212. }
  10213. /**
  10214. * 四舍五入
  10215. * @export
  10216. */
  10217. function round(num, ratio) {
  10218. var base = Math.pow(10, ratio);
  10219. var result = divide(Math.round(Math.abs(times(num, base))), base);
  10220. if (num < 0 && result !== 0) {
  10221. result = times(result, -1);
  10222. }
  10223. // 位数不足则补0
  10224. return result;
  10225. }
  10226. /**
  10227. * 是否进行边界检查,默认开启
  10228. * @param flag 标记开关,true 为开启,false 为关闭,默认为 true
  10229. * @export
  10230. */
  10231. function enableBoundaryChecking() {
  10232. var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  10233. _boundaryCheckingState = flag;
  10234. }
  10235. var _default = {
  10236. times: times,
  10237. plus: plus,
  10238. minus: minus,
  10239. divide: divide,
  10240. round: round,
  10241. enableBoundaryChecking: enableBoundaryChecking
  10242. };
  10243. exports.default = _default;
  10244. /***/ }),
  10245. /***/ 258:
  10246. /*!********************************************************!*\
  10247. !*** ./node_modules/@babel/runtime/helpers/toArray.js ***!
  10248. \********************************************************/
  10249. /*! no static exports found */
  10250. /***/ (function(module, exports, __webpack_require__) {
  10251. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  10252. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  10253. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  10254. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  10255. function _toArray(arr) {
  10256. return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
  10257. }
  10258. module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10259. /***/ }),
  10260. /***/ 259:
  10261. /*!*********************************************************************!*\
  10262. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/util/route.js ***!
  10263. \*********************************************************************/
  10264. /*! no static exports found */
  10265. /***/ (function(module, exports, __webpack_require__) {
  10266. "use strict";
  10267. /* WEBPACK VAR INJECTION */(function(uni) {
  10268. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10269. Object.defineProperty(exports, "__esModule", {
  10270. value: true
  10271. });
  10272. exports.default = void 0;
  10273. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 63));
  10274. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65));
  10275. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10276. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10277. var _index = __webpack_require__(/*! @/uni_modules/uv-ui-tools/libs/function/index.js */ 255);
  10278. /**
  10279. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  10280. * 并且带有路由拦截功能
  10281. */
  10282. var Router = /*#__PURE__*/function () {
  10283. function Router() {
  10284. (0, _classCallCheck2.default)(this, Router);
  10285. // 原始属性定义
  10286. this.config = {
  10287. type: 'navigateTo',
  10288. url: '',
  10289. delta: 1,
  10290. // navigateBack页面后退时,回退的层数
  10291. params: {},
  10292. // 传递的参数
  10293. animationType: 'pop-in',
  10294. // 窗口动画,只在APP有效
  10295. animationDuration: 300,
  10296. // 窗口动画持续时间,单位毫秒,只在APP有效
  10297. intercept: false,
  10298. // 是否需要拦截
  10299. events: {} // 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
  10300. };
  10301. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  10302. // 这里在构造函数中进行this绑定
  10303. this.route = this.route.bind(this);
  10304. }
  10305. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  10306. (0, _createClass2.default)(Router, [{
  10307. key: "addRootPath",
  10308. value: function addRootPath(url) {
  10309. return url[0] === '/' ? url : "/".concat(url);
  10310. }
  10311. // 整合路由参数
  10312. }, {
  10313. key: "mixinParam",
  10314. value: function mixinParam(url, params) {
  10315. url = url && this.addRootPath(url);
  10316. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10317. // 如果有url中有get参数,转换后无需带上"?"
  10318. var query = '';
  10319. if (/.*\/.*\?.*=.*/.test(url)) {
  10320. // object对象转为get类型的参数
  10321. query = (0, _index.queryParams)(params, false);
  10322. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10323. return url += "&".concat(query);
  10324. }
  10325. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  10326. query = (0, _index.queryParams)(params);
  10327. return url += query;
  10328. }
  10329. // 对外的方法名称
  10330. }, {
  10331. key: "route",
  10332. value: function () {
  10333. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10334. var options,
  10335. params,
  10336. mergeConfig,
  10337. isNext,
  10338. _args = arguments;
  10339. return _regenerator.default.wrap(function _callee$(_context) {
  10340. while (1) {
  10341. switch (_context.prev = _context.next) {
  10342. case 0:
  10343. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  10344. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  10345. // 合并用户的配置和内部的默认配置
  10346. mergeConfig = {};
  10347. if (typeof options === 'string') {
  10348. // 如果options为字符串,则为route(url, params)的形式
  10349. mergeConfig.url = this.mixinParam(options, params);
  10350. mergeConfig.type = 'navigateTo';
  10351. } else {
  10352. mergeConfig = (0, _index.deepMerge)(this.config, options);
  10353. // 否则正常使用mergeConfig中的url和params进行拼接
  10354. mergeConfig.url = this.mixinParam(options.url, options.params);
  10355. }
  10356. // 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
  10357. if (!(mergeConfig.url === (0, _index.page)())) {
  10358. _context.next = 6;
  10359. break;
  10360. }
  10361. return _context.abrupt("return");
  10362. case 6:
  10363. if (params.intercept) {
  10364. mergeConfig.intercept = params.intercept;
  10365. }
  10366. // params参数也带给拦截器
  10367. mergeConfig.params = params;
  10368. // 合并内外部参数
  10369. mergeConfig = (0, _index.deepMerge)(this.config, mergeConfig);
  10370. // 判断用户是否定义了拦截器
  10371. if (!(typeof mergeConfig.intercept === 'function')) {
  10372. _context.next = 16;
  10373. break;
  10374. }
  10375. _context.next = 12;
  10376. return new Promise(function (resolve, reject) {
  10377. mergeConfig.intercept(mergeConfig, resolve);
  10378. });
  10379. case 12:
  10380. isNext = _context.sent;
  10381. // 如果isNext为true,则执行路由跳转
  10382. isNext && this.openPage(mergeConfig);
  10383. _context.next = 17;
  10384. break;
  10385. case 16:
  10386. this.openPage(mergeConfig);
  10387. case 17:
  10388. case "end":
  10389. return _context.stop();
  10390. }
  10391. }
  10392. }, _callee, this);
  10393. }));
  10394. function route() {
  10395. return _route.apply(this, arguments);
  10396. }
  10397. return route;
  10398. }() // 执行路由跳转
  10399. }, {
  10400. key: "openPage",
  10401. value: function openPage(config) {
  10402. // 解构参数
  10403. var url = config.url,
  10404. type = config.type,
  10405. delta = config.delta,
  10406. animationType = config.animationType,
  10407. animationDuration = config.animationDuration,
  10408. events = config.events;
  10409. if (config.type == 'navigateTo' || config.type == 'to') {
  10410. uni.navigateTo({
  10411. url: url,
  10412. animationType: animationType,
  10413. animationDuration: animationDuration,
  10414. events: events
  10415. });
  10416. }
  10417. if (config.type == 'redirectTo' || config.type == 'redirect') {
  10418. uni.redirectTo({
  10419. url: url
  10420. });
  10421. }
  10422. if (config.type == 'switchTab' || config.type == 'tab') {
  10423. uni.switchTab({
  10424. url: url
  10425. });
  10426. }
  10427. if (config.type == 'reLaunch' || config.type == 'launch') {
  10428. uni.reLaunch({
  10429. url: url
  10430. });
  10431. }
  10432. if (config.type == 'navigateBack' || config.type == 'back') {
  10433. uni.navigateBack({
  10434. delta: delta
  10435. });
  10436. }
  10437. }
  10438. }]);
  10439. return Router;
  10440. }();
  10441. var _default = new Router().route;
  10442. exports.default = _default;
  10443. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10444. /***/ }),
  10445. /***/ 26:
  10446. /*!*************************************!*\
  10447. !*** E:/盈通/sulibao-mini/pages.json ***!
  10448. \*************************************/
  10449. /*! no static exports found */
  10450. /***/ (function(module, exports) {
  10451. /***/ }),
  10452. /***/ 260:
  10453. /*!****************************************************************************!*\
  10454. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/function/debounce.js ***!
  10455. \****************************************************************************/
  10456. /*! no static exports found */
  10457. /***/ (function(module, exports, __webpack_require__) {
  10458. "use strict";
  10459. Object.defineProperty(exports, "__esModule", {
  10460. value: true
  10461. });
  10462. exports.default = void 0;
  10463. var timeout = null;
  10464. /**
  10465. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  10466. *
  10467. * @param {Function} func 要执行的回调函数
  10468. * @param {Number} wait 延时的时间
  10469. * @param {Boolean} immediate 是否立即执行
  10470. * @return null
  10471. */
  10472. function debounce(func) {
  10473. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  10474. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10475. // 清除定时器
  10476. if (timeout !== null) clearTimeout(timeout);
  10477. // 立即执行,此类情况一般用不到
  10478. if (immediate) {
  10479. var callNow = !timeout;
  10480. timeout = setTimeout(function () {
  10481. timeout = null;
  10482. }, wait);
  10483. if (callNow) typeof func === 'function' && func();
  10484. } else {
  10485. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  10486. timeout = setTimeout(function () {
  10487. typeof func === 'function' && func();
  10488. }, wait);
  10489. }
  10490. }
  10491. var _default = debounce;
  10492. exports.default = _default;
  10493. /***/ }),
  10494. /***/ 261:
  10495. /*!****************************************************************************!*\
  10496. !*** E:/盈通/sulibao-mini/uni_modules/uv-ui-tools/libs/function/throttle.js ***!
  10497. \****************************************************************************/
  10498. /*! no static exports found */
  10499. /***/ (function(module, exports, __webpack_require__) {
  10500. "use strict";
  10501. Object.defineProperty(exports, "__esModule", {
  10502. value: true
  10503. });
  10504. exports.default = void 0;
  10505. var timer;
  10506. var flag;
  10507. /**
  10508. * 节流原理:在一定时间内,只能触发一次
  10509. *
  10510. * @param {Function} func 要执行的回调函数
  10511. * @param {Number} wait 延时的时间
  10512. * @param {Boolean} immediate 是否立即执行
  10513. * @return null
  10514. */
  10515. function throttle(func) {
  10516. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  10517. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10518. if (immediate) {
  10519. if (!flag) {
  10520. flag = true;
  10521. // 如果是立即执行,则在wait毫秒内开始时执行
  10522. typeof func === 'function' && func();
  10523. timer = setTimeout(function () {
  10524. flag = false;
  10525. }, wait);
  10526. }
  10527. } else if (!flag) {
  10528. flag = true;
  10529. // 如果是非立即执行,则在wait毫秒内的结束处执行
  10530. timer = setTimeout(function () {
  10531. flag = false;
  10532. typeof func === 'function' && func();
  10533. }, wait);
  10534. }
  10535. }
  10536. var _default = throttle;
  10537. exports.default = _default;
  10538. /***/ }),
  10539. /***/ 262:
  10540. /*!******************************************************************************!*\
  10541. !*** E:/盈通/sulibao-mini/uni_modules/uv-sticky/components/uv-sticky/props.js ***!
  10542. \******************************************************************************/
  10543. /*! no static exports found */
  10544. /***/ (function(module, exports, __webpack_require__) {
  10545. "use strict";
  10546. /* WEBPACK VAR INJECTION */(function(uni) {
  10547. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10548. Object.defineProperty(exports, "__esModule", {
  10549. value: true
  10550. });
  10551. exports.default = void 0;
  10552. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10553. var _uni$$uv, _uni$$uv$props;
  10554. 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; }
  10555. 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; }
  10556. var _default = {
  10557. props: _objectSpread({
  10558. // 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
  10559. offsetTop: {
  10560. type: [String, Number],
  10561. default: 0
  10562. },
  10563. // 自定义导航栏的高度
  10564. customNavHeight: {
  10565. type: [String, Number],
  10566. default: 0
  10567. },
  10568. // 是否禁用吸顶功能
  10569. disabled: {
  10570. type: Boolean,
  10571. default: false
  10572. },
  10573. // 吸顶区域的背景颜色
  10574. bgColor: {
  10575. type: String,
  10576. default: 'transparent'
  10577. },
  10578. // z-index值
  10579. zIndex: {
  10580. type: [String, Number],
  10581. default: ''
  10582. },
  10583. // 列表中的索引值
  10584. index: {
  10585. type: [String, Number],
  10586. default: ''
  10587. }
  10588. }, (_uni$$uv = uni.$uv) === null || _uni$$uv === void 0 ? void 0 : (_uni$$uv$props = _uni$$uv.props) === null || _uni$$uv$props === void 0 ? void 0 : _uni$$uv$props.sticky)
  10589. };
  10590. exports.default = _default;
  10591. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10592. /***/ }),
  10593. /***/ 270:
  10594. /*!*********************************************************************************************!*\
  10595. !*** E:/盈通/sulibao-mini/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js ***!
  10596. \*********************************************************************************************/
  10597. /*! no static exports found */
  10598. /***/ (function(module, exports, __webpack_require__) {
  10599. "use strict";
  10600. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10601. Object.defineProperty(exports, "__esModule", {
  10602. value: true
  10603. });
  10604. exports.default = void 0;
  10605. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 271));
  10606. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 272));
  10607. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 273));
  10608. var _default = {
  10609. en: _en.default,
  10610. 'zh-Hans': _zhHans.default,
  10611. 'zh-Hant': _zhHant.default
  10612. };
  10613. exports.default = _default;
  10614. /***/ }),
  10615. /***/ 271:
  10616. /*!********************************************************************************************!*\
  10617. !*** E:/盈通/sulibao-mini/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json ***!
  10618. \********************************************************************************************/
  10619. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10620. /***/ (function(module) {
  10621. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"Search enter content\"}");
  10622. /***/ }),
  10623. /***/ 272:
  10624. /*!*************************************************************************************************!*\
  10625. !*** E:/盈通/sulibao-mini/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json ***!
  10626. \*************************************************************************************************/
  10627. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10628. /***/ (function(module) {
  10629. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"取消\",\"uni-search-bar.placeholder\":\"请输入搜索内容\"}");
  10630. /***/ }),
  10631. /***/ 273:
  10632. /*!*************************************************************************************************!*\
  10633. !*** E:/盈通/sulibao-mini/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json ***!
  10634. \*************************************************************************************************/
  10635. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10636. /***/ (function(module) {
  10637. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"取消\",\"uni-search-bar.placeholder\":\"請輸入搜索內容\"}");
  10638. /***/ }),
  10639. /***/ 3:
  10640. /*!***********************************!*\
  10641. !*** (webpack)/buildin/global.js ***!
  10642. \***********************************/
  10643. /*! no static exports found */
  10644. /***/ (function(module, exports) {
  10645. var g;
  10646. // This works in non-strict mode
  10647. g = (function() {
  10648. return this;
  10649. })();
  10650. try {
  10651. // This works if eval is allowed (see CSP)
  10652. g = g || new Function("return this")();
  10653. } catch (e) {
  10654. // This works if the window reference is available
  10655. if (typeof window === "object") g = window;
  10656. }
  10657. // g can still be undefined, but nothing to do about it...
  10658. // We return undefined, instead of nothing here, so it's
  10659. // easier to handle this case. if(!global) { ...}
  10660. module.exports = g;
  10661. /***/ }),
  10662. /***/ 30:
  10663. /*!*****************************************!*\
  10664. !*** E:/盈通/sulibao-mini/store/index.js ***!
  10665. \*****************************************/
  10666. /*! no static exports found */
  10667. /***/ (function(module, exports, __webpack_require__) {
  10668. "use strict";
  10669. /* WEBPACK VAR INJECTION */(function(uni) {
  10670. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10671. Object.defineProperty(exports, "__esModule", {
  10672. value: true
  10673. });
  10674. exports.default = void 0;
  10675. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  10676. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 31));
  10677. var _storage = _interopRequireDefault(__webpack_require__(/*! @/utils/storage.js */ 32));
  10678. _vue.default.use(_vuex.default);
  10679. var lifeData = {};
  10680. // 尝试获取本地是否存在lifeData变量,第一次启动时不存在
  10681. try {
  10682. lifeData = uni.getStorageSync('lifeData');
  10683. } catch (e) {}
  10684. // 标记需要永久存储的变量,在每次启动时取出,在state中的变量名
  10685. var saveStateKeys = ['vuex_user'];
  10686. // 保存变量到本地存储
  10687. var saveLifeData = function saveLifeData(key, value) {
  10688. // 判断变量是否在存储数组中
  10689. if (saveStateKeys.indexOf(key) != -1) {
  10690. // 获取本地存储的lifeData对象,将变量添加到对象中
  10691. var tmpLifeData = uni.getStorageSync('lifeData');
  10692. // 第一次启动时不存在,则放一个空对象
  10693. tmpLifeData = tmpLifeData ? tmpLifeData : {}, tmpLifeData[key] = value;
  10694. // 将变量再次放回本地存储中
  10695. uni.setStorageSync('lifeData', tmpLifeData);
  10696. }
  10697. };
  10698. var store = new _vuex.default.Store({
  10699. state: {
  10700. // 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
  10701. // 加上vuex_前缀,是防止变量名冲突,也让人一目了然
  10702. vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {
  10703. name: '速立保'
  10704. },
  10705. // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
  10706. // app版本
  10707. vuex_version: "1.0.0",
  10708. // 是否使用自定义导航栏
  10709. vuex_custom_nav_bar: true,
  10710. // 状态栏高度
  10711. vuex_status_bar_height: 0,
  10712. // 自定义导航栏的高度
  10713. vuex_custom_bar_height: 0,
  10714. token: null,
  10715. openId: null,
  10716. userInfo: null,
  10717. expires_time: null,
  10718. isGOAuth: false,
  10719. //是否已跳转至登录界面,防止路由重复注入
  10720. isFirstLoad: true,
  10721. //是否第一次加载 第一次加载未认证不需要弹框 直接跳转认证
  10722. authPopupShow: false,
  10723. //x-authorize 弹窗是否显示
  10724. engAdmin: false
  10725. },
  10726. mutations: {
  10727. LOGOUT: function LOGOUT(state) {
  10728. state.token = null;
  10729. //state.expires_time = null;
  10730. state.userInfo = null;
  10731. _storage.default.remove('openId');
  10732. _storage.default.remove('userInfo');
  10733. _storage.default.remove('token');
  10734. _storage.default.remove('memberNo');
  10735. _storage.default.remove('myUsername');
  10736. _storage.default.remove('accountName');
  10737. //storage.remove('expires_time')
  10738. },
  10739. LOGIN: function LOGIN(state, _ref) {
  10740. var token = _ref.token,
  10741. openId = _ref.openId,
  10742. expires_time = _ref.expires_time;
  10743. state.token = token;
  10744. state.openId = openId;
  10745. state.expires_time = expires_time;
  10746. _storage.default.set('token', token);
  10747. _storage.default.set('openId', openId);
  10748. _storage.default.set('expires_time', expires_time);
  10749. },
  10750. UPDATE_USERINFO: function UPDATE_USERINFO(state, userInfo) {
  10751. state.userInfo = userInfo;
  10752. _storage.default.set('userInfo', userInfo);
  10753. if (userInfo) {
  10754. _storage.default.set('memberNo', userInfo.member_no);
  10755. _storage.default.set('accountName', userInfo.account_name);
  10756. uni.setStorageSync("myUsername", userInfo.account_name);
  10757. // uni.setStorageSync("myUsername",userInfo.account_name+"m"+userInfo.member_no);
  10758. state.engAdmin = false;
  10759. if (userInfo.engAdmin) {
  10760. state.engAdmin = userInfo.engAdmin;
  10761. }
  10762. }
  10763. },
  10764. SET_GO_AUTH: function SET_GO_AUTH(state, self) {
  10765. state.isGOAuth = self;
  10766. },
  10767. SHOW_AUTH_POPUP_SHOW: function SHOW_AUTH_POPUP_SHOW(state) {
  10768. state.authPopupShow = true;
  10769. },
  10770. HIDE_AUTH_POPUP_SHOW: function HIDE_AUTH_POPUP_SHOW(state) {
  10771. state.authPopupShow = false;
  10772. },
  10773. $tStore: function $tStore(state, payload) {
  10774. // 判断是否多层调用,state中为对象存在的情况,例如user.info.score = 1
  10775. var nameArr = payload.name.split('.');
  10776. var saveKey = '';
  10777. var len = nameArr.length;
  10778. if (len >= 2) {
  10779. var obj = state[nameArr[0]];
  10780. for (var i = 1; i < len - 1; i++) {
  10781. obj = obj[nameArr[i]];
  10782. }
  10783. obj[nameArr[len - 1]] = payload.value;
  10784. saveKey = nameArr[0];
  10785. } else {
  10786. // 单层级变量
  10787. state[payload.name] = payload.value;
  10788. saveKey = payload.name;
  10789. }
  10790. // 保存变量到本地中
  10791. saveLifeData(saveKey, state[saveKey]);
  10792. }
  10793. },
  10794. actions: {},
  10795. getters: {
  10796. token: function token(state) {
  10797. return state.token;
  10798. },
  10799. userInfo: function userInfo(state) {
  10800. return state.userInfo || {};
  10801. },
  10802. expires_time: function expires_time(state) {
  10803. return state.expires_time;
  10804. },
  10805. authPopupShow: function authPopupShow(state) {
  10806. return state.authPopupShow;
  10807. }
  10808. }
  10809. });
  10810. var _default = store;
  10811. exports.default = _default;
  10812. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10813. /***/ }),
  10814. /***/ 31:
  10815. /*!**************************************************************************************!*\
  10816. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  10817. \**************************************************************************************/
  10818. /*! no static exports found */
  10819. /***/ (function(module, exports, __webpack_require__) {
  10820. "use strict";
  10821. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10822. * vuex v3.6.2
  10823. * (c) 2021 Evan You
  10824. * @license MIT
  10825. */
  10826. function applyMixin (Vue) {
  10827. var version = Number(Vue.version.split('.')[0]);
  10828. if (version >= 2) {
  10829. Vue.mixin({ beforeCreate: vuexInit });
  10830. } else {
  10831. // override init and inject vuex init procedure
  10832. // for 1.x backwards compatibility.
  10833. var _init = Vue.prototype._init;
  10834. Vue.prototype._init = function (options) {
  10835. if ( options === void 0 ) options = {};
  10836. options.init = options.init
  10837. ? [vuexInit].concat(options.init)
  10838. : vuexInit;
  10839. _init.call(this, options);
  10840. };
  10841. }
  10842. /**
  10843. * Vuex init hook, injected into each instances init hooks list.
  10844. */
  10845. function vuexInit () {
  10846. var options = this.$options;
  10847. // store injection
  10848. if (options.store) {
  10849. this.$store = typeof options.store === 'function'
  10850. ? options.store()
  10851. : options.store;
  10852. } else if (options.parent && options.parent.$store) {
  10853. this.$store = options.parent.$store;
  10854. }
  10855. }
  10856. }
  10857. var target = typeof window !== 'undefined'
  10858. ? window
  10859. : typeof global !== 'undefined'
  10860. ? global
  10861. : {};
  10862. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10863. function devtoolPlugin (store) {
  10864. if (!devtoolHook) { return }
  10865. store._devtoolHook = devtoolHook;
  10866. devtoolHook.emit('vuex:init', store);
  10867. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10868. store.replaceState(targetState);
  10869. });
  10870. store.subscribe(function (mutation, state) {
  10871. devtoolHook.emit('vuex:mutation', mutation, state);
  10872. }, { prepend: true });
  10873. store.subscribeAction(function (action, state) {
  10874. devtoolHook.emit('vuex:action', action, state);
  10875. }, { prepend: true });
  10876. }
  10877. /**
  10878. * Get the first item that pass the test
  10879. * by second argument function
  10880. *
  10881. * @param {Array} list
  10882. * @param {Function} f
  10883. * @return {*}
  10884. */
  10885. function find (list, f) {
  10886. return list.filter(f)[0]
  10887. }
  10888. /**
  10889. * Deep copy the given object considering circular structure.
  10890. * This function caches all nested objects and its copies.
  10891. * If it detects circular structure, use cached copy to avoid infinite loop.
  10892. *
  10893. * @param {*} obj
  10894. * @param {Array<Object>} cache
  10895. * @return {*}
  10896. */
  10897. function deepCopy (obj, cache) {
  10898. if ( cache === void 0 ) cache = [];
  10899. // just return if obj is immutable value
  10900. if (obj === null || typeof obj !== 'object') {
  10901. return obj
  10902. }
  10903. // if obj is hit, it is in circular structure
  10904. var hit = find(cache, function (c) { return c.original === obj; });
  10905. if (hit) {
  10906. return hit.copy
  10907. }
  10908. var copy = Array.isArray(obj) ? [] : {};
  10909. // put the copy into cache at first
  10910. // because we want to refer it in recursive deepCopy
  10911. cache.push({
  10912. original: obj,
  10913. copy: copy
  10914. });
  10915. Object.keys(obj).forEach(function (key) {
  10916. copy[key] = deepCopy(obj[key], cache);
  10917. });
  10918. return copy
  10919. }
  10920. /**
  10921. * forEach for object
  10922. */
  10923. function forEachValue (obj, fn) {
  10924. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10925. }
  10926. function isObject (obj) {
  10927. return obj !== null && typeof obj === 'object'
  10928. }
  10929. function isPromise (val) {
  10930. return val && typeof val.then === 'function'
  10931. }
  10932. function assert (condition, msg) {
  10933. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10934. }
  10935. function partial (fn, arg) {
  10936. return function () {
  10937. return fn(arg)
  10938. }
  10939. }
  10940. // Base data struct for store's module, package with some attribute and method
  10941. var Module = function Module (rawModule, runtime) {
  10942. this.runtime = runtime;
  10943. // Store some children item
  10944. this._children = Object.create(null);
  10945. // Store the origin module object which passed by programmer
  10946. this._rawModule = rawModule;
  10947. var rawState = rawModule.state;
  10948. // Store the origin module's state
  10949. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10950. };
  10951. var prototypeAccessors = { namespaced: { configurable: true } };
  10952. prototypeAccessors.namespaced.get = function () {
  10953. return !!this._rawModule.namespaced
  10954. };
  10955. Module.prototype.addChild = function addChild (key, module) {
  10956. this._children[key] = module;
  10957. };
  10958. Module.prototype.removeChild = function removeChild (key) {
  10959. delete this._children[key];
  10960. };
  10961. Module.prototype.getChild = function getChild (key) {
  10962. return this._children[key]
  10963. };
  10964. Module.prototype.hasChild = function hasChild (key) {
  10965. return key in this._children
  10966. };
  10967. Module.prototype.update = function update (rawModule) {
  10968. this._rawModule.namespaced = rawModule.namespaced;
  10969. if (rawModule.actions) {
  10970. this._rawModule.actions = rawModule.actions;
  10971. }
  10972. if (rawModule.mutations) {
  10973. this._rawModule.mutations = rawModule.mutations;
  10974. }
  10975. if (rawModule.getters) {
  10976. this._rawModule.getters = rawModule.getters;
  10977. }
  10978. };
  10979. Module.prototype.forEachChild = function forEachChild (fn) {
  10980. forEachValue(this._children, fn);
  10981. };
  10982. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10983. if (this._rawModule.getters) {
  10984. forEachValue(this._rawModule.getters, fn);
  10985. }
  10986. };
  10987. Module.prototype.forEachAction = function forEachAction (fn) {
  10988. if (this._rawModule.actions) {
  10989. forEachValue(this._rawModule.actions, fn);
  10990. }
  10991. };
  10992. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10993. if (this._rawModule.mutations) {
  10994. forEachValue(this._rawModule.mutations, fn);
  10995. }
  10996. };
  10997. Object.defineProperties( Module.prototype, prototypeAccessors );
  10998. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10999. // register root module (Vuex.Store options)
  11000. this.register([], rawRootModule, false);
  11001. };
  11002. ModuleCollection.prototype.get = function get (path) {
  11003. return path.reduce(function (module, key) {
  11004. return module.getChild(key)
  11005. }, this.root)
  11006. };
  11007. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  11008. var module = this.root;
  11009. return path.reduce(function (namespace, key) {
  11010. module = module.getChild(key);
  11011. return namespace + (module.namespaced ? key + '/' : '')
  11012. }, '')
  11013. };
  11014. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  11015. update([], this.root, rawRootModule);
  11016. };
  11017. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  11018. var this$1 = this;
  11019. if ( runtime === void 0 ) runtime = true;
  11020. if ((true)) {
  11021. assertRawModule(path, rawModule);
  11022. }
  11023. var newModule = new Module(rawModule, runtime);
  11024. if (path.length === 0) {
  11025. this.root = newModule;
  11026. } else {
  11027. var parent = this.get(path.slice(0, -1));
  11028. parent.addChild(path[path.length - 1], newModule);
  11029. }
  11030. // register nested modules
  11031. if (rawModule.modules) {
  11032. forEachValue(rawModule.modules, function (rawChildModule, key) {
  11033. this$1.register(path.concat(key), rawChildModule, runtime);
  11034. });
  11035. }
  11036. };
  11037. ModuleCollection.prototype.unregister = function unregister (path) {
  11038. var parent = this.get(path.slice(0, -1));
  11039. var key = path[path.length - 1];
  11040. var child = parent.getChild(key);
  11041. if (!child) {
  11042. if ((true)) {
  11043. console.warn(
  11044. "[vuex] trying to unregister module '" + key + "', which is " +
  11045. "not registered"
  11046. );
  11047. }
  11048. return
  11049. }
  11050. if (!child.runtime) {
  11051. return
  11052. }
  11053. parent.removeChild(key);
  11054. };
  11055. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  11056. var parent = this.get(path.slice(0, -1));
  11057. var key = path[path.length - 1];
  11058. if (parent) {
  11059. return parent.hasChild(key)
  11060. }
  11061. return false
  11062. };
  11063. function update (path, targetModule, newModule) {
  11064. if ((true)) {
  11065. assertRawModule(path, newModule);
  11066. }
  11067. // update target module
  11068. targetModule.update(newModule);
  11069. // update nested modules
  11070. if (newModule.modules) {
  11071. for (var key in newModule.modules) {
  11072. if (!targetModule.getChild(key)) {
  11073. if ((true)) {
  11074. console.warn(
  11075. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  11076. 'manual reload is needed'
  11077. );
  11078. }
  11079. return
  11080. }
  11081. update(
  11082. path.concat(key),
  11083. targetModule.getChild(key),
  11084. newModule.modules[key]
  11085. );
  11086. }
  11087. }
  11088. }
  11089. var functionAssert = {
  11090. assert: function (value) { return typeof value === 'function'; },
  11091. expected: 'function'
  11092. };
  11093. var objectAssert = {
  11094. assert: function (value) { return typeof value === 'function' ||
  11095. (typeof value === 'object' && typeof value.handler === 'function'); },
  11096. expected: 'function or object with "handler" function'
  11097. };
  11098. var assertTypes = {
  11099. getters: functionAssert,
  11100. mutations: functionAssert,
  11101. actions: objectAssert
  11102. };
  11103. function assertRawModule (path, rawModule) {
  11104. Object.keys(assertTypes).forEach(function (key) {
  11105. if (!rawModule[key]) { return }
  11106. var assertOptions = assertTypes[key];
  11107. forEachValue(rawModule[key], function (value, type) {
  11108. assert(
  11109. assertOptions.assert(value),
  11110. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  11111. );
  11112. });
  11113. });
  11114. }
  11115. function makeAssertionMessage (path, key, type, value, expected) {
  11116. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  11117. if (path.length > 0) {
  11118. buf += " in module \"" + (path.join('.')) + "\"";
  11119. }
  11120. buf += " is " + (JSON.stringify(value)) + ".";
  11121. return buf
  11122. }
  11123. var Vue; // bind on install
  11124. var Store = function Store (options) {
  11125. var this$1 = this;
  11126. if ( options === void 0 ) options = {};
  11127. // Auto install if it is not done yet and `window` has `Vue`.
  11128. // To allow users to avoid auto-installation in some cases,
  11129. // this code should be placed here. See #731
  11130. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  11131. install(window.Vue);
  11132. }
  11133. if ((true)) {
  11134. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  11135. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  11136. assert(this instanceof Store, "store must be called with the new operator.");
  11137. }
  11138. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  11139. var strict = options.strict; if ( strict === void 0 ) strict = false;
  11140. // store internal state
  11141. this._committing = false;
  11142. this._actions = Object.create(null);
  11143. this._actionSubscribers = [];
  11144. this._mutations = Object.create(null);
  11145. this._wrappedGetters = Object.create(null);
  11146. this._modules = new ModuleCollection(options);
  11147. this._modulesNamespaceMap = Object.create(null);
  11148. this._subscribers = [];
  11149. this._watcherVM = new Vue();
  11150. this._makeLocalGettersCache = Object.create(null);
  11151. // bind commit and dispatch to self
  11152. var store = this;
  11153. var ref = this;
  11154. var dispatch = ref.dispatch;
  11155. var commit = ref.commit;
  11156. this.dispatch = function boundDispatch (type, payload) {
  11157. return dispatch.call(store, type, payload)
  11158. };
  11159. this.commit = function boundCommit (type, payload, options) {
  11160. return commit.call(store, type, payload, options)
  11161. };
  11162. // strict mode
  11163. this.strict = strict;
  11164. var state = this._modules.root.state;
  11165. // init root module.
  11166. // this also recursively registers all sub-modules
  11167. // and collects all module getters inside this._wrappedGetters
  11168. installModule(this, state, [], this._modules.root);
  11169. // initialize the store vm, which is responsible for the reactivity
  11170. // (also registers _wrappedGetters as computed properties)
  11171. resetStoreVM(this, state);
  11172. // apply plugins
  11173. plugins.forEach(function (plugin) { return plugin(this$1); });
  11174. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  11175. if (useDevtools) {
  11176. devtoolPlugin(this);
  11177. }
  11178. };
  11179. var prototypeAccessors$1 = { state: { configurable: true } };
  11180. prototypeAccessors$1.state.get = function () {
  11181. return this._vm._data.$$state
  11182. };
  11183. prototypeAccessors$1.state.set = function (v) {
  11184. if ((true)) {
  11185. assert(false, "use store.replaceState() to explicit replace store state.");
  11186. }
  11187. };
  11188. Store.prototype.commit = function commit (_type, _payload, _options) {
  11189. var this$1 = this;
  11190. // check object-style commit
  11191. var ref = unifyObjectStyle(_type, _payload, _options);
  11192. var type = ref.type;
  11193. var payload = ref.payload;
  11194. var options = ref.options;
  11195. var mutation = { type: type, payload: payload };
  11196. var entry = this._mutations[type];
  11197. if (!entry) {
  11198. if ((true)) {
  11199. console.error(("[vuex] unknown mutation type: " + type));
  11200. }
  11201. return
  11202. }
  11203. this._withCommit(function () {
  11204. entry.forEach(function commitIterator (handler) {
  11205. handler(payload);
  11206. });
  11207. });
  11208. this._subscribers
  11209. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  11210. .forEach(function (sub) { return sub(mutation, this$1.state); });
  11211. if (
  11212. ( true) &&
  11213. options && options.silent
  11214. ) {
  11215. console.warn(
  11216. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  11217. 'Use the filter functionality in the vue-devtools'
  11218. );
  11219. }
  11220. };
  11221. Store.prototype.dispatch = function dispatch (_type, _payload) {
  11222. var this$1 = this;
  11223. // check object-style dispatch
  11224. var ref = unifyObjectStyle(_type, _payload);
  11225. var type = ref.type;
  11226. var payload = ref.payload;
  11227. var action = { type: type, payload: payload };
  11228. var entry = this._actions[type];
  11229. if (!entry) {
  11230. if ((true)) {
  11231. console.error(("[vuex] unknown action type: " + type));
  11232. }
  11233. return
  11234. }
  11235. try {
  11236. this._actionSubscribers
  11237. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  11238. .filter(function (sub) { return sub.before; })
  11239. .forEach(function (sub) { return sub.before(action, this$1.state); });
  11240. } catch (e) {
  11241. if ((true)) {
  11242. console.warn("[vuex] error in before action subscribers: ");
  11243. console.error(e);
  11244. }
  11245. }
  11246. var result = entry.length > 1
  11247. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  11248. : entry[0](payload);
  11249. return new Promise(function (resolve, reject) {
  11250. result.then(function (res) {
  11251. try {
  11252. this$1._actionSubscribers
  11253. .filter(function (sub) { return sub.after; })
  11254. .forEach(function (sub) { return sub.after(action, this$1.state); });
  11255. } catch (e) {
  11256. if ((true)) {
  11257. console.warn("[vuex] error in after action subscribers: ");
  11258. console.error(e);
  11259. }
  11260. }
  11261. resolve(res);
  11262. }, function (error) {
  11263. try {
  11264. this$1._actionSubscribers
  11265. .filter(function (sub) { return sub.error; })
  11266. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  11267. } catch (e) {
  11268. if ((true)) {
  11269. console.warn("[vuex] error in error action subscribers: ");
  11270. console.error(e);
  11271. }
  11272. }
  11273. reject(error);
  11274. });
  11275. })
  11276. };
  11277. Store.prototype.subscribe = function subscribe (fn, options) {
  11278. return genericSubscribe(fn, this._subscribers, options)
  11279. };
  11280. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  11281. var subs = typeof fn === 'function' ? { before: fn } : fn;
  11282. return genericSubscribe(subs, this._actionSubscribers, options)
  11283. };
  11284. Store.prototype.watch = function watch (getter, cb, options) {
  11285. var this$1 = this;
  11286. if ((true)) {
  11287. assert(typeof getter === 'function', "store.watch only accepts a function.");
  11288. }
  11289. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  11290. };
  11291. Store.prototype.replaceState = function replaceState (state) {
  11292. var this$1 = this;
  11293. this._withCommit(function () {
  11294. this$1._vm._data.$$state = state;
  11295. });
  11296. };
  11297. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  11298. if ( options === void 0 ) options = {};
  11299. if (typeof path === 'string') { path = [path]; }
  11300. if ((true)) {
  11301. assert(Array.isArray(path), "module path must be a string or an Array.");
  11302. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  11303. }
  11304. this._modules.register(path, rawModule);
  11305. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  11306. // reset store to update getters...
  11307. resetStoreVM(this, this.state);
  11308. };
  11309. Store.prototype.unregisterModule = function unregisterModule (path) {
  11310. var this$1 = this;
  11311. if (typeof path === 'string') { path = [path]; }
  11312. if ((true)) {
  11313. assert(Array.isArray(path), "module path must be a string or an Array.");
  11314. }
  11315. this._modules.unregister(path);
  11316. this._withCommit(function () {
  11317. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  11318. Vue.delete(parentState, path[path.length - 1]);
  11319. });
  11320. resetStore(this);
  11321. };
  11322. Store.prototype.hasModule = function hasModule (path) {
  11323. if (typeof path === 'string') { path = [path]; }
  11324. if ((true)) {
  11325. assert(Array.isArray(path), "module path must be a string or an Array.");
  11326. }
  11327. return this._modules.isRegistered(path)
  11328. };
  11329. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  11330. this._modules.update(newOptions);
  11331. resetStore(this, true);
  11332. };
  11333. Store.prototype._withCommit = function _withCommit (fn) {
  11334. var committing = this._committing;
  11335. this._committing = true;
  11336. fn();
  11337. this._committing = committing;
  11338. };
  11339. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  11340. function genericSubscribe (fn, subs, options) {
  11341. if (subs.indexOf(fn) < 0) {
  11342. options && options.prepend
  11343. ? subs.unshift(fn)
  11344. : subs.push(fn);
  11345. }
  11346. return function () {
  11347. var i = subs.indexOf(fn);
  11348. if (i > -1) {
  11349. subs.splice(i, 1);
  11350. }
  11351. }
  11352. }
  11353. function resetStore (store, hot) {
  11354. store._actions = Object.create(null);
  11355. store._mutations = Object.create(null);
  11356. store._wrappedGetters = Object.create(null);
  11357. store._modulesNamespaceMap = Object.create(null);
  11358. var state = store.state;
  11359. // init all modules
  11360. installModule(store, state, [], store._modules.root, true);
  11361. // reset vm
  11362. resetStoreVM(store, state, hot);
  11363. }
  11364. function resetStoreVM (store, state, hot) {
  11365. var oldVm = store._vm;
  11366. // bind store public getters
  11367. store.getters = {};
  11368. // reset local getters cache
  11369. store._makeLocalGettersCache = Object.create(null);
  11370. var wrappedGetters = store._wrappedGetters;
  11371. var computed = {};
  11372. forEachValue(wrappedGetters, function (fn, key) {
  11373. // use computed to leverage its lazy-caching mechanism
  11374. // direct inline function use will lead to closure preserving oldVm.
  11375. // using partial to return function with only arguments preserved in closure environment.
  11376. computed[key] = partial(fn, store);
  11377. Object.defineProperty(store.getters, key, {
  11378. get: function () { return store._vm[key]; },
  11379. enumerable: true // for local getters
  11380. });
  11381. });
  11382. // use a Vue instance to store the state tree
  11383. // suppress warnings just in case the user has added
  11384. // some funky global mixins
  11385. var silent = Vue.config.silent;
  11386. Vue.config.silent = true;
  11387. store._vm = new Vue({
  11388. data: {
  11389. $$state: state
  11390. },
  11391. computed: computed
  11392. });
  11393. Vue.config.silent = silent;
  11394. // enable strict mode for new vm
  11395. if (store.strict) {
  11396. enableStrictMode(store);
  11397. }
  11398. if (oldVm) {
  11399. if (hot) {
  11400. // dispatch changes in all subscribed watchers
  11401. // to force getter re-evaluation for hot reloading.
  11402. store._withCommit(function () {
  11403. oldVm._data.$$state = null;
  11404. });
  11405. }
  11406. Vue.nextTick(function () { return oldVm.$destroy(); });
  11407. }
  11408. }
  11409. function installModule (store, rootState, path, module, hot) {
  11410. var isRoot = !path.length;
  11411. var namespace = store._modules.getNamespace(path);
  11412. // register in namespace map
  11413. if (module.namespaced) {
  11414. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  11415. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  11416. }
  11417. store._modulesNamespaceMap[namespace] = module;
  11418. }
  11419. // set state
  11420. if (!isRoot && !hot) {
  11421. var parentState = getNestedState(rootState, path.slice(0, -1));
  11422. var moduleName = path[path.length - 1];
  11423. store._withCommit(function () {
  11424. if ((true)) {
  11425. if (moduleName in parentState) {
  11426. console.warn(
  11427. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  11428. );
  11429. }
  11430. }
  11431. Vue.set(parentState, moduleName, module.state);
  11432. });
  11433. }
  11434. var local = module.context = makeLocalContext(store, namespace, path);
  11435. module.forEachMutation(function (mutation, key) {
  11436. var namespacedType = namespace + key;
  11437. registerMutation(store, namespacedType, mutation, local);
  11438. });
  11439. module.forEachAction(function (action, key) {
  11440. var type = action.root ? key : namespace + key;
  11441. var handler = action.handler || action;
  11442. registerAction(store, type, handler, local);
  11443. });
  11444. module.forEachGetter(function (getter, key) {
  11445. var namespacedType = namespace + key;
  11446. registerGetter(store, namespacedType, getter, local);
  11447. });
  11448. module.forEachChild(function (child, key) {
  11449. installModule(store, rootState, path.concat(key), child, hot);
  11450. });
  11451. }
  11452. /**
  11453. * make localized dispatch, commit, getters and state
  11454. * if there is no namespace, just use root ones
  11455. */
  11456. function makeLocalContext (store, namespace, path) {
  11457. var noNamespace = namespace === '';
  11458. var local = {
  11459. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  11460. var args = unifyObjectStyle(_type, _payload, _options);
  11461. var payload = args.payload;
  11462. var options = args.options;
  11463. var type = args.type;
  11464. if (!options || !options.root) {
  11465. type = namespace + type;
  11466. if (( true) && !store._actions[type]) {
  11467. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  11468. return
  11469. }
  11470. }
  11471. return store.dispatch(type, payload)
  11472. },
  11473. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  11474. var args = unifyObjectStyle(_type, _payload, _options);
  11475. var payload = args.payload;
  11476. var options = args.options;
  11477. var type = args.type;
  11478. if (!options || !options.root) {
  11479. type = namespace + type;
  11480. if (( true) && !store._mutations[type]) {
  11481. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  11482. return
  11483. }
  11484. }
  11485. store.commit(type, payload, options);
  11486. }
  11487. };
  11488. // getters and state object must be gotten lazily
  11489. // because they will be changed by vm update
  11490. Object.defineProperties(local, {
  11491. getters: {
  11492. get: noNamespace
  11493. ? function () { return store.getters; }
  11494. : function () { return makeLocalGetters(store, namespace); }
  11495. },
  11496. state: {
  11497. get: function () { return getNestedState(store.state, path); }
  11498. }
  11499. });
  11500. return local
  11501. }
  11502. function makeLocalGetters (store, namespace) {
  11503. if (!store._makeLocalGettersCache[namespace]) {
  11504. var gettersProxy = {};
  11505. var splitPos = namespace.length;
  11506. Object.keys(store.getters).forEach(function (type) {
  11507. // skip if the target getter is not match this namespace
  11508. if (type.slice(0, splitPos) !== namespace) { return }
  11509. // extract local getter type
  11510. var localType = type.slice(splitPos);
  11511. // Add a port to the getters proxy.
  11512. // Define as getter property because
  11513. // we do not want to evaluate the getters in this time.
  11514. Object.defineProperty(gettersProxy, localType, {
  11515. get: function () { return store.getters[type]; },
  11516. enumerable: true
  11517. });
  11518. });
  11519. store._makeLocalGettersCache[namespace] = gettersProxy;
  11520. }
  11521. return store._makeLocalGettersCache[namespace]
  11522. }
  11523. function registerMutation (store, type, handler, local) {
  11524. var entry = store._mutations[type] || (store._mutations[type] = []);
  11525. entry.push(function wrappedMutationHandler (payload) {
  11526. handler.call(store, local.state, payload);
  11527. });
  11528. }
  11529. function registerAction (store, type, handler, local) {
  11530. var entry = store._actions[type] || (store._actions[type] = []);
  11531. entry.push(function wrappedActionHandler (payload) {
  11532. var res = handler.call(store, {
  11533. dispatch: local.dispatch,
  11534. commit: local.commit,
  11535. getters: local.getters,
  11536. state: local.state,
  11537. rootGetters: store.getters,
  11538. rootState: store.state
  11539. }, payload);
  11540. if (!isPromise(res)) {
  11541. res = Promise.resolve(res);
  11542. }
  11543. if (store._devtoolHook) {
  11544. return res.catch(function (err) {
  11545. store._devtoolHook.emit('vuex:error', err);
  11546. throw err
  11547. })
  11548. } else {
  11549. return res
  11550. }
  11551. });
  11552. }
  11553. function registerGetter (store, type, rawGetter, local) {
  11554. if (store._wrappedGetters[type]) {
  11555. if ((true)) {
  11556. console.error(("[vuex] duplicate getter key: " + type));
  11557. }
  11558. return
  11559. }
  11560. store._wrappedGetters[type] = function wrappedGetter (store) {
  11561. return rawGetter(
  11562. local.state, // local state
  11563. local.getters, // local getters
  11564. store.state, // root state
  11565. store.getters // root getters
  11566. )
  11567. };
  11568. }
  11569. function enableStrictMode (store) {
  11570. store._vm.$watch(function () { return this._data.$$state }, function () {
  11571. if ((true)) {
  11572. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  11573. }
  11574. }, { deep: true, sync: true });
  11575. }
  11576. function getNestedState (state, path) {
  11577. return path.reduce(function (state, key) { return state[key]; }, state)
  11578. }
  11579. function unifyObjectStyle (type, payload, options) {
  11580. if (isObject(type) && type.type) {
  11581. options = payload;
  11582. payload = type;
  11583. type = type.type;
  11584. }
  11585. if ((true)) {
  11586. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  11587. }
  11588. return { type: type, payload: payload, options: options }
  11589. }
  11590. function install (_Vue) {
  11591. if (Vue && _Vue === Vue) {
  11592. if ((true)) {
  11593. console.error(
  11594. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  11595. );
  11596. }
  11597. return
  11598. }
  11599. Vue = _Vue;
  11600. applyMixin(Vue);
  11601. }
  11602. /**
  11603. * Reduce the code which written in Vue.js for getting the state.
  11604. * @param {String} [namespace] - Module's namespace
  11605. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  11606. * @param {Object}
  11607. */
  11608. var mapState = normalizeNamespace(function (namespace, states) {
  11609. var res = {};
  11610. if (( true) && !isValidMap(states)) {
  11611. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  11612. }
  11613. normalizeMap(states).forEach(function (ref) {
  11614. var key = ref.key;
  11615. var val = ref.val;
  11616. res[key] = function mappedState () {
  11617. var state = this.$store.state;
  11618. var getters = this.$store.getters;
  11619. if (namespace) {
  11620. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  11621. if (!module) {
  11622. return
  11623. }
  11624. state = module.context.state;
  11625. getters = module.context.getters;
  11626. }
  11627. return typeof val === 'function'
  11628. ? val.call(this, state, getters)
  11629. : state[val]
  11630. };
  11631. // mark vuex getter for devtools
  11632. res[key].vuex = true;
  11633. });
  11634. return res
  11635. });
  11636. /**
  11637. * Reduce the code which written in Vue.js for committing the mutation
  11638. * @param {String} [namespace] - Module's namespace
  11639. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  11640. * @return {Object}
  11641. */
  11642. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  11643. var res = {};
  11644. if (( true) && !isValidMap(mutations)) {
  11645. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  11646. }
  11647. normalizeMap(mutations).forEach(function (ref) {
  11648. var key = ref.key;
  11649. var val = ref.val;
  11650. res[key] = function mappedMutation () {
  11651. var args = [], len = arguments.length;
  11652. while ( len-- ) args[ len ] = arguments[ len ];
  11653. // Get the commit method from store
  11654. var commit = this.$store.commit;
  11655. if (namespace) {
  11656. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  11657. if (!module) {
  11658. return
  11659. }
  11660. commit = module.context.commit;
  11661. }
  11662. return typeof val === 'function'
  11663. ? val.apply(this, [commit].concat(args))
  11664. : commit.apply(this.$store, [val].concat(args))
  11665. };
  11666. });
  11667. return res
  11668. });
  11669. /**
  11670. * Reduce the code which written in Vue.js for getting the getters
  11671. * @param {String} [namespace] - Module's namespace
  11672. * @param {Object|Array} getters
  11673. * @return {Object}
  11674. */
  11675. var mapGetters = normalizeNamespace(function (namespace, getters) {
  11676. var res = {};
  11677. if (( true) && !isValidMap(getters)) {
  11678. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  11679. }
  11680. normalizeMap(getters).forEach(function (ref) {
  11681. var key = ref.key;
  11682. var val = ref.val;
  11683. // The namespace has been mutated by normalizeNamespace
  11684. val = namespace + val;
  11685. res[key] = function mappedGetter () {
  11686. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  11687. return
  11688. }
  11689. if (( true) && !(val in this.$store.getters)) {
  11690. console.error(("[vuex] unknown getter: " + val));
  11691. return
  11692. }
  11693. return this.$store.getters[val]
  11694. };
  11695. // mark vuex getter for devtools
  11696. res[key].vuex = true;
  11697. });
  11698. return res
  11699. });
  11700. /**
  11701. * Reduce the code which written in Vue.js for dispatch the action
  11702. * @param {String} [namespace] - Module's namespace
  11703. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  11704. * @return {Object}
  11705. */
  11706. var mapActions = normalizeNamespace(function (namespace, actions) {
  11707. var res = {};
  11708. if (( true) && !isValidMap(actions)) {
  11709. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  11710. }
  11711. normalizeMap(actions).forEach(function (ref) {
  11712. var key = ref.key;
  11713. var val = ref.val;
  11714. res[key] = function mappedAction () {
  11715. var args = [], len = arguments.length;
  11716. while ( len-- ) args[ len ] = arguments[ len ];
  11717. // get dispatch function from store
  11718. var dispatch = this.$store.dispatch;
  11719. if (namespace) {
  11720. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  11721. if (!module) {
  11722. return
  11723. }
  11724. dispatch = module.context.dispatch;
  11725. }
  11726. return typeof val === 'function'
  11727. ? val.apply(this, [dispatch].concat(args))
  11728. : dispatch.apply(this.$store, [val].concat(args))
  11729. };
  11730. });
  11731. return res
  11732. });
  11733. /**
  11734. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  11735. * @param {String} namespace
  11736. * @return {Object}
  11737. */
  11738. var createNamespacedHelpers = function (namespace) { return ({
  11739. mapState: mapState.bind(null, namespace),
  11740. mapGetters: mapGetters.bind(null, namespace),
  11741. mapMutations: mapMutations.bind(null, namespace),
  11742. mapActions: mapActions.bind(null, namespace)
  11743. }); };
  11744. /**
  11745. * Normalize the map
  11746. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  11747. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  11748. * @param {Array|Object} map
  11749. * @return {Object}
  11750. */
  11751. function normalizeMap (map) {
  11752. if (!isValidMap(map)) {
  11753. return []
  11754. }
  11755. return Array.isArray(map)
  11756. ? map.map(function (key) { return ({ key: key, val: key }); })
  11757. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  11758. }
  11759. /**
  11760. * Validate whether given map is valid or not
  11761. * @param {*} map
  11762. * @return {Boolean}
  11763. */
  11764. function isValidMap (map) {
  11765. return Array.isArray(map) || isObject(map)
  11766. }
  11767. /**
  11768. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  11769. * @param {Function} fn
  11770. * @return {Function}
  11771. */
  11772. function normalizeNamespace (fn) {
  11773. return function (namespace, map) {
  11774. if (typeof namespace !== 'string') {
  11775. map = namespace;
  11776. namespace = '';
  11777. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  11778. namespace += '/';
  11779. }
  11780. return fn(namespace, map)
  11781. }
  11782. }
  11783. /**
  11784. * Search a special module from store by namespace. if module not exist, print error message.
  11785. * @param {Object} store
  11786. * @param {String} helper
  11787. * @param {String} namespace
  11788. * @return {Object}
  11789. */
  11790. function getModuleByNamespace (store, helper, namespace) {
  11791. var module = store._modulesNamespaceMap[namespace];
  11792. if (( true) && !module) {
  11793. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11794. }
  11795. return module
  11796. }
  11797. // Credits: borrowed code from fcomb/redux-logger
  11798. function createLogger (ref) {
  11799. if ( ref === void 0 ) ref = {};
  11800. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  11801. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  11802. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  11803. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  11804. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  11805. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  11806. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  11807. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  11808. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  11809. return function (store) {
  11810. var prevState = deepCopy(store.state);
  11811. if (typeof logger === 'undefined') {
  11812. return
  11813. }
  11814. if (logMutations) {
  11815. store.subscribe(function (mutation, state) {
  11816. var nextState = deepCopy(state);
  11817. if (filter(mutation, prevState, nextState)) {
  11818. var formattedTime = getFormattedTime();
  11819. var formattedMutation = mutationTransformer(mutation);
  11820. var message = "mutation " + (mutation.type) + formattedTime;
  11821. startMessage(logger, message, collapsed);
  11822. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11823. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11824. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11825. endMessage(logger);
  11826. }
  11827. prevState = nextState;
  11828. });
  11829. }
  11830. if (logActions) {
  11831. store.subscribeAction(function (action, state) {
  11832. if (actionFilter(action, state)) {
  11833. var formattedTime = getFormattedTime();
  11834. var formattedAction = actionTransformer(action);
  11835. var message = "action " + (action.type) + formattedTime;
  11836. startMessage(logger, message, collapsed);
  11837. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11838. endMessage(logger);
  11839. }
  11840. });
  11841. }
  11842. }
  11843. }
  11844. function startMessage (logger, message, collapsed) {
  11845. var startMessage = collapsed
  11846. ? logger.groupCollapsed
  11847. : logger.group;
  11848. // render
  11849. try {
  11850. startMessage.call(logger, message);
  11851. } catch (e) {
  11852. logger.log(message);
  11853. }
  11854. }
  11855. function endMessage (logger) {
  11856. try {
  11857. logger.groupEnd();
  11858. } catch (e) {
  11859. logger.log('—— log end ——');
  11860. }
  11861. }
  11862. function getFormattedTime () {
  11863. var time = new Date();
  11864. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11865. }
  11866. function repeat (str, times) {
  11867. return (new Array(times + 1)).join(str)
  11868. }
  11869. function pad (num, maxLength) {
  11870. return repeat('0', maxLength - num.toString().length) + num
  11871. }
  11872. var index_cjs = {
  11873. Store: Store,
  11874. install: install,
  11875. version: '3.6.2',
  11876. mapState: mapState,
  11877. mapMutations: mapMutations,
  11878. mapGetters: mapGetters,
  11879. mapActions: mapActions,
  11880. createNamespacedHelpers: createNamespacedHelpers,
  11881. createLogger: createLogger
  11882. };
  11883. module.exports = index_cjs;
  11884. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  11885. /***/ }),
  11886. /***/ 32:
  11887. /*!*******************************************!*\
  11888. !*** E:/盈通/sulibao-mini/utils/storage.js ***!
  11889. \*******************************************/
  11890. /*! no static exports found */
  11891. /***/ (function(module, exports, __webpack_require__) {
  11892. "use strict";
  11893. /* WEBPACK VAR INJECTION */(function(uni) {
  11894. Object.defineProperty(exports, "__esModule", {
  11895. value: true
  11896. });
  11897. exports.default = void 0;
  11898. function set(key, data) {
  11899. var sync = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11900. try {
  11901. if (sync) {
  11902. return uni.setStorageSync(key, data);
  11903. } else {
  11904. uni.setStorage({
  11905. key: key,
  11906. data: data,
  11907. success: function success(res) {}
  11908. });
  11909. }
  11910. } catch (e) {
  11911. return false;
  11912. }
  11913. }
  11914. function get(key) {
  11915. var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11916. try {
  11917. if (sync) {
  11918. return uni.getStorageSync(key);
  11919. } else {
  11920. var val = '';
  11921. uni.getStorage({
  11922. key: key,
  11923. success: function success(res) {
  11924. val = res.data;
  11925. }
  11926. });
  11927. return val;
  11928. }
  11929. } catch (e) {
  11930. return false;
  11931. }
  11932. }
  11933. function info() {
  11934. var sync = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  11935. try {
  11936. if (sync) {
  11937. return uni.getStorageInfoSync();
  11938. } else {
  11939. var val = '';
  11940. uni.getStorageInfo({
  11941. success: function success(res) {
  11942. val = res;
  11943. }
  11944. });
  11945. return val;
  11946. }
  11947. } catch (e) {
  11948. return false;
  11949. }
  11950. }
  11951. function remove(key) {
  11952. var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11953. try {
  11954. if (sync) {
  11955. return uni.removeStorageSync(key);
  11956. } else {
  11957. uni.removeStorage({
  11958. key: key
  11959. });
  11960. }
  11961. } catch (e) {
  11962. return false;
  11963. }
  11964. }
  11965. function clear() {
  11966. var sync = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  11967. try {
  11968. if (sync) {
  11969. return uni.clearStorageSync();
  11970. } else {
  11971. uni.clearStorage();
  11972. }
  11973. } catch (e) {
  11974. return false;
  11975. }
  11976. }
  11977. function has(key) {
  11978. var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11979. try {
  11980. if (sync) {
  11981. return uni.getStorageSync(key) !== null;
  11982. } else {
  11983. var val = false;
  11984. uni.getStorage({
  11985. key: key,
  11986. success: function success(res) {
  11987. val = res.data !== null;
  11988. }
  11989. });
  11990. return val;
  11991. }
  11992. } catch (e) {
  11993. return false;
  11994. }
  11995. }
  11996. var storage = {
  11997. get: get,
  11998. set: set,
  11999. info: info,
  12000. remove: remove,
  12001. clear: clear,
  12002. has: has
  12003. };
  12004. var _default = storage;
  12005. exports.default = _default;
  12006. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12007. /***/ }),
  12008. /***/ 33:
  12009. /*!*************************************************************************!*\
  12010. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/updateCustomBarInfo.js ***!
  12011. \*************************************************************************/
  12012. /*! no static exports found */
  12013. /***/ (function(module, exports, __webpack_require__) {
  12014. "use strict";
  12015. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  12016. Object.defineProperty(exports, "__esModule", {
  12017. value: true
  12018. });
  12019. exports.default = void 0;
  12020. /**
  12021. * 更新自定义顶部导航栏的高度
  12022. */
  12023. function updateCustomBarInfo() {
  12024. return new Promise(function (resolve, reject) {
  12025. uni.getSystemInfo({
  12026. success: function success(e) {
  12027. var statusBarHeight = 0;
  12028. var customBarHeight = 0;
  12029. statusBarHeight = e.statusBarHeight;
  12030. var custom = wx.getMenuButtonBoundingClientRect();
  12031. customBarHeight = custom.bottom + (custom.top - e.statusBarHeight <= 4 ? custom.top - e.statusBarHeight + 4 : custom.top - e.statusBarHeight);
  12032. resolve({
  12033. statusBarHeight: statusBarHeight,
  12034. customBarHeight: customBarHeight
  12035. });
  12036. },
  12037. fail: function fail(err) {
  12038. console.log("获取设备信息失败", err);
  12039. reject();
  12040. }
  12041. });
  12042. });
  12043. }
  12044. var _default = updateCustomBarInfo;
  12045. exports.default = _default;
  12046. /* 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"]))
  12047. /***/ }),
  12048. /***/ 351:
  12049. /*!************************************************************************************!*\
  12050. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  12051. \************************************************************************************/
  12052. /*! no static exports found */
  12053. /***/ (function(module, exports, __webpack_require__) {
  12054. "use strict";
  12055. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  12056. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12057. Object.defineProperty(exports, "__esModule", {
  12058. value: true
  12059. });
  12060. exports.default = exports.UniCloudError = void 0;
  12061. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 63));
  12062. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 352));
  12063. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  12064. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12065. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  12066. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65));
  12067. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  12068. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 353));
  12069. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 354));
  12070. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 355));
  12071. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 356));
  12072. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  12073. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  12074. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 358));
  12075. 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; } } }; }
  12076. 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); }
  12077. 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; }
  12078. 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; }
  12079. 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; }
  12080. 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); }; }
  12081. 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; } }
  12082. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  12083. function t(e) {
  12084. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  12085. }
  12086. function n(e, t, n) {
  12087. return e(n = {
  12088. path: t,
  12089. exports: {},
  12090. require: function require(e, t) {
  12091. return function () {
  12092. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  12093. }(null == t && n.path);
  12094. }
  12095. }, n.exports), n.exports;
  12096. }
  12097. var s = n(function (e, t) {
  12098. var n;
  12099. e.exports = (n = n || function (e, t) {
  12100. var n = Object.create || function () {
  12101. function e() {}
  12102. return function (t) {
  12103. var n;
  12104. return e.prototype = t, n = new e(), e.prototype = null, n;
  12105. };
  12106. }(),
  12107. s = {},
  12108. r = s.lib = {},
  12109. i = r.Base = {
  12110. extend: function extend(e) {
  12111. var t = n(this);
  12112. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  12113. t.$super.init.apply(this, arguments);
  12114. }), t.init.prototype = t, t.$super = this, t;
  12115. },
  12116. create: function create() {
  12117. var e = this.extend();
  12118. return e.init.apply(e, arguments), e;
  12119. },
  12120. init: function init() {},
  12121. mixIn: function mixIn(e) {
  12122. for (var t in e) {
  12123. e.hasOwnProperty(t) && (this[t] = e[t]);
  12124. }
  12125. e.hasOwnProperty("toString") && (this.toString = e.toString);
  12126. },
  12127. clone: function clone() {
  12128. return this.init.prototype.extend(this);
  12129. }
  12130. },
  12131. o = r.WordArray = i.extend({
  12132. init: function init(e, n) {
  12133. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  12134. },
  12135. toString: function toString(e) {
  12136. return (e || c).stringify(this);
  12137. },
  12138. concat: function concat(e) {
  12139. var t = this.words,
  12140. n = e.words,
  12141. s = this.sigBytes,
  12142. r = e.sigBytes;
  12143. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  12144. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  12145. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  12146. } else for (i = 0; i < r; i += 4) {
  12147. t[s + i >>> 2] = n[i >>> 2];
  12148. }
  12149. return this.sigBytes += r, this;
  12150. },
  12151. clamp: function clamp() {
  12152. var t = this.words,
  12153. n = this.sigBytes;
  12154. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  12155. },
  12156. clone: function clone() {
  12157. var e = i.clone.call(this);
  12158. return e.words = this.words.slice(0), e;
  12159. },
  12160. random: function random(t) {
  12161. for (var n, s = [], r = function r(t) {
  12162. t = t;
  12163. var n = 987654321,
  12164. s = 4294967295;
  12165. return function () {
  12166. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  12167. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  12168. };
  12169. }, i = 0; i < t; i += 4) {
  12170. var a = r(4294967296 * (n || e.random()));
  12171. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  12172. }
  12173. return new o.init(s, t);
  12174. }
  12175. }),
  12176. a = s.enc = {},
  12177. c = a.Hex = {
  12178. stringify: function stringify(e) {
  12179. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  12180. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  12181. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  12182. }
  12183. return s.join("");
  12184. },
  12185. parse: function parse(e) {
  12186. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  12187. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  12188. }
  12189. return new o.init(n, t / 2);
  12190. }
  12191. },
  12192. u = a.Latin1 = {
  12193. stringify: function stringify(e) {
  12194. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  12195. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  12196. s.push(String.fromCharCode(i));
  12197. }
  12198. return s.join("");
  12199. },
  12200. parse: function parse(e) {
  12201. for (var t = e.length, n = [], s = 0; s < t; s++) {
  12202. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  12203. }
  12204. return new o.init(n, t);
  12205. }
  12206. },
  12207. l = a.Utf8 = {
  12208. stringify: function stringify(e) {
  12209. try {
  12210. return decodeURIComponent(escape(u.stringify(e)));
  12211. } catch (e) {
  12212. throw new Error("Malformed UTF-8 data");
  12213. }
  12214. },
  12215. parse: function parse(e) {
  12216. return u.parse(unescape(encodeURIComponent(e)));
  12217. }
  12218. },
  12219. h = r.BufferedBlockAlgorithm = i.extend({
  12220. reset: function reset() {
  12221. this._data = new o.init(), this._nDataBytes = 0;
  12222. },
  12223. _append: function _append(e) {
  12224. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  12225. },
  12226. _process: function _process(t) {
  12227. var n = this._data,
  12228. s = n.words,
  12229. r = n.sigBytes,
  12230. i = this.blockSize,
  12231. a = r / (4 * i),
  12232. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  12233. u = e.min(4 * c, r);
  12234. if (c) {
  12235. for (var l = 0; l < c; l += i) {
  12236. this._doProcessBlock(s, l);
  12237. }
  12238. var h = s.splice(0, c);
  12239. n.sigBytes -= u;
  12240. }
  12241. return new o.init(h, u);
  12242. },
  12243. clone: function clone() {
  12244. var e = i.clone.call(this);
  12245. return e._data = this._data.clone(), e;
  12246. },
  12247. _minBufferSize: 0
  12248. });
  12249. r.Hasher = h.extend({
  12250. cfg: i.extend(),
  12251. init: function init(e) {
  12252. this.cfg = this.cfg.extend(e), this.reset();
  12253. },
  12254. reset: function reset() {
  12255. h.reset.call(this), this._doReset();
  12256. },
  12257. update: function update(e) {
  12258. return this._append(e), this._process(), this;
  12259. },
  12260. finalize: function finalize(e) {
  12261. return e && this._append(e), this._doFinalize();
  12262. },
  12263. blockSize: 16,
  12264. _createHelper: function _createHelper(e) {
  12265. return function (t, n) {
  12266. return new e.init(n).finalize(t);
  12267. };
  12268. },
  12269. _createHmacHelper: function _createHmacHelper(e) {
  12270. return function (t, n) {
  12271. return new d.HMAC.init(e, n).finalize(t);
  12272. };
  12273. }
  12274. });
  12275. var d = s.algo = {};
  12276. return s;
  12277. }(Math), n);
  12278. }),
  12279. r = s,
  12280. i = (n(function (e, t) {
  12281. var n;
  12282. e.exports = (n = r, function (e) {
  12283. var t = n,
  12284. s = t.lib,
  12285. r = s.WordArray,
  12286. i = s.Hasher,
  12287. o = t.algo,
  12288. a = [];
  12289. !function () {
  12290. for (var t = 0; t < 64; t++) {
  12291. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  12292. }
  12293. }();
  12294. var c = o.MD5 = i.extend({
  12295. _doReset: function _doReset() {
  12296. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  12297. },
  12298. _doProcessBlock: function _doProcessBlock(e, t) {
  12299. for (var n = 0; n < 16; n++) {
  12300. var s = t + n,
  12301. r = e[s];
  12302. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  12303. }
  12304. var i = this._hash.words,
  12305. o = e[t + 0],
  12306. c = e[t + 1],
  12307. p = e[t + 2],
  12308. f = e[t + 3],
  12309. g = e[t + 4],
  12310. m = e[t + 5],
  12311. y = e[t + 6],
  12312. _ = e[t + 7],
  12313. w = e[t + 8],
  12314. v = e[t + 9],
  12315. I = e[t + 10],
  12316. S = e[t + 11],
  12317. b = e[t + 12],
  12318. k = e[t + 13],
  12319. A = e[t + 14],
  12320. C = e[t + 15],
  12321. P = i[0],
  12322. T = i[1],
  12323. x = i[2],
  12324. O = i[3];
  12325. P = u(P, T, x, O, o, 7, a[0]), O = u(O, P, T, x, c, 12, a[1]), x = u(x, O, P, T, p, 17, a[2]), T = u(T, x, O, P, f, 22, a[3]), P = u(P, T, x, O, g, 7, a[4]), O = u(O, P, T, x, m, 12, a[5]), x = u(x, O, P, T, y, 17, a[6]), T = u(T, x, O, P, _, 22, a[7]), P = u(P, T, x, O, w, 7, a[8]), O = u(O, P, T, x, v, 12, a[9]), x = u(x, O, P, T, I, 17, a[10]), T = u(T, x, O, P, S, 22, a[11]), P = u(P, T, x, O, b, 7, a[12]), O = u(O, P, T, x, k, 12, a[13]), x = u(x, O, P, T, A, 17, a[14]), P = l(P, T = u(T, x, O, P, C, 22, a[15]), x, O, c, 5, a[16]), O = l(O, P, T, x, y, 9, a[17]), x = l(x, O, P, T, S, 14, a[18]), T = l(T, x, O, P, o, 20, a[19]), P = l(P, T, x, O, m, 5, a[20]), O = l(O, P, T, x, I, 9, a[21]), x = l(x, O, P, T, C, 14, a[22]), T = l(T, x, O, P, g, 20, a[23]), P = l(P, T, x, O, v, 5, a[24]), O = l(O, P, T, x, A, 9, a[25]), x = l(x, O, P, T, f, 14, a[26]), T = l(T, x, O, P, w, 20, a[27]), P = l(P, T, x, O, k, 5, a[28]), O = l(O, P, T, x, p, 9, a[29]), x = l(x, O, P, T, _, 14, a[30]), P = h(P, T = l(T, x, O, P, b, 20, a[31]), x, O, m, 4, a[32]), O = h(O, P, T, x, w, 11, a[33]), x = h(x, O, P, T, S, 16, a[34]), T = h(T, x, O, P, A, 23, a[35]), P = h(P, T, x, O, c, 4, a[36]), O = h(O, P, T, x, g, 11, a[37]), x = h(x, O, P, T, _, 16, a[38]), T = h(T, x, O, P, I, 23, a[39]), P = h(P, T, x, O, k, 4, a[40]), O = h(O, P, T, x, o, 11, a[41]), x = h(x, O, P, T, f, 16, a[42]), T = h(T, x, O, P, y, 23, a[43]), P = h(P, T, x, O, v, 4, a[44]), O = h(O, P, T, x, b, 11, a[45]), x = h(x, O, P, T, C, 16, a[46]), P = d(P, T = h(T, x, O, P, p, 23, a[47]), x, O, o, 6, a[48]), O = d(O, P, T, x, _, 10, a[49]), x = d(x, O, P, T, A, 15, a[50]), T = d(T, x, O, P, m, 21, a[51]), P = d(P, T, x, O, b, 6, a[52]), O = d(O, P, T, x, f, 10, a[53]), x = d(x, O, P, T, I, 15, a[54]), T = d(T, x, O, P, c, 21, a[55]), P = d(P, T, x, O, w, 6, a[56]), O = d(O, P, T, x, C, 10, a[57]), x = d(x, O, P, T, y, 15, a[58]), T = d(T, x, O, P, k, 21, a[59]), P = d(P, T, x, O, g, 6, a[60]), O = d(O, P, T, x, S, 10, a[61]), x = d(x, O, P, T, p, 15, a[62]), T = d(T, x, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + T | 0, i[2] = i[2] + x | 0, i[3] = i[3] + O | 0;
  12326. },
  12327. _doFinalize: function _doFinalize() {
  12328. var t = this._data,
  12329. n = t.words,
  12330. s = 8 * this._nDataBytes,
  12331. r = 8 * t.sigBytes;
  12332. n[r >>> 5] |= 128 << 24 - r % 32;
  12333. var i = e.floor(s / 4294967296),
  12334. o = s;
  12335. 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();
  12336. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  12337. var l = c[u];
  12338. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  12339. }
  12340. return a;
  12341. },
  12342. clone: function clone() {
  12343. var e = i.clone.call(this);
  12344. return e._hash = this._hash.clone(), e;
  12345. }
  12346. });
  12347. function u(e, t, n, s, r, i, o) {
  12348. var a = e + (t & n | ~t & s) + r + o;
  12349. return (a << i | a >>> 32 - i) + t;
  12350. }
  12351. function l(e, t, n, s, r, i, o) {
  12352. var a = e + (t & s | n & ~s) + r + o;
  12353. return (a << i | a >>> 32 - i) + t;
  12354. }
  12355. function h(e, t, n, s, r, i, o) {
  12356. var a = e + (t ^ n ^ s) + r + o;
  12357. return (a << i | a >>> 32 - i) + t;
  12358. }
  12359. function d(e, t, n, s, r, i, o) {
  12360. var a = e + (n ^ (t | ~s)) + r + o;
  12361. return (a << i | a >>> 32 - i) + t;
  12362. }
  12363. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  12364. }(Math), n.MD5);
  12365. }), n(function (e, t) {
  12366. var n;
  12367. e.exports = (n = r, void function () {
  12368. var e = n,
  12369. t = e.lib.Base,
  12370. s = e.enc.Utf8;
  12371. e.algo.HMAC = t.extend({
  12372. init: function init(e, t) {
  12373. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  12374. var n = e.blockSize,
  12375. r = 4 * n;
  12376. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  12377. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  12378. a[u] ^= 1549556828, c[u] ^= 909522486;
  12379. }
  12380. i.sigBytes = o.sigBytes = r, this.reset();
  12381. },
  12382. reset: function reset() {
  12383. var e = this._hasher;
  12384. e.reset(), e.update(this._iKey);
  12385. },
  12386. update: function update(e) {
  12387. return this._hasher.update(e), this;
  12388. },
  12389. finalize: function finalize(e) {
  12390. var t = this._hasher,
  12391. n = t.finalize(e);
  12392. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  12393. }
  12394. });
  12395. }());
  12396. }), n(function (e, t) {
  12397. e.exports = r.HmacMD5;
  12398. })),
  12399. o = n(function (e, t) {
  12400. e.exports = r.enc.Utf8;
  12401. }),
  12402. a = n(function (e, t) {
  12403. var n;
  12404. e.exports = (n = r, function () {
  12405. var e = n,
  12406. t = e.lib.WordArray;
  12407. function s(e, n, s) {
  12408. for (var r = [], i = 0, o = 0; o < n; o++) {
  12409. if (o % 4) {
  12410. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  12411. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  12412. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  12413. }
  12414. }
  12415. return t.create(r, i);
  12416. }
  12417. e.enc.Base64 = {
  12418. stringify: function stringify(e) {
  12419. var t = e.words,
  12420. n = e.sigBytes,
  12421. s = this._map;
  12422. e.clamp();
  12423. for (var r = [], i = 0; i < n; i += 3) {
  12424. 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++) {
  12425. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  12426. }
  12427. }
  12428. var c = s.charAt(64);
  12429. if (c) for (; r.length % 4;) {
  12430. r.push(c);
  12431. }
  12432. return r.join("");
  12433. },
  12434. parse: function parse(e) {
  12435. var t = e.length,
  12436. n = this._map,
  12437. r = this._reverseMap;
  12438. if (!r) {
  12439. r = this._reverseMap = [];
  12440. for (var i = 0; i < n.length; i++) {
  12441. r[n.charCodeAt(i)] = i;
  12442. }
  12443. }
  12444. var o = n.charAt(64);
  12445. if (o) {
  12446. var a = e.indexOf(o);
  12447. -1 !== a && (t = a);
  12448. }
  12449. return s(e, t, r);
  12450. },
  12451. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  12452. };
  12453. }(), n.enc.Base64);
  12454. });
  12455. var c = "FUNCTION",
  12456. u = "OBJECT",
  12457. l = "CLIENT_DB",
  12458. h = "pending",
  12459. d = "fulfilled",
  12460. p = "rejected";
  12461. function f(e) {
  12462. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  12463. }
  12464. function g(e) {
  12465. return "object" === f(e);
  12466. }
  12467. function m(e) {
  12468. return "function" == typeof e;
  12469. }
  12470. function y(e) {
  12471. return function () {
  12472. try {
  12473. return e.apply(e, arguments);
  12474. } catch (e) {
  12475. console.error(e);
  12476. }
  12477. };
  12478. }
  12479. var _ = "REJECTED",
  12480. w = "NOT_PENDING";
  12481. var v = /*#__PURE__*/function () {
  12482. function v() {
  12483. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12484. e = _ref.createPromise,
  12485. _ref$retryRule = _ref.retryRule,
  12486. t = _ref$retryRule === void 0 ? _ : _ref$retryRule;
  12487. (0, _classCallCheck2.default)(this, v);
  12488. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  12489. }
  12490. (0, _createClass2.default)(v, [{
  12491. key: "needRetry",
  12492. get: function get() {
  12493. if (!this.status) return !0;
  12494. switch (this.retryRule) {
  12495. case _:
  12496. return this.status === p;
  12497. case w:
  12498. return this.status !== h;
  12499. }
  12500. }
  12501. }, {
  12502. key: "exec",
  12503. value: function exec() {
  12504. var _this = this;
  12505. return this.needRetry ? (this.status = h, this.promise = this.createPromise().then(function (e) {
  12506. return _this.status = d, Promise.resolve(e);
  12507. }, function (e) {
  12508. return _this.status = p, Promise.reject(e);
  12509. }), this.promise) : this.promise;
  12510. }
  12511. }]);
  12512. return v;
  12513. }();
  12514. function I(e) {
  12515. return e && "string" == typeof e ? JSON.parse(e) : e;
  12516. }
  12517. var S = "development" === "development",
  12518. b = "mp-weixin",
  12519. k = "true" === undefined || !0 === undefined,
  12520. A = I([]),
  12521. C = "h5" === b ? "web" : "app-plus" === b ? "app" : b,
  12522. P = I(undefined),
  12523. T = I([]) || [],
  12524. x = true;
  12525. var O = "";
  12526. try {
  12527. O = (__webpack_require__(/*! uni-stat-config */ 359).default || __webpack_require__(/*! uni-stat-config */ 359)).appid;
  12528. } catch (e) {}
  12529. var E = {};
  12530. function L(e) {
  12531. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12532. var n, s;
  12533. return n = E, s = e, Object.prototype.hasOwnProperty.call(n, s) || (E[e] = t), E[e];
  12534. }
  12535. "app" === C && (E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  12536. var R = ["invoke", "success", "fail", "complete"],
  12537. U = L("_globalUniCloudInterceptor");
  12538. function N(e, t) {
  12539. U[e] || (U[e] = {}), g(t) && Object.keys(t).forEach(function (n) {
  12540. R.indexOf(n) > -1 && function (e, t, n) {
  12541. var s = U[e][t];
  12542. s || (s = U[e][t] = []), -1 === s.indexOf(n) && m(n) && s.push(n);
  12543. }(e, n, t[n]);
  12544. });
  12545. }
  12546. function D(e, t) {
  12547. U[e] || (U[e] = {}), g(t) ? Object.keys(t).forEach(function (n) {
  12548. R.indexOf(n) > -1 && function (e, t, n) {
  12549. var s = U[e][t];
  12550. if (!s) return;
  12551. var r = s.indexOf(n);
  12552. r > -1 && s.splice(r, 1);
  12553. }(e, n, t[n]);
  12554. }) : delete U[e];
  12555. }
  12556. function q(e, t) {
  12557. return e && 0 !== e.length ? e.reduce(function (e, n) {
  12558. return e.then(function () {
  12559. return n(t);
  12560. });
  12561. }, Promise.resolve()) : Promise.resolve();
  12562. }
  12563. function M(e, t) {
  12564. return U[e] && U[e][t] || [];
  12565. }
  12566. function F(e) {
  12567. N("callObject", e);
  12568. }
  12569. var K = L("_globalUniCloudListener"),
  12570. j = "response",
  12571. $ = "needLogin",
  12572. B = "refreshToken",
  12573. W = "clientdb",
  12574. H = "cloudfunction",
  12575. J = "cloudobject";
  12576. function z(e) {
  12577. return K[e] || (K[e] = []), K[e];
  12578. }
  12579. function V(e, t) {
  12580. var n = z(e);
  12581. n.includes(t) || n.push(t);
  12582. }
  12583. function G(e, t) {
  12584. var n = z(e),
  12585. s = n.indexOf(t);
  12586. -1 !== s && n.splice(s, 1);
  12587. }
  12588. function Y(e, t) {
  12589. var n = z(e);
  12590. for (var _e2 = 0; _e2 < n.length; _e2++) {
  12591. (0, n[_e2])(t);
  12592. }
  12593. }
  12594. var Q,
  12595. X = !1;
  12596. function Z() {
  12597. return Q || (Q = new Promise(function (e) {
  12598. X && e(), function t() {
  12599. if ("function" == typeof getCurrentPages) {
  12600. var _t2 = getCurrentPages();
  12601. _t2 && _t2[0] && (X = !0, e());
  12602. }
  12603. X || setTimeout(function () {
  12604. t();
  12605. }, 30);
  12606. }();
  12607. }), Q);
  12608. }
  12609. function ee(e) {
  12610. var t = {};
  12611. for (var _n2 in e) {
  12612. var _s2 = e[_n2];
  12613. m(_s2) && (t[_n2] = y(_s2));
  12614. }
  12615. return t;
  12616. }
  12617. var te = /*#__PURE__*/function (_Error) {
  12618. (0, _inherits2.default)(te, _Error);
  12619. var _super = _createSuper(te);
  12620. function te(e) {
  12621. var _this2;
  12622. (0, _classCallCheck2.default)(this, te);
  12623. _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;
  12624. return _this2;
  12625. }
  12626. (0, _createClass2.default)(te, [{
  12627. key: "toJson",
  12628. value: function toJson() {
  12629. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  12630. if (!(e >= 10)) return e++, {
  12631. errCode: this.errCode,
  12632. errMsg: this.errMsg,
  12633. errSubject: this.errSubject,
  12634. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  12635. };
  12636. }
  12637. }]);
  12638. return te;
  12639. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  12640. exports.UniCloudError = te;
  12641. var ne = {
  12642. request: function request(e) {
  12643. return uni.request(e);
  12644. },
  12645. uploadFile: function uploadFile(e) {
  12646. return uni.uploadFile(e);
  12647. },
  12648. setStorageSync: function setStorageSync(e, t) {
  12649. return uni.setStorageSync(e, t);
  12650. },
  12651. getStorageSync: function getStorageSync(e) {
  12652. return uni.getStorageSync(e);
  12653. },
  12654. removeStorageSync: function removeStorageSync(e) {
  12655. return uni.removeStorageSync(e);
  12656. },
  12657. clearStorageSync: function clearStorageSync() {
  12658. return uni.clearStorageSync();
  12659. },
  12660. connectSocket: function connectSocket(e) {
  12661. return uni.connectSocket(e);
  12662. }
  12663. };
  12664. function se() {
  12665. return {
  12666. token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"),
  12667. tokenExpired: ne.getStorageSync("uni_id_token_expired")
  12668. };
  12669. }
  12670. function re() {
  12671. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12672. e = _ref2.token,
  12673. t = _ref2.tokenExpired;
  12674. e && ne.setStorageSync("uni_id_token", e), t && ne.setStorageSync("uni_id_token_expired", t);
  12675. }
  12676. var ie, oe;
  12677. function ae() {
  12678. return ie || (ie = uni.getSystemInfoSync()), ie;
  12679. }
  12680. function ce() {
  12681. var e, t;
  12682. try {
  12683. if (uni.getLaunchOptionsSync) {
  12684. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  12685. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  12686. _n3 = _uni$getLaunchOptions.scene,
  12687. _s3 = _uni$getLaunchOptions.channel;
  12688. e = _s3, t = _n3;
  12689. }
  12690. } catch (e) {}
  12691. return {
  12692. channel: e,
  12693. scene: t
  12694. };
  12695. }
  12696. var ue = {};
  12697. function le() {
  12698. var e = uni.getLocale && uni.getLocale() || "en";
  12699. if (oe) return _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  12700. locale: e,
  12701. LOCALE: e
  12702. });
  12703. var t = ae(),
  12704. n = t.deviceId,
  12705. s = t.osName,
  12706. r = t.uniPlatform,
  12707. i = t.appId,
  12708. o = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
  12709. for (var _e3 in t) {
  12710. Object.hasOwnProperty.call(t, _e3) && -1 === o.indexOf(_e3) && delete t[_e3];
  12711. }
  12712. return oe = _objectSpread(_objectSpread({
  12713. PLATFORM: r,
  12714. OS: s,
  12715. APPID: i,
  12716. DEVICEID: n
  12717. }, ce()), t), _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  12718. locale: e,
  12719. LOCALE: e
  12720. });
  12721. }
  12722. var he = {
  12723. sign: function sign(e, t) {
  12724. var n = "";
  12725. return Object.keys(e).sort().forEach(function (t) {
  12726. e[t] && (n = n + "&" + t + "=" + e[t]);
  12727. }), n = n.slice(1), i(n, t).toString();
  12728. },
  12729. wrappedRequest: function wrappedRequest(e, t) {
  12730. return new Promise(function (n, s) {
  12731. t(Object.assign(e, {
  12732. complete: function complete(e) {
  12733. e || (e = {}), S && "web" === C && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  12734. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  12735. if (!e.statusCode || e.statusCode >= 400) {
  12736. var _n4 = e.data && e.data.error && e.data.error.code || "SYS_ERR",
  12737. _r = e.data && e.data.error && e.data.error.message || e.errMsg || "request:fail";
  12738. return s(new te({
  12739. code: _n4,
  12740. message: _r,
  12741. requestId: t
  12742. }));
  12743. }
  12744. var r = e.data;
  12745. if (r.error) return s(new te({
  12746. code: r.error.code,
  12747. message: r.error.message,
  12748. requestId: t
  12749. }));
  12750. r.result = r.data, r.requestId = t, delete r.data, n(r);
  12751. }
  12752. }));
  12753. });
  12754. },
  12755. toBase64: function toBase64(e) {
  12756. return a.stringify(o.parse(e));
  12757. }
  12758. };
  12759. var de = /*#__PURE__*/function () {
  12760. function de(e) {
  12761. var _this3 = this;
  12762. (0, _classCallCheck2.default)(this, de);
  12763. ["spaceId", "clientSecret"].forEach(function (t) {
  12764. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  12765. }), this.config = Object.assign({}, {
  12766. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  12767. }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new v({
  12768. createPromise: function createPromise() {
  12769. return _this3.requestAuth(_this3.setupRequest({
  12770. method: "serverless.auth.user.anonymousAuthorize",
  12771. params: "{}"
  12772. }, "auth")).then(function (e) {
  12773. if (!e.result || !e.result.accessToken) throw new te({
  12774. code: "AUTH_FAILED",
  12775. message: "获取accessToken失败"
  12776. });
  12777. _this3.setAccessToken(e.result.accessToken);
  12778. });
  12779. },
  12780. retryRule: w
  12781. });
  12782. }
  12783. (0, _createClass2.default)(de, [{
  12784. key: "hasAccessToken",
  12785. get: function get() {
  12786. return !!this.accessToken;
  12787. }
  12788. }, {
  12789. key: "setAccessToken",
  12790. value: function setAccessToken(e) {
  12791. this.accessToken = e;
  12792. }
  12793. }, {
  12794. key: "requestWrapped",
  12795. value: function requestWrapped(e) {
  12796. return he.wrappedRequest(e, this.adapter.request);
  12797. }
  12798. }, {
  12799. key: "requestAuth",
  12800. value: function requestAuth(e) {
  12801. return this.requestWrapped(e);
  12802. }
  12803. }, {
  12804. key: "request",
  12805. value: function request(e, t) {
  12806. var _this4 = this;
  12807. return Promise.resolve().then(function () {
  12808. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  12809. return new Promise(function (e, n) {
  12810. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  12811. }).then(function () {
  12812. return _this4.getAccessToken();
  12813. }).then(function () {
  12814. var t = _this4.rebuildRequest(e);
  12815. return _this4.request(t, !0);
  12816. });
  12817. }) : _this4.getAccessToken().then(function () {
  12818. var t = _this4.rebuildRequest(e);
  12819. return _this4.request(t, !0);
  12820. });
  12821. });
  12822. }
  12823. }, {
  12824. key: "rebuildRequest",
  12825. value: function rebuildRequest(e) {
  12826. var t = Object.assign({}, e);
  12827. 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;
  12828. }
  12829. }, {
  12830. key: "setupRequest",
  12831. value: function setupRequest(e, t) {
  12832. var n = Object.assign({}, e, {
  12833. spaceId: this.config.spaceId,
  12834. timestamp: Date.now()
  12835. }),
  12836. s = {
  12837. "Content-Type": "application/json"
  12838. };
  12839. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  12840. url: this.config.requestUrl,
  12841. method: "POST",
  12842. data: n,
  12843. dataType: "json",
  12844. header: s
  12845. };
  12846. }
  12847. }, {
  12848. key: "getAccessToken",
  12849. value: function getAccessToken() {
  12850. return this._getAccessTokenPromiseHub.exec();
  12851. }
  12852. }, {
  12853. key: "authorize",
  12854. value: function () {
  12855. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  12856. return _regenerator.default.wrap(function _callee$(_context) {
  12857. while (1) {
  12858. switch (_context.prev = _context.next) {
  12859. case 0:
  12860. _context.next = 2;
  12861. return this.getAccessToken();
  12862. case 2:
  12863. case "end":
  12864. return _context.stop();
  12865. }
  12866. }
  12867. }, _callee, this);
  12868. }));
  12869. function authorize() {
  12870. return _authorize.apply(this, arguments);
  12871. }
  12872. return authorize;
  12873. }()
  12874. }, {
  12875. key: "callFunction",
  12876. value: function callFunction(e) {
  12877. var t = {
  12878. method: "serverless.function.runtime.invoke",
  12879. params: JSON.stringify({
  12880. functionTarget: e.name,
  12881. functionArgs: e.data || {}
  12882. })
  12883. };
  12884. return this.request(_objectSpread(_objectSpread({}, this.setupRequest(t)), {}, {
  12885. timeout: e.timeout
  12886. }));
  12887. }
  12888. }, {
  12889. key: "getOSSUploadOptionsFromPath",
  12890. value: function getOSSUploadOptionsFromPath(e) {
  12891. var t = {
  12892. method: "serverless.file.resource.generateProximalSign",
  12893. params: JSON.stringify(e)
  12894. };
  12895. return this.request(this.setupRequest(t));
  12896. }
  12897. }, {
  12898. key: "uploadFileToOSS",
  12899. value: function uploadFileToOSS(_ref3) {
  12900. var _this5 = this;
  12901. var e = _ref3.url,
  12902. t = _ref3.formData,
  12903. n = _ref3.name,
  12904. s = _ref3.filePath,
  12905. r = _ref3.fileType,
  12906. i = _ref3.onUploadProgress;
  12907. return new Promise(function (o, a) {
  12908. var c = _this5.adapter.uploadFile({
  12909. url: e,
  12910. formData: t,
  12911. name: n,
  12912. filePath: s,
  12913. fileType: r,
  12914. header: {
  12915. "X-OSS-server-side-encrpytion": "AES256"
  12916. },
  12917. success: function success(e) {
  12918. e && e.statusCode < 400 ? o(e) : a(new te({
  12919. code: "UPLOAD_FAILED",
  12920. message: "文件上传失败"
  12921. }));
  12922. },
  12923. fail: function fail(e) {
  12924. a(new te({
  12925. code: e.code || "UPLOAD_FAILED",
  12926. message: e.message || e.errMsg || "文件上传失败"
  12927. }));
  12928. }
  12929. });
  12930. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  12931. i({
  12932. loaded: e.totalBytesSent,
  12933. total: e.totalBytesExpectedToSend
  12934. });
  12935. });
  12936. });
  12937. }
  12938. }, {
  12939. key: "reportOSSUpload",
  12940. value: function reportOSSUpload(e) {
  12941. var t = {
  12942. method: "serverless.file.resource.report",
  12943. params: JSON.stringify(e)
  12944. };
  12945. return this.request(this.setupRequest(t));
  12946. }
  12947. }, {
  12948. key: "uploadFile",
  12949. value: function () {
  12950. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  12951. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, l, h, d, p, g, m, y, _, _e4, w;
  12952. return _regenerator.default.wrap(function _callee2$(_context2) {
  12953. while (1) {
  12954. switch (_context2.prev = _context2.next) {
  12955. case 0:
  12956. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, _ref4$cloudPathAsReal = _ref4.cloudPathAsRealPath, s = _ref4$cloudPathAsReal === void 0 ? !1 : _ref4$cloudPathAsReal, r = _ref4.onUploadProgress, i = _ref4.config;
  12957. if (!("string" !== f(t))) {
  12958. _context2.next = 3;
  12959. break;
  12960. }
  12961. throw new te({
  12962. code: "INVALID_PARAM",
  12963. message: "cloudPath必须为字符串类型"
  12964. });
  12965. case 3:
  12966. if (t = t.trim()) {
  12967. _context2.next = 5;
  12968. break;
  12969. }
  12970. throw new te({
  12971. code: "INVALID_PARAM",
  12972. message: "cloudPath不可为空"
  12973. });
  12974. case 5:
  12975. if (!/:\/\//.test(t)) {
  12976. _context2.next = 7;
  12977. break;
  12978. }
  12979. throw new te({
  12980. code: "INVALID_PARAM",
  12981. message: "cloudPath不合法"
  12982. });
  12983. case 7:
  12984. o = i && i.envType || this.config.envType;
  12985. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  12986. _context2.next = 10;
  12987. break;
  12988. }
  12989. throw new te({
  12990. code: "INVALID_PARAM",
  12991. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  12992. });
  12993. case 10:
  12994. _context2.next = 12;
  12995. return this.getOSSUploadOptionsFromPath({
  12996. env: o,
  12997. filename: s ? t.split("/").pop() : t,
  12998. fileId: s ? t : void 0
  12999. });
  13000. case 12:
  13001. a = _context2.sent.result;
  13002. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  13003. u = a.securityToken;
  13004. l = a.accessKeyId;
  13005. h = a.signature;
  13006. d = a.host;
  13007. p = a.ossPath;
  13008. g = a.id;
  13009. m = a.policy;
  13010. y = a.ossCallbackUrl;
  13011. _ = {
  13012. "Cache-Control": "max-age=2592000",
  13013. "Content-Disposition": "attachment",
  13014. OSSAccessKeyId: l,
  13015. Signature: h,
  13016. host: d,
  13017. id: g,
  13018. key: p,
  13019. policy: m,
  13020. success_action_status: 200
  13021. };
  13022. if (u && (_["x-oss-security-token"] = u), y) {
  13023. _e4 = JSON.stringify({
  13024. callbackUrl: y,
  13025. callbackBody: JSON.stringify({
  13026. fileId: g,
  13027. spaceId: this.config.spaceId
  13028. }),
  13029. callbackBodyType: "application/json"
  13030. });
  13031. _.callback = he.toBase64(_e4);
  13032. }
  13033. w = {
  13034. url: "https://" + a.host,
  13035. formData: _,
  13036. fileName: "file",
  13037. name: "file",
  13038. filePath: e,
  13039. fileType: n
  13040. };
  13041. _context2.next = 27;
  13042. return this.uploadFileToOSS(Object.assign({}, w, {
  13043. onUploadProgress: r
  13044. }));
  13045. case 27:
  13046. if (!y) {
  13047. _context2.next = 29;
  13048. break;
  13049. }
  13050. return _context2.abrupt("return", {
  13051. success: !0,
  13052. filePath: e,
  13053. fileID: c
  13054. });
  13055. case 29:
  13056. _context2.next = 31;
  13057. return this.reportOSSUpload({
  13058. id: g
  13059. });
  13060. case 31:
  13061. if (!_context2.sent.success) {
  13062. _context2.next = 33;
  13063. break;
  13064. }
  13065. return _context2.abrupt("return", {
  13066. success: !0,
  13067. filePath: e,
  13068. fileID: c
  13069. });
  13070. case 33:
  13071. throw new te({
  13072. code: "UPLOAD_FAILED",
  13073. message: "文件上传失败"
  13074. });
  13075. case 34:
  13076. case "end":
  13077. return _context2.stop();
  13078. }
  13079. }
  13080. }, _callee2, this);
  13081. }));
  13082. function uploadFile(_x) {
  13083. return _uploadFile.apply(this, arguments);
  13084. }
  13085. return uploadFile;
  13086. }()
  13087. }, {
  13088. key: "getTempFileURL",
  13089. value: function getTempFileURL() {
  13090. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13091. e = _ref5.fileList;
  13092. return new Promise(function (t, n) {
  13093. Array.isArray(e) && 0 !== e.length || n(new te({
  13094. code: "INVALID_PARAM",
  13095. message: "fileList的元素必须是非空的字符串"
  13096. })), t({
  13097. fileList: e.map(function (e) {
  13098. return {
  13099. fileID: e,
  13100. tempFileURL: e
  13101. };
  13102. })
  13103. });
  13104. });
  13105. }
  13106. }, {
  13107. key: "getFileInfo",
  13108. value: function () {
  13109. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  13110. var _ref6,
  13111. e,
  13112. t,
  13113. _args3 = arguments;
  13114. return _regenerator.default.wrap(function _callee3$(_context3) {
  13115. while (1) {
  13116. switch (_context3.prev = _context3.next) {
  13117. case 0:
  13118. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  13119. if (!(!Array.isArray(e) || 0 === e.length)) {
  13120. _context3.next = 3;
  13121. break;
  13122. }
  13123. throw new te({
  13124. code: "INVALID_PARAM",
  13125. message: "fileList的元素必须是非空的字符串"
  13126. });
  13127. case 3:
  13128. t = {
  13129. method: "serverless.file.resource.info",
  13130. params: JSON.stringify({
  13131. id: e.map(function (e) {
  13132. return e.split("?")[0];
  13133. }).join(",")
  13134. })
  13135. };
  13136. _context3.next = 6;
  13137. return this.request(this.setupRequest(t));
  13138. case 6:
  13139. _context3.t0 = _context3.sent.result;
  13140. return _context3.abrupt("return", {
  13141. fileList: _context3.t0
  13142. });
  13143. case 8:
  13144. case "end":
  13145. return _context3.stop();
  13146. }
  13147. }
  13148. }, _callee3, this);
  13149. }));
  13150. function getFileInfo() {
  13151. return _getFileInfo.apply(this, arguments);
  13152. }
  13153. return getFileInfo;
  13154. }()
  13155. }]);
  13156. return de;
  13157. }();
  13158. var pe = {
  13159. init: function init(e) {
  13160. var t = new de(e),
  13161. n = {
  13162. signInAnonymously: function signInAnonymously() {
  13163. return t.authorize();
  13164. },
  13165. getLoginState: function getLoginState() {
  13166. return Promise.resolve(!1);
  13167. }
  13168. };
  13169. return t.auth = function () {
  13170. return n;
  13171. }, t.customAuth = t.auth, t;
  13172. }
  13173. };
  13174. var fe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  13175. var ge;
  13176. !function (e) {
  13177. e.local = "local", e.none = "none", e.session = "session";
  13178. }(ge || (ge = {}));
  13179. var me = function me() {},
  13180. ye = n(function (e, t) {
  13181. var n;
  13182. e.exports = (n = r, function (e) {
  13183. var t = n,
  13184. s = t.lib,
  13185. r = s.WordArray,
  13186. i = s.Hasher,
  13187. o = t.algo,
  13188. a = [],
  13189. c = [];
  13190. !function () {
  13191. function t(t) {
  13192. for (var n = e.sqrt(t), s = 2; s <= n; s++) {
  13193. if (!(t % s)) return !1;
  13194. }
  13195. return !0;
  13196. }
  13197. function n(e) {
  13198. return 4294967296 * (e - (0 | e)) | 0;
  13199. }
  13200. for (var s = 2, r = 0; r < 64;) {
  13201. t(s) && (r < 8 && (a[r] = n(e.pow(s, .5))), c[r] = n(e.pow(s, 1 / 3)), r++), s++;
  13202. }
  13203. }();
  13204. var u = [],
  13205. l = o.SHA256 = i.extend({
  13206. _doReset: function _doReset() {
  13207. this._hash = new r.init(a.slice(0));
  13208. },
  13209. _doProcessBlock: function _doProcessBlock(e, t) {
  13210. for (var n = this._hash.words, s = n[0], r = n[1], i = n[2], o = n[3], a = n[4], l = n[5], h = n[6], d = n[7], p = 0; p < 64; p++) {
  13211. if (p < 16) u[p] = 0 | e[t + p];else {
  13212. var f = u[p - 15],
  13213. g = (f << 25 | f >>> 7) ^ (f << 14 | f >>> 18) ^ f >>> 3,
  13214. m = u[p - 2],
  13215. y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
  13216. u[p] = g + u[p - 7] + y + u[p - 16];
  13217. }
  13218. var _ = s & r ^ s & i ^ r & i,
  13219. w = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
  13220. v = d + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & l ^ ~a & h) + c[p] + u[p];
  13221. d = h, h = l, l = a, a = o + v | 0, o = i, i = r, r = s, s = v + (w + _) | 0;
  13222. }
  13223. n[0] = n[0] + s | 0, n[1] = n[1] + r | 0, n[2] = n[2] + i | 0, n[3] = n[3] + o | 0, n[4] = n[4] + a | 0, n[5] = n[5] + l | 0, n[6] = n[6] + h | 0, n[7] = n[7] + d | 0;
  13224. },
  13225. _doFinalize: function _doFinalize() {
  13226. var t = this._data,
  13227. n = t.words,
  13228. s = 8 * this._nDataBytes,
  13229. r = 8 * t.sigBytes;
  13230. return n[r >>> 5] |= 128 << 24 - r % 32, n[14 + (r + 64 >>> 9 << 4)] = e.floor(s / 4294967296), n[15 + (r + 64 >>> 9 << 4)] = s, t.sigBytes = 4 * n.length, this._process(), this._hash;
  13231. },
  13232. clone: function clone() {
  13233. var e = i.clone.call(this);
  13234. return e._hash = this._hash.clone(), e;
  13235. }
  13236. });
  13237. t.SHA256 = i._createHelper(l), t.HmacSHA256 = i._createHmacHelper(l);
  13238. }(Math), n.SHA256);
  13239. }),
  13240. _e = ye,
  13241. we = n(function (e, t) {
  13242. e.exports = r.HmacSHA256;
  13243. });
  13244. var ve = function ve() {
  13245. var e;
  13246. if (!Promise) {
  13247. e = function e() {}, e.promise = {};
  13248. var _t3 = function _t3() {
  13249. throw new te({
  13250. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  13251. });
  13252. };
  13253. return Object.defineProperty(e.promise, "then", {
  13254. get: _t3
  13255. }), Object.defineProperty(e.promise, "catch", {
  13256. get: _t3
  13257. }), e;
  13258. }
  13259. var t = new Promise(function (t, n) {
  13260. e = function e(_e5, s) {
  13261. return _e5 ? n(_e5) : t(s);
  13262. };
  13263. });
  13264. return e.promise = t, e;
  13265. };
  13266. function Ie(e) {
  13267. return void 0 === e;
  13268. }
  13269. function Se(e) {
  13270. return "[object Null]" === Object.prototype.toString.call(e);
  13271. }
  13272. var be;
  13273. function ke(e) {
  13274. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  13275. var n;
  13276. var _iterator = _createForOfIteratorHelper(t),
  13277. _step;
  13278. try {
  13279. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  13280. var _e6 = _step.value;
  13281. var _t4 = _e6.isMatch,
  13282. _n5 = _e6.genAdapter,
  13283. _s4 = _e6.runtime;
  13284. if (_t4()) return {
  13285. adapter: _n5(),
  13286. runtime: _s4
  13287. };
  13288. }
  13289. } catch (err) {
  13290. _iterator.e(err);
  13291. } finally {
  13292. _iterator.f();
  13293. }
  13294. }
  13295. !function (e) {
  13296. e.WEB = "web", e.WX_MP = "wx_mp";
  13297. }(be || (be = {}));
  13298. var Ae = {
  13299. adapter: null,
  13300. runtime: void 0
  13301. },
  13302. Ce = ["anonymousUuidKey"];
  13303. var Pe = /*#__PURE__*/function (_me) {
  13304. (0, _inherits2.default)(Pe, _me);
  13305. var _super2 = _createSuper(Pe);
  13306. function Pe() {
  13307. var _this6;
  13308. (0, _classCallCheck2.default)(this, Pe);
  13309. _this6 = _super2.call(this), Ae.adapter.root.tcbObject || (Ae.adapter.root.tcbObject = {});
  13310. return _this6;
  13311. }
  13312. (0, _createClass2.default)(Pe, [{
  13313. key: "setItem",
  13314. value: function setItem(e, t) {
  13315. Ae.adapter.root.tcbObject[e] = t;
  13316. }
  13317. }, {
  13318. key: "getItem",
  13319. value: function getItem(e) {
  13320. return Ae.adapter.root.tcbObject[e];
  13321. }
  13322. }, {
  13323. key: "removeItem",
  13324. value: function removeItem(e) {
  13325. delete Ae.adapter.root.tcbObject[e];
  13326. }
  13327. }, {
  13328. key: "clear",
  13329. value: function clear() {
  13330. delete Ae.adapter.root.tcbObject;
  13331. }
  13332. }]);
  13333. return Pe;
  13334. }(me);
  13335. function Te(e, t) {
  13336. switch (e) {
  13337. case "local":
  13338. return t.localStorage || new Pe();
  13339. case "none":
  13340. return new Pe();
  13341. default:
  13342. return t.sessionStorage || new Pe();
  13343. }
  13344. }
  13345. var xe = /*#__PURE__*/function () {
  13346. function xe(e) {
  13347. (0, _classCallCheck2.default)(this, xe);
  13348. if (!this._storage) {
  13349. this._persistence = Ae.adapter.primaryStorage || e.persistence, this._storage = Te(this._persistence, Ae.adapter);
  13350. var _t5 = "access_token_".concat(e.env),
  13351. _n6 = "access_token_expire_".concat(e.env),
  13352. _s5 = "refresh_token_".concat(e.env),
  13353. _r2 = "anonymous_uuid_".concat(e.env),
  13354. _i = "login_type_".concat(e.env),
  13355. _o = "user_info_".concat(e.env);
  13356. this.keys = {
  13357. accessTokenKey: _t5,
  13358. accessTokenExpireKey: _n6,
  13359. refreshTokenKey: _s5,
  13360. anonymousUuidKey: _r2,
  13361. loginTypeKey: _i,
  13362. userInfoKey: _o
  13363. };
  13364. }
  13365. }
  13366. (0, _createClass2.default)(xe, [{
  13367. key: "updatePersistence",
  13368. value: function updatePersistence(e) {
  13369. if (e === this._persistence) return;
  13370. var t = "local" === this._persistence;
  13371. this._persistence = e;
  13372. var n = Te(e, Ae.adapter);
  13373. for (var _e7 in this.keys) {
  13374. var _s6 = this.keys[_e7];
  13375. if (t && Ce.includes(_e7)) continue;
  13376. var _r3 = this._storage.getItem(_s6);
  13377. Ie(_r3) || Se(_r3) || (n.setItem(_s6, _r3), this._storage.removeItem(_s6));
  13378. }
  13379. this._storage = n;
  13380. }
  13381. }, {
  13382. key: "setStore",
  13383. value: function setStore(e, t, n) {
  13384. if (!this._storage) return;
  13385. var s = {
  13386. version: n || "localCachev1",
  13387. content: t
  13388. },
  13389. r = JSON.stringify(s);
  13390. try {
  13391. this._storage.setItem(e, r);
  13392. } catch (e) {
  13393. throw e;
  13394. }
  13395. }
  13396. }, {
  13397. key: "getStore",
  13398. value: function getStore(e, t) {
  13399. try {
  13400. if (!this._storage) return;
  13401. } catch (e) {
  13402. return "";
  13403. }
  13404. t = t || "localCachev1";
  13405. var n = this._storage.getItem(e);
  13406. if (!n) return "";
  13407. if (n.indexOf(t) >= 0) {
  13408. return JSON.parse(n).content;
  13409. }
  13410. return "";
  13411. }
  13412. }, {
  13413. key: "removeStore",
  13414. value: function removeStore(e) {
  13415. this._storage.removeItem(e);
  13416. }
  13417. }]);
  13418. return xe;
  13419. }();
  13420. var Oe = {},
  13421. Ee = {};
  13422. function Le(e) {
  13423. return Oe[e];
  13424. }
  13425. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  13426. (0, _classCallCheck2.default)(this, Re);
  13427. this.data = t || null, this.name = e;
  13428. });
  13429. var Ue = /*#__PURE__*/function (_Re) {
  13430. (0, _inherits2.default)(Ue, _Re);
  13431. var _super3 = _createSuper(Ue);
  13432. function Ue(e, t) {
  13433. var _this7;
  13434. (0, _classCallCheck2.default)(this, Ue);
  13435. _this7 = _super3.call(this, "error", {
  13436. error: e,
  13437. data: t
  13438. }), _this7.error = e;
  13439. return _this7;
  13440. }
  13441. return (0, _createClass2.default)(Ue);
  13442. }(Re);
  13443. var Ne = new ( /*#__PURE__*/function () {
  13444. function _class() {
  13445. (0, _classCallCheck2.default)(this, _class);
  13446. this._listeners = {};
  13447. }
  13448. (0, _createClass2.default)(_class, [{
  13449. key: "on",
  13450. value: function on(e, t) {
  13451. return function (e, t, n) {
  13452. n[e] = n[e] || [], n[e].push(t);
  13453. }(e, t, this._listeners), this;
  13454. }
  13455. }, {
  13456. key: "off",
  13457. value: function off(e, t) {
  13458. return function (e, t, n) {
  13459. if (n && n[e]) {
  13460. var _s7 = n[e].indexOf(t);
  13461. -1 !== _s7 && n[e].splice(_s7, 1);
  13462. }
  13463. }(e, t, this._listeners), this;
  13464. }
  13465. }, {
  13466. key: "fire",
  13467. value: function fire(e, t) {
  13468. if (e instanceof Ue) return console.error(e.error), this;
  13469. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  13470. var s = n.name;
  13471. if (this._listens(s)) {
  13472. n.target = this;
  13473. var _e8 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  13474. var _iterator2 = _createForOfIteratorHelper(_e8),
  13475. _step2;
  13476. try {
  13477. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  13478. var _t6 = _step2.value;
  13479. _t6.call(this, n);
  13480. }
  13481. } catch (err) {
  13482. _iterator2.e(err);
  13483. } finally {
  13484. _iterator2.f();
  13485. }
  13486. }
  13487. return this;
  13488. }
  13489. }, {
  13490. key: "_listens",
  13491. value: function _listens(e) {
  13492. return this._listeners[e] && this._listeners[e].length > 0;
  13493. }
  13494. }]);
  13495. return _class;
  13496. }())();
  13497. function De(e, t) {
  13498. Ne.on(e, t);
  13499. }
  13500. function qe(e) {
  13501. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13502. Ne.fire(e, t);
  13503. }
  13504. function Me(e, t) {
  13505. Ne.off(e, t);
  13506. }
  13507. var Fe = "loginStateChanged",
  13508. Ke = "loginStateExpire",
  13509. je = "loginTypeChanged",
  13510. $e = "anonymousConverted",
  13511. Be = "refreshAccessToken";
  13512. var We;
  13513. !function (e) {
  13514. 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";
  13515. }(We || (We = {}));
  13516. var He = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  13517. Je = {
  13518. "X-SDK-Version": "1.3.5"
  13519. };
  13520. function ze(e, t, n) {
  13521. var s = e[t];
  13522. e[t] = function (t) {
  13523. var r = {},
  13524. i = {};
  13525. n.forEach(function (n) {
  13526. var _n$call = n.call(e, t),
  13527. s = _n$call.data,
  13528. o = _n$call.headers;
  13529. Object.assign(r, s), Object.assign(i, o);
  13530. });
  13531. var o = t.data;
  13532. return o && function () {
  13533. var e;
  13534. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e9 in r) {
  13535. o.append(_e9, r[_e9]);
  13536. }
  13537. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  13538. };
  13539. }
  13540. function Ve() {
  13541. var e = Math.random().toString(16).slice(2);
  13542. return {
  13543. data: {
  13544. seqId: e
  13545. },
  13546. headers: _objectSpread(_objectSpread({}, Je), {}, {
  13547. "x-seqid": e
  13548. })
  13549. };
  13550. }
  13551. var Ge = /*#__PURE__*/function () {
  13552. function Ge() {
  13553. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13554. (0, _classCallCheck2.default)(this, Ge);
  13555. var t;
  13556. this.config = e, this._reqClass = new Ae.adapter.reqClass({
  13557. timeout: this.config.timeout,
  13558. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  13559. restrictedMethods: ["post"]
  13560. }), this._cache = Le(this.config.env), this._localCache = (t = this.config.env, Ee[t]), ze(this._reqClass, "post", [Ve]), ze(this._reqClass, "upload", [Ve]), ze(this._reqClass, "download", [Ve]);
  13561. }
  13562. (0, _createClass2.default)(Ge, [{
  13563. key: "post",
  13564. value: function () {
  13565. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  13566. return _regenerator.default.wrap(function _callee4$(_context4) {
  13567. while (1) {
  13568. switch (_context4.prev = _context4.next) {
  13569. case 0:
  13570. _context4.next = 2;
  13571. return this._reqClass.post(e);
  13572. case 2:
  13573. return _context4.abrupt("return", _context4.sent);
  13574. case 3:
  13575. case "end":
  13576. return _context4.stop();
  13577. }
  13578. }
  13579. }, _callee4, this);
  13580. }));
  13581. function post(_x2) {
  13582. return _post.apply(this, arguments);
  13583. }
  13584. return post;
  13585. }()
  13586. }, {
  13587. key: "upload",
  13588. value: function () {
  13589. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  13590. return _regenerator.default.wrap(function _callee5$(_context5) {
  13591. while (1) {
  13592. switch (_context5.prev = _context5.next) {
  13593. case 0:
  13594. _context5.next = 2;
  13595. return this._reqClass.upload(e);
  13596. case 2:
  13597. return _context5.abrupt("return", _context5.sent);
  13598. case 3:
  13599. case "end":
  13600. return _context5.stop();
  13601. }
  13602. }
  13603. }, _callee5, this);
  13604. }));
  13605. function upload(_x3) {
  13606. return _upload.apply(this, arguments);
  13607. }
  13608. return upload;
  13609. }()
  13610. }, {
  13611. key: "download",
  13612. value: function () {
  13613. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  13614. return _regenerator.default.wrap(function _callee6$(_context6) {
  13615. while (1) {
  13616. switch (_context6.prev = _context6.next) {
  13617. case 0:
  13618. _context6.next = 2;
  13619. return this._reqClass.download(e);
  13620. case 2:
  13621. return _context6.abrupt("return", _context6.sent);
  13622. case 3:
  13623. case "end":
  13624. return _context6.stop();
  13625. }
  13626. }
  13627. }, _callee6, this);
  13628. }));
  13629. function download(_x4) {
  13630. return _download.apply(this, arguments);
  13631. }
  13632. return download;
  13633. }()
  13634. }, {
  13635. key: "refreshAccessToken",
  13636. value: function () {
  13637. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  13638. var e, t;
  13639. return _regenerator.default.wrap(function _callee7$(_context7) {
  13640. while (1) {
  13641. switch (_context7.prev = _context7.next) {
  13642. case 0:
  13643. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  13644. _context7.prev = 1;
  13645. _context7.next = 4;
  13646. return this._refreshAccessTokenPromise;
  13647. case 4:
  13648. e = _context7.sent;
  13649. _context7.next = 10;
  13650. break;
  13651. case 7:
  13652. _context7.prev = 7;
  13653. _context7.t0 = _context7["catch"](1);
  13654. t = _context7.t0;
  13655. case 10:
  13656. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  13657. _context7.next = 12;
  13658. break;
  13659. }
  13660. throw t;
  13661. case 12:
  13662. return _context7.abrupt("return", e);
  13663. case 13:
  13664. case "end":
  13665. return _context7.stop();
  13666. }
  13667. }
  13668. }, _callee7, this, [[1, 7]]);
  13669. }));
  13670. function refreshAccessToken() {
  13671. return _refreshAccessToken2.apply(this, arguments);
  13672. }
  13673. return refreshAccessToken;
  13674. }()
  13675. }, {
  13676. key: "_refreshAccessToken",
  13677. value: function () {
  13678. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  13679. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e10, _e11, _t7, _s8;
  13680. return _regenerator.default.wrap(function _callee8$(_context8) {
  13681. while (1) {
  13682. switch (_context8.prev = _context8.next) {
  13683. case 0:
  13684. _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;
  13685. this._cache.removeStore(e), this._cache.removeStore(t);
  13686. i = this._cache.getStore(n);
  13687. if (i) {
  13688. _context8.next = 5;
  13689. break;
  13690. }
  13691. throw new te({
  13692. message: "未登录CloudBase"
  13693. });
  13694. case 5:
  13695. o = {
  13696. refresh_token: i
  13697. };
  13698. _context8.next = 8;
  13699. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  13700. case 8:
  13701. a = _context8.sent;
  13702. if (!a.data.code) {
  13703. _context8.next = 21;
  13704. break;
  13705. }
  13706. _e10 = a.data.code;
  13707. if (!("SIGN_PARAM_INVALID" === _e10 || "REFRESH_TOKEN_EXPIRED" === _e10 || "INVALID_REFRESH_TOKEN" === _e10)) {
  13708. _context8.next = 20;
  13709. break;
  13710. }
  13711. if (!(this._cache.getStore(s) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e10)) {
  13712. _context8.next = 19;
  13713. break;
  13714. }
  13715. _e11 = this._cache.getStore(r);
  13716. _t7 = this._cache.getStore(n);
  13717. _context8.next = 17;
  13718. return this.send("auth.signInAnonymously", {
  13719. anonymous_uuid: _e11,
  13720. refresh_token: _t7
  13721. });
  13722. case 17:
  13723. _s8 = _context8.sent;
  13724. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  13725. case 19:
  13726. qe(Ke), this._cache.removeStore(n);
  13727. case 20:
  13728. throw new te({
  13729. code: a.data.code,
  13730. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  13731. });
  13732. case 21:
  13733. if (!a.data.access_token) {
  13734. _context8.next = 23;
  13735. break;
  13736. }
  13737. return _context8.abrupt("return", (qe(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  13738. accessToken: a.data.access_token,
  13739. accessTokenExpire: a.data.access_token_expire
  13740. }));
  13741. case 23:
  13742. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  13743. case 24:
  13744. case "end":
  13745. return _context8.stop();
  13746. }
  13747. }
  13748. }, _callee8, this);
  13749. }));
  13750. function _refreshAccessToken() {
  13751. return _refreshAccessToken3.apply(this, arguments);
  13752. }
  13753. return _refreshAccessToken;
  13754. }()
  13755. }, {
  13756. key: "getAccessToken",
  13757. value: function () {
  13758. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  13759. var _this$_cache$keys2, e, t, n, s, r, i;
  13760. return _regenerator.default.wrap(function _callee9$(_context9) {
  13761. while (1) {
  13762. switch (_context9.prev = _context9.next) {
  13763. case 0:
  13764. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  13765. if (this._cache.getStore(n)) {
  13766. _context9.next = 3;
  13767. break;
  13768. }
  13769. throw new te({
  13770. message: "refresh token不存在,登录状态异常"
  13771. });
  13772. case 3:
  13773. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  13774. _context9.t0 = this._shouldRefreshAccessTokenHook;
  13775. if (!_context9.t0) {
  13776. _context9.next = 9;
  13777. break;
  13778. }
  13779. _context9.next = 8;
  13780. return this._shouldRefreshAccessTokenHook(s, r);
  13781. case 8:
  13782. _context9.t0 = !_context9.sent;
  13783. case 9:
  13784. _context9.t1 = _context9.t0;
  13785. if (!_context9.t1) {
  13786. _context9.next = 12;
  13787. break;
  13788. }
  13789. i = !1;
  13790. case 12:
  13791. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  13792. accessToken: s,
  13793. accessTokenExpire: r
  13794. });
  13795. case 13:
  13796. case "end":
  13797. return _context9.stop();
  13798. }
  13799. }
  13800. }, _callee9, this);
  13801. }));
  13802. function getAccessToken() {
  13803. return _getAccessToken.apply(this, arguments);
  13804. }
  13805. return getAccessToken;
  13806. }()
  13807. }, {
  13808. key: "request",
  13809. value: function () {
  13810. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  13811. var s, r, i, _e12, o, _e13, _e14, a, c, u, l, h, d, p, f, g;
  13812. return _regenerator.default.wrap(function _callee10$(_context10) {
  13813. while (1) {
  13814. switch (_context10.prev = _context10.next) {
  13815. case 0:
  13816. s = "x-tcb-trace_".concat(this.config.env);
  13817. r = "application/x-www-form-urlencoded";
  13818. i = _objectSpread({
  13819. action: e,
  13820. env: this.config.env,
  13821. dataVersion: "2019-08-16"
  13822. }, t);
  13823. if (!(-1 === He.indexOf(e))) {
  13824. _context10.next = 10;
  13825. break;
  13826. }
  13827. _e12 = this._cache.keys.refreshTokenKey;
  13828. _context10.t0 = this._cache.getStore(_e12);
  13829. if (!_context10.t0) {
  13830. _context10.next = 10;
  13831. break;
  13832. }
  13833. _context10.next = 9;
  13834. return this.getAccessToken();
  13835. case 9:
  13836. i.access_token = _context10.sent.accessToken;
  13837. case 10:
  13838. if ("storage.uploadFile" === e) {
  13839. o = new FormData();
  13840. for (_e13 in o) {
  13841. o.hasOwnProperty(_e13) && void 0 !== o[_e13] && o.append(_e13, i[_e13]);
  13842. }
  13843. r = "multipart/form-data";
  13844. } else {
  13845. r = "application/json", o = {};
  13846. for (_e14 in i) {
  13847. void 0 !== i[_e14] && (o[_e14] = i[_e14]);
  13848. }
  13849. }
  13850. a = {
  13851. headers: {
  13852. "content-type": r
  13853. }
  13854. };
  13855. n && n.timeout && (a.timeout = n.timeout), n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  13856. c = this._localCache.getStore(s);
  13857. c && (a.headers["X-TCB-Trace"] = c);
  13858. u = t.parse, l = t.inQuery, h = t.search;
  13859. d = {
  13860. env: this.config.env
  13861. };
  13862. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  13863. p = function (e, t) {
  13864. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  13865. var s = /\?/.test(t);
  13866. var r = "";
  13867. for (var _e15 in n) {
  13868. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e15, "=").concat(encodeURIComponent(n[_e15]));
  13869. }
  13870. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  13871. }(fe, "//tcb-api.tencentcloudapi.com/web", d);
  13872. h && (p += h);
  13873. _context10.next = 22;
  13874. return this.post(_objectSpread({
  13875. url: p,
  13876. data: o
  13877. }, a));
  13878. case 22:
  13879. f = _context10.sent;
  13880. g = f.header && f.header["x-tcb-trace"];
  13881. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  13882. _context10.next = 26;
  13883. break;
  13884. }
  13885. throw new te({
  13886. code: "NETWORK_ERROR",
  13887. message: "network request error"
  13888. });
  13889. case 26:
  13890. return _context10.abrupt("return", f);
  13891. case 27:
  13892. case "end":
  13893. return _context10.stop();
  13894. }
  13895. }
  13896. }, _callee10, this);
  13897. }));
  13898. function request(_x5, _x6, _x7) {
  13899. return _request.apply(this, arguments);
  13900. }
  13901. return request;
  13902. }()
  13903. }, {
  13904. key: "send",
  13905. value: function () {
  13906. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  13907. var t,
  13908. n,
  13909. s,
  13910. _s9,
  13911. _args11 = arguments;
  13912. return _regenerator.default.wrap(function _callee11$(_context11) {
  13913. while (1) {
  13914. switch (_context11.prev = _context11.next) {
  13915. case 0:
  13916. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  13917. n = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
  13918. _context11.next = 4;
  13919. return this.request(e, t, _objectSpread(_objectSpread({}, n), {}, {
  13920. onUploadProgress: t.onUploadProgress
  13921. }));
  13922. case 4:
  13923. s = _context11.sent;
  13924. if (!("ACCESS_TOKEN_EXPIRED" === s.data.code && -1 === He.indexOf(e))) {
  13925. _context11.next = 14;
  13926. break;
  13927. }
  13928. _context11.next = 8;
  13929. return this.refreshAccessToken();
  13930. case 8:
  13931. _context11.next = 10;
  13932. return this.request(e, t, _objectSpread(_objectSpread({}, n), {}, {
  13933. onUploadProgress: t.onUploadProgress
  13934. }));
  13935. case 10:
  13936. _s9 = _context11.sent;
  13937. if (!_s9.data.code) {
  13938. _context11.next = 13;
  13939. break;
  13940. }
  13941. throw new te({
  13942. code: _s9.data.code,
  13943. message: _s9.data.message
  13944. });
  13945. case 13:
  13946. return _context11.abrupt("return", _s9.data);
  13947. case 14:
  13948. if (!s.data.code) {
  13949. _context11.next = 16;
  13950. break;
  13951. }
  13952. throw new te({
  13953. code: s.data.code,
  13954. message: s.data.message
  13955. });
  13956. case 16:
  13957. return _context11.abrupt("return", s.data);
  13958. case 17:
  13959. case "end":
  13960. return _context11.stop();
  13961. }
  13962. }
  13963. }, _callee11, this);
  13964. }));
  13965. function send(_x8) {
  13966. return _send.apply(this, arguments);
  13967. }
  13968. return send;
  13969. }()
  13970. }, {
  13971. key: "setRefreshToken",
  13972. value: function setRefreshToken(e) {
  13973. var _this$_cache$keys3 = this._cache.keys,
  13974. t = _this$_cache$keys3.accessTokenKey,
  13975. n = _this$_cache$keys3.accessTokenExpireKey,
  13976. s = _this$_cache$keys3.refreshTokenKey;
  13977. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13978. }
  13979. }]);
  13980. return Ge;
  13981. }();
  13982. var Ye = {};
  13983. function Qe(e) {
  13984. return Ye[e];
  13985. }
  13986. var Xe = /*#__PURE__*/function () {
  13987. function Xe(e) {
  13988. (0, _classCallCheck2.default)(this, Xe);
  13989. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env);
  13990. }
  13991. (0, _createClass2.default)(Xe, [{
  13992. key: "setRefreshToken",
  13993. value: function setRefreshToken(e) {
  13994. var _this$_cache$keys4 = this._cache.keys,
  13995. t = _this$_cache$keys4.accessTokenKey,
  13996. n = _this$_cache$keys4.accessTokenExpireKey,
  13997. s = _this$_cache$keys4.refreshTokenKey;
  13998. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13999. }
  14000. }, {
  14001. key: "setAccessToken",
  14002. value: function setAccessToken(e, t) {
  14003. var _this$_cache$keys5 = this._cache.keys,
  14004. n = _this$_cache$keys5.accessTokenKey,
  14005. s = _this$_cache$keys5.accessTokenExpireKey;
  14006. this._cache.setStore(n, e), this._cache.setStore(s, t);
  14007. }
  14008. }, {
  14009. key: "refreshUserInfo",
  14010. value: function () {
  14011. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  14012. var _yield$this$_request$, e;
  14013. return _regenerator.default.wrap(function _callee12$(_context12) {
  14014. while (1) {
  14015. switch (_context12.prev = _context12.next) {
  14016. case 0:
  14017. _context12.next = 2;
  14018. return this._request.send("auth.getUserInfo", {});
  14019. case 2:
  14020. _yield$this$_request$ = _context12.sent;
  14021. e = _yield$this$_request$.data;
  14022. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  14023. case 5:
  14024. case "end":
  14025. return _context12.stop();
  14026. }
  14027. }
  14028. }, _callee12, this);
  14029. }));
  14030. function refreshUserInfo() {
  14031. return _refreshUserInfo.apply(this, arguments);
  14032. }
  14033. return refreshUserInfo;
  14034. }()
  14035. }, {
  14036. key: "setLocalUserInfo",
  14037. value: function setLocalUserInfo(e) {
  14038. var t = this._cache.keys.userInfoKey;
  14039. this._cache.setStore(t, e);
  14040. }
  14041. }]);
  14042. return Xe;
  14043. }();
  14044. var Ze = /*#__PURE__*/function () {
  14045. function Ze(e) {
  14046. (0, _classCallCheck2.default)(this, Ze);
  14047. if (!e) throw new te({
  14048. code: "PARAM_ERROR",
  14049. message: "envId is not defined"
  14050. });
  14051. this._envId = e, this._cache = Le(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  14052. }
  14053. (0, _createClass2.default)(Ze, [{
  14054. key: "linkWithTicket",
  14055. value: function linkWithTicket(e) {
  14056. if ("string" != typeof e) throw new te({
  14057. code: "PARAM_ERROR",
  14058. message: "ticket must be string"
  14059. });
  14060. return this._request.send("auth.linkWithTicket", {
  14061. ticket: e
  14062. });
  14063. }
  14064. }, {
  14065. key: "linkWithRedirect",
  14066. value: function linkWithRedirect(e) {
  14067. e.signInWithRedirect();
  14068. }
  14069. }, {
  14070. key: "updatePassword",
  14071. value: function updatePassword(e, t) {
  14072. return this._request.send("auth.updatePassword", {
  14073. oldPassword: t,
  14074. newPassword: e
  14075. });
  14076. }
  14077. }, {
  14078. key: "updateEmail",
  14079. value: function updateEmail(e) {
  14080. return this._request.send("auth.updateEmail", {
  14081. newEmail: e
  14082. });
  14083. }
  14084. }, {
  14085. key: "updateUsername",
  14086. value: function updateUsername(e) {
  14087. if ("string" != typeof e) throw new te({
  14088. code: "PARAM_ERROR",
  14089. message: "username must be a string"
  14090. });
  14091. return this._request.send("auth.updateUsername", {
  14092. username: e
  14093. });
  14094. }
  14095. }, {
  14096. key: "getLinkedUidList",
  14097. value: function () {
  14098. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  14099. var _yield$this$_request$2, e, t, n;
  14100. return _regenerator.default.wrap(function _callee13$(_context13) {
  14101. while (1) {
  14102. switch (_context13.prev = _context13.next) {
  14103. case 0:
  14104. _context13.next = 2;
  14105. return this._request.send("auth.getLinkedUidList", {});
  14106. case 2:
  14107. _yield$this$_request$2 = _context13.sent;
  14108. e = _yield$this$_request$2.data;
  14109. t = !1;
  14110. n = e.users;
  14111. return _context13.abrupt("return", (n.forEach(function (e) {
  14112. e.wxOpenId && e.wxPublicId && (t = !0);
  14113. }), {
  14114. users: n,
  14115. hasPrimaryUid: t
  14116. }));
  14117. case 7:
  14118. case "end":
  14119. return _context13.stop();
  14120. }
  14121. }
  14122. }, _callee13, this);
  14123. }));
  14124. function getLinkedUidList() {
  14125. return _getLinkedUidList.apply(this, arguments);
  14126. }
  14127. return getLinkedUidList;
  14128. }()
  14129. }, {
  14130. key: "setPrimaryUid",
  14131. value: function setPrimaryUid(e) {
  14132. return this._request.send("auth.setPrimaryUid", {
  14133. uid: e
  14134. });
  14135. }
  14136. }, {
  14137. key: "unlink",
  14138. value: function unlink(e) {
  14139. return this._request.send("auth.unlink", {
  14140. platform: e
  14141. });
  14142. }
  14143. }, {
  14144. key: "update",
  14145. value: function () {
  14146. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  14147. var t, n, s, r, i, o, _yield$this$_request$3, a;
  14148. return _regenerator.default.wrap(function _callee14$(_context14) {
  14149. while (1) {
  14150. switch (_context14.prev = _context14.next) {
  14151. case 0:
  14152. t = e.nickName;
  14153. n = e.gender;
  14154. s = e.avatarUrl;
  14155. r = e.province;
  14156. i = e.country;
  14157. o = e.city;
  14158. _context14.next = 8;
  14159. return this._request.send("auth.updateUserInfo", {
  14160. nickName: t,
  14161. gender: n,
  14162. avatarUrl: s,
  14163. province: r,
  14164. country: i,
  14165. city: o
  14166. });
  14167. case 8:
  14168. _yield$this$_request$3 = _context14.sent;
  14169. a = _yield$this$_request$3.data;
  14170. this.setLocalUserInfo(a);
  14171. case 11:
  14172. case "end":
  14173. return _context14.stop();
  14174. }
  14175. }
  14176. }, _callee14, this);
  14177. }));
  14178. function update(_x9) {
  14179. return _update.apply(this, arguments);
  14180. }
  14181. return update;
  14182. }()
  14183. }, {
  14184. key: "refresh",
  14185. value: function () {
  14186. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  14187. var _yield$this$_request$4, e;
  14188. return _regenerator.default.wrap(function _callee15$(_context15) {
  14189. while (1) {
  14190. switch (_context15.prev = _context15.next) {
  14191. case 0:
  14192. _context15.next = 2;
  14193. return this._request.send("auth.getUserInfo", {});
  14194. case 2:
  14195. _yield$this$_request$4 = _context15.sent;
  14196. e = _yield$this$_request$4.data;
  14197. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  14198. case 5:
  14199. case "end":
  14200. return _context15.stop();
  14201. }
  14202. }
  14203. }, _callee15, this);
  14204. }));
  14205. function refresh() {
  14206. return _refresh.apply(this, arguments);
  14207. }
  14208. return refresh;
  14209. }()
  14210. }, {
  14211. key: "setUserInfo",
  14212. value: function setUserInfo() {
  14213. var _this8 = this;
  14214. var e = this._cache.keys.userInfoKey,
  14215. t = this._cache.getStore(e);
  14216. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  14217. _this8[e] = t[e];
  14218. }), this.location = {
  14219. country: t.country,
  14220. province: t.province,
  14221. city: t.city
  14222. };
  14223. }
  14224. }, {
  14225. key: "setLocalUserInfo",
  14226. value: function setLocalUserInfo(e) {
  14227. var t = this._cache.keys.userInfoKey;
  14228. this._cache.setStore(t, e), this.setUserInfo();
  14229. }
  14230. }]);
  14231. return Ze;
  14232. }();
  14233. var et = /*#__PURE__*/function () {
  14234. function et(e) {
  14235. (0, _classCallCheck2.default)(this, et);
  14236. if (!e) throw new te({
  14237. code: "PARAM_ERROR",
  14238. message: "envId is not defined"
  14239. });
  14240. this._cache = Le(e);
  14241. var _this$_cache$keys6 = this._cache.keys,
  14242. t = _this$_cache$keys6.refreshTokenKey,
  14243. n = _this$_cache$keys6.accessTokenKey,
  14244. s = _this$_cache$keys6.accessTokenExpireKey,
  14245. r = this._cache.getStore(t),
  14246. i = this._cache.getStore(n),
  14247. o = this._cache.getStore(s);
  14248. this.credential = {
  14249. refreshToken: r,
  14250. accessToken: i,
  14251. accessTokenExpire: o
  14252. }, this.user = new Ze(e);
  14253. }
  14254. (0, _createClass2.default)(et, [{
  14255. key: "isAnonymousAuth",
  14256. get: function get() {
  14257. return this.loginType === We.ANONYMOUS;
  14258. }
  14259. }, {
  14260. key: "isCustomAuth",
  14261. get: function get() {
  14262. return this.loginType === We.CUSTOM;
  14263. }
  14264. }, {
  14265. key: "isWeixinAuth",
  14266. get: function get() {
  14267. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  14268. }
  14269. }, {
  14270. key: "loginType",
  14271. get: function get() {
  14272. return this._cache.getStore(this._cache.keys.loginTypeKey);
  14273. }
  14274. }]);
  14275. return et;
  14276. }();
  14277. var tt = /*#__PURE__*/function (_Xe) {
  14278. (0, _inherits2.default)(tt, _Xe);
  14279. var _super4 = _createSuper(tt);
  14280. function tt() {
  14281. (0, _classCallCheck2.default)(this, tt);
  14282. return _super4.apply(this, arguments);
  14283. }
  14284. (0, _createClass2.default)(tt, [{
  14285. key: "signIn",
  14286. value: function () {
  14287. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  14288. var _this$_cache$keys7, e, t, n, s, r, _e16;
  14289. return _regenerator.default.wrap(function _callee16$(_context16) {
  14290. while (1) {
  14291. switch (_context16.prev = _context16.next) {
  14292. case 0:
  14293. this._cache.updatePersistence("local");
  14294. _this$_cache$keys7 = this._cache.keys;
  14295. e = _this$_cache$keys7.anonymousUuidKey;
  14296. t = _this$_cache$keys7.refreshTokenKey;
  14297. n = this._cache.getStore(e) || void 0;
  14298. s = this._cache.getStore(t) || void 0;
  14299. _context16.next = 8;
  14300. return this._request.send("auth.signInAnonymously", {
  14301. anonymous_uuid: n,
  14302. refresh_token: s
  14303. });
  14304. case 8:
  14305. r = _context16.sent;
  14306. if (!(r.uuid && r.refresh_token)) {
  14307. _context16.next = 20;
  14308. break;
  14309. }
  14310. this._setAnonymousUUID(r.uuid);
  14311. this.setRefreshToken(r.refresh_token);
  14312. _context16.next = 14;
  14313. return this._request.refreshAccessToken();
  14314. case 14:
  14315. qe(Fe);
  14316. qe(je, {
  14317. env: this.config.env,
  14318. loginType: We.ANONYMOUS,
  14319. persistence: "local"
  14320. });
  14321. _e16 = new et(this.config.env);
  14322. _context16.next = 19;
  14323. return _e16.user.refresh();
  14324. case 19:
  14325. return _context16.abrupt("return", _e16);
  14326. case 20:
  14327. throw new te({
  14328. message: "匿名登录失败"
  14329. });
  14330. case 21:
  14331. case "end":
  14332. return _context16.stop();
  14333. }
  14334. }
  14335. }, _callee16, this);
  14336. }));
  14337. function signIn() {
  14338. return _signIn.apply(this, arguments);
  14339. }
  14340. return signIn;
  14341. }()
  14342. }, {
  14343. key: "linkAndRetrieveDataWithTicket",
  14344. value: function () {
  14345. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  14346. var _this$_cache$keys8, t, n, s, r, i;
  14347. return _regenerator.default.wrap(function _callee17$(_context17) {
  14348. while (1) {
  14349. switch (_context17.prev = _context17.next) {
  14350. case 0:
  14351. _this$_cache$keys8 = this._cache.keys;
  14352. t = _this$_cache$keys8.anonymousUuidKey;
  14353. n = _this$_cache$keys8.refreshTokenKey;
  14354. s = this._cache.getStore(t);
  14355. r = this._cache.getStore(n);
  14356. _context17.next = 7;
  14357. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  14358. anonymous_uuid: s,
  14359. refresh_token: r,
  14360. ticket: e
  14361. });
  14362. case 7:
  14363. i = _context17.sent;
  14364. if (!i.refresh_token) {
  14365. _context17.next = 16;
  14366. break;
  14367. }
  14368. this._clearAnonymousUUID();
  14369. this.setRefreshToken(i.refresh_token);
  14370. _context17.next = 13;
  14371. return this._request.refreshAccessToken();
  14372. case 13:
  14373. qe($e, {
  14374. env: this.config.env
  14375. });
  14376. qe(je, {
  14377. loginType: We.CUSTOM,
  14378. persistence: "local"
  14379. });
  14380. return _context17.abrupt("return", {
  14381. credential: {
  14382. refreshToken: i.refresh_token
  14383. }
  14384. });
  14385. case 16:
  14386. throw new te({
  14387. message: "匿名转化失败"
  14388. });
  14389. case 17:
  14390. case "end":
  14391. return _context17.stop();
  14392. }
  14393. }
  14394. }, _callee17, this);
  14395. }));
  14396. function linkAndRetrieveDataWithTicket(_x10) {
  14397. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  14398. }
  14399. return linkAndRetrieveDataWithTicket;
  14400. }()
  14401. }, {
  14402. key: "_setAnonymousUUID",
  14403. value: function _setAnonymousUUID(e) {
  14404. var _this$_cache$keys9 = this._cache.keys,
  14405. t = _this$_cache$keys9.anonymousUuidKey,
  14406. n = _this$_cache$keys9.loginTypeKey;
  14407. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, We.ANONYMOUS);
  14408. }
  14409. }, {
  14410. key: "_clearAnonymousUUID",
  14411. value: function _clearAnonymousUUID() {
  14412. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  14413. }
  14414. }]);
  14415. return tt;
  14416. }(Xe);
  14417. var nt = /*#__PURE__*/function (_Xe2) {
  14418. (0, _inherits2.default)(nt, _Xe2);
  14419. var _super5 = _createSuper(nt);
  14420. function nt() {
  14421. (0, _classCallCheck2.default)(this, nt);
  14422. return _super5.apply(this, arguments);
  14423. }
  14424. (0, _createClass2.default)(nt, [{
  14425. key: "signIn",
  14426. value: function () {
  14427. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  14428. var t, n;
  14429. return _regenerator.default.wrap(function _callee18$(_context18) {
  14430. while (1) {
  14431. switch (_context18.prev = _context18.next) {
  14432. case 0:
  14433. if (!("string" != typeof e)) {
  14434. _context18.next = 2;
  14435. break;
  14436. }
  14437. throw new te({
  14438. code: "PARAM_ERROR",
  14439. message: "ticket must be a string"
  14440. });
  14441. case 2:
  14442. t = this._cache.keys.refreshTokenKey;
  14443. _context18.next = 5;
  14444. return this._request.send("auth.signInWithTicket", {
  14445. ticket: e,
  14446. refresh_token: this._cache.getStore(t) || ""
  14447. });
  14448. case 5:
  14449. n = _context18.sent;
  14450. if (!n.refresh_token) {
  14451. _context18.next = 15;
  14452. break;
  14453. }
  14454. this.setRefreshToken(n.refresh_token);
  14455. _context18.next = 10;
  14456. return this._request.refreshAccessToken();
  14457. case 10:
  14458. qe(Fe);
  14459. qe(je, {
  14460. env: this.config.env,
  14461. loginType: We.CUSTOM,
  14462. persistence: this.config.persistence
  14463. });
  14464. _context18.next = 14;
  14465. return this.refreshUserInfo();
  14466. case 14:
  14467. return _context18.abrupt("return", new et(this.config.env));
  14468. case 15:
  14469. throw new te({
  14470. message: "自定义登录失败"
  14471. });
  14472. case 16:
  14473. case "end":
  14474. return _context18.stop();
  14475. }
  14476. }
  14477. }, _callee18, this);
  14478. }));
  14479. function signIn(_x11) {
  14480. return _signIn2.apply(this, arguments);
  14481. }
  14482. return signIn;
  14483. }()
  14484. }]);
  14485. return nt;
  14486. }(Xe);
  14487. var st = /*#__PURE__*/function (_Xe3) {
  14488. (0, _inherits2.default)(st, _Xe3);
  14489. var _super6 = _createSuper(st);
  14490. function st() {
  14491. (0, _classCallCheck2.default)(this, st);
  14492. return _super6.apply(this, arguments);
  14493. }
  14494. (0, _createClass2.default)(st, [{
  14495. key: "signIn",
  14496. value: function () {
  14497. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  14498. var n, s, r, i, o;
  14499. return _regenerator.default.wrap(function _callee19$(_context19) {
  14500. while (1) {
  14501. switch (_context19.prev = _context19.next) {
  14502. case 0:
  14503. if (!("string" != typeof e)) {
  14504. _context19.next = 2;
  14505. break;
  14506. }
  14507. throw new te({
  14508. code: "PARAM_ERROR",
  14509. message: "email must be a string"
  14510. });
  14511. case 2:
  14512. n = this._cache.keys.refreshTokenKey;
  14513. _context19.next = 5;
  14514. return this._request.send("auth.signIn", {
  14515. loginType: "EMAIL",
  14516. email: e,
  14517. password: t,
  14518. refresh_token: this._cache.getStore(n) || ""
  14519. });
  14520. case 5:
  14521. s = _context19.sent;
  14522. r = s.refresh_token;
  14523. i = s.access_token;
  14524. o = s.access_token_expire;
  14525. if (!r) {
  14526. _context19.next = 22;
  14527. break;
  14528. }
  14529. this.setRefreshToken(r);
  14530. if (!(i && o)) {
  14531. _context19.next = 15;
  14532. break;
  14533. }
  14534. this.setAccessToken(i, o);
  14535. _context19.next = 17;
  14536. break;
  14537. case 15:
  14538. _context19.next = 17;
  14539. return this._request.refreshAccessToken();
  14540. case 17:
  14541. _context19.next = 19;
  14542. return this.refreshUserInfo();
  14543. case 19:
  14544. qe(Fe);
  14545. qe(je, {
  14546. env: this.config.env,
  14547. loginType: We.EMAIL,
  14548. persistence: this.config.persistence
  14549. });
  14550. return _context19.abrupt("return", new et(this.config.env));
  14551. case 22:
  14552. throw s.code ? new te({
  14553. code: s.code,
  14554. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14555. }) : new te({
  14556. message: "邮箱登录失败"
  14557. });
  14558. case 23:
  14559. case "end":
  14560. return _context19.stop();
  14561. }
  14562. }
  14563. }, _callee19, this);
  14564. }));
  14565. function signIn(_x12, _x13) {
  14566. return _signIn3.apply(this, arguments);
  14567. }
  14568. return signIn;
  14569. }()
  14570. }, {
  14571. key: "activate",
  14572. value: function () {
  14573. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  14574. return _regenerator.default.wrap(function _callee20$(_context20) {
  14575. while (1) {
  14576. switch (_context20.prev = _context20.next) {
  14577. case 0:
  14578. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  14579. token: e
  14580. }));
  14581. case 1:
  14582. case "end":
  14583. return _context20.stop();
  14584. }
  14585. }
  14586. }, _callee20, this);
  14587. }));
  14588. function activate(_x14) {
  14589. return _activate.apply(this, arguments);
  14590. }
  14591. return activate;
  14592. }()
  14593. }, {
  14594. key: "resetPasswordWithToken",
  14595. value: function () {
  14596. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  14597. return _regenerator.default.wrap(function _callee21$(_context21) {
  14598. while (1) {
  14599. switch (_context21.prev = _context21.next) {
  14600. case 0:
  14601. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  14602. token: e,
  14603. newPassword: t
  14604. }));
  14605. case 1:
  14606. case "end":
  14607. return _context21.stop();
  14608. }
  14609. }
  14610. }, _callee21, this);
  14611. }));
  14612. function resetPasswordWithToken(_x15, _x16) {
  14613. return _resetPasswordWithToken.apply(this, arguments);
  14614. }
  14615. return resetPasswordWithToken;
  14616. }()
  14617. }]);
  14618. return st;
  14619. }(Xe);
  14620. var rt = /*#__PURE__*/function (_Xe4) {
  14621. (0, _inherits2.default)(rt, _Xe4);
  14622. var _super7 = _createSuper(rt);
  14623. function rt() {
  14624. (0, _classCallCheck2.default)(this, rt);
  14625. return _super7.apply(this, arguments);
  14626. }
  14627. (0, _createClass2.default)(rt, [{
  14628. key: "signIn",
  14629. value: function () {
  14630. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  14631. var n, s, r, i, o;
  14632. return _regenerator.default.wrap(function _callee22$(_context22) {
  14633. while (1) {
  14634. switch (_context22.prev = _context22.next) {
  14635. case 0:
  14636. if (!("string" != typeof e)) {
  14637. _context22.next = 2;
  14638. break;
  14639. }
  14640. throw new te({
  14641. code: "PARAM_ERROR",
  14642. message: "username must be a string"
  14643. });
  14644. case 2:
  14645. "string" != typeof t && (t = "", console.warn("password is empty"));
  14646. n = this._cache.keys.refreshTokenKey;
  14647. _context22.next = 6;
  14648. return this._request.send("auth.signIn", {
  14649. loginType: We.USERNAME,
  14650. username: e,
  14651. password: t,
  14652. refresh_token: this._cache.getStore(n) || ""
  14653. });
  14654. case 6:
  14655. s = _context22.sent;
  14656. r = s.refresh_token;
  14657. i = s.access_token_expire;
  14658. o = s.access_token;
  14659. if (!r) {
  14660. _context22.next = 23;
  14661. break;
  14662. }
  14663. this.setRefreshToken(r);
  14664. if (!(o && i)) {
  14665. _context22.next = 16;
  14666. break;
  14667. }
  14668. this.setAccessToken(o, i);
  14669. _context22.next = 18;
  14670. break;
  14671. case 16:
  14672. _context22.next = 18;
  14673. return this._request.refreshAccessToken();
  14674. case 18:
  14675. _context22.next = 20;
  14676. return this.refreshUserInfo();
  14677. case 20:
  14678. qe(Fe);
  14679. qe(je, {
  14680. env: this.config.env,
  14681. loginType: We.USERNAME,
  14682. persistence: this.config.persistence
  14683. });
  14684. return _context22.abrupt("return", new et(this.config.env));
  14685. case 23:
  14686. throw s.code ? new te({
  14687. code: s.code,
  14688. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14689. }) : new te({
  14690. message: "用户名密码登录失败"
  14691. });
  14692. case 24:
  14693. case "end":
  14694. return _context22.stop();
  14695. }
  14696. }
  14697. }, _callee22, this);
  14698. }));
  14699. function signIn(_x17, _x18) {
  14700. return _signIn4.apply(this, arguments);
  14701. }
  14702. return signIn;
  14703. }()
  14704. }]);
  14705. return rt;
  14706. }(Xe);
  14707. var it = /*#__PURE__*/function () {
  14708. function it(e) {
  14709. (0, _classCallCheck2.default)(this, it);
  14710. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  14711. }
  14712. (0, _createClass2.default)(it, [{
  14713. key: "currentUser",
  14714. get: function get() {
  14715. var e = this.hasLoginState();
  14716. return e && e.user || null;
  14717. }
  14718. }, {
  14719. key: "loginType",
  14720. get: function get() {
  14721. return this._cache.getStore(this._cache.keys.loginTypeKey);
  14722. }
  14723. }, {
  14724. key: "anonymousAuthProvider",
  14725. value: function anonymousAuthProvider() {
  14726. return new tt(this.config);
  14727. }
  14728. }, {
  14729. key: "customAuthProvider",
  14730. value: function customAuthProvider() {
  14731. return new nt(this.config);
  14732. }
  14733. }, {
  14734. key: "emailAuthProvider",
  14735. value: function emailAuthProvider() {
  14736. return new st(this.config);
  14737. }
  14738. }, {
  14739. key: "usernameAuthProvider",
  14740. value: function usernameAuthProvider() {
  14741. return new rt(this.config);
  14742. }
  14743. }, {
  14744. key: "signInAnonymously",
  14745. value: function () {
  14746. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  14747. return _regenerator.default.wrap(function _callee23$(_context23) {
  14748. while (1) {
  14749. switch (_context23.prev = _context23.next) {
  14750. case 0:
  14751. return _context23.abrupt("return", new tt(this.config).signIn());
  14752. case 1:
  14753. case "end":
  14754. return _context23.stop();
  14755. }
  14756. }
  14757. }, _callee23, this);
  14758. }));
  14759. function signInAnonymously() {
  14760. return _signInAnonymously.apply(this, arguments);
  14761. }
  14762. return signInAnonymously;
  14763. }()
  14764. }, {
  14765. key: "signInWithEmailAndPassword",
  14766. value: function () {
  14767. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  14768. return _regenerator.default.wrap(function _callee24$(_context24) {
  14769. while (1) {
  14770. switch (_context24.prev = _context24.next) {
  14771. case 0:
  14772. return _context24.abrupt("return", new st(this.config).signIn(e, t));
  14773. case 1:
  14774. case "end":
  14775. return _context24.stop();
  14776. }
  14777. }
  14778. }, _callee24, this);
  14779. }));
  14780. function signInWithEmailAndPassword(_x19, _x20) {
  14781. return _signInWithEmailAndPassword.apply(this, arguments);
  14782. }
  14783. return signInWithEmailAndPassword;
  14784. }()
  14785. }, {
  14786. key: "signInWithUsernameAndPassword",
  14787. value: function signInWithUsernameAndPassword(e, t) {
  14788. return new rt(this.config).signIn(e, t);
  14789. }
  14790. }, {
  14791. key: "linkAndRetrieveDataWithTicket",
  14792. value: function () {
  14793. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  14794. return _regenerator.default.wrap(function _callee25$(_context25) {
  14795. while (1) {
  14796. switch (_context25.prev = _context25.next) {
  14797. case 0:
  14798. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De($e, this._onAnonymousConverted);
  14799. _context25.next = 3;
  14800. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  14801. case 3:
  14802. return _context25.abrupt("return", _context25.sent);
  14803. case 4:
  14804. case "end":
  14805. return _context25.stop();
  14806. }
  14807. }
  14808. }, _callee25, this);
  14809. }));
  14810. function linkAndRetrieveDataWithTicket(_x21) {
  14811. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  14812. }
  14813. return linkAndRetrieveDataWithTicket;
  14814. }()
  14815. }, {
  14816. key: "signOut",
  14817. value: function () {
  14818. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  14819. var _this$_cache$keys10, e, t, n, s, r;
  14820. return _regenerator.default.wrap(function _callee26$(_context26) {
  14821. while (1) {
  14822. switch (_context26.prev = _context26.next) {
  14823. case 0:
  14824. if (!(this.loginType === We.ANONYMOUS)) {
  14825. _context26.next = 2;
  14826. break;
  14827. }
  14828. throw new te({
  14829. message: "匿名用户不支持登出操作"
  14830. });
  14831. case 2:
  14832. _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);
  14833. if (s) {
  14834. _context26.next = 5;
  14835. break;
  14836. }
  14837. return _context26.abrupt("return");
  14838. case 5:
  14839. _context26.next = 7;
  14840. return this._request.send("auth.logout", {
  14841. refresh_token: s
  14842. });
  14843. case 7:
  14844. r = _context26.sent;
  14845. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), qe(Fe), qe(je, {
  14846. env: this.config.env,
  14847. loginType: We.NULL,
  14848. persistence: this.config.persistence
  14849. }), r));
  14850. case 9:
  14851. case "end":
  14852. return _context26.stop();
  14853. }
  14854. }
  14855. }, _callee26, this);
  14856. }));
  14857. function signOut() {
  14858. return _signOut.apply(this, arguments);
  14859. }
  14860. return signOut;
  14861. }()
  14862. }, {
  14863. key: "signUpWithEmailAndPassword",
  14864. value: function () {
  14865. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  14866. return _regenerator.default.wrap(function _callee27$(_context27) {
  14867. while (1) {
  14868. switch (_context27.prev = _context27.next) {
  14869. case 0:
  14870. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  14871. email: e,
  14872. password: t
  14873. }));
  14874. case 1:
  14875. case "end":
  14876. return _context27.stop();
  14877. }
  14878. }
  14879. }, _callee27, this);
  14880. }));
  14881. function signUpWithEmailAndPassword(_x22, _x23) {
  14882. return _signUpWithEmailAndPassword.apply(this, arguments);
  14883. }
  14884. return signUpWithEmailAndPassword;
  14885. }()
  14886. }, {
  14887. key: "sendPasswordResetEmail",
  14888. value: function () {
  14889. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  14890. return _regenerator.default.wrap(function _callee28$(_context28) {
  14891. while (1) {
  14892. switch (_context28.prev = _context28.next) {
  14893. case 0:
  14894. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  14895. email: e
  14896. }));
  14897. case 1:
  14898. case "end":
  14899. return _context28.stop();
  14900. }
  14901. }
  14902. }, _callee28, this);
  14903. }));
  14904. function sendPasswordResetEmail(_x24) {
  14905. return _sendPasswordResetEmail.apply(this, arguments);
  14906. }
  14907. return sendPasswordResetEmail;
  14908. }()
  14909. }, {
  14910. key: "onLoginStateChanged",
  14911. value: function onLoginStateChanged(e) {
  14912. var _this9 = this;
  14913. De(Fe, function () {
  14914. var t = _this9.hasLoginState();
  14915. e.call(_this9, t);
  14916. });
  14917. var t = this.hasLoginState();
  14918. e.call(this, t);
  14919. }
  14920. }, {
  14921. key: "onLoginStateExpired",
  14922. value: function onLoginStateExpired(e) {
  14923. De(Ke, e.bind(this));
  14924. }
  14925. }, {
  14926. key: "onAccessTokenRefreshed",
  14927. value: function onAccessTokenRefreshed(e) {
  14928. De(Be, e.bind(this));
  14929. }
  14930. }, {
  14931. key: "onAnonymousConverted",
  14932. value: function onAnonymousConverted(e) {
  14933. De($e, e.bind(this));
  14934. }
  14935. }, {
  14936. key: "onLoginTypeChanged",
  14937. value: function onLoginTypeChanged(e) {
  14938. var _this10 = this;
  14939. De(je, function () {
  14940. var t = _this10.hasLoginState();
  14941. e.call(_this10, t);
  14942. });
  14943. }
  14944. }, {
  14945. key: "getAccessToken",
  14946. value: function () {
  14947. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  14948. return _regenerator.default.wrap(function _callee29$(_context29) {
  14949. while (1) {
  14950. switch (_context29.prev = _context29.next) {
  14951. case 0:
  14952. _context29.next = 2;
  14953. return this._request.getAccessToken();
  14954. case 2:
  14955. _context29.t0 = _context29.sent.accessToken;
  14956. _context29.t1 = this.config.env;
  14957. return _context29.abrupt("return", {
  14958. accessToken: _context29.t0,
  14959. env: _context29.t1
  14960. });
  14961. case 5:
  14962. case "end":
  14963. return _context29.stop();
  14964. }
  14965. }
  14966. }, _callee29, this);
  14967. }));
  14968. function getAccessToken() {
  14969. return _getAccessToken2.apply(this, arguments);
  14970. }
  14971. return getAccessToken;
  14972. }()
  14973. }, {
  14974. key: "hasLoginState",
  14975. value: function hasLoginState() {
  14976. var e = this._cache.keys.refreshTokenKey;
  14977. return this._cache.getStore(e) ? new et(this.config.env) : null;
  14978. }
  14979. }, {
  14980. key: "isUsernameRegistered",
  14981. value: function () {
  14982. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  14983. var _yield$this$_request$5, t;
  14984. return _regenerator.default.wrap(function _callee30$(_context30) {
  14985. while (1) {
  14986. switch (_context30.prev = _context30.next) {
  14987. case 0:
  14988. if (!("string" != typeof e)) {
  14989. _context30.next = 2;
  14990. break;
  14991. }
  14992. throw new te({
  14993. code: "PARAM_ERROR",
  14994. message: "username must be a string"
  14995. });
  14996. case 2:
  14997. _context30.next = 4;
  14998. return this._request.send("auth.isUsernameRegistered", {
  14999. username: e
  15000. });
  15001. case 4:
  15002. _yield$this$_request$5 = _context30.sent;
  15003. t = _yield$this$_request$5.data;
  15004. return _context30.abrupt("return", t && t.isRegistered);
  15005. case 7:
  15006. case "end":
  15007. return _context30.stop();
  15008. }
  15009. }
  15010. }, _callee30, this);
  15011. }));
  15012. function isUsernameRegistered(_x25) {
  15013. return _isUsernameRegistered.apply(this, arguments);
  15014. }
  15015. return isUsernameRegistered;
  15016. }()
  15017. }, {
  15018. key: "getLoginState",
  15019. value: function getLoginState() {
  15020. return Promise.resolve(this.hasLoginState());
  15021. }
  15022. }, {
  15023. key: "signInWithTicket",
  15024. value: function () {
  15025. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  15026. return _regenerator.default.wrap(function _callee31$(_context31) {
  15027. while (1) {
  15028. switch (_context31.prev = _context31.next) {
  15029. case 0:
  15030. return _context31.abrupt("return", new nt(this.config).signIn(e));
  15031. case 1:
  15032. case "end":
  15033. return _context31.stop();
  15034. }
  15035. }
  15036. }, _callee31, this);
  15037. }));
  15038. function signInWithTicket(_x26) {
  15039. return _signInWithTicket.apply(this, arguments);
  15040. }
  15041. return signInWithTicket;
  15042. }()
  15043. }, {
  15044. key: "shouldRefreshAccessToken",
  15045. value: function shouldRefreshAccessToken(e) {
  15046. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  15047. }
  15048. }, {
  15049. key: "getUserInfo",
  15050. value: function getUserInfo() {
  15051. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  15052. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  15053. requestId: e.seqId
  15054. });
  15055. });
  15056. }
  15057. }, {
  15058. key: "getAuthHeader",
  15059. value: function getAuthHeader() {
  15060. var _this$_cache$keys11 = this._cache.keys,
  15061. e = _this$_cache$keys11.refreshTokenKey,
  15062. t = _this$_cache$keys11.accessTokenKey,
  15063. n = this._cache.getStore(e);
  15064. return {
  15065. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  15066. };
  15067. }
  15068. }, {
  15069. key: "_onAnonymousConverted",
  15070. value: function _onAnonymousConverted(e) {
  15071. var t = e.data.env;
  15072. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  15073. }
  15074. }, {
  15075. key: "_onLoginTypeChanged",
  15076. value: function _onLoginTypeChanged(e) {
  15077. var _e$data = e.data,
  15078. t = _e$data.loginType,
  15079. n = _e$data.persistence,
  15080. s = _e$data.env;
  15081. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  15082. }
  15083. }]);
  15084. return it;
  15085. }();
  15086. var ot = function ot(e, t) {
  15087. t = t || ve();
  15088. var n = Qe(this.config.env),
  15089. s = e.cloudPath,
  15090. r = e.filePath,
  15091. i = e.onUploadProgress,
  15092. _e$fileType = e.fileType,
  15093. o = _e$fileType === void 0 ? "image" : _e$fileType;
  15094. return n.send("storage.getUploadMetadata", {
  15095. path: s
  15096. }).then(function (e) {
  15097. var _e$data2 = e.data,
  15098. a = _e$data2.url,
  15099. c = _e$data2.authorization,
  15100. u = _e$data2.token,
  15101. l = _e$data2.fileId,
  15102. h = _e$data2.cosFileId,
  15103. d = e.requestId,
  15104. p = {
  15105. key: s,
  15106. signature: c,
  15107. "x-cos-meta-fileid": h,
  15108. success_action_status: "201",
  15109. "x-cos-security-token": u
  15110. };
  15111. n.upload({
  15112. url: a,
  15113. data: p,
  15114. file: r,
  15115. name: s,
  15116. fileType: o,
  15117. onUploadProgress: i
  15118. }).then(function (e) {
  15119. 201 === e.statusCode ? t(null, {
  15120. fileID: l,
  15121. requestId: d
  15122. }) : t(new te({
  15123. code: "STORAGE_REQUEST_FAIL",
  15124. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  15125. }));
  15126. }).catch(function (e) {
  15127. t(e);
  15128. });
  15129. }).catch(function (e) {
  15130. t(e);
  15131. }), t.promise;
  15132. },
  15133. at = function at(e, t) {
  15134. t = t || ve();
  15135. var n = Qe(this.config.env),
  15136. s = e.cloudPath;
  15137. return n.send("storage.getUploadMetadata", {
  15138. path: s
  15139. }).then(function (e) {
  15140. t(null, e);
  15141. }).catch(function (e) {
  15142. t(e);
  15143. }), t.promise;
  15144. },
  15145. ct = function ct(_ref7, t) {
  15146. var e = _ref7.fileList;
  15147. if (t = t || ve(), !e || !Array.isArray(e)) return {
  15148. code: "INVALID_PARAM",
  15149. message: "fileList必须是非空的数组"
  15150. };
  15151. var _iterator3 = _createForOfIteratorHelper(e),
  15152. _step3;
  15153. try {
  15154. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  15155. var _t8 = _step3.value;
  15156. if (!_t8 || "string" != typeof _t8) return {
  15157. code: "INVALID_PARAM",
  15158. message: "fileList的元素必须是非空的字符串"
  15159. };
  15160. }
  15161. } catch (err) {
  15162. _iterator3.e(err);
  15163. } finally {
  15164. _iterator3.f();
  15165. }
  15166. var n = {
  15167. fileid_list: e
  15168. };
  15169. return Qe(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  15170. e.code ? t(null, e) : t(null, {
  15171. fileList: e.data.delete_list,
  15172. requestId: e.requestId
  15173. });
  15174. }).catch(function (e) {
  15175. t(e);
  15176. }), t.promise;
  15177. },
  15178. ut = function ut(_ref8, t) {
  15179. var e = _ref8.fileList;
  15180. t = t || ve(), e && Array.isArray(e) || t(null, {
  15181. code: "INVALID_PARAM",
  15182. message: "fileList必须是非空的数组"
  15183. });
  15184. var n = [];
  15185. var _iterator4 = _createForOfIteratorHelper(e),
  15186. _step4;
  15187. try {
  15188. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  15189. var _s10 = _step4.value;
  15190. "object" == (0, _typeof2.default)(_s10) ? (_s10.hasOwnProperty("fileID") && _s10.hasOwnProperty("maxAge") || t(null, {
  15191. code: "INVALID_PARAM",
  15192. message: "fileList的元素必须是包含fileID和maxAge的对象"
  15193. }), n.push({
  15194. fileid: _s10.fileID,
  15195. max_age: _s10.maxAge
  15196. })) : "string" == typeof _s10 ? n.push({
  15197. fileid: _s10
  15198. }) : t(null, {
  15199. code: "INVALID_PARAM",
  15200. message: "fileList的元素必须是字符串"
  15201. });
  15202. }
  15203. } catch (err) {
  15204. _iterator4.e(err);
  15205. } finally {
  15206. _iterator4.f();
  15207. }
  15208. var s = {
  15209. file_list: n
  15210. };
  15211. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  15212. e.code ? t(null, e) : t(null, {
  15213. fileList: e.data.download_list,
  15214. requestId: e.requestId
  15215. });
  15216. }).catch(function (e) {
  15217. t(e);
  15218. }), t.promise;
  15219. },
  15220. lt = /*#__PURE__*/function () {
  15221. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  15222. var e, n, s, r;
  15223. return _regenerator.default.wrap(function _callee32$(_context32) {
  15224. while (1) {
  15225. switch (_context32.prev = _context32.next) {
  15226. case 0:
  15227. e = _ref9.fileID;
  15228. _context32.next = 3;
  15229. return ut.call(this, {
  15230. fileList: [{
  15231. fileID: e,
  15232. maxAge: 600
  15233. }]
  15234. });
  15235. case 3:
  15236. n = _context32.sent.fileList[0];
  15237. if (!("SUCCESS" !== n.code)) {
  15238. _context32.next = 6;
  15239. break;
  15240. }
  15241. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  15242. e(n);
  15243. }));
  15244. case 6:
  15245. s = Qe(this.config.env);
  15246. r = n.download_url;
  15247. if (!(r = encodeURI(r), !t)) {
  15248. _context32.next = 10;
  15249. break;
  15250. }
  15251. return _context32.abrupt("return", s.download({
  15252. url: r
  15253. }));
  15254. case 10:
  15255. _context32.t0 = t;
  15256. _context32.next = 13;
  15257. return s.download({
  15258. url: r
  15259. });
  15260. case 13:
  15261. _context32.t1 = _context32.sent;
  15262. (0, _context32.t0)(_context32.t1);
  15263. case 15:
  15264. case "end":
  15265. return _context32.stop();
  15266. }
  15267. }
  15268. }, _callee32, this);
  15269. }));
  15270. return function lt(_x27, _x28) {
  15271. return _ref10.apply(this, arguments);
  15272. };
  15273. }(),
  15274. ht = function ht(_ref11, o) {
  15275. var e = _ref11.name,
  15276. t = _ref11.data,
  15277. n = _ref11.query,
  15278. s = _ref11.parse,
  15279. r = _ref11.search,
  15280. i = _ref11.timeout;
  15281. var a = o || ve();
  15282. var c;
  15283. try {
  15284. c = t ? JSON.stringify(t) : "";
  15285. } catch (e) {
  15286. return Promise.reject(e);
  15287. }
  15288. if (!e) return Promise.reject(new te({
  15289. code: "PARAM_ERROR",
  15290. message: "函数名不能为空"
  15291. }));
  15292. var u = {
  15293. inQuery: n,
  15294. parse: s,
  15295. search: r,
  15296. function_name: e,
  15297. request_data: c
  15298. };
  15299. return Qe(this.config.env).send("functions.invokeFunction", u, {
  15300. timeout: i
  15301. }).then(function (e) {
  15302. if (e.code) a(null, e);else {
  15303. var _t9 = e.data.response_data;
  15304. if (s) a(null, {
  15305. result: _t9,
  15306. requestId: e.requestId
  15307. });else try {
  15308. _t9 = JSON.parse(e.data.response_data), a(null, {
  15309. result: _t9,
  15310. requestId: e.requestId
  15311. });
  15312. } catch (e) {
  15313. a(new te({
  15314. message: "response data must be json"
  15315. }));
  15316. }
  15317. }
  15318. return a.promise;
  15319. }).catch(function (e) {
  15320. a(e);
  15321. }), a.promise;
  15322. },
  15323. dt = {
  15324. timeout: 15e3,
  15325. persistence: "session"
  15326. },
  15327. pt = {};
  15328. var ft = /*#__PURE__*/function () {
  15329. function ft(e) {
  15330. (0, _classCallCheck2.default)(this, ft);
  15331. this.config = e || this.config, this.authObj = void 0;
  15332. }
  15333. (0, _createClass2.default)(ft, [{
  15334. key: "init",
  15335. value: function init(e) {
  15336. switch (Ae.adapter || (this.requestClient = new Ae.adapter.reqClass({
  15337. timeout: e.timeout || 5e3,
  15338. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  15339. })), this.config = _objectSpread(_objectSpread({}, dt), e), !0) {
  15340. case this.config.timeout > 6e5:
  15341. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  15342. break;
  15343. case this.config.timeout < 100:
  15344. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  15345. }
  15346. return new ft(this.config);
  15347. }
  15348. }, {
  15349. key: "auth",
  15350. value: function auth() {
  15351. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15352. e = _ref12.persistence;
  15353. if (this.authObj) return this.authObj;
  15354. var t = e || Ae.adapter.primaryStorage || dt.persistence;
  15355. var n;
  15356. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  15357. var t = e.env;
  15358. Oe[t] = new xe(e), Ee[t] = new xe(_objectSpread(_objectSpread({}, e), {}, {
  15359. persistence: "local"
  15360. }));
  15361. }(this.config), n = this.config, Ye[n.env] = new Ge(n), this.authObj = new it(this.config), this.authObj;
  15362. }
  15363. }, {
  15364. key: "on",
  15365. value: function on(e, t) {
  15366. return De.apply(this, [e, t]);
  15367. }
  15368. }, {
  15369. key: "off",
  15370. value: function off(e, t) {
  15371. return Me.apply(this, [e, t]);
  15372. }
  15373. }, {
  15374. key: "callFunction",
  15375. value: function callFunction(e, t) {
  15376. return ht.apply(this, [e, t]);
  15377. }
  15378. }, {
  15379. key: "deleteFile",
  15380. value: function deleteFile(e, t) {
  15381. return ct.apply(this, [e, t]);
  15382. }
  15383. }, {
  15384. key: "getTempFileURL",
  15385. value: function getTempFileURL(e, t) {
  15386. return ut.apply(this, [e, t]);
  15387. }
  15388. }, {
  15389. key: "downloadFile",
  15390. value: function downloadFile(e, t) {
  15391. return lt.apply(this, [e, t]);
  15392. }
  15393. }, {
  15394. key: "uploadFile",
  15395. value: function uploadFile(e, t) {
  15396. return ot.apply(this, [e, t]);
  15397. }
  15398. }, {
  15399. key: "getUploadMetadata",
  15400. value: function getUploadMetadata(e, t) {
  15401. return at.apply(this, [e, t]);
  15402. }
  15403. }, {
  15404. key: "registerExtension",
  15405. value: function registerExtension(e) {
  15406. pt[e.name] = e;
  15407. }
  15408. }, {
  15409. key: "invokeExtension",
  15410. value: function () {
  15411. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  15412. var n;
  15413. return _regenerator.default.wrap(function _callee33$(_context33) {
  15414. while (1) {
  15415. switch (_context33.prev = _context33.next) {
  15416. case 0:
  15417. n = pt[e];
  15418. if (n) {
  15419. _context33.next = 3;
  15420. break;
  15421. }
  15422. throw new te({
  15423. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  15424. });
  15425. case 3:
  15426. _context33.next = 5;
  15427. return n.invoke(t, this);
  15428. case 5:
  15429. return _context33.abrupt("return", _context33.sent);
  15430. case 6:
  15431. case "end":
  15432. return _context33.stop();
  15433. }
  15434. }
  15435. }, _callee33, this);
  15436. }));
  15437. function invokeExtension(_x29, _x30) {
  15438. return _invokeExtension.apply(this, arguments);
  15439. }
  15440. return invokeExtension;
  15441. }()
  15442. }, {
  15443. key: "useAdapters",
  15444. value: function useAdapters(e) {
  15445. var _ref13 = ke(e) || {},
  15446. t = _ref13.adapter,
  15447. n = _ref13.runtime;
  15448. t && (Ae.adapter = t), n && (Ae.runtime = n);
  15449. }
  15450. }]);
  15451. return ft;
  15452. }();
  15453. var gt = new ft();
  15454. function mt(e, t, n) {
  15455. void 0 === n && (n = {});
  15456. var s = /\?/.test(t),
  15457. r = "";
  15458. for (var i in n) {
  15459. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  15460. }
  15461. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  15462. }
  15463. var yt = /*#__PURE__*/function () {
  15464. function yt() {
  15465. (0, _classCallCheck2.default)(this, yt);
  15466. }
  15467. (0, _createClass2.default)(yt, [{
  15468. key: "post",
  15469. value: function post(e) {
  15470. var t = e.url,
  15471. n = e.data,
  15472. s = e.headers,
  15473. r = e.timeout;
  15474. return new Promise(function (e, i) {
  15475. ne.request({
  15476. url: mt("https:", t),
  15477. data: n,
  15478. method: "POST",
  15479. header: s,
  15480. timeout: r,
  15481. success: function success(t) {
  15482. e(t);
  15483. },
  15484. fail: function fail(e) {
  15485. i(e);
  15486. }
  15487. });
  15488. });
  15489. }
  15490. }, {
  15491. key: "upload",
  15492. value: function upload(e) {
  15493. return new Promise(function (t, n) {
  15494. var s = e.url,
  15495. r = e.file,
  15496. i = e.data,
  15497. o = e.headers,
  15498. a = e.fileType,
  15499. c = ne.uploadFile({
  15500. url: mt("https:", s),
  15501. name: "file",
  15502. formData: Object.assign({}, i),
  15503. filePath: r,
  15504. fileType: a,
  15505. header: o,
  15506. success: function success(e) {
  15507. var n = {
  15508. statusCode: e.statusCode,
  15509. data: e.data || {}
  15510. };
  15511. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  15512. },
  15513. fail: function fail(e) {
  15514. n(new Error(e.errMsg || "uploadFile:fail"));
  15515. }
  15516. });
  15517. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  15518. e.onUploadProgress({
  15519. loaded: t.totalBytesSent,
  15520. total: t.totalBytesExpectedToSend
  15521. });
  15522. });
  15523. });
  15524. }
  15525. }]);
  15526. return yt;
  15527. }();
  15528. var _t = {
  15529. setItem: function setItem(e, t) {
  15530. ne.setStorageSync(e, t);
  15531. },
  15532. getItem: function getItem(e) {
  15533. return ne.getStorageSync(e);
  15534. },
  15535. removeItem: function removeItem(e) {
  15536. ne.removeStorageSync(e);
  15537. },
  15538. clear: function clear() {
  15539. ne.clearStorageSync();
  15540. }
  15541. };
  15542. var wt = {
  15543. genAdapter: function genAdapter() {
  15544. return {
  15545. root: {},
  15546. reqClass: yt,
  15547. localStorage: _t,
  15548. primaryStorage: "local"
  15549. };
  15550. },
  15551. isMatch: function isMatch() {
  15552. return !0;
  15553. },
  15554. runtime: "uni_app"
  15555. };
  15556. gt.useAdapters(wt);
  15557. var vt = gt,
  15558. It = vt.init;
  15559. vt.init = function (e) {
  15560. e.env = e.spaceId;
  15561. var t = It.call(this, e);
  15562. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  15563. var n = t.auth;
  15564. return t.auth = function (e) {
  15565. var t = n.call(this, e);
  15566. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  15567. var n;
  15568. t[e] = (n = t[e], function (e) {
  15569. e = e || {};
  15570. var _ee = ee(e),
  15571. t = _ee.success,
  15572. s = _ee.fail,
  15573. r = _ee.complete;
  15574. if (!(t || s || r)) return n.call(this, e);
  15575. n.call(this, e).then(function (e) {
  15576. t && t(e), r && r(e);
  15577. }, function (e) {
  15578. s && s(e), r && r(e);
  15579. });
  15580. }).bind(t);
  15581. }), t;
  15582. }, t.customAuth = t.auth, t;
  15583. };
  15584. var St = vt;
  15585. function bt(_x31, _x32) {
  15586. return _bt.apply(this, arguments);
  15587. }
  15588. function _bt() {
  15589. _bt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e, t) {
  15590. var n, _e30, s;
  15591. return _regenerator.default.wrap(function _callee59$(_context59) {
  15592. while (1) {
  15593. switch (_context59.prev = _context59.next) {
  15594. case 0:
  15595. n = "http://".concat(e, ":").concat(t, "/system/ping");
  15596. _context59.prev = 1;
  15597. _context59.next = 4;
  15598. return s = {
  15599. url: n,
  15600. timeout: 500
  15601. }, new Promise(function (e, t) {
  15602. ne.request(_objectSpread(_objectSpread({}, s), {}, {
  15603. success: function success(t) {
  15604. e(t);
  15605. },
  15606. fail: function fail(e) {
  15607. t(e);
  15608. }
  15609. }));
  15610. });
  15611. case 4:
  15612. _e30 = _context59.sent;
  15613. return _context59.abrupt("return", !(!_e30.data || 0 !== _e30.data.code));
  15614. case 8:
  15615. _context59.prev = 8;
  15616. _context59.t0 = _context59["catch"](1);
  15617. return _context59.abrupt("return", !1);
  15618. case 11:
  15619. case "end":
  15620. return _context59.stop();
  15621. }
  15622. }
  15623. }, _callee59, null, [[1, 8]]);
  15624. }));
  15625. return _bt.apply(this, arguments);
  15626. }
  15627. function kt(_x33, _x34) {
  15628. return _kt.apply(this, arguments);
  15629. }
  15630. function _kt() {
  15631. _kt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(e, t) {
  15632. var n, s, _r10;
  15633. return _regenerator.default.wrap(function _callee60$(_context60) {
  15634. while (1) {
  15635. switch (_context60.prev = _context60.next) {
  15636. case 0:
  15637. s = 0;
  15638. case 1:
  15639. if (!(s < e.length)) {
  15640. _context60.next = 11;
  15641. break;
  15642. }
  15643. _r10 = e[s];
  15644. _context60.next = 5;
  15645. return bt(_r10, t);
  15646. case 5:
  15647. if (!_context60.sent) {
  15648. _context60.next = 8;
  15649. break;
  15650. }
  15651. n = _r10;
  15652. return _context60.abrupt("break", 11);
  15653. case 8:
  15654. s++;
  15655. _context60.next = 1;
  15656. break;
  15657. case 11:
  15658. return _context60.abrupt("return", {
  15659. address: n,
  15660. port: t
  15661. });
  15662. case 12:
  15663. case "end":
  15664. return _context60.stop();
  15665. }
  15666. }
  15667. }, _callee60);
  15668. }));
  15669. return _kt.apply(this, arguments);
  15670. }
  15671. var At = {
  15672. "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign",
  15673. "serverless.file.resource.report": "storage/report",
  15674. "serverless.file.resource.delete": "storage/delete",
  15675. "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url"
  15676. };
  15677. var Ct = /*#__PURE__*/function () {
  15678. function Ct(e) {
  15679. (0, _classCallCheck2.default)(this, Ct);
  15680. if (["spaceId", "clientSecret"].forEach(function (t) {
  15681. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  15682. }), !e.endpoint) throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");
  15683. this.config = Object.assign({}, e), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ne;
  15684. }
  15685. (0, _createClass2.default)(Ct, [{
  15686. key: "request",
  15687. value: function () {
  15688. var _request2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  15689. var _this11 = this;
  15690. var t,
  15691. n,
  15692. _args34 = arguments;
  15693. return _regenerator.default.wrap(function _callee34$(_context34) {
  15694. while (1) {
  15695. switch (_context34.prev = _context34.next) {
  15696. case 0:
  15697. t = _args34.length > 1 && _args34[1] !== undefined ? _args34[1] : !0;
  15698. n = S && t;
  15699. if (!n) {
  15700. _context34.next = 8;
  15701. break;
  15702. }
  15703. _context34.next = 5;
  15704. return this.setupLocalRequest(e);
  15705. case 5:
  15706. _context34.t0 = _context34.sent;
  15707. _context34.next = 9;
  15708. break;
  15709. case 8:
  15710. _context34.t0 = this.setupRequest(e);
  15711. case 9:
  15712. e = _context34.t0;
  15713. return _context34.abrupt("return", Promise.resolve().then(function () {
  15714. return n ? _this11.requestLocal(e) : he.wrappedRequest(e, _this11.adapter.request);
  15715. }));
  15716. case 11:
  15717. case "end":
  15718. return _context34.stop();
  15719. }
  15720. }
  15721. }, _callee34, this);
  15722. }));
  15723. function request(_x35) {
  15724. return _request2.apply(this, arguments);
  15725. }
  15726. return request;
  15727. }()
  15728. }, {
  15729. key: "requestLocal",
  15730. value: function requestLocal(e) {
  15731. var _this12 = this;
  15732. return new Promise(function (t, n) {
  15733. _this12.adapter.request(Object.assign(e, {
  15734. complete: function complete(e) {
  15735. if (e || (e = {}), !e.statusCode || e.statusCode >= 400) {
  15736. var _t10 = e.data && e.data.code || "SYS_ERR",
  15737. _s11 = e.data && e.data.message || "request:fail";
  15738. return n(new te({
  15739. code: _t10,
  15740. message: _s11
  15741. }));
  15742. }
  15743. t({
  15744. success: !0,
  15745. result: e.data
  15746. });
  15747. }
  15748. }));
  15749. });
  15750. }
  15751. }, {
  15752. key: "setupRequest",
  15753. value: function setupRequest(e) {
  15754. var t = Object.assign({}, e, {
  15755. spaceId: this.config.spaceId,
  15756. timestamp: Date.now()
  15757. }),
  15758. n = {
  15759. "Content-Type": "application/json"
  15760. };
  15761. n["x-serverless-sign"] = he.sign(t, this.config.clientSecret);
  15762. var s = le();
  15763. n["x-client-info"] = encodeURIComponent(JSON.stringify(s));
  15764. var _se = se(),
  15765. r = _se.token;
  15766. return n["x-client-token"] = r, {
  15767. url: this.config.requestUrl,
  15768. method: "POST",
  15769. data: t,
  15770. dataType: "json",
  15771. header: JSON.parse(JSON.stringify(n))
  15772. };
  15773. }
  15774. }, {
  15775. key: "setupLocalRequest",
  15776. value: function () {
  15777. var _setupLocalRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  15778. var t, _se2, n, s, _ref14, r, i, _yield$kt, o;
  15779. return _regenerator.default.wrap(function _callee35$(_context35) {
  15780. while (1) {
  15781. switch (_context35.prev = _context35.next) {
  15782. case 0:
  15783. t = le();
  15784. _se2 = se();
  15785. n = _se2.token;
  15786. s = Object.assign({}, e, {
  15787. spaceId: this.config.spaceId,
  15788. timestamp: Date.now(),
  15789. clientInfo: t,
  15790. token: n
  15791. });
  15792. _ref14 = this.__dev__ && this.__dev__.debugInfo || {};
  15793. r = _ref14.address;
  15794. i = _ref14.servePort;
  15795. _context35.next = 9;
  15796. return kt(r, i);
  15797. case 9:
  15798. _yield$kt = _context35.sent;
  15799. o = _yield$kt.address;
  15800. return _context35.abrupt("return", {
  15801. url: "http://".concat(o, ":").concat(i, "/").concat(At[e.method]),
  15802. method: "POST",
  15803. data: s,
  15804. dataType: "json",
  15805. header: JSON.parse(JSON.stringify({
  15806. "Content-Type": "application/json"
  15807. }))
  15808. });
  15809. case 12:
  15810. case "end":
  15811. return _context35.stop();
  15812. }
  15813. }
  15814. }, _callee35, this);
  15815. }));
  15816. function setupLocalRequest(_x36) {
  15817. return _setupLocalRequest.apply(this, arguments);
  15818. }
  15819. return setupLocalRequest;
  15820. }()
  15821. }, {
  15822. key: "callFunction",
  15823. value: function callFunction(e) {
  15824. var t = {
  15825. method: "serverless.function.runtime.invoke",
  15826. params: JSON.stringify({
  15827. functionTarget: e.name,
  15828. functionArgs: e.data || {}
  15829. })
  15830. };
  15831. return this.request(t, !1);
  15832. }
  15833. }, {
  15834. key: "getUploadFileOptions",
  15835. value: function getUploadFileOptions(e) {
  15836. var t = {
  15837. method: "serverless.file.resource.generateProximalSign",
  15838. params: JSON.stringify(e)
  15839. };
  15840. return this.request(t);
  15841. }
  15842. }, {
  15843. key: "reportUploadFile",
  15844. value: function reportUploadFile(e) {
  15845. var t = {
  15846. method: "serverless.file.resource.report",
  15847. params: JSON.stringify(e)
  15848. };
  15849. return this.request(t);
  15850. }
  15851. }, {
  15852. key: "uploadFile",
  15853. value: function uploadFile(_ref15) {
  15854. var _this13 = this;
  15855. var e = _ref15.filePath,
  15856. t = _ref15.cloudPath,
  15857. _ref15$fileType = _ref15.fileType,
  15858. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  15859. s = _ref15.onUploadProgress;
  15860. if (!t) throw new te({
  15861. code: "CLOUDPATH_REQUIRED",
  15862. message: "cloudPath不可为空"
  15863. });
  15864. var r;
  15865. return this.getUploadFileOptions({
  15866. cloudPath: t
  15867. }).then(function (t) {
  15868. var _t$result = t.result,
  15869. i = _t$result.url,
  15870. o = _t$result.formData,
  15871. a = _t$result.name;
  15872. return r = t.result.fileUrl, new Promise(function (t, r) {
  15873. var c = _this13.adapter.uploadFile({
  15874. url: i,
  15875. formData: o,
  15876. name: a,
  15877. filePath: e,
  15878. fileType: n,
  15879. success: function success(e) {
  15880. e && e.statusCode < 400 ? t(e) : r(new te({
  15881. code: "UPLOAD_FAILED",
  15882. message: "文件上传失败"
  15883. }));
  15884. },
  15885. fail: function fail(e) {
  15886. r(new te({
  15887. code: e.code || "UPLOAD_FAILED",
  15888. message: e.message || e.errMsg || "文件上传失败"
  15889. }));
  15890. }
  15891. });
  15892. "function" == typeof s && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  15893. s({
  15894. loaded: e.totalBytesSent,
  15895. total: e.totalBytesExpectedToSend
  15896. });
  15897. });
  15898. });
  15899. }).then(function () {
  15900. return _this13.reportUploadFile({
  15901. cloudPath: t
  15902. });
  15903. }).then(function (t) {
  15904. return new Promise(function (n, s) {
  15905. t.success ? n({
  15906. success: !0,
  15907. filePath: e,
  15908. fileID: r
  15909. }) : s(new te({
  15910. code: "UPLOAD_FAILED",
  15911. message: "文件上传失败"
  15912. }));
  15913. });
  15914. });
  15915. }
  15916. }, {
  15917. key: "deleteFile",
  15918. value: function deleteFile(_ref16) {
  15919. var e = _ref16.fileList;
  15920. var t = {
  15921. method: "serverless.file.resource.delete",
  15922. params: JSON.stringify({
  15923. fileList: e
  15924. })
  15925. };
  15926. return this.request(t).then(function (e) {
  15927. if (e.success) return e.result;
  15928. throw new te({
  15929. code: "DELETE_FILE_FAILED",
  15930. message: "删除文件失败"
  15931. });
  15932. });
  15933. }
  15934. }, {
  15935. key: "getTempFileURL",
  15936. value: function getTempFileURL() {
  15937. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15938. e = _ref17.fileList,
  15939. t = _ref17.maxAge;
  15940. if (!Array.isArray(e) || 0 === e.length) throw new te({
  15941. code: "INVALID_PARAM",
  15942. message: "fileList的元素必须是非空的字符串"
  15943. });
  15944. var n = {
  15945. method: "serverless.file.resource.getTempFileURL",
  15946. params: JSON.stringify({
  15947. fileList: e,
  15948. maxAge: t
  15949. })
  15950. };
  15951. return this.request(n).then(function (e) {
  15952. if (e.success) return {
  15953. fileList: e.result.fileList.map(function (e) {
  15954. return {
  15955. fileID: e.fileID,
  15956. tempFileURL: e.tempFileURL
  15957. };
  15958. })
  15959. };
  15960. throw new te({
  15961. code: "GET_TEMP_FILE_URL_FAILED",
  15962. message: "获取临时文件链接失败"
  15963. });
  15964. });
  15965. }
  15966. }]);
  15967. return Ct;
  15968. }();
  15969. var Pt = {
  15970. init: function init(e) {
  15971. var t = new Ct(e),
  15972. n = {
  15973. signInAnonymously: function signInAnonymously() {
  15974. return Promise.resolve();
  15975. },
  15976. getLoginState: function getLoginState() {
  15977. return Promise.resolve(!1);
  15978. }
  15979. };
  15980. return t.auth = function () {
  15981. return n;
  15982. }, t.customAuth = t.auth, t;
  15983. }
  15984. },
  15985. Tt = n(function (e, t) {
  15986. e.exports = r.enc.Hex;
  15987. });
  15988. function xt() {
  15989. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (e) {
  15990. var t = 16 * Math.random() | 0;
  15991. return ("x" === e ? t : 3 & t | 8).toString(16);
  15992. });
  15993. }
  15994. function Ot() {
  15995. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15996. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15997. var n = t.data,
  15998. s = t.functionName,
  15999. r = t.method,
  16000. i = t.headers,
  16001. _t$signHeaderKeys = t.signHeaderKeys,
  16002. o = _t$signHeaderKeys === void 0 ? [] : _t$signHeaderKeys,
  16003. a = t.config,
  16004. c = Date.now(),
  16005. u = xt(),
  16006. l = Object.assign({}, i, {
  16007. "x-from-app-id": a.spaceAppId,
  16008. "x-from-env-id": a.spaceId,
  16009. "x-to-env-id": a.spaceId,
  16010. "x-from-instance-id": c,
  16011. "x-from-function-name": s,
  16012. "x-client-timestamp": c,
  16013. "x-alipay-source": "client",
  16014. "x-request-id": u,
  16015. "x-alipay-callid": u,
  16016. "x-trace-id": u
  16017. }),
  16018. h = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o),
  16019. _ref18 = e.split("?") || [],
  16020. _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
  16021. _ref19$ = _ref19[0],
  16022. d = _ref19$ === void 0 ? "" : _ref19$,
  16023. _ref19$2 = _ref19[1],
  16024. p = _ref19$2 === void 0 ? "" : _ref19$2,
  16025. f = function (e) {
  16026. var t = e.signedHeaders.join(";"),
  16027. n = e.signedHeaders.map(function (t) {
  16028. return "".concat(t.toLowerCase(), ":").concat(e.headers[t], "\n");
  16029. }).join(""),
  16030. s = _e(e.body).toString(Tt),
  16031. r = "".concat(e.method.toUpperCase(), "\n").concat(e.path, "\n").concat(e.query, "\n").concat(n, "\n").concat(t, "\n").concat(s, "\n"),
  16032. i = _e(r).toString(Tt),
  16033. o = "HMAC-SHA256\n".concat(e.timestamp, "\n").concat(i, "\n"),
  16034. a = we(o, e.secretKey).toString(Tt);
  16035. return "HMAC-SHA256 Credential=".concat(e.secretId, ", SignedHeaders=").concat(t, ", Signature=").concat(a);
  16036. }({
  16037. path: d,
  16038. query: p,
  16039. method: r,
  16040. headers: l,
  16041. timestamp: c,
  16042. body: JSON.stringify(n),
  16043. secretId: a.accessKey,
  16044. secretKey: a.secretKey,
  16045. signedHeaders: h.sort()
  16046. });
  16047. return {
  16048. url: "".concat(a.endpoint).concat(e),
  16049. headers: Object.assign({}, l, {
  16050. Authorization: f
  16051. })
  16052. };
  16053. }
  16054. function Et(_ref20) {
  16055. var e = _ref20.url,
  16056. t = _ref20.data,
  16057. _ref20$method = _ref20.method,
  16058. n = _ref20$method === void 0 ? "POST" : _ref20$method,
  16059. _ref20$headers = _ref20.headers,
  16060. s = _ref20$headers === void 0 ? {} : _ref20$headers,
  16061. r = _ref20.timeout;
  16062. return new Promise(function (i, o) {
  16063. ne.request({
  16064. url: e,
  16065. method: n,
  16066. data: "object" == (0, _typeof2.default)(t) ? JSON.stringify(t) : t,
  16067. header: s,
  16068. dataType: "json",
  16069. timeout: r,
  16070. complete: function complete() {
  16071. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16072. var t = s["x-trace-id"] || "";
  16073. if (!e.statusCode || e.statusCode >= 400) {
  16074. var _ref21 = e.data || {},
  16075. _n7 = _ref21.message,
  16076. _s12 = _ref21.errMsg,
  16077. _r4 = _ref21.trace_id;
  16078. return o(new te({
  16079. code: "SYS_ERR",
  16080. message: _n7 || _s12 || "request:fail",
  16081. requestId: _r4 || t
  16082. }));
  16083. }
  16084. i({
  16085. status: e.statusCode,
  16086. data: e.data,
  16087. headers: e.header,
  16088. requestId: t
  16089. });
  16090. }
  16091. });
  16092. });
  16093. }
  16094. function Lt(e, t) {
  16095. var n = e.path,
  16096. s = e.data,
  16097. _e$method = e.method,
  16098. r = _e$method === void 0 ? "GET" : _e$method,
  16099. _Ot = Ot(n, {
  16100. functionName: "",
  16101. data: s,
  16102. method: r,
  16103. headers: {
  16104. "x-alipay-cloud-mode": "oss",
  16105. "x-data-api-type": "oss",
  16106. "x-expire-timestamp": Date.now() + 6e4
  16107. },
  16108. signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"],
  16109. config: t
  16110. }),
  16111. i = _Ot.url,
  16112. o = _Ot.headers;
  16113. return Et({
  16114. url: i,
  16115. data: s,
  16116. method: r,
  16117. headers: o
  16118. }).then(function (e) {
  16119. var t = e.data || {};
  16120. if (!t.success) throw new te({
  16121. code: e.errCode,
  16122. message: e.errMsg,
  16123. requestId: e.requestId
  16124. });
  16125. return t.data || {};
  16126. }).catch(function (e) {
  16127. throw new te({
  16128. code: e.errCode,
  16129. message: e.errMsg,
  16130. requestId: e.requestId
  16131. });
  16132. });
  16133. }
  16134. function Rt() {
  16135. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  16136. var t = e.trim().replace(/^cloud:\/\//, ""),
  16137. n = t.indexOf("/");
  16138. if (n <= 0) throw new te({
  16139. code: "INVALID_PARAM",
  16140. message: "fileID不合法"
  16141. });
  16142. var s = t.substring(0, n),
  16143. r = t.substring(n + 1);
  16144. return s !== this.config.spaceId && console.warn("file ".concat(e, " does not belong to env ").concat(this.config.spaceId)), r;
  16145. }
  16146. function Ut() {
  16147. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  16148. return "cloud://".concat(this.config.spaceId, "/").concat(e.replace(/^\/+/, ""));
  16149. }
  16150. var Nt = /*#__PURE__*/function () {
  16151. function Nt(e) {
  16152. (0, _classCallCheck2.default)(this, Nt);
  16153. this.config = e;
  16154. }
  16155. (0, _createClass2.default)(Nt, [{
  16156. key: "signedURL",
  16157. value: function signedURL(e) {
  16158. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16159. var n = "/ws/function/".concat(e),
  16160. s = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""),
  16161. r = Object.assign({}, t, {
  16162. accessKeyId: this.config.accessKey,
  16163. signatureNonce: xt(),
  16164. timestamp: "" + Date.now()
  16165. }),
  16166. i = [n, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function (e) {
  16167. return r[e] ? "".concat(e, "=").concat(r[e]) : null;
  16168. }).filter(Boolean).join("&"), "host:".concat(s)].join("\n"),
  16169. o = ["HMAC-SHA256", _e(i).toString(Tt)].join("\n"),
  16170. a = we(o, this.config.secretKey).toString(Tt),
  16171. c = Object.keys(r).map(function (e) {
  16172. return "".concat(e, "=").concat(encodeURIComponent(r[e]));
  16173. }).join("&");
  16174. return "".concat(this.config.wsEndpoint).concat(n, "?").concat(c, "&signature=").concat(a);
  16175. }
  16176. }]);
  16177. return Nt;
  16178. }();
  16179. var Dt = /*#__PURE__*/function () {
  16180. function Dt(e) {
  16181. (0, _classCallCheck2.default)(this, Dt);
  16182. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach(function (t) {
  16183. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  16184. }), e.endpoint) {
  16185. if ("string" != typeof e.endpoint) throw new Error("endpoint must be string");
  16186. if (!/^https:\/\//.test(e.endpoint)) throw new Error("endpoint must start with https://");
  16187. e.endpoint = e.endpoint.replace(/\/$/, "");
  16188. }
  16189. this.config = Object.assign({}, e, {
  16190. endpoint: e.endpoint || "https://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn"),
  16191. wsEndpoint: e.wsEndpoint || "wss://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn")
  16192. }), this._websocket = new Nt(this.config);
  16193. }
  16194. (0, _createClass2.default)(Dt, [{
  16195. key: "callFunction",
  16196. value: function callFunction(e) {
  16197. return function (e, t) {
  16198. var n = e.name,
  16199. s = e.data,
  16200. _e$async = e.async,
  16201. r = _e$async === void 0 ? !1 : _e$async,
  16202. i = e.timeout,
  16203. o = "POST",
  16204. a = {
  16205. "x-to-function-name": n
  16206. };
  16207. r && (a["x-function-invoke-type"] = "async");
  16208. var _Ot2 = Ot("/functions/invokeFunction", {
  16209. functionName: n,
  16210. data: s,
  16211. method: o,
  16212. headers: a,
  16213. signHeaderKeys: ["x-to-function-name"],
  16214. config: t
  16215. }),
  16216. c = _Ot2.url,
  16217. u = _Ot2.headers;
  16218. return Et({
  16219. url: c,
  16220. data: s,
  16221. method: o,
  16222. headers: u,
  16223. timeout: i
  16224. }).then(function (e) {
  16225. var t = 0;
  16226. if (r) {
  16227. var _n8 = e.data || {};
  16228. t = "200" === _n8.errCode ? 0 : _n8.errCode, e.data = _n8.data || {}, e.errMsg = _n8.errMsg;
  16229. }
  16230. if (0 !== t) throw new te({
  16231. code: t,
  16232. message: e.errMsg,
  16233. requestId: e.requestId
  16234. });
  16235. return {
  16236. errCode: t,
  16237. success: 0 === t,
  16238. requestId: e.requestId,
  16239. result: e.data
  16240. };
  16241. }).catch(function (e) {
  16242. throw new te({
  16243. code: e.errCode,
  16244. message: e.errMsg,
  16245. requestId: e.requestId
  16246. });
  16247. });
  16248. }(e, this.config);
  16249. }
  16250. }, {
  16251. key: "uploadFileToOSS",
  16252. value: function uploadFileToOSS(_ref22) {
  16253. var e = _ref22.url,
  16254. t = _ref22.filePath,
  16255. n = _ref22.fileType,
  16256. s = _ref22.formData,
  16257. r = _ref22.onUploadProgress;
  16258. return new Promise(function (i, o) {
  16259. var a = ne.uploadFile({
  16260. url: e,
  16261. filePath: t,
  16262. fileType: n,
  16263. formData: s,
  16264. name: "file",
  16265. success: function success(e) {
  16266. e && e.statusCode < 400 ? i(e) : o(new te({
  16267. code: "UPLOAD_FAILED",
  16268. message: "文件上传失败"
  16269. }));
  16270. },
  16271. fail: function fail(e) {
  16272. o(new te({
  16273. code: e.code || "UPLOAD_FAILED",
  16274. message: e.message || e.errMsg || "文件上传失败"
  16275. }));
  16276. }
  16277. });
  16278. "function" == typeof r && a && "function" == typeof a.onProgressUpdate && a.onProgressUpdate(function (e) {
  16279. r({
  16280. loaded: e.totalBytesSent,
  16281. total: e.totalBytesExpectedToSend
  16282. });
  16283. });
  16284. });
  16285. }
  16286. }, {
  16287. key: "uploadFile",
  16288. value: function () {
  16289. var _uploadFile2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(_ref23) {
  16290. var e, _ref23$cloudPath, t, _ref23$fileType, n, s, r, i, o, a, c;
  16291. return _regenerator.default.wrap(function _callee36$(_context36) {
  16292. while (1) {
  16293. switch (_context36.prev = _context36.next) {
  16294. case 0:
  16295. e = _ref23.filePath, _ref23$cloudPath = _ref23.cloudPath, t = _ref23$cloudPath === void 0 ? "" : _ref23$cloudPath, _ref23$fileType = _ref23.fileType, n = _ref23$fileType === void 0 ? "image" : _ref23$fileType, s = _ref23.onUploadProgress;
  16296. if (!("string" !== f(t))) {
  16297. _context36.next = 3;
  16298. break;
  16299. }
  16300. throw new te({
  16301. code: "INVALID_PARAM",
  16302. message: "cloudPath必须为字符串类型"
  16303. });
  16304. case 3:
  16305. if (t = t.trim()) {
  16306. _context36.next = 5;
  16307. break;
  16308. }
  16309. throw new te({
  16310. code: "INVALID_PARAM",
  16311. message: "cloudPath不可为空"
  16312. });
  16313. case 5:
  16314. if (!/:\/\//.test(t)) {
  16315. _context36.next = 7;
  16316. break;
  16317. }
  16318. throw new te({
  16319. code: "INVALID_PARAM",
  16320. message: "cloudPath不合法"
  16321. });
  16322. case 7:
  16323. _context36.next = 9;
  16324. return Lt({
  16325. path: "/".concat(t.replace(/^\//, ""), "?post_url")
  16326. }, this.config);
  16327. case 9:
  16328. r = _context36.sent;
  16329. i = r.file_id;
  16330. o = r.upload_url;
  16331. a = r.form_data;
  16332. c = a && a.reduce(function (e, t) {
  16333. return e[t.key] = t.value, e;
  16334. }, {});
  16335. return _context36.abrupt("return", this.uploadFileToOSS({
  16336. url: o,
  16337. filePath: e,
  16338. fileType: n,
  16339. formData: c,
  16340. onUploadProgress: s
  16341. }).then(function () {
  16342. return {
  16343. fileID: i
  16344. };
  16345. }));
  16346. case 15:
  16347. case "end":
  16348. return _context36.stop();
  16349. }
  16350. }
  16351. }, _callee36, this);
  16352. }));
  16353. function uploadFile(_x37) {
  16354. return _uploadFile2.apply(this, arguments);
  16355. }
  16356. return uploadFile;
  16357. }()
  16358. }, {
  16359. key: "getTempFileURL",
  16360. value: function () {
  16361. var _getTempFileURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(_ref24) {
  16362. var _this14 = this;
  16363. var e;
  16364. return _regenerator.default.wrap(function _callee37$(_context37) {
  16365. while (1) {
  16366. switch (_context37.prev = _context37.next) {
  16367. case 0:
  16368. e = _ref24.fileList;
  16369. return _context37.abrupt("return", new Promise(function (t, n) {
  16370. (!e || e.length < 0) && n(new te({
  16371. errCode: "INVALID_PARAM",
  16372. errMsg: "fileList不能为空数组"
  16373. })), e.length > 50 && n(new te({
  16374. errCode: "INVALID_PARAM",
  16375. errMsg: "fileList数组长度不能超过50"
  16376. }));
  16377. var s = [];
  16378. var _iterator5 = _createForOfIteratorHelper(e),
  16379. _step5;
  16380. try {
  16381. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  16382. var _t11 = _step5.value;
  16383. "string" !== f(_t11) && n(new te({
  16384. errCode: "INVALID_PARAM",
  16385. errMsg: "fileList的元素必须是非空的字符串"
  16386. }));
  16387. var _e17 = Rt.call(_this14, _t11);
  16388. s.push({
  16389. file_id: _e17,
  16390. expire: 600
  16391. });
  16392. }
  16393. } catch (err) {
  16394. _iterator5.e(err);
  16395. } finally {
  16396. _iterator5.f();
  16397. }
  16398. Lt({
  16399. path: "/?download_url",
  16400. data: {
  16401. file_list: s
  16402. },
  16403. method: "POST"
  16404. }, _this14.config).then(function (e) {
  16405. var _e$file_list = e.file_list,
  16406. n = _e$file_list === void 0 ? [] : _e$file_list;
  16407. t({
  16408. fileList: n.map(function (e) {
  16409. return {
  16410. fileID: Ut.call(_this14, e.file_id),
  16411. tempFileURL: e.download_url
  16412. };
  16413. })
  16414. });
  16415. }).catch(function (e) {
  16416. return n(e);
  16417. });
  16418. }));
  16419. case 2:
  16420. case "end":
  16421. return _context37.stop();
  16422. }
  16423. }
  16424. }, _callee37);
  16425. }));
  16426. function getTempFileURL(_x38) {
  16427. return _getTempFileURL.apply(this, arguments);
  16428. }
  16429. return getTempFileURL;
  16430. }()
  16431. }, {
  16432. key: "connectWebSocket",
  16433. value: function () {
  16434. var _connectWebSocket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(e) {
  16435. var t, n;
  16436. return _regenerator.default.wrap(function _callee38$(_context38) {
  16437. while (1) {
  16438. switch (_context38.prev = _context38.next) {
  16439. case 0:
  16440. t = e.name, n = e.query;
  16441. return _context38.abrupt("return", ne.connectSocket({
  16442. url: this._websocket.signedURL(t, n),
  16443. complete: function complete() {}
  16444. }));
  16445. case 2:
  16446. case "end":
  16447. return _context38.stop();
  16448. }
  16449. }
  16450. }, _callee38, this);
  16451. }));
  16452. function connectWebSocket(_x39) {
  16453. return _connectWebSocket.apply(this, arguments);
  16454. }
  16455. return connectWebSocket;
  16456. }()
  16457. }]);
  16458. return Dt;
  16459. }();
  16460. var qt = {
  16461. init: function init(e) {
  16462. e.provider = "alipay";
  16463. var t = new Dt(e);
  16464. return t.auth = function () {
  16465. return {
  16466. signInAnonymously: function signInAnonymously() {
  16467. return Promise.resolve();
  16468. },
  16469. getLoginState: function getLoginState() {
  16470. return Promise.resolve(!0);
  16471. }
  16472. };
  16473. }, t;
  16474. }
  16475. };
  16476. function Mt(_ref25) {
  16477. var e = _ref25.data;
  16478. var t;
  16479. t = le();
  16480. var n = JSON.parse(JSON.stringify(e || {}));
  16481. if (Object.assign(n, {
  16482. clientInfo: t
  16483. }), !n.uniIdToken) {
  16484. var _se3 = se(),
  16485. _e18 = _se3.token;
  16486. _e18 && (n.uniIdToken = _e18);
  16487. }
  16488. return n;
  16489. }
  16490. function Ft() {
  16491. return _Ft.apply(this, arguments);
  16492. }
  16493. function _Ft() {
  16494. _Ft = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
  16495. var _this27 = this;
  16496. var e,
  16497. _this$__dev__,
  16498. t,
  16499. n,
  16500. s,
  16501. r,
  16502. i,
  16503. o,
  16504. _args8 = arguments;
  16505. return _regenerator.default.wrap(function _callee61$(_context61) {
  16506. while (1) {
  16507. switch (_context61.prev = _context61.next) {
  16508. case 0:
  16509. e = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
  16510. _context61.next = 3;
  16511. return this.__dev__.initLocalNetwork();
  16512. case 3:
  16513. _this$__dev__ = this.__dev__, t = _this$__dev__.localAddress, n = _this$__dev__.localPort, s = {
  16514. aliyun: "aliyun",
  16515. tencent: "tcb",
  16516. alipay: "alipay",
  16517. dcloud: "dcloud"
  16518. }[this.config.provider], r = this.config.spaceId, i = "http://".concat(t, ":").concat(n, "/system/check-function"), o = "http://".concat(t, ":").concat(n, "/cloudfunctions/").concat(e.name);
  16519. return _context61.abrupt("return", new Promise(function (t, n) {
  16520. ne.request({
  16521. method: "POST",
  16522. url: i,
  16523. data: {
  16524. name: e.name,
  16525. platform: C,
  16526. provider: s,
  16527. spaceId: r
  16528. },
  16529. timeout: 3e3,
  16530. success: function success(e) {
  16531. t(e);
  16532. },
  16533. fail: function fail() {
  16534. t({
  16535. data: {
  16536. code: "NETWORK_ERROR",
  16537. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  16538. }
  16539. });
  16540. }
  16541. });
  16542. }).then(function () {
  16543. var _ref67 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16544. e = _ref67.data;
  16545. var _ref68 = e || {},
  16546. t = _ref68.code,
  16547. n = _ref68.message;
  16548. return {
  16549. code: 0 === t ? 0 : t || "SYS_ERR",
  16550. message: n || "SYS_ERR"
  16551. };
  16552. }).then(function (_ref69) {
  16553. var t = _ref69.code,
  16554. n = _ref69.message;
  16555. if (0 !== t) {
  16556. switch (t) {
  16557. case "MODULE_ENCRYPTED":
  16558. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e.name, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  16559. break;
  16560. case "FUNCTION_ENCRYPTED":
  16561. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e.name, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  16562. break;
  16563. case "ACTION_ENCRYPTED":
  16564. console.error(n || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  16565. break;
  16566. case "NETWORK_ERROR":
  16567. console.error(n || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  16568. break;
  16569. case "SWITCH_TO_CLOUD":
  16570. break;
  16571. default:
  16572. {
  16573. var _e31 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(n, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");
  16574. throw console.error(_e31), new Error(_e31);
  16575. }
  16576. }
  16577. return _this27._callCloudFunction(e);
  16578. }
  16579. return new Promise(function (t, n) {
  16580. var r = Mt.call(_this27, {
  16581. data: e.data
  16582. });
  16583. ne.request({
  16584. method: "POST",
  16585. url: o,
  16586. data: {
  16587. provider: s,
  16588. platform: C,
  16589. param: r
  16590. },
  16591. timeout: e.timeout,
  16592. success: function success() {
  16593. var _ref70 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16594. e = _ref70.statusCode,
  16595. s = _ref70.data;
  16596. return !e || e >= 400 ? n(new te({
  16597. code: s.code || "SYS_ERR",
  16598. message: s.message || "request:fail"
  16599. })) : t({
  16600. result: s
  16601. });
  16602. },
  16603. fail: function fail(e) {
  16604. n(new te({
  16605. code: e.code || e.errCode || "SYS_ERR",
  16606. message: e.message || e.errMsg || "request:fail"
  16607. }));
  16608. }
  16609. });
  16610. });
  16611. }));
  16612. case 5:
  16613. case "end":
  16614. return _context61.stop();
  16615. }
  16616. }
  16617. }, _callee61, this);
  16618. }));
  16619. return _Ft.apply(this, arguments);
  16620. }
  16621. var Kt = [{
  16622. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  16623. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  16624. mode: "append"
  16625. }];
  16626. var jt = /[\\^$.*+?()[\]{}|]/g,
  16627. $t = RegExp(jt.source);
  16628. function Bt(e, t, n) {
  16629. return e.replace(new RegExp((s = t) && $t.test(s) ? s.replace(jt, "\\$&") : s, "g"), n);
  16630. var s;
  16631. }
  16632. var Wt = "none",
  16633. Ht = "request",
  16634. Jt = "response",
  16635. zt = "both";
  16636. var Vt = /*#__PURE__*/function () {
  16637. function Vt() {
  16638. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16639. e = _ref26.secretType,
  16640. t = _ref26.uniCloudIns;
  16641. (0, _classCallCheck2.default)(this, Vt);
  16642. this.clientType = "", this.secretType = e || Wt, this.uniCloudIns = t;
  16643. var _this$uniCloudIns$con = this.uniCloudIns.config,
  16644. n = _this$uniCloudIns$con.provider,
  16645. s = _this$uniCloudIns$con.spaceId;
  16646. var r;
  16647. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  16648. }
  16649. (0, _createClass2.default)(Vt, [{
  16650. key: "getSystemInfo",
  16651. value: function getSystemInfo() {
  16652. return this._systemInfo || (this._systemInfo = ae()), this._systemInfo;
  16653. }
  16654. }, {
  16655. key: "appId",
  16656. get: function get() {
  16657. return this.getSystemInfo().appId;
  16658. }
  16659. }, {
  16660. key: "deviceId",
  16661. get: function get() {
  16662. return this.getSystemInfo().deviceId;
  16663. }
  16664. }, {
  16665. key: "encryptData",
  16666. value: function () {
  16667. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(e) {
  16668. return _regenerator.default.wrap(function _callee39$(_context39) {
  16669. while (1) {
  16670. switch (_context39.prev = _context39.next) {
  16671. case 0:
  16672. return _context39.abrupt("return", this.secretType === Wt ? e : this.platformEncryptData(e));
  16673. case 1:
  16674. case "end":
  16675. return _context39.stop();
  16676. }
  16677. }
  16678. }, _callee39, this);
  16679. }));
  16680. function encryptData(_x40) {
  16681. return _encryptData.apply(this, arguments);
  16682. }
  16683. return encryptData;
  16684. }()
  16685. }, {
  16686. key: "decryptResult",
  16687. value: function () {
  16688. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(e) {
  16689. var _ref27, t, n;
  16690. return _regenerator.default.wrap(function _callee40$(_context40) {
  16691. while (1) {
  16692. switch (_context40.prev = _context40.next) {
  16693. case 0:
  16694. if (!(this.secretType === Wt)) {
  16695. _context40.next = 2;
  16696. break;
  16697. }
  16698. return _context40.abrupt("return", e);
  16699. case 2:
  16700. _ref27 = e || {}, t = _ref27.errCode, n = _ref27.content;
  16701. return _context40.abrupt("return", t || !n ? e : this.secretType === Ht ? n : this.platformDecryptResult(e));
  16702. case 4:
  16703. case "end":
  16704. return _context40.stop();
  16705. }
  16706. }
  16707. }, _callee40, this);
  16708. }));
  16709. function decryptResult(_x41) {
  16710. return _decryptResult.apply(this, arguments);
  16711. }
  16712. return decryptResult;
  16713. }()
  16714. }, {
  16715. key: "wrapVerifyClientCallFunction",
  16716. value: function wrapVerifyClientCallFunction(e) {
  16717. var t = this;
  16718. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
  16719. var _ref29,
  16720. n,
  16721. _ref29$data,
  16722. s,
  16723. r,
  16724. _args41 = arguments;
  16725. return _regenerator.default.wrap(function _callee41$(_context41) {
  16726. while (1) {
  16727. switch (_context41.prev = _context41.next) {
  16728. case 0:
  16729. _ref29 = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {}, n = _ref29.name, _ref29$data = _ref29.data, s = _ref29$data === void 0 ? {} : _ref29$data;
  16730. _context41.next = 3;
  16731. return t.prepare();
  16732. case 3:
  16733. _context41.next = 5;
  16734. return t.platformGetSignOption();
  16735. case 5:
  16736. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context41.sent;
  16737. _context41.next = 8;
  16738. return e({
  16739. name: n,
  16740. data: s
  16741. });
  16742. case 8:
  16743. r = _context41.sent;
  16744. _context41.t0 = t.isClientKeyNotFound(r);
  16745. if (!_context41.t0) {
  16746. _context41.next = 19;
  16747. break;
  16748. }
  16749. _context41.next = 13;
  16750. return t.prepare({
  16751. forceUpdate: !0
  16752. });
  16753. case 13:
  16754. _context41.next = 15;
  16755. return t.platformGetSignOption();
  16756. case 15:
  16757. s._uniCloudOptions = _context41.sent;
  16758. _context41.next = 18;
  16759. return e({
  16760. name: n,
  16761. data: s
  16762. });
  16763. case 18:
  16764. r = _context41.sent;
  16765. case 19:
  16766. return _context41.abrupt("return", r);
  16767. case 20:
  16768. case "end":
  16769. return _context41.stop();
  16770. }
  16771. }
  16772. }, _callee41);
  16773. }));
  16774. }
  16775. }, {
  16776. key: "wrapEncryptDataCallFunction",
  16777. value: function wrapEncryptDataCallFunction(e) {
  16778. var t = this;
  16779. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  16780. var _ref31,
  16781. n,
  16782. _ref31$data,
  16783. s,
  16784. r,
  16785. i,
  16786. _r5,
  16787. _args42 = arguments;
  16788. return _regenerator.default.wrap(function _callee42$(_context42) {
  16789. while (1) {
  16790. switch (_context42.prev = _context42.next) {
  16791. case 0:
  16792. _ref31 = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {}, n = _ref31.name, _ref31$data = _ref31.data, s = _ref31$data === void 0 ? {} : _ref31$data;
  16793. _context42.next = 3;
  16794. return t.prepare();
  16795. case 3:
  16796. _context42.next = 5;
  16797. return t.encryptData(s);
  16798. case 5:
  16799. r = _context42.sent;
  16800. _context42.next = 8;
  16801. return e({
  16802. name: n,
  16803. data: r
  16804. });
  16805. case 8:
  16806. i = _context42.sent;
  16807. if (!t.isClientKeyNotFound(i)) {
  16808. _context42.next = 21;
  16809. break;
  16810. }
  16811. _context42.next = 12;
  16812. return t.prepare({
  16813. forceUpdate: !0
  16814. });
  16815. case 12:
  16816. _context42.next = 14;
  16817. return t.encryptData(s);
  16818. case 14:
  16819. _r5 = _context42.sent;
  16820. _context42.next = 17;
  16821. return t.platformGetSignOption();
  16822. case 17:
  16823. s._uniCloudOptions = _context42.sent;
  16824. _context42.next = 20;
  16825. return e({
  16826. name: n,
  16827. data: _r5
  16828. });
  16829. case 20:
  16830. i = _context42.sent;
  16831. case 21:
  16832. _context42.next = 23;
  16833. return t.decryptResult(i.result);
  16834. case 23:
  16835. i.result = _context42.sent;
  16836. return _context42.abrupt("return", i);
  16837. case 25:
  16838. case "end":
  16839. return _context42.stop();
  16840. }
  16841. }
  16842. }, _callee42);
  16843. }));
  16844. }
  16845. }]);
  16846. return Vt;
  16847. }();
  16848. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  16849. function Gt(e) {
  16850. return parseInt(e) === e;
  16851. }
  16852. function Yt(e) {
  16853. if (!Gt(e.length)) return !1;
  16854. for (var t = 0; t < e.length; t++) {
  16855. if (!Gt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  16856. }
  16857. return !0;
  16858. }
  16859. function Qt(e, t) {
  16860. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  16861. if (Array.isArray(e)) {
  16862. if (!Yt(e)) throw new Error("Array contains invalid value: " + e);
  16863. return new Uint8Array(e);
  16864. }
  16865. if (Gt(e.length) && Yt(e)) return new Uint8Array(e);
  16866. throw new Error("unsupported array-like object");
  16867. }
  16868. function Xt(e) {
  16869. return new Uint8Array(e);
  16870. }
  16871. function Zt(e, t, n, s, r) {
  16872. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  16873. }
  16874. var en,
  16875. tn = {
  16876. toBytes: function toBytes(e) {
  16877. var t = [],
  16878. n = 0;
  16879. for (e = encodeURI(e); n < e.length;) {
  16880. var s = e.charCodeAt(n++);
  16881. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  16882. }
  16883. return Qt(t);
  16884. },
  16885. fromBytes: function fromBytes(e) {
  16886. for (var t = [], n = 0; n < e.length;) {
  16887. var s = e[n];
  16888. 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);
  16889. }
  16890. return t.join("");
  16891. }
  16892. },
  16893. nn = (en = "0123456789abcdef", {
  16894. toBytes: function toBytes(e) {
  16895. for (var t = [], n = 0; n < e.length; n += 2) {
  16896. t.push(parseInt(e.substr(n, 2), 16));
  16897. }
  16898. return t;
  16899. },
  16900. fromBytes: function fromBytes(e) {
  16901. for (var t = [], n = 0; n < e.length; n++) {
  16902. var s = e[n];
  16903. t.push(en[(240 & s) >> 4] + en[15 & s]);
  16904. }
  16905. return t.join("");
  16906. }
  16907. }),
  16908. sn = {
  16909. 16: 10,
  16910. 24: 12,
  16911. 32: 14
  16912. },
  16913. rn = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  16914. on = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  16915. an = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  16916. cn = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  16917. un = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  16918. ln = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  16919. hn = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  16920. dn = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  16921. pn = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  16922. fn = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  16923. gn = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  16924. mn = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  16925. yn = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  16926. _n = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  16927. wn = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  16928. function vn(e) {
  16929. for (var t = [], n = 0; n < e.length; n += 4) {
  16930. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  16931. }
  16932. return t;
  16933. }
  16934. var In = /*#__PURE__*/function () {
  16935. function In(e) {
  16936. (0, _classCallCheck2.default)(this, In);
  16937. if (!(this instanceof In)) throw Error("AES must be instanitated with `new`");
  16938. Object.defineProperty(this, "key", {
  16939. value: Qt(e, !0)
  16940. }), this._prepare();
  16941. }
  16942. (0, _createClass2.default)(In, [{
  16943. key: "_prepare",
  16944. value: function _prepare() {
  16945. var e = sn[this.key.length];
  16946. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  16947. this._Ke = [], this._Kd = [];
  16948. for (var t = 0; t <= e; t++) {
  16949. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  16950. }
  16951. var n,
  16952. s = 4 * (e + 1),
  16953. r = this.key.length / 4,
  16954. i = vn(this.key);
  16955. for (t = 0; t < r; t++) {
  16956. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  16957. }
  16958. for (var o, a = 0, c = r; c < s;) {
  16959. if (o = i[r - 1], i[0] ^= on[o >> 16 & 255] << 24 ^ on[o >> 8 & 255] << 16 ^ on[255 & o] << 8 ^ on[o >> 24 & 255] ^ rn[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  16960. i[t] ^= i[t - 1];
  16961. } else {
  16962. for (t = 1; t < r / 2; t++) {
  16963. i[t] ^= i[t - 1];
  16964. }
  16965. o = i[r / 2 - 1], i[r / 2] ^= on[255 & o] ^ on[o >> 8 & 255] << 8 ^ on[o >> 16 & 255] << 16 ^ on[o >> 24 & 255] << 24;
  16966. for (t = r / 2 + 1; t < r; t++) {
  16967. i[t] ^= i[t - 1];
  16968. }
  16969. }
  16970. for (t = 0; t < r && c < s;) {
  16971. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  16972. }
  16973. }
  16974. for (var u = 1; u < e; u++) {
  16975. for (var l = 0; l < 4; l++) {
  16976. o = this._Kd[u][l], this._Kd[u][l] = mn[o >> 24 & 255] ^ yn[o >> 16 & 255] ^ _n[o >> 8 & 255] ^ wn[255 & o];
  16977. }
  16978. }
  16979. }
  16980. }, {
  16981. key: "encrypt",
  16982. value: function encrypt(e) {
  16983. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  16984. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = vn(e), r = 0; r < 4; r++) {
  16985. s[r] ^= this._Ke[0][r];
  16986. }
  16987. for (var i = 1; i < t; i++) {
  16988. for (r = 0; r < 4; r++) {
  16989. n[r] = cn[s[r] >> 24 & 255] ^ un[s[(r + 1) % 4] >> 16 & 255] ^ ln[s[(r + 2) % 4] >> 8 & 255] ^ hn[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  16990. }
  16991. s = n.slice();
  16992. }
  16993. var o,
  16994. a = Xt(16);
  16995. for (r = 0; r < 4; r++) {
  16996. o = this._Ke[t][r], a[4 * r] = 255 & (on[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (on[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (on[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (on[255 & s[(r + 3) % 4]] ^ o);
  16997. }
  16998. return a;
  16999. }
  17000. }, {
  17001. key: "decrypt",
  17002. value: function decrypt(e) {
  17003. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  17004. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = vn(e), r = 0; r < 4; r++) {
  17005. s[r] ^= this._Kd[0][r];
  17006. }
  17007. for (var i = 1; i < t; i++) {
  17008. for (r = 0; r < 4; r++) {
  17009. n[r] = dn[s[r] >> 24 & 255] ^ pn[s[(r + 3) % 4] >> 16 & 255] ^ fn[s[(r + 2) % 4] >> 8 & 255] ^ gn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  17010. }
  17011. s = n.slice();
  17012. }
  17013. var o,
  17014. a = Xt(16);
  17015. for (r = 0; r < 4; r++) {
  17016. o = this._Kd[t][r], a[4 * r] = 255 & (an[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (an[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (an[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (an[255 & s[(r + 1) % 4]] ^ o);
  17017. }
  17018. return a;
  17019. }
  17020. }]);
  17021. return In;
  17022. }();
  17023. var Sn = /*#__PURE__*/function () {
  17024. function Sn(e) {
  17025. (0, _classCallCheck2.default)(this, Sn);
  17026. if (!(this instanceof Sn)) throw Error("AES must be instanitated with `new`");
  17027. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new In(e);
  17028. }
  17029. (0, _createClass2.default)(Sn, [{
  17030. key: "encrypt",
  17031. value: function encrypt(e) {
  17032. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  17033. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  17034. Zt(e, n, 0, s, s + 16), Zt(n = this._aes.encrypt(n), t, s);
  17035. }
  17036. return t;
  17037. }
  17038. }, {
  17039. key: "decrypt",
  17040. value: function decrypt(e) {
  17041. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  17042. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  17043. Zt(e, n, 0, s, s + 16), Zt(n = this._aes.decrypt(n), t, s);
  17044. }
  17045. return t;
  17046. }
  17047. }]);
  17048. return Sn;
  17049. }();
  17050. var bn = /*#__PURE__*/function () {
  17051. function bn(e, t) {
  17052. (0, _classCallCheck2.default)(this, bn);
  17053. if (!(this instanceof bn)) throw Error("AES must be instanitated with `new`");
  17054. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  17055. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  17056. } else t = Xt(16);
  17057. this._lastCipherblock = Qt(t, !0), this._aes = new In(e);
  17058. }
  17059. (0, _createClass2.default)(bn, [{
  17060. key: "encrypt",
  17061. value: function encrypt(e) {
  17062. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  17063. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  17064. Zt(e, n, 0, s, s + 16);
  17065. for (var r = 0; r < 16; r++) {
  17066. n[r] ^= this._lastCipherblock[r];
  17067. }
  17068. this._lastCipherblock = this._aes.encrypt(n), Zt(this._lastCipherblock, t, s);
  17069. }
  17070. return t;
  17071. }
  17072. }, {
  17073. key: "decrypt",
  17074. value: function decrypt(e) {
  17075. if ((e = Qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  17076. for (var t = Xt(e.length), n = Xt(16), s = 0; s < e.length; s += 16) {
  17077. Zt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  17078. for (var r = 0; r < 16; r++) {
  17079. t[s + r] = n[r] ^ this._lastCipherblock[r];
  17080. }
  17081. Zt(e, this._lastCipherblock, 0, s, s + 16);
  17082. }
  17083. return t;
  17084. }
  17085. }]);
  17086. return bn;
  17087. }();
  17088. var kn = /*#__PURE__*/function () {
  17089. function kn(e, t, n) {
  17090. (0, _classCallCheck2.default)(this, kn);
  17091. if (!(this instanceof kn)) throw Error("AES must be instanitated with `new`");
  17092. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  17093. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  17094. } else t = Xt(16);
  17095. n || (n = 1), this.segmentSize = n, this._shiftRegister = Qt(t, !0), this._aes = new In(e);
  17096. }
  17097. (0, _createClass2.default)(kn, [{
  17098. key: "encrypt",
  17099. value: function encrypt(e) {
  17100. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  17101. for (var t, n = Qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  17102. t = this._aes.encrypt(this._shiftRegister);
  17103. for (var r = 0; r < this.segmentSize; r++) {
  17104. n[s + r] ^= t[r];
  17105. }
  17106. Zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Zt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  17107. }
  17108. return n;
  17109. }
  17110. }, {
  17111. key: "decrypt",
  17112. value: function decrypt(e) {
  17113. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  17114. for (var t, n = Qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  17115. t = this._aes.encrypt(this._shiftRegister);
  17116. for (var r = 0; r < this.segmentSize; r++) {
  17117. n[s + r] ^= t[r];
  17118. }
  17119. Zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Zt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  17120. }
  17121. return n;
  17122. }
  17123. }]);
  17124. return kn;
  17125. }();
  17126. var An = /*#__PURE__*/function () {
  17127. function An(e, t) {
  17128. (0, _classCallCheck2.default)(this, An);
  17129. if (!(this instanceof An)) throw Error("AES must be instanitated with `new`");
  17130. if (this.description = "Output Feedback", this.name = "ofb", t) {
  17131. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  17132. } else t = Xt(16);
  17133. this._lastPrecipher = Qt(t, !0), this._lastPrecipherIndex = 16, this._aes = new In(e);
  17134. }
  17135. (0, _createClass2.default)(An, [{
  17136. key: "encrypt",
  17137. value: function encrypt(e) {
  17138. for (var t = Qt(e, !0), n = 0; n < t.length; n++) {
  17139. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  17140. }
  17141. return t;
  17142. }
  17143. }, {
  17144. key: "decrypt",
  17145. value: function decrypt(e) {
  17146. return this.encrypt(e);
  17147. }
  17148. }]);
  17149. return An;
  17150. }();
  17151. var Cn = /*#__PURE__*/function () {
  17152. function Cn(e) {
  17153. (0, _classCallCheck2.default)(this, Cn);
  17154. if (!(this instanceof Cn)) throw Error("Counter must be instanitated with `new`");
  17155. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Xt(16), this.setValue(e)) : this.setBytes(e);
  17156. }
  17157. (0, _createClass2.default)(Cn, [{
  17158. key: "setValue",
  17159. value: function setValue(e) {
  17160. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  17161. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  17162. for (var t = 15; t >= 0; --t) {
  17163. this._counter[t] = e % 256, e = parseInt(e / 256);
  17164. }
  17165. }
  17166. }, {
  17167. key: "setBytes",
  17168. value: function setBytes(e) {
  17169. if (16 != (e = Qt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  17170. this._counter = e;
  17171. }
  17172. }, {
  17173. key: "increment",
  17174. value: function increment() {
  17175. for (var e = 15; e >= 0; e--) {
  17176. if (255 !== this._counter[e]) {
  17177. this._counter[e]++;
  17178. break;
  17179. }
  17180. this._counter[e] = 0;
  17181. }
  17182. }
  17183. }]);
  17184. return Cn;
  17185. }();
  17186. var Pn = /*#__PURE__*/function () {
  17187. function Pn(e, t) {
  17188. (0, _classCallCheck2.default)(this, Pn);
  17189. if (!(this instanceof Pn)) throw Error("AES must be instanitated with `new`");
  17190. this.description = "Counter", this.name = "ctr", t instanceof Cn || (t = new Cn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new In(e);
  17191. }
  17192. (0, _createClass2.default)(Pn, [{
  17193. key: "encrypt",
  17194. value: function encrypt(e) {
  17195. for (var t = Qt(e, !0), n = 0; n < t.length; n++) {
  17196. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  17197. }
  17198. return t;
  17199. }
  17200. }, {
  17201. key: "decrypt",
  17202. value: function decrypt(e) {
  17203. return this.encrypt(e);
  17204. }
  17205. }]);
  17206. return Pn;
  17207. }();
  17208. var Tn = {
  17209. AES: In,
  17210. Counter: Cn,
  17211. ModeOfOperation: {
  17212. ecb: Sn,
  17213. cbc: bn,
  17214. cfb: kn,
  17215. ofb: An,
  17216. ctr: Pn
  17217. },
  17218. utils: {
  17219. hex: nn,
  17220. utf8: tn
  17221. },
  17222. padding: {
  17223. pkcs7: {
  17224. pad: function pad(e) {
  17225. var t = 16 - (e = Qt(e, !0)).length % 16,
  17226. n = Xt(e.length + t);
  17227. Zt(e, n);
  17228. for (var s = e.length; s < n.length; s++) {
  17229. n[s] = t;
  17230. }
  17231. return n;
  17232. },
  17233. strip: function strip(e) {
  17234. if ((e = Qt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  17235. var t = e[e.length - 1];
  17236. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  17237. for (var n = e.length - t, s = 0; s < t; s++) {
  17238. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  17239. }
  17240. var r = Xt(n);
  17241. return Zt(e, r, 0, 0, n), r;
  17242. }
  17243. }
  17244. },
  17245. _arrayTest: {
  17246. coerceArray: Qt,
  17247. createArray: Xt,
  17248. copyArray: Zt
  17249. }
  17250. };
  17251. function xn(e, t, n) {
  17252. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  17253. r = Tn.utils.utf8.toBytes(n),
  17254. i = Tn.utils.utf8.toBytes(e),
  17255. o = new Tn.ModeOfOperation.cbc(s, r),
  17256. a = Tn.padding.pkcs7.pad(i),
  17257. c = o.encrypt(a);
  17258. return uni.arrayBufferToBase64(c);
  17259. }
  17260. var On = {
  17261. code: 2e4,
  17262. message: "System error"
  17263. },
  17264. En = {
  17265. code: 20101,
  17266. message: "Invalid client"
  17267. },
  17268. Ln = {
  17269. code: 20102,
  17270. message: "Get encrypt key failed"
  17271. },
  17272. Rn = {
  17273. 10001: "Secure network is not supported on current playground or unimpsdk",
  17274. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  17275. 10009: "Encrypt payload failed",
  17276. 10010: "Decrypt response failed"
  17277. };
  17278. function Un(e) {
  17279. var _ref32 = e || {},
  17280. t = _ref32.errSubject,
  17281. n = _ref32.subject,
  17282. s = _ref32.errCode,
  17283. r = _ref32.errMsg,
  17284. i = _ref32.code,
  17285. o = _ref32.message,
  17286. a = _ref32.cause;
  17287. return new te({
  17288. subject: t || n || "uni-secure-network",
  17289. code: s || i || On.code,
  17290. message: r || o,
  17291. cause: a
  17292. });
  17293. }
  17294. var Nn,
  17295. Dn,
  17296. qn = null;
  17297. var Mn = /*#__PURE__*/function (_Vt) {
  17298. (0, _inherits2.default)(Mn, _Vt);
  17299. var _super8 = _createSuper(Mn);
  17300. function Mn(e) {
  17301. var _this15;
  17302. (0, _classCallCheck2.default)(this, Mn);
  17303. _this15 = _super8.call(this, e), _this15.clientType = "mp-weixin", _this15.userEncryptKey = null;
  17304. return _this15;
  17305. }
  17306. (0, _createClass2.default)(Mn, [{
  17307. key: "isLogin",
  17308. value: function isLogin() {
  17309. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  17310. }
  17311. }, {
  17312. key: "prepare",
  17313. value: function () {
  17314. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  17315. return _regenerator.default.wrap(function _callee43$(_context43) {
  17316. while (1) {
  17317. switch (_context43.prev = _context43.next) {
  17318. case 0:
  17319. if (this.isLogin()) {
  17320. _context43.next = 7;
  17321. break;
  17322. }
  17323. if (this.scopedGlobalCache.initPromise) {
  17324. _context43.next = 3;
  17325. break;
  17326. }
  17327. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  17328. case 3:
  17329. _context43.next = 5;
  17330. return this.scopedGlobalCache.initPromise;
  17331. case 5:
  17332. if (this.isLogin()) {
  17333. _context43.next = 7;
  17334. break;
  17335. }
  17336. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  17337. case 7:
  17338. case "end":
  17339. return _context43.stop();
  17340. }
  17341. }
  17342. }, _callee43, this);
  17343. }));
  17344. function prepare() {
  17345. return _prepare2.apply(this, arguments);
  17346. }
  17347. return prepare;
  17348. }()
  17349. }, {
  17350. key: "getUserEncryptKey",
  17351. value: function () {
  17352. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  17353. var _this16 = this;
  17354. var e;
  17355. return _regenerator.default.wrap(function _callee44$(_context44) {
  17356. while (1) {
  17357. switch (_context44.prev = _context44.next) {
  17358. case 0:
  17359. if (!this.userEncryptKey) {
  17360. _context44.next = 2;
  17361. break;
  17362. }
  17363. return _context44.abrupt("return", this.userEncryptKey);
  17364. case 2:
  17365. if (!(qn && qn.expireTime)) {
  17366. _context44.next = 6;
  17367. break;
  17368. }
  17369. e = Date.now();
  17370. if (!(qn.expireTime - e > 0)) {
  17371. _context44.next = 6;
  17372. break;
  17373. }
  17374. return _context44.abrupt("return", (this.userEncryptKey = qn, this.userEncryptKey));
  17375. case 6:
  17376. return _context44.abrupt("return", new Promise(function (e, t) {
  17377. uni.getUserCryptoManager().getLatestUserKey({
  17378. success: function success(t) {
  17379. qn = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  17380. },
  17381. fail: function fail(e) {
  17382. t(Un(_objectSpread(_objectSpread({}, Ln), {}, {
  17383. cause: e
  17384. })));
  17385. }
  17386. });
  17387. }));
  17388. case 7:
  17389. case "end":
  17390. return _context44.stop();
  17391. }
  17392. }
  17393. }, _callee44, this);
  17394. }));
  17395. function getUserEncryptKey() {
  17396. return _getUserEncryptKey.apply(this, arguments);
  17397. }
  17398. return getUserEncryptKey;
  17399. }()
  17400. }, {
  17401. key: "getWxAppId",
  17402. value: function getWxAppId() {
  17403. return wx.getAccountInfoSync().miniProgram.appId;
  17404. }
  17405. }, {
  17406. key: "platformGetSignOption",
  17407. value: function () {
  17408. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  17409. var _yield$this$getUserEn, e, t, n;
  17410. return _regenerator.default.wrap(function _callee45$(_context45) {
  17411. while (1) {
  17412. switch (_context45.prev = _context45.next) {
  17413. case 0:
  17414. _context45.next = 2;
  17415. return this.getUserEncryptKey();
  17416. case 2:
  17417. _yield$this$getUserEn = _context45.sent;
  17418. e = _yield$this$getUserEn.encryptKey;
  17419. t = _yield$this$getUserEn.iv;
  17420. n = _yield$this$getUserEn.version;
  17421. return _context45.abrupt("return", {
  17422. verifyClientSign: xn(JSON.stringify({
  17423. data: JSON.stringify({}),
  17424. appId: this.appId,
  17425. deviceId: this.deviceId,
  17426. wxAppId: this.getWxAppId(),
  17427. simulator: "devtools" === ae().platform,
  17428. timestamp: Date.now()
  17429. }), e, t),
  17430. encryptKeyId: n,
  17431. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  17432. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  17433. });
  17434. case 7:
  17435. case "end":
  17436. return _context45.stop();
  17437. }
  17438. }
  17439. }, _callee45, this);
  17440. }));
  17441. function platformGetSignOption() {
  17442. return _platformGetSignOption.apply(this, arguments);
  17443. }
  17444. return platformGetSignOption;
  17445. }()
  17446. }, {
  17447. key: "platformEncryptData",
  17448. value: function () {
  17449. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(e) {
  17450. var _yield$this$getUserEn2, t, n, s, r;
  17451. return _regenerator.default.wrap(function _callee46$(_context46) {
  17452. while (1) {
  17453. switch (_context46.prev = _context46.next) {
  17454. case 0:
  17455. _context46.next = 2;
  17456. return this.getUserEncryptKey();
  17457. case 2:
  17458. _yield$this$getUserEn2 = _context46.sent;
  17459. t = _yield$this$getUserEn2.encryptKey;
  17460. n = _yield$this$getUserEn2.iv;
  17461. s = _yield$this$getUserEn2.version;
  17462. r = {
  17463. secretType: this.secretType,
  17464. encryptKeyId: s,
  17465. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  17466. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  17467. };
  17468. return _context46.abrupt("return", this.secretType === Jt ? {
  17469. content: e,
  17470. _uniCloudOptions: r
  17471. } : {
  17472. content: xn(JSON.stringify({
  17473. data: JSON.stringify(e),
  17474. appId: this.appId,
  17475. deviceId: this.deviceId,
  17476. wxAppId: this.getWxAppId(),
  17477. simulator: "devtools" === ae().platform,
  17478. timestamp: Date.now()
  17479. }), t, n),
  17480. _uniCloudOptions: r
  17481. });
  17482. case 8:
  17483. case "end":
  17484. return _context46.stop();
  17485. }
  17486. }
  17487. }, _callee46, this);
  17488. }));
  17489. function platformEncryptData(_x42) {
  17490. return _platformEncryptData.apply(this, arguments);
  17491. }
  17492. return platformEncryptData;
  17493. }()
  17494. }, {
  17495. key: "platformDecryptResult",
  17496. value: function () {
  17497. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(e) {
  17498. var t, _yield$this$getUserEn3, n, s;
  17499. return _regenerator.default.wrap(function _callee47$(_context47) {
  17500. while (1) {
  17501. switch (_context47.prev = _context47.next) {
  17502. case 0:
  17503. t = e.content;
  17504. _context47.next = 3;
  17505. return this.getUserEncryptKey();
  17506. case 3:
  17507. _yield$this$getUserEn3 = _context47.sent;
  17508. n = _yield$this$getUserEn3.encryptKey;
  17509. s = _yield$this$getUserEn3.iv;
  17510. return _context47.abrupt("return", JSON.parse(function (e, t, n) {
  17511. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  17512. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  17513. i = Tn.utils.utf8.toBytes(n),
  17514. o = new Tn.ModeOfOperation.cbc(r, i),
  17515. a = Tn.padding.pkcs7.strip(o.decrypt(s));
  17516. return Tn.utils.utf8.fromBytes(a);
  17517. }(t, n, s)));
  17518. case 7:
  17519. case "end":
  17520. return _context47.stop();
  17521. }
  17522. }
  17523. }, _callee47, this);
  17524. }));
  17525. function platformDecryptResult(_x43) {
  17526. return _platformDecryptResult.apply(this, arguments);
  17527. }
  17528. return platformDecryptResult;
  17529. }()
  17530. }, {
  17531. key: "isClientKeyNotFound",
  17532. value: function isClientKeyNotFound() {
  17533. return !1;
  17534. }
  17535. }]);
  17536. return Mn;
  17537. }(Vt);
  17538. function Fn(e) {
  17539. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  17540. n = {};
  17541. var _loop = function _loop(_s13) {
  17542. var r = t[_s13];
  17543. n[r] = function () {
  17544. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  17545. t[_key] = arguments[_key];
  17546. }
  17547. return new Promise(function (n, s) {
  17548. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  17549. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17550. e = _ref33.type,
  17551. t = _ref33.data,
  17552. r = _ref33.errCode,
  17553. i = _ref33.errMsg,
  17554. o = _ref33.errSubject,
  17555. a = _ref33.message;
  17556. "success" === e ? n(t) : s(Un({
  17557. errCode: r,
  17558. errMsg: Rn[r] || i || a,
  17559. errSubject: o
  17560. }));
  17561. }])) : s(Un({
  17562. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  17563. }));
  17564. });
  17565. };
  17566. };
  17567. for (var _s13 = 0; _s13 < t.length; _s13++) {
  17568. _loop(_s13);
  17569. }
  17570. return n;
  17571. }
  17572. var Kn = /*#__PURE__*/function (_Vt2) {
  17573. (0, _inherits2.default)(Kn, _Vt2);
  17574. var _super9 = _createSuper(Kn);
  17575. function Kn(e) {
  17576. var _this17;
  17577. (0, _classCallCheck2.default)(this, Kn);
  17578. _this17 = _super9.call(this, e), _this17.clientType = "app", _this17.appUtils = _objectSpread({}, Fn(uni.requireNativePlugin("plus"))), _this17.systemInfo = Nn || (Nn = ae());
  17579. return _this17;
  17580. }
  17581. (0, _createClass2.default)(Kn, [{
  17582. key: "hasClientKey",
  17583. value: function () {
  17584. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
  17585. return _regenerator.default.wrap(function _callee48$(_context48) {
  17586. while (1) {
  17587. switch (_context48.prev = _context48.next) {
  17588. case 0:
  17589. _context48.next = 2;
  17590. return this.appUtils.hasClientKey({
  17591. provider: this.provider,
  17592. spaceId: this.spaceId
  17593. });
  17594. case 2:
  17595. this._hasClientKey = _context48.sent;
  17596. return _context48.abrupt("return", this._hasClientKey);
  17597. case 4:
  17598. case "end":
  17599. return _context48.stop();
  17600. }
  17601. }
  17602. }, _callee48, this);
  17603. }));
  17604. function hasClientKey() {
  17605. return _hasClientKey.apply(this, arguments);
  17606. }
  17607. return hasClientKey;
  17608. }()
  17609. }, {
  17610. key: "getAppClientKey",
  17611. value: function () {
  17612. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  17613. var _yield$this$appUtils$, e, t, n, s, r;
  17614. return _regenerator.default.wrap(function _callee49$(_context49) {
  17615. while (1) {
  17616. switch (_context49.prev = _context49.next) {
  17617. case 0:
  17618. _context49.next = 2;
  17619. return this.appUtils.encryptGetClientKeyPayload({
  17620. data: JSON.stringify({})
  17621. });
  17622. case 2:
  17623. _yield$this$appUtils$ = _context49.sent;
  17624. e = _yield$this$appUtils$.data;
  17625. t = _yield$this$appUtils$.key;
  17626. _context49.next = 7;
  17627. return this.uniCloudIns.callFunction({
  17628. name: "DCloud-clientDB",
  17629. data: {
  17630. redirectTo: "encryption",
  17631. action: "getAppClientKey",
  17632. data: e,
  17633. key: t
  17634. }
  17635. });
  17636. case 7:
  17637. _context49.t0 = _context49.sent.result;
  17638. if (_context49.t0) {
  17639. _context49.next = 10;
  17640. break;
  17641. }
  17642. _context49.t0 = {};
  17643. case 10:
  17644. n = _context49.t0;
  17645. if (!(0 !== n.errCode)) {
  17646. _context49.next = 13;
  17647. break;
  17648. }
  17649. throw function (e) {
  17650. return new te({
  17651. subject: e.errSubject || "uni-secure-network",
  17652. code: e.errCode || e.code || On.code,
  17653. message: e.errMsg || e.message
  17654. });
  17655. }(n);
  17656. case 13:
  17657. s = n.clientKey, r = n.key;
  17658. _context49.next = 16;
  17659. return this.appUtils.setClientKey({
  17660. provider: this.provider,
  17661. spaceId: this.spaceId,
  17662. clientKey: s,
  17663. key: r
  17664. });
  17665. case 16:
  17666. case "end":
  17667. return _context49.stop();
  17668. }
  17669. }
  17670. }, _callee49, this);
  17671. }));
  17672. function getAppClientKey() {
  17673. return _getAppClientKey.apply(this, arguments);
  17674. }
  17675. return getAppClientKey;
  17676. }()
  17677. }, {
  17678. key: "ensureClientKey",
  17679. value: function () {
  17680. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  17681. var _this18 = this;
  17682. var _ref34,
  17683. _ref34$forceUpdate,
  17684. e,
  17685. _args50 = arguments;
  17686. return _regenerator.default.wrap(function _callee50$(_context50) {
  17687. while (1) {
  17688. switch (_context50.prev = _context50.next) {
  17689. case 0:
  17690. _ref34 = _args50.length > 0 && _args50[0] !== undefined ? _args50[0] : {}, _ref34$forceUpdate = _ref34.forceUpdate, e = _ref34$forceUpdate === void 0 ? !1 : _ref34$forceUpdate;
  17691. _context50.t1 = !0;
  17692. _context50.next = 4;
  17693. return this.hasClientKey();
  17694. case 4:
  17695. _context50.t2 = _context50.sent;
  17696. _context50.t0 = _context50.t1 !== _context50.t2;
  17697. if (_context50.t0) {
  17698. _context50.next = 8;
  17699. break;
  17700. }
  17701. _context50.t0 = e;
  17702. case 8:
  17703. if (!_context50.t0) {
  17704. _context50.next = 10;
  17705. break;
  17706. }
  17707. return _context50.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === h || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== p || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  17708. _this18.scopedGlobalCache.initStatus = d;
  17709. }).catch(function (e) {
  17710. throw _this18.scopedGlobalCache.initStatus = p, e;
  17711. }), this.scopedGlobalCache.initStatus = h), this.scopedGlobalCache.initPromise));
  17712. case 10:
  17713. case "end":
  17714. return _context50.stop();
  17715. }
  17716. }
  17717. }, _callee50, this);
  17718. }));
  17719. function ensureClientKey() {
  17720. return _ensureClientKey.apply(this, arguments);
  17721. }
  17722. return ensureClientKey;
  17723. }()
  17724. }, {
  17725. key: "prepare",
  17726. value: function () {
  17727. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  17728. var _ref35,
  17729. _ref35$forceUpdate,
  17730. e,
  17731. _args51 = arguments;
  17732. return _regenerator.default.wrap(function _callee51$(_context51) {
  17733. while (1) {
  17734. switch (_context51.prev = _context51.next) {
  17735. case 0:
  17736. _ref35 = _args51.length > 0 && _args51[0] !== undefined ? _args51[0] : {}, _ref35$forceUpdate = _ref35.forceUpdate, e = _ref35$forceUpdate === void 0 ? !1 : _ref35$forceUpdate;
  17737. _context51.next = 3;
  17738. return this.ensureClientKey({
  17739. forceUpdate: e
  17740. });
  17741. case 3:
  17742. case "end":
  17743. return _context51.stop();
  17744. }
  17745. }
  17746. }, _callee51, this);
  17747. }));
  17748. function prepare() {
  17749. return _prepare3.apply(this, arguments);
  17750. }
  17751. return prepare;
  17752. }()
  17753. }, {
  17754. key: "platformGetSignOption",
  17755. value: function () {
  17756. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  17757. var _yield$this$appUtils$2, e, t;
  17758. return _regenerator.default.wrap(function _callee52$(_context52) {
  17759. while (1) {
  17760. switch (_context52.prev = _context52.next) {
  17761. case 0:
  17762. _context52.next = 2;
  17763. return this.appUtils.encrypt({
  17764. provider: this.provider,
  17765. spaceId: this.spaceId,
  17766. data: JSON.stringify({})
  17767. });
  17768. case 2:
  17769. _yield$this$appUtils$2 = _context52.sent;
  17770. e = _yield$this$appUtils$2.data;
  17771. t = _yield$this$appUtils$2.key;
  17772. return _context52.abrupt("return", {
  17773. verifyClientSign: e,
  17774. encryptKeyId: t
  17775. });
  17776. case 6:
  17777. case "end":
  17778. return _context52.stop();
  17779. }
  17780. }
  17781. }, _callee52, this);
  17782. }));
  17783. function platformGetSignOption() {
  17784. return _platformGetSignOption2.apply(this, arguments);
  17785. }
  17786. return platformGetSignOption;
  17787. }()
  17788. }, {
  17789. key: "platformEncryptData",
  17790. value: function () {
  17791. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(e) {
  17792. var _yield$this$appUtils$3, t, n, s;
  17793. return _regenerator.default.wrap(function _callee53$(_context53) {
  17794. while (1) {
  17795. switch (_context53.prev = _context53.next) {
  17796. case 0:
  17797. _context53.next = 2;
  17798. return this.appUtils.encrypt({
  17799. provider: this.provider,
  17800. spaceId: this.spaceId,
  17801. data: JSON.stringify(e)
  17802. });
  17803. case 2:
  17804. _yield$this$appUtils$3 = _context53.sent;
  17805. t = _yield$this$appUtils$3.data;
  17806. n = _yield$this$appUtils$3.key;
  17807. s = {
  17808. secretType: this.secretType,
  17809. encryptKeyId: n
  17810. };
  17811. return _context53.abrupt("return", this.secretType === Jt ? {
  17812. content: e,
  17813. _uniCloudOptions: s
  17814. } : {
  17815. content: t,
  17816. _uniCloudOptions: s
  17817. });
  17818. case 7:
  17819. case "end":
  17820. return _context53.stop();
  17821. }
  17822. }
  17823. }, _callee53, this);
  17824. }));
  17825. function platformEncryptData(_x44) {
  17826. return _platformEncryptData2.apply(this, arguments);
  17827. }
  17828. return platformEncryptData;
  17829. }()
  17830. }, {
  17831. key: "platformDecryptResult",
  17832. value: function () {
  17833. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(e) {
  17834. var t, _e$_uniCloudOptions, n, s, r;
  17835. return _regenerator.default.wrap(function _callee54$(_context54) {
  17836. while (1) {
  17837. switch (_context54.prev = _context54.next) {
  17838. case 0:
  17839. t = e.content;
  17840. _e$_uniCloudOptions = e._uniCloudOptions;
  17841. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  17842. s = n.encryptKeyId;
  17843. _context54.next = 6;
  17844. return this.appUtils.decrypt({
  17845. provider: this.provider,
  17846. spaceId: this.spaceId,
  17847. data: t,
  17848. key: s
  17849. });
  17850. case 6:
  17851. r = _context54.sent;
  17852. return _context54.abrupt("return", JSON.parse(r.data));
  17853. case 8:
  17854. case "end":
  17855. return _context54.stop();
  17856. }
  17857. }
  17858. }, _callee54, this);
  17859. }));
  17860. function platformDecryptResult(_x45) {
  17861. return _platformDecryptResult2.apply(this, arguments);
  17862. }
  17863. return platformDecryptResult;
  17864. }()
  17865. }, {
  17866. key: "isClientKeyNotFound",
  17867. value: function isClientKeyNotFound() {
  17868. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17869. var t = e.result || {};
  17870. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  17871. }
  17872. }]);
  17873. return Kn;
  17874. }(Vt);
  17875. function jn() {
  17876. var _ref36 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17877. e = _ref36.secretType;
  17878. return e === Ht || e === Jt || e === zt;
  17879. }
  17880. function $n() {
  17881. var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17882. e = _ref37.name,
  17883. _ref37$data = _ref37.data,
  17884. t = _ref37$data === void 0 ? {} : _ref37$data;
  17885. return "app" === C && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  17886. }
  17887. function Bn() {
  17888. var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17889. e = _ref38.provider,
  17890. t = _ref38.spaceId,
  17891. n = _ref38.functionName;
  17892. var _ae = ae(),
  17893. s = _ae.appId,
  17894. r = _ae.uniPlatform,
  17895. i = _ae.osName;
  17896. var o = r;
  17897. "app" === r && (o = i);
  17898. var a = function () {
  17899. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17900. e = _ref39.provider,
  17901. t = _ref39.spaceId;
  17902. var n = A;
  17903. if (!n) return {};
  17904. e = function (e) {
  17905. return "tencent" === e ? "tcb" : e;
  17906. }(e);
  17907. var s = n.find(function (n) {
  17908. return n.provider === e && n.spaceId === t;
  17909. });
  17910. return s && s.config;
  17911. }({
  17912. provider: e,
  17913. spaceId: t
  17914. });
  17915. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  17916. var c = a.accessControl.function || {},
  17917. u = Object.keys(c);
  17918. if (0 === u.length) return !0;
  17919. var l = function (e, t) {
  17920. var n, s, r;
  17921. for (var _i2 = 0; _i2 < e.length; _i2++) {
  17922. var _o2 = e[_i2];
  17923. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  17924. return e.trim();
  17925. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  17926. }
  17927. return n || s || r;
  17928. }(u, n);
  17929. if (!l) return !1;
  17930. if ((c[l] || []).find(function () {
  17931. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17932. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  17933. })) return !0;
  17934. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), Un(En);
  17935. }
  17936. function Wn(_ref40) {
  17937. var e = _ref40.functionName,
  17938. t = _ref40.result,
  17939. n = _ref40.logPvd;
  17940. if (S && this.__dev__.debugLog && t && t.requestId) {
  17941. var _s14 = JSON.stringify({
  17942. spaceId: this.config.spaceId,
  17943. functionName: e,
  17944. requestId: t.requestId
  17945. });
  17946. console.log("[".concat(n, "-request]").concat(_s14, "[/").concat(n, "-request]"));
  17947. }
  17948. }
  17949. function Hn(e) {
  17950. var t = e.callFunction,
  17951. n = function n(_n9) {
  17952. var _this19 = this;
  17953. var s = _n9.name;
  17954. _n9.data = Mt.call(e, {
  17955. data: _n9.data
  17956. });
  17957. var r = {
  17958. aliyun: "aliyun",
  17959. tencent: "tcb",
  17960. tcb: "tcb",
  17961. alipay: "alipay",
  17962. dcloud: "dcloud"
  17963. }[this.config.provider],
  17964. i = jn(_n9),
  17965. o = $n(_n9),
  17966. a = i || o;
  17967. return t.call(this, _n9).then(function (e) {
  17968. return e.errCode = 0, !a && Wn.call(_this19, {
  17969. functionName: s,
  17970. result: e,
  17971. logPvd: r
  17972. }), Promise.resolve(e);
  17973. }, function (e) {
  17974. return !a && Wn.call(_this19, {
  17975. functionName: s,
  17976. result: e,
  17977. logPvd: r
  17978. }), e && e.message && (e.message = function () {
  17979. var _ref41 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17980. _ref41$message = _ref41.message,
  17981. e = _ref41$message === void 0 ? "" : _ref41$message,
  17982. _ref41$extraInfo = _ref41.extraInfo,
  17983. t = _ref41$extraInfo === void 0 ? {} : _ref41$extraInfo,
  17984. _ref41$formatter = _ref41.formatter,
  17985. n = _ref41$formatter === void 0 ? [] : _ref41$formatter;
  17986. for (var _s15 = 0; _s15 < n.length; _s15++) {
  17987. var _n$_s = n[_s15],
  17988. _r6 = _n$_s.rule,
  17989. _i3 = _n$_s.content,
  17990. _o3 = _n$_s.mode,
  17991. _a = e.match(_r6);
  17992. if (!_a) continue;
  17993. var _c = _i3;
  17994. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  17995. _c = Bt(_c, "{$".concat(_e19, "}"), _a[_e19]);
  17996. }
  17997. for (var _e20 in t) {
  17998. _c = Bt(_c, "{".concat(_e20, "}"), t[_e20]);
  17999. }
  18000. return "replace" === _o3 ? _c : e + _c;
  18001. }
  18002. return e;
  18003. }({
  18004. message: "[".concat(_n9.name, "]: ").concat(e.message),
  18005. formatter: Kt,
  18006. extraInfo: {
  18007. functionName: s
  18008. }
  18009. })), Promise.reject(e);
  18010. });
  18011. };
  18012. e.callFunction = function (t) {
  18013. var _e$config = e.config,
  18014. s = _e$config.provider,
  18015. r = _e$config.spaceId,
  18016. i = t.name;
  18017. var o, a;
  18018. if (t.data = t.data || {}, S && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && T ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ft), o = Ft) : o = n, o = o.bind(e), $n(t)) a = n.call(e, t);else if (function (_ref42) {
  18019. var e = _ref42.name,
  18020. _ref42$data = _ref42.data,
  18021. t = _ref42$data === void 0 ? {} : _ref42$data;
  18022. return "mp-weixin" === C && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  18023. }(t)) a = o.call(e, t);else if (jn(t)) {
  18024. a = new Dn({
  18025. secretType: t.secretType,
  18026. uniCloudIns: e
  18027. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  18028. } else if (Bn({
  18029. provider: s,
  18030. spaceId: r,
  18031. functionName: i
  18032. })) {
  18033. a = new Dn({
  18034. secretType: t.secretType,
  18035. uniCloudIns: e
  18036. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  18037. } else a = o(t);
  18038. return Object.defineProperty(a, "result", {
  18039. get: function get() {
  18040. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  18041. }
  18042. }), a.then(function (e) {
  18043. return "undefined" != typeof UTSJSONObject && (e.result = new UTSJSONObject(e.result)), e;
  18044. });
  18045. };
  18046. }
  18047. Dn = "mp-weixin" !== C && "app" !== C ? /*#__PURE__*/function () {
  18048. function _class2() {
  18049. (0, _classCallCheck2.default)(this, _class2);
  18050. throw Un({
  18051. message: "Platform ".concat(C, " is not supported by secure network")
  18052. });
  18053. }
  18054. return (0, _createClass2.default)(_class2);
  18055. }() : k ? "mp-weixin" === C ? Mn : Kn : /*#__PURE__*/function () {
  18056. function _class3() {
  18057. (0, _classCallCheck2.default)(this, _class3);
  18058. throw Un({
  18059. message: "Platform ".concat(C, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  18060. });
  18061. }
  18062. return (0, _createClass2.default)(_class3);
  18063. }();
  18064. var Jn = Symbol("CLIENT_DB_INTERNAL");
  18065. function zn(e, t) {
  18066. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Jn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  18067. get: function get(e, n, s) {
  18068. if ("_uniClient" === n) return null;
  18069. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  18070. if (n in e || "string" != typeof n) {
  18071. var _t12 = e[n];
  18072. return "function" == typeof _t12 ? _t12.bind(e) : _t12;
  18073. }
  18074. return t.get(e, n, s);
  18075. }
  18076. });
  18077. }
  18078. function Vn(e) {
  18079. return {
  18080. on: function on(t, n) {
  18081. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  18082. },
  18083. off: function off(t, n) {
  18084. e[t] = e[t] || [];
  18085. var s = e[t].indexOf(n);
  18086. -1 !== s && e[t].splice(s, 1);
  18087. }
  18088. };
  18089. }
  18090. var Gn = ["db.Geo", "db.command", "command.aggregate"];
  18091. function Yn(e, t) {
  18092. return Gn.indexOf("".concat(e, ".").concat(t)) > -1;
  18093. }
  18094. function Qn(e) {
  18095. switch (f(e)) {
  18096. case "array":
  18097. return e.map(function (e) {
  18098. return Qn(e);
  18099. });
  18100. case "object":
  18101. return e._internalType === Jn || Object.keys(e).forEach(function (t) {
  18102. e[t] = Qn(e[t]);
  18103. }), e;
  18104. case "regexp":
  18105. return {
  18106. $regexp: {
  18107. source: e.source,
  18108. flags: e.flags
  18109. }
  18110. };
  18111. case "date":
  18112. return {
  18113. $date: e.toISOString()
  18114. };
  18115. default:
  18116. return e;
  18117. }
  18118. }
  18119. function Xn(e) {
  18120. return e && e.content && e.content.$method;
  18121. }
  18122. var Zn = /*#__PURE__*/function () {
  18123. function Zn(e, t, n) {
  18124. (0, _classCallCheck2.default)(this, Zn);
  18125. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  18126. }
  18127. (0, _createClass2.default)(Zn, [{
  18128. key: "toJSON",
  18129. value: function toJSON() {
  18130. var e = this;
  18131. var t = [e.content];
  18132. for (; e.prevStage;) {
  18133. e = e.prevStage, t.push(e.content);
  18134. }
  18135. return {
  18136. $db: t.reverse().map(function (e) {
  18137. return {
  18138. $method: e.$method,
  18139. $param: Qn(e.$param)
  18140. };
  18141. })
  18142. };
  18143. }
  18144. }, {
  18145. key: "toString",
  18146. value: function toString() {
  18147. return JSON.stringify(this.toJSON());
  18148. }
  18149. }, {
  18150. key: "getAction",
  18151. value: function getAction() {
  18152. var e = this.toJSON().$db.find(function (e) {
  18153. return "action" === e.$method;
  18154. });
  18155. return e && e.$param && e.$param[0];
  18156. }
  18157. }, {
  18158. key: "getCommand",
  18159. value: function getCommand() {
  18160. return {
  18161. $db: this.toJSON().$db.filter(function (e) {
  18162. return "action" !== e.$method;
  18163. })
  18164. };
  18165. }
  18166. }, {
  18167. key: "isAggregate",
  18168. get: function get() {
  18169. var e = this;
  18170. for (; e;) {
  18171. var t = Xn(e),
  18172. _n10 = Xn(e.prevStage);
  18173. if ("aggregate" === t && "collection" === _n10 || "pipeline" === t) return !0;
  18174. e = e.prevStage;
  18175. }
  18176. return !1;
  18177. }
  18178. }, {
  18179. key: "isCommand",
  18180. get: function get() {
  18181. var e = this;
  18182. for (; e;) {
  18183. if ("command" === Xn(e)) return !0;
  18184. e = e.prevStage;
  18185. }
  18186. return !1;
  18187. }
  18188. }, {
  18189. key: "isAggregateCommand",
  18190. get: function get() {
  18191. var e = this;
  18192. for (; e;) {
  18193. var t = Xn(e),
  18194. _n11 = Xn(e.prevStage);
  18195. if ("aggregate" === t && "command" === _n11) return !0;
  18196. e = e.prevStage;
  18197. }
  18198. return !1;
  18199. }
  18200. }, {
  18201. key: "getNextStageFn",
  18202. value: function getNextStageFn(e) {
  18203. var t = this;
  18204. return function () {
  18205. return es({
  18206. $method: e,
  18207. $param: Qn(Array.from(arguments))
  18208. }, t, t._database);
  18209. };
  18210. }
  18211. }, {
  18212. key: "count",
  18213. get: function get() {
  18214. return this.isAggregate ? this.getNextStageFn("count") : function () {
  18215. return this._send("count", Array.from(arguments));
  18216. };
  18217. }
  18218. }, {
  18219. key: "remove",
  18220. get: function get() {
  18221. return this.isCommand ? this.getNextStageFn("remove") : function () {
  18222. return this._send("remove", Array.from(arguments));
  18223. };
  18224. }
  18225. }, {
  18226. key: "get",
  18227. value: function get() {
  18228. return this._send("get", Array.from(arguments));
  18229. }
  18230. }, {
  18231. key: "add",
  18232. get: function get() {
  18233. return this.isCommand ? this.getNextStageFn("add") : function () {
  18234. return this._send("add", Array.from(arguments));
  18235. };
  18236. }
  18237. }, {
  18238. key: "update",
  18239. value: function update() {
  18240. return this._send("update", Array.from(arguments));
  18241. }
  18242. }, {
  18243. key: "end",
  18244. value: function end() {
  18245. return this._send("end", Array.from(arguments));
  18246. }
  18247. }, {
  18248. key: "set",
  18249. get: function get() {
  18250. return this.isCommand ? this.getNextStageFn("set") : function () {
  18251. throw new Error("JQL禁止使用set方法");
  18252. };
  18253. }
  18254. }, {
  18255. key: "_send",
  18256. value: function _send(e, t) {
  18257. var n = this.getAction(),
  18258. s = this.getCommand();
  18259. if (s.$db.push({
  18260. $method: e,
  18261. $param: Qn(t)
  18262. }), S) {
  18263. var _e21 = s.$db.find(function (e) {
  18264. return "collection" === e.$method;
  18265. }),
  18266. _t13 = _e21 && _e21.$param;
  18267. _t13 && 1 === _t13.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  18268. }
  18269. return this._database._callCloudFunction({
  18270. action: n,
  18271. command: s
  18272. });
  18273. }
  18274. }]);
  18275. return Zn;
  18276. }();
  18277. function es(e, t, n) {
  18278. return zn(new Zn(e, t, n), {
  18279. get: function get(e, t) {
  18280. var s = "db";
  18281. return e && e.content && (s = e.content.$method), Yn(s, t) ? es({
  18282. $method: t
  18283. }, e, n) : function () {
  18284. return es({
  18285. $method: t,
  18286. $param: Qn(Array.from(arguments))
  18287. }, e, n);
  18288. };
  18289. }
  18290. });
  18291. }
  18292. function ts(_ref43) {
  18293. var e = _ref43.path,
  18294. t = _ref43.method;
  18295. return /*#__PURE__*/function () {
  18296. function _class4() {
  18297. (0, _classCallCheck2.default)(this, _class4);
  18298. this.param = Array.from(arguments);
  18299. }
  18300. (0, _createClass2.default)(_class4, [{
  18301. key: "toJSON",
  18302. value: function toJSON() {
  18303. return {
  18304. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  18305. return {
  18306. $method: e
  18307. };
  18308. })), [{
  18309. $method: t,
  18310. $param: this.param
  18311. }])
  18312. };
  18313. }
  18314. }, {
  18315. key: "toString",
  18316. value: function toString() {
  18317. return JSON.stringify(this.toJSON());
  18318. }
  18319. }]);
  18320. return _class4;
  18321. }();
  18322. }
  18323. function ns(e) {
  18324. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18325. return zn(new e(t), {
  18326. get: function get(e, t) {
  18327. return Yn("db", t) ? es({
  18328. $method: t
  18329. }, null, e) : function () {
  18330. return es({
  18331. $method: t,
  18332. $param: Qn(Array.from(arguments))
  18333. }, null, e);
  18334. };
  18335. }
  18336. });
  18337. }
  18338. var ss = /*#__PURE__*/function (_ref44) {
  18339. (0, _inherits2.default)(ss, _ref44);
  18340. var _super10 = _createSuper(ss);
  18341. function ss() {
  18342. (0, _classCallCheck2.default)(this, ss);
  18343. return _super10.apply(this, arguments);
  18344. }
  18345. (0, _createClass2.default)(ss, [{
  18346. key: "_parseResult",
  18347. value: function _parseResult(e) {
  18348. return this._isJQL ? e.result : e;
  18349. }
  18350. }, {
  18351. key: "_callCloudFunction",
  18352. value: function _callCloudFunction(_ref45) {
  18353. var _this20 = this;
  18354. var e = _ref45.action,
  18355. t = _ref45.command,
  18356. n = _ref45.multiCommand,
  18357. s = _ref45.queryList;
  18358. function r(e, t) {
  18359. if (n && s) for (var _n12 = 0; _n12 < s.length; _n12++) {
  18360. var _r7 = s[_n12];
  18361. _r7.udb && "function" == typeof _r7.udb.setResult && (t ? _r7.udb.setResult(t) : _r7.udb.setResult(e.result.dataList[_n12]));
  18362. }
  18363. }
  18364. var i = this,
  18365. o = this._isJQL ? "databaseForJQL" : "database";
  18366. function a(e) {
  18367. return i._callback("error", [e]), q(M(o, "fail"), e).then(function () {
  18368. return q(M(o, "complete"), e);
  18369. }).then(function () {
  18370. return r(null, e), Y(j, {
  18371. type: W,
  18372. content: e
  18373. }), Promise.reject(e);
  18374. });
  18375. }
  18376. var c = q(M(o, "invoke")),
  18377. u = this._uniClient;
  18378. return c.then(function () {
  18379. return u.callFunction({
  18380. name: "DCloud-clientDB",
  18381. type: l,
  18382. data: {
  18383. action: e,
  18384. command: t,
  18385. multiCommand: n
  18386. }
  18387. });
  18388. }).then(function (e) {
  18389. var _e$result = e.result,
  18390. t = _e$result.code,
  18391. n = _e$result.message,
  18392. s = _e$result.token,
  18393. c = _e$result.tokenExpired,
  18394. _e$result$systemInfo = _e$result.systemInfo,
  18395. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  18396. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  18397. var _u$_e = u[_e22],
  18398. _t14 = _u$_e.level,
  18399. _n13 = _u$_e.message,
  18400. _s16 = _u$_e.detail,
  18401. _r8 = console["app" === C && "warn" === _t14 ? "error" : _t14] || console.log;
  18402. var _i4 = "[System Info]" + _n13;
  18403. _s16 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s16)), _r8(_i4);
  18404. }
  18405. if (t) {
  18406. return a(new te({
  18407. code: t,
  18408. message: n,
  18409. requestId: e.requestId
  18410. }));
  18411. }
  18412. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (re({
  18413. token: s,
  18414. tokenExpired: c
  18415. }), _this20._callbackAuth("refreshToken", [{
  18416. token: s,
  18417. tokenExpired: c
  18418. }]), _this20._callback("refreshToken", [{
  18419. token: s,
  18420. tokenExpired: c
  18421. }]), Y(B, {
  18422. token: s,
  18423. tokenExpired: c
  18424. }));
  18425. var l = [{
  18426. prop: "affectedDocs",
  18427. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  18428. }, {
  18429. prop: "code",
  18430. tips: "code不再推荐使用,请使用errCode替代"
  18431. }, {
  18432. prop: "message",
  18433. tips: "message不再推荐使用,请使用errMsg替代"
  18434. }];
  18435. var _loop2 = function _loop2(_t15) {
  18436. var _l$_t = l[_t15],
  18437. n = _l$_t.prop,
  18438. s = _l$_t.tips;
  18439. if (n in e.result) {
  18440. var _t16 = e.result[n];
  18441. Object.defineProperty(e.result, n, {
  18442. get: function get() {
  18443. return console.warn(s), _t16;
  18444. }
  18445. });
  18446. }
  18447. };
  18448. for (var _t15 = 0; _t15 < l.length; _t15++) {
  18449. _loop2(_t15);
  18450. }
  18451. return function (e) {
  18452. return q(M(o, "success"), e).then(function () {
  18453. return q(M(o, "complete"), e);
  18454. }).then(function () {
  18455. r(e, null);
  18456. var t = i._parseResult(e);
  18457. return Y(j, {
  18458. type: W,
  18459. content: t
  18460. }), Promise.resolve(t);
  18461. });
  18462. }(e);
  18463. }, function (e) {
  18464. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  18465. return a(new te({
  18466. code: e.code || "SYSTEM_ERROR",
  18467. message: e.message,
  18468. requestId: e.requestId
  18469. }));
  18470. });
  18471. }
  18472. }]);
  18473. return ss;
  18474. }( /*#__PURE__*/function () {
  18475. function _class5() {
  18476. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18477. _ref46$uniClient = _ref46.uniClient,
  18478. e = _ref46$uniClient === void 0 ? {} : _ref46$uniClient,
  18479. _ref46$isJQL = _ref46.isJQL,
  18480. t = _ref46$isJQL === void 0 ? !1 : _ref46$isJQL;
  18481. (0, _classCallCheck2.default)(this, _class5);
  18482. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = Vn(this._authCallBacks)), this._isJQL = t, Object.assign(this, Vn(this._dbCallBacks)), this.env = zn({}, {
  18483. get: function get(e, t) {
  18484. return {
  18485. $env: t
  18486. };
  18487. }
  18488. }), this.Geo = zn({}, {
  18489. get: function get(e, t) {
  18490. return ts({
  18491. path: ["Geo"],
  18492. method: t
  18493. });
  18494. }
  18495. }), this.serverDate = ts({
  18496. path: [],
  18497. method: "serverDate"
  18498. }), this.RegExp = ts({
  18499. path: [],
  18500. method: "RegExp"
  18501. });
  18502. }
  18503. (0, _createClass2.default)(_class5, [{
  18504. key: "getCloudEnv",
  18505. value: function getCloudEnv(e) {
  18506. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  18507. return {
  18508. $env: e.replace("$cloudEnv_", "")
  18509. };
  18510. }
  18511. }, {
  18512. key: "_callback",
  18513. value: function _callback(e, t) {
  18514. var n = this._dbCallBacks;
  18515. n[e] && n[e].forEach(function (e) {
  18516. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  18517. });
  18518. }
  18519. }, {
  18520. key: "_callbackAuth",
  18521. value: function _callbackAuth(e, t) {
  18522. var n = this._authCallBacks;
  18523. n[e] && n[e].forEach(function (e) {
  18524. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  18525. });
  18526. }
  18527. }, {
  18528. key: "multiSend",
  18529. value: function multiSend() {
  18530. var e = Array.from(arguments),
  18531. t = e.map(function (e) {
  18532. var t = e.getAction(),
  18533. n = e.getCommand();
  18534. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  18535. return {
  18536. action: t,
  18537. command: n
  18538. };
  18539. });
  18540. return this._callCloudFunction({
  18541. multiCommand: t,
  18542. queryList: e
  18543. });
  18544. }
  18545. }]);
  18546. return _class5;
  18547. }());
  18548. var rs = "token无效,跳转登录页面",
  18549. is = "token过期,跳转登录页面",
  18550. os = {
  18551. TOKEN_INVALID_TOKEN_EXPIRED: is,
  18552. TOKEN_INVALID_INVALID_CLIENTID: rs,
  18553. TOKEN_INVALID: rs,
  18554. TOKEN_INVALID_WRONG_TOKEN: rs,
  18555. TOKEN_INVALID_ANONYMOUS_USER: rs
  18556. },
  18557. as = {
  18558. "uni-id-token-expired": is,
  18559. "uni-id-check-token-failed": rs,
  18560. "uni-id-token-not-exist": rs,
  18561. "uni-id-check-device-feature-failed": rs
  18562. };
  18563. function cs(e, t) {
  18564. var n = "";
  18565. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  18566. }
  18567. function us() {
  18568. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  18569. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  18570. var n = [],
  18571. s = [];
  18572. return e.forEach(function (e) {
  18573. !0 === e.needLogin ? n.push(cs(t, e.path)) : !1 === e.needLogin && s.push(cs(t, e.path));
  18574. }), {
  18575. needLoginPage: n,
  18576. notNeedLoginPage: s
  18577. };
  18578. }
  18579. function ls(e) {
  18580. return e.split("?")[0].replace(/^\//, "");
  18581. }
  18582. function hs() {
  18583. return function (e) {
  18584. var t = e && e.$page && e.$page.fullPath || "";
  18585. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  18586. }(function () {
  18587. var e = getCurrentPages();
  18588. return e[e.length - 1];
  18589. }());
  18590. }
  18591. function ds() {
  18592. return ls(hs());
  18593. }
  18594. function ps() {
  18595. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  18596. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18597. if (!e) return !1;
  18598. if (!(t && t.list && t.list.length)) return !1;
  18599. var n = t.list,
  18600. s = ls(e);
  18601. return n.some(function (e) {
  18602. return e.pagePath === s;
  18603. });
  18604. }
  18605. var fs = !!_pages.default.uniIdRouter;
  18606. var _ref47 = function () {
  18607. var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  18608. _ref28$pages = _ref28.pages,
  18609. t = _ref28$pages === void 0 ? [] : _ref28$pages,
  18610. _ref28$subPackages = _ref28.subPackages,
  18611. n = _ref28$subPackages === void 0 ? [] : _ref28$subPackages,
  18612. _ref28$uniIdRouter = _ref28.uniIdRouter,
  18613. s = _ref28$uniIdRouter === void 0 ? {} : _ref28$uniIdRouter,
  18614. _ref28$tabBar = _ref28.tabBar,
  18615. r = _ref28$tabBar === void 0 ? {} : _ref28$tabBar;
  18616. var i = s.loginPage,
  18617. _s$needLogin = s.needLogin,
  18618. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  18619. _s$resToLogin = s.resToLogin,
  18620. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  18621. _us = us(t),
  18622. c = _us.needLoginPage,
  18623. u = _us.notNeedLoginPage,
  18624. _ref30 = function () {
  18625. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  18626. var t = [],
  18627. n = [];
  18628. return e.forEach(function (e) {
  18629. var s = e.root,
  18630. _e$pages = e.pages,
  18631. r = _e$pages === void 0 ? [] : _e$pages,
  18632. _us2 = us(r, s),
  18633. i = _us2.needLoginPage,
  18634. o = _us2.notNeedLoginPage;
  18635. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  18636. }), {
  18637. needLoginPage: t,
  18638. notNeedLoginPage: n
  18639. };
  18640. }(n),
  18641. l = _ref30.needLoginPage,
  18642. h = _ref30.notNeedLoginPage;
  18643. return {
  18644. loginPage: i,
  18645. routerNeedLogin: o,
  18646. resToLogin: a,
  18647. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  18648. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  18649. loginPageInTabBar: ps(i, r)
  18650. };
  18651. }(),
  18652. gs = _ref47.loginPage,
  18653. ms = _ref47.routerNeedLogin,
  18654. ys = _ref47.resToLogin,
  18655. _s = _ref47.needLoginPage,
  18656. ws = _ref47.notNeedLoginPage,
  18657. vs = _ref47.loginPageInTabBar;
  18658. if (_s.indexOf(gs) > -1) throw new Error("Login page [".concat(gs, "] should not be \"needLogin\", please check your pages.json"));
  18659. function Is(e) {
  18660. var t = ds();
  18661. if ("/" === e.charAt(0)) return e;
  18662. var _e$split = e.split("?"),
  18663. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  18664. n = _e$split2[0],
  18665. s = _e$split2[1],
  18666. r = n.replace(/^\//, "").split("/"),
  18667. i = t.split("/");
  18668. i.pop();
  18669. for (var _e23 = 0; _e23 < r.length; _e23++) {
  18670. var _t17 = r[_e23];
  18671. ".." === _t17 ? i.pop() : "." !== _t17 && i.push(_t17);
  18672. }
  18673. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  18674. }
  18675. function Ss(e) {
  18676. var t = ls(Is(e));
  18677. return !(ws.indexOf(t) > -1) && (_s.indexOf(t) > -1 || ms.some(function (t) {
  18678. return function (e, t) {
  18679. return new RegExp(t).test(e);
  18680. }(e, t);
  18681. }));
  18682. }
  18683. function bs(_ref48) {
  18684. var e = _ref48.redirect;
  18685. var t = ls(e),
  18686. n = ls(gs);
  18687. return ds() !== n && t !== n;
  18688. }
  18689. function ks() {
  18690. var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18691. e = _ref49.api,
  18692. t = _ref49.redirect;
  18693. if (!t || !bs({
  18694. redirect: t
  18695. })) return;
  18696. var n = function (e, t) {
  18697. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  18698. }(gs, t);
  18699. vs ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  18700. var s = {
  18701. navigateTo: uni.navigateTo,
  18702. redirectTo: uni.redirectTo,
  18703. switchTab: uni.switchTab,
  18704. reLaunch: uni.reLaunch
  18705. };
  18706. setTimeout(function () {
  18707. s[e]({
  18708. url: n
  18709. });
  18710. }, 0);
  18711. }
  18712. function As() {
  18713. var _ref50 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18714. e = _ref50.url;
  18715. var t = {
  18716. abortLoginPageJump: !1,
  18717. autoToLoginPage: !1
  18718. },
  18719. n = function () {
  18720. var _se4 = se(),
  18721. e = _se4.token,
  18722. t = _se4.tokenExpired;
  18723. var n;
  18724. if (e) {
  18725. if (t < Date.now()) {
  18726. var _e24 = "uni-id-token-expired";
  18727. n = {
  18728. errCode: _e24,
  18729. errMsg: as[_e24]
  18730. };
  18731. }
  18732. } else {
  18733. var _e25 = "uni-id-check-token-failed";
  18734. n = {
  18735. errCode: _e25,
  18736. errMsg: as[_e25]
  18737. };
  18738. }
  18739. return n;
  18740. }();
  18741. if (Ss(e) && n) {
  18742. n.uniIdRedirectUrl = e;
  18743. if (z($).length > 0) return setTimeout(function () {
  18744. Y($, n);
  18745. }, 0), t.abortLoginPageJump = !0, t;
  18746. t.autoToLoginPage = !0;
  18747. }
  18748. return t;
  18749. }
  18750. function Cs() {
  18751. !function () {
  18752. var e = hs(),
  18753. _As = As({
  18754. url: e
  18755. }),
  18756. t = _As.abortLoginPageJump,
  18757. n = _As.autoToLoginPage;
  18758. t || n && ks({
  18759. api: "redirectTo",
  18760. redirect: e
  18761. });
  18762. }();
  18763. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  18764. var _loop3 = function _loop3(_t18) {
  18765. var n = e[_t18];
  18766. uni.addInterceptor(n, {
  18767. invoke: function invoke(e) {
  18768. var _As2 = As({
  18769. url: e.url
  18770. }),
  18771. t = _As2.abortLoginPageJump,
  18772. s = _As2.autoToLoginPage;
  18773. return t ? e : s ? (ks({
  18774. api: n,
  18775. redirect: Is(e.url)
  18776. }), !1) : e;
  18777. }
  18778. });
  18779. };
  18780. for (var _t18 = 0; _t18 < e.length; _t18++) {
  18781. _loop3(_t18);
  18782. }
  18783. }
  18784. function Ps() {
  18785. this.onResponse(function (e) {
  18786. var t = e.type,
  18787. n = e.content;
  18788. var s = !1;
  18789. switch (t) {
  18790. case "cloudobject":
  18791. s = function (e) {
  18792. if ("object" != (0, _typeof2.default)(e)) return !1;
  18793. var _ref51 = e || {},
  18794. t = _ref51.errCode;
  18795. return t in as;
  18796. }(n);
  18797. break;
  18798. case "clientdb":
  18799. s = function (e) {
  18800. if ("object" != (0, _typeof2.default)(e)) return !1;
  18801. var _ref52 = e || {},
  18802. t = _ref52.errCode;
  18803. return t in os;
  18804. }(n);
  18805. }
  18806. s && function () {
  18807. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18808. var t = z($);
  18809. Z().then(function () {
  18810. var n = hs();
  18811. if (n && bs({
  18812. redirect: n
  18813. })) return t.length > 0 ? Y($, Object.assign({
  18814. uniIdRedirectUrl: n
  18815. }, e)) : void (gs && ks({
  18816. api: "navigateTo",
  18817. redirect: n
  18818. }));
  18819. });
  18820. }(n);
  18821. });
  18822. }
  18823. function Ts(e) {
  18824. !function (e) {
  18825. e.onResponse = function (e) {
  18826. V(j, e);
  18827. }, e.offResponse = function (e) {
  18828. G(j, e);
  18829. };
  18830. }(e), function (e) {
  18831. e.onNeedLogin = function (e) {
  18832. V($, e);
  18833. }, e.offNeedLogin = function (e) {
  18834. G($, e);
  18835. }, fs && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, Z().then(function () {
  18836. Cs.call(e);
  18837. }), ys && Ps.call(e)));
  18838. }(e), function (e) {
  18839. e.onRefreshToken = function (e) {
  18840. V(B, e);
  18841. }, e.offRefreshToken = function (e) {
  18842. G(B, e);
  18843. };
  18844. }(e);
  18845. }
  18846. var xs;
  18847. var Os = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  18848. Es = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  18849. function Ls() {
  18850. var e = se().token || "",
  18851. t = e.split(".");
  18852. if (!e || 3 !== t.length) return {
  18853. uid: null,
  18854. role: [],
  18855. permission: [],
  18856. tokenExpired: 0
  18857. };
  18858. var n;
  18859. try {
  18860. n = JSON.parse((s = t[1], decodeURIComponent(xs(s).split("").map(function (e) {
  18861. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  18862. }).join(""))));
  18863. } catch (e) {
  18864. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  18865. }
  18866. var s;
  18867. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  18868. }
  18869. xs = "function" != typeof atob ? function (e) {
  18870. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !Es.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  18871. var t;
  18872. e += "==".slice(2 - (3 & e.length));
  18873. for (var n, s, r = "", i = 0; i < e.length;) {
  18874. t = Os.indexOf(e.charAt(i++)) << 18 | Os.indexOf(e.charAt(i++)) << 12 | (n = Os.indexOf(e.charAt(i++))) << 6 | (s = Os.indexOf(e.charAt(i++))), r += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);
  18875. }
  18876. return r;
  18877. } : atob;
  18878. var Rs = n(function (e, t) {
  18879. Object.defineProperty(t, "__esModule", {
  18880. value: !0
  18881. });
  18882. var n = "chooseAndUploadFile:ok",
  18883. s = "chooseAndUploadFile:fail";
  18884. function r(e, t) {
  18885. return e.tempFiles.forEach(function (e, n) {
  18886. 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("."));
  18887. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  18888. return e.path;
  18889. })), e;
  18890. }
  18891. function i(e, t, _ref53) {
  18892. var s = _ref53.onChooseFile,
  18893. r = _ref53.onUploadProgress;
  18894. return t.then(function (e) {
  18895. if (s) {
  18896. var _t19 = s(e);
  18897. if (void 0 !== _t19) return Promise.resolve(_t19).then(function (t) {
  18898. return void 0 === t ? e : t;
  18899. });
  18900. }
  18901. return e;
  18902. }).then(function (t) {
  18903. return !1 === t ? {
  18904. errMsg: n,
  18905. tempFilePaths: [],
  18906. tempFiles: []
  18907. } : function (e, t) {
  18908. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  18909. var r = arguments.length > 3 ? arguments[3] : undefined;
  18910. (t = Object.assign({}, t)).errMsg = n;
  18911. var i = t.tempFiles,
  18912. o = i.length;
  18913. var a = 0;
  18914. return new Promise(function (n) {
  18915. for (; a < s;) {
  18916. c();
  18917. }
  18918. function c() {
  18919. var s = a++;
  18920. if (s >= o) return void (!i.find(function (e) {
  18921. return !e.url && !e.errMsg;
  18922. }) && n(t));
  18923. var u = i[s];
  18924. e.uploadFile({
  18925. provider: u.provider,
  18926. filePath: u.path,
  18927. cloudPath: u.cloudPath,
  18928. fileType: u.fileType,
  18929. cloudPathAsRealPath: u.cloudPathAsRealPath,
  18930. onUploadProgress: function onUploadProgress(e) {
  18931. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  18932. }
  18933. }).then(function (e) {
  18934. u.url = e.fileID, s < o && c();
  18935. }).catch(function (e) {
  18936. u.errMsg = e.errMsg || e.message, s < o && c();
  18937. });
  18938. }
  18939. });
  18940. }(e, t, 5, r);
  18941. });
  18942. }
  18943. t.initChooseAndUploadFile = function (e) {
  18944. return function () {
  18945. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  18946. type: "all"
  18947. };
  18948. return "image" === t.type ? i(e, function (e) {
  18949. var t = e.count,
  18950. n = e.sizeType,
  18951. _e$sourceType = e.sourceType,
  18952. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  18953. o = e.extension;
  18954. return new Promise(function (e, a) {
  18955. uni.chooseImage({
  18956. count: t,
  18957. sizeType: n,
  18958. sourceType: i,
  18959. extension: o,
  18960. success: function success(t) {
  18961. e(r(t, "image"));
  18962. },
  18963. fail: function fail(e) {
  18964. a({
  18965. errMsg: e.errMsg.replace("chooseImage:fail", s)
  18966. });
  18967. }
  18968. });
  18969. });
  18970. }(t), t) : "video" === t.type ? i(e, function (e) {
  18971. var t = e.camera,
  18972. n = e.compressed,
  18973. i = e.maxDuration,
  18974. _e$sourceType2 = e.sourceType,
  18975. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  18976. a = e.extension;
  18977. return new Promise(function (e, c) {
  18978. uni.chooseVideo({
  18979. camera: t,
  18980. compressed: n,
  18981. maxDuration: i,
  18982. sourceType: o,
  18983. extension: a,
  18984. success: function success(t) {
  18985. var n = t.tempFilePath,
  18986. s = t.duration,
  18987. i = t.size,
  18988. o = t.height,
  18989. a = t.width;
  18990. e(r({
  18991. errMsg: "chooseVideo:ok",
  18992. tempFilePaths: [n],
  18993. tempFiles: [{
  18994. name: t.tempFile && t.tempFile.name || "",
  18995. path: n,
  18996. size: i,
  18997. type: t.tempFile && t.tempFile.type || "",
  18998. width: a,
  18999. height: o,
  19000. duration: s,
  19001. fileType: "video",
  19002. cloudPath: ""
  19003. }]
  19004. }, "video"));
  19005. },
  19006. fail: function fail(e) {
  19007. c({
  19008. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  19009. });
  19010. }
  19011. });
  19012. });
  19013. }(t), t) : i(e, function (e) {
  19014. var t = e.count,
  19015. n = e.extension;
  19016. return new Promise(function (e, i) {
  19017. var o = uni.chooseFile;
  19018. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  19019. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  19020. });
  19021. o({
  19022. type: "all",
  19023. count: t,
  19024. extension: n,
  19025. success: function success(t) {
  19026. e(r(t));
  19027. },
  19028. fail: function fail(e) {
  19029. i({
  19030. errMsg: e.errMsg.replace("chooseFile:fail", s)
  19031. });
  19032. }
  19033. });
  19034. });
  19035. }(t), t);
  19036. };
  19037. };
  19038. }),
  19039. Us = t(Rs);
  19040. var Ns = "manual";
  19041. function Ds(e) {
  19042. return {
  19043. props: {
  19044. localdata: {
  19045. type: Array,
  19046. default: function _default() {
  19047. return [];
  19048. }
  19049. },
  19050. options: {
  19051. type: [Object, Array],
  19052. default: function _default() {
  19053. return {};
  19054. }
  19055. },
  19056. spaceInfo: {
  19057. type: Object,
  19058. default: function _default() {
  19059. return {};
  19060. }
  19061. },
  19062. collection: {
  19063. type: [String, Array],
  19064. default: ""
  19065. },
  19066. action: {
  19067. type: String,
  19068. default: ""
  19069. },
  19070. field: {
  19071. type: String,
  19072. default: ""
  19073. },
  19074. orderby: {
  19075. type: String,
  19076. default: ""
  19077. },
  19078. where: {
  19079. type: [String, Object],
  19080. default: ""
  19081. },
  19082. pageData: {
  19083. type: String,
  19084. default: "add"
  19085. },
  19086. pageCurrent: {
  19087. type: Number,
  19088. default: 1
  19089. },
  19090. pageSize: {
  19091. type: Number,
  19092. default: 20
  19093. },
  19094. getcount: {
  19095. type: [Boolean, String],
  19096. default: !1
  19097. },
  19098. gettree: {
  19099. type: [Boolean, String],
  19100. default: !1
  19101. },
  19102. gettreepath: {
  19103. type: [Boolean, String],
  19104. default: !1
  19105. },
  19106. startwith: {
  19107. type: String,
  19108. default: ""
  19109. },
  19110. limitlevel: {
  19111. type: Number,
  19112. default: 10
  19113. },
  19114. groupby: {
  19115. type: String,
  19116. default: ""
  19117. },
  19118. groupField: {
  19119. type: String,
  19120. default: ""
  19121. },
  19122. distinct: {
  19123. type: [Boolean, String],
  19124. default: !1
  19125. },
  19126. foreignKey: {
  19127. type: String,
  19128. default: ""
  19129. },
  19130. loadtime: {
  19131. type: String,
  19132. default: "auto"
  19133. },
  19134. manual: {
  19135. type: Boolean,
  19136. default: !1
  19137. }
  19138. },
  19139. data: function data() {
  19140. return {
  19141. mixinDatacomLoading: !1,
  19142. mixinDatacomHasMore: !1,
  19143. mixinDatacomResData: [],
  19144. mixinDatacomErrorMessage: "",
  19145. mixinDatacomPage: {},
  19146. mixinDatacomError: null
  19147. };
  19148. },
  19149. created: function created() {
  19150. var _this21 = this;
  19151. this.mixinDatacomPage = {
  19152. current: this.pageCurrent,
  19153. size: this.pageSize,
  19154. count: 0
  19155. }, this.$watch(function () {
  19156. var e = [];
  19157. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  19158. e.push(_this21[t]);
  19159. }), e;
  19160. }, function (e, t) {
  19161. if (_this21.loadtime === Ns) return;
  19162. var n = !1;
  19163. var s = [];
  19164. for (var _r9 = 2; _r9 < e.length; _r9++) {
  19165. e[_r9] !== t[_r9] && (s.push(e[_r9]), n = !0);
  19166. }
  19167. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  19168. });
  19169. },
  19170. methods: {
  19171. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  19172. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  19173. var _this22 = this;
  19174. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19175. _ref54$getone = _ref54.getone,
  19176. e = _ref54$getone === void 0 ? !1 : _ref54$getone,
  19177. t = _ref54.success,
  19178. n = _ref54.fail;
  19179. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then(function (n) {
  19180. _this22.mixinDatacomLoading = !1;
  19181. var _n$result = n.result,
  19182. s = _n$result.data,
  19183. r = _n$result.count;
  19184. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  19185. var i = e ? s.length ? s[0] : void 0 : s;
  19186. _this22.mixinDatacomResData = i, t && t(i);
  19187. }).catch(function (e) {
  19188. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, _this22.mixinDatacomError = e, n && n(e);
  19189. }));
  19190. },
  19191. mixinDatacomGet: function mixinDatacomGet() {
  19192. var _n14;
  19193. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19194. var n;
  19195. t = t || {}, n = "undefined" != typeof __uniX && __uniX ? e.databaseForJQL(this.spaceInfo) : e.database(this.spaceInfo);
  19196. var s = t.action || this.action;
  19197. s && (n = n.action(s));
  19198. var r = t.collection || this.collection;
  19199. n = Array.isArray(r) ? (_n14 = n).collection.apply(_n14, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  19200. var i = t.where || this.where;
  19201. i && Object.keys(i).length && (n = n.where(i));
  19202. var o = t.field || this.field;
  19203. o && (n = n.field(o));
  19204. var a = t.foreignKey || this.foreignKey;
  19205. a && (n = n.foreignKey(a));
  19206. var c = t.groupby || this.groupby;
  19207. c && (n = n.groupBy(c));
  19208. var u = t.groupField || this.groupField;
  19209. u && (n = n.groupField(u));
  19210. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  19211. var l = t.orderby || this.orderby;
  19212. l && (n = n.orderBy(l));
  19213. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  19214. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  19215. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  19216. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  19217. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  19218. m = {
  19219. getCount: p
  19220. },
  19221. y = {
  19222. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  19223. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  19224. };
  19225. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  19226. }
  19227. }
  19228. };
  19229. }
  19230. function qs(e) {
  19231. return function (t) {
  19232. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19233. n = function (e) {
  19234. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19235. 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;
  19236. }({
  19237. customUI: !1,
  19238. loadingOptions: {
  19239. title: "加载中...",
  19240. mask: !0
  19241. },
  19242. errorOptions: {
  19243. type: "modal",
  19244. retry: !1
  19245. }
  19246. }, n);
  19247. var _n15 = n,
  19248. s = _n15.customUI,
  19249. r = _n15.loadingOptions,
  19250. i = _n15.errorOptions,
  19251. o = _n15.parseSystemError,
  19252. a = !s;
  19253. return new Proxy({}, {
  19254. get: function get(s, c) {
  19255. switch (c) {
  19256. case "toString":
  19257. return "[object UniCloudObject]";
  19258. case "toJSON":
  19259. return {};
  19260. }
  19261. return function () {
  19262. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19263. e = _ref55.fn,
  19264. t = _ref55.interceptorName,
  19265. n = _ref55.getCallbackArgs;
  19266. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  19267. var _len2,
  19268. s,
  19269. _key2,
  19270. r,
  19271. i,
  19272. o,
  19273. _args = arguments;
  19274. return _regenerator.default.wrap(function _callee55$(_context55) {
  19275. while (1) {
  19276. switch (_context55.prev = _context55.next) {
  19277. case 0:
  19278. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  19279. s[_key2] = _args[_key2];
  19280. }
  19281. r = n ? n({
  19282. params: s
  19283. }) : {};
  19284. _context55.prev = 2;
  19285. _context55.next = 5;
  19286. return q(M(t, "invoke"), _objectSpread({}, r));
  19287. case 5:
  19288. _context55.next = 7;
  19289. return e.apply(void 0, s);
  19290. case 7:
  19291. i = _context55.sent;
  19292. _context55.next = 10;
  19293. return q(M(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  19294. result: i
  19295. }));
  19296. case 10:
  19297. return _context55.abrupt("return", i);
  19298. case 13:
  19299. _context55.prev = 13;
  19300. _context55.t0 = _context55["catch"](2);
  19301. o = _context55.t0;
  19302. _context55.next = 18;
  19303. return q(M(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  19304. error: o
  19305. }));
  19306. case 18:
  19307. throw o;
  19308. case 19:
  19309. _context55.prev = 19;
  19310. _context55.next = 22;
  19311. return q(M(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  19312. error: o
  19313. }) : _objectSpread(_objectSpread({}, r), {}, {
  19314. result: i
  19315. }));
  19316. case 22:
  19317. return _context55.finish(19);
  19318. case 23:
  19319. case "end":
  19320. return _context55.stop();
  19321. }
  19322. }
  19323. }, _callee55, null, [[2, 13, 19, 23]]);
  19324. }));
  19325. }({
  19326. fn: function () {
  19327. var _s17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
  19328. var h,
  19329. _len3,
  19330. l,
  19331. _key3,
  19332. d,
  19333. p,
  19334. _ref57,
  19335. f,
  19336. g,
  19337. m,
  19338. y,
  19339. _e26,
  19340. _yield,
  19341. _t20,
  19342. _n16,
  19343. _args4 = arguments;
  19344. return _regenerator.default.wrap(function _callee57$(_context57) {
  19345. while (1) {
  19346. switch (_context57.prev = _context57.next) {
  19347. case 0:
  19348. a && uni.showLoading({
  19349. title: r.title,
  19350. mask: r.mask
  19351. });
  19352. for (_len3 = _args4.length, l = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  19353. l[_key3] = _args4[_key3];
  19354. }
  19355. d = {
  19356. name: t,
  19357. type: u,
  19358. data: {
  19359. method: c,
  19360. params: l
  19361. }
  19362. };
  19363. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  19364. var n = t.data.method,
  19365. s = e.secretMethods || {},
  19366. r = s[n] || s["*"];
  19367. r && (t.secretType = r);
  19368. }(n, d);
  19369. p = !1;
  19370. _context57.prev = 5;
  19371. _context57.next = 8;
  19372. return e.callFunction(d);
  19373. case 8:
  19374. h = _context57.sent;
  19375. _context57.next = 14;
  19376. break;
  19377. case 11:
  19378. _context57.prev = 11;
  19379. _context57.t0 = _context57["catch"](5);
  19380. p = !0, h = {
  19381. result: new te(_context57.t0)
  19382. };
  19383. case 14:
  19384. _ref57 = h.result || {}, f = _ref57.errSubject, g = _ref57.errCode, m = _ref57.errMsg, y = _ref57.newToken;
  19385. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (re(y), Y(B, _objectSpread({}, y))), g)) {
  19386. _context57.next = 39;
  19387. break;
  19388. }
  19389. _e26 = m;
  19390. if (!(p && o)) {
  19391. _context57.next = 24;
  19392. break;
  19393. }
  19394. _context57.next = 20;
  19395. return o({
  19396. objectName: t,
  19397. methodName: c,
  19398. params: l,
  19399. errSubject: f,
  19400. errCode: g,
  19401. errMsg: m
  19402. });
  19403. case 20:
  19404. _context57.t1 = _context57.sent.errMsg;
  19405. if (_context57.t1) {
  19406. _context57.next = 23;
  19407. break;
  19408. }
  19409. _context57.t1 = m;
  19410. case 23:
  19411. _e26 = _context57.t1;
  19412. case 24:
  19413. if (!a) {
  19414. _context57.next = 37;
  19415. break;
  19416. }
  19417. if (!("toast" === i.type)) {
  19418. _context57.next = 29;
  19419. break;
  19420. }
  19421. uni.showToast({
  19422. title: _e26,
  19423. icon: "none"
  19424. });
  19425. _context57.next = 37;
  19426. break;
  19427. case 29:
  19428. if (!("modal" !== i.type)) {
  19429. _context57.next = 31;
  19430. break;
  19431. }
  19432. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  19433. case 31:
  19434. _context57.next = 33;
  19435. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
  19436. var _ref59,
  19437. e,
  19438. t,
  19439. n,
  19440. s,
  19441. r,
  19442. _args2 = arguments;
  19443. return _regenerator.default.wrap(function _callee56$(_context56) {
  19444. while (1) {
  19445. switch (_context56.prev = _context56.next) {
  19446. case 0:
  19447. _ref59 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref59.title, t = _ref59.content, n = _ref59.showCancel, s = _ref59.cancelText, r = _ref59.confirmText;
  19448. return _context56.abrupt("return", new Promise(function (i, o) {
  19449. uni.showModal({
  19450. title: e,
  19451. content: t,
  19452. showCancel: n,
  19453. cancelText: s,
  19454. confirmText: r,
  19455. success: function success(e) {
  19456. i(e);
  19457. },
  19458. fail: function fail() {
  19459. i({
  19460. confirm: !1,
  19461. cancel: !0
  19462. });
  19463. }
  19464. });
  19465. }));
  19466. case 2:
  19467. case "end":
  19468. return _context56.stop();
  19469. }
  19470. }
  19471. }, _callee56);
  19472. }))({
  19473. title: "提示",
  19474. content: _e26,
  19475. showCancel: i.retry,
  19476. cancelText: "取消",
  19477. confirmText: i.retry ? "重试" : "确定"
  19478. });
  19479. case 33:
  19480. _yield = _context57.sent;
  19481. _t20 = _yield.confirm;
  19482. if (!(i.retry && _t20)) {
  19483. _context57.next = 37;
  19484. break;
  19485. }
  19486. return _context57.abrupt("return", s.apply(void 0, l));
  19487. case 37:
  19488. _n16 = new te({
  19489. subject: f,
  19490. code: g,
  19491. message: m,
  19492. requestId: h.requestId
  19493. });
  19494. throw _n16.detail = h.result, Y(j, {
  19495. type: J,
  19496. content: _n16
  19497. }), _n16;
  19498. case 39:
  19499. return _context57.abrupt("return", (Y(j, {
  19500. type: J,
  19501. content: h.result
  19502. }), h.result));
  19503. case 40:
  19504. case "end":
  19505. return _context57.stop();
  19506. }
  19507. }
  19508. }, _callee57, null, [[5, 11]]);
  19509. }));
  19510. function s() {
  19511. return _s17.apply(this, arguments);
  19512. }
  19513. return s;
  19514. }(),
  19515. interceptorName: "callObject",
  19516. getCallbackArgs: function getCallbackArgs() {
  19517. var _ref60 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19518. e = _ref60.params;
  19519. return {
  19520. objectName: t,
  19521. methodName: c,
  19522. params: e
  19523. };
  19524. }
  19525. });
  19526. }
  19527. });
  19528. };
  19529. }
  19530. function Ms(e) {
  19531. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  19532. }
  19533. function Fs() {
  19534. return _Fs.apply(this, arguments);
  19535. }
  19536. function _Fs() {
  19537. _Fs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
  19538. var _ref71,
  19539. e,
  19540. _ref71$callLoginByWei,
  19541. t,
  19542. n,
  19543. s,
  19544. r,
  19545. _args9 = arguments;
  19546. return _regenerator.default.wrap(function _callee62$(_context62) {
  19547. while (1) {
  19548. switch (_context62.prev = _context62.next) {
  19549. case 0:
  19550. _ref71 = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {}, e = _ref71.openid, _ref71$callLoginByWei = _ref71.callLoginByWeixin, t = _ref71$callLoginByWei === void 0 ? !1 : _ref71$callLoginByWei;
  19551. n = Ms(this);
  19552. if (!("mp-weixin" !== C)) {
  19553. _context62.next = 4;
  19554. break;
  19555. }
  19556. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(C, "`"));
  19557. case 4:
  19558. if (!(e && t)) {
  19559. _context62.next = 6;
  19560. break;
  19561. }
  19562. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  19563. case 6:
  19564. if (!e) {
  19565. _context62.next = 8;
  19566. break;
  19567. }
  19568. return _context62.abrupt("return", (n.mpWeixinOpenid = e, {}));
  19569. case 8:
  19570. _context62.next = 10;
  19571. return new Promise(function (e, t) {
  19572. uni.login({
  19573. success: function success(t) {
  19574. e(t.code);
  19575. },
  19576. fail: function fail(e) {
  19577. t(new Error(e.errMsg));
  19578. }
  19579. });
  19580. });
  19581. case 10:
  19582. s = _context62.sent;
  19583. r = this.importObject("uni-id-co", {
  19584. customUI: !0
  19585. });
  19586. _context62.next = 14;
  19587. return r.secureNetworkHandshakeByWeixin({
  19588. code: s,
  19589. callLoginByWeixin: t
  19590. });
  19591. case 14:
  19592. n.mpWeixinCode = s;
  19593. return _context62.abrupt("return", {
  19594. code: s
  19595. });
  19596. case 16:
  19597. case "end":
  19598. return _context62.stop();
  19599. }
  19600. }
  19601. }, _callee62, this);
  19602. }));
  19603. return _Fs.apply(this, arguments);
  19604. }
  19605. function Ks(_x46) {
  19606. return _Ks.apply(this, arguments);
  19607. }
  19608. function _Ks() {
  19609. _Ks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63(e) {
  19610. var t;
  19611. return _regenerator.default.wrap(function _callee63$(_context63) {
  19612. while (1) {
  19613. switch (_context63.prev = _context63.next) {
  19614. case 0:
  19615. t = Ms(this);
  19616. return _context63.abrupt("return", (t.initPromise || (t.initPromise = Fs.call(this, e).then(function (e) {
  19617. return e;
  19618. }).catch(function (e) {
  19619. throw delete t.initPromise, e;
  19620. })), t.initPromise));
  19621. case 2:
  19622. case "end":
  19623. return _context63.stop();
  19624. }
  19625. }
  19626. }, _callee63, this);
  19627. }));
  19628. return _Ks.apply(this, arguments);
  19629. }
  19630. function js(e) {
  19631. return function () {
  19632. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19633. t = _ref61.openid,
  19634. _ref61$callLoginByWei = _ref61.callLoginByWeixin,
  19635. n = _ref61$callLoginByWei === void 0 ? !1 : _ref61$callLoginByWei;
  19636. return Ks.call(e, {
  19637. openid: t,
  19638. callLoginByWeixin: n
  19639. });
  19640. };
  19641. }
  19642. function $s(e) {
  19643. !function (e) {
  19644. ue = e;
  19645. }(e);
  19646. }
  19647. function Bs(e) {
  19648. var t = {
  19649. getSystemInfo: uni.getSystemInfo,
  19650. getPushClientId: uni.getPushClientId
  19651. };
  19652. return function (n) {
  19653. return new Promise(function (s, r) {
  19654. t[e](_objectSpread(_objectSpread({}, n), {}, {
  19655. success: function success(e) {
  19656. s(e);
  19657. },
  19658. fail: function fail(e) {
  19659. r(e);
  19660. }
  19661. }));
  19662. });
  19663. };
  19664. }
  19665. var Ws = /*#__PURE__*/function (_ref62) {
  19666. (0, _inherits2.default)(Ws, _ref62);
  19667. var _super11 = _createSuper(Ws);
  19668. function Ws() {
  19669. var _this23;
  19670. (0, _classCallCheck2.default)(this, Ws);
  19671. _this23 = _super11.call(this), _this23._uniPushMessageCallback = _this23._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this23)), _this23._currentMessageId = -1, _this23._payloadQueue = [];
  19672. return _this23;
  19673. }
  19674. (0, _createClass2.default)(Ws, [{
  19675. key: "init",
  19676. value: function init() {
  19677. var _this24 = this;
  19678. return Promise.all([Bs("getSystemInfo")(), Bs("getPushClientId")()]).then(function () {
  19679. var _ref63 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  19680. _ref64 = (0, _slicedToArray2.default)(_ref63, 2),
  19681. _ref64$ = _ref64[0];
  19682. _ref64$ = _ref64$ === void 0 ? {} : _ref64$;
  19683. var e = _ref64$.appId,
  19684. _ref64$2 = _ref64[1];
  19685. _ref64$2 = _ref64$2 === void 0 ? {} : _ref64$2;
  19686. var t = _ref64$2.cid;
  19687. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  19688. if (!t) throw new Error("Invalid push client id");
  19689. _this24._appId = e, _this24._pushClientId = t, _this24._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this24.emit("open"), _this24._initMessageListener();
  19690. }, function (e) {
  19691. throw _this24.emit("error", e), _this24.close(), e;
  19692. });
  19693. }
  19694. }, {
  19695. key: "open",
  19696. value: function () {
  19697. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
  19698. return _regenerator.default.wrap(function _callee58$(_context58) {
  19699. while (1) {
  19700. switch (_context58.prev = _context58.next) {
  19701. case 0:
  19702. return _context58.abrupt("return", this.init());
  19703. case 1:
  19704. case "end":
  19705. return _context58.stop();
  19706. }
  19707. }
  19708. }, _callee58, this);
  19709. }));
  19710. function open() {
  19711. return _open.apply(this, arguments);
  19712. }
  19713. return open;
  19714. }()
  19715. }, {
  19716. key: "_isUniCloudSSE",
  19717. value: function _isUniCloudSSE(e) {
  19718. if ("receive" !== e.type) return !1;
  19719. var t = e && e.data && e.data.payload;
  19720. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  19721. }
  19722. }, {
  19723. key: "_receivePushMessage",
  19724. value: function _receivePushMessage(e) {
  19725. if (!this._isUniCloudSSE(e)) return;
  19726. var t = e && e.data && e.data.payload,
  19727. n = t.action,
  19728. s = t.messageId,
  19729. r = t.message;
  19730. this._payloadQueue.push({
  19731. action: n,
  19732. messageId: s,
  19733. message: r
  19734. }), this._consumMessage();
  19735. }
  19736. }, {
  19737. key: "_consumMessage",
  19738. value: function _consumMessage() {
  19739. var _this25 = this;
  19740. for (;;) {
  19741. var _e27 = this._payloadQueue.find(function (e) {
  19742. return e.messageId === _this25._currentMessageId + 1;
  19743. });
  19744. if (!_e27) break;
  19745. this._currentMessageId++, this._parseMessagePayload(_e27);
  19746. }
  19747. }
  19748. }, {
  19749. key: "_parseMessagePayload",
  19750. value: function _parseMessagePayload(e) {
  19751. var t = e.action,
  19752. n = e.messageId,
  19753. s = e.message;
  19754. "end" === t ? this._end({
  19755. messageId: n,
  19756. message: s
  19757. }) : "message" === t && this._appendMessage({
  19758. messageId: n,
  19759. message: s
  19760. });
  19761. }
  19762. }, {
  19763. key: "_appendMessage",
  19764. value: function _appendMessage() {
  19765. var _ref65 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19766. e = _ref65.messageId,
  19767. t = _ref65.message;
  19768. this.emit("message", t);
  19769. }
  19770. }, {
  19771. key: "_end",
  19772. value: function _end() {
  19773. var _ref66 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19774. e = _ref66.messageId,
  19775. t = _ref66.message;
  19776. this.emit("end", t), this.close();
  19777. }
  19778. }, {
  19779. key: "_initMessageListener",
  19780. value: function _initMessageListener() {
  19781. uni.onPushMessage(this._uniPushMessageCallback);
  19782. }
  19783. }, {
  19784. key: "_destroy",
  19785. value: function _destroy() {
  19786. uni.offPushMessage(this._uniPushMessageCallback);
  19787. }
  19788. }, {
  19789. key: "toJSON",
  19790. value: function toJSON() {
  19791. return {
  19792. appId: this._appId,
  19793. pushClientId: this._pushClientId,
  19794. seqId: this._seqId
  19795. };
  19796. }
  19797. }, {
  19798. key: "close",
  19799. value: function close() {
  19800. this._destroy(), this.emit("close");
  19801. }
  19802. }]);
  19803. return Ws;
  19804. }( /*#__PURE__*/function () {
  19805. function _class6() {
  19806. (0, _classCallCheck2.default)(this, _class6);
  19807. this._callback = {};
  19808. }
  19809. (0, _createClass2.default)(_class6, [{
  19810. key: "addListener",
  19811. value: function addListener(e, t) {
  19812. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  19813. }
  19814. }, {
  19815. key: "on",
  19816. value: function on(e, t) {
  19817. return this.addListener(e, t);
  19818. }
  19819. }, {
  19820. key: "removeListener",
  19821. value: function removeListener(e, t) {
  19822. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  19823. var n = this._callback[e];
  19824. if (!n) return;
  19825. var s = function (e, t) {
  19826. for (var _n17 = e.length - 1; _n17 >= 0; _n17--) {
  19827. if (e[_n17] === t) return _n17;
  19828. }
  19829. return -1;
  19830. }(n, t);
  19831. n.splice(s, 1);
  19832. }
  19833. }, {
  19834. key: "off",
  19835. value: function off(e, t) {
  19836. return this.removeListener(e, t);
  19837. }
  19838. }, {
  19839. key: "removeAllListener",
  19840. value: function removeAllListener(e) {
  19841. delete this._callback[e];
  19842. }
  19843. }, {
  19844. key: "emit",
  19845. value: function emit(e) {
  19846. var n = this._callback[e];
  19847. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  19848. t[_key4 - 1] = arguments[_key4];
  19849. }
  19850. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  19851. n[_e28].apply(n, t);
  19852. }
  19853. }
  19854. }]);
  19855. return _class6;
  19856. }());
  19857. function Hs(_x47) {
  19858. return _Hs.apply(this, arguments);
  19859. }
  19860. function _Hs() {
  19861. _Hs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64(e) {
  19862. var _ae2, _e32, _t22, t, _t$debugInfo, n, s, _yield$kt2, r, i, o;
  19863. return _regenerator.default.wrap(function _callee64$(_context64) {
  19864. while (1) {
  19865. switch (_context64.prev = _context64.next) {
  19866. case 0:
  19867. if (S) {
  19868. _context64.next = 2;
  19869. break;
  19870. }
  19871. return _context64.abrupt("return", Promise.resolve());
  19872. case 2:
  19873. if ("app" === C) {
  19874. _ae2 = ae(), _e32 = _ae2.osName, _t22 = _ae2.osVersion;
  19875. "ios" === _e32 && function (e) {
  19876. if (!e || "string" != typeof e) return 0;
  19877. var t = e.match(/^(\d+)./);
  19878. return t && t[1] ? parseInt(t[1]) : 0;
  19879. }(_t22) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  19880. }
  19881. t = e.__dev__;
  19882. if (t.debugInfo) {
  19883. _context64.next = 6;
  19884. break;
  19885. }
  19886. return _context64.abrupt("return");
  19887. case 6:
  19888. _t$debugInfo = t.debugInfo;
  19889. n = _t$debugInfo.address;
  19890. s = _t$debugInfo.servePort;
  19891. _context64.next = 11;
  19892. return kt(n, s);
  19893. case 11:
  19894. _yield$kt2 = _context64.sent;
  19895. r = _yield$kt2.address;
  19896. if (!r) {
  19897. _context64.next = 15;
  19898. break;
  19899. }
  19900. return _context64.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  19901. case 15:
  19902. i = console["app" === C ? "error" : "warn"];
  19903. o = "";
  19904. if (!("remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, o = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === C && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === C.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  19905. _context64.next = 19;
  19906. break;
  19907. }
  19908. throw new Error(o);
  19909. case 19:
  19910. i(o);
  19911. case 20:
  19912. case "end":
  19913. return _context64.stop();
  19914. }
  19915. }
  19916. }, _callee64);
  19917. }));
  19918. return _Hs.apply(this, arguments);
  19919. }
  19920. function Js(e) {
  19921. e._initPromiseHub || (e._initPromiseHub = new v({
  19922. createPromise: function createPromise() {
  19923. var t = Promise.resolve();
  19924. var n;
  19925. n = 1, t = new Promise(function (e) {
  19926. setTimeout(function () {
  19927. e();
  19928. }, n);
  19929. });
  19930. var s = e.auth();
  19931. return t.then(function () {
  19932. return s.getLoginState();
  19933. }).then(function (e) {
  19934. return e ? Promise.resolve() : s.signInAnonymously();
  19935. });
  19936. }
  19937. }));
  19938. }
  19939. var zs = {
  19940. tcb: St,
  19941. tencent: St,
  19942. aliyun: pe,
  19943. private: Pt,
  19944. dcloud: Pt,
  19945. alipay: qt
  19946. };
  19947. var Vs = new ( /*#__PURE__*/function () {
  19948. function _class7() {
  19949. (0, _classCallCheck2.default)(this, _class7);
  19950. }
  19951. (0, _createClass2.default)(_class7, [{
  19952. key: "init",
  19953. value: function init(e) {
  19954. var t = {};
  19955. var n = zs[e.provider];
  19956. if (!n) throw new Error("未提供正确的provider参数");
  19957. t = n.init(e), S && function (e) {
  19958. if (!S) return;
  19959. var t = {};
  19960. e.__dev__ = t, t.debugLog = S && ("web" === C && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === C);
  19961. var n = P;
  19962. n && !n.code && (t.debugInfo = n);
  19963. var s = new v({
  19964. createPromise: function createPromise() {
  19965. return Hs(e);
  19966. }
  19967. });
  19968. t.initLocalNetwork = function () {
  19969. return s.exec();
  19970. };
  19971. }(t), Js(t), Hn(t), function (e) {
  19972. var t = e.uploadFile;
  19973. e.uploadFile = function (e) {
  19974. return t.call(this, e);
  19975. };
  19976. }(t), function (e) {
  19977. e.database = function (t) {
  19978. if (t && Object.keys(t).length > 0) return e.init(t).database();
  19979. if (this._database) return this._database;
  19980. var n = ns(ss, {
  19981. uniClient: e
  19982. });
  19983. return this._database = n, n;
  19984. }, e.databaseForJQL = function (t) {
  19985. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  19986. if (this._databaseForJQL) return this._databaseForJQL;
  19987. var n = ns(ss, {
  19988. uniClient: e,
  19989. isJQL: !0
  19990. });
  19991. return this._databaseForJQL = n, n;
  19992. };
  19993. }(t), function (e) {
  19994. e.getCurrentUserInfo = Ls, e.chooseAndUploadFile = Us.initChooseAndUploadFile(e), Object.assign(e, {
  19995. get mixinDatacom() {
  19996. return Ds(e);
  19997. }
  19998. }), e.SSEChannel = Ws, e.initSecureNetworkByWeixin = js(e), e.setCustomClientInfo = $s, e.importObject = qs(e);
  19999. }(t);
  20000. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  20001. if (!t[e]) return;
  20002. var n = t[e];
  20003. t[e] = function () {
  20004. return n.apply(t, Array.from(arguments));
  20005. }, t[e] = function (e, t) {
  20006. return function (n) {
  20007. var _this26 = this;
  20008. var s = !1;
  20009. if ("callFunction" === t) {
  20010. var _e29 = n && n.type || c;
  20011. s = _e29 !== c;
  20012. }
  20013. var r = "callFunction" === t && !s,
  20014. i = this._initPromiseHub.exec();
  20015. n = n || {};
  20016. var _ee2 = ee(n),
  20017. o = _ee2.success,
  20018. a = _ee2.fail,
  20019. u = _ee2.complete,
  20020. l = i.then(function () {
  20021. return s ? Promise.resolve() : q(M(t, "invoke"), n);
  20022. }).then(function () {
  20023. return e.call(_this26, n);
  20024. }).then(function (e) {
  20025. return s ? Promise.resolve(e) : q(M(t, "success"), e).then(function () {
  20026. return q(M(t, "complete"), e);
  20027. }).then(function () {
  20028. return r && Y(j, {
  20029. type: H,
  20030. content: e
  20031. }), Promise.resolve(e);
  20032. });
  20033. }, function (e) {
  20034. return s ? Promise.reject(e) : q(M(t, "fail"), e).then(function () {
  20035. return q(M(t, "complete"), e);
  20036. }).then(function () {
  20037. return Y(j, {
  20038. type: H,
  20039. content: e
  20040. }), Promise.reject(e);
  20041. });
  20042. });
  20043. if (!(o || a || u)) return l;
  20044. l.then(function (e) {
  20045. o && o(e), u && u(e), r && Y(j, {
  20046. type: H,
  20047. content: e
  20048. });
  20049. }, function (e) {
  20050. a && a(e), u && u(e), r && Y(j, {
  20051. type: H,
  20052. content: e
  20053. });
  20054. });
  20055. };
  20056. }(t[e], e).bind(t);
  20057. }), t.init = this.init, t;
  20058. }
  20059. }]);
  20060. return _class7;
  20061. }())();
  20062. (function () {
  20063. var e = T;
  20064. var t = {};
  20065. if (e && 1 === e.length) t = e[0], Vs = Vs.init(t), Vs._isDefault = !0;else {
  20066. var _t21 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  20067. var _n18;
  20068. _n18 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t21.forEach(function (e) {
  20069. Vs[e] = function () {
  20070. return console.error(_n18), Promise.reject(new te({
  20071. code: "SYS_ERR",
  20072. message: _n18
  20073. }));
  20074. };
  20075. });
  20076. }
  20077. Object.assign(Vs, {
  20078. get mixinDatacom() {
  20079. return Ds(Vs);
  20080. }
  20081. }), Ts(Vs), Vs.addInterceptor = N, Vs.removeInterceptor = D, Vs.interceptObject = F, S && "web" === C && (window.uniCloud = Vs);
  20082. })();
  20083. var Gs = Vs;
  20084. exports.default = Gs;
  20085. /* 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"]))
  20086. /***/ }),
  20087. /***/ 352:
  20088. /*!**********************************************************************!*\
  20089. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  20090. \**********************************************************************/
  20091. /*! no static exports found */
  20092. /***/ (function(module, exports) {
  20093. function _assertThisInitialized(self) {
  20094. if (self === void 0) {
  20095. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  20096. }
  20097. return self;
  20098. }
  20099. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20100. /***/ }),
  20101. /***/ 353:
  20102. /*!*********************************************************!*\
  20103. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  20104. \*********************************************************/
  20105. /*! no static exports found */
  20106. /***/ (function(module, exports, __webpack_require__) {
  20107. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  20108. function _inherits(subClass, superClass) {
  20109. if (typeof superClass !== "function" && superClass !== null) {
  20110. throw new TypeError("Super expression must either be null or a function");
  20111. }
  20112. subClass.prototype = Object.create(superClass && superClass.prototype, {
  20113. constructor: {
  20114. value: subClass,
  20115. writable: true,
  20116. configurable: true
  20117. }
  20118. });
  20119. Object.defineProperty(subClass, "prototype", {
  20120. writable: false
  20121. });
  20122. if (superClass) setPrototypeOf(subClass, superClass);
  20123. }
  20124. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20125. /***/ }),
  20126. /***/ 354:
  20127. /*!**************************************************************************!*\
  20128. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  20129. \**************************************************************************/
  20130. /*! no static exports found */
  20131. /***/ (function(module, exports, __webpack_require__) {
  20132. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  20133. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 352);
  20134. function _possibleConstructorReturn(self, call) {
  20135. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  20136. return call;
  20137. } else if (call !== void 0) {
  20138. throw new TypeError("Derived constructors may only return object or undefined");
  20139. }
  20140. return assertThisInitialized(self);
  20141. }
  20142. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20143. /***/ }),
  20144. /***/ 355:
  20145. /*!***************************************************************!*\
  20146. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  20147. \***************************************************************/
  20148. /*! no static exports found */
  20149. /***/ (function(module, exports) {
  20150. function _getPrototypeOf(o) {
  20151. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  20152. return o.__proto__ || Object.getPrototypeOf(o);
  20153. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20154. return _getPrototypeOf(o);
  20155. }
  20156. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20157. /***/ }),
  20158. /***/ 356:
  20159. /*!****************************************************************!*\
  20160. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  20161. \****************************************************************/
  20162. /*! no static exports found */
  20163. /***/ (function(module, exports, __webpack_require__) {
  20164. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 355);
  20165. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  20166. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 357);
  20167. var construct = __webpack_require__(/*! ./construct.js */ 15);
  20168. function _wrapNativeSuper(Class) {
  20169. var _cache = typeof Map === "function" ? new Map() : undefined;
  20170. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  20171. if (Class === null || !isNativeFunction(Class)) return Class;
  20172. if (typeof Class !== "function") {
  20173. throw new TypeError("Super expression must either be null or a function");
  20174. }
  20175. if (typeof _cache !== "undefined") {
  20176. if (_cache.has(Class)) return _cache.get(Class);
  20177. _cache.set(Class, Wrapper);
  20178. }
  20179. function Wrapper() {
  20180. return construct(Class, arguments, getPrototypeOf(this).constructor);
  20181. }
  20182. Wrapper.prototype = Object.create(Class.prototype, {
  20183. constructor: {
  20184. value: Wrapper,
  20185. enumerable: false,
  20186. writable: true,
  20187. configurable: true
  20188. }
  20189. });
  20190. return setPrototypeOf(Wrapper, Class);
  20191. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20192. return _wrapNativeSuper(Class);
  20193. }
  20194. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20195. /***/ }),
  20196. /***/ 357:
  20197. /*!*****************************************************************!*\
  20198. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  20199. \*****************************************************************/
  20200. /*! no static exports found */
  20201. /***/ (function(module, exports) {
  20202. function _isNativeFunction(fn) {
  20203. try {
  20204. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  20205. } catch (e) {
  20206. return typeof fn === "function";
  20207. }
  20208. }
  20209. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20210. /***/ }),
  20211. /***/ 358:
  20212. /*!******************************************************************!*\
  20213. !*** E:/盈通/sulibao-mini/pages.json?{"type":"origin-pages-json"} ***!
  20214. \******************************************************************/
  20215. /*! no static exports found */
  20216. /***/ (function(module, exports, __webpack_require__) {
  20217. "use strict";
  20218. Object.defineProperty(exports, "__esModule", {
  20219. value: true
  20220. });
  20221. exports.default = void 0;
  20222. var _default = {
  20223. "easycom": {
  20224. "^tn-(.*)": "@/tuniao-ui/components/tn-$1/tn-$1.vue"
  20225. },
  20226. "pages": [{
  20227. "path": "pages/index/index",
  20228. "style": {
  20229. "navigationBarTitleText": "速立保"
  20230. }
  20231. }, {
  20232. "path": "pages/index/auth",
  20233. "style": {
  20234. "navigationBarTitleText": ""
  20235. }
  20236. }, {
  20237. "path": "pages/login/login",
  20238. "style": {
  20239. "navigationBarTitleText": "登录"
  20240. }
  20241. }, {
  20242. "path": "pages/login/info",
  20243. "style": {
  20244. "navigationBarTitleText": "用户协议"
  20245. }
  20246. }, {
  20247. "path": "pages/mine/need",
  20248. "style": {
  20249. "navigationBarTitleText": "我的需求"
  20250. }
  20251. }, {
  20252. "path": "pages/mine/share",
  20253. "style": {
  20254. "navigationBarTitleText": "我的供应"
  20255. }
  20256. }, {
  20257. "path": "pages/webview/web-view",
  20258. "style": {
  20259. "navigationBarTitleText": ""
  20260. }
  20261. }, {
  20262. "path": "pages/mine/coll",
  20263. "style": {
  20264. "navigationBarTitleText": "我的收藏"
  20265. }
  20266. }, {
  20267. "path": "pages/comm/search",
  20268. "style": {
  20269. "navigationBarTitleText": "搜索"
  20270. }
  20271. }, {
  20272. "path": "pages/mine/feedback",
  20273. "style": {
  20274. "navigationBarTitleText": "问题反馈",
  20275. "enablePullDownRefresh": true
  20276. }
  20277. }, {
  20278. "path": "pages/mine/addFeed",
  20279. "style": {
  20280. "navigationBarTitleText": "问题反馈"
  20281. }
  20282. }, {
  20283. "path": "pages/mine/about",
  20284. "style": {
  20285. "navigationBarTitleText": "了解速立保"
  20286. }
  20287. }, {
  20288. "path": "pages/comm/search2",
  20289. "style": {
  20290. "navigationBarTitleText": "搜索"
  20291. }
  20292. }, {
  20293. "path": "pages/index/detail/detail",
  20294. "style": {
  20295. "navigationBarTitleText": "详情"
  20296. }
  20297. }, {
  20298. "path": "pages/login/loginByCode",
  20299. "style": {
  20300. "navigationBarTitleText": "账号登录"
  20301. }
  20302. }, {
  20303. "path": "pages/home/home",
  20304. "style": {
  20305. "navigationBarTitleText": "我要什么"
  20306. }
  20307. }, {
  20308. "path": "pages/mine/mine",
  20309. "style": {
  20310. "navigationBarTitleText": "我的"
  20311. }
  20312. }, {
  20313. "path": "pages/comm/comm",
  20314. "style": {
  20315. "navigationBarTitleText": "我有什么"
  20316. }
  20317. }],
  20318. "subPackages": [{
  20319. "root": "homePages",
  20320. "pages": []
  20321. }, {
  20322. "root": "circlePages",
  20323. "pages": [{
  20324. "path": "circle",
  20325. "style": {
  20326. "navigationBarTitleText": "晒帖子",
  20327. "enablePullDownRefresh": false
  20328. }
  20329. }, {
  20330. "path": "addShare",
  20331. "style": {
  20332. "navigationBarTitleText": "发布供应"
  20333. }
  20334. }]
  20335. }, {
  20336. "root": "minePages",
  20337. "pages": [{
  20338. "path": "set",
  20339. "style": {
  20340. "navigationBarTitleText": "设置",
  20341. "enablePullDownRefresh": false
  20342. }
  20343. }]
  20344. }],
  20345. "tabBar": {
  20346. "color": "#868585",
  20347. "selectedColor": "#005DA6",
  20348. "list": [{
  20349. "pagePath": "pages/index/index",
  20350. "text": "供需发布平台",
  20351. "iconPath": "static/ui/home.png",
  20352. "selectedIconPath": "static/ui/home1.png"
  20353. }, {
  20354. "pagePath": "pages/home/home",
  20355. "text": "我要什么",
  20356. "iconPath": "static/ui/need.png",
  20357. "selectedIconPath": "static/ui/need1.png"
  20358. }, {
  20359. "pagePath": "pages/comm/comm",
  20360. "text": "我有什么",
  20361. "iconPath": "static/ui/share.png",
  20362. "selectedIconPath": "static/ui/share1.png"
  20363. }, {
  20364. "pagePath": "pages/mine/mine",
  20365. "text": "我的",
  20366. "iconPath": "static/ui/me.png",
  20367. "selectedIconPath": "static/ui/me1.png"
  20368. }]
  20369. },
  20370. "globalStyle": {
  20371. "navigationStyle": "custom",
  20372. "navigationBarTextStyle": "black",
  20373. "navigationBarTitleText": "速立保",
  20374. "navigationBarBackgroundColor": "#fff",
  20375. "backgroundColor": "#F8F8F8"
  20376. }
  20377. };
  20378. exports.default = _default;
  20379. /***/ }),
  20380. /***/ 359:
  20381. /*!*****************************************************!*\
  20382. !*** E:/盈通/sulibao-mini/pages.json?{"type":"stat"} ***!
  20383. \*****************************************************/
  20384. /*! no static exports found */
  20385. /***/ (function(module, exports, __webpack_require__) {
  20386. "use strict";
  20387. Object.defineProperty(exports, "__esModule", {
  20388. value: true
  20389. });
  20390. exports.default = void 0;
  20391. var _default = {
  20392. "appid": "__UNI__1EF8770"
  20393. };
  20394. exports.default = _default;
  20395. /***/ }),
  20396. /***/ 36:
  20397. /*!**********************************************************************************************************!*\
  20398. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  20399. \**********************************************************************************************************/
  20400. /*! exports provided: default */
  20401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20402. "use strict";
  20403. __webpack_require__.r(__webpack_exports__);
  20404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  20405. /* globals __VUE_SSR_CONTEXT__ */
  20406. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  20407. // This module is a runtime utility for cleaner component module output and will
  20408. // be included in the final webpack user bundle.
  20409. function normalizeComponent (
  20410. scriptExports,
  20411. render,
  20412. staticRenderFns,
  20413. functionalTemplate,
  20414. injectStyles,
  20415. scopeId,
  20416. moduleIdentifier, /* server only */
  20417. shadowMode, /* vue-cli only */
  20418. components, // fixed by xxxxxx auto components
  20419. renderjs // fixed by xxxxxx renderjs
  20420. ) {
  20421. // Vue.extend constructor export interop
  20422. var options = typeof scriptExports === 'function'
  20423. ? scriptExports.options
  20424. : scriptExports
  20425. // fixed by xxxxxx auto components
  20426. if (components) {
  20427. if (!options.components) {
  20428. options.components = {}
  20429. }
  20430. var hasOwn = Object.prototype.hasOwnProperty
  20431. for (var name in components) {
  20432. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  20433. options.components[name] = components[name]
  20434. }
  20435. }
  20436. }
  20437. // fixed by xxxxxx renderjs
  20438. if (renderjs) {
  20439. if(typeof renderjs.beforeCreate === 'function'){
  20440. renderjs.beforeCreate = [renderjs.beforeCreate]
  20441. }
  20442. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  20443. this[renderjs.__module] = this
  20444. });
  20445. (options.mixins || (options.mixins = [])).push(renderjs)
  20446. }
  20447. // render functions
  20448. if (render) {
  20449. options.render = render
  20450. options.staticRenderFns = staticRenderFns
  20451. options._compiled = true
  20452. }
  20453. // functional template
  20454. if (functionalTemplate) {
  20455. options.functional = true
  20456. }
  20457. // scopedId
  20458. if (scopeId) {
  20459. options._scopeId = 'data-v-' + scopeId
  20460. }
  20461. var hook
  20462. if (moduleIdentifier) { // server build
  20463. hook = function (context) {
  20464. // 2.3 injection
  20465. context =
  20466. context || // cached call
  20467. (this.$vnode && this.$vnode.ssrContext) || // stateful
  20468. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  20469. // 2.2 with runInNewContext: true
  20470. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  20471. context = __VUE_SSR_CONTEXT__
  20472. }
  20473. // inject component styles
  20474. if (injectStyles) {
  20475. injectStyles.call(this, context)
  20476. }
  20477. // register component module identifier for async chunk inferrence
  20478. if (context && context._registeredComponents) {
  20479. context._registeredComponents.add(moduleIdentifier)
  20480. }
  20481. }
  20482. // used by ssr in case component is cached and beforeCreate
  20483. // never gets called
  20484. options._ssrRegister = hook
  20485. } else if (injectStyles) {
  20486. hook = shadowMode
  20487. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  20488. : injectStyles
  20489. }
  20490. if (hook) {
  20491. if (options.functional) {
  20492. // for template-only hot-reload because in that case the render fn doesn't
  20493. // go through the normalizer
  20494. options._injectStyles = hook
  20495. // register for functioal component in vue file
  20496. var originalRender = options.render
  20497. options.render = function renderWithStyleInjection (h, context) {
  20498. hook.call(context)
  20499. return originalRender(h, context)
  20500. }
  20501. } else {
  20502. // inject component registration as beforeCreate hook
  20503. var existing = options.beforeCreate
  20504. options.beforeCreate = existing
  20505. ? [].concat(existing, hook)
  20506. : [hook]
  20507. }
  20508. }
  20509. return {
  20510. exports: scriptExports,
  20511. options: options
  20512. }
  20513. }
  20514. /***/ }),
  20515. /***/ 367:
  20516. /*!***********************************************************************************************************!*\
  20517. !*** E:/盈通/sulibao-mini/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  20518. \***********************************************************************************************************/
  20519. /*! no static exports found */
  20520. /***/ (function(module, exports, __webpack_require__) {
  20521. "use strict";
  20522. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  20523. Object.defineProperty(exports, "__esModule", {
  20524. value: true
  20525. });
  20526. exports.chooseAndUploadFile = chooseAndUploadFile;
  20527. exports.uploadCloudFiles = uploadCloudFiles;
  20528. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  20529. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  20530. function chooseImage(opts) {
  20531. var count = opts.count,
  20532. _opts$sizeType = opts.sizeType,
  20533. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  20534. sourceType = opts.sourceType,
  20535. extension = opts.extension;
  20536. return new Promise(function (resolve, reject) {
  20537. // 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口
  20538. uni.chooseMedia({
  20539. count: count,
  20540. sizeType: sizeType,
  20541. sourceType: sourceType,
  20542. mediaType: ['image'],
  20543. extension: extension,
  20544. success: function success(res) {
  20545. res.tempFiles.forEach(function (item) {
  20546. item.path = item.tempFilePath;
  20547. });
  20548. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  20549. },
  20550. fail: function fail(res) {
  20551. reject({
  20552. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  20553. });
  20554. }
  20555. });
  20556. });
  20557. }
  20558. function chooseVideo(opts) {
  20559. var count = opts.count,
  20560. camera = opts.camera,
  20561. compressed = opts.compressed,
  20562. maxDuration = opts.maxDuration,
  20563. sourceType = opts.sourceType,
  20564. extension = opts.extension;
  20565. return new Promise(function (resolve, reject) {
  20566. // 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口
  20567. uni.chooseMedia({
  20568. count: count,
  20569. compressed: compressed,
  20570. maxDuration: maxDuration,
  20571. sourceType: sourceType,
  20572. extension: extension,
  20573. mediaType: ['video'],
  20574. success: function success(res) {
  20575. var tempFiles = res.tempFiles;
  20576. resolve(normalizeChooseAndUploadFileRes({
  20577. errMsg: 'chooseVideo:ok',
  20578. tempFiles: tempFiles.map(function (item) {
  20579. return {
  20580. name: item.name || '',
  20581. path: item.tempFilePath,
  20582. thumbTempFilePath: item.thumbTempFilePath,
  20583. size: item.size,
  20584. type: res.tempFile && res.tempFile.type || '',
  20585. width: item.width,
  20586. height: item.height,
  20587. duration: item.duration,
  20588. fileType: 'video',
  20589. cloudPath: ''
  20590. };
  20591. })
  20592. }, 'video'));
  20593. },
  20594. fail: function fail(res) {
  20595. reject({
  20596. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  20597. });
  20598. }
  20599. });
  20600. });
  20601. }
  20602. function chooseAll(opts) {
  20603. var count = opts.count,
  20604. extension = opts.extension;
  20605. return new Promise(function (resolve, reject) {
  20606. var chooseFile = uni.chooseFile;
  20607. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  20608. chooseFile = wx.chooseMessageFile;
  20609. }
  20610. if (typeof chooseFile !== 'function') {
  20611. return reject({
  20612. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  20613. });
  20614. }
  20615. chooseFile({
  20616. type: 'all',
  20617. count: count,
  20618. extension: extension,
  20619. success: function success(res) {
  20620. resolve(normalizeChooseAndUploadFileRes(res));
  20621. },
  20622. fail: function fail(res) {
  20623. reject({
  20624. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  20625. });
  20626. }
  20627. });
  20628. });
  20629. }
  20630. function normalizeChooseAndUploadFileRes(res, fileType) {
  20631. res.tempFiles.forEach(function (item, index) {
  20632. if (!item.name) {
  20633. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  20634. }
  20635. if (fileType) {
  20636. item.fileType = fileType;
  20637. }
  20638. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  20639. });
  20640. if (!res.tempFilePaths) {
  20641. res.tempFilePaths = res.tempFiles.map(function (file) {
  20642. return file.path;
  20643. });
  20644. }
  20645. return res;
  20646. }
  20647. function uploadCloudFiles(files) {
  20648. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  20649. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  20650. files = JSON.parse(JSON.stringify(files));
  20651. var len = files.length;
  20652. var count = 0;
  20653. var self = this;
  20654. return new Promise(function (resolve) {
  20655. while (count < max) {
  20656. next();
  20657. }
  20658. function next() {
  20659. var cur = count++;
  20660. if (cur >= len) {
  20661. !files.find(function (item) {
  20662. return !item.url && !item.errMsg;
  20663. }) && resolve(files);
  20664. return;
  20665. }
  20666. var fileItem = files[cur];
  20667. var index = self.files.findIndex(function (v) {
  20668. return v.uuid === fileItem.uuid;
  20669. });
  20670. fileItem.url = '';
  20671. delete fileItem.errMsg;
  20672. uniCloud.uploadFile({
  20673. filePath: fileItem.path,
  20674. cloudPath: fileItem.cloudPath,
  20675. fileType: fileItem.fileType,
  20676. onUploadProgress: function onUploadProgress(res) {
  20677. res.index = index;
  20678. _onUploadProgress && _onUploadProgress(res);
  20679. }
  20680. }).then(function (res) {
  20681. fileItem.url = res.fileID;
  20682. fileItem.index = index;
  20683. if (cur < len) {
  20684. next();
  20685. }
  20686. }).catch(function (res) {
  20687. fileItem.errMsg = res.errMsg || res.message;
  20688. fileItem.index = index;
  20689. if (cur < len) {
  20690. next();
  20691. }
  20692. });
  20693. }
  20694. });
  20695. }
  20696. function uploadFiles(choosePromise, _ref) {
  20697. var onChooseFile = _ref.onChooseFile,
  20698. onUploadProgress = _ref.onUploadProgress;
  20699. return choosePromise.then(function (res) {
  20700. if (onChooseFile) {
  20701. var customChooseRes = onChooseFile(res);
  20702. if (typeof customChooseRes !== 'undefined') {
  20703. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  20704. return typeof chooseRes === 'undefined' ? res : chooseRes;
  20705. });
  20706. }
  20707. }
  20708. return res;
  20709. }).then(function (res) {
  20710. if (res === false) {
  20711. return {
  20712. errMsg: ERR_MSG_OK,
  20713. tempFilePaths: [],
  20714. tempFiles: []
  20715. };
  20716. }
  20717. return res;
  20718. });
  20719. }
  20720. function chooseAndUploadFile() {
  20721. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  20722. type: 'all'
  20723. };
  20724. if (opts.type === 'image') {
  20725. return uploadFiles(chooseImage(opts), opts);
  20726. } else if (opts.type === 'video') {
  20727. return uploadFiles(chooseVideo(opts), opts);
  20728. }
  20729. return uploadFiles(chooseAll(opts), opts);
  20730. }
  20731. /* 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 */ 351)["default"]))
  20732. /***/ }),
  20733. /***/ 368:
  20734. /*!******************************************************************************************!*\
  20735. !*** E:/盈通/sulibao-mini/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  20736. \******************************************************************************************/
  20737. /*! no static exports found */
  20738. /***/ (function(module, exports, __webpack_require__) {
  20739. "use strict";
  20740. /* WEBPACK VAR INJECTION */(function(uni) {
  20741. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20742. Object.defineProperty(exports, "__esModule", {
  20743. value: true
  20744. });
  20745. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  20746. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 63));
  20747. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65));
  20748. /**
  20749. * 获取文件名和后缀
  20750. * @param {String} name
  20751. */
  20752. var get_file_ext = function get_file_ext(name) {
  20753. var last_len = name.lastIndexOf('.');
  20754. var len = name.length;
  20755. return {
  20756. name: name.substring(0, last_len),
  20757. ext: name.substring(last_len + 1, len)
  20758. };
  20759. };
  20760. /**
  20761. * 获取扩展名
  20762. * @param {Array} fileExtname
  20763. */
  20764. exports.get_file_ext = get_file_ext;
  20765. var get_extname = function get_extname(fileExtname) {
  20766. if (!Array.isArray(fileExtname)) {
  20767. var extname = fileExtname.replace(/(\[|\])/g, '');
  20768. return extname.split(',');
  20769. } else {
  20770. return fileExtname;
  20771. }
  20772. return [];
  20773. };
  20774. /**
  20775. * 获取文件和检测是否可选
  20776. */
  20777. exports.get_extname = get_extname;
  20778. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  20779. var filePaths = [];
  20780. var files = [];
  20781. if (!_extname || _extname.length === 0) {
  20782. return {
  20783. filePaths: filePaths,
  20784. files: files
  20785. };
  20786. }
  20787. res.tempFiles.forEach(function (v) {
  20788. var fileFullName = get_file_ext(v.name);
  20789. var extname = fileFullName.ext.toLowerCase();
  20790. if (_extname.indexOf(extname) !== -1) {
  20791. files.push(v);
  20792. filePaths.push(v.path);
  20793. }
  20794. });
  20795. if (files.length !== res.tempFiles.length) {
  20796. uni.showToast({
  20797. 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"),
  20798. icon: 'none',
  20799. duration: 5000
  20800. });
  20801. }
  20802. return {
  20803. filePaths: filePaths,
  20804. files: files
  20805. };
  20806. };
  20807. /**
  20808. * 获取图片信息
  20809. * @param {Object} filepath
  20810. */
  20811. exports.get_files_and_is_max = get_files_and_is_max;
  20812. var get_file_info = function get_file_info(filepath) {
  20813. return new Promise(function (resolve, reject) {
  20814. uni.getImageInfo({
  20815. src: filepath,
  20816. success: function success(res) {
  20817. resolve(res);
  20818. },
  20819. fail: function fail(err) {
  20820. reject(err);
  20821. }
  20822. });
  20823. });
  20824. };
  20825. /**
  20826. * 获取封装数据
  20827. */
  20828. exports.get_file_info = get_file_info;
  20829. var get_file_data = /*#__PURE__*/function () {
  20830. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  20831. var type,
  20832. fileFullName,
  20833. extname,
  20834. filedata,
  20835. imageinfo,
  20836. _args = arguments;
  20837. return _regenerator.default.wrap(function _callee$(_context) {
  20838. while (1) {
  20839. switch (_context.prev = _context.next) {
  20840. case 0:
  20841. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  20842. // 最终需要上传数据库的数据
  20843. fileFullName = get_file_ext(files.name);
  20844. extname = fileFullName.ext.toLowerCase();
  20845. filedata = {
  20846. name: files.name,
  20847. uuid: files.uuid,
  20848. extname: extname || '',
  20849. cloudPath: files.cloudPath,
  20850. fileType: files.fileType,
  20851. thumbTempFilePath: files.thumbTempFilePath,
  20852. url: files.path || files.path,
  20853. size: files.size,
  20854. //单位是字节
  20855. image: {},
  20856. path: files.path,
  20857. video: {}
  20858. };
  20859. if (!(type === 'image')) {
  20860. _context.next = 14;
  20861. break;
  20862. }
  20863. _context.next = 7;
  20864. return get_file_info(files.path);
  20865. case 7:
  20866. imageinfo = _context.sent;
  20867. delete filedata.video;
  20868. filedata.image.width = imageinfo.width;
  20869. filedata.image.height = imageinfo.height;
  20870. filedata.image.location = imageinfo.path;
  20871. _context.next = 15;
  20872. break;
  20873. case 14:
  20874. delete filedata.image;
  20875. case 15:
  20876. return _context.abrupt("return", filedata);
  20877. case 16:
  20878. case "end":
  20879. return _context.stop();
  20880. }
  20881. }
  20882. }, _callee);
  20883. }));
  20884. return function get_file_data(_x) {
  20885. return _ref.apply(this, arguments);
  20886. };
  20887. }();
  20888. exports.get_file_data = get_file_data;
  20889. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20890. /***/ }),
  20891. /***/ 37:
  20892. /*!*********************************************!*\
  20893. !*** E:/盈通/sulibao-mini/tuniao-ui/index.js ***!
  20894. \*********************************************/
  20895. /*! no static exports found */
  20896. /***/ (function(module, exports, __webpack_require__) {
  20897. "use strict";
  20898. /* WEBPACK VAR INJECTION */(function(uni) {
  20899. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20900. Object.defineProperty(exports, "__esModule", {
  20901. value: true
  20902. });
  20903. exports.default = void 0;
  20904. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 38));
  20905. var _updateCustomBarInfo = _interopRequireDefault(__webpack_require__(/*! ./libs/function/updateCustomBarInfo.js */ 33));
  20906. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 39));
  20907. var _message = _interopRequireDefault(__webpack_require__(/*! ./libs/function/message.js */ 40));
  20908. var _uuid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/uuid.js */ 41));
  20909. var _array = _interopRequireDefault(__webpack_require__(/*! ./libs/function/array.js */ 42));
  20910. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 43));
  20911. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 44));
  20912. var _string = _interopRequireDefault(__webpack_require__(/*! ./libs/function/string.js */ 45));
  20913. var _number = _interopRequireDefault(__webpack_require__(/*! ./libs/function/number.js */ 46));
  20914. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 47));
  20915. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 48));
  20916. var _color2 = _interopRequireDefault(__webpack_require__(/*! ./libs/config/color.js */ 49));
  20917. // 引入全局mixin
  20918. // 调试输出信息
  20919. function wranning(str) {
  20920. // 开发环境进行信息输出,主要是一些报错信息
  20921. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  20922. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  20923. if (true) {
  20924. console.warn(str);
  20925. }
  20926. }
  20927. // 更新自定义状态栏的信息
  20928. var $t = {
  20929. updateCustomBar: _updateCustomBarInfo.default,
  20930. color: _color.default,
  20931. message: _message.default,
  20932. uuid: _uuid.default,
  20933. array: _array.default,
  20934. test: _test.default,
  20935. $parent: _$parent.default,
  20936. string: _string.default,
  20937. number: _number.default,
  20938. deepClone: _deepClone.default,
  20939. zIndex: _zIndex.default,
  20940. colorInfo: _color2.default
  20941. };
  20942. // 挂载到uni对象上
  20943. uni.$t = $t;
  20944. var install = function install(Vue) {
  20945. // 全局混入
  20946. Vue.mixin(_mixin.default);
  20947. // Filter格式化
  20948. Vue.prototype.$t = $t;
  20949. };
  20950. var _default = {
  20951. install: install
  20952. };
  20953. exports.default = _default;
  20954. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20955. /***/ }),
  20956. /***/ 38:
  20957. /*!********************************************************!*\
  20958. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/mixin/mixin.js ***!
  20959. \********************************************************/
  20960. /*! no static exports found */
  20961. /***/ (function(module, exports, __webpack_require__) {
  20962. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  20963. data: function data() {
  20964. return {};
  20965. },
  20966. onLoad: function onLoad() {
  20967. // getRect挂载再$t上,用为这个方法需要使用in(this),所以无法把它独立层一个单独的文件导出
  20968. this.$t.getRect = this._tGetRect;
  20969. },
  20970. beforeDestory: function beforeDestory() {
  20971. var _this = this;
  20972. // 判断当前页面是否存在parent和children
  20973. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  20974. if (this.parent && uni.$t.test.array(this.parent.children)) {
  20975. // 组件销毁时,移除子组件在父组件children数组中的实例
  20976. var childrenList = this.parent.children;
  20977. childrenList.map(function (child, index) {
  20978. // 如果相对,则移除
  20979. if (child === _this) {
  20980. childrenList.splice(index, 1);
  20981. }
  20982. });
  20983. }
  20984. },
  20985. methods: {
  20986. /**
  20987. * 查询节点信息
  20988. * 当前方法在支付宝小程序中无法获取组件跟接点的尺寸
  20989. * 解决办法:为组件根部再套一个没有任何作用的view元素
  20990. */
  20991. _tGetRect: function _tGetRect(selector, all) {
  20992. var _this2 = this;
  20993. return new Promise(function (resolve) {
  20994. uni.createSelectorQuery().in(_this2)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  20995. if (all && Array.isArray(rect) && rect.length) {
  20996. resolve(rect);
  20997. }
  20998. if (!all && rect) {
  20999. resolve(rect);
  21000. }
  21001. }).exec();
  21002. });
  21003. },
  21004. /**
  21005. * 获取父组件的数据
  21006. */
  21007. getParentData: function getParentData() {
  21008. var _this3 = this;
  21009. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  21010. // 避免再created中定义parent变量
  21011. if (!this.parent) this.parent = false;
  21012. // 通过获取父组件实例
  21013. // 将父组件this中对应的参数,赋值给本组件的parentData对象中对应的属性
  21014. // 头条小程序不支持通过this.parent.xxx去监听父组件参数的变化,所以需要本方法进行实现
  21015. this.parent = this.$t.$parent.call(this, parentName);
  21016. if (this.parent) {
  21017. // 遍历parentData中的属性,将parent中同名的属性赋值给parentData
  21018. Object.keys(this.parentData).map(function (key) {
  21019. _this3.parentData[key] = _this3.parent[key];
  21020. });
  21021. }
  21022. },
  21023. /**
  21024. * 阻止事件冒泡
  21025. */
  21026. preventEvent: function preventEvent(e) {
  21027. e && e.stopPropagation && e.stopPropagation();
  21028. }
  21029. }
  21030. };
  21031. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  21032. /***/ }),
  21033. /***/ 383:
  21034. /*!*********************************************************************************!*\
  21035. !*** E:/盈通/sulibao-mini/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  21036. \*********************************************************************************/
  21037. /*! no static exports found */
  21038. /***/ (function(module, exports, __webpack_require__) {
  21039. "use strict";
  21040. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21041. Object.defineProperty(exports, "__esModule", {
  21042. value: true
  21043. });
  21044. exports.default = void 0;
  21045. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 63));
  21046. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 353));
  21047. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 354));
  21048. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 355));
  21049. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65));
  21050. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  21051. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  21052. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  21053. 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); }; }
  21054. 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; } }
  21055. var pattern = {
  21056. email: /^\S+?@\S+?\.\S+?$/,
  21057. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  21058. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  21059. };
  21060. var FORMAT_MAPPING = {
  21061. "int": 'integer',
  21062. "bool": 'boolean',
  21063. "double": 'number',
  21064. "long": 'number',
  21065. "password": 'string'
  21066. // "fileurls": 'array'
  21067. };
  21068. function formatMessage(args) {
  21069. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  21070. var defaultMessage = ['label'];
  21071. defaultMessage.forEach(function (item) {
  21072. if (args[item] === undefined) {
  21073. args[item] = '';
  21074. }
  21075. });
  21076. var str = resources;
  21077. for (var key in args) {
  21078. var reg = new RegExp('{' + key + '}');
  21079. str = str.replace(reg, args[key]);
  21080. }
  21081. return str;
  21082. }
  21083. function isEmptyValue(value, type) {
  21084. if (value === undefined || value === null) {
  21085. return true;
  21086. }
  21087. if (typeof value === 'string' && !value) {
  21088. return true;
  21089. }
  21090. if (Array.isArray(value) && !value.length) {
  21091. return true;
  21092. }
  21093. if (type === 'object' && !Object.keys(value).length) {
  21094. return true;
  21095. }
  21096. return false;
  21097. }
  21098. var types = {
  21099. integer: function integer(value) {
  21100. return types.number(value) && parseInt(value, 10) === value;
  21101. },
  21102. string: function string(value) {
  21103. return typeof value === 'string';
  21104. },
  21105. number: function number(value) {
  21106. if (isNaN(value)) {
  21107. return false;
  21108. }
  21109. return typeof value === 'number';
  21110. },
  21111. "boolean": function boolean(value) {
  21112. return typeof value === 'boolean';
  21113. },
  21114. "float": function float(value) {
  21115. return types.number(value) && !types.integer(value);
  21116. },
  21117. array: function array(value) {
  21118. return Array.isArray(value);
  21119. },
  21120. object: function object(value) {
  21121. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  21122. },
  21123. date: function date(value) {
  21124. return value instanceof Date;
  21125. },
  21126. timestamp: function timestamp(value) {
  21127. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  21128. return false;
  21129. }
  21130. return true;
  21131. },
  21132. file: function file(value) {
  21133. return typeof value.url === 'string';
  21134. },
  21135. email: function email(value) {
  21136. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  21137. },
  21138. url: function url(value) {
  21139. return typeof value === 'string' && !!value.match(pattern.url);
  21140. },
  21141. pattern: function pattern(reg, value) {
  21142. try {
  21143. return new RegExp(reg).test(value);
  21144. } catch (e) {
  21145. return false;
  21146. }
  21147. },
  21148. method: function method(value) {
  21149. return typeof value === 'function';
  21150. },
  21151. idcard: function idcard(value) {
  21152. return typeof value === 'string' && !!value.match(pattern.idcard);
  21153. },
  21154. 'url-https': function urlHttps(value) {
  21155. return this.url(value) && value.startsWith('https://');
  21156. },
  21157. 'url-scheme': function urlScheme(value) {
  21158. return value.startsWith('://');
  21159. },
  21160. 'url-web': function urlWeb(value) {
  21161. return false;
  21162. }
  21163. };
  21164. var RuleValidator = /*#__PURE__*/function () {
  21165. function RuleValidator(message) {
  21166. (0, _classCallCheck2.default)(this, RuleValidator);
  21167. this._message = message;
  21168. }
  21169. (0, _createClass2.default)(RuleValidator, [{
  21170. key: "validateRule",
  21171. value: function () {
  21172. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  21173. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  21174. return _regenerator.default.wrap(function _callee$(_context) {
  21175. while (1) {
  21176. switch (_context.prev = _context.next) {
  21177. case 0:
  21178. result = null;
  21179. rules = fieldValue.rules;
  21180. hasRequired = rules.findIndex(function (item) {
  21181. return item.required;
  21182. });
  21183. if (!(hasRequired < 0)) {
  21184. _context.next = 8;
  21185. break;
  21186. }
  21187. if (!(value === null || value === undefined)) {
  21188. _context.next = 6;
  21189. break;
  21190. }
  21191. return _context.abrupt("return", result);
  21192. case 6:
  21193. if (!(typeof value === 'string' && !value.length)) {
  21194. _context.next = 8;
  21195. break;
  21196. }
  21197. return _context.abrupt("return", result);
  21198. case 8:
  21199. message = this._message;
  21200. if (!(rules === undefined)) {
  21201. _context.next = 11;
  21202. break;
  21203. }
  21204. return _context.abrupt("return", message['default']);
  21205. case 11:
  21206. i = 0;
  21207. case 12:
  21208. if (!(i < rules.length)) {
  21209. _context.next = 35;
  21210. break;
  21211. }
  21212. rule = rules[i];
  21213. vt = this._getValidateType(rule);
  21214. Object.assign(rule, {
  21215. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  21216. });
  21217. if (!RuleValidatorHelper[vt]) {
  21218. _context.next = 20;
  21219. break;
  21220. }
  21221. result = RuleValidatorHelper[vt](rule, value, message);
  21222. if (!(result != null)) {
  21223. _context.next = 20;
  21224. break;
  21225. }
  21226. return _context.abrupt("break", 35);
  21227. case 20:
  21228. if (!rule.validateExpr) {
  21229. _context.next = 26;
  21230. break;
  21231. }
  21232. now = Date.now();
  21233. resultExpr = rule.validateExpr(value, allData, now);
  21234. if (!(resultExpr === false)) {
  21235. _context.next = 26;
  21236. break;
  21237. }
  21238. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  21239. return _context.abrupt("break", 35);
  21240. case 26:
  21241. if (!rule.validateFunction) {
  21242. _context.next = 32;
  21243. break;
  21244. }
  21245. _context.next = 29;
  21246. return this.validateFunction(rule, value, data, allData, vt);
  21247. case 29:
  21248. result = _context.sent;
  21249. if (!(result !== null)) {
  21250. _context.next = 32;
  21251. break;
  21252. }
  21253. return _context.abrupt("break", 35);
  21254. case 32:
  21255. i++;
  21256. _context.next = 12;
  21257. break;
  21258. case 35:
  21259. if (result !== null) {
  21260. result = message.TAG + result;
  21261. }
  21262. return _context.abrupt("return", result);
  21263. case 37:
  21264. case "end":
  21265. return _context.stop();
  21266. }
  21267. }
  21268. }, _callee, this);
  21269. }));
  21270. function validateRule(_x, _x2, _x3, _x4, _x5) {
  21271. return _validateRule.apply(this, arguments);
  21272. }
  21273. return validateRule;
  21274. }()
  21275. }, {
  21276. key: "validateFunction",
  21277. value: function () {
  21278. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  21279. var result, callbackMessage, res;
  21280. return _regenerator.default.wrap(function _callee2$(_context2) {
  21281. while (1) {
  21282. switch (_context2.prev = _context2.next) {
  21283. case 0:
  21284. result = null;
  21285. _context2.prev = 1;
  21286. callbackMessage = null;
  21287. _context2.next = 5;
  21288. return rule.validateFunction(rule, value, allData || data, function (message) {
  21289. callbackMessage = message;
  21290. });
  21291. case 5:
  21292. res = _context2.sent;
  21293. if (callbackMessage || typeof res === 'string' && res || res === false) {
  21294. result = this._getMessage(rule, callbackMessage || res, vt);
  21295. }
  21296. _context2.next = 12;
  21297. break;
  21298. case 9:
  21299. _context2.prev = 9;
  21300. _context2.t0 = _context2["catch"](1);
  21301. result = this._getMessage(rule, _context2.t0.message, vt);
  21302. case 12:
  21303. return _context2.abrupt("return", result);
  21304. case 13:
  21305. case "end":
  21306. return _context2.stop();
  21307. }
  21308. }
  21309. }, _callee2, this, [[1, 9]]);
  21310. }));
  21311. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  21312. return _validateFunction.apply(this, arguments);
  21313. }
  21314. return validateFunction;
  21315. }()
  21316. }, {
  21317. key: "_getMessage",
  21318. value: function _getMessage(rule, message, vt) {
  21319. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  21320. }
  21321. }, {
  21322. key: "_getValidateType",
  21323. value: function _getValidateType(rule) {
  21324. var result = '';
  21325. if (rule.required) {
  21326. result = 'required';
  21327. } else if (rule.format) {
  21328. result = 'format';
  21329. } else if (rule.arrayType) {
  21330. result = 'arrayTypeFormat';
  21331. } else if (rule.range) {
  21332. result = 'range';
  21333. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  21334. result = 'rangeNumber';
  21335. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  21336. result = 'rangeLength';
  21337. } else if (rule.pattern) {
  21338. result = 'pattern';
  21339. } else if (rule.validateFunction) {
  21340. result = 'validateFunction';
  21341. }
  21342. return result;
  21343. }
  21344. }]);
  21345. return RuleValidator;
  21346. }();
  21347. var RuleValidatorHelper = {
  21348. required: function required(rule, value, message) {
  21349. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  21350. return formatMessage(rule, rule.errorMessage || message.required);
  21351. }
  21352. return null;
  21353. },
  21354. range: function range(rule, value, message) {
  21355. var range = rule.range,
  21356. errorMessage = rule.errorMessage;
  21357. var list = new Array(range.length);
  21358. for (var i = 0; i < range.length; i++) {
  21359. var item = range[i];
  21360. if (types.object(item) && item.value !== undefined) {
  21361. list[i] = item.value;
  21362. } else {
  21363. list[i] = item;
  21364. }
  21365. }
  21366. var result = false;
  21367. if (Array.isArray(value)) {
  21368. result = new Set(value.concat(list)).size === list.length;
  21369. } else {
  21370. if (list.indexOf(value) > -1) {
  21371. result = true;
  21372. }
  21373. }
  21374. if (!result) {
  21375. return formatMessage(rule, errorMessage || message['enum']);
  21376. }
  21377. return null;
  21378. },
  21379. rangeNumber: function rangeNumber(rule, value, message) {
  21380. if (!types.number(value)) {
  21381. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  21382. }
  21383. var minimum = rule.minimum,
  21384. maximum = rule.maximum,
  21385. exclusiveMinimum = rule.exclusiveMinimum,
  21386. exclusiveMaximum = rule.exclusiveMaximum;
  21387. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  21388. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  21389. if (minimum !== undefined && min) {
  21390. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  21391. } else if (maximum !== undefined && max) {
  21392. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  21393. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  21394. return formatMessage(rule, rule.errorMessage || message['number'].range);
  21395. }
  21396. return null;
  21397. },
  21398. rangeLength: function rangeLength(rule, value, message) {
  21399. if (!types.string(value) && !types.array(value)) {
  21400. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  21401. }
  21402. var min = rule.minLength;
  21403. var max = rule.maxLength;
  21404. var val = value.length;
  21405. if (min !== undefined && val < min) {
  21406. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  21407. } else if (max !== undefined && val > max) {
  21408. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  21409. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  21410. return formatMessage(rule, rule.errorMessage || message['length'].range);
  21411. }
  21412. return null;
  21413. },
  21414. pattern: function pattern(rule, value, message) {
  21415. if (!types['pattern'](rule.pattern, value)) {
  21416. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  21417. }
  21418. return null;
  21419. },
  21420. format: function format(rule, value, message) {
  21421. var customTypes = Object.keys(types);
  21422. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  21423. if (customTypes.indexOf(format) > -1) {
  21424. if (!types[format](value)) {
  21425. return formatMessage(rule, rule.errorMessage || message.typeError);
  21426. }
  21427. }
  21428. return null;
  21429. },
  21430. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  21431. if (!Array.isArray(value)) {
  21432. return formatMessage(rule, rule.errorMessage || message.typeError);
  21433. }
  21434. for (var i = 0; i < value.length; i++) {
  21435. var element = value[i];
  21436. var formatResult = this.format(rule, element, message);
  21437. if (formatResult !== null) {
  21438. return formatResult;
  21439. }
  21440. }
  21441. return null;
  21442. }
  21443. };
  21444. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  21445. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  21446. var _super = _createSuper(SchemaValidator);
  21447. function SchemaValidator(schema, options) {
  21448. var _this;
  21449. (0, _classCallCheck2.default)(this, SchemaValidator);
  21450. _this = _super.call(this, SchemaValidator.message);
  21451. _this._schema = schema;
  21452. _this._options = options || null;
  21453. return _this;
  21454. }
  21455. (0, _createClass2.default)(SchemaValidator, [{
  21456. key: "updateSchema",
  21457. value: function updateSchema(schema) {
  21458. this._schema = schema;
  21459. }
  21460. }, {
  21461. key: "validate",
  21462. value: function () {
  21463. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  21464. var result;
  21465. return _regenerator.default.wrap(function _callee3$(_context3) {
  21466. while (1) {
  21467. switch (_context3.prev = _context3.next) {
  21468. case 0:
  21469. result = this._checkFieldInSchema(data);
  21470. if (result) {
  21471. _context3.next = 5;
  21472. break;
  21473. }
  21474. _context3.next = 4;
  21475. return this.invokeValidate(data, false, allData);
  21476. case 4:
  21477. result = _context3.sent;
  21478. case 5:
  21479. return _context3.abrupt("return", result.length ? result[0] : null);
  21480. case 6:
  21481. case "end":
  21482. return _context3.stop();
  21483. }
  21484. }
  21485. }, _callee3, this);
  21486. }));
  21487. function validate(_x11, _x12) {
  21488. return _validate.apply(this, arguments);
  21489. }
  21490. return validate;
  21491. }()
  21492. }, {
  21493. key: "validateAll",
  21494. value: function () {
  21495. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  21496. var result;
  21497. return _regenerator.default.wrap(function _callee4$(_context4) {
  21498. while (1) {
  21499. switch (_context4.prev = _context4.next) {
  21500. case 0:
  21501. result = this._checkFieldInSchema(data);
  21502. if (result) {
  21503. _context4.next = 5;
  21504. break;
  21505. }
  21506. _context4.next = 4;
  21507. return this.invokeValidate(data, true, allData);
  21508. case 4:
  21509. result = _context4.sent;
  21510. case 5:
  21511. return _context4.abrupt("return", result);
  21512. case 6:
  21513. case "end":
  21514. return _context4.stop();
  21515. }
  21516. }
  21517. }, _callee4, this);
  21518. }));
  21519. function validateAll(_x13, _x14) {
  21520. return _validateAll.apply(this, arguments);
  21521. }
  21522. return validateAll;
  21523. }()
  21524. }, {
  21525. key: "validateUpdate",
  21526. value: function () {
  21527. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  21528. var result;
  21529. return _regenerator.default.wrap(function _callee5$(_context5) {
  21530. while (1) {
  21531. switch (_context5.prev = _context5.next) {
  21532. case 0:
  21533. result = this._checkFieldInSchema(data);
  21534. if (result) {
  21535. _context5.next = 5;
  21536. break;
  21537. }
  21538. _context5.next = 4;
  21539. return this.invokeValidateUpdate(data, false, allData);
  21540. case 4:
  21541. result = _context5.sent;
  21542. case 5:
  21543. return _context5.abrupt("return", result.length ? result[0] : null);
  21544. case 6:
  21545. case "end":
  21546. return _context5.stop();
  21547. }
  21548. }
  21549. }, _callee5, this);
  21550. }));
  21551. function validateUpdate(_x15, _x16) {
  21552. return _validateUpdate.apply(this, arguments);
  21553. }
  21554. return validateUpdate;
  21555. }()
  21556. }, {
  21557. key: "invokeValidate",
  21558. value: function () {
  21559. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  21560. var result, schema, key, value, errorMessage;
  21561. return _regenerator.default.wrap(function _callee6$(_context6) {
  21562. while (1) {
  21563. switch (_context6.prev = _context6.next) {
  21564. case 0:
  21565. result = [];
  21566. schema = this._schema;
  21567. _context6.t0 = _regenerator.default.keys(schema);
  21568. case 3:
  21569. if ((_context6.t1 = _context6.t0()).done) {
  21570. _context6.next = 15;
  21571. break;
  21572. }
  21573. key = _context6.t1.value;
  21574. value = schema[key];
  21575. _context6.next = 8;
  21576. return this.validateRule(key, value, data[key], data, allData);
  21577. case 8:
  21578. errorMessage = _context6.sent;
  21579. if (!(errorMessage != null)) {
  21580. _context6.next = 13;
  21581. break;
  21582. }
  21583. result.push({
  21584. key: key,
  21585. errorMessage: errorMessage
  21586. });
  21587. if (all) {
  21588. _context6.next = 13;
  21589. break;
  21590. }
  21591. return _context6.abrupt("break", 15);
  21592. case 13:
  21593. _context6.next = 3;
  21594. break;
  21595. case 15:
  21596. return _context6.abrupt("return", result);
  21597. case 16:
  21598. case "end":
  21599. return _context6.stop();
  21600. }
  21601. }
  21602. }, _callee6, this);
  21603. }));
  21604. function invokeValidate(_x17, _x18, _x19) {
  21605. return _invokeValidate.apply(this, arguments);
  21606. }
  21607. return invokeValidate;
  21608. }()
  21609. }, {
  21610. key: "invokeValidateUpdate",
  21611. value: function () {
  21612. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  21613. var result, key, errorMessage;
  21614. return _regenerator.default.wrap(function _callee7$(_context7) {
  21615. while (1) {
  21616. switch (_context7.prev = _context7.next) {
  21617. case 0:
  21618. result = [];
  21619. _context7.t0 = _regenerator.default.keys(data);
  21620. case 2:
  21621. if ((_context7.t1 = _context7.t0()).done) {
  21622. _context7.next = 13;
  21623. break;
  21624. }
  21625. key = _context7.t1.value;
  21626. _context7.next = 6;
  21627. return this.validateRule(key, this._schema[key], data[key], data, allData);
  21628. case 6:
  21629. errorMessage = _context7.sent;
  21630. if (!(errorMessage != null)) {
  21631. _context7.next = 11;
  21632. break;
  21633. }
  21634. result.push({
  21635. key: key,
  21636. errorMessage: errorMessage
  21637. });
  21638. if (all) {
  21639. _context7.next = 11;
  21640. break;
  21641. }
  21642. return _context7.abrupt("break", 13);
  21643. case 11:
  21644. _context7.next = 2;
  21645. break;
  21646. case 13:
  21647. return _context7.abrupt("return", result);
  21648. case 14:
  21649. case "end":
  21650. return _context7.stop();
  21651. }
  21652. }
  21653. }, _callee7, this);
  21654. }));
  21655. function invokeValidateUpdate(_x20, _x21, _x22) {
  21656. return _invokeValidateUpdate.apply(this, arguments);
  21657. }
  21658. return invokeValidateUpdate;
  21659. }()
  21660. }, {
  21661. key: "_checkFieldInSchema",
  21662. value: function _checkFieldInSchema(data) {
  21663. var keys = Object.keys(data);
  21664. var keys2 = Object.keys(this._schema);
  21665. if (new Set(keys.concat(keys2)).size === keys2.length) {
  21666. return '';
  21667. }
  21668. var noExistFields = keys.filter(function (key) {
  21669. return keys2.indexOf(key) < 0;
  21670. });
  21671. var errorMessage = formatMessage({
  21672. field: JSON.stringify(noExistFields)
  21673. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  21674. return [{
  21675. key: 'invalid',
  21676. errorMessage: errorMessage
  21677. }];
  21678. }
  21679. }]);
  21680. return SchemaValidator;
  21681. }(RuleValidator);
  21682. function Message() {
  21683. return {
  21684. TAG: "",
  21685. default: '验证错误',
  21686. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  21687. validateFunction: '验证无效',
  21688. required: '{label}必填',
  21689. 'enum': '{label}超出范围',
  21690. timestamp: '{label}格式无效',
  21691. whitespace: '{label}不能为空',
  21692. typeError: '{label}类型无效',
  21693. date: {
  21694. format: '{label}日期{value}格式无效',
  21695. parse: '{label}日期无法解析,{value}无效',
  21696. invalid: '{label}日期{value}无效'
  21697. },
  21698. length: {
  21699. minLength: '{label}长度不能少于{minLength}',
  21700. maxLength: '{label}长度不能超过{maxLength}',
  21701. range: '{label}必须介于{minLength}和{maxLength}之间'
  21702. },
  21703. number: {
  21704. minimum: '{label}不能小于{minimum}',
  21705. maximum: '{label}不能大于{maximum}',
  21706. exclusiveMinimum: '{label}不能小于等于{minimum}',
  21707. exclusiveMaximum: '{label}不能大于等于{maximum}',
  21708. range: '{label}必须介于{minimum}and{maximum}之间'
  21709. },
  21710. pattern: {
  21711. mismatch: '{label}格式不匹配'
  21712. }
  21713. };
  21714. }
  21715. SchemaValidator.message = new Message();
  21716. var _default = SchemaValidator;
  21717. exports.default = _default;
  21718. /***/ }),
  21719. /***/ 384:
  21720. /*!******************************************************************************!*\
  21721. !*** E:/盈通/sulibao-mini/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  21722. \******************************************************************************/
  21723. /*! no static exports found */
  21724. /***/ (function(module, exports, __webpack_require__) {
  21725. "use strict";
  21726. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21727. Object.defineProperty(exports, "__esModule", {
  21728. value: true
  21729. });
  21730. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  21731. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  21732. /**
  21733. * 简单处理对象拷贝
  21734. * @param {Obejct} 被拷贝对象
  21735. * @@return {Object} 拷贝对象
  21736. */
  21737. var deepCopy = function deepCopy(val) {
  21738. return JSON.parse(JSON.stringify(val));
  21739. };
  21740. /**
  21741. * 过滤数字类型
  21742. * @param {String} format 数字类型
  21743. * @@return {Boolean} 返回是否为数字类型
  21744. */
  21745. exports.deepCopy = deepCopy;
  21746. var typeFilter = function typeFilter(format) {
  21747. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  21748. };
  21749. /**
  21750. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  21751. * @param {String} key 字段名
  21752. * @param {any} value 字段值
  21753. * @param {Object} rules 表单校验规则
  21754. */
  21755. exports.typeFilter = typeFilter;
  21756. var getValue = function getValue(key, value, rules) {
  21757. var isRuleNumType = rules.find(function (val) {
  21758. return val.format && typeFilter(val.format);
  21759. });
  21760. var isRuleBoolType = rules.find(function (val) {
  21761. return val.format && val.format === 'boolean' || val.format === 'bool';
  21762. });
  21763. // 输入类型为 number
  21764. if (!!isRuleNumType) {
  21765. if (!value && value !== 0) {
  21766. value = null;
  21767. } else {
  21768. value = isNumber(Number(value)) ? Number(value) : value;
  21769. }
  21770. }
  21771. // 输入类型为 boolean
  21772. if (!!isRuleBoolType) {
  21773. value = isBoolean(value) ? value : false;
  21774. }
  21775. return value;
  21776. };
  21777. /**
  21778. * 获取表单数据
  21779. * @param {String|Array} name 真实名称,需要使用 realName 获取
  21780. * @param {Object} data 原始数据
  21781. * @param {any} value 需要设置的值
  21782. */
  21783. exports.getValue = getValue;
  21784. var setDataValue = function setDataValue(field, formdata, value) {
  21785. formdata[field] = value;
  21786. return value || '';
  21787. };
  21788. /**
  21789. * 获取表单数据
  21790. * @param {String|Array} field 真实名称,需要使用 realName 获取
  21791. * @param {Object} data 原始数据
  21792. */
  21793. exports.setDataValue = setDataValue;
  21794. var getDataValue = function getDataValue(field, data) {
  21795. return objGet(data, field);
  21796. };
  21797. /**
  21798. * 获取表单类型
  21799. * @param {String|Array} field 真实名称,需要使用 realName 获取
  21800. */
  21801. exports.getDataValue = getDataValue;
  21802. var getDataValueType = function getDataValueType(field, data) {
  21803. var value = getDataValue(field, data);
  21804. return {
  21805. type: type(value),
  21806. value: value
  21807. };
  21808. };
  21809. /**
  21810. * 获取表单可用的真实name
  21811. * @param {String|Array} name 表单name
  21812. * @@return {String} 表单可用的真实name
  21813. */
  21814. exports.getDataValueType = getDataValueType;
  21815. var realName = function realName(name) {
  21816. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21817. var base_name = _basePath(name);
  21818. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  21819. var realname = base_name.reduce(function (a, b) {
  21820. return a += "#".concat(b);
  21821. }, '_formdata_');
  21822. return realname;
  21823. }
  21824. return base_name[0] || name;
  21825. };
  21826. /**
  21827. * 判断是否表单可用的真实name
  21828. * @param {String|Array} name 表单name
  21829. * @@return {String} 表单可用的真实name
  21830. */
  21831. exports.realName = realName;
  21832. var isRealName = function isRealName(name) {
  21833. var reg = /^_formdata_#*/;
  21834. return reg.test(name);
  21835. };
  21836. /**
  21837. * 获取表单数据的原始格式
  21838. * @@return {Object|Array} object 需要解析的数据
  21839. */
  21840. exports.isRealName = isRealName;
  21841. var rawData = function rawData() {
  21842. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  21843. var name = arguments.length > 1 ? arguments[1] : undefined;
  21844. var newData = JSON.parse(JSON.stringify(object));
  21845. var formData = {};
  21846. for (var i in newData) {
  21847. var path = name2arr(i);
  21848. objSet(formData, path, newData[i]);
  21849. }
  21850. return formData;
  21851. };
  21852. /**
  21853. * 真实name还原为 array
  21854. * @param {*} name
  21855. */
  21856. exports.rawData = rawData;
  21857. var name2arr = function name2arr(name) {
  21858. var field = name.replace('_formdata_#', '');
  21859. field = field.split('#').map(function (v) {
  21860. return isNumber(v) ? Number(v) : v;
  21861. });
  21862. return field;
  21863. };
  21864. /**
  21865. * 对象中设置值
  21866. * @param {Object|Array} object 源数据
  21867. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  21868. * @param {String} value 需要设置的值
  21869. */
  21870. exports.name2arr = name2arr;
  21871. var objSet = function objSet(object, path, value) {
  21872. if ((0, _typeof2.default)(object) !== 'object') return object;
  21873. _basePath(path).reduce(function (o, k, i, _) {
  21874. if (i === _.length - 1) {
  21875. // 若遍历结束直接赋值
  21876. o[k] = value;
  21877. return null;
  21878. } else if (k in o) {
  21879. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  21880. return o[k];
  21881. } else {
  21882. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  21883. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  21884. return o[k];
  21885. }
  21886. }, object);
  21887. // 返回object
  21888. return object;
  21889. };
  21890. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  21891. exports.objSet = objSet;
  21892. function _basePath(path) {
  21893. // 若是数组,则直接返回
  21894. if (Array.isArray(path)) return path;
  21895. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  21896. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  21897. }
  21898. /**
  21899. * 从对象中获取值
  21900. * @param {Object|Array} object 源数据
  21901. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  21902. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  21903. */
  21904. var objGet = function objGet(object, path) {
  21905. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  21906. // 先将path处理成统一格式
  21907. var newPath = _basePath(path);
  21908. // 递归处理,返回最后结果
  21909. var val = newPath.reduce(function (o, k) {
  21910. return (o || {})[k];
  21911. }, object);
  21912. return !val || val !== undefined ? val : defaultVal;
  21913. };
  21914. /**
  21915. * 是否为 number 类型
  21916. * @param {any} num 需要判断的值
  21917. * @return {Boolean} 是否为 number
  21918. */
  21919. exports.objGet = objGet;
  21920. var isNumber = function isNumber(num) {
  21921. return !isNaN(Number(num));
  21922. };
  21923. /**
  21924. * 是否为 boolean 类型
  21925. * @param {any} bool 需要判断的值
  21926. * @return {Boolean} 是否为 boolean
  21927. */
  21928. exports.isNumber = isNumber;
  21929. var isBoolean = function isBoolean(bool) {
  21930. return typeof bool === 'boolean';
  21931. };
  21932. /**
  21933. * 是否有必填字段
  21934. * @param {Object} rules 规则
  21935. * @return {Boolean} 是否有必填字段
  21936. */
  21937. exports.isBoolean = isBoolean;
  21938. var isRequiredField = function isRequiredField(rules) {
  21939. var isNoField = false;
  21940. for (var i = 0; i < rules.length; i++) {
  21941. var ruleData = rules[i];
  21942. if (ruleData.required) {
  21943. isNoField = true;
  21944. break;
  21945. }
  21946. }
  21947. return isNoField;
  21948. };
  21949. /**
  21950. * 获取数据类型
  21951. * @param {Any} obj 需要获取数据类型的值
  21952. */
  21953. exports.isRequiredField = isRequiredField;
  21954. var type = function type(obj) {
  21955. var class2type = {};
  21956. // 生成class2type映射
  21957. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  21958. class2type["[object " + item + "]"] = item.toLowerCase();
  21959. });
  21960. if (obj == null) {
  21961. return obj + "";
  21962. }
  21963. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  21964. };
  21965. /**
  21966. * 判断两个值是否相等
  21967. * @param {any} a 值
  21968. * @param {any} b 值
  21969. * @return {Boolean} 是否相等
  21970. */
  21971. exports.type = type;
  21972. var isEqual = function isEqual(a, b) {
  21973. //如果a和b本来就全等
  21974. if (a === b) {
  21975. //判断是否为0和-0
  21976. return a !== 0 || 1 / a === 1 / b;
  21977. }
  21978. //判断是否为null和undefined
  21979. if (a == null || b == null) {
  21980. return a === b;
  21981. }
  21982. //接下来判断a和b的数据类型
  21983. var classNameA = toString.call(a),
  21984. classNameB = toString.call(b);
  21985. //如果数据类型不相等,则返回false
  21986. if (classNameA !== classNameB) {
  21987. return false;
  21988. }
  21989. //如果数据类型相等,再根据不同数据类型分别判断
  21990. switch (classNameA) {
  21991. case '[object RegExp]':
  21992. case '[object String]':
  21993. //进行字符串转换比较
  21994. return '' + a === '' + b;
  21995. case '[object Number]':
  21996. //进行数字转换比较,判断是否为NaN
  21997. if (+a !== +a) {
  21998. return +b !== +b;
  21999. }
  22000. //判断是否为0或-0
  22001. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  22002. case '[object Date]':
  22003. case '[object Boolean]':
  22004. return +a === +b;
  22005. }
  22006. //如果是对象类型
  22007. if (classNameA == '[object Object]') {
  22008. //获取a和b的属性长度
  22009. var propsA = Object.getOwnPropertyNames(a),
  22010. propsB = Object.getOwnPropertyNames(b);
  22011. if (propsA.length != propsB.length) {
  22012. return false;
  22013. }
  22014. for (var i = 0; i < propsA.length; i++) {
  22015. var propName = propsA[i];
  22016. //如果对应属性对应值不相等,则返回false
  22017. if (a[propName] !== b[propName]) {
  22018. return false;
  22019. }
  22020. }
  22021. return true;
  22022. }
  22023. //如果是数组类型
  22024. if (classNameA == '[object Array]') {
  22025. if (a.toString() == b.toString()) {
  22026. return true;
  22027. }
  22028. return false;
  22029. }
  22030. };
  22031. exports.isEqual = isEqual;
  22032. /***/ }),
  22033. /***/ 39:
  22034. /*!***********************************************************!*\
  22035. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/color.js ***!
  22036. \***********************************************************/
  22037. /*! no static exports found */
  22038. /***/ (function(module, exports, __webpack_require__) {
  22039. "use strict";
  22040. Object.defineProperty(exports, "__esModule", {
  22041. value: true
  22042. });
  22043. exports.default = void 0;
  22044. var color = ['red', 'purplered', 'purple', 'bluepurple', 'aquablue', 'blue', 'indigo', 'cyan', 'teal', 'green', 'yellowgreen', 'lime', 'yellow', 'orangeyellow', 'orange', 'orangered', 'brown', 'grey', 'gray'];
  22045. // 酷炫颜色的数量
  22046. var COOL_BG_COLOR_COUNT = 16;
  22047. /**
  22048. * 获取速立保配色颜色列表
  22049. */
  22050. function getTuniaoColorList() {
  22051. return color;
  22052. }
  22053. /**
  22054. * 获取指定类型的随机颜色对应的类
  22055. * @param {String} type 颜色类型
  22056. */
  22057. function getRandomColorClass() {
  22058. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bg';
  22059. var index = Math.floor(Math.random() * color.length);
  22060. var colorValue = color[index];
  22061. return 'tn-' + type + '-' + colorValue;
  22062. }
  22063. /**
  22064. * 随机获取酷炫背景对应的类
  22065. */
  22066. function getRandomCoolBgClass() {
  22067. var index = Math.random() * COOL_BG_COLOR_COUNT + 1;
  22068. return 'tn-cool-bg-color-' + Math.floor(index);
  22069. }
  22070. /**
  22071. * 根据传入的值获取内部背景颜色类
  22072. *
  22073. * @param {String} backgroundColor 背景颜色信息
  22074. */
  22075. function getBackgroundColorInternalClass() {
  22076. var backgroundColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  22077. if (!backgroundColor) return '';
  22078. if (['tn-bg', 'tn-dynamic-bg', 'tn-main-gradient', 'tn-cool-bg'].some(function (item) {
  22079. return backgroundColor.includes(item);
  22080. })) {
  22081. return backgroundColor;
  22082. }
  22083. return '';
  22084. }
  22085. /**
  22086. * 根据传入的值获取背景颜色样式
  22087. *
  22088. * @param {String} backgroundColor 背景颜色信息
  22089. */
  22090. function getBackgroundColorStyle() {
  22091. var backgroundColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  22092. if (!backgroundColor) return '';
  22093. if (!backgroundColor.startsWith('tn-') || ['#', 'rgb', 'rgba'].some(function (item) {
  22094. return backgroundColor.includes(item);
  22095. })) {
  22096. return backgroundColor;
  22097. }
  22098. return '';
  22099. }
  22100. /**
  22101. * 根据传入的值获取内部字体颜色类
  22102. *
  22103. * @param {String} fontColor 背景颜色信息
  22104. */
  22105. function getFontColorInternalClass() {
  22106. var fontColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  22107. if (!fontColor) return '';
  22108. if (['tn-color'].some(function (item) {
  22109. return fontColor.includes(item);
  22110. })) {
  22111. return fontColor;
  22112. }
  22113. return '';
  22114. }
  22115. /**
  22116. * 根据传入的值获取字体颜色样式
  22117. *
  22118. * @param {String} fontColor 背景颜色信息
  22119. */
  22120. function getFontColorStyle() {
  22121. var fontColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  22122. if (!fontColor) return '';
  22123. if (!fontColor.startsWith('tn-') || ['#', 'rgb', 'rgba'].some(function (item) {
  22124. return fontColor.includes(item);
  22125. })) {
  22126. return fontColor;
  22127. }
  22128. return '';
  22129. }
  22130. /**
  22131. * 求两个颜色之间的渐变值
  22132. *
  22133. * @param {String} startColor 开始颜色
  22134. * @param {String} endColor 结束颜色
  22135. * @param {Number} step 颜色等分的份额
  22136. */
  22137. function colorGradient() {
  22138. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  22139. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  22140. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  22141. var startRGB = hexToRGB(startColor, false);
  22142. var startR = startRGB[0];
  22143. var startG = startRGB[1];
  22144. var startB = startRGB[2];
  22145. var endRGB = hexToRGB(endColor, false);
  22146. var endR = endRGB[0];
  22147. var endG = endRGB[1];
  22148. var endB = endRGB[2];
  22149. // 求差值
  22150. var R = (endR - startR) / step;
  22151. var G = (endG - startG) / step;
  22152. var B = (endB - startB) / step;
  22153. var colorArr = [];
  22154. for (var i = 0; i < step; i++) {
  22155. // 计算每一步的hex值
  22156. var hex = rgbToHex("rgb(".concat(Math.round(R * i + startR), ", ").concat(Math.round(G * i + startG), ", ").concat(Math.round(B * i + startB), ")"));
  22157. colorArr.push(hex);
  22158. }
  22159. return colorArr;
  22160. }
  22161. /**
  22162. * 将hex的颜色表示方式转换为rgb表示方式
  22163. *
  22164. * @param {String} color 颜色
  22165. * @param {Boolean} str 是否返回字符串
  22166. * @return {Array|String} rgb的值
  22167. */
  22168. function hexToRGB(color) {
  22169. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22170. var reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
  22171. color = color.toLowerCase();
  22172. if (color && reg.test(color)) {
  22173. // #000 => #000000
  22174. if (color.length === 4) {
  22175. var colorNew = '#';
  22176. for (var i = 1; i < 4; i++) {
  22177. colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
  22178. }
  22179. color = colorNew;
  22180. }
  22181. // 处理六位的颜色值
  22182. var colorChange = [];
  22183. for (var _i = 1; _i < 7; _i += 2) {
  22184. colorChange.push(parseInt("0x" + color.slice(_i, _i + 2)));
  22185. }
  22186. if (!str) {
  22187. return colorChange;
  22188. } else {
  22189. return "rgb(".concat(colorChange[0], ", ").concat(colorChange[1], ", ").concat(colorChange[2], ")");
  22190. }
  22191. } else if (/^(rgb|RGB)/.test(color)) {
  22192. var arr = color.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(',');
  22193. return arr.map(function (item) {
  22194. return Number(item);
  22195. });
  22196. } else {
  22197. return color;
  22198. }
  22199. }
  22200. /**
  22201. * 将rgb的颜色表示方式转换成hex表示方式
  22202. *
  22203. * @param {Object} rgb rgb颜色值
  22204. */
  22205. function rgbToHex(rgb) {
  22206. var reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
  22207. if (/^(rgb|RGB)/.test(rgb)) {
  22208. var _color = rgb.replace(/(?:\(|\)|rgb|GRB)*/g, "").split(',');
  22209. var strHex = '#';
  22210. for (var i = 0; i < _color.length; i++) {
  22211. var hex = Number(_color[i]).toString(16);
  22212. // 保证每个值否是两位数
  22213. hex = String(hex).length === 1 ? 0 + '' + hex : hex;
  22214. if (hex === '0') {
  22215. hex += hex;
  22216. }
  22217. strHex += hex;
  22218. }
  22219. if (strHex.length !== 7) {
  22220. strHex = rgb;
  22221. }
  22222. return strHex;
  22223. } else if (reg.test(rgb)) {
  22224. var num = rgb.replace(/#/, '').split('');
  22225. if (num.length === 6) {
  22226. return rgb;
  22227. } else if (num.length === 3) {
  22228. var numHex = '#';
  22229. for (var _i2 = 0; _i2 < num.length; _i2++) {
  22230. numHex += num[_i2] + num[_i2];
  22231. }
  22232. return numHex;
  22233. }
  22234. } else {
  22235. return rgb;
  22236. }
  22237. }
  22238. /**
  22239. * 将传入的颜色值转换为rgba字符串
  22240. *
  22241. * @param {String} color 颜色
  22242. * @param {Number} alpha 透明度
  22243. */
  22244. function colorToRGBA(color) {
  22245. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  22246. color = rgbToHex(color);
  22247. // 十六进制颜色值的正则表达式
  22248. var reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
  22249. color = color.toLowerCase();
  22250. if (color && reg.test(color)) {
  22251. // #000 => #000000
  22252. if (color.length === 4) {
  22253. var colorNew = '#';
  22254. for (var i = 1; i < 4; i++) {
  22255. colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
  22256. }
  22257. color = colorNew;
  22258. }
  22259. // 处理六位的颜色值
  22260. var colorChange = [];
  22261. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  22262. colorChange.push(parseInt("0x" + color.slice(_i3, _i3 + 2)));
  22263. }
  22264. return "rgba(".concat(colorChange[0], ", ").concat(colorChange[1], ", ").concat(colorChange[2], ", ").concat(alpha, ")");
  22265. } else {
  22266. return color;
  22267. }
  22268. }
  22269. var _default = {
  22270. COOL_BG_COLOR_COUNT: COOL_BG_COLOR_COUNT,
  22271. getTuniaoColorList: getTuniaoColorList,
  22272. getRandomColorClass: getRandomColorClass,
  22273. getRandomCoolBgClass: getRandomCoolBgClass,
  22274. getBackgroundColorInternalClass: getBackgroundColorInternalClass,
  22275. getBackgroundColorStyle: getBackgroundColorStyle,
  22276. getFontColorInternalClass: getFontColorInternalClass,
  22277. getFontColorStyle: getFontColorStyle,
  22278. colorGradient: colorGradient,
  22279. hexToRGB: hexToRGB,
  22280. rgbToHex: rgbToHex,
  22281. colorToRGBA: colorToRGBA
  22282. };
  22283. exports.default = _default;
  22284. /***/ }),
  22285. /***/ 4:
  22286. /*!**********************************************************************!*\
  22287. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  22288. \**********************************************************************/
  22289. /*! no static exports found */
  22290. /***/ (function(module, exports) {
  22291. function _interopRequireDefault(obj) {
  22292. return obj && obj.__esModule ? obj : {
  22293. "default": obj
  22294. };
  22295. }
  22296. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22297. /***/ }),
  22298. /***/ 40:
  22299. /*!*************************************************************!*\
  22300. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/message.js ***!
  22301. \*************************************************************/
  22302. /*! no static exports found */
  22303. /***/ (function(module, exports, __webpack_require__) {
  22304. "use strict";
  22305. /* WEBPACK VAR INJECTION */(function(uni) {
  22306. Object.defineProperty(exports, "__esModule", {
  22307. value: true
  22308. });
  22309. exports.default = void 0;
  22310. /**
  22311. * 弹出系统内置的toast
  22312. */
  22313. function toast(title) {
  22314. var mask = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22315. var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22316. var icon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'none';
  22317. var duration = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1500;
  22318. uni.showToast({
  22319. title: title,
  22320. icon: icon,
  22321. mask: mask,
  22322. duration: duration,
  22323. success: function success() {
  22324. setTimeout(function () {
  22325. cb && cb();
  22326. }, duration);
  22327. }
  22328. });
  22329. }
  22330. /**
  22331. * 弹出内置的加载框
  22332. */
  22333. function loading(title) {
  22334. uni.showLoading({
  22335. title: title,
  22336. mask: true
  22337. });
  22338. }
  22339. /**
  22340. * 弹出系统内置的modal
  22341. */
  22342. function modal(title, content, confirmCb) {
  22343. var showCancel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  22344. var cancelCb = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  22345. var confirmText = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "确定";
  22346. var cancelText = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "取消";
  22347. uni.showModal({
  22348. title: title,
  22349. content: content,
  22350. showCancel: showCancel,
  22351. cancelText: cancelText,
  22352. confirmText: confirmText,
  22353. success: function success(res) {
  22354. if (res.cancel) {
  22355. cancelCb && cancelCb();
  22356. } else if (res.confirm) {
  22357. confirmCb && confirmCb();
  22358. }
  22359. }
  22360. });
  22361. }
  22362. /**
  22363. * 关闭系统内置toast
  22364. */
  22365. function closeToast() {
  22366. uni.hideToast();
  22367. }
  22368. /**
  22369. * 关闭系统内置的加载框
  22370. */
  22371. function closeLoading() {
  22372. uni.hideLoading();
  22373. }
  22374. var _default = {
  22375. toast: toast,
  22376. loading: loading,
  22377. modal: modal,
  22378. closeToast: closeToast,
  22379. closeLoading: closeLoading
  22380. };
  22381. exports.default = _default;
  22382. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  22383. /***/ }),
  22384. /***/ 41:
  22385. /*!**********************************************************!*\
  22386. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/uuid.js ***!
  22387. \**********************************************************/
  22388. /*! no static exports found */
  22389. /***/ (function(module, exports, __webpack_require__) {
  22390. "use strict";
  22391. Object.defineProperty(exports, "__esModule", {
  22392. value: true
  22393. });
  22394. exports.default = void 0;
  22395. /**
  22396. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  22397. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  22398. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  22399. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  22400. * v-for的时候,推荐使用后端返回的id而不是循环的index
  22401. * @param {Number} len uuid的长度
  22402. * @param {Boolean} firstT 将返回的首字母置为"t"
  22403. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  22404. */
  22405. function uuid() {
  22406. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  22407. var firstT = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22408. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22409. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  22410. var uuid = [];
  22411. radix = radix || chars.length;
  22412. if (len) {
  22413. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  22414. for (var i = 0; i < len; i++) {
  22415. uuid[i] = chars[0 | Math.random() * radix];
  22416. }
  22417. } else {
  22418. var r;
  22419. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  22420. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  22421. uuid[14] = '4';
  22422. for (var _i = 0; _i < 36; _i++) {
  22423. if (!uuid[_i]) {
  22424. r = 0 | Math.random() * 16;
  22425. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  22426. }
  22427. }
  22428. }
  22429. // 移除第一个字符,并用t替代,因为第一个字符为数值时,该uuid不能用作id或者class
  22430. if (firstT) {
  22431. uuid.shift();
  22432. return 't' + uuid.join('');
  22433. } else {
  22434. return uuid.join('');
  22435. }
  22436. }
  22437. var _default = uuid;
  22438. exports.default = _default;
  22439. /***/ }),
  22440. /***/ 42:
  22441. /*!***********************************************************!*\
  22442. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/array.js ***!
  22443. \***********************************************************/
  22444. /*! no static exports found */
  22445. /***/ (function(module, exports, __webpack_require__) {
  22446. "use strict";
  22447. Object.defineProperty(exports, "__esModule", {
  22448. value: true
  22449. });
  22450. exports.default = void 0;
  22451. /**
  22452. * 打乱传入的数组
  22453. *
  22454. * @param {Array} array 待打乱的数组
  22455. */
  22456. function random() {
  22457. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  22458. return array.sort(function () {
  22459. return Math.random() - 0.5;
  22460. });
  22461. }
  22462. /**
  22463. * 判断是否为数组
  22464. *
  22465. * @param {Object} arr
  22466. */
  22467. function isArray(arr) {
  22468. return Object.prototype.toString.call(arr) === '[object Array]';
  22469. }
  22470. var _default = {
  22471. random: random,
  22472. isArray: isArray
  22473. };
  22474. exports.default = _default;
  22475. /***/ }),
  22476. /***/ 43:
  22477. /*!**********************************************************!*\
  22478. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/test.js ***!
  22479. \**********************************************************/
  22480. /*! no static exports found */
  22481. /***/ (function(module, exports, __webpack_require__) {
  22482. "use strict";
  22483. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22484. Object.defineProperty(exports, "__esModule", {
  22485. value: true
  22486. });
  22487. exports.default = void 0;
  22488. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  22489. /**
  22490. * 验证电子邮箱格式
  22491. */
  22492. function email(value) {
  22493. return /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(value);
  22494. }
  22495. /**
  22496. * 验证手机格式
  22497. */
  22498. function mobile(value) {
  22499. return /^1[3-9]\d{9}$/.test(value);
  22500. }
  22501. /**
  22502. * 验证URL格式
  22503. */
  22504. function url(value) {
  22505. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  22506. }
  22507. /**
  22508. * 验证日期格式
  22509. */
  22510. function date(value) {
  22511. return !/Invalid|NaN/.test(new Date(value).toString());
  22512. }
  22513. /**
  22514. * 验证ISO类型的日期格式
  22515. */
  22516. function dateISO(value) {
  22517. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  22518. }
  22519. /**
  22520. * 验证十进制数字
  22521. */
  22522. function number(value) {
  22523. return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value);
  22524. }
  22525. /**
  22526. * 验证整数
  22527. */
  22528. function digits(value) {
  22529. return /^\d+$/.test(value);
  22530. }
  22531. /**
  22532. * 验证身份证号码
  22533. */
  22534. function idCard(value) {
  22535. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value);
  22536. }
  22537. /**
  22538. * 是否车牌号
  22539. */
  22540. function carNo(value) {
  22541. // 新能源车牌
  22542. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  22543. // 旧车牌
  22544. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  22545. if (value.length === 7) {
  22546. return creg.test(value);
  22547. } else if (value.length === 8) {
  22548. return xreg.test(value);
  22549. } else {
  22550. return false;
  22551. }
  22552. }
  22553. /**
  22554. * 金额,只允许2位小数
  22555. */
  22556. function amount(value) {
  22557. //金额,只允许保留两位小数
  22558. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  22559. }
  22560. /**
  22561. * 中文
  22562. */
  22563. function chinese(value) {
  22564. var reg = /^[\u4e00-\u9fa5]+$/gi;
  22565. return reg.test(value);
  22566. }
  22567. /**
  22568. * 只能输入字母
  22569. */
  22570. function letter(value) {
  22571. return /^[a-zA-Z]*$/.test(value);
  22572. }
  22573. /**
  22574. * 只能是字母或者数字
  22575. */
  22576. function enOrNum(value) {
  22577. //英文或者数字
  22578. var reg = /^[0-9a-zA-Z]*$/g;
  22579. return reg.test(value);
  22580. }
  22581. /**
  22582. * 验证是否包含某个值
  22583. */
  22584. function contains(value, param) {
  22585. return value.indexOf(param) >= 0;
  22586. }
  22587. /**
  22588. * 验证一个值范围[min, max]
  22589. */
  22590. function range(value, param) {
  22591. return value >= param[0] && value <= param[1];
  22592. }
  22593. /**
  22594. * 验证一个长度范围[min, max]
  22595. */
  22596. function rangeLength(value, param) {
  22597. return value.length >= param[0] && value.length <= param[1];
  22598. }
  22599. /**
  22600. * 是否固定电话
  22601. */
  22602. function landline(value) {
  22603. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  22604. return reg.test(value);
  22605. }
  22606. /**
  22607. * 判断是否为空
  22608. */
  22609. function empty(value) {
  22610. switch ((0, _typeof2.default)(value)) {
  22611. case 'undefined':
  22612. return true;
  22613. case 'string':
  22614. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  22615. break;
  22616. case 'boolean':
  22617. if (!value) return true;
  22618. break;
  22619. case 'number':
  22620. if (0 === value || isNaN(value)) return true;
  22621. break;
  22622. case 'object':
  22623. if (null === value || value.length === 0) return true;
  22624. for (var i in value) {
  22625. return false;
  22626. }
  22627. return true;
  22628. }
  22629. return false;
  22630. }
  22631. /**
  22632. * 是否json字符串
  22633. */
  22634. function jsonString(value) {
  22635. if (typeof value == 'string') {
  22636. try {
  22637. var obj = JSON.parse(value);
  22638. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  22639. return true;
  22640. } else {
  22641. return false;
  22642. }
  22643. } catch (e) {
  22644. return false;
  22645. }
  22646. }
  22647. return false;
  22648. }
  22649. /**
  22650. * 是否数组
  22651. */
  22652. function array(value) {
  22653. if (typeof Array.isArray === "function") {
  22654. return Array.isArray(value);
  22655. } else {
  22656. return Object.prototype.toString.call(value) === "[object Array]";
  22657. }
  22658. }
  22659. /**
  22660. * 是否对象
  22661. */
  22662. function object(value) {
  22663. return Object.prototype.toString.call(value) === '[object Object]';
  22664. }
  22665. /**
  22666. * 是否短信验证码
  22667. */
  22668. function code(value) {
  22669. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  22670. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  22671. }
  22672. var _default = {
  22673. email: email,
  22674. mobile: mobile,
  22675. url: url,
  22676. date: date,
  22677. dateISO: dateISO,
  22678. number: number,
  22679. digits: digits,
  22680. idCard: idCard,
  22681. carNo: carNo,
  22682. amount: amount,
  22683. chinese: chinese,
  22684. letter: letter,
  22685. enOrNum: enOrNum,
  22686. contains: contains,
  22687. range: range,
  22688. rangeLength: rangeLength,
  22689. empty: empty,
  22690. isEmpty: empty,
  22691. jsonString: jsonString,
  22692. landline: landline,
  22693. object: object,
  22694. array: array,
  22695. code: code
  22696. };
  22697. exports.default = _default;
  22698. /***/ }),
  22699. /***/ 434:
  22700. /*!******************************************************************************************!*\
  22701. !*** E:/盈通/sulibao-mini/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js ***!
  22702. \******************************************************************************************/
  22703. /*! no static exports found */
  22704. /***/ (function(module, exports, __webpack_require__) {
  22705. "use strict";
  22706. Object.defineProperty(exports, "__esModule", {
  22707. value: true
  22708. });
  22709. exports.fontData = void 0;
  22710. var fontData = [{
  22711. "font_class": "arrow-down",
  22712. "unicode": "\uE6BE"
  22713. }, {
  22714. "font_class": "arrow-left",
  22715. "unicode": "\uE6BC"
  22716. }, {
  22717. "font_class": "arrow-right",
  22718. "unicode": "\uE6BB"
  22719. }, {
  22720. "font_class": "arrow-up",
  22721. "unicode": "\uE6BD"
  22722. }, {
  22723. "font_class": "auth",
  22724. "unicode": "\uE6AB"
  22725. }, {
  22726. "font_class": "auth-filled",
  22727. "unicode": "\uE6CC"
  22728. }, {
  22729. "font_class": "back",
  22730. "unicode": "\uE6B9"
  22731. }, {
  22732. "font_class": "bars",
  22733. "unicode": "\uE627"
  22734. }, {
  22735. "font_class": "calendar",
  22736. "unicode": "\uE6A0"
  22737. }, {
  22738. "font_class": "calendar-filled",
  22739. "unicode": "\uE6C0"
  22740. }, {
  22741. "font_class": "camera",
  22742. "unicode": "\uE65A"
  22743. }, {
  22744. "font_class": "camera-filled",
  22745. "unicode": "\uE658"
  22746. }, {
  22747. "font_class": "cart",
  22748. "unicode": "\uE631"
  22749. }, {
  22750. "font_class": "cart-filled",
  22751. "unicode": "\uE6D0"
  22752. }, {
  22753. "font_class": "chat",
  22754. "unicode": "\uE65D"
  22755. }, {
  22756. "font_class": "chat-filled",
  22757. "unicode": "\uE659"
  22758. }, {
  22759. "font_class": "chatboxes",
  22760. "unicode": "\uE696"
  22761. }, {
  22762. "font_class": "chatboxes-filled",
  22763. "unicode": "\uE692"
  22764. }, {
  22765. "font_class": "chatbubble",
  22766. "unicode": "\uE697"
  22767. }, {
  22768. "font_class": "chatbubble-filled",
  22769. "unicode": "\uE694"
  22770. }, {
  22771. "font_class": "checkbox",
  22772. "unicode": "\uE62B"
  22773. }, {
  22774. "font_class": "checkbox-filled",
  22775. "unicode": "\uE62C"
  22776. }, {
  22777. "font_class": "checkmarkempty",
  22778. "unicode": "\uE65C"
  22779. }, {
  22780. "font_class": "circle",
  22781. "unicode": "\uE65B"
  22782. }, {
  22783. "font_class": "circle-filled",
  22784. "unicode": "\uE65E"
  22785. }, {
  22786. "font_class": "clear",
  22787. "unicode": "\uE66D"
  22788. }, {
  22789. "font_class": "close",
  22790. "unicode": "\uE673"
  22791. }, {
  22792. "font_class": "closeempty",
  22793. "unicode": "\uE66C"
  22794. }, {
  22795. "font_class": "cloud-download",
  22796. "unicode": "\uE647"
  22797. }, {
  22798. "font_class": "cloud-download-filled",
  22799. "unicode": "\uE646"
  22800. }, {
  22801. "font_class": "cloud-upload",
  22802. "unicode": "\uE645"
  22803. }, {
  22804. "font_class": "cloud-upload-filled",
  22805. "unicode": "\uE648"
  22806. }, {
  22807. "font_class": "color",
  22808. "unicode": "\uE6CF"
  22809. }, {
  22810. "font_class": "color-filled",
  22811. "unicode": "\uE6C9"
  22812. }, {
  22813. "font_class": "compose",
  22814. "unicode": "\uE67F"
  22815. }, {
  22816. "font_class": "contact",
  22817. "unicode": "\uE693"
  22818. }, {
  22819. "font_class": "contact-filled",
  22820. "unicode": "\uE695"
  22821. }, {
  22822. "font_class": "down",
  22823. "unicode": "\uE6B8"
  22824. }, {
  22825. "font_class": "bottom",
  22826. "unicode": "\uE6B8"
  22827. }, {
  22828. "font_class": "download",
  22829. "unicode": "\uE68D"
  22830. }, {
  22831. "font_class": "download-filled",
  22832. "unicode": "\uE681"
  22833. }, {
  22834. "font_class": "email",
  22835. "unicode": "\uE69E"
  22836. }, {
  22837. "font_class": "email-filled",
  22838. "unicode": "\uE69A"
  22839. }, {
  22840. "font_class": "eye",
  22841. "unicode": "\uE651"
  22842. }, {
  22843. "font_class": "eye-filled",
  22844. "unicode": "\uE66A"
  22845. }, {
  22846. "font_class": "eye-slash",
  22847. "unicode": "\uE6B3"
  22848. }, {
  22849. "font_class": "eye-slash-filled",
  22850. "unicode": "\uE6B4"
  22851. }, {
  22852. "font_class": "fire",
  22853. "unicode": "\uE6A1"
  22854. }, {
  22855. "font_class": "fire-filled",
  22856. "unicode": "\uE6C5"
  22857. }, {
  22858. "font_class": "flag",
  22859. "unicode": "\uE65F"
  22860. }, {
  22861. "font_class": "flag-filled",
  22862. "unicode": "\uE660"
  22863. }, {
  22864. "font_class": "folder-add",
  22865. "unicode": "\uE6A9"
  22866. }, {
  22867. "font_class": "folder-add-filled",
  22868. "unicode": "\uE6C8"
  22869. }, {
  22870. "font_class": "font",
  22871. "unicode": "\uE6A3"
  22872. }, {
  22873. "font_class": "forward",
  22874. "unicode": "\uE6BA"
  22875. }, {
  22876. "font_class": "gear",
  22877. "unicode": "\uE664"
  22878. }, {
  22879. "font_class": "gear-filled",
  22880. "unicode": "\uE661"
  22881. }, {
  22882. "font_class": "gift",
  22883. "unicode": "\uE6A4"
  22884. }, {
  22885. "font_class": "gift-filled",
  22886. "unicode": "\uE6C4"
  22887. }, {
  22888. "font_class": "hand-down",
  22889. "unicode": "\uE63D"
  22890. }, {
  22891. "font_class": "hand-down-filled",
  22892. "unicode": "\uE63C"
  22893. }, {
  22894. "font_class": "hand-up",
  22895. "unicode": "\uE63F"
  22896. }, {
  22897. "font_class": "hand-up-filled",
  22898. "unicode": "\uE63E"
  22899. }, {
  22900. "font_class": "headphones",
  22901. "unicode": "\uE630"
  22902. }, {
  22903. "font_class": "heart",
  22904. "unicode": "\uE639"
  22905. }, {
  22906. "font_class": "heart-filled",
  22907. "unicode": "\uE641"
  22908. }, {
  22909. "font_class": "help",
  22910. "unicode": "\uE679"
  22911. }, {
  22912. "font_class": "help-filled",
  22913. "unicode": "\uE674"
  22914. }, {
  22915. "font_class": "home",
  22916. "unicode": "\uE662"
  22917. }, {
  22918. "font_class": "home-filled",
  22919. "unicode": "\uE663"
  22920. }, {
  22921. "font_class": "image",
  22922. "unicode": "\uE670"
  22923. }, {
  22924. "font_class": "image-filled",
  22925. "unicode": "\uE678"
  22926. }, {
  22927. "font_class": "images",
  22928. "unicode": "\uE650"
  22929. }, {
  22930. "font_class": "images-filled",
  22931. "unicode": "\uE64B"
  22932. }, {
  22933. "font_class": "info",
  22934. "unicode": "\uE669"
  22935. }, {
  22936. "font_class": "info-filled",
  22937. "unicode": "\uE649"
  22938. }, {
  22939. "font_class": "left",
  22940. "unicode": "\uE6B7"
  22941. }, {
  22942. "font_class": "link",
  22943. "unicode": "\uE6A5"
  22944. }, {
  22945. "font_class": "list",
  22946. "unicode": "\uE644"
  22947. }, {
  22948. "font_class": "location",
  22949. "unicode": "\uE6AE"
  22950. }, {
  22951. "font_class": "location-filled",
  22952. "unicode": "\uE6AF"
  22953. }, {
  22954. "font_class": "locked",
  22955. "unicode": "\uE66B"
  22956. }, {
  22957. "font_class": "locked-filled",
  22958. "unicode": "\uE668"
  22959. }, {
  22960. "font_class": "loop",
  22961. "unicode": "\uE633"
  22962. }, {
  22963. "font_class": "mail-open",
  22964. "unicode": "\uE643"
  22965. }, {
  22966. "font_class": "mail-open-filled",
  22967. "unicode": "\uE63A"
  22968. }, {
  22969. "font_class": "map",
  22970. "unicode": "\uE667"
  22971. }, {
  22972. "font_class": "map-filled",
  22973. "unicode": "\uE666"
  22974. }, {
  22975. "font_class": "map-pin",
  22976. "unicode": "\uE6AD"
  22977. }, {
  22978. "font_class": "map-pin-ellipse",
  22979. "unicode": "\uE6AC"
  22980. }, {
  22981. "font_class": "medal",
  22982. "unicode": "\uE6A2"
  22983. }, {
  22984. "font_class": "medal-filled",
  22985. "unicode": "\uE6C3"
  22986. }, {
  22987. "font_class": "mic",
  22988. "unicode": "\uE671"
  22989. }, {
  22990. "font_class": "mic-filled",
  22991. "unicode": "\uE677"
  22992. }, {
  22993. "font_class": "micoff",
  22994. "unicode": "\uE67E"
  22995. }, {
  22996. "font_class": "micoff-filled",
  22997. "unicode": "\uE6B0"
  22998. }, {
  22999. "font_class": "minus",
  23000. "unicode": "\uE66F"
  23001. }, {
  23002. "font_class": "minus-filled",
  23003. "unicode": "\uE67D"
  23004. }, {
  23005. "font_class": "more",
  23006. "unicode": "\uE64D"
  23007. }, {
  23008. "font_class": "more-filled",
  23009. "unicode": "\uE64E"
  23010. }, {
  23011. "font_class": "navigate",
  23012. "unicode": "\uE66E"
  23013. }, {
  23014. "font_class": "navigate-filled",
  23015. "unicode": "\uE67A"
  23016. }, {
  23017. "font_class": "notification",
  23018. "unicode": "\uE6A6"
  23019. }, {
  23020. "font_class": "notification-filled",
  23021. "unicode": "\uE6C1"
  23022. }, {
  23023. "font_class": "paperclip",
  23024. "unicode": "\uE652"
  23025. }, {
  23026. "font_class": "paperplane",
  23027. "unicode": "\uE672"
  23028. }, {
  23029. "font_class": "paperplane-filled",
  23030. "unicode": "\uE675"
  23031. }, {
  23032. "font_class": "person",
  23033. "unicode": "\uE699"
  23034. }, {
  23035. "font_class": "person-filled",
  23036. "unicode": "\uE69D"
  23037. }, {
  23038. "font_class": "personadd",
  23039. "unicode": "\uE69F"
  23040. }, {
  23041. "font_class": "personadd-filled",
  23042. "unicode": "\uE698"
  23043. }, {
  23044. "font_class": "personadd-filled-copy",
  23045. "unicode": "\uE6D1"
  23046. }, {
  23047. "font_class": "phone",
  23048. "unicode": "\uE69C"
  23049. }, {
  23050. "font_class": "phone-filled",
  23051. "unicode": "\uE69B"
  23052. }, {
  23053. "font_class": "plus",
  23054. "unicode": "\uE676"
  23055. }, {
  23056. "font_class": "plus-filled",
  23057. "unicode": "\uE6C7"
  23058. }, {
  23059. "font_class": "plusempty",
  23060. "unicode": "\uE67B"
  23061. }, {
  23062. "font_class": "pulldown",
  23063. "unicode": "\uE632"
  23064. }, {
  23065. "font_class": "pyq",
  23066. "unicode": "\uE682"
  23067. }, {
  23068. "font_class": "qq",
  23069. "unicode": "\uE680"
  23070. }, {
  23071. "font_class": "redo",
  23072. "unicode": "\uE64A"
  23073. }, {
  23074. "font_class": "redo-filled",
  23075. "unicode": "\uE655"
  23076. }, {
  23077. "font_class": "refresh",
  23078. "unicode": "\uE657"
  23079. }, {
  23080. "font_class": "refresh-filled",
  23081. "unicode": "\uE656"
  23082. }, {
  23083. "font_class": "refreshempty",
  23084. "unicode": "\uE6BF"
  23085. }, {
  23086. "font_class": "reload",
  23087. "unicode": "\uE6B2"
  23088. }, {
  23089. "font_class": "right",
  23090. "unicode": "\uE6B5"
  23091. }, {
  23092. "font_class": "scan",
  23093. "unicode": "\uE62A"
  23094. }, {
  23095. "font_class": "search",
  23096. "unicode": "\uE654"
  23097. }, {
  23098. "font_class": "settings",
  23099. "unicode": "\uE653"
  23100. }, {
  23101. "font_class": "settings-filled",
  23102. "unicode": "\uE6CE"
  23103. }, {
  23104. "font_class": "shop",
  23105. "unicode": "\uE62F"
  23106. }, {
  23107. "font_class": "shop-filled",
  23108. "unicode": "\uE6CD"
  23109. }, {
  23110. "font_class": "smallcircle",
  23111. "unicode": "\uE67C"
  23112. }, {
  23113. "font_class": "smallcircle-filled",
  23114. "unicode": "\uE665"
  23115. }, {
  23116. "font_class": "sound",
  23117. "unicode": "\uE684"
  23118. }, {
  23119. "font_class": "sound-filled",
  23120. "unicode": "\uE686"
  23121. }, {
  23122. "font_class": "spinner-cycle",
  23123. "unicode": "\uE68A"
  23124. }, {
  23125. "font_class": "staff",
  23126. "unicode": "\uE6A7"
  23127. }, {
  23128. "font_class": "staff-filled",
  23129. "unicode": "\uE6CB"
  23130. }, {
  23131. "font_class": "star",
  23132. "unicode": "\uE688"
  23133. }, {
  23134. "font_class": "star-filled",
  23135. "unicode": "\uE68F"
  23136. }, {
  23137. "font_class": "starhalf",
  23138. "unicode": "\uE683"
  23139. }, {
  23140. "font_class": "trash",
  23141. "unicode": "\uE687"
  23142. }, {
  23143. "font_class": "trash-filled",
  23144. "unicode": "\uE685"
  23145. }, {
  23146. "font_class": "tune",
  23147. "unicode": "\uE6AA"
  23148. }, {
  23149. "font_class": "tune-filled",
  23150. "unicode": "\uE6CA"
  23151. }, {
  23152. "font_class": "undo",
  23153. "unicode": "\uE64F"
  23154. }, {
  23155. "font_class": "undo-filled",
  23156. "unicode": "\uE64C"
  23157. }, {
  23158. "font_class": "up",
  23159. "unicode": "\uE6B6"
  23160. }, {
  23161. "font_class": "top",
  23162. "unicode": "\uE6B6"
  23163. }, {
  23164. "font_class": "upload",
  23165. "unicode": "\uE690"
  23166. }, {
  23167. "font_class": "upload-filled",
  23168. "unicode": "\uE68E"
  23169. }, {
  23170. "font_class": "videocam",
  23171. "unicode": "\uE68C"
  23172. }, {
  23173. "font_class": "videocam-filled",
  23174. "unicode": "\uE689"
  23175. }, {
  23176. "font_class": "vip",
  23177. "unicode": "\uE6A8"
  23178. }, {
  23179. "font_class": "vip-filled",
  23180. "unicode": "\uE6C6"
  23181. }, {
  23182. "font_class": "wallet",
  23183. "unicode": "\uE6B1"
  23184. }, {
  23185. "font_class": "wallet-filled",
  23186. "unicode": "\uE6C2"
  23187. }, {
  23188. "font_class": "weibo",
  23189. "unicode": "\uE68B"
  23190. }, {
  23191. "font_class": "weixin",
  23192. "unicode": "\uE691"
  23193. }];
  23194. // export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
  23195. exports.fontData = fontData;
  23196. /***/ }),
  23197. /***/ 44:
  23198. /*!*************************************************************!*\
  23199. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/$parent.js ***!
  23200. \*************************************************************/
  23201. /*! no static exports found */
  23202. /***/ (function(module, exports, __webpack_require__) {
  23203. "use strict";
  23204. Object.defineProperty(exports, "__esModule", {
  23205. value: true
  23206. });
  23207. exports.default = $parent;
  23208. // 获取父组件的参数,在支付宝小程序中不支持provide/inject的写法
  23209. // 在非H5中this.$parent可以获取到父组件,但是在H5中需要多次调用this.$parent.$parent.xxx
  23210. // 传递默认值undefined表示查找最顶层的$parent
  23211. function $parent() {
  23212. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  23213. var parent = this.$parent;
  23214. // 通过whle遍历,这里主要是为了H5需要多层解析
  23215. while (parent) {
  23216. // 父组件
  23217. if (parent.$options && parent.$options.name !== name) {
  23218. // 如果组件的name不相等,则继续查找
  23219. parent = parent.$parent;
  23220. } else {
  23221. return parent;
  23222. }
  23223. }
  23224. return false;
  23225. }
  23226. /***/ }),
  23227. /***/ 45:
  23228. /*!************************************************************!*\
  23229. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/string.js ***!
  23230. \************************************************************/
  23231. /*! no static exports found */
  23232. /***/ (function(module, exports, __webpack_require__) {
  23233. "use strict";
  23234. Object.defineProperty(exports, "__esModule", {
  23235. value: true
  23236. });
  23237. exports.default = void 0;
  23238. /**
  23239. * 去掉字符串中空格
  23240. *
  23241. * @param {String} str 待处理的字符串
  23242. * @param {String} type 处理类型
  23243. */
  23244. function trim(str) {
  23245. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  23246. if (type === 'both') {
  23247. return str.replace(/^\s+|\s+$/g, "");
  23248. } else if (type === 'left') {
  23249. return str.replace(/^\s*/g, "");
  23250. } else if (type === 'right') {
  23251. return str.replace(/(\s*$)/g, "");
  23252. } else if (type === 'all') {
  23253. return str.replace(/\s+/g, "");
  23254. } else {
  23255. return str;
  23256. }
  23257. }
  23258. /**
  23259. * 获取带单位的长度值
  23260. *
  23261. * @param {String} value 待处理的值
  23262. * @param {String} unit 单位
  23263. */
  23264. function getLengthUnitValue(value) {
  23265. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  23266. if (!value) {
  23267. return '';
  23268. }
  23269. if (/(%|px|rpx|auto)$/.test(value)) return value;else return value + unit;
  23270. }
  23271. /**
  23272. * 将驼峰命名的字符串转换为指定连接符来进行连接
  23273. *
  23274. * @param {Object} string 待转换的字符串
  23275. * @param {Object} replace 进行连接的字符
  23276. */
  23277. function humpConvertChar(string) {
  23278. var replace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_';
  23279. if (!string || !replace) {
  23280. return '';
  23281. }
  23282. return string.replace(/([A-Z])/g, "".concat(replace, "$1")).toLowerCase();
  23283. }
  23284. /**
  23285. * 将用指定连接符来进行连接的字符串转为驼峰命名的字符串
  23286. *
  23287. * @param {Object} string 待转换的字符串
  23288. * @param {Object} replace 进行连接的字符
  23289. */
  23290. function charConvertHump(string) {
  23291. var replace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_';
  23292. if (!string || !replace) {
  23293. return '';
  23294. }
  23295. var reg = RegExp(replace + "(\\w)", "g");
  23296. return string.replace(reg, function (all, letter) {
  23297. return letter.toUpperCase();
  23298. });
  23299. }
  23300. var _default = {
  23301. trim: trim,
  23302. getLengthUnitValue: getLengthUnitValue,
  23303. humpConvertChar: humpConvertChar,
  23304. charConvertHump: charConvertHump
  23305. };
  23306. exports.default = _default;
  23307. /***/ }),
  23308. /***/ 46:
  23309. /*!************************************************************!*\
  23310. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/number.js ***!
  23311. \************************************************************/
  23312. /*! no static exports found */
  23313. /***/ (function(module, exports, __webpack_require__) {
  23314. "use strict";
  23315. Object.defineProperty(exports, "__esModule", {
  23316. value: true
  23317. });
  23318. exports.default = void 0;
  23319. /**
  23320. * 格式化数字字符串
  23321. * @param {String, Number} value 待格式化的字符串
  23322. * @param {Number} digits 保留位数
  23323. */
  23324. function formatNumberString(value) {
  23325. var digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  23326. var number = 0;
  23327. // 判断是什么类型
  23328. if (typeof value === 'string') {
  23329. number = Number(value);
  23330. } else if (typeof value === 'number') {
  23331. number = value;
  23332. }
  23333. if (isNaN(number) || number === 0) {
  23334. return 0;
  23335. }
  23336. var maxNumber = Math.pow(10, digits) - 1;
  23337. if (number > maxNumber) {
  23338. return "".concat(maxNumber, "+");
  23339. }
  23340. return number;
  23341. }
  23342. /**
  23343. * 格式化数字字符串,往数字前添加0
  23344. *
  23345. * @param {Object} num 待格式化的数值
  23346. */
  23347. function formatNumberAddZero(value) {
  23348. var number = 0;
  23349. // 判断是什么类型
  23350. if (typeof value === 'string') {
  23351. number = Number(value);
  23352. } else if (typeof value === 'number') {
  23353. number = value;
  23354. }
  23355. if (isNaN(number) || +number < 10) {
  23356. return '0' + number;
  23357. } else {
  23358. return String(number);
  23359. }
  23360. }
  23361. /**
  23362. * 格式化数字,往数值后添加单位
  23363. *
  23364. * @param {Object} value 待格式化的数值
  23365. * @param {Object} digits 保留位数
  23366. */
  23367. function formatNumberAddPriceUnit(value) {
  23368. var digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  23369. // 数值分割点
  23370. var unitSplit = [{
  23371. value: 1,
  23372. symbol: ''
  23373. }, {
  23374. value: 1E3,
  23375. symbol: 'K'
  23376. }, {
  23377. value: 1E4,
  23378. symbol: 'W'
  23379. }];
  23380. var reg = /\.0+$|(\.[0=9]*[1-9])0+$/;
  23381. var number = 0;
  23382. // 判断是什么类型
  23383. if (typeof value === 'string') {
  23384. number = Number(value);
  23385. } else if (typeof value === 'number') {
  23386. number = value;
  23387. }
  23388. var i;
  23389. for (i = unitSplit.length - 1; i > 0; i--) {
  23390. if (number >= unitSplit[i].value) break;
  23391. }
  23392. return (number / unitSplit[i].value).toFixed(digits).replace(reg, "$1") + unitSplit[i].symbol;
  23393. }
  23394. /**
  23395. * 获取数值的整数位数
  23396. *
  23397. * @param {Object} number 数值
  23398. */
  23399. function getDigit(number) {
  23400. var digit = -1;
  23401. while (number >= 1) {
  23402. digit++;
  23403. number = number / 10;
  23404. }
  23405. return digit;
  23406. }
  23407. /**
  23408. * 获取指定范围的随机数(返回整数)
  23409. * @param {Object} min 最小值
  23410. * @param {Object} max 最大值
  23411. */
  23412. function random(min, max) {
  23413. if (min >= 0 && max > 0 && max >= min) {
  23414. var gab = max - min;
  23415. return Math.random() * gab + min;
  23416. } else {
  23417. return 0;
  23418. }
  23419. }
  23420. /**
  23421. * 获取指定范围的随机数(返回整数)
  23422. * @param {Object} min 最小值
  23423. * @param {Object} max 最大值
  23424. */
  23425. function randomInt(min, max) {
  23426. if (min >= 0 && max > 0 && max >= min) {
  23427. var gab = max - min + 1;
  23428. return Math.floor(Math.random() * gab + min);
  23429. } else {
  23430. return 0;
  23431. }
  23432. }
  23433. var _default = {
  23434. formatNumberString: formatNumberString,
  23435. formatNumberAddZero: formatNumberAddZero,
  23436. formatNumberAddPriceUnit: formatNumberAddPriceUnit,
  23437. random: random,
  23438. randomInt: randomInt
  23439. };
  23440. exports.default = _default;
  23441. /***/ }),
  23442. /***/ 47:
  23443. /*!***************************************************************!*\
  23444. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/function/deepClone.js ***!
  23445. \***************************************************************/
  23446. /*! no static exports found */
  23447. /***/ (function(module, exports, __webpack_require__) {
  23448. "use strict";
  23449. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  23450. Object.defineProperty(exports, "__esModule", {
  23451. value: true
  23452. });
  23453. exports.default = void 0;
  23454. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  23455. /**
  23456. * 判断是否为数组
  23457. *
  23458. * @param {Object} arr
  23459. */
  23460. function isArray(arr) {
  23461. return Object.prototype.toString.call(arr) === '[object Array]';
  23462. }
  23463. /**
  23464. * 深度复制数据
  23465. *
  23466. * @param {Object} obj
  23467. */
  23468. function deepClone(obj) {
  23469. if ([null, undefined, NaN, false].includes(obj)) return obj;
  23470. if ((0, _typeof2.default)(obj) !== 'object' && typeof obj !== 'function') {
  23471. return obj;
  23472. }
  23473. var o = isArray(obj) ? [] : {};
  23474. for (var i in obj) {
  23475. if (obj.hasOwnProperty(i)) {
  23476. o[i] = (0, _typeof2.default)(obj[i]) === 'object' ? deepClone(obj[i]) : obj[i];
  23477. }
  23478. }
  23479. return o;
  23480. }
  23481. var _default = deepClone;
  23482. exports.default = _default;
  23483. /***/ }),
  23484. /***/ 477:
  23485. /*!*******************************************************************************************!*\
  23486. !*** E:/盈通/sulibao-mini/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  23487. \*******************************************************************************************/
  23488. /*! no static exports found */
  23489. /***/ (function(module, exports, __webpack_require__) {
  23490. "use strict";
  23491. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  23492. Object.defineProperty(exports, "__esModule", {
  23493. value: true
  23494. });
  23495. exports.default = void 0;
  23496. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 478));
  23497. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 479));
  23498. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 480));
  23499. var _default = {
  23500. en: _en.default,
  23501. 'zh-Hans': _zhHans.default,
  23502. 'zh-Hant': _zhHant.default
  23503. };
  23504. exports.default = _default;
  23505. /***/ }),
  23506. /***/ 478:
  23507. /*!******************************************************************************************!*\
  23508. !*** E:/盈通/sulibao-mini/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  23509. \******************************************************************************************/
  23510. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  23511. /***/ (function(module) {
  23512. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  23513. /***/ }),
  23514. /***/ 479:
  23515. /*!***********************************************************************************************!*\
  23516. !*** E:/盈通/sulibao-mini/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  23517. \***********************************************************************************************/
  23518. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  23519. /***/ (function(module) {
  23520. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  23521. /***/ }),
  23522. /***/ 48:
  23523. /*!**********************************************************!*\
  23524. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/config/zIndex.js ***!
  23525. \**********************************************************/
  23526. /*! no static exports found */
  23527. /***/ (function(module, exports, __webpack_require__) {
  23528. "use strict";
  23529. Object.defineProperty(exports, "__esModule", {
  23530. value: true
  23531. });
  23532. exports.default = void 0;
  23533. // 各组件的z-index值
  23534. var _default = {
  23535. landsacpe: 29100,
  23536. navbar: 29090,
  23537. toast: 20090,
  23538. goodsNav: 20089,
  23539. alert: 20085,
  23540. modal: 20080,
  23541. popup: 20075,
  23542. tips: 19080,
  23543. sticky: 19075,
  23544. indexListSticky: 19070,
  23545. fab: 19060,
  23546. mask: 9999,
  23547. tableTr: 1001,
  23548. tableTd: 1000
  23549. };
  23550. exports.default = _default;
  23551. /***/ }),
  23552. /***/ 480:
  23553. /*!***********************************************************************************************!*\
  23554. !*** E:/盈通/sulibao-mini/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  23555. \***********************************************************************************************/
  23556. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  23557. /***/ (function(module) {
  23558. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  23559. /***/ }),
  23560. /***/ 49:
  23561. /*!*********************************************************!*\
  23562. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/config/color.js ***!
  23563. \*********************************************************/
  23564. /*! no static exports found */
  23565. /***/ (function(module, exports, __webpack_require__) {
  23566. "use strict";
  23567. Object.defineProperty(exports, "__esModule", {
  23568. value: true
  23569. });
  23570. exports.default = void 0;
  23571. // TuniaoUI颜色值
  23572. var _default = {
  23573. mainColor: '#01BEFF',
  23574. reverseMainColor: '#FFF00D',
  23575. femaleColor: '#FF71D2',
  23576. maleColor: '#82B2FF',
  23577. mainOrange: '#FBBD12',
  23578. bgColor: '#FFFFFF',
  23579. spaceColor: '#F8F7F8',
  23580. fontColor: '#080808',
  23581. fontSubColor: '#AAAAAA',
  23582. contentColor: '#838383',
  23583. fontHolderColor: '#E6E6E6',
  23584. maskBgColor: 'rgba(0, 0, 0, 0.4)'
  23585. };
  23586. exports.default = _default;
  23587. /***/ }),
  23588. /***/ 5:
  23589. /*!**************************************************************!*\
  23590. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  23591. \**************************************************************/
  23592. /*! no static exports found */
  23593. /***/ (function(module, exports, __webpack_require__) {
  23594. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  23595. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  23596. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  23597. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  23598. function _slicedToArray(arr, i) {
  23599. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  23600. }
  23601. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23602. /***/ }),
  23603. /***/ 50:
  23604. /*!********************************************!*\
  23605. !*** E:/盈通/sulibao-mini/store/$t.mixin.js ***!
  23606. \********************************************/
  23607. /*! no static exports found */
  23608. /***/ (function(module, exports, __webpack_require__) {
  23609. "use strict";
  23610. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  23611. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  23612. var _vuex = __webpack_require__(/*! vuex */ 31);
  23613. var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 30));
  23614. 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; }
  23615. 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; }
  23616. // 尝试将用户在根目录中的store/index.js的vuex的state变量加载到全局变量中
  23617. var $tStoreKey = [];
  23618. try {
  23619. $tStoreKey = _store.default.state ? Object.keys(_store.default.state) : [];
  23620. } catch (e) {}
  23621. module.exports = {
  23622. beforeCreate: function beforeCreate() {
  23623. var _this = this;
  23624. // 将vuex方法挂在在$t中
  23625. // 使用方法:
  23626. // 修改vuex的state中的user.name变量为速立保小菜 => this.$t.vuex('user.name', '速立保小菜')
  23627. // 修改vuexde state中的version变量为1.0.1 => this.$t.vuex('version', 1.0.1)
  23628. this.$t.vuex = function (name, value) {
  23629. _this.$store.commit('$tStore', {
  23630. name: name,
  23631. value: value
  23632. });
  23633. };
  23634. },
  23635. computed: _objectSpread({}, (0, _vuex.mapState)($tStoreKey))
  23636. };
  23637. /***/ }),
  23638. /***/ 51:
  23639. /*!**********************************************************!*\
  23640. !*** E:/盈通/sulibao-mini/tuniao-ui/libs/mixin/mpShare.js ***!
  23641. \**********************************************************/
  23642. /*! no static exports found */
  23643. /***/ (function(module, exports, __webpack_require__) {
  23644. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  23645. onLoad: function onLoad() {
  23646. // 设置默认的转发参数
  23647. this.$t.mpShare = {
  23648. // 分享的标题,默认为小程序名称
  23649. title: '',
  23650. // 分享的路径,默认为当前页面
  23651. path: '',
  23652. // 分享时显示的图片,默认为当前页面截图
  23653. imageUrl: '',
  23654. // 当前页面是否可以分享
  23655. share: true
  23656. };
  23657. if (!this.$t.mpShare.share) {
  23658. uni.hideShareMenu();
  23659. }
  23660. },
  23661. onShareAppMessage: function onShareAppMessage() {
  23662. return this.$t.mpShare;
  23663. },
  23664. onShareTimeline: function onShareTimeline() {
  23665. return {
  23666. title: this.$t.mpShare.title,
  23667. query: this.$t.mpShare.path.substring(this.$t.mpShare.path.indexOf('?') + 1, this.$t.mpShare.path.length),
  23668. imageUrl: this.$t.mpShare.imageUrl
  23669. };
  23670. }
  23671. };
  23672. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  23673. /***/ }),
  23674. /***/ 6:
  23675. /*!***************************************************************!*\
  23676. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  23677. \***************************************************************/
  23678. /*! no static exports found */
  23679. /***/ (function(module, exports) {
  23680. function _arrayWithHoles(arr) {
  23681. if (Array.isArray(arr)) return arr;
  23682. }
  23683. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23684. /***/ }),
  23685. /***/ 63:
  23686. /*!************************************************************************************************!*\
  23687. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  23688. \************************************************************************************************/
  23689. /*! no static exports found */
  23690. /***/ (function(module, exports, __webpack_require__) {
  23691. // TODO(Babel 8): Remove this file.
  23692. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 64)();
  23693. module.exports = runtime;
  23694. /***/ }),
  23695. /***/ 64:
  23696. /*!*******************************************************************!*\
  23697. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  23698. \*******************************************************************/
  23699. /*! no static exports found */
  23700. /***/ (function(module, exports, __webpack_require__) {
  23701. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  23702. function _regeneratorRuntime() {
  23703. "use strict";
  23704. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  23705. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  23706. return e;
  23707. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23708. var t,
  23709. e = {},
  23710. r = Object.prototype,
  23711. n = r.hasOwnProperty,
  23712. o = Object.defineProperty || function (t, e, r) {
  23713. t[e] = r.value;
  23714. },
  23715. i = "function" == typeof Symbol ? Symbol : {},
  23716. a = i.iterator || "@@iterator",
  23717. c = i.asyncIterator || "@@asyncIterator",
  23718. u = i.toStringTag || "@@toStringTag";
  23719. function define(t, e, r) {
  23720. return Object.defineProperty(t, e, {
  23721. value: r,
  23722. enumerable: !0,
  23723. configurable: !0,
  23724. writable: !0
  23725. }), t[e];
  23726. }
  23727. try {
  23728. define({}, "");
  23729. } catch (t) {
  23730. define = function define(t, e, r) {
  23731. return t[e] = r;
  23732. };
  23733. }
  23734. function wrap(t, e, r, n) {
  23735. var i = e && e.prototype instanceof Generator ? e : Generator,
  23736. a = Object.create(i.prototype),
  23737. c = new Context(n || []);
  23738. return o(a, "_invoke", {
  23739. value: makeInvokeMethod(t, r, c)
  23740. }), a;
  23741. }
  23742. function tryCatch(t, e, r) {
  23743. try {
  23744. return {
  23745. type: "normal",
  23746. arg: t.call(e, r)
  23747. };
  23748. } catch (t) {
  23749. return {
  23750. type: "throw",
  23751. arg: t
  23752. };
  23753. }
  23754. }
  23755. e.wrap = wrap;
  23756. var h = "suspendedStart",
  23757. l = "suspendedYield",
  23758. f = "executing",
  23759. s = "completed",
  23760. y = {};
  23761. function Generator() {}
  23762. function GeneratorFunction() {}
  23763. function GeneratorFunctionPrototype() {}
  23764. var p = {};
  23765. define(p, a, function () {
  23766. return this;
  23767. });
  23768. var d = Object.getPrototypeOf,
  23769. v = d && d(d(values([])));
  23770. v && v !== r && n.call(v, a) && (p = v);
  23771. var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
  23772. function defineIteratorMethods(t) {
  23773. ["next", "throw", "return"].forEach(function (e) {
  23774. define(t, e, function (t) {
  23775. return this._invoke(e, t);
  23776. });
  23777. });
  23778. }
  23779. function AsyncIterator(t, e) {
  23780. function invoke(r, o, i, a) {
  23781. var c = tryCatch(t[r], t, o);
  23782. if ("throw" !== c.type) {
  23783. var u = c.arg,
  23784. h = u.value;
  23785. return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
  23786. invoke("next", t, i, a);
  23787. }, function (t) {
  23788. invoke("throw", t, i, a);
  23789. }) : e.resolve(h).then(function (t) {
  23790. u.value = t, i(u);
  23791. }, function (t) {
  23792. return invoke("throw", t, i, a);
  23793. });
  23794. }
  23795. a(c.arg);
  23796. }
  23797. var r;
  23798. o(this, "_invoke", {
  23799. value: function value(t, n) {
  23800. function callInvokeWithMethodAndArg() {
  23801. return new e(function (e, r) {
  23802. invoke(t, n, e, r);
  23803. });
  23804. }
  23805. return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  23806. }
  23807. });
  23808. }
  23809. function makeInvokeMethod(e, r, n) {
  23810. var o = h;
  23811. return function (i, a) {
  23812. if (o === f) throw Error("Generator is already running");
  23813. if (o === s) {
  23814. if ("throw" === i) throw a;
  23815. return {
  23816. value: t,
  23817. done: !0
  23818. };
  23819. }
  23820. for (n.method = i, n.arg = a;;) {
  23821. var c = n.delegate;
  23822. if (c) {
  23823. var u = maybeInvokeDelegate(c, n);
  23824. if (u) {
  23825. if (u === y) continue;
  23826. return u;
  23827. }
  23828. }
  23829. if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
  23830. if (o === h) throw o = s, n.arg;
  23831. n.dispatchException(n.arg);
  23832. } else "return" === n.method && n.abrupt("return", n.arg);
  23833. o = f;
  23834. var p = tryCatch(e, r, n);
  23835. if ("normal" === p.type) {
  23836. if (o = n.done ? s : l, p.arg === y) continue;
  23837. return {
  23838. value: p.arg,
  23839. done: n.done
  23840. };
  23841. }
  23842. "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
  23843. }
  23844. };
  23845. }
  23846. function maybeInvokeDelegate(e, r) {
  23847. var n = r.method,
  23848. o = e.iterator[n];
  23849. if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
  23850. var i = tryCatch(o, e.iterator, r.arg);
  23851. if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
  23852. var a = i.arg;
  23853. return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
  23854. }
  23855. function pushTryEntry(t) {
  23856. var e = {
  23857. tryLoc: t[0]
  23858. };
  23859. 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
  23860. }
  23861. function resetTryEntry(t) {
  23862. var e = t.completion || {};
  23863. e.type = "normal", delete e.arg, t.completion = e;
  23864. }
  23865. function Context(t) {
  23866. this.tryEntries = [{
  23867. tryLoc: "root"
  23868. }], t.forEach(pushTryEntry, this), this.reset(!0);
  23869. }
  23870. function values(e) {
  23871. if (e || "" === e) {
  23872. var r = e[a];
  23873. if (r) return r.call(e);
  23874. if ("function" == typeof e.next) return e;
  23875. if (!isNaN(e.length)) {
  23876. var o = -1,
  23877. i = function next() {
  23878. for (; ++o < e.length;) {
  23879. if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
  23880. }
  23881. return next.value = t, next.done = !0, next;
  23882. };
  23883. return i.next = i;
  23884. }
  23885. }
  23886. throw new TypeError(_typeof(e) + " is not iterable");
  23887. }
  23888. return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
  23889. value: GeneratorFunctionPrototype,
  23890. configurable: !0
  23891. }), o(GeneratorFunctionPrototype, "constructor", {
  23892. value: GeneratorFunction,
  23893. configurable: !0
  23894. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
  23895. var e = "function" == typeof t && t.constructor;
  23896. return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
  23897. }, e.mark = function (t) {
  23898. return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
  23899. }, e.awrap = function (t) {
  23900. return {
  23901. __await: t
  23902. };
  23903. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
  23904. return this;
  23905. }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
  23906. void 0 === i && (i = Promise);
  23907. var a = new AsyncIterator(wrap(t, r, n, o), i);
  23908. return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
  23909. return t.done ? t.value : a.next();
  23910. });
  23911. }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
  23912. return this;
  23913. }), define(g, "toString", function () {
  23914. return "[object Generator]";
  23915. }), e.keys = function (t) {
  23916. var e = Object(t),
  23917. r = [];
  23918. for (var n in e) {
  23919. r.push(n);
  23920. }
  23921. return r.reverse(), function next() {
  23922. for (; r.length;) {
  23923. var t = r.pop();
  23924. if (t in e) return next.value = t, next.done = !1, next;
  23925. }
  23926. return next.done = !0, next;
  23927. };
  23928. }, e.values = values, Context.prototype = {
  23929. constructor: Context,
  23930. reset: function reset(e) {
  23931. if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) {
  23932. "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
  23933. }
  23934. },
  23935. stop: function stop() {
  23936. this.done = !0;
  23937. var t = this.tryEntries[0].completion;
  23938. if ("throw" === t.type) throw t.arg;
  23939. return this.rval;
  23940. },
  23941. dispatchException: function dispatchException(e) {
  23942. if (this.done) throw e;
  23943. var r = this;
  23944. function handle(n, o) {
  23945. return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
  23946. }
  23947. for (var o = this.tryEntries.length - 1; o >= 0; --o) {
  23948. var i = this.tryEntries[o],
  23949. a = i.completion;
  23950. if ("root" === i.tryLoc) return handle("end");
  23951. if (i.tryLoc <= this.prev) {
  23952. var c = n.call(i, "catchLoc"),
  23953. u = n.call(i, "finallyLoc");
  23954. if (c && u) {
  23955. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  23956. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  23957. } else if (c) {
  23958. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  23959. } else {
  23960. if (!u) throw Error("try statement without catch or finally");
  23961. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  23962. }
  23963. }
  23964. }
  23965. },
  23966. abrupt: function abrupt(t, e) {
  23967. for (var r = this.tryEntries.length - 1; r >= 0; --r) {
  23968. var o = this.tryEntries[r];
  23969. if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
  23970. var i = o;
  23971. break;
  23972. }
  23973. }
  23974. i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
  23975. var a = i ? i.completion : {};
  23976. return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
  23977. },
  23978. complete: function complete(t, e) {
  23979. if ("throw" === t.type) throw t.arg;
  23980. return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
  23981. },
  23982. finish: function finish(t) {
  23983. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  23984. var r = this.tryEntries[e];
  23985. if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
  23986. }
  23987. },
  23988. "catch": function _catch(t) {
  23989. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  23990. var r = this.tryEntries[e];
  23991. if (r.tryLoc === t) {
  23992. var n = r.completion;
  23993. if ("throw" === n.type) {
  23994. var o = n.arg;
  23995. resetTryEntry(r);
  23996. }
  23997. return o;
  23998. }
  23999. }
  24000. throw Error("illegal catch attempt");
  24001. },
  24002. delegateYield: function delegateYield(e, r, n) {
  24003. return this.delegate = {
  24004. iterator: values(e),
  24005. resultName: r,
  24006. nextLoc: n
  24007. }, "next" === this.method && (this.arg = t), y;
  24008. }
  24009. }, e;
  24010. }
  24011. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  24012. /***/ }),
  24013. /***/ 65:
  24014. /*!*****************************************************************!*\
  24015. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  24016. \*****************************************************************/
  24017. /*! no static exports found */
  24018. /***/ (function(module, exports) {
  24019. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  24020. try {
  24021. var info = gen[key](arg);
  24022. var value = info.value;
  24023. } catch (error) {
  24024. reject(error);
  24025. return;
  24026. }
  24027. if (info.done) {
  24028. resolve(value);
  24029. } else {
  24030. Promise.resolve(value).then(_next, _throw);
  24031. }
  24032. }
  24033. function _asyncToGenerator(fn) {
  24034. return function () {
  24035. var self = this,
  24036. args = arguments;
  24037. return new Promise(function (resolve, reject) {
  24038. var gen = fn.apply(self, args);
  24039. function _next(value) {
  24040. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  24041. }
  24042. function _throw(err) {
  24043. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  24044. }
  24045. _next(undefined);
  24046. });
  24047. };
  24048. }
  24049. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  24050. /***/ }),
  24051. /***/ 66:
  24052. /*!*******************************************!*\
  24053. !*** E:/盈通/sulibao-mini/utils/request.js ***!
  24054. \*******************************************/
  24055. /*! no static exports found */
  24056. /***/ (function(module, exports, __webpack_require__) {
  24057. "use strict";
  24058. /* WEBPACK VAR INJECTION */(function(uni) {
  24059. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  24060. Object.defineProperty(exports, "__esModule", {
  24061. value: true
  24062. });
  24063. exports.default = void 0;
  24064. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  24065. var _uni_request = _interopRequireDefault(__webpack_require__(/*! ../plugins/uni_request.js */ 67));
  24066. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 30));
  24067. var _jsMd = _interopRequireDefault(__webpack_require__(/*! js-md5 */ 69));
  24068. var _uni_api = __webpack_require__(/*! ./uni_api */ 74);
  24069. var _config = __webpack_require__(/*! ../config.js */ 75);
  24070. 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; }
  24071. 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; }
  24072. // 初始化自定义参数 login 是否需要登录权限 cancel 是否取消上次请求
  24073. var defaultOptions = {
  24074. login: true,
  24075. auth: false,
  24076. cancel: false,
  24077. loading: true,
  24078. //是否显示 请求加载中
  24079. warn: true //是否异常弹窗提示
  24080. };
  24081. // 初始化请求
  24082. var instance = _uni_request.default.create({
  24083. baseURL: _config.VUE_APP_URL,
  24084. timeout: 100000,
  24085. debug: true
  24086. });
  24087. var setCancel;
  24088. // 请求拦截器
  24089. instance.interceptors.request.use(function (config) {
  24090. var token = _store.default.state.token; //'7221b77a-899b-492b-8263-9507f5c470e9';// store.state.token
  24091. //console.log("frontlixiangsid:"+token);
  24092. config.header['frontlixiangsid'] = token; //登录token 标志id
  24093. config.header['platType'] = 'slb';
  24094. config.header['mpType'] = 'engineer';
  24095. config.header['appType'] = 'ma';
  24096. config.cancelToken = new _uni_request.default.CancelToken(function executor(c) {
  24097. setCancel = c; //记录当前请求
  24098. });
  24099. config.timeStamp = new Date().getTime();
  24100. var jsToken = ""; //防重复提交
  24101. jsToken = (0, _jsMd.default)(JSON.stringify(config));
  24102. console.log('jsToken' + jsToken);
  24103. console.log(config);
  24104. config.data['tokenId'] = jsToken;
  24105. return config;
  24106. });
  24107. // 响应拦截器
  24108. instance.interceptors.response.use(function (response) {
  24109. // console.log('响应成功', response)
  24110. return response;
  24111. });
  24112. // 读取cookie
  24113. function getCookie(cookie, c_name) {
  24114. if (cookie && cookie.length > 0) {
  24115. var c_start = cookie.indexOf(c_name + "=");
  24116. if (c_start != -1) {
  24117. c_start = c_start + c_name.length + 1;
  24118. var c_end = cookie.indexOf(";", c_start);
  24119. if (c_end == -1) c_end = cookie.length;
  24120. return unescape(cookie.substring(c_start, c_end));
  24121. }
  24122. }
  24123. return "";
  24124. }
  24125. // 请求主体
  24126. function baseRequest(config, options) {
  24127. var login = options.login,
  24128. auth = options.auth,
  24129. cancel = options.cancel,
  24130. _options$loading = options.loading,
  24131. loading = _options$loading === void 0 ? true : _options$loading,
  24132. warn = options.warn;
  24133. if (options.cancel) {
  24134. cancelRequest();
  24135. }
  24136. loadingStatus(loading, true);
  24137. if (login && !_store.default.state.token) {
  24138. loadingStatus(loading, false);
  24139. // autoAuth();
  24140. }
  24141. return instance.request(config).then(function (res) {
  24142. if (config.url === '/slbMpAutoLogin' || config.url === '/slbSmLogin') {
  24143. try {
  24144. var cookie = res.header["set-cookie"] || res.header["Set-Cookie"];
  24145. var frontId = res.data.resultMap ? res.data.resultMap.frontlixiangsid || '' : '';
  24146. var frontlixiangsid = getCookie(cookie, "frontlixiangsid") || frontId;
  24147. if (frontlixiangsid == 'deleteMe' && frontId) {
  24148. frontlixiangsid = frontId;
  24149. }
  24150. if (frontlixiangsid && frontlixiangsid != 'deleteMe') {
  24151. // uni.setStorageSync('frontlixiangsid',frontlixiangsid)
  24152. _store.default.state.token = frontlixiangsid;
  24153. }
  24154. } catch (err) {
  24155. console.log(err);
  24156. }
  24157. }
  24158. //console.log(config);
  24159. loadingStatus(loading, false);
  24160. //console.log(res);
  24161. if (res.statusCode) {
  24162. var data = res.data;
  24163. console.log('instance.request', res);
  24164. console.log('instance.request data', data);
  24165. if (res.statusCode === 200) {
  24166. console.log('instance.request data 1', data);
  24167. if (data.state == 1) {
  24168. return Promise.resolve(data);
  24169. } else if (data.msg && (data.msg == '请勿频繁操作' || data.msg.indexOf('不能再次使用') > -1)) {
  24170. (0, _uni_api.uniShowToast)(data.msg);
  24171. return;
  24172. } else if (data._redirect || data.msg == '未登录') {
  24173. uni.removeStorageSync('userNo');
  24174. // if(uni.getStorageSync('userNo')){
  24175. // uniShowModal('', '账号过期,重新登录?', {
  24176. // showCancel: true,
  24177. // success: (res) => {
  24178. // if(res.confirm){
  24179. // //添加跳转 微信绑定公众号页面
  24180. // uni.redirectTo({
  24181. // url: '/pages/login/login'
  24182. // });
  24183. // }else{
  24184. // return Promise.resolve(data);
  24185. // }
  24186. // }
  24187. // })
  24188. // }
  24189. // store.commit("LOGOUT");
  24190. // uni.reLaunch({
  24191. // url: '/pages/index/auth'
  24192. // });
  24193. return Promise.resolve(data);
  24194. } else if (data.state == -1) {
  24195. return Promise.resolve(data);
  24196. } else if (data == '' || data == 'success' || data._redirect) {
  24197. console.log('instance.request data 2', data);
  24198. // store.commit("LOGOUT");
  24199. //未登录
  24200. if (!_store.default.state.isGOAuth) {
  24201. _store.default.commit("SET_GO_AUTH", true);
  24202. //判断是否是第一次加载第一次加载未登录不用弹框提醒
  24203. if (_store.default.state.isFirstLoad) {
  24204. _store.default.state.isFirstLoad = false;
  24205. uni.redirectTo({
  24206. url: '/pages/Login/Login'
  24207. });
  24208. return;
  24209. } else {
  24210. _store.default.state.isFirstLoad = false;
  24211. (0, _uni_api.uniShowModal)('', '账号过期重新登录认证', {
  24212. showCancel: false,
  24213. success: function success(res) {
  24214. //添加跳转 微信绑定公众号页面
  24215. uni.redirectTo({
  24216. url: '/pages/auth/auth'
  24217. });
  24218. }
  24219. });
  24220. return;
  24221. }
  24222. } else {
  24223. console.log('路由已存在,不再重复跳转');
  24224. return;
  24225. }
  24226. data.msg = '未登录';
  24227. return Promise.reject(data);
  24228. } else {
  24229. console.log('instance.request data 3', data);
  24230. //data.state == -301||
  24231. if (data.msg == undefined) {
  24232. if (uni.getStorageSync("loginFlag")) {
  24233. uni.redirectTo({
  24234. url: "/pages/Login/Login"
  24235. });
  24236. }
  24237. return;
  24238. }
  24239. if (warn) {
  24240. uni.redirectTo({
  24241. url: '/pages/error/error?code=' + data.state + '&msg=' + data.msg
  24242. });
  24243. return;
  24244. }
  24245. return Promise.resolve(data);
  24246. }
  24247. return Promise.resolve(res.data);
  24248. } else {
  24249. if (warn) {
  24250. responseError({
  24251. code: res.statusCode
  24252. });
  24253. }
  24254. return Promise.reject(res.data);
  24255. }
  24256. } else {
  24257. return Promise.reject(res.data);
  24258. }
  24259. loadingStatus(loading, false);
  24260. }).catch(function (err) {
  24261. loadingStatus(loading, false);
  24262. // if (warn) {
  24263. (0, _uni_api.uniShowToast)(err);
  24264. // }
  24265. return Promise.reject(err);
  24266. });
  24267. }
  24268. function cancelRequest() {
  24269. if (typeof setCancel === 'function') {
  24270. setCancel('取消请求');
  24271. }
  24272. loadingStatus(loading, false);
  24273. }
  24274. // 定义请求提示
  24275. var loadingStatus = function loadingStatus(loading, type) {
  24276. if (loading) {
  24277. if (type) {
  24278. // loadingToast('正在请求中');
  24279. // setTimeout(function () {
  24280. // uniHideLoading();
  24281. // }, 5000);//防水异常加载不关闭影响操作
  24282. } else {
  24283. // uniHideLoading();
  24284. }
  24285. } else {
  24286. return;
  24287. }
  24288. };
  24289. // 请求返回statusCode
  24290. var responseError = function responseError(_ref) {
  24291. var code = _ref.code;
  24292. var content = '';
  24293. switch (code) {
  24294. case 400:
  24295. content = '请求参数错误';
  24296. break;
  24297. case 401:
  24298. content = '未授权,请重新登录-401';
  24299. break;
  24300. case 403:
  24301. content = '没有访问权限-403';
  24302. break;
  24303. case 404:
  24304. content = '请求错误,未找到该资源-404';
  24305. break;
  24306. case 405:
  24307. content = '请求方式错误-405';
  24308. break;
  24309. case 408:
  24310. content = '请求超时';
  24311. break;
  24312. case 500:
  24313. content = '服务器异常-500';
  24314. break;
  24315. case 501:
  24316. content = '服务未实现';
  24317. break;
  24318. case 502:
  24319. content = '网关错误';
  24320. break;
  24321. case 503:
  24322. content = '服务不可用';
  24323. break;
  24324. case 504:
  24325. content = '网关超时';
  24326. break;
  24327. case 505:
  24328. content = 'HTTP版本不受支持';
  24329. break;
  24330. default:
  24331. content = '请求异常-' + code;
  24332. break;
  24333. }
  24334. (0, _uni_api.uniShowModal)('', content, {
  24335. showCancel: false,
  24336. success: function success(res) {
  24337. console.log(res);
  24338. }
  24339. });
  24340. };
  24341. var request = ['get', 'post', 'put', 'delete', 'connect', 'head', 'options', 'trace'].reduce(function (request, method) {
  24342. request[method] = function (url, data) {
  24343. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  24344. return baseRequest({
  24345. url: url,
  24346. method: method,
  24347. data: data
  24348. }, _objectSpread(_objectSpread({}, defaultOptions), options));
  24349. };
  24350. return request;
  24351. }, {});
  24352. var _default = request;
  24353. exports.default = _default;
  24354. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  24355. /***/ }),
  24356. /***/ 67:
  24357. /*!*************************************************!*\
  24358. !*** E:/盈通/sulibao-mini/plugins/uni_request.js ***!
  24359. \*************************************************/
  24360. /*! no static exports found */
  24361. /***/ (function(module, exports, __webpack_require__) {
  24362. "use strict";
  24363. /* WEBPACK VAR INJECTION */(function(uni) {
  24364. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  24365. Object.defineProperty(exports, "__esModule", {
  24366. value: true
  24367. });
  24368. exports.default = void 0;
  24369. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 63));
  24370. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 65));
  24371. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  24372. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  24373. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  24374. var _cancel = __webpack_require__(/*! ./cancel.js */ 68);
  24375. 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; }
  24376. 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; }
  24377. var Request = /*#__PURE__*/function () {
  24378. function Request(_args) {
  24379. var _this4 = this;
  24380. (0, _classCallCheck2.default)(this, Request);
  24381. (0, _defineProperty2.default)(this, "interceptors", {
  24382. // 拦截器
  24383. request: {
  24384. interceptors: [],
  24385. use: function use(fn) {
  24386. this.interceptors.push(fn);
  24387. },
  24388. intercept: function intercept(config) {
  24389. var _this2 = this;
  24390. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  24391. var i;
  24392. return _regenerator.default.wrap(function _callee$(_context) {
  24393. while (1) {
  24394. switch (_context.prev = _context.next) {
  24395. case 0:
  24396. i = 0;
  24397. case 1:
  24398. if (!(i < _this2.interceptors.length)) {
  24399. _context.next = 8;
  24400. break;
  24401. }
  24402. _context.next = 4;
  24403. return _this2.interceptors[i](config);
  24404. case 4:
  24405. config = _context.sent;
  24406. case 5:
  24407. i++;
  24408. _context.next = 1;
  24409. break;
  24410. case 8:
  24411. return _context.abrupt("return", config);
  24412. case 9:
  24413. case "end":
  24414. return _context.stop();
  24415. }
  24416. }
  24417. }, _callee);
  24418. }))();
  24419. }
  24420. },
  24421. response: {
  24422. interceptors: [],
  24423. use: function use(fn) {
  24424. this.interceptors.push(fn);
  24425. },
  24426. intercept: function intercept(resolve, response) {
  24427. var _this3 = this;
  24428. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  24429. var i;
  24430. return _regenerator.default.wrap(function _callee2$(_context2) {
  24431. while (1) {
  24432. switch (_context2.prev = _context2.next) {
  24433. case 0:
  24434. i = 0;
  24435. case 1:
  24436. if (!(i < _this3.interceptors.length)) {
  24437. _context2.next = 8;
  24438. break;
  24439. }
  24440. _context2.next = 4;
  24441. return _this3.interceptors[i](response);
  24442. case 4:
  24443. response = _context2.sent;
  24444. case 5:
  24445. i++;
  24446. _context2.next = 1;
  24447. break;
  24448. case 8:
  24449. return _context2.abrupt("return", resolve(response));
  24450. case 9:
  24451. case "end":
  24452. return _context2.stop();
  24453. }
  24454. }
  24455. }, _callee2);
  24456. }))();
  24457. }
  24458. }
  24459. });
  24460. (0, _defineProperty2.default)(this, "abort", function () {
  24461. _this4.aborted = true;
  24462. _this4.requestTask ? _this4.requestTask.abort() : '';
  24463. });
  24464. (0, _defineProperty2.default)(this, "onerror", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  24465. var options,
  24466. obj,
  24467. _args4 = arguments;
  24468. return _regenerator.default.wrap(function _callee3$(_context3) {
  24469. while (1) {
  24470. switch (_context3.prev = _context3.next) {
  24471. case 0:
  24472. options = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : _objectSpread({}, args);
  24473. obj = {
  24474. url: options.url,
  24475. method: options.method,
  24476. mes: options.str
  24477. };
  24478. if (options.cancel) {
  24479. obj.mes = options.cancel.message || '取消请求';
  24480. }
  24481. if (_this4.defaults.debug) {
  24482. console.log(obj.mes, options);
  24483. }
  24484. return _context3.abrupt("return", obj);
  24485. case 5:
  24486. case "end":
  24487. return _context3.stop();
  24488. }
  24489. }
  24490. }, _callee3);
  24491. })));
  24492. this.defaults = _objectSpread({
  24493. headers: {
  24494. 'Accept': 'application/json',
  24495. 'Content-Type': 'application/x-www-form-urlencoded'
  24496. },
  24497. debug: false
  24498. }, _args) || {};
  24499. this.timer = null;
  24500. this.requestTask = null;
  24501. this.aborted = false;
  24502. this.timeoutCancel = false;
  24503. this.Cancel = _cancel.Cancel;
  24504. this.CancelToken = _cancel.CancelToken;
  24505. this.isCancel = _cancel.isCancel;
  24506. }
  24507. (0, _createClass2.default)(Request, [{
  24508. key: "request",
  24509. value: function request(options) {
  24510. var _this = this;
  24511. var method = options.method,
  24512. url = options.url,
  24513. data = options.data,
  24514. cancelToken = options.cancelToken;
  24515. var config = {
  24516. url: this.defaults.baseURL + url,
  24517. method: method.toUpperCase() || 'GET',
  24518. header: this.defaults.headers || {},
  24519. data: data || {}
  24520. };
  24521. return new Proxy(new Promise(function (resolve, reject) {
  24522. _this.interceptors.request.intercept(config).then( /*#__PURE__*/function () {
  24523. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(res) {
  24524. var str;
  24525. return _regenerator.default.wrap(function _callee9$(_context9) {
  24526. while (1) {
  24527. switch (_context9.prev = _context9.next) {
  24528. case 0:
  24529. if (!_this.aborted) {
  24530. _context9.next = 5;
  24531. break;
  24532. }
  24533. // 如果请求已被取消,停止执行,返回 reject
  24534. str = '主动中断请求';
  24535. _context9.next = 4;
  24536. return _this.onerror({
  24537. config: config,
  24538. str: str
  24539. });
  24540. case 4:
  24541. return _context9.abrupt("return", reject(str));
  24542. case 5:
  24543. if (config.cancelToken) {
  24544. // Handle cancellation
  24545. config.cancelToken.promise.then( /*#__PURE__*/function () {
  24546. var _onCanceled = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(cancel) {
  24547. return _regenerator.default.wrap(function _callee4$(_context4) {
  24548. while (1) {
  24549. switch (_context4.prev = _context4.next) {
  24550. case 0:
  24551. clearTimeout(_this.timer);
  24552. _this.requestTask = null;
  24553. _context4.next = 4;
  24554. return _this.onerror({
  24555. config: config,
  24556. cancel: cancel
  24557. });
  24558. case 4:
  24559. return _context4.abrupt("return", reject(cancel));
  24560. case 5:
  24561. case "end":
  24562. return _context4.stop();
  24563. }
  24564. }
  24565. }, _callee4);
  24566. }));
  24567. function onCanceled(_x2) {
  24568. return _onCanceled.apply(this, arguments);
  24569. }
  24570. return onCanceled;
  24571. }());
  24572. }
  24573. _this.requestTask = uni.request(_objectSpread(_objectSpread({}, config), {}, {
  24574. success: function () {
  24575. var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(res) {
  24576. return _regenerator.default.wrap(function _callee5$(_context5) {
  24577. while (1) {
  24578. switch (_context5.prev = _context5.next) {
  24579. case 0:
  24580. clearTimeout(_this.timer); // 清除检测超时定时器
  24581. _this.interceptors.response.intercept(resolve, res); // 执行响应拦截器
  24582. case 2:
  24583. case "end":
  24584. return _context5.stop();
  24585. }
  24586. }
  24587. }, _callee5);
  24588. }));
  24589. function success(_x3) {
  24590. return _success.apply(this, arguments);
  24591. }
  24592. return success;
  24593. }(),
  24594. fail: function () {
  24595. var _fail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(error) {
  24596. var failTimer;
  24597. return _regenerator.default.wrap(function _callee7$(_context7) {
  24598. while (1) {
  24599. switch (_context7.prev = _context7.next) {
  24600. case 0:
  24601. console.log(error);
  24602. clearTimeout(_this.timer); // 清除检测超时定时器
  24603. failTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
  24604. var str;
  24605. return _regenerator.default.wrap(function _callee6$(_context6) {
  24606. while (1) {
  24607. switch (_context6.prev = _context6.next) {
  24608. case 0:
  24609. // 区分失败原因为超时或其它原因
  24610. str = '网络异常或URL无效';
  24611. if (_this.timeoutCancel) {
  24612. _context6.next = 6;
  24613. break;
  24614. }
  24615. _context6.next = 4;
  24616. return _this.onerror({
  24617. config: config,
  24618. str: str
  24619. });
  24620. case 4:
  24621. clearTimeout(failTimer);
  24622. reject(str);
  24623. case 6:
  24624. case "end":
  24625. return _context6.stop();
  24626. }
  24627. }
  24628. }, _callee6);
  24629. })), 300);
  24630. case 3:
  24631. case "end":
  24632. return _context7.stop();
  24633. }
  24634. }
  24635. }, _callee7);
  24636. }));
  24637. function fail(_x4) {
  24638. return _fail.apply(this, arguments);
  24639. }
  24640. return fail;
  24641. }()
  24642. }));
  24643. _this.timer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  24644. var str;
  24645. return _regenerator.default.wrap(function _callee8$(_context8) {
  24646. while (1) {
  24647. switch (_context8.prev = _context8.next) {
  24648. case 0:
  24649. if (!config.cancelToken) {
  24650. _context8.next = 2;
  24651. break;
  24652. }
  24653. return _context8.abrupt("return");
  24654. case 2:
  24655. _this.requestTask.abort(); // 执行取消请求方法
  24656. _this.timeoutCancel = true;
  24657. str = "\u7F51\u7EDC\u8BF7\u6C42\u65F6\u95F4\u8D85\u65F6,\u5F53\u524D\u8BBE\u7F6E\u54CD\u5E94\u65F6\u95F4\u4E3A".concat(_this.defaults.timeout);
  24658. _context8.next = 7;
  24659. return _this.onerror({
  24660. config: config,
  24661. str: str
  24662. });
  24663. case 7:
  24664. reject(str);
  24665. case 8:
  24666. case "end":
  24667. return _context8.stop();
  24668. }
  24669. }
  24670. }, _callee8);
  24671. })), _this.defaults.timeout || 12345); // 设定检测超时定时器
  24672. case 8:
  24673. case "end":
  24674. return _context9.stop();
  24675. }
  24676. }
  24677. }, _callee9);
  24678. }));
  24679. return function (_x) {
  24680. return _ref2.apply(this, arguments);
  24681. };
  24682. }());
  24683. }), {
  24684. get: function get(target, key, receiver) {
  24685. // console.log(`getting ${key}!`);
  24686. return key === 'abort' ? _this.abort : Reflect.get(target, key, receiver).bind(target); //传入target 为异步函数需要 .bind(target)
  24687. },
  24688. set: function set(target, key, value, receiver) {
  24689. // console.log(`setting ${key}!`);
  24690. return Reflect.set(target, key, value, receiver);
  24691. }
  24692. });
  24693. }
  24694. }]);
  24695. return Request;
  24696. }(); // class CreateInstance extends Request {
  24697. // constructor(args) {
  24698. // super();
  24699. // super.defaults = args;
  24700. // }
  24701. // }
  24702. var unirequest = new Request();
  24703. unirequest.create = function (args) {
  24704. return new Request(args);
  24705. };
  24706. var _default = unirequest;
  24707. exports.default = _default;
  24708. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  24709. /***/ }),
  24710. /***/ 68:
  24711. /*!********************************************!*\
  24712. !*** E:/盈通/sulibao-mini/plugins/cancel.js ***!
  24713. \********************************************/
  24714. /*! no static exports found */
  24715. /***/ (function(module, exports, __webpack_require__) {
  24716. "use strict";
  24717. Object.defineProperty(exports, "__esModule", {
  24718. value: true
  24719. });
  24720. exports.Cancel = Cancel;
  24721. exports.CancelToken = CancelToken;
  24722. exports.isCancel = isCancel;
  24723. function Cancel(message) {
  24724. this.message = message;
  24725. console.log('1 cancel');
  24726. }
  24727. Cancel.prototype.toString = function toString() {
  24728. return 'Cancel' + (this.message ? ': ' + this.message : '');
  24729. };
  24730. Cancel.prototype.__CANCEL__ = true;
  24731. function CancelToken(executor) {
  24732. if (typeof executor !== 'function') {
  24733. throw new TypeError('executor must be a function.');
  24734. }
  24735. //console.log('2 CancelToken')
  24736. var resolvePromise;
  24737. this.promise = new Promise(function promiseExecutor(resolve) {
  24738. resolvePromise = resolve;
  24739. //console.log('3 CancelToken')
  24740. });
  24741. var token = this;
  24742. executor(function cancel(message) {
  24743. //console.log('4 CancelToken')
  24744. if (token.reason) {
  24745. // Cancellation has already been requested
  24746. return;
  24747. }
  24748. //console.log('5 CancelToken')
  24749. token.reason = new Cancel(message);
  24750. resolvePromise(token.reason);
  24751. });
  24752. }
  24753. /**
  24754. * Throws a `Cancel` if cancellation has been requested.
  24755. */
  24756. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  24757. //console.log('6 CancelToken')
  24758. if (this.reason) {
  24759. throw this.reason;
  24760. }
  24761. };
  24762. /**
  24763. * Returns an object that contains a new `CancelToken` and a function that, when called,
  24764. * cancels the `CancelToken`.
  24765. */
  24766. CancelToken.source = function source() {
  24767. var cancel;
  24768. console.log('7 CancelToken');
  24769. var token = new CancelToken(function executor(c) {
  24770. cancel = c;
  24771. });
  24772. return {
  24773. token: token,
  24774. cancel: cancel
  24775. };
  24776. };
  24777. function isCancel(value) {
  24778. console.log('8 isCancel');
  24779. return !!(value && value.__CANCEL__);
  24780. }
  24781. ;
  24782. /***/ }),
  24783. /***/ 69:
  24784. /*!*********************************************************!*\
  24785. !*** E:/盈通/sulibao-mini/node_modules/js-md5/src/md5.js ***!
  24786. \*********************************************************/
  24787. /*! no static exports found */
  24788. /***/ (function(module, exports, __webpack_require__) {
  24789. /* WEBPACK VAR INJECTION */(function(process, global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  24790. /**
  24791. * [js-md5]{@link https://github.com/emn178/js-md5}
  24792. *
  24793. * @namespace md5
  24794. * @version 0.7.3
  24795. * @author Chen, Yi-Cyuan [emn178@gmail.com]
  24796. * @copyright Chen, Yi-Cyuan 2014-2017
  24797. * @license MIT
  24798. */
  24799. (function () {
  24800. 'use strict';
  24801. var ERROR = 'input is invalid type';
  24802. var WINDOW = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object';
  24803. var root = WINDOW ? window : {};
  24804. if (root.JS_MD5_NO_WINDOW) {
  24805. WINDOW = false;
  24806. }
  24807. var WEB_WORKER = !WINDOW && (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object';
  24808. var NODE_JS = !root.JS_MD5_NO_NODE_JS && (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && process.versions && process.versions.node;
  24809. if (NODE_JS) {
  24810. root = global;
  24811. } else if (WEB_WORKER) {
  24812. root = self;
  24813. }
  24814. var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && ( false ? undefined : _typeof(module)) === 'object' && module.exports;
  24815. var AMD = true && __webpack_require__(/*! !webpack amd options */ 73);
  24816. var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
  24817. var HEX_CHARS = '0123456789abcdef'.split('');
  24818. var EXTRA = [128, 32768, 8388608, -2147483648];
  24819. var SHIFT = [0, 8, 16, 24];
  24820. var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
  24821. var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  24822. var blocks = [],
  24823. buffer8;
  24824. if (ARRAY_BUFFER) {
  24825. var buffer = new ArrayBuffer(68);
  24826. buffer8 = new Uint8Array(buffer);
  24827. blocks = new Uint32Array(buffer);
  24828. }
  24829. if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
  24830. Array.isArray = function (obj) {
  24831. return Object.prototype.toString.call(obj) === '[object Array]';
  24832. };
  24833. }
  24834. if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
  24835. ArrayBuffer.isView = function (obj) {
  24836. return _typeof(obj) === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
  24837. };
  24838. }
  24839. /**
  24840. * @method hex
  24841. * @memberof md5
  24842. * @description Output hash as hex string
  24843. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24844. * @returns {String} Hex string
  24845. * @example
  24846. * md5.hex('The quick brown fox jumps over the lazy dog');
  24847. * // equal to
  24848. * md5('The quick brown fox jumps over the lazy dog');
  24849. */
  24850. /**
  24851. * @method digest
  24852. * @memberof md5
  24853. * @description Output hash as bytes array
  24854. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24855. * @returns {Array} Bytes array
  24856. * @example
  24857. * md5.digest('The quick brown fox jumps over the lazy dog');
  24858. */
  24859. /**
  24860. * @method array
  24861. * @memberof md5
  24862. * @description Output hash as bytes array
  24863. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24864. * @returns {Array} Bytes array
  24865. * @example
  24866. * md5.array('The quick brown fox jumps over the lazy dog');
  24867. */
  24868. /**
  24869. * @method arrayBuffer
  24870. * @memberof md5
  24871. * @description Output hash as ArrayBuffer
  24872. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24873. * @returns {ArrayBuffer} ArrayBuffer
  24874. * @example
  24875. * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
  24876. */
  24877. /**
  24878. * @method buffer
  24879. * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
  24880. * @memberof md5
  24881. * @description Output hash as ArrayBuffer
  24882. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24883. * @returns {ArrayBuffer} ArrayBuffer
  24884. * @example
  24885. * md5.buffer('The quick brown fox jumps over the lazy dog');
  24886. */
  24887. /**
  24888. * @method base64
  24889. * @memberof md5
  24890. * @description Output hash as base64 string
  24891. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24892. * @returns {String} base64 string
  24893. * @example
  24894. * md5.base64('The quick brown fox jumps over the lazy dog');
  24895. */
  24896. var createOutputMethod = function createOutputMethod(outputType) {
  24897. return function (message) {
  24898. return new Md5(true).update(message)[outputType]();
  24899. };
  24900. };
  24901. /**
  24902. * @method create
  24903. * @memberof md5
  24904. * @description Create Md5 object
  24905. * @returns {Md5} Md5 object.
  24906. * @example
  24907. * var hash = md5.create();
  24908. */
  24909. /**
  24910. * @method update
  24911. * @memberof md5
  24912. * @description Create and update Md5 object
  24913. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24914. * @returns {Md5} Md5 object.
  24915. * @example
  24916. * var hash = md5.update('The quick brown fox jumps over the lazy dog');
  24917. * // equal to
  24918. * var hash = md5.create();
  24919. * hash.update('The quick brown fox jumps over the lazy dog');
  24920. */
  24921. var createMethod = function createMethod() {
  24922. var method = createOutputMethod('hex');
  24923. if (NODE_JS) {
  24924. method = nodeWrap(method);
  24925. }
  24926. method.create = function () {
  24927. return new Md5();
  24928. };
  24929. method.update = function (message) {
  24930. return method.create().update(message);
  24931. };
  24932. for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
  24933. var type = OUTPUT_TYPES[i];
  24934. method[type] = createOutputMethod(type);
  24935. }
  24936. return method;
  24937. };
  24938. var nodeWrap = function nodeWrap(method) {
  24939. var crypto = eval("require('crypto')");
  24940. var Buffer = eval("require('buffer').Buffer");
  24941. var nodeMethod = function nodeMethod(message) {
  24942. if (typeof message === 'string') {
  24943. return crypto.createHash('md5').update(message, 'utf8').digest('hex');
  24944. } else {
  24945. if (message === null || message === undefined) {
  24946. throw ERROR;
  24947. } else if (message.constructor === ArrayBuffer) {
  24948. message = new Uint8Array(message);
  24949. }
  24950. }
  24951. if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) {
  24952. return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
  24953. } else {
  24954. return method(message);
  24955. }
  24956. };
  24957. return nodeMethod;
  24958. };
  24959. /**
  24960. * Md5 class
  24961. * @class Md5
  24962. * @description This is internal class.
  24963. * @see {@link md5.create}
  24964. */
  24965. function Md5(sharedMemory) {
  24966. if (sharedMemory) {
  24967. blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
  24968. this.blocks = blocks;
  24969. this.buffer8 = buffer8;
  24970. } else {
  24971. if (ARRAY_BUFFER) {
  24972. var buffer = new ArrayBuffer(68);
  24973. this.buffer8 = new Uint8Array(buffer);
  24974. this.blocks = new Uint32Array(buffer);
  24975. } else {
  24976. this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  24977. }
  24978. }
  24979. this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
  24980. this.finalized = this.hashed = false;
  24981. this.first = true;
  24982. }
  24983. /**
  24984. * @method update
  24985. * @memberof Md5
  24986. * @instance
  24987. * @description Update hash
  24988. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  24989. * @returns {Md5} Md5 object.
  24990. * @see {@link md5.update}
  24991. */
  24992. Md5.prototype.update = function (message) {
  24993. if (this.finalized) {
  24994. return;
  24995. }
  24996. var notString,
  24997. type = _typeof(message);
  24998. if (type !== 'string') {
  24999. if (type === 'object') {
  25000. if (message === null) {
  25001. throw ERROR;
  25002. } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
  25003. message = new Uint8Array(message);
  25004. } else if (!Array.isArray(message)) {
  25005. if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
  25006. throw ERROR;
  25007. }
  25008. }
  25009. } else {
  25010. throw ERROR;
  25011. }
  25012. notString = true;
  25013. }
  25014. var code,
  25015. index = 0,
  25016. i,
  25017. length = message.length,
  25018. blocks = this.blocks;
  25019. var buffer8 = this.buffer8;
  25020. while (index < length) {
  25021. if (this.hashed) {
  25022. this.hashed = false;
  25023. blocks[0] = blocks[16];
  25024. blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
  25025. }
  25026. if (notString) {
  25027. if (ARRAY_BUFFER) {
  25028. for (i = this.start; index < length && i < 64; ++index) {
  25029. buffer8[i++] = message[index];
  25030. }
  25031. } else {
  25032. for (i = this.start; index < length && i < 64; ++index) {
  25033. blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
  25034. }
  25035. }
  25036. } else {
  25037. if (ARRAY_BUFFER) {
  25038. for (i = this.start; index < length && i < 64; ++index) {
  25039. code = message.charCodeAt(index);
  25040. if (code < 0x80) {
  25041. buffer8[i++] = code;
  25042. } else if (code < 0x800) {
  25043. buffer8[i++] = 0xc0 | code >> 6;
  25044. buffer8[i++] = 0x80 | code & 0x3f;
  25045. } else if (code < 0xd800 || code >= 0xe000) {
  25046. buffer8[i++] = 0xe0 | code >> 12;
  25047. buffer8[i++] = 0x80 | code >> 6 & 0x3f;
  25048. buffer8[i++] = 0x80 | code & 0x3f;
  25049. } else {
  25050. code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);
  25051. buffer8[i++] = 0xf0 | code >> 18;
  25052. buffer8[i++] = 0x80 | code >> 12 & 0x3f;
  25053. buffer8[i++] = 0x80 | code >> 6 & 0x3f;
  25054. buffer8[i++] = 0x80 | code & 0x3f;
  25055. }
  25056. }
  25057. } else {
  25058. for (i = this.start; index < length && i < 64; ++index) {
  25059. code = message.charCodeAt(index);
  25060. if (code < 0x80) {
  25061. blocks[i >> 2] |= code << SHIFT[i++ & 3];
  25062. } else if (code < 0x800) {
  25063. blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];
  25064. blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
  25065. } else if (code < 0xd800 || code >= 0xe000) {
  25066. blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];
  25067. blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];
  25068. blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
  25069. } else {
  25070. code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);
  25071. blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];
  25072. blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];
  25073. blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];
  25074. blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
  25075. }
  25076. }
  25077. }
  25078. }
  25079. this.lastByteIndex = i;
  25080. this.bytes += i - this.start;
  25081. if (i >= 64) {
  25082. this.start = i - 64;
  25083. this.hash();
  25084. this.hashed = true;
  25085. } else {
  25086. this.start = i;
  25087. }
  25088. }
  25089. if (this.bytes > 4294967295) {
  25090. this.hBytes += this.bytes / 4294967296 << 0;
  25091. this.bytes = this.bytes % 4294967296;
  25092. }
  25093. return this;
  25094. };
  25095. Md5.prototype.finalize = function () {
  25096. if (this.finalized) {
  25097. return;
  25098. }
  25099. this.finalized = true;
  25100. var blocks = this.blocks,
  25101. i = this.lastByteIndex;
  25102. blocks[i >> 2] |= EXTRA[i & 3];
  25103. if (i >= 56) {
  25104. if (!this.hashed) {
  25105. this.hash();
  25106. }
  25107. blocks[0] = blocks[16];
  25108. blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
  25109. }
  25110. blocks[14] = this.bytes << 3;
  25111. blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
  25112. this.hash();
  25113. };
  25114. Md5.prototype.hash = function () {
  25115. var a,
  25116. b,
  25117. c,
  25118. d,
  25119. bc,
  25120. da,
  25121. blocks = this.blocks;
  25122. if (this.first) {
  25123. a = blocks[0] - 680876937;
  25124. a = (a << 7 | a >>> 25) - 271733879 << 0;
  25125. d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
  25126. d = (d << 12 | d >>> 20) + a << 0;
  25127. c = (-271733879 ^ d & (a ^ -271733879)) + blocks[2] - 1126478375;
  25128. c = (c << 17 | c >>> 15) + d << 0;
  25129. b = (a ^ c & (d ^ a)) + blocks[3] - 1316259209;
  25130. b = (b << 22 | b >>> 10) + c << 0;
  25131. } else {
  25132. a = this.h0;
  25133. b = this.h1;
  25134. c = this.h2;
  25135. d = this.h3;
  25136. a += (d ^ b & (c ^ d)) + blocks[0] - 680876936;
  25137. a = (a << 7 | a >>> 25) + b << 0;
  25138. d += (c ^ a & (b ^ c)) + blocks[1] - 389564586;
  25139. d = (d << 12 | d >>> 20) + a << 0;
  25140. c += (b ^ d & (a ^ b)) + blocks[2] + 606105819;
  25141. c = (c << 17 | c >>> 15) + d << 0;
  25142. b += (a ^ c & (d ^ a)) + blocks[3] - 1044525330;
  25143. b = (b << 22 | b >>> 10) + c << 0;
  25144. }
  25145. a += (d ^ b & (c ^ d)) + blocks[4] - 176418897;
  25146. a = (a << 7 | a >>> 25) + b << 0;
  25147. d += (c ^ a & (b ^ c)) + blocks[5] + 1200080426;
  25148. d = (d << 12 | d >>> 20) + a << 0;
  25149. c += (b ^ d & (a ^ b)) + blocks[6] - 1473231341;
  25150. c = (c << 17 | c >>> 15) + d << 0;
  25151. b += (a ^ c & (d ^ a)) + blocks[7] - 45705983;
  25152. b = (b << 22 | b >>> 10) + c << 0;
  25153. a += (d ^ b & (c ^ d)) + blocks[8] + 1770035416;
  25154. a = (a << 7 | a >>> 25) + b << 0;
  25155. d += (c ^ a & (b ^ c)) + blocks[9] - 1958414417;
  25156. d = (d << 12 | d >>> 20) + a << 0;
  25157. c += (b ^ d & (a ^ b)) + blocks[10] - 42063;
  25158. c = (c << 17 | c >>> 15) + d << 0;
  25159. b += (a ^ c & (d ^ a)) + blocks[11] - 1990404162;
  25160. b = (b << 22 | b >>> 10) + c << 0;
  25161. a += (d ^ b & (c ^ d)) + blocks[12] + 1804603682;
  25162. a = (a << 7 | a >>> 25) + b << 0;
  25163. d += (c ^ a & (b ^ c)) + blocks[13] - 40341101;
  25164. d = (d << 12 | d >>> 20) + a << 0;
  25165. c += (b ^ d & (a ^ b)) + blocks[14] - 1502002290;
  25166. c = (c << 17 | c >>> 15) + d << 0;
  25167. b += (a ^ c & (d ^ a)) + blocks[15] + 1236535329;
  25168. b = (b << 22 | b >>> 10) + c << 0;
  25169. a += (c ^ d & (b ^ c)) + blocks[1] - 165796510;
  25170. a = (a << 5 | a >>> 27) + b << 0;
  25171. d += (b ^ c & (a ^ b)) + blocks[6] - 1069501632;
  25172. d = (d << 9 | d >>> 23) + a << 0;
  25173. c += (a ^ b & (d ^ a)) + blocks[11] + 643717713;
  25174. c = (c << 14 | c >>> 18) + d << 0;
  25175. b += (d ^ a & (c ^ d)) + blocks[0] - 373897302;
  25176. b = (b << 20 | b >>> 12) + c << 0;
  25177. a += (c ^ d & (b ^ c)) + blocks[5] - 701558691;
  25178. a = (a << 5 | a >>> 27) + b << 0;
  25179. d += (b ^ c & (a ^ b)) + blocks[10] + 38016083;
  25180. d = (d << 9 | d >>> 23) + a << 0;
  25181. c += (a ^ b & (d ^ a)) + blocks[15] - 660478335;
  25182. c = (c << 14 | c >>> 18) + d << 0;
  25183. b += (d ^ a & (c ^ d)) + blocks[4] - 405537848;
  25184. b = (b << 20 | b >>> 12) + c << 0;
  25185. a += (c ^ d & (b ^ c)) + blocks[9] + 568446438;
  25186. a = (a << 5 | a >>> 27) + b << 0;
  25187. d += (b ^ c & (a ^ b)) + blocks[14] - 1019803690;
  25188. d = (d << 9 | d >>> 23) + a << 0;
  25189. c += (a ^ b & (d ^ a)) + blocks[3] - 187363961;
  25190. c = (c << 14 | c >>> 18) + d << 0;
  25191. b += (d ^ a & (c ^ d)) + blocks[8] + 1163531501;
  25192. b = (b << 20 | b >>> 12) + c << 0;
  25193. a += (c ^ d & (b ^ c)) + blocks[13] - 1444681467;
  25194. a = (a << 5 | a >>> 27) + b << 0;
  25195. d += (b ^ c & (a ^ b)) + blocks[2] - 51403784;
  25196. d = (d << 9 | d >>> 23) + a << 0;
  25197. c += (a ^ b & (d ^ a)) + blocks[7] + 1735328473;
  25198. c = (c << 14 | c >>> 18) + d << 0;
  25199. b += (d ^ a & (c ^ d)) + blocks[12] - 1926607734;
  25200. b = (b << 20 | b >>> 12) + c << 0;
  25201. bc = b ^ c;
  25202. a += (bc ^ d) + blocks[5] - 378558;
  25203. a = (a << 4 | a >>> 28) + b << 0;
  25204. d += (bc ^ a) + blocks[8] - 2022574463;
  25205. d = (d << 11 | d >>> 21) + a << 0;
  25206. da = d ^ a;
  25207. c += (da ^ b) + blocks[11] + 1839030562;
  25208. c = (c << 16 | c >>> 16) + d << 0;
  25209. b += (da ^ c) + blocks[14] - 35309556;
  25210. b = (b << 23 | b >>> 9) + c << 0;
  25211. bc = b ^ c;
  25212. a += (bc ^ d) + blocks[1] - 1530992060;
  25213. a = (a << 4 | a >>> 28) + b << 0;
  25214. d += (bc ^ a) + blocks[4] + 1272893353;
  25215. d = (d << 11 | d >>> 21) + a << 0;
  25216. da = d ^ a;
  25217. c += (da ^ b) + blocks[7] - 155497632;
  25218. c = (c << 16 | c >>> 16) + d << 0;
  25219. b += (da ^ c) + blocks[10] - 1094730640;
  25220. b = (b << 23 | b >>> 9) + c << 0;
  25221. bc = b ^ c;
  25222. a += (bc ^ d) + blocks[13] + 681279174;
  25223. a = (a << 4 | a >>> 28) + b << 0;
  25224. d += (bc ^ a) + blocks[0] - 358537222;
  25225. d = (d << 11 | d >>> 21) + a << 0;
  25226. da = d ^ a;
  25227. c += (da ^ b) + blocks[3] - 722521979;
  25228. c = (c << 16 | c >>> 16) + d << 0;
  25229. b += (da ^ c) + blocks[6] + 76029189;
  25230. b = (b << 23 | b >>> 9) + c << 0;
  25231. bc = b ^ c;
  25232. a += (bc ^ d) + blocks[9] - 640364487;
  25233. a = (a << 4 | a >>> 28) + b << 0;
  25234. d += (bc ^ a) + blocks[12] - 421815835;
  25235. d = (d << 11 | d >>> 21) + a << 0;
  25236. da = d ^ a;
  25237. c += (da ^ b) + blocks[15] + 530742520;
  25238. c = (c << 16 | c >>> 16) + d << 0;
  25239. b += (da ^ c) + blocks[2] - 995338651;
  25240. b = (b << 23 | b >>> 9) + c << 0;
  25241. a += (c ^ (b | ~d)) + blocks[0] - 198630844;
  25242. a = (a << 6 | a >>> 26) + b << 0;
  25243. d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
  25244. d = (d << 10 | d >>> 22) + a << 0;
  25245. c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
  25246. c = (c << 15 | c >>> 17) + d << 0;
  25247. b += (d ^ (c | ~a)) + blocks[5] - 57434055;
  25248. b = (b << 21 | b >>> 11) + c << 0;
  25249. a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
  25250. a = (a << 6 | a >>> 26) + b << 0;
  25251. d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
  25252. d = (d << 10 | d >>> 22) + a << 0;
  25253. c += (a ^ (d | ~b)) + blocks[10] - 1051523;
  25254. c = (c << 15 | c >>> 17) + d << 0;
  25255. b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
  25256. b = (b << 21 | b >>> 11) + c << 0;
  25257. a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
  25258. a = (a << 6 | a >>> 26) + b << 0;
  25259. d += (b ^ (a | ~c)) + blocks[15] - 30611744;
  25260. d = (d << 10 | d >>> 22) + a << 0;
  25261. c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
  25262. c = (c << 15 | c >>> 17) + d << 0;
  25263. b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
  25264. b = (b << 21 | b >>> 11) + c << 0;
  25265. a += (c ^ (b | ~d)) + blocks[4] - 145523070;
  25266. a = (a << 6 | a >>> 26) + b << 0;
  25267. d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
  25268. d = (d << 10 | d >>> 22) + a << 0;
  25269. c += (a ^ (d | ~b)) + blocks[2] + 718787259;
  25270. c = (c << 15 | c >>> 17) + d << 0;
  25271. b += (d ^ (c | ~a)) + blocks[9] - 343485551;
  25272. b = (b << 21 | b >>> 11) + c << 0;
  25273. if (this.first) {
  25274. this.h0 = a + 1732584193 << 0;
  25275. this.h1 = b - 271733879 << 0;
  25276. this.h2 = c - 1732584194 << 0;
  25277. this.h3 = d + 271733878 << 0;
  25278. this.first = false;
  25279. } else {
  25280. this.h0 = this.h0 + a << 0;
  25281. this.h1 = this.h1 + b << 0;
  25282. this.h2 = this.h2 + c << 0;
  25283. this.h3 = this.h3 + d << 0;
  25284. }
  25285. };
  25286. /**
  25287. * @method hex
  25288. * @memberof Md5
  25289. * @instance
  25290. * @description Output hash as hex string
  25291. * @returns {String} Hex string
  25292. * @see {@link md5.hex}
  25293. * @example
  25294. * hash.hex();
  25295. */
  25296. Md5.prototype.hex = function () {
  25297. this.finalize();
  25298. var h0 = this.h0,
  25299. h1 = this.h1,
  25300. h2 = this.h2,
  25301. h3 = this.h3;
  25302. return HEX_CHARS[h0 >> 4 & 0x0F] + HEX_CHARS[h0 & 0x0F] + HEX_CHARS[h0 >> 12 & 0x0F] + HEX_CHARS[h0 >> 8 & 0x0F] + HEX_CHARS[h0 >> 20 & 0x0F] + HEX_CHARS[h0 >> 16 & 0x0F] + HEX_CHARS[h0 >> 28 & 0x0F] + HEX_CHARS[h0 >> 24 & 0x0F] + HEX_CHARS[h1 >> 4 & 0x0F] + HEX_CHARS[h1 & 0x0F] + HEX_CHARS[h1 >> 12 & 0x0F] + HEX_CHARS[h1 >> 8 & 0x0F] + HEX_CHARS[h1 >> 20 & 0x0F] + HEX_CHARS[h1 >> 16 & 0x0F] + HEX_CHARS[h1 >> 28 & 0x0F] + HEX_CHARS[h1 >> 24 & 0x0F] + HEX_CHARS[h2 >> 4 & 0x0F] + HEX_CHARS[h2 & 0x0F] + HEX_CHARS[h2 >> 12 & 0x0F] + HEX_CHARS[h2 >> 8 & 0x0F] + HEX_CHARS[h2 >> 20 & 0x0F] + HEX_CHARS[h2 >> 16 & 0x0F] + HEX_CHARS[h2 >> 28 & 0x0F] + HEX_CHARS[h2 >> 24 & 0x0F] + HEX_CHARS[h3 >> 4 & 0x0F] + HEX_CHARS[h3 & 0x0F] + HEX_CHARS[h3 >> 12 & 0x0F] + HEX_CHARS[h3 >> 8 & 0x0F] + HEX_CHARS[h3 >> 20 & 0x0F] + HEX_CHARS[h3 >> 16 & 0x0F] + HEX_CHARS[h3 >> 28 & 0x0F] + HEX_CHARS[h3 >> 24 & 0x0F];
  25303. };
  25304. /**
  25305. * @method toString
  25306. * @memberof Md5
  25307. * @instance
  25308. * @description Output hash as hex string
  25309. * @returns {String} Hex string
  25310. * @see {@link md5.hex}
  25311. * @example
  25312. * hash.toString();
  25313. */
  25314. Md5.prototype.toString = Md5.prototype.hex;
  25315. /**
  25316. * @method digest
  25317. * @memberof Md5
  25318. * @instance
  25319. * @description Output hash as bytes array
  25320. * @returns {Array} Bytes array
  25321. * @see {@link md5.digest}
  25322. * @example
  25323. * hash.digest();
  25324. */
  25325. Md5.prototype.digest = function () {
  25326. this.finalize();
  25327. var h0 = this.h0,
  25328. h1 = this.h1,
  25329. h2 = this.h2,
  25330. h3 = this.h3;
  25331. return [h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >> 24 & 0xFF];
  25332. };
  25333. /**
  25334. * @method array
  25335. * @memberof Md5
  25336. * @instance
  25337. * @description Output hash as bytes array
  25338. * @returns {Array} Bytes array
  25339. * @see {@link md5.array}
  25340. * @example
  25341. * hash.array();
  25342. */
  25343. Md5.prototype.array = Md5.prototype.digest;
  25344. /**
  25345. * @method arrayBuffer
  25346. * @memberof Md5
  25347. * @instance
  25348. * @description Output hash as ArrayBuffer
  25349. * @returns {ArrayBuffer} ArrayBuffer
  25350. * @see {@link md5.arrayBuffer}
  25351. * @example
  25352. * hash.arrayBuffer();
  25353. */
  25354. Md5.prototype.arrayBuffer = function () {
  25355. this.finalize();
  25356. var buffer = new ArrayBuffer(16);
  25357. var blocks = new Uint32Array(buffer);
  25358. blocks[0] = this.h0;
  25359. blocks[1] = this.h1;
  25360. blocks[2] = this.h2;
  25361. blocks[3] = this.h3;
  25362. return buffer;
  25363. };
  25364. /**
  25365. * @method buffer
  25366. * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
  25367. * @memberof Md5
  25368. * @instance
  25369. * @description Output hash as ArrayBuffer
  25370. * @returns {ArrayBuffer} ArrayBuffer
  25371. * @see {@link md5.buffer}
  25372. * @example
  25373. * hash.buffer();
  25374. */
  25375. Md5.prototype.buffer = Md5.prototype.arrayBuffer;
  25376. /**
  25377. * @method base64
  25378. * @memberof Md5
  25379. * @instance
  25380. * @description Output hash as base64 string
  25381. * @returns {String} base64 string
  25382. * @see {@link md5.base64}
  25383. * @example
  25384. * hash.base64();
  25385. */
  25386. Md5.prototype.base64 = function () {
  25387. var v1,
  25388. v2,
  25389. v3,
  25390. base64Str = '',
  25391. bytes = this.array();
  25392. for (var i = 0; i < 15;) {
  25393. v1 = bytes[i++];
  25394. v2 = bytes[i++];
  25395. v3 = bytes[i++];
  25396. base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] + BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] + BASE64_ENCODE_CHAR[v3 & 63];
  25397. }
  25398. v1 = bytes[i];
  25399. base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[v1 << 4 & 63] + '==';
  25400. return base64Str;
  25401. };
  25402. var exports = createMethod();
  25403. if (COMMON_JS) {
  25404. module.exports = exports;
  25405. } else {
  25406. /**
  25407. * @method md5
  25408. * @description Md5 hash function, export to global in browsers.
  25409. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
  25410. * @returns {String} md5 hashes
  25411. * @example
  25412. * md5(''); // d41d8cd98f00b204e9800998ecf8427e
  25413. * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
  25414. * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
  25415. *
  25416. * // It also supports UTF-8 encoding
  25417. * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
  25418. *
  25419. * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
  25420. * md5([]); // d41d8cd98f00b204e9800998ecf8427e
  25421. * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
  25422. */
  25423. root.md5 = exports;
  25424. if (AMD) {
  25425. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  25426. return exports;
  25427. }).call(exports, __webpack_require__, exports, module),
  25428. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  25429. }
  25430. }
  25431. })();
  25432. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 70), __webpack_require__(/*! (webpack)/buildin/global.js */ 3), __webpack_require__(/*! (webpack)/buildin/module.js */ 72)(module)))
  25433. /***/ }),
  25434. /***/ 7:
  25435. /*!*********************************************************************!*\
  25436. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  25437. \*********************************************************************/
  25438. /*! no static exports found */
  25439. /***/ (function(module, exports) {
  25440. function _iterableToArrayLimit(r, l) {
  25441. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  25442. if (null != t) {
  25443. var e,
  25444. n,
  25445. i,
  25446. u,
  25447. a = [],
  25448. f = !0,
  25449. o = !1;
  25450. try {
  25451. if (i = (t = t.call(r)).next, 0 === l) {
  25452. if (Object(t) !== t) return;
  25453. f = !1;
  25454. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
  25455. ;
  25456. }
  25457. } catch (r) {
  25458. o = !0, n = r;
  25459. } finally {
  25460. try {
  25461. if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
  25462. } finally {
  25463. if (o) throw n;
  25464. }
  25465. }
  25466. return a;
  25467. }
  25468. }
  25469. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  25470. /***/ }),
  25471. /***/ 70:
  25472. /*!********************************************************!*\
  25473. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  25474. \********************************************************/
  25475. /*! no static exports found */
  25476. /***/ (function(module, exports, __webpack_require__) {
  25477. exports.nextTick = function nextTick(fn) {
  25478. var args = Array.prototype.slice.call(arguments);
  25479. args.shift();
  25480. setTimeout(function () {
  25481. fn.apply(null, args);
  25482. }, 0);
  25483. };
  25484. exports.platform = exports.arch =
  25485. exports.execPath = exports.title = 'browser';
  25486. exports.pid = 1;
  25487. exports.browser = true;
  25488. exports.env = {};
  25489. exports.argv = [];
  25490. exports.binding = function (name) {
  25491. throw new Error('No such module. (Possibly not yet loaded)')
  25492. };
  25493. (function () {
  25494. var cwd = '/';
  25495. var path;
  25496. exports.cwd = function () { return cwd };
  25497. exports.chdir = function (dir) {
  25498. if (!path) path = __webpack_require__(/*! path */ 71);
  25499. cwd = path.resolve(dir, cwd);
  25500. };
  25501. })();
  25502. exports.exit = exports.kill =
  25503. exports.umask = exports.dlopen =
  25504. exports.uptime = exports.memoryUsage =
  25505. exports.uvCounters = function() {};
  25506. exports.features = {};
  25507. /***/ }),
  25508. /***/ 71:
  25509. /*!***********************************************!*\
  25510. !*** ./node_modules/path-browserify/index.js ***!
  25511. \***********************************************/
  25512. /*! no static exports found */
  25513. /***/ (function(module, exports, __webpack_require__) {
  25514. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  25515. // backported and transplited with Babel, with backwards-compat fixes
  25516. // Copyright Joyent, Inc. and other Node contributors.
  25517. //
  25518. // Permission is hereby granted, free of charge, to any person obtaining a
  25519. // copy of this software and associated documentation files (the
  25520. // "Software"), to deal in the Software without restriction, including
  25521. // without limitation the rights to use, copy, modify, merge, publish,
  25522. // distribute, sublicense, and/or sell copies of the Software, and to permit
  25523. // persons to whom the Software is furnished to do so, subject to the
  25524. // following conditions:
  25525. //
  25526. // The above copyright notice and this permission notice shall be included
  25527. // in all copies or substantial portions of the Software.
  25528. //
  25529. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  25530. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25531. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  25532. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  25533. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  25534. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  25535. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  25536. // resolves . and .. elements in a path array with directory names there
  25537. // must be no slashes, empty elements, or device names (c:\) in the array
  25538. // (so also no leading and trailing slashes - it does not distinguish
  25539. // relative and absolute paths)
  25540. function normalizeArray(parts, allowAboveRoot) {
  25541. // if the path tries to go above the root, `up` ends up > 0
  25542. var up = 0;
  25543. for (var i = parts.length - 1; i >= 0; i--) {
  25544. var last = parts[i];
  25545. if (last === '.') {
  25546. parts.splice(i, 1);
  25547. } else if (last === '..') {
  25548. parts.splice(i, 1);
  25549. up++;
  25550. } else if (up) {
  25551. parts.splice(i, 1);
  25552. up--;
  25553. }
  25554. }
  25555. // if the path is allowed to go above the root, restore leading ..s
  25556. if (allowAboveRoot) {
  25557. for (; up--; up) {
  25558. parts.unshift('..');
  25559. }
  25560. }
  25561. return parts;
  25562. }
  25563. // path.resolve([from ...], to)
  25564. // posix version
  25565. exports.resolve = function() {
  25566. var resolvedPath = '',
  25567. resolvedAbsolute = false;
  25568. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  25569. var path = (i >= 0) ? arguments[i] : process.cwd();
  25570. // Skip empty and invalid entries
  25571. if (typeof path !== 'string') {
  25572. throw new TypeError('Arguments to path.resolve must be strings');
  25573. } else if (!path) {
  25574. continue;
  25575. }
  25576. resolvedPath = path + '/' + resolvedPath;
  25577. resolvedAbsolute = path.charAt(0) === '/';
  25578. }
  25579. // At this point the path should be resolved to a full absolute path, but
  25580. // handle relative paths to be safe (might happen when process.cwd() fails)
  25581. // Normalize the path
  25582. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  25583. return !!p;
  25584. }), !resolvedAbsolute).join('/');
  25585. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  25586. };
  25587. // path.normalize(path)
  25588. // posix version
  25589. exports.normalize = function(path) {
  25590. var isAbsolute = exports.isAbsolute(path),
  25591. trailingSlash = substr(path, -1) === '/';
  25592. // Normalize the path
  25593. path = normalizeArray(filter(path.split('/'), function(p) {
  25594. return !!p;
  25595. }), !isAbsolute).join('/');
  25596. if (!path && !isAbsolute) {
  25597. path = '.';
  25598. }
  25599. if (path && trailingSlash) {
  25600. path += '/';
  25601. }
  25602. return (isAbsolute ? '/' : '') + path;
  25603. };
  25604. // posix version
  25605. exports.isAbsolute = function(path) {
  25606. return path.charAt(0) === '/';
  25607. };
  25608. // posix version
  25609. exports.join = function() {
  25610. var paths = Array.prototype.slice.call(arguments, 0);
  25611. return exports.normalize(filter(paths, function(p, index) {
  25612. if (typeof p !== 'string') {
  25613. throw new TypeError('Arguments to path.join must be strings');
  25614. }
  25615. return p;
  25616. }).join('/'));
  25617. };
  25618. // path.relative(from, to)
  25619. // posix version
  25620. exports.relative = function(from, to) {
  25621. from = exports.resolve(from).substr(1);
  25622. to = exports.resolve(to).substr(1);
  25623. function trim(arr) {
  25624. var start = 0;
  25625. for (; start < arr.length; start++) {
  25626. if (arr[start] !== '') break;
  25627. }
  25628. var end = arr.length - 1;
  25629. for (; end >= 0; end--) {
  25630. if (arr[end] !== '') break;
  25631. }
  25632. if (start > end) return [];
  25633. return arr.slice(start, end - start + 1);
  25634. }
  25635. var fromParts = trim(from.split('/'));
  25636. var toParts = trim(to.split('/'));
  25637. var length = Math.min(fromParts.length, toParts.length);
  25638. var samePartsLength = length;
  25639. for (var i = 0; i < length; i++) {
  25640. if (fromParts[i] !== toParts[i]) {
  25641. samePartsLength = i;
  25642. break;
  25643. }
  25644. }
  25645. var outputParts = [];
  25646. for (var i = samePartsLength; i < fromParts.length; i++) {
  25647. outputParts.push('..');
  25648. }
  25649. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  25650. return outputParts.join('/');
  25651. };
  25652. exports.sep = '/';
  25653. exports.delimiter = ':';
  25654. exports.dirname = function (path) {
  25655. if (typeof path !== 'string') path = path + '';
  25656. if (path.length === 0) return '.';
  25657. var code = path.charCodeAt(0);
  25658. var hasRoot = code === 47 /*/*/;
  25659. var end = -1;
  25660. var matchedSlash = true;
  25661. for (var i = path.length - 1; i >= 1; --i) {
  25662. code = path.charCodeAt(i);
  25663. if (code === 47 /*/*/) {
  25664. if (!matchedSlash) {
  25665. end = i;
  25666. break;
  25667. }
  25668. } else {
  25669. // We saw the first non-path separator
  25670. matchedSlash = false;
  25671. }
  25672. }
  25673. if (end === -1) return hasRoot ? '/' : '.';
  25674. if (hasRoot && end === 1) {
  25675. // return '//';
  25676. // Backwards-compat fix:
  25677. return '/';
  25678. }
  25679. return path.slice(0, end);
  25680. };
  25681. function basename(path) {
  25682. if (typeof path !== 'string') path = path + '';
  25683. var start = 0;
  25684. var end = -1;
  25685. var matchedSlash = true;
  25686. var i;
  25687. for (i = path.length - 1; i >= 0; --i) {
  25688. if (path.charCodeAt(i) === 47 /*/*/) {
  25689. // If we reached a path separator that was not part of a set of path
  25690. // separators at the end of the string, stop now
  25691. if (!matchedSlash) {
  25692. start = i + 1;
  25693. break;
  25694. }
  25695. } else if (end === -1) {
  25696. // We saw the first non-path separator, mark this as the end of our
  25697. // path component
  25698. matchedSlash = false;
  25699. end = i + 1;
  25700. }
  25701. }
  25702. if (end === -1) return '';
  25703. return path.slice(start, end);
  25704. }
  25705. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  25706. // in new Node.js versions, so only basename() above is backported here
  25707. exports.basename = function (path, ext) {
  25708. var f = basename(path);
  25709. if (ext && f.substr(-1 * ext.length) === ext) {
  25710. f = f.substr(0, f.length - ext.length);
  25711. }
  25712. return f;
  25713. };
  25714. exports.extname = function (path) {
  25715. if (typeof path !== 'string') path = path + '';
  25716. var startDot = -1;
  25717. var startPart = 0;
  25718. var end = -1;
  25719. var matchedSlash = true;
  25720. // Track the state of characters (if any) we see before our first dot and
  25721. // after any path separator we find
  25722. var preDotState = 0;
  25723. for (var i = path.length - 1; i >= 0; --i) {
  25724. var code = path.charCodeAt(i);
  25725. if (code === 47 /*/*/) {
  25726. // If we reached a path separator that was not part of a set of path
  25727. // separators at the end of the string, stop now
  25728. if (!matchedSlash) {
  25729. startPart = i + 1;
  25730. break;
  25731. }
  25732. continue;
  25733. }
  25734. if (end === -1) {
  25735. // We saw the first non-path separator, mark this as the end of our
  25736. // extension
  25737. matchedSlash = false;
  25738. end = i + 1;
  25739. }
  25740. if (code === 46 /*.*/) {
  25741. // If this is our first dot, mark it as the start of our extension
  25742. if (startDot === -1)
  25743. startDot = i;
  25744. else if (preDotState !== 1)
  25745. preDotState = 1;
  25746. } else if (startDot !== -1) {
  25747. // We saw a non-dot and non-path separator before our dot, so we should
  25748. // have a good chance at having a non-empty extension
  25749. preDotState = -1;
  25750. }
  25751. }
  25752. if (startDot === -1 || end === -1 ||
  25753. // We saw a non-dot character immediately before the dot
  25754. preDotState === 0 ||
  25755. // The (right-most) trimmed path component is exactly '..'
  25756. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  25757. return '';
  25758. }
  25759. return path.slice(startDot, end);
  25760. };
  25761. function filter (xs, f) {
  25762. if (xs.filter) return xs.filter(f);
  25763. var res = [];
  25764. for (var i = 0; i < xs.length; i++) {
  25765. if (f(xs[i], i, xs)) res.push(xs[i]);
  25766. }
  25767. return res;
  25768. }
  25769. // String.prototype.substr - negative index don't work in IE8
  25770. var substr = 'ab'.substr(-1) === 'b'
  25771. ? function (str, start, len) { return str.substr(start, len) }
  25772. : function (str, start, len) {
  25773. if (start < 0) start = str.length + start;
  25774. return str.substr(start, len);
  25775. }
  25776. ;
  25777. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 70)))
  25778. /***/ }),
  25779. /***/ 72:
  25780. /*!***********************************!*\
  25781. !*** (webpack)/buildin/module.js ***!
  25782. \***********************************/
  25783. /*! no static exports found */
  25784. /***/ (function(module, exports) {
  25785. module.exports = function(module) {
  25786. if (!module.webpackPolyfill) {
  25787. module.deprecate = function() {};
  25788. module.paths = [];
  25789. // module.parent = undefined by default
  25790. if (!module.children) module.children = [];
  25791. Object.defineProperty(module, "loaded", {
  25792. enumerable: true,
  25793. get: function() {
  25794. return module.l;
  25795. }
  25796. });
  25797. Object.defineProperty(module, "id", {
  25798. enumerable: true,
  25799. get: function() {
  25800. return module.i;
  25801. }
  25802. });
  25803. module.webpackPolyfill = 1;
  25804. }
  25805. return module;
  25806. };
  25807. /***/ }),
  25808. /***/ 73:
  25809. /*!****************************************!*\
  25810. !*** (webpack)/buildin/amd-options.js ***!
  25811. \****************************************/
  25812. /*! no static exports found */
  25813. /***/ (function(module, exports) {
  25814. /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
  25815. module.exports = __webpack_amd_options__;
  25816. /* WEBPACK VAR INJECTION */}.call(this, {}))
  25817. /***/ }),
  25818. /***/ 74:
  25819. /*!*******************************************!*\
  25820. !*** E:/盈通/sulibao-mini/utils/uni_api.js ***!
  25821. \*******************************************/
  25822. /*! no static exports found */
  25823. /***/ (function(module, exports, __webpack_require__) {
  25824. "use strict";
  25825. /* WEBPACK VAR INJECTION */(function(uni) {
  25826. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  25827. Object.defineProperty(exports, "__esModule", {
  25828. value: true
  25829. });
  25830. exports.loadingToast = loadingToast;
  25831. exports.successToast = successToast;
  25832. exports.uniGetImageInfo = uniGetImageInfo;
  25833. exports.uniHideLoading = uniHideLoading;
  25834. exports.uniHideToast = uniHideToast;
  25835. exports.uniNavigateBackMiniProgram = uniNavigateBackMiniProgram;
  25836. exports.uniNavigateToMiniProgram = uniNavigateToMiniProgram;
  25837. exports.uniNavigator = uniNavigator;
  25838. exports.uniSelectorQueryInfo = uniSelectorQueryInfo;
  25839. exports.uniSetNavigationBarColor = uniSetNavigationBarColor;
  25840. exports.uniShowModal = uniShowModal;
  25841. exports.uniShowToast = uniShowToast;
  25842. exports.uniStartPullDownRefresh = uniStartPullDownRefresh;
  25843. exports.uniStopPullDownRefresh = uniStopPullDownRefresh;
  25844. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  25845. 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; }
  25846. 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; }
  25847. // 对uni中的交互反馈相关api组件进行封装 showToast、showModal
  25848. function uniShowToast() {
  25849. var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '提示语';
  25850. var icon = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "none";
  25851. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  25852. var _args$image = args.image,
  25853. image = _args$image === void 0 ? '' : _args$image,
  25854. _args$mask = args.mask,
  25855. mask = _args$mask === void 0 ? false : _args$mask,
  25856. _args$duration = args.duration,
  25857. duration = _args$duration === void 0 ? 1500 : _args$duration,
  25858. position = args.position,
  25859. success = args.success,
  25860. fail = args.fail,
  25861. complete = args.complete;
  25862. var toast = {
  25863. title: title,
  25864. icon: icon,
  25865. duration: duration
  25866. };
  25867. if (image) {
  25868. toast['image'] = image;
  25869. }
  25870. if (mask) {
  25871. toast['mask'] = mask;
  25872. }
  25873. uni.showToast(_objectSpread(_objectSpread({}, toast), callBack(toast, {
  25874. success: success,
  25875. fail: fail,
  25876. complete: complete
  25877. })));
  25878. }
  25879. function uniHideToast() {
  25880. uni.hideToast();
  25881. }
  25882. function uniHideLoading() {
  25883. uni.hideLoading();
  25884. }
  25885. function successToast() {
  25886. var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '成功';
  25887. var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  25888. uniShowToast(title, "success", args);
  25889. }
  25890. function loadingToast() {
  25891. var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '加载中';
  25892. var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  25893. var _args$mask2 = args.mask,
  25894. mask = _args$mask2 === void 0 ? true : _args$mask2,
  25895. success = args.success,
  25896. fail = args.fail,
  25897. complete = args.complete;
  25898. var loading = {
  25899. title: title
  25900. };
  25901. if (mask) {
  25902. loading['mask'] = mask;
  25903. }
  25904. uni.showLoading(_objectSpread(_objectSpread({}, loading), {}, {
  25905. mask: true
  25906. }, callBack(loading, {
  25907. success: success,
  25908. fail: fail,
  25909. complete: complete
  25910. })));
  25911. }
  25912. function uniShowModal(title, content) {
  25913. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  25914. var _args$showCancel = args.showCancel,
  25915. showCancel = _args$showCancel === void 0 ? true : _args$showCancel,
  25916. _args$cancelText = args.cancelText,
  25917. cancelText = _args$cancelText === void 0 ? "取消" : _args$cancelText,
  25918. cancelColor = args.cancelColor,
  25919. _args$confirmText = args.confirmText,
  25920. confirmText = _args$confirmText === void 0 ? "确定" : _args$confirmText,
  25921. confirmColor = args.confirmColor,
  25922. success = args.success,
  25923. fail = args.fail,
  25924. complete = args.complete;
  25925. var modal = {
  25926. title: title,
  25927. content: content,
  25928. showCancel: showCancel,
  25929. cancelText: cancelText,
  25930. confirmText: confirmText
  25931. };
  25932. if (cancelColor) {
  25933. modal['cancelColor'] = cancelColor;
  25934. }
  25935. if (confirmColor) {
  25936. modal['confirmColor'] = confirmColor;
  25937. }
  25938. uni.showModal(_objectSpread(_objectSpread({}, modal), callBack(modal, {
  25939. success: success,
  25940. fail: fail,
  25941. complete: complete
  25942. })));
  25943. }
  25944. function uniNavigator(url) {
  25945. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'navigateTo';
  25946. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  25947. type = Number(url) ? 'navigateBack' : type || 'navigateTo';
  25948. var _args$endtime = args.endtime,
  25949. endtime = _args$endtime === void 0 ? Number(url) ? 600 : 200 : _args$endtime,
  25950. animationType = args.animationType,
  25951. animationDuration = args.animationDuration,
  25952. success = args.success,
  25953. fail = args.fail,
  25954. complete = args.complete;
  25955. var obj = {
  25956. url: url
  25957. };
  25958. obj = callBack(obj, {
  25959. success: success,
  25960. fail: fail,
  25961. complete: complete
  25962. });
  25963. console.log(obj);
  25964. switch (type) {
  25965. case 'navigateTo':
  25966. setTimeout(function () {
  25967. uni.navigateTo(obj);
  25968. }, endtime);
  25969. break;
  25970. case 'redirectTo':
  25971. setTimeout(function () {
  25972. uni.redirectTo(obj);
  25973. }, endtime);
  25974. break;
  25975. case 'reLaunch':
  25976. setTimeout(function () {
  25977. uni.reLaunch(obj);
  25978. }, endtime);
  25979. break;
  25980. case 'switchTab':
  25981. setTimeout(function () {
  25982. uni.switchTab(obj);
  25983. }, endtime);
  25984. break;
  25985. case 'navigateBack':
  25986. setTimeout(function () {
  25987. var history = getCurrentPages();
  25988. if (history.length > 1) {
  25989. uni.navigateBack({
  25990. delta: Number(url)
  25991. });
  25992. } else {
  25993. uni.switchTab({
  25994. url: '/pages/index/index'
  25995. });
  25996. }
  25997. }, endtime);
  25998. break;
  25999. }
  26000. }
  26001. function uniStartPullDownRefresh() {
  26002. var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  26003. uni.startPullDownRefresh(args);
  26004. }
  26005. function uniStopPullDownRefresh() {
  26006. var endtime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
  26007. setTimeout(function () {
  26008. uni.stopPullDownRefresh();
  26009. }, endtime);
  26010. }
  26011. // 获取图片信息
  26012. function uniGetImageInfo(path) {
  26013. return new Promise(function (resolve, reject) {
  26014. uni.getImageInfo({
  26015. src: path,
  26016. success: function success(res) {
  26017. console.log(res);
  26018. resolve(res);
  26019. },
  26020. fail: function fail(err) {
  26021. console.log(err);
  26022. reject(err);
  26023. }
  26024. });
  26025. });
  26026. }
  26027. // 获取节点信息
  26028. function uniSelectorQueryInfo(selector, _this) {
  26029. return new Promise(function (resolve, reject) {
  26030. var query = uni.createSelectorQuery().in(_this);
  26031. query.select(selector).boundingClientRect(function (res) {
  26032. // 获取节点坐标
  26033. resolve(res);
  26034. }).exec();
  26035. });
  26036. }
  26037. // 设置导航栏颜色
  26038. function uniSetNavigationBarColor() {
  26039. var backgroundColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "#e93323";
  26040. var frontColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#ffffff";
  26041. uni.setNavigationBarColor({
  26042. frontColor: frontColor,
  26043. backgroundColor: backgroundColor,
  26044. animation: {
  26045. duration: 400,
  26046. timingFunc: 'easeIn'
  26047. }
  26048. });
  26049. }
  26050. // 跳转小程序
  26051. function uniNavigateToMiniProgram(appId) {
  26052. var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26053. var path = args.path,
  26054. _args$extraData = args.extraData,
  26055. extraData = _args$extraData === void 0 ? {
  26056. from: '跳转小程序要携带的信息'
  26057. } : _args$extraData,
  26058. envVersion = args.envVersion,
  26059. success = args.success,
  26060. fail = args.fail,
  26061. complete = args.complete;
  26062. var obj = {
  26063. path: path,
  26064. extraData: extraData,
  26065. envVersion: envVersion
  26066. };
  26067. obj = callBack(obj, {
  26068. success: success,
  26069. fail: fail,
  26070. complete: complete
  26071. });
  26072. uni.navigateToMiniProgram(_objectSpread({
  26073. appId: ''
  26074. }, obj));
  26075. }
  26076. // 返回上一个小程序
  26077. function uniNavigateBackMiniProgram() {
  26078. var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  26079. var _args$extraData2 = args.extraData,
  26080. extraData = _args$extraData2 === void 0 ? {
  26081. from: '返回上一个小程序要携带的信息'
  26082. } : _args$extraData2,
  26083. success = args.success,
  26084. fail = args.fail,
  26085. complete = args.complete;
  26086. var obj = {
  26087. extraData: extraData
  26088. };
  26089. obj = callBack(obj, {
  26090. success: success,
  26091. fail: fail,
  26092. complete: complete
  26093. });
  26094. uni.navigateBackMiniProgram(_objectSpread({}, obj));
  26095. }
  26096. function callBack() {
  26097. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  26098. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26099. var success = options.success,
  26100. fail = options.fail,
  26101. complete = options.complete;
  26102. if (success) {
  26103. name['success'] = function (res) {
  26104. success(res);
  26105. };
  26106. }
  26107. if (fail) {
  26108. name['fail'] = function (err) {
  26109. fail(err);
  26110. };
  26111. }
  26112. if (complete) {
  26113. name['complete'] = function (res) {
  26114. complete(res);
  26115. };
  26116. }
  26117. return name;
  26118. }
  26119. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  26120. /***/ }),
  26121. /***/ 75:
  26122. /*!************************************!*\
  26123. !*** E:/盈通/sulibao-mini/config.js ***!
  26124. \************************************/
  26125. /*! no static exports found */
  26126. /***/ (function(module, exports, __webpack_require__) {
  26127. "use strict";
  26128. /* WEBPACK VAR INJECTION */(function(wx) {
  26129. Object.defineProperty(exports, "__esModule", {
  26130. value: true
  26131. });
  26132. exports.WECHAT_LOGIN = exports.WECHAT_AUTH_BACK_URL = exports.VUE_APP_URL = void 0;
  26133. // api请求地址
  26134. var ApiURL = 'https://api.lx-device.com';
  26135. if (wx.getAccountInfoSync() && (wx.getAccountInfoSync().miniProgram.envVersion == 'develop' || wx.getAccountInfoSync().miniProgram.envVersion == 'trial')) {
  26136. ApiURL = 'http://slb-m.dev.ml1993.com/lx-api';
  26137. }
  26138. var VUE_APP_URL = ApiURL; //开发版体验 连接开发前管控制器
  26139. // export const VUE_APP_URL = 'http://192.168.11.67:8032'; //开发版体验 连接开发前管控制器
  26140. // 公众号中是否使用公众号授权登录 true公众号授权->auth界面下一步操作 false直接跳转login登录界面
  26141. exports.VUE_APP_URL = VUE_APP_URL;
  26142. var WECHAT_LOGIN = true;
  26143. // 授权之后返回原有地址
  26144. exports.WECHAT_LOGIN = WECHAT_LOGIN;
  26145. var WECHAT_AUTH_BACK_URL = 'WECHAT_AUTH_BACK_URL';
  26146. exports.WECHAT_AUTH_BACK_URL = WECHAT_AUTH_BACK_URL;
  26147. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  26148. /***/ }),
  26149. /***/ 8:
  26150. /*!***************************************************************************!*\
  26151. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  26152. \***************************************************************************/
  26153. /*! no static exports found */
  26154. /***/ (function(module, exports, __webpack_require__) {
  26155. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  26156. function _unsupportedIterableToArray(o, minLen) {
  26157. if (!o) return;
  26158. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  26159. var n = Object.prototype.toString.call(o).slice(8, -1);
  26160. if (n === "Object" && o.constructor) n = o.constructor.name;
  26161. if (n === "Map" || n === "Set") return Array.from(o);
  26162. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  26163. }
  26164. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  26165. /***/ }),
  26166. /***/ 9:
  26167. /*!*****************************************************************!*\
  26168. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  26169. \*****************************************************************/
  26170. /*! no static exports found */
  26171. /***/ (function(module, exports) {
  26172. function _arrayLikeToArray(arr, len) {
  26173. if (len == null || len > arr.length) len = arr.length;
  26174. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  26175. arr2[i] = arr[i];
  26176. }
  26177. return arr2;
  26178. }
  26179. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  26180. /***/ })
  26181. }]);
  26182. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map