vendor.js 775 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308
  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. /***/ 115:
  76. /*!**************************************************************************!*\
  77. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistScore.js ***!
  78. \**************************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. "use strict";
  82. Object.defineProperty(exports, "__esModule", {
  83. value: true
  84. });
  85. exports.batchSatisfactionChecklist = batchSatisfactionChecklist;
  86. exports.getChecklistScoreRecordByList = getChecklistScoreRecordByList;
  87. exports.getChecklistScoreRecordByPage = getChecklistScoreRecordByPage;
  88. exports.getScoreRecordView = getScoreRecordView;
  89. exports.getScoreView = getScoreView;
  90. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  91. /**
  92. * 获取评分清单视图
  93. * @param data
  94. *
  95. * @returns
  96. */
  97. function getScoreView(checklistId) {
  98. return (0, _request.request)({
  99. url: "/checklist/view/".concat(checklistId),
  100. method: 'GET'
  101. });
  102. }
  103. /**
  104. * 获取评分清单记录视图
  105. * @param data
  106. *
  107. * @returns
  108. */
  109. function getScoreRecordView(recordId, checklistId) {
  110. return (0, _request.request)({
  111. url: "/checklist/score/record/view/".concat(recordId, "/").concat(checklistId),
  112. method: 'GET'
  113. });
  114. }
  115. // 2. 一次批量提交
  116. function batchSatisfactionChecklist(data) {
  117. return (0, _request.request)({
  118. url: "/checklist/score/record/batch",
  119. method: 'POST',
  120. data: data
  121. });
  122. }
  123. /**
  124. * 获取Checklist列表
  125. * @param data
  126. * @returns
  127. */
  128. function getChecklistScoreRecordByList(data) {
  129. return (0, _request.request)({
  130. url: '/checklist/score/record',
  131. method: 'GET',
  132. data: data
  133. });
  134. }
  135. /**
  136. * 获取Checklist列表
  137. * @param data
  138. * @returns
  139. */
  140. function getChecklistScoreRecordByPage(data) {
  141. return (0, _request.request)({
  142. url: '/checklist/score/record/page',
  143. method: 'GET',
  144. data: data
  145. });
  146. }
  147. /***/ }),
  148. /***/ 12:
  149. /*!**************************************************************!*\
  150. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  151. \**************************************************************/
  152. /*! no static exports found */
  153. /***/ (function(module, exports, __webpack_require__) {
  154. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  155. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  156. function _toPropertyKey(arg) {
  157. var key = toPrimitive(arg, "string");
  158. return _typeof(key) === "symbol" ? key : String(key);
  159. }
  160. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  161. /***/ }),
  162. /***/ 13:
  163. /*!*******************************************************!*\
  164. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  165. \*******************************************************/
  166. /*! no static exports found */
  167. /***/ (function(module, exports) {
  168. function _typeof(obj) {
  169. "@babel/helpers - typeof";
  170. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  171. return typeof obj;
  172. } : function (obj) {
  173. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  174. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  175. }
  176. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  177. /***/ }),
  178. /***/ 130:
  179. /*!**********************************************************************!*\
  180. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/groupApi.js ***!
  181. \**********************************************************************/
  182. /*! no static exports found */
  183. /***/ (function(module, exports, __webpack_require__) {
  184. "use strict";
  185. Object.defineProperty(exports, "__esModule", {
  186. value: true
  187. });
  188. exports.createGroup = createGroup;
  189. exports.deleteGroupById = deleteGroupById;
  190. exports.getGroupById = getGroupById;
  191. exports.getGroupByList = getGroupByList;
  192. exports.getGroupView = getGroupView;
  193. exports.updateGroup = updateGroup;
  194. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  195. /**
  196. * 获取部门列表
  197. * @returns
  198. */
  199. function getGroupByList() {
  200. return (0, _request.request)({
  201. url: '/group',
  202. method: 'GET'
  203. });
  204. }
  205. /**
  206. * 根据ID获取
  207. * @returns
  208. * @param groupId
  209. */
  210. function getGroupById(groupId) {
  211. return (0, _request.request)({
  212. url: "/group/".concat(groupId),
  213. method: 'GET'
  214. });
  215. }
  216. /**
  217. * 添加部门
  218. * @param data
  219. * @returns
  220. */
  221. function createGroup(data) {
  222. return (0, _request.request)({
  223. url: "/group/add",
  224. method: 'POST',
  225. data: data
  226. });
  227. }
  228. /**
  229. * 更新部门
  230. * @param data
  231. * @returns
  232. */
  233. function updateGroup(data) {
  234. return (0, _request.request)({
  235. url: "/group/update",
  236. method: 'PUT',
  237. data: data
  238. });
  239. }
  240. /**
  241. * 删除部门
  242. * @returns
  243. * @param groupId
  244. */
  245. function deleteGroupById(groupId) {
  246. return (0, _request.request)({
  247. url: "/group/".concat(groupId),
  248. method: 'DELETE'
  249. });
  250. }
  251. /**
  252. * 获取部门列表
  253. * @returns
  254. */
  255. function getGroupView() {
  256. return (0, _request.request)({
  257. url: '/group/view',
  258. method: 'GET'
  259. });
  260. }
  261. /***/ }),
  262. /***/ 131:
  263. /*!*************************************************************!*\
  264. !*** E:/work/Project_newGit/hptwxMiniProgram/api/danger.js ***!
  265. \*************************************************************/
  266. /*! no static exports found */
  267. /***/ (function(module, exports, __webpack_require__) {
  268. "use strict";
  269. Object.defineProperty(exports, "__esModule", {
  270. value: true
  271. });
  272. exports.getDangerCatByList = getDangerCatByList;
  273. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  274. /**
  275. * 列表查询Danger Category
  276. * @returns
  277. */
  278. function getDangerCatByList() {
  279. return (0, _request.request)({
  280. url: '/danger/cat',
  281. method: 'GET'
  282. });
  283. }
  284. /***/ }),
  285. /***/ 132:
  286. /*!****************************************************************!*\
  287. !*** E:/work/Project_newGit/hptwxMiniProgram/api/riskPiont.js ***!
  288. \****************************************************************/
  289. /*! no static exports found */
  290. /***/ (function(module, exports, __webpack_require__) {
  291. "use strict";
  292. Object.defineProperty(exports, "__esModule", {
  293. value: true
  294. });
  295. exports.getRiskPointByList = getRiskPointByList;
  296. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  297. /**
  298. * 列表查询
  299. * @returns
  300. */
  301. function getRiskPointByList(data) {
  302. return (0, _request.request)({
  303. url: '/riskPoint',
  304. method: 'GET',
  305. params: data
  306. });
  307. }
  308. /***/ }),
  309. /***/ 133:
  310. /*!***********************************************************************!*\
  311. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/dangerApi.js ***!
  312. \***********************************************************************/
  313. /*! no static exports found */
  314. /***/ (function(module, exports, __webpack_require__) {
  315. "use strict";
  316. Object.defineProperty(exports, "__esModule", {
  317. value: true
  318. });
  319. exports.deleteDangerById = deleteDangerById;
  320. exports.getDangerById = getDangerById;
  321. exports.getDangerByList = getDangerByList;
  322. exports.getDangerByPage = getDangerByPage;
  323. exports.handleDanger = handleDanger;
  324. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  325. /**
  326. * 获取Danger列表
  327. * @param data
  328. * @returns
  329. */
  330. function getDangerByList(data) {
  331. return (0, _request.request)({
  332. url: '/danger',
  333. method: 'GET',
  334. params: data
  335. });
  336. }
  337. /**
  338. * 获取Danger分页
  339. * @param data
  340. * @returns
  341. */
  342. function getDangerByPage(data) {
  343. return (0, _request.request)({
  344. url: '/danger/page',
  345. method: 'GET',
  346. params: data
  347. });
  348. }
  349. /**
  350. * 根据Id获取Danger
  351. * @param dangerId
  352. * @returns
  353. */
  354. function getDangerById(dangerId) {
  355. return (0, _request.request)({
  356. url: "/danger/".concat(dangerId),
  357. method: 'GET'
  358. });
  359. }
  360. /**
  361. * 删除Danger
  362. * @param dangerId
  363. * @returns
  364. */
  365. function deleteDangerById(dangerId) {
  366. return (0, _request.request)({
  367. url: "/danger/".concat(dangerId),
  368. method: 'DELETE'
  369. });
  370. }
  371. /**
  372. * 处理Danger
  373. * @param data
  374. * @returns
  375. */
  376. function handleDanger(data) {
  377. return (0, _request.request)({
  378. url: "/danger/handle",
  379. method: 'POST',
  380. data: data
  381. });
  382. }
  383. /***/ }),
  384. /***/ 134:
  385. /*!********************************************************************!*\
  386. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/upload.js ***!
  387. \********************************************************************/
  388. /*! no static exports found */
  389. /***/ (function(module, exports, __webpack_require__) {
  390. "use strict";
  391. /* WEBPACK VAR INJECTION */(function(uni) {
  392. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  393. Object.defineProperty(exports, "__esModule", {
  394. value: true
  395. });
  396. exports.upload = void 0;
  397. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  398. var _auth = __webpack_require__(/*! @/utils/auth.js */ 49);
  399. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  400. var baseUrl = true ? _index.default.base.dev : undefined;
  401. var upload = function upload(_ref) {
  402. var formData = _ref.formData,
  403. filePath = _ref.filePath,
  404. callback = _ref.callback;
  405. uni.showLoading({
  406. mask: true,
  407. title: "上传中"
  408. });
  409. var unionid = uni.getStorageSync('unionid');
  410. var qrcode = uni.getStorageSync('qrcode');
  411. var isAccount = uni.getStorageSync('isAccount');
  412. return new Promise(function (resolve, reject) {
  413. var _header;
  414. var uploadTask = uni.uploadFile({
  415. url: baseUrl + '/upload/file',
  416. filePath: filePath,
  417. header: (_header = {}, (0, _defineProperty2.default)(_header, _index.default.TokenKey, (0, _auth.getToken)()), (0, _defineProperty2.default)(_header, "AppID", _index.default.appID), (0, _defineProperty2.default)(_header, "AppKey", _index.default.appKey), (0, _defineProperty2.default)(_header, "AppSecret", _index.default.appSecret), (0, _defineProperty2.default)(_header, "wxCode", unionid), (0, _defineProperty2.default)(_header, "ocId", qrcode.ocId), (0, _defineProperty2.default)(_header, "AppType", 'mini'), (0, _defineProperty2.default)(_header, "isAccount", isAccount), _header),
  418. name: 'file',
  419. formData: formData,
  420. success: function success(uploadFileRes) {
  421. uni.hideLoading();
  422. resolve(uploadFileRes.data);
  423. },
  424. fail: function fail(_ref2) {
  425. var errMsg = _ref2.errMsg;
  426. uni.hideLoading({
  427. mask: true,
  428. title: "上传失败"
  429. });
  430. reject(errMsg);
  431. }
  432. });
  433. if (callback) {
  434. callback(uploadTask);
  435. }
  436. });
  437. };
  438. exports.upload = upload;
  439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  440. /***/ }),
  441. /***/ 14:
  442. /*!************************************************************!*\
  443. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  444. \************************************************************/
  445. /*! no static exports found */
  446. /***/ (function(module, exports, __webpack_require__) {
  447. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  448. function _toPrimitive(input, hint) {
  449. if (_typeof(input) !== "object" || input === null) return input;
  450. var prim = input[Symbol.toPrimitive];
  451. if (prim !== undefined) {
  452. var res = prim.call(input, hint || "default");
  453. if (_typeof(res) !== "object") return res;
  454. throw new TypeError("@@toPrimitive must return a primitive value.");
  455. }
  456. return (hint === "string" ? String : Number)(input);
  457. }
  458. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  459. /***/ }),
  460. /***/ 15:
  461. /*!**********************************************************!*\
  462. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  463. \**********************************************************/
  464. /*! no static exports found */
  465. /***/ (function(module, exports, __webpack_require__) {
  466. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  467. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  468. function _construct(Parent, args, Class) {
  469. if (isNativeReflectConstruct()) {
  470. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  471. } else {
  472. module.exports = _construct = function _construct(Parent, args, Class) {
  473. var a = [null];
  474. a.push.apply(a, args);
  475. var Constructor = Function.bind.apply(Parent, a);
  476. var instance = new Constructor();
  477. if (Class) setPrototypeOf(instance, Class.prototype);
  478. return instance;
  479. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  480. }
  481. return _construct.apply(null, arguments);
  482. }
  483. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  484. /***/ }),
  485. /***/ 16:
  486. /*!***************************************************************!*\
  487. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  488. \***************************************************************/
  489. /*! no static exports found */
  490. /***/ (function(module, exports) {
  491. function _setPrototypeOf(o, p) {
  492. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  493. o.__proto__ = p;
  494. return o;
  495. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  496. return _setPrototypeOf(o, p);
  497. }
  498. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  499. /***/ }),
  500. /***/ 17:
  501. /*!*************************************************************************!*\
  502. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  503. \*************************************************************************/
  504. /*! no static exports found */
  505. /***/ (function(module, exports) {
  506. function _isNativeReflectConstruct() {
  507. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  508. if (Reflect.construct.sham) return false;
  509. if (typeof Proxy === "function") return true;
  510. try {
  511. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  512. return true;
  513. } catch (e) {
  514. return false;
  515. }
  516. }
  517. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  518. /***/ }),
  519. /***/ 18:
  520. /*!******************************************************************!*\
  521. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  522. \******************************************************************/
  523. /*! no static exports found */
  524. /***/ (function(module, exports, __webpack_require__) {
  525. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  526. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  527. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  528. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  529. function _toConsumableArray(arr) {
  530. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  531. }
  532. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  533. /***/ }),
  534. /***/ 181:
  535. /*!************************************************************************************!*\
  536. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistHazardRecordApi.js ***!
  537. \************************************************************************************/
  538. /*! no static exports found */
  539. /***/ (function(module, exports, __webpack_require__) {
  540. "use strict";
  541. Object.defineProperty(exports, "__esModule", {
  542. value: true
  543. });
  544. exports.batchUpdateChecklistHazardRecordDoing = batchUpdateChecklistHazardRecordDoing;
  545. exports.cancelChecklistDoing = cancelChecklistDoing;
  546. exports.completeChecklistDoing = completeChecklistDoing;
  547. exports.getChecklistHazardRecordViewById = getChecklistHazardRecordViewById;
  548. exports.initChecklistHazardRecord = initChecklistHazardRecord;
  549. exports.updateChecklistHazardRecordDoing = updateChecklistHazardRecordDoing;
  550. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  551. /**
  552. * 根据Id获取Checklist Score Record Data
  553. * @param recordId
  554. * @param checklistId
  555. * @returns
  556. */
  557. function getChecklistHazardRecordViewById(recordId, checklistId) {
  558. return (0, _request.request)({
  559. url: "/checklist/hazard/record/view/".concat(recordId, "/").concat(checklistId),
  560. method: 'GET'
  561. });
  562. }
  563. /**
  564. * 初始化
  565. * @returns
  566. * @param data
  567. */
  568. function initChecklistHazardRecord(data) {
  569. return (0, _request.request)({
  570. url: "/checklist/hazard/record/init",
  571. method: 'POST',
  572. data: data
  573. });
  574. }
  575. /**
  576. * 根据Id获取Checklist Score Record Data
  577. * @param recordId
  578. * @param checklistId
  579. * @returns
  580. */
  581. function completeChecklistDoing(recordId) {
  582. return (0, _request.request)({
  583. url: "/checklist/hazard/record/complete/".concat(recordId),
  584. method: 'PUT'
  585. });
  586. }
  587. /**
  588. * 根据Id获取Checklist Score Record Data
  589. * @param recordId
  590. * @returns
  591. */
  592. function cancelChecklistDoing(recordId) {
  593. return (0, _request.request)({
  594. url: "/checklist/point/record/complete/".concat(recordId),
  595. method: 'PUT'
  596. });
  597. }
  598. /**
  599. * 更新CheckTaskDoing Item
  600. * @param data
  601. * @returns
  602. */
  603. function updateChecklistHazardRecordDoing(data) {
  604. return (0, _request.request)({
  605. url: "/checklist/hazard/record/doing/update",
  606. method: 'PUT',
  607. data: data
  608. });
  609. }
  610. /**
  611. * 批量更新CheckTaskDoing Item
  612. * @returns
  613. * @param recordId
  614. * @param checkResult
  615. */
  616. function batchUpdateChecklistHazardRecordDoing(recordId, checkResult) {
  617. return (0, _request.request)({
  618. url: "/checklist/hazard/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  619. method: 'PUT'
  620. });
  621. }
  622. /***/ }),
  623. /***/ 19:
  624. /*!******************************************************************!*\
  625. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  626. \******************************************************************/
  627. /*! no static exports found */
  628. /***/ (function(module, exports, __webpack_require__) {
  629. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  630. function _arrayWithoutHoles(arr) {
  631. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  632. }
  633. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  634. /***/ }),
  635. /***/ 2:
  636. /*!************************************************************!*\
  637. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  638. \************************************************************/
  639. /*! no static exports found */
  640. /***/ (function(module, exports, __webpack_require__) {
  641. "use strict";
  642. /* WEBPACK VAR INJECTION */(function(wx, global) {
  643. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  644. Object.defineProperty(exports, "__esModule", {
  645. value: true
  646. });
  647. exports.createApp = createApp;
  648. exports.createComponent = createComponent;
  649. exports.createPage = createPage;
  650. exports.createPlugin = createPlugin;
  651. exports.createSubpackageApp = createSubpackageApp;
  652. exports.default = void 0;
  653. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  654. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  655. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  656. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  657. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  658. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  659. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  660. 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; }
  661. 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; }
  662. var realAtob;
  663. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  664. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  665. if (typeof atob !== 'function') {
  666. realAtob = function realAtob(str) {
  667. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  668. if (!b64re.test(str)) {
  669. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  670. }
  671. // Adding the padding if missing, for semplicity
  672. str += '=='.slice(2 - (str.length & 3));
  673. var bitmap;
  674. var result = '';
  675. var r1;
  676. var r2;
  677. var i = 0;
  678. for (; i < str.length;) {
  679. 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++)));
  680. 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);
  681. }
  682. return result;
  683. };
  684. } else {
  685. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  686. realAtob = atob;
  687. }
  688. function b64DecodeUnicode(str) {
  689. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  690. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  691. }).join(''));
  692. }
  693. function getCurrentUserInfo() {
  694. var token = wx.getStorageSync('uni_id_token') || '';
  695. var tokenArr = token.split('.');
  696. if (!token || tokenArr.length !== 3) {
  697. return {
  698. uid: null,
  699. role: [],
  700. permission: [],
  701. tokenExpired: 0
  702. };
  703. }
  704. var userInfo;
  705. try {
  706. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  707. } catch (error) {
  708. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  709. }
  710. userInfo.tokenExpired = userInfo.exp * 1000;
  711. delete userInfo.exp;
  712. delete userInfo.iat;
  713. return userInfo;
  714. }
  715. function uniIdMixin(Vue) {
  716. Vue.prototype.uniIDHasRole = function (roleId) {
  717. var _getCurrentUserInfo = getCurrentUserInfo(),
  718. role = _getCurrentUserInfo.role;
  719. return role.indexOf(roleId) > -1;
  720. };
  721. Vue.prototype.uniIDHasPermission = function (permissionId) {
  722. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  723. permission = _getCurrentUserInfo2.permission;
  724. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  725. };
  726. Vue.prototype.uniIDTokenValid = function () {
  727. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  728. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  729. return tokenExpired > Date.now();
  730. };
  731. }
  732. var _toString = Object.prototype.toString;
  733. var hasOwnProperty = Object.prototype.hasOwnProperty;
  734. function isFn(fn) {
  735. return typeof fn === 'function';
  736. }
  737. function isStr(str) {
  738. return typeof str === 'string';
  739. }
  740. function isObject(obj) {
  741. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  742. }
  743. function isPlainObject(obj) {
  744. return _toString.call(obj) === '[object Object]';
  745. }
  746. function hasOwn(obj, key) {
  747. return hasOwnProperty.call(obj, key);
  748. }
  749. function noop() {}
  750. /**
  751. * Create a cached version of a pure function.
  752. */
  753. function cached(fn) {
  754. var cache = Object.create(null);
  755. return function cachedFn(str) {
  756. var hit = cache[str];
  757. return hit || (cache[str] = fn(str));
  758. };
  759. }
  760. /**
  761. * Camelize a hyphen-delimited string.
  762. */
  763. var camelizeRE = /-(\w)/g;
  764. var camelize = cached(function (str) {
  765. return str.replace(camelizeRE, function (_, c) {
  766. return c ? c.toUpperCase() : '';
  767. });
  768. });
  769. function sortObject(obj) {
  770. var sortObj = {};
  771. if (isPlainObject(obj)) {
  772. Object.keys(obj).sort().forEach(function (key) {
  773. sortObj[key] = obj[key];
  774. });
  775. }
  776. return !Object.keys(sortObj) ? obj : sortObj;
  777. }
  778. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  779. var globalInterceptors = {};
  780. var scopedInterceptors = {};
  781. function mergeHook(parentVal, childVal) {
  782. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  783. return res ? dedupeHooks(res) : res;
  784. }
  785. function dedupeHooks(hooks) {
  786. var res = [];
  787. for (var i = 0; i < hooks.length; i++) {
  788. if (res.indexOf(hooks[i]) === -1) {
  789. res.push(hooks[i]);
  790. }
  791. }
  792. return res;
  793. }
  794. function removeHook(hooks, hook) {
  795. var index = hooks.indexOf(hook);
  796. if (index !== -1) {
  797. hooks.splice(index, 1);
  798. }
  799. }
  800. function mergeInterceptorHook(interceptor, option) {
  801. Object.keys(option).forEach(function (hook) {
  802. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  803. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  804. }
  805. });
  806. }
  807. function removeInterceptorHook(interceptor, option) {
  808. if (!interceptor || !option) {
  809. return;
  810. }
  811. Object.keys(option).forEach(function (hook) {
  812. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  813. removeHook(interceptor[hook], option[hook]);
  814. }
  815. });
  816. }
  817. function addInterceptor(method, option) {
  818. if (typeof method === 'string' && isPlainObject(option)) {
  819. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  820. } else if (isPlainObject(method)) {
  821. mergeInterceptorHook(globalInterceptors, method);
  822. }
  823. }
  824. function removeInterceptor(method, option) {
  825. if (typeof method === 'string') {
  826. if (isPlainObject(option)) {
  827. removeInterceptorHook(scopedInterceptors[method], option);
  828. } else {
  829. delete scopedInterceptors[method];
  830. }
  831. } else if (isPlainObject(method)) {
  832. removeInterceptorHook(globalInterceptors, method);
  833. }
  834. }
  835. function wrapperHook(hook, params) {
  836. return function (data) {
  837. return hook(data, params) || data;
  838. };
  839. }
  840. function isPromise(obj) {
  841. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  842. }
  843. function queue(hooks, data, params) {
  844. var promise = false;
  845. for (var i = 0; i < hooks.length; i++) {
  846. var hook = hooks[i];
  847. if (promise) {
  848. promise = Promise.resolve(wrapperHook(hook, params));
  849. } else {
  850. var res = hook(data, params);
  851. if (isPromise(res)) {
  852. promise = Promise.resolve(res);
  853. }
  854. if (res === false) {
  855. return {
  856. then: function then() {}
  857. };
  858. }
  859. }
  860. }
  861. return promise || {
  862. then: function then(callback) {
  863. return callback(data);
  864. }
  865. };
  866. }
  867. function wrapperOptions(interceptor) {
  868. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  869. ['success', 'fail', 'complete'].forEach(function (name) {
  870. if (Array.isArray(interceptor[name])) {
  871. var oldCallback = options[name];
  872. options[name] = function callbackInterceptor(res) {
  873. queue(interceptor[name], res, options).then(function (res) {
  874. /* eslint-disable no-mixed-operators */
  875. return isFn(oldCallback) && oldCallback(res) || res;
  876. });
  877. };
  878. }
  879. });
  880. return options;
  881. }
  882. function wrapperReturnValue(method, returnValue) {
  883. var returnValueHooks = [];
  884. if (Array.isArray(globalInterceptors.returnValue)) {
  885. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  886. }
  887. var interceptor = scopedInterceptors[method];
  888. if (interceptor && Array.isArray(interceptor.returnValue)) {
  889. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  890. }
  891. returnValueHooks.forEach(function (hook) {
  892. returnValue = hook(returnValue) || returnValue;
  893. });
  894. return returnValue;
  895. }
  896. function getApiInterceptorHooks(method) {
  897. var interceptor = Object.create(null);
  898. Object.keys(globalInterceptors).forEach(function (hook) {
  899. if (hook !== 'returnValue') {
  900. interceptor[hook] = globalInterceptors[hook].slice();
  901. }
  902. });
  903. var scopedInterceptor = scopedInterceptors[method];
  904. if (scopedInterceptor) {
  905. Object.keys(scopedInterceptor).forEach(function (hook) {
  906. if (hook !== 'returnValue') {
  907. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  908. }
  909. });
  910. }
  911. return interceptor;
  912. }
  913. function invokeApi(method, api, options) {
  914. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  915. params[_key - 3] = arguments[_key];
  916. }
  917. var interceptor = getApiInterceptorHooks(method);
  918. if (interceptor && Object.keys(interceptor).length) {
  919. if (Array.isArray(interceptor.invoke)) {
  920. var res = queue(interceptor.invoke, options);
  921. return res.then(function (options) {
  922. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  923. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  924. });
  925. } else {
  926. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  927. }
  928. }
  929. return api.apply(void 0, [options].concat(params));
  930. }
  931. var promiseInterceptor = {
  932. returnValue: function returnValue(res) {
  933. if (!isPromise(res)) {
  934. return res;
  935. }
  936. return new Promise(function (resolve, reject) {
  937. res.then(function (res) {
  938. if (res[0]) {
  939. reject(res[0]);
  940. } else {
  941. resolve(res[1]);
  942. }
  943. });
  944. });
  945. }
  946. };
  947. 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/;
  948. var CONTEXT_API_RE = /^create|Manager$/;
  949. // Context例外情况
  950. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  951. // 同步例外情况
  952. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  953. var CALLBACK_API_RE = /^on|^off/;
  954. function isContextApi(name) {
  955. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  956. }
  957. function isSyncApi(name) {
  958. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  959. }
  960. function isCallbackApi(name) {
  961. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  962. }
  963. function handlePromise(promise) {
  964. return promise.then(function (data) {
  965. return [null, data];
  966. }).catch(function (err) {
  967. return [err];
  968. });
  969. }
  970. function shouldPromise(name) {
  971. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  972. return false;
  973. }
  974. return true;
  975. }
  976. /* eslint-disable no-extend-native */
  977. if (!Promise.prototype.finally) {
  978. Promise.prototype.finally = function (callback) {
  979. var promise = this.constructor;
  980. return this.then(function (value) {
  981. return promise.resolve(callback()).then(function () {
  982. return value;
  983. });
  984. }, function (reason) {
  985. return promise.resolve(callback()).then(function () {
  986. throw reason;
  987. });
  988. });
  989. };
  990. }
  991. function promisify(name, api) {
  992. if (!shouldPromise(name) || !isFn(api)) {
  993. return api;
  994. }
  995. return function promiseApi() {
  996. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  997. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  998. params[_key2 - 1] = arguments[_key2];
  999. }
  1000. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1001. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1002. }
  1003. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1004. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1005. success: resolve,
  1006. fail: reject
  1007. })].concat(params));
  1008. })));
  1009. };
  1010. }
  1011. var EPS = 1e-4;
  1012. var BASE_DEVICE_WIDTH = 750;
  1013. var isIOS = false;
  1014. var deviceWidth = 0;
  1015. var deviceDPR = 0;
  1016. function checkDeviceWidth() {
  1017. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1018. platform = _wx$getSystemInfoSync.platform,
  1019. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1020. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1021. deviceWidth = windowWidth;
  1022. deviceDPR = pixelRatio;
  1023. isIOS = platform === 'ios';
  1024. }
  1025. function upx2px(number, newDeviceWidth) {
  1026. if (deviceWidth === 0) {
  1027. checkDeviceWidth();
  1028. }
  1029. number = Number(number);
  1030. if (number === 0) {
  1031. return 0;
  1032. }
  1033. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1034. if (result < 0) {
  1035. result = -result;
  1036. }
  1037. result = Math.floor(result + EPS);
  1038. if (result === 0) {
  1039. if (deviceDPR === 1 || !isIOS) {
  1040. result = 1;
  1041. } else {
  1042. result = 0.5;
  1043. }
  1044. }
  1045. return number < 0 ? -result : result;
  1046. }
  1047. var LOCALE_ZH_HANS = 'zh-Hans';
  1048. var LOCALE_ZH_HANT = 'zh-Hant';
  1049. var LOCALE_EN = 'en';
  1050. var LOCALE_FR = 'fr';
  1051. var LOCALE_ES = 'es';
  1052. var messages = {};
  1053. var locale;
  1054. {
  1055. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1056. }
  1057. function initI18nMessages() {
  1058. if (!isEnableLocale()) {
  1059. return;
  1060. }
  1061. var localeKeys = Object.keys(__uniConfig.locales);
  1062. if (localeKeys.length) {
  1063. localeKeys.forEach(function (locale) {
  1064. var curMessages = messages[locale];
  1065. var userMessages = __uniConfig.locales[locale];
  1066. if (curMessages) {
  1067. Object.assign(curMessages, userMessages);
  1068. } else {
  1069. messages[locale] = userMessages;
  1070. }
  1071. });
  1072. }
  1073. }
  1074. initI18nMessages();
  1075. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1076. var t = i18n.t;
  1077. var i18nMixin = i18n.mixin = {
  1078. beforeCreate: function beforeCreate() {
  1079. var _this = this;
  1080. var unwatch = i18n.i18n.watchLocale(function () {
  1081. _this.$forceUpdate();
  1082. });
  1083. this.$once('hook:beforeDestroy', function () {
  1084. unwatch();
  1085. });
  1086. },
  1087. methods: {
  1088. $$t: function $$t(key, values) {
  1089. return t(key, values);
  1090. }
  1091. }
  1092. };
  1093. var setLocale = i18n.setLocale;
  1094. var getLocale = i18n.getLocale;
  1095. function initAppLocale(Vue, appVm, locale) {
  1096. var state = Vue.observable({
  1097. locale: locale || i18n.getLocale()
  1098. });
  1099. var localeWatchers = [];
  1100. appVm.$watchLocale = function (fn) {
  1101. localeWatchers.push(fn);
  1102. };
  1103. Object.defineProperty(appVm, '$locale', {
  1104. get: function get() {
  1105. return state.locale;
  1106. },
  1107. set: function set(v) {
  1108. state.locale = v;
  1109. localeWatchers.forEach(function (watch) {
  1110. return watch(v);
  1111. });
  1112. }
  1113. });
  1114. }
  1115. function isEnableLocale() {
  1116. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1117. }
  1118. function include(str, parts) {
  1119. return !!parts.find(function (part) {
  1120. return str.indexOf(part) !== -1;
  1121. });
  1122. }
  1123. function startsWith(str, parts) {
  1124. return parts.find(function (part) {
  1125. return str.indexOf(part) === 0;
  1126. });
  1127. }
  1128. function normalizeLocale(locale, messages) {
  1129. if (!locale) {
  1130. return;
  1131. }
  1132. locale = locale.trim().replace(/_/g, '-');
  1133. if (messages && messages[locale]) {
  1134. return locale;
  1135. }
  1136. locale = locale.toLowerCase();
  1137. if (locale === 'chinese') {
  1138. // 支付宝
  1139. return LOCALE_ZH_HANS;
  1140. }
  1141. if (locale.indexOf('zh') === 0) {
  1142. if (locale.indexOf('-hans') > -1) {
  1143. return LOCALE_ZH_HANS;
  1144. }
  1145. if (locale.indexOf('-hant') > -1) {
  1146. return LOCALE_ZH_HANT;
  1147. }
  1148. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1149. return LOCALE_ZH_HANT;
  1150. }
  1151. return LOCALE_ZH_HANS;
  1152. }
  1153. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1154. if (lang) {
  1155. return lang;
  1156. }
  1157. }
  1158. // export function initI18n() {
  1159. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1160. // if (localeKeys.length) {
  1161. // localeKeys.forEach((locale) =>
  1162. // i18n.add(locale, __uniConfig.locales[locale])
  1163. // )
  1164. // }
  1165. // }
  1166. function getLocale$1() {
  1167. // 优先使用 $locale
  1168. if (isFn(getApp)) {
  1169. var app = getApp({
  1170. allowDefault: true
  1171. });
  1172. if (app && app.$vm) {
  1173. return app.$vm.$locale;
  1174. }
  1175. }
  1176. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1177. }
  1178. function setLocale$1(locale) {
  1179. var app = isFn(getApp) ? getApp() : false;
  1180. if (!app) {
  1181. return false;
  1182. }
  1183. var oldLocale = app.$vm.$locale;
  1184. if (oldLocale !== locale) {
  1185. app.$vm.$locale = locale;
  1186. onLocaleChangeCallbacks.forEach(function (fn) {
  1187. return fn({
  1188. locale: locale
  1189. });
  1190. });
  1191. return true;
  1192. }
  1193. return false;
  1194. }
  1195. var onLocaleChangeCallbacks = [];
  1196. function onLocaleChange(fn) {
  1197. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1198. onLocaleChangeCallbacks.push(fn);
  1199. }
  1200. }
  1201. if (typeof global !== 'undefined') {
  1202. global.getLocale = getLocale$1;
  1203. }
  1204. var interceptors = {
  1205. promiseInterceptor: promiseInterceptor
  1206. };
  1207. var baseApi = /*#__PURE__*/Object.freeze({
  1208. __proto__: null,
  1209. upx2px: upx2px,
  1210. getLocale: getLocale$1,
  1211. setLocale: setLocale$1,
  1212. onLocaleChange: onLocaleChange,
  1213. addInterceptor: addInterceptor,
  1214. removeInterceptor: removeInterceptor,
  1215. interceptors: interceptors
  1216. });
  1217. function findExistsPageIndex(url) {
  1218. var pages = getCurrentPages();
  1219. var len = pages.length;
  1220. while (len--) {
  1221. var page = pages[len];
  1222. if (page.$page && page.$page.fullPath === url) {
  1223. return len;
  1224. }
  1225. }
  1226. return -1;
  1227. }
  1228. var redirectTo = {
  1229. name: function name(fromArgs) {
  1230. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1231. return 'navigateBack';
  1232. }
  1233. return 'redirectTo';
  1234. },
  1235. args: function args(fromArgs) {
  1236. if (fromArgs.exists === 'back' && fromArgs.url) {
  1237. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1238. if (existsPageIndex !== -1) {
  1239. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1240. if (delta > 0) {
  1241. fromArgs.delta = delta;
  1242. }
  1243. }
  1244. }
  1245. }
  1246. };
  1247. var previewImage = {
  1248. args: function args(fromArgs) {
  1249. var currentIndex = parseInt(fromArgs.current);
  1250. if (isNaN(currentIndex)) {
  1251. return;
  1252. }
  1253. var urls = fromArgs.urls;
  1254. if (!Array.isArray(urls)) {
  1255. return;
  1256. }
  1257. var len = urls.length;
  1258. if (!len) {
  1259. return;
  1260. }
  1261. if (currentIndex < 0) {
  1262. currentIndex = 0;
  1263. } else if (currentIndex >= len) {
  1264. currentIndex = len - 1;
  1265. }
  1266. if (currentIndex > 0) {
  1267. fromArgs.current = urls[currentIndex];
  1268. fromArgs.urls = urls.filter(function (item, index) {
  1269. return index < currentIndex ? item !== urls[currentIndex] : true;
  1270. });
  1271. } else {
  1272. fromArgs.current = urls[0];
  1273. }
  1274. return {
  1275. indicator: false,
  1276. loop: false
  1277. };
  1278. }
  1279. };
  1280. var UUID_KEY = '__DC_STAT_UUID';
  1281. var deviceId;
  1282. function useDeviceId(result) {
  1283. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1284. if (!deviceId) {
  1285. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1286. wx.setStorage({
  1287. key: UUID_KEY,
  1288. data: deviceId
  1289. });
  1290. }
  1291. result.deviceId = deviceId;
  1292. }
  1293. function addSafeAreaInsets(result) {
  1294. if (result.safeArea) {
  1295. var safeArea = result.safeArea;
  1296. result.safeAreaInsets = {
  1297. top: safeArea.top,
  1298. left: safeArea.left,
  1299. right: result.windowWidth - safeArea.right,
  1300. bottom: result.screenHeight - safeArea.bottom
  1301. };
  1302. }
  1303. }
  1304. function populateParameters(result) {
  1305. var _result$brand = result.brand,
  1306. brand = _result$brand === void 0 ? '' : _result$brand,
  1307. _result$model = result.model,
  1308. model = _result$model === void 0 ? '' : _result$model,
  1309. _result$system = result.system,
  1310. system = _result$system === void 0 ? '' : _result$system,
  1311. _result$language = result.language,
  1312. language = _result$language === void 0 ? '' : _result$language,
  1313. theme = result.theme,
  1314. version = result.version,
  1315. platform = result.platform,
  1316. fontSizeSetting = result.fontSizeSetting,
  1317. SDKVersion = result.SDKVersion,
  1318. pixelRatio = result.pixelRatio,
  1319. deviceOrientation = result.deviceOrientation;
  1320. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1321. var extraParam = {};
  1322. // osName osVersion
  1323. var osName = '';
  1324. var osVersion = '';
  1325. {
  1326. osName = system.split(' ')[0] || '';
  1327. osVersion = system.split(' ')[1] || '';
  1328. }
  1329. var hostVersion = version;
  1330. // deviceType
  1331. var deviceType = getGetDeviceType(result, model);
  1332. // deviceModel
  1333. var deviceBrand = getDeviceBrand(brand);
  1334. // hostName
  1335. var _hostName = getHostName(result);
  1336. // deviceOrientation
  1337. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1338. // devicePixelRatio
  1339. var _devicePixelRatio = pixelRatio;
  1340. // SDKVersion
  1341. var _SDKVersion = SDKVersion;
  1342. // hostLanguage
  1343. var hostLanguage = language.replace(/_/g, '-');
  1344. // wx.getAccountInfoSync
  1345. var parameters = {
  1346. appId: "__UNI__2E20170",
  1347. appName: "hptwxMiniProgram",
  1348. appVersion: "1.0.0",
  1349. appVersionCode: "100",
  1350. appLanguage: getAppLanguage(hostLanguage),
  1351. uniCompileVersion: "3.96",
  1352. uniRuntimeVersion: "3.96",
  1353. uniPlatform: undefined || "mp-weixin",
  1354. deviceBrand: deviceBrand,
  1355. deviceModel: model,
  1356. deviceType: deviceType,
  1357. devicePixelRatio: _devicePixelRatio,
  1358. deviceOrientation: _deviceOrientation,
  1359. osName: osName.toLocaleLowerCase(),
  1360. osVersion: osVersion,
  1361. hostTheme: theme,
  1362. hostVersion: hostVersion,
  1363. hostLanguage: hostLanguage,
  1364. hostName: _hostName,
  1365. hostSDKVersion: _SDKVersion,
  1366. hostFontSizeSetting: fontSizeSetting,
  1367. windowTop: 0,
  1368. windowBottom: 0,
  1369. // TODO
  1370. osLanguage: undefined,
  1371. osTheme: undefined,
  1372. ua: undefined,
  1373. hostPackageName: undefined,
  1374. browserName: undefined,
  1375. browserVersion: undefined
  1376. };
  1377. Object.assign(result, parameters, extraParam);
  1378. }
  1379. function getGetDeviceType(result, model) {
  1380. var deviceType = result.deviceType || 'phone';
  1381. {
  1382. var deviceTypeMaps = {
  1383. ipad: 'pad',
  1384. windows: 'pc',
  1385. mac: 'pc'
  1386. };
  1387. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1388. var _model = model.toLocaleLowerCase();
  1389. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1390. var _m = deviceTypeMapsKeys[index];
  1391. if (_model.indexOf(_m) !== -1) {
  1392. deviceType = deviceTypeMaps[_m];
  1393. break;
  1394. }
  1395. }
  1396. }
  1397. return deviceType;
  1398. }
  1399. function getDeviceBrand(brand) {
  1400. var deviceBrand = brand;
  1401. if (deviceBrand) {
  1402. deviceBrand = brand.toLocaleLowerCase();
  1403. }
  1404. return deviceBrand;
  1405. }
  1406. function getAppLanguage(defaultLanguage) {
  1407. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1408. }
  1409. function getHostName(result) {
  1410. var _platform = 'WeChat';
  1411. var _hostName = result.hostName || _platform; // mp-jd
  1412. {
  1413. if (result.environment) {
  1414. _hostName = result.environment;
  1415. } else if (result.host && result.host.env) {
  1416. _hostName = result.host.env;
  1417. }
  1418. }
  1419. return _hostName;
  1420. }
  1421. var getSystemInfo = {
  1422. returnValue: function returnValue(result) {
  1423. useDeviceId(result);
  1424. addSafeAreaInsets(result);
  1425. populateParameters(result);
  1426. }
  1427. };
  1428. var showActionSheet = {
  1429. args: function args(fromArgs) {
  1430. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1431. fromArgs.alertText = fromArgs.title;
  1432. }
  1433. }
  1434. };
  1435. var getAppBaseInfo = {
  1436. returnValue: function returnValue(result) {
  1437. var _result = result,
  1438. version = _result.version,
  1439. language = _result.language,
  1440. SDKVersion = _result.SDKVersion,
  1441. theme = _result.theme;
  1442. var _hostName = getHostName(result);
  1443. var hostLanguage = language.replace('_', '-');
  1444. result = sortObject(Object.assign(result, {
  1445. appId: "__UNI__2E20170",
  1446. appName: "hptwxMiniProgram",
  1447. appVersion: "1.0.0",
  1448. appVersionCode: "100",
  1449. appLanguage: getAppLanguage(hostLanguage),
  1450. hostVersion: version,
  1451. hostLanguage: hostLanguage,
  1452. hostName: _hostName,
  1453. hostSDKVersion: SDKVersion,
  1454. hostTheme: theme
  1455. }));
  1456. }
  1457. };
  1458. var getDeviceInfo = {
  1459. returnValue: function returnValue(result) {
  1460. var _result2 = result,
  1461. brand = _result2.brand,
  1462. model = _result2.model;
  1463. var deviceType = getGetDeviceType(result, model);
  1464. var deviceBrand = getDeviceBrand(brand);
  1465. useDeviceId(result);
  1466. result = sortObject(Object.assign(result, {
  1467. deviceType: deviceType,
  1468. deviceBrand: deviceBrand,
  1469. deviceModel: model
  1470. }));
  1471. }
  1472. };
  1473. var getWindowInfo = {
  1474. returnValue: function returnValue(result) {
  1475. addSafeAreaInsets(result);
  1476. result = sortObject(Object.assign(result, {
  1477. windowTop: 0,
  1478. windowBottom: 0
  1479. }));
  1480. }
  1481. };
  1482. var getAppAuthorizeSetting = {
  1483. returnValue: function returnValue(result) {
  1484. var locationReducedAccuracy = result.locationReducedAccuracy;
  1485. result.locationAccuracy = 'unsupported';
  1486. if (locationReducedAccuracy === true) {
  1487. result.locationAccuracy = 'reduced';
  1488. } else if (locationReducedAccuracy === false) {
  1489. result.locationAccuracy = 'full';
  1490. }
  1491. }
  1492. };
  1493. // import navigateTo from 'uni-helpers/navigate-to'
  1494. var compressImage = {
  1495. args: function args(fromArgs) {
  1496. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1497. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1498. fromArgs.compressHeight = fromArgs.compressedHeight;
  1499. }
  1500. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1501. fromArgs.compressWidth = fromArgs.compressedWidth;
  1502. }
  1503. }
  1504. };
  1505. var protocols = {
  1506. redirectTo: redirectTo,
  1507. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1508. previewImage: previewImage,
  1509. getSystemInfo: getSystemInfo,
  1510. getSystemInfoSync: getSystemInfo,
  1511. showActionSheet: showActionSheet,
  1512. getAppBaseInfo: getAppBaseInfo,
  1513. getDeviceInfo: getDeviceInfo,
  1514. getWindowInfo: getWindowInfo,
  1515. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1516. compressImage: compressImage
  1517. };
  1518. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1519. var canIUses = [];
  1520. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1521. function processCallback(methodName, method, returnValue) {
  1522. return function (res) {
  1523. return method(processReturnValue(methodName, res, returnValue));
  1524. };
  1525. }
  1526. function processArgs(methodName, fromArgs) {
  1527. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1528. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1529. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1530. if (isPlainObject(fromArgs)) {
  1531. // 一般 api 的参数解析
  1532. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1533. if (isFn(argsOption)) {
  1534. argsOption = argsOption(fromArgs, toArgs) || {};
  1535. }
  1536. for (var key in fromArgs) {
  1537. if (hasOwn(argsOption, key)) {
  1538. var keyOption = argsOption[key];
  1539. if (isFn(keyOption)) {
  1540. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1541. }
  1542. if (!keyOption) {
  1543. // 不支持的参数
  1544. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1545. } else if (isStr(keyOption)) {
  1546. // 重写参数 key
  1547. toArgs[keyOption] = fromArgs[key];
  1548. } else if (isPlainObject(keyOption)) {
  1549. // {name:newName,value:value}可重新指定参数 key:value
  1550. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1551. }
  1552. } else if (CALLBACKS.indexOf(key) !== -1) {
  1553. if (isFn(fromArgs[key])) {
  1554. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1555. }
  1556. } else {
  1557. if (!keepFromArgs) {
  1558. toArgs[key] = fromArgs[key];
  1559. }
  1560. }
  1561. }
  1562. return toArgs;
  1563. } else if (isFn(fromArgs)) {
  1564. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1565. }
  1566. return fromArgs;
  1567. }
  1568. function processReturnValue(methodName, res, returnValue) {
  1569. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1570. if (isFn(protocols.returnValue)) {
  1571. // 处理通用 returnValue
  1572. res = protocols.returnValue(methodName, res);
  1573. }
  1574. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1575. }
  1576. function wrapper(methodName, method) {
  1577. if (hasOwn(protocols, methodName)) {
  1578. var protocol = protocols[methodName];
  1579. if (!protocol) {
  1580. // 暂不支持的 api
  1581. return function () {
  1582. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1583. };
  1584. }
  1585. return function (arg1, arg2) {
  1586. // 目前 api 最多两个参数
  1587. var options = protocol;
  1588. if (isFn(protocol)) {
  1589. options = protocol(arg1);
  1590. }
  1591. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1592. var args = [arg1];
  1593. if (typeof arg2 !== 'undefined') {
  1594. args.push(arg2);
  1595. }
  1596. if (isFn(options.name)) {
  1597. methodName = options.name(arg1);
  1598. } else if (isStr(options.name)) {
  1599. methodName = options.name;
  1600. }
  1601. var returnValue = wx[methodName].apply(wx, args);
  1602. if (isSyncApi(methodName)) {
  1603. // 同步 api
  1604. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1605. }
  1606. return returnValue;
  1607. };
  1608. }
  1609. return method;
  1610. }
  1611. var todoApis = Object.create(null);
  1612. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1613. function createTodoApi(name) {
  1614. return function todoApi(_ref) {
  1615. var fail = _ref.fail,
  1616. complete = _ref.complete;
  1617. var res = {
  1618. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1619. };
  1620. isFn(fail) && fail(res);
  1621. isFn(complete) && complete(res);
  1622. };
  1623. }
  1624. TODOS.forEach(function (name) {
  1625. todoApis[name] = createTodoApi(name);
  1626. });
  1627. var providers = {
  1628. oauth: ['weixin'],
  1629. share: ['weixin'],
  1630. payment: ['wxpay'],
  1631. push: ['weixin']
  1632. };
  1633. function getProvider(_ref2) {
  1634. var service = _ref2.service,
  1635. success = _ref2.success,
  1636. fail = _ref2.fail,
  1637. complete = _ref2.complete;
  1638. var res = false;
  1639. if (providers[service]) {
  1640. res = {
  1641. errMsg: 'getProvider:ok',
  1642. service: service,
  1643. provider: providers[service]
  1644. };
  1645. isFn(success) && success(res);
  1646. } else {
  1647. res = {
  1648. errMsg: 'getProvider:fail service not found'
  1649. };
  1650. isFn(fail) && fail(res);
  1651. }
  1652. isFn(complete) && complete(res);
  1653. }
  1654. var extraApi = /*#__PURE__*/Object.freeze({
  1655. __proto__: null,
  1656. getProvider: getProvider
  1657. });
  1658. var getEmitter = function () {
  1659. var Emitter;
  1660. return function getUniEmitter() {
  1661. if (!Emitter) {
  1662. Emitter = new _vue.default();
  1663. }
  1664. return Emitter;
  1665. };
  1666. }();
  1667. function apply(ctx, method, args) {
  1668. return ctx[method].apply(ctx, args);
  1669. }
  1670. function $on() {
  1671. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1672. }
  1673. function $off() {
  1674. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1675. }
  1676. function $once() {
  1677. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1678. }
  1679. function $emit() {
  1680. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1681. }
  1682. var eventApi = /*#__PURE__*/Object.freeze({
  1683. __proto__: null,
  1684. $on: $on,
  1685. $off: $off,
  1686. $once: $once,
  1687. $emit: $emit
  1688. });
  1689. /**
  1690. * 框架内 try-catch
  1691. */
  1692. /**
  1693. * 开发者 try-catch
  1694. */
  1695. function tryCatch(fn) {
  1696. return function () {
  1697. try {
  1698. return fn.apply(fn, arguments);
  1699. } catch (e) {
  1700. // TODO
  1701. console.error(e);
  1702. }
  1703. };
  1704. }
  1705. function getApiCallbacks(params) {
  1706. var apiCallbacks = {};
  1707. for (var name in params) {
  1708. var param = params[name];
  1709. if (isFn(param)) {
  1710. apiCallbacks[name] = tryCatch(param);
  1711. delete params[name];
  1712. }
  1713. }
  1714. return apiCallbacks;
  1715. }
  1716. var cid;
  1717. var cidErrMsg;
  1718. var enabled;
  1719. function normalizePushMessage(message) {
  1720. try {
  1721. return JSON.parse(message);
  1722. } catch (e) {}
  1723. return message;
  1724. }
  1725. function invokePushCallback(args) {
  1726. if (args.type === 'enabled') {
  1727. enabled = true;
  1728. } else if (args.type === 'clientId') {
  1729. cid = args.cid;
  1730. cidErrMsg = args.errMsg;
  1731. invokeGetPushCidCallbacks(cid, args.errMsg);
  1732. } else if (args.type === 'pushMsg') {
  1733. var message = {
  1734. type: 'receive',
  1735. data: normalizePushMessage(args.message)
  1736. };
  1737. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1738. var callback = onPushMessageCallbacks[i];
  1739. callback(message);
  1740. // 该消息已被阻止
  1741. if (message.stopped) {
  1742. break;
  1743. }
  1744. }
  1745. } else if (args.type === 'click') {
  1746. onPushMessageCallbacks.forEach(function (callback) {
  1747. callback({
  1748. type: 'click',
  1749. data: normalizePushMessage(args.message)
  1750. });
  1751. });
  1752. }
  1753. }
  1754. var getPushCidCallbacks = [];
  1755. function invokeGetPushCidCallbacks(cid, errMsg) {
  1756. getPushCidCallbacks.forEach(function (callback) {
  1757. callback(cid, errMsg);
  1758. });
  1759. getPushCidCallbacks.length = 0;
  1760. }
  1761. function getPushClientId(args) {
  1762. if (!isPlainObject(args)) {
  1763. args = {};
  1764. }
  1765. var _getApiCallbacks = getApiCallbacks(args),
  1766. success = _getApiCallbacks.success,
  1767. fail = _getApiCallbacks.fail,
  1768. complete = _getApiCallbacks.complete;
  1769. var hasSuccess = isFn(success);
  1770. var hasFail = isFn(fail);
  1771. var hasComplete = isFn(complete);
  1772. Promise.resolve().then(function () {
  1773. if (typeof enabled === 'undefined') {
  1774. enabled = false;
  1775. cid = '';
  1776. cidErrMsg = 'uniPush is not enabled';
  1777. }
  1778. getPushCidCallbacks.push(function (cid, errMsg) {
  1779. var res;
  1780. if (cid) {
  1781. res = {
  1782. errMsg: 'getPushClientId:ok',
  1783. cid: cid
  1784. };
  1785. hasSuccess && success(res);
  1786. } else {
  1787. res = {
  1788. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1789. };
  1790. hasFail && fail(res);
  1791. }
  1792. hasComplete && complete(res);
  1793. });
  1794. if (typeof cid !== 'undefined') {
  1795. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1796. }
  1797. });
  1798. }
  1799. var onPushMessageCallbacks = [];
  1800. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1801. var onPushMessage = function onPushMessage(fn) {
  1802. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1803. onPushMessageCallbacks.push(fn);
  1804. }
  1805. };
  1806. var offPushMessage = function offPushMessage(fn) {
  1807. if (!fn) {
  1808. onPushMessageCallbacks.length = 0;
  1809. } else {
  1810. var index = onPushMessageCallbacks.indexOf(fn);
  1811. if (index > -1) {
  1812. onPushMessageCallbacks.splice(index, 1);
  1813. }
  1814. }
  1815. };
  1816. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1817. if (!baseInfo) {
  1818. baseInfo = wx.getSystemInfoSync();
  1819. }
  1820. var host = baseInfo ? baseInfo.host : null;
  1821. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1822. var api = /*#__PURE__*/Object.freeze({
  1823. __proto__: null,
  1824. shareVideoMessage: shareVideoMessage,
  1825. getPushClientId: getPushClientId,
  1826. onPushMessage: onPushMessage,
  1827. offPushMessage: offPushMessage,
  1828. invokePushCallback: invokePushCallback
  1829. });
  1830. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1831. function findVmByVueId(vm, vuePid) {
  1832. var $children = vm.$children;
  1833. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1834. for (var i = $children.length - 1; i >= 0; i--) {
  1835. var childVm = $children[i];
  1836. if (childVm.$scope._$vueId === vuePid) {
  1837. return childVm;
  1838. }
  1839. }
  1840. // 反向递归查找
  1841. var parentVm;
  1842. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1843. parentVm = findVmByVueId($children[_i], vuePid);
  1844. if (parentVm) {
  1845. return parentVm;
  1846. }
  1847. }
  1848. }
  1849. function initBehavior(options) {
  1850. return Behavior(options);
  1851. }
  1852. function isPage() {
  1853. return !!this.route;
  1854. }
  1855. function initRelation(detail) {
  1856. this.triggerEvent('__l', detail);
  1857. }
  1858. function selectAllComponents(mpInstance, selector, $refs) {
  1859. var components = mpInstance.selectAllComponents(selector) || [];
  1860. components.forEach(function (component) {
  1861. var ref = component.dataset.ref;
  1862. $refs[ref] = component.$vm || toSkip(component);
  1863. {
  1864. if (component.dataset.vueGeneric === 'scoped') {
  1865. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1866. selectAllComponents(scopedComponent, selector, $refs);
  1867. });
  1868. }
  1869. }
  1870. });
  1871. }
  1872. function syncRefs(refs, newRefs) {
  1873. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1874. var newKeys = Object.keys(newRefs);
  1875. newKeys.forEach(function (key) {
  1876. var oldValue = refs[key];
  1877. var newValue = newRefs[key];
  1878. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1879. return oldValue.includes(value);
  1880. })) {
  1881. return;
  1882. }
  1883. refs[key] = newValue;
  1884. oldKeys.delete(key);
  1885. });
  1886. oldKeys.forEach(function (key) {
  1887. delete refs[key];
  1888. });
  1889. return refs;
  1890. }
  1891. function initRefs(vm) {
  1892. var mpInstance = vm.$scope;
  1893. var refs = {};
  1894. Object.defineProperty(vm, '$refs', {
  1895. get: function get() {
  1896. var $refs = {};
  1897. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1898. // TODO 暂不考虑 for 中的 scoped
  1899. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1900. forComponents.forEach(function (component) {
  1901. var ref = component.dataset.ref;
  1902. if (!$refs[ref]) {
  1903. $refs[ref] = [];
  1904. }
  1905. $refs[ref].push(component.$vm || toSkip(component));
  1906. });
  1907. return syncRefs(refs, $refs);
  1908. }
  1909. });
  1910. }
  1911. function handleLink(event) {
  1912. var _ref3 = event.detail || event.value,
  1913. vuePid = _ref3.vuePid,
  1914. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1915. var parentVm;
  1916. if (vuePid) {
  1917. parentVm = findVmByVueId(this.$vm, vuePid);
  1918. }
  1919. if (!parentVm) {
  1920. parentVm = this.$vm;
  1921. }
  1922. vueOptions.parent = parentVm;
  1923. }
  1924. function markMPComponent(component) {
  1925. // 在 Vue 中标记为小程序组件
  1926. var IS_MP = '__v_isMPComponent';
  1927. Object.defineProperty(component, IS_MP, {
  1928. configurable: true,
  1929. enumerable: false,
  1930. value: true
  1931. });
  1932. return component;
  1933. }
  1934. function toSkip(obj) {
  1935. var OB = '__ob__';
  1936. var SKIP = '__v_skip';
  1937. if (isObject(obj) && Object.isExtensible(obj)) {
  1938. // 避免被 @vue/composition-api 观测
  1939. Object.defineProperty(obj, OB, {
  1940. configurable: true,
  1941. enumerable: false,
  1942. value: (0, _defineProperty2.default)({}, SKIP, true)
  1943. });
  1944. }
  1945. return obj;
  1946. }
  1947. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1948. function initWorkletMethods(mpMethods, vueMethods) {
  1949. if (vueMethods) {
  1950. Object.keys(vueMethods).forEach(function (name) {
  1951. var matches = name.match(WORKLET_RE);
  1952. if (matches) {
  1953. var workletName = matches[1];
  1954. mpMethods[name] = vueMethods[name];
  1955. mpMethods[workletName] = vueMethods[workletName];
  1956. }
  1957. });
  1958. }
  1959. }
  1960. var MPPage = Page;
  1961. var MPComponent = Component;
  1962. var customizeRE = /:/g;
  1963. var customize = cached(function (str) {
  1964. return camelize(str.replace(customizeRE, '-'));
  1965. });
  1966. function initTriggerEvent(mpInstance) {
  1967. var oldTriggerEvent = mpInstance.triggerEvent;
  1968. var newTriggerEvent = function newTriggerEvent(event) {
  1969. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1970. args[_key3 - 1] = arguments[_key3];
  1971. }
  1972. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1973. if (this.$vm || this.dataset && this.dataset.comType) {
  1974. event = customize(event);
  1975. } else {
  1976. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1977. var newEvent = customize(event);
  1978. if (newEvent !== event) {
  1979. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1980. }
  1981. }
  1982. return oldTriggerEvent.apply(this, [event].concat(args));
  1983. };
  1984. try {
  1985. // 京东小程序 triggerEvent 为只读
  1986. mpInstance.triggerEvent = newTriggerEvent;
  1987. } catch (error) {
  1988. mpInstance._triggerEvent = newTriggerEvent;
  1989. }
  1990. }
  1991. function initHook(name, options, isComponent) {
  1992. var oldHook = options[name];
  1993. options[name] = function () {
  1994. markMPComponent(this);
  1995. initTriggerEvent(this);
  1996. if (oldHook) {
  1997. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1998. args[_key4] = arguments[_key4];
  1999. }
  2000. return oldHook.apply(this, args);
  2001. }
  2002. };
  2003. }
  2004. if (!MPPage.__$wrappered) {
  2005. MPPage.__$wrappered = true;
  2006. Page = function Page() {
  2007. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2008. initHook('onLoad', options);
  2009. return MPPage(options);
  2010. };
  2011. Page.after = MPPage.after;
  2012. Component = function Component() {
  2013. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2014. initHook('created', options);
  2015. return MPComponent(options);
  2016. };
  2017. }
  2018. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2019. function initMocks(vm, mocks) {
  2020. var mpInstance = vm.$mp[vm.mpType];
  2021. mocks.forEach(function (mock) {
  2022. if (hasOwn(mpInstance, mock)) {
  2023. vm[mock] = mpInstance[mock];
  2024. }
  2025. });
  2026. }
  2027. function hasHook(hook, vueOptions) {
  2028. if (!vueOptions) {
  2029. return true;
  2030. }
  2031. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2032. return true;
  2033. }
  2034. vueOptions = vueOptions.default || vueOptions;
  2035. if (isFn(vueOptions)) {
  2036. if (isFn(vueOptions.extendOptions[hook])) {
  2037. return true;
  2038. }
  2039. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2040. return true;
  2041. }
  2042. return false;
  2043. }
  2044. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2045. return true;
  2046. }
  2047. var mixins = vueOptions.mixins;
  2048. if (Array.isArray(mixins)) {
  2049. return !!mixins.find(function (mixin) {
  2050. return hasHook(hook, mixin);
  2051. });
  2052. }
  2053. }
  2054. function initHooks(mpOptions, hooks, vueOptions) {
  2055. hooks.forEach(function (hook) {
  2056. if (hasHook(hook, vueOptions)) {
  2057. mpOptions[hook] = function (args) {
  2058. return this.$vm && this.$vm.__call_hook(hook, args);
  2059. };
  2060. }
  2061. });
  2062. }
  2063. function initUnknownHooks(mpOptions, vueOptions) {
  2064. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2065. findHooks(vueOptions).forEach(function (hook) {
  2066. return initHook$1(mpOptions, hook, excludes);
  2067. });
  2068. }
  2069. function findHooks(vueOptions) {
  2070. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2071. if (vueOptions) {
  2072. Object.keys(vueOptions).forEach(function (name) {
  2073. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2074. hooks.push(name);
  2075. }
  2076. });
  2077. }
  2078. return hooks;
  2079. }
  2080. function initHook$1(mpOptions, hook, excludes) {
  2081. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2082. mpOptions[hook] = function (args) {
  2083. return this.$vm && this.$vm.__call_hook(hook, args);
  2084. };
  2085. }
  2086. }
  2087. function initVueComponent(Vue, vueOptions) {
  2088. vueOptions = vueOptions.default || vueOptions;
  2089. var VueComponent;
  2090. if (isFn(vueOptions)) {
  2091. VueComponent = vueOptions;
  2092. } else {
  2093. VueComponent = Vue.extend(vueOptions);
  2094. }
  2095. vueOptions = VueComponent.options;
  2096. return [VueComponent, vueOptions];
  2097. }
  2098. function initSlots(vm, vueSlots) {
  2099. if (Array.isArray(vueSlots) && vueSlots.length) {
  2100. var $slots = Object.create(null);
  2101. vueSlots.forEach(function (slotName) {
  2102. $slots[slotName] = true;
  2103. });
  2104. vm.$scopedSlots = vm.$slots = $slots;
  2105. }
  2106. }
  2107. function initVueIds(vueIds, mpInstance) {
  2108. vueIds = (vueIds || '').split(',');
  2109. var len = vueIds.length;
  2110. if (len === 1) {
  2111. mpInstance._$vueId = vueIds[0];
  2112. } else if (len === 2) {
  2113. mpInstance._$vueId = vueIds[0];
  2114. mpInstance._$vuePid = vueIds[1];
  2115. }
  2116. }
  2117. function initData(vueOptions, context) {
  2118. var data = vueOptions.data || {};
  2119. var methods = vueOptions.methods || {};
  2120. if (typeof data === 'function') {
  2121. try {
  2122. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2123. } catch (e) {
  2124. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2125. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2126. }
  2127. }
  2128. } else {
  2129. try {
  2130. // 对 data 格式化
  2131. data = JSON.parse(JSON.stringify(data));
  2132. } catch (e) {}
  2133. }
  2134. if (!isPlainObject(data)) {
  2135. data = {};
  2136. }
  2137. Object.keys(methods).forEach(function (methodName) {
  2138. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2139. data[methodName] = methods[methodName];
  2140. }
  2141. });
  2142. return data;
  2143. }
  2144. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2145. function createObserver(name) {
  2146. return function observer(newVal, oldVal) {
  2147. if (this.$vm) {
  2148. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2149. }
  2150. };
  2151. }
  2152. function initBehaviors(vueOptions, initBehavior) {
  2153. var vueBehaviors = vueOptions.behaviors;
  2154. var vueExtends = vueOptions.extends;
  2155. var vueMixins = vueOptions.mixins;
  2156. var vueProps = vueOptions.props;
  2157. if (!vueProps) {
  2158. vueOptions.props = vueProps = [];
  2159. }
  2160. var behaviors = [];
  2161. if (Array.isArray(vueBehaviors)) {
  2162. vueBehaviors.forEach(function (behavior) {
  2163. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2164. if (behavior === 'uni://form-field') {
  2165. if (Array.isArray(vueProps)) {
  2166. vueProps.push('name');
  2167. vueProps.push('value');
  2168. } else {
  2169. vueProps.name = {
  2170. type: String,
  2171. default: ''
  2172. };
  2173. vueProps.value = {
  2174. type: [String, Number, Boolean, Array, Object, Date],
  2175. default: ''
  2176. };
  2177. }
  2178. }
  2179. });
  2180. }
  2181. if (isPlainObject(vueExtends) && vueExtends.props) {
  2182. behaviors.push(initBehavior({
  2183. properties: initProperties(vueExtends.props, true)
  2184. }));
  2185. }
  2186. if (Array.isArray(vueMixins)) {
  2187. vueMixins.forEach(function (vueMixin) {
  2188. if (isPlainObject(vueMixin) && vueMixin.props) {
  2189. behaviors.push(initBehavior({
  2190. properties: initProperties(vueMixin.props, true)
  2191. }));
  2192. }
  2193. });
  2194. }
  2195. return behaviors;
  2196. }
  2197. function parsePropType(key, type, defaultValue, file) {
  2198. // [String]=>String
  2199. if (Array.isArray(type) && type.length === 1) {
  2200. return type[0];
  2201. }
  2202. return type;
  2203. }
  2204. function initProperties(props) {
  2205. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2206. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2207. var options = arguments.length > 3 ? arguments[3] : undefined;
  2208. var properties = {};
  2209. if (!isBehavior) {
  2210. properties.vueId = {
  2211. type: String,
  2212. value: ''
  2213. };
  2214. {
  2215. if (options.virtualHost) {
  2216. properties.virtualHostStyle = {
  2217. type: null,
  2218. value: ''
  2219. };
  2220. properties.virtualHostClass = {
  2221. type: null,
  2222. value: ''
  2223. };
  2224. }
  2225. }
  2226. // scopedSlotsCompiler auto
  2227. properties.scopedSlotsCompiler = {
  2228. type: String,
  2229. value: ''
  2230. };
  2231. properties.vueSlots = {
  2232. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2233. type: null,
  2234. value: [],
  2235. observer: function observer(newVal, oldVal) {
  2236. var $slots = Object.create(null);
  2237. newVal.forEach(function (slotName) {
  2238. $slots[slotName] = true;
  2239. });
  2240. this.setData({
  2241. $slots: $slots
  2242. });
  2243. }
  2244. };
  2245. }
  2246. if (Array.isArray(props)) {
  2247. // ['title']
  2248. props.forEach(function (key) {
  2249. properties[key] = {
  2250. type: null,
  2251. observer: createObserver(key)
  2252. };
  2253. });
  2254. } else if (isPlainObject(props)) {
  2255. // {title:{type:String,default:''},content:String}
  2256. Object.keys(props).forEach(function (key) {
  2257. var opts = props[key];
  2258. if (isPlainObject(opts)) {
  2259. // title:{type:String,default:''}
  2260. var value = opts.default;
  2261. if (isFn(value)) {
  2262. value = value();
  2263. }
  2264. opts.type = parsePropType(key, opts.type);
  2265. properties[key] = {
  2266. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2267. value: value,
  2268. observer: createObserver(key)
  2269. };
  2270. } else {
  2271. // content:String
  2272. var type = parsePropType(key, opts);
  2273. properties[key] = {
  2274. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2275. observer: createObserver(key)
  2276. };
  2277. }
  2278. });
  2279. }
  2280. return properties;
  2281. }
  2282. function wrapper$1(event) {
  2283. // TODO 又得兼容 mpvue 的 mp 对象
  2284. try {
  2285. event.mp = JSON.parse(JSON.stringify(event));
  2286. } catch (e) {}
  2287. event.stopPropagation = noop;
  2288. event.preventDefault = noop;
  2289. event.target = event.target || {};
  2290. if (!hasOwn(event, 'detail')) {
  2291. event.detail = {};
  2292. }
  2293. if (hasOwn(event, 'markerId')) {
  2294. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2295. event.detail.markerId = event.markerId;
  2296. }
  2297. if (isPlainObject(event.detail)) {
  2298. event.target = Object.assign({}, event.target, event.detail);
  2299. }
  2300. return event;
  2301. }
  2302. function getExtraValue(vm, dataPathsArray) {
  2303. var context = vm;
  2304. dataPathsArray.forEach(function (dataPathArray) {
  2305. var dataPath = dataPathArray[0];
  2306. var value = dataPathArray[2];
  2307. if (dataPath || typeof value !== 'undefined') {
  2308. // ['','',index,'disable']
  2309. var propPath = dataPathArray[1];
  2310. var valuePath = dataPathArray[3];
  2311. var vFor;
  2312. if (Number.isInteger(dataPath)) {
  2313. vFor = dataPath;
  2314. } else if (!dataPath) {
  2315. vFor = context;
  2316. } else if (typeof dataPath === 'string' && dataPath) {
  2317. if (dataPath.indexOf('#s#') === 0) {
  2318. vFor = dataPath.substr(3);
  2319. } else {
  2320. vFor = vm.__get_value(dataPath, context);
  2321. }
  2322. }
  2323. if (Number.isInteger(vFor)) {
  2324. context = value;
  2325. } else if (!propPath) {
  2326. context = vFor[value];
  2327. } else {
  2328. if (Array.isArray(vFor)) {
  2329. context = vFor.find(function (vForItem) {
  2330. return vm.__get_value(propPath, vForItem) === value;
  2331. });
  2332. } else if (isPlainObject(vFor)) {
  2333. context = Object.keys(vFor).find(function (vForKey) {
  2334. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2335. });
  2336. } else {
  2337. console.error('v-for 暂不支持循环数据:', vFor);
  2338. }
  2339. }
  2340. if (valuePath) {
  2341. context = vm.__get_value(valuePath, context);
  2342. }
  2343. }
  2344. });
  2345. return context;
  2346. }
  2347. function processEventExtra(vm, extra, event, __args__) {
  2348. var extraObj = {};
  2349. if (Array.isArray(extra) && extra.length) {
  2350. /**
  2351. *[
  2352. * ['data.items', 'data.id', item.data.id],
  2353. * ['metas', 'id', meta.id]
  2354. *],
  2355. *[
  2356. * ['data.items', 'data.id', item.data.id],
  2357. * ['metas', 'id', meta.id]
  2358. *],
  2359. *'test'
  2360. */
  2361. extra.forEach(function (dataPath, index) {
  2362. if (typeof dataPath === 'string') {
  2363. if (!dataPath) {
  2364. // model,prop.sync
  2365. extraObj['$' + index] = vm;
  2366. } else {
  2367. if (dataPath === '$event') {
  2368. // $event
  2369. extraObj['$' + index] = event;
  2370. } else if (dataPath === 'arguments') {
  2371. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2372. } else if (dataPath.indexOf('$event.') === 0) {
  2373. // $event.target.value
  2374. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2375. } else {
  2376. extraObj['$' + index] = vm.__get_value(dataPath);
  2377. }
  2378. }
  2379. } else {
  2380. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2381. }
  2382. });
  2383. }
  2384. return extraObj;
  2385. }
  2386. function getObjByArray(arr) {
  2387. var obj = {};
  2388. for (var i = 1; i < arr.length; i++) {
  2389. var element = arr[i];
  2390. obj[element[0]] = element[1];
  2391. }
  2392. return obj;
  2393. }
  2394. function processEventArgs(vm, event) {
  2395. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2396. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2397. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2398. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2399. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2400. // fixed 用户直接触发 mpInstance.triggerEvent
  2401. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2402. if (isCustom) {
  2403. // 自定义事件
  2404. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2405. if (!args.length) {
  2406. // 无参数,直接传入 event 或 detail 数组
  2407. if (isCustomMPEvent) {
  2408. return [event];
  2409. }
  2410. return __args__;
  2411. }
  2412. }
  2413. var extraObj = processEventExtra(vm, extra, event, __args__);
  2414. var ret = [];
  2415. args.forEach(function (arg) {
  2416. if (arg === '$event') {
  2417. if (methodName === '__set_model' && !isCustom) {
  2418. // input v-model value
  2419. ret.push(event.target.value);
  2420. } else {
  2421. if (isCustom && !isCustomMPEvent) {
  2422. ret.push(__args__[0]);
  2423. } else {
  2424. // wxcomponent 组件或内置组件
  2425. ret.push(event);
  2426. }
  2427. }
  2428. } else {
  2429. if (Array.isArray(arg) && arg[0] === 'o') {
  2430. ret.push(getObjByArray(arg));
  2431. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2432. ret.push(extraObj[arg]);
  2433. } else {
  2434. ret.push(arg);
  2435. }
  2436. }
  2437. });
  2438. return ret;
  2439. }
  2440. var ONCE = '~';
  2441. var CUSTOM = '^';
  2442. function isMatchEventType(eventType, optType) {
  2443. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2444. }
  2445. function getContextVm(vm) {
  2446. var $parent = vm.$parent;
  2447. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2448. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2449. $parent = $parent.$parent;
  2450. }
  2451. return $parent && $parent.$parent;
  2452. }
  2453. function handleEvent(event) {
  2454. var _this2 = this;
  2455. event = wrapper$1(event);
  2456. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2457. var dataset = (event.currentTarget || event.target).dataset;
  2458. if (!dataset) {
  2459. return console.warn('事件信息不存在');
  2460. }
  2461. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2462. if (!eventOpts) {
  2463. return console.warn('事件信息不存在');
  2464. }
  2465. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2466. var eventType = event.type;
  2467. var ret = [];
  2468. eventOpts.forEach(function (eventOpt) {
  2469. var type = eventOpt[0];
  2470. var eventsArray = eventOpt[1];
  2471. var isCustom = type.charAt(0) === CUSTOM;
  2472. type = isCustom ? type.slice(1) : type;
  2473. var isOnce = type.charAt(0) === ONCE;
  2474. type = isOnce ? type.slice(1) : type;
  2475. if (eventsArray && isMatchEventType(eventType, type)) {
  2476. eventsArray.forEach(function (eventArray) {
  2477. var methodName = eventArray[0];
  2478. if (methodName) {
  2479. var handlerCtx = _this2.$vm;
  2480. if (handlerCtx.$options.generic) {
  2481. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2482. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2483. }
  2484. if (methodName === '$emit') {
  2485. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2486. return;
  2487. }
  2488. var handler = handlerCtx[methodName];
  2489. if (!isFn(handler)) {
  2490. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2491. var path = _this2.route || _this2.is;
  2492. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2493. }
  2494. if (isOnce) {
  2495. if (handler.once) {
  2496. return;
  2497. }
  2498. handler.once = true;
  2499. }
  2500. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2501. params = Array.isArray(params) ? params : [];
  2502. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2503. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2504. // eslint-disable-next-line no-sparse-arrays
  2505. params = params.concat([,,,,,,,,,, event]);
  2506. }
  2507. ret.push(handler.apply(handlerCtx, params));
  2508. }
  2509. });
  2510. }
  2511. });
  2512. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2513. return ret[0];
  2514. }
  2515. }
  2516. var eventChannels = {};
  2517. function getEventChannel(id) {
  2518. var eventChannel = eventChannels[id];
  2519. delete eventChannels[id];
  2520. return eventChannel;
  2521. }
  2522. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2523. function initEventChannel() {
  2524. _vue.default.prototype.getOpenerEventChannel = function () {
  2525. // 微信小程序使用自身getOpenerEventChannel
  2526. {
  2527. return this.$scope.getOpenerEventChannel();
  2528. }
  2529. };
  2530. var callHook = _vue.default.prototype.__call_hook;
  2531. _vue.default.prototype.__call_hook = function (hook, args) {
  2532. if (hook === 'onLoad' && args && args.__id__) {
  2533. this.__eventChannel__ = getEventChannel(args.__id__);
  2534. delete args.__id__;
  2535. }
  2536. return callHook.call(this, hook, args);
  2537. };
  2538. }
  2539. function initScopedSlotsParams() {
  2540. var center = {};
  2541. var parents = {};
  2542. function currentId(fn) {
  2543. var vueIds = this.$options.propsData.vueId;
  2544. if (vueIds) {
  2545. var vueId = vueIds.split(',')[0];
  2546. fn(vueId);
  2547. }
  2548. }
  2549. _vue.default.prototype.$hasSSP = function (vueId) {
  2550. var slot = center[vueId];
  2551. if (!slot) {
  2552. parents[vueId] = this;
  2553. this.$on('hook:destroyed', function () {
  2554. delete parents[vueId];
  2555. });
  2556. }
  2557. return slot;
  2558. };
  2559. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2560. var slot = center[vueId];
  2561. if (slot) {
  2562. var params = slot[name] || [];
  2563. if (needAll) {
  2564. return params;
  2565. }
  2566. return params[0];
  2567. }
  2568. };
  2569. _vue.default.prototype.$setSSP = function (name, value) {
  2570. var index = 0;
  2571. currentId.call(this, function (vueId) {
  2572. var slot = center[vueId];
  2573. var params = slot[name] = slot[name] || [];
  2574. params.push(value);
  2575. index = params.length - 1;
  2576. });
  2577. return index;
  2578. };
  2579. _vue.default.prototype.$initSSP = function () {
  2580. currentId.call(this, function (vueId) {
  2581. center[vueId] = {};
  2582. });
  2583. };
  2584. _vue.default.prototype.$callSSP = function () {
  2585. currentId.call(this, function (vueId) {
  2586. if (parents[vueId]) {
  2587. parents[vueId].$forceUpdate();
  2588. }
  2589. });
  2590. };
  2591. _vue.default.mixin({
  2592. destroyed: function destroyed() {
  2593. var propsData = this.$options.propsData;
  2594. var vueId = propsData && propsData.vueId;
  2595. if (vueId) {
  2596. delete center[vueId];
  2597. delete parents[vueId];
  2598. }
  2599. }
  2600. });
  2601. }
  2602. function parseBaseApp(vm, _ref4) {
  2603. var mocks = _ref4.mocks,
  2604. initRefs = _ref4.initRefs;
  2605. initEventChannel();
  2606. {
  2607. initScopedSlotsParams();
  2608. }
  2609. if (vm.$options.store) {
  2610. _vue.default.prototype.$store = vm.$options.store;
  2611. }
  2612. uniIdMixin(_vue.default);
  2613. _vue.default.prototype.mpHost = "mp-weixin";
  2614. _vue.default.mixin({
  2615. beforeCreate: function beforeCreate() {
  2616. if (!this.$options.mpType) {
  2617. return;
  2618. }
  2619. this.mpType = this.$options.mpType;
  2620. this.$mp = (0, _defineProperty2.default)({
  2621. data: {}
  2622. }, this.mpType, this.$options.mpInstance);
  2623. this.$scope = this.$options.mpInstance;
  2624. delete this.$options.mpType;
  2625. delete this.$options.mpInstance;
  2626. if (this.mpType === 'page' && typeof getApp === 'function') {
  2627. // hack vue-i18n
  2628. var app = getApp();
  2629. if (app.$vm && app.$vm.$i18n) {
  2630. this._i18n = app.$vm.$i18n;
  2631. }
  2632. }
  2633. if (this.mpType !== 'app') {
  2634. initRefs(this);
  2635. initMocks(this, mocks);
  2636. }
  2637. }
  2638. });
  2639. var appOptions = {
  2640. onLaunch: function onLaunch(args) {
  2641. if (this.$vm) {
  2642. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2643. return;
  2644. }
  2645. {
  2646. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2647. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2648. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2649. }
  2650. }
  2651. this.$vm = vm;
  2652. this.$vm.$mp = {
  2653. app: this
  2654. };
  2655. this.$vm.$scope = this;
  2656. // vm 上也挂载 globalData
  2657. this.$vm.globalData = this.globalData;
  2658. this.$vm._isMounted = true;
  2659. this.$vm.__call_hook('mounted', args);
  2660. this.$vm.__call_hook('onLaunch', args);
  2661. }
  2662. };
  2663. // 兼容旧版本 globalData
  2664. appOptions.globalData = vm.$options.globalData || {};
  2665. // 将 methods 中的方法挂在 getApp() 中
  2666. var methods = vm.$options.methods;
  2667. if (methods) {
  2668. Object.keys(methods).forEach(function (name) {
  2669. appOptions[name] = methods[name];
  2670. });
  2671. }
  2672. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2673. initHooks(appOptions, hooks);
  2674. initUnknownHooks(appOptions, vm.$options);
  2675. return appOptions;
  2676. }
  2677. function parseApp(vm) {
  2678. return parseBaseApp(vm, {
  2679. mocks: mocks,
  2680. initRefs: initRefs
  2681. });
  2682. }
  2683. function createApp(vm) {
  2684. App(parseApp(vm));
  2685. return vm;
  2686. }
  2687. var encodeReserveRE = /[!'()*]/g;
  2688. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2689. return '%' + c.charCodeAt(0).toString(16);
  2690. };
  2691. var commaRE = /%2C/g;
  2692. // fixed encodeURIComponent which is more conformant to RFC3986:
  2693. // - escapes [!'()*]
  2694. // - preserve commas
  2695. var encode = function encode(str) {
  2696. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2697. };
  2698. function stringifyQuery(obj) {
  2699. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2700. var res = obj ? Object.keys(obj).map(function (key) {
  2701. var val = obj[key];
  2702. if (val === undefined) {
  2703. return '';
  2704. }
  2705. if (val === null) {
  2706. return encodeStr(key);
  2707. }
  2708. if (Array.isArray(val)) {
  2709. var result = [];
  2710. val.forEach(function (val2) {
  2711. if (val2 === undefined) {
  2712. return;
  2713. }
  2714. if (val2 === null) {
  2715. result.push(encodeStr(key));
  2716. } else {
  2717. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2718. }
  2719. });
  2720. return result.join('&');
  2721. }
  2722. return encodeStr(key) + '=' + encodeStr(val);
  2723. }).filter(function (x) {
  2724. return x.length > 0;
  2725. }).join('&') : null;
  2726. return res ? "?".concat(res) : '';
  2727. }
  2728. function parseBaseComponent(vueComponentOptions) {
  2729. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2730. isPage = _ref5.isPage,
  2731. initRelation = _ref5.initRelation;
  2732. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2733. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2734. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2735. VueComponent = _initVueComponent2[0],
  2736. vueOptions = _initVueComponent2[1];
  2737. var options = _objectSpread({
  2738. multipleSlots: true,
  2739. // styleIsolation: 'apply-shared',
  2740. addGlobalClass: true
  2741. }, vueOptions.options || {});
  2742. {
  2743. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2744. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2745. Object.assign(options, vueOptions['mp-weixin'].options);
  2746. }
  2747. }
  2748. var componentOptions = {
  2749. options: options,
  2750. data: initData(vueOptions, _vue.default.prototype),
  2751. behaviors: initBehaviors(vueOptions, initBehavior),
  2752. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2753. lifetimes: {
  2754. attached: function attached() {
  2755. var properties = this.properties;
  2756. var options = {
  2757. mpType: isPage.call(this) ? 'page' : 'component',
  2758. mpInstance: this,
  2759. propsData: properties
  2760. };
  2761. initVueIds(properties.vueId, this);
  2762. // 处理父子关系
  2763. initRelation.call(this, {
  2764. vuePid: this._$vuePid,
  2765. vueOptions: options
  2766. });
  2767. // 初始化 vue 实例
  2768. this.$vm = new VueComponent(options);
  2769. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2770. initSlots(this.$vm, properties.vueSlots);
  2771. // 触发首次 setData
  2772. this.$vm.$mount();
  2773. },
  2774. ready: function ready() {
  2775. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2776. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2777. if (this.$vm) {
  2778. this.$vm._isMounted = true;
  2779. this.$vm.__call_hook('mounted');
  2780. this.$vm.__call_hook('onReady');
  2781. }
  2782. },
  2783. detached: function detached() {
  2784. this.$vm && this.$vm.$destroy();
  2785. }
  2786. },
  2787. pageLifetimes: {
  2788. show: function show(args) {
  2789. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2790. },
  2791. hide: function hide() {
  2792. this.$vm && this.$vm.__call_hook('onPageHide');
  2793. },
  2794. resize: function resize(size) {
  2795. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2796. }
  2797. },
  2798. methods: {
  2799. __l: handleLink,
  2800. __e: handleEvent
  2801. }
  2802. };
  2803. // externalClasses
  2804. if (vueOptions.externalClasses) {
  2805. componentOptions.externalClasses = vueOptions.externalClasses;
  2806. }
  2807. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2808. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2809. componentOptions.methods[callMethod] = function (args) {
  2810. return this.$vm[callMethod](args);
  2811. };
  2812. });
  2813. }
  2814. if (needVueOptions) {
  2815. return [componentOptions, vueOptions, VueComponent];
  2816. }
  2817. if (isPage) {
  2818. return componentOptions;
  2819. }
  2820. return [componentOptions, VueComponent];
  2821. }
  2822. function parseComponent(vueComponentOptions, needVueOptions) {
  2823. return parseBaseComponent(vueComponentOptions, {
  2824. isPage: isPage,
  2825. initRelation: initRelation
  2826. }, needVueOptions);
  2827. }
  2828. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2829. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2830. function parseBasePage(vuePageOptions) {
  2831. var _parseComponent = parseComponent(vuePageOptions, true),
  2832. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2833. pageOptions = _parseComponent2[0],
  2834. vueOptions = _parseComponent2[1];
  2835. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2836. pageOptions.methods.onLoad = function (query) {
  2837. this.options = query;
  2838. var copyQuery = Object.assign({}, query);
  2839. delete copyQuery.__id__;
  2840. this.$page = {
  2841. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2842. };
  2843. this.$vm.$mp.query = query; // 兼容 mpvue
  2844. this.$vm.__call_hook('onLoad', query);
  2845. };
  2846. {
  2847. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2848. }
  2849. {
  2850. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2851. }
  2852. return pageOptions;
  2853. }
  2854. function parsePage(vuePageOptions) {
  2855. return parseBasePage(vuePageOptions);
  2856. }
  2857. function createPage(vuePageOptions) {
  2858. {
  2859. return Component(parsePage(vuePageOptions));
  2860. }
  2861. }
  2862. function createComponent(vueOptions) {
  2863. {
  2864. return Component(parseComponent(vueOptions));
  2865. }
  2866. }
  2867. function createSubpackageApp(vm) {
  2868. var appOptions = parseApp(vm);
  2869. var app = getApp({
  2870. allowDefault: true
  2871. });
  2872. vm.$scope = app;
  2873. var globalData = app.globalData;
  2874. if (globalData) {
  2875. Object.keys(appOptions.globalData).forEach(function (name) {
  2876. if (!hasOwn(globalData, name)) {
  2877. globalData[name] = appOptions.globalData[name];
  2878. }
  2879. });
  2880. }
  2881. Object.keys(appOptions).forEach(function (name) {
  2882. if (!hasOwn(app, name)) {
  2883. app[name] = appOptions[name];
  2884. }
  2885. });
  2886. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2887. wx.onAppShow(function () {
  2888. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2889. args[_key5] = arguments[_key5];
  2890. }
  2891. vm.__call_hook('onShow', args);
  2892. });
  2893. }
  2894. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2895. wx.onAppHide(function () {
  2896. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2897. args[_key6] = arguments[_key6];
  2898. }
  2899. vm.__call_hook('onHide', args);
  2900. });
  2901. }
  2902. if (isFn(appOptions.onLaunch)) {
  2903. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2904. vm.__call_hook('onLaunch', args);
  2905. }
  2906. return vm;
  2907. }
  2908. function createPlugin(vm) {
  2909. var appOptions = parseApp(vm);
  2910. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2911. wx.onAppShow(function () {
  2912. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2913. args[_key7] = arguments[_key7];
  2914. }
  2915. vm.__call_hook('onShow', args);
  2916. });
  2917. }
  2918. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2919. wx.onAppHide(function () {
  2920. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2921. args[_key8] = arguments[_key8];
  2922. }
  2923. vm.__call_hook('onHide', args);
  2924. });
  2925. }
  2926. if (isFn(appOptions.onLaunch)) {
  2927. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2928. vm.__call_hook('onLaunch', args);
  2929. }
  2930. return vm;
  2931. }
  2932. todos.forEach(function (todoApi) {
  2933. protocols[todoApi] = false;
  2934. });
  2935. canIUses.forEach(function (canIUseApi) {
  2936. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2937. if (!wx.canIUse(apiName)) {
  2938. protocols[canIUseApi] = false;
  2939. }
  2940. });
  2941. var uni = {};
  2942. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2943. uni = new Proxy({}, {
  2944. get: function get(target, name) {
  2945. if (hasOwn(target, name)) {
  2946. return target[name];
  2947. }
  2948. if (baseApi[name]) {
  2949. return baseApi[name];
  2950. }
  2951. if (api[name]) {
  2952. return promisify(name, api[name]);
  2953. }
  2954. {
  2955. if (extraApi[name]) {
  2956. return promisify(name, extraApi[name]);
  2957. }
  2958. if (todoApis[name]) {
  2959. return promisify(name, todoApis[name]);
  2960. }
  2961. }
  2962. if (eventApi[name]) {
  2963. return eventApi[name];
  2964. }
  2965. return promisify(name, wrapper(name, wx[name]));
  2966. },
  2967. set: function set(target, name, value) {
  2968. target[name] = value;
  2969. return true;
  2970. }
  2971. });
  2972. } else {
  2973. Object.keys(baseApi).forEach(function (name) {
  2974. uni[name] = baseApi[name];
  2975. });
  2976. {
  2977. Object.keys(todoApis).forEach(function (name) {
  2978. uni[name] = promisify(name, todoApis[name]);
  2979. });
  2980. Object.keys(extraApi).forEach(function (name) {
  2981. uni[name] = promisify(name, extraApi[name]);
  2982. });
  2983. }
  2984. Object.keys(eventApi).forEach(function (name) {
  2985. uni[name] = eventApi[name];
  2986. });
  2987. Object.keys(api).forEach(function (name) {
  2988. uni[name] = promisify(name, api[name]);
  2989. });
  2990. Object.keys(wx).forEach(function (name) {
  2991. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2992. uni[name] = promisify(name, wrapper(name, wx[name]));
  2993. }
  2994. });
  2995. }
  2996. wx.createApp = createApp;
  2997. wx.createPage = createPage;
  2998. wx.createComponent = createComponent;
  2999. wx.createSubpackageApp = createSubpackageApp;
  3000. wx.createPlugin = createPlugin;
  3001. var uni$1 = uni;
  3002. var _default = uni$1;
  3003. exports.default = _default;
  3004. /* 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)))
  3005. /***/ }),
  3006. /***/ 20:
  3007. /*!****************************************************************!*\
  3008. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3009. \****************************************************************/
  3010. /*! no static exports found */
  3011. /***/ (function(module, exports) {
  3012. function _iterableToArray(iter) {
  3013. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3014. }
  3015. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3016. /***/ }),
  3017. /***/ 21:
  3018. /*!******************************************************************!*\
  3019. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3020. \******************************************************************/
  3021. /*! no static exports found */
  3022. /***/ (function(module, exports) {
  3023. function _nonIterableSpread() {
  3024. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3025. }
  3026. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3027. /***/ }),
  3028. /***/ 22:
  3029. /*!*************************************************************!*\
  3030. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3031. \*************************************************************/
  3032. /*! no static exports found */
  3033. /***/ (function(module, exports, __webpack_require__) {
  3034. "use strict";
  3035. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3036. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3037. Object.defineProperty(exports, "__esModule", {
  3038. value: true
  3039. });
  3040. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3041. exports.compileI18nJsonStr = compileI18nJsonStr;
  3042. exports.hasI18nJson = hasI18nJson;
  3043. exports.initVueI18n = initVueI18n;
  3044. exports.isI18nStr = isI18nStr;
  3045. exports.isString = void 0;
  3046. exports.normalizeLocale = normalizeLocale;
  3047. exports.parseI18nJson = parseI18nJson;
  3048. exports.resolveLocale = resolveLocale;
  3049. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3050. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3051. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3052. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3053. var isObject = function isObject(val) {
  3054. return val !== null && (0, _typeof2.default)(val) === 'object';
  3055. };
  3056. var defaultDelimiters = ['{', '}'];
  3057. var BaseFormatter = /*#__PURE__*/function () {
  3058. function BaseFormatter() {
  3059. (0, _classCallCheck2.default)(this, BaseFormatter);
  3060. this._caches = Object.create(null);
  3061. }
  3062. (0, _createClass2.default)(BaseFormatter, [{
  3063. key: "interpolate",
  3064. value: function interpolate(message, values) {
  3065. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3066. if (!values) {
  3067. return [message];
  3068. }
  3069. var tokens = this._caches[message];
  3070. if (!tokens) {
  3071. tokens = parse(message, delimiters);
  3072. this._caches[message] = tokens;
  3073. }
  3074. return compile(tokens, values);
  3075. }
  3076. }]);
  3077. return BaseFormatter;
  3078. }();
  3079. exports.Formatter = BaseFormatter;
  3080. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3081. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3082. function parse(format, _ref) {
  3083. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3084. startDelimiter = _ref2[0],
  3085. endDelimiter = _ref2[1];
  3086. var tokens = [];
  3087. var position = 0;
  3088. var text = '';
  3089. while (position < format.length) {
  3090. var char = format[position++];
  3091. if (char === startDelimiter) {
  3092. if (text) {
  3093. tokens.push({
  3094. type: 'text',
  3095. value: text
  3096. });
  3097. }
  3098. text = '';
  3099. var sub = '';
  3100. char = format[position++];
  3101. while (char !== undefined && char !== endDelimiter) {
  3102. sub += char;
  3103. char = format[position++];
  3104. }
  3105. var isClosed = char === endDelimiter;
  3106. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3107. tokens.push({
  3108. value: sub,
  3109. type: type
  3110. });
  3111. }
  3112. // else if (char === '%') {
  3113. // // when found rails i18n syntax, skip text capture
  3114. // if (format[position] !== '{') {
  3115. // text += char
  3116. // }
  3117. // }
  3118. else {
  3119. text += char;
  3120. }
  3121. }
  3122. text && tokens.push({
  3123. type: 'text',
  3124. value: text
  3125. });
  3126. return tokens;
  3127. }
  3128. function compile(tokens, values) {
  3129. var compiled = [];
  3130. var index = 0;
  3131. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3132. if (mode === 'unknown') {
  3133. return compiled;
  3134. }
  3135. while (index < tokens.length) {
  3136. var token = tokens[index];
  3137. switch (token.type) {
  3138. case 'text':
  3139. compiled.push(token.value);
  3140. break;
  3141. case 'list':
  3142. compiled.push(values[parseInt(token.value, 10)]);
  3143. break;
  3144. case 'named':
  3145. if (mode === 'named') {
  3146. compiled.push(values[token.value]);
  3147. } else {
  3148. if (true) {
  3149. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3150. }
  3151. }
  3152. break;
  3153. case 'unknown':
  3154. if (true) {
  3155. console.warn("Detect 'unknown' type of token!");
  3156. }
  3157. break;
  3158. }
  3159. index++;
  3160. }
  3161. return compiled;
  3162. }
  3163. var LOCALE_ZH_HANS = 'zh-Hans';
  3164. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3165. var LOCALE_ZH_HANT = 'zh-Hant';
  3166. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3167. var LOCALE_EN = 'en';
  3168. exports.LOCALE_EN = LOCALE_EN;
  3169. var LOCALE_FR = 'fr';
  3170. exports.LOCALE_FR = LOCALE_FR;
  3171. var LOCALE_ES = 'es';
  3172. exports.LOCALE_ES = LOCALE_ES;
  3173. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3174. var hasOwn = function hasOwn(val, key) {
  3175. return hasOwnProperty.call(val, key);
  3176. };
  3177. var defaultFormatter = new BaseFormatter();
  3178. function include(str, parts) {
  3179. return !!parts.find(function (part) {
  3180. return str.indexOf(part) !== -1;
  3181. });
  3182. }
  3183. function startsWith(str, parts) {
  3184. return parts.find(function (part) {
  3185. return str.indexOf(part) === 0;
  3186. });
  3187. }
  3188. function normalizeLocale(locale, messages) {
  3189. if (!locale) {
  3190. return;
  3191. }
  3192. locale = locale.trim().replace(/_/g, '-');
  3193. if (messages && messages[locale]) {
  3194. return locale;
  3195. }
  3196. locale = locale.toLowerCase();
  3197. if (locale === 'chinese') {
  3198. // 支付宝
  3199. return LOCALE_ZH_HANS;
  3200. }
  3201. if (locale.indexOf('zh') === 0) {
  3202. if (locale.indexOf('-hans') > -1) {
  3203. return LOCALE_ZH_HANS;
  3204. }
  3205. if (locale.indexOf('-hant') > -1) {
  3206. return LOCALE_ZH_HANT;
  3207. }
  3208. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3209. return LOCALE_ZH_HANT;
  3210. }
  3211. return LOCALE_ZH_HANS;
  3212. }
  3213. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3214. if (messages && Object.keys(messages).length > 0) {
  3215. locales = Object.keys(messages);
  3216. }
  3217. var lang = startsWith(locale, locales);
  3218. if (lang) {
  3219. return lang;
  3220. }
  3221. }
  3222. var I18n = /*#__PURE__*/function () {
  3223. function I18n(_ref3) {
  3224. var locale = _ref3.locale,
  3225. fallbackLocale = _ref3.fallbackLocale,
  3226. messages = _ref3.messages,
  3227. watcher = _ref3.watcher,
  3228. formater = _ref3.formater;
  3229. (0, _classCallCheck2.default)(this, I18n);
  3230. this.locale = LOCALE_EN;
  3231. this.fallbackLocale = LOCALE_EN;
  3232. this.message = {};
  3233. this.messages = {};
  3234. this.watchers = [];
  3235. if (fallbackLocale) {
  3236. this.fallbackLocale = fallbackLocale;
  3237. }
  3238. this.formater = formater || defaultFormatter;
  3239. this.messages = messages || {};
  3240. this.setLocale(locale || LOCALE_EN);
  3241. if (watcher) {
  3242. this.watchLocale(watcher);
  3243. }
  3244. }
  3245. (0, _createClass2.default)(I18n, [{
  3246. key: "setLocale",
  3247. value: function setLocale(locale) {
  3248. var _this = this;
  3249. var oldLocale = this.locale;
  3250. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3251. if (!this.messages[this.locale]) {
  3252. // 可能初始化时不存在
  3253. this.messages[this.locale] = {};
  3254. }
  3255. this.message = this.messages[this.locale];
  3256. // 仅发生变化时,通知
  3257. if (oldLocale !== this.locale) {
  3258. this.watchers.forEach(function (watcher) {
  3259. watcher(_this.locale, oldLocale);
  3260. });
  3261. }
  3262. }
  3263. }, {
  3264. key: "getLocale",
  3265. value: function getLocale() {
  3266. return this.locale;
  3267. }
  3268. }, {
  3269. key: "watchLocale",
  3270. value: function watchLocale(fn) {
  3271. var _this2 = this;
  3272. var index = this.watchers.push(fn) - 1;
  3273. return function () {
  3274. _this2.watchers.splice(index, 1);
  3275. };
  3276. }
  3277. }, {
  3278. key: "add",
  3279. value: function add(locale, message) {
  3280. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3281. var curMessages = this.messages[locale];
  3282. if (curMessages) {
  3283. if (override) {
  3284. Object.assign(curMessages, message);
  3285. } else {
  3286. Object.keys(message).forEach(function (key) {
  3287. if (!hasOwn(curMessages, key)) {
  3288. curMessages[key] = message[key];
  3289. }
  3290. });
  3291. }
  3292. } else {
  3293. this.messages[locale] = message;
  3294. }
  3295. }
  3296. }, {
  3297. key: "f",
  3298. value: function f(message, values, delimiters) {
  3299. return this.formater.interpolate(message, values, delimiters).join('');
  3300. }
  3301. }, {
  3302. key: "t",
  3303. value: function t(key, locale, values) {
  3304. var message = this.message;
  3305. if (typeof locale === 'string') {
  3306. locale = normalizeLocale(locale, this.messages);
  3307. locale && (message = this.messages[locale]);
  3308. } else {
  3309. values = locale;
  3310. }
  3311. if (!hasOwn(message, key)) {
  3312. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3313. return key;
  3314. }
  3315. return this.formater.interpolate(message[key], values).join('');
  3316. }
  3317. }]);
  3318. return I18n;
  3319. }();
  3320. exports.I18n = I18n;
  3321. function watchAppLocale(appVm, i18n) {
  3322. // 需要保证 watch 的触发在组件渲染之前
  3323. if (appVm.$watchLocale) {
  3324. // vue2
  3325. appVm.$watchLocale(function (newLocale) {
  3326. i18n.setLocale(newLocale);
  3327. });
  3328. } else {
  3329. appVm.$watch(function () {
  3330. return appVm.$locale;
  3331. }, function (newLocale) {
  3332. i18n.setLocale(newLocale);
  3333. });
  3334. }
  3335. }
  3336. function getDefaultLocale() {
  3337. if (typeof uni !== 'undefined' && uni.getLocale) {
  3338. return uni.getLocale();
  3339. }
  3340. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3341. if (typeof global !== 'undefined' && global.getLocale) {
  3342. return global.getLocale();
  3343. }
  3344. return LOCALE_EN;
  3345. }
  3346. function initVueI18n(locale) {
  3347. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3348. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3349. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3350. // 兼容旧版本入参
  3351. if (typeof locale !== 'string') {
  3352. var _ref4 = [messages, locale];
  3353. locale = _ref4[0];
  3354. messages = _ref4[1];
  3355. }
  3356. if (typeof locale !== 'string') {
  3357. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3358. locale = getDefaultLocale();
  3359. }
  3360. if (typeof fallbackLocale !== 'string') {
  3361. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3362. }
  3363. var i18n = new I18n({
  3364. locale: locale,
  3365. fallbackLocale: fallbackLocale,
  3366. messages: messages,
  3367. watcher: watcher
  3368. });
  3369. var _t = function t(key, values) {
  3370. if (typeof getApp !== 'function') {
  3371. // app view
  3372. /* eslint-disable no-func-assign */
  3373. _t = function t(key, values) {
  3374. return i18n.t(key, values);
  3375. };
  3376. } else {
  3377. var isWatchedAppLocale = false;
  3378. _t = function t(key, values) {
  3379. var appVm = getApp().$vm;
  3380. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3381. // options: {
  3382. // type: Array,
  3383. // default () {
  3384. // return [{
  3385. // icon: 'shop',
  3386. // text: t("uni-goods-nav.options.shop"),
  3387. // }, {
  3388. // icon: 'cart',
  3389. // text: t("uni-goods-nav.options.cart")
  3390. // }]
  3391. // }
  3392. // },
  3393. if (appVm) {
  3394. // 触发响应式
  3395. appVm.$locale;
  3396. if (!isWatchedAppLocale) {
  3397. isWatchedAppLocale = true;
  3398. watchAppLocale(appVm, i18n);
  3399. }
  3400. }
  3401. return i18n.t(key, values);
  3402. };
  3403. }
  3404. return _t(key, values);
  3405. };
  3406. return {
  3407. i18n: i18n,
  3408. f: function f(message, values, delimiters) {
  3409. return i18n.f(message, values, delimiters);
  3410. },
  3411. t: function t(key, values) {
  3412. return _t(key, values);
  3413. },
  3414. add: function add(locale, message) {
  3415. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3416. return i18n.add(locale, message, override);
  3417. },
  3418. watch: function watch(fn) {
  3419. return i18n.watchLocale(fn);
  3420. },
  3421. getLocale: function getLocale() {
  3422. return i18n.getLocale();
  3423. },
  3424. setLocale: function setLocale(newLocale) {
  3425. return i18n.setLocale(newLocale);
  3426. }
  3427. };
  3428. }
  3429. var isString = function isString(val) {
  3430. return typeof val === 'string';
  3431. };
  3432. exports.isString = isString;
  3433. var formater;
  3434. function hasI18nJson(jsonObj, delimiters) {
  3435. if (!formater) {
  3436. formater = new BaseFormatter();
  3437. }
  3438. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3439. var value = jsonObj[key];
  3440. if (isString(value)) {
  3441. if (isI18nStr(value, delimiters)) {
  3442. return true;
  3443. }
  3444. } else {
  3445. return hasI18nJson(value, delimiters);
  3446. }
  3447. });
  3448. }
  3449. function parseI18nJson(jsonObj, values, delimiters) {
  3450. if (!formater) {
  3451. formater = new BaseFormatter();
  3452. }
  3453. walkJsonObj(jsonObj, function (jsonObj, key) {
  3454. var value = jsonObj[key];
  3455. if (isString(value)) {
  3456. if (isI18nStr(value, delimiters)) {
  3457. jsonObj[key] = compileStr(value, values, delimiters);
  3458. }
  3459. } else {
  3460. parseI18nJson(value, values, delimiters);
  3461. }
  3462. });
  3463. return jsonObj;
  3464. }
  3465. function compileI18nJsonStr(jsonStr, _ref5) {
  3466. var locale = _ref5.locale,
  3467. locales = _ref5.locales,
  3468. delimiters = _ref5.delimiters;
  3469. if (!isI18nStr(jsonStr, delimiters)) {
  3470. return jsonStr;
  3471. }
  3472. if (!formater) {
  3473. formater = new BaseFormatter();
  3474. }
  3475. var localeValues = [];
  3476. Object.keys(locales).forEach(function (name) {
  3477. if (name !== locale) {
  3478. localeValues.push({
  3479. locale: name,
  3480. values: locales[name]
  3481. });
  3482. }
  3483. });
  3484. localeValues.unshift({
  3485. locale: locale,
  3486. values: locales[locale]
  3487. });
  3488. try {
  3489. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3490. } catch (e) {}
  3491. return jsonStr;
  3492. }
  3493. function isI18nStr(value, delimiters) {
  3494. return value.indexOf(delimiters[0]) > -1;
  3495. }
  3496. function compileStr(value, values, delimiters) {
  3497. return formater.interpolate(value, values, delimiters).join('');
  3498. }
  3499. function compileValue(jsonObj, key, localeValues, delimiters) {
  3500. var value = jsonObj[key];
  3501. if (isString(value)) {
  3502. // 存在国际化
  3503. if (isI18nStr(value, delimiters)) {
  3504. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3505. if (localeValues.length > 1) {
  3506. // 格式化国际化语言
  3507. var valueLocales = jsonObj[key + 'Locales'] = {};
  3508. localeValues.forEach(function (localValue) {
  3509. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3510. });
  3511. }
  3512. }
  3513. } else {
  3514. compileJsonObj(value, localeValues, delimiters);
  3515. }
  3516. }
  3517. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3518. walkJsonObj(jsonObj, function (jsonObj, key) {
  3519. compileValue(jsonObj, key, localeValues, delimiters);
  3520. });
  3521. return jsonObj;
  3522. }
  3523. function walkJsonObj(jsonObj, walk) {
  3524. if (Array.isArray(jsonObj)) {
  3525. for (var i = 0; i < jsonObj.length; i++) {
  3526. if (walk(jsonObj, i)) {
  3527. return true;
  3528. }
  3529. }
  3530. } else if (isObject(jsonObj)) {
  3531. for (var key in jsonObj) {
  3532. if (walk(jsonObj, key)) {
  3533. return true;
  3534. }
  3535. }
  3536. }
  3537. return false;
  3538. }
  3539. function resolveLocale(locales) {
  3540. return function (locale) {
  3541. if (!locale) {
  3542. return locale;
  3543. }
  3544. locale = normalizeLocale(locale) || locale;
  3545. return resolveLocaleChain(locale).find(function (locale) {
  3546. return locales.indexOf(locale) > -1;
  3547. });
  3548. };
  3549. }
  3550. function resolveLocaleChain(locale) {
  3551. var chain = [];
  3552. var tokens = locale.split('-');
  3553. while (tokens.length) {
  3554. chain.push(tokens.join('-'));
  3555. tokens.pop();
  3556. }
  3557. return chain;
  3558. }
  3559. /* 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)))
  3560. /***/ }),
  3561. /***/ 222:
  3562. /*!**************************************************************************!*\
  3563. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/taskEventApi.js ***!
  3564. \**************************************************************************/
  3565. /*! no static exports found */
  3566. /***/ (function(module, exports, __webpack_require__) {
  3567. "use strict";
  3568. Object.defineProperty(exports, "__esModule", {
  3569. value: true
  3570. });
  3571. exports.createTaskEvent = createTaskEvent;
  3572. exports.deleteTaskEvent = deleteTaskEvent;
  3573. exports.getTaskEventByList = getTaskEventByList;
  3574. exports.getTaskEventByPage = getTaskEventByPage;
  3575. exports.getTaskEventByTaskId = getTaskEventByTaskId;
  3576. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  3577. /**
  3578. * 获取Task Event分页
  3579. * @param data
  3580. * @returns
  3581. */
  3582. function getTaskEventByPage(data) {
  3583. return (0, _request.request)({
  3584. url: '/task/event/page',
  3585. method: 'GET',
  3586. params: data
  3587. });
  3588. }
  3589. /**
  3590. * 获取Task Event列表
  3591. * @param data
  3592. * @returns
  3593. */
  3594. function getTaskEventByList(data) {
  3595. return (0, _request.request)({
  3596. url: '/task/event',
  3597. method: 'GET',
  3598. params: data
  3599. });
  3600. }
  3601. /**
  3602. * 根据Id获取Task Event
  3603. * @param data
  3604. * @returns
  3605. */
  3606. function getTaskEventByTaskId(taskId) {
  3607. return (0, _request.request)({
  3608. url: "/task/event/".concat(taskId),
  3609. method: 'GET'
  3610. });
  3611. }
  3612. /**
  3613. * 添加Task Event
  3614. * @param data
  3615. * @returns
  3616. */
  3617. function createTaskEvent(data) {
  3618. return (0, _request.request)({
  3619. url: "/task/event/add",
  3620. method: 'POST',
  3621. data: data
  3622. });
  3623. }
  3624. /**
  3625. * 删除Task Event
  3626. * @param data
  3627. * @returns
  3628. */
  3629. function deleteTaskEvent(taskId) {
  3630. return (0, _request.request)({
  3631. url: "/task/event/".concat(taskId),
  3632. method: 'DELETE'
  3633. });
  3634. }
  3635. /***/ }),
  3636. /***/ 23:
  3637. /*!***************************************************************!*\
  3638. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3639. \***************************************************************/
  3640. /*! no static exports found */
  3641. /***/ (function(module, exports) {
  3642. function _classCallCheck(instance, Constructor) {
  3643. if (!(instance instanceof Constructor)) {
  3644. throw new TypeError("Cannot call a class as a function");
  3645. }
  3646. }
  3647. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3648. /***/ }),
  3649. /***/ 24:
  3650. /*!************************************************************!*\
  3651. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3652. \************************************************************/
  3653. /*! no static exports found */
  3654. /***/ (function(module, exports, __webpack_require__) {
  3655. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3656. function _defineProperties(target, props) {
  3657. for (var i = 0; i < props.length; i++) {
  3658. var descriptor = props[i];
  3659. descriptor.enumerable = descriptor.enumerable || false;
  3660. descriptor.configurable = true;
  3661. if ("value" in descriptor) descriptor.writable = true;
  3662. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3663. }
  3664. }
  3665. function _createClass(Constructor, protoProps, staticProps) {
  3666. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3667. if (staticProps) _defineProperties(Constructor, staticProps);
  3668. Object.defineProperty(Constructor, "prototype", {
  3669. writable: false
  3670. });
  3671. return Constructor;
  3672. }
  3673. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3674. /***/ }),
  3675. /***/ 247:
  3676. /*!*********************************************************************!*\
  3677. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/dutyApi.js ***!
  3678. \*********************************************************************/
  3679. /*! no static exports found */
  3680. /***/ (function(module, exports, __webpack_require__) {
  3681. "use strict";
  3682. Object.defineProperty(exports, "__esModule", {
  3683. value: true
  3684. });
  3685. exports.creatDuty = creatDuty;
  3686. exports.getDutyRecord = getDutyRecord;
  3687. exports.getDutyRecordItemByList = getDutyRecordItemByList;
  3688. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  3689. /**
  3690. * 获取Danger列表
  3691. * @param data
  3692. * @returns
  3693. */
  3694. function creatDuty(data) {
  3695. return (0, _request.request)({
  3696. url: '/duty/record/item/add',
  3697. method: 'POST',
  3698. data: data
  3699. });
  3700. }
  3701. /**
  3702. * 列表查询
  3703. * @param data
  3704. * @returns
  3705. */
  3706. function getDutyRecordItemByList(data) {
  3707. return (0, _request.request)({
  3708. url: '/duty/record/item',
  3709. method: 'GET',
  3710. params: data
  3711. });
  3712. }
  3713. /**
  3714. * 列表查询
  3715. * @param data
  3716. * @returns
  3717. */
  3718. function getDutyRecord(dutyDate) {
  3719. return (0, _request.request)({
  3720. url: "/duty/record/item/my/".concat(dutyDate)
  3721. });
  3722. }
  3723. /***/ }),
  3724. /***/ 25:
  3725. /*!******************************************************************************************!*\
  3726. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3727. \******************************************************************************************/
  3728. /*! exports provided: default */
  3729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3730. "use strict";
  3731. __webpack_require__.r(__webpack_exports__);
  3732. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3733. * Vue.js v2.6.11
  3734. * (c) 2014-2023 Evan You
  3735. * Released under the MIT License.
  3736. */
  3737. /* */
  3738. var emptyObject = Object.freeze({});
  3739. // These helpers produce better VM code in JS engines due to their
  3740. // explicitness and function inlining.
  3741. function isUndef (v) {
  3742. return v === undefined || v === null
  3743. }
  3744. function isDef (v) {
  3745. return v !== undefined && v !== null
  3746. }
  3747. function isTrue (v) {
  3748. return v === true
  3749. }
  3750. function isFalse (v) {
  3751. return v === false
  3752. }
  3753. /**
  3754. * Check if value is primitive.
  3755. */
  3756. function isPrimitive (value) {
  3757. return (
  3758. typeof value === 'string' ||
  3759. typeof value === 'number' ||
  3760. // $flow-disable-line
  3761. typeof value === 'symbol' ||
  3762. typeof value === 'boolean'
  3763. )
  3764. }
  3765. /**
  3766. * Quick object check - this is primarily used to tell
  3767. * Objects from primitive values when we know the value
  3768. * is a JSON-compliant type.
  3769. */
  3770. function isObject (obj) {
  3771. return obj !== null && typeof obj === 'object'
  3772. }
  3773. /**
  3774. * Get the raw type string of a value, e.g., [object Object].
  3775. */
  3776. var _toString = Object.prototype.toString;
  3777. function toRawType (value) {
  3778. return _toString.call(value).slice(8, -1)
  3779. }
  3780. /**
  3781. * Strict object type check. Only returns true
  3782. * for plain JavaScript objects.
  3783. */
  3784. function isPlainObject (obj) {
  3785. return _toString.call(obj) === '[object Object]'
  3786. }
  3787. function isRegExp (v) {
  3788. return _toString.call(v) === '[object RegExp]'
  3789. }
  3790. /**
  3791. * Check if val is a valid array index.
  3792. */
  3793. function isValidArrayIndex (val) {
  3794. var n = parseFloat(String(val));
  3795. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3796. }
  3797. function isPromise (val) {
  3798. return (
  3799. isDef(val) &&
  3800. typeof val.then === 'function' &&
  3801. typeof val.catch === 'function'
  3802. )
  3803. }
  3804. /**
  3805. * Convert a value to a string that is actually rendered.
  3806. */
  3807. function toString (val) {
  3808. return val == null
  3809. ? ''
  3810. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3811. ? JSON.stringify(val, null, 2)
  3812. : String(val)
  3813. }
  3814. /**
  3815. * Convert an input value to a number for persistence.
  3816. * If the conversion fails, return original string.
  3817. */
  3818. function toNumber (val) {
  3819. var n = parseFloat(val);
  3820. return isNaN(n) ? val : n
  3821. }
  3822. /**
  3823. * Make a map and return a function for checking if a key
  3824. * is in that map.
  3825. */
  3826. function makeMap (
  3827. str,
  3828. expectsLowerCase
  3829. ) {
  3830. var map = Object.create(null);
  3831. var list = str.split(',');
  3832. for (var i = 0; i < list.length; i++) {
  3833. map[list[i]] = true;
  3834. }
  3835. return expectsLowerCase
  3836. ? function (val) { return map[val.toLowerCase()]; }
  3837. : function (val) { return map[val]; }
  3838. }
  3839. /**
  3840. * Check if a tag is a built-in tag.
  3841. */
  3842. var isBuiltInTag = makeMap('slot,component', true);
  3843. /**
  3844. * Check if an attribute is a reserved attribute.
  3845. */
  3846. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3847. /**
  3848. * Remove an item from an array.
  3849. */
  3850. function remove (arr, item) {
  3851. if (arr.length) {
  3852. var index = arr.indexOf(item);
  3853. if (index > -1) {
  3854. return arr.splice(index, 1)
  3855. }
  3856. }
  3857. }
  3858. /**
  3859. * Check whether an object has the property.
  3860. */
  3861. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3862. function hasOwn (obj, key) {
  3863. return hasOwnProperty.call(obj, key)
  3864. }
  3865. /**
  3866. * Create a cached version of a pure function.
  3867. */
  3868. function cached (fn) {
  3869. var cache = Object.create(null);
  3870. return (function cachedFn (str) {
  3871. var hit = cache[str];
  3872. return hit || (cache[str] = fn(str))
  3873. })
  3874. }
  3875. /**
  3876. * Camelize a hyphen-delimited string.
  3877. */
  3878. var camelizeRE = /-(\w)/g;
  3879. var camelize = cached(function (str) {
  3880. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3881. });
  3882. /**
  3883. * Capitalize a string.
  3884. */
  3885. var capitalize = cached(function (str) {
  3886. return str.charAt(0).toUpperCase() + str.slice(1)
  3887. });
  3888. /**
  3889. * Hyphenate a camelCase string.
  3890. */
  3891. var hyphenateRE = /\B([A-Z])/g;
  3892. var hyphenate = cached(function (str) {
  3893. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3894. });
  3895. /**
  3896. * Simple bind polyfill for environments that do not support it,
  3897. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3898. * since native bind is now performant enough in most browsers.
  3899. * But removing it would mean breaking code that was able to run in
  3900. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3901. */
  3902. /* istanbul ignore next */
  3903. function polyfillBind (fn, ctx) {
  3904. function boundFn (a) {
  3905. var l = arguments.length;
  3906. return l
  3907. ? l > 1
  3908. ? fn.apply(ctx, arguments)
  3909. : fn.call(ctx, a)
  3910. : fn.call(ctx)
  3911. }
  3912. boundFn._length = fn.length;
  3913. return boundFn
  3914. }
  3915. function nativeBind (fn, ctx) {
  3916. return fn.bind(ctx)
  3917. }
  3918. var bind = Function.prototype.bind
  3919. ? nativeBind
  3920. : polyfillBind;
  3921. /**
  3922. * Convert an Array-like object to a real Array.
  3923. */
  3924. function toArray (list, start) {
  3925. start = start || 0;
  3926. var i = list.length - start;
  3927. var ret = new Array(i);
  3928. while (i--) {
  3929. ret[i] = list[i + start];
  3930. }
  3931. return ret
  3932. }
  3933. /**
  3934. * Mix properties into target object.
  3935. */
  3936. function extend (to, _from) {
  3937. for (var key in _from) {
  3938. to[key] = _from[key];
  3939. }
  3940. return to
  3941. }
  3942. /**
  3943. * Merge an Array of Objects into a single Object.
  3944. */
  3945. function toObject (arr) {
  3946. var res = {};
  3947. for (var i = 0; i < arr.length; i++) {
  3948. if (arr[i]) {
  3949. extend(res, arr[i]);
  3950. }
  3951. }
  3952. return res
  3953. }
  3954. /* eslint-disable no-unused-vars */
  3955. /**
  3956. * Perform no operation.
  3957. * Stubbing args to make Flow happy without leaving useless transpiled code
  3958. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3959. */
  3960. function noop (a, b, c) {}
  3961. /**
  3962. * Always return false.
  3963. */
  3964. var no = function (a, b, c) { return false; };
  3965. /* eslint-enable no-unused-vars */
  3966. /**
  3967. * Return the same value.
  3968. */
  3969. var identity = function (_) { return _; };
  3970. /**
  3971. * Check if two values are loosely equal - that is,
  3972. * if they are plain objects, do they have the same shape?
  3973. */
  3974. function looseEqual (a, b) {
  3975. if (a === b) { return true }
  3976. var isObjectA = isObject(a);
  3977. var isObjectB = isObject(b);
  3978. if (isObjectA && isObjectB) {
  3979. try {
  3980. var isArrayA = Array.isArray(a);
  3981. var isArrayB = Array.isArray(b);
  3982. if (isArrayA && isArrayB) {
  3983. return a.length === b.length && a.every(function (e, i) {
  3984. return looseEqual(e, b[i])
  3985. })
  3986. } else if (a instanceof Date && b instanceof Date) {
  3987. return a.getTime() === b.getTime()
  3988. } else if (!isArrayA && !isArrayB) {
  3989. var keysA = Object.keys(a);
  3990. var keysB = Object.keys(b);
  3991. return keysA.length === keysB.length && keysA.every(function (key) {
  3992. return looseEqual(a[key], b[key])
  3993. })
  3994. } else {
  3995. /* istanbul ignore next */
  3996. return false
  3997. }
  3998. } catch (e) {
  3999. /* istanbul ignore next */
  4000. return false
  4001. }
  4002. } else if (!isObjectA && !isObjectB) {
  4003. return String(a) === String(b)
  4004. } else {
  4005. return false
  4006. }
  4007. }
  4008. /**
  4009. * Return the first index at which a loosely equal value can be
  4010. * found in the array (if value is a plain object, the array must
  4011. * contain an object of the same shape), or -1 if it is not present.
  4012. */
  4013. function looseIndexOf (arr, val) {
  4014. for (var i = 0; i < arr.length; i++) {
  4015. if (looseEqual(arr[i], val)) { return i }
  4016. }
  4017. return -1
  4018. }
  4019. /**
  4020. * Ensure a function is called only once.
  4021. */
  4022. function once (fn) {
  4023. var called = false;
  4024. return function () {
  4025. if (!called) {
  4026. called = true;
  4027. fn.apply(this, arguments);
  4028. }
  4029. }
  4030. }
  4031. var ASSET_TYPES = [
  4032. 'component',
  4033. 'directive',
  4034. 'filter'
  4035. ];
  4036. var LIFECYCLE_HOOKS = [
  4037. 'beforeCreate',
  4038. 'created',
  4039. 'beforeMount',
  4040. 'mounted',
  4041. 'beforeUpdate',
  4042. 'updated',
  4043. 'beforeDestroy',
  4044. 'destroyed',
  4045. 'activated',
  4046. 'deactivated',
  4047. 'errorCaptured',
  4048. 'serverPrefetch'
  4049. ];
  4050. /* */
  4051. var config = ({
  4052. /**
  4053. * Option merge strategies (used in core/util/options)
  4054. */
  4055. // $flow-disable-line
  4056. optionMergeStrategies: Object.create(null),
  4057. /**
  4058. * Whether to suppress warnings.
  4059. */
  4060. silent: false,
  4061. /**
  4062. * Show production mode tip message on boot?
  4063. */
  4064. productionTip: "development" !== 'production',
  4065. /**
  4066. * Whether to enable devtools
  4067. */
  4068. devtools: "development" !== 'production',
  4069. /**
  4070. * Whether to record perf
  4071. */
  4072. performance: false,
  4073. /**
  4074. * Error handler for watcher errors
  4075. */
  4076. errorHandler: null,
  4077. /**
  4078. * Warn handler for watcher warns
  4079. */
  4080. warnHandler: null,
  4081. /**
  4082. * Ignore certain custom elements
  4083. */
  4084. ignoredElements: [],
  4085. /**
  4086. * Custom user key aliases for v-on
  4087. */
  4088. // $flow-disable-line
  4089. keyCodes: Object.create(null),
  4090. /**
  4091. * Check if a tag is reserved so that it cannot be registered as a
  4092. * component. This is platform-dependent and may be overwritten.
  4093. */
  4094. isReservedTag: no,
  4095. /**
  4096. * Check if an attribute is reserved so that it cannot be used as a component
  4097. * prop. This is platform-dependent and may be overwritten.
  4098. */
  4099. isReservedAttr: no,
  4100. /**
  4101. * Check if a tag is an unknown element.
  4102. * Platform-dependent.
  4103. */
  4104. isUnknownElement: no,
  4105. /**
  4106. * Get the namespace of an element
  4107. */
  4108. getTagNamespace: noop,
  4109. /**
  4110. * Parse the real tag name for the specific platform.
  4111. */
  4112. parsePlatformTagName: identity,
  4113. /**
  4114. * Check if an attribute must be bound using property, e.g. value
  4115. * Platform-dependent.
  4116. */
  4117. mustUseProp: no,
  4118. /**
  4119. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4120. * This will significantly reduce performance if set to false.
  4121. */
  4122. async: true,
  4123. /**
  4124. * Exposed for legacy reasons
  4125. */
  4126. _lifecycleHooks: LIFECYCLE_HOOKS
  4127. });
  4128. /* */
  4129. /**
  4130. * unicode letters used for parsing html tags, component names and property paths.
  4131. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4132. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4133. */
  4134. 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/;
  4135. /**
  4136. * Check if a string starts with $ or _
  4137. */
  4138. function isReserved (str) {
  4139. var c = (str + '').charCodeAt(0);
  4140. return c === 0x24 || c === 0x5F
  4141. }
  4142. /**
  4143. * Define a property.
  4144. */
  4145. function def (obj, key, val, enumerable) {
  4146. Object.defineProperty(obj, key, {
  4147. value: val,
  4148. enumerable: !!enumerable,
  4149. writable: true,
  4150. configurable: true
  4151. });
  4152. }
  4153. /**
  4154. * Parse simple path.
  4155. */
  4156. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4157. function parsePath (path) {
  4158. if (bailRE.test(path)) {
  4159. return
  4160. }
  4161. var segments = path.split('.');
  4162. return function (obj) {
  4163. for (var i = 0; i < segments.length; i++) {
  4164. if (!obj) { return }
  4165. obj = obj[segments[i]];
  4166. }
  4167. return obj
  4168. }
  4169. }
  4170. /* */
  4171. // can we use __proto__?
  4172. var hasProto = '__proto__' in {};
  4173. // Browser environment sniffing
  4174. var inBrowser = typeof window !== 'undefined';
  4175. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4176. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4177. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4178. var isIE = UA && /msie|trident/.test(UA);
  4179. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4180. var isEdge = UA && UA.indexOf('edge/') > 0;
  4181. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4182. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4183. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4184. var isPhantomJS = UA && /phantomjs/.test(UA);
  4185. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4186. // Firefox has a "watch" function on Object.prototype...
  4187. var nativeWatch = ({}).watch;
  4188. if (inBrowser) {
  4189. try {
  4190. var opts = {};
  4191. Object.defineProperty(opts, 'passive', ({
  4192. get: function get () {
  4193. }
  4194. })); // https://github.com/facebook/flow/issues/285
  4195. window.addEventListener('test-passive', null, opts);
  4196. } catch (e) {}
  4197. }
  4198. // this needs to be lazy-evaled because vue may be required before
  4199. // vue-server-renderer can set VUE_ENV
  4200. var _isServer;
  4201. var isServerRendering = function () {
  4202. if (_isServer === undefined) {
  4203. /* istanbul ignore if */
  4204. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4205. // detect presence of vue-server-renderer and avoid
  4206. // Webpack shimming the process
  4207. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4208. } else {
  4209. _isServer = false;
  4210. }
  4211. }
  4212. return _isServer
  4213. };
  4214. // detect devtools
  4215. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4216. /* istanbul ignore next */
  4217. function isNative (Ctor) {
  4218. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4219. }
  4220. var hasSymbol =
  4221. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4222. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4223. var _Set;
  4224. /* istanbul ignore if */ // $flow-disable-line
  4225. if (typeof Set !== 'undefined' && isNative(Set)) {
  4226. // use native Set when available.
  4227. _Set = Set;
  4228. } else {
  4229. // a non-standard Set polyfill that only works with primitive keys.
  4230. _Set = /*@__PURE__*/(function () {
  4231. function Set () {
  4232. this.set = Object.create(null);
  4233. }
  4234. Set.prototype.has = function has (key) {
  4235. return this.set[key] === true
  4236. };
  4237. Set.prototype.add = function add (key) {
  4238. this.set[key] = true;
  4239. };
  4240. Set.prototype.clear = function clear () {
  4241. this.set = Object.create(null);
  4242. };
  4243. return Set;
  4244. }());
  4245. }
  4246. /* */
  4247. var warn = noop;
  4248. var tip = noop;
  4249. var generateComponentTrace = (noop); // work around flow check
  4250. var formatComponentName = (noop);
  4251. if (true) {
  4252. var hasConsole = typeof console !== 'undefined';
  4253. var classifyRE = /(?:^|[-_])(\w)/g;
  4254. var classify = function (str) { return str
  4255. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4256. .replace(/[-_]/g, ''); };
  4257. warn = function (msg, vm) {
  4258. var trace = vm ? generateComponentTrace(vm) : '';
  4259. if (config.warnHandler) {
  4260. config.warnHandler.call(null, msg, vm, trace);
  4261. } else if (hasConsole && (!config.silent)) {
  4262. console.error(("[Vue warn]: " + msg + trace));
  4263. }
  4264. };
  4265. tip = function (msg, vm) {
  4266. if (hasConsole && (!config.silent)) {
  4267. console.warn("[Vue tip]: " + msg + (
  4268. vm ? generateComponentTrace(vm) : ''
  4269. ));
  4270. }
  4271. };
  4272. formatComponentName = function (vm, includeFile) {
  4273. if (vm.$root === vm) {
  4274. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4275. return ('') + vm.$options.__file
  4276. }
  4277. return '<Root>'
  4278. }
  4279. var options = typeof vm === 'function' && vm.cid != null
  4280. ? vm.options
  4281. : vm._isVue
  4282. ? vm.$options || vm.constructor.options
  4283. : vm;
  4284. var name = options.name || options._componentTag;
  4285. var file = options.__file;
  4286. if (!name && file) {
  4287. var match = file.match(/([^/\\]+)\.vue$/);
  4288. name = match && match[1];
  4289. }
  4290. return (
  4291. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4292. (file && includeFile !== false ? (" at " + file) : '')
  4293. )
  4294. };
  4295. var repeat = function (str, n) {
  4296. var res = '';
  4297. while (n) {
  4298. if (n % 2 === 1) { res += str; }
  4299. if (n > 1) { str += str; }
  4300. n >>= 1;
  4301. }
  4302. return res
  4303. };
  4304. generateComponentTrace = function (vm) {
  4305. if (vm._isVue && vm.$parent) {
  4306. var tree = [];
  4307. var currentRecursiveSequence = 0;
  4308. while (vm && vm.$options.name !== 'PageBody') {
  4309. if (tree.length > 0) {
  4310. var last = tree[tree.length - 1];
  4311. if (last.constructor === vm.constructor) {
  4312. currentRecursiveSequence++;
  4313. vm = vm.$parent;
  4314. continue
  4315. } else if (currentRecursiveSequence > 0) {
  4316. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4317. currentRecursiveSequence = 0;
  4318. }
  4319. }
  4320. !vm.$options.isReserved && tree.push(vm);
  4321. vm = vm.$parent;
  4322. }
  4323. return '\n\nfound in\n\n' + tree
  4324. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4325. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4326. : formatComponentName(vm))); })
  4327. .join('\n')
  4328. } else {
  4329. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4330. }
  4331. };
  4332. }
  4333. /* */
  4334. var uid = 0;
  4335. /**
  4336. * A dep is an observable that can have multiple
  4337. * directives subscribing to it.
  4338. */
  4339. var Dep = function Dep () {
  4340. this.id = uid++;
  4341. this.subs = [];
  4342. };
  4343. Dep.prototype.addSub = function addSub (sub) {
  4344. this.subs.push(sub);
  4345. };
  4346. Dep.prototype.removeSub = function removeSub (sub) {
  4347. remove(this.subs, sub);
  4348. };
  4349. Dep.prototype.depend = function depend () {
  4350. if (Dep.SharedObject.target) {
  4351. Dep.SharedObject.target.addDep(this);
  4352. }
  4353. };
  4354. Dep.prototype.notify = function notify () {
  4355. // stabilize the subscriber list first
  4356. var subs = this.subs.slice();
  4357. if ( true && !config.async) {
  4358. // subs aren't sorted in scheduler if not running async
  4359. // we need to sort them now to make sure they fire in correct
  4360. // order
  4361. subs.sort(function (a, b) { return a.id - b.id; });
  4362. }
  4363. for (var i = 0, l = subs.length; i < l; i++) {
  4364. subs[i].update();
  4365. }
  4366. };
  4367. // The current target watcher being evaluated.
  4368. // This is globally unique because only one watcher
  4369. // can be evaluated at a time.
  4370. // fixed by xxxxxx (nvue shared vuex)
  4371. /* eslint-disable no-undef */
  4372. Dep.SharedObject = {};
  4373. Dep.SharedObject.target = null;
  4374. Dep.SharedObject.targetStack = [];
  4375. function pushTarget (target) {
  4376. Dep.SharedObject.targetStack.push(target);
  4377. Dep.SharedObject.target = target;
  4378. Dep.target = target;
  4379. }
  4380. function popTarget () {
  4381. Dep.SharedObject.targetStack.pop();
  4382. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4383. Dep.target = Dep.SharedObject.target;
  4384. }
  4385. /* */
  4386. var VNode = function VNode (
  4387. tag,
  4388. data,
  4389. children,
  4390. text,
  4391. elm,
  4392. context,
  4393. componentOptions,
  4394. asyncFactory
  4395. ) {
  4396. this.tag = tag;
  4397. this.data = data;
  4398. this.children = children;
  4399. this.text = text;
  4400. this.elm = elm;
  4401. this.ns = undefined;
  4402. this.context = context;
  4403. this.fnContext = undefined;
  4404. this.fnOptions = undefined;
  4405. this.fnScopeId = undefined;
  4406. this.key = data && data.key;
  4407. this.componentOptions = componentOptions;
  4408. this.componentInstance = undefined;
  4409. this.parent = undefined;
  4410. this.raw = false;
  4411. this.isStatic = false;
  4412. this.isRootInsert = true;
  4413. this.isComment = false;
  4414. this.isCloned = false;
  4415. this.isOnce = false;
  4416. this.asyncFactory = asyncFactory;
  4417. this.asyncMeta = undefined;
  4418. this.isAsyncPlaceholder = false;
  4419. };
  4420. var prototypeAccessors = { child: { configurable: true } };
  4421. // DEPRECATED: alias for componentInstance for backwards compat.
  4422. /* istanbul ignore next */
  4423. prototypeAccessors.child.get = function () {
  4424. return this.componentInstance
  4425. };
  4426. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4427. var createEmptyVNode = function (text) {
  4428. if ( text === void 0 ) text = '';
  4429. var node = new VNode();
  4430. node.text = text;
  4431. node.isComment = true;
  4432. return node
  4433. };
  4434. function createTextVNode (val) {
  4435. return new VNode(undefined, undefined, undefined, String(val))
  4436. }
  4437. // optimized shallow clone
  4438. // used for static nodes and slot nodes because they may be reused across
  4439. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4440. // on their elm reference.
  4441. function cloneVNode (vnode) {
  4442. var cloned = new VNode(
  4443. vnode.tag,
  4444. vnode.data,
  4445. // #7975
  4446. // clone children array to avoid mutating original in case of cloning
  4447. // a child.
  4448. vnode.children && vnode.children.slice(),
  4449. vnode.text,
  4450. vnode.elm,
  4451. vnode.context,
  4452. vnode.componentOptions,
  4453. vnode.asyncFactory
  4454. );
  4455. cloned.ns = vnode.ns;
  4456. cloned.isStatic = vnode.isStatic;
  4457. cloned.key = vnode.key;
  4458. cloned.isComment = vnode.isComment;
  4459. cloned.fnContext = vnode.fnContext;
  4460. cloned.fnOptions = vnode.fnOptions;
  4461. cloned.fnScopeId = vnode.fnScopeId;
  4462. cloned.asyncMeta = vnode.asyncMeta;
  4463. cloned.isCloned = true;
  4464. return cloned
  4465. }
  4466. /*
  4467. * not type checking this file because flow doesn't play well with
  4468. * dynamically accessing methods on Array prototype
  4469. */
  4470. var arrayProto = Array.prototype;
  4471. var arrayMethods = Object.create(arrayProto);
  4472. var methodsToPatch = [
  4473. 'push',
  4474. 'pop',
  4475. 'shift',
  4476. 'unshift',
  4477. 'splice',
  4478. 'sort',
  4479. 'reverse'
  4480. ];
  4481. /**
  4482. * Intercept mutating methods and emit events
  4483. */
  4484. methodsToPatch.forEach(function (method) {
  4485. // cache original method
  4486. var original = arrayProto[method];
  4487. def(arrayMethods, method, function mutator () {
  4488. var args = [], len = arguments.length;
  4489. while ( len-- ) args[ len ] = arguments[ len ];
  4490. var result = original.apply(this, args);
  4491. var ob = this.__ob__;
  4492. var inserted;
  4493. switch (method) {
  4494. case 'push':
  4495. case 'unshift':
  4496. inserted = args;
  4497. break
  4498. case 'splice':
  4499. inserted = args.slice(2);
  4500. break
  4501. }
  4502. if (inserted) { ob.observeArray(inserted); }
  4503. // notify change
  4504. ob.dep.notify();
  4505. return result
  4506. });
  4507. });
  4508. /* */
  4509. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4510. /**
  4511. * In some cases we may want to disable observation inside a component's
  4512. * update computation.
  4513. */
  4514. var shouldObserve = true;
  4515. function toggleObserving (value) {
  4516. shouldObserve = value;
  4517. }
  4518. /**
  4519. * Observer class that is attached to each observed
  4520. * object. Once attached, the observer converts the target
  4521. * object's property keys into getter/setters that
  4522. * collect dependencies and dispatch updates.
  4523. */
  4524. var Observer = function Observer (value) {
  4525. this.value = value;
  4526. this.dep = new Dep();
  4527. this.vmCount = 0;
  4528. def(value, '__ob__', this);
  4529. if (Array.isArray(value)) {
  4530. if (hasProto) {
  4531. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4532. if(value.push !== value.__proto__.push){
  4533. copyAugment(value, arrayMethods, arrayKeys);
  4534. } else {
  4535. protoAugment(value, arrayMethods);
  4536. }
  4537. }
  4538. } else {
  4539. copyAugment(value, arrayMethods, arrayKeys);
  4540. }
  4541. this.observeArray(value);
  4542. } else {
  4543. this.walk(value);
  4544. }
  4545. };
  4546. /**
  4547. * Walk through all properties and convert them into
  4548. * getter/setters. This method should only be called when
  4549. * value type is Object.
  4550. */
  4551. Observer.prototype.walk = function walk (obj) {
  4552. var keys = Object.keys(obj);
  4553. for (var i = 0; i < keys.length; i++) {
  4554. defineReactive$$1(obj, keys[i]);
  4555. }
  4556. };
  4557. /**
  4558. * Observe a list of Array items.
  4559. */
  4560. Observer.prototype.observeArray = function observeArray (items) {
  4561. for (var i = 0, l = items.length; i < l; i++) {
  4562. observe(items[i]);
  4563. }
  4564. };
  4565. // helpers
  4566. /**
  4567. * Augment a target Object or Array by intercepting
  4568. * the prototype chain using __proto__
  4569. */
  4570. function protoAugment (target, src) {
  4571. /* eslint-disable no-proto */
  4572. target.__proto__ = src;
  4573. /* eslint-enable no-proto */
  4574. }
  4575. /**
  4576. * Augment a target Object or Array by defining
  4577. * hidden properties.
  4578. */
  4579. /* istanbul ignore next */
  4580. function copyAugment (target, src, keys) {
  4581. for (var i = 0, l = keys.length; i < l; i++) {
  4582. var key = keys[i];
  4583. def(target, key, src[key]);
  4584. }
  4585. }
  4586. /**
  4587. * Attempt to create an observer instance for a value,
  4588. * returns the new observer if successfully observed,
  4589. * or the existing observer if the value already has one.
  4590. */
  4591. function observe (value, asRootData) {
  4592. if (!isObject(value) || value instanceof VNode) {
  4593. return
  4594. }
  4595. var ob;
  4596. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4597. ob = value.__ob__;
  4598. } else if (
  4599. shouldObserve &&
  4600. !isServerRendering() &&
  4601. (Array.isArray(value) || isPlainObject(value)) &&
  4602. Object.isExtensible(value) &&
  4603. !value._isVue &&
  4604. !value.__v_isMPComponent
  4605. ) {
  4606. ob = new Observer(value);
  4607. }
  4608. if (asRootData && ob) {
  4609. ob.vmCount++;
  4610. }
  4611. return ob
  4612. }
  4613. /**
  4614. * Define a reactive property on an Object.
  4615. */
  4616. function defineReactive$$1 (
  4617. obj,
  4618. key,
  4619. val,
  4620. customSetter,
  4621. shallow
  4622. ) {
  4623. var dep = new Dep();
  4624. var property = Object.getOwnPropertyDescriptor(obj, key);
  4625. if (property && property.configurable === false) {
  4626. return
  4627. }
  4628. // cater for pre-defined getter/setters
  4629. var getter = property && property.get;
  4630. var setter = property && property.set;
  4631. if ((!getter || setter) && arguments.length === 2) {
  4632. val = obj[key];
  4633. }
  4634. var childOb = !shallow && observe(val);
  4635. Object.defineProperty(obj, key, {
  4636. enumerable: true,
  4637. configurable: true,
  4638. get: function reactiveGetter () {
  4639. var value = getter ? getter.call(obj) : val;
  4640. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4641. dep.depend();
  4642. if (childOb) {
  4643. childOb.dep.depend();
  4644. if (Array.isArray(value)) {
  4645. dependArray(value);
  4646. }
  4647. }
  4648. }
  4649. return value
  4650. },
  4651. set: function reactiveSetter (newVal) {
  4652. var value = getter ? getter.call(obj) : val;
  4653. /* eslint-disable no-self-compare */
  4654. if (newVal === value || (newVal !== newVal && value !== value)) {
  4655. return
  4656. }
  4657. /* eslint-enable no-self-compare */
  4658. if ( true && customSetter) {
  4659. customSetter();
  4660. }
  4661. // #7981: for accessor properties without setter
  4662. if (getter && !setter) { return }
  4663. if (setter) {
  4664. setter.call(obj, newVal);
  4665. } else {
  4666. val = newVal;
  4667. }
  4668. childOb = !shallow && observe(newVal);
  4669. dep.notify();
  4670. }
  4671. });
  4672. }
  4673. /**
  4674. * Set a property on an object. Adds the new property and
  4675. * triggers change notification if the property doesn't
  4676. * already exist.
  4677. */
  4678. function set (target, key, val) {
  4679. if ( true &&
  4680. (isUndef(target) || isPrimitive(target))
  4681. ) {
  4682. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4683. }
  4684. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4685. target.length = Math.max(target.length, key);
  4686. target.splice(key, 1, val);
  4687. return val
  4688. }
  4689. if (key in target && !(key in Object.prototype)) {
  4690. target[key] = val;
  4691. return val
  4692. }
  4693. var ob = (target).__ob__;
  4694. if (target._isVue || (ob && ob.vmCount)) {
  4695. true && warn(
  4696. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4697. 'at runtime - declare it upfront in the data option.'
  4698. );
  4699. return val
  4700. }
  4701. if (!ob) {
  4702. target[key] = val;
  4703. return val
  4704. }
  4705. defineReactive$$1(ob.value, key, val);
  4706. ob.dep.notify();
  4707. return val
  4708. }
  4709. /**
  4710. * Delete a property and trigger change if necessary.
  4711. */
  4712. function del (target, key) {
  4713. if ( true &&
  4714. (isUndef(target) || isPrimitive(target))
  4715. ) {
  4716. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4717. }
  4718. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4719. target.splice(key, 1);
  4720. return
  4721. }
  4722. var ob = (target).__ob__;
  4723. if (target._isVue || (ob && ob.vmCount)) {
  4724. true && warn(
  4725. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4726. '- just set it to null.'
  4727. );
  4728. return
  4729. }
  4730. if (!hasOwn(target, key)) {
  4731. return
  4732. }
  4733. delete target[key];
  4734. if (!ob) {
  4735. return
  4736. }
  4737. ob.dep.notify();
  4738. }
  4739. /**
  4740. * Collect dependencies on array elements when the array is touched, since
  4741. * we cannot intercept array element access like property getters.
  4742. */
  4743. function dependArray (value) {
  4744. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4745. e = value[i];
  4746. e && e.__ob__ && e.__ob__.dep.depend();
  4747. if (Array.isArray(e)) {
  4748. dependArray(e);
  4749. }
  4750. }
  4751. }
  4752. /* */
  4753. /**
  4754. * Option overwriting strategies are functions that handle
  4755. * how to merge a parent option value and a child option
  4756. * value into the final value.
  4757. */
  4758. var strats = config.optionMergeStrategies;
  4759. /**
  4760. * Options with restrictions
  4761. */
  4762. if (true) {
  4763. strats.el = strats.propsData = function (parent, child, vm, key) {
  4764. if (!vm) {
  4765. warn(
  4766. "option \"" + key + "\" can only be used during instance " +
  4767. 'creation with the `new` keyword.'
  4768. );
  4769. }
  4770. return defaultStrat(parent, child)
  4771. };
  4772. }
  4773. /**
  4774. * Helper that recursively merges two data objects together.
  4775. */
  4776. function mergeData (to, from) {
  4777. if (!from) { return to }
  4778. var key, toVal, fromVal;
  4779. var keys = hasSymbol
  4780. ? Reflect.ownKeys(from)
  4781. : Object.keys(from);
  4782. for (var i = 0; i < keys.length; i++) {
  4783. key = keys[i];
  4784. // in case the object is already observed...
  4785. if (key === '__ob__') { continue }
  4786. toVal = to[key];
  4787. fromVal = from[key];
  4788. if (!hasOwn(to, key)) {
  4789. set(to, key, fromVal);
  4790. } else if (
  4791. toVal !== fromVal &&
  4792. isPlainObject(toVal) &&
  4793. isPlainObject(fromVal)
  4794. ) {
  4795. mergeData(toVal, fromVal);
  4796. }
  4797. }
  4798. return to
  4799. }
  4800. /**
  4801. * Data
  4802. */
  4803. function mergeDataOrFn (
  4804. parentVal,
  4805. childVal,
  4806. vm
  4807. ) {
  4808. if (!vm) {
  4809. // in a Vue.extend merge, both should be functions
  4810. if (!childVal) {
  4811. return parentVal
  4812. }
  4813. if (!parentVal) {
  4814. return childVal
  4815. }
  4816. // when parentVal & childVal are both present,
  4817. // we need to return a function that returns the
  4818. // merged result of both functions... no need to
  4819. // check if parentVal is a function here because
  4820. // it has to be a function to pass previous merges.
  4821. return function mergedDataFn () {
  4822. return mergeData(
  4823. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4824. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4825. )
  4826. }
  4827. } else {
  4828. return function mergedInstanceDataFn () {
  4829. // instance merge
  4830. var instanceData = typeof childVal === 'function'
  4831. ? childVal.call(vm, vm)
  4832. : childVal;
  4833. var defaultData = typeof parentVal === 'function'
  4834. ? parentVal.call(vm, vm)
  4835. : parentVal;
  4836. if (instanceData) {
  4837. return mergeData(instanceData, defaultData)
  4838. } else {
  4839. return defaultData
  4840. }
  4841. }
  4842. }
  4843. }
  4844. strats.data = function (
  4845. parentVal,
  4846. childVal,
  4847. vm
  4848. ) {
  4849. if (!vm) {
  4850. if (childVal && typeof childVal !== 'function') {
  4851. true && warn(
  4852. 'The "data" option should be a function ' +
  4853. 'that returns a per-instance value in component ' +
  4854. 'definitions.',
  4855. vm
  4856. );
  4857. return parentVal
  4858. }
  4859. return mergeDataOrFn(parentVal, childVal)
  4860. }
  4861. return mergeDataOrFn(parentVal, childVal, vm)
  4862. };
  4863. /**
  4864. * Hooks and props are merged as arrays.
  4865. */
  4866. function mergeHook (
  4867. parentVal,
  4868. childVal
  4869. ) {
  4870. var res = childVal
  4871. ? parentVal
  4872. ? parentVal.concat(childVal)
  4873. : Array.isArray(childVal)
  4874. ? childVal
  4875. : [childVal]
  4876. : parentVal;
  4877. return res
  4878. ? dedupeHooks(res)
  4879. : res
  4880. }
  4881. function dedupeHooks (hooks) {
  4882. var res = [];
  4883. for (var i = 0; i < hooks.length; i++) {
  4884. if (res.indexOf(hooks[i]) === -1) {
  4885. res.push(hooks[i]);
  4886. }
  4887. }
  4888. return res
  4889. }
  4890. LIFECYCLE_HOOKS.forEach(function (hook) {
  4891. strats[hook] = mergeHook;
  4892. });
  4893. /**
  4894. * Assets
  4895. *
  4896. * When a vm is present (instance creation), we need to do
  4897. * a three-way merge between constructor options, instance
  4898. * options and parent options.
  4899. */
  4900. function mergeAssets (
  4901. parentVal,
  4902. childVal,
  4903. vm,
  4904. key
  4905. ) {
  4906. var res = Object.create(parentVal || null);
  4907. if (childVal) {
  4908. true && assertObjectType(key, childVal, vm);
  4909. return extend(res, childVal)
  4910. } else {
  4911. return res
  4912. }
  4913. }
  4914. ASSET_TYPES.forEach(function (type) {
  4915. strats[type + 's'] = mergeAssets;
  4916. });
  4917. /**
  4918. * Watchers.
  4919. *
  4920. * Watchers hashes should not overwrite one
  4921. * another, so we merge them as arrays.
  4922. */
  4923. strats.watch = function (
  4924. parentVal,
  4925. childVal,
  4926. vm,
  4927. key
  4928. ) {
  4929. // work around Firefox's Object.prototype.watch...
  4930. if (parentVal === nativeWatch) { parentVal = undefined; }
  4931. if (childVal === nativeWatch) { childVal = undefined; }
  4932. /* istanbul ignore if */
  4933. if (!childVal) { return Object.create(parentVal || null) }
  4934. if (true) {
  4935. assertObjectType(key, childVal, vm);
  4936. }
  4937. if (!parentVal) { return childVal }
  4938. var ret = {};
  4939. extend(ret, parentVal);
  4940. for (var key$1 in childVal) {
  4941. var parent = ret[key$1];
  4942. var child = childVal[key$1];
  4943. if (parent && !Array.isArray(parent)) {
  4944. parent = [parent];
  4945. }
  4946. ret[key$1] = parent
  4947. ? parent.concat(child)
  4948. : Array.isArray(child) ? child : [child];
  4949. }
  4950. return ret
  4951. };
  4952. /**
  4953. * Other object hashes.
  4954. */
  4955. strats.props =
  4956. strats.methods =
  4957. strats.inject =
  4958. strats.computed = function (
  4959. parentVal,
  4960. childVal,
  4961. vm,
  4962. key
  4963. ) {
  4964. if (childVal && "development" !== 'production') {
  4965. assertObjectType(key, childVal, vm);
  4966. }
  4967. if (!parentVal) { return childVal }
  4968. var ret = Object.create(null);
  4969. extend(ret, parentVal);
  4970. if (childVal) { extend(ret, childVal); }
  4971. return ret
  4972. };
  4973. strats.provide = mergeDataOrFn;
  4974. /**
  4975. * Default strategy.
  4976. */
  4977. var defaultStrat = function (parentVal, childVal) {
  4978. return childVal === undefined
  4979. ? parentVal
  4980. : childVal
  4981. };
  4982. /**
  4983. * Validate component names
  4984. */
  4985. function checkComponents (options) {
  4986. for (var key in options.components) {
  4987. validateComponentName(key);
  4988. }
  4989. }
  4990. function validateComponentName (name) {
  4991. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4992. warn(
  4993. 'Invalid component name: "' + name + '". Component names ' +
  4994. 'should conform to valid custom element name in html5 specification.'
  4995. );
  4996. }
  4997. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4998. warn(
  4999. 'Do not use built-in or reserved HTML elements as component ' +
  5000. 'id: ' + name
  5001. );
  5002. }
  5003. }
  5004. /**
  5005. * Ensure all props option syntax are normalized into the
  5006. * Object-based format.
  5007. */
  5008. function normalizeProps (options, vm) {
  5009. var props = options.props;
  5010. if (!props) { return }
  5011. var res = {};
  5012. var i, val, name;
  5013. if (Array.isArray(props)) {
  5014. i = props.length;
  5015. while (i--) {
  5016. val = props[i];
  5017. if (typeof val === 'string') {
  5018. name = camelize(val);
  5019. res[name] = { type: null };
  5020. } else if (true) {
  5021. warn('props must be strings when using array syntax.');
  5022. }
  5023. }
  5024. } else if (isPlainObject(props)) {
  5025. for (var key in props) {
  5026. val = props[key];
  5027. name = camelize(key);
  5028. res[name] = isPlainObject(val)
  5029. ? val
  5030. : { type: val };
  5031. }
  5032. } else if (true) {
  5033. warn(
  5034. "Invalid value for option \"props\": expected an Array or an Object, " +
  5035. "but got " + (toRawType(props)) + ".",
  5036. vm
  5037. );
  5038. }
  5039. options.props = res;
  5040. }
  5041. /**
  5042. * Normalize all injections into Object-based format
  5043. */
  5044. function normalizeInject (options, vm) {
  5045. var inject = options.inject;
  5046. if (!inject) { return }
  5047. var normalized = options.inject = {};
  5048. if (Array.isArray(inject)) {
  5049. for (var i = 0; i < inject.length; i++) {
  5050. normalized[inject[i]] = { from: inject[i] };
  5051. }
  5052. } else if (isPlainObject(inject)) {
  5053. for (var key in inject) {
  5054. var val = inject[key];
  5055. normalized[key] = isPlainObject(val)
  5056. ? extend({ from: key }, val)
  5057. : { from: val };
  5058. }
  5059. } else if (true) {
  5060. warn(
  5061. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5062. "but got " + (toRawType(inject)) + ".",
  5063. vm
  5064. );
  5065. }
  5066. }
  5067. /**
  5068. * Normalize raw function directives into object format.
  5069. */
  5070. function normalizeDirectives (options) {
  5071. var dirs = options.directives;
  5072. if (dirs) {
  5073. for (var key in dirs) {
  5074. var def$$1 = dirs[key];
  5075. if (typeof def$$1 === 'function') {
  5076. dirs[key] = { bind: def$$1, update: def$$1 };
  5077. }
  5078. }
  5079. }
  5080. }
  5081. function assertObjectType (name, value, vm) {
  5082. if (!isPlainObject(value)) {
  5083. warn(
  5084. "Invalid value for option \"" + name + "\": expected an Object, " +
  5085. "but got " + (toRawType(value)) + ".",
  5086. vm
  5087. );
  5088. }
  5089. }
  5090. /**
  5091. * Merge two option objects into a new one.
  5092. * Core utility used in both instantiation and inheritance.
  5093. */
  5094. function mergeOptions (
  5095. parent,
  5096. child,
  5097. vm
  5098. ) {
  5099. if (true) {
  5100. checkComponents(child);
  5101. }
  5102. if (typeof child === 'function') {
  5103. child = child.options;
  5104. }
  5105. normalizeProps(child, vm);
  5106. normalizeInject(child, vm);
  5107. normalizeDirectives(child);
  5108. // Apply extends and mixins on the child options,
  5109. // but only if it is a raw options object that isn't
  5110. // the result of another mergeOptions call.
  5111. // Only merged options has the _base property.
  5112. if (!child._base) {
  5113. if (child.extends) {
  5114. parent = mergeOptions(parent, child.extends, vm);
  5115. }
  5116. if (child.mixins) {
  5117. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5118. parent = mergeOptions(parent, child.mixins[i], vm);
  5119. }
  5120. }
  5121. }
  5122. var options = {};
  5123. var key;
  5124. for (key in parent) {
  5125. mergeField(key);
  5126. }
  5127. for (key in child) {
  5128. if (!hasOwn(parent, key)) {
  5129. mergeField(key);
  5130. }
  5131. }
  5132. function mergeField (key) {
  5133. var strat = strats[key] || defaultStrat;
  5134. options[key] = strat(parent[key], child[key], vm, key);
  5135. }
  5136. return options
  5137. }
  5138. /**
  5139. * Resolve an asset.
  5140. * This function is used because child instances need access
  5141. * to assets defined in its ancestor chain.
  5142. */
  5143. function resolveAsset (
  5144. options,
  5145. type,
  5146. id,
  5147. warnMissing
  5148. ) {
  5149. /* istanbul ignore if */
  5150. if (typeof id !== 'string') {
  5151. return
  5152. }
  5153. var assets = options[type];
  5154. // check local registration variations first
  5155. if (hasOwn(assets, id)) { return assets[id] }
  5156. var camelizedId = camelize(id);
  5157. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5158. var PascalCaseId = capitalize(camelizedId);
  5159. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5160. // fallback to prototype chain
  5161. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5162. if ( true && warnMissing && !res) {
  5163. warn(
  5164. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5165. options
  5166. );
  5167. }
  5168. return res
  5169. }
  5170. /* */
  5171. function validateProp (
  5172. key,
  5173. propOptions,
  5174. propsData,
  5175. vm
  5176. ) {
  5177. var prop = propOptions[key];
  5178. var absent = !hasOwn(propsData, key);
  5179. var value = propsData[key];
  5180. // boolean casting
  5181. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5182. if (booleanIndex > -1) {
  5183. if (absent && !hasOwn(prop, 'default')) {
  5184. value = false;
  5185. } else if (value === '' || value === hyphenate(key)) {
  5186. // only cast empty string / same name to boolean if
  5187. // boolean has higher priority
  5188. var stringIndex = getTypeIndex(String, prop.type);
  5189. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5190. value = true;
  5191. }
  5192. }
  5193. }
  5194. // check default value
  5195. if (value === undefined) {
  5196. value = getPropDefaultValue(vm, prop, key);
  5197. // since the default value is a fresh copy,
  5198. // make sure to observe it.
  5199. var prevShouldObserve = shouldObserve;
  5200. toggleObserving(true);
  5201. observe(value);
  5202. toggleObserving(prevShouldObserve);
  5203. }
  5204. if (
  5205. true
  5206. ) {
  5207. assertProp(prop, key, value, vm, absent);
  5208. }
  5209. return value
  5210. }
  5211. /**
  5212. * Get the default value of a prop.
  5213. */
  5214. function getPropDefaultValue (vm, prop, key) {
  5215. // no default, return undefined
  5216. if (!hasOwn(prop, 'default')) {
  5217. return undefined
  5218. }
  5219. var def = prop.default;
  5220. // warn against non-factory defaults for Object & Array
  5221. if ( true && isObject(def)) {
  5222. warn(
  5223. 'Invalid default value for prop "' + key + '": ' +
  5224. 'Props with type Object/Array must use a factory function ' +
  5225. 'to return the default value.',
  5226. vm
  5227. );
  5228. }
  5229. // the raw prop value was also undefined from previous render,
  5230. // return previous default value to avoid unnecessary watcher trigger
  5231. if (vm && vm.$options.propsData &&
  5232. vm.$options.propsData[key] === undefined &&
  5233. vm._props[key] !== undefined
  5234. ) {
  5235. return vm._props[key]
  5236. }
  5237. // call factory function for non-Function types
  5238. // a value is Function if its prototype is function even across different execution context
  5239. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5240. ? def.call(vm)
  5241. : def
  5242. }
  5243. /**
  5244. * Assert whether a prop is valid.
  5245. */
  5246. function assertProp (
  5247. prop,
  5248. name,
  5249. value,
  5250. vm,
  5251. absent
  5252. ) {
  5253. if (prop.required && absent) {
  5254. warn(
  5255. 'Missing required prop: "' + name + '"',
  5256. vm
  5257. );
  5258. return
  5259. }
  5260. if (value == null && !prop.required) {
  5261. return
  5262. }
  5263. var type = prop.type;
  5264. var valid = !type || type === true;
  5265. var expectedTypes = [];
  5266. if (type) {
  5267. if (!Array.isArray(type)) {
  5268. type = [type];
  5269. }
  5270. for (var i = 0; i < type.length && !valid; i++) {
  5271. var assertedType = assertType(value, type[i]);
  5272. expectedTypes.push(assertedType.expectedType || '');
  5273. valid = assertedType.valid;
  5274. }
  5275. }
  5276. if (!valid) {
  5277. warn(
  5278. getInvalidTypeMessage(name, value, expectedTypes),
  5279. vm
  5280. );
  5281. return
  5282. }
  5283. var validator = prop.validator;
  5284. if (validator) {
  5285. if (!validator(value)) {
  5286. warn(
  5287. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5288. vm
  5289. );
  5290. }
  5291. }
  5292. }
  5293. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5294. function assertType (value, type) {
  5295. var valid;
  5296. var expectedType = getType(type);
  5297. if (simpleCheckRE.test(expectedType)) {
  5298. var t = typeof value;
  5299. valid = t === expectedType.toLowerCase();
  5300. // for primitive wrapper objects
  5301. if (!valid && t === 'object') {
  5302. valid = value instanceof type;
  5303. }
  5304. } else if (expectedType === 'Object') {
  5305. valid = isPlainObject(value);
  5306. } else if (expectedType === 'Array') {
  5307. valid = Array.isArray(value);
  5308. } else {
  5309. valid = value instanceof type;
  5310. }
  5311. return {
  5312. valid: valid,
  5313. expectedType: expectedType
  5314. }
  5315. }
  5316. /**
  5317. * Use function string name to check built-in types,
  5318. * because a simple equality check will fail when running
  5319. * across different vms / iframes.
  5320. */
  5321. function getType (fn) {
  5322. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5323. return match ? match[1] : ''
  5324. }
  5325. function isSameType (a, b) {
  5326. return getType(a) === getType(b)
  5327. }
  5328. function getTypeIndex (type, expectedTypes) {
  5329. if (!Array.isArray(expectedTypes)) {
  5330. return isSameType(expectedTypes, type) ? 0 : -1
  5331. }
  5332. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5333. if (isSameType(expectedTypes[i], type)) {
  5334. return i
  5335. }
  5336. }
  5337. return -1
  5338. }
  5339. function getInvalidTypeMessage (name, value, expectedTypes) {
  5340. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5341. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5342. var expectedType = expectedTypes[0];
  5343. var receivedType = toRawType(value);
  5344. var expectedValue = styleValue(value, expectedType);
  5345. var receivedValue = styleValue(value, receivedType);
  5346. // check if we need to specify expected value
  5347. if (expectedTypes.length === 1 &&
  5348. isExplicable(expectedType) &&
  5349. !isBoolean(expectedType, receivedType)) {
  5350. message += " with value " + expectedValue;
  5351. }
  5352. message += ", got " + receivedType + " ";
  5353. // check if we need to specify received value
  5354. if (isExplicable(receivedType)) {
  5355. message += "with value " + receivedValue + ".";
  5356. }
  5357. return message
  5358. }
  5359. function styleValue (value, type) {
  5360. if (type === 'String') {
  5361. return ("\"" + value + "\"")
  5362. } else if (type === 'Number') {
  5363. return ("" + (Number(value)))
  5364. } else {
  5365. return ("" + value)
  5366. }
  5367. }
  5368. function isExplicable (value) {
  5369. var explicitTypes = ['string', 'number', 'boolean'];
  5370. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5371. }
  5372. function isBoolean () {
  5373. var args = [], len = arguments.length;
  5374. while ( len-- ) args[ len ] = arguments[ len ];
  5375. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5376. }
  5377. /* */
  5378. function handleError (err, vm, info) {
  5379. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5380. // See: https://github.com/vuejs/vuex/issues/1505
  5381. pushTarget();
  5382. try {
  5383. if (vm) {
  5384. var cur = vm;
  5385. while ((cur = cur.$parent)) {
  5386. var hooks = cur.$options.errorCaptured;
  5387. if (hooks) {
  5388. for (var i = 0; i < hooks.length; i++) {
  5389. try {
  5390. var capture = hooks[i].call(cur, err, vm, info) === false;
  5391. if (capture) { return }
  5392. } catch (e) {
  5393. globalHandleError(e, cur, 'errorCaptured hook');
  5394. }
  5395. }
  5396. }
  5397. }
  5398. }
  5399. globalHandleError(err, vm, info);
  5400. } finally {
  5401. popTarget();
  5402. }
  5403. }
  5404. function invokeWithErrorHandling (
  5405. handler,
  5406. context,
  5407. args,
  5408. vm,
  5409. info
  5410. ) {
  5411. var res;
  5412. try {
  5413. res = args ? handler.apply(context, args) : handler.call(context);
  5414. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5415. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5416. // issue #9511
  5417. // avoid catch triggering multiple times when nested calls
  5418. res._handled = true;
  5419. }
  5420. } catch (e) {
  5421. handleError(e, vm, info);
  5422. }
  5423. return res
  5424. }
  5425. function globalHandleError (err, vm, info) {
  5426. if (config.errorHandler) {
  5427. try {
  5428. return config.errorHandler.call(null, err, vm, info)
  5429. } catch (e) {
  5430. // if the user intentionally throws the original error in the handler,
  5431. // do not log it twice
  5432. if (e !== err) {
  5433. logError(e, null, 'config.errorHandler');
  5434. }
  5435. }
  5436. }
  5437. logError(err, vm, info);
  5438. }
  5439. function logError (err, vm, info) {
  5440. if (true) {
  5441. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5442. }
  5443. /* istanbul ignore else */
  5444. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5445. console.error(err);
  5446. } else {
  5447. throw err
  5448. }
  5449. }
  5450. /* */
  5451. var callbacks = [];
  5452. var pending = false;
  5453. function flushCallbacks () {
  5454. pending = false;
  5455. var copies = callbacks.slice(0);
  5456. callbacks.length = 0;
  5457. for (var i = 0; i < copies.length; i++) {
  5458. copies[i]();
  5459. }
  5460. }
  5461. // Here we have async deferring wrappers using microtasks.
  5462. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5463. // However, it has subtle problems when state is changed right before repaint
  5464. // (e.g. #6813, out-in transitions).
  5465. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5466. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5467. // So we now use microtasks everywhere, again.
  5468. // A major drawback of this tradeoff is that there are some scenarios
  5469. // where microtasks have too high a priority and fire in between supposedly
  5470. // sequential events (e.g. #4521, #6690, which have workarounds)
  5471. // or even between bubbling of the same event (#6566).
  5472. var timerFunc;
  5473. // The nextTick behavior leverages the microtask queue, which can be accessed
  5474. // via either native Promise.then or MutationObserver.
  5475. // MutationObserver has wider support, however it is seriously bugged in
  5476. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5477. // completely stops working after triggering a few times... so, if native
  5478. // Promise is available, we will use it:
  5479. /* istanbul ignore next, $flow-disable-line */
  5480. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5481. var p = Promise.resolve();
  5482. timerFunc = function () {
  5483. p.then(flushCallbacks);
  5484. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5485. // it can get stuck in a weird state where callbacks are pushed into the
  5486. // microtask queue but the queue isn't being flushed, until the browser
  5487. // needs to do some other work, e.g. handle a timer. Therefore we can
  5488. // "force" the microtask queue to be flushed by adding an empty timer.
  5489. if (isIOS) { setTimeout(noop); }
  5490. };
  5491. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5492. isNative(MutationObserver) ||
  5493. // PhantomJS and iOS 7.x
  5494. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5495. )) {
  5496. // Use MutationObserver where native Promise is not available,
  5497. // e.g. PhantomJS, iOS7, Android 4.4
  5498. // (#6466 MutationObserver is unreliable in IE11)
  5499. var counter = 1;
  5500. var observer = new MutationObserver(flushCallbacks);
  5501. var textNode = document.createTextNode(String(counter));
  5502. observer.observe(textNode, {
  5503. characterData: true
  5504. });
  5505. timerFunc = function () {
  5506. counter = (counter + 1) % 2;
  5507. textNode.data = String(counter);
  5508. };
  5509. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5510. // Fallback to setImmediate.
  5511. // Technically it leverages the (macro) task queue,
  5512. // but it is still a better choice than setTimeout.
  5513. timerFunc = function () {
  5514. setImmediate(flushCallbacks);
  5515. };
  5516. } else {
  5517. // Fallback to setTimeout.
  5518. timerFunc = function () {
  5519. setTimeout(flushCallbacks, 0);
  5520. };
  5521. }
  5522. function nextTick (cb, ctx) {
  5523. var _resolve;
  5524. callbacks.push(function () {
  5525. if (cb) {
  5526. try {
  5527. cb.call(ctx);
  5528. } catch (e) {
  5529. handleError(e, ctx, 'nextTick');
  5530. }
  5531. } else if (_resolve) {
  5532. _resolve(ctx);
  5533. }
  5534. });
  5535. if (!pending) {
  5536. pending = true;
  5537. timerFunc();
  5538. }
  5539. // $flow-disable-line
  5540. if (!cb && typeof Promise !== 'undefined') {
  5541. return new Promise(function (resolve) {
  5542. _resolve = resolve;
  5543. })
  5544. }
  5545. }
  5546. /* */
  5547. /* not type checking this file because flow doesn't play well with Proxy */
  5548. var initProxy;
  5549. if (true) {
  5550. var allowedGlobals = makeMap(
  5551. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5552. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5553. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5554. 'require' // for Webpack/Browserify
  5555. );
  5556. var warnNonPresent = function (target, key) {
  5557. warn(
  5558. "Property or method \"" + key + "\" is not defined on the instance but " +
  5559. 'referenced during render. Make sure that this property is reactive, ' +
  5560. 'either in the data option, or for class-based components, by ' +
  5561. 'initializing the property. ' +
  5562. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5563. target
  5564. );
  5565. };
  5566. var warnReservedPrefix = function (target, key) {
  5567. warn(
  5568. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5569. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5570. 'prevent conflicts with Vue internals. ' +
  5571. 'See: https://vuejs.org/v2/api/#data',
  5572. target
  5573. );
  5574. };
  5575. var hasProxy =
  5576. typeof Proxy !== 'undefined' && isNative(Proxy);
  5577. if (hasProxy) {
  5578. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5579. config.keyCodes = new Proxy(config.keyCodes, {
  5580. set: function set (target, key, value) {
  5581. if (isBuiltInModifier(key)) {
  5582. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5583. return false
  5584. } else {
  5585. target[key] = value;
  5586. return true
  5587. }
  5588. }
  5589. });
  5590. }
  5591. var hasHandler = {
  5592. has: function has (target, key) {
  5593. var has = key in target;
  5594. var isAllowed = allowedGlobals(key) ||
  5595. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5596. if (!has && !isAllowed) {
  5597. if (key in target.$data) { warnReservedPrefix(target, key); }
  5598. else { warnNonPresent(target, key); }
  5599. }
  5600. return has || !isAllowed
  5601. }
  5602. };
  5603. var getHandler = {
  5604. get: function get (target, key) {
  5605. if (typeof key === 'string' && !(key in target)) {
  5606. if (key in target.$data) { warnReservedPrefix(target, key); }
  5607. else { warnNonPresent(target, key); }
  5608. }
  5609. return target[key]
  5610. }
  5611. };
  5612. initProxy = function initProxy (vm) {
  5613. if (hasProxy) {
  5614. // determine which proxy handler to use
  5615. var options = vm.$options;
  5616. var handlers = options.render && options.render._withStripped
  5617. ? getHandler
  5618. : hasHandler;
  5619. vm._renderProxy = new Proxy(vm, handlers);
  5620. } else {
  5621. vm._renderProxy = vm;
  5622. }
  5623. };
  5624. }
  5625. /* */
  5626. var seenObjects = new _Set();
  5627. /**
  5628. * Recursively traverse an object to evoke all converted
  5629. * getters, so that every nested property inside the object
  5630. * is collected as a "deep" dependency.
  5631. */
  5632. function traverse (val) {
  5633. _traverse(val, seenObjects);
  5634. seenObjects.clear();
  5635. }
  5636. function _traverse (val, seen) {
  5637. var i, keys;
  5638. var isA = Array.isArray(val);
  5639. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5640. return
  5641. }
  5642. if (val.__ob__) {
  5643. var depId = val.__ob__.dep.id;
  5644. if (seen.has(depId)) {
  5645. return
  5646. }
  5647. seen.add(depId);
  5648. }
  5649. if (isA) {
  5650. i = val.length;
  5651. while (i--) { _traverse(val[i], seen); }
  5652. } else {
  5653. keys = Object.keys(val);
  5654. i = keys.length;
  5655. while (i--) { _traverse(val[keys[i]], seen); }
  5656. }
  5657. }
  5658. var mark;
  5659. var measure;
  5660. if (true) {
  5661. var perf = inBrowser && window.performance;
  5662. /* istanbul ignore if */
  5663. if (
  5664. perf &&
  5665. perf.mark &&
  5666. perf.measure &&
  5667. perf.clearMarks &&
  5668. perf.clearMeasures
  5669. ) {
  5670. mark = function (tag) { return perf.mark(tag); };
  5671. measure = function (name, startTag, endTag) {
  5672. perf.measure(name, startTag, endTag);
  5673. perf.clearMarks(startTag);
  5674. perf.clearMarks(endTag);
  5675. // perf.clearMeasures(name)
  5676. };
  5677. }
  5678. }
  5679. /* */
  5680. var normalizeEvent = cached(function (name) {
  5681. var passive = name.charAt(0) === '&';
  5682. name = passive ? name.slice(1) : name;
  5683. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5684. name = once$$1 ? name.slice(1) : name;
  5685. var capture = name.charAt(0) === '!';
  5686. name = capture ? name.slice(1) : name;
  5687. return {
  5688. name: name,
  5689. once: once$$1,
  5690. capture: capture,
  5691. passive: passive
  5692. }
  5693. });
  5694. function createFnInvoker (fns, vm) {
  5695. function invoker () {
  5696. var arguments$1 = arguments;
  5697. var fns = invoker.fns;
  5698. if (Array.isArray(fns)) {
  5699. var cloned = fns.slice();
  5700. for (var i = 0; i < cloned.length; i++) {
  5701. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5702. }
  5703. } else {
  5704. // return handler return value for single handlers
  5705. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5706. }
  5707. }
  5708. invoker.fns = fns;
  5709. return invoker
  5710. }
  5711. function updateListeners (
  5712. on,
  5713. oldOn,
  5714. add,
  5715. remove$$1,
  5716. createOnceHandler,
  5717. vm
  5718. ) {
  5719. var name, def$$1, cur, old, event;
  5720. for (name in on) {
  5721. def$$1 = cur = on[name];
  5722. old = oldOn[name];
  5723. event = normalizeEvent(name);
  5724. if (isUndef(cur)) {
  5725. true && warn(
  5726. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5727. vm
  5728. );
  5729. } else if (isUndef(old)) {
  5730. if (isUndef(cur.fns)) {
  5731. cur = on[name] = createFnInvoker(cur, vm);
  5732. }
  5733. if (isTrue(event.once)) {
  5734. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5735. }
  5736. add(event.name, cur, event.capture, event.passive, event.params);
  5737. } else if (cur !== old) {
  5738. old.fns = cur;
  5739. on[name] = old;
  5740. }
  5741. }
  5742. for (name in oldOn) {
  5743. if (isUndef(on[name])) {
  5744. event = normalizeEvent(name);
  5745. remove$$1(event.name, oldOn[name], event.capture);
  5746. }
  5747. }
  5748. }
  5749. /* */
  5750. /* */
  5751. // fixed by xxxxxx (mp properties)
  5752. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5753. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5754. if (isUndef(propOptions)) {
  5755. return res
  5756. }
  5757. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5758. var attrs = data.attrs;
  5759. var props = data.props;
  5760. if (isDef(attrs) || isDef(props)) {
  5761. for (var key in propOptions) {
  5762. var altKey = hyphenate(key);
  5763. var result = checkProp(res, props, key, altKey, true) ||
  5764. checkProp(res, attrs, key, altKey, false);
  5765. // externalClass
  5766. if (
  5767. result &&
  5768. res[key] &&
  5769. externalClasses.indexOf(altKey) !== -1 &&
  5770. context[camelize(res[key])]
  5771. ) {
  5772. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5773. res[key] = context[camelize(res[key])];
  5774. }
  5775. }
  5776. }
  5777. return res
  5778. }
  5779. function extractPropsFromVNodeData (
  5780. data,
  5781. Ctor,
  5782. tag,
  5783. context// fixed by xxxxxx
  5784. ) {
  5785. // we are only extracting raw values here.
  5786. // validation and default values are handled in the child
  5787. // component itself.
  5788. var propOptions = Ctor.options.props;
  5789. if (isUndef(propOptions)) {
  5790. // fixed by xxxxxx
  5791. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5792. }
  5793. var res = {};
  5794. var attrs = data.attrs;
  5795. var props = data.props;
  5796. if (isDef(attrs) || isDef(props)) {
  5797. for (var key in propOptions) {
  5798. var altKey = hyphenate(key);
  5799. if (true) {
  5800. var keyInLowerCase = key.toLowerCase();
  5801. if (
  5802. key !== keyInLowerCase &&
  5803. attrs && hasOwn(attrs, keyInLowerCase)
  5804. ) {
  5805. tip(
  5806. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5807. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5808. " \"" + key + "\". " +
  5809. "Note that HTML attributes are case-insensitive and camelCased " +
  5810. "props need to use their kebab-case equivalents when using in-DOM " +
  5811. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5812. );
  5813. }
  5814. }
  5815. checkProp(res, props, key, altKey, true) ||
  5816. checkProp(res, attrs, key, altKey, false);
  5817. }
  5818. }
  5819. // fixed by xxxxxx
  5820. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5821. }
  5822. function checkProp (
  5823. res,
  5824. hash,
  5825. key,
  5826. altKey,
  5827. preserve
  5828. ) {
  5829. if (isDef(hash)) {
  5830. if (hasOwn(hash, key)) {
  5831. res[key] = hash[key];
  5832. if (!preserve) {
  5833. delete hash[key];
  5834. }
  5835. return true
  5836. } else if (hasOwn(hash, altKey)) {
  5837. res[key] = hash[altKey];
  5838. if (!preserve) {
  5839. delete hash[altKey];
  5840. }
  5841. return true
  5842. }
  5843. }
  5844. return false
  5845. }
  5846. /* */
  5847. // The template compiler attempts to minimize the need for normalization by
  5848. // statically analyzing the template at compile time.
  5849. //
  5850. // For plain HTML markup, normalization can be completely skipped because the
  5851. // generated render function is guaranteed to return Array<VNode>. There are
  5852. // two cases where extra normalization is needed:
  5853. // 1. When the children contains components - because a functional component
  5854. // may return an Array instead of a single root. In this case, just a simple
  5855. // normalization is needed - if any child is an Array, we flatten the whole
  5856. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5857. // because functional components already normalize their own children.
  5858. function simpleNormalizeChildren (children) {
  5859. for (var i = 0; i < children.length; i++) {
  5860. if (Array.isArray(children[i])) {
  5861. return Array.prototype.concat.apply([], children)
  5862. }
  5863. }
  5864. return children
  5865. }
  5866. // 2. When the children contains constructs that always generated nested Arrays,
  5867. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5868. // with hand-written render functions / JSX. In such cases a full normalization
  5869. // is needed to cater to all possible types of children values.
  5870. function normalizeChildren (children) {
  5871. return isPrimitive(children)
  5872. ? [createTextVNode(children)]
  5873. : Array.isArray(children)
  5874. ? normalizeArrayChildren(children)
  5875. : undefined
  5876. }
  5877. function isTextNode (node) {
  5878. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5879. }
  5880. function normalizeArrayChildren (children, nestedIndex) {
  5881. var res = [];
  5882. var i, c, lastIndex, last;
  5883. for (i = 0; i < children.length; i++) {
  5884. c = children[i];
  5885. if (isUndef(c) || typeof c === 'boolean') { continue }
  5886. lastIndex = res.length - 1;
  5887. last = res[lastIndex];
  5888. // nested
  5889. if (Array.isArray(c)) {
  5890. if (c.length > 0) {
  5891. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5892. // merge adjacent text nodes
  5893. if (isTextNode(c[0]) && isTextNode(last)) {
  5894. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5895. c.shift();
  5896. }
  5897. res.push.apply(res, c);
  5898. }
  5899. } else if (isPrimitive(c)) {
  5900. if (isTextNode(last)) {
  5901. // merge adjacent text nodes
  5902. // this is necessary for SSR hydration because text nodes are
  5903. // essentially merged when rendered to HTML strings
  5904. res[lastIndex] = createTextVNode(last.text + c);
  5905. } else if (c !== '') {
  5906. // convert primitive to vnode
  5907. res.push(createTextVNode(c));
  5908. }
  5909. } else {
  5910. if (isTextNode(c) && isTextNode(last)) {
  5911. // merge adjacent text nodes
  5912. res[lastIndex] = createTextVNode(last.text + c.text);
  5913. } else {
  5914. // default key for nested array children (likely generated by v-for)
  5915. if (isTrue(children._isVList) &&
  5916. isDef(c.tag) &&
  5917. isUndef(c.key) &&
  5918. isDef(nestedIndex)) {
  5919. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5920. }
  5921. res.push(c);
  5922. }
  5923. }
  5924. }
  5925. return res
  5926. }
  5927. /* */
  5928. function initProvide (vm) {
  5929. var provide = vm.$options.provide;
  5930. if (provide) {
  5931. vm._provided = typeof provide === 'function'
  5932. ? provide.call(vm)
  5933. : provide;
  5934. }
  5935. }
  5936. function initInjections (vm) {
  5937. var result = resolveInject(vm.$options.inject, vm);
  5938. if (result) {
  5939. toggleObserving(false);
  5940. Object.keys(result).forEach(function (key) {
  5941. /* istanbul ignore else */
  5942. if (true) {
  5943. defineReactive$$1(vm, key, result[key], function () {
  5944. warn(
  5945. "Avoid mutating an injected value directly since the changes will be " +
  5946. "overwritten whenever the provided component re-renders. " +
  5947. "injection being mutated: \"" + key + "\"",
  5948. vm
  5949. );
  5950. });
  5951. } else {}
  5952. });
  5953. toggleObserving(true);
  5954. }
  5955. }
  5956. function resolveInject (inject, vm) {
  5957. if (inject) {
  5958. // inject is :any because flow is not smart enough to figure out cached
  5959. var result = Object.create(null);
  5960. var keys = hasSymbol
  5961. ? Reflect.ownKeys(inject)
  5962. : Object.keys(inject);
  5963. for (var i = 0; i < keys.length; i++) {
  5964. var key = keys[i];
  5965. // #6574 in case the inject object is observed...
  5966. if (key === '__ob__') { continue }
  5967. var provideKey = inject[key].from;
  5968. var source = vm;
  5969. while (source) {
  5970. if (source._provided && hasOwn(source._provided, provideKey)) {
  5971. result[key] = source._provided[provideKey];
  5972. break
  5973. }
  5974. source = source.$parent;
  5975. }
  5976. if (!source) {
  5977. if ('default' in inject[key]) {
  5978. var provideDefault = inject[key].default;
  5979. result[key] = typeof provideDefault === 'function'
  5980. ? provideDefault.call(vm)
  5981. : provideDefault;
  5982. } else if (true) {
  5983. warn(("Injection \"" + key + "\" not found"), vm);
  5984. }
  5985. }
  5986. }
  5987. return result
  5988. }
  5989. }
  5990. /* */
  5991. /**
  5992. * Runtime helper for resolving raw children VNodes into a slot object.
  5993. */
  5994. function resolveSlots (
  5995. children,
  5996. context
  5997. ) {
  5998. if (!children || !children.length) {
  5999. return {}
  6000. }
  6001. var slots = {};
  6002. for (var i = 0, l = children.length; i < l; i++) {
  6003. var child = children[i];
  6004. var data = child.data;
  6005. // remove slot attribute if the node is resolved as a Vue slot node
  6006. if (data && data.attrs && data.attrs.slot) {
  6007. delete data.attrs.slot;
  6008. }
  6009. // named slots should only be respected if the vnode was rendered in the
  6010. // same context.
  6011. if ((child.context === context || child.fnContext === context) &&
  6012. data && data.slot != null
  6013. ) {
  6014. var name = data.slot;
  6015. var slot = (slots[name] || (slots[name] = []));
  6016. if (child.tag === 'template') {
  6017. slot.push.apply(slot, child.children || []);
  6018. } else {
  6019. slot.push(child);
  6020. }
  6021. } else {
  6022. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6023. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6024. (slots['page'] || (slots['page'] = [])).push(child);
  6025. }else{
  6026. (slots.default || (slots.default = [])).push(child);
  6027. }
  6028. }
  6029. }
  6030. // ignore slots that contains only whitespace
  6031. for (var name$1 in slots) {
  6032. if (slots[name$1].every(isWhitespace)) {
  6033. delete slots[name$1];
  6034. }
  6035. }
  6036. return slots
  6037. }
  6038. function isWhitespace (node) {
  6039. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6040. }
  6041. /* */
  6042. function normalizeScopedSlots (
  6043. slots,
  6044. normalSlots,
  6045. prevSlots
  6046. ) {
  6047. var res;
  6048. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6049. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6050. var key = slots && slots.$key;
  6051. if (!slots) {
  6052. res = {};
  6053. } else if (slots._normalized) {
  6054. // fast path 1: child component re-render only, parent did not change
  6055. return slots._normalized
  6056. } else if (
  6057. isStable &&
  6058. prevSlots &&
  6059. prevSlots !== emptyObject &&
  6060. key === prevSlots.$key &&
  6061. !hasNormalSlots &&
  6062. !prevSlots.$hasNormal
  6063. ) {
  6064. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6065. // only need to normalize once
  6066. return prevSlots
  6067. } else {
  6068. res = {};
  6069. for (var key$1 in slots) {
  6070. if (slots[key$1] && key$1[0] !== '$') {
  6071. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6072. }
  6073. }
  6074. }
  6075. // expose normal slots on scopedSlots
  6076. for (var key$2 in normalSlots) {
  6077. if (!(key$2 in res)) {
  6078. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6079. }
  6080. }
  6081. // avoriaz seems to mock a non-extensible $scopedSlots object
  6082. // and when that is passed down this would cause an error
  6083. if (slots && Object.isExtensible(slots)) {
  6084. (slots)._normalized = res;
  6085. }
  6086. def(res, '$stable', isStable);
  6087. def(res, '$key', key);
  6088. def(res, '$hasNormal', hasNormalSlots);
  6089. return res
  6090. }
  6091. function normalizeScopedSlot(normalSlots, key, fn) {
  6092. var normalized = function () {
  6093. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6094. res = res && typeof res === 'object' && !Array.isArray(res)
  6095. ? [res] // single vnode
  6096. : normalizeChildren(res);
  6097. return res && (
  6098. res.length === 0 ||
  6099. (res.length === 1 && res[0].isComment) // #9658
  6100. ) ? undefined
  6101. : res
  6102. };
  6103. // this is a slot using the new v-slot syntax without scope. although it is
  6104. // compiled as a scoped slot, render fn users would expect it to be present
  6105. // on this.$slots because the usage is semantically a normal slot.
  6106. if (fn.proxy) {
  6107. Object.defineProperty(normalSlots, key, {
  6108. get: normalized,
  6109. enumerable: true,
  6110. configurable: true
  6111. });
  6112. }
  6113. return normalized
  6114. }
  6115. function proxyNormalSlot(slots, key) {
  6116. return function () { return slots[key]; }
  6117. }
  6118. /* */
  6119. /**
  6120. * Runtime helper for rendering v-for lists.
  6121. */
  6122. function renderList (
  6123. val,
  6124. render
  6125. ) {
  6126. var ret, i, l, keys, key;
  6127. if (Array.isArray(val) || typeof val === 'string') {
  6128. ret = new Array(val.length);
  6129. for (i = 0, l = val.length; i < l; i++) {
  6130. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6131. }
  6132. } else if (typeof val === 'number') {
  6133. ret = new Array(val);
  6134. for (i = 0; i < val; i++) {
  6135. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6136. }
  6137. } else if (isObject(val)) {
  6138. if (hasSymbol && val[Symbol.iterator]) {
  6139. ret = [];
  6140. var iterator = val[Symbol.iterator]();
  6141. var result = iterator.next();
  6142. while (!result.done) {
  6143. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6144. result = iterator.next();
  6145. }
  6146. } else {
  6147. keys = Object.keys(val);
  6148. ret = new Array(keys.length);
  6149. for (i = 0, l = keys.length; i < l; i++) {
  6150. key = keys[i];
  6151. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6152. }
  6153. }
  6154. }
  6155. if (!isDef(ret)) {
  6156. ret = [];
  6157. }
  6158. (ret)._isVList = true;
  6159. return ret
  6160. }
  6161. /* */
  6162. /**
  6163. * Runtime helper for rendering <slot>
  6164. */
  6165. function renderSlot (
  6166. name,
  6167. fallback,
  6168. props,
  6169. bindObject
  6170. ) {
  6171. var scopedSlotFn = this.$scopedSlots[name];
  6172. var nodes;
  6173. if (scopedSlotFn) { // scoped slot
  6174. props = props || {};
  6175. if (bindObject) {
  6176. if ( true && !isObject(bindObject)) {
  6177. warn(
  6178. 'slot v-bind without argument expects an Object',
  6179. this
  6180. );
  6181. }
  6182. props = extend(extend({}, bindObject), props);
  6183. }
  6184. // fixed by xxxxxx app-plus scopedSlot
  6185. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6186. } else {
  6187. nodes = this.$slots[name] || fallback;
  6188. }
  6189. var target = props && props.slot;
  6190. if (target) {
  6191. return this.$createElement('template', { slot: target }, nodes)
  6192. } else {
  6193. return nodes
  6194. }
  6195. }
  6196. /* */
  6197. /**
  6198. * Runtime helper for resolving filters
  6199. */
  6200. function resolveFilter (id) {
  6201. return resolveAsset(this.$options, 'filters', id, true) || identity
  6202. }
  6203. /* */
  6204. function isKeyNotMatch (expect, actual) {
  6205. if (Array.isArray(expect)) {
  6206. return expect.indexOf(actual) === -1
  6207. } else {
  6208. return expect !== actual
  6209. }
  6210. }
  6211. /**
  6212. * Runtime helper for checking keyCodes from config.
  6213. * exposed as Vue.prototype._k
  6214. * passing in eventKeyName as last argument separately for backwards compat
  6215. */
  6216. function checkKeyCodes (
  6217. eventKeyCode,
  6218. key,
  6219. builtInKeyCode,
  6220. eventKeyName,
  6221. builtInKeyName
  6222. ) {
  6223. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6224. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6225. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6226. } else if (mappedKeyCode) {
  6227. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6228. } else if (eventKeyName) {
  6229. return hyphenate(eventKeyName) !== key
  6230. }
  6231. }
  6232. /* */
  6233. /**
  6234. * Runtime helper for merging v-bind="object" into a VNode's data.
  6235. */
  6236. function bindObjectProps (
  6237. data,
  6238. tag,
  6239. value,
  6240. asProp,
  6241. isSync
  6242. ) {
  6243. if (value) {
  6244. if (!isObject(value)) {
  6245. true && warn(
  6246. 'v-bind without argument expects an Object or Array value',
  6247. this
  6248. );
  6249. } else {
  6250. if (Array.isArray(value)) {
  6251. value = toObject(value);
  6252. }
  6253. var hash;
  6254. var loop = function ( key ) {
  6255. if (
  6256. key === 'class' ||
  6257. key === 'style' ||
  6258. isReservedAttribute(key)
  6259. ) {
  6260. hash = data;
  6261. } else {
  6262. var type = data.attrs && data.attrs.type;
  6263. hash = asProp || config.mustUseProp(tag, type, key)
  6264. ? data.domProps || (data.domProps = {})
  6265. : data.attrs || (data.attrs = {});
  6266. }
  6267. var camelizedKey = camelize(key);
  6268. var hyphenatedKey = hyphenate(key);
  6269. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6270. hash[key] = value[key];
  6271. if (isSync) {
  6272. var on = data.on || (data.on = {});
  6273. on[("update:" + key)] = function ($event) {
  6274. value[key] = $event;
  6275. };
  6276. }
  6277. }
  6278. };
  6279. for (var key in value) loop( key );
  6280. }
  6281. }
  6282. return data
  6283. }
  6284. /* */
  6285. /**
  6286. * Runtime helper for rendering static trees.
  6287. */
  6288. function renderStatic (
  6289. index,
  6290. isInFor
  6291. ) {
  6292. var cached = this._staticTrees || (this._staticTrees = []);
  6293. var tree = cached[index];
  6294. // if has already-rendered static tree and not inside v-for,
  6295. // we can reuse the same tree.
  6296. if (tree && !isInFor) {
  6297. return tree
  6298. }
  6299. // otherwise, render a fresh tree.
  6300. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6301. this._renderProxy,
  6302. null,
  6303. this // for render fns generated for functional component templates
  6304. );
  6305. markStatic(tree, ("__static__" + index), false);
  6306. return tree
  6307. }
  6308. /**
  6309. * Runtime helper for v-once.
  6310. * Effectively it means marking the node as static with a unique key.
  6311. */
  6312. function markOnce (
  6313. tree,
  6314. index,
  6315. key
  6316. ) {
  6317. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6318. return tree
  6319. }
  6320. function markStatic (
  6321. tree,
  6322. key,
  6323. isOnce
  6324. ) {
  6325. if (Array.isArray(tree)) {
  6326. for (var i = 0; i < tree.length; i++) {
  6327. if (tree[i] && typeof tree[i] !== 'string') {
  6328. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6329. }
  6330. }
  6331. } else {
  6332. markStaticNode(tree, key, isOnce);
  6333. }
  6334. }
  6335. function markStaticNode (node, key, isOnce) {
  6336. node.isStatic = true;
  6337. node.key = key;
  6338. node.isOnce = isOnce;
  6339. }
  6340. /* */
  6341. function bindObjectListeners (data, value) {
  6342. if (value) {
  6343. if (!isPlainObject(value)) {
  6344. true && warn(
  6345. 'v-on without argument expects an Object value',
  6346. this
  6347. );
  6348. } else {
  6349. var on = data.on = data.on ? extend({}, data.on) : {};
  6350. for (var key in value) {
  6351. var existing = on[key];
  6352. var ours = value[key];
  6353. on[key] = existing ? [].concat(existing, ours) : ours;
  6354. }
  6355. }
  6356. }
  6357. return data
  6358. }
  6359. /* */
  6360. function resolveScopedSlots (
  6361. fns, // see flow/vnode
  6362. res,
  6363. // the following are added in 2.6
  6364. hasDynamicKeys,
  6365. contentHashKey
  6366. ) {
  6367. res = res || { $stable: !hasDynamicKeys };
  6368. for (var i = 0; i < fns.length; i++) {
  6369. var slot = fns[i];
  6370. if (Array.isArray(slot)) {
  6371. resolveScopedSlots(slot, res, hasDynamicKeys);
  6372. } else if (slot) {
  6373. // marker for reverse proxying v-slot without scope on this.$slots
  6374. if (slot.proxy) {
  6375. slot.fn.proxy = true;
  6376. }
  6377. res[slot.key] = slot.fn;
  6378. }
  6379. }
  6380. if (contentHashKey) {
  6381. (res).$key = contentHashKey;
  6382. }
  6383. return res
  6384. }
  6385. /* */
  6386. function bindDynamicKeys (baseObj, values) {
  6387. for (var i = 0; i < values.length; i += 2) {
  6388. var key = values[i];
  6389. if (typeof key === 'string' && key) {
  6390. baseObj[values[i]] = values[i + 1];
  6391. } else if ( true && key !== '' && key !== null) {
  6392. // null is a special value for explicitly removing a binding
  6393. warn(
  6394. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6395. this
  6396. );
  6397. }
  6398. }
  6399. return baseObj
  6400. }
  6401. // helper to dynamically append modifier runtime markers to event names.
  6402. // ensure only append when value is already string, otherwise it will be cast
  6403. // to string and cause the type check to miss.
  6404. function prependModifier (value, symbol) {
  6405. return typeof value === 'string' ? symbol + value : value
  6406. }
  6407. /* */
  6408. function installRenderHelpers (target) {
  6409. target._o = markOnce;
  6410. target._n = toNumber;
  6411. target._s = toString;
  6412. target._l = renderList;
  6413. target._t = renderSlot;
  6414. target._q = looseEqual;
  6415. target._i = looseIndexOf;
  6416. target._m = renderStatic;
  6417. target._f = resolveFilter;
  6418. target._k = checkKeyCodes;
  6419. target._b = bindObjectProps;
  6420. target._v = createTextVNode;
  6421. target._e = createEmptyVNode;
  6422. target._u = resolveScopedSlots;
  6423. target._g = bindObjectListeners;
  6424. target._d = bindDynamicKeys;
  6425. target._p = prependModifier;
  6426. }
  6427. /* */
  6428. function FunctionalRenderContext (
  6429. data,
  6430. props,
  6431. children,
  6432. parent,
  6433. Ctor
  6434. ) {
  6435. var this$1 = this;
  6436. var options = Ctor.options;
  6437. // ensure the createElement function in functional components
  6438. // gets a unique context - this is necessary for correct named slot check
  6439. var contextVm;
  6440. if (hasOwn(parent, '_uid')) {
  6441. contextVm = Object.create(parent);
  6442. // $flow-disable-line
  6443. contextVm._original = parent;
  6444. } else {
  6445. // the context vm passed in is a functional context as well.
  6446. // in this case we want to make sure we are able to get a hold to the
  6447. // real context instance.
  6448. contextVm = parent;
  6449. // $flow-disable-line
  6450. parent = parent._original;
  6451. }
  6452. var isCompiled = isTrue(options._compiled);
  6453. var needNormalization = !isCompiled;
  6454. this.data = data;
  6455. this.props = props;
  6456. this.children = children;
  6457. this.parent = parent;
  6458. this.listeners = data.on || emptyObject;
  6459. this.injections = resolveInject(options.inject, parent);
  6460. this.slots = function () {
  6461. if (!this$1.$slots) {
  6462. normalizeScopedSlots(
  6463. data.scopedSlots,
  6464. this$1.$slots = resolveSlots(children, parent)
  6465. );
  6466. }
  6467. return this$1.$slots
  6468. };
  6469. Object.defineProperty(this, 'scopedSlots', ({
  6470. enumerable: true,
  6471. get: function get () {
  6472. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6473. }
  6474. }));
  6475. // support for compiled functional template
  6476. if (isCompiled) {
  6477. // exposing $options for renderStatic()
  6478. this.$options = options;
  6479. // pre-resolve slots for renderSlot()
  6480. this.$slots = this.slots();
  6481. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6482. }
  6483. if (options._scopeId) {
  6484. this._c = function (a, b, c, d) {
  6485. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6486. if (vnode && !Array.isArray(vnode)) {
  6487. vnode.fnScopeId = options._scopeId;
  6488. vnode.fnContext = parent;
  6489. }
  6490. return vnode
  6491. };
  6492. } else {
  6493. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6494. }
  6495. }
  6496. installRenderHelpers(FunctionalRenderContext.prototype);
  6497. function createFunctionalComponent (
  6498. Ctor,
  6499. propsData,
  6500. data,
  6501. contextVm,
  6502. children
  6503. ) {
  6504. var options = Ctor.options;
  6505. var props = {};
  6506. var propOptions = options.props;
  6507. if (isDef(propOptions)) {
  6508. for (var key in propOptions) {
  6509. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6510. }
  6511. } else {
  6512. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6513. if (isDef(data.props)) { mergeProps(props, data.props); }
  6514. }
  6515. var renderContext = new FunctionalRenderContext(
  6516. data,
  6517. props,
  6518. children,
  6519. contextVm,
  6520. Ctor
  6521. );
  6522. var vnode = options.render.call(null, renderContext._c, renderContext);
  6523. if (vnode instanceof VNode) {
  6524. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6525. } else if (Array.isArray(vnode)) {
  6526. var vnodes = normalizeChildren(vnode) || [];
  6527. var res = new Array(vnodes.length);
  6528. for (var i = 0; i < vnodes.length; i++) {
  6529. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6530. }
  6531. return res
  6532. }
  6533. }
  6534. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6535. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6536. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6537. // that should not be matched to match.
  6538. var clone = cloneVNode(vnode);
  6539. clone.fnContext = contextVm;
  6540. clone.fnOptions = options;
  6541. if (true) {
  6542. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6543. }
  6544. if (data.slot) {
  6545. (clone.data || (clone.data = {})).slot = data.slot;
  6546. }
  6547. return clone
  6548. }
  6549. function mergeProps (to, from) {
  6550. for (var key in from) {
  6551. to[camelize(key)] = from[key];
  6552. }
  6553. }
  6554. /* */
  6555. /* */
  6556. /* */
  6557. /* */
  6558. // inline hooks to be invoked on component VNodes during patch
  6559. var componentVNodeHooks = {
  6560. init: function init (vnode, hydrating) {
  6561. if (
  6562. vnode.componentInstance &&
  6563. !vnode.componentInstance._isDestroyed &&
  6564. vnode.data.keepAlive
  6565. ) {
  6566. // kept-alive components, treat as a patch
  6567. var mountedNode = vnode; // work around flow
  6568. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6569. } else {
  6570. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6571. vnode,
  6572. activeInstance
  6573. );
  6574. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6575. }
  6576. },
  6577. prepatch: function prepatch (oldVnode, vnode) {
  6578. var options = vnode.componentOptions;
  6579. var child = vnode.componentInstance = oldVnode.componentInstance;
  6580. updateChildComponent(
  6581. child,
  6582. options.propsData, // updated props
  6583. options.listeners, // updated listeners
  6584. vnode, // new parent vnode
  6585. options.children // new children
  6586. );
  6587. },
  6588. insert: function insert (vnode) {
  6589. var context = vnode.context;
  6590. var componentInstance = vnode.componentInstance;
  6591. if (!componentInstance._isMounted) {
  6592. callHook(componentInstance, 'onServiceCreated');
  6593. callHook(componentInstance, 'onServiceAttached');
  6594. componentInstance._isMounted = true;
  6595. callHook(componentInstance, 'mounted');
  6596. }
  6597. if (vnode.data.keepAlive) {
  6598. if (context._isMounted) {
  6599. // vue-router#1212
  6600. // During updates, a kept-alive component's child components may
  6601. // change, so directly walking the tree here may call activated hooks
  6602. // on incorrect children. Instead we push them into a queue which will
  6603. // be processed after the whole patch process ended.
  6604. queueActivatedComponent(componentInstance);
  6605. } else {
  6606. activateChildComponent(componentInstance, true /* direct */);
  6607. }
  6608. }
  6609. },
  6610. destroy: function destroy (vnode) {
  6611. var componentInstance = vnode.componentInstance;
  6612. if (!componentInstance._isDestroyed) {
  6613. if (!vnode.data.keepAlive) {
  6614. componentInstance.$destroy();
  6615. } else {
  6616. deactivateChildComponent(componentInstance, true /* direct */);
  6617. }
  6618. }
  6619. }
  6620. };
  6621. var hooksToMerge = Object.keys(componentVNodeHooks);
  6622. function createComponent (
  6623. Ctor,
  6624. data,
  6625. context,
  6626. children,
  6627. tag
  6628. ) {
  6629. if (isUndef(Ctor)) {
  6630. return
  6631. }
  6632. var baseCtor = context.$options._base;
  6633. // plain options object: turn it into a constructor
  6634. if (isObject(Ctor)) {
  6635. Ctor = baseCtor.extend(Ctor);
  6636. }
  6637. // if at this stage it's not a constructor or an async component factory,
  6638. // reject.
  6639. if (typeof Ctor !== 'function') {
  6640. if (true) {
  6641. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6642. }
  6643. return
  6644. }
  6645. // async component
  6646. var asyncFactory;
  6647. if (isUndef(Ctor.cid)) {
  6648. asyncFactory = Ctor;
  6649. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6650. if (Ctor === undefined) {
  6651. // return a placeholder node for async component, which is rendered
  6652. // as a comment node but preserves all the raw information for the node.
  6653. // the information will be used for async server-rendering and hydration.
  6654. return createAsyncPlaceholder(
  6655. asyncFactory,
  6656. data,
  6657. context,
  6658. children,
  6659. tag
  6660. )
  6661. }
  6662. }
  6663. data = data || {};
  6664. // resolve constructor options in case global mixins are applied after
  6665. // component constructor creation
  6666. resolveConstructorOptions(Ctor);
  6667. // transform component v-model data into props & events
  6668. if (isDef(data.model)) {
  6669. transformModel(Ctor.options, data);
  6670. }
  6671. // extract props
  6672. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6673. // functional component
  6674. if (isTrue(Ctor.options.functional)) {
  6675. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6676. }
  6677. // extract listeners, since these needs to be treated as
  6678. // child component listeners instead of DOM listeners
  6679. var listeners = data.on;
  6680. // replace with listeners with .native modifier
  6681. // so it gets processed during parent component patch.
  6682. data.on = data.nativeOn;
  6683. if (isTrue(Ctor.options.abstract)) {
  6684. // abstract components do not keep anything
  6685. // other than props & listeners & slot
  6686. // work around flow
  6687. var slot = data.slot;
  6688. data = {};
  6689. if (slot) {
  6690. data.slot = slot;
  6691. }
  6692. }
  6693. // install component management hooks onto the placeholder node
  6694. installComponentHooks(data);
  6695. // return a placeholder vnode
  6696. var name = Ctor.options.name || tag;
  6697. var vnode = new VNode(
  6698. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6699. data, undefined, undefined, undefined, context,
  6700. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6701. asyncFactory
  6702. );
  6703. return vnode
  6704. }
  6705. function createComponentInstanceForVnode (
  6706. vnode, // we know it's MountedComponentVNode but flow doesn't
  6707. parent // activeInstance in lifecycle state
  6708. ) {
  6709. var options = {
  6710. _isComponent: true,
  6711. _parentVnode: vnode,
  6712. parent: parent
  6713. };
  6714. // check inline-template render functions
  6715. var inlineTemplate = vnode.data.inlineTemplate;
  6716. if (isDef(inlineTemplate)) {
  6717. options.render = inlineTemplate.render;
  6718. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6719. }
  6720. return new vnode.componentOptions.Ctor(options)
  6721. }
  6722. function installComponentHooks (data) {
  6723. var hooks = data.hook || (data.hook = {});
  6724. for (var i = 0; i < hooksToMerge.length; i++) {
  6725. var key = hooksToMerge[i];
  6726. var existing = hooks[key];
  6727. var toMerge = componentVNodeHooks[key];
  6728. if (existing !== toMerge && !(existing && existing._merged)) {
  6729. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6730. }
  6731. }
  6732. }
  6733. function mergeHook$1 (f1, f2) {
  6734. var merged = function (a, b) {
  6735. // flow complains about extra args which is why we use any
  6736. f1(a, b);
  6737. f2(a, b);
  6738. };
  6739. merged._merged = true;
  6740. return merged
  6741. }
  6742. // transform component v-model info (value and callback) into
  6743. // prop and event handler respectively.
  6744. function transformModel (options, data) {
  6745. var prop = (options.model && options.model.prop) || 'value';
  6746. var event = (options.model && options.model.event) || 'input'
  6747. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6748. var on = data.on || (data.on = {});
  6749. var existing = on[event];
  6750. var callback = data.model.callback;
  6751. if (isDef(existing)) {
  6752. if (
  6753. Array.isArray(existing)
  6754. ? existing.indexOf(callback) === -1
  6755. : existing !== callback
  6756. ) {
  6757. on[event] = [callback].concat(existing);
  6758. }
  6759. } else {
  6760. on[event] = callback;
  6761. }
  6762. }
  6763. /* */
  6764. var SIMPLE_NORMALIZE = 1;
  6765. var ALWAYS_NORMALIZE = 2;
  6766. // wrapper function for providing a more flexible interface
  6767. // without getting yelled at by flow
  6768. function createElement (
  6769. context,
  6770. tag,
  6771. data,
  6772. children,
  6773. normalizationType,
  6774. alwaysNormalize
  6775. ) {
  6776. if (Array.isArray(data) || isPrimitive(data)) {
  6777. normalizationType = children;
  6778. children = data;
  6779. data = undefined;
  6780. }
  6781. if (isTrue(alwaysNormalize)) {
  6782. normalizationType = ALWAYS_NORMALIZE;
  6783. }
  6784. return _createElement(context, tag, data, children, normalizationType)
  6785. }
  6786. function _createElement (
  6787. context,
  6788. tag,
  6789. data,
  6790. children,
  6791. normalizationType
  6792. ) {
  6793. if (isDef(data) && isDef((data).__ob__)) {
  6794. true && warn(
  6795. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6796. 'Always create fresh vnode data objects in each render!',
  6797. context
  6798. );
  6799. return createEmptyVNode()
  6800. }
  6801. // object syntax in v-bind
  6802. if (isDef(data) && isDef(data.is)) {
  6803. tag = data.is;
  6804. }
  6805. if (!tag) {
  6806. // in case of component :is set to falsy value
  6807. return createEmptyVNode()
  6808. }
  6809. // warn against non-primitive key
  6810. if ( true &&
  6811. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6812. ) {
  6813. {
  6814. warn(
  6815. 'Avoid using non-primitive value as key, ' +
  6816. 'use string/number value instead.',
  6817. context
  6818. );
  6819. }
  6820. }
  6821. // support single function children as default scoped slot
  6822. if (Array.isArray(children) &&
  6823. typeof children[0] === 'function'
  6824. ) {
  6825. data = data || {};
  6826. data.scopedSlots = { default: children[0] };
  6827. children.length = 0;
  6828. }
  6829. if (normalizationType === ALWAYS_NORMALIZE) {
  6830. children = normalizeChildren(children);
  6831. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6832. children = simpleNormalizeChildren(children);
  6833. }
  6834. var vnode, ns;
  6835. if (typeof tag === 'string') {
  6836. var Ctor;
  6837. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6838. if (config.isReservedTag(tag)) {
  6839. // platform built-in elements
  6840. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6841. warn(
  6842. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6843. context
  6844. );
  6845. }
  6846. vnode = new VNode(
  6847. config.parsePlatformTagName(tag), data, children,
  6848. undefined, undefined, context
  6849. );
  6850. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6851. // component
  6852. vnode = createComponent(Ctor, data, context, children, tag);
  6853. } else {
  6854. // unknown or unlisted namespaced elements
  6855. // check at runtime because it may get assigned a namespace when its
  6856. // parent normalizes children
  6857. vnode = new VNode(
  6858. tag, data, children,
  6859. undefined, undefined, context
  6860. );
  6861. }
  6862. } else {
  6863. // direct component options / constructor
  6864. vnode = createComponent(tag, data, context, children);
  6865. }
  6866. if (Array.isArray(vnode)) {
  6867. return vnode
  6868. } else if (isDef(vnode)) {
  6869. if (isDef(ns)) { applyNS(vnode, ns); }
  6870. if (isDef(data)) { registerDeepBindings(data); }
  6871. return vnode
  6872. } else {
  6873. return createEmptyVNode()
  6874. }
  6875. }
  6876. function applyNS (vnode, ns, force) {
  6877. vnode.ns = ns;
  6878. if (vnode.tag === 'foreignObject') {
  6879. // use default namespace inside foreignObject
  6880. ns = undefined;
  6881. force = true;
  6882. }
  6883. if (isDef(vnode.children)) {
  6884. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6885. var child = vnode.children[i];
  6886. if (isDef(child.tag) && (
  6887. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6888. applyNS(child, ns, force);
  6889. }
  6890. }
  6891. }
  6892. }
  6893. // ref #5318
  6894. // necessary to ensure parent re-render when deep bindings like :style and
  6895. // :class are used on slot nodes
  6896. function registerDeepBindings (data) {
  6897. if (isObject(data.style)) {
  6898. traverse(data.style);
  6899. }
  6900. if (isObject(data.class)) {
  6901. traverse(data.class);
  6902. }
  6903. }
  6904. /* */
  6905. function initRender (vm) {
  6906. vm._vnode = null; // the root of the child tree
  6907. vm._staticTrees = null; // v-once cached trees
  6908. var options = vm.$options;
  6909. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6910. var renderContext = parentVnode && parentVnode.context;
  6911. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6912. vm.$scopedSlots = emptyObject;
  6913. // bind the createElement fn to this instance
  6914. // so that we get proper render context inside it.
  6915. // args order: tag, data, children, normalizationType, alwaysNormalize
  6916. // internal version is used by render functions compiled from templates
  6917. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6918. // normalization is always applied for the public version, used in
  6919. // user-written render functions.
  6920. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6921. // $attrs & $listeners are exposed for easier HOC creation.
  6922. // they need to be reactive so that HOCs using them are always updated
  6923. var parentData = parentVnode && parentVnode.data;
  6924. /* istanbul ignore else */
  6925. if (true) {
  6926. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6927. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6928. }, true);
  6929. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6930. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6931. }, true);
  6932. } else {}
  6933. }
  6934. var currentRenderingInstance = null;
  6935. function renderMixin (Vue) {
  6936. // install runtime convenience helpers
  6937. installRenderHelpers(Vue.prototype);
  6938. Vue.prototype.$nextTick = function (fn) {
  6939. return nextTick(fn, this)
  6940. };
  6941. Vue.prototype._render = function () {
  6942. var vm = this;
  6943. var ref = vm.$options;
  6944. var render = ref.render;
  6945. var _parentVnode = ref._parentVnode;
  6946. if (_parentVnode) {
  6947. vm.$scopedSlots = normalizeScopedSlots(
  6948. _parentVnode.data.scopedSlots,
  6949. vm.$slots,
  6950. vm.$scopedSlots
  6951. );
  6952. }
  6953. // set parent vnode. this allows render functions to have access
  6954. // to the data on the placeholder node.
  6955. vm.$vnode = _parentVnode;
  6956. // render self
  6957. var vnode;
  6958. try {
  6959. // There's no need to maintain a stack because all render fns are called
  6960. // separately from one another. Nested component's render fns are called
  6961. // when parent component is patched.
  6962. currentRenderingInstance = vm;
  6963. vnode = render.call(vm._renderProxy, vm.$createElement);
  6964. } catch (e) {
  6965. handleError(e, vm, "render");
  6966. // return error render result,
  6967. // or previous vnode to prevent render error causing blank component
  6968. /* istanbul ignore else */
  6969. if ( true && vm.$options.renderError) {
  6970. try {
  6971. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6972. } catch (e) {
  6973. handleError(e, vm, "renderError");
  6974. vnode = vm._vnode;
  6975. }
  6976. } else {
  6977. vnode = vm._vnode;
  6978. }
  6979. } finally {
  6980. currentRenderingInstance = null;
  6981. }
  6982. // if the returned array contains only a single node, allow it
  6983. if (Array.isArray(vnode) && vnode.length === 1) {
  6984. vnode = vnode[0];
  6985. }
  6986. // return empty vnode in case the render function errored out
  6987. if (!(vnode instanceof VNode)) {
  6988. if ( true && Array.isArray(vnode)) {
  6989. warn(
  6990. 'Multiple root nodes returned from render function. Render function ' +
  6991. 'should return a single root node.',
  6992. vm
  6993. );
  6994. }
  6995. vnode = createEmptyVNode();
  6996. }
  6997. // set parent
  6998. vnode.parent = _parentVnode;
  6999. return vnode
  7000. };
  7001. }
  7002. /* */
  7003. function ensureCtor (comp, base) {
  7004. if (
  7005. comp.__esModule ||
  7006. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7007. ) {
  7008. comp = comp.default;
  7009. }
  7010. return isObject(comp)
  7011. ? base.extend(comp)
  7012. : comp
  7013. }
  7014. function createAsyncPlaceholder (
  7015. factory,
  7016. data,
  7017. context,
  7018. children,
  7019. tag
  7020. ) {
  7021. var node = createEmptyVNode();
  7022. node.asyncFactory = factory;
  7023. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7024. return node
  7025. }
  7026. function resolveAsyncComponent (
  7027. factory,
  7028. baseCtor
  7029. ) {
  7030. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7031. return factory.errorComp
  7032. }
  7033. if (isDef(factory.resolved)) {
  7034. return factory.resolved
  7035. }
  7036. var owner = currentRenderingInstance;
  7037. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7038. // already pending
  7039. factory.owners.push(owner);
  7040. }
  7041. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7042. return factory.loadingComp
  7043. }
  7044. if (owner && !isDef(factory.owners)) {
  7045. var owners = factory.owners = [owner];
  7046. var sync = true;
  7047. var timerLoading = null;
  7048. var timerTimeout = null
  7049. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7050. var forceRender = function (renderCompleted) {
  7051. for (var i = 0, l = owners.length; i < l; i++) {
  7052. (owners[i]).$forceUpdate();
  7053. }
  7054. if (renderCompleted) {
  7055. owners.length = 0;
  7056. if (timerLoading !== null) {
  7057. clearTimeout(timerLoading);
  7058. timerLoading = null;
  7059. }
  7060. if (timerTimeout !== null) {
  7061. clearTimeout(timerTimeout);
  7062. timerTimeout = null;
  7063. }
  7064. }
  7065. };
  7066. var resolve = once(function (res) {
  7067. // cache resolved
  7068. factory.resolved = ensureCtor(res, baseCtor);
  7069. // invoke callbacks only if this is not a synchronous resolve
  7070. // (async resolves are shimmed as synchronous during SSR)
  7071. if (!sync) {
  7072. forceRender(true);
  7073. } else {
  7074. owners.length = 0;
  7075. }
  7076. });
  7077. var reject = once(function (reason) {
  7078. true && warn(
  7079. "Failed to resolve async component: " + (String(factory)) +
  7080. (reason ? ("\nReason: " + reason) : '')
  7081. );
  7082. if (isDef(factory.errorComp)) {
  7083. factory.error = true;
  7084. forceRender(true);
  7085. }
  7086. });
  7087. var res = factory(resolve, reject);
  7088. if (isObject(res)) {
  7089. if (isPromise(res)) {
  7090. // () => Promise
  7091. if (isUndef(factory.resolved)) {
  7092. res.then(resolve, reject);
  7093. }
  7094. } else if (isPromise(res.component)) {
  7095. res.component.then(resolve, reject);
  7096. if (isDef(res.error)) {
  7097. factory.errorComp = ensureCtor(res.error, baseCtor);
  7098. }
  7099. if (isDef(res.loading)) {
  7100. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7101. if (res.delay === 0) {
  7102. factory.loading = true;
  7103. } else {
  7104. timerLoading = setTimeout(function () {
  7105. timerLoading = null;
  7106. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7107. factory.loading = true;
  7108. forceRender(false);
  7109. }
  7110. }, res.delay || 200);
  7111. }
  7112. }
  7113. if (isDef(res.timeout)) {
  7114. timerTimeout = setTimeout(function () {
  7115. timerTimeout = null;
  7116. if (isUndef(factory.resolved)) {
  7117. reject(
  7118. true
  7119. ? ("timeout (" + (res.timeout) + "ms)")
  7120. : undefined
  7121. );
  7122. }
  7123. }, res.timeout);
  7124. }
  7125. }
  7126. }
  7127. sync = false;
  7128. // return in case resolved synchronously
  7129. return factory.loading
  7130. ? factory.loadingComp
  7131. : factory.resolved
  7132. }
  7133. }
  7134. /* */
  7135. function isAsyncPlaceholder (node) {
  7136. return node.isComment && node.asyncFactory
  7137. }
  7138. /* */
  7139. function getFirstComponentChild (children) {
  7140. if (Array.isArray(children)) {
  7141. for (var i = 0; i < children.length; i++) {
  7142. var c = children[i];
  7143. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7144. return c
  7145. }
  7146. }
  7147. }
  7148. }
  7149. /* */
  7150. /* */
  7151. function initEvents (vm) {
  7152. vm._events = Object.create(null);
  7153. vm._hasHookEvent = false;
  7154. // init parent attached events
  7155. var listeners = vm.$options._parentListeners;
  7156. if (listeners) {
  7157. updateComponentListeners(vm, listeners);
  7158. }
  7159. }
  7160. var target;
  7161. function add (event, fn) {
  7162. target.$on(event, fn);
  7163. }
  7164. function remove$1 (event, fn) {
  7165. target.$off(event, fn);
  7166. }
  7167. function createOnceHandler (event, fn) {
  7168. var _target = target;
  7169. return function onceHandler () {
  7170. var res = fn.apply(null, arguments);
  7171. if (res !== null) {
  7172. _target.$off(event, onceHandler);
  7173. }
  7174. }
  7175. }
  7176. function updateComponentListeners (
  7177. vm,
  7178. listeners,
  7179. oldListeners
  7180. ) {
  7181. target = vm;
  7182. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7183. target = undefined;
  7184. }
  7185. function eventsMixin (Vue) {
  7186. var hookRE = /^hook:/;
  7187. Vue.prototype.$on = function (event, fn) {
  7188. var vm = this;
  7189. if (Array.isArray(event)) {
  7190. for (var i = 0, l = event.length; i < l; i++) {
  7191. vm.$on(event[i], fn);
  7192. }
  7193. } else {
  7194. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7195. // optimize hook:event cost by using a boolean flag marked at registration
  7196. // instead of a hash lookup
  7197. if (hookRE.test(event)) {
  7198. vm._hasHookEvent = true;
  7199. }
  7200. }
  7201. return vm
  7202. };
  7203. Vue.prototype.$once = function (event, fn) {
  7204. var vm = this;
  7205. function on () {
  7206. vm.$off(event, on);
  7207. fn.apply(vm, arguments);
  7208. }
  7209. on.fn = fn;
  7210. vm.$on(event, on);
  7211. return vm
  7212. };
  7213. Vue.prototype.$off = function (event, fn) {
  7214. var vm = this;
  7215. // all
  7216. if (!arguments.length) {
  7217. vm._events = Object.create(null);
  7218. return vm
  7219. }
  7220. // array of events
  7221. if (Array.isArray(event)) {
  7222. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7223. vm.$off(event[i$1], fn);
  7224. }
  7225. return vm
  7226. }
  7227. // specific event
  7228. var cbs = vm._events[event];
  7229. if (!cbs) {
  7230. return vm
  7231. }
  7232. if (!fn) {
  7233. vm._events[event] = null;
  7234. return vm
  7235. }
  7236. // specific handler
  7237. var cb;
  7238. var i = cbs.length;
  7239. while (i--) {
  7240. cb = cbs[i];
  7241. if (cb === fn || cb.fn === fn) {
  7242. cbs.splice(i, 1);
  7243. break
  7244. }
  7245. }
  7246. return vm
  7247. };
  7248. Vue.prototype.$emit = function (event) {
  7249. var vm = this;
  7250. if (true) {
  7251. var lowerCaseEvent = event.toLowerCase();
  7252. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7253. tip(
  7254. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7255. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7256. "Note that HTML attributes are case-insensitive and you cannot use " +
  7257. "v-on to listen to camelCase events when using in-DOM templates. " +
  7258. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7259. );
  7260. }
  7261. }
  7262. var cbs = vm._events[event];
  7263. if (cbs) {
  7264. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7265. var args = toArray(arguments, 1);
  7266. var info = "event handler for \"" + event + "\"";
  7267. for (var i = 0, l = cbs.length; i < l; i++) {
  7268. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7269. }
  7270. }
  7271. return vm
  7272. };
  7273. }
  7274. /* */
  7275. var activeInstance = null;
  7276. var isUpdatingChildComponent = false;
  7277. function setActiveInstance(vm) {
  7278. var prevActiveInstance = activeInstance;
  7279. activeInstance = vm;
  7280. return function () {
  7281. activeInstance = prevActiveInstance;
  7282. }
  7283. }
  7284. function initLifecycle (vm) {
  7285. var options = vm.$options;
  7286. // locate first non-abstract parent
  7287. var parent = options.parent;
  7288. if (parent && !options.abstract) {
  7289. while (parent.$options.abstract && parent.$parent) {
  7290. parent = parent.$parent;
  7291. }
  7292. parent.$children.push(vm);
  7293. }
  7294. vm.$parent = parent;
  7295. vm.$root = parent ? parent.$root : vm;
  7296. vm.$children = [];
  7297. vm.$refs = {};
  7298. vm._watcher = null;
  7299. vm._inactive = null;
  7300. vm._directInactive = false;
  7301. vm._isMounted = false;
  7302. vm._isDestroyed = false;
  7303. vm._isBeingDestroyed = false;
  7304. }
  7305. function lifecycleMixin (Vue) {
  7306. Vue.prototype._update = function (vnode, hydrating) {
  7307. var vm = this;
  7308. var prevEl = vm.$el;
  7309. var prevVnode = vm._vnode;
  7310. var restoreActiveInstance = setActiveInstance(vm);
  7311. vm._vnode = vnode;
  7312. // Vue.prototype.__patch__ is injected in entry points
  7313. // based on the rendering backend used.
  7314. if (!prevVnode) {
  7315. // initial render
  7316. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7317. } else {
  7318. // updates
  7319. vm.$el = vm.__patch__(prevVnode, vnode);
  7320. }
  7321. restoreActiveInstance();
  7322. // update __vue__ reference
  7323. if (prevEl) {
  7324. prevEl.__vue__ = null;
  7325. }
  7326. if (vm.$el) {
  7327. vm.$el.__vue__ = vm;
  7328. }
  7329. // if parent is an HOC, update its $el as well
  7330. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7331. vm.$parent.$el = vm.$el;
  7332. }
  7333. // updated hook is called by the scheduler to ensure that children are
  7334. // updated in a parent's updated hook.
  7335. };
  7336. Vue.prototype.$forceUpdate = function () {
  7337. var vm = this;
  7338. if (vm._watcher) {
  7339. vm._watcher.update();
  7340. }
  7341. };
  7342. Vue.prototype.$destroy = function () {
  7343. var vm = this;
  7344. if (vm._isBeingDestroyed) {
  7345. return
  7346. }
  7347. callHook(vm, 'beforeDestroy');
  7348. vm._isBeingDestroyed = true;
  7349. // remove self from parent
  7350. var parent = vm.$parent;
  7351. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7352. remove(parent.$children, vm);
  7353. }
  7354. // teardown watchers
  7355. if (vm._watcher) {
  7356. vm._watcher.teardown();
  7357. }
  7358. var i = vm._watchers.length;
  7359. while (i--) {
  7360. vm._watchers[i].teardown();
  7361. }
  7362. // remove reference from data ob
  7363. // frozen object may not have observer.
  7364. if (vm._data.__ob__) {
  7365. vm._data.__ob__.vmCount--;
  7366. }
  7367. // call the last hook...
  7368. vm._isDestroyed = true;
  7369. // invoke destroy hooks on current rendered tree
  7370. vm.__patch__(vm._vnode, null);
  7371. // fire destroyed hook
  7372. callHook(vm, 'destroyed');
  7373. // turn off all instance listeners.
  7374. vm.$off();
  7375. // remove __vue__ reference
  7376. if (vm.$el) {
  7377. vm.$el.__vue__ = null;
  7378. }
  7379. // release circular reference (#6759)
  7380. if (vm.$vnode) {
  7381. vm.$vnode.parent = null;
  7382. }
  7383. };
  7384. }
  7385. function updateChildComponent (
  7386. vm,
  7387. propsData,
  7388. listeners,
  7389. parentVnode,
  7390. renderChildren
  7391. ) {
  7392. if (true) {
  7393. isUpdatingChildComponent = true;
  7394. }
  7395. // determine whether component has slot children
  7396. // we need to do this before overwriting $options._renderChildren.
  7397. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7398. // dynamic slot names). Static scoped slots compiled from template has the
  7399. // "$stable" marker.
  7400. var newScopedSlots = parentVnode.data.scopedSlots;
  7401. var oldScopedSlots = vm.$scopedSlots;
  7402. var hasDynamicScopedSlot = !!(
  7403. (newScopedSlots && !newScopedSlots.$stable) ||
  7404. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7405. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7406. );
  7407. // Any static slot children from the parent may have changed during parent's
  7408. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7409. // update is necessary to ensure correctness.
  7410. var needsForceUpdate = !!(
  7411. renderChildren || // has new static slots
  7412. vm.$options._renderChildren || // has old static slots
  7413. hasDynamicScopedSlot
  7414. );
  7415. vm.$options._parentVnode = parentVnode;
  7416. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7417. if (vm._vnode) { // update child tree's parent
  7418. vm._vnode.parent = parentVnode;
  7419. }
  7420. vm.$options._renderChildren = renderChildren;
  7421. // update $attrs and $listeners hash
  7422. // these are also reactive so they may trigger child update if the child
  7423. // used them during render
  7424. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7425. vm.$listeners = listeners || emptyObject;
  7426. // update props
  7427. if (propsData && vm.$options.props) {
  7428. toggleObserving(false);
  7429. var props = vm._props;
  7430. var propKeys = vm.$options._propKeys || [];
  7431. for (var i = 0; i < propKeys.length; i++) {
  7432. var key = propKeys[i];
  7433. var propOptions = vm.$options.props; // wtf flow?
  7434. props[key] = validateProp(key, propOptions, propsData, vm);
  7435. }
  7436. toggleObserving(true);
  7437. // keep a copy of raw propsData
  7438. vm.$options.propsData = propsData;
  7439. }
  7440. // fixed by xxxxxx update properties(mp runtime)
  7441. vm._$updateProperties && vm._$updateProperties(vm);
  7442. // update listeners
  7443. listeners = listeners || emptyObject;
  7444. var oldListeners = vm.$options._parentListeners;
  7445. vm.$options._parentListeners = listeners;
  7446. updateComponentListeners(vm, listeners, oldListeners);
  7447. // resolve slots + force update if has children
  7448. if (needsForceUpdate) {
  7449. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7450. vm.$forceUpdate();
  7451. }
  7452. if (true) {
  7453. isUpdatingChildComponent = false;
  7454. }
  7455. }
  7456. function isInInactiveTree (vm) {
  7457. while (vm && (vm = vm.$parent)) {
  7458. if (vm._inactive) { return true }
  7459. }
  7460. return false
  7461. }
  7462. function activateChildComponent (vm, direct) {
  7463. if (direct) {
  7464. vm._directInactive = false;
  7465. if (isInInactiveTree(vm)) {
  7466. return
  7467. }
  7468. } else if (vm._directInactive) {
  7469. return
  7470. }
  7471. if (vm._inactive || vm._inactive === null) {
  7472. vm._inactive = false;
  7473. for (var i = 0; i < vm.$children.length; i++) {
  7474. activateChildComponent(vm.$children[i]);
  7475. }
  7476. callHook(vm, 'activated');
  7477. }
  7478. }
  7479. function deactivateChildComponent (vm, direct) {
  7480. if (direct) {
  7481. vm._directInactive = true;
  7482. if (isInInactiveTree(vm)) {
  7483. return
  7484. }
  7485. }
  7486. if (!vm._inactive) {
  7487. vm._inactive = true;
  7488. for (var i = 0; i < vm.$children.length; i++) {
  7489. deactivateChildComponent(vm.$children[i]);
  7490. }
  7491. callHook(vm, 'deactivated');
  7492. }
  7493. }
  7494. function callHook (vm, hook) {
  7495. // #7573 disable dep collection when invoking lifecycle hooks
  7496. pushTarget();
  7497. var handlers = vm.$options[hook];
  7498. var info = hook + " hook";
  7499. if (handlers) {
  7500. for (var i = 0, j = handlers.length; i < j; i++) {
  7501. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7502. }
  7503. }
  7504. if (vm._hasHookEvent) {
  7505. vm.$emit('hook:' + hook);
  7506. }
  7507. popTarget();
  7508. }
  7509. /* */
  7510. var MAX_UPDATE_COUNT = 100;
  7511. var queue = [];
  7512. var activatedChildren = [];
  7513. var has = {};
  7514. var circular = {};
  7515. var waiting = false;
  7516. var flushing = false;
  7517. var index = 0;
  7518. /**
  7519. * Reset the scheduler's state.
  7520. */
  7521. function resetSchedulerState () {
  7522. index = queue.length = activatedChildren.length = 0;
  7523. has = {};
  7524. if (true) {
  7525. circular = {};
  7526. }
  7527. waiting = flushing = false;
  7528. }
  7529. // Async edge case #6566 requires saving the timestamp when event listeners are
  7530. // attached. However, calling performance.now() has a perf overhead especially
  7531. // if the page has thousands of event listeners. Instead, we take a timestamp
  7532. // every time the scheduler flushes and use that for all event listeners
  7533. // attached during that flush.
  7534. var currentFlushTimestamp = 0;
  7535. // Async edge case fix requires storing an event listener's attach timestamp.
  7536. var getNow = Date.now;
  7537. // Determine what event timestamp the browser is using. Annoyingly, the
  7538. // timestamp can either be hi-res (relative to page load) or low-res
  7539. // (relative to UNIX epoch), so in order to compare time we have to use the
  7540. // same timestamp type when saving the flush timestamp.
  7541. // All IE versions use low-res event timestamps, and have problematic clock
  7542. // implementations (#9632)
  7543. if (inBrowser && !isIE) {
  7544. var performance = window.performance;
  7545. if (
  7546. performance &&
  7547. typeof performance.now === 'function' &&
  7548. getNow() > document.createEvent('Event').timeStamp
  7549. ) {
  7550. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7551. // smaller than it, it means the event is using a hi-res timestamp,
  7552. // and we need to use the hi-res version for event listener timestamps as
  7553. // well.
  7554. getNow = function () { return performance.now(); };
  7555. }
  7556. }
  7557. /**
  7558. * Flush both queues and run the watchers.
  7559. */
  7560. function flushSchedulerQueue () {
  7561. currentFlushTimestamp = getNow();
  7562. flushing = true;
  7563. var watcher, id;
  7564. // Sort queue before flush.
  7565. // This ensures that:
  7566. // 1. Components are updated from parent to child. (because parent is always
  7567. // created before the child)
  7568. // 2. A component's user watchers are run before its render watcher (because
  7569. // user watchers are created before the render watcher)
  7570. // 3. If a component is destroyed during a parent component's watcher run,
  7571. // its watchers can be skipped.
  7572. queue.sort(function (a, b) { return a.id - b.id; });
  7573. // do not cache length because more watchers might be pushed
  7574. // as we run existing watchers
  7575. for (index = 0; index < queue.length; index++) {
  7576. watcher = queue[index];
  7577. if (watcher.before) {
  7578. watcher.before();
  7579. }
  7580. id = watcher.id;
  7581. has[id] = null;
  7582. watcher.run();
  7583. // in dev build, check and stop circular updates.
  7584. if ( true && has[id] != null) {
  7585. circular[id] = (circular[id] || 0) + 1;
  7586. if (circular[id] > MAX_UPDATE_COUNT) {
  7587. warn(
  7588. 'You may have an infinite update loop ' + (
  7589. watcher.user
  7590. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7591. : "in a component render function."
  7592. ),
  7593. watcher.vm
  7594. );
  7595. break
  7596. }
  7597. }
  7598. }
  7599. // keep copies of post queues before resetting state
  7600. var activatedQueue = activatedChildren.slice();
  7601. var updatedQueue = queue.slice();
  7602. resetSchedulerState();
  7603. // call component updated and activated hooks
  7604. callActivatedHooks(activatedQueue);
  7605. callUpdatedHooks(updatedQueue);
  7606. // devtool hook
  7607. /* istanbul ignore if */
  7608. if (devtools && config.devtools) {
  7609. devtools.emit('flush');
  7610. }
  7611. }
  7612. function callUpdatedHooks (queue) {
  7613. var i = queue.length;
  7614. while (i--) {
  7615. var watcher = queue[i];
  7616. var vm = watcher.vm;
  7617. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7618. callHook(vm, 'updated');
  7619. }
  7620. }
  7621. }
  7622. /**
  7623. * Queue a kept-alive component that was activated during patch.
  7624. * The queue will be processed after the entire tree has been patched.
  7625. */
  7626. function queueActivatedComponent (vm) {
  7627. // setting _inactive to false here so that a render function can
  7628. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7629. vm._inactive = false;
  7630. activatedChildren.push(vm);
  7631. }
  7632. function callActivatedHooks (queue) {
  7633. for (var i = 0; i < queue.length; i++) {
  7634. queue[i]._inactive = true;
  7635. activateChildComponent(queue[i], true /* true */);
  7636. }
  7637. }
  7638. /**
  7639. * Push a watcher into the watcher queue.
  7640. * Jobs with duplicate IDs will be skipped unless it's
  7641. * pushed when the queue is being flushed.
  7642. */
  7643. function queueWatcher (watcher) {
  7644. var id = watcher.id;
  7645. if (has[id] == null) {
  7646. has[id] = true;
  7647. if (!flushing) {
  7648. queue.push(watcher);
  7649. } else {
  7650. // if already flushing, splice the watcher based on its id
  7651. // if already past its id, it will be run next immediately.
  7652. var i = queue.length - 1;
  7653. while (i > index && queue[i].id > watcher.id) {
  7654. i--;
  7655. }
  7656. queue.splice(i + 1, 0, watcher);
  7657. }
  7658. // queue the flush
  7659. if (!waiting) {
  7660. waiting = true;
  7661. if ( true && !config.async) {
  7662. flushSchedulerQueue();
  7663. return
  7664. }
  7665. nextTick(flushSchedulerQueue);
  7666. }
  7667. }
  7668. }
  7669. /* */
  7670. var uid$2 = 0;
  7671. /**
  7672. * A watcher parses an expression, collects dependencies,
  7673. * and fires callback when the expression value changes.
  7674. * This is used for both the $watch() api and directives.
  7675. */
  7676. var Watcher = function Watcher (
  7677. vm,
  7678. expOrFn,
  7679. cb,
  7680. options,
  7681. isRenderWatcher
  7682. ) {
  7683. this.vm = vm;
  7684. if (isRenderWatcher) {
  7685. vm._watcher = this;
  7686. }
  7687. vm._watchers.push(this);
  7688. // options
  7689. if (options) {
  7690. this.deep = !!options.deep;
  7691. this.user = !!options.user;
  7692. this.lazy = !!options.lazy;
  7693. this.sync = !!options.sync;
  7694. this.before = options.before;
  7695. } else {
  7696. this.deep = this.user = this.lazy = this.sync = false;
  7697. }
  7698. this.cb = cb;
  7699. this.id = ++uid$2; // uid for batching
  7700. this.active = true;
  7701. this.dirty = this.lazy; // for lazy watchers
  7702. this.deps = [];
  7703. this.newDeps = [];
  7704. this.depIds = new _Set();
  7705. this.newDepIds = new _Set();
  7706. this.expression = true
  7707. ? expOrFn.toString()
  7708. : undefined;
  7709. // parse expression for getter
  7710. if (typeof expOrFn === 'function') {
  7711. this.getter = expOrFn;
  7712. } else {
  7713. this.getter = parsePath(expOrFn);
  7714. if (!this.getter) {
  7715. this.getter = noop;
  7716. true && warn(
  7717. "Failed watching path: \"" + expOrFn + "\" " +
  7718. 'Watcher only accepts simple dot-delimited paths. ' +
  7719. 'For full control, use a function instead.',
  7720. vm
  7721. );
  7722. }
  7723. }
  7724. this.value = this.lazy
  7725. ? undefined
  7726. : this.get();
  7727. };
  7728. /**
  7729. * Evaluate the getter, and re-collect dependencies.
  7730. */
  7731. Watcher.prototype.get = function get () {
  7732. pushTarget(this);
  7733. var value;
  7734. var vm = this.vm;
  7735. try {
  7736. value = this.getter.call(vm, vm);
  7737. } catch (e) {
  7738. if (this.user) {
  7739. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7740. } else {
  7741. throw e
  7742. }
  7743. } finally {
  7744. // "touch" every property so they are all tracked as
  7745. // dependencies for deep watching
  7746. if (this.deep) {
  7747. traverse(value);
  7748. }
  7749. popTarget();
  7750. this.cleanupDeps();
  7751. }
  7752. return value
  7753. };
  7754. /**
  7755. * Add a dependency to this directive.
  7756. */
  7757. Watcher.prototype.addDep = function addDep (dep) {
  7758. var id = dep.id;
  7759. if (!this.newDepIds.has(id)) {
  7760. this.newDepIds.add(id);
  7761. this.newDeps.push(dep);
  7762. if (!this.depIds.has(id)) {
  7763. dep.addSub(this);
  7764. }
  7765. }
  7766. };
  7767. /**
  7768. * Clean up for dependency collection.
  7769. */
  7770. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7771. var i = this.deps.length;
  7772. while (i--) {
  7773. var dep = this.deps[i];
  7774. if (!this.newDepIds.has(dep.id)) {
  7775. dep.removeSub(this);
  7776. }
  7777. }
  7778. var tmp = this.depIds;
  7779. this.depIds = this.newDepIds;
  7780. this.newDepIds = tmp;
  7781. this.newDepIds.clear();
  7782. tmp = this.deps;
  7783. this.deps = this.newDeps;
  7784. this.newDeps = tmp;
  7785. this.newDeps.length = 0;
  7786. };
  7787. /**
  7788. * Subscriber interface.
  7789. * Will be called when a dependency changes.
  7790. */
  7791. Watcher.prototype.update = function update () {
  7792. /* istanbul ignore else */
  7793. if (this.lazy) {
  7794. this.dirty = true;
  7795. } else if (this.sync) {
  7796. this.run();
  7797. } else {
  7798. queueWatcher(this);
  7799. }
  7800. };
  7801. /**
  7802. * Scheduler job interface.
  7803. * Will be called by the scheduler.
  7804. */
  7805. Watcher.prototype.run = function run () {
  7806. if (this.active) {
  7807. var value = this.get();
  7808. if (
  7809. value !== this.value ||
  7810. // Deep watchers and watchers on Object/Arrays should fire even
  7811. // when the value is the same, because the value may
  7812. // have mutated.
  7813. isObject(value) ||
  7814. this.deep
  7815. ) {
  7816. // set new value
  7817. var oldValue = this.value;
  7818. this.value = value;
  7819. if (this.user) {
  7820. try {
  7821. this.cb.call(this.vm, value, oldValue);
  7822. } catch (e) {
  7823. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7824. }
  7825. } else {
  7826. this.cb.call(this.vm, value, oldValue);
  7827. }
  7828. }
  7829. }
  7830. };
  7831. /**
  7832. * Evaluate the value of the watcher.
  7833. * This only gets called for lazy watchers.
  7834. */
  7835. Watcher.prototype.evaluate = function evaluate () {
  7836. this.value = this.get();
  7837. this.dirty = false;
  7838. };
  7839. /**
  7840. * Depend on all deps collected by this watcher.
  7841. */
  7842. Watcher.prototype.depend = function depend () {
  7843. var i = this.deps.length;
  7844. while (i--) {
  7845. this.deps[i].depend();
  7846. }
  7847. };
  7848. /**
  7849. * Remove self from all dependencies' subscriber list.
  7850. */
  7851. Watcher.prototype.teardown = function teardown () {
  7852. if (this.active) {
  7853. // remove self from vm's watcher list
  7854. // this is a somewhat expensive operation so we skip it
  7855. // if the vm is being destroyed.
  7856. if (!this.vm._isBeingDestroyed) {
  7857. remove(this.vm._watchers, this);
  7858. }
  7859. var i = this.deps.length;
  7860. while (i--) {
  7861. this.deps[i].removeSub(this);
  7862. }
  7863. this.active = false;
  7864. }
  7865. };
  7866. /* */
  7867. var sharedPropertyDefinition = {
  7868. enumerable: true,
  7869. configurable: true,
  7870. get: noop,
  7871. set: noop
  7872. };
  7873. function proxy (target, sourceKey, key) {
  7874. sharedPropertyDefinition.get = function proxyGetter () {
  7875. return this[sourceKey][key]
  7876. };
  7877. sharedPropertyDefinition.set = function proxySetter (val) {
  7878. this[sourceKey][key] = val;
  7879. };
  7880. Object.defineProperty(target, key, sharedPropertyDefinition);
  7881. }
  7882. function initState (vm) {
  7883. vm._watchers = [];
  7884. var opts = vm.$options;
  7885. if (opts.props) { initProps(vm, opts.props); }
  7886. if (opts.methods) { initMethods(vm, opts.methods); }
  7887. if (opts.data) {
  7888. initData(vm);
  7889. } else {
  7890. observe(vm._data = {}, true /* asRootData */);
  7891. }
  7892. if (opts.computed) { initComputed(vm, opts.computed); }
  7893. if (opts.watch && opts.watch !== nativeWatch) {
  7894. initWatch(vm, opts.watch);
  7895. }
  7896. }
  7897. function initProps (vm, propsOptions) {
  7898. var propsData = vm.$options.propsData || {};
  7899. var props = vm._props = {};
  7900. // cache prop keys so that future props updates can iterate using Array
  7901. // instead of dynamic object key enumeration.
  7902. var keys = vm.$options._propKeys = [];
  7903. var isRoot = !vm.$parent;
  7904. // root instance props should be converted
  7905. if (!isRoot) {
  7906. toggleObserving(false);
  7907. }
  7908. var loop = function ( key ) {
  7909. keys.push(key);
  7910. var value = validateProp(key, propsOptions, propsData, vm);
  7911. /* istanbul ignore else */
  7912. if (true) {
  7913. var hyphenatedKey = hyphenate(key);
  7914. if (isReservedAttribute(hyphenatedKey) ||
  7915. config.isReservedAttr(hyphenatedKey)) {
  7916. warn(
  7917. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7918. vm
  7919. );
  7920. }
  7921. defineReactive$$1(props, key, value, function () {
  7922. if (!isRoot && !isUpdatingChildComponent) {
  7923. {
  7924. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7925. return
  7926. }
  7927. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7928. if(
  7929. key === 'value' &&
  7930. Array.isArray(vm.$options.behaviors) &&
  7931. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7932. ){
  7933. return
  7934. }
  7935. if(vm._getFormData){
  7936. return
  7937. }
  7938. var $parent = vm.$parent;
  7939. while($parent){
  7940. if($parent.__next_tick_pending){
  7941. return
  7942. }
  7943. $parent = $parent.$parent;
  7944. }
  7945. }
  7946. warn(
  7947. "Avoid mutating a prop directly since the value will be " +
  7948. "overwritten whenever the parent component re-renders. " +
  7949. "Instead, use a data or computed property based on the prop's " +
  7950. "value. Prop being mutated: \"" + key + "\"",
  7951. vm
  7952. );
  7953. }
  7954. });
  7955. } else {}
  7956. // static props are already proxied on the component's prototype
  7957. // during Vue.extend(). We only need to proxy props defined at
  7958. // instantiation here.
  7959. if (!(key in vm)) {
  7960. proxy(vm, "_props", key);
  7961. }
  7962. };
  7963. for (var key in propsOptions) loop( key );
  7964. toggleObserving(true);
  7965. }
  7966. function initData (vm) {
  7967. var data = vm.$options.data;
  7968. data = vm._data = typeof data === 'function'
  7969. ? getData(data, vm)
  7970. : data || {};
  7971. if (!isPlainObject(data)) {
  7972. data = {};
  7973. true && warn(
  7974. 'data functions should return an object:\n' +
  7975. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7976. vm
  7977. );
  7978. }
  7979. // proxy data on instance
  7980. var keys = Object.keys(data);
  7981. var props = vm.$options.props;
  7982. var methods = vm.$options.methods;
  7983. var i = keys.length;
  7984. while (i--) {
  7985. var key = keys[i];
  7986. if (true) {
  7987. if (methods && hasOwn(methods, key)) {
  7988. warn(
  7989. ("Method \"" + key + "\" has already been defined as a data property."),
  7990. vm
  7991. );
  7992. }
  7993. }
  7994. if (props && hasOwn(props, key)) {
  7995. true && warn(
  7996. "The data property \"" + key + "\" is already declared as a prop. " +
  7997. "Use prop default value instead.",
  7998. vm
  7999. );
  8000. } else if (!isReserved(key)) {
  8001. proxy(vm, "_data", key);
  8002. }
  8003. }
  8004. // observe data
  8005. observe(data, true /* asRootData */);
  8006. }
  8007. function getData (data, vm) {
  8008. // #7573 disable dep collection when invoking data getters
  8009. pushTarget();
  8010. try {
  8011. return data.call(vm, vm)
  8012. } catch (e) {
  8013. handleError(e, vm, "data()");
  8014. return {}
  8015. } finally {
  8016. popTarget();
  8017. }
  8018. }
  8019. var computedWatcherOptions = { lazy: true };
  8020. function initComputed (vm, computed) {
  8021. // $flow-disable-line
  8022. var watchers = vm._computedWatchers = Object.create(null);
  8023. // computed properties are just getters during SSR
  8024. var isSSR = isServerRendering();
  8025. for (var key in computed) {
  8026. var userDef = computed[key];
  8027. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8028. if ( true && getter == null) {
  8029. warn(
  8030. ("Getter is missing for computed property \"" + key + "\"."),
  8031. vm
  8032. );
  8033. }
  8034. if (!isSSR) {
  8035. // create internal watcher for the computed property.
  8036. watchers[key] = new Watcher(
  8037. vm,
  8038. getter || noop,
  8039. noop,
  8040. computedWatcherOptions
  8041. );
  8042. }
  8043. // component-defined computed properties are already defined on the
  8044. // component prototype. We only need to define computed properties defined
  8045. // at instantiation here.
  8046. if (!(key in vm)) {
  8047. defineComputed(vm, key, userDef);
  8048. } else if (true) {
  8049. if (key in vm.$data) {
  8050. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8051. } else if (vm.$options.props && key in vm.$options.props) {
  8052. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8053. }
  8054. }
  8055. }
  8056. }
  8057. function defineComputed (
  8058. target,
  8059. key,
  8060. userDef
  8061. ) {
  8062. var shouldCache = !isServerRendering();
  8063. if (typeof userDef === 'function') {
  8064. sharedPropertyDefinition.get = shouldCache
  8065. ? createComputedGetter(key)
  8066. : createGetterInvoker(userDef);
  8067. sharedPropertyDefinition.set = noop;
  8068. } else {
  8069. sharedPropertyDefinition.get = userDef.get
  8070. ? shouldCache && userDef.cache !== false
  8071. ? createComputedGetter(key)
  8072. : createGetterInvoker(userDef.get)
  8073. : noop;
  8074. sharedPropertyDefinition.set = userDef.set || noop;
  8075. }
  8076. if ( true &&
  8077. sharedPropertyDefinition.set === noop) {
  8078. sharedPropertyDefinition.set = function () {
  8079. warn(
  8080. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8081. this
  8082. );
  8083. };
  8084. }
  8085. Object.defineProperty(target, key, sharedPropertyDefinition);
  8086. }
  8087. function createComputedGetter (key) {
  8088. return function computedGetter () {
  8089. var watcher = this._computedWatchers && this._computedWatchers[key];
  8090. if (watcher) {
  8091. if (watcher.dirty) {
  8092. watcher.evaluate();
  8093. }
  8094. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8095. watcher.depend();
  8096. }
  8097. return watcher.value
  8098. }
  8099. }
  8100. }
  8101. function createGetterInvoker(fn) {
  8102. return function computedGetter () {
  8103. return fn.call(this, this)
  8104. }
  8105. }
  8106. function initMethods (vm, methods) {
  8107. var props = vm.$options.props;
  8108. for (var key in methods) {
  8109. if (true) {
  8110. if (typeof methods[key] !== 'function') {
  8111. warn(
  8112. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8113. "Did you reference the function correctly?",
  8114. vm
  8115. );
  8116. }
  8117. if (props && hasOwn(props, key)) {
  8118. warn(
  8119. ("Method \"" + key + "\" has already been defined as a prop."),
  8120. vm
  8121. );
  8122. }
  8123. if ((key in vm) && isReserved(key)) {
  8124. warn(
  8125. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8126. "Avoid defining component methods that start with _ or $."
  8127. );
  8128. }
  8129. }
  8130. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8131. }
  8132. }
  8133. function initWatch (vm, watch) {
  8134. for (var key in watch) {
  8135. var handler = watch[key];
  8136. if (Array.isArray(handler)) {
  8137. for (var i = 0; i < handler.length; i++) {
  8138. createWatcher(vm, key, handler[i]);
  8139. }
  8140. } else {
  8141. createWatcher(vm, key, handler);
  8142. }
  8143. }
  8144. }
  8145. function createWatcher (
  8146. vm,
  8147. expOrFn,
  8148. handler,
  8149. options
  8150. ) {
  8151. if (isPlainObject(handler)) {
  8152. options = handler;
  8153. handler = handler.handler;
  8154. }
  8155. if (typeof handler === 'string') {
  8156. handler = vm[handler];
  8157. }
  8158. return vm.$watch(expOrFn, handler, options)
  8159. }
  8160. function stateMixin (Vue) {
  8161. // flow somehow has problems with directly declared definition object
  8162. // when using Object.defineProperty, so we have to procedurally build up
  8163. // the object here.
  8164. var dataDef = {};
  8165. dataDef.get = function () { return this._data };
  8166. var propsDef = {};
  8167. propsDef.get = function () { return this._props };
  8168. if (true) {
  8169. dataDef.set = function () {
  8170. warn(
  8171. 'Avoid replacing instance root $data. ' +
  8172. 'Use nested data properties instead.',
  8173. this
  8174. );
  8175. };
  8176. propsDef.set = function () {
  8177. warn("$props is readonly.", this);
  8178. };
  8179. }
  8180. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8181. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8182. Vue.prototype.$set = set;
  8183. Vue.prototype.$delete = del;
  8184. Vue.prototype.$watch = function (
  8185. expOrFn,
  8186. cb,
  8187. options
  8188. ) {
  8189. var vm = this;
  8190. if (isPlainObject(cb)) {
  8191. return createWatcher(vm, expOrFn, cb, options)
  8192. }
  8193. options = options || {};
  8194. options.user = true;
  8195. var watcher = new Watcher(vm, expOrFn, cb, options);
  8196. if (options.immediate) {
  8197. try {
  8198. cb.call(vm, watcher.value);
  8199. } catch (error) {
  8200. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8201. }
  8202. }
  8203. return function unwatchFn () {
  8204. watcher.teardown();
  8205. }
  8206. };
  8207. }
  8208. /* */
  8209. var uid$3 = 0;
  8210. function initMixin (Vue) {
  8211. Vue.prototype._init = function (options) {
  8212. var vm = this;
  8213. // a uid
  8214. vm._uid = uid$3++;
  8215. var startTag, endTag;
  8216. /* istanbul ignore if */
  8217. if ( true && config.performance && mark) {
  8218. startTag = "vue-perf-start:" + (vm._uid);
  8219. endTag = "vue-perf-end:" + (vm._uid);
  8220. mark(startTag);
  8221. }
  8222. // a flag to avoid this being observed
  8223. vm._isVue = true;
  8224. // merge options
  8225. if (options && options._isComponent) {
  8226. // optimize internal component instantiation
  8227. // since dynamic options merging is pretty slow, and none of the
  8228. // internal component options needs special treatment.
  8229. initInternalComponent(vm, options);
  8230. } else {
  8231. vm.$options = mergeOptions(
  8232. resolveConstructorOptions(vm.constructor),
  8233. options || {},
  8234. vm
  8235. );
  8236. }
  8237. /* istanbul ignore else */
  8238. if (true) {
  8239. initProxy(vm);
  8240. } else {}
  8241. // expose real self
  8242. vm._self = vm;
  8243. initLifecycle(vm);
  8244. initEvents(vm);
  8245. initRender(vm);
  8246. callHook(vm, 'beforeCreate');
  8247. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8248. initState(vm);
  8249. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8250. !vm._$fallback && callHook(vm, 'created');
  8251. /* istanbul ignore if */
  8252. if ( true && config.performance && mark) {
  8253. vm._name = formatComponentName(vm, false);
  8254. mark(endTag);
  8255. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8256. }
  8257. if (vm.$options.el) {
  8258. vm.$mount(vm.$options.el);
  8259. }
  8260. };
  8261. }
  8262. function initInternalComponent (vm, options) {
  8263. var opts = vm.$options = Object.create(vm.constructor.options);
  8264. // doing this because it's faster than dynamic enumeration.
  8265. var parentVnode = options._parentVnode;
  8266. opts.parent = options.parent;
  8267. opts._parentVnode = parentVnode;
  8268. var vnodeComponentOptions = parentVnode.componentOptions;
  8269. opts.propsData = vnodeComponentOptions.propsData;
  8270. opts._parentListeners = vnodeComponentOptions.listeners;
  8271. opts._renderChildren = vnodeComponentOptions.children;
  8272. opts._componentTag = vnodeComponentOptions.tag;
  8273. if (options.render) {
  8274. opts.render = options.render;
  8275. opts.staticRenderFns = options.staticRenderFns;
  8276. }
  8277. }
  8278. function resolveConstructorOptions (Ctor) {
  8279. var options = Ctor.options;
  8280. if (Ctor.super) {
  8281. var superOptions = resolveConstructorOptions(Ctor.super);
  8282. var cachedSuperOptions = Ctor.superOptions;
  8283. if (superOptions !== cachedSuperOptions) {
  8284. // super option changed,
  8285. // need to resolve new options.
  8286. Ctor.superOptions = superOptions;
  8287. // check if there are any late-modified/attached options (#4976)
  8288. var modifiedOptions = resolveModifiedOptions(Ctor);
  8289. // update base extend options
  8290. if (modifiedOptions) {
  8291. extend(Ctor.extendOptions, modifiedOptions);
  8292. }
  8293. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8294. if (options.name) {
  8295. options.components[options.name] = Ctor;
  8296. }
  8297. }
  8298. }
  8299. return options
  8300. }
  8301. function resolveModifiedOptions (Ctor) {
  8302. var modified;
  8303. var latest = Ctor.options;
  8304. var sealed = Ctor.sealedOptions;
  8305. for (var key in latest) {
  8306. if (latest[key] !== sealed[key]) {
  8307. if (!modified) { modified = {}; }
  8308. modified[key] = latest[key];
  8309. }
  8310. }
  8311. return modified
  8312. }
  8313. function Vue (options) {
  8314. if ( true &&
  8315. !(this instanceof Vue)
  8316. ) {
  8317. warn('Vue is a constructor and should be called with the `new` keyword');
  8318. }
  8319. this._init(options);
  8320. }
  8321. initMixin(Vue);
  8322. stateMixin(Vue);
  8323. eventsMixin(Vue);
  8324. lifecycleMixin(Vue);
  8325. renderMixin(Vue);
  8326. /* */
  8327. function initUse (Vue) {
  8328. Vue.use = function (plugin) {
  8329. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8330. if (installedPlugins.indexOf(plugin) > -1) {
  8331. return this
  8332. }
  8333. // additional parameters
  8334. var args = toArray(arguments, 1);
  8335. args.unshift(this);
  8336. if (typeof plugin.install === 'function') {
  8337. plugin.install.apply(plugin, args);
  8338. } else if (typeof plugin === 'function') {
  8339. plugin.apply(null, args);
  8340. }
  8341. installedPlugins.push(plugin);
  8342. return this
  8343. };
  8344. }
  8345. /* */
  8346. function initMixin$1 (Vue) {
  8347. Vue.mixin = function (mixin) {
  8348. this.options = mergeOptions(this.options, mixin);
  8349. return this
  8350. };
  8351. }
  8352. /* */
  8353. function initExtend (Vue) {
  8354. /**
  8355. * Each instance constructor, including Vue, has a unique
  8356. * cid. This enables us to create wrapped "child
  8357. * constructors" for prototypal inheritance and cache them.
  8358. */
  8359. Vue.cid = 0;
  8360. var cid = 1;
  8361. /**
  8362. * Class inheritance
  8363. */
  8364. Vue.extend = function (extendOptions) {
  8365. extendOptions = extendOptions || {};
  8366. var Super = this;
  8367. var SuperId = Super.cid;
  8368. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8369. if (cachedCtors[SuperId]) {
  8370. return cachedCtors[SuperId]
  8371. }
  8372. var name = extendOptions.name || Super.options.name;
  8373. if ( true && name) {
  8374. validateComponentName(name);
  8375. }
  8376. var Sub = function VueComponent (options) {
  8377. this._init(options);
  8378. };
  8379. Sub.prototype = Object.create(Super.prototype);
  8380. Sub.prototype.constructor = Sub;
  8381. Sub.cid = cid++;
  8382. Sub.options = mergeOptions(
  8383. Super.options,
  8384. extendOptions
  8385. );
  8386. Sub['super'] = Super;
  8387. // For props and computed properties, we define the proxy getters on
  8388. // the Vue instances at extension time, on the extended prototype. This
  8389. // avoids Object.defineProperty calls for each instance created.
  8390. if (Sub.options.props) {
  8391. initProps$1(Sub);
  8392. }
  8393. if (Sub.options.computed) {
  8394. initComputed$1(Sub);
  8395. }
  8396. // allow further extension/mixin/plugin usage
  8397. Sub.extend = Super.extend;
  8398. Sub.mixin = Super.mixin;
  8399. Sub.use = Super.use;
  8400. // create asset registers, so extended classes
  8401. // can have their private assets too.
  8402. ASSET_TYPES.forEach(function (type) {
  8403. Sub[type] = Super[type];
  8404. });
  8405. // enable recursive self-lookup
  8406. if (name) {
  8407. Sub.options.components[name] = Sub;
  8408. }
  8409. // keep a reference to the super options at extension time.
  8410. // later at instantiation we can check if Super's options have
  8411. // been updated.
  8412. Sub.superOptions = Super.options;
  8413. Sub.extendOptions = extendOptions;
  8414. Sub.sealedOptions = extend({}, Sub.options);
  8415. // cache constructor
  8416. cachedCtors[SuperId] = Sub;
  8417. return Sub
  8418. };
  8419. }
  8420. function initProps$1 (Comp) {
  8421. var props = Comp.options.props;
  8422. for (var key in props) {
  8423. proxy(Comp.prototype, "_props", key);
  8424. }
  8425. }
  8426. function initComputed$1 (Comp) {
  8427. var computed = Comp.options.computed;
  8428. for (var key in computed) {
  8429. defineComputed(Comp.prototype, key, computed[key]);
  8430. }
  8431. }
  8432. /* */
  8433. function initAssetRegisters (Vue) {
  8434. /**
  8435. * Create asset registration methods.
  8436. */
  8437. ASSET_TYPES.forEach(function (type) {
  8438. Vue[type] = function (
  8439. id,
  8440. definition
  8441. ) {
  8442. if (!definition) {
  8443. return this.options[type + 's'][id]
  8444. } else {
  8445. /* istanbul ignore if */
  8446. if ( true && type === 'component') {
  8447. validateComponentName(id);
  8448. }
  8449. if (type === 'component' && isPlainObject(definition)) {
  8450. definition.name = definition.name || id;
  8451. definition = this.options._base.extend(definition);
  8452. }
  8453. if (type === 'directive' && typeof definition === 'function') {
  8454. definition = { bind: definition, update: definition };
  8455. }
  8456. this.options[type + 's'][id] = definition;
  8457. return definition
  8458. }
  8459. };
  8460. });
  8461. }
  8462. /* */
  8463. function getComponentName (opts) {
  8464. return opts && (opts.Ctor.options.name || opts.tag)
  8465. }
  8466. function matches (pattern, name) {
  8467. if (Array.isArray(pattern)) {
  8468. return pattern.indexOf(name) > -1
  8469. } else if (typeof pattern === 'string') {
  8470. return pattern.split(',').indexOf(name) > -1
  8471. } else if (isRegExp(pattern)) {
  8472. return pattern.test(name)
  8473. }
  8474. /* istanbul ignore next */
  8475. return false
  8476. }
  8477. function pruneCache (keepAliveInstance, filter) {
  8478. var cache = keepAliveInstance.cache;
  8479. var keys = keepAliveInstance.keys;
  8480. var _vnode = keepAliveInstance._vnode;
  8481. for (var key in cache) {
  8482. var cachedNode = cache[key];
  8483. if (cachedNode) {
  8484. var name = getComponentName(cachedNode.componentOptions);
  8485. if (name && !filter(name)) {
  8486. pruneCacheEntry(cache, key, keys, _vnode);
  8487. }
  8488. }
  8489. }
  8490. }
  8491. function pruneCacheEntry (
  8492. cache,
  8493. key,
  8494. keys,
  8495. current
  8496. ) {
  8497. var cached$$1 = cache[key];
  8498. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8499. cached$$1.componentInstance.$destroy();
  8500. }
  8501. cache[key] = null;
  8502. remove(keys, key);
  8503. }
  8504. var patternTypes = [String, RegExp, Array];
  8505. var KeepAlive = {
  8506. name: 'keep-alive',
  8507. abstract: true,
  8508. props: {
  8509. include: patternTypes,
  8510. exclude: patternTypes,
  8511. max: [String, Number]
  8512. },
  8513. created: function created () {
  8514. this.cache = Object.create(null);
  8515. this.keys = [];
  8516. },
  8517. destroyed: function destroyed () {
  8518. for (var key in this.cache) {
  8519. pruneCacheEntry(this.cache, key, this.keys);
  8520. }
  8521. },
  8522. mounted: function mounted () {
  8523. var this$1 = this;
  8524. this.$watch('include', function (val) {
  8525. pruneCache(this$1, function (name) { return matches(val, name); });
  8526. });
  8527. this.$watch('exclude', function (val) {
  8528. pruneCache(this$1, function (name) { return !matches(val, name); });
  8529. });
  8530. },
  8531. render: function render () {
  8532. var slot = this.$slots.default;
  8533. var vnode = getFirstComponentChild(slot);
  8534. var componentOptions = vnode && vnode.componentOptions;
  8535. if (componentOptions) {
  8536. // check pattern
  8537. var name = getComponentName(componentOptions);
  8538. var ref = this;
  8539. var include = ref.include;
  8540. var exclude = ref.exclude;
  8541. if (
  8542. // not included
  8543. (include && (!name || !matches(include, name))) ||
  8544. // excluded
  8545. (exclude && name && matches(exclude, name))
  8546. ) {
  8547. return vnode
  8548. }
  8549. var ref$1 = this;
  8550. var cache = ref$1.cache;
  8551. var keys = ref$1.keys;
  8552. var key = vnode.key == null
  8553. // same constructor may get registered as different local components
  8554. // so cid alone is not enough (#3269)
  8555. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8556. : vnode.key;
  8557. if (cache[key]) {
  8558. vnode.componentInstance = cache[key].componentInstance;
  8559. // make current key freshest
  8560. remove(keys, key);
  8561. keys.push(key);
  8562. } else {
  8563. cache[key] = vnode;
  8564. keys.push(key);
  8565. // prune oldest entry
  8566. if (this.max && keys.length > parseInt(this.max)) {
  8567. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8568. }
  8569. }
  8570. vnode.data.keepAlive = true;
  8571. }
  8572. return vnode || (slot && slot[0])
  8573. }
  8574. };
  8575. var builtInComponents = {
  8576. KeepAlive: KeepAlive
  8577. };
  8578. /* */
  8579. function initGlobalAPI (Vue) {
  8580. // config
  8581. var configDef = {};
  8582. configDef.get = function () { return config; };
  8583. if (true) {
  8584. configDef.set = function () {
  8585. warn(
  8586. 'Do not replace the Vue.config object, set individual fields instead.'
  8587. );
  8588. };
  8589. }
  8590. Object.defineProperty(Vue, 'config', configDef);
  8591. // exposed util methods.
  8592. // NOTE: these are not considered part of the public API - avoid relying on
  8593. // them unless you are aware of the risk.
  8594. Vue.util = {
  8595. warn: warn,
  8596. extend: extend,
  8597. mergeOptions: mergeOptions,
  8598. defineReactive: defineReactive$$1
  8599. };
  8600. Vue.set = set;
  8601. Vue.delete = del;
  8602. Vue.nextTick = nextTick;
  8603. // 2.6 explicit observable API
  8604. Vue.observable = function (obj) {
  8605. observe(obj);
  8606. return obj
  8607. };
  8608. Vue.options = Object.create(null);
  8609. ASSET_TYPES.forEach(function (type) {
  8610. Vue.options[type + 's'] = Object.create(null);
  8611. });
  8612. // this is used to identify the "base" constructor to extend all plain-object
  8613. // components with in Weex's multi-instance scenarios.
  8614. Vue.options._base = Vue;
  8615. extend(Vue.options.components, builtInComponents);
  8616. initUse(Vue);
  8617. initMixin$1(Vue);
  8618. initExtend(Vue);
  8619. initAssetRegisters(Vue);
  8620. }
  8621. initGlobalAPI(Vue);
  8622. Object.defineProperty(Vue.prototype, '$isServer', {
  8623. get: isServerRendering
  8624. });
  8625. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8626. get: function get () {
  8627. /* istanbul ignore next */
  8628. return this.$vnode && this.$vnode.ssrContext
  8629. }
  8630. });
  8631. // expose FunctionalRenderContext for ssr runtime helper installation
  8632. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8633. value: FunctionalRenderContext
  8634. });
  8635. Vue.version = '2.6.11';
  8636. /**
  8637. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8638. */
  8639. var ARRAYTYPE = '[object Array]';
  8640. var OBJECTTYPE = '[object Object]';
  8641. var NULLTYPE = '[object Null]';
  8642. var UNDEFINEDTYPE = '[object Undefined]';
  8643. // const FUNCTIONTYPE = '[object Function]'
  8644. function diff(current, pre) {
  8645. var result = {};
  8646. syncKeys(current, pre);
  8647. _diff(current, pre, '', result);
  8648. return result
  8649. }
  8650. function syncKeys(current, pre) {
  8651. if (current === pre) { return }
  8652. var rootCurrentType = type(current);
  8653. var rootPreType = type(pre);
  8654. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8655. if(Object.keys(current).length >= Object.keys(pre).length){
  8656. for (var key in pre) {
  8657. var currentValue = current[key];
  8658. if (currentValue === undefined) {
  8659. current[key] = null;
  8660. } else {
  8661. syncKeys(currentValue, pre[key]);
  8662. }
  8663. }
  8664. }
  8665. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8666. if (current.length >= pre.length) {
  8667. pre.forEach(function (item, index) {
  8668. syncKeys(current[index], item);
  8669. });
  8670. }
  8671. }
  8672. }
  8673. function nullOrUndefined(currentType, preType) {
  8674. if(
  8675. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8676. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8677. ) {
  8678. return false
  8679. }
  8680. return true
  8681. }
  8682. function _diff(current, pre, path, result) {
  8683. if (current === pre) { return }
  8684. var rootCurrentType = type(current);
  8685. var rootPreType = type(pre);
  8686. if (rootCurrentType == OBJECTTYPE) {
  8687. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8688. setResult(result, path, current);
  8689. } else {
  8690. var loop = function ( key ) {
  8691. var currentValue = current[key];
  8692. var preValue = pre[key];
  8693. var currentType = type(currentValue);
  8694. var preType = type(preValue);
  8695. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8696. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8697. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8698. }
  8699. } else if (currentType == ARRAYTYPE) {
  8700. if (preType != ARRAYTYPE) {
  8701. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8702. } else {
  8703. if (currentValue.length < preValue.length) {
  8704. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8705. } else {
  8706. currentValue.forEach(function (item, index) {
  8707. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8708. });
  8709. }
  8710. }
  8711. } else if (currentType == OBJECTTYPE) {
  8712. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8713. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8714. } else {
  8715. for (var subKey in currentValue) {
  8716. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8717. }
  8718. }
  8719. }
  8720. };
  8721. for (var key in current) loop( key );
  8722. }
  8723. } else if (rootCurrentType == ARRAYTYPE) {
  8724. if (rootPreType != ARRAYTYPE) {
  8725. setResult(result, path, current);
  8726. } else {
  8727. if (current.length < pre.length) {
  8728. setResult(result, path, current);
  8729. } else {
  8730. current.forEach(function (item, index) {
  8731. _diff(item, pre[index], path + '[' + index + ']', result);
  8732. });
  8733. }
  8734. }
  8735. } else {
  8736. setResult(result, path, current);
  8737. }
  8738. }
  8739. function setResult(result, k, v) {
  8740. // if (type(v) != FUNCTIONTYPE) {
  8741. result[k] = v;
  8742. // }
  8743. }
  8744. function type(obj) {
  8745. return Object.prototype.toString.call(obj)
  8746. }
  8747. /* */
  8748. function flushCallbacks$1(vm) {
  8749. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8750. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8751. var mpInstance = vm.$scope;
  8752. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8753. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8754. }
  8755. var copies = vm.__next_tick_callbacks.slice(0);
  8756. vm.__next_tick_callbacks.length = 0;
  8757. for (var i = 0; i < copies.length; i++) {
  8758. copies[i]();
  8759. }
  8760. }
  8761. }
  8762. function hasRenderWatcher(vm) {
  8763. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8764. }
  8765. function nextTick$1(vm, cb) {
  8766. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8767. //2.nextTick 之前存在 render watcher
  8768. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8769. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8770. var mpInstance = vm.$scope;
  8771. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8772. ']:nextVueTick');
  8773. }
  8774. return nextTick(cb, vm)
  8775. }else{
  8776. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8777. var mpInstance$1 = vm.$scope;
  8778. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8779. ']:nextMPTick');
  8780. }
  8781. }
  8782. var _resolve;
  8783. if (!vm.__next_tick_callbacks) {
  8784. vm.__next_tick_callbacks = [];
  8785. }
  8786. vm.__next_tick_callbacks.push(function () {
  8787. if (cb) {
  8788. try {
  8789. cb.call(vm);
  8790. } catch (e) {
  8791. handleError(e, vm, 'nextTick');
  8792. }
  8793. } else if (_resolve) {
  8794. _resolve(vm);
  8795. }
  8796. });
  8797. // $flow-disable-line
  8798. if (!cb && typeof Promise !== 'undefined') {
  8799. return new Promise(function (resolve) {
  8800. _resolve = resolve;
  8801. })
  8802. }
  8803. }
  8804. /* */
  8805. function clearInstance(key, value) {
  8806. // 简易去除 Vue 和小程序组件实例
  8807. if (value) {
  8808. if (value._isVue || value.__v_isMPComponent) {
  8809. return {}
  8810. }
  8811. }
  8812. return value
  8813. }
  8814. function cloneWithData(vm) {
  8815. // 确保当前 vm 所有数据被同步
  8816. var ret = Object.create(null);
  8817. var dataKeys = [].concat(
  8818. Object.keys(vm._data || {}),
  8819. Object.keys(vm._computedWatchers || {}));
  8820. dataKeys.reduce(function(ret, key) {
  8821. ret[key] = vm[key];
  8822. return ret
  8823. }, ret);
  8824. // vue-composition-api
  8825. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8826. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8827. if (rawBindings) {
  8828. Object.keys(rawBindings).forEach(function (key) {
  8829. ret[key] = vm[key];
  8830. });
  8831. }
  8832. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8833. Object.assign(ret, vm.$mp.data || {});
  8834. if (
  8835. Array.isArray(vm.$options.behaviors) &&
  8836. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8837. ) { //form-field
  8838. ret['name'] = vm.name;
  8839. ret['value'] = vm.value;
  8840. }
  8841. return JSON.parse(JSON.stringify(ret, clearInstance))
  8842. }
  8843. var patch = function(oldVnode, vnode) {
  8844. var this$1 = this;
  8845. if (vnode === null) { //destroy
  8846. return
  8847. }
  8848. if (this.mpType === 'page' || this.mpType === 'component') {
  8849. var mpInstance = this.$scope;
  8850. var data = Object.create(null);
  8851. try {
  8852. data = cloneWithData(this);
  8853. } catch (err) {
  8854. console.error(err);
  8855. }
  8856. data.__webviewId__ = mpInstance.data.__webviewId__;
  8857. var mpData = Object.create(null);
  8858. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8859. mpData[key] = mpInstance.data[key];
  8860. });
  8861. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8862. if (Object.keys(diffData).length) {
  8863. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8864. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8865. ']差量更新',
  8866. JSON.stringify(diffData));
  8867. }
  8868. this.__next_tick_pending = true;
  8869. mpInstance.setData(diffData, function () {
  8870. this$1.__next_tick_pending = false;
  8871. flushCallbacks$1(this$1);
  8872. });
  8873. } else {
  8874. flushCallbacks$1(this);
  8875. }
  8876. }
  8877. };
  8878. /* */
  8879. function createEmptyRender() {
  8880. }
  8881. function mountComponent$1(
  8882. vm,
  8883. el,
  8884. hydrating
  8885. ) {
  8886. if (!vm.mpType) {//main.js 中的 new Vue
  8887. return vm
  8888. }
  8889. if (vm.mpType === 'app') {
  8890. vm.$options.render = createEmptyRender;
  8891. }
  8892. if (!vm.$options.render) {
  8893. vm.$options.render = createEmptyRender;
  8894. if (true) {
  8895. /* istanbul ignore if */
  8896. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8897. vm.$options.el || el) {
  8898. warn(
  8899. 'You are using the runtime-only build of Vue where the template ' +
  8900. 'compiler is not available. Either pre-compile the templates into ' +
  8901. 'render functions, or use the compiler-included build.',
  8902. vm
  8903. );
  8904. } else {
  8905. warn(
  8906. 'Failed to mount component: template or render function not defined.',
  8907. vm
  8908. );
  8909. }
  8910. }
  8911. }
  8912. !vm._$fallback && callHook(vm, 'beforeMount');
  8913. var updateComponent = function () {
  8914. vm._update(vm._render(), hydrating);
  8915. };
  8916. // we set this to vm._watcher inside the watcher's constructor
  8917. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8918. // component's mounted hook), which relies on vm._watcher being already defined
  8919. new Watcher(vm, updateComponent, noop, {
  8920. before: function before() {
  8921. if (vm._isMounted && !vm._isDestroyed) {
  8922. callHook(vm, 'beforeUpdate');
  8923. }
  8924. }
  8925. }, true /* isRenderWatcher */);
  8926. hydrating = false;
  8927. return vm
  8928. }
  8929. /* */
  8930. function renderClass (
  8931. staticClass,
  8932. dynamicClass
  8933. ) {
  8934. if (isDef(staticClass) || isDef(dynamicClass)) {
  8935. return concat(staticClass, stringifyClass(dynamicClass))
  8936. }
  8937. /* istanbul ignore next */
  8938. return ''
  8939. }
  8940. function concat (a, b) {
  8941. return a ? b ? (a + ' ' + b) : a : (b || '')
  8942. }
  8943. function stringifyClass (value) {
  8944. if (Array.isArray(value)) {
  8945. return stringifyArray(value)
  8946. }
  8947. if (isObject(value)) {
  8948. return stringifyObject(value)
  8949. }
  8950. if (typeof value === 'string') {
  8951. return value
  8952. }
  8953. /* istanbul ignore next */
  8954. return ''
  8955. }
  8956. function stringifyArray (value) {
  8957. var res = '';
  8958. var stringified;
  8959. for (var i = 0, l = value.length; i < l; i++) {
  8960. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8961. if (res) { res += ' '; }
  8962. res += stringified;
  8963. }
  8964. }
  8965. return res
  8966. }
  8967. function stringifyObject (value) {
  8968. var res = '';
  8969. for (var key in value) {
  8970. if (value[key]) {
  8971. if (res) { res += ' '; }
  8972. res += key;
  8973. }
  8974. }
  8975. return res
  8976. }
  8977. /* */
  8978. var parseStyleText = cached(function (cssText) {
  8979. var res = {};
  8980. var listDelimiter = /;(?![^(]*\))/g;
  8981. var propertyDelimiter = /:(.+)/;
  8982. cssText.split(listDelimiter).forEach(function (item) {
  8983. if (item) {
  8984. var tmp = item.split(propertyDelimiter);
  8985. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8986. }
  8987. });
  8988. return res
  8989. });
  8990. // normalize possible array / string values into Object
  8991. function normalizeStyleBinding (bindingStyle) {
  8992. if (Array.isArray(bindingStyle)) {
  8993. return toObject(bindingStyle)
  8994. }
  8995. if (typeof bindingStyle === 'string') {
  8996. return parseStyleText(bindingStyle)
  8997. }
  8998. return bindingStyle
  8999. }
  9000. /* */
  9001. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9002. function getTarget(obj, path) {
  9003. var parts = path.split('.');
  9004. var key = parts[0];
  9005. if (key.indexOf('__$n') === 0) { //number index
  9006. key = parseInt(key.replace('__$n', ''));
  9007. }
  9008. if (parts.length === 1) {
  9009. return obj[key]
  9010. }
  9011. return getTarget(obj[key], parts.slice(1).join('.'))
  9012. }
  9013. function internalMixin(Vue) {
  9014. Vue.config.errorHandler = function(err, vm, info) {
  9015. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9016. console.error(err);
  9017. /* eslint-disable no-undef */
  9018. var app = typeof getApp === 'function' && getApp();
  9019. if (app && app.onError) {
  9020. app.onError(err);
  9021. }
  9022. };
  9023. var oldEmit = Vue.prototype.$emit;
  9024. Vue.prototype.$emit = function(event) {
  9025. if (this.$scope && event) {
  9026. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9027. if (triggerEvent) {
  9028. try {
  9029. triggerEvent.call(this.$scope, event, {
  9030. __args__: toArray(arguments, 1)
  9031. });
  9032. } catch (error) {
  9033. }
  9034. }
  9035. }
  9036. return oldEmit.apply(this, arguments)
  9037. };
  9038. Vue.prototype.$nextTick = function(fn) {
  9039. return nextTick$1(this, fn)
  9040. };
  9041. MP_METHODS.forEach(function (method) {
  9042. Vue.prototype[method] = function(args) {
  9043. if (this.$scope && this.$scope[method]) {
  9044. return this.$scope[method](args)
  9045. }
  9046. // mp-alipay
  9047. if (typeof my === 'undefined') {
  9048. return
  9049. }
  9050. if (method === 'createSelectorQuery') {
  9051. /* eslint-disable no-undef */
  9052. return my.createSelectorQuery(args)
  9053. } else if (method === 'createIntersectionObserver') {
  9054. /* eslint-disable no-undef */
  9055. return my.createIntersectionObserver(args)
  9056. }
  9057. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9058. };
  9059. });
  9060. Vue.prototype.__init_provide = initProvide;
  9061. Vue.prototype.__init_injections = initInjections;
  9062. Vue.prototype.__call_hook = function(hook, args) {
  9063. var vm = this;
  9064. // #7573 disable dep collection when invoking lifecycle hooks
  9065. pushTarget();
  9066. var handlers = vm.$options[hook];
  9067. var info = hook + " hook";
  9068. var ret;
  9069. if (handlers) {
  9070. for (var i = 0, j = handlers.length; i < j; i++) {
  9071. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9072. }
  9073. }
  9074. if (vm._hasHookEvent) {
  9075. vm.$emit('hook:' + hook, args);
  9076. }
  9077. popTarget();
  9078. return ret
  9079. };
  9080. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9081. if (Array.isArray(modifiers)) {
  9082. if (modifiers.indexOf('trim') !== -1) {
  9083. value = value.trim();
  9084. }
  9085. if (modifiers.indexOf('number') !== -1) {
  9086. value = this._n(value);
  9087. }
  9088. }
  9089. if (!target) {
  9090. target = this;
  9091. }
  9092. // 解决动态属性添加
  9093. Vue.set(target, key, value);
  9094. };
  9095. Vue.prototype.__set_sync = function(target, key, value) {
  9096. if (!target) {
  9097. target = this;
  9098. }
  9099. // 解决动态属性添加
  9100. Vue.set(target, key, value);
  9101. };
  9102. Vue.prototype.__get_orig = function(item) {
  9103. if (isPlainObject(item)) {
  9104. return item['$orig'] || item
  9105. }
  9106. return item
  9107. };
  9108. Vue.prototype.__get_value = function(dataPath, target) {
  9109. return getTarget(target || this, dataPath)
  9110. };
  9111. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9112. return renderClass(staticClass, dynamicClass)
  9113. };
  9114. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9115. if (!dynamicStyle && !staticStyle) {
  9116. return ''
  9117. }
  9118. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9119. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9120. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9121. };
  9122. Vue.prototype.__map = function(val, iteratee) {
  9123. //TODO 暂不考虑 string
  9124. var ret, i, l, keys, key;
  9125. if (Array.isArray(val)) {
  9126. ret = new Array(val.length);
  9127. for (i = 0, l = val.length; i < l; i++) {
  9128. ret[i] = iteratee(val[i], i);
  9129. }
  9130. return ret
  9131. } else if (isObject(val)) {
  9132. keys = Object.keys(val);
  9133. ret = Object.create(null);
  9134. for (i = 0, l = keys.length; i < l; i++) {
  9135. key = keys[i];
  9136. ret[key] = iteratee(val[key], key, i);
  9137. }
  9138. return ret
  9139. } else if (typeof val === 'number') {
  9140. ret = new Array(val);
  9141. for (i = 0, l = val; i < l; i++) {
  9142. // 第一个参数暂时仍和小程序一致
  9143. ret[i] = iteratee(i, i);
  9144. }
  9145. return ret
  9146. }
  9147. return []
  9148. };
  9149. }
  9150. /* */
  9151. var LIFECYCLE_HOOKS$1 = [
  9152. //App
  9153. 'onLaunch',
  9154. 'onShow',
  9155. 'onHide',
  9156. 'onUniNViewMessage',
  9157. 'onPageNotFound',
  9158. 'onThemeChange',
  9159. 'onError',
  9160. 'onUnhandledRejection',
  9161. //Page
  9162. 'onInit',
  9163. 'onLoad',
  9164. // 'onShow',
  9165. 'onReady',
  9166. // 'onHide',
  9167. 'onUnload',
  9168. 'onPullDownRefresh',
  9169. 'onReachBottom',
  9170. 'onTabItemTap',
  9171. 'onAddToFavorites',
  9172. 'onShareTimeline',
  9173. 'onShareAppMessage',
  9174. 'onResize',
  9175. 'onPageScroll',
  9176. 'onNavigationBarButtonTap',
  9177. 'onBackPress',
  9178. 'onNavigationBarSearchInputChanged',
  9179. 'onNavigationBarSearchInputConfirmed',
  9180. 'onNavigationBarSearchInputClicked',
  9181. 'onUploadDouyinVideo',
  9182. 'onNFCReadMessage',
  9183. //Component
  9184. // 'onReady', // 兼容旧版本,应该移除该事件
  9185. 'onPageShow',
  9186. 'onPageHide',
  9187. 'onPageResize'
  9188. ];
  9189. function lifecycleMixin$1(Vue) {
  9190. //fixed vue-class-component
  9191. var oldExtend = Vue.extend;
  9192. Vue.extend = function(extendOptions) {
  9193. extendOptions = extendOptions || {};
  9194. var methods = extendOptions.methods;
  9195. if (methods) {
  9196. Object.keys(methods).forEach(function (methodName) {
  9197. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9198. extendOptions[methodName] = methods[methodName];
  9199. delete methods[methodName];
  9200. }
  9201. });
  9202. }
  9203. return oldExtend.call(this, extendOptions)
  9204. };
  9205. var strategies = Vue.config.optionMergeStrategies;
  9206. var mergeHook = strategies.created;
  9207. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9208. strategies[hook] = mergeHook;
  9209. });
  9210. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9211. }
  9212. /* */
  9213. // install platform patch function
  9214. Vue.prototype.__patch__ = patch;
  9215. // public mount method
  9216. Vue.prototype.$mount = function(
  9217. el ,
  9218. hydrating
  9219. ) {
  9220. return mountComponent$1(this, el, hydrating)
  9221. };
  9222. lifecycleMixin$1(Vue);
  9223. internalMixin(Vue);
  9224. /* */
  9225. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9226. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9227. /***/ }),
  9228. /***/ 26:
  9229. /*!**********************************************************!*\
  9230. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json ***!
  9231. \**********************************************************/
  9232. /*! no static exports found */
  9233. /***/ (function(module, exports) {
  9234. /***/ }),
  9235. /***/ 269:
  9236. /*!******************************************************************************************************!*\
  9237. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  9238. \******************************************************************************************************/
  9239. /*! no static exports found */
  9240. /***/ (function(module, exports, __webpack_require__) {
  9241. "use strict";
  9242. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9243. Object.defineProperty(exports, "__esModule", {
  9244. value: true
  9245. });
  9246. exports.default = void 0;
  9247. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  9248. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 270));
  9249. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 271));
  9250. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 273));
  9251. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  9252. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9253. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9254. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9255. 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); }; }
  9256. 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; } }
  9257. var pattern = {
  9258. email: /^\S+?@\S+?\.\S+?$/,
  9259. 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]$/,
  9260. 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')
  9261. };
  9262. var FORMAT_MAPPING = {
  9263. "int": 'integer',
  9264. "bool": 'boolean',
  9265. "double": 'number',
  9266. "long": 'number',
  9267. "password": 'string'
  9268. // "fileurls": 'array'
  9269. };
  9270. function formatMessage(args) {
  9271. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  9272. var defaultMessage = ['label'];
  9273. defaultMessage.forEach(function (item) {
  9274. if (args[item] === undefined) {
  9275. args[item] = '';
  9276. }
  9277. });
  9278. var str = resources;
  9279. for (var key in args) {
  9280. var reg = new RegExp('{' + key + '}');
  9281. str = str.replace(reg, args[key]);
  9282. }
  9283. return str;
  9284. }
  9285. function isEmptyValue(value, type) {
  9286. if (value === undefined || value === null) {
  9287. return true;
  9288. }
  9289. if (typeof value === 'string' && !value) {
  9290. return true;
  9291. }
  9292. if (Array.isArray(value) && !value.length) {
  9293. return true;
  9294. }
  9295. if (type === 'object' && !Object.keys(value).length) {
  9296. return true;
  9297. }
  9298. return false;
  9299. }
  9300. var types = {
  9301. integer: function integer(value) {
  9302. return types.number(value) && parseInt(value, 10) === value;
  9303. },
  9304. string: function string(value) {
  9305. return typeof value === 'string';
  9306. },
  9307. number: function number(value) {
  9308. if (isNaN(value)) {
  9309. return false;
  9310. }
  9311. return typeof value === 'number';
  9312. },
  9313. "boolean": function boolean(value) {
  9314. return typeof value === 'boolean';
  9315. },
  9316. "float": function float(value) {
  9317. return types.number(value) && !types.integer(value);
  9318. },
  9319. array: function array(value) {
  9320. return Array.isArray(value);
  9321. },
  9322. object: function object(value) {
  9323. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  9324. },
  9325. date: function date(value) {
  9326. return value instanceof Date;
  9327. },
  9328. timestamp: function timestamp(value) {
  9329. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  9330. return false;
  9331. }
  9332. return true;
  9333. },
  9334. file: function file(value) {
  9335. return typeof value.url === 'string';
  9336. },
  9337. email: function email(value) {
  9338. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  9339. },
  9340. url: function url(value) {
  9341. return typeof value === 'string' && !!value.match(pattern.url);
  9342. },
  9343. pattern: function pattern(reg, value) {
  9344. try {
  9345. return new RegExp(reg).test(value);
  9346. } catch (e) {
  9347. return false;
  9348. }
  9349. },
  9350. method: function method(value) {
  9351. return typeof value === 'function';
  9352. },
  9353. idcard: function idcard(value) {
  9354. return typeof value === 'string' && !!value.match(pattern.idcard);
  9355. },
  9356. 'url-https': function urlHttps(value) {
  9357. return this.url(value) && value.startsWith('https://');
  9358. },
  9359. 'url-scheme': function urlScheme(value) {
  9360. return value.startsWith('://');
  9361. },
  9362. 'url-web': function urlWeb(value) {
  9363. return false;
  9364. }
  9365. };
  9366. var RuleValidator = /*#__PURE__*/function () {
  9367. function RuleValidator(message) {
  9368. (0, _classCallCheck2.default)(this, RuleValidator);
  9369. this._message = message;
  9370. }
  9371. (0, _createClass2.default)(RuleValidator, [{
  9372. key: "validateRule",
  9373. value: function () {
  9374. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  9375. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  9376. return _regenerator.default.wrap(function _callee$(_context) {
  9377. while (1) {
  9378. switch (_context.prev = _context.next) {
  9379. case 0:
  9380. result = null;
  9381. rules = fieldValue.rules;
  9382. hasRequired = rules.findIndex(function (item) {
  9383. return item.required;
  9384. });
  9385. if (!(hasRequired < 0)) {
  9386. _context.next = 8;
  9387. break;
  9388. }
  9389. if (!(value === null || value === undefined)) {
  9390. _context.next = 6;
  9391. break;
  9392. }
  9393. return _context.abrupt("return", result);
  9394. case 6:
  9395. if (!(typeof value === 'string' && !value.length)) {
  9396. _context.next = 8;
  9397. break;
  9398. }
  9399. return _context.abrupt("return", result);
  9400. case 8:
  9401. message = this._message;
  9402. if (!(rules === undefined)) {
  9403. _context.next = 11;
  9404. break;
  9405. }
  9406. return _context.abrupt("return", message['default']);
  9407. case 11:
  9408. i = 0;
  9409. case 12:
  9410. if (!(i < rules.length)) {
  9411. _context.next = 35;
  9412. break;
  9413. }
  9414. rule = rules[i];
  9415. vt = this._getValidateType(rule);
  9416. Object.assign(rule, {
  9417. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  9418. });
  9419. if (!RuleValidatorHelper[vt]) {
  9420. _context.next = 20;
  9421. break;
  9422. }
  9423. result = RuleValidatorHelper[vt](rule, value, message);
  9424. if (!(result != null)) {
  9425. _context.next = 20;
  9426. break;
  9427. }
  9428. return _context.abrupt("break", 35);
  9429. case 20:
  9430. if (!rule.validateExpr) {
  9431. _context.next = 26;
  9432. break;
  9433. }
  9434. now = Date.now();
  9435. resultExpr = rule.validateExpr(value, allData, now);
  9436. if (!(resultExpr === false)) {
  9437. _context.next = 26;
  9438. break;
  9439. }
  9440. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  9441. return _context.abrupt("break", 35);
  9442. case 26:
  9443. if (!rule.validateFunction) {
  9444. _context.next = 32;
  9445. break;
  9446. }
  9447. _context.next = 29;
  9448. return this.validateFunction(rule, value, data, allData, vt);
  9449. case 29:
  9450. result = _context.sent;
  9451. if (!(result !== null)) {
  9452. _context.next = 32;
  9453. break;
  9454. }
  9455. return _context.abrupt("break", 35);
  9456. case 32:
  9457. i++;
  9458. _context.next = 12;
  9459. break;
  9460. case 35:
  9461. if (result !== null) {
  9462. result = message.TAG + result;
  9463. }
  9464. return _context.abrupt("return", result);
  9465. case 37:
  9466. case "end":
  9467. return _context.stop();
  9468. }
  9469. }
  9470. }, _callee, this);
  9471. }));
  9472. function validateRule(_x, _x2, _x3, _x4, _x5) {
  9473. return _validateRule.apply(this, arguments);
  9474. }
  9475. return validateRule;
  9476. }()
  9477. }, {
  9478. key: "validateFunction",
  9479. value: function () {
  9480. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  9481. var result, callbackMessage, res;
  9482. return _regenerator.default.wrap(function _callee2$(_context2) {
  9483. while (1) {
  9484. switch (_context2.prev = _context2.next) {
  9485. case 0:
  9486. result = null;
  9487. _context2.prev = 1;
  9488. callbackMessage = null;
  9489. _context2.next = 5;
  9490. return rule.validateFunction(rule, value, allData || data, function (message) {
  9491. callbackMessage = message;
  9492. });
  9493. case 5:
  9494. res = _context2.sent;
  9495. if (callbackMessage || typeof res === 'string' && res || res === false) {
  9496. result = this._getMessage(rule, callbackMessage || res, vt);
  9497. }
  9498. _context2.next = 12;
  9499. break;
  9500. case 9:
  9501. _context2.prev = 9;
  9502. _context2.t0 = _context2["catch"](1);
  9503. result = this._getMessage(rule, _context2.t0.message, vt);
  9504. case 12:
  9505. return _context2.abrupt("return", result);
  9506. case 13:
  9507. case "end":
  9508. return _context2.stop();
  9509. }
  9510. }
  9511. }, _callee2, this, [[1, 9]]);
  9512. }));
  9513. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  9514. return _validateFunction.apply(this, arguments);
  9515. }
  9516. return validateFunction;
  9517. }()
  9518. }, {
  9519. key: "_getMessage",
  9520. value: function _getMessage(rule, message, vt) {
  9521. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  9522. }
  9523. }, {
  9524. key: "_getValidateType",
  9525. value: function _getValidateType(rule) {
  9526. var result = '';
  9527. if (rule.required) {
  9528. result = 'required';
  9529. } else if (rule.format) {
  9530. result = 'format';
  9531. } else if (rule.arrayType) {
  9532. result = 'arrayTypeFormat';
  9533. } else if (rule.range) {
  9534. result = 'range';
  9535. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  9536. result = 'rangeNumber';
  9537. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  9538. result = 'rangeLength';
  9539. } else if (rule.pattern) {
  9540. result = 'pattern';
  9541. } else if (rule.validateFunction) {
  9542. result = 'validateFunction';
  9543. }
  9544. return result;
  9545. }
  9546. }]);
  9547. return RuleValidator;
  9548. }();
  9549. var RuleValidatorHelper = {
  9550. required: function required(rule, value, message) {
  9551. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  9552. return formatMessage(rule, rule.errorMessage || message.required);
  9553. }
  9554. return null;
  9555. },
  9556. range: function range(rule, value, message) {
  9557. var range = rule.range,
  9558. errorMessage = rule.errorMessage;
  9559. var list = new Array(range.length);
  9560. for (var i = 0; i < range.length; i++) {
  9561. var item = range[i];
  9562. if (types.object(item) && item.value !== undefined) {
  9563. list[i] = item.value;
  9564. } else {
  9565. list[i] = item;
  9566. }
  9567. }
  9568. var result = false;
  9569. if (Array.isArray(value)) {
  9570. result = new Set(value.concat(list)).size === list.length;
  9571. } else {
  9572. if (list.indexOf(value) > -1) {
  9573. result = true;
  9574. }
  9575. }
  9576. if (!result) {
  9577. return formatMessage(rule, errorMessage || message['enum']);
  9578. }
  9579. return null;
  9580. },
  9581. rangeNumber: function rangeNumber(rule, value, message) {
  9582. if (!types.number(value)) {
  9583. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9584. }
  9585. var minimum = rule.minimum,
  9586. maximum = rule.maximum,
  9587. exclusiveMinimum = rule.exclusiveMinimum,
  9588. exclusiveMaximum = rule.exclusiveMaximum;
  9589. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  9590. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  9591. if (minimum !== undefined && min) {
  9592. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  9593. } else if (maximum !== undefined && max) {
  9594. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  9595. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  9596. return formatMessage(rule, rule.errorMessage || message['number'].range);
  9597. }
  9598. return null;
  9599. },
  9600. rangeLength: function rangeLength(rule, value, message) {
  9601. if (!types.string(value) && !types.array(value)) {
  9602. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9603. }
  9604. var min = rule.minLength;
  9605. var max = rule.maxLength;
  9606. var val = value.length;
  9607. if (min !== undefined && val < min) {
  9608. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  9609. } else if (max !== undefined && val > max) {
  9610. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  9611. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  9612. return formatMessage(rule, rule.errorMessage || message['length'].range);
  9613. }
  9614. return null;
  9615. },
  9616. pattern: function pattern(rule, value, message) {
  9617. if (!types['pattern'](rule.pattern, value)) {
  9618. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9619. }
  9620. return null;
  9621. },
  9622. format: function format(rule, value, message) {
  9623. var customTypes = Object.keys(types);
  9624. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  9625. if (customTypes.indexOf(format) > -1) {
  9626. if (!types[format](value)) {
  9627. return formatMessage(rule, rule.errorMessage || message.typeError);
  9628. }
  9629. }
  9630. return null;
  9631. },
  9632. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  9633. if (!Array.isArray(value)) {
  9634. return formatMessage(rule, rule.errorMessage || message.typeError);
  9635. }
  9636. for (var i = 0; i < value.length; i++) {
  9637. var element = value[i];
  9638. var formatResult = this.format(rule, element, message);
  9639. if (formatResult !== null) {
  9640. return formatResult;
  9641. }
  9642. }
  9643. return null;
  9644. }
  9645. };
  9646. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  9647. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  9648. var _super = _createSuper(SchemaValidator);
  9649. function SchemaValidator(schema, options) {
  9650. var _this;
  9651. (0, _classCallCheck2.default)(this, SchemaValidator);
  9652. _this = _super.call(this, SchemaValidator.message);
  9653. _this._schema = schema;
  9654. _this._options = options || null;
  9655. return _this;
  9656. }
  9657. (0, _createClass2.default)(SchemaValidator, [{
  9658. key: "updateSchema",
  9659. value: function updateSchema(schema) {
  9660. this._schema = schema;
  9661. }
  9662. }, {
  9663. key: "validate",
  9664. value: function () {
  9665. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  9666. var result;
  9667. return _regenerator.default.wrap(function _callee3$(_context3) {
  9668. while (1) {
  9669. switch (_context3.prev = _context3.next) {
  9670. case 0:
  9671. result = this._checkFieldInSchema(data);
  9672. if (result) {
  9673. _context3.next = 5;
  9674. break;
  9675. }
  9676. _context3.next = 4;
  9677. return this.invokeValidate(data, false, allData);
  9678. case 4:
  9679. result = _context3.sent;
  9680. case 5:
  9681. return _context3.abrupt("return", result.length ? result[0] : null);
  9682. case 6:
  9683. case "end":
  9684. return _context3.stop();
  9685. }
  9686. }
  9687. }, _callee3, this);
  9688. }));
  9689. function validate(_x11, _x12) {
  9690. return _validate.apply(this, arguments);
  9691. }
  9692. return validate;
  9693. }()
  9694. }, {
  9695. key: "validateAll",
  9696. value: function () {
  9697. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  9698. var result;
  9699. return _regenerator.default.wrap(function _callee4$(_context4) {
  9700. while (1) {
  9701. switch (_context4.prev = _context4.next) {
  9702. case 0:
  9703. result = this._checkFieldInSchema(data);
  9704. if (result) {
  9705. _context4.next = 5;
  9706. break;
  9707. }
  9708. _context4.next = 4;
  9709. return this.invokeValidate(data, true, allData);
  9710. case 4:
  9711. result = _context4.sent;
  9712. case 5:
  9713. return _context4.abrupt("return", result);
  9714. case 6:
  9715. case "end":
  9716. return _context4.stop();
  9717. }
  9718. }
  9719. }, _callee4, this);
  9720. }));
  9721. function validateAll(_x13, _x14) {
  9722. return _validateAll.apply(this, arguments);
  9723. }
  9724. return validateAll;
  9725. }()
  9726. }, {
  9727. key: "validateUpdate",
  9728. value: function () {
  9729. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  9730. var result;
  9731. return _regenerator.default.wrap(function _callee5$(_context5) {
  9732. while (1) {
  9733. switch (_context5.prev = _context5.next) {
  9734. case 0:
  9735. result = this._checkFieldInSchema(data);
  9736. if (result) {
  9737. _context5.next = 5;
  9738. break;
  9739. }
  9740. _context5.next = 4;
  9741. return this.invokeValidateUpdate(data, false, allData);
  9742. case 4:
  9743. result = _context5.sent;
  9744. case 5:
  9745. return _context5.abrupt("return", result.length ? result[0] : null);
  9746. case 6:
  9747. case "end":
  9748. return _context5.stop();
  9749. }
  9750. }
  9751. }, _callee5, this);
  9752. }));
  9753. function validateUpdate(_x15, _x16) {
  9754. return _validateUpdate.apply(this, arguments);
  9755. }
  9756. return validateUpdate;
  9757. }()
  9758. }, {
  9759. key: "invokeValidate",
  9760. value: function () {
  9761. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  9762. var result, schema, key, value, errorMessage;
  9763. return _regenerator.default.wrap(function _callee6$(_context6) {
  9764. while (1) {
  9765. switch (_context6.prev = _context6.next) {
  9766. case 0:
  9767. result = [];
  9768. schema = this._schema;
  9769. _context6.t0 = _regenerator.default.keys(schema);
  9770. case 3:
  9771. if ((_context6.t1 = _context6.t0()).done) {
  9772. _context6.next = 15;
  9773. break;
  9774. }
  9775. key = _context6.t1.value;
  9776. value = schema[key];
  9777. _context6.next = 8;
  9778. return this.validateRule(key, value, data[key], data, allData);
  9779. case 8:
  9780. errorMessage = _context6.sent;
  9781. if (!(errorMessage != null)) {
  9782. _context6.next = 13;
  9783. break;
  9784. }
  9785. result.push({
  9786. key: key,
  9787. errorMessage: errorMessage
  9788. });
  9789. if (all) {
  9790. _context6.next = 13;
  9791. break;
  9792. }
  9793. return _context6.abrupt("break", 15);
  9794. case 13:
  9795. _context6.next = 3;
  9796. break;
  9797. case 15:
  9798. return _context6.abrupt("return", result);
  9799. case 16:
  9800. case "end":
  9801. return _context6.stop();
  9802. }
  9803. }
  9804. }, _callee6, this);
  9805. }));
  9806. function invokeValidate(_x17, _x18, _x19) {
  9807. return _invokeValidate.apply(this, arguments);
  9808. }
  9809. return invokeValidate;
  9810. }()
  9811. }, {
  9812. key: "invokeValidateUpdate",
  9813. value: function () {
  9814. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  9815. var result, key, errorMessage;
  9816. return _regenerator.default.wrap(function _callee7$(_context7) {
  9817. while (1) {
  9818. switch (_context7.prev = _context7.next) {
  9819. case 0:
  9820. result = [];
  9821. _context7.t0 = _regenerator.default.keys(data);
  9822. case 2:
  9823. if ((_context7.t1 = _context7.t0()).done) {
  9824. _context7.next = 13;
  9825. break;
  9826. }
  9827. key = _context7.t1.value;
  9828. _context7.next = 6;
  9829. return this.validateRule(key, this._schema[key], data[key], data, allData);
  9830. case 6:
  9831. errorMessage = _context7.sent;
  9832. if (!(errorMessage != null)) {
  9833. _context7.next = 11;
  9834. break;
  9835. }
  9836. result.push({
  9837. key: key,
  9838. errorMessage: errorMessage
  9839. });
  9840. if (all) {
  9841. _context7.next = 11;
  9842. break;
  9843. }
  9844. return _context7.abrupt("break", 13);
  9845. case 11:
  9846. _context7.next = 2;
  9847. break;
  9848. case 13:
  9849. return _context7.abrupt("return", result);
  9850. case 14:
  9851. case "end":
  9852. return _context7.stop();
  9853. }
  9854. }
  9855. }, _callee7, this);
  9856. }));
  9857. function invokeValidateUpdate(_x20, _x21, _x22) {
  9858. return _invokeValidateUpdate.apply(this, arguments);
  9859. }
  9860. return invokeValidateUpdate;
  9861. }()
  9862. }, {
  9863. key: "_checkFieldInSchema",
  9864. value: function _checkFieldInSchema(data) {
  9865. var keys = Object.keys(data);
  9866. var keys2 = Object.keys(this._schema);
  9867. if (new Set(keys.concat(keys2)).size === keys2.length) {
  9868. return '';
  9869. }
  9870. var noExistFields = keys.filter(function (key) {
  9871. return keys2.indexOf(key) < 0;
  9872. });
  9873. var errorMessage = formatMessage({
  9874. field: JSON.stringify(noExistFields)
  9875. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  9876. return [{
  9877. key: 'invalid',
  9878. errorMessage: errorMessage
  9879. }];
  9880. }
  9881. }]);
  9882. return SchemaValidator;
  9883. }(RuleValidator);
  9884. function Message() {
  9885. return {
  9886. TAG: "",
  9887. default: '验证错误',
  9888. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  9889. validateFunction: '验证无效',
  9890. required: '{label}必填',
  9891. 'enum': '{label}超出范围',
  9892. timestamp: '{label}格式无效',
  9893. whitespace: '{label}不能为空',
  9894. typeError: '{label}类型无效',
  9895. date: {
  9896. format: '{label}日期{value}格式无效',
  9897. parse: '{label}日期无法解析,{value}无效',
  9898. invalid: '{label}日期{value}无效'
  9899. },
  9900. length: {
  9901. minLength: '{label}长度不能少于{minLength}',
  9902. maxLength: '{label}长度不能超过{maxLength}',
  9903. range: '{label}必须介于{minLength}和{maxLength}之间'
  9904. },
  9905. number: {
  9906. minimum: '{label}不能小于{minimum}',
  9907. maximum: '{label}不能大于{maximum}',
  9908. exclusiveMinimum: '{label}不能小于等于{minimum}',
  9909. exclusiveMaximum: '{label}不能大于等于{maximum}',
  9910. range: '{label}必须介于{minimum}and{maximum}之间'
  9911. },
  9912. pattern: {
  9913. mismatch: '{label}格式不匹配'
  9914. }
  9915. };
  9916. }
  9917. SchemaValidator.message = new Message();
  9918. var _default = SchemaValidator;
  9919. exports.default = _default;
  9920. /***/ }),
  9921. /***/ 270:
  9922. /*!*********************************************************!*\
  9923. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  9924. \*********************************************************/
  9925. /*! no static exports found */
  9926. /***/ (function(module, exports, __webpack_require__) {
  9927. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  9928. function _inherits(subClass, superClass) {
  9929. if (typeof superClass !== "function" && superClass !== null) {
  9930. throw new TypeError("Super expression must either be null or a function");
  9931. }
  9932. subClass.prototype = Object.create(superClass && superClass.prototype, {
  9933. constructor: {
  9934. value: subClass,
  9935. writable: true,
  9936. configurable: true
  9937. }
  9938. });
  9939. Object.defineProperty(subClass, "prototype", {
  9940. writable: false
  9941. });
  9942. if (superClass) setPrototypeOf(subClass, superClass);
  9943. }
  9944. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9945. /***/ }),
  9946. /***/ 271:
  9947. /*!**************************************************************************!*\
  9948. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  9949. \**************************************************************************/
  9950. /*! no static exports found */
  9951. /***/ (function(module, exports, __webpack_require__) {
  9952. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9953. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 272);
  9954. function _possibleConstructorReturn(self, call) {
  9955. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  9956. return call;
  9957. } else if (call !== void 0) {
  9958. throw new TypeError("Derived constructors may only return object or undefined");
  9959. }
  9960. return assertThisInitialized(self);
  9961. }
  9962. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9963. /***/ }),
  9964. /***/ 272:
  9965. /*!**********************************************************************!*\
  9966. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  9967. \**********************************************************************/
  9968. /*! no static exports found */
  9969. /***/ (function(module, exports) {
  9970. function _assertThisInitialized(self) {
  9971. if (self === void 0) {
  9972. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9973. }
  9974. return self;
  9975. }
  9976. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9977. /***/ }),
  9978. /***/ 273:
  9979. /*!***************************************************************!*\
  9980. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  9981. \***************************************************************/
  9982. /*! no static exports found */
  9983. /***/ (function(module, exports) {
  9984. function _getPrototypeOf(o) {
  9985. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  9986. return o.__proto__ || Object.getPrototypeOf(o);
  9987. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9988. return _getPrototypeOf(o);
  9989. }
  9990. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9991. /***/ }),
  9992. /***/ 274:
  9993. /*!***************************************************************************************************!*\
  9994. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  9995. \***************************************************************************************************/
  9996. /*! no static exports found */
  9997. /***/ (function(module, exports, __webpack_require__) {
  9998. "use strict";
  9999. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10000. Object.defineProperty(exports, "__esModule", {
  10001. value: true
  10002. });
  10003. 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;
  10004. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10005. /**
  10006. * 简单处理对象拷贝
  10007. * @param {Obejct} 被拷贝对象
  10008. * @@return {Object} 拷贝对象
  10009. */
  10010. var deepCopy = function deepCopy(val) {
  10011. return JSON.parse(JSON.stringify(val));
  10012. };
  10013. /**
  10014. * 过滤数字类型
  10015. * @param {String} format 数字类型
  10016. * @@return {Boolean} 返回是否为数字类型
  10017. */
  10018. exports.deepCopy = deepCopy;
  10019. var typeFilter = function typeFilter(format) {
  10020. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  10021. };
  10022. /**
  10023. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  10024. * @param {String} key 字段名
  10025. * @param {any} value 字段值
  10026. * @param {Object} rules 表单校验规则
  10027. */
  10028. exports.typeFilter = typeFilter;
  10029. var getValue = function getValue(key, value, rules) {
  10030. var isRuleNumType = rules.find(function (val) {
  10031. return val.format && typeFilter(val.format);
  10032. });
  10033. var isRuleBoolType = rules.find(function (val) {
  10034. return val.format && val.format === 'boolean' || val.format === 'bool';
  10035. });
  10036. // 输入类型为 number
  10037. if (!!isRuleNumType) {
  10038. if (!value && value !== 0) {
  10039. value = null;
  10040. } else {
  10041. value = isNumber(Number(value)) ? Number(value) : value;
  10042. }
  10043. }
  10044. // 输入类型为 boolean
  10045. if (!!isRuleBoolType) {
  10046. value = isBoolean(value) ? value : false;
  10047. }
  10048. return value;
  10049. };
  10050. /**
  10051. * 获取表单数据
  10052. * @param {String|Array} name 真实名称,需要使用 realName 获取
  10053. * @param {Object} data 原始数据
  10054. * @param {any} value 需要设置的值
  10055. */
  10056. exports.getValue = getValue;
  10057. var setDataValue = function setDataValue(field, formdata, value) {
  10058. formdata[field] = value;
  10059. return value || '';
  10060. };
  10061. /**
  10062. * 获取表单数据
  10063. * @param {String|Array} field 真实名称,需要使用 realName 获取
  10064. * @param {Object} data 原始数据
  10065. */
  10066. exports.setDataValue = setDataValue;
  10067. var getDataValue = function getDataValue(field, data) {
  10068. return objGet(data, field);
  10069. };
  10070. /**
  10071. * 获取表单类型
  10072. * @param {String|Array} field 真实名称,需要使用 realName 获取
  10073. */
  10074. exports.getDataValue = getDataValue;
  10075. var getDataValueType = function getDataValueType(field, data) {
  10076. var value = getDataValue(field, data);
  10077. return {
  10078. type: type(value),
  10079. value: value
  10080. };
  10081. };
  10082. /**
  10083. * 获取表单可用的真实name
  10084. * @param {String|Array} name 表单name
  10085. * @@return {String} 表单可用的真实name
  10086. */
  10087. exports.getDataValueType = getDataValueType;
  10088. var realName = function realName(name) {
  10089. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10090. var base_name = _basePath(name);
  10091. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  10092. var realname = base_name.reduce(function (a, b) {
  10093. return a += "#".concat(b);
  10094. }, '_formdata_');
  10095. return realname;
  10096. }
  10097. return base_name[0] || name;
  10098. };
  10099. /**
  10100. * 判断是否表单可用的真实name
  10101. * @param {String|Array} name 表单name
  10102. * @@return {String} 表单可用的真实name
  10103. */
  10104. exports.realName = realName;
  10105. var isRealName = function isRealName(name) {
  10106. var reg = /^_formdata_#*/;
  10107. return reg.test(name);
  10108. };
  10109. /**
  10110. * 获取表单数据的原始格式
  10111. * @@return {Object|Array} object 需要解析的数据
  10112. */
  10113. exports.isRealName = isRealName;
  10114. var rawData = function rawData() {
  10115. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10116. var name = arguments.length > 1 ? arguments[1] : undefined;
  10117. var newData = JSON.parse(JSON.stringify(object));
  10118. var formData = {};
  10119. for (var i in newData) {
  10120. var path = name2arr(i);
  10121. objSet(formData, path, newData[i]);
  10122. }
  10123. return formData;
  10124. };
  10125. /**
  10126. * 真实name还原为 array
  10127. * @param {*} name
  10128. */
  10129. exports.rawData = rawData;
  10130. var name2arr = function name2arr(name) {
  10131. var field = name.replace('_formdata_#', '');
  10132. field = field.split('#').map(function (v) {
  10133. return isNumber(v) ? Number(v) : v;
  10134. });
  10135. return field;
  10136. };
  10137. /**
  10138. * 对象中设置值
  10139. * @param {Object|Array} object 源数据
  10140. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  10141. * @param {String} value 需要设置的值
  10142. */
  10143. exports.name2arr = name2arr;
  10144. var objSet = function objSet(object, path, value) {
  10145. if ((0, _typeof2.default)(object) !== 'object') return object;
  10146. _basePath(path).reduce(function (o, k, i, _) {
  10147. if (i === _.length - 1) {
  10148. // 若遍历结束直接赋值
  10149. o[k] = value;
  10150. return null;
  10151. } else if (k in o) {
  10152. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  10153. return o[k];
  10154. } else {
  10155. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  10156. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  10157. return o[k];
  10158. }
  10159. }, object);
  10160. // 返回object
  10161. return object;
  10162. };
  10163. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  10164. exports.objSet = objSet;
  10165. function _basePath(path) {
  10166. // 若是数组,则直接返回
  10167. if (Array.isArray(path)) return path;
  10168. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  10169. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  10170. }
  10171. /**
  10172. * 从对象中获取值
  10173. * @param {Object|Array} object 源数据
  10174. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  10175. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  10176. */
  10177. var objGet = function objGet(object, path) {
  10178. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  10179. // 先将path处理成统一格式
  10180. var newPath = _basePath(path);
  10181. // 递归处理,返回最后结果
  10182. var val = newPath.reduce(function (o, k) {
  10183. return (o || {})[k];
  10184. }, object);
  10185. return !val || val !== undefined ? val : defaultVal;
  10186. };
  10187. /**
  10188. * 是否为 number 类型
  10189. * @param {any} num 需要判断的值
  10190. * @return {Boolean} 是否为 number
  10191. */
  10192. exports.objGet = objGet;
  10193. var isNumber = function isNumber(num) {
  10194. return !isNaN(Number(num));
  10195. };
  10196. /**
  10197. * 是否为 boolean 类型
  10198. * @param {any} bool 需要判断的值
  10199. * @return {Boolean} 是否为 boolean
  10200. */
  10201. exports.isNumber = isNumber;
  10202. var isBoolean = function isBoolean(bool) {
  10203. return typeof bool === 'boolean';
  10204. };
  10205. /**
  10206. * 是否有必填字段
  10207. * @param {Object} rules 规则
  10208. * @return {Boolean} 是否有必填字段
  10209. */
  10210. exports.isBoolean = isBoolean;
  10211. var isRequiredField = function isRequiredField(rules) {
  10212. var isNoField = false;
  10213. for (var i = 0; i < rules.length; i++) {
  10214. var ruleData = rules[i];
  10215. if (ruleData.required) {
  10216. isNoField = true;
  10217. break;
  10218. }
  10219. }
  10220. return isNoField;
  10221. };
  10222. /**
  10223. * 获取数据类型
  10224. * @param {Any} obj 需要获取数据类型的值
  10225. */
  10226. exports.isRequiredField = isRequiredField;
  10227. var type = function type(obj) {
  10228. var class2type = {};
  10229. // 生成class2type映射
  10230. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  10231. class2type["[object " + item + "]"] = item.toLowerCase();
  10232. });
  10233. if (obj == null) {
  10234. return obj + "";
  10235. }
  10236. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  10237. };
  10238. /**
  10239. * 判断两个值是否相等
  10240. * @param {any} a 值
  10241. * @param {any} b 值
  10242. * @return {Boolean} 是否相等
  10243. */
  10244. exports.type = type;
  10245. var isEqual = function isEqual(a, b) {
  10246. //如果a和b本来就全等
  10247. if (a === b) {
  10248. //判断是否为0和-0
  10249. return a !== 0 || 1 / a === 1 / b;
  10250. }
  10251. //判断是否为null和undefined
  10252. if (a == null || b == null) {
  10253. return a === b;
  10254. }
  10255. //接下来判断a和b的数据类型
  10256. var classNameA = toString.call(a),
  10257. classNameB = toString.call(b);
  10258. //如果数据类型不相等,则返回false
  10259. if (classNameA !== classNameB) {
  10260. return false;
  10261. }
  10262. //如果数据类型相等,再根据不同数据类型分别判断
  10263. switch (classNameA) {
  10264. case '[object RegExp]':
  10265. case '[object String]':
  10266. //进行字符串转换比较
  10267. return '' + a === '' + b;
  10268. case '[object Number]':
  10269. //进行数字转换比较,判断是否为NaN
  10270. if (+a !== +a) {
  10271. return +b !== +b;
  10272. }
  10273. //判断是否为0或-0
  10274. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  10275. case '[object Date]':
  10276. case '[object Boolean]':
  10277. return +a === +b;
  10278. }
  10279. //如果是对象类型
  10280. if (classNameA == '[object Object]') {
  10281. //获取a和b的属性长度
  10282. var propsA = Object.getOwnPropertyNames(a),
  10283. propsB = Object.getOwnPropertyNames(b);
  10284. if (propsA.length != propsB.length) {
  10285. return false;
  10286. }
  10287. for (var i = 0; i < propsA.length; i++) {
  10288. var propName = propsA[i];
  10289. //如果对应属性对应值不相等,则返回false
  10290. if (a[propName] !== b[propName]) {
  10291. return false;
  10292. }
  10293. }
  10294. return true;
  10295. }
  10296. //如果是数组类型
  10297. if (classNameA == '[object Array]') {
  10298. if (a.toString() == b.toString()) {
  10299. return true;
  10300. }
  10301. return false;
  10302. }
  10303. };
  10304. exports.isEqual = isEqual;
  10305. /***/ }),
  10306. /***/ 289:
  10307. /*!************************************************************************************!*\
  10308. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  10309. \************************************************************************************/
  10310. /*! no static exports found */
  10311. /***/ (function(module, exports, __webpack_require__) {
  10312. "use strict";
  10313. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  10314. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10315. Object.defineProperty(exports, "__esModule", {
  10316. value: true
  10317. });
  10318. exports.default = void 0;
  10319. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 272));
  10320. var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ 290));
  10321. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  10322. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  10323. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10324. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  10325. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  10326. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10327. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 270));
  10328. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 271));
  10329. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 273));
  10330. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 292));
  10331. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10332. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10333. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 294));
  10334. var _excluded = ["spaceAppId", "accessKey"];
  10335. 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(_e34) { throw _e34; }, 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(_e35) { didErr = true; err = _e35; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  10336. 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); }
  10337. 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; }
  10338. 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; }
  10339. 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; }
  10340. 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); }; }
  10341. 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; } }
  10342. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  10343. function t(e) {
  10344. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  10345. }
  10346. function n(e, t, n) {
  10347. return e(n = {
  10348. path: t,
  10349. exports: {},
  10350. require: function require(e, t) {
  10351. return function () {
  10352. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  10353. }(null == t && n.path);
  10354. }
  10355. }, n.exports), n.exports;
  10356. }
  10357. var s = n(function (e, t) {
  10358. var n;
  10359. e.exports = (n = n || function (e, t) {
  10360. var n = Object.create || function () {
  10361. function e() {}
  10362. return function (t) {
  10363. var n;
  10364. return e.prototype = t, n = new e(), e.prototype = null, n;
  10365. };
  10366. }(),
  10367. s = {},
  10368. r = s.lib = {},
  10369. i = r.Base = {
  10370. extend: function extend(e) {
  10371. var t = n(this);
  10372. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  10373. t.$super.init.apply(this, arguments);
  10374. }), t.init.prototype = t, t.$super = this, t;
  10375. },
  10376. create: function create() {
  10377. var e = this.extend();
  10378. return e.init.apply(e, arguments), e;
  10379. },
  10380. init: function init() {},
  10381. mixIn: function mixIn(e) {
  10382. for (var t in e) {
  10383. e.hasOwnProperty(t) && (this[t] = e[t]);
  10384. }
  10385. e.hasOwnProperty("toString") && (this.toString = e.toString);
  10386. },
  10387. clone: function clone() {
  10388. return this.init.prototype.extend(this);
  10389. }
  10390. },
  10391. o = r.WordArray = i.extend({
  10392. init: function init(e, n) {
  10393. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  10394. },
  10395. toString: function toString(e) {
  10396. return (e || c).stringify(this);
  10397. },
  10398. concat: function concat(e) {
  10399. var t = this.words,
  10400. n = e.words,
  10401. s = this.sigBytes,
  10402. r = e.sigBytes;
  10403. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  10404. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  10405. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  10406. } else for (i = 0; i < r; i += 4) {
  10407. t[s + i >>> 2] = n[i >>> 2];
  10408. }
  10409. return this.sigBytes += r, this;
  10410. },
  10411. clamp: function clamp() {
  10412. var t = this.words,
  10413. n = this.sigBytes;
  10414. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  10415. },
  10416. clone: function clone() {
  10417. var e = i.clone.call(this);
  10418. return e.words = this.words.slice(0), e;
  10419. },
  10420. random: function random(t) {
  10421. for (var n, s = [], r = function r(t) {
  10422. t = t;
  10423. var n = 987654321,
  10424. s = 4294967295;
  10425. return function () {
  10426. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  10427. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  10428. };
  10429. }, i = 0; i < t; i += 4) {
  10430. var a = r(4294967296 * (n || e.random()));
  10431. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  10432. }
  10433. return new o.init(s, t);
  10434. }
  10435. }),
  10436. a = s.enc = {},
  10437. c = a.Hex = {
  10438. stringify: function stringify(e) {
  10439. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10440. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10441. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10442. }
  10443. return s.join("");
  10444. },
  10445. parse: function parse(e) {
  10446. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10447. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10448. }
  10449. return new o.init(n, t / 2);
  10450. }
  10451. },
  10452. u = a.Latin1 = {
  10453. stringify: function stringify(e) {
  10454. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10455. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10456. s.push(String.fromCharCode(i));
  10457. }
  10458. return s.join("");
  10459. },
  10460. parse: function parse(e) {
  10461. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10462. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10463. }
  10464. return new o.init(n, t);
  10465. }
  10466. },
  10467. l = a.Utf8 = {
  10468. stringify: function stringify(e) {
  10469. try {
  10470. return decodeURIComponent(escape(u.stringify(e)));
  10471. } catch (e) {
  10472. throw new Error("Malformed UTF-8 data");
  10473. }
  10474. },
  10475. parse: function parse(e) {
  10476. return u.parse(unescape(encodeURIComponent(e)));
  10477. }
  10478. },
  10479. h = r.BufferedBlockAlgorithm = i.extend({
  10480. reset: function reset() {
  10481. this._data = new o.init(), this._nDataBytes = 0;
  10482. },
  10483. _append: function _append(e) {
  10484. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10485. },
  10486. _process: function _process(t) {
  10487. var n = this._data,
  10488. s = n.words,
  10489. r = n.sigBytes,
  10490. i = this.blockSize,
  10491. a = r / (4 * i),
  10492. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10493. u = e.min(4 * c, r);
  10494. if (c) {
  10495. for (var l = 0; l < c; l += i) {
  10496. this._doProcessBlock(s, l);
  10497. }
  10498. var h = s.splice(0, c);
  10499. n.sigBytes -= u;
  10500. }
  10501. return new o.init(h, u);
  10502. },
  10503. clone: function clone() {
  10504. var e = i.clone.call(this);
  10505. return e._data = this._data.clone(), e;
  10506. },
  10507. _minBufferSize: 0
  10508. });
  10509. r.Hasher = h.extend({
  10510. cfg: i.extend(),
  10511. init: function init(e) {
  10512. this.cfg = this.cfg.extend(e), this.reset();
  10513. },
  10514. reset: function reset() {
  10515. h.reset.call(this), this._doReset();
  10516. },
  10517. update: function update(e) {
  10518. return this._append(e), this._process(), this;
  10519. },
  10520. finalize: function finalize(e) {
  10521. return e && this._append(e), this._doFinalize();
  10522. },
  10523. blockSize: 16,
  10524. _createHelper: function _createHelper(e) {
  10525. return function (t, n) {
  10526. return new e.init(n).finalize(t);
  10527. };
  10528. },
  10529. _createHmacHelper: function _createHmacHelper(e) {
  10530. return function (t, n) {
  10531. return new d.HMAC.init(e, n).finalize(t);
  10532. };
  10533. }
  10534. });
  10535. var d = s.algo = {};
  10536. return s;
  10537. }(Math), n);
  10538. }),
  10539. r = s,
  10540. i = (n(function (e, t) {
  10541. var n;
  10542. e.exports = (n = r, function (e) {
  10543. var t = n,
  10544. s = t.lib,
  10545. r = s.WordArray,
  10546. i = s.Hasher,
  10547. o = t.algo,
  10548. a = [];
  10549. !function () {
  10550. for (var t = 0; t < 64; t++) {
  10551. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10552. }
  10553. }();
  10554. var c = o.MD5 = i.extend({
  10555. _doReset: function _doReset() {
  10556. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10557. },
  10558. _doProcessBlock: function _doProcessBlock(e, t) {
  10559. for (var n = 0; n < 16; n++) {
  10560. var s = t + n,
  10561. r = e[s];
  10562. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10563. }
  10564. var i = this._hash.words,
  10565. o = e[t + 0],
  10566. c = e[t + 1],
  10567. p = e[t + 2],
  10568. f = e[t + 3],
  10569. g = e[t + 4],
  10570. m = e[t + 5],
  10571. y = e[t + 6],
  10572. _ = e[t + 7],
  10573. w = e[t + 8],
  10574. v = e[t + 9],
  10575. I = e[t + 10],
  10576. S = e[t + 11],
  10577. b = e[t + 12],
  10578. k = e[t + 13],
  10579. A = e[t + 14],
  10580. P = e[t + 15],
  10581. T = i[0],
  10582. C = i[1],
  10583. x = i[2],
  10584. O = i[3];
  10585. T = u(T, C, x, O, o, 7, a[0]), O = u(O, T, C, x, c, 12, a[1]), x = u(x, O, T, C, p, 17, a[2]), C = u(C, x, O, T, f, 22, a[3]), T = u(T, C, x, O, g, 7, a[4]), O = u(O, T, C, x, m, 12, a[5]), x = u(x, O, T, C, y, 17, a[6]), C = u(C, x, O, T, _, 22, a[7]), T = u(T, C, x, O, w, 7, a[8]), O = u(O, T, C, x, v, 12, a[9]), x = u(x, O, T, C, I, 17, a[10]), C = u(C, x, O, T, S, 22, a[11]), T = u(T, C, x, O, b, 7, a[12]), O = u(O, T, C, x, k, 12, a[13]), x = u(x, O, T, C, A, 17, a[14]), T = l(T, C = u(C, x, O, T, P, 22, a[15]), x, O, c, 5, a[16]), O = l(O, T, C, x, y, 9, a[17]), x = l(x, O, T, C, S, 14, a[18]), C = l(C, x, O, T, o, 20, a[19]), T = l(T, C, x, O, m, 5, a[20]), O = l(O, T, C, x, I, 9, a[21]), x = l(x, O, T, C, P, 14, a[22]), C = l(C, x, O, T, g, 20, a[23]), T = l(T, C, x, O, v, 5, a[24]), O = l(O, T, C, x, A, 9, a[25]), x = l(x, O, T, C, f, 14, a[26]), C = l(C, x, O, T, w, 20, a[27]), T = l(T, C, x, O, k, 5, a[28]), O = l(O, T, C, x, p, 9, a[29]), x = l(x, O, T, C, _, 14, a[30]), T = h(T, C = l(C, x, O, T, b, 20, a[31]), x, O, m, 4, a[32]), O = h(O, T, C, x, w, 11, a[33]), x = h(x, O, T, C, S, 16, a[34]), C = h(C, x, O, T, A, 23, a[35]), T = h(T, C, x, O, c, 4, a[36]), O = h(O, T, C, x, g, 11, a[37]), x = h(x, O, T, C, _, 16, a[38]), C = h(C, x, O, T, I, 23, a[39]), T = h(T, C, x, O, k, 4, a[40]), O = h(O, T, C, x, o, 11, a[41]), x = h(x, O, T, C, f, 16, a[42]), C = h(C, x, O, T, y, 23, a[43]), T = h(T, C, x, O, v, 4, a[44]), O = h(O, T, C, x, b, 11, a[45]), x = h(x, O, T, C, P, 16, a[46]), T = d(T, C = h(C, x, O, T, p, 23, a[47]), x, O, o, 6, a[48]), O = d(O, T, C, x, _, 10, a[49]), x = d(x, O, T, C, A, 15, a[50]), C = d(C, x, O, T, m, 21, a[51]), T = d(T, C, x, O, b, 6, a[52]), O = d(O, T, C, x, f, 10, a[53]), x = d(x, O, T, C, I, 15, a[54]), C = d(C, x, O, T, c, 21, a[55]), T = d(T, C, x, O, w, 6, a[56]), O = d(O, T, C, x, P, 10, a[57]), x = d(x, O, T, C, y, 15, a[58]), C = d(C, x, O, T, k, 21, a[59]), T = d(T, C, x, O, g, 6, a[60]), O = d(O, T, C, x, S, 10, a[61]), x = d(x, O, T, C, p, 15, a[62]), C = d(C, x, O, T, v, 21, a[63]), i[0] = i[0] + T | 0, i[1] = i[1] + C | 0, i[2] = i[2] + x | 0, i[3] = i[3] + O | 0;
  10586. },
  10587. _doFinalize: function _doFinalize() {
  10588. var t = this._data,
  10589. n = t.words,
  10590. s = 8 * this._nDataBytes,
  10591. r = 8 * t.sigBytes;
  10592. n[r >>> 5] |= 128 << 24 - r % 32;
  10593. var i = e.floor(s / 4294967296),
  10594. o = s;
  10595. 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();
  10596. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10597. var l = c[u];
  10598. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  10599. }
  10600. return a;
  10601. },
  10602. clone: function clone() {
  10603. var e = i.clone.call(this);
  10604. return e._hash = this._hash.clone(), e;
  10605. }
  10606. });
  10607. function u(e, t, n, s, r, i, o) {
  10608. var a = e + (t & n | ~t & s) + r + o;
  10609. return (a << i | a >>> 32 - i) + t;
  10610. }
  10611. function l(e, t, n, s, r, i, o) {
  10612. var a = e + (t & s | n & ~s) + r + o;
  10613. return (a << i | a >>> 32 - i) + t;
  10614. }
  10615. function h(e, t, n, s, r, i, o) {
  10616. var a = e + (t ^ n ^ s) + r + o;
  10617. return (a << i | a >>> 32 - i) + t;
  10618. }
  10619. function d(e, t, n, s, r, i, o) {
  10620. var a = e + (n ^ (t | ~s)) + r + o;
  10621. return (a << i | a >>> 32 - i) + t;
  10622. }
  10623. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  10624. }(Math), n.MD5);
  10625. }), n(function (e, t) {
  10626. var n;
  10627. e.exports = (n = r, void function () {
  10628. var e = n,
  10629. t = e.lib.Base,
  10630. s = e.enc.Utf8;
  10631. e.algo.HMAC = t.extend({
  10632. init: function init(e, t) {
  10633. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  10634. var n = e.blockSize,
  10635. r = 4 * n;
  10636. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  10637. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  10638. a[u] ^= 1549556828, c[u] ^= 909522486;
  10639. }
  10640. i.sigBytes = o.sigBytes = r, this.reset();
  10641. },
  10642. reset: function reset() {
  10643. var e = this._hasher;
  10644. e.reset(), e.update(this._iKey);
  10645. },
  10646. update: function update(e) {
  10647. return this._hasher.update(e), this;
  10648. },
  10649. finalize: function finalize(e) {
  10650. var t = this._hasher,
  10651. n = t.finalize(e);
  10652. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  10653. }
  10654. });
  10655. }());
  10656. }), n(function (e, t) {
  10657. e.exports = r.HmacMD5;
  10658. })),
  10659. o = n(function (e, t) {
  10660. e.exports = r.enc.Utf8;
  10661. }),
  10662. a = n(function (e, t) {
  10663. var n;
  10664. e.exports = (n = r, function () {
  10665. var e = n,
  10666. t = e.lib.WordArray;
  10667. function s(e, n, s) {
  10668. for (var r = [], i = 0, o = 0; o < n; o++) {
  10669. if (o % 4) {
  10670. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  10671. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  10672. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  10673. }
  10674. }
  10675. return t.create(r, i);
  10676. }
  10677. e.enc.Base64 = {
  10678. stringify: function stringify(e) {
  10679. var t = e.words,
  10680. n = e.sigBytes,
  10681. s = this._map;
  10682. e.clamp();
  10683. for (var r = [], i = 0; i < n; i += 3) {
  10684. 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++) {
  10685. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  10686. }
  10687. }
  10688. var c = s.charAt(64);
  10689. if (c) for (; r.length % 4;) {
  10690. r.push(c);
  10691. }
  10692. return r.join("");
  10693. },
  10694. parse: function parse(e) {
  10695. var t = e.length,
  10696. n = this._map,
  10697. r = this._reverseMap;
  10698. if (!r) {
  10699. r = this._reverseMap = [];
  10700. for (var i = 0; i < n.length; i++) {
  10701. r[n.charCodeAt(i)] = i;
  10702. }
  10703. }
  10704. var o = n.charAt(64);
  10705. if (o) {
  10706. var a = e.indexOf(o);
  10707. -1 !== a && (t = a);
  10708. }
  10709. return s(e, t, r);
  10710. },
  10711. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  10712. };
  10713. }(), n.enc.Base64);
  10714. });
  10715. var c = "FUNCTION",
  10716. u = "OBJECT",
  10717. l = "CLIENT_DB",
  10718. h = "pending",
  10719. d = "fulfilled",
  10720. p = "rejected";
  10721. function f(e) {
  10722. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  10723. }
  10724. function g(e) {
  10725. return "object" === f(e);
  10726. }
  10727. function m(e) {
  10728. return "function" == typeof e;
  10729. }
  10730. function y(e) {
  10731. return function () {
  10732. try {
  10733. return e.apply(e, arguments);
  10734. } catch (e) {
  10735. console.error(e);
  10736. }
  10737. };
  10738. }
  10739. var _ = "REJECTED",
  10740. w = "NOT_PENDING";
  10741. var v = /*#__PURE__*/function () {
  10742. function v() {
  10743. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10744. e = _ref.createPromise,
  10745. _ref$retryRule = _ref.retryRule,
  10746. t = _ref$retryRule === void 0 ? _ : _ref$retryRule;
  10747. (0, _classCallCheck2.default)(this, v);
  10748. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  10749. }
  10750. (0, _createClass2.default)(v, [{
  10751. key: "needRetry",
  10752. get: function get() {
  10753. if (!this.status) return !0;
  10754. switch (this.retryRule) {
  10755. case _:
  10756. return this.status === p;
  10757. case w:
  10758. return this.status !== h;
  10759. }
  10760. }
  10761. }, {
  10762. key: "exec",
  10763. value: function exec() {
  10764. var _this = this;
  10765. return this.needRetry ? (this.status = h, this.promise = this.createPromise().then(function (e) {
  10766. return _this.status = d, Promise.resolve(e);
  10767. }, function (e) {
  10768. return _this.status = p, Promise.reject(e);
  10769. }), this.promise) : this.promise;
  10770. }
  10771. }]);
  10772. return v;
  10773. }();
  10774. function I(e) {
  10775. return e && "string" == typeof e ? JSON.parse(e) : e;
  10776. }
  10777. var S = "development" === "development",
  10778. b = "mp-weixin",
  10779. k = "true" === undefined || !0 === undefined,
  10780. A = I([]),
  10781. P = "h5" === b ? "web" : "app-plus" === b ? "app" : b,
  10782. T = I(undefined),
  10783. C = I([]) || [],
  10784. x = true;
  10785. var O = "";
  10786. try {
  10787. O = (__webpack_require__(/*! uni-stat-config */ 295).default || __webpack_require__(/*! uni-stat-config */ 295)).appid;
  10788. } catch (e) {}
  10789. var E = {};
  10790. function L(e) {
  10791. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10792. var n, s;
  10793. return n = E, s = e, Object.prototype.hasOwnProperty.call(n, s) || (E[e] = t), E[e];
  10794. }
  10795. "app" === P && (E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  10796. var R = ["invoke", "success", "fail", "complete"],
  10797. U = L("_globalUniCloudInterceptor");
  10798. function N(e, t) {
  10799. U[e] || (U[e] = {}), g(t) && Object.keys(t).forEach(function (n) {
  10800. R.indexOf(n) > -1 && function (e, t, n) {
  10801. var s = U[e][t];
  10802. s || (s = U[e][t] = []), -1 === s.indexOf(n) && m(n) && s.push(n);
  10803. }(e, n, t[n]);
  10804. });
  10805. }
  10806. function D(e, t) {
  10807. U[e] || (U[e] = {}), g(t) ? Object.keys(t).forEach(function (n) {
  10808. R.indexOf(n) > -1 && function (e, t, n) {
  10809. var s = U[e][t];
  10810. if (!s) return;
  10811. var r = s.indexOf(n);
  10812. r > -1 && s.splice(r, 1);
  10813. }(e, n, t[n]);
  10814. }) : delete U[e];
  10815. }
  10816. function M(e, t) {
  10817. return e && 0 !== e.length ? e.reduce(function (e, n) {
  10818. return e.then(function () {
  10819. return n(t);
  10820. });
  10821. }, Promise.resolve()) : Promise.resolve();
  10822. }
  10823. function q(e, t) {
  10824. return U[e] && U[e][t] || [];
  10825. }
  10826. function F(e) {
  10827. N("callObject", e);
  10828. }
  10829. var K = L("_globalUniCloudListener"),
  10830. j = "response",
  10831. B = "needLogin",
  10832. $ = "refreshToken",
  10833. W = "clientdb",
  10834. H = "cloudfunction",
  10835. z = "cloudobject";
  10836. function J(e) {
  10837. return K[e] || (K[e] = []), K[e];
  10838. }
  10839. function V(e, t) {
  10840. var n = J(e);
  10841. n.includes(t) || n.push(t);
  10842. }
  10843. function G(e, t) {
  10844. var n = J(e),
  10845. s = n.indexOf(t);
  10846. -1 !== s && n.splice(s, 1);
  10847. }
  10848. function Y(e, t) {
  10849. var n = J(e);
  10850. for (var _e2 = 0; _e2 < n.length; _e2++) {
  10851. (0, n[_e2])(t);
  10852. }
  10853. }
  10854. var Q,
  10855. X = !1;
  10856. function Z() {
  10857. return Q || (Q = new Promise(function (e) {
  10858. X && e(), function t() {
  10859. if ("function" == typeof getCurrentPages) {
  10860. var _t2 = getCurrentPages();
  10861. _t2 && _t2[0] && (X = !0, e());
  10862. }
  10863. X || setTimeout(function () {
  10864. t();
  10865. }, 30);
  10866. }();
  10867. }), Q);
  10868. }
  10869. function ee(e) {
  10870. var t = {};
  10871. for (var _n2 in e) {
  10872. var _s2 = e[_n2];
  10873. m(_s2) && (t[_n2] = y(_s2));
  10874. }
  10875. return t;
  10876. }
  10877. var te = /*#__PURE__*/function (_Error) {
  10878. (0, _inherits2.default)(te, _Error);
  10879. var _super = _createSuper(te);
  10880. function te(e) {
  10881. var _this2;
  10882. (0, _classCallCheck2.default)(this, te);
  10883. _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;
  10884. return _this2;
  10885. }
  10886. (0, _createClass2.default)(te, [{
  10887. key: "toJson",
  10888. value: function toJson() {
  10889. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10890. if (!(e >= 10)) return e++, {
  10891. errCode: this.errCode,
  10892. errMsg: this.errMsg,
  10893. errSubject: this.errSubject,
  10894. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  10895. };
  10896. }
  10897. }]);
  10898. return te;
  10899. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  10900. var ne = {
  10901. request: function request(e) {
  10902. return uni.request(e);
  10903. },
  10904. uploadFile: function uploadFile(e) {
  10905. return uni.uploadFile(e);
  10906. },
  10907. setStorageSync: function setStorageSync(e, t) {
  10908. return uni.setStorageSync(e, t);
  10909. },
  10910. getStorageSync: function getStorageSync(e) {
  10911. return uni.getStorageSync(e);
  10912. },
  10913. removeStorageSync: function removeStorageSync(e) {
  10914. return uni.removeStorageSync(e);
  10915. },
  10916. clearStorageSync: function clearStorageSync() {
  10917. return uni.clearStorageSync();
  10918. }
  10919. };
  10920. function se() {
  10921. return {
  10922. token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"),
  10923. tokenExpired: ne.getStorageSync("uni_id_token_expired")
  10924. };
  10925. }
  10926. function re() {
  10927. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10928. e = _ref2.token,
  10929. t = _ref2.tokenExpired;
  10930. e && ne.setStorageSync("uni_id_token", e), t && ne.setStorageSync("uni_id_token_expired", t);
  10931. }
  10932. var ie, oe;
  10933. function ae() {
  10934. return ie || (ie = uni.getSystemInfoSync()), ie;
  10935. }
  10936. function ce() {
  10937. var e, t;
  10938. try {
  10939. if (uni.getLaunchOptionsSync) {
  10940. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  10941. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  10942. _n3 = _uni$getLaunchOptions.scene,
  10943. _s3 = _uni$getLaunchOptions.channel;
  10944. e = _s3, t = _n3;
  10945. }
  10946. } catch (e) {}
  10947. return {
  10948. channel: e,
  10949. scene: t
  10950. };
  10951. }
  10952. function ue() {
  10953. var e = uni.getLocale && uni.getLocale() || "en";
  10954. if (oe) return _objectSpread(_objectSpread({}, oe), {}, {
  10955. locale: e,
  10956. LOCALE: e
  10957. });
  10958. var t = ae(),
  10959. n = t.deviceId,
  10960. s = t.osName,
  10961. r = t.uniPlatform,
  10962. i = t.appId,
  10963. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10964. for (var _e3 = 0; _e3 < o.length; _e3++) {
  10965. delete t[o[_e3]];
  10966. }
  10967. return oe = _objectSpread(_objectSpread({
  10968. PLATFORM: r,
  10969. OS: s,
  10970. APPID: i,
  10971. DEVICEID: n
  10972. }, ce()), t), _objectSpread(_objectSpread({}, oe), {}, {
  10973. locale: e,
  10974. LOCALE: e
  10975. });
  10976. }
  10977. var le = {
  10978. sign: function sign(e, t) {
  10979. var n = "";
  10980. return Object.keys(e).sort().forEach(function (t) {
  10981. e[t] && (n = n + "&" + t + "=" + e[t]);
  10982. }), n = n.slice(1), i(n, t).toString();
  10983. },
  10984. wrappedRequest: function wrappedRequest(e, t) {
  10985. return new Promise(function (n, s) {
  10986. t(Object.assign(e, {
  10987. complete: function complete(e) {
  10988. e || (e = {}), S && "web" === P && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  10989. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  10990. if (!e.statusCode || e.statusCode >= 400) return s(new te({
  10991. code: "SYS_ERR",
  10992. message: e.errMsg || "request:fail",
  10993. requestId: t
  10994. }));
  10995. var r = e.data;
  10996. if (r.error) return s(new te({
  10997. code: r.error.code,
  10998. message: r.error.message,
  10999. requestId: t
  11000. }));
  11001. r.result = r.data, r.requestId = t, delete r.data, n(r);
  11002. }
  11003. }));
  11004. });
  11005. },
  11006. toBase64: function toBase64(e) {
  11007. return a.stringify(o.parse(e));
  11008. }
  11009. };
  11010. var he = /*#__PURE__*/function () {
  11011. function he(e) {
  11012. var _this3 = this;
  11013. (0, _classCallCheck2.default)(this, he);
  11014. ["spaceId", "clientSecret"].forEach(function (t) {
  11015. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  11016. }), this.config = Object.assign({}, {
  11017. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  11018. }, 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({
  11019. createPromise: function createPromise() {
  11020. return _this3.requestAuth(_this3.setupRequest({
  11021. method: "serverless.auth.user.anonymousAuthorize",
  11022. params: "{}"
  11023. }, "auth")).then(function (e) {
  11024. if (!e.result || !e.result.accessToken) throw new te({
  11025. code: "AUTH_FAILED",
  11026. message: "获取accessToken失败"
  11027. });
  11028. _this3.setAccessToken(e.result.accessToken);
  11029. });
  11030. },
  11031. retryRule: w
  11032. });
  11033. }
  11034. (0, _createClass2.default)(he, [{
  11035. key: "hasAccessToken",
  11036. get: function get() {
  11037. return !!this.accessToken;
  11038. }
  11039. }, {
  11040. key: "setAccessToken",
  11041. value: function setAccessToken(e) {
  11042. this.accessToken = e;
  11043. }
  11044. }, {
  11045. key: "requestWrapped",
  11046. value: function requestWrapped(e) {
  11047. return le.wrappedRequest(e, this.adapter.request);
  11048. }
  11049. }, {
  11050. key: "requestAuth",
  11051. value: function requestAuth(e) {
  11052. return this.requestWrapped(e);
  11053. }
  11054. }, {
  11055. key: "request",
  11056. value: function request(e, t) {
  11057. var _this4 = this;
  11058. return Promise.resolve().then(function () {
  11059. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  11060. return new Promise(function (e, n) {
  11061. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  11062. }).then(function () {
  11063. return _this4.getAccessToken();
  11064. }).then(function () {
  11065. var t = _this4.rebuildRequest(e);
  11066. return _this4.request(t, !0);
  11067. });
  11068. }) : _this4.getAccessToken().then(function () {
  11069. var t = _this4.rebuildRequest(e);
  11070. return _this4.request(t, !0);
  11071. });
  11072. });
  11073. }
  11074. }, {
  11075. key: "rebuildRequest",
  11076. value: function rebuildRequest(e) {
  11077. var t = Object.assign({}, e);
  11078. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = le.sign(t.data, this.config.clientSecret), t;
  11079. }
  11080. }, {
  11081. key: "setupRequest",
  11082. value: function setupRequest(e, t) {
  11083. var n = Object.assign({}, e, {
  11084. spaceId: this.config.spaceId,
  11085. timestamp: Date.now()
  11086. }),
  11087. s = {
  11088. "Content-Type": "application/json"
  11089. };
  11090. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret), {
  11091. url: this.config.requestUrl,
  11092. method: "POST",
  11093. data: n,
  11094. dataType: "json",
  11095. header: s
  11096. };
  11097. }
  11098. }, {
  11099. key: "getAccessToken",
  11100. value: function getAccessToken() {
  11101. return this._getAccessTokenPromiseHub.exec();
  11102. }
  11103. }, {
  11104. key: "authorize",
  11105. value: function () {
  11106. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11107. return _regenerator.default.wrap(function _callee$(_context) {
  11108. while (1) {
  11109. switch (_context.prev = _context.next) {
  11110. case 0:
  11111. _context.next = 2;
  11112. return this.getAccessToken();
  11113. case 2:
  11114. case "end":
  11115. return _context.stop();
  11116. }
  11117. }
  11118. }, _callee, this);
  11119. }));
  11120. function authorize() {
  11121. return _authorize.apply(this, arguments);
  11122. }
  11123. return authorize;
  11124. }()
  11125. }, {
  11126. key: "callFunction",
  11127. value: function callFunction(e) {
  11128. var t = {
  11129. method: "serverless.function.runtime.invoke",
  11130. params: JSON.stringify({
  11131. functionTarget: e.name,
  11132. functionArgs: e.data || {}
  11133. })
  11134. };
  11135. return this.request(this.setupRequest(t));
  11136. }
  11137. }, {
  11138. key: "getOSSUploadOptionsFromPath",
  11139. value: function getOSSUploadOptionsFromPath(e) {
  11140. var t = {
  11141. method: "serverless.file.resource.generateProximalSign",
  11142. params: JSON.stringify(e)
  11143. };
  11144. return this.request(this.setupRequest(t));
  11145. }
  11146. }, {
  11147. key: "uploadFileToOSS",
  11148. value: function uploadFileToOSS(_ref3) {
  11149. var _this5 = this;
  11150. var e = _ref3.url,
  11151. t = _ref3.formData,
  11152. n = _ref3.name,
  11153. s = _ref3.filePath,
  11154. r = _ref3.fileType,
  11155. i = _ref3.onUploadProgress;
  11156. return new Promise(function (o, a) {
  11157. var c = _this5.adapter.uploadFile({
  11158. url: e,
  11159. formData: t,
  11160. name: n,
  11161. filePath: s,
  11162. fileType: r,
  11163. header: {
  11164. "X-OSS-server-side-encrpytion": "AES256"
  11165. },
  11166. success: function success(e) {
  11167. e && e.statusCode < 400 ? o(e) : a(new te({
  11168. code: "UPLOAD_FAILED",
  11169. message: "文件上传失败"
  11170. }));
  11171. },
  11172. fail: function fail(e) {
  11173. a(new te({
  11174. code: e.code || "UPLOAD_FAILED",
  11175. message: e.message || e.errMsg || "文件上传失败"
  11176. }));
  11177. }
  11178. });
  11179. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  11180. i({
  11181. loaded: e.totalBytesSent,
  11182. total: e.totalBytesExpectedToSend
  11183. });
  11184. });
  11185. });
  11186. }
  11187. }, {
  11188. key: "reportOSSUpload",
  11189. value: function reportOSSUpload(e) {
  11190. var t = {
  11191. method: "serverless.file.resource.report",
  11192. params: JSON.stringify(e)
  11193. };
  11194. return this.request(this.setupRequest(t));
  11195. }
  11196. }, {
  11197. key: "uploadFile",
  11198. value: function () {
  11199. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  11200. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, l, h, d, p, g, m, y, _, _e4, w;
  11201. return _regenerator.default.wrap(function _callee2$(_context2) {
  11202. while (1) {
  11203. switch (_context2.prev = _context2.next) {
  11204. case 0:
  11205. 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;
  11206. if (!("string" !== f(t))) {
  11207. _context2.next = 3;
  11208. break;
  11209. }
  11210. throw new te({
  11211. code: "INVALID_PARAM",
  11212. message: "cloudPath必须为字符串类型"
  11213. });
  11214. case 3:
  11215. if (t = t.trim()) {
  11216. _context2.next = 5;
  11217. break;
  11218. }
  11219. throw new te({
  11220. code: "INVALID_PARAM",
  11221. message: "cloudPath不可为空"
  11222. });
  11223. case 5:
  11224. if (!/:\/\//.test(t)) {
  11225. _context2.next = 7;
  11226. break;
  11227. }
  11228. throw new te({
  11229. code: "INVALID_PARAM",
  11230. message: "cloudPath不合法"
  11231. });
  11232. case 7:
  11233. o = i && i.envType || this.config.envType;
  11234. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  11235. _context2.next = 10;
  11236. break;
  11237. }
  11238. throw new te({
  11239. code: "INVALID_PARAM",
  11240. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  11241. });
  11242. case 10:
  11243. _context2.next = 12;
  11244. return this.getOSSUploadOptionsFromPath({
  11245. env: o,
  11246. filename: s ? t.split("/").pop() : t,
  11247. fileId: s ? t : void 0
  11248. });
  11249. case 12:
  11250. a = _context2.sent.result;
  11251. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  11252. u = a.securityToken;
  11253. l = a.accessKeyId;
  11254. h = a.signature;
  11255. d = a.host;
  11256. p = a.ossPath;
  11257. g = a.id;
  11258. m = a.policy;
  11259. y = a.ossCallbackUrl;
  11260. _ = {
  11261. "Cache-Control": "max-age=2592000",
  11262. "Content-Disposition": "attachment",
  11263. OSSAccessKeyId: l,
  11264. Signature: h,
  11265. host: d,
  11266. id: g,
  11267. key: p,
  11268. policy: m,
  11269. success_action_status: 200
  11270. };
  11271. if (u && (_["x-oss-security-token"] = u), y) {
  11272. _e4 = JSON.stringify({
  11273. callbackUrl: y,
  11274. callbackBody: JSON.stringify({
  11275. fileId: g,
  11276. spaceId: this.config.spaceId
  11277. }),
  11278. callbackBodyType: "application/json"
  11279. });
  11280. _.callback = le.toBase64(_e4);
  11281. }
  11282. w = {
  11283. url: "https://" + a.host,
  11284. formData: _,
  11285. fileName: "file",
  11286. name: "file",
  11287. filePath: e,
  11288. fileType: n
  11289. };
  11290. _context2.next = 27;
  11291. return this.uploadFileToOSS(Object.assign({}, w, {
  11292. onUploadProgress: r
  11293. }));
  11294. case 27:
  11295. if (!y) {
  11296. _context2.next = 29;
  11297. break;
  11298. }
  11299. return _context2.abrupt("return", {
  11300. success: !0,
  11301. filePath: e,
  11302. fileID: c
  11303. });
  11304. case 29:
  11305. _context2.next = 31;
  11306. return this.reportOSSUpload({
  11307. id: g
  11308. });
  11309. case 31:
  11310. if (!_context2.sent.success) {
  11311. _context2.next = 33;
  11312. break;
  11313. }
  11314. return _context2.abrupt("return", {
  11315. success: !0,
  11316. filePath: e,
  11317. fileID: c
  11318. });
  11319. case 33:
  11320. throw new te({
  11321. code: "UPLOAD_FAILED",
  11322. message: "文件上传失败"
  11323. });
  11324. case 34:
  11325. case "end":
  11326. return _context2.stop();
  11327. }
  11328. }
  11329. }, _callee2, this);
  11330. }));
  11331. function uploadFile(_x) {
  11332. return _uploadFile.apply(this, arguments);
  11333. }
  11334. return uploadFile;
  11335. }()
  11336. }, {
  11337. key: "getTempFileURL",
  11338. value: function getTempFileURL() {
  11339. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11340. e = _ref5.fileList;
  11341. return new Promise(function (t, n) {
  11342. Array.isArray(e) && 0 !== e.length || n(new te({
  11343. code: "INVALID_PARAM",
  11344. message: "fileList的元素必须是非空的字符串"
  11345. })), t({
  11346. fileList: e.map(function (e) {
  11347. return {
  11348. fileID: e,
  11349. tempFileURL: e
  11350. };
  11351. })
  11352. });
  11353. });
  11354. }
  11355. }, {
  11356. key: "getFileInfo",
  11357. value: function () {
  11358. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  11359. var _ref6,
  11360. e,
  11361. t,
  11362. _args3 = arguments;
  11363. return _regenerator.default.wrap(function _callee3$(_context3) {
  11364. while (1) {
  11365. switch (_context3.prev = _context3.next) {
  11366. case 0:
  11367. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  11368. if (!(!Array.isArray(e) || 0 === e.length)) {
  11369. _context3.next = 3;
  11370. break;
  11371. }
  11372. throw new te({
  11373. code: "INVALID_PARAM",
  11374. message: "fileList的元素必须是非空的字符串"
  11375. });
  11376. case 3:
  11377. t = {
  11378. method: "serverless.file.resource.info",
  11379. params: JSON.stringify({
  11380. id: e.map(function (e) {
  11381. return e.split("?")[0];
  11382. }).join(",")
  11383. })
  11384. };
  11385. _context3.next = 6;
  11386. return this.request(this.setupRequest(t));
  11387. case 6:
  11388. _context3.t0 = _context3.sent.result;
  11389. return _context3.abrupt("return", {
  11390. fileList: _context3.t0
  11391. });
  11392. case 8:
  11393. case "end":
  11394. return _context3.stop();
  11395. }
  11396. }
  11397. }, _callee3, this);
  11398. }));
  11399. function getFileInfo() {
  11400. return _getFileInfo.apply(this, arguments);
  11401. }
  11402. return getFileInfo;
  11403. }()
  11404. }]);
  11405. return he;
  11406. }();
  11407. var de = {
  11408. init: function init(e) {
  11409. var t = new he(e),
  11410. n = {
  11411. signInAnonymously: function signInAnonymously() {
  11412. return t.authorize();
  11413. },
  11414. getLoginState: function getLoginState() {
  11415. return Promise.resolve(!1);
  11416. }
  11417. };
  11418. return t.auth = function () {
  11419. return n;
  11420. }, t.customAuth = t.auth, t;
  11421. }
  11422. };
  11423. var pe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11424. var fe;
  11425. !function (e) {
  11426. e.local = "local", e.none = "none", e.session = "session";
  11427. }(fe || (fe = {}));
  11428. var ge = function ge() {},
  11429. me = n(function (e, t) {
  11430. var n;
  11431. e.exports = (n = r, function (e) {
  11432. var t = n,
  11433. s = t.lib,
  11434. r = s.WordArray,
  11435. i = s.Hasher,
  11436. o = t.algo,
  11437. a = [],
  11438. c = [];
  11439. !function () {
  11440. function t(t) {
  11441. for (var n = e.sqrt(t), s = 2; s <= n; s++) {
  11442. if (!(t % s)) return !1;
  11443. }
  11444. return !0;
  11445. }
  11446. function n(e) {
  11447. return 4294967296 * (e - (0 | e)) | 0;
  11448. }
  11449. for (var s = 2, r = 0; r < 64;) {
  11450. t(s) && (r < 8 && (a[r] = n(e.pow(s, .5))), c[r] = n(e.pow(s, 1 / 3)), r++), s++;
  11451. }
  11452. }();
  11453. var u = [],
  11454. l = o.SHA256 = i.extend({
  11455. _doReset: function _doReset() {
  11456. this._hash = new r.init(a.slice(0));
  11457. },
  11458. _doProcessBlock: function _doProcessBlock(e, t) {
  11459. 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++) {
  11460. if (p < 16) u[p] = 0 | e[t + p];else {
  11461. var f = u[p - 15],
  11462. g = (f << 25 | f >>> 7) ^ (f << 14 | f >>> 18) ^ f >>> 3,
  11463. m = u[p - 2],
  11464. y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
  11465. u[p] = g + u[p - 7] + y + u[p - 16];
  11466. }
  11467. var _ = s & r ^ s & i ^ r & i,
  11468. w = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
  11469. v = d + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & l ^ ~a & h) + c[p] + u[p];
  11470. d = h, h = l, l = a, a = o + v | 0, o = i, i = r, r = s, s = v + (w + _) | 0;
  11471. }
  11472. 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;
  11473. },
  11474. _doFinalize: function _doFinalize() {
  11475. var t = this._data,
  11476. n = t.words,
  11477. s = 8 * this._nDataBytes,
  11478. r = 8 * t.sigBytes;
  11479. 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;
  11480. },
  11481. clone: function clone() {
  11482. var e = i.clone.call(this);
  11483. return e._hash = this._hash.clone(), e;
  11484. }
  11485. });
  11486. t.SHA256 = i._createHelper(l), t.HmacSHA256 = i._createHmacHelper(l);
  11487. }(Math), n.SHA256);
  11488. }),
  11489. ye = me,
  11490. _e = n(function (e, t) {
  11491. e.exports = r.HmacSHA256;
  11492. });
  11493. var we = function we() {
  11494. var e;
  11495. if (!Promise) {
  11496. e = function e() {}, e.promise = {};
  11497. var _t3 = function _t3() {
  11498. throw new te({
  11499. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11500. });
  11501. };
  11502. return Object.defineProperty(e.promise, "then", {
  11503. get: _t3
  11504. }), Object.defineProperty(e.promise, "catch", {
  11505. get: _t3
  11506. }), e;
  11507. }
  11508. var t = new Promise(function (t, n) {
  11509. e = function e(_e5, s) {
  11510. return _e5 ? n(_e5) : t(s);
  11511. };
  11512. });
  11513. return e.promise = t, e;
  11514. };
  11515. function ve(e) {
  11516. return void 0 === e;
  11517. }
  11518. function Ie(e) {
  11519. return "[object Null]" === Object.prototype.toString.call(e);
  11520. }
  11521. var Se;
  11522. function be(e) {
  11523. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11524. var n;
  11525. var _iterator = _createForOfIteratorHelper(t),
  11526. _step;
  11527. try {
  11528. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11529. var _e6 = _step.value;
  11530. var _t4 = _e6.isMatch,
  11531. _n4 = _e6.genAdapter,
  11532. _s4 = _e6.runtime;
  11533. if (_t4()) return {
  11534. adapter: _n4(),
  11535. runtime: _s4
  11536. };
  11537. }
  11538. } catch (err) {
  11539. _iterator.e(err);
  11540. } finally {
  11541. _iterator.f();
  11542. }
  11543. }
  11544. !function (e) {
  11545. e.WEB = "web", e.WX_MP = "wx_mp";
  11546. }(Se || (Se = {}));
  11547. var ke = {
  11548. adapter: null,
  11549. runtime: void 0
  11550. },
  11551. Ae = ["anonymousUuidKey"];
  11552. var Pe = /*#__PURE__*/function (_ge) {
  11553. (0, _inherits2.default)(Pe, _ge);
  11554. var _super2 = _createSuper(Pe);
  11555. function Pe() {
  11556. var _this6;
  11557. (0, _classCallCheck2.default)(this, Pe);
  11558. _this6 = _super2.call(this), ke.adapter.root.tcbObject || (ke.adapter.root.tcbObject = {});
  11559. return _this6;
  11560. }
  11561. (0, _createClass2.default)(Pe, [{
  11562. key: "setItem",
  11563. value: function setItem(e, t) {
  11564. ke.adapter.root.tcbObject[e] = t;
  11565. }
  11566. }, {
  11567. key: "getItem",
  11568. value: function getItem(e) {
  11569. return ke.adapter.root.tcbObject[e];
  11570. }
  11571. }, {
  11572. key: "removeItem",
  11573. value: function removeItem(e) {
  11574. delete ke.adapter.root.tcbObject[e];
  11575. }
  11576. }, {
  11577. key: "clear",
  11578. value: function clear() {
  11579. delete ke.adapter.root.tcbObject;
  11580. }
  11581. }]);
  11582. return Pe;
  11583. }(ge);
  11584. function Te(e, t) {
  11585. switch (e) {
  11586. case "local":
  11587. return t.localStorage || new Pe();
  11588. case "none":
  11589. return new Pe();
  11590. default:
  11591. return t.sessionStorage || new Pe();
  11592. }
  11593. }
  11594. var Ce = /*#__PURE__*/function () {
  11595. function Ce(e) {
  11596. (0, _classCallCheck2.default)(this, Ce);
  11597. if (!this._storage) {
  11598. this._persistence = ke.adapter.primaryStorage || e.persistence, this._storage = Te(this._persistence, ke.adapter);
  11599. var _t5 = "access_token_".concat(e.env),
  11600. _n5 = "access_token_expire_".concat(e.env),
  11601. _s5 = "refresh_token_".concat(e.env),
  11602. _r = "anonymous_uuid_".concat(e.env),
  11603. _i = "login_type_".concat(e.env),
  11604. _o = "user_info_".concat(e.env);
  11605. this.keys = {
  11606. accessTokenKey: _t5,
  11607. accessTokenExpireKey: _n5,
  11608. refreshTokenKey: _s5,
  11609. anonymousUuidKey: _r,
  11610. loginTypeKey: _i,
  11611. userInfoKey: _o
  11612. };
  11613. }
  11614. }
  11615. (0, _createClass2.default)(Ce, [{
  11616. key: "updatePersistence",
  11617. value: function updatePersistence(e) {
  11618. if (e === this._persistence) return;
  11619. var t = "local" === this._persistence;
  11620. this._persistence = e;
  11621. var n = Te(e, ke.adapter);
  11622. for (var _e7 in this.keys) {
  11623. var _s6 = this.keys[_e7];
  11624. if (t && Ae.includes(_e7)) continue;
  11625. var _r2 = this._storage.getItem(_s6);
  11626. ve(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  11627. }
  11628. this._storage = n;
  11629. }
  11630. }, {
  11631. key: "setStore",
  11632. value: function setStore(e, t, n) {
  11633. if (!this._storage) return;
  11634. var s = {
  11635. version: n || "localCachev1",
  11636. content: t
  11637. },
  11638. r = JSON.stringify(s);
  11639. try {
  11640. this._storage.setItem(e, r);
  11641. } catch (e) {
  11642. throw e;
  11643. }
  11644. }
  11645. }, {
  11646. key: "getStore",
  11647. value: function getStore(e, t) {
  11648. try {
  11649. if (!this._storage) return;
  11650. } catch (e) {
  11651. return "";
  11652. }
  11653. t = t || "localCachev1";
  11654. var n = this._storage.getItem(e);
  11655. if (!n) return "";
  11656. if (n.indexOf(t) >= 0) {
  11657. return JSON.parse(n).content;
  11658. }
  11659. return "";
  11660. }
  11661. }, {
  11662. key: "removeStore",
  11663. value: function removeStore(e) {
  11664. this._storage.removeItem(e);
  11665. }
  11666. }]);
  11667. return Ce;
  11668. }();
  11669. var xe = {},
  11670. Oe = {};
  11671. function Ee(e) {
  11672. return xe[e];
  11673. }
  11674. var Le = /*#__PURE__*/(0, _createClass2.default)(function Le(e, t) {
  11675. (0, _classCallCheck2.default)(this, Le);
  11676. this.data = t || null, this.name = e;
  11677. });
  11678. var Re = /*#__PURE__*/function (_Le) {
  11679. (0, _inherits2.default)(Re, _Le);
  11680. var _super3 = _createSuper(Re);
  11681. function Re(e, t) {
  11682. var _this7;
  11683. (0, _classCallCheck2.default)(this, Re);
  11684. _this7 = _super3.call(this, "error", {
  11685. error: e,
  11686. data: t
  11687. }), _this7.error = e;
  11688. return _this7;
  11689. }
  11690. return (0, _createClass2.default)(Re);
  11691. }(Le);
  11692. var Ue = new ( /*#__PURE__*/function () {
  11693. function _class() {
  11694. (0, _classCallCheck2.default)(this, _class);
  11695. this._listeners = {};
  11696. }
  11697. (0, _createClass2.default)(_class, [{
  11698. key: "on",
  11699. value: function on(e, t) {
  11700. return function (e, t, n) {
  11701. n[e] = n[e] || [], n[e].push(t);
  11702. }(e, t, this._listeners), this;
  11703. }
  11704. }, {
  11705. key: "off",
  11706. value: function off(e, t) {
  11707. return function (e, t, n) {
  11708. if (n && n[e]) {
  11709. var _s7 = n[e].indexOf(t);
  11710. -1 !== _s7 && n[e].splice(_s7, 1);
  11711. }
  11712. }(e, t, this._listeners), this;
  11713. }
  11714. }, {
  11715. key: "fire",
  11716. value: function fire(e, t) {
  11717. if (e instanceof Re) return console.error(e.error), this;
  11718. var n = "string" == typeof e ? new Le(e, t || {}) : e;
  11719. var s = n.name;
  11720. if (this._listens(s)) {
  11721. n.target = this;
  11722. var _e8 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  11723. var _iterator2 = _createForOfIteratorHelper(_e8),
  11724. _step2;
  11725. try {
  11726. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  11727. var _t6 = _step2.value;
  11728. _t6.call(this, n);
  11729. }
  11730. } catch (err) {
  11731. _iterator2.e(err);
  11732. } finally {
  11733. _iterator2.f();
  11734. }
  11735. }
  11736. return this;
  11737. }
  11738. }, {
  11739. key: "_listens",
  11740. value: function _listens(e) {
  11741. return this._listeners[e] && this._listeners[e].length > 0;
  11742. }
  11743. }]);
  11744. return _class;
  11745. }())();
  11746. function Ne(e, t) {
  11747. Ue.on(e, t);
  11748. }
  11749. function De(e) {
  11750. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11751. Ue.fire(e, t);
  11752. }
  11753. function Me(e, t) {
  11754. Ue.off(e, t);
  11755. }
  11756. var qe = "loginStateChanged",
  11757. Fe = "loginStateExpire",
  11758. Ke = "loginTypeChanged",
  11759. je = "anonymousConverted",
  11760. Be = "refreshAccessToken";
  11761. var $e;
  11762. !function (e) {
  11763. 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";
  11764. }($e || ($e = {}));
  11765. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  11766. He = {
  11767. "X-SDK-Version": "1.3.5"
  11768. };
  11769. function ze(e, t, n) {
  11770. var s = e[t];
  11771. e[t] = function (t) {
  11772. var r = {},
  11773. i = {};
  11774. n.forEach(function (n) {
  11775. var _n$call = n.call(e, t),
  11776. s = _n$call.data,
  11777. o = _n$call.headers;
  11778. Object.assign(r, s), Object.assign(i, o);
  11779. });
  11780. var o = t.data;
  11781. return o && function () {
  11782. var e;
  11783. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e9 in r) {
  11784. o.append(_e9, r[_e9]);
  11785. }
  11786. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  11787. };
  11788. }
  11789. function Je() {
  11790. var e = Math.random().toString(16).slice(2);
  11791. return {
  11792. data: {
  11793. seqId: e
  11794. },
  11795. headers: _objectSpread(_objectSpread({}, He), {}, {
  11796. "x-seqid": e
  11797. })
  11798. };
  11799. }
  11800. var Ve = /*#__PURE__*/function () {
  11801. function Ve() {
  11802. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11803. (0, _classCallCheck2.default)(this, Ve);
  11804. var t;
  11805. this.config = e, this._reqClass = new ke.adapter.reqClass({
  11806. timeout: this.config.timeout,
  11807. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  11808. restrictedMethods: ["post"]
  11809. }), this._cache = Ee(this.config.env), this._localCache = (t = this.config.env, Oe[t]), ze(this._reqClass, "post", [Je]), ze(this._reqClass, "upload", [Je]), ze(this._reqClass, "download", [Je]);
  11810. }
  11811. (0, _createClass2.default)(Ve, [{
  11812. key: "post",
  11813. value: function () {
  11814. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  11815. return _regenerator.default.wrap(function _callee4$(_context4) {
  11816. while (1) {
  11817. switch (_context4.prev = _context4.next) {
  11818. case 0:
  11819. _context4.next = 2;
  11820. return this._reqClass.post(e);
  11821. case 2:
  11822. return _context4.abrupt("return", _context4.sent);
  11823. case 3:
  11824. case "end":
  11825. return _context4.stop();
  11826. }
  11827. }
  11828. }, _callee4, this);
  11829. }));
  11830. function post(_x2) {
  11831. return _post.apply(this, arguments);
  11832. }
  11833. return post;
  11834. }()
  11835. }, {
  11836. key: "upload",
  11837. value: function () {
  11838. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  11839. return _regenerator.default.wrap(function _callee5$(_context5) {
  11840. while (1) {
  11841. switch (_context5.prev = _context5.next) {
  11842. case 0:
  11843. _context5.next = 2;
  11844. return this._reqClass.upload(e);
  11845. case 2:
  11846. return _context5.abrupt("return", _context5.sent);
  11847. case 3:
  11848. case "end":
  11849. return _context5.stop();
  11850. }
  11851. }
  11852. }, _callee5, this);
  11853. }));
  11854. function upload(_x3) {
  11855. return _upload.apply(this, arguments);
  11856. }
  11857. return upload;
  11858. }()
  11859. }, {
  11860. key: "download",
  11861. value: function () {
  11862. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  11863. return _regenerator.default.wrap(function _callee6$(_context6) {
  11864. while (1) {
  11865. switch (_context6.prev = _context6.next) {
  11866. case 0:
  11867. _context6.next = 2;
  11868. return this._reqClass.download(e);
  11869. case 2:
  11870. return _context6.abrupt("return", _context6.sent);
  11871. case 3:
  11872. case "end":
  11873. return _context6.stop();
  11874. }
  11875. }
  11876. }, _callee6, this);
  11877. }));
  11878. function download(_x4) {
  11879. return _download.apply(this, arguments);
  11880. }
  11881. return download;
  11882. }()
  11883. }, {
  11884. key: "refreshAccessToken",
  11885. value: function () {
  11886. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  11887. var e, t;
  11888. return _regenerator.default.wrap(function _callee7$(_context7) {
  11889. while (1) {
  11890. switch (_context7.prev = _context7.next) {
  11891. case 0:
  11892. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11893. _context7.prev = 1;
  11894. _context7.next = 4;
  11895. return this._refreshAccessTokenPromise;
  11896. case 4:
  11897. e = _context7.sent;
  11898. _context7.next = 10;
  11899. break;
  11900. case 7:
  11901. _context7.prev = 7;
  11902. _context7.t0 = _context7["catch"](1);
  11903. t = _context7.t0;
  11904. case 10:
  11905. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  11906. _context7.next = 12;
  11907. break;
  11908. }
  11909. throw t;
  11910. case 12:
  11911. return _context7.abrupt("return", e);
  11912. case 13:
  11913. case "end":
  11914. return _context7.stop();
  11915. }
  11916. }
  11917. }, _callee7, this, [[1, 7]]);
  11918. }));
  11919. function refreshAccessToken() {
  11920. return _refreshAccessToken2.apply(this, arguments);
  11921. }
  11922. return refreshAccessToken;
  11923. }()
  11924. }, {
  11925. key: "_refreshAccessToken",
  11926. value: function () {
  11927. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  11928. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e10, _e11, _t7, _s8;
  11929. return _regenerator.default.wrap(function _callee8$(_context8) {
  11930. while (1) {
  11931. switch (_context8.prev = _context8.next) {
  11932. case 0:
  11933. _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;
  11934. this._cache.removeStore(e), this._cache.removeStore(t);
  11935. i = this._cache.getStore(n);
  11936. if (i) {
  11937. _context8.next = 5;
  11938. break;
  11939. }
  11940. throw new te({
  11941. message: "未登录CloudBase"
  11942. });
  11943. case 5:
  11944. o = {
  11945. refresh_token: i
  11946. };
  11947. _context8.next = 8;
  11948. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  11949. case 8:
  11950. a = _context8.sent;
  11951. if (!a.data.code) {
  11952. _context8.next = 21;
  11953. break;
  11954. }
  11955. _e10 = a.data.code;
  11956. if (!("SIGN_PARAM_INVALID" === _e10 || "REFRESH_TOKEN_EXPIRED" === _e10 || "INVALID_REFRESH_TOKEN" === _e10)) {
  11957. _context8.next = 20;
  11958. break;
  11959. }
  11960. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e10)) {
  11961. _context8.next = 19;
  11962. break;
  11963. }
  11964. _e11 = this._cache.getStore(r);
  11965. _t7 = this._cache.getStore(n);
  11966. _context8.next = 17;
  11967. return this.send("auth.signInAnonymously", {
  11968. anonymous_uuid: _e11,
  11969. refresh_token: _t7
  11970. });
  11971. case 17:
  11972. _s8 = _context8.sent;
  11973. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  11974. case 19:
  11975. De(Fe), this._cache.removeStore(n);
  11976. case 20:
  11977. throw new te({
  11978. code: a.data.code,
  11979. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  11980. });
  11981. case 21:
  11982. if (!a.data.access_token) {
  11983. _context8.next = 23;
  11984. break;
  11985. }
  11986. return _context8.abrupt("return", (De(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  11987. accessToken: a.data.access_token,
  11988. accessTokenExpire: a.data.access_token_expire
  11989. }));
  11990. case 23:
  11991. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  11992. case 24:
  11993. case "end":
  11994. return _context8.stop();
  11995. }
  11996. }
  11997. }, _callee8, this);
  11998. }));
  11999. function _refreshAccessToken() {
  12000. return _refreshAccessToken3.apply(this, arguments);
  12001. }
  12002. return _refreshAccessToken;
  12003. }()
  12004. }, {
  12005. key: "getAccessToken",
  12006. value: function () {
  12007. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  12008. var _this$_cache$keys2, e, t, n, s, r, i;
  12009. return _regenerator.default.wrap(function _callee9$(_context9) {
  12010. while (1) {
  12011. switch (_context9.prev = _context9.next) {
  12012. case 0:
  12013. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  12014. if (this._cache.getStore(n)) {
  12015. _context9.next = 3;
  12016. break;
  12017. }
  12018. throw new te({
  12019. message: "refresh token不存在,登录状态异常"
  12020. });
  12021. case 3:
  12022. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  12023. _context9.t0 = this._shouldRefreshAccessTokenHook;
  12024. if (!_context9.t0) {
  12025. _context9.next = 9;
  12026. break;
  12027. }
  12028. _context9.next = 8;
  12029. return this._shouldRefreshAccessTokenHook(s, r);
  12030. case 8:
  12031. _context9.t0 = !_context9.sent;
  12032. case 9:
  12033. _context9.t1 = _context9.t0;
  12034. if (!_context9.t1) {
  12035. _context9.next = 12;
  12036. break;
  12037. }
  12038. i = !1;
  12039. case 12:
  12040. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  12041. accessToken: s,
  12042. accessTokenExpire: r
  12043. });
  12044. case 13:
  12045. case "end":
  12046. return _context9.stop();
  12047. }
  12048. }
  12049. }, _callee9, this);
  12050. }));
  12051. function getAccessToken() {
  12052. return _getAccessToken.apply(this, arguments);
  12053. }
  12054. return getAccessToken;
  12055. }()
  12056. }, {
  12057. key: "request",
  12058. value: function () {
  12059. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  12060. var s, r, i, _e12, o, _e13, _e14, a, c, u, l, h, d, p, f, g;
  12061. return _regenerator.default.wrap(function _callee10$(_context10) {
  12062. while (1) {
  12063. switch (_context10.prev = _context10.next) {
  12064. case 0:
  12065. s = "x-tcb-trace_".concat(this.config.env);
  12066. r = "application/x-www-form-urlencoded";
  12067. i = _objectSpread({
  12068. action: e,
  12069. env: this.config.env,
  12070. dataVersion: "2019-08-16"
  12071. }, t);
  12072. if (!(-1 === We.indexOf(e))) {
  12073. _context10.next = 10;
  12074. break;
  12075. }
  12076. _e12 = this._cache.keys.refreshTokenKey;
  12077. _context10.t0 = this._cache.getStore(_e12);
  12078. if (!_context10.t0) {
  12079. _context10.next = 10;
  12080. break;
  12081. }
  12082. _context10.next = 9;
  12083. return this.getAccessToken();
  12084. case 9:
  12085. i.access_token = _context10.sent.accessToken;
  12086. case 10:
  12087. if ("storage.uploadFile" === e) {
  12088. o = new FormData();
  12089. for (_e13 in o) {
  12090. o.hasOwnProperty(_e13) && void 0 !== o[_e13] && o.append(_e13, i[_e13]);
  12091. }
  12092. r = "multipart/form-data";
  12093. } else {
  12094. r = "application/json", o = {};
  12095. for (_e14 in i) {
  12096. void 0 !== i[_e14] && (o[_e14] = i[_e14]);
  12097. }
  12098. }
  12099. a = {
  12100. headers: {
  12101. "content-type": r
  12102. }
  12103. };
  12104. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  12105. c = this._localCache.getStore(s);
  12106. c && (a.headers["X-TCB-Trace"] = c);
  12107. u = t.parse, l = t.inQuery, h = t.search;
  12108. d = {
  12109. env: this.config.env
  12110. };
  12111. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  12112. p = function (e, t) {
  12113. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12114. var s = /\?/.test(t);
  12115. var r = "";
  12116. for (var _e15 in n) {
  12117. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e15, "=").concat(encodeURIComponent(n[_e15]));
  12118. }
  12119. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  12120. }(pe, "//tcb-api.tencentcloudapi.com/web", d);
  12121. h && (p += h);
  12122. _context10.next = 22;
  12123. return this.post(_objectSpread({
  12124. url: p,
  12125. data: o
  12126. }, a));
  12127. case 22:
  12128. f = _context10.sent;
  12129. g = f.header && f.header["x-tcb-trace"];
  12130. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  12131. _context10.next = 26;
  12132. break;
  12133. }
  12134. throw new te({
  12135. code: "NETWORK_ERROR",
  12136. message: "network request error"
  12137. });
  12138. case 26:
  12139. return _context10.abrupt("return", f);
  12140. case 27:
  12141. case "end":
  12142. return _context10.stop();
  12143. }
  12144. }
  12145. }, _callee10, this);
  12146. }));
  12147. function request(_x5, _x6, _x7) {
  12148. return _request.apply(this, arguments);
  12149. }
  12150. return request;
  12151. }()
  12152. }, {
  12153. key: "send",
  12154. value: function () {
  12155. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  12156. var t,
  12157. n,
  12158. _n6,
  12159. _args11 = arguments;
  12160. return _regenerator.default.wrap(function _callee11$(_context11) {
  12161. while (1) {
  12162. switch (_context11.prev = _context11.next) {
  12163. case 0:
  12164. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  12165. _context11.next = 3;
  12166. return this.request(e, t, {
  12167. onUploadProgress: t.onUploadProgress
  12168. });
  12169. case 3:
  12170. n = _context11.sent;
  12171. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  12172. _context11.next = 13;
  12173. break;
  12174. }
  12175. _context11.next = 7;
  12176. return this.refreshAccessToken();
  12177. case 7:
  12178. _context11.next = 9;
  12179. return this.request(e, t, {
  12180. onUploadProgress: t.onUploadProgress
  12181. });
  12182. case 9:
  12183. _n6 = _context11.sent;
  12184. if (!_n6.data.code) {
  12185. _context11.next = 12;
  12186. break;
  12187. }
  12188. throw new te({
  12189. code: _n6.data.code,
  12190. message: _n6.data.message
  12191. });
  12192. case 12:
  12193. return _context11.abrupt("return", _n6.data);
  12194. case 13:
  12195. if (!n.data.code) {
  12196. _context11.next = 15;
  12197. break;
  12198. }
  12199. throw new te({
  12200. code: n.data.code,
  12201. message: n.data.message
  12202. });
  12203. case 15:
  12204. return _context11.abrupt("return", n.data);
  12205. case 16:
  12206. case "end":
  12207. return _context11.stop();
  12208. }
  12209. }
  12210. }, _callee11, this);
  12211. }));
  12212. function send(_x8) {
  12213. return _send.apply(this, arguments);
  12214. }
  12215. return send;
  12216. }()
  12217. }, {
  12218. key: "setRefreshToken",
  12219. value: function setRefreshToken(e) {
  12220. var _this$_cache$keys3 = this._cache.keys,
  12221. t = _this$_cache$keys3.accessTokenKey,
  12222. n = _this$_cache$keys3.accessTokenExpireKey,
  12223. s = _this$_cache$keys3.refreshTokenKey;
  12224. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12225. }
  12226. }]);
  12227. return Ve;
  12228. }();
  12229. var Ge = {};
  12230. function Ye(e) {
  12231. return Ge[e];
  12232. }
  12233. var Qe = /*#__PURE__*/function () {
  12234. function Qe(e) {
  12235. (0, _classCallCheck2.default)(this, Qe);
  12236. this.config = e, this._cache = Ee(e.env), this._request = Ye(e.env);
  12237. }
  12238. (0, _createClass2.default)(Qe, [{
  12239. key: "setRefreshToken",
  12240. value: function setRefreshToken(e) {
  12241. var _this$_cache$keys4 = this._cache.keys,
  12242. t = _this$_cache$keys4.accessTokenKey,
  12243. n = _this$_cache$keys4.accessTokenExpireKey,
  12244. s = _this$_cache$keys4.refreshTokenKey;
  12245. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12246. }
  12247. }, {
  12248. key: "setAccessToken",
  12249. value: function setAccessToken(e, t) {
  12250. var _this$_cache$keys5 = this._cache.keys,
  12251. n = _this$_cache$keys5.accessTokenKey,
  12252. s = _this$_cache$keys5.accessTokenExpireKey;
  12253. this._cache.setStore(n, e), this._cache.setStore(s, t);
  12254. }
  12255. }, {
  12256. key: "refreshUserInfo",
  12257. value: function () {
  12258. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  12259. var _yield$this$_request$, e;
  12260. return _regenerator.default.wrap(function _callee12$(_context12) {
  12261. while (1) {
  12262. switch (_context12.prev = _context12.next) {
  12263. case 0:
  12264. _context12.next = 2;
  12265. return this._request.send("auth.getUserInfo", {});
  12266. case 2:
  12267. _yield$this$_request$ = _context12.sent;
  12268. e = _yield$this$_request$.data;
  12269. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  12270. case 5:
  12271. case "end":
  12272. return _context12.stop();
  12273. }
  12274. }
  12275. }, _callee12, this);
  12276. }));
  12277. function refreshUserInfo() {
  12278. return _refreshUserInfo.apply(this, arguments);
  12279. }
  12280. return refreshUserInfo;
  12281. }()
  12282. }, {
  12283. key: "setLocalUserInfo",
  12284. value: function setLocalUserInfo(e) {
  12285. var t = this._cache.keys.userInfoKey;
  12286. this._cache.setStore(t, e);
  12287. }
  12288. }]);
  12289. return Qe;
  12290. }();
  12291. var Xe = /*#__PURE__*/function () {
  12292. function Xe(e) {
  12293. (0, _classCallCheck2.default)(this, Xe);
  12294. if (!e) throw new te({
  12295. code: "PARAM_ERROR",
  12296. message: "envId is not defined"
  12297. });
  12298. this._envId = e, this._cache = Ee(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  12299. }
  12300. (0, _createClass2.default)(Xe, [{
  12301. key: "linkWithTicket",
  12302. value: function linkWithTicket(e) {
  12303. if ("string" != typeof e) throw new te({
  12304. code: "PARAM_ERROR",
  12305. message: "ticket must be string"
  12306. });
  12307. return this._request.send("auth.linkWithTicket", {
  12308. ticket: e
  12309. });
  12310. }
  12311. }, {
  12312. key: "linkWithRedirect",
  12313. value: function linkWithRedirect(e) {
  12314. e.signInWithRedirect();
  12315. }
  12316. }, {
  12317. key: "updatePassword",
  12318. value: function updatePassword(e, t) {
  12319. return this._request.send("auth.updatePassword", {
  12320. oldPassword: t,
  12321. newPassword: e
  12322. });
  12323. }
  12324. }, {
  12325. key: "updateEmail",
  12326. value: function updateEmail(e) {
  12327. return this._request.send("auth.updateEmail", {
  12328. newEmail: e
  12329. });
  12330. }
  12331. }, {
  12332. key: "updateUsername",
  12333. value: function updateUsername(e) {
  12334. if ("string" != typeof e) throw new te({
  12335. code: "PARAM_ERROR",
  12336. message: "username must be a string"
  12337. });
  12338. return this._request.send("auth.updateUsername", {
  12339. username: e
  12340. });
  12341. }
  12342. }, {
  12343. key: "getLinkedUidList",
  12344. value: function () {
  12345. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  12346. var _yield$this$_request$2, e, t, n;
  12347. return _regenerator.default.wrap(function _callee13$(_context13) {
  12348. while (1) {
  12349. switch (_context13.prev = _context13.next) {
  12350. case 0:
  12351. _context13.next = 2;
  12352. return this._request.send("auth.getLinkedUidList", {});
  12353. case 2:
  12354. _yield$this$_request$2 = _context13.sent;
  12355. e = _yield$this$_request$2.data;
  12356. t = !1;
  12357. n = e.users;
  12358. return _context13.abrupt("return", (n.forEach(function (e) {
  12359. e.wxOpenId && e.wxPublicId && (t = !0);
  12360. }), {
  12361. users: n,
  12362. hasPrimaryUid: t
  12363. }));
  12364. case 7:
  12365. case "end":
  12366. return _context13.stop();
  12367. }
  12368. }
  12369. }, _callee13, this);
  12370. }));
  12371. function getLinkedUidList() {
  12372. return _getLinkedUidList.apply(this, arguments);
  12373. }
  12374. return getLinkedUidList;
  12375. }()
  12376. }, {
  12377. key: "setPrimaryUid",
  12378. value: function setPrimaryUid(e) {
  12379. return this._request.send("auth.setPrimaryUid", {
  12380. uid: e
  12381. });
  12382. }
  12383. }, {
  12384. key: "unlink",
  12385. value: function unlink(e) {
  12386. return this._request.send("auth.unlink", {
  12387. platform: e
  12388. });
  12389. }
  12390. }, {
  12391. key: "update",
  12392. value: function () {
  12393. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  12394. var t, n, s, r, i, o, _yield$this$_request$3, a;
  12395. return _regenerator.default.wrap(function _callee14$(_context14) {
  12396. while (1) {
  12397. switch (_context14.prev = _context14.next) {
  12398. case 0:
  12399. t = e.nickName;
  12400. n = e.gender;
  12401. s = e.avatarUrl;
  12402. r = e.province;
  12403. i = e.country;
  12404. o = e.city;
  12405. _context14.next = 8;
  12406. return this._request.send("auth.updateUserInfo", {
  12407. nickName: t,
  12408. gender: n,
  12409. avatarUrl: s,
  12410. province: r,
  12411. country: i,
  12412. city: o
  12413. });
  12414. case 8:
  12415. _yield$this$_request$3 = _context14.sent;
  12416. a = _yield$this$_request$3.data;
  12417. this.setLocalUserInfo(a);
  12418. case 11:
  12419. case "end":
  12420. return _context14.stop();
  12421. }
  12422. }
  12423. }, _callee14, this);
  12424. }));
  12425. function update(_x9) {
  12426. return _update.apply(this, arguments);
  12427. }
  12428. return update;
  12429. }()
  12430. }, {
  12431. key: "refresh",
  12432. value: function () {
  12433. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  12434. var _yield$this$_request$4, e;
  12435. return _regenerator.default.wrap(function _callee15$(_context15) {
  12436. while (1) {
  12437. switch (_context15.prev = _context15.next) {
  12438. case 0:
  12439. _context15.next = 2;
  12440. return this._request.send("auth.getUserInfo", {});
  12441. case 2:
  12442. _yield$this$_request$4 = _context15.sent;
  12443. e = _yield$this$_request$4.data;
  12444. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  12445. case 5:
  12446. case "end":
  12447. return _context15.stop();
  12448. }
  12449. }
  12450. }, _callee15, this);
  12451. }));
  12452. function refresh() {
  12453. return _refresh.apply(this, arguments);
  12454. }
  12455. return refresh;
  12456. }()
  12457. }, {
  12458. key: "setUserInfo",
  12459. value: function setUserInfo() {
  12460. var _this8 = this;
  12461. var e = this._cache.keys.userInfoKey,
  12462. t = this._cache.getStore(e);
  12463. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  12464. _this8[e] = t[e];
  12465. }), this.location = {
  12466. country: t.country,
  12467. province: t.province,
  12468. city: t.city
  12469. };
  12470. }
  12471. }, {
  12472. key: "setLocalUserInfo",
  12473. value: function setLocalUserInfo(e) {
  12474. var t = this._cache.keys.userInfoKey;
  12475. this._cache.setStore(t, e), this.setUserInfo();
  12476. }
  12477. }]);
  12478. return Xe;
  12479. }();
  12480. var Ze = /*#__PURE__*/function () {
  12481. function Ze(e) {
  12482. (0, _classCallCheck2.default)(this, Ze);
  12483. if (!e) throw new te({
  12484. code: "PARAM_ERROR",
  12485. message: "envId is not defined"
  12486. });
  12487. this._cache = Ee(e);
  12488. var _this$_cache$keys6 = this._cache.keys,
  12489. t = _this$_cache$keys6.refreshTokenKey,
  12490. n = _this$_cache$keys6.accessTokenKey,
  12491. s = _this$_cache$keys6.accessTokenExpireKey,
  12492. r = this._cache.getStore(t),
  12493. i = this._cache.getStore(n),
  12494. o = this._cache.getStore(s);
  12495. this.credential = {
  12496. refreshToken: r,
  12497. accessToken: i,
  12498. accessTokenExpire: o
  12499. }, this.user = new Xe(e);
  12500. }
  12501. (0, _createClass2.default)(Ze, [{
  12502. key: "isAnonymousAuth",
  12503. get: function get() {
  12504. return this.loginType === $e.ANONYMOUS;
  12505. }
  12506. }, {
  12507. key: "isCustomAuth",
  12508. get: function get() {
  12509. return this.loginType === $e.CUSTOM;
  12510. }
  12511. }, {
  12512. key: "isWeixinAuth",
  12513. get: function get() {
  12514. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  12515. }
  12516. }, {
  12517. key: "loginType",
  12518. get: function get() {
  12519. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12520. }
  12521. }]);
  12522. return Ze;
  12523. }();
  12524. var et = /*#__PURE__*/function (_Qe) {
  12525. (0, _inherits2.default)(et, _Qe);
  12526. var _super4 = _createSuper(et);
  12527. function et() {
  12528. (0, _classCallCheck2.default)(this, et);
  12529. return _super4.apply(this, arguments);
  12530. }
  12531. (0, _createClass2.default)(et, [{
  12532. key: "signIn",
  12533. value: function () {
  12534. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12535. var _this$_cache$keys7, e, t, n, s, r, _e16;
  12536. return _regenerator.default.wrap(function _callee16$(_context16) {
  12537. while (1) {
  12538. switch (_context16.prev = _context16.next) {
  12539. case 0:
  12540. this._cache.updatePersistence("local");
  12541. _this$_cache$keys7 = this._cache.keys;
  12542. e = _this$_cache$keys7.anonymousUuidKey;
  12543. t = _this$_cache$keys7.refreshTokenKey;
  12544. n = this._cache.getStore(e) || void 0;
  12545. s = this._cache.getStore(t) || void 0;
  12546. _context16.next = 8;
  12547. return this._request.send("auth.signInAnonymously", {
  12548. anonymous_uuid: n,
  12549. refresh_token: s
  12550. });
  12551. case 8:
  12552. r = _context16.sent;
  12553. if (!(r.uuid && r.refresh_token)) {
  12554. _context16.next = 20;
  12555. break;
  12556. }
  12557. this._setAnonymousUUID(r.uuid);
  12558. this.setRefreshToken(r.refresh_token);
  12559. _context16.next = 14;
  12560. return this._request.refreshAccessToken();
  12561. case 14:
  12562. De(qe);
  12563. De(Ke, {
  12564. env: this.config.env,
  12565. loginType: $e.ANONYMOUS,
  12566. persistence: "local"
  12567. });
  12568. _e16 = new Ze(this.config.env);
  12569. _context16.next = 19;
  12570. return _e16.user.refresh();
  12571. case 19:
  12572. return _context16.abrupt("return", _e16);
  12573. case 20:
  12574. throw new te({
  12575. message: "匿名登录失败"
  12576. });
  12577. case 21:
  12578. case "end":
  12579. return _context16.stop();
  12580. }
  12581. }
  12582. }, _callee16, this);
  12583. }));
  12584. function signIn() {
  12585. return _signIn.apply(this, arguments);
  12586. }
  12587. return signIn;
  12588. }()
  12589. }, {
  12590. key: "linkAndRetrieveDataWithTicket",
  12591. value: function () {
  12592. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12593. var _this$_cache$keys8, t, n, s, r, i;
  12594. return _regenerator.default.wrap(function _callee17$(_context17) {
  12595. while (1) {
  12596. switch (_context17.prev = _context17.next) {
  12597. case 0:
  12598. _this$_cache$keys8 = this._cache.keys;
  12599. t = _this$_cache$keys8.anonymousUuidKey;
  12600. n = _this$_cache$keys8.refreshTokenKey;
  12601. s = this._cache.getStore(t);
  12602. r = this._cache.getStore(n);
  12603. _context17.next = 7;
  12604. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12605. anonymous_uuid: s,
  12606. refresh_token: r,
  12607. ticket: e
  12608. });
  12609. case 7:
  12610. i = _context17.sent;
  12611. if (!i.refresh_token) {
  12612. _context17.next = 16;
  12613. break;
  12614. }
  12615. this._clearAnonymousUUID();
  12616. this.setRefreshToken(i.refresh_token);
  12617. _context17.next = 13;
  12618. return this._request.refreshAccessToken();
  12619. case 13:
  12620. De(je, {
  12621. env: this.config.env
  12622. });
  12623. De(Ke, {
  12624. loginType: $e.CUSTOM,
  12625. persistence: "local"
  12626. });
  12627. return _context17.abrupt("return", {
  12628. credential: {
  12629. refreshToken: i.refresh_token
  12630. }
  12631. });
  12632. case 16:
  12633. throw new te({
  12634. message: "匿名转化失败"
  12635. });
  12636. case 17:
  12637. case "end":
  12638. return _context17.stop();
  12639. }
  12640. }
  12641. }, _callee17, this);
  12642. }));
  12643. function linkAndRetrieveDataWithTicket(_x10) {
  12644. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  12645. }
  12646. return linkAndRetrieveDataWithTicket;
  12647. }()
  12648. }, {
  12649. key: "_setAnonymousUUID",
  12650. value: function _setAnonymousUUID(e) {
  12651. var _this$_cache$keys9 = this._cache.keys,
  12652. t = _this$_cache$keys9.anonymousUuidKey,
  12653. n = _this$_cache$keys9.loginTypeKey;
  12654. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  12655. }
  12656. }, {
  12657. key: "_clearAnonymousUUID",
  12658. value: function _clearAnonymousUUID() {
  12659. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12660. }
  12661. }]);
  12662. return et;
  12663. }(Qe);
  12664. var tt = /*#__PURE__*/function (_Qe2) {
  12665. (0, _inherits2.default)(tt, _Qe2);
  12666. var _super5 = _createSuper(tt);
  12667. function tt() {
  12668. (0, _classCallCheck2.default)(this, tt);
  12669. return _super5.apply(this, arguments);
  12670. }
  12671. (0, _createClass2.default)(tt, [{
  12672. key: "signIn",
  12673. value: function () {
  12674. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  12675. var t, n;
  12676. return _regenerator.default.wrap(function _callee18$(_context18) {
  12677. while (1) {
  12678. switch (_context18.prev = _context18.next) {
  12679. case 0:
  12680. if (!("string" != typeof e)) {
  12681. _context18.next = 2;
  12682. break;
  12683. }
  12684. throw new te({
  12685. code: "PARAM_ERROR",
  12686. message: "ticket must be a string"
  12687. });
  12688. case 2:
  12689. t = this._cache.keys.refreshTokenKey;
  12690. _context18.next = 5;
  12691. return this._request.send("auth.signInWithTicket", {
  12692. ticket: e,
  12693. refresh_token: this._cache.getStore(t) || ""
  12694. });
  12695. case 5:
  12696. n = _context18.sent;
  12697. if (!n.refresh_token) {
  12698. _context18.next = 15;
  12699. break;
  12700. }
  12701. this.setRefreshToken(n.refresh_token);
  12702. _context18.next = 10;
  12703. return this._request.refreshAccessToken();
  12704. case 10:
  12705. De(qe);
  12706. De(Ke, {
  12707. env: this.config.env,
  12708. loginType: $e.CUSTOM,
  12709. persistence: this.config.persistence
  12710. });
  12711. _context18.next = 14;
  12712. return this.refreshUserInfo();
  12713. case 14:
  12714. return _context18.abrupt("return", new Ze(this.config.env));
  12715. case 15:
  12716. throw new te({
  12717. message: "自定义登录失败"
  12718. });
  12719. case 16:
  12720. case "end":
  12721. return _context18.stop();
  12722. }
  12723. }
  12724. }, _callee18, this);
  12725. }));
  12726. function signIn(_x11) {
  12727. return _signIn2.apply(this, arguments);
  12728. }
  12729. return signIn;
  12730. }()
  12731. }]);
  12732. return tt;
  12733. }(Qe);
  12734. var nt = /*#__PURE__*/function (_Qe3) {
  12735. (0, _inherits2.default)(nt, _Qe3);
  12736. var _super6 = _createSuper(nt);
  12737. function nt() {
  12738. (0, _classCallCheck2.default)(this, nt);
  12739. return _super6.apply(this, arguments);
  12740. }
  12741. (0, _createClass2.default)(nt, [{
  12742. key: "signIn",
  12743. value: function () {
  12744. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  12745. var n, s, r, i, o;
  12746. return _regenerator.default.wrap(function _callee19$(_context19) {
  12747. while (1) {
  12748. switch (_context19.prev = _context19.next) {
  12749. case 0:
  12750. if (!("string" != typeof e)) {
  12751. _context19.next = 2;
  12752. break;
  12753. }
  12754. throw new te({
  12755. code: "PARAM_ERROR",
  12756. message: "email must be a string"
  12757. });
  12758. case 2:
  12759. n = this._cache.keys.refreshTokenKey;
  12760. _context19.next = 5;
  12761. return this._request.send("auth.signIn", {
  12762. loginType: "EMAIL",
  12763. email: e,
  12764. password: t,
  12765. refresh_token: this._cache.getStore(n) || ""
  12766. });
  12767. case 5:
  12768. s = _context19.sent;
  12769. r = s.refresh_token;
  12770. i = s.access_token;
  12771. o = s.access_token_expire;
  12772. if (!r) {
  12773. _context19.next = 22;
  12774. break;
  12775. }
  12776. this.setRefreshToken(r);
  12777. if (!(i && o)) {
  12778. _context19.next = 15;
  12779. break;
  12780. }
  12781. this.setAccessToken(i, o);
  12782. _context19.next = 17;
  12783. break;
  12784. case 15:
  12785. _context19.next = 17;
  12786. return this._request.refreshAccessToken();
  12787. case 17:
  12788. _context19.next = 19;
  12789. return this.refreshUserInfo();
  12790. case 19:
  12791. De(qe);
  12792. De(Ke, {
  12793. env: this.config.env,
  12794. loginType: $e.EMAIL,
  12795. persistence: this.config.persistence
  12796. });
  12797. return _context19.abrupt("return", new Ze(this.config.env));
  12798. case 22:
  12799. throw s.code ? new te({
  12800. code: s.code,
  12801. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12802. }) : new te({
  12803. message: "邮箱登录失败"
  12804. });
  12805. case 23:
  12806. case "end":
  12807. return _context19.stop();
  12808. }
  12809. }
  12810. }, _callee19, this);
  12811. }));
  12812. function signIn(_x12, _x13) {
  12813. return _signIn3.apply(this, arguments);
  12814. }
  12815. return signIn;
  12816. }()
  12817. }, {
  12818. key: "activate",
  12819. value: function () {
  12820. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  12821. return _regenerator.default.wrap(function _callee20$(_context20) {
  12822. while (1) {
  12823. switch (_context20.prev = _context20.next) {
  12824. case 0:
  12825. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  12826. token: e
  12827. }));
  12828. case 1:
  12829. case "end":
  12830. return _context20.stop();
  12831. }
  12832. }
  12833. }, _callee20, this);
  12834. }));
  12835. function activate(_x14) {
  12836. return _activate.apply(this, arguments);
  12837. }
  12838. return activate;
  12839. }()
  12840. }, {
  12841. key: "resetPasswordWithToken",
  12842. value: function () {
  12843. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  12844. return _regenerator.default.wrap(function _callee21$(_context21) {
  12845. while (1) {
  12846. switch (_context21.prev = _context21.next) {
  12847. case 0:
  12848. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  12849. token: e,
  12850. newPassword: t
  12851. }));
  12852. case 1:
  12853. case "end":
  12854. return _context21.stop();
  12855. }
  12856. }
  12857. }, _callee21, this);
  12858. }));
  12859. function resetPasswordWithToken(_x15, _x16) {
  12860. return _resetPasswordWithToken.apply(this, arguments);
  12861. }
  12862. return resetPasswordWithToken;
  12863. }()
  12864. }]);
  12865. return nt;
  12866. }(Qe);
  12867. var st = /*#__PURE__*/function (_Qe4) {
  12868. (0, _inherits2.default)(st, _Qe4);
  12869. var _super7 = _createSuper(st);
  12870. function st() {
  12871. (0, _classCallCheck2.default)(this, st);
  12872. return _super7.apply(this, arguments);
  12873. }
  12874. (0, _createClass2.default)(st, [{
  12875. key: "signIn",
  12876. value: function () {
  12877. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  12878. var n, s, r, i, o;
  12879. return _regenerator.default.wrap(function _callee22$(_context22) {
  12880. while (1) {
  12881. switch (_context22.prev = _context22.next) {
  12882. case 0:
  12883. if (!("string" != typeof e)) {
  12884. _context22.next = 2;
  12885. break;
  12886. }
  12887. throw new te({
  12888. code: "PARAM_ERROR",
  12889. message: "username must be a string"
  12890. });
  12891. case 2:
  12892. "string" != typeof t && (t = "", console.warn("password is empty"));
  12893. n = this._cache.keys.refreshTokenKey;
  12894. _context22.next = 6;
  12895. return this._request.send("auth.signIn", {
  12896. loginType: $e.USERNAME,
  12897. username: e,
  12898. password: t,
  12899. refresh_token: this._cache.getStore(n) || ""
  12900. });
  12901. case 6:
  12902. s = _context22.sent;
  12903. r = s.refresh_token;
  12904. i = s.access_token_expire;
  12905. o = s.access_token;
  12906. if (!r) {
  12907. _context22.next = 23;
  12908. break;
  12909. }
  12910. this.setRefreshToken(r);
  12911. if (!(o && i)) {
  12912. _context22.next = 16;
  12913. break;
  12914. }
  12915. this.setAccessToken(o, i);
  12916. _context22.next = 18;
  12917. break;
  12918. case 16:
  12919. _context22.next = 18;
  12920. return this._request.refreshAccessToken();
  12921. case 18:
  12922. _context22.next = 20;
  12923. return this.refreshUserInfo();
  12924. case 20:
  12925. De(qe);
  12926. De(Ke, {
  12927. env: this.config.env,
  12928. loginType: $e.USERNAME,
  12929. persistence: this.config.persistence
  12930. });
  12931. return _context22.abrupt("return", new Ze(this.config.env));
  12932. case 23:
  12933. throw s.code ? new te({
  12934. code: s.code,
  12935. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12936. }) : new te({
  12937. message: "用户名密码登录失败"
  12938. });
  12939. case 24:
  12940. case "end":
  12941. return _context22.stop();
  12942. }
  12943. }
  12944. }, _callee22, this);
  12945. }));
  12946. function signIn(_x17, _x18) {
  12947. return _signIn4.apply(this, arguments);
  12948. }
  12949. return signIn;
  12950. }()
  12951. }]);
  12952. return st;
  12953. }(Qe);
  12954. var rt = /*#__PURE__*/function () {
  12955. function rt(e) {
  12956. (0, _classCallCheck2.default)(this, rt);
  12957. this.config = e, this._cache = Ee(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Ke, this._onLoginTypeChanged);
  12958. }
  12959. (0, _createClass2.default)(rt, [{
  12960. key: "currentUser",
  12961. get: function get() {
  12962. var e = this.hasLoginState();
  12963. return e && e.user || null;
  12964. }
  12965. }, {
  12966. key: "loginType",
  12967. get: function get() {
  12968. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12969. }
  12970. }, {
  12971. key: "anonymousAuthProvider",
  12972. value: function anonymousAuthProvider() {
  12973. return new et(this.config);
  12974. }
  12975. }, {
  12976. key: "customAuthProvider",
  12977. value: function customAuthProvider() {
  12978. return new tt(this.config);
  12979. }
  12980. }, {
  12981. key: "emailAuthProvider",
  12982. value: function emailAuthProvider() {
  12983. return new nt(this.config);
  12984. }
  12985. }, {
  12986. key: "usernameAuthProvider",
  12987. value: function usernameAuthProvider() {
  12988. return new st(this.config);
  12989. }
  12990. }, {
  12991. key: "signInAnonymously",
  12992. value: function () {
  12993. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  12994. return _regenerator.default.wrap(function _callee23$(_context23) {
  12995. while (1) {
  12996. switch (_context23.prev = _context23.next) {
  12997. case 0:
  12998. return _context23.abrupt("return", new et(this.config).signIn());
  12999. case 1:
  13000. case "end":
  13001. return _context23.stop();
  13002. }
  13003. }
  13004. }, _callee23, this);
  13005. }));
  13006. function signInAnonymously() {
  13007. return _signInAnonymously.apply(this, arguments);
  13008. }
  13009. return signInAnonymously;
  13010. }()
  13011. }, {
  13012. key: "signInWithEmailAndPassword",
  13013. value: function () {
  13014. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  13015. return _regenerator.default.wrap(function _callee24$(_context24) {
  13016. while (1) {
  13017. switch (_context24.prev = _context24.next) {
  13018. case 0:
  13019. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  13020. case 1:
  13021. case "end":
  13022. return _context24.stop();
  13023. }
  13024. }
  13025. }, _callee24, this);
  13026. }));
  13027. function signInWithEmailAndPassword(_x19, _x20) {
  13028. return _signInWithEmailAndPassword.apply(this, arguments);
  13029. }
  13030. return signInWithEmailAndPassword;
  13031. }()
  13032. }, {
  13033. key: "signInWithUsernameAndPassword",
  13034. value: function signInWithUsernameAndPassword(e, t) {
  13035. return new st(this.config).signIn(e, t);
  13036. }
  13037. }, {
  13038. key: "linkAndRetrieveDataWithTicket",
  13039. value: function () {
  13040. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  13041. return _regenerator.default.wrap(function _callee25$(_context25) {
  13042. while (1) {
  13043. switch (_context25.prev = _context25.next) {
  13044. case 0:
  13045. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  13046. _context25.next = 3;
  13047. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  13048. case 3:
  13049. return _context25.abrupt("return", _context25.sent);
  13050. case 4:
  13051. case "end":
  13052. return _context25.stop();
  13053. }
  13054. }
  13055. }, _callee25, this);
  13056. }));
  13057. function linkAndRetrieveDataWithTicket(_x21) {
  13058. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  13059. }
  13060. return linkAndRetrieveDataWithTicket;
  13061. }()
  13062. }, {
  13063. key: "signOut",
  13064. value: function () {
  13065. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  13066. var _this$_cache$keys10, e, t, n, s, r;
  13067. return _regenerator.default.wrap(function _callee26$(_context26) {
  13068. while (1) {
  13069. switch (_context26.prev = _context26.next) {
  13070. case 0:
  13071. if (!(this.loginType === $e.ANONYMOUS)) {
  13072. _context26.next = 2;
  13073. break;
  13074. }
  13075. throw new te({
  13076. message: "匿名用户不支持登出操作"
  13077. });
  13078. case 2:
  13079. _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);
  13080. if (s) {
  13081. _context26.next = 5;
  13082. break;
  13083. }
  13084. return _context26.abrupt("return");
  13085. case 5:
  13086. _context26.next = 7;
  13087. return this._request.send("auth.logout", {
  13088. refresh_token: s
  13089. });
  13090. case 7:
  13091. r = _context26.sent;
  13092. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Ke, {
  13093. env: this.config.env,
  13094. loginType: $e.NULL,
  13095. persistence: this.config.persistence
  13096. }), r));
  13097. case 9:
  13098. case "end":
  13099. return _context26.stop();
  13100. }
  13101. }
  13102. }, _callee26, this);
  13103. }));
  13104. function signOut() {
  13105. return _signOut.apply(this, arguments);
  13106. }
  13107. return signOut;
  13108. }()
  13109. }, {
  13110. key: "signUpWithEmailAndPassword",
  13111. value: function () {
  13112. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  13113. return _regenerator.default.wrap(function _callee27$(_context27) {
  13114. while (1) {
  13115. switch (_context27.prev = _context27.next) {
  13116. case 0:
  13117. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  13118. email: e,
  13119. password: t
  13120. }));
  13121. case 1:
  13122. case "end":
  13123. return _context27.stop();
  13124. }
  13125. }
  13126. }, _callee27, this);
  13127. }));
  13128. function signUpWithEmailAndPassword(_x22, _x23) {
  13129. return _signUpWithEmailAndPassword.apply(this, arguments);
  13130. }
  13131. return signUpWithEmailAndPassword;
  13132. }()
  13133. }, {
  13134. key: "sendPasswordResetEmail",
  13135. value: function () {
  13136. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  13137. return _regenerator.default.wrap(function _callee28$(_context28) {
  13138. while (1) {
  13139. switch (_context28.prev = _context28.next) {
  13140. case 0:
  13141. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  13142. email: e
  13143. }));
  13144. case 1:
  13145. case "end":
  13146. return _context28.stop();
  13147. }
  13148. }
  13149. }, _callee28, this);
  13150. }));
  13151. function sendPasswordResetEmail(_x24) {
  13152. return _sendPasswordResetEmail.apply(this, arguments);
  13153. }
  13154. return sendPasswordResetEmail;
  13155. }()
  13156. }, {
  13157. key: "onLoginStateChanged",
  13158. value: function onLoginStateChanged(e) {
  13159. var _this9 = this;
  13160. Ne(qe, function () {
  13161. var t = _this9.hasLoginState();
  13162. e.call(_this9, t);
  13163. });
  13164. var t = this.hasLoginState();
  13165. e.call(this, t);
  13166. }
  13167. }, {
  13168. key: "onLoginStateExpired",
  13169. value: function onLoginStateExpired(e) {
  13170. Ne(Fe, e.bind(this));
  13171. }
  13172. }, {
  13173. key: "onAccessTokenRefreshed",
  13174. value: function onAccessTokenRefreshed(e) {
  13175. Ne(Be, e.bind(this));
  13176. }
  13177. }, {
  13178. key: "onAnonymousConverted",
  13179. value: function onAnonymousConverted(e) {
  13180. Ne(je, e.bind(this));
  13181. }
  13182. }, {
  13183. key: "onLoginTypeChanged",
  13184. value: function onLoginTypeChanged(e) {
  13185. var _this10 = this;
  13186. Ne(Ke, function () {
  13187. var t = _this10.hasLoginState();
  13188. e.call(_this10, t);
  13189. });
  13190. }
  13191. }, {
  13192. key: "getAccessToken",
  13193. value: function () {
  13194. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  13195. return _regenerator.default.wrap(function _callee29$(_context29) {
  13196. while (1) {
  13197. switch (_context29.prev = _context29.next) {
  13198. case 0:
  13199. _context29.next = 2;
  13200. return this._request.getAccessToken();
  13201. case 2:
  13202. _context29.t0 = _context29.sent.accessToken;
  13203. _context29.t1 = this.config.env;
  13204. return _context29.abrupt("return", {
  13205. accessToken: _context29.t0,
  13206. env: _context29.t1
  13207. });
  13208. case 5:
  13209. case "end":
  13210. return _context29.stop();
  13211. }
  13212. }
  13213. }, _callee29, this);
  13214. }));
  13215. function getAccessToken() {
  13216. return _getAccessToken2.apply(this, arguments);
  13217. }
  13218. return getAccessToken;
  13219. }()
  13220. }, {
  13221. key: "hasLoginState",
  13222. value: function hasLoginState() {
  13223. var e = this._cache.keys.refreshTokenKey;
  13224. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  13225. }
  13226. }, {
  13227. key: "isUsernameRegistered",
  13228. value: function () {
  13229. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  13230. var _yield$this$_request$5, t;
  13231. return _regenerator.default.wrap(function _callee30$(_context30) {
  13232. while (1) {
  13233. switch (_context30.prev = _context30.next) {
  13234. case 0:
  13235. if (!("string" != typeof e)) {
  13236. _context30.next = 2;
  13237. break;
  13238. }
  13239. throw new te({
  13240. code: "PARAM_ERROR",
  13241. message: "username must be a string"
  13242. });
  13243. case 2:
  13244. _context30.next = 4;
  13245. return this._request.send("auth.isUsernameRegistered", {
  13246. username: e
  13247. });
  13248. case 4:
  13249. _yield$this$_request$5 = _context30.sent;
  13250. t = _yield$this$_request$5.data;
  13251. return _context30.abrupt("return", t && t.isRegistered);
  13252. case 7:
  13253. case "end":
  13254. return _context30.stop();
  13255. }
  13256. }
  13257. }, _callee30, this);
  13258. }));
  13259. function isUsernameRegistered(_x25) {
  13260. return _isUsernameRegistered.apply(this, arguments);
  13261. }
  13262. return isUsernameRegistered;
  13263. }()
  13264. }, {
  13265. key: "getLoginState",
  13266. value: function getLoginState() {
  13267. return Promise.resolve(this.hasLoginState());
  13268. }
  13269. }, {
  13270. key: "signInWithTicket",
  13271. value: function () {
  13272. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  13273. return _regenerator.default.wrap(function _callee31$(_context31) {
  13274. while (1) {
  13275. switch (_context31.prev = _context31.next) {
  13276. case 0:
  13277. return _context31.abrupt("return", new tt(this.config).signIn(e));
  13278. case 1:
  13279. case "end":
  13280. return _context31.stop();
  13281. }
  13282. }
  13283. }, _callee31, this);
  13284. }));
  13285. function signInWithTicket(_x26) {
  13286. return _signInWithTicket.apply(this, arguments);
  13287. }
  13288. return signInWithTicket;
  13289. }()
  13290. }, {
  13291. key: "shouldRefreshAccessToken",
  13292. value: function shouldRefreshAccessToken(e) {
  13293. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  13294. }
  13295. }, {
  13296. key: "getUserInfo",
  13297. value: function getUserInfo() {
  13298. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  13299. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  13300. requestId: e.seqId
  13301. });
  13302. });
  13303. }
  13304. }, {
  13305. key: "getAuthHeader",
  13306. value: function getAuthHeader() {
  13307. var _this$_cache$keys11 = this._cache.keys,
  13308. e = _this$_cache$keys11.refreshTokenKey,
  13309. t = _this$_cache$keys11.accessTokenKey,
  13310. n = this._cache.getStore(e);
  13311. return {
  13312. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  13313. };
  13314. }
  13315. }, {
  13316. key: "_onAnonymousConverted",
  13317. value: function _onAnonymousConverted(e) {
  13318. var t = e.data.env;
  13319. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  13320. }
  13321. }, {
  13322. key: "_onLoginTypeChanged",
  13323. value: function _onLoginTypeChanged(e) {
  13324. var _e$data = e.data,
  13325. t = _e$data.loginType,
  13326. n = _e$data.persistence,
  13327. s = _e$data.env;
  13328. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  13329. }
  13330. }]);
  13331. return rt;
  13332. }();
  13333. var it = function it(e, t) {
  13334. t = t || we();
  13335. var n = Ye(this.config.env),
  13336. s = e.cloudPath,
  13337. r = e.filePath,
  13338. i = e.onUploadProgress,
  13339. _e$fileType = e.fileType,
  13340. o = _e$fileType === void 0 ? "image" : _e$fileType;
  13341. return n.send("storage.getUploadMetadata", {
  13342. path: s
  13343. }).then(function (e) {
  13344. var _e$data2 = e.data,
  13345. a = _e$data2.url,
  13346. c = _e$data2.authorization,
  13347. u = _e$data2.token,
  13348. l = _e$data2.fileId,
  13349. h = _e$data2.cosFileId,
  13350. d = e.requestId,
  13351. p = {
  13352. key: s,
  13353. signature: c,
  13354. "x-cos-meta-fileid": h,
  13355. success_action_status: "201",
  13356. "x-cos-security-token": u
  13357. };
  13358. n.upload({
  13359. url: a,
  13360. data: p,
  13361. file: r,
  13362. name: s,
  13363. fileType: o,
  13364. onUploadProgress: i
  13365. }).then(function (e) {
  13366. 201 === e.statusCode ? t(null, {
  13367. fileID: l,
  13368. requestId: d
  13369. }) : t(new te({
  13370. code: "STORAGE_REQUEST_FAIL",
  13371. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  13372. }));
  13373. }).catch(function (e) {
  13374. t(e);
  13375. });
  13376. }).catch(function (e) {
  13377. t(e);
  13378. }), t.promise;
  13379. },
  13380. ot = function ot(e, t) {
  13381. t = t || we();
  13382. var n = Ye(this.config.env),
  13383. s = e.cloudPath;
  13384. return n.send("storage.getUploadMetadata", {
  13385. path: s
  13386. }).then(function (e) {
  13387. t(null, e);
  13388. }).catch(function (e) {
  13389. t(e);
  13390. }), t.promise;
  13391. },
  13392. at = function at(_ref7, t) {
  13393. var e = _ref7.fileList;
  13394. if (t = t || we(), !e || !Array.isArray(e)) return {
  13395. code: "INVALID_PARAM",
  13396. message: "fileList必须是非空的数组"
  13397. };
  13398. var _iterator3 = _createForOfIteratorHelper(e),
  13399. _step3;
  13400. try {
  13401. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  13402. var _t8 = _step3.value;
  13403. if (!_t8 || "string" != typeof _t8) return {
  13404. code: "INVALID_PARAM",
  13405. message: "fileList的元素必须是非空的字符串"
  13406. };
  13407. }
  13408. } catch (err) {
  13409. _iterator3.e(err);
  13410. } finally {
  13411. _iterator3.f();
  13412. }
  13413. var n = {
  13414. fileid_list: e
  13415. };
  13416. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  13417. e.code ? t(null, e) : t(null, {
  13418. fileList: e.data.delete_list,
  13419. requestId: e.requestId
  13420. });
  13421. }).catch(function (e) {
  13422. t(e);
  13423. }), t.promise;
  13424. },
  13425. ct = function ct(_ref8, t) {
  13426. var e = _ref8.fileList;
  13427. t = t || we(), e && Array.isArray(e) || t(null, {
  13428. code: "INVALID_PARAM",
  13429. message: "fileList必须是非空的数组"
  13430. });
  13431. var n = [];
  13432. var _iterator4 = _createForOfIteratorHelper(e),
  13433. _step4;
  13434. try {
  13435. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  13436. var _s9 = _step4.value;
  13437. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  13438. code: "INVALID_PARAM",
  13439. message: "fileList的元素必须是包含fileID和maxAge的对象"
  13440. }), n.push({
  13441. fileid: _s9.fileID,
  13442. max_age: _s9.maxAge
  13443. })) : "string" == typeof _s9 ? n.push({
  13444. fileid: _s9
  13445. }) : t(null, {
  13446. code: "INVALID_PARAM",
  13447. message: "fileList的元素必须是字符串"
  13448. });
  13449. }
  13450. } catch (err) {
  13451. _iterator4.e(err);
  13452. } finally {
  13453. _iterator4.f();
  13454. }
  13455. var s = {
  13456. file_list: n
  13457. };
  13458. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  13459. e.code ? t(null, e) : t(null, {
  13460. fileList: e.data.download_list,
  13461. requestId: e.requestId
  13462. });
  13463. }).catch(function (e) {
  13464. t(e);
  13465. }), t.promise;
  13466. },
  13467. ut = /*#__PURE__*/function () {
  13468. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  13469. var e, n, s, r;
  13470. return _regenerator.default.wrap(function _callee32$(_context32) {
  13471. while (1) {
  13472. switch (_context32.prev = _context32.next) {
  13473. case 0:
  13474. e = _ref9.fileID;
  13475. _context32.next = 3;
  13476. return ct.call(this, {
  13477. fileList: [{
  13478. fileID: e,
  13479. maxAge: 600
  13480. }]
  13481. });
  13482. case 3:
  13483. n = _context32.sent.fileList[0];
  13484. if (!("SUCCESS" !== n.code)) {
  13485. _context32.next = 6;
  13486. break;
  13487. }
  13488. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13489. e(n);
  13490. }));
  13491. case 6:
  13492. s = Ye(this.config.env);
  13493. r = n.download_url;
  13494. if (!(r = encodeURI(r), !t)) {
  13495. _context32.next = 10;
  13496. break;
  13497. }
  13498. return _context32.abrupt("return", s.download({
  13499. url: r
  13500. }));
  13501. case 10:
  13502. _context32.t0 = t;
  13503. _context32.next = 13;
  13504. return s.download({
  13505. url: r
  13506. });
  13507. case 13:
  13508. _context32.t1 = _context32.sent;
  13509. (0, _context32.t0)(_context32.t1);
  13510. case 15:
  13511. case "end":
  13512. return _context32.stop();
  13513. }
  13514. }
  13515. }, _callee32, this);
  13516. }));
  13517. return function ut(_x27, _x28) {
  13518. return _ref10.apply(this, arguments);
  13519. };
  13520. }(),
  13521. lt = function lt(_ref11, i) {
  13522. var e = _ref11.name,
  13523. t = _ref11.data,
  13524. n = _ref11.query,
  13525. s = _ref11.parse,
  13526. r = _ref11.search;
  13527. var o = i || we();
  13528. var a;
  13529. try {
  13530. a = t ? JSON.stringify(t) : "";
  13531. } catch (e) {
  13532. return Promise.reject(e);
  13533. }
  13534. if (!e) return Promise.reject(new te({
  13535. code: "PARAM_ERROR",
  13536. message: "函数名不能为空"
  13537. }));
  13538. var c = {
  13539. inQuery: n,
  13540. parse: s,
  13541. search: r,
  13542. function_name: e,
  13543. request_data: a
  13544. };
  13545. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13546. if (e.code) o(null, e);else {
  13547. var _t9 = e.data.response_data;
  13548. if (s) o(null, {
  13549. result: _t9,
  13550. requestId: e.requestId
  13551. });else try {
  13552. _t9 = JSON.parse(e.data.response_data), o(null, {
  13553. result: _t9,
  13554. requestId: e.requestId
  13555. });
  13556. } catch (e) {
  13557. o(new te({
  13558. message: "response data must be json"
  13559. }));
  13560. }
  13561. }
  13562. return o.promise;
  13563. }).catch(function (e) {
  13564. o(e);
  13565. }), o.promise;
  13566. },
  13567. ht = {
  13568. timeout: 15e3,
  13569. persistence: "session"
  13570. },
  13571. dt = {};
  13572. var pt = /*#__PURE__*/function () {
  13573. function pt(e) {
  13574. (0, _classCallCheck2.default)(this, pt);
  13575. this.config = e || this.config, this.authObj = void 0;
  13576. }
  13577. (0, _createClass2.default)(pt, [{
  13578. key: "init",
  13579. value: function init(e) {
  13580. switch (ke.adapter || (this.requestClient = new ke.adapter.reqClass({
  13581. timeout: e.timeout || 5e3,
  13582. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13583. })), this.config = _objectSpread(_objectSpread({}, ht), e), !0) {
  13584. case this.config.timeout > 6e5:
  13585. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13586. break;
  13587. case this.config.timeout < 100:
  13588. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13589. }
  13590. return new pt(this.config);
  13591. }
  13592. }, {
  13593. key: "auth",
  13594. value: function auth() {
  13595. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13596. e = _ref12.persistence;
  13597. if (this.authObj) return this.authObj;
  13598. var t = e || ke.adapter.primaryStorage || ht.persistence;
  13599. var n;
  13600. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13601. var t = e.env;
  13602. xe[t] = new Ce(e), Oe[t] = new Ce(_objectSpread(_objectSpread({}, e), {}, {
  13603. persistence: "local"
  13604. }));
  13605. }(this.config), n = this.config, Ge[n.env] = new Ve(n), this.authObj = new rt(this.config), this.authObj;
  13606. }
  13607. }, {
  13608. key: "on",
  13609. value: function on(e, t) {
  13610. return Ne.apply(this, [e, t]);
  13611. }
  13612. }, {
  13613. key: "off",
  13614. value: function off(e, t) {
  13615. return Me.apply(this, [e, t]);
  13616. }
  13617. }, {
  13618. key: "callFunction",
  13619. value: function callFunction(e, t) {
  13620. return lt.apply(this, [e, t]);
  13621. }
  13622. }, {
  13623. key: "deleteFile",
  13624. value: function deleteFile(e, t) {
  13625. return at.apply(this, [e, t]);
  13626. }
  13627. }, {
  13628. key: "getTempFileURL",
  13629. value: function getTempFileURL(e, t) {
  13630. return ct.apply(this, [e, t]);
  13631. }
  13632. }, {
  13633. key: "downloadFile",
  13634. value: function downloadFile(e, t) {
  13635. return ut.apply(this, [e, t]);
  13636. }
  13637. }, {
  13638. key: "uploadFile",
  13639. value: function uploadFile(e, t) {
  13640. return it.apply(this, [e, t]);
  13641. }
  13642. }, {
  13643. key: "getUploadMetadata",
  13644. value: function getUploadMetadata(e, t) {
  13645. return ot.apply(this, [e, t]);
  13646. }
  13647. }, {
  13648. key: "registerExtension",
  13649. value: function registerExtension(e) {
  13650. dt[e.name] = e;
  13651. }
  13652. }, {
  13653. key: "invokeExtension",
  13654. value: function () {
  13655. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  13656. var n;
  13657. return _regenerator.default.wrap(function _callee33$(_context33) {
  13658. while (1) {
  13659. switch (_context33.prev = _context33.next) {
  13660. case 0:
  13661. n = dt[e];
  13662. if (n) {
  13663. _context33.next = 3;
  13664. break;
  13665. }
  13666. throw new te({
  13667. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  13668. });
  13669. case 3:
  13670. _context33.next = 5;
  13671. return n.invoke(t, this);
  13672. case 5:
  13673. return _context33.abrupt("return", _context33.sent);
  13674. case 6:
  13675. case "end":
  13676. return _context33.stop();
  13677. }
  13678. }
  13679. }, _callee33, this);
  13680. }));
  13681. function invokeExtension(_x29, _x30) {
  13682. return _invokeExtension.apply(this, arguments);
  13683. }
  13684. return invokeExtension;
  13685. }()
  13686. }, {
  13687. key: "useAdapters",
  13688. value: function useAdapters(e) {
  13689. var _ref13 = be(e) || {},
  13690. t = _ref13.adapter,
  13691. n = _ref13.runtime;
  13692. t && (ke.adapter = t), n && (ke.runtime = n);
  13693. }
  13694. }]);
  13695. return pt;
  13696. }();
  13697. var ft = new pt();
  13698. function gt(e, t, n) {
  13699. void 0 === n && (n = {});
  13700. var s = /\?/.test(t),
  13701. r = "";
  13702. for (var i in n) {
  13703. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  13704. }
  13705. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  13706. }
  13707. var mt = /*#__PURE__*/function () {
  13708. function mt() {
  13709. (0, _classCallCheck2.default)(this, mt);
  13710. }
  13711. (0, _createClass2.default)(mt, [{
  13712. key: "post",
  13713. value: function post(e) {
  13714. var t = e.url,
  13715. n = e.data,
  13716. s = e.headers;
  13717. return new Promise(function (e, r) {
  13718. ne.request({
  13719. url: gt("https:", t),
  13720. data: n,
  13721. method: "POST",
  13722. header: s,
  13723. success: function success(t) {
  13724. e(t);
  13725. },
  13726. fail: function fail(e) {
  13727. r(e);
  13728. }
  13729. });
  13730. });
  13731. }
  13732. }, {
  13733. key: "upload",
  13734. value: function upload(e) {
  13735. return new Promise(function (t, n) {
  13736. var s = e.url,
  13737. r = e.file,
  13738. i = e.data,
  13739. o = e.headers,
  13740. a = e.fileType,
  13741. c = ne.uploadFile({
  13742. url: gt("https:", s),
  13743. name: "file",
  13744. formData: Object.assign({}, i),
  13745. filePath: r,
  13746. fileType: a,
  13747. header: o,
  13748. success: function success(e) {
  13749. var n = {
  13750. statusCode: e.statusCode,
  13751. data: e.data || {}
  13752. };
  13753. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  13754. },
  13755. fail: function fail(e) {
  13756. n(new Error(e.errMsg || "uploadFile:fail"));
  13757. }
  13758. });
  13759. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  13760. e.onUploadProgress({
  13761. loaded: t.totalBytesSent,
  13762. total: t.totalBytesExpectedToSend
  13763. });
  13764. });
  13765. });
  13766. }
  13767. }]);
  13768. return mt;
  13769. }();
  13770. var yt = {
  13771. setItem: function setItem(e, t) {
  13772. ne.setStorageSync(e, t);
  13773. },
  13774. getItem: function getItem(e) {
  13775. return ne.getStorageSync(e);
  13776. },
  13777. removeItem: function removeItem(e) {
  13778. ne.removeStorageSync(e);
  13779. },
  13780. clear: function clear() {
  13781. ne.clearStorageSync();
  13782. }
  13783. };
  13784. var _t = {
  13785. genAdapter: function genAdapter() {
  13786. return {
  13787. root: {},
  13788. reqClass: mt,
  13789. localStorage: yt,
  13790. primaryStorage: "local"
  13791. };
  13792. },
  13793. isMatch: function isMatch() {
  13794. return !0;
  13795. },
  13796. runtime: "uni_app"
  13797. };
  13798. ft.useAdapters(_t);
  13799. var wt = ft,
  13800. vt = wt.init;
  13801. wt.init = function (e) {
  13802. e.env = e.spaceId;
  13803. var t = vt.call(this, e);
  13804. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  13805. var n = t.auth;
  13806. return t.auth = function (e) {
  13807. var t = n.call(this, e);
  13808. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  13809. var n;
  13810. t[e] = (n = t[e], function (e) {
  13811. e = e || {};
  13812. var _ee = ee(e),
  13813. t = _ee.success,
  13814. s = _ee.fail,
  13815. r = _ee.complete;
  13816. if (!(t || s || r)) return n.call(this, e);
  13817. n.call(this, e).then(function (e) {
  13818. t && t(e), r && r(e);
  13819. }, function (e) {
  13820. s && s(e), r && r(e);
  13821. });
  13822. }).bind(t);
  13823. }), t;
  13824. }, t.customAuth = t.auth, t;
  13825. };
  13826. var It = wt;
  13827. var St = /*#__PURE__*/function (_he) {
  13828. (0, _inherits2.default)(St, _he);
  13829. var _super8 = _createSuper(St);
  13830. function St() {
  13831. (0, _classCallCheck2.default)(this, St);
  13832. return _super8.apply(this, arguments);
  13833. }
  13834. (0, _createClass2.default)(St, [{
  13835. key: "getAccessToken",
  13836. value: function getAccessToken() {
  13837. var _this11 = this;
  13838. return new Promise(function (e, t) {
  13839. var n = "Anonymous_Access_token";
  13840. _this11.setAccessToken(n), e(n);
  13841. });
  13842. }
  13843. }, {
  13844. key: "setupRequest",
  13845. value: function setupRequest(e, t) {
  13846. var n = Object.assign({}, e, {
  13847. spaceId: this.config.spaceId,
  13848. timestamp: Date.now()
  13849. }),
  13850. s = {
  13851. "Content-Type": "application/json"
  13852. };
  13853. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret);
  13854. var r = ue();
  13855. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  13856. var _se = se(),
  13857. i = _se.token;
  13858. return s["x-client-token"] = i, {
  13859. url: this.config.requestUrl,
  13860. method: "POST",
  13861. data: n,
  13862. dataType: "json",
  13863. header: JSON.parse(JSON.stringify(s))
  13864. };
  13865. }
  13866. }, {
  13867. key: "uploadFileToOSS",
  13868. value: function uploadFileToOSS(_ref14) {
  13869. var _this12 = this;
  13870. var e = _ref14.url,
  13871. t = _ref14.formData,
  13872. n = _ref14.name,
  13873. s = _ref14.filePath,
  13874. r = _ref14.fileType,
  13875. i = _ref14.onUploadProgress;
  13876. return new Promise(function (o, a) {
  13877. var c = _this12.adapter.uploadFile({
  13878. url: e,
  13879. formData: t,
  13880. name: n,
  13881. filePath: s,
  13882. fileType: r,
  13883. success: function success(e) {
  13884. e && e.statusCode < 400 ? o(e) : a(new te({
  13885. code: "UPLOAD_FAILED",
  13886. message: "文件上传失败"
  13887. }));
  13888. },
  13889. fail: function fail(e) {
  13890. a(new te({
  13891. code: e.code || "UPLOAD_FAILED",
  13892. message: e.message || e.errMsg || "文件上传失败"
  13893. }));
  13894. }
  13895. });
  13896. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  13897. i({
  13898. loaded: e.totalBytesSent,
  13899. total: e.totalBytesExpectedToSend
  13900. });
  13901. });
  13902. });
  13903. }
  13904. }, {
  13905. key: "uploadFile",
  13906. value: function uploadFile(_ref15) {
  13907. var _this13 = this;
  13908. var e = _ref15.filePath,
  13909. t = _ref15.cloudPath,
  13910. _ref15$fileType = _ref15.fileType,
  13911. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  13912. s = _ref15.onUploadProgress;
  13913. if (!t) throw new te({
  13914. code: "CLOUDPATH_REQUIRED",
  13915. message: "cloudPath不可为空"
  13916. });
  13917. var r;
  13918. return this.getOSSUploadOptionsFromPath({
  13919. cloudPath: t
  13920. }).then(function (t) {
  13921. var _t$result = t.result,
  13922. i = _t$result.url,
  13923. o = _t$result.formData,
  13924. a = _t$result.name;
  13925. r = t.result.fileUrl;
  13926. var c = {
  13927. url: i,
  13928. formData: o,
  13929. name: a,
  13930. filePath: e,
  13931. fileType: n
  13932. };
  13933. return _this13.uploadFileToOSS(Object.assign({}, c, {
  13934. onUploadProgress: s
  13935. }));
  13936. }).then(function () {
  13937. return _this13.reportOSSUpload({
  13938. cloudPath: t
  13939. });
  13940. }).then(function (t) {
  13941. return new Promise(function (n, s) {
  13942. t.success ? n({
  13943. success: !0,
  13944. filePath: e,
  13945. fileID: r
  13946. }) : s(new te({
  13947. code: "UPLOAD_FAILED",
  13948. message: "文件上传失败"
  13949. }));
  13950. });
  13951. });
  13952. }
  13953. }, {
  13954. key: "deleteFile",
  13955. value: function deleteFile(_ref16) {
  13956. var e = _ref16.fileList;
  13957. var t = {
  13958. method: "serverless.file.resource.delete",
  13959. params: JSON.stringify({
  13960. fileList: e
  13961. })
  13962. };
  13963. return this.request(this.setupRequest(t)).then(function (e) {
  13964. if (e.success) return e.result;
  13965. throw new te({
  13966. code: "DELETE_FILE_FAILED",
  13967. message: "删除文件失败"
  13968. });
  13969. });
  13970. }
  13971. }, {
  13972. key: "getTempFileURL",
  13973. value: function getTempFileURL() {
  13974. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13975. e = _ref17.fileList,
  13976. t = _ref17.maxAge;
  13977. if (!Array.isArray(e) || 0 === e.length) throw new te({
  13978. code: "INVALID_PARAM",
  13979. message: "fileList的元素必须是非空的字符串"
  13980. });
  13981. var n = {
  13982. method: "serverless.file.resource.getTempFileURL",
  13983. params: JSON.stringify({
  13984. fileList: e,
  13985. maxAge: t
  13986. })
  13987. };
  13988. return this.request(this.setupRequest(n)).then(function (e) {
  13989. if (e.success) return {
  13990. fileList: e.result.fileList.map(function (e) {
  13991. return {
  13992. fileID: e.fileID,
  13993. tempFileURL: e.tempFileURL
  13994. };
  13995. })
  13996. };
  13997. throw new te({
  13998. code: "GET_TEMP_FILE_URL_FAILED",
  13999. message: "获取临时文件链接失败"
  14000. });
  14001. });
  14002. }
  14003. }]);
  14004. return St;
  14005. }(he);
  14006. var bt = {
  14007. init: function init(e) {
  14008. var t = new St(e),
  14009. n = {
  14010. signInAnonymously: function signInAnonymously() {
  14011. return t.authorize();
  14012. },
  14013. getLoginState: function getLoginState() {
  14014. return Promise.resolve(!1);
  14015. }
  14016. };
  14017. return t.auth = function () {
  14018. return n;
  14019. }, t.customAuth = t.auth, t;
  14020. }
  14021. },
  14022. kt = n(function (e, t) {
  14023. e.exports = r.enc.Hex;
  14024. });
  14025. function At() {
  14026. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14027. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14028. var n = t.data,
  14029. s = t.functionName,
  14030. r = t.method,
  14031. i = t.headers,
  14032. _t$signHeaderKeys = t.signHeaderKeys,
  14033. o = _t$signHeaderKeys === void 0 ? [] : _t$signHeaderKeys,
  14034. a = t.config,
  14035. c = Date.now(),
  14036. u = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (e) {
  14037. var t = 16 * Math.random() | 0;
  14038. return ("x" === e ? t : 3 & t | 8).toString(16);
  14039. }),
  14040. l = Object.assign({}, i, {
  14041. "x-from-app-id": a.appId,
  14042. "x-from-env-id": a.envId,
  14043. "x-to-env-id": a.envId,
  14044. "x-from-instance-id": c,
  14045. "x-from-function-name": s,
  14046. "x-client-timestamp": c,
  14047. "x-alipay-source": "client",
  14048. "x-request-id": u,
  14049. "x-alipay-callid": u
  14050. }),
  14051. 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),
  14052. _ref18 = e.split("?") || [],
  14053. _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
  14054. _ref19$ = _ref19[0],
  14055. d = _ref19$ === void 0 ? "" : _ref19$,
  14056. _ref19$2 = _ref19[1],
  14057. p = _ref19$2 === void 0 ? "" : _ref19$2,
  14058. f = function (e) {
  14059. var t = e.signedHeaders.join(";"),
  14060. n = e.signedHeaders.map(function (t) {
  14061. return "".concat(t.toLowerCase(), ":").concat(e.headers[t], "\n");
  14062. }).join(""),
  14063. s = ye(e.body).toString(kt),
  14064. r = "".concat(e.method.toUpperCase(), "\n").concat(e.path, "\n").concat(e.query, "\n").concat(n, "\n").concat(t, "\n").concat(s, "\n"),
  14065. i = ye(r).toString(kt),
  14066. o = "HMAC-SHA256\n".concat(e.timestamp, "\n").concat(i, "\n"),
  14067. a = _e(o, e.secretKey).toString(kt);
  14068. return "HMAC-SHA256 Credential=".concat(e.secretId, ", SignedHeaders=").concat(t, ", Signature=").concat(a);
  14069. }({
  14070. path: d,
  14071. query: p,
  14072. method: r,
  14073. headers: l,
  14074. timestamp: c,
  14075. body: JSON.stringify(n),
  14076. secretId: a.secretId,
  14077. secretKey: a.secretKey,
  14078. signedHeaders: h.sort()
  14079. });
  14080. return {
  14081. url: "".concat(a.endpoint).concat(e.replace(/^\//, "")),
  14082. headers: Object.assign({}, l, {
  14083. Authorization: f
  14084. })
  14085. };
  14086. }
  14087. function Pt(_ref20) {
  14088. var e = _ref20.url,
  14089. t = _ref20.data,
  14090. _ref20$method = _ref20.method,
  14091. n = _ref20$method === void 0 ? "POST" : _ref20$method,
  14092. _ref20$headers = _ref20.headers,
  14093. s = _ref20$headers === void 0 ? {} : _ref20$headers;
  14094. return new Promise(function (r, i) {
  14095. ne.request({
  14096. url: e,
  14097. method: n,
  14098. data: t,
  14099. header: s,
  14100. dataType: "json",
  14101. complete: function complete() {
  14102. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14103. if (!e.statusCode || e.statusCode >= 400) {
  14104. var _ref21 = e.data || {},
  14105. _t10 = _ref21.errMsg;
  14106. return i(new te({
  14107. code: "SYS_ERR",
  14108. message: _t10 || e.errMsg || "request:fail"
  14109. }));
  14110. }
  14111. r({
  14112. status: e.statusCode,
  14113. data: e.data,
  14114. headers: e.header
  14115. });
  14116. }
  14117. });
  14118. });
  14119. }
  14120. function Tt(e, t) {
  14121. var n = e.path,
  14122. s = e.data,
  14123. _e$method = e.method,
  14124. r = _e$method === void 0 ? "GET" : _e$method,
  14125. _At = At(n, {
  14126. functionName: "",
  14127. data: s,
  14128. method: r,
  14129. headers: {
  14130. "x-alipay-cloud-mode": "oss",
  14131. "x-data-api-type": "oss",
  14132. "x-expire-timestamp": Date.now() + 6e4
  14133. },
  14134. signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"],
  14135. config: t
  14136. }),
  14137. i = _At.url,
  14138. o = _At.headers;
  14139. return Pt({
  14140. url: i,
  14141. data: s,
  14142. method: r,
  14143. headers: o
  14144. }).then(function (e) {
  14145. var t = e.data || {};
  14146. if (!t.success) throw new te({
  14147. code: e.code,
  14148. message: e.message,
  14149. requestId: e.trace_id
  14150. });
  14151. return t.data || {};
  14152. }).catch(function (e) {
  14153. throw new te({
  14154. code: e.errCode,
  14155. message: e.errMsg,
  14156. requestId: e.requestId
  14157. });
  14158. });
  14159. }
  14160. function Ct() {
  14161. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14162. var t = e.trim().replace(/^cloud:\/\//, ""),
  14163. n = t.indexOf("/");
  14164. if (n <= 0) throw new te({
  14165. code: "INVALID_PARAM",
  14166. message: "fileID不合法"
  14167. });
  14168. var s = t.substring(0, n),
  14169. r = t.substring(n + 1);
  14170. return s !== this.config.envId && console.warn("file ".concat(e, " does not belong to env ").concat(this.config.envId)), r;
  14171. }
  14172. var xt = /*#__PURE__*/function () {
  14173. function xt(e) {
  14174. (0, _classCallCheck2.default)(this, xt);
  14175. ["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach(function (t) {
  14176. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  14177. });
  14178. var t = e.spaceAppId,
  14179. n = e.accessKey,
  14180. s = (0, _objectWithoutProperties2.default)(e, _excluded);
  14181. this.config = Object.assign({}, {
  14182. endpoint: e.endpoint || "https://".concat(e.envId, ".api-hz.cloudbasefunction.cn/"),
  14183. envId: e.spaceId,
  14184. appId: t,
  14185. secretId: n
  14186. }, s);
  14187. }
  14188. (0, _createClass2.default)(xt, [{
  14189. key: "callFunction",
  14190. value: function callFunction(e) {
  14191. return function (e, t) {
  14192. var n = e.name,
  14193. s = e.data,
  14194. r = "POST",
  14195. _At2 = At("/functions/invokeFunction", {
  14196. functionName: n,
  14197. data: s,
  14198. method: r,
  14199. headers: {
  14200. "x-to-function-name": n
  14201. },
  14202. signHeaderKeys: ["x-to-function-name"],
  14203. config: t
  14204. }),
  14205. i = _At2.url,
  14206. o = _At2.headers;
  14207. return Pt({
  14208. url: i,
  14209. data: s,
  14210. method: r,
  14211. headers: o
  14212. }).then(function (e) {
  14213. return e.errCode = 0, e.success = !0, e.requestId = e.requestID || e.requestId, e.result = e.data, delete e.requestID, delete e.data, e;
  14214. }).catch(function (e) {
  14215. throw new te({
  14216. code: e.errCode,
  14217. message: e.errMsg,
  14218. requestId: e.requestId
  14219. });
  14220. });
  14221. }(e, this.config);
  14222. }
  14223. }, {
  14224. key: "uploadFileToOSS",
  14225. value: function uploadFileToOSS(_ref22) {
  14226. var e = _ref22.url,
  14227. t = _ref22.filePath,
  14228. n = _ref22.fileType,
  14229. s = _ref22.formData,
  14230. r = _ref22.onUploadProgress;
  14231. return new Promise(function (i, o) {
  14232. var a = ne.uploadFile({
  14233. url: e,
  14234. filePath: t,
  14235. fileType: n,
  14236. formData: s,
  14237. success: function success(e) {
  14238. e && e.statusCode < 400 ? i(e) : o(new te({
  14239. code: "UPLOAD_FAILED",
  14240. message: "文件上传失败"
  14241. }));
  14242. },
  14243. fail: function fail(e) {
  14244. o(new te({
  14245. code: e.code || "UPLOAD_FAILED",
  14246. message: e.message || e.errMsg || "文件上传失败"
  14247. }));
  14248. }
  14249. });
  14250. "function" == typeof r && a && "function" == typeof a.onProgressUpdate && a.onProgressUpdate(function (e) {
  14251. r({
  14252. loaded: e.totalBytesSent,
  14253. total: e.totalBytesExpectedToSend
  14254. });
  14255. });
  14256. });
  14257. }
  14258. }, {
  14259. key: "uploadFile",
  14260. value: function () {
  14261. var _uploadFile2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(_ref23) {
  14262. var e, _ref23$cloudPath, t, _ref23$fileType, n, s, r, i, o, a, c;
  14263. return _regenerator.default.wrap(function _callee34$(_context34) {
  14264. while (1) {
  14265. switch (_context34.prev = _context34.next) {
  14266. case 0:
  14267. 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;
  14268. if (!("string" !== f(t))) {
  14269. _context34.next = 3;
  14270. break;
  14271. }
  14272. throw new te({
  14273. code: "INVALID_PARAM",
  14274. message: "cloudPath必须为字符串类型"
  14275. });
  14276. case 3:
  14277. if (t = t.trim()) {
  14278. _context34.next = 5;
  14279. break;
  14280. }
  14281. throw new te({
  14282. code: "INVALID_PARAM",
  14283. message: "cloudPath不可为空"
  14284. });
  14285. case 5:
  14286. if (!/:\/\//.test(t)) {
  14287. _context34.next = 7;
  14288. break;
  14289. }
  14290. throw new te({
  14291. code: "INVALID_PARAM",
  14292. message: "cloudPath不合法"
  14293. });
  14294. case 7:
  14295. _context34.next = 9;
  14296. return Tt({
  14297. path: "/".concat(t.replace(/^\//, ""), "?post_url")
  14298. }, this.config);
  14299. case 9:
  14300. r = _context34.sent;
  14301. i = r.file_id;
  14302. o = r.upload_url;
  14303. a = r.form_data;
  14304. c = a && a.reduce(function (e, t) {
  14305. return e[t.key] = t.value, e;
  14306. }, {});
  14307. return _context34.abrupt("return", this.uploadFileToOSS({
  14308. url: o,
  14309. filePath: e,
  14310. fileType: n,
  14311. formData: c,
  14312. onUploadProgress: s
  14313. }).then(function () {
  14314. return {
  14315. fileID: i
  14316. };
  14317. }));
  14318. case 15:
  14319. case "end":
  14320. return _context34.stop();
  14321. }
  14322. }
  14323. }, _callee34, this);
  14324. }));
  14325. function uploadFile(_x31) {
  14326. return _uploadFile2.apply(this, arguments);
  14327. }
  14328. return uploadFile;
  14329. }()
  14330. }, {
  14331. key: "getTempFileURL",
  14332. value: function () {
  14333. var _getTempFileURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(_ref24) {
  14334. var _this14 = this;
  14335. var e;
  14336. return _regenerator.default.wrap(function _callee35$(_context35) {
  14337. while (1) {
  14338. switch (_context35.prev = _context35.next) {
  14339. case 0:
  14340. e = _ref24.fileList;
  14341. return _context35.abrupt("return", new Promise(function (t, n) {
  14342. (!e || e.length < 0) && n(new te({
  14343. errCode: "INVALID_PARAM",
  14344. errMsg: "fileList不能为空数组"
  14345. })), e.length > 50 && n(new te({
  14346. errCode: "INVALID_PARAM",
  14347. errMsg: "fileList数组长度不能超过50"
  14348. }));
  14349. var s = [];
  14350. var _iterator5 = _createForOfIteratorHelper(e),
  14351. _step5;
  14352. try {
  14353. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  14354. var _t11 = _step5.value;
  14355. "string" !== f(_t11) && n(new te({
  14356. errCode: "INVALID_PARAM",
  14357. errMsg: "fileList的元素必须是非空的字符串"
  14358. }));
  14359. var _e17 = Ct.call(_this14, _t11);
  14360. s.push({
  14361. file_id: _e17,
  14362. expire: 600
  14363. });
  14364. }
  14365. } catch (err) {
  14366. _iterator5.e(err);
  14367. } finally {
  14368. _iterator5.f();
  14369. }
  14370. Tt({
  14371. path: "/?download_url",
  14372. data: {
  14373. file_list: s
  14374. },
  14375. method: "POST"
  14376. }, _this14.config).then(function (e) {
  14377. var _e$file_list = e.file_list,
  14378. n = _e$file_list === void 0 ? [] : _e$file_list;
  14379. t({
  14380. fileList: n.map(function (e) {
  14381. return {
  14382. fileID: e.file_id,
  14383. tempFileURL: e.download_url
  14384. };
  14385. })
  14386. });
  14387. }).catch(function (e) {
  14388. return n(e);
  14389. });
  14390. }));
  14391. case 2:
  14392. case "end":
  14393. return _context35.stop();
  14394. }
  14395. }
  14396. }, _callee35);
  14397. }));
  14398. function getTempFileURL(_x32) {
  14399. return _getTempFileURL.apply(this, arguments);
  14400. }
  14401. return getTempFileURL;
  14402. }()
  14403. }, {
  14404. key: "deleteFile",
  14405. value: function () {
  14406. var _deleteFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(_ref25) {
  14407. var _this15 = this;
  14408. var e;
  14409. return _regenerator.default.wrap(function _callee36$(_context36) {
  14410. while (1) {
  14411. switch (_context36.prev = _context36.next) {
  14412. case 0:
  14413. e = _ref25.fileList;
  14414. return _context36.abrupt("return", new Promise(function (t, n) {
  14415. (!e || e.length < 0) && n(new te({
  14416. errCode: "INVALID_PARAM",
  14417. errMsg: "fileList不能为空数组"
  14418. })), e.length > 50 && n(new te({
  14419. errCode: "INVALID_PARAM",
  14420. errMsg: "fileList数组长度不能超过50"
  14421. }));
  14422. var s = [];
  14423. var _iterator6 = _createForOfIteratorHelper(e),
  14424. _step6;
  14425. try {
  14426. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  14427. var _t12 = _step6.value;
  14428. "string" !== f(_t12) && n(new te({
  14429. errCode: "INVALID_PARAM",
  14430. errMsg: "fileList的元素必须是非空的字符串"
  14431. })), s.push(Ct.call(_this15, _t12));
  14432. }
  14433. } catch (err) {
  14434. _iterator6.e(err);
  14435. } finally {
  14436. _iterator6.f();
  14437. }
  14438. Tt({
  14439. path: "/?delete",
  14440. data: {
  14441. file_list: s
  14442. },
  14443. method: "POST"
  14444. }, _this15.config).then(function (e) {
  14445. var _e$file_list2 = e.file_list,
  14446. n = _e$file_list2 === void 0 ? [] : _e$file_list2;
  14447. t({
  14448. fileList: n.map(function (e) {
  14449. return {
  14450. fileID: e.file_id,
  14451. tempFileURL: e.download_url
  14452. };
  14453. })
  14454. });
  14455. }).catch(function (e) {
  14456. return n(e);
  14457. });
  14458. }));
  14459. case 2:
  14460. case "end":
  14461. return _context36.stop();
  14462. }
  14463. }
  14464. }, _callee36);
  14465. }));
  14466. function deleteFile(_x33) {
  14467. return _deleteFile.apply(this, arguments);
  14468. }
  14469. return deleteFile;
  14470. }()
  14471. }]);
  14472. return xt;
  14473. }();
  14474. var Ot = {
  14475. init: function init(e) {
  14476. e.envId = e.spaceId, e.provider = "alipay";
  14477. var t = new xt(e);
  14478. return t.auth = function () {
  14479. return {
  14480. signInAnonymously: function signInAnonymously() {
  14481. return Promise.resolve();
  14482. },
  14483. getLoginState: function getLoginState() {
  14484. return Promise.resolve(!0);
  14485. }
  14486. };
  14487. }, t;
  14488. }
  14489. };
  14490. function Et(_ref26) {
  14491. var e = _ref26.data;
  14492. var t;
  14493. t = ue();
  14494. var n = JSON.parse(JSON.stringify(e || {}));
  14495. if (Object.assign(n, {
  14496. clientInfo: t
  14497. }), !n.uniIdToken) {
  14498. var _se2 = se(),
  14499. _e18 = _se2.token;
  14500. _e18 && (n.uniIdToken = _e18);
  14501. }
  14502. return n;
  14503. }
  14504. function Lt() {
  14505. return _Lt.apply(this, arguments);
  14506. }
  14507. function _Lt() {
  14508. _Lt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
  14509. var _this28 = this;
  14510. var _ref68,
  14511. e,
  14512. t,
  14513. _this$__dev__,
  14514. n,
  14515. s,
  14516. r,
  14517. i,
  14518. o,
  14519. a,
  14520. _args6 = arguments;
  14521. return _regenerator.default.wrap(function _callee57$(_context57) {
  14522. while (1) {
  14523. switch (_context57.prev = _context57.next) {
  14524. case 0:
  14525. _ref68 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref68.name, t = _ref68.data;
  14526. _context57.next = 3;
  14527. return this.__dev__.initLocalNetwork();
  14528. case 3:
  14529. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  14530. aliyun: "aliyun",
  14531. tencent: "tcb",
  14532. alipay: "alipay"
  14533. }[this.config.provider], i = this.config.spaceId, o = "http://".concat(n, ":").concat(s, "/system/check-function"), a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  14534. return _context57.abrupt("return", new Promise(function (t, n) {
  14535. ne.request({
  14536. method: "POST",
  14537. url: o,
  14538. data: {
  14539. name: e,
  14540. platform: P,
  14541. provider: r,
  14542. spaceId: i
  14543. },
  14544. timeout: 3e3,
  14545. success: function success(e) {
  14546. t(e);
  14547. },
  14548. fail: function fail() {
  14549. t({
  14550. data: {
  14551. code: "NETWORK_ERROR",
  14552. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  14553. }
  14554. });
  14555. }
  14556. });
  14557. }).then(function () {
  14558. var _ref69 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14559. e = _ref69.data;
  14560. var _ref70 = e || {},
  14561. t = _ref70.code,
  14562. n = _ref70.message;
  14563. return {
  14564. code: 0 === t ? 0 : t || "SYS_ERR",
  14565. message: n || "SYS_ERR"
  14566. };
  14567. }).then(function (_ref71) {
  14568. var n = _ref71.code,
  14569. s = _ref71.message;
  14570. if (0 !== n) {
  14571. switch (n) {
  14572. case "MODULE_ENCRYPTED":
  14573. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  14574. break;
  14575. case "FUNCTION_ENCRYPTED":
  14576. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  14577. break;
  14578. case "ACTION_ENCRYPTED":
  14579. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  14580. break;
  14581. case "NETWORK_ERROR":
  14582. {
  14583. var _e30 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  14584. throw console.error(_e30), new Error(_e30);
  14585. }
  14586. case "SWITCH_TO_CLOUD":
  14587. break;
  14588. default:
  14589. {
  14590. var _e31 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");
  14591. throw console.error(_e31), new Error(_e31);
  14592. }
  14593. }
  14594. return _this28._callCloudFunction({
  14595. name: e,
  14596. data: t
  14597. });
  14598. }
  14599. return new Promise(function (e, n) {
  14600. var s = Et.call(_this28, {
  14601. data: t
  14602. });
  14603. ne.request({
  14604. method: "POST",
  14605. url: a,
  14606. data: {
  14607. provider: r,
  14608. platform: P,
  14609. param: s
  14610. },
  14611. success: function success() {
  14612. var _ref72 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14613. t = _ref72.statusCode,
  14614. s = _ref72.data;
  14615. return !t || t >= 400 ? n(new te({
  14616. code: s.code || "SYS_ERR",
  14617. message: s.message || "request:fail"
  14618. })) : e({
  14619. result: s
  14620. });
  14621. },
  14622. fail: function fail(e) {
  14623. n(new te({
  14624. code: e.code || e.errCode || "SYS_ERR",
  14625. message: e.message || e.errMsg || "request:fail"
  14626. }));
  14627. }
  14628. });
  14629. });
  14630. }));
  14631. case 5:
  14632. case "end":
  14633. return _context57.stop();
  14634. }
  14635. }
  14636. }, _callee57, this);
  14637. }));
  14638. return _Lt.apply(this, arguments);
  14639. }
  14640. var Rt = [{
  14641. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  14642. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  14643. mode: "append"
  14644. }];
  14645. var Ut = /[\\^$.*+?()[\]{}|]/g,
  14646. Nt = RegExp(Ut.source);
  14647. function Dt(e, t, n) {
  14648. return e.replace(new RegExp((s = t) && Nt.test(s) ? s.replace(Ut, "\\$&") : s, "g"), n);
  14649. var s;
  14650. }
  14651. var Mt = "none",
  14652. qt = "request",
  14653. Ft = "response",
  14654. Kt = "both";
  14655. var jt = /*#__PURE__*/function () {
  14656. function jt() {
  14657. var _ref27 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14658. e = _ref27.secretType,
  14659. t = _ref27.uniCloudIns;
  14660. (0, _classCallCheck2.default)(this, jt);
  14661. this.clientType = "", this.secretType = e || Mt, this.uniCloudIns = t;
  14662. var _this$uniCloudIns$con = this.uniCloudIns.config,
  14663. n = _this$uniCloudIns$con.provider,
  14664. s = _this$uniCloudIns$con.spaceId;
  14665. var r;
  14666. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  14667. }
  14668. (0, _createClass2.default)(jt, [{
  14669. key: "getSystemInfo",
  14670. value: function getSystemInfo() {
  14671. return this._systemInfo || (this._systemInfo = ae()), this._systemInfo;
  14672. }
  14673. }, {
  14674. key: "appId",
  14675. get: function get() {
  14676. return this.getSystemInfo().appId;
  14677. }
  14678. }, {
  14679. key: "deviceId",
  14680. get: function get() {
  14681. return this.getSystemInfo().deviceId;
  14682. }
  14683. }, {
  14684. key: "encryptData",
  14685. value: function () {
  14686. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(e) {
  14687. return _regenerator.default.wrap(function _callee37$(_context37) {
  14688. while (1) {
  14689. switch (_context37.prev = _context37.next) {
  14690. case 0:
  14691. return _context37.abrupt("return", this.secretType === Mt ? e : this.platformEncryptData(e));
  14692. case 1:
  14693. case "end":
  14694. return _context37.stop();
  14695. }
  14696. }
  14697. }, _callee37, this);
  14698. }));
  14699. function encryptData(_x34) {
  14700. return _encryptData.apply(this, arguments);
  14701. }
  14702. return encryptData;
  14703. }()
  14704. }, {
  14705. key: "decryptResult",
  14706. value: function () {
  14707. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(e) {
  14708. var _ref28, t, n;
  14709. return _regenerator.default.wrap(function _callee38$(_context38) {
  14710. while (1) {
  14711. switch (_context38.prev = _context38.next) {
  14712. case 0:
  14713. if (!(this.secretType === Mt)) {
  14714. _context38.next = 2;
  14715. break;
  14716. }
  14717. return _context38.abrupt("return", e);
  14718. case 2:
  14719. _ref28 = e || {}, t = _ref28.errCode, n = _ref28.content;
  14720. return _context38.abrupt("return", t || !n ? e : this.secretType === qt ? n : this.platformDecryptResult(e));
  14721. case 4:
  14722. case "end":
  14723. return _context38.stop();
  14724. }
  14725. }
  14726. }, _callee38, this);
  14727. }));
  14728. function decryptResult(_x35) {
  14729. return _decryptResult.apply(this, arguments);
  14730. }
  14731. return decryptResult;
  14732. }()
  14733. }, {
  14734. key: "wrapVerifyClientCallFunction",
  14735. value: function wrapVerifyClientCallFunction(e) {
  14736. var t = this;
  14737. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  14738. var _ref30,
  14739. n,
  14740. _ref30$data,
  14741. s,
  14742. r,
  14743. _args39 = arguments;
  14744. return _regenerator.default.wrap(function _callee39$(_context39) {
  14745. while (1) {
  14746. switch (_context39.prev = _context39.next) {
  14747. case 0:
  14748. _ref30 = _args39.length > 0 && _args39[0] !== undefined ? _args39[0] : {}, n = _ref30.name, _ref30$data = _ref30.data, s = _ref30$data === void 0 ? {} : _ref30$data;
  14749. _context39.next = 3;
  14750. return t.prepare();
  14751. case 3:
  14752. _context39.next = 5;
  14753. return t.platformGetSignOption();
  14754. case 5:
  14755. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context39.sent;
  14756. _context39.next = 8;
  14757. return e({
  14758. name: n,
  14759. data: s
  14760. });
  14761. case 8:
  14762. r = _context39.sent;
  14763. _context39.t0 = t.isClientKeyNotFound(r);
  14764. if (!_context39.t0) {
  14765. _context39.next = 19;
  14766. break;
  14767. }
  14768. _context39.next = 13;
  14769. return t.prepare({
  14770. forceUpdate: !0
  14771. });
  14772. case 13:
  14773. _context39.next = 15;
  14774. return t.platformGetSignOption();
  14775. case 15:
  14776. s._uniCloudOptions = _context39.sent;
  14777. _context39.next = 18;
  14778. return e({
  14779. name: n,
  14780. data: s
  14781. });
  14782. case 18:
  14783. r = _context39.sent;
  14784. case 19:
  14785. return _context39.abrupt("return", r);
  14786. case 20:
  14787. case "end":
  14788. return _context39.stop();
  14789. }
  14790. }
  14791. }, _callee39);
  14792. }));
  14793. }
  14794. }, {
  14795. key: "wrapEncryptDataCallFunction",
  14796. value: function wrapEncryptDataCallFunction(e) {
  14797. var t = this;
  14798. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  14799. var _ref32,
  14800. n,
  14801. _ref32$data,
  14802. s,
  14803. r,
  14804. i,
  14805. _r3,
  14806. _args40 = arguments;
  14807. return _regenerator.default.wrap(function _callee40$(_context40) {
  14808. while (1) {
  14809. switch (_context40.prev = _context40.next) {
  14810. case 0:
  14811. _ref32 = _args40.length > 0 && _args40[0] !== undefined ? _args40[0] : {}, n = _ref32.name, _ref32$data = _ref32.data, s = _ref32$data === void 0 ? {} : _ref32$data;
  14812. _context40.next = 3;
  14813. return t.prepare();
  14814. case 3:
  14815. _context40.next = 5;
  14816. return t.encryptData(s);
  14817. case 5:
  14818. r = _context40.sent;
  14819. _context40.next = 8;
  14820. return e({
  14821. name: n,
  14822. data: r
  14823. });
  14824. case 8:
  14825. i = _context40.sent;
  14826. if (!t.isClientKeyNotFound(i)) {
  14827. _context40.next = 21;
  14828. break;
  14829. }
  14830. _context40.next = 12;
  14831. return t.prepare({
  14832. forceUpdate: !0
  14833. });
  14834. case 12:
  14835. _context40.next = 14;
  14836. return t.encryptData(s);
  14837. case 14:
  14838. _r3 = _context40.sent;
  14839. _context40.next = 17;
  14840. return t.platformGetSignOption();
  14841. case 17:
  14842. s._uniCloudOptions = _context40.sent;
  14843. _context40.next = 20;
  14844. return e({
  14845. name: n,
  14846. data: _r3
  14847. });
  14848. case 20:
  14849. i = _context40.sent;
  14850. case 21:
  14851. _context40.next = 23;
  14852. return t.decryptResult(i.result);
  14853. case 23:
  14854. i.result = _context40.sent;
  14855. return _context40.abrupt("return", i);
  14856. case 25:
  14857. case "end":
  14858. return _context40.stop();
  14859. }
  14860. }
  14861. }, _callee40);
  14862. }));
  14863. }
  14864. }]);
  14865. return jt;
  14866. }();
  14867. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  14868. function Bt(e) {
  14869. return parseInt(e) === e;
  14870. }
  14871. function $t(e) {
  14872. if (!Bt(e.length)) return !1;
  14873. for (var t = 0; t < e.length; t++) {
  14874. if (!Bt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  14875. }
  14876. return !0;
  14877. }
  14878. function Wt(e, t) {
  14879. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  14880. if (Array.isArray(e)) {
  14881. if (!$t(e)) throw new Error("Array contains invalid value: " + e);
  14882. return new Uint8Array(e);
  14883. }
  14884. if (Bt(e.length) && $t(e)) return new Uint8Array(e);
  14885. throw new Error("unsupported array-like object");
  14886. }
  14887. function Ht(e) {
  14888. return new Uint8Array(e);
  14889. }
  14890. function zt(e, t, n, s, r) {
  14891. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  14892. }
  14893. var Jt,
  14894. Vt = {
  14895. toBytes: function toBytes(e) {
  14896. var t = [],
  14897. n = 0;
  14898. for (e = encodeURI(e); n < e.length;) {
  14899. var s = e.charCodeAt(n++);
  14900. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  14901. }
  14902. return Wt(t);
  14903. },
  14904. fromBytes: function fromBytes(e) {
  14905. for (var t = [], n = 0; n < e.length;) {
  14906. var s = e[n];
  14907. 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);
  14908. }
  14909. return t.join("");
  14910. }
  14911. },
  14912. Gt = (Jt = "0123456789abcdef", {
  14913. toBytes: function toBytes(e) {
  14914. for (var t = [], n = 0; n < e.length; n += 2) {
  14915. t.push(parseInt(e.substr(n, 2), 16));
  14916. }
  14917. return t;
  14918. },
  14919. fromBytes: function fromBytes(e) {
  14920. for (var t = [], n = 0; n < e.length; n++) {
  14921. var s = e[n];
  14922. t.push(Jt[(240 & s) >> 4] + Jt[15 & s]);
  14923. }
  14924. return t.join("");
  14925. }
  14926. }),
  14927. Yt = {
  14928. 16: 10,
  14929. 24: 12,
  14930. 32: 14
  14931. },
  14932. Qt = [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],
  14933. Xt = [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],
  14934. Zt = [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],
  14935. en = [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],
  14936. tn = [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],
  14937. nn = [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],
  14938. sn = [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],
  14939. rn = [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],
  14940. on = [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],
  14941. an = [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],
  14942. cn = [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],
  14943. un = [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],
  14944. ln = [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],
  14945. hn = [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],
  14946. dn = [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];
  14947. function pn(e) {
  14948. for (var t = [], n = 0; n < e.length; n += 4) {
  14949. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  14950. }
  14951. return t;
  14952. }
  14953. var fn = /*#__PURE__*/function () {
  14954. function fn(e) {
  14955. (0, _classCallCheck2.default)(this, fn);
  14956. if (!(this instanceof fn)) throw Error("AES must be instanitated with `new`");
  14957. Object.defineProperty(this, "key", {
  14958. value: Wt(e, !0)
  14959. }), this._prepare();
  14960. }
  14961. (0, _createClass2.default)(fn, [{
  14962. key: "_prepare",
  14963. value: function _prepare() {
  14964. var e = Yt[this.key.length];
  14965. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  14966. this._Ke = [], this._Kd = [];
  14967. for (var t = 0; t <= e; t++) {
  14968. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  14969. }
  14970. var n,
  14971. s = 4 * (e + 1),
  14972. r = this.key.length / 4,
  14973. i = pn(this.key);
  14974. for (t = 0; t < r; t++) {
  14975. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  14976. }
  14977. for (var o, a = 0, c = r; c < s;) {
  14978. if (o = i[r - 1], i[0] ^= Xt[o >> 16 & 255] << 24 ^ Xt[o >> 8 & 255] << 16 ^ Xt[255 & o] << 8 ^ Xt[o >> 24 & 255] ^ Qt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  14979. i[t] ^= i[t - 1];
  14980. } else {
  14981. for (t = 1; t < r / 2; t++) {
  14982. i[t] ^= i[t - 1];
  14983. }
  14984. o = i[r / 2 - 1], i[r / 2] ^= Xt[255 & o] ^ Xt[o >> 8 & 255] << 8 ^ Xt[o >> 16 & 255] << 16 ^ Xt[o >> 24 & 255] << 24;
  14985. for (t = r / 2 + 1; t < r; t++) {
  14986. i[t] ^= i[t - 1];
  14987. }
  14988. }
  14989. for (t = 0; t < r && c < s;) {
  14990. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  14991. }
  14992. }
  14993. for (var u = 1; u < e; u++) {
  14994. for (var l = 0; l < 4; l++) {
  14995. o = this._Kd[u][l], this._Kd[u][l] = un[o >> 24 & 255] ^ ln[o >> 16 & 255] ^ hn[o >> 8 & 255] ^ dn[255 & o];
  14996. }
  14997. }
  14998. }
  14999. }, {
  15000. key: "encrypt",
  15001. value: function encrypt(e) {
  15002. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  15003. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = pn(e), r = 0; r < 4; r++) {
  15004. s[r] ^= this._Ke[0][r];
  15005. }
  15006. for (var i = 1; i < t; i++) {
  15007. for (r = 0; r < 4; r++) {
  15008. n[r] = en[s[r] >> 24 & 255] ^ tn[s[(r + 1) % 4] >> 16 & 255] ^ nn[s[(r + 2) % 4] >> 8 & 255] ^ sn[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  15009. }
  15010. s = n.slice();
  15011. }
  15012. var o,
  15013. a = Ht(16);
  15014. for (r = 0; r < 4; r++) {
  15015. o = this._Ke[t][r], a[4 * r] = 255 & (Xt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Xt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Xt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Xt[255 & s[(r + 3) % 4]] ^ o);
  15016. }
  15017. return a;
  15018. }
  15019. }, {
  15020. key: "decrypt",
  15021. value: function decrypt(e) {
  15022. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  15023. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = pn(e), r = 0; r < 4; r++) {
  15024. s[r] ^= this._Kd[0][r];
  15025. }
  15026. for (var i = 1; i < t; i++) {
  15027. for (r = 0; r < 4; r++) {
  15028. n[r] = rn[s[r] >> 24 & 255] ^ on[s[(r + 3) % 4] >> 16 & 255] ^ an[s[(r + 2) % 4] >> 8 & 255] ^ cn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  15029. }
  15030. s = n.slice();
  15031. }
  15032. var o,
  15033. a = Ht(16);
  15034. for (r = 0; r < 4; r++) {
  15035. o = this._Kd[t][r], a[4 * r] = 255 & (Zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Zt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Zt[255 & s[(r + 1) % 4]] ^ o);
  15036. }
  15037. return a;
  15038. }
  15039. }]);
  15040. return fn;
  15041. }();
  15042. var gn = /*#__PURE__*/function () {
  15043. function gn(e) {
  15044. (0, _classCallCheck2.default)(this, gn);
  15045. if (!(this instanceof gn)) throw Error("AES must be instanitated with `new`");
  15046. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new fn(e);
  15047. }
  15048. (0, _createClass2.default)(gn, [{
  15049. key: "encrypt",
  15050. value: function encrypt(e) {
  15051. if ((e = Wt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15052. for (var t = Ht(e.length), n = Ht(16), s = 0; s < e.length; s += 16) {
  15053. zt(e, n, 0, s, s + 16), zt(n = this._aes.encrypt(n), t, s);
  15054. }
  15055. return t;
  15056. }
  15057. }, {
  15058. key: "decrypt",
  15059. value: function decrypt(e) {
  15060. if ((e = Wt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15061. for (var t = Ht(e.length), n = Ht(16), s = 0; s < e.length; s += 16) {
  15062. zt(e, n, 0, s, s + 16), zt(n = this._aes.decrypt(n), t, s);
  15063. }
  15064. return t;
  15065. }
  15066. }]);
  15067. return gn;
  15068. }();
  15069. var mn = /*#__PURE__*/function () {
  15070. function mn(e, t) {
  15071. (0, _classCallCheck2.default)(this, mn);
  15072. if (!(this instanceof mn)) throw Error("AES must be instanitated with `new`");
  15073. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  15074. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15075. } else t = Ht(16);
  15076. this._lastCipherblock = Wt(t, !0), this._aes = new fn(e);
  15077. }
  15078. (0, _createClass2.default)(mn, [{
  15079. key: "encrypt",
  15080. value: function encrypt(e) {
  15081. if ((e = Wt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15082. for (var t = Ht(e.length), n = Ht(16), s = 0; s < e.length; s += 16) {
  15083. zt(e, n, 0, s, s + 16);
  15084. for (var r = 0; r < 16; r++) {
  15085. n[r] ^= this._lastCipherblock[r];
  15086. }
  15087. this._lastCipherblock = this._aes.encrypt(n), zt(this._lastCipherblock, t, s);
  15088. }
  15089. return t;
  15090. }
  15091. }, {
  15092. key: "decrypt",
  15093. value: function decrypt(e) {
  15094. if ((e = Wt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15095. for (var t = Ht(e.length), n = Ht(16), s = 0; s < e.length; s += 16) {
  15096. zt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  15097. for (var r = 0; r < 16; r++) {
  15098. t[s + r] = n[r] ^ this._lastCipherblock[r];
  15099. }
  15100. zt(e, this._lastCipherblock, 0, s, s + 16);
  15101. }
  15102. return t;
  15103. }
  15104. }]);
  15105. return mn;
  15106. }();
  15107. var yn = /*#__PURE__*/function () {
  15108. function yn(e, t, n) {
  15109. (0, _classCallCheck2.default)(this, yn);
  15110. if (!(this instanceof yn)) throw Error("AES must be instanitated with `new`");
  15111. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  15112. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  15113. } else t = Ht(16);
  15114. n || (n = 1), this.segmentSize = n, this._shiftRegister = Wt(t, !0), this._aes = new fn(e);
  15115. }
  15116. (0, _createClass2.default)(yn, [{
  15117. key: "encrypt",
  15118. value: function encrypt(e) {
  15119. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  15120. for (var t, n = Wt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15121. t = this._aes.encrypt(this._shiftRegister);
  15122. for (var r = 0; r < this.segmentSize; r++) {
  15123. n[s + r] ^= t[r];
  15124. }
  15125. zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), zt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15126. }
  15127. return n;
  15128. }
  15129. }, {
  15130. key: "decrypt",
  15131. value: function decrypt(e) {
  15132. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  15133. for (var t, n = Wt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15134. t = this._aes.encrypt(this._shiftRegister);
  15135. for (var r = 0; r < this.segmentSize; r++) {
  15136. n[s + r] ^= t[r];
  15137. }
  15138. zt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), zt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15139. }
  15140. return n;
  15141. }
  15142. }]);
  15143. return yn;
  15144. }();
  15145. var _n = /*#__PURE__*/function () {
  15146. function _n(e, t) {
  15147. (0, _classCallCheck2.default)(this, _n);
  15148. if (!(this instanceof _n)) throw Error("AES must be instanitated with `new`");
  15149. if (this.description = "Output Feedback", this.name = "ofb", t) {
  15150. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15151. } else t = Ht(16);
  15152. this._lastPrecipher = Wt(t, !0), this._lastPrecipherIndex = 16, this._aes = new fn(e);
  15153. }
  15154. (0, _createClass2.default)(_n, [{
  15155. key: "encrypt",
  15156. value: function encrypt(e) {
  15157. for (var t = Wt(e, !0), n = 0; n < t.length; n++) {
  15158. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  15159. }
  15160. return t;
  15161. }
  15162. }, {
  15163. key: "decrypt",
  15164. value: function decrypt(e) {
  15165. return this.encrypt(e);
  15166. }
  15167. }]);
  15168. return _n;
  15169. }();
  15170. var wn = /*#__PURE__*/function () {
  15171. function wn(e) {
  15172. (0, _classCallCheck2.default)(this, wn);
  15173. if (!(this instanceof wn)) throw Error("Counter must be instanitated with `new`");
  15174. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Ht(16), this.setValue(e)) : this.setBytes(e);
  15175. }
  15176. (0, _createClass2.default)(wn, [{
  15177. key: "setValue",
  15178. value: function setValue(e) {
  15179. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  15180. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  15181. for (var t = 15; t >= 0; --t) {
  15182. this._counter[t] = e % 256, e = parseInt(e / 256);
  15183. }
  15184. }
  15185. }, {
  15186. key: "setBytes",
  15187. value: function setBytes(e) {
  15188. if (16 != (e = Wt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  15189. this._counter = e;
  15190. }
  15191. }, {
  15192. key: "increment",
  15193. value: function increment() {
  15194. for (var e = 15; e >= 0; e--) {
  15195. if (255 !== this._counter[e]) {
  15196. this._counter[e]++;
  15197. break;
  15198. }
  15199. this._counter[e] = 0;
  15200. }
  15201. }
  15202. }]);
  15203. return wn;
  15204. }();
  15205. var vn = /*#__PURE__*/function () {
  15206. function vn(e, t) {
  15207. (0, _classCallCheck2.default)(this, vn);
  15208. if (!(this instanceof vn)) throw Error("AES must be instanitated with `new`");
  15209. this.description = "Counter", this.name = "ctr", t instanceof wn || (t = new wn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new fn(e);
  15210. }
  15211. (0, _createClass2.default)(vn, [{
  15212. key: "encrypt",
  15213. value: function encrypt(e) {
  15214. for (var t = Wt(e, !0), n = 0; n < t.length; n++) {
  15215. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  15216. }
  15217. return t;
  15218. }
  15219. }, {
  15220. key: "decrypt",
  15221. value: function decrypt(e) {
  15222. return this.encrypt(e);
  15223. }
  15224. }]);
  15225. return vn;
  15226. }();
  15227. var In = {
  15228. AES: fn,
  15229. Counter: wn,
  15230. ModeOfOperation: {
  15231. ecb: gn,
  15232. cbc: mn,
  15233. cfb: yn,
  15234. ofb: _n,
  15235. ctr: vn
  15236. },
  15237. utils: {
  15238. hex: Gt,
  15239. utf8: Vt
  15240. },
  15241. padding: {
  15242. pkcs7: {
  15243. pad: function pad(e) {
  15244. var t = 16 - (e = Wt(e, !0)).length % 16,
  15245. n = Ht(e.length + t);
  15246. zt(e, n);
  15247. for (var s = e.length; s < n.length; s++) {
  15248. n[s] = t;
  15249. }
  15250. return n;
  15251. },
  15252. strip: function strip(e) {
  15253. if ((e = Wt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  15254. var t = e[e.length - 1];
  15255. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  15256. for (var n = e.length - t, s = 0; s < t; s++) {
  15257. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  15258. }
  15259. var r = Ht(n);
  15260. return zt(e, r, 0, 0, n), r;
  15261. }
  15262. }
  15263. },
  15264. _arrayTest: {
  15265. coerceArray: Wt,
  15266. createArray: Ht,
  15267. copyArray: zt
  15268. }
  15269. };
  15270. function Sn(e, t, n) {
  15271. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15272. r = In.utils.utf8.toBytes(n),
  15273. i = In.utils.utf8.toBytes(e),
  15274. o = new In.ModeOfOperation.cbc(s, r),
  15275. a = In.padding.pkcs7.pad(i),
  15276. c = o.encrypt(a);
  15277. return uni.arrayBufferToBase64(c);
  15278. }
  15279. var bn = {
  15280. code: 2e4,
  15281. message: "System error"
  15282. },
  15283. kn = {
  15284. code: 20101,
  15285. message: "Invalid client"
  15286. },
  15287. An = {
  15288. code: 20102,
  15289. message: "Get encrypt key failed"
  15290. },
  15291. Pn = {
  15292. 10001: "Secure network is not supported on current playground or unimpsdk",
  15293. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  15294. 10009: "Encrypt payload failed",
  15295. 10010: "Decrypt response failed"
  15296. };
  15297. function Tn(e) {
  15298. var _ref33 = e || {},
  15299. t = _ref33.errSubject,
  15300. n = _ref33.subject,
  15301. s = _ref33.errCode,
  15302. r = _ref33.errMsg,
  15303. i = _ref33.code,
  15304. o = _ref33.message,
  15305. a = _ref33.cause;
  15306. return new te({
  15307. subject: t || n || "uni-secure-network",
  15308. code: s || i || bn.code,
  15309. message: r || o,
  15310. cause: a
  15311. });
  15312. }
  15313. var Cn,
  15314. xn,
  15315. On = null;
  15316. var En = /*#__PURE__*/function (_jt) {
  15317. (0, _inherits2.default)(En, _jt);
  15318. var _super9 = _createSuper(En);
  15319. function En(e) {
  15320. var _this16;
  15321. (0, _classCallCheck2.default)(this, En);
  15322. _this16 = _super9.call(this, e), _this16.clientType = "mp-weixin", _this16.userEncryptKey = null;
  15323. return _this16;
  15324. }
  15325. (0, _createClass2.default)(En, [{
  15326. key: "isLogin",
  15327. value: function isLogin() {
  15328. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  15329. }
  15330. }, {
  15331. key: "prepare",
  15332. value: function () {
  15333. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
  15334. return _regenerator.default.wrap(function _callee41$(_context41) {
  15335. while (1) {
  15336. switch (_context41.prev = _context41.next) {
  15337. case 0:
  15338. if (this.isLogin()) {
  15339. _context41.next = 7;
  15340. break;
  15341. }
  15342. if (this.scopedGlobalCache.initPromise) {
  15343. _context41.next = 3;
  15344. break;
  15345. }
  15346. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  15347. case 3:
  15348. _context41.next = 5;
  15349. return this.scopedGlobalCache.initPromise;
  15350. case 5:
  15351. if (this.isLogin()) {
  15352. _context41.next = 7;
  15353. break;
  15354. }
  15355. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  15356. case 7:
  15357. case "end":
  15358. return _context41.stop();
  15359. }
  15360. }
  15361. }, _callee41, this);
  15362. }));
  15363. function prepare() {
  15364. return _prepare2.apply(this, arguments);
  15365. }
  15366. return prepare;
  15367. }()
  15368. }, {
  15369. key: "getUserEncryptKey",
  15370. value: function () {
  15371. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  15372. var _this17 = this;
  15373. var e;
  15374. return _regenerator.default.wrap(function _callee42$(_context42) {
  15375. while (1) {
  15376. switch (_context42.prev = _context42.next) {
  15377. case 0:
  15378. if (!this.userEncryptKey) {
  15379. _context42.next = 2;
  15380. break;
  15381. }
  15382. return _context42.abrupt("return", this.userEncryptKey);
  15383. case 2:
  15384. if (!(On && On.expireTime)) {
  15385. _context42.next = 6;
  15386. break;
  15387. }
  15388. e = Date.now();
  15389. if (!(On.expireTime - e > 0)) {
  15390. _context42.next = 6;
  15391. break;
  15392. }
  15393. return _context42.abrupt("return", (this.userEncryptKey = On, this.userEncryptKey));
  15394. case 6:
  15395. return _context42.abrupt("return", new Promise(function (e, t) {
  15396. uni.getUserCryptoManager().getLatestUserKey({
  15397. success: function success(t) {
  15398. On = t, _this17.userEncryptKey = t, e(_this17.userEncryptKey);
  15399. },
  15400. fail: function fail(e) {
  15401. t(Tn(_objectSpread(_objectSpread({}, An), {}, {
  15402. cause: e
  15403. })));
  15404. }
  15405. });
  15406. }));
  15407. case 7:
  15408. case "end":
  15409. return _context42.stop();
  15410. }
  15411. }
  15412. }, _callee42, this);
  15413. }));
  15414. function getUserEncryptKey() {
  15415. return _getUserEncryptKey.apply(this, arguments);
  15416. }
  15417. return getUserEncryptKey;
  15418. }()
  15419. }, {
  15420. key: "getWxAppId",
  15421. value: function getWxAppId() {
  15422. return wx.getAccountInfoSync().miniProgram.appId;
  15423. }
  15424. }, {
  15425. key: "platformGetSignOption",
  15426. value: function () {
  15427. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  15428. var _yield$this$getUserEn, e, t, n;
  15429. return _regenerator.default.wrap(function _callee43$(_context43) {
  15430. while (1) {
  15431. switch (_context43.prev = _context43.next) {
  15432. case 0:
  15433. _context43.next = 2;
  15434. return this.getUserEncryptKey();
  15435. case 2:
  15436. _yield$this$getUserEn = _context43.sent;
  15437. e = _yield$this$getUserEn.encryptKey;
  15438. t = _yield$this$getUserEn.iv;
  15439. n = _yield$this$getUserEn.version;
  15440. return _context43.abrupt("return", {
  15441. verifyClientSign: Sn(JSON.stringify({
  15442. data: JSON.stringify({}),
  15443. appId: this.appId,
  15444. deviceId: this.deviceId,
  15445. wxAppId: this.getWxAppId(),
  15446. simulator: "devtools" === ae().platform,
  15447. timestamp: Date.now()
  15448. }), e, t),
  15449. encryptKeyId: n,
  15450. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  15451. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  15452. });
  15453. case 7:
  15454. case "end":
  15455. return _context43.stop();
  15456. }
  15457. }
  15458. }, _callee43, this);
  15459. }));
  15460. function platformGetSignOption() {
  15461. return _platformGetSignOption.apply(this, arguments);
  15462. }
  15463. return platformGetSignOption;
  15464. }()
  15465. }, {
  15466. key: "platformEncryptData",
  15467. value: function () {
  15468. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(e) {
  15469. var _yield$this$getUserEn2, t, n, s, r;
  15470. return _regenerator.default.wrap(function _callee44$(_context44) {
  15471. while (1) {
  15472. switch (_context44.prev = _context44.next) {
  15473. case 0:
  15474. _context44.next = 2;
  15475. return this.getUserEncryptKey();
  15476. case 2:
  15477. _yield$this$getUserEn2 = _context44.sent;
  15478. t = _yield$this$getUserEn2.encryptKey;
  15479. n = _yield$this$getUserEn2.iv;
  15480. s = _yield$this$getUserEn2.version;
  15481. r = {
  15482. secretType: this.secretType,
  15483. encryptKeyId: s,
  15484. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  15485. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  15486. };
  15487. return _context44.abrupt("return", this.secretType === Ft ? {
  15488. content: e,
  15489. _uniCloudOptions: r
  15490. } : {
  15491. content: Sn(JSON.stringify({
  15492. data: JSON.stringify(e),
  15493. appId: this.appId,
  15494. deviceId: this.deviceId,
  15495. wxAppId: this.getWxAppId(),
  15496. simulator: "devtools" === ae().platform,
  15497. timestamp: Date.now()
  15498. }), t, n),
  15499. _uniCloudOptions: r
  15500. });
  15501. case 8:
  15502. case "end":
  15503. return _context44.stop();
  15504. }
  15505. }
  15506. }, _callee44, this);
  15507. }));
  15508. function platformEncryptData(_x36) {
  15509. return _platformEncryptData.apply(this, arguments);
  15510. }
  15511. return platformEncryptData;
  15512. }()
  15513. }, {
  15514. key: "platformDecryptResult",
  15515. value: function () {
  15516. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(e) {
  15517. var t, _yield$this$getUserEn3, n, s;
  15518. return _regenerator.default.wrap(function _callee45$(_context45) {
  15519. while (1) {
  15520. switch (_context45.prev = _context45.next) {
  15521. case 0:
  15522. t = e.content;
  15523. _context45.next = 3;
  15524. return this.getUserEncryptKey();
  15525. case 3:
  15526. _yield$this$getUserEn3 = _context45.sent;
  15527. n = _yield$this$getUserEn3.encryptKey;
  15528. s = _yield$this$getUserEn3.iv;
  15529. return _context45.abrupt("return", JSON.parse(function (e, t, n) {
  15530. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  15531. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15532. i = In.utils.utf8.toBytes(n),
  15533. o = new In.ModeOfOperation.cbc(r, i),
  15534. a = In.padding.pkcs7.strip(o.decrypt(s));
  15535. return In.utils.utf8.fromBytes(a);
  15536. }(t, n, s)));
  15537. case 7:
  15538. case "end":
  15539. return _context45.stop();
  15540. }
  15541. }
  15542. }, _callee45, this);
  15543. }));
  15544. function platformDecryptResult(_x37) {
  15545. return _platformDecryptResult.apply(this, arguments);
  15546. }
  15547. return platformDecryptResult;
  15548. }()
  15549. }, {
  15550. key: "isClientKeyNotFound",
  15551. value: function isClientKeyNotFound() {
  15552. return !1;
  15553. }
  15554. }]);
  15555. return En;
  15556. }(jt);
  15557. function Ln(e) {
  15558. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  15559. n = {};
  15560. var _loop = function _loop(_s10) {
  15561. var r = t[_s10];
  15562. n[r] = function () {
  15563. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  15564. t[_key] = arguments[_key];
  15565. }
  15566. return new Promise(function (n, s) {
  15567. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  15568. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15569. e = _ref34.type,
  15570. t = _ref34.data,
  15571. r = _ref34.errCode,
  15572. i = _ref34.errMsg,
  15573. o = _ref34.errSubject,
  15574. a = _ref34.message;
  15575. "success" === e ? n(t) : s(Tn({
  15576. errCode: r,
  15577. errMsg: Pn[r] || i || a,
  15578. errSubject: o
  15579. }));
  15580. }])) : s(Tn({
  15581. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  15582. }));
  15583. });
  15584. };
  15585. };
  15586. for (var _s10 = 0; _s10 < t.length; _s10++) {
  15587. _loop(_s10);
  15588. }
  15589. return n;
  15590. }
  15591. var Rn = /*#__PURE__*/function (_jt2) {
  15592. (0, _inherits2.default)(Rn, _jt2);
  15593. var _super10 = _createSuper(Rn);
  15594. function Rn(e) {
  15595. var _this18;
  15596. (0, _classCallCheck2.default)(this, Rn);
  15597. _this18 = _super10.call(this, e), _this18.clientType = "app", _this18.appUtils = _objectSpread({}, Ln(uni.requireNativePlugin("plus"))), _this18.systemInfo = Cn || (Cn = ae());
  15598. return _this18;
  15599. }
  15600. (0, _createClass2.default)(Rn, [{
  15601. key: "hasClientKey",
  15602. value: function () {
  15603. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  15604. return _regenerator.default.wrap(function _callee46$(_context46) {
  15605. while (1) {
  15606. switch (_context46.prev = _context46.next) {
  15607. case 0:
  15608. _context46.next = 2;
  15609. return this.appUtils.hasClientKey({
  15610. provider: this.provider,
  15611. spaceId: this.spaceId
  15612. });
  15613. case 2:
  15614. this._hasClientKey = _context46.sent;
  15615. return _context46.abrupt("return", this._hasClientKey);
  15616. case 4:
  15617. case "end":
  15618. return _context46.stop();
  15619. }
  15620. }
  15621. }, _callee46, this);
  15622. }));
  15623. function hasClientKey() {
  15624. return _hasClientKey.apply(this, arguments);
  15625. }
  15626. return hasClientKey;
  15627. }()
  15628. }, {
  15629. key: "getAppClientKey",
  15630. value: function () {
  15631. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  15632. var _yield$this$appUtils$, e, t, n, s, r;
  15633. return _regenerator.default.wrap(function _callee47$(_context47) {
  15634. while (1) {
  15635. switch (_context47.prev = _context47.next) {
  15636. case 0:
  15637. _context47.next = 2;
  15638. return this.appUtils.encryptGetClientKeyPayload({
  15639. data: JSON.stringify({})
  15640. });
  15641. case 2:
  15642. _yield$this$appUtils$ = _context47.sent;
  15643. e = _yield$this$appUtils$.data;
  15644. t = _yield$this$appUtils$.key;
  15645. _context47.next = 7;
  15646. return this.uniCloudIns.callFunction({
  15647. name: "DCloud-clientDB",
  15648. data: {
  15649. redirectTo: "encryption",
  15650. action: "getAppClientKey",
  15651. data: e,
  15652. key: t
  15653. }
  15654. });
  15655. case 7:
  15656. _context47.t0 = _context47.sent.result;
  15657. if (_context47.t0) {
  15658. _context47.next = 10;
  15659. break;
  15660. }
  15661. _context47.t0 = {};
  15662. case 10:
  15663. n = _context47.t0;
  15664. if (!(0 !== n.errCode)) {
  15665. _context47.next = 13;
  15666. break;
  15667. }
  15668. throw function (e) {
  15669. return new te({
  15670. subject: e.errSubject || "uni-secure-network",
  15671. code: e.errCode || e.code || bn.code,
  15672. message: e.errMsg || e.message
  15673. });
  15674. }(n);
  15675. case 13:
  15676. s = n.clientKey, r = n.key;
  15677. _context47.next = 16;
  15678. return this.appUtils.setClientKey({
  15679. provider: this.provider,
  15680. spaceId: this.spaceId,
  15681. clientKey: s,
  15682. key: r
  15683. });
  15684. case 16:
  15685. case "end":
  15686. return _context47.stop();
  15687. }
  15688. }
  15689. }, _callee47, this);
  15690. }));
  15691. function getAppClientKey() {
  15692. return _getAppClientKey.apply(this, arguments);
  15693. }
  15694. return getAppClientKey;
  15695. }()
  15696. }, {
  15697. key: "ensureClientKey",
  15698. value: function () {
  15699. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
  15700. var _this19 = this;
  15701. var _ref35,
  15702. _ref35$forceUpdate,
  15703. e,
  15704. _args48 = arguments;
  15705. return _regenerator.default.wrap(function _callee48$(_context48) {
  15706. while (1) {
  15707. switch (_context48.prev = _context48.next) {
  15708. case 0:
  15709. _ref35 = _args48.length > 0 && _args48[0] !== undefined ? _args48[0] : {}, _ref35$forceUpdate = _ref35.forceUpdate, e = _ref35$forceUpdate === void 0 ? !1 : _ref35$forceUpdate;
  15710. _context48.t1 = !0;
  15711. _context48.next = 4;
  15712. return this.hasClientKey();
  15713. case 4:
  15714. _context48.t2 = _context48.sent;
  15715. _context48.t0 = _context48.t1 !== _context48.t2;
  15716. if (_context48.t0) {
  15717. _context48.next = 8;
  15718. break;
  15719. }
  15720. _context48.t0 = e;
  15721. case 8:
  15722. if (!_context48.t0) {
  15723. _context48.next = 10;
  15724. break;
  15725. }
  15726. return _context48.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) {
  15727. _this19.scopedGlobalCache.initStatus = d;
  15728. }).catch(function (e) {
  15729. throw _this19.scopedGlobalCache.initStatus = p, e;
  15730. }), this.scopedGlobalCache.initStatus = h), this.scopedGlobalCache.initPromise));
  15731. case 10:
  15732. case "end":
  15733. return _context48.stop();
  15734. }
  15735. }
  15736. }, _callee48, this);
  15737. }));
  15738. function ensureClientKey() {
  15739. return _ensureClientKey.apply(this, arguments);
  15740. }
  15741. return ensureClientKey;
  15742. }()
  15743. }, {
  15744. key: "prepare",
  15745. value: function () {
  15746. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  15747. var _ref36,
  15748. _ref36$forceUpdate,
  15749. e,
  15750. _args49 = arguments;
  15751. return _regenerator.default.wrap(function _callee49$(_context49) {
  15752. while (1) {
  15753. switch (_context49.prev = _context49.next) {
  15754. case 0:
  15755. _ref36 = _args49.length > 0 && _args49[0] !== undefined ? _args49[0] : {}, _ref36$forceUpdate = _ref36.forceUpdate, e = _ref36$forceUpdate === void 0 ? !1 : _ref36$forceUpdate;
  15756. _context49.next = 3;
  15757. return this.ensureClientKey({
  15758. forceUpdate: e
  15759. });
  15760. case 3:
  15761. case "end":
  15762. return _context49.stop();
  15763. }
  15764. }
  15765. }, _callee49, this);
  15766. }));
  15767. function prepare() {
  15768. return _prepare3.apply(this, arguments);
  15769. }
  15770. return prepare;
  15771. }()
  15772. }, {
  15773. key: "platformGetSignOption",
  15774. value: function () {
  15775. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  15776. var _yield$this$appUtils$2, e, t;
  15777. return _regenerator.default.wrap(function _callee50$(_context50) {
  15778. while (1) {
  15779. switch (_context50.prev = _context50.next) {
  15780. case 0:
  15781. _context50.next = 2;
  15782. return this.appUtils.encrypt({
  15783. provider: this.provider,
  15784. spaceId: this.spaceId,
  15785. data: JSON.stringify({})
  15786. });
  15787. case 2:
  15788. _yield$this$appUtils$2 = _context50.sent;
  15789. e = _yield$this$appUtils$2.data;
  15790. t = _yield$this$appUtils$2.key;
  15791. return _context50.abrupt("return", {
  15792. verifyClientSign: e,
  15793. encryptKeyId: t
  15794. });
  15795. case 6:
  15796. case "end":
  15797. return _context50.stop();
  15798. }
  15799. }
  15800. }, _callee50, this);
  15801. }));
  15802. function platformGetSignOption() {
  15803. return _platformGetSignOption2.apply(this, arguments);
  15804. }
  15805. return platformGetSignOption;
  15806. }()
  15807. }, {
  15808. key: "platformEncryptData",
  15809. value: function () {
  15810. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(e) {
  15811. var _yield$this$appUtils$3, t, n, s;
  15812. return _regenerator.default.wrap(function _callee51$(_context51) {
  15813. while (1) {
  15814. switch (_context51.prev = _context51.next) {
  15815. case 0:
  15816. _context51.next = 2;
  15817. return this.appUtils.encrypt({
  15818. provider: this.provider,
  15819. spaceId: this.spaceId,
  15820. data: JSON.stringify(e)
  15821. });
  15822. case 2:
  15823. _yield$this$appUtils$3 = _context51.sent;
  15824. t = _yield$this$appUtils$3.data;
  15825. n = _yield$this$appUtils$3.key;
  15826. s = {
  15827. secretType: this.secretType,
  15828. encryptKeyId: n
  15829. };
  15830. return _context51.abrupt("return", this.secretType === Ft ? {
  15831. content: e,
  15832. _uniCloudOptions: s
  15833. } : {
  15834. content: t,
  15835. _uniCloudOptions: s
  15836. });
  15837. case 7:
  15838. case "end":
  15839. return _context51.stop();
  15840. }
  15841. }
  15842. }, _callee51, this);
  15843. }));
  15844. function platformEncryptData(_x38) {
  15845. return _platformEncryptData2.apply(this, arguments);
  15846. }
  15847. return platformEncryptData;
  15848. }()
  15849. }, {
  15850. key: "platformDecryptResult",
  15851. value: function () {
  15852. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(e) {
  15853. var t, _e$_uniCloudOptions, n, s, r;
  15854. return _regenerator.default.wrap(function _callee52$(_context52) {
  15855. while (1) {
  15856. switch (_context52.prev = _context52.next) {
  15857. case 0:
  15858. t = e.content;
  15859. _e$_uniCloudOptions = e._uniCloudOptions;
  15860. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  15861. s = n.encryptKeyId;
  15862. _context52.next = 6;
  15863. return this.appUtils.decrypt({
  15864. provider: this.provider,
  15865. spaceId: this.spaceId,
  15866. data: t,
  15867. key: s
  15868. });
  15869. case 6:
  15870. r = _context52.sent;
  15871. return _context52.abrupt("return", JSON.parse(r.data));
  15872. case 8:
  15873. case "end":
  15874. return _context52.stop();
  15875. }
  15876. }
  15877. }, _callee52, this);
  15878. }));
  15879. function platformDecryptResult(_x39) {
  15880. return _platformDecryptResult2.apply(this, arguments);
  15881. }
  15882. return platformDecryptResult;
  15883. }()
  15884. }, {
  15885. key: "isClientKeyNotFound",
  15886. value: function isClientKeyNotFound() {
  15887. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15888. var t = e.result || {};
  15889. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  15890. }
  15891. }]);
  15892. return Rn;
  15893. }(jt);
  15894. function Un() {
  15895. var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15896. e = _ref37.secretType;
  15897. return e === qt || e === Ft || e === Kt;
  15898. }
  15899. function Nn() {
  15900. var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15901. e = _ref38.name,
  15902. _ref38$data = _ref38.data,
  15903. t = _ref38$data === void 0 ? {} : _ref38$data;
  15904. return "app" === P && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  15905. }
  15906. function Dn() {
  15907. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15908. e = _ref39.provider,
  15909. t = _ref39.spaceId,
  15910. n = _ref39.functionName;
  15911. var _ae = ae(),
  15912. s = _ae.appId,
  15913. r = _ae.uniPlatform,
  15914. i = _ae.osName;
  15915. var o = r;
  15916. "app" === r && (o = i);
  15917. var a = function () {
  15918. var _ref40 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15919. e = _ref40.provider,
  15920. t = _ref40.spaceId;
  15921. var n = A;
  15922. if (!n) return {};
  15923. e = function (e) {
  15924. return "tencent" === e ? "tcb" : e;
  15925. }(e);
  15926. var s = n.find(function (n) {
  15927. return n.provider === e && n.spaceId === t;
  15928. });
  15929. return s && s.config;
  15930. }({
  15931. provider: e,
  15932. spaceId: t
  15933. });
  15934. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  15935. var c = a.accessControl.function || {},
  15936. u = Object.keys(c);
  15937. if (0 === u.length) return !0;
  15938. var l = function (e, t) {
  15939. var n, s, r;
  15940. for (var _i2 = 0; _i2 < e.length; _i2++) {
  15941. var _o2 = e[_i2];
  15942. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  15943. return e.trim();
  15944. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  15945. }
  15946. return n || s || r;
  15947. }(u, n);
  15948. if (!l) return !1;
  15949. if ((c[l] || []).find(function () {
  15950. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15951. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  15952. })) return !0;
  15953. 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")), Tn(kn);
  15954. }
  15955. function Mn(_ref41) {
  15956. var e = _ref41.functionName,
  15957. t = _ref41.result,
  15958. n = _ref41.logPvd;
  15959. if (S && this.__dev__.debugLog && t && t.requestId) {
  15960. var _s11 = JSON.stringify({
  15961. spaceId: this.config.spaceId,
  15962. functionName: e,
  15963. requestId: t.requestId
  15964. });
  15965. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  15966. }
  15967. }
  15968. function qn(e) {
  15969. var t = e.callFunction,
  15970. n = function n(_n7) {
  15971. var _this20 = this;
  15972. var s = _n7.name;
  15973. _n7.data = Et.call(e, {
  15974. data: _n7.data
  15975. });
  15976. var r = {
  15977. aliyun: "aliyun",
  15978. tencent: "tcb",
  15979. tcb: "tcb",
  15980. alipay: "alipay"
  15981. }[this.config.provider],
  15982. i = Un(_n7),
  15983. o = Nn(_n7),
  15984. a = i || o;
  15985. return t.call(this, _n7).then(function (e) {
  15986. return e.errCode = 0, !a && Mn.call(_this20, {
  15987. functionName: s,
  15988. result: e,
  15989. logPvd: r
  15990. }), Promise.resolve(e);
  15991. }, function (e) {
  15992. return !a && Mn.call(_this20, {
  15993. functionName: s,
  15994. result: e,
  15995. logPvd: r
  15996. }), e && e.message && (e.message = function () {
  15997. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15998. _ref42$message = _ref42.message,
  15999. e = _ref42$message === void 0 ? "" : _ref42$message,
  16000. _ref42$extraInfo = _ref42.extraInfo,
  16001. t = _ref42$extraInfo === void 0 ? {} : _ref42$extraInfo,
  16002. _ref42$formatter = _ref42.formatter,
  16003. n = _ref42$formatter === void 0 ? [] : _ref42$formatter;
  16004. for (var _s12 = 0; _s12 < n.length; _s12++) {
  16005. var _n$_s = n[_s12],
  16006. _r4 = _n$_s.rule,
  16007. _i3 = _n$_s.content,
  16008. _o3 = _n$_s.mode,
  16009. _a = e.match(_r4);
  16010. if (!_a) continue;
  16011. var _c = _i3;
  16012. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  16013. _c = Dt(_c, "{$".concat(_e19, "}"), _a[_e19]);
  16014. }
  16015. for (var _e20 in t) {
  16016. _c = Dt(_c, "{".concat(_e20, "}"), t[_e20]);
  16017. }
  16018. return "replace" === _o3 ? _c : e + _c;
  16019. }
  16020. return e;
  16021. }({
  16022. message: "[".concat(_n7.name, "]: ").concat(e.message),
  16023. formatter: Rt,
  16024. extraInfo: {
  16025. functionName: s
  16026. }
  16027. })), Promise.reject(e);
  16028. });
  16029. };
  16030. e.callFunction = function (t) {
  16031. var _e$config = e.config,
  16032. s = _e$config.provider,
  16033. r = _e$config.spaceId,
  16034. i = t.name;
  16035. var o, a;
  16036. if (t.data = t.data || {}, S && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && C ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Lt), o = Lt) : o = n, o = o.bind(e), Nn(t)) a = n.call(e, t);else if (function (_ref43) {
  16037. var e = _ref43.name,
  16038. _ref43$data = _ref43.data,
  16039. t = _ref43$data === void 0 ? {} : _ref43$data;
  16040. return "mp-weixin" === P && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  16041. }(t)) a = o.call(e, t);else if (Un(t)) {
  16042. a = new xn({
  16043. secretType: t.secretType,
  16044. uniCloudIns: e
  16045. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  16046. } else if (Dn({
  16047. provider: s,
  16048. spaceId: r,
  16049. functionName: i
  16050. })) {
  16051. a = new xn({
  16052. secretType: t.secretType,
  16053. uniCloudIns: e
  16054. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  16055. } else a = o(t);
  16056. return Object.defineProperty(a, "result", {
  16057. get: function get() {
  16058. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  16059. }
  16060. }), a;
  16061. };
  16062. }
  16063. xn = "mp-weixin" !== P && "app" !== P ? /*#__PURE__*/function () {
  16064. function _class2() {
  16065. (0, _classCallCheck2.default)(this, _class2);
  16066. throw Tn({
  16067. message: "Platform ".concat(P, " is not supported by secure network")
  16068. });
  16069. }
  16070. return (0, _createClass2.default)(_class2);
  16071. }() : k ? "mp-weixin" === P ? En : Rn : /*#__PURE__*/function () {
  16072. function _class3() {
  16073. (0, _classCallCheck2.default)(this, _class3);
  16074. throw Tn({
  16075. message: "Platform ".concat(P, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  16076. });
  16077. }
  16078. return (0, _createClass2.default)(_class3);
  16079. }();
  16080. var Fn = Symbol("CLIENT_DB_INTERNAL");
  16081. function Kn(e, t) {
  16082. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Fn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  16083. get: function get(e, n, s) {
  16084. if ("_uniClient" === n) return null;
  16085. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  16086. if (n in e || "string" != typeof n) {
  16087. var _t13 = e[n];
  16088. return "function" == typeof _t13 ? _t13.bind(e) : _t13;
  16089. }
  16090. return t.get(e, n, s);
  16091. }
  16092. });
  16093. }
  16094. function jn(e) {
  16095. return {
  16096. on: function on(t, n) {
  16097. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  16098. },
  16099. off: function off(t, n) {
  16100. e[t] = e[t] || [];
  16101. var s = e[t].indexOf(n);
  16102. -1 !== s && e[t].splice(s, 1);
  16103. }
  16104. };
  16105. }
  16106. var Bn = ["db.Geo", "db.command", "command.aggregate"];
  16107. function $n(e, t) {
  16108. return Bn.indexOf("".concat(e, ".").concat(t)) > -1;
  16109. }
  16110. function Wn(e) {
  16111. switch (f(e)) {
  16112. case "array":
  16113. return e.map(function (e) {
  16114. return Wn(e);
  16115. });
  16116. case "object":
  16117. return e._internalType === Fn || Object.keys(e).forEach(function (t) {
  16118. e[t] = Wn(e[t]);
  16119. }), e;
  16120. case "regexp":
  16121. return {
  16122. $regexp: {
  16123. source: e.source,
  16124. flags: e.flags
  16125. }
  16126. };
  16127. case "date":
  16128. return {
  16129. $date: e.toISOString()
  16130. };
  16131. default:
  16132. return e;
  16133. }
  16134. }
  16135. function Hn(e) {
  16136. return e && e.content && e.content.$method;
  16137. }
  16138. var zn = /*#__PURE__*/function () {
  16139. function zn(e, t, n) {
  16140. (0, _classCallCheck2.default)(this, zn);
  16141. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  16142. }
  16143. (0, _createClass2.default)(zn, [{
  16144. key: "toJSON",
  16145. value: function toJSON() {
  16146. var e = this;
  16147. var t = [e.content];
  16148. for (; e.prevStage;) {
  16149. e = e.prevStage, t.push(e.content);
  16150. }
  16151. return {
  16152. $db: t.reverse().map(function (e) {
  16153. return {
  16154. $method: e.$method,
  16155. $param: Wn(e.$param)
  16156. };
  16157. })
  16158. };
  16159. }
  16160. }, {
  16161. key: "toString",
  16162. value: function toString() {
  16163. return JSON.stringify(this.toJSON());
  16164. }
  16165. }, {
  16166. key: "getAction",
  16167. value: function getAction() {
  16168. var e = this.toJSON().$db.find(function (e) {
  16169. return "action" === e.$method;
  16170. });
  16171. return e && e.$param && e.$param[0];
  16172. }
  16173. }, {
  16174. key: "getCommand",
  16175. value: function getCommand() {
  16176. return {
  16177. $db: this.toJSON().$db.filter(function (e) {
  16178. return "action" !== e.$method;
  16179. })
  16180. };
  16181. }
  16182. }, {
  16183. key: "isAggregate",
  16184. get: function get() {
  16185. var e = this;
  16186. for (; e;) {
  16187. var t = Hn(e),
  16188. _n8 = Hn(e.prevStage);
  16189. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  16190. e = e.prevStage;
  16191. }
  16192. return !1;
  16193. }
  16194. }, {
  16195. key: "isCommand",
  16196. get: function get() {
  16197. var e = this;
  16198. for (; e;) {
  16199. if ("command" === Hn(e)) return !0;
  16200. e = e.prevStage;
  16201. }
  16202. return !1;
  16203. }
  16204. }, {
  16205. key: "isAggregateCommand",
  16206. get: function get() {
  16207. var e = this;
  16208. for (; e;) {
  16209. var t = Hn(e),
  16210. _n9 = Hn(e.prevStage);
  16211. if ("aggregate" === t && "command" === _n9) return !0;
  16212. e = e.prevStage;
  16213. }
  16214. return !1;
  16215. }
  16216. }, {
  16217. key: "getNextStageFn",
  16218. value: function getNextStageFn(e) {
  16219. var t = this;
  16220. return function () {
  16221. return Jn({
  16222. $method: e,
  16223. $param: Wn(Array.from(arguments))
  16224. }, t, t._database);
  16225. };
  16226. }
  16227. }, {
  16228. key: "count",
  16229. get: function get() {
  16230. return this.isAggregate ? this.getNextStageFn("count") : function () {
  16231. return this._send("count", Array.from(arguments));
  16232. };
  16233. }
  16234. }, {
  16235. key: "remove",
  16236. get: function get() {
  16237. return this.isCommand ? this.getNextStageFn("remove") : function () {
  16238. return this._send("remove", Array.from(arguments));
  16239. };
  16240. }
  16241. }, {
  16242. key: "get",
  16243. value: function get() {
  16244. return this._send("get", Array.from(arguments));
  16245. }
  16246. }, {
  16247. key: "add",
  16248. get: function get() {
  16249. return this.isCommand ? this.getNextStageFn("add") : function () {
  16250. return this._send("add", Array.from(arguments));
  16251. };
  16252. }
  16253. }, {
  16254. key: "update",
  16255. value: function update() {
  16256. return this._send("update", Array.from(arguments));
  16257. }
  16258. }, {
  16259. key: "end",
  16260. value: function end() {
  16261. return this._send("end", Array.from(arguments));
  16262. }
  16263. }, {
  16264. key: "set",
  16265. get: function get() {
  16266. return this.isCommand ? this.getNextStageFn("set") : function () {
  16267. throw new Error("JQL禁止使用set方法");
  16268. };
  16269. }
  16270. }, {
  16271. key: "_send",
  16272. value: function _send(e, t) {
  16273. var n = this.getAction(),
  16274. s = this.getCommand();
  16275. if (s.$db.push({
  16276. $method: e,
  16277. $param: Wn(t)
  16278. }), S) {
  16279. var _e21 = s.$db.find(function (e) {
  16280. return "collection" === e.$method;
  16281. }),
  16282. _t14 = _e21 && _e21.$param;
  16283. _t14 && 1 === _t14.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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  16284. }
  16285. return this._database._callCloudFunction({
  16286. action: n,
  16287. command: s
  16288. });
  16289. }
  16290. }]);
  16291. return zn;
  16292. }();
  16293. function Jn(e, t, n) {
  16294. return Kn(new zn(e, t, n), {
  16295. get: function get(e, t) {
  16296. var s = "db";
  16297. return e && e.content && (s = e.content.$method), $n(s, t) ? Jn({
  16298. $method: t
  16299. }, e, n) : function () {
  16300. return Jn({
  16301. $method: t,
  16302. $param: Wn(Array.from(arguments))
  16303. }, e, n);
  16304. };
  16305. }
  16306. });
  16307. }
  16308. function Vn(_ref44) {
  16309. var e = _ref44.path,
  16310. t = _ref44.method;
  16311. return /*#__PURE__*/function () {
  16312. function _class4() {
  16313. (0, _classCallCheck2.default)(this, _class4);
  16314. this.param = Array.from(arguments);
  16315. }
  16316. (0, _createClass2.default)(_class4, [{
  16317. key: "toJSON",
  16318. value: function toJSON() {
  16319. return {
  16320. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  16321. return {
  16322. $method: e
  16323. };
  16324. })), [{
  16325. $method: t,
  16326. $param: this.param
  16327. }])
  16328. };
  16329. }
  16330. }, {
  16331. key: "toString",
  16332. value: function toString() {
  16333. return JSON.stringify(this.toJSON());
  16334. }
  16335. }]);
  16336. return _class4;
  16337. }();
  16338. }
  16339. function Gn(e) {
  16340. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16341. return Kn(new e(t), {
  16342. get: function get(e, t) {
  16343. return $n("db", t) ? Jn({
  16344. $method: t
  16345. }, null, e) : function () {
  16346. return Jn({
  16347. $method: t,
  16348. $param: Wn(Array.from(arguments))
  16349. }, null, e);
  16350. };
  16351. }
  16352. });
  16353. }
  16354. var Yn = /*#__PURE__*/function (_ref45) {
  16355. (0, _inherits2.default)(Yn, _ref45);
  16356. var _super11 = _createSuper(Yn);
  16357. function Yn() {
  16358. (0, _classCallCheck2.default)(this, Yn);
  16359. return _super11.apply(this, arguments);
  16360. }
  16361. (0, _createClass2.default)(Yn, [{
  16362. key: "_parseResult",
  16363. value: function _parseResult(e) {
  16364. return this._isJQL ? e.result : e;
  16365. }
  16366. }, {
  16367. key: "_callCloudFunction",
  16368. value: function _callCloudFunction(_ref46) {
  16369. var _this21 = this;
  16370. var e = _ref46.action,
  16371. t = _ref46.command,
  16372. n = _ref46.multiCommand,
  16373. s = _ref46.queryList;
  16374. function r(e, t) {
  16375. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  16376. var _r5 = s[_n10];
  16377. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  16378. }
  16379. }
  16380. var i = this,
  16381. o = this._isJQL ? "databaseForJQL" : "database";
  16382. function a(e) {
  16383. return i._callback("error", [e]), M(q(o, "fail"), e).then(function () {
  16384. return M(q(o, "complete"), e);
  16385. }).then(function () {
  16386. return r(null, e), Y(j, {
  16387. type: W,
  16388. content: e
  16389. }), Promise.reject(e);
  16390. });
  16391. }
  16392. var c = M(q(o, "invoke")),
  16393. u = this._uniClient;
  16394. return c.then(function () {
  16395. return u.callFunction({
  16396. name: "DCloud-clientDB",
  16397. type: l,
  16398. data: {
  16399. action: e,
  16400. command: t,
  16401. multiCommand: n
  16402. }
  16403. });
  16404. }).then(function (e) {
  16405. var _e$result = e.result,
  16406. t = _e$result.code,
  16407. n = _e$result.message,
  16408. s = _e$result.token,
  16409. c = _e$result.tokenExpired,
  16410. _e$result$systemInfo = _e$result.systemInfo,
  16411. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  16412. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  16413. var _u$_e = u[_e22],
  16414. _t15 = _u$_e.level,
  16415. _n11 = _u$_e.message,
  16416. _s13 = _u$_e.detail,
  16417. _r6 = console["app" === P && "warn" === _t15 ? "error" : _t15] || console.log;
  16418. var _i4 = "[System Info]" + _n11;
  16419. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  16420. }
  16421. if (t) {
  16422. return a(new te({
  16423. code: t,
  16424. message: n,
  16425. requestId: e.requestId
  16426. }));
  16427. }
  16428. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (re({
  16429. token: s,
  16430. tokenExpired: c
  16431. }), _this21._callbackAuth("refreshToken", [{
  16432. token: s,
  16433. tokenExpired: c
  16434. }]), _this21._callback("refreshToken", [{
  16435. token: s,
  16436. tokenExpired: c
  16437. }]), Y($, {
  16438. token: s,
  16439. tokenExpired: c
  16440. }));
  16441. var l = [{
  16442. prop: "affectedDocs",
  16443. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  16444. }, {
  16445. prop: "code",
  16446. tips: "code不再推荐使用,请使用errCode替代"
  16447. }, {
  16448. prop: "message",
  16449. tips: "message不再推荐使用,请使用errMsg替代"
  16450. }];
  16451. var _loop2 = function _loop2(_t16) {
  16452. var _l$_t = l[_t16],
  16453. n = _l$_t.prop,
  16454. s = _l$_t.tips;
  16455. if (n in e.result) {
  16456. var _t17 = e.result[n];
  16457. Object.defineProperty(e.result, n, {
  16458. get: function get() {
  16459. return console.warn(s), _t17;
  16460. }
  16461. });
  16462. }
  16463. };
  16464. for (var _t16 = 0; _t16 < l.length; _t16++) {
  16465. _loop2(_t16);
  16466. }
  16467. return function (e) {
  16468. return M(q(o, "success"), e).then(function () {
  16469. return M(q(o, "complete"), e);
  16470. }).then(function () {
  16471. r(e, null);
  16472. var t = i._parseResult(e);
  16473. return Y(j, {
  16474. type: W,
  16475. content: t
  16476. }), Promise.resolve(t);
  16477. });
  16478. }(e);
  16479. }, function (e) {
  16480. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  16481. return a(new te({
  16482. code: e.code || "SYSTEM_ERROR",
  16483. message: e.message,
  16484. requestId: e.requestId
  16485. }));
  16486. });
  16487. }
  16488. }]);
  16489. return Yn;
  16490. }( /*#__PURE__*/function () {
  16491. function _class5() {
  16492. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16493. _ref47$uniClient = _ref47.uniClient,
  16494. e = _ref47$uniClient === void 0 ? {} : _ref47$uniClient,
  16495. _ref47$isJQL = _ref47.isJQL,
  16496. t = _ref47$isJQL === void 0 ? !1 : _ref47$isJQL;
  16497. (0, _classCallCheck2.default)(this, _class5);
  16498. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = jn(this._authCallBacks)), this._isJQL = t, Object.assign(this, jn(this._dbCallBacks)), this.env = Kn({}, {
  16499. get: function get(e, t) {
  16500. return {
  16501. $env: t
  16502. };
  16503. }
  16504. }), this.Geo = Kn({}, {
  16505. get: function get(e, t) {
  16506. return Vn({
  16507. path: ["Geo"],
  16508. method: t
  16509. });
  16510. }
  16511. }), this.serverDate = Vn({
  16512. path: [],
  16513. method: "serverDate"
  16514. }), this.RegExp = Vn({
  16515. path: [],
  16516. method: "RegExp"
  16517. });
  16518. }
  16519. (0, _createClass2.default)(_class5, [{
  16520. key: "getCloudEnv",
  16521. value: function getCloudEnv(e) {
  16522. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  16523. return {
  16524. $env: e.replace("$cloudEnv_", "")
  16525. };
  16526. }
  16527. }, {
  16528. key: "_callback",
  16529. value: function _callback(e, t) {
  16530. var n = this._dbCallBacks;
  16531. n[e] && n[e].forEach(function (e) {
  16532. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  16533. });
  16534. }
  16535. }, {
  16536. key: "_callbackAuth",
  16537. value: function _callbackAuth(e, t) {
  16538. var n = this._authCallBacks;
  16539. n[e] && n[e].forEach(function (e) {
  16540. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  16541. });
  16542. }
  16543. }, {
  16544. key: "multiSend",
  16545. value: function multiSend() {
  16546. var e = Array.from(arguments),
  16547. t = e.map(function (e) {
  16548. var t = e.getAction(),
  16549. n = e.getCommand();
  16550. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  16551. return {
  16552. action: t,
  16553. command: n
  16554. };
  16555. });
  16556. return this._callCloudFunction({
  16557. multiCommand: t,
  16558. queryList: e
  16559. });
  16560. }
  16561. }]);
  16562. return _class5;
  16563. }());
  16564. var Qn = "token无效,跳转登录页面",
  16565. Xn = "token过期,跳转登录页面",
  16566. Zn = {
  16567. TOKEN_INVALID_TOKEN_EXPIRED: Xn,
  16568. TOKEN_INVALID_INVALID_CLIENTID: Qn,
  16569. TOKEN_INVALID: Qn,
  16570. TOKEN_INVALID_WRONG_TOKEN: Qn,
  16571. TOKEN_INVALID_ANONYMOUS_USER: Qn
  16572. },
  16573. es = {
  16574. "uni-id-token-expired": Xn,
  16575. "uni-id-check-token-failed": Qn,
  16576. "uni-id-token-not-exist": Qn,
  16577. "uni-id-check-device-feature-failed": Qn
  16578. };
  16579. function ts(e, t) {
  16580. var n = "";
  16581. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  16582. }
  16583. function ns() {
  16584. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16585. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  16586. var n = [],
  16587. s = [];
  16588. return e.forEach(function (e) {
  16589. !0 === e.needLogin ? n.push(ts(t, e.path)) : !1 === e.needLogin && s.push(ts(t, e.path));
  16590. }), {
  16591. needLoginPage: n,
  16592. notNeedLoginPage: s
  16593. };
  16594. }
  16595. function ss(e) {
  16596. return e.split("?")[0].replace(/^\//, "");
  16597. }
  16598. function rs() {
  16599. return function (e) {
  16600. var t = e && e.$page && e.$page.fullPath || "";
  16601. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  16602. }(function () {
  16603. var e = getCurrentPages();
  16604. return e[e.length - 1];
  16605. }());
  16606. }
  16607. function is() {
  16608. return ss(rs());
  16609. }
  16610. function os() {
  16611. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  16612. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16613. if (!e) return !1;
  16614. if (!(t && t.list && t.list.length)) return !1;
  16615. var n = t.list,
  16616. s = ss(e);
  16617. return n.some(function (e) {
  16618. return e.pagePath === s;
  16619. });
  16620. }
  16621. var as = !!_pages.default.uniIdRouter;
  16622. var _ref48 = function () {
  16623. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  16624. _ref29$pages = _ref29.pages,
  16625. t = _ref29$pages === void 0 ? [] : _ref29$pages,
  16626. _ref29$subPackages = _ref29.subPackages,
  16627. n = _ref29$subPackages === void 0 ? [] : _ref29$subPackages,
  16628. _ref29$uniIdRouter = _ref29.uniIdRouter,
  16629. s = _ref29$uniIdRouter === void 0 ? {} : _ref29$uniIdRouter,
  16630. _ref29$tabBar = _ref29.tabBar,
  16631. r = _ref29$tabBar === void 0 ? {} : _ref29$tabBar;
  16632. var i = s.loginPage,
  16633. _s$needLogin = s.needLogin,
  16634. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  16635. _s$resToLogin = s.resToLogin,
  16636. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  16637. _ns = ns(t),
  16638. c = _ns.needLoginPage,
  16639. u = _ns.notNeedLoginPage,
  16640. _ref31 = function () {
  16641. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16642. var t = [],
  16643. n = [];
  16644. return e.forEach(function (e) {
  16645. var s = e.root,
  16646. _e$pages = e.pages,
  16647. r = _e$pages === void 0 ? [] : _e$pages,
  16648. _ns2 = ns(r, s),
  16649. i = _ns2.needLoginPage,
  16650. o = _ns2.notNeedLoginPage;
  16651. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  16652. }), {
  16653. needLoginPage: t,
  16654. notNeedLoginPage: n
  16655. };
  16656. }(n),
  16657. l = _ref31.needLoginPage,
  16658. h = _ref31.notNeedLoginPage;
  16659. return {
  16660. loginPage: i,
  16661. routerNeedLogin: o,
  16662. resToLogin: a,
  16663. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  16664. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  16665. loginPageInTabBar: os(i, r)
  16666. };
  16667. }(),
  16668. cs = _ref48.loginPage,
  16669. us = _ref48.routerNeedLogin,
  16670. ls = _ref48.resToLogin,
  16671. hs = _ref48.needLoginPage,
  16672. ds = _ref48.notNeedLoginPage,
  16673. ps = _ref48.loginPageInTabBar;
  16674. if (hs.indexOf(cs) > -1) throw new Error("Login page [".concat(cs, "] should not be \"needLogin\", please check your pages.json"));
  16675. function fs(e) {
  16676. var t = is();
  16677. if ("/" === e.charAt(0)) return e;
  16678. var _e$split = e.split("?"),
  16679. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  16680. n = _e$split2[0],
  16681. s = _e$split2[1],
  16682. r = n.replace(/^\//, "").split("/"),
  16683. i = t.split("/");
  16684. i.pop();
  16685. for (var _e23 = 0; _e23 < r.length; _e23++) {
  16686. var _t18 = r[_e23];
  16687. ".." === _t18 ? i.pop() : "." !== _t18 && i.push(_t18);
  16688. }
  16689. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  16690. }
  16691. function gs(e) {
  16692. var t = ss(fs(e));
  16693. return !(ds.indexOf(t) > -1) && (hs.indexOf(t) > -1 || us.some(function (t) {
  16694. return function (e, t) {
  16695. return new RegExp(t).test(e);
  16696. }(e, t);
  16697. }));
  16698. }
  16699. function ms(_ref49) {
  16700. var e = _ref49.redirect;
  16701. var t = ss(e),
  16702. n = ss(cs);
  16703. return is() !== n && t !== n;
  16704. }
  16705. function ys() {
  16706. var _ref50 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16707. e = _ref50.api,
  16708. t = _ref50.redirect;
  16709. if (!t || !ms({
  16710. redirect: t
  16711. })) return;
  16712. var n = function (e, t) {
  16713. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  16714. }(cs, t);
  16715. ps ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  16716. var s = {
  16717. navigateTo: uni.navigateTo,
  16718. redirectTo: uni.redirectTo,
  16719. switchTab: uni.switchTab,
  16720. reLaunch: uni.reLaunch
  16721. };
  16722. setTimeout(function () {
  16723. s[e]({
  16724. url: n
  16725. });
  16726. });
  16727. }
  16728. function _s() {
  16729. var _ref51 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16730. e = _ref51.url;
  16731. var t = {
  16732. abortLoginPageJump: !1,
  16733. autoToLoginPage: !1
  16734. },
  16735. n = function () {
  16736. var _se3 = se(),
  16737. e = _se3.token,
  16738. t = _se3.tokenExpired;
  16739. var n;
  16740. if (e) {
  16741. if (t < Date.now()) {
  16742. var _e24 = "uni-id-token-expired";
  16743. n = {
  16744. errCode: _e24,
  16745. errMsg: es[_e24]
  16746. };
  16747. }
  16748. } else {
  16749. var _e25 = "uni-id-check-token-failed";
  16750. n = {
  16751. errCode: _e25,
  16752. errMsg: es[_e25]
  16753. };
  16754. }
  16755. return n;
  16756. }();
  16757. if (gs(e) && n) {
  16758. n.uniIdRedirectUrl = e;
  16759. if (J(B).length > 0) return setTimeout(function () {
  16760. Y(B, n);
  16761. }, 0), t.abortLoginPageJump = !0, t;
  16762. t.autoToLoginPage = !0;
  16763. }
  16764. return t;
  16765. }
  16766. function ws() {
  16767. !function () {
  16768. var e = rs(),
  16769. _s14 = _s({
  16770. url: e
  16771. }),
  16772. t = _s14.abortLoginPageJump,
  16773. n = _s14.autoToLoginPage;
  16774. t || n && ys({
  16775. api: "redirectTo",
  16776. redirect: e
  16777. });
  16778. }();
  16779. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  16780. var _loop3 = function _loop3(_t19) {
  16781. var n = e[_t19];
  16782. uni.addInterceptor(n, {
  16783. invoke: function invoke(e) {
  16784. var _s15 = _s({
  16785. url: e.url
  16786. }),
  16787. t = _s15.abortLoginPageJump,
  16788. s = _s15.autoToLoginPage;
  16789. return t ? e : s ? (ys({
  16790. api: n,
  16791. redirect: fs(e.url)
  16792. }), !1) : e;
  16793. }
  16794. });
  16795. };
  16796. for (var _t19 = 0; _t19 < e.length; _t19++) {
  16797. _loop3(_t19);
  16798. }
  16799. }
  16800. function vs() {
  16801. this.onResponse(function (e) {
  16802. var t = e.type,
  16803. n = e.content;
  16804. var s = !1;
  16805. switch (t) {
  16806. case "cloudobject":
  16807. s = function (e) {
  16808. if ("object" != (0, _typeof2.default)(e)) return !1;
  16809. var _ref52 = e || {},
  16810. t = _ref52.errCode;
  16811. return t in es;
  16812. }(n);
  16813. break;
  16814. case "clientdb":
  16815. s = function (e) {
  16816. if ("object" != (0, _typeof2.default)(e)) return !1;
  16817. var _ref53 = e || {},
  16818. t = _ref53.errCode;
  16819. return t in Zn;
  16820. }(n);
  16821. }
  16822. s && function () {
  16823. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16824. var t = J(B);
  16825. Z().then(function () {
  16826. var n = rs();
  16827. if (n && ms({
  16828. redirect: n
  16829. })) return t.length > 0 ? Y(B, Object.assign({
  16830. uniIdRedirectUrl: n
  16831. }, e)) : void (cs && ys({
  16832. api: "navigateTo",
  16833. redirect: n
  16834. }));
  16835. });
  16836. }(n);
  16837. });
  16838. }
  16839. function Is(e) {
  16840. !function (e) {
  16841. e.onResponse = function (e) {
  16842. V(j, e);
  16843. }, e.offResponse = function (e) {
  16844. G(j, e);
  16845. };
  16846. }(e), function (e) {
  16847. e.onNeedLogin = function (e) {
  16848. V(B, e);
  16849. }, e.offNeedLogin = function (e) {
  16850. G(B, e);
  16851. }, as && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, Z().then(function () {
  16852. ws.call(e);
  16853. }), ls && vs.call(e)));
  16854. }(e), function (e) {
  16855. e.onRefreshToken = function (e) {
  16856. V($, e);
  16857. }, e.offRefreshToken = function (e) {
  16858. G($, e);
  16859. };
  16860. }(e);
  16861. }
  16862. var Ss;
  16863. var bs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  16864. ks = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  16865. function As() {
  16866. var e = se().token || "",
  16867. t = e.split(".");
  16868. if (!e || 3 !== t.length) return {
  16869. uid: null,
  16870. role: [],
  16871. permission: [],
  16872. tokenExpired: 0
  16873. };
  16874. var n;
  16875. try {
  16876. n = JSON.parse((s = t[1], decodeURIComponent(Ss(s).split("").map(function (e) {
  16877. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  16878. }).join(""))));
  16879. } catch (e) {
  16880. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  16881. }
  16882. var s;
  16883. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  16884. }
  16885. Ss = "function" != typeof atob ? function (e) {
  16886. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !ks.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  16887. var t;
  16888. e += "==".slice(2 - (3 & e.length));
  16889. for (var n, s, r = "", i = 0; i < e.length;) {
  16890. t = bs.indexOf(e.charAt(i++)) << 18 | bs.indexOf(e.charAt(i++)) << 12 | (n = bs.indexOf(e.charAt(i++))) << 6 | (s = bs.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);
  16891. }
  16892. return r;
  16893. } : atob;
  16894. var Ps = n(function (e, t) {
  16895. Object.defineProperty(t, "__esModule", {
  16896. value: !0
  16897. });
  16898. var n = "chooseAndUploadFile:ok",
  16899. s = "chooseAndUploadFile:fail";
  16900. function r(e, t) {
  16901. return e.tempFiles.forEach(function (e, n) {
  16902. 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("."));
  16903. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  16904. return e.path;
  16905. })), e;
  16906. }
  16907. function i(e, t, _ref54) {
  16908. var s = _ref54.onChooseFile,
  16909. r = _ref54.onUploadProgress;
  16910. return t.then(function (e) {
  16911. if (s) {
  16912. var _t20 = s(e);
  16913. if (void 0 !== _t20) return Promise.resolve(_t20).then(function (t) {
  16914. return void 0 === t ? e : t;
  16915. });
  16916. }
  16917. return e;
  16918. }).then(function (t) {
  16919. return !1 === t ? {
  16920. errMsg: n,
  16921. tempFilePaths: [],
  16922. tempFiles: []
  16923. } : function (e, t) {
  16924. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  16925. var r = arguments.length > 3 ? arguments[3] : undefined;
  16926. (t = Object.assign({}, t)).errMsg = n;
  16927. var i = t.tempFiles,
  16928. o = i.length;
  16929. var a = 0;
  16930. return new Promise(function (n) {
  16931. for (; a < s;) {
  16932. c();
  16933. }
  16934. function c() {
  16935. var s = a++;
  16936. if (s >= o) return void (!i.find(function (e) {
  16937. return !e.url && !e.errMsg;
  16938. }) && n(t));
  16939. var u = i[s];
  16940. e.uploadFile({
  16941. filePath: u.path,
  16942. cloudPath: u.cloudPath,
  16943. fileType: u.fileType,
  16944. cloudPathAsRealPath: u.cloudPathAsRealPath,
  16945. onUploadProgress: function onUploadProgress(e) {
  16946. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  16947. }
  16948. }).then(function (e) {
  16949. u.url = e.fileID, s < o && c();
  16950. }).catch(function (e) {
  16951. u.errMsg = e.errMsg || e.message, s < o && c();
  16952. });
  16953. }
  16954. });
  16955. }(e, t, 5, r);
  16956. });
  16957. }
  16958. t.initChooseAndUploadFile = function (e) {
  16959. return function () {
  16960. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  16961. type: "all"
  16962. };
  16963. return "image" === t.type ? i(e, function (e) {
  16964. var t = e.count,
  16965. n = e.sizeType,
  16966. _e$sourceType = e.sourceType,
  16967. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  16968. o = e.extension;
  16969. return new Promise(function (e, a) {
  16970. uni.chooseImage({
  16971. count: t,
  16972. sizeType: n,
  16973. sourceType: i,
  16974. extension: o,
  16975. success: function success(t) {
  16976. e(r(t, "image"));
  16977. },
  16978. fail: function fail(e) {
  16979. a({
  16980. errMsg: e.errMsg.replace("chooseImage:fail", s)
  16981. });
  16982. }
  16983. });
  16984. });
  16985. }(t), t) : "video" === t.type ? i(e, function (e) {
  16986. var t = e.camera,
  16987. n = e.compressed,
  16988. i = e.maxDuration,
  16989. _e$sourceType2 = e.sourceType,
  16990. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  16991. a = e.extension;
  16992. return new Promise(function (e, c) {
  16993. uni.chooseVideo({
  16994. camera: t,
  16995. compressed: n,
  16996. maxDuration: i,
  16997. sourceType: o,
  16998. extension: a,
  16999. success: function success(t) {
  17000. var n = t.tempFilePath,
  17001. s = t.duration,
  17002. i = t.size,
  17003. o = t.height,
  17004. a = t.width;
  17005. e(r({
  17006. errMsg: "chooseVideo:ok",
  17007. tempFilePaths: [n],
  17008. tempFiles: [{
  17009. name: t.tempFile && t.tempFile.name || "",
  17010. path: n,
  17011. size: i,
  17012. type: t.tempFile && t.tempFile.type || "",
  17013. width: a,
  17014. height: o,
  17015. duration: s,
  17016. fileType: "video",
  17017. cloudPath: ""
  17018. }]
  17019. }, "video"));
  17020. },
  17021. fail: function fail(e) {
  17022. c({
  17023. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  17024. });
  17025. }
  17026. });
  17027. });
  17028. }(t), t) : i(e, function (e) {
  17029. var t = e.count,
  17030. n = e.extension;
  17031. return new Promise(function (e, i) {
  17032. var o = uni.chooseFile;
  17033. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  17034. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  17035. });
  17036. o({
  17037. type: "all",
  17038. count: t,
  17039. extension: n,
  17040. success: function success(t) {
  17041. e(r(t));
  17042. },
  17043. fail: function fail(e) {
  17044. i({
  17045. errMsg: e.errMsg.replace("chooseFile:fail", s)
  17046. });
  17047. }
  17048. });
  17049. });
  17050. }(t), t);
  17051. };
  17052. };
  17053. }),
  17054. Ts = t(Ps);
  17055. var Cs = "manual";
  17056. function xs(e) {
  17057. return {
  17058. props: {
  17059. localdata: {
  17060. type: Array,
  17061. default: function _default() {
  17062. return [];
  17063. }
  17064. },
  17065. options: {
  17066. type: [Object, Array],
  17067. default: function _default() {
  17068. return {};
  17069. }
  17070. },
  17071. spaceInfo: {
  17072. type: Object,
  17073. default: function _default() {
  17074. return {};
  17075. }
  17076. },
  17077. collection: {
  17078. type: [String, Array],
  17079. default: ""
  17080. },
  17081. action: {
  17082. type: String,
  17083. default: ""
  17084. },
  17085. field: {
  17086. type: String,
  17087. default: ""
  17088. },
  17089. orderby: {
  17090. type: String,
  17091. default: ""
  17092. },
  17093. where: {
  17094. type: [String, Object],
  17095. default: ""
  17096. },
  17097. pageData: {
  17098. type: String,
  17099. default: "add"
  17100. },
  17101. pageCurrent: {
  17102. type: Number,
  17103. default: 1
  17104. },
  17105. pageSize: {
  17106. type: Number,
  17107. default: 20
  17108. },
  17109. getcount: {
  17110. type: [Boolean, String],
  17111. default: !1
  17112. },
  17113. gettree: {
  17114. type: [Boolean, String],
  17115. default: !1
  17116. },
  17117. gettreepath: {
  17118. type: [Boolean, String],
  17119. default: !1
  17120. },
  17121. startwith: {
  17122. type: String,
  17123. default: ""
  17124. },
  17125. limitlevel: {
  17126. type: Number,
  17127. default: 10
  17128. },
  17129. groupby: {
  17130. type: String,
  17131. default: ""
  17132. },
  17133. groupField: {
  17134. type: String,
  17135. default: ""
  17136. },
  17137. distinct: {
  17138. type: [Boolean, String],
  17139. default: !1
  17140. },
  17141. foreignKey: {
  17142. type: String,
  17143. default: ""
  17144. },
  17145. loadtime: {
  17146. type: String,
  17147. default: "auto"
  17148. },
  17149. manual: {
  17150. type: Boolean,
  17151. default: !1
  17152. }
  17153. },
  17154. data: function data() {
  17155. return {
  17156. mixinDatacomLoading: !1,
  17157. mixinDatacomHasMore: !1,
  17158. mixinDatacomResData: [],
  17159. mixinDatacomErrorMessage: "",
  17160. mixinDatacomPage: {}
  17161. };
  17162. },
  17163. created: function created() {
  17164. var _this22 = this;
  17165. this.mixinDatacomPage = {
  17166. current: this.pageCurrent,
  17167. size: this.pageSize,
  17168. count: 0
  17169. }, this.$watch(function () {
  17170. var e = [];
  17171. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  17172. e.push(_this22[t]);
  17173. }), e;
  17174. }, function (e, t) {
  17175. if (_this22.loadtime === Cs) return;
  17176. var n = !1;
  17177. var s = [];
  17178. for (var _r7 = 2; _r7 < e.length; _r7++) {
  17179. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  17180. }
  17181. e[0] !== t[0] && (_this22.mixinDatacomPage.current = _this22.pageCurrent), _this22.mixinDatacomPage.size = _this22.pageSize, _this22.onMixinDatacomPropsChange(n, s);
  17182. });
  17183. },
  17184. methods: {
  17185. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  17186. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  17187. var _this23 = this;
  17188. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17189. _ref55$getone = _ref55.getone,
  17190. e = _ref55$getone === void 0 ? !1 : _ref55$getone,
  17191. t = _ref55.success,
  17192. n = _ref55.fail;
  17193. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  17194. _this23.mixinDatacomLoading = !1;
  17195. var _n$result = n.result,
  17196. s = _n$result.data,
  17197. r = _n$result.count;
  17198. _this23.getcount && (_this23.mixinDatacomPage.count = r), _this23.mixinDatacomHasMore = s.length < _this23.pageSize;
  17199. var i = e ? s.length ? s[0] : void 0 : s;
  17200. _this23.mixinDatacomResData = i, t && t(i);
  17201. }).catch(function (e) {
  17202. _this23.mixinDatacomLoading = !1, _this23.mixinDatacomErrorMessage = e, n && n(e);
  17203. }));
  17204. },
  17205. mixinDatacomGet: function mixinDatacomGet() {
  17206. var _n12;
  17207. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17208. var n = e.database(this.spaceInfo);
  17209. var s = t.action || this.action;
  17210. s && (n = n.action(s));
  17211. var r = t.collection || this.collection;
  17212. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  17213. var i = t.where || this.where;
  17214. i && Object.keys(i).length && (n = n.where(i));
  17215. var o = t.field || this.field;
  17216. o && (n = n.field(o));
  17217. var a = t.foreignKey || this.foreignKey;
  17218. a && (n = n.foreignKey(a));
  17219. var c = t.groupby || this.groupby;
  17220. c && (n = n.groupBy(c));
  17221. var u = t.groupField || this.groupField;
  17222. u && (n = n.groupField(u));
  17223. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  17224. var l = t.orderby || this.orderby;
  17225. l && (n = n.orderBy(l));
  17226. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  17227. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  17228. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  17229. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  17230. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  17231. m = {
  17232. getCount: p
  17233. },
  17234. y = {
  17235. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  17236. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  17237. };
  17238. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  17239. }
  17240. }
  17241. };
  17242. }
  17243. function Os(e) {
  17244. return function (t) {
  17245. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17246. n = function (e) {
  17247. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17248. 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;
  17249. }({
  17250. customUI: !1,
  17251. loadingOptions: {
  17252. title: "加载中...",
  17253. mask: !0
  17254. },
  17255. errorOptions: {
  17256. type: "modal",
  17257. retry: !1
  17258. }
  17259. }, n);
  17260. var _n13 = n,
  17261. s = _n13.customUI,
  17262. r = _n13.loadingOptions,
  17263. i = _n13.errorOptions,
  17264. o = _n13.parseSystemError,
  17265. a = !s;
  17266. return new Proxy({}, {
  17267. get: function get(s, c) {
  17268. return function () {
  17269. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17270. e = _ref56.fn,
  17271. t = _ref56.interceptorName,
  17272. n = _ref56.getCallbackArgs;
  17273. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  17274. var _len2,
  17275. s,
  17276. _key2,
  17277. r,
  17278. i,
  17279. o,
  17280. _args = arguments;
  17281. return _regenerator.default.wrap(function _callee53$(_context53) {
  17282. while (1) {
  17283. switch (_context53.prev = _context53.next) {
  17284. case 0:
  17285. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  17286. s[_key2] = _args[_key2];
  17287. }
  17288. r = n ? n({
  17289. params: s
  17290. }) : {};
  17291. _context53.prev = 2;
  17292. _context53.next = 5;
  17293. return M(q(t, "invoke"), _objectSpread({}, r));
  17294. case 5:
  17295. _context53.next = 7;
  17296. return e.apply(void 0, s);
  17297. case 7:
  17298. i = _context53.sent;
  17299. _context53.next = 10;
  17300. return M(q(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  17301. result: i
  17302. }));
  17303. case 10:
  17304. return _context53.abrupt("return", i);
  17305. case 13:
  17306. _context53.prev = 13;
  17307. _context53.t0 = _context53["catch"](2);
  17308. o = _context53.t0;
  17309. _context53.next = 18;
  17310. return M(q(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  17311. error: o
  17312. }));
  17313. case 18:
  17314. throw o;
  17315. case 19:
  17316. _context53.prev = 19;
  17317. _context53.next = 22;
  17318. return M(q(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  17319. error: o
  17320. }) : _objectSpread(_objectSpread({}, r), {}, {
  17321. result: i
  17322. }));
  17323. case 22:
  17324. return _context53.finish(19);
  17325. case 23:
  17326. case "end":
  17327. return _context53.stop();
  17328. }
  17329. }
  17330. }, _callee53, null, [[2, 13, 19, 23]]);
  17331. }));
  17332. }({
  17333. fn: function () {
  17334. var _s16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  17335. var h,
  17336. _len3,
  17337. l,
  17338. _key3,
  17339. d,
  17340. p,
  17341. _ref58,
  17342. f,
  17343. g,
  17344. m,
  17345. y,
  17346. _e26,
  17347. _yield,
  17348. _t21,
  17349. _n14,
  17350. _args4 = arguments;
  17351. return _regenerator.default.wrap(function _callee55$(_context55) {
  17352. while (1) {
  17353. switch (_context55.prev = _context55.next) {
  17354. case 0:
  17355. a && uni.showLoading({
  17356. title: r.title,
  17357. mask: r.mask
  17358. });
  17359. for (_len3 = _args4.length, l = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  17360. l[_key3] = _args4[_key3];
  17361. }
  17362. d = {
  17363. name: t,
  17364. type: u,
  17365. data: {
  17366. method: c,
  17367. params: l
  17368. }
  17369. };
  17370. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  17371. var n = t.data.method,
  17372. s = e.secretMethods || {},
  17373. r = s[n] || s["*"];
  17374. r && (t.secretType = r);
  17375. }(n, d);
  17376. p = !1;
  17377. _context55.prev = 5;
  17378. _context55.next = 8;
  17379. return e.callFunction(d);
  17380. case 8:
  17381. h = _context55.sent;
  17382. _context55.next = 14;
  17383. break;
  17384. case 11:
  17385. _context55.prev = 11;
  17386. _context55.t0 = _context55["catch"](5);
  17387. p = !0, h = {
  17388. result: new te(_context55.t0)
  17389. };
  17390. case 14:
  17391. _ref58 = h.result || {}, f = _ref58.errSubject, g = _ref58.errCode, m = _ref58.errMsg, y = _ref58.newToken;
  17392. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (re(y), Y($, _objectSpread({}, y))), g)) {
  17393. _context55.next = 39;
  17394. break;
  17395. }
  17396. _e26 = m;
  17397. if (!(p && o)) {
  17398. _context55.next = 24;
  17399. break;
  17400. }
  17401. _context55.next = 20;
  17402. return o({
  17403. objectName: t,
  17404. methodName: c,
  17405. params: l,
  17406. errSubject: f,
  17407. errCode: g,
  17408. errMsg: m
  17409. });
  17410. case 20:
  17411. _context55.t1 = _context55.sent.errMsg;
  17412. if (_context55.t1) {
  17413. _context55.next = 23;
  17414. break;
  17415. }
  17416. _context55.t1 = m;
  17417. case 23:
  17418. _e26 = _context55.t1;
  17419. case 24:
  17420. if (!a) {
  17421. _context55.next = 37;
  17422. break;
  17423. }
  17424. if (!("toast" === i.type)) {
  17425. _context55.next = 29;
  17426. break;
  17427. }
  17428. uni.showToast({
  17429. title: _e26,
  17430. icon: "none"
  17431. });
  17432. _context55.next = 37;
  17433. break;
  17434. case 29:
  17435. if (!("modal" !== i.type)) {
  17436. _context55.next = 31;
  17437. break;
  17438. }
  17439. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  17440. case 31:
  17441. _context55.next = 33;
  17442. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  17443. var _ref60,
  17444. e,
  17445. t,
  17446. n,
  17447. s,
  17448. r,
  17449. _args2 = arguments;
  17450. return _regenerator.default.wrap(function _callee54$(_context54) {
  17451. while (1) {
  17452. switch (_context54.prev = _context54.next) {
  17453. case 0:
  17454. _ref60 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref60.title, t = _ref60.content, n = _ref60.showCancel, s = _ref60.cancelText, r = _ref60.confirmText;
  17455. return _context54.abrupt("return", new Promise(function (i, o) {
  17456. uni.showModal({
  17457. title: e,
  17458. content: t,
  17459. showCancel: n,
  17460. cancelText: s,
  17461. confirmText: r,
  17462. success: function success(e) {
  17463. i(e);
  17464. },
  17465. fail: function fail() {
  17466. i({
  17467. confirm: !1,
  17468. cancel: !0
  17469. });
  17470. }
  17471. });
  17472. }));
  17473. case 2:
  17474. case "end":
  17475. return _context54.stop();
  17476. }
  17477. }
  17478. }, _callee54);
  17479. }))({
  17480. title: "提示",
  17481. content: _e26,
  17482. showCancel: i.retry,
  17483. cancelText: "取消",
  17484. confirmText: i.retry ? "重试" : "确定"
  17485. });
  17486. case 33:
  17487. _yield = _context55.sent;
  17488. _t21 = _yield.confirm;
  17489. if (!(i.retry && _t21)) {
  17490. _context55.next = 37;
  17491. break;
  17492. }
  17493. return _context55.abrupt("return", s.apply(void 0, l));
  17494. case 37:
  17495. _n14 = new te({
  17496. subject: f,
  17497. code: g,
  17498. message: m,
  17499. requestId: h.requestId
  17500. });
  17501. throw _n14.detail = h.result, Y(j, {
  17502. type: z,
  17503. content: _n14
  17504. }), _n14;
  17505. case 39:
  17506. return _context55.abrupt("return", (Y(j, {
  17507. type: z,
  17508. content: h.result
  17509. }), h.result));
  17510. case 40:
  17511. case "end":
  17512. return _context55.stop();
  17513. }
  17514. }
  17515. }, _callee55, null, [[5, 11]]);
  17516. }));
  17517. function s() {
  17518. return _s16.apply(this, arguments);
  17519. }
  17520. return s;
  17521. }(),
  17522. interceptorName: "callObject",
  17523. getCallbackArgs: function getCallbackArgs() {
  17524. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17525. e = _ref61.params;
  17526. return {
  17527. objectName: t,
  17528. methodName: c,
  17529. params: e
  17530. };
  17531. }
  17532. });
  17533. }
  17534. });
  17535. };
  17536. }
  17537. function Es(e) {
  17538. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  17539. }
  17540. function Ls() {
  17541. return _Ls.apply(this, arguments);
  17542. }
  17543. function _Ls() {
  17544. _Ls = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
  17545. var _ref73,
  17546. e,
  17547. _ref73$callLoginByWei,
  17548. t,
  17549. n,
  17550. s,
  17551. r,
  17552. _args7 = arguments;
  17553. return _regenerator.default.wrap(function _callee58$(_context58) {
  17554. while (1) {
  17555. switch (_context58.prev = _context58.next) {
  17556. case 0:
  17557. _ref73 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref73.openid, _ref73$callLoginByWei = _ref73.callLoginByWeixin, t = _ref73$callLoginByWei === void 0 ? !1 : _ref73$callLoginByWei;
  17558. n = Es(this);
  17559. if (!("mp-weixin" !== P)) {
  17560. _context58.next = 4;
  17561. break;
  17562. }
  17563. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(P, "`"));
  17564. case 4:
  17565. if (!(e && t)) {
  17566. _context58.next = 6;
  17567. break;
  17568. }
  17569. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  17570. case 6:
  17571. if (!e) {
  17572. _context58.next = 8;
  17573. break;
  17574. }
  17575. return _context58.abrupt("return", (n.mpWeixinOpenid = e, {}));
  17576. case 8:
  17577. _context58.next = 10;
  17578. return new Promise(function (e, t) {
  17579. uni.login({
  17580. success: function success(t) {
  17581. e(t.code);
  17582. },
  17583. fail: function fail(e) {
  17584. t(new Error(e.errMsg));
  17585. }
  17586. });
  17587. });
  17588. case 10:
  17589. s = _context58.sent;
  17590. r = this.importObject("uni-id-co", {
  17591. customUI: !0
  17592. });
  17593. _context58.next = 14;
  17594. return r.secureNetworkHandshakeByWeixin({
  17595. code: s,
  17596. callLoginByWeixin: t
  17597. });
  17598. case 14:
  17599. n.mpWeixinCode = s;
  17600. return _context58.abrupt("return", {
  17601. code: s
  17602. });
  17603. case 16:
  17604. case "end":
  17605. return _context58.stop();
  17606. }
  17607. }
  17608. }, _callee58, this);
  17609. }));
  17610. return _Ls.apply(this, arguments);
  17611. }
  17612. function Rs(_x40) {
  17613. return _Rs.apply(this, arguments);
  17614. }
  17615. function _Rs() {
  17616. _Rs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  17617. var t;
  17618. return _regenerator.default.wrap(function _callee59$(_context59) {
  17619. while (1) {
  17620. switch (_context59.prev = _context59.next) {
  17621. case 0:
  17622. t = Es(this);
  17623. return _context59.abrupt("return", (t.initPromise || (t.initPromise = Ls.call(this, e)), t.initPromise));
  17624. case 2:
  17625. case "end":
  17626. return _context59.stop();
  17627. }
  17628. }
  17629. }, _callee59, this);
  17630. }));
  17631. return _Rs.apply(this, arguments);
  17632. }
  17633. function Us(e) {
  17634. return function () {
  17635. var _ref62 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17636. t = _ref62.openid,
  17637. _ref62$callLoginByWei = _ref62.callLoginByWeixin,
  17638. n = _ref62$callLoginByWei === void 0 ? !1 : _ref62$callLoginByWei;
  17639. return Rs.call(e, {
  17640. openid: t,
  17641. callLoginByWeixin: n
  17642. });
  17643. };
  17644. }
  17645. function Ns(e) {
  17646. var t = {
  17647. getSystemInfo: uni.getSystemInfo,
  17648. getPushClientId: uni.getPushClientId
  17649. };
  17650. return function (n) {
  17651. return new Promise(function (s, r) {
  17652. t[e](_objectSpread(_objectSpread({}, n), {}, {
  17653. success: function success(e) {
  17654. s(e);
  17655. },
  17656. fail: function fail(e) {
  17657. r(e);
  17658. }
  17659. }));
  17660. });
  17661. };
  17662. }
  17663. var Ds = /*#__PURE__*/function (_ref63) {
  17664. (0, _inherits2.default)(Ds, _ref63);
  17665. var _super12 = _createSuper(Ds);
  17666. function Ds() {
  17667. var _this24;
  17668. (0, _classCallCheck2.default)(this, Ds);
  17669. _this24 = _super12.call(this), _this24._uniPushMessageCallback = _this24._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this24)), _this24._currentMessageId = -1, _this24._payloadQueue = [];
  17670. return _this24;
  17671. }
  17672. (0, _createClass2.default)(Ds, [{
  17673. key: "init",
  17674. value: function init() {
  17675. var _this25 = this;
  17676. return Promise.all([Ns("getSystemInfo")(), Ns("getPushClientId")()]).then(function () {
  17677. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  17678. _ref65 = (0, _slicedToArray2.default)(_ref64, 2),
  17679. _ref65$ = _ref65[0];
  17680. _ref65$ = _ref65$ === void 0 ? {} : _ref65$;
  17681. var e = _ref65$.appId,
  17682. _ref65$2 = _ref65[1];
  17683. _ref65$2 = _ref65$2 === void 0 ? {} : _ref65$2;
  17684. var t = _ref65$2.cid;
  17685. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  17686. if (!t) throw new Error("Invalid push client id");
  17687. _this25._appId = e, _this25._pushClientId = t, _this25._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this25.emit("open"), _this25._initMessageListener();
  17688. }, function (e) {
  17689. throw _this25.emit("error", e), _this25.close(), e;
  17690. });
  17691. }
  17692. }, {
  17693. key: "open",
  17694. value: function () {
  17695. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
  17696. return _regenerator.default.wrap(function _callee56$(_context56) {
  17697. while (1) {
  17698. switch (_context56.prev = _context56.next) {
  17699. case 0:
  17700. return _context56.abrupt("return", this.init());
  17701. case 1:
  17702. case "end":
  17703. return _context56.stop();
  17704. }
  17705. }
  17706. }, _callee56, this);
  17707. }));
  17708. function open() {
  17709. return _open.apply(this, arguments);
  17710. }
  17711. return open;
  17712. }()
  17713. }, {
  17714. key: "_isUniCloudSSE",
  17715. value: function _isUniCloudSSE(e) {
  17716. if ("receive" !== e.type) return !1;
  17717. var t = e && e.data && e.data.payload;
  17718. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  17719. }
  17720. }, {
  17721. key: "_receivePushMessage",
  17722. value: function _receivePushMessage(e) {
  17723. if (!this._isUniCloudSSE(e)) return;
  17724. var t = e && e.data && e.data.payload,
  17725. n = t.action,
  17726. s = t.messageId,
  17727. r = t.message;
  17728. this._payloadQueue.push({
  17729. action: n,
  17730. messageId: s,
  17731. message: r
  17732. }), this._consumMessage();
  17733. }
  17734. }, {
  17735. key: "_consumMessage",
  17736. value: function _consumMessage() {
  17737. var _this26 = this;
  17738. for (;;) {
  17739. var _e27 = this._payloadQueue.find(function (e) {
  17740. return e.messageId === _this26._currentMessageId + 1;
  17741. });
  17742. if (!_e27) break;
  17743. this._currentMessageId++, this._parseMessagePayload(_e27);
  17744. }
  17745. }
  17746. }, {
  17747. key: "_parseMessagePayload",
  17748. value: function _parseMessagePayload(e) {
  17749. var t = e.action,
  17750. n = e.messageId,
  17751. s = e.message;
  17752. "end" === t ? this._end({
  17753. messageId: n,
  17754. message: s
  17755. }) : "message" === t && this._appendMessage({
  17756. messageId: n,
  17757. message: s
  17758. });
  17759. }
  17760. }, {
  17761. key: "_appendMessage",
  17762. value: function _appendMessage() {
  17763. var _ref66 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17764. e = _ref66.messageId,
  17765. t = _ref66.message;
  17766. this.emit("message", t);
  17767. }
  17768. }, {
  17769. key: "_end",
  17770. value: function _end() {
  17771. var _ref67 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17772. e = _ref67.messageId,
  17773. t = _ref67.message;
  17774. this.emit("end", t), this.close();
  17775. }
  17776. }, {
  17777. key: "_initMessageListener",
  17778. value: function _initMessageListener() {
  17779. uni.onPushMessage(this._uniPushMessageCallback);
  17780. }
  17781. }, {
  17782. key: "_destroy",
  17783. value: function _destroy() {
  17784. uni.offPushMessage(this._uniPushMessageCallback);
  17785. }
  17786. }, {
  17787. key: "toJSON",
  17788. value: function toJSON() {
  17789. return {
  17790. appId: this._appId,
  17791. pushClientId: this._pushClientId,
  17792. seqId: this._seqId
  17793. };
  17794. }
  17795. }, {
  17796. key: "close",
  17797. value: function close() {
  17798. this._destroy(), this.emit("close");
  17799. }
  17800. }]);
  17801. return Ds;
  17802. }( /*#__PURE__*/function () {
  17803. function _class6() {
  17804. (0, _classCallCheck2.default)(this, _class6);
  17805. this._callback = {};
  17806. }
  17807. (0, _createClass2.default)(_class6, [{
  17808. key: "addListener",
  17809. value: function addListener(e, t) {
  17810. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  17811. }
  17812. }, {
  17813. key: "on",
  17814. value: function on(e, t) {
  17815. return this.addListener(e, t);
  17816. }
  17817. }, {
  17818. key: "removeListener",
  17819. value: function removeListener(e, t) {
  17820. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  17821. var n = this._callback[e];
  17822. if (!n) return;
  17823. var s = function (e, t) {
  17824. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  17825. if (e[_n15] === t) return _n15;
  17826. }
  17827. return -1;
  17828. }(n, t);
  17829. n.splice(s, 1);
  17830. }
  17831. }, {
  17832. key: "off",
  17833. value: function off(e, t) {
  17834. return this.removeListener(e, t);
  17835. }
  17836. }, {
  17837. key: "removeAllListener",
  17838. value: function removeAllListener(e) {
  17839. delete this._callback[e];
  17840. }
  17841. }, {
  17842. key: "emit",
  17843. value: function emit(e) {
  17844. var n = this._callback[e];
  17845. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  17846. t[_key4 - 1] = arguments[_key4];
  17847. }
  17848. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  17849. n[_e28].apply(n, t);
  17850. }
  17851. }
  17852. }]);
  17853. return _class6;
  17854. }());
  17855. function Ms(_x41, _x42) {
  17856. return _Ms.apply(this, arguments);
  17857. }
  17858. function _Ms() {
  17859. _Ms = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(e, t) {
  17860. var n, _e32, s;
  17861. return _regenerator.default.wrap(function _callee60$(_context60) {
  17862. while (1) {
  17863. switch (_context60.prev = _context60.next) {
  17864. case 0:
  17865. n = "http://".concat(e, ":").concat(t, "/system/ping");
  17866. _context60.prev = 1;
  17867. _context60.next = 4;
  17868. return s = {
  17869. url: n,
  17870. timeout: 500
  17871. }, new Promise(function (e, t) {
  17872. ne.request(_objectSpread(_objectSpread({}, s), {}, {
  17873. success: function success(t) {
  17874. e(t);
  17875. },
  17876. fail: function fail(e) {
  17877. t(e);
  17878. }
  17879. }));
  17880. });
  17881. case 4:
  17882. _e32 = _context60.sent;
  17883. return _context60.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  17884. case 8:
  17885. _context60.prev = 8;
  17886. _context60.t0 = _context60["catch"](1);
  17887. return _context60.abrupt("return", !1);
  17888. case 11:
  17889. case "end":
  17890. return _context60.stop();
  17891. }
  17892. }
  17893. }, _callee60, null, [[1, 8]]);
  17894. }));
  17895. return _Ms.apply(this, arguments);
  17896. }
  17897. function qs(_x43) {
  17898. return _qs.apply(this, arguments);
  17899. }
  17900. function _qs() {
  17901. _qs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62(e) {
  17902. var _ae2, _e33, _t23, t, _t$debugInfo, n, s, _yield2, r, i, o;
  17903. return _regenerator.default.wrap(function _callee62$(_context62) {
  17904. while (1) {
  17905. switch (_context62.prev = _context62.next) {
  17906. case 0:
  17907. if (S) {
  17908. _context62.next = 2;
  17909. break;
  17910. }
  17911. return _context62.abrupt("return", Promise.resolve());
  17912. case 2:
  17913. if ("app" === P) {
  17914. _ae2 = ae(), _e33 = _ae2.osName, _t23 = _ae2.osVersion;
  17915. "ios" === _e33 && function (e) {
  17916. if (!e || "string" != typeof e) return 0;
  17917. var t = e.match(/^(\d+)./);
  17918. return t && t[1] ? parseInt(t[1]) : 0;
  17919. }(_t23) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  17920. }
  17921. t = e.__dev__;
  17922. if (t.debugInfo) {
  17923. _context62.next = 6;
  17924. break;
  17925. }
  17926. return _context62.abrupt("return");
  17927. case 6:
  17928. _t$debugInfo = t.debugInfo;
  17929. n = _t$debugInfo.address;
  17930. s = _t$debugInfo.servePort;
  17931. _context62.next = 11;
  17932. return function () {
  17933. var _ref74 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(e, t) {
  17934. var n, _s17, _r8;
  17935. return _regenerator.default.wrap(function _callee61$(_context61) {
  17936. while (1) {
  17937. switch (_context61.prev = _context61.next) {
  17938. case 0:
  17939. _s17 = 0;
  17940. case 1:
  17941. if (!(_s17 < e.length)) {
  17942. _context61.next = 11;
  17943. break;
  17944. }
  17945. _r8 = e[_s17];
  17946. _context61.next = 5;
  17947. return Ms(_r8, t);
  17948. case 5:
  17949. if (!_context61.sent) {
  17950. _context61.next = 8;
  17951. break;
  17952. }
  17953. n = _r8;
  17954. return _context61.abrupt("break", 11);
  17955. case 8:
  17956. _s17++;
  17957. _context61.next = 1;
  17958. break;
  17959. case 11:
  17960. return _context61.abrupt("return", {
  17961. address: n,
  17962. port: t
  17963. });
  17964. case 12:
  17965. case "end":
  17966. return _context61.stop();
  17967. }
  17968. }
  17969. }, _callee61);
  17970. }));
  17971. return function (_x44, _x45) {
  17972. return _ref74.apply(this, arguments);
  17973. };
  17974. }()(n, s);
  17975. case 11:
  17976. _yield2 = _context62.sent;
  17977. r = _yield2.address;
  17978. if (!r) {
  17979. _context62.next = 15;
  17980. break;
  17981. }
  17982. return _context62.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  17983. case 15:
  17984. i = console["app" === P ? "error" : "warn"];
  17985. o = "";
  17986. 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" === P && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === P.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  17987. _context62.next = 19;
  17988. break;
  17989. }
  17990. throw new Error(o);
  17991. case 19:
  17992. i(o);
  17993. case 20:
  17994. case "end":
  17995. return _context62.stop();
  17996. }
  17997. }
  17998. }, _callee62);
  17999. }));
  18000. return _qs.apply(this, arguments);
  18001. }
  18002. function Fs(e) {
  18003. e._initPromiseHub || (e._initPromiseHub = new v({
  18004. createPromise: function createPromise() {
  18005. var t = Promise.resolve();
  18006. var n;
  18007. n = 1, t = new Promise(function (e) {
  18008. setTimeout(function () {
  18009. e();
  18010. }, n);
  18011. });
  18012. var s = e.auth();
  18013. return t.then(function () {
  18014. return s.getLoginState();
  18015. }).then(function (e) {
  18016. return e ? Promise.resolve() : s.signInAnonymously();
  18017. });
  18018. }
  18019. }));
  18020. }
  18021. var Ks = {
  18022. tcb: It,
  18023. tencent: It,
  18024. aliyun: de,
  18025. private: bt,
  18026. alipay: Ot
  18027. };
  18028. var js = new ( /*#__PURE__*/function () {
  18029. function _class7() {
  18030. (0, _classCallCheck2.default)(this, _class7);
  18031. }
  18032. (0, _createClass2.default)(_class7, [{
  18033. key: "init",
  18034. value: function init(e) {
  18035. var t = {};
  18036. var n = Ks[e.provider];
  18037. if (!n) throw new Error("未提供正确的provider参数");
  18038. t = n.init(e), S && function (e) {
  18039. if (!S) return;
  18040. var t = {};
  18041. e.__dev__ = t, t.debugLog = S && ("web" === P && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === P);
  18042. var n = T;
  18043. n && !n.code && (t.debugInfo = n);
  18044. var s = new v({
  18045. createPromise: function createPromise() {
  18046. return qs(e);
  18047. }
  18048. });
  18049. t.initLocalNetwork = function () {
  18050. return s.exec();
  18051. };
  18052. }(t), Fs(t), qn(t), function (e) {
  18053. var t = e.uploadFile;
  18054. e.uploadFile = function (e) {
  18055. return t.call(this, e);
  18056. };
  18057. }(t), function (e) {
  18058. e.database = function (t) {
  18059. if (t && Object.keys(t).length > 0) return e.init(t).database();
  18060. if (this._database) return this._database;
  18061. var n = Gn(Yn, {
  18062. uniClient: e
  18063. });
  18064. return this._database = n, n;
  18065. }, e.databaseForJQL = function (t) {
  18066. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  18067. if (this._databaseForJQL) return this._databaseForJQL;
  18068. var n = Gn(Yn, {
  18069. uniClient: e,
  18070. isJQL: !0
  18071. });
  18072. return this._databaseForJQL = n, n;
  18073. };
  18074. }(t), function (e) {
  18075. e.getCurrentUserInfo = As, e.chooseAndUploadFile = Ts.initChooseAndUploadFile(e), Object.assign(e, {
  18076. get mixinDatacom() {
  18077. return xs(e);
  18078. }
  18079. }), e.SSEChannel = Ds, e.initSecureNetworkByWeixin = Us(e), e.importObject = Os(e);
  18080. }(t);
  18081. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  18082. if (!t[e]) return;
  18083. var n = t[e];
  18084. t[e] = function () {
  18085. return n.apply(t, Array.from(arguments));
  18086. }, t[e] = function (e, t) {
  18087. return function (n) {
  18088. var _this27 = this;
  18089. var s = !1;
  18090. if ("callFunction" === t) {
  18091. var _e29 = n && n.type || c;
  18092. s = _e29 !== c;
  18093. }
  18094. var r = "callFunction" === t && !s,
  18095. i = this._initPromiseHub.exec();
  18096. n = n || {};
  18097. var _ee2 = ee(n),
  18098. o = _ee2.success,
  18099. a = _ee2.fail,
  18100. u = _ee2.complete,
  18101. l = i.then(function () {
  18102. return s ? Promise.resolve() : M(q(t, "invoke"), n);
  18103. }).then(function () {
  18104. return e.call(_this27, n);
  18105. }).then(function (e) {
  18106. return s ? Promise.resolve(e) : M(q(t, "success"), e).then(function () {
  18107. return M(q(t, "complete"), e);
  18108. }).then(function () {
  18109. return r && Y(j, {
  18110. type: H,
  18111. content: e
  18112. }), Promise.resolve(e);
  18113. });
  18114. }, function (e) {
  18115. return s ? Promise.reject(e) : M(q(t, "fail"), e).then(function () {
  18116. return M(q(t, "complete"), e);
  18117. }).then(function () {
  18118. return Y(j, {
  18119. type: H,
  18120. content: e
  18121. }), Promise.reject(e);
  18122. });
  18123. });
  18124. if (!(o || a || u)) return l;
  18125. l.then(function (e) {
  18126. o && o(e), u && u(e), r && Y(j, {
  18127. type: H,
  18128. content: e
  18129. });
  18130. }, function (e) {
  18131. a && a(e), u && u(e), r && Y(j, {
  18132. type: H,
  18133. content: e
  18134. });
  18135. });
  18136. };
  18137. }(t[e], e).bind(t);
  18138. }), t.init = this.init, t;
  18139. }
  18140. }]);
  18141. return _class7;
  18142. }())();
  18143. (function () {
  18144. var e = C;
  18145. var t = {};
  18146. if (e && 1 === e.length) t = e[0], js = js.init(t), js._isDefault = !0;else {
  18147. var _t22 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  18148. var _n16;
  18149. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t22.forEach(function (e) {
  18150. js[e] = function () {
  18151. return console.error(_n16), Promise.reject(new te({
  18152. code: "SYS_ERR",
  18153. message: _n16
  18154. }));
  18155. };
  18156. });
  18157. }
  18158. Object.assign(js, {
  18159. get mixinDatacom() {
  18160. return xs(js);
  18161. }
  18162. }), Is(js), js.addInterceptor = N, js.removeInterceptor = D, js.interceptObject = F, S && "web" === P && (window.uniCloud = js);
  18163. })();
  18164. var Bs = js;
  18165. exports.default = Bs;
  18166. /* 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"]))
  18167. /***/ }),
  18168. /***/ 290:
  18169. /*!************************************************************************!*\
  18170. !*** ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
  18171. \************************************************************************/
  18172. /*! no static exports found */
  18173. /***/ (function(module, exports, __webpack_require__) {
  18174. var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ 291);
  18175. function _objectWithoutProperties(source, excluded) {
  18176. if (source == null) return {};
  18177. var target = objectWithoutPropertiesLoose(source, excluded);
  18178. var key, i;
  18179. if (Object.getOwnPropertySymbols) {
  18180. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  18181. for (i = 0; i < sourceSymbolKeys.length; i++) {
  18182. key = sourceSymbolKeys[i];
  18183. if (excluded.indexOf(key) >= 0) continue;
  18184. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
  18185. target[key] = source[key];
  18186. }
  18187. }
  18188. return target;
  18189. }
  18190. module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18191. /***/ }),
  18192. /***/ 291:
  18193. /*!*****************************************************************************!*\
  18194. !*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
  18195. \*****************************************************************************/
  18196. /*! no static exports found */
  18197. /***/ (function(module, exports) {
  18198. function _objectWithoutPropertiesLoose(source, excluded) {
  18199. if (source == null) return {};
  18200. var target = {};
  18201. var sourceKeys = Object.keys(source);
  18202. var key, i;
  18203. for (i = 0; i < sourceKeys.length; i++) {
  18204. key = sourceKeys[i];
  18205. if (excluded.indexOf(key) >= 0) continue;
  18206. target[key] = source[key];
  18207. }
  18208. return target;
  18209. }
  18210. module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18211. /***/ }),
  18212. /***/ 292:
  18213. /*!****************************************************************!*\
  18214. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  18215. \****************************************************************/
  18216. /*! no static exports found */
  18217. /***/ (function(module, exports, __webpack_require__) {
  18218. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 273);
  18219. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  18220. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 293);
  18221. var construct = __webpack_require__(/*! ./construct.js */ 15);
  18222. function _wrapNativeSuper(Class) {
  18223. var _cache = typeof Map === "function" ? new Map() : undefined;
  18224. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  18225. if (Class === null || !isNativeFunction(Class)) return Class;
  18226. if (typeof Class !== "function") {
  18227. throw new TypeError("Super expression must either be null or a function");
  18228. }
  18229. if (typeof _cache !== "undefined") {
  18230. if (_cache.has(Class)) return _cache.get(Class);
  18231. _cache.set(Class, Wrapper);
  18232. }
  18233. function Wrapper() {
  18234. return construct(Class, arguments, getPrototypeOf(this).constructor);
  18235. }
  18236. Wrapper.prototype = Object.create(Class.prototype, {
  18237. constructor: {
  18238. value: Wrapper,
  18239. enumerable: false,
  18240. writable: true,
  18241. configurable: true
  18242. }
  18243. });
  18244. return setPrototypeOf(Wrapper, Class);
  18245. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18246. return _wrapNativeSuper(Class);
  18247. }
  18248. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18249. /***/ }),
  18250. /***/ 293:
  18251. /*!*****************************************************************!*\
  18252. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  18253. \*****************************************************************/
  18254. /*! no static exports found */
  18255. /***/ (function(module, exports) {
  18256. function _isNativeFunction(fn) {
  18257. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  18258. }
  18259. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18260. /***/ }),
  18261. /***/ 294:
  18262. /*!***************************************************************************************!*\
  18263. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"origin-pages-json"} ***!
  18264. \***************************************************************************************/
  18265. /*! no static exports found */
  18266. /***/ (function(module, exports, __webpack_require__) {
  18267. "use strict";
  18268. Object.defineProperty(exports, "__esModule", {
  18269. value: true
  18270. });
  18271. exports.default = void 0;
  18272. var _default = {
  18273. "pages": [{
  18274. "path": "pages/index/index",
  18275. "style": {
  18276. "navigationBarTitleText": "六院联创促进医院高质量发展"
  18277. }
  18278. }, {
  18279. "path": "pages/history/history",
  18280. "style": {
  18281. "navigationBarTitleText": "操作记录",
  18282. "enablePullDownRefresh": true
  18283. }
  18284. }, {
  18285. "path": "pages/history/detail/detail",
  18286. "style": {
  18287. "navigationBarTitleText": "操作记录详情"
  18288. }
  18289. }, {
  18290. "path": "pages/myCenter/myCenter",
  18291. "style": {
  18292. "navigationBarTitleText": "我的",
  18293. "enablePullDownRefresh": true
  18294. }
  18295. }, {
  18296. "path": "pages/login/index",
  18297. "style": {
  18298. "navigationBarTitleText": "登录"
  18299. }
  18300. }, {
  18301. "path": "pages/authorizedLogin/index",
  18302. "style": {
  18303. "navigationBarTitleText": "授权登录"
  18304. }
  18305. }, {
  18306. "path": "pages/service_agreement/service_agreement",
  18307. "style": {
  18308. "navigationBarTitleText": "隐私协议"
  18309. }
  18310. }, {
  18311. "path": "pages/app_views/satisfaction_evaluation/satisfaction_evaluation",
  18312. "style": {
  18313. "navigationBarTitleText": "满意度评价",
  18314. "enablePullDownRefresh": false
  18315. }
  18316. }, {
  18317. "path": "pages/app_views/safe_checked/safe_checked",
  18318. "style": {
  18319. "navigationBarTitleText": "安全巡检",
  18320. "enablePullDownRefresh": false
  18321. }
  18322. }, {
  18323. "path": "pages/app_views/danger/submit/submit",
  18324. "style": {
  18325. "navigationBarTitleText": "登记隐患",
  18326. "enablePullDownRefresh": false
  18327. }
  18328. }, {
  18329. "path": "pages/app_views/equipment_maintenance/equipment_maintenance",
  18330. "style": {
  18331. "navigationBarTitleText": "设备保养",
  18332. "enablePullDownRefresh": false
  18333. }
  18334. }, {
  18335. "path": "pages/app_views/problem_feedback/problem_feedback",
  18336. "style": {
  18337. "navigationBarTitleText": "问题反馈",
  18338. "enablePullDownRefresh": false
  18339. }
  18340. }, {
  18341. "path": "pages/app_views/danger/handle/handle",
  18342. "style": {
  18343. "navigationBarTitleText": "隐患处理",
  18344. "enablePullDownRefresh": false
  18345. }
  18346. }, {
  18347. "path": "pages/app_views/checkList/index/index",
  18348. "style": {
  18349. "navigationBarTitleText": "清单",
  18350. "enablePullDownRefresh": false
  18351. }
  18352. }, {
  18353. "path": "pages/app_views/checkList/form/form",
  18354. "style": {
  18355. "navigationBarTitleText": "风险点巡检",
  18356. "enablePullDownRefresh": false
  18357. }
  18358. }, {
  18359. "path": "pages/app_views/hazard/index/index",
  18360. "style": {
  18361. "navigationBarTitleText": "危险源",
  18362. "enablePullDownRefresh": false
  18363. }
  18364. }, {
  18365. "path": "pages/app_views/hazard/form/form",
  18366. "style": {
  18367. "navigationBarTitleText": "隐患提交",
  18368. "enablePullDownRefresh": false
  18369. }
  18370. }, {
  18371. "path": "pages/myCenter/profile/profile",
  18372. "style": {
  18373. "navigationBarTitleText": "个人信息",
  18374. "enablePullDownRefresh": false
  18375. }
  18376. }, {
  18377. "path": "pages/task/task",
  18378. "style": {
  18379. "navigationBarTitleText": "代办任务",
  18380. "enablePullDownRefresh": true
  18381. }
  18382. }, {
  18383. "path": "pages/danger/danger",
  18384. "style": {
  18385. "navigationBarTitleText": "待处理隐患",
  18386. "enablePullDownRefresh": true
  18387. }
  18388. }, {
  18389. "path": "pages/app_views/problem_feedback/record/record",
  18390. "style": {
  18391. "navigationBarTitleText": "问题反馈记录",
  18392. "enablePullDownRefresh": false
  18393. }
  18394. }, {
  18395. "path": "pages/app_views/problem_feedback/form/form",
  18396. "style": {
  18397. "navigationBarTitleText": "反馈处理",
  18398. "enablePullDownRefresh": false
  18399. }
  18400. }, {
  18401. "path": "pages/app_views/checkList/detail/detail",
  18402. "style": {
  18403. "navigationBarTitleText": "检查表详情",
  18404. "enablePullDownRefresh": false
  18405. }
  18406. }, {
  18407. "path": "pages/app_views/clockIn/index",
  18408. "style": {
  18409. "navigationBarTitleText": "打卡签到",
  18410. "enablePullDownRefresh": false
  18411. }
  18412. }],
  18413. "tabBar": {
  18414. "color": "#7A7E83",
  18415. "selectedColor": "#1296db",
  18416. "borderStyle": "black",
  18417. "backgroundColor": "#ffffff",
  18418. "list": [{
  18419. "pagePath": "pages/index/index",
  18420. "iconPath": "static/tabbar/index.png",
  18421. "selectedIconPath": "static/tabbar/indexEd.png",
  18422. "text": "首页"
  18423. }, {
  18424. "pagePath": "pages/history/history",
  18425. "iconPath": "static/tabbar/history.png",
  18426. "selectedIconPath": "static/tabbar/historyEd.png",
  18427. "text": "操作记录"
  18428. }, {
  18429. "pagePath": "pages/myCenter/myCenter",
  18430. "iconPath": "static/tabbar/myCenter.png",
  18431. "selectedIconPath": "static/tabbar/myCenterEd.png",
  18432. "text": "我的"
  18433. }]
  18434. },
  18435. "globalStyle": {
  18436. "navigationBarTextStyle": "black",
  18437. "navigationBarTitleText": "uni-app",
  18438. "navigationBarBackgroundColor": "#F8F8F8",
  18439. "backgroundColor": "#F8F8F8"
  18440. },
  18441. "permission": {
  18442. "scope.userLocation": {
  18443. "desc": "你的位置信息将用于打卡签到定位"
  18444. }
  18445. },
  18446. "uniIdRouter": {}
  18447. };
  18448. exports.default = _default;
  18449. /***/ }),
  18450. /***/ 295:
  18451. /*!**************************************************************************!*\
  18452. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"stat"} ***!
  18453. \**************************************************************************/
  18454. /*! no static exports found */
  18455. /***/ (function(module, exports, __webpack_require__) {
  18456. "use strict";
  18457. Object.defineProperty(exports, "__esModule", {
  18458. value: true
  18459. });
  18460. exports.default = void 0;
  18461. var _default = {
  18462. "appid": "__UNI__2E20170"
  18463. };
  18464. exports.default = _default;
  18465. /***/ }),
  18466. /***/ 3:
  18467. /*!***********************************!*\
  18468. !*** (webpack)/buildin/global.js ***!
  18469. \***********************************/
  18470. /*! no static exports found */
  18471. /***/ (function(module, exports) {
  18472. var g;
  18473. // This works in non-strict mode
  18474. g = (function() {
  18475. return this;
  18476. })();
  18477. try {
  18478. // This works if eval is allowed (see CSP)
  18479. g = g || new Function("return this")();
  18480. } catch (e) {
  18481. // This works if the window reference is available
  18482. if (typeof window === "object") g = window;
  18483. }
  18484. // g can still be undefined, but nothing to do about it...
  18485. // We return undefined, instead of nothing here, so it's
  18486. // easier to handle this case. if(!global) { ...}
  18487. module.exports = g;
  18488. /***/ }),
  18489. /***/ 310:
  18490. /*!****************************************************************************************************************************!*\
  18491. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  18492. \****************************************************************************************************************************/
  18493. /*! no static exports found */
  18494. /***/ (function(module, exports, __webpack_require__) {
  18495. "use strict";
  18496. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18497. Object.defineProperty(exports, "__esModule", {
  18498. value: true
  18499. });
  18500. exports.default = void 0;
  18501. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 311));
  18502. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 312));
  18503. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 313));
  18504. var _default = {
  18505. en: _en.default,
  18506. 'zh-Hans': _zhHans.default,
  18507. 'zh-Hant': _zhHant.default
  18508. };
  18509. exports.default = _default;
  18510. /***/ }),
  18511. /***/ 311:
  18512. /*!***************************************************************************************************************************!*\
  18513. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  18514. \***************************************************************************************************************************/
  18515. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.SUN, uni-calender.confirm, default */
  18516. /***/ (function(module) {
  18517. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select date and time\",\"uni-datetime-picker.startDate\":\"start date\",\"uni-datetime-picker.endDate\":\"end date\",\"uni-datetime-picker.startTime\":\"start time\",\"uni-datetime-picker.endTime\":\"end time\",\"uni-datetime-picker.ok\":\"ok\",\"uni-datetime-picker.clear\":\"clear\",\"uni-datetime-picker.cancel\":\"cancel\",\"uni-datetime-picker.year\":\"-\",\"uni-datetime-picker.month\":\"\",\"uni-calender.MON\":\"MON\",\"uni-calender.TUE\":\"TUE\",\"uni-calender.WED\":\"WED\",\"uni-calender.THU\":\"THU\",\"uni-calender.FRI\":\"FRI\",\"uni-calender.SAT\":\"SAT\",\"uni-calender.SUN\":\"SUN\",\"uni-calender.confirm\":\"confirm\"}");
  18518. /***/ }),
  18519. /***/ 312:
  18520. /*!********************************************************************************************************************************!*\
  18521. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  18522. \********************************************************************************************************************************/
  18523. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  18524. /***/ (function(module) {
  18525. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"选择日期\",\"uni-datetime-picker.selectTime\":\"选择时间\",\"uni-datetime-picker.selectDateTime\":\"选择日期时间\",\"uni-datetime-picker.startDate\":\"开始日期\",\"uni-datetime-picker.endDate\":\"结束日期\",\"uni-datetime-picker.startTime\":\"开始时间\",\"uni-datetime-picker.endTime\":\"结束时间\",\"uni-datetime-picker.ok\":\"确定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"确认\"}");
  18526. /***/ }),
  18527. /***/ 313:
  18528. /*!********************************************************************************************************************************!*\
  18529. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  18530. \********************************************************************************************************************************/
  18531. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  18532. /***/ (function(module) {
  18533. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"選擇日期\",\"uni-datetime-picker.selectTime\":\"選擇時間\",\"uni-datetime-picker.selectDateTime\":\"選擇日期時間\",\"uni-datetime-picker.startDate\":\"開始日期\",\"uni-datetime-picker.endDate\":\"結束日期\",\"uni-datetime-picker.startTime\":\"開始时间\",\"uni-datetime-picker.endTime\":\"結束时间\",\"uni-datetime-picker.ok\":\"確定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"確認\"}");
  18534. /***/ }),
  18535. /***/ 314:
  18536. /*!**********************************************************************************************************************!*\
  18537. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  18538. \**********************************************************************************************************************/
  18539. /*! no static exports found */
  18540. /***/ (function(module, exports, __webpack_require__) {
  18541. "use strict";
  18542. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18543. Object.defineProperty(exports, "__esModule", {
  18544. value: true
  18545. });
  18546. exports.Calendar = void 0;
  18547. exports.addZero = addZero;
  18548. exports.checkDate = checkDate;
  18549. exports.dateCompare = dateCompare;
  18550. exports.fixIosDateFormat = fixIosDateFormat;
  18551. exports.getDate = getDate;
  18552. exports.getDateTime = getDateTime;
  18553. exports.getDefaultSecond = getDefaultSecond;
  18554. exports.getTime = getTime;
  18555. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  18556. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  18557. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  18558. var Calendar = /*#__PURE__*/function () {
  18559. function Calendar() {
  18560. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18561. selected = _ref.selected,
  18562. startDate = _ref.startDate,
  18563. endDate = _ref.endDate,
  18564. range = _ref.range;
  18565. (0, _classCallCheck2.default)(this, Calendar);
  18566. // 当前日期
  18567. this.date = this.getDateObj(new Date()); // 当前初入日期
  18568. // 打点信息
  18569. this.selected = selected || [];
  18570. // 起始时间
  18571. this.startDate = startDate;
  18572. // 终止时间
  18573. this.endDate = endDate;
  18574. // 是否范围选择
  18575. this.range = range;
  18576. // 多选状态
  18577. this.cleanMultipleStatus();
  18578. // 每周日期
  18579. this.weeks = {};
  18580. this.lastHover = false;
  18581. }
  18582. /**
  18583. * 设置日期
  18584. * @param {Object} date
  18585. */
  18586. (0, _createClass2.default)(Calendar, [{
  18587. key: "setDate",
  18588. value: function setDate(date) {
  18589. var selectDate = this.getDateObj(date);
  18590. this.getWeeks(selectDate.fullDate);
  18591. }
  18592. /**
  18593. * 清理多选状态
  18594. */
  18595. }, {
  18596. key: "cleanMultipleStatus",
  18597. value: function cleanMultipleStatus() {
  18598. this.multipleStatus = {
  18599. before: '',
  18600. after: '',
  18601. data: []
  18602. };
  18603. }
  18604. }, {
  18605. key: "setStartDate",
  18606. value: function setStartDate(startDate) {
  18607. this.startDate = startDate;
  18608. }
  18609. }, {
  18610. key: "setEndDate",
  18611. value: function setEndDate(endDate) {
  18612. this.endDate = endDate;
  18613. }
  18614. }, {
  18615. key: "getPreMonthObj",
  18616. value: function getPreMonthObj(date) {
  18617. date = fixIosDateFormat(date);
  18618. date = new Date(date);
  18619. var oldMonth = date.getMonth();
  18620. date.setMonth(oldMonth - 1);
  18621. var newMonth = date.getMonth();
  18622. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  18623. date.setMonth(newMonth - 1);
  18624. }
  18625. return this.getDateObj(date);
  18626. }
  18627. }, {
  18628. key: "getNextMonthObj",
  18629. value: function getNextMonthObj(date) {
  18630. date = fixIosDateFormat(date);
  18631. date = new Date(date);
  18632. var oldMonth = date.getMonth();
  18633. date.setMonth(oldMonth + 1);
  18634. var newMonth = date.getMonth();
  18635. if (newMonth - oldMonth > 1) {
  18636. date.setMonth(newMonth - 1);
  18637. }
  18638. return this.getDateObj(date);
  18639. }
  18640. /**
  18641. * 获取指定格式Date对象
  18642. */
  18643. }, {
  18644. key: "getDateObj",
  18645. value: function getDateObj(date) {
  18646. date = fixIosDateFormat(date);
  18647. date = new Date(date);
  18648. return {
  18649. fullDate: getDate(date),
  18650. year: date.getFullYear(),
  18651. month: addZero(date.getMonth() + 1),
  18652. date: addZero(date.getDate()),
  18653. day: date.getDay()
  18654. };
  18655. }
  18656. /**
  18657. * 获取上一个月日期集合
  18658. */
  18659. }, {
  18660. key: "getPreMonthDays",
  18661. value: function getPreMonthDays(amount, dateObj) {
  18662. var _this = this;
  18663. var result = [];
  18664. var _loop = function _loop(i) {
  18665. var month = dateObj.month > 1 ? dateObj.month - 1 : 12;
  18666. var year = month === 12 ? dateObj.year - 1 : dateObj.year;
  18667. var date = new Date(year, month, -i).getDate();
  18668. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(date));
  18669. var multiples = _this.multipleStatus.data;
  18670. var multiplesStatus = -1;
  18671. if (_this.range && multiples) {
  18672. multiplesStatus = multiples.findIndex(function (item) {
  18673. return _this.dateEqual(item, fullDate);
  18674. });
  18675. }
  18676. var checked = multiplesStatus !== -1;
  18677. // 获取打点信息
  18678. var extraInfo = _this.selected && _this.selected.find(function (item) {
  18679. if (_this.dateEqual(fullDate, item.date)) {
  18680. return item;
  18681. }
  18682. });
  18683. result.push({
  18684. fullDate: fullDate,
  18685. year: year,
  18686. month: month,
  18687. date: date,
  18688. multiple: _this.range ? checked : false,
  18689. beforeMultiple: _this.isLogicBefore(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18690. afterMultiple: _this.isLogicAfter(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18691. disable: _this.startDate && !dateCompare(_this.startDate, fullDate) || _this.endDate && !dateCompare(fullDate, _this.endDate),
  18692. isToday: fullDate === _this.date.fullDate,
  18693. userChecked: false,
  18694. extraInfo: extraInfo
  18695. });
  18696. };
  18697. for (var i = amount - 1; i >= 0; i--) {
  18698. _loop(i);
  18699. }
  18700. return result;
  18701. }
  18702. /**
  18703. * 获取本月日期集合
  18704. */
  18705. }, {
  18706. key: "getCurrentMonthDays",
  18707. value: function getCurrentMonthDays(amount, dateObj) {
  18708. var _this2 = this;
  18709. var result = [];
  18710. var fullDate = this.date.fullDate;
  18711. var _loop2 = function _loop2(i) {
  18712. var currentDate = "".concat(dateObj.year, "-").concat(dateObj.month, "-").concat(addZero(i));
  18713. var isToday = fullDate === currentDate;
  18714. // 获取打点信息
  18715. var extraInfo = _this2.selected && _this2.selected.find(function (item) {
  18716. if (_this2.dateEqual(currentDate, item.date)) {
  18717. return item;
  18718. }
  18719. });
  18720. // 日期禁用
  18721. var disableBefore = true;
  18722. var disableAfter = true;
  18723. if (_this2.startDate) {
  18724. disableBefore = dateCompare(_this2.startDate, currentDate);
  18725. }
  18726. if (_this2.endDate) {
  18727. disableAfter = dateCompare(currentDate, _this2.endDate);
  18728. }
  18729. var multiples = _this2.multipleStatus.data;
  18730. var multiplesStatus = -1;
  18731. if (_this2.range && multiples) {
  18732. multiplesStatus = multiples.findIndex(function (item) {
  18733. return _this2.dateEqual(item, currentDate);
  18734. });
  18735. }
  18736. var checked = multiplesStatus !== -1;
  18737. result.push({
  18738. fullDate: currentDate,
  18739. year: dateObj.year,
  18740. month: dateObj.month,
  18741. date: i,
  18742. multiple: _this2.range ? checked : false,
  18743. beforeMultiple: _this2.isLogicBefore(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  18744. afterMultiple: _this2.isLogicAfter(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  18745. disable: _this2.startDate && !dateCompare(_this2.startDate, currentDate) || _this2.endDate && !dateCompare(currentDate, _this2.endDate),
  18746. isToday: isToday,
  18747. userChecked: false,
  18748. extraInfo: extraInfo
  18749. });
  18750. };
  18751. for (var i = 1; i <= amount; i++) {
  18752. _loop2(i);
  18753. }
  18754. return result;
  18755. }
  18756. /**
  18757. * 获取下一个月日期集合
  18758. */
  18759. }, {
  18760. key: "_getNextMonthDays",
  18761. value: function _getNextMonthDays(amount, dateObj) {
  18762. var _this3 = this;
  18763. var result = [];
  18764. var month = dateObj.month + 1;
  18765. var _loop3 = function _loop3(i) {
  18766. var month = dateObj.month === 12 ? 1 : dateObj.month * 1 + 1;
  18767. var year = month === 1 ? dateObj.year + 1 : dateObj.year;
  18768. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(i));
  18769. var multiples = _this3.multipleStatus.data;
  18770. var multiplesStatus = -1;
  18771. if (_this3.range && multiples) {
  18772. multiplesStatus = multiples.findIndex(function (item) {
  18773. return _this3.dateEqual(item, fullDate);
  18774. });
  18775. }
  18776. var checked = multiplesStatus !== -1;
  18777. // 获取打点信息
  18778. var extraInfo = _this3.selected && _this3.selected.find(function (item) {
  18779. if (_this3.dateEqual(fullDate, item.date)) {
  18780. return item;
  18781. }
  18782. });
  18783. result.push({
  18784. fullDate: fullDate,
  18785. year: year,
  18786. date: i,
  18787. month: month,
  18788. multiple: _this3.range ? checked : false,
  18789. beforeMultiple: _this3.isLogicBefore(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  18790. afterMultiple: _this3.isLogicAfter(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  18791. disable: _this3.startDate && !dateCompare(_this3.startDate, fullDate) || _this3.endDate && !dateCompare(fullDate, _this3.endDate),
  18792. isToday: fullDate === _this3.date.fullDate,
  18793. userChecked: false,
  18794. extraInfo: extraInfo
  18795. });
  18796. };
  18797. for (var i = 1; i <= amount; i++) {
  18798. _loop3(i);
  18799. }
  18800. return result;
  18801. }
  18802. /**
  18803. * 获取当前日期详情
  18804. * @param {Object} date
  18805. */
  18806. }, {
  18807. key: "getInfo",
  18808. value: function getInfo(date) {
  18809. var _this4 = this;
  18810. if (!date) {
  18811. date = new Date();
  18812. }
  18813. return this.calendar.find(function (item) {
  18814. return item.fullDate === _this4.getDateObj(date).fullDate;
  18815. });
  18816. }
  18817. /**
  18818. * 比较时间是否相等
  18819. */
  18820. }, {
  18821. key: "dateEqual",
  18822. value: function dateEqual(before, after) {
  18823. before = new Date(fixIosDateFormat(before));
  18824. after = new Date(fixIosDateFormat(after));
  18825. return before.valueOf() === after.valueOf();
  18826. }
  18827. /**
  18828. * 比较真实起始日期
  18829. */
  18830. }, {
  18831. key: "isLogicBefore",
  18832. value: function isLogicBefore(currentDate, before, after) {
  18833. var logicBefore = before;
  18834. if (before && after) {
  18835. logicBefore = dateCompare(before, after) ? before : after;
  18836. }
  18837. return this.dateEqual(logicBefore, currentDate);
  18838. }
  18839. }, {
  18840. key: "isLogicAfter",
  18841. value: function isLogicAfter(currentDate, before, after) {
  18842. var logicAfter = after;
  18843. if (before && after) {
  18844. logicAfter = dateCompare(before, after) ? after : before;
  18845. }
  18846. return this.dateEqual(logicAfter, currentDate);
  18847. }
  18848. /**
  18849. * 获取日期范围内所有日期
  18850. * @param {Object} begin
  18851. * @param {Object} end
  18852. */
  18853. }, {
  18854. key: "geDateAll",
  18855. value: function geDateAll(begin, end) {
  18856. var arr = [];
  18857. var ab = begin.split('-');
  18858. var ae = end.split('-');
  18859. var db = new Date();
  18860. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  18861. var de = new Date();
  18862. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  18863. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  18864. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  18865. for (var k = unixDb; k <= unixDe;) {
  18866. k = k + 24 * 60 * 60 * 1000;
  18867. arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
  18868. }
  18869. return arr;
  18870. }
  18871. /**
  18872. * 获取多选状态
  18873. */
  18874. }, {
  18875. key: "setMultiple",
  18876. value: function setMultiple(fullDate) {
  18877. if (!this.range) return;
  18878. var _this$multipleStatus = this.multipleStatus,
  18879. before = _this$multipleStatus.before,
  18880. after = _this$multipleStatus.after;
  18881. if (before && after) {
  18882. if (!this.lastHover) {
  18883. this.lastHover = true;
  18884. return;
  18885. }
  18886. this.multipleStatus.before = fullDate;
  18887. this.multipleStatus.after = '';
  18888. this.multipleStatus.data = [];
  18889. this.multipleStatus.fulldate = '';
  18890. this.lastHover = false;
  18891. } else {
  18892. if (!before) {
  18893. this.multipleStatus.before = fullDate;
  18894. this.lastHover = false;
  18895. } else {
  18896. this.multipleStatus.after = fullDate;
  18897. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18898. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18899. } else {
  18900. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18901. }
  18902. this.lastHover = true;
  18903. }
  18904. }
  18905. this.getWeeks(fullDate);
  18906. }
  18907. /**
  18908. * 鼠标 hover 更新多选状态
  18909. */
  18910. }, {
  18911. key: "setHoverMultiple",
  18912. value: function setHoverMultiple(fullDate) {
  18913. if (!this.range || this.lastHover) return;
  18914. var before = this.multipleStatus.before;
  18915. if (!before) {
  18916. this.multipleStatus.before = fullDate;
  18917. } else {
  18918. this.multipleStatus.after = fullDate;
  18919. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18920. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18921. } else {
  18922. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18923. }
  18924. }
  18925. this.getWeeks(fullDate);
  18926. }
  18927. /**
  18928. * 更新默认值多选状态
  18929. */
  18930. }, {
  18931. key: "setDefaultMultiple",
  18932. value: function setDefaultMultiple(before, after) {
  18933. this.multipleStatus.before = before;
  18934. this.multipleStatus.after = after;
  18935. if (before && after) {
  18936. if (dateCompare(before, after)) {
  18937. this.multipleStatus.data = this.geDateAll(before, after);
  18938. this.getWeeks(after);
  18939. } else {
  18940. this.multipleStatus.data = this.geDateAll(after, before);
  18941. this.getWeeks(before);
  18942. }
  18943. }
  18944. }
  18945. /**
  18946. * 获取每周数据
  18947. * @param {Object} dateData
  18948. */
  18949. }, {
  18950. key: "getWeeks",
  18951. value: function getWeeks(dateData) {
  18952. var _this$getDateObj = this.getDateObj(dateData),
  18953. year = _this$getDateObj.year,
  18954. month = _this$getDateObj.month;
  18955. var preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  18956. var preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  18957. var currentMonthDayAmount = new Date(year, month, 0).getDate();
  18958. var currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  18959. var nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  18960. var nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  18961. var calendarDays = [].concat((0, _toConsumableArray2.default)(preMonthDays), (0, _toConsumableArray2.default)(currentMonthDays), (0, _toConsumableArray2.default)(nextMonthDays));
  18962. var weeks = new Array(6);
  18963. for (var i = 0; i < calendarDays.length; i++) {
  18964. var index = Math.floor(i / 7);
  18965. if (!weeks[index]) {
  18966. weeks[index] = new Array(7);
  18967. }
  18968. weeks[index][i % 7] = calendarDays[i];
  18969. }
  18970. this.calendar = calendarDays;
  18971. this.weeks = weeks;
  18972. }
  18973. }]);
  18974. return Calendar;
  18975. }();
  18976. exports.Calendar = Calendar;
  18977. function getDateTime(date, hideSecond) {
  18978. return "".concat(getDate(date), " ").concat(getTime(date, hideSecond));
  18979. }
  18980. function getDate(date) {
  18981. date = fixIosDateFormat(date);
  18982. date = new Date(date);
  18983. var year = date.getFullYear();
  18984. var month = date.getMonth() + 1;
  18985. var day = date.getDate();
  18986. return "".concat(year, "-").concat(addZero(month), "-").concat(addZero(day));
  18987. }
  18988. function getTime(date, hideSecond) {
  18989. date = fixIosDateFormat(date);
  18990. date = new Date(date);
  18991. var hour = date.getHours();
  18992. var minute = date.getMinutes();
  18993. var second = date.getSeconds();
  18994. return hideSecond ? "".concat(addZero(hour), ":").concat(addZero(minute)) : "".concat(addZero(hour), ":").concat(addZero(minute), ":").concat(addZero(second));
  18995. }
  18996. function addZero(num) {
  18997. if (num < 10) {
  18998. num = "0".concat(num);
  18999. }
  19000. return num;
  19001. }
  19002. function getDefaultSecond(hideSecond) {
  19003. return hideSecond ? '00:00' : '00:00:00';
  19004. }
  19005. function dateCompare(startDate, endDate) {
  19006. startDate = new Date(fixIosDateFormat(startDate));
  19007. endDate = new Date(fixIosDateFormat(endDate));
  19008. return startDate <= endDate;
  19009. }
  19010. function checkDate(date) {
  19011. var dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  19012. return date.match(dateReg);
  19013. }
  19014. var dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9]:[0-5]?[0-9])?$/;
  19015. function fixIosDateFormat(value) {
  19016. if (typeof value === 'string' && dateTimeReg.test(value)) {
  19017. value = value.replace(/-/g, '/');
  19018. }
  19019. return value;
  19020. }
  19021. /***/ }),
  19022. /***/ 32:
  19023. /*!**********************************************************************************************************!*\
  19024. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  19025. \**********************************************************************************************************/
  19026. /*! exports provided: default */
  19027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19028. "use strict";
  19029. __webpack_require__.r(__webpack_exports__);
  19030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  19031. /* globals __VUE_SSR_CONTEXT__ */
  19032. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  19033. // This module is a runtime utility for cleaner component module output and will
  19034. // be included in the final webpack user bundle.
  19035. function normalizeComponent (
  19036. scriptExports,
  19037. render,
  19038. staticRenderFns,
  19039. functionalTemplate,
  19040. injectStyles,
  19041. scopeId,
  19042. moduleIdentifier, /* server only */
  19043. shadowMode, /* vue-cli only */
  19044. components, // fixed by xxxxxx auto components
  19045. renderjs // fixed by xxxxxx renderjs
  19046. ) {
  19047. // Vue.extend constructor export interop
  19048. var options = typeof scriptExports === 'function'
  19049. ? scriptExports.options
  19050. : scriptExports
  19051. // fixed by xxxxxx auto components
  19052. if (components) {
  19053. if (!options.components) {
  19054. options.components = {}
  19055. }
  19056. var hasOwn = Object.prototype.hasOwnProperty
  19057. for (var name in components) {
  19058. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  19059. options.components[name] = components[name]
  19060. }
  19061. }
  19062. }
  19063. // fixed by xxxxxx renderjs
  19064. if (renderjs) {
  19065. if(typeof renderjs.beforeCreate === 'function'){
  19066. renderjs.beforeCreate = [renderjs.beforeCreate]
  19067. }
  19068. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  19069. this[renderjs.__module] = this
  19070. });
  19071. (options.mixins || (options.mixins = [])).push(renderjs)
  19072. }
  19073. // render functions
  19074. if (render) {
  19075. options.render = render
  19076. options.staticRenderFns = staticRenderFns
  19077. options._compiled = true
  19078. }
  19079. // functional template
  19080. if (functionalTemplate) {
  19081. options.functional = true
  19082. }
  19083. // scopedId
  19084. if (scopeId) {
  19085. options._scopeId = 'data-v-' + scopeId
  19086. }
  19087. var hook
  19088. if (moduleIdentifier) { // server build
  19089. hook = function (context) {
  19090. // 2.3 injection
  19091. context =
  19092. context || // cached call
  19093. (this.$vnode && this.$vnode.ssrContext) || // stateful
  19094. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  19095. // 2.2 with runInNewContext: true
  19096. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  19097. context = __VUE_SSR_CONTEXT__
  19098. }
  19099. // inject component styles
  19100. if (injectStyles) {
  19101. injectStyles.call(this, context)
  19102. }
  19103. // register component module identifier for async chunk inferrence
  19104. if (context && context._registeredComponents) {
  19105. context._registeredComponents.add(moduleIdentifier)
  19106. }
  19107. }
  19108. // used by ssr in case component is cached and beforeCreate
  19109. // never gets called
  19110. options._ssrRegister = hook
  19111. } else if (injectStyles) {
  19112. hook = shadowMode
  19113. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  19114. : injectStyles
  19115. }
  19116. if (hook) {
  19117. if (options.functional) {
  19118. // for template-only hot-reload because in that case the render fn doesn't
  19119. // go through the normalizer
  19120. options._injectStyles = hook
  19121. // register for functioal component in vue file
  19122. var originalRender = options.render
  19123. options.render = function renderWithStyleInjection (h, context) {
  19124. hook.call(context)
  19125. return originalRender(h, context)
  19126. }
  19127. } else {
  19128. // inject component registration as beforeCreate hook
  19129. var existing = options.beforeCreate
  19130. options.beforeCreate = existing
  19131. ? [].concat(existing, hook)
  19132. : [hook]
  19133. }
  19134. }
  19135. return {
  19136. exports: scriptExports,
  19137. options: options
  19138. }
  19139. }
  19140. /***/ }),
  19141. /***/ 329:
  19142. /*!********************************************************************************************************************************!*\
  19143. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  19144. \********************************************************************************************************************************/
  19145. /*! no static exports found */
  19146. /***/ (function(module, exports, __webpack_require__) {
  19147. "use strict";
  19148. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  19149. Object.defineProperty(exports, "__esModule", {
  19150. value: true
  19151. });
  19152. exports.chooseAndUploadFile = chooseAndUploadFile;
  19153. exports.uploadCloudFiles = uploadCloudFiles;
  19154. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  19155. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  19156. function chooseImage(opts) {
  19157. var count = opts.count,
  19158. _opts$sizeType = opts.sizeType,
  19159. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  19160. sourceType = opts.sourceType,
  19161. extension = opts.extension;
  19162. return new Promise(function (resolve, reject) {
  19163. uni.chooseImage({
  19164. count: count,
  19165. sizeType: sizeType,
  19166. sourceType: sourceType,
  19167. extension: extension,
  19168. success: function success(res) {
  19169. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  19170. },
  19171. fail: function fail(res) {
  19172. reject({
  19173. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  19174. });
  19175. }
  19176. });
  19177. });
  19178. }
  19179. function chooseVideo(opts) {
  19180. var camera = opts.camera,
  19181. compressed = opts.compressed,
  19182. maxDuration = opts.maxDuration,
  19183. sourceType = opts.sourceType,
  19184. extension = opts.extension;
  19185. return new Promise(function (resolve, reject) {
  19186. uni.chooseVideo({
  19187. camera: camera,
  19188. compressed: compressed,
  19189. maxDuration: maxDuration,
  19190. sourceType: sourceType,
  19191. extension: extension,
  19192. success: function success(res) {
  19193. var tempFilePath = res.tempFilePath,
  19194. duration = res.duration,
  19195. size = res.size,
  19196. height = res.height,
  19197. width = res.width;
  19198. resolve(normalizeChooseAndUploadFileRes({
  19199. errMsg: 'chooseVideo:ok',
  19200. tempFilePaths: [tempFilePath],
  19201. tempFiles: [{
  19202. name: res.tempFile && res.tempFile.name || '',
  19203. path: tempFilePath,
  19204. size: size,
  19205. type: res.tempFile && res.tempFile.type || '',
  19206. width: width,
  19207. height: height,
  19208. duration: duration,
  19209. fileType: 'video',
  19210. cloudPath: ''
  19211. }]
  19212. }, 'video'));
  19213. },
  19214. fail: function fail(res) {
  19215. reject({
  19216. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  19217. });
  19218. }
  19219. });
  19220. });
  19221. }
  19222. function chooseAll(opts) {
  19223. var count = opts.count,
  19224. extension = opts.extension;
  19225. return new Promise(function (resolve, reject) {
  19226. var chooseFile = uni.chooseFile;
  19227. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  19228. chooseFile = wx.chooseMessageFile;
  19229. }
  19230. if (typeof chooseFile !== 'function') {
  19231. return reject({
  19232. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  19233. });
  19234. }
  19235. chooseFile({
  19236. type: 'all',
  19237. count: count,
  19238. extension: extension,
  19239. success: function success(res) {
  19240. resolve(normalizeChooseAndUploadFileRes(res));
  19241. },
  19242. fail: function fail(res) {
  19243. reject({
  19244. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  19245. });
  19246. }
  19247. });
  19248. });
  19249. }
  19250. function normalizeChooseAndUploadFileRes(res, fileType) {
  19251. res.tempFiles.forEach(function (item, index) {
  19252. if (!item.name) {
  19253. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  19254. }
  19255. if (fileType) {
  19256. item.fileType = fileType;
  19257. }
  19258. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  19259. });
  19260. if (!res.tempFilePaths) {
  19261. res.tempFilePaths = res.tempFiles.map(function (file) {
  19262. return file.path;
  19263. });
  19264. }
  19265. return res;
  19266. }
  19267. function uploadCloudFiles(files) {
  19268. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  19269. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  19270. files = JSON.parse(JSON.stringify(files));
  19271. var len = files.length;
  19272. var count = 0;
  19273. var self = this;
  19274. return new Promise(function (resolve) {
  19275. while (count < max) {
  19276. next();
  19277. }
  19278. function next() {
  19279. var cur = count++;
  19280. if (cur >= len) {
  19281. !files.find(function (item) {
  19282. return !item.url && !item.errMsg;
  19283. }) && resolve(files);
  19284. return;
  19285. }
  19286. var fileItem = files[cur];
  19287. var index = self.files.findIndex(function (v) {
  19288. return v.uuid === fileItem.uuid;
  19289. });
  19290. fileItem.url = '';
  19291. delete fileItem.errMsg;
  19292. uniCloud.uploadFile({
  19293. filePath: fileItem.path,
  19294. cloudPath: fileItem.cloudPath,
  19295. fileType: fileItem.fileType,
  19296. onUploadProgress: function onUploadProgress(res) {
  19297. res.index = index;
  19298. _onUploadProgress && _onUploadProgress(res);
  19299. }
  19300. }).then(function (res) {
  19301. fileItem.url = res.fileID;
  19302. fileItem.index = index;
  19303. if (cur < len) {
  19304. next();
  19305. }
  19306. }).catch(function (res) {
  19307. fileItem.errMsg = res.errMsg || res.message;
  19308. fileItem.index = index;
  19309. if (cur < len) {
  19310. next();
  19311. }
  19312. });
  19313. }
  19314. });
  19315. }
  19316. function uploadFiles(choosePromise, _ref) {
  19317. var onChooseFile = _ref.onChooseFile,
  19318. onUploadProgress = _ref.onUploadProgress;
  19319. return choosePromise.then(function (res) {
  19320. if (onChooseFile) {
  19321. var customChooseRes = onChooseFile(res);
  19322. if (typeof customChooseRes !== 'undefined') {
  19323. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  19324. return typeof chooseRes === 'undefined' ? res : chooseRes;
  19325. });
  19326. }
  19327. }
  19328. return res;
  19329. }).then(function (res) {
  19330. if (res === false) {
  19331. return {
  19332. errMsg: ERR_MSG_OK,
  19333. tempFilePaths: [],
  19334. tempFiles: []
  19335. };
  19336. }
  19337. return res;
  19338. });
  19339. }
  19340. function chooseAndUploadFile() {
  19341. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  19342. type: 'all'
  19343. };
  19344. if (opts.type === 'image') {
  19345. return uploadFiles(chooseImage(opts), opts);
  19346. } else if (opts.type === 'video') {
  19347. return uploadFiles(chooseVideo(opts), opts);
  19348. }
  19349. return uploadFiles(chooseAll(opts), opts);
  19350. }
  19351. /* 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 */ 289)["default"]))
  19352. /***/ }),
  19353. /***/ 33:
  19354. /*!************************************************************************!*\
  19355. !*** E:/work/Project_newGit/hptwxMiniProgram/uni.promisify.adaptor.js ***!
  19356. \************************************************************************/
  19357. /*! no static exports found */
  19358. /***/ (function(module, exports, __webpack_require__) {
  19359. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  19360. uni.addInterceptor({
  19361. returnValue: function returnValue(res) {
  19362. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  19363. return res;
  19364. }
  19365. return new Promise(function (resolve, reject) {
  19366. res.then(function (res) {
  19367. return res[0] ? reject(res[0]) : resolve(res[1]);
  19368. });
  19369. });
  19370. }
  19371. });
  19372. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19373. /***/ }),
  19374. /***/ 330:
  19375. /*!***************************************************************************************************************!*\
  19376. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  19377. \***************************************************************************************************************/
  19378. /*! no static exports found */
  19379. /***/ (function(module, exports, __webpack_require__) {
  19380. "use strict";
  19381. /* WEBPACK VAR INJECTION */(function(uni) {
  19382. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19383. Object.defineProperty(exports, "__esModule", {
  19384. value: true
  19385. });
  19386. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  19387. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  19388. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  19389. /**
  19390. * 获取文件名和后缀
  19391. * @param {String} name
  19392. */
  19393. var get_file_ext = function get_file_ext(name) {
  19394. var last_len = name.lastIndexOf('.');
  19395. var len = name.length;
  19396. return {
  19397. name: name.substring(0, last_len),
  19398. ext: name.substring(last_len + 1, len)
  19399. };
  19400. };
  19401. /**
  19402. * 获取扩展名
  19403. * @param {Array} fileExtname
  19404. */
  19405. exports.get_file_ext = get_file_ext;
  19406. var get_extname = function get_extname(fileExtname) {
  19407. if (!Array.isArray(fileExtname)) {
  19408. var extname = fileExtname.replace(/(\[|\])/g, '');
  19409. return extname.split(',');
  19410. } else {
  19411. return fileExtname;
  19412. }
  19413. return [];
  19414. };
  19415. /**
  19416. * 获取文件和检测是否可选
  19417. */
  19418. exports.get_extname = get_extname;
  19419. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  19420. var filePaths = [];
  19421. var files = [];
  19422. if (!_extname || _extname.length === 0) {
  19423. return {
  19424. filePaths: filePaths,
  19425. files: files
  19426. };
  19427. }
  19428. res.tempFiles.forEach(function (v) {
  19429. var fileFullName = get_file_ext(v.name);
  19430. var extname = fileFullName.ext.toLowerCase();
  19431. if (_extname.indexOf(extname) !== -1) {
  19432. files.push(v);
  19433. filePaths.push(v.path);
  19434. }
  19435. });
  19436. if (files.length !== res.tempFiles.length) {
  19437. uni.showToast({
  19438. 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"),
  19439. icon: 'none',
  19440. duration: 5000
  19441. });
  19442. }
  19443. return {
  19444. filePaths: filePaths,
  19445. files: files
  19446. };
  19447. };
  19448. /**
  19449. * 获取图片信息
  19450. * @param {Object} filepath
  19451. */
  19452. exports.get_files_and_is_max = get_files_and_is_max;
  19453. var get_file_info = function get_file_info(filepath) {
  19454. return new Promise(function (resolve, reject) {
  19455. uni.getImageInfo({
  19456. src: filepath,
  19457. success: function success(res) {
  19458. resolve(res);
  19459. },
  19460. fail: function fail(err) {
  19461. reject(err);
  19462. }
  19463. });
  19464. });
  19465. };
  19466. /**
  19467. * 获取封装数据
  19468. */
  19469. exports.get_file_info = get_file_info;
  19470. var get_file_data = /*#__PURE__*/function () {
  19471. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  19472. var type,
  19473. fileFullName,
  19474. extname,
  19475. filedata,
  19476. imageinfo,
  19477. _args = arguments;
  19478. return _regenerator.default.wrap(function _callee$(_context) {
  19479. while (1) {
  19480. switch (_context.prev = _context.next) {
  19481. case 0:
  19482. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  19483. // 最终需要上传数据库的数据
  19484. fileFullName = get_file_ext(files.name);
  19485. extname = fileFullName.ext.toLowerCase();
  19486. filedata = {
  19487. name: files.name,
  19488. uuid: files.uuid,
  19489. extname: extname || '',
  19490. cloudPath: files.cloudPath,
  19491. fileType: files.fileType,
  19492. url: files.path || files.path,
  19493. size: files.size,
  19494. //单位是字节
  19495. image: {},
  19496. path: files.path,
  19497. video: {}
  19498. };
  19499. if (!(type === 'image')) {
  19500. _context.next = 14;
  19501. break;
  19502. }
  19503. _context.next = 7;
  19504. return get_file_info(files.path);
  19505. case 7:
  19506. imageinfo = _context.sent;
  19507. delete filedata.video;
  19508. filedata.image.width = imageinfo.width;
  19509. filedata.image.height = imageinfo.height;
  19510. filedata.image.location = imageinfo.path;
  19511. _context.next = 15;
  19512. break;
  19513. case 14:
  19514. delete filedata.image;
  19515. case 15:
  19516. return _context.abrupt("return", filedata);
  19517. case 16:
  19518. case "end":
  19519. return _context.stop();
  19520. }
  19521. }
  19522. }, _callee);
  19523. }));
  19524. return function get_file_data(_x) {
  19525. return _ref.apply(this, arguments);
  19526. };
  19527. }();
  19528. exports.get_file_data = get_file_data;
  19529. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19530. /***/ }),
  19531. /***/ 373:
  19532. /*!***************************************************************************************************!*\
  19533. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  19534. \***************************************************************************************************/
  19535. /*! no static exports found */
  19536. /***/ (function(module, exports, __webpack_require__) {
  19537. "use strict";
  19538. Object.defineProperty(exports, "__esModule", {
  19539. value: true
  19540. });
  19541. exports.default = void 0;
  19542. var _default = {
  19543. "id": "2852637",
  19544. "name": "uniui图标库",
  19545. "font_family": "uniicons",
  19546. "css_prefix_text": "uniui-",
  19547. "description": "",
  19548. "glyphs": [{
  19549. "icon_id": "25027049",
  19550. "name": "yanse",
  19551. "font_class": "color",
  19552. "unicode": "e6cf",
  19553. "unicode_decimal": 59087
  19554. }, {
  19555. "icon_id": "25027048",
  19556. "name": "wallet",
  19557. "font_class": "wallet",
  19558. "unicode": "e6b1",
  19559. "unicode_decimal": 59057
  19560. }, {
  19561. "icon_id": "25015720",
  19562. "name": "settings-filled",
  19563. "font_class": "settings-filled",
  19564. "unicode": "e6ce",
  19565. "unicode_decimal": 59086
  19566. }, {
  19567. "icon_id": "25015434",
  19568. "name": "shimingrenzheng-filled",
  19569. "font_class": "auth-filled",
  19570. "unicode": "e6cc",
  19571. "unicode_decimal": 59084
  19572. }, {
  19573. "icon_id": "24934246",
  19574. "name": "shop-filled",
  19575. "font_class": "shop-filled",
  19576. "unicode": "e6cd",
  19577. "unicode_decimal": 59085
  19578. }, {
  19579. "icon_id": "24934159",
  19580. "name": "staff-filled-01",
  19581. "font_class": "staff-filled",
  19582. "unicode": "e6cb",
  19583. "unicode_decimal": 59083
  19584. }, {
  19585. "icon_id": "24932461",
  19586. "name": "VIP-filled",
  19587. "font_class": "vip-filled",
  19588. "unicode": "e6c6",
  19589. "unicode_decimal": 59078
  19590. }, {
  19591. "icon_id": "24932462",
  19592. "name": "plus_circle_fill",
  19593. "font_class": "plus-filled",
  19594. "unicode": "e6c7",
  19595. "unicode_decimal": 59079
  19596. }, {
  19597. "icon_id": "24932463",
  19598. "name": "folder_add-filled",
  19599. "font_class": "folder-add-filled",
  19600. "unicode": "e6c8",
  19601. "unicode_decimal": 59080
  19602. }, {
  19603. "icon_id": "24932464",
  19604. "name": "yanse-filled",
  19605. "font_class": "color-filled",
  19606. "unicode": "e6c9",
  19607. "unicode_decimal": 59081
  19608. }, {
  19609. "icon_id": "24932465",
  19610. "name": "tune-filled",
  19611. "font_class": "tune-filled",
  19612. "unicode": "e6ca",
  19613. "unicode_decimal": 59082
  19614. }, {
  19615. "icon_id": "24932455",
  19616. "name": "a-rilidaka-filled",
  19617. "font_class": "calendar-filled",
  19618. "unicode": "e6c0",
  19619. "unicode_decimal": 59072
  19620. }, {
  19621. "icon_id": "24932456",
  19622. "name": "notification-filled",
  19623. "font_class": "notification-filled",
  19624. "unicode": "e6c1",
  19625. "unicode_decimal": 59073
  19626. }, {
  19627. "icon_id": "24932457",
  19628. "name": "wallet-filled",
  19629. "font_class": "wallet-filled",
  19630. "unicode": "e6c2",
  19631. "unicode_decimal": 59074
  19632. }, {
  19633. "icon_id": "24932458",
  19634. "name": "paihangbang-filled",
  19635. "font_class": "medal-filled",
  19636. "unicode": "e6c3",
  19637. "unicode_decimal": 59075
  19638. }, {
  19639. "icon_id": "24932459",
  19640. "name": "gift-filled",
  19641. "font_class": "gift-filled",
  19642. "unicode": "e6c4",
  19643. "unicode_decimal": 59076
  19644. }, {
  19645. "icon_id": "24932460",
  19646. "name": "fire-filled",
  19647. "font_class": "fire-filled",
  19648. "unicode": "e6c5",
  19649. "unicode_decimal": 59077
  19650. }, {
  19651. "icon_id": "24928001",
  19652. "name": "refreshempty",
  19653. "font_class": "refreshempty",
  19654. "unicode": "e6bf",
  19655. "unicode_decimal": 59071
  19656. }, {
  19657. "icon_id": "24926853",
  19658. "name": "location-ellipse",
  19659. "font_class": "location-filled",
  19660. "unicode": "e6af",
  19661. "unicode_decimal": 59055
  19662. }, {
  19663. "icon_id": "24926735",
  19664. "name": "person-filled",
  19665. "font_class": "person-filled",
  19666. "unicode": "e69d",
  19667. "unicode_decimal": 59037
  19668. }, {
  19669. "icon_id": "24926703",
  19670. "name": "personadd-filled",
  19671. "font_class": "personadd-filled",
  19672. "unicode": "e698",
  19673. "unicode_decimal": 59032
  19674. }, {
  19675. "icon_id": "24923351",
  19676. "name": "back",
  19677. "font_class": "back",
  19678. "unicode": "e6b9",
  19679. "unicode_decimal": 59065
  19680. }, {
  19681. "icon_id": "24923352",
  19682. "name": "forward",
  19683. "font_class": "forward",
  19684. "unicode": "e6ba",
  19685. "unicode_decimal": 59066
  19686. }, {
  19687. "icon_id": "24923353",
  19688. "name": "arrowthinright",
  19689. "font_class": "arrow-right",
  19690. "unicode": "e6bb",
  19691. "unicode_decimal": 59067
  19692. }, {
  19693. "icon_id": "24923353",
  19694. "name": "arrowthinright",
  19695. "font_class": "arrowthinright",
  19696. "unicode": "e6bb",
  19697. "unicode_decimal": 59067
  19698. }, {
  19699. "icon_id": "24923354",
  19700. "name": "arrowthinleft",
  19701. "font_class": "arrow-left",
  19702. "unicode": "e6bc",
  19703. "unicode_decimal": 59068
  19704. }, {
  19705. "icon_id": "24923354",
  19706. "name": "arrowthinleft",
  19707. "font_class": "arrowthinleft",
  19708. "unicode": "e6bc",
  19709. "unicode_decimal": 59068
  19710. }, {
  19711. "icon_id": "24923355",
  19712. "name": "arrowthinup",
  19713. "font_class": "arrow-up",
  19714. "unicode": "e6bd",
  19715. "unicode_decimal": 59069
  19716. }, {
  19717. "icon_id": "24923355",
  19718. "name": "arrowthinup",
  19719. "font_class": "arrowthinup",
  19720. "unicode": "e6bd",
  19721. "unicode_decimal": 59069
  19722. }, {
  19723. "icon_id": "24923356",
  19724. "name": "arrowthindown",
  19725. "font_class": "arrow-down",
  19726. "unicode": "e6be",
  19727. "unicode_decimal": 59070
  19728. }, {
  19729. "icon_id": "24923356",
  19730. "name": "arrowthindown",
  19731. "font_class": "arrowthindown",
  19732. "unicode": "e6be",
  19733. "unicode_decimal": 59070
  19734. }, {
  19735. "icon_id": "24923349",
  19736. "name": "arrowdown",
  19737. "font_class": "bottom",
  19738. "unicode": "e6b8",
  19739. "unicode_decimal": 59064
  19740. }, {
  19741. "icon_id": "24923349",
  19742. "name": "arrowdown",
  19743. "font_class": "arrowdown",
  19744. "unicode": "e6b8",
  19745. "unicode_decimal": 59064
  19746. }, {
  19747. "icon_id": "24923346",
  19748. "name": "arrowright",
  19749. "font_class": "right",
  19750. "unicode": "e6b5",
  19751. "unicode_decimal": 59061
  19752. }, {
  19753. "icon_id": "24923346",
  19754. "name": "arrowright",
  19755. "font_class": "arrowright",
  19756. "unicode": "e6b5",
  19757. "unicode_decimal": 59061
  19758. }, {
  19759. "icon_id": "24923347",
  19760. "name": "arrowup",
  19761. "font_class": "top",
  19762. "unicode": "e6b6",
  19763. "unicode_decimal": 59062
  19764. }, {
  19765. "icon_id": "24923347",
  19766. "name": "arrowup",
  19767. "font_class": "arrowup",
  19768. "unicode": "e6b6",
  19769. "unicode_decimal": 59062
  19770. }, {
  19771. "icon_id": "24923348",
  19772. "name": "arrowleft",
  19773. "font_class": "left",
  19774. "unicode": "e6b7",
  19775. "unicode_decimal": 59063
  19776. }, {
  19777. "icon_id": "24923348",
  19778. "name": "arrowleft",
  19779. "font_class": "arrowleft",
  19780. "unicode": "e6b7",
  19781. "unicode_decimal": 59063
  19782. }, {
  19783. "icon_id": "24923334",
  19784. "name": "eye",
  19785. "font_class": "eye",
  19786. "unicode": "e651",
  19787. "unicode_decimal": 58961
  19788. }, {
  19789. "icon_id": "24923335",
  19790. "name": "eye-filled",
  19791. "font_class": "eye-filled",
  19792. "unicode": "e66a",
  19793. "unicode_decimal": 58986
  19794. }, {
  19795. "icon_id": "24923336",
  19796. "name": "eye-slash",
  19797. "font_class": "eye-slash",
  19798. "unicode": "e6b3",
  19799. "unicode_decimal": 59059
  19800. }, {
  19801. "icon_id": "24923337",
  19802. "name": "eye-slash-filled",
  19803. "font_class": "eye-slash-filled",
  19804. "unicode": "e6b4",
  19805. "unicode_decimal": 59060
  19806. }, {
  19807. "icon_id": "24923305",
  19808. "name": "info-filled",
  19809. "font_class": "info-filled",
  19810. "unicode": "e649",
  19811. "unicode_decimal": 58953
  19812. }, {
  19813. "icon_id": "24923299",
  19814. "name": "reload-01",
  19815. "font_class": "reload",
  19816. "unicode": "e6b2",
  19817. "unicode_decimal": 59058
  19818. }, {
  19819. "icon_id": "24923195",
  19820. "name": "mic_slash_fill",
  19821. "font_class": "micoff-filled",
  19822. "unicode": "e6b0",
  19823. "unicode_decimal": 59056
  19824. }, {
  19825. "icon_id": "24923165",
  19826. "name": "map-pin-ellipse",
  19827. "font_class": "map-pin-ellipse",
  19828. "unicode": "e6ac",
  19829. "unicode_decimal": 59052
  19830. }, {
  19831. "icon_id": "24923166",
  19832. "name": "map-pin",
  19833. "font_class": "map-pin",
  19834. "unicode": "e6ad",
  19835. "unicode_decimal": 59053
  19836. }, {
  19837. "icon_id": "24923167",
  19838. "name": "location",
  19839. "font_class": "location",
  19840. "unicode": "e6ae",
  19841. "unicode_decimal": 59054
  19842. }, {
  19843. "icon_id": "24923064",
  19844. "name": "starhalf",
  19845. "font_class": "starhalf",
  19846. "unicode": "e683",
  19847. "unicode_decimal": 59011
  19848. }, {
  19849. "icon_id": "24923065",
  19850. "name": "star",
  19851. "font_class": "star",
  19852. "unicode": "e688",
  19853. "unicode_decimal": 59016
  19854. }, {
  19855. "icon_id": "24923066",
  19856. "name": "star-filled",
  19857. "font_class": "star-filled",
  19858. "unicode": "e68f",
  19859. "unicode_decimal": 59023
  19860. }, {
  19861. "icon_id": "24899646",
  19862. "name": "a-rilidaka",
  19863. "font_class": "calendar",
  19864. "unicode": "e6a0",
  19865. "unicode_decimal": 59040
  19866. }, {
  19867. "icon_id": "24899647",
  19868. "name": "fire",
  19869. "font_class": "fire",
  19870. "unicode": "e6a1",
  19871. "unicode_decimal": 59041
  19872. }, {
  19873. "icon_id": "24899648",
  19874. "name": "paihangbang",
  19875. "font_class": "medal",
  19876. "unicode": "e6a2",
  19877. "unicode_decimal": 59042
  19878. }, {
  19879. "icon_id": "24899649",
  19880. "name": "font",
  19881. "font_class": "font",
  19882. "unicode": "e6a3",
  19883. "unicode_decimal": 59043
  19884. }, {
  19885. "icon_id": "24899650",
  19886. "name": "gift",
  19887. "font_class": "gift",
  19888. "unicode": "e6a4",
  19889. "unicode_decimal": 59044
  19890. }, {
  19891. "icon_id": "24899651",
  19892. "name": "link",
  19893. "font_class": "link",
  19894. "unicode": "e6a5",
  19895. "unicode_decimal": 59045
  19896. }, {
  19897. "icon_id": "24899652",
  19898. "name": "notification",
  19899. "font_class": "notification",
  19900. "unicode": "e6a6",
  19901. "unicode_decimal": 59046
  19902. }, {
  19903. "icon_id": "24899653",
  19904. "name": "staff",
  19905. "font_class": "staff",
  19906. "unicode": "e6a7",
  19907. "unicode_decimal": 59047
  19908. }, {
  19909. "icon_id": "24899654",
  19910. "name": "VIP",
  19911. "font_class": "vip",
  19912. "unicode": "e6a8",
  19913. "unicode_decimal": 59048
  19914. }, {
  19915. "icon_id": "24899655",
  19916. "name": "folder_add",
  19917. "font_class": "folder-add",
  19918. "unicode": "e6a9",
  19919. "unicode_decimal": 59049
  19920. }, {
  19921. "icon_id": "24899656",
  19922. "name": "tune",
  19923. "font_class": "tune",
  19924. "unicode": "e6aa",
  19925. "unicode_decimal": 59050
  19926. }, {
  19927. "icon_id": "24899657",
  19928. "name": "shimingrenzheng",
  19929. "font_class": "auth",
  19930. "unicode": "e6ab",
  19931. "unicode_decimal": 59051
  19932. }, {
  19933. "icon_id": "24899565",
  19934. "name": "person",
  19935. "font_class": "person",
  19936. "unicode": "e699",
  19937. "unicode_decimal": 59033
  19938. }, {
  19939. "icon_id": "24899566",
  19940. "name": "email-filled",
  19941. "font_class": "email-filled",
  19942. "unicode": "e69a",
  19943. "unicode_decimal": 59034
  19944. }, {
  19945. "icon_id": "24899567",
  19946. "name": "phone-filled",
  19947. "font_class": "phone-filled",
  19948. "unicode": "e69b",
  19949. "unicode_decimal": 59035
  19950. }, {
  19951. "icon_id": "24899568",
  19952. "name": "phone",
  19953. "font_class": "phone",
  19954. "unicode": "e69c",
  19955. "unicode_decimal": 59036
  19956. }, {
  19957. "icon_id": "24899570",
  19958. "name": "email",
  19959. "font_class": "email",
  19960. "unicode": "e69e",
  19961. "unicode_decimal": 59038
  19962. }, {
  19963. "icon_id": "24899571",
  19964. "name": "personadd",
  19965. "font_class": "personadd",
  19966. "unicode": "e69f",
  19967. "unicode_decimal": 59039
  19968. }, {
  19969. "icon_id": "24899558",
  19970. "name": "chatboxes-filled",
  19971. "font_class": "chatboxes-filled",
  19972. "unicode": "e692",
  19973. "unicode_decimal": 59026
  19974. }, {
  19975. "icon_id": "24899559",
  19976. "name": "contact",
  19977. "font_class": "contact",
  19978. "unicode": "e693",
  19979. "unicode_decimal": 59027
  19980. }, {
  19981. "icon_id": "24899560",
  19982. "name": "chatbubble-filled",
  19983. "font_class": "chatbubble-filled",
  19984. "unicode": "e694",
  19985. "unicode_decimal": 59028
  19986. }, {
  19987. "icon_id": "24899561",
  19988. "name": "contact-filled",
  19989. "font_class": "contact-filled",
  19990. "unicode": "e695",
  19991. "unicode_decimal": 59029
  19992. }, {
  19993. "icon_id": "24899562",
  19994. "name": "chatboxes",
  19995. "font_class": "chatboxes",
  19996. "unicode": "e696",
  19997. "unicode_decimal": 59030
  19998. }, {
  19999. "icon_id": "24899563",
  20000. "name": "chatbubble",
  20001. "font_class": "chatbubble",
  20002. "unicode": "e697",
  20003. "unicode_decimal": 59031
  20004. }, {
  20005. "icon_id": "24881290",
  20006. "name": "upload-filled",
  20007. "font_class": "upload-filled",
  20008. "unicode": "e68e",
  20009. "unicode_decimal": 59022
  20010. }, {
  20011. "icon_id": "24881292",
  20012. "name": "upload",
  20013. "font_class": "upload",
  20014. "unicode": "e690",
  20015. "unicode_decimal": 59024
  20016. }, {
  20017. "icon_id": "24881293",
  20018. "name": "weixin",
  20019. "font_class": "weixin",
  20020. "unicode": "e691",
  20021. "unicode_decimal": 59025
  20022. }, {
  20023. "icon_id": "24881274",
  20024. "name": "compose",
  20025. "font_class": "compose",
  20026. "unicode": "e67f",
  20027. "unicode_decimal": 59007
  20028. }, {
  20029. "icon_id": "24881275",
  20030. "name": "qq",
  20031. "font_class": "qq",
  20032. "unicode": "e680",
  20033. "unicode_decimal": 59008
  20034. }, {
  20035. "icon_id": "24881276",
  20036. "name": "download-filled",
  20037. "font_class": "download-filled",
  20038. "unicode": "e681",
  20039. "unicode_decimal": 59009
  20040. }, {
  20041. "icon_id": "24881277",
  20042. "name": "pengyouquan",
  20043. "font_class": "pyq",
  20044. "unicode": "e682",
  20045. "unicode_decimal": 59010
  20046. }, {
  20047. "icon_id": "24881279",
  20048. "name": "sound",
  20049. "font_class": "sound",
  20050. "unicode": "e684",
  20051. "unicode_decimal": 59012
  20052. }, {
  20053. "icon_id": "24881280",
  20054. "name": "trash-filled",
  20055. "font_class": "trash-filled",
  20056. "unicode": "e685",
  20057. "unicode_decimal": 59013
  20058. }, {
  20059. "icon_id": "24881281",
  20060. "name": "sound-filled",
  20061. "font_class": "sound-filled",
  20062. "unicode": "e686",
  20063. "unicode_decimal": 59014
  20064. }, {
  20065. "icon_id": "24881282",
  20066. "name": "trash",
  20067. "font_class": "trash",
  20068. "unicode": "e687",
  20069. "unicode_decimal": 59015
  20070. }, {
  20071. "icon_id": "24881284",
  20072. "name": "videocam-filled",
  20073. "font_class": "videocam-filled",
  20074. "unicode": "e689",
  20075. "unicode_decimal": 59017
  20076. }, {
  20077. "icon_id": "24881285",
  20078. "name": "spinner-cycle",
  20079. "font_class": "spinner-cycle",
  20080. "unicode": "e68a",
  20081. "unicode_decimal": 59018
  20082. }, {
  20083. "icon_id": "24881286",
  20084. "name": "weibo",
  20085. "font_class": "weibo",
  20086. "unicode": "e68b",
  20087. "unicode_decimal": 59019
  20088. }, {
  20089. "icon_id": "24881288",
  20090. "name": "videocam",
  20091. "font_class": "videocam",
  20092. "unicode": "e68c",
  20093. "unicode_decimal": 59020
  20094. }, {
  20095. "icon_id": "24881289",
  20096. "name": "download",
  20097. "font_class": "download",
  20098. "unicode": "e68d",
  20099. "unicode_decimal": 59021
  20100. }, {
  20101. "icon_id": "24879601",
  20102. "name": "help",
  20103. "font_class": "help",
  20104. "unicode": "e679",
  20105. "unicode_decimal": 59001
  20106. }, {
  20107. "icon_id": "24879602",
  20108. "name": "navigate-filled",
  20109. "font_class": "navigate-filled",
  20110. "unicode": "e67a",
  20111. "unicode_decimal": 59002
  20112. }, {
  20113. "icon_id": "24879603",
  20114. "name": "plusempty",
  20115. "font_class": "plusempty",
  20116. "unicode": "e67b",
  20117. "unicode_decimal": 59003
  20118. }, {
  20119. "icon_id": "24879604",
  20120. "name": "smallcircle",
  20121. "font_class": "smallcircle",
  20122. "unicode": "e67c",
  20123. "unicode_decimal": 59004
  20124. }, {
  20125. "icon_id": "24879605",
  20126. "name": "minus-filled",
  20127. "font_class": "minus-filled",
  20128. "unicode": "e67d",
  20129. "unicode_decimal": 59005
  20130. }, {
  20131. "icon_id": "24879606",
  20132. "name": "micoff",
  20133. "font_class": "micoff",
  20134. "unicode": "e67e",
  20135. "unicode_decimal": 59006
  20136. }, {
  20137. "icon_id": "24879588",
  20138. "name": "closeempty",
  20139. "font_class": "closeempty",
  20140. "unicode": "e66c",
  20141. "unicode_decimal": 58988
  20142. }, {
  20143. "icon_id": "24879589",
  20144. "name": "clear",
  20145. "font_class": "clear",
  20146. "unicode": "e66d",
  20147. "unicode_decimal": 58989
  20148. }, {
  20149. "icon_id": "24879590",
  20150. "name": "navigate",
  20151. "font_class": "navigate",
  20152. "unicode": "e66e",
  20153. "unicode_decimal": 58990
  20154. }, {
  20155. "icon_id": "24879591",
  20156. "name": "minus",
  20157. "font_class": "minus",
  20158. "unicode": "e66f",
  20159. "unicode_decimal": 58991
  20160. }, {
  20161. "icon_id": "24879592",
  20162. "name": "image",
  20163. "font_class": "image",
  20164. "unicode": "e670",
  20165. "unicode_decimal": 58992
  20166. }, {
  20167. "icon_id": "24879593",
  20168. "name": "mic",
  20169. "font_class": "mic",
  20170. "unicode": "e671",
  20171. "unicode_decimal": 58993
  20172. }, {
  20173. "icon_id": "24879594",
  20174. "name": "paperplane",
  20175. "font_class": "paperplane",
  20176. "unicode": "e672",
  20177. "unicode_decimal": 58994
  20178. }, {
  20179. "icon_id": "24879595",
  20180. "name": "close",
  20181. "font_class": "close",
  20182. "unicode": "e673",
  20183. "unicode_decimal": 58995
  20184. }, {
  20185. "icon_id": "24879596",
  20186. "name": "help-filled",
  20187. "font_class": "help-filled",
  20188. "unicode": "e674",
  20189. "unicode_decimal": 58996
  20190. }, {
  20191. "icon_id": "24879597",
  20192. "name": "plus-filled",
  20193. "font_class": "paperplane-filled",
  20194. "unicode": "e675",
  20195. "unicode_decimal": 58997
  20196. }, {
  20197. "icon_id": "24879598",
  20198. "name": "plus",
  20199. "font_class": "plus",
  20200. "unicode": "e676",
  20201. "unicode_decimal": 58998
  20202. }, {
  20203. "icon_id": "24879599",
  20204. "name": "mic-filled",
  20205. "font_class": "mic-filled",
  20206. "unicode": "e677",
  20207. "unicode_decimal": 58999
  20208. }, {
  20209. "icon_id": "24879600",
  20210. "name": "image-filled",
  20211. "font_class": "image-filled",
  20212. "unicode": "e678",
  20213. "unicode_decimal": 59000
  20214. }, {
  20215. "icon_id": "24855900",
  20216. "name": "locked-filled",
  20217. "font_class": "locked-filled",
  20218. "unicode": "e668",
  20219. "unicode_decimal": 58984
  20220. }, {
  20221. "icon_id": "24855901",
  20222. "name": "info",
  20223. "font_class": "info",
  20224. "unicode": "e669",
  20225. "unicode_decimal": 58985
  20226. }, {
  20227. "icon_id": "24855903",
  20228. "name": "locked",
  20229. "font_class": "locked",
  20230. "unicode": "e66b",
  20231. "unicode_decimal": 58987
  20232. }, {
  20233. "icon_id": "24855884",
  20234. "name": "camera-filled",
  20235. "font_class": "camera-filled",
  20236. "unicode": "e658",
  20237. "unicode_decimal": 58968
  20238. }, {
  20239. "icon_id": "24855885",
  20240. "name": "chat-filled",
  20241. "font_class": "chat-filled",
  20242. "unicode": "e659",
  20243. "unicode_decimal": 58969
  20244. }, {
  20245. "icon_id": "24855886",
  20246. "name": "camera",
  20247. "font_class": "camera",
  20248. "unicode": "e65a",
  20249. "unicode_decimal": 58970
  20250. }, {
  20251. "icon_id": "24855887",
  20252. "name": "circle",
  20253. "font_class": "circle",
  20254. "unicode": "e65b",
  20255. "unicode_decimal": 58971
  20256. }, {
  20257. "icon_id": "24855888",
  20258. "name": "checkmarkempty",
  20259. "font_class": "checkmarkempty",
  20260. "unicode": "e65c",
  20261. "unicode_decimal": 58972
  20262. }, {
  20263. "icon_id": "24855889",
  20264. "name": "chat",
  20265. "font_class": "chat",
  20266. "unicode": "e65d",
  20267. "unicode_decimal": 58973
  20268. }, {
  20269. "icon_id": "24855890",
  20270. "name": "circle-filled",
  20271. "font_class": "circle-filled",
  20272. "unicode": "e65e",
  20273. "unicode_decimal": 58974
  20274. }, {
  20275. "icon_id": "24855891",
  20276. "name": "flag",
  20277. "font_class": "flag",
  20278. "unicode": "e65f",
  20279. "unicode_decimal": 58975
  20280. }, {
  20281. "icon_id": "24855892",
  20282. "name": "flag-filled",
  20283. "font_class": "flag-filled",
  20284. "unicode": "e660",
  20285. "unicode_decimal": 58976
  20286. }, {
  20287. "icon_id": "24855893",
  20288. "name": "gear-filled",
  20289. "font_class": "gear-filled",
  20290. "unicode": "e661",
  20291. "unicode_decimal": 58977
  20292. }, {
  20293. "icon_id": "24855894",
  20294. "name": "home",
  20295. "font_class": "home",
  20296. "unicode": "e662",
  20297. "unicode_decimal": 58978
  20298. }, {
  20299. "icon_id": "24855895",
  20300. "name": "home-filled",
  20301. "font_class": "home-filled",
  20302. "unicode": "e663",
  20303. "unicode_decimal": 58979
  20304. }, {
  20305. "icon_id": "24855896",
  20306. "name": "gear",
  20307. "font_class": "gear",
  20308. "unicode": "e664",
  20309. "unicode_decimal": 58980
  20310. }, {
  20311. "icon_id": "24855897",
  20312. "name": "smallcircle-filled",
  20313. "font_class": "smallcircle-filled",
  20314. "unicode": "e665",
  20315. "unicode_decimal": 58981
  20316. }, {
  20317. "icon_id": "24855898",
  20318. "name": "map-filled",
  20319. "font_class": "map-filled",
  20320. "unicode": "e666",
  20321. "unicode_decimal": 58982
  20322. }, {
  20323. "icon_id": "24855899",
  20324. "name": "map",
  20325. "font_class": "map",
  20326. "unicode": "e667",
  20327. "unicode_decimal": 58983
  20328. }, {
  20329. "icon_id": "24855825",
  20330. "name": "refresh-filled",
  20331. "font_class": "refresh-filled",
  20332. "unicode": "e656",
  20333. "unicode_decimal": 58966
  20334. }, {
  20335. "icon_id": "24855826",
  20336. "name": "refresh",
  20337. "font_class": "refresh",
  20338. "unicode": "e657",
  20339. "unicode_decimal": 58967
  20340. }, {
  20341. "icon_id": "24855808",
  20342. "name": "cloud-upload",
  20343. "font_class": "cloud-upload",
  20344. "unicode": "e645",
  20345. "unicode_decimal": 58949
  20346. }, {
  20347. "icon_id": "24855809",
  20348. "name": "cloud-download-filled",
  20349. "font_class": "cloud-download-filled",
  20350. "unicode": "e646",
  20351. "unicode_decimal": 58950
  20352. }, {
  20353. "icon_id": "24855810",
  20354. "name": "cloud-download",
  20355. "font_class": "cloud-download",
  20356. "unicode": "e647",
  20357. "unicode_decimal": 58951
  20358. }, {
  20359. "icon_id": "24855811",
  20360. "name": "cloud-upload-filled",
  20361. "font_class": "cloud-upload-filled",
  20362. "unicode": "e648",
  20363. "unicode_decimal": 58952
  20364. }, {
  20365. "icon_id": "24855813",
  20366. "name": "redo",
  20367. "font_class": "redo",
  20368. "unicode": "e64a",
  20369. "unicode_decimal": 58954
  20370. }, {
  20371. "icon_id": "24855814",
  20372. "name": "images-filled",
  20373. "font_class": "images-filled",
  20374. "unicode": "e64b",
  20375. "unicode_decimal": 58955
  20376. }, {
  20377. "icon_id": "24855815",
  20378. "name": "undo-filled",
  20379. "font_class": "undo-filled",
  20380. "unicode": "e64c",
  20381. "unicode_decimal": 58956
  20382. }, {
  20383. "icon_id": "24855816",
  20384. "name": "more",
  20385. "font_class": "more",
  20386. "unicode": "e64d",
  20387. "unicode_decimal": 58957
  20388. }, {
  20389. "icon_id": "24855817",
  20390. "name": "more-filled",
  20391. "font_class": "more-filled",
  20392. "unicode": "e64e",
  20393. "unicode_decimal": 58958
  20394. }, {
  20395. "icon_id": "24855818",
  20396. "name": "undo",
  20397. "font_class": "undo",
  20398. "unicode": "e64f",
  20399. "unicode_decimal": 58959
  20400. }, {
  20401. "icon_id": "24855819",
  20402. "name": "images",
  20403. "font_class": "images",
  20404. "unicode": "e650",
  20405. "unicode_decimal": 58960
  20406. }, {
  20407. "icon_id": "24855821",
  20408. "name": "paperclip",
  20409. "font_class": "paperclip",
  20410. "unicode": "e652",
  20411. "unicode_decimal": 58962
  20412. }, {
  20413. "icon_id": "24855822",
  20414. "name": "settings",
  20415. "font_class": "settings",
  20416. "unicode": "e653",
  20417. "unicode_decimal": 58963
  20418. }, {
  20419. "icon_id": "24855823",
  20420. "name": "search",
  20421. "font_class": "search",
  20422. "unicode": "e654",
  20423. "unicode_decimal": 58964
  20424. }, {
  20425. "icon_id": "24855824",
  20426. "name": "redo-filled",
  20427. "font_class": "redo-filled",
  20428. "unicode": "e655",
  20429. "unicode_decimal": 58965
  20430. }, {
  20431. "icon_id": "24841702",
  20432. "name": "list",
  20433. "font_class": "list",
  20434. "unicode": "e644",
  20435. "unicode_decimal": 58948
  20436. }, {
  20437. "icon_id": "24841489",
  20438. "name": "mail-open-filled",
  20439. "font_class": "mail-open-filled",
  20440. "unicode": "e63a",
  20441. "unicode_decimal": 58938
  20442. }, {
  20443. "icon_id": "24841491",
  20444. "name": "hand-thumbsdown-filled",
  20445. "font_class": "hand-down-filled",
  20446. "unicode": "e63c",
  20447. "unicode_decimal": 58940
  20448. }, {
  20449. "icon_id": "24841492",
  20450. "name": "hand-thumbsdown",
  20451. "font_class": "hand-down",
  20452. "unicode": "e63d",
  20453. "unicode_decimal": 58941
  20454. }, {
  20455. "icon_id": "24841493",
  20456. "name": "hand-thumbsup-filled",
  20457. "font_class": "hand-up-filled",
  20458. "unicode": "e63e",
  20459. "unicode_decimal": 58942
  20460. }, {
  20461. "icon_id": "24841494",
  20462. "name": "hand-thumbsup",
  20463. "font_class": "hand-up",
  20464. "unicode": "e63f",
  20465. "unicode_decimal": 58943
  20466. }, {
  20467. "icon_id": "24841496",
  20468. "name": "heart-filled",
  20469. "font_class": "heart-filled",
  20470. "unicode": "e641",
  20471. "unicode_decimal": 58945
  20472. }, {
  20473. "icon_id": "24841498",
  20474. "name": "mail-open",
  20475. "font_class": "mail-open",
  20476. "unicode": "e643",
  20477. "unicode_decimal": 58947
  20478. }, {
  20479. "icon_id": "24841488",
  20480. "name": "heart",
  20481. "font_class": "heart",
  20482. "unicode": "e639",
  20483. "unicode_decimal": 58937
  20484. }, {
  20485. "icon_id": "24839963",
  20486. "name": "loop",
  20487. "font_class": "loop",
  20488. "unicode": "e633",
  20489. "unicode_decimal": 58931
  20490. }, {
  20491. "icon_id": "24839866",
  20492. "name": "pulldown",
  20493. "font_class": "pulldown",
  20494. "unicode": "e632",
  20495. "unicode_decimal": 58930
  20496. }, {
  20497. "icon_id": "24813798",
  20498. "name": "scan",
  20499. "font_class": "scan",
  20500. "unicode": "e62a",
  20501. "unicode_decimal": 58922
  20502. }, {
  20503. "icon_id": "24813786",
  20504. "name": "bars",
  20505. "font_class": "bars",
  20506. "unicode": "e627",
  20507. "unicode_decimal": 58919
  20508. }, {
  20509. "icon_id": "24813788",
  20510. "name": "cart-filled",
  20511. "font_class": "cart-filled",
  20512. "unicode": "e629",
  20513. "unicode_decimal": 58921
  20514. }, {
  20515. "icon_id": "24813790",
  20516. "name": "checkbox",
  20517. "font_class": "checkbox",
  20518. "unicode": "e62b",
  20519. "unicode_decimal": 58923
  20520. }, {
  20521. "icon_id": "24813791",
  20522. "name": "checkbox-filled",
  20523. "font_class": "checkbox-filled",
  20524. "unicode": "e62c",
  20525. "unicode_decimal": 58924
  20526. }, {
  20527. "icon_id": "24813794",
  20528. "name": "shop",
  20529. "font_class": "shop",
  20530. "unicode": "e62f",
  20531. "unicode_decimal": 58927
  20532. }, {
  20533. "icon_id": "24813795",
  20534. "name": "headphones",
  20535. "font_class": "headphones",
  20536. "unicode": "e630",
  20537. "unicode_decimal": 58928
  20538. }, {
  20539. "icon_id": "24813796",
  20540. "name": "cart",
  20541. "font_class": "cart",
  20542. "unicode": "e631",
  20543. "unicode_decimal": 58929
  20544. }]
  20545. };
  20546. exports.default = _default;
  20547. /***/ }),
  20548. /***/ 381:
  20549. /*!****************************************************************************************************************!*\
  20550. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  20551. \****************************************************************************************************************/
  20552. /*! no static exports found */
  20553. /***/ (function(module, exports, __webpack_require__) {
  20554. "use strict";
  20555. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20556. Object.defineProperty(exports, "__esModule", {
  20557. value: true
  20558. });
  20559. exports.default = void 0;
  20560. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 382));
  20561. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 383));
  20562. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 384));
  20563. var _default = {
  20564. en: _en.default,
  20565. 'zh-Hans': _zhHans.default,
  20566. 'zh-Hant': _zhHant.default
  20567. };
  20568. exports.default = _default;
  20569. /***/ }),
  20570. /***/ 382:
  20571. /*!***************************************************************************************************************!*\
  20572. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  20573. \***************************************************************************************************************/
  20574. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20575. /***/ (function(module) {
  20576. 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\"}");
  20577. /***/ }),
  20578. /***/ 383:
  20579. /*!********************************************************************************************************************!*\
  20580. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  20581. \********************************************************************************************************************/
  20582. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20583. /***/ (function(module) {
  20584. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  20585. /***/ }),
  20586. /***/ 384:
  20587. /*!********************************************************************************************************************!*\
  20588. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  20589. \********************************************************************************************************************/
  20590. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20591. /***/ (function(module) {
  20592. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  20593. /***/ }),
  20594. /***/ 4:
  20595. /*!**********************************************************************!*\
  20596. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  20597. \**********************************************************************/
  20598. /*! no static exports found */
  20599. /***/ (function(module, exports) {
  20600. function _interopRequireDefault(obj) {
  20601. return obj && obj.__esModule ? obj : {
  20602. "default": obj
  20603. };
  20604. }
  20605. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20606. /***/ }),
  20607. /***/ 40:
  20608. /*!************************************************************************************************!*\
  20609. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  20610. \************************************************************************************************/
  20611. /*! no static exports found */
  20612. /***/ (function(module, exports, __webpack_require__) {
  20613. // TODO(Babel 8): Remove this file.
  20614. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 41)();
  20615. module.exports = runtime;
  20616. /***/ }),
  20617. /***/ 41:
  20618. /*!*******************************************************************!*\
  20619. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  20620. \*******************************************************************/
  20621. /*! no static exports found */
  20622. /***/ (function(module, exports, __webpack_require__) {
  20623. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  20624. function _regeneratorRuntime() {
  20625. "use strict";
  20626. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  20627. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  20628. return exports;
  20629. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20630. var exports = {},
  20631. Op = Object.prototype,
  20632. hasOwn = Op.hasOwnProperty,
  20633. defineProperty = Object.defineProperty || function (obj, key, desc) {
  20634. obj[key] = desc.value;
  20635. },
  20636. $Symbol = "function" == typeof Symbol ? Symbol : {},
  20637. iteratorSymbol = $Symbol.iterator || "@@iterator",
  20638. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  20639. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  20640. function define(obj, key, value) {
  20641. return Object.defineProperty(obj, key, {
  20642. value: value,
  20643. enumerable: !0,
  20644. configurable: !0,
  20645. writable: !0
  20646. }), obj[key];
  20647. }
  20648. try {
  20649. define({}, "");
  20650. } catch (err) {
  20651. define = function define(obj, key, value) {
  20652. return obj[key] = value;
  20653. };
  20654. }
  20655. function wrap(innerFn, outerFn, self, tryLocsList) {
  20656. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  20657. generator = Object.create(protoGenerator.prototype),
  20658. context = new Context(tryLocsList || []);
  20659. return defineProperty(generator, "_invoke", {
  20660. value: makeInvokeMethod(innerFn, self, context)
  20661. }), generator;
  20662. }
  20663. function tryCatch(fn, obj, arg) {
  20664. try {
  20665. return {
  20666. type: "normal",
  20667. arg: fn.call(obj, arg)
  20668. };
  20669. } catch (err) {
  20670. return {
  20671. type: "throw",
  20672. arg: err
  20673. };
  20674. }
  20675. }
  20676. exports.wrap = wrap;
  20677. var ContinueSentinel = {};
  20678. function Generator() {}
  20679. function GeneratorFunction() {}
  20680. function GeneratorFunctionPrototype() {}
  20681. var IteratorPrototype = {};
  20682. define(IteratorPrototype, iteratorSymbol, function () {
  20683. return this;
  20684. });
  20685. var getProto = Object.getPrototypeOf,
  20686. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  20687. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  20688. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  20689. function defineIteratorMethods(prototype) {
  20690. ["next", "throw", "return"].forEach(function (method) {
  20691. define(prototype, method, function (arg) {
  20692. return this._invoke(method, arg);
  20693. });
  20694. });
  20695. }
  20696. function AsyncIterator(generator, PromiseImpl) {
  20697. function invoke(method, arg, resolve, reject) {
  20698. var record = tryCatch(generator[method], generator, arg);
  20699. if ("throw" !== record.type) {
  20700. var result = record.arg,
  20701. value = result.value;
  20702. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  20703. invoke("next", value, resolve, reject);
  20704. }, function (err) {
  20705. invoke("throw", err, resolve, reject);
  20706. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  20707. result.value = unwrapped, resolve(result);
  20708. }, function (error) {
  20709. return invoke("throw", error, resolve, reject);
  20710. });
  20711. }
  20712. reject(record.arg);
  20713. }
  20714. var previousPromise;
  20715. defineProperty(this, "_invoke", {
  20716. value: function value(method, arg) {
  20717. function callInvokeWithMethodAndArg() {
  20718. return new PromiseImpl(function (resolve, reject) {
  20719. invoke(method, arg, resolve, reject);
  20720. });
  20721. }
  20722. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  20723. }
  20724. });
  20725. }
  20726. function makeInvokeMethod(innerFn, self, context) {
  20727. var state = "suspendedStart";
  20728. return function (method, arg) {
  20729. if ("executing" === state) throw new Error("Generator is already running");
  20730. if ("completed" === state) {
  20731. if ("throw" === method) throw arg;
  20732. return doneResult();
  20733. }
  20734. for (context.method = method, context.arg = arg;;) {
  20735. var delegate = context.delegate;
  20736. if (delegate) {
  20737. var delegateResult = maybeInvokeDelegate(delegate, context);
  20738. if (delegateResult) {
  20739. if (delegateResult === ContinueSentinel) continue;
  20740. return delegateResult;
  20741. }
  20742. }
  20743. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  20744. if ("suspendedStart" === state) throw state = "completed", context.arg;
  20745. context.dispatchException(context.arg);
  20746. } else "return" === context.method && context.abrupt("return", context.arg);
  20747. state = "executing";
  20748. var record = tryCatch(innerFn, self, context);
  20749. if ("normal" === record.type) {
  20750. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  20751. return {
  20752. value: record.arg,
  20753. done: context.done
  20754. };
  20755. }
  20756. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  20757. }
  20758. };
  20759. }
  20760. function maybeInvokeDelegate(delegate, context) {
  20761. var methodName = context.method,
  20762. method = delegate.iterator[methodName];
  20763. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  20764. var record = tryCatch(method, delegate.iterator, context.arg);
  20765. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  20766. var info = record.arg;
  20767. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  20768. }
  20769. function pushTryEntry(locs) {
  20770. var entry = {
  20771. tryLoc: locs[0]
  20772. };
  20773. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  20774. }
  20775. function resetTryEntry(entry) {
  20776. var record = entry.completion || {};
  20777. record.type = "normal", delete record.arg, entry.completion = record;
  20778. }
  20779. function Context(tryLocsList) {
  20780. this.tryEntries = [{
  20781. tryLoc: "root"
  20782. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  20783. }
  20784. function values(iterable) {
  20785. if (iterable) {
  20786. var iteratorMethod = iterable[iteratorSymbol];
  20787. if (iteratorMethod) return iteratorMethod.call(iterable);
  20788. if ("function" == typeof iterable.next) return iterable;
  20789. if (!isNaN(iterable.length)) {
  20790. var i = -1,
  20791. next = function next() {
  20792. for (; ++i < iterable.length;) {
  20793. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  20794. }
  20795. return next.value = undefined, next.done = !0, next;
  20796. };
  20797. return next.next = next;
  20798. }
  20799. }
  20800. return {
  20801. next: doneResult
  20802. };
  20803. }
  20804. function doneResult() {
  20805. return {
  20806. value: undefined,
  20807. done: !0
  20808. };
  20809. }
  20810. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  20811. value: GeneratorFunctionPrototype,
  20812. configurable: !0
  20813. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  20814. value: GeneratorFunction,
  20815. configurable: !0
  20816. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  20817. var ctor = "function" == typeof genFun && genFun.constructor;
  20818. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  20819. }, exports.mark = function (genFun) {
  20820. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  20821. }, exports.awrap = function (arg) {
  20822. return {
  20823. __await: arg
  20824. };
  20825. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  20826. return this;
  20827. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  20828. void 0 === PromiseImpl && (PromiseImpl = Promise);
  20829. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  20830. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  20831. return result.done ? result.value : iter.next();
  20832. });
  20833. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  20834. return this;
  20835. }), define(Gp, "toString", function () {
  20836. return "[object Generator]";
  20837. }), exports.keys = function (val) {
  20838. var object = Object(val),
  20839. keys = [];
  20840. for (var key in object) {
  20841. keys.push(key);
  20842. }
  20843. return keys.reverse(), function next() {
  20844. for (; keys.length;) {
  20845. var key = keys.pop();
  20846. if (key in object) return next.value = key, next.done = !1, next;
  20847. }
  20848. return next.done = !0, next;
  20849. };
  20850. }, exports.values = values, Context.prototype = {
  20851. constructor: Context,
  20852. reset: function reset(skipTempReset) {
  20853. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  20854. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  20855. }
  20856. },
  20857. stop: function stop() {
  20858. this.done = !0;
  20859. var rootRecord = this.tryEntries[0].completion;
  20860. if ("throw" === rootRecord.type) throw rootRecord.arg;
  20861. return this.rval;
  20862. },
  20863. dispatchException: function dispatchException(exception) {
  20864. if (this.done) throw exception;
  20865. var context = this;
  20866. function handle(loc, caught) {
  20867. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  20868. }
  20869. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20870. var entry = this.tryEntries[i],
  20871. record = entry.completion;
  20872. if ("root" === entry.tryLoc) return handle("end");
  20873. if (entry.tryLoc <= this.prev) {
  20874. var hasCatch = hasOwn.call(entry, "catchLoc"),
  20875. hasFinally = hasOwn.call(entry, "finallyLoc");
  20876. if (hasCatch && hasFinally) {
  20877. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20878. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20879. } else if (hasCatch) {
  20880. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20881. } else {
  20882. if (!hasFinally) throw new Error("try statement without catch or finally");
  20883. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20884. }
  20885. }
  20886. }
  20887. },
  20888. abrupt: function abrupt(type, arg) {
  20889. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20890. var entry = this.tryEntries[i];
  20891. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  20892. var finallyEntry = entry;
  20893. break;
  20894. }
  20895. }
  20896. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  20897. var record = finallyEntry ? finallyEntry.completion : {};
  20898. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  20899. },
  20900. complete: function complete(record, afterLoc) {
  20901. if ("throw" === record.type) throw record.arg;
  20902. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  20903. },
  20904. finish: function finish(finallyLoc) {
  20905. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20906. var entry = this.tryEntries[i];
  20907. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  20908. }
  20909. },
  20910. "catch": function _catch(tryLoc) {
  20911. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20912. var entry = this.tryEntries[i];
  20913. if (entry.tryLoc === tryLoc) {
  20914. var record = entry.completion;
  20915. if ("throw" === record.type) {
  20916. var thrown = record.arg;
  20917. resetTryEntry(entry);
  20918. }
  20919. return thrown;
  20920. }
  20921. }
  20922. throw new Error("illegal catch attempt");
  20923. },
  20924. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  20925. return this.delegate = {
  20926. iterator: values(iterable),
  20927. resultName: resultName,
  20928. nextLoc: nextLoc
  20929. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  20930. }
  20931. }, exports;
  20932. }
  20933. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20934. /***/ }),
  20935. /***/ 42:
  20936. /*!*****************************************************************!*\
  20937. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  20938. \*****************************************************************/
  20939. /*! no static exports found */
  20940. /***/ (function(module, exports) {
  20941. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  20942. try {
  20943. var info = gen[key](arg);
  20944. var value = info.value;
  20945. } catch (error) {
  20946. reject(error);
  20947. return;
  20948. }
  20949. if (info.done) {
  20950. resolve(value);
  20951. } else {
  20952. Promise.resolve(value).then(_next, _throw);
  20953. }
  20954. }
  20955. function _asyncToGenerator(fn) {
  20956. return function () {
  20957. var self = this,
  20958. args = arguments;
  20959. return new Promise(function (resolve, reject) {
  20960. var gen = fn.apply(self, args);
  20961. function _next(value) {
  20962. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  20963. }
  20964. function _throw(err) {
  20965. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  20966. }
  20967. _next(undefined);
  20968. });
  20969. };
  20970. }
  20971. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20972. /***/ }),
  20973. /***/ 43:
  20974. /*!*****************************************************************!*\
  20975. !*** E:/work/Project_newGit/hptwxMiniProgram/static/avatar.png ***!
  20976. \*****************************************************************/
  20977. /*! no static exports found */
  20978. /***/ (function(module, exports) {
  20979. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAe1BMVEUAAACKioqLi4uKioqKioqJiYmKioqKioqJiYmMjIyKioqKioqKioqKioqLi4uKioqKioqKioqKioqLi4uKioqKioqIiIiKioqOjo6KioqKioqKioqKioqKioqKioqKioqHh4eMjIyKioqLi4uKioqKioqLi4uKioqKiorfp5FpAAAAKHRSTlMA3E+S6IHxx0kJuKv3ymI7XbWcfSNVRtIQ+tXBr4x1aj8yv70piRbh3pKoQwAAA+dJREFUeNrE1teaqkAQBOAaRAaUoCgopjWtW+//hOfW/UzVhLP/NWFmur6eRivrIt/P/cqFUdNEoVv5+T4v1vgvknp8DvlUeB7XCQZVjy8p30ov4xoDiUeOEjeKB/z736yhmtBsUqEvsy1b2c7Qhzxja1mOrk5TdjI9oYtkkbKjdJGgtcCzBz5AS2P2ZIw2ljv2ZreEWeDYIxf0e/zDl+GbvfuGwYgDGEF24SAuEIUcSAhJxMFEEGw4oA0+mnBQE3xQcmBll/4zfEcKaJDtv+Lren2Nv/YZDQK8tHRUlcENd25BSZVb4pWdHKUaD2o5vruuAUhzPJWn3WIQUBPGeCEOu8Qg8ZS4BC8ljhKf4NGCEo+3PCULPDilVDh84KhIH6f1KRXRFR9cIyqmDwm2pad7M8vxWyauWzClIsMvM0qOEBwpmeHe1nqTdb9Rt7hTUVJAUlBSmaeQDUQb62wSUzLqeaqPrS8cITpaN+SoaCBrqHDGCoSQhZTEtgo4yBwlI9vjGWSZaUs1NVvIttTUlkGAK8hWtIwFc2p+IPuhZg4ASUpNBFlETZoAKKiCjKrCEAGygqgiDSE4U1VCVFJ1lruW3gqtn1xTF0ASULdGQd0Ekgl1BXIazCCY0SDHngYeAk+DPea0OOCjAy3m8DSJ8UFME48VbZZ4a0mbFRyNbnjjRiOHkFYHof6yEBHNSqEFqyI0tPMVnqg87Ro0bGP6r3mz220QhqGwQ1a6EFJoBy2TJgJSL/b+T7jbSajqsQ1yvuuq6o+J7ZNzus0+Fn8lfIu18Wse/tV+vkr1c83lwCP6uR9nHx+aKwQn1N19HrshEBGFoRuzF6r8jgSfvo55oA1DjrXgVyR26d6qQC8I1Y39QBGzeuLyZjGOzFrmteMGUckaVjvmDCSpJ4g+cQaS7oiLR88YySZND9J3pQmdoT8WYrGAb4suJonYJHQx+TrKAnECV7MOueQR8YMtp6GVCgN6maANkEDxJCFPQKAAiqAnMT0k0dyl1gu9FeQOyHSJVCREefSyP0D/J3hgm2pISYPseU6kSajVCgc0r0hqItBeP4ErAjELsmk3wBIm5gaU18ivAH0VjO/l7XqiHZhqQHzvXx/Veq7IAZOAKUzKjJywF14b1DfFC/C4OtoJhxwwa8udwzVTersiFo5MO5ERCweFM3oK6E+Cc4BettJOrOBXO20VQRyOengC52jaDXTKHxxwSyahBs1sVDH9CiJHQ1WyodHe0mlvarW39dobm+2t3fbmdnt7v33AwT7iYR9ysY/52AedCoh62Yfd7ON+BQQeC4h8FhB6LSD2W0DwuYTodwnh9wPi/38f4pWf21QKgQAAAABJRU5ErkJggg=="
  20980. /***/ }),
  20981. /***/ 44:
  20982. /*!**************************************************************!*\
  20983. !*** E:/work/Project_newGit/hptwxMiniProgram/api/openApi.js ***!
  20984. \**************************************************************/
  20985. /*! no static exports found */
  20986. /***/ (function(module, exports, __webpack_require__) {
  20987. "use strict";
  20988. Object.defineProperty(exports, "__esModule", {
  20989. value: true
  20990. });
  20991. exports.wxDecryptUserInfo = wxDecryptUserInfo;
  20992. exports.wxLogin = wxLogin;
  20993. var _openRequest = __webpack_require__(/*! @/utils/openRequest.js */ 45);
  20994. /**
  20995. * WX登陆
  20996. * @param jsCode 二维码
  20997. * @returns
  20998. */
  20999. function wxLogin(data) {
  21000. return (0, _openRequest.request)({
  21001. url: "/wx/login",
  21002. method: 'GET',
  21003. data: data
  21004. });
  21005. }
  21006. /**
  21007. * 解密WX用户数据
  21008. * @param jsCode 二维码
  21009. * @returns
  21010. */
  21011. function wxDecryptUserInfo(data) {
  21012. return (0, _openRequest.request)({
  21013. url: "/wx/userInfo/decrypt",
  21014. method: 'POST',
  21015. data: data
  21016. });
  21017. }
  21018. /***/ }),
  21019. /***/ 45:
  21020. /*!********************************************************************!*\
  21021. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/openRequest.js ***!
  21022. \********************************************************************/
  21023. /*! no static exports found */
  21024. /***/ (function(module, exports, __webpack_require__) {
  21025. "use strict";
  21026. /* WEBPACK VAR INJECTION */(function(uni) {
  21027. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21028. Object.defineProperty(exports, "__esModule", {
  21029. value: true
  21030. });
  21031. exports.request = request;
  21032. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  21033. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  21034. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  21035. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  21036. 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; }
  21037. 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; }
  21038. var baseUrl = true ? _index.default.base.dev : undefined;
  21039. function request(_x) {
  21040. return _request.apply(this, arguments);
  21041. }
  21042. function _request() {
  21043. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  21044. return _regenerator.default.wrap(function _callee$(_context) {
  21045. while (1) {
  21046. switch (_context.prev = _context.next) {
  21047. case 0:
  21048. return _context.abrupt("return", new Promise(function (resolve, reject) {
  21049. try {
  21050. uni.showLoading({
  21051. title: '加载中',
  21052. mask: true
  21053. });
  21054. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  21055. success: function success(response) {
  21056. var data = response.data;
  21057. var code = data.code;
  21058. var msg = data.msg;
  21059. if (code === 200) {
  21060. resolve(data);
  21061. } else {
  21062. if (code === 401) {
  21063. uni.showToast({
  21064. title: msg || "登录失效!",
  21065. mask: true,
  21066. icon: "none",
  21067. complete: function complete() {
  21068. uni.redirectTo({
  21069. url: '/pages/authorizedLogin/index'
  21070. });
  21071. }
  21072. });
  21073. } else {
  21074. reject(data);
  21075. uni.showToast({
  21076. title: msg,
  21077. mask: true,
  21078. icon: "none"
  21079. });
  21080. }
  21081. }
  21082. },
  21083. fail: function fail(res) {
  21084. uni.showToast({
  21085. title: res,
  21086. mask: true,
  21087. icon: "none"
  21088. });
  21089. reject(res);
  21090. },
  21091. complete: function complete(res) {
  21092. uni.hideLoading();
  21093. }
  21094. }));
  21095. } catch (err) {
  21096. console.log(err);
  21097. reject(err);
  21098. }
  21099. }));
  21100. case 1:
  21101. case "end":
  21102. return _context.stop();
  21103. }
  21104. }
  21105. }, _callee);
  21106. }));
  21107. return _request.apply(this, arguments);
  21108. }
  21109. function formatRequestBody(parmas) {
  21110. var url = parmas.url;
  21111. url = baseUrl + url;
  21112. var data = _objectSpread({}, parmas.data);
  21113. var header = _objectSpread({}, parmas.header);
  21114. header['AppID'] = _index.default.appID;
  21115. header['AppKey'] = _index.default.appKey;
  21116. header['AppSecret'] = _index.default.appSecret;
  21117. var method = parmas.method || "get";
  21118. var dataType = parmas.dataType || "json";
  21119. var requestBody = {
  21120. url: url,
  21121. data: data,
  21122. header: header,
  21123. method: method,
  21124. dataType: dataType
  21125. };
  21126. return requestBody;
  21127. }
  21128. ;
  21129. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  21130. /***/ }),
  21131. /***/ 46:
  21132. /*!***************************************************************!*\
  21133. !*** E:/work/Project_newGit/hptwxMiniProgram/config/index.js ***!
  21134. \***************************************************************/
  21135. /*! no static exports found */
  21136. /***/ (function(module, exports, __webpack_require__) {
  21137. "use strict";
  21138. Object.defineProperty(exports, "__esModule", {
  21139. value: true
  21140. });
  21141. exports.default = void 0;
  21142. var _default = {
  21143. base: {
  21144. dev: 'https://api.xazhyc.com',
  21145. // dev: 'http://1.15.92.205:6001',
  21146. // dev: 'http://192.168.3.253:7001',
  21147. pro: 'https://api.xazhyc.com'
  21148. },
  21149. appID: '10007',
  21150. appKey: '82a8bf439373e311',
  21151. appSecret: '82a8bf439373e311',
  21152. permitTplId: 7,
  21153. TokenKey: "Authorization"
  21154. };
  21155. exports.default = _default;
  21156. /***/ }),
  21157. /***/ 47:
  21158. /*!******************************************************************!*\
  21159. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/scan.js ***!
  21160. \******************************************************************/
  21161. /*! no static exports found */
  21162. /***/ (function(module, exports, __webpack_require__) {
  21163. "use strict";
  21164. Object.defineProperty(exports, "__esModule", {
  21165. value: true
  21166. });
  21167. exports.getApps = getApps;
  21168. exports.getByQr = getByQr;
  21169. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21170. /**
  21171. * 扫码请求
  21172. * @param ocId 单位ID
  21173. * @param qrCode 二维码
  21174. * @returns
  21175. */
  21176. function getByQr(ocId, qrCode) {
  21177. return (0, _request.request)({
  21178. url: "/qr/request/".concat(ocId, "/").concat(qrCode),
  21179. method: 'GET'
  21180. });
  21181. }
  21182. function getApps(targetId) {
  21183. return (0, _request.request)({
  21184. url: "/mini/permitted/".concat(targetId, " "),
  21185. method: 'GET'
  21186. });
  21187. }
  21188. /***/ }),
  21189. /***/ 48:
  21190. /*!****************************************************************!*\
  21191. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/request.js ***!
  21192. \****************************************************************/
  21193. /*! no static exports found */
  21194. /***/ (function(module, exports, __webpack_require__) {
  21195. "use strict";
  21196. /* WEBPACK VAR INJECTION */(function(uni) {
  21197. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21198. Object.defineProperty(exports, "__esModule", {
  21199. value: true
  21200. });
  21201. exports.request = request;
  21202. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  21203. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  21204. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  21205. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  21206. var _auth = __webpack_require__(/*! @/utils/auth.js */ 49);
  21207. 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; }
  21208. 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; }
  21209. var baseUrl = true ? _index.default.base.dev : undefined;
  21210. function request(_x) {
  21211. return _request.apply(this, arguments);
  21212. }
  21213. function _request() {
  21214. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  21215. return _regenerator.default.wrap(function _callee$(_context) {
  21216. while (1) {
  21217. switch (_context.prev = _context.next) {
  21218. case 0:
  21219. return _context.abrupt("return", new Promise(function (resolve, reject) {
  21220. try {
  21221. uni.showLoading({
  21222. title: '加载中',
  21223. mask: true
  21224. });
  21225. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  21226. success: function success(response) {
  21227. var data = response.data;
  21228. var code = data.code;
  21229. var msg = data.msg;
  21230. if (code === 200) {
  21231. resolve(data);
  21232. } else {
  21233. if (code === 401) {
  21234. uni.showToast({
  21235. title: msg || "登录失效!",
  21236. mask: true,
  21237. icon: "none",
  21238. complete: function complete() {
  21239. uni.redirectTo({
  21240. url: '/pages/authorizedLogin/index'
  21241. });
  21242. }
  21243. });
  21244. } else {
  21245. reject(data);
  21246. uni.showToast({
  21247. title: msg,
  21248. mask: true,
  21249. icon: "none"
  21250. });
  21251. }
  21252. }
  21253. },
  21254. fail: function fail(res) {
  21255. uni.showToast({
  21256. title: res,
  21257. mask: true,
  21258. icon: "none"
  21259. });
  21260. reject(res);
  21261. },
  21262. complete: function complete(res) {
  21263. uni.hideLoading();
  21264. }
  21265. }));
  21266. } catch (err) {
  21267. console.log(err);
  21268. reject(err);
  21269. }
  21270. }));
  21271. case 1:
  21272. case "end":
  21273. return _context.stop();
  21274. }
  21275. }
  21276. }, _callee);
  21277. }));
  21278. return _request.apply(this, arguments);
  21279. }
  21280. function formatRequestBody(parmas) {
  21281. var unionid = uni.getStorageSync('unionid');
  21282. var isAccount = uni.getStorageSync('isAccount');
  21283. var qrcode = uni.getStorageSync('qrcode');
  21284. var url = parmas.url;
  21285. url = baseUrl + url;
  21286. var data = _objectSpread({}, parmas.data);
  21287. var header = _objectSpread({}, parmas.header);
  21288. header[_index.default.TokenKey] = (0, _auth.getToken)();
  21289. header['AppID'] = _index.default.appID;
  21290. header['AppKey'] = _index.default.appKey;
  21291. header['AppSecret'] = _index.default.appSecret;
  21292. header['wxCode'] = unionid;
  21293. header['ocId'] = qrcode.ocId;
  21294. header['isAccount'] = isAccount;
  21295. header['AppType'] = 'mini';
  21296. var method = parmas.method || "get";
  21297. var dataType = parmas.dataType || "json";
  21298. var requestBody = {
  21299. url: url,
  21300. data: data,
  21301. header: header,
  21302. method: method,
  21303. dataType: dataType
  21304. };
  21305. return requestBody;
  21306. }
  21307. ;
  21308. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  21309. /***/ }),
  21310. /***/ 49:
  21311. /*!*************************************************************!*\
  21312. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/auth.js ***!
  21313. \*************************************************************/
  21314. /*! no static exports found */
  21315. /***/ (function(module, exports, __webpack_require__) {
  21316. "use strict";
  21317. /* WEBPACK VAR INJECTION */(function(uni) {
  21318. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21319. Object.defineProperty(exports, "__esModule", {
  21320. value: true
  21321. });
  21322. exports.getToken = getToken;
  21323. exports.removeToken = removeToken;
  21324. exports.setToken = setToken;
  21325. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 46));
  21326. var TokenKey = _index.default.TokenKey;
  21327. function getToken() {
  21328. return uni.getStorageSync(TokenKey);
  21329. }
  21330. function setToken(token) {
  21331. return uni.setStorageSync(TokenKey, token);
  21332. }
  21333. function removeToken() {
  21334. return uni.removeStorageSync(TokenKey);
  21335. }
  21336. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  21337. /***/ }),
  21338. /***/ 5:
  21339. /*!**************************************************************!*\
  21340. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  21341. \**************************************************************/
  21342. /*! no static exports found */
  21343. /***/ (function(module, exports, __webpack_require__) {
  21344. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  21345. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  21346. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  21347. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  21348. function _slicedToArray(arr, i) {
  21349. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  21350. }
  21351. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21352. /***/ }),
  21353. /***/ 50:
  21354. /*!**************************************************************!*\
  21355. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/index.js ***!
  21356. \**************************************************************/
  21357. /*! no static exports found */
  21358. /***/ (function(module, exports, __webpack_require__) {
  21359. "use strict";
  21360. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21361. Object.defineProperty(exports, "__esModule", {
  21362. value: true
  21363. });
  21364. exports.getQueryParams = getQueryParams;
  21365. exports.parseTime = parseTime;
  21366. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  21367. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  21368. function getQueryParams(url) {
  21369. var paramArr = url.slice(url.indexOf("?") + 1).split("&");
  21370. var params = {};
  21371. paramArr.map(function (param) {
  21372. var _param$split = param.split("="),
  21373. _param$split2 = (0, _slicedToArray2.default)(_param$split, 2),
  21374. key = _param$split2[0],
  21375. val = _param$split2[1];
  21376. params[key] = decodeURIComponent(val);
  21377. });
  21378. return params;
  21379. }
  21380. function parseTime(time, cFormat) {
  21381. if (arguments.length === 0 || !time) {
  21382. return null;
  21383. }
  21384. var format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}';
  21385. var date;
  21386. if ((0, _typeof2.default)(time) === 'object') {
  21387. date = time;
  21388. } else {
  21389. if (typeof time === 'string') {
  21390. if (/^[0-9]+$/.test(time)) {
  21391. // support "1548221490638"
  21392. time = parseInt(time);
  21393. } else {
  21394. // support safari
  21395. // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
  21396. time = time.replace(new RegExp(/-/gm), '/');
  21397. }
  21398. }
  21399. if (typeof time === 'number' && time.toString().length === 10) {
  21400. time = time * 1000;
  21401. }
  21402. date = new Date(time);
  21403. }
  21404. var formatObj = {
  21405. y: date.getFullYear(),
  21406. m: date.getMonth() + 1,
  21407. d: date.getDate(),
  21408. h: date.getHours(),
  21409. i: date.getMinutes(),
  21410. s: date.getSeconds(),
  21411. a: date.getDay()
  21412. };
  21413. var time_str = format.replace(/{([ymdhisa])+}/g, function (result, key) {
  21414. var value = formatObj[key];
  21415. // Note: getDay() returns 0 on Sunday
  21416. if (key === 'a') {
  21417. return ['日', '一', '二', '三', '四', '五', '六'][value];
  21418. }
  21419. return value.toString().padStart(2, '0');
  21420. });
  21421. return time_str;
  21422. }
  21423. /***/ }),
  21424. /***/ 59:
  21425. /*!*********************************************************************!*\
  21426. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/dangerApi.js ***!
  21427. \*********************************************************************/
  21428. /*! no static exports found */
  21429. /***/ (function(module, exports, __webpack_require__) {
  21430. "use strict";
  21431. Object.defineProperty(exports, "__esModule", {
  21432. value: true
  21433. });
  21434. exports.deleteDangerById = deleteDangerById;
  21435. exports.getDangerById = getDangerById;
  21436. exports.getDangerByList = getDangerByList;
  21437. exports.getDangerByPage = getDangerByPage;
  21438. exports.getMyHandlingDangerByPage = getMyHandlingDangerByPage;
  21439. exports.handleDanger = handleDanger;
  21440. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21441. /**
  21442. * 获取Danger列表
  21443. * @param data
  21444. * @returns
  21445. */
  21446. function getDangerByList(data) {
  21447. return (0, _request.request)({
  21448. url: '/danger',
  21449. method: 'GET',
  21450. data: data
  21451. });
  21452. }
  21453. /**
  21454. * 获取Danger分页
  21455. * @param data
  21456. * @returns
  21457. */
  21458. function getDangerByPage(data) {
  21459. return (0, _request.request)({
  21460. url: '/danger/page',
  21461. method: 'GET',
  21462. data: data
  21463. });
  21464. }
  21465. /**
  21466. * 根据Id获取Danger
  21467. * @param dangerId
  21468. * @returns
  21469. */
  21470. function getDangerById(dangerId) {
  21471. return (0, _request.request)({
  21472. url: "/danger/".concat(dangerId),
  21473. method: 'GET'
  21474. });
  21475. }
  21476. /**
  21477. * 删除Danger
  21478. * @param dangerId
  21479. * @returns
  21480. */
  21481. function deleteDangerById(dangerId) {
  21482. return (0, _request.request)({
  21483. url: "/danger/".concat(dangerId),
  21484. method: 'DELETE'
  21485. });
  21486. }
  21487. /**
  21488. * 处理Danger
  21489. * @param data
  21490. * @returns
  21491. */
  21492. function handleDanger(data) {
  21493. return (0, _request.request)({
  21494. url: "/danger/handle",
  21495. method: 'POST',
  21496. data: data
  21497. });
  21498. }
  21499. /**
  21500. * 待处理Danger
  21501. * @param data
  21502. * @returns
  21503. */
  21504. function getMyHandlingDangerByPage(data) {
  21505. return (0, _request.request)({
  21506. url: "/danger/myHandling/page",
  21507. method: 'GET',
  21508. data: data
  21509. });
  21510. }
  21511. /***/ }),
  21512. /***/ 6:
  21513. /*!***************************************************************!*\
  21514. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  21515. \***************************************************************/
  21516. /*! no static exports found */
  21517. /***/ (function(module, exports) {
  21518. function _arrayWithHoles(arr) {
  21519. if (Array.isArray(arr)) return arr;
  21520. }
  21521. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21522. /***/ }),
  21523. /***/ 60:
  21524. /*!**************************************************************************!*\
  21525. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistPoint.js ***!
  21526. \**************************************************************************/
  21527. /*! no static exports found */
  21528. /***/ (function(module, exports, __webpack_require__) {
  21529. "use strict";
  21530. Object.defineProperty(exports, "__esModule", {
  21531. value: true
  21532. });
  21533. exports.checklistBatchUpdate = checklistBatchUpdate;
  21534. exports.checklistCancel = checklistCancel;
  21535. exports.checklistComplete = checklistComplete;
  21536. exports.checklistInit = checklistInit;
  21537. exports.getDoingPoint = getDoingPoint;
  21538. exports.getPoint = getPoint;
  21539. exports.getchecklistByPage = getchecklistByPage;
  21540. exports.getchecklistRecord = getchecklistRecord;
  21541. exports.updateChecklistPoint = updateChecklistPoint;
  21542. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21543. /**
  21544. * 清单初始化
  21545. * ocId
  21546. * targetId ,targetType,targetTitle,targetGroupId,,targetGroupName
  21547. * checklistId
  21548. */
  21549. function checklistInit(data) {
  21550. return (0, _request.request)({
  21551. url: "/checklist/point/record/init",
  21552. method: 'POST',
  21553. data: data
  21554. });
  21555. }
  21556. function updateChecklistPoint(data) {
  21557. return (0, _request.request)({
  21558. url: "/checklist/point/record/doing/update",
  21559. method: 'PUT',
  21560. data: data
  21561. });
  21562. }
  21563. function getchecklistRecord(checklistId, recordId) {
  21564. return (0, _request.request)({
  21565. url: "/checklist/point/record/view/".concat(recordId, "/").concat(checklistId),
  21566. method: 'GET'
  21567. });
  21568. }
  21569. function getchecklistByPage(data) {
  21570. return (0, _request.request)({
  21571. url: "/checklist/record/page",
  21572. method: 'GET',
  21573. data: data
  21574. });
  21575. }
  21576. // 巡检完成
  21577. function checklistComplete(recordId) {
  21578. return (0, _request.request)({
  21579. url: "/checklist/point/record/complete/".concat(recordId),
  21580. method: 'PUT'
  21581. });
  21582. }
  21583. // 巡检放弃
  21584. function checklistCancel(recordId) {
  21585. return (0, _request.request)({
  21586. url: "/checklist/point/record/cancel/".concat(recordId),
  21587. method: 'PUT'
  21588. });
  21589. }
  21590. // 批量操作
  21591. function checklistBatchUpdate(recordId, checkResult) {
  21592. return (0, _request.request)({
  21593. url: "/checklist/point/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  21594. method: 'PUT'
  21595. });
  21596. }
  21597. // 批量操作
  21598. function getDoingPoint(checklistId, itemId, recordId, pointId) {
  21599. return (0, _request.request)({
  21600. url: "/checklist/point/record/doing/".concat(recordId, "/").concat(checklistId, "/").concat(itemId, "/").concat(pointId)
  21601. });
  21602. }
  21603. function getPoint(checklistId, itemId, recordId, pointId) {
  21604. return (0, _request.request)({
  21605. url: "/checklist/point/record/".concat(recordId, "/").concat(checklistId, "/").concat(itemId, "/").concat(pointId)
  21606. });
  21607. }
  21608. /***/ }),
  21609. /***/ 61:
  21610. /*!***********************************************************************!*\
  21611. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/snapshotApi.js ***!
  21612. \***********************************************************************/
  21613. /*! no static exports found */
  21614. /***/ (function(module, exports, __webpack_require__) {
  21615. "use strict";
  21616. Object.defineProperty(exports, "__esModule", {
  21617. value: true
  21618. });
  21619. exports.cancelSnapshot = cancelSnapshot;
  21620. exports.completeSnapshot = completeSnapshot;
  21621. exports.createSnapshot = createSnapshot;
  21622. exports.deleteSnapshotById = deleteSnapshotById;
  21623. exports.getSnapshotById = getSnapshotById;
  21624. exports.getSnapshotByList = getSnapshotByList;
  21625. exports.getSnapshotByPage = getSnapshotByPage;
  21626. exports.getSnapshotCounter = getSnapshotCounter;
  21627. exports.transferSnapshot = transferSnapshot;
  21628. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21629. /**
  21630. * 问题反馈列表
  21631. * @param data
  21632. * @returns
  21633. */
  21634. function getSnapshotByList(data) {
  21635. return (0, _request.request)({
  21636. url: '/snapshot',
  21637. method: 'GET',
  21638. params: data
  21639. });
  21640. }
  21641. /**
  21642. * 问题反馈列表
  21643. * @param data
  21644. * @returns
  21645. */
  21646. function getSnapshotByPage(data) {
  21647. return (0, _request.request)({
  21648. url: '/snapshot/page',
  21649. method: 'GET',
  21650. data: data
  21651. });
  21652. }
  21653. /**
  21654. * 获取问题反馈详情
  21655. * @param snapshotId
  21656. * @returns
  21657. */
  21658. function getSnapshotById(snapshotId) {
  21659. return (0, _request.request)({
  21660. url: "/snapshot/".concat(snapshotId),
  21661. method: 'GET'
  21662. });
  21663. }
  21664. /**
  21665. * 添加问题反馈
  21666. * @param data
  21667. * @returns
  21668. */
  21669. function createSnapshot(data) {
  21670. return (0, _request.request)({
  21671. url: "/snapshot/add",
  21672. method: 'POST',
  21673. data: data
  21674. });
  21675. }
  21676. /**
  21677. * 完成处理
  21678. * @param snapshotId
  21679. * @param data
  21680. * @returns
  21681. */
  21682. function completeSnapshot(snapshotId, data) {
  21683. return (0, _request.request)({
  21684. url: "/snapshot/complete",
  21685. method: 'POST',
  21686. data: data
  21687. });
  21688. }
  21689. /**
  21690. * 转交他人
  21691. * @param snapshotId
  21692. * @param data
  21693. * @returns
  21694. */
  21695. function transferSnapshot(snapshotId, data) {
  21696. return (0, _request.request)({
  21697. url: "/snapshot/transfer/".concat(snapshotId),
  21698. method: 'POST',
  21699. data: data
  21700. });
  21701. }
  21702. /**
  21703. * 撤消
  21704. * @param snapshotId
  21705. * @returns
  21706. */
  21707. function cancelSnapshot(snapshotId) {
  21708. return (0, _request.request)({
  21709. url: "/snapshot/cancel/".concat(snapshotId),
  21710. method: 'GET'
  21711. });
  21712. }
  21713. /**
  21714. * 基于ID删除
  21715. * @param snapshotId
  21716. * @returns
  21717. */
  21718. function deleteSnapshotById(snapshotId) {
  21719. return (0, _request.request)({
  21720. url: "/snapshot/".concat(snapshotId),
  21721. method: 'DELETE'
  21722. });
  21723. }
  21724. /**
  21725. * 查询统计结果
  21726. */
  21727. function getSnapshotCounter() {
  21728. return (0, _request.request)({
  21729. url: '/snapshot/statis/counterByStatus',
  21730. method: 'GET'
  21731. });
  21732. }
  21733. /***/ }),
  21734. /***/ 7:
  21735. /*!*********************************************************************!*\
  21736. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  21737. \*********************************************************************/
  21738. /*! no static exports found */
  21739. /***/ (function(module, exports) {
  21740. function _iterableToArrayLimit(arr, i) {
  21741. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  21742. if (null != _i) {
  21743. var _s,
  21744. _e,
  21745. _x,
  21746. _r,
  21747. _arr = [],
  21748. _n = !0,
  21749. _d = !1;
  21750. try {
  21751. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  21752. if (Object(_i) !== _i) return;
  21753. _n = !1;
  21754. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  21755. ;
  21756. }
  21757. } catch (err) {
  21758. _d = !0, _e = err;
  21759. } finally {
  21760. try {
  21761. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  21762. } finally {
  21763. if (_d) throw _e;
  21764. }
  21765. }
  21766. return _arr;
  21767. }
  21768. }
  21769. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21770. /***/ }),
  21771. /***/ 70:
  21772. /*!*******************************************************************!*\
  21773. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/wfApi.js ***!
  21774. \*******************************************************************/
  21775. /*! no static exports found */
  21776. /***/ (function(module, exports, __webpack_require__) {
  21777. "use strict";
  21778. Object.defineProperty(exports, "__esModule", {
  21779. value: true
  21780. });
  21781. exports.cancelWorkflow = cancelWorkflow;
  21782. exports.getWorkflowById = getWorkflowById;
  21783. exports.getWorkflowById2 = getWorkflowById2;
  21784. exports.getWorkflowById3 = getWorkflowById3;
  21785. exports.getWorkflowDetailsById = getWorkflowDetailsById;
  21786. exports.getWorkflowRecordById = getWorkflowRecordById;
  21787. exports.handleWorkflow = handleWorkflow;
  21788. exports.startWorkflow = startWorkflow;
  21789. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21790. /**
  21791. * 启动Workflow
  21792. * @param wfDefId
  21793. * @returns
  21794. */
  21795. function startWorkflow(wfDefId) {
  21796. return (0, _request.request)({
  21797. url: "/wf/start/".concat(wfDefId),
  21798. method: 'GET'
  21799. });
  21800. }
  21801. function getWorkflowById(wfInsId) {
  21802. return (0, _request.request)({
  21803. url: "/wf/getIns/".concat(wfInsId),
  21804. method: 'GET'
  21805. });
  21806. }
  21807. function getWorkflowById2(wfInsId, activityInsId) {
  21808. return (0, _request.request)({
  21809. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId),
  21810. method: 'GET'
  21811. });
  21812. }
  21813. function getWorkflowById3(wfInsId, activityInsId, actionInsId) {
  21814. return (0, _request.request)({
  21815. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId, "/").concat(actionInsId),
  21816. method: 'GET'
  21817. });
  21818. }
  21819. function getWorkflowDetailsById(wfInsId) {
  21820. return (0, _request.request)({
  21821. url: "/wf/details/".concat(wfInsId),
  21822. method: 'GET'
  21823. });
  21824. }
  21825. function getWorkflowRecordById(wfInsId) {
  21826. return (0, _request.request)({
  21827. url: "/wf/record/".concat(wfInsId),
  21828. method: 'GET'
  21829. });
  21830. }
  21831. /**
  21832. * 处理
  21833. * @param data
  21834. * @returns
  21835. */
  21836. function handleWorkflow(data) {
  21837. return (0, _request.request)({
  21838. url: "/wf/handle",
  21839. method: 'POST',
  21840. data: data
  21841. });
  21842. }
  21843. /**
  21844. * 撤消
  21845. * @param wfInsId
  21846. * @returns
  21847. */
  21848. function cancelWorkflow(wfInsId) {
  21849. return (0, _request.request)({
  21850. url: "/wf/cancel/".concat(wfInsId),
  21851. method: 'GET'
  21852. });
  21853. }
  21854. /***/ }),
  21855. /***/ 79:
  21856. /*!******************************************************************!*\
  21857. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/user.js ***!
  21858. \******************************************************************/
  21859. /*! no static exports found */
  21860. /***/ (function(module, exports, __webpack_require__) {
  21861. "use strict";
  21862. Object.defineProperty(exports, "__esModule", {
  21863. value: true
  21864. });
  21865. exports.getUserInfo = getUserInfo;
  21866. exports.getUserList = getUserList;
  21867. exports.login = login;
  21868. exports.logout = logout;
  21869. exports.register = register;
  21870. exports.updatePwd = updatePwd;
  21871. exports.uploadFile = uploadFile;
  21872. exports.wxWorkLogin = wxWorkLogin;
  21873. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21874. function login(data) {
  21875. return (0, _request.request)({
  21876. url: '/login',
  21877. method: 'post',
  21878. header: {
  21879. 'content-type': "application/x-www-form-urlencoded"
  21880. },
  21881. data: data
  21882. });
  21883. }
  21884. function getUserInfo() {
  21885. return (0, _request.request)({
  21886. url: '/user/profile'
  21887. });
  21888. }
  21889. function logout() {
  21890. return (0, _request.request)({
  21891. url: '/logout',
  21892. method: 'GET'
  21893. });
  21894. }
  21895. function register(data) {
  21896. return (0, _request.request)({
  21897. url: '/user/register',
  21898. method: 'post',
  21899. data: data
  21900. });
  21901. }
  21902. /**公用上传接口 */
  21903. function uploadFile(data) {
  21904. return (0, _request.request)({
  21905. url: '/upload/file',
  21906. method: "post",
  21907. headers: {
  21908. 'Content-Type': 'multipart/form-data'
  21909. },
  21910. data: data
  21911. });
  21912. }
  21913. function updatePwd(data) {
  21914. return (0, _request.request)({
  21915. url: '/user/updatePwd',
  21916. method: "post",
  21917. data: data
  21918. });
  21919. }
  21920. //查询用户的带岗位
  21921. function getUserList() {
  21922. return (0, _request.request)({
  21923. url: '/user/select',
  21924. method: 'get'
  21925. });
  21926. }
  21927. //企业微信登录
  21928. function wxWorkLogin(_ref) {
  21929. var userId = _ref.userId,
  21930. code = _ref.code;
  21931. return (0, _request.request)({
  21932. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  21933. method: 'post'
  21934. });
  21935. }
  21936. /***/ }),
  21937. /***/ 8:
  21938. /*!***************************************************************************!*\
  21939. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  21940. \***************************************************************************/
  21941. /*! no static exports found */
  21942. /***/ (function(module, exports, __webpack_require__) {
  21943. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  21944. function _unsupportedIterableToArray(o, minLen) {
  21945. if (!o) return;
  21946. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  21947. var n = Object.prototype.toString.call(o).slice(8, -1);
  21948. if (n === "Object" && o.constructor) n = o.constructor.name;
  21949. if (n === "Map" || n === "Set") return Array.from(o);
  21950. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  21951. }
  21952. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21953. /***/ }),
  21954. /***/ 80:
  21955. /*!****************************************************************!*\
  21956. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/task.js ***!
  21957. \****************************************************************/
  21958. /*! no static exports found */
  21959. /***/ (function(module, exports, __webpack_require__) {
  21960. "use strict";
  21961. Object.defineProperty(exports, "__esModule", {
  21962. value: true
  21963. });
  21964. exports.getTaskMyHandlingByList = getTaskMyHandlingByList;
  21965. exports.handleCheckTask = handleCheckTask;
  21966. exports.waitHandleStatistics = waitHandleStatistics;
  21967. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21968. /**
  21969. * 列表查询Danger Category
  21970. * @returns
  21971. */
  21972. function getTaskMyHandlingByList(data) {
  21973. return (0, _request.request)({
  21974. url: '/task/myHandling/page',
  21975. method: 'GET',
  21976. data: data
  21977. });
  21978. }
  21979. /**
  21980. * Handle CheckTask
  21981. * @param taskId
  21982. */
  21983. function handleCheckTask(taskId) {
  21984. return (0, _request.request)({
  21985. url: "/check/task/handle/".concat(taskId),
  21986. method: 'PUT'
  21987. });
  21988. }
  21989. /**
  21990. * Handle CheckTask
  21991. * @param taskId
  21992. */
  21993. function waitHandleStatistics() {
  21994. return (0, _request.request)({
  21995. url: "/myCounter"
  21996. });
  21997. }
  21998. /***/ }),
  21999. /***/ 89:
  22000. /*!**************************************************************!*\
  22001. !*** E:/work/Project_newGit/hptwxMiniProgram/store/index.js ***!
  22002. \**************************************************************/
  22003. /*! no static exports found */
  22004. /***/ (function(module, exports, __webpack_require__) {
  22005. "use strict";
  22006. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22007. Object.defineProperty(exports, "__esModule", {
  22008. value: true
  22009. });
  22010. exports.default = void 0;
  22011. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  22012. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 90));
  22013. _vue.default.use(_vuex.default);
  22014. //实例store对象
  22015. var store = new _vuex.default.Store({
  22016. state: {
  22017. access_token: "",
  22018. jpush: null
  22019. },
  22020. mutations: {
  22021. setToken: function setToken(state, token) {
  22022. state.access_token = token;
  22023. },
  22024. initJpush: function initJpush(state, jpush) {
  22025. state.jpush = jpush;
  22026. }
  22027. }
  22028. });
  22029. //导出store对象
  22030. var _default = store;
  22031. exports.default = _default;
  22032. /***/ }),
  22033. /***/ 9:
  22034. /*!*****************************************************************!*\
  22035. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  22036. \*****************************************************************/
  22037. /*! no static exports found */
  22038. /***/ (function(module, exports) {
  22039. function _arrayLikeToArray(arr, len) {
  22040. if (len == null || len > arr.length) len = arr.length;
  22041. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  22042. arr2[i] = arr[i];
  22043. }
  22044. return arr2;
  22045. }
  22046. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22047. /***/ }),
  22048. /***/ 90:
  22049. /*!**************************************************************************************!*\
  22050. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  22051. \**************************************************************************************/
  22052. /*! no static exports found */
  22053. /***/ (function(module, exports, __webpack_require__) {
  22054. "use strict";
  22055. /* WEBPACK VAR INJECTION */(function(global) {/*!
  22056. * vuex v3.6.2
  22057. * (c) 2021 Evan You
  22058. * @license MIT
  22059. */
  22060. function applyMixin (Vue) {
  22061. var version = Number(Vue.version.split('.')[0]);
  22062. if (version >= 2) {
  22063. Vue.mixin({ beforeCreate: vuexInit });
  22064. } else {
  22065. // override init and inject vuex init procedure
  22066. // for 1.x backwards compatibility.
  22067. var _init = Vue.prototype._init;
  22068. Vue.prototype._init = function (options) {
  22069. if ( options === void 0 ) options = {};
  22070. options.init = options.init
  22071. ? [vuexInit].concat(options.init)
  22072. : vuexInit;
  22073. _init.call(this, options);
  22074. };
  22075. }
  22076. /**
  22077. * Vuex init hook, injected into each instances init hooks list.
  22078. */
  22079. function vuexInit () {
  22080. var options = this.$options;
  22081. // store injection
  22082. if (options.store) {
  22083. this.$store = typeof options.store === 'function'
  22084. ? options.store()
  22085. : options.store;
  22086. } else if (options.parent && options.parent.$store) {
  22087. this.$store = options.parent.$store;
  22088. }
  22089. }
  22090. }
  22091. var target = typeof window !== 'undefined'
  22092. ? window
  22093. : typeof global !== 'undefined'
  22094. ? global
  22095. : {};
  22096. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  22097. function devtoolPlugin (store) {
  22098. if (!devtoolHook) { return }
  22099. store._devtoolHook = devtoolHook;
  22100. devtoolHook.emit('vuex:init', store);
  22101. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  22102. store.replaceState(targetState);
  22103. });
  22104. store.subscribe(function (mutation, state) {
  22105. devtoolHook.emit('vuex:mutation', mutation, state);
  22106. }, { prepend: true });
  22107. store.subscribeAction(function (action, state) {
  22108. devtoolHook.emit('vuex:action', action, state);
  22109. }, { prepend: true });
  22110. }
  22111. /**
  22112. * Get the first item that pass the test
  22113. * by second argument function
  22114. *
  22115. * @param {Array} list
  22116. * @param {Function} f
  22117. * @return {*}
  22118. */
  22119. function find (list, f) {
  22120. return list.filter(f)[0]
  22121. }
  22122. /**
  22123. * Deep copy the given object considering circular structure.
  22124. * This function caches all nested objects and its copies.
  22125. * If it detects circular structure, use cached copy to avoid infinite loop.
  22126. *
  22127. * @param {*} obj
  22128. * @param {Array<Object>} cache
  22129. * @return {*}
  22130. */
  22131. function deepCopy (obj, cache) {
  22132. if ( cache === void 0 ) cache = [];
  22133. // just return if obj is immutable value
  22134. if (obj === null || typeof obj !== 'object') {
  22135. return obj
  22136. }
  22137. // if obj is hit, it is in circular structure
  22138. var hit = find(cache, function (c) { return c.original === obj; });
  22139. if (hit) {
  22140. return hit.copy
  22141. }
  22142. var copy = Array.isArray(obj) ? [] : {};
  22143. // put the copy into cache at first
  22144. // because we want to refer it in recursive deepCopy
  22145. cache.push({
  22146. original: obj,
  22147. copy: copy
  22148. });
  22149. Object.keys(obj).forEach(function (key) {
  22150. copy[key] = deepCopy(obj[key], cache);
  22151. });
  22152. return copy
  22153. }
  22154. /**
  22155. * forEach for object
  22156. */
  22157. function forEachValue (obj, fn) {
  22158. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  22159. }
  22160. function isObject (obj) {
  22161. return obj !== null && typeof obj === 'object'
  22162. }
  22163. function isPromise (val) {
  22164. return val && typeof val.then === 'function'
  22165. }
  22166. function assert (condition, msg) {
  22167. if (!condition) { throw new Error(("[vuex] " + msg)) }
  22168. }
  22169. function partial (fn, arg) {
  22170. return function () {
  22171. return fn(arg)
  22172. }
  22173. }
  22174. // Base data struct for store's module, package with some attribute and method
  22175. var Module = function Module (rawModule, runtime) {
  22176. this.runtime = runtime;
  22177. // Store some children item
  22178. this._children = Object.create(null);
  22179. // Store the origin module object which passed by programmer
  22180. this._rawModule = rawModule;
  22181. var rawState = rawModule.state;
  22182. // Store the origin module's state
  22183. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  22184. };
  22185. var prototypeAccessors = { namespaced: { configurable: true } };
  22186. prototypeAccessors.namespaced.get = function () {
  22187. return !!this._rawModule.namespaced
  22188. };
  22189. Module.prototype.addChild = function addChild (key, module) {
  22190. this._children[key] = module;
  22191. };
  22192. Module.prototype.removeChild = function removeChild (key) {
  22193. delete this._children[key];
  22194. };
  22195. Module.prototype.getChild = function getChild (key) {
  22196. return this._children[key]
  22197. };
  22198. Module.prototype.hasChild = function hasChild (key) {
  22199. return key in this._children
  22200. };
  22201. Module.prototype.update = function update (rawModule) {
  22202. this._rawModule.namespaced = rawModule.namespaced;
  22203. if (rawModule.actions) {
  22204. this._rawModule.actions = rawModule.actions;
  22205. }
  22206. if (rawModule.mutations) {
  22207. this._rawModule.mutations = rawModule.mutations;
  22208. }
  22209. if (rawModule.getters) {
  22210. this._rawModule.getters = rawModule.getters;
  22211. }
  22212. };
  22213. Module.prototype.forEachChild = function forEachChild (fn) {
  22214. forEachValue(this._children, fn);
  22215. };
  22216. Module.prototype.forEachGetter = function forEachGetter (fn) {
  22217. if (this._rawModule.getters) {
  22218. forEachValue(this._rawModule.getters, fn);
  22219. }
  22220. };
  22221. Module.prototype.forEachAction = function forEachAction (fn) {
  22222. if (this._rawModule.actions) {
  22223. forEachValue(this._rawModule.actions, fn);
  22224. }
  22225. };
  22226. Module.prototype.forEachMutation = function forEachMutation (fn) {
  22227. if (this._rawModule.mutations) {
  22228. forEachValue(this._rawModule.mutations, fn);
  22229. }
  22230. };
  22231. Object.defineProperties( Module.prototype, prototypeAccessors );
  22232. var ModuleCollection = function ModuleCollection (rawRootModule) {
  22233. // register root module (Vuex.Store options)
  22234. this.register([], rawRootModule, false);
  22235. };
  22236. ModuleCollection.prototype.get = function get (path) {
  22237. return path.reduce(function (module, key) {
  22238. return module.getChild(key)
  22239. }, this.root)
  22240. };
  22241. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  22242. var module = this.root;
  22243. return path.reduce(function (namespace, key) {
  22244. module = module.getChild(key);
  22245. return namespace + (module.namespaced ? key + '/' : '')
  22246. }, '')
  22247. };
  22248. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  22249. update([], this.root, rawRootModule);
  22250. };
  22251. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  22252. var this$1 = this;
  22253. if ( runtime === void 0 ) runtime = true;
  22254. if ((true)) {
  22255. assertRawModule(path, rawModule);
  22256. }
  22257. var newModule = new Module(rawModule, runtime);
  22258. if (path.length === 0) {
  22259. this.root = newModule;
  22260. } else {
  22261. var parent = this.get(path.slice(0, -1));
  22262. parent.addChild(path[path.length - 1], newModule);
  22263. }
  22264. // register nested modules
  22265. if (rawModule.modules) {
  22266. forEachValue(rawModule.modules, function (rawChildModule, key) {
  22267. this$1.register(path.concat(key), rawChildModule, runtime);
  22268. });
  22269. }
  22270. };
  22271. ModuleCollection.prototype.unregister = function unregister (path) {
  22272. var parent = this.get(path.slice(0, -1));
  22273. var key = path[path.length - 1];
  22274. var child = parent.getChild(key);
  22275. if (!child) {
  22276. if ((true)) {
  22277. console.warn(
  22278. "[vuex] trying to unregister module '" + key + "', which is " +
  22279. "not registered"
  22280. );
  22281. }
  22282. return
  22283. }
  22284. if (!child.runtime) {
  22285. return
  22286. }
  22287. parent.removeChild(key);
  22288. };
  22289. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  22290. var parent = this.get(path.slice(0, -1));
  22291. var key = path[path.length - 1];
  22292. if (parent) {
  22293. return parent.hasChild(key)
  22294. }
  22295. return false
  22296. };
  22297. function update (path, targetModule, newModule) {
  22298. if ((true)) {
  22299. assertRawModule(path, newModule);
  22300. }
  22301. // update target module
  22302. targetModule.update(newModule);
  22303. // update nested modules
  22304. if (newModule.modules) {
  22305. for (var key in newModule.modules) {
  22306. if (!targetModule.getChild(key)) {
  22307. if ((true)) {
  22308. console.warn(
  22309. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  22310. 'manual reload is needed'
  22311. );
  22312. }
  22313. return
  22314. }
  22315. update(
  22316. path.concat(key),
  22317. targetModule.getChild(key),
  22318. newModule.modules[key]
  22319. );
  22320. }
  22321. }
  22322. }
  22323. var functionAssert = {
  22324. assert: function (value) { return typeof value === 'function'; },
  22325. expected: 'function'
  22326. };
  22327. var objectAssert = {
  22328. assert: function (value) { return typeof value === 'function' ||
  22329. (typeof value === 'object' && typeof value.handler === 'function'); },
  22330. expected: 'function or object with "handler" function'
  22331. };
  22332. var assertTypes = {
  22333. getters: functionAssert,
  22334. mutations: functionAssert,
  22335. actions: objectAssert
  22336. };
  22337. function assertRawModule (path, rawModule) {
  22338. Object.keys(assertTypes).forEach(function (key) {
  22339. if (!rawModule[key]) { return }
  22340. var assertOptions = assertTypes[key];
  22341. forEachValue(rawModule[key], function (value, type) {
  22342. assert(
  22343. assertOptions.assert(value),
  22344. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  22345. );
  22346. });
  22347. });
  22348. }
  22349. function makeAssertionMessage (path, key, type, value, expected) {
  22350. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  22351. if (path.length > 0) {
  22352. buf += " in module \"" + (path.join('.')) + "\"";
  22353. }
  22354. buf += " is " + (JSON.stringify(value)) + ".";
  22355. return buf
  22356. }
  22357. var Vue; // bind on install
  22358. var Store = function Store (options) {
  22359. var this$1 = this;
  22360. if ( options === void 0 ) options = {};
  22361. // Auto install if it is not done yet and `window` has `Vue`.
  22362. // To allow users to avoid auto-installation in some cases,
  22363. // this code should be placed here. See #731
  22364. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  22365. install(window.Vue);
  22366. }
  22367. if ((true)) {
  22368. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  22369. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  22370. assert(this instanceof Store, "store must be called with the new operator.");
  22371. }
  22372. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  22373. var strict = options.strict; if ( strict === void 0 ) strict = false;
  22374. // store internal state
  22375. this._committing = false;
  22376. this._actions = Object.create(null);
  22377. this._actionSubscribers = [];
  22378. this._mutations = Object.create(null);
  22379. this._wrappedGetters = Object.create(null);
  22380. this._modules = new ModuleCollection(options);
  22381. this._modulesNamespaceMap = Object.create(null);
  22382. this._subscribers = [];
  22383. this._watcherVM = new Vue();
  22384. this._makeLocalGettersCache = Object.create(null);
  22385. // bind commit and dispatch to self
  22386. var store = this;
  22387. var ref = this;
  22388. var dispatch = ref.dispatch;
  22389. var commit = ref.commit;
  22390. this.dispatch = function boundDispatch (type, payload) {
  22391. return dispatch.call(store, type, payload)
  22392. };
  22393. this.commit = function boundCommit (type, payload, options) {
  22394. return commit.call(store, type, payload, options)
  22395. };
  22396. // strict mode
  22397. this.strict = strict;
  22398. var state = this._modules.root.state;
  22399. // init root module.
  22400. // this also recursively registers all sub-modules
  22401. // and collects all module getters inside this._wrappedGetters
  22402. installModule(this, state, [], this._modules.root);
  22403. // initialize the store vm, which is responsible for the reactivity
  22404. // (also registers _wrappedGetters as computed properties)
  22405. resetStoreVM(this, state);
  22406. // apply plugins
  22407. plugins.forEach(function (plugin) { return plugin(this$1); });
  22408. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  22409. if (useDevtools) {
  22410. devtoolPlugin(this);
  22411. }
  22412. };
  22413. var prototypeAccessors$1 = { state: { configurable: true } };
  22414. prototypeAccessors$1.state.get = function () {
  22415. return this._vm._data.$$state
  22416. };
  22417. prototypeAccessors$1.state.set = function (v) {
  22418. if ((true)) {
  22419. assert(false, "use store.replaceState() to explicit replace store state.");
  22420. }
  22421. };
  22422. Store.prototype.commit = function commit (_type, _payload, _options) {
  22423. var this$1 = this;
  22424. // check object-style commit
  22425. var ref = unifyObjectStyle(_type, _payload, _options);
  22426. var type = ref.type;
  22427. var payload = ref.payload;
  22428. var options = ref.options;
  22429. var mutation = { type: type, payload: payload };
  22430. var entry = this._mutations[type];
  22431. if (!entry) {
  22432. if ((true)) {
  22433. console.error(("[vuex] unknown mutation type: " + type));
  22434. }
  22435. return
  22436. }
  22437. this._withCommit(function () {
  22438. entry.forEach(function commitIterator (handler) {
  22439. handler(payload);
  22440. });
  22441. });
  22442. this._subscribers
  22443. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  22444. .forEach(function (sub) { return sub(mutation, this$1.state); });
  22445. if (
  22446. ( true) &&
  22447. options && options.silent
  22448. ) {
  22449. console.warn(
  22450. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  22451. 'Use the filter functionality in the vue-devtools'
  22452. );
  22453. }
  22454. };
  22455. Store.prototype.dispatch = function dispatch (_type, _payload) {
  22456. var this$1 = this;
  22457. // check object-style dispatch
  22458. var ref = unifyObjectStyle(_type, _payload);
  22459. var type = ref.type;
  22460. var payload = ref.payload;
  22461. var action = { type: type, payload: payload };
  22462. var entry = this._actions[type];
  22463. if (!entry) {
  22464. if ((true)) {
  22465. console.error(("[vuex] unknown action type: " + type));
  22466. }
  22467. return
  22468. }
  22469. try {
  22470. this._actionSubscribers
  22471. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  22472. .filter(function (sub) { return sub.before; })
  22473. .forEach(function (sub) { return sub.before(action, this$1.state); });
  22474. } catch (e) {
  22475. if ((true)) {
  22476. console.warn("[vuex] error in before action subscribers: ");
  22477. console.error(e);
  22478. }
  22479. }
  22480. var result = entry.length > 1
  22481. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  22482. : entry[0](payload);
  22483. return new Promise(function (resolve, reject) {
  22484. result.then(function (res) {
  22485. try {
  22486. this$1._actionSubscribers
  22487. .filter(function (sub) { return sub.after; })
  22488. .forEach(function (sub) { return sub.after(action, this$1.state); });
  22489. } catch (e) {
  22490. if ((true)) {
  22491. console.warn("[vuex] error in after action subscribers: ");
  22492. console.error(e);
  22493. }
  22494. }
  22495. resolve(res);
  22496. }, function (error) {
  22497. try {
  22498. this$1._actionSubscribers
  22499. .filter(function (sub) { return sub.error; })
  22500. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  22501. } catch (e) {
  22502. if ((true)) {
  22503. console.warn("[vuex] error in error action subscribers: ");
  22504. console.error(e);
  22505. }
  22506. }
  22507. reject(error);
  22508. });
  22509. })
  22510. };
  22511. Store.prototype.subscribe = function subscribe (fn, options) {
  22512. return genericSubscribe(fn, this._subscribers, options)
  22513. };
  22514. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  22515. var subs = typeof fn === 'function' ? { before: fn } : fn;
  22516. return genericSubscribe(subs, this._actionSubscribers, options)
  22517. };
  22518. Store.prototype.watch = function watch (getter, cb, options) {
  22519. var this$1 = this;
  22520. if ((true)) {
  22521. assert(typeof getter === 'function', "store.watch only accepts a function.");
  22522. }
  22523. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  22524. };
  22525. Store.prototype.replaceState = function replaceState (state) {
  22526. var this$1 = this;
  22527. this._withCommit(function () {
  22528. this$1._vm._data.$$state = state;
  22529. });
  22530. };
  22531. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  22532. if ( options === void 0 ) options = {};
  22533. if (typeof path === 'string') { path = [path]; }
  22534. if ((true)) {
  22535. assert(Array.isArray(path), "module path must be a string or an Array.");
  22536. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  22537. }
  22538. this._modules.register(path, rawModule);
  22539. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  22540. // reset store to update getters...
  22541. resetStoreVM(this, this.state);
  22542. };
  22543. Store.prototype.unregisterModule = function unregisterModule (path) {
  22544. var this$1 = this;
  22545. if (typeof path === 'string') { path = [path]; }
  22546. if ((true)) {
  22547. assert(Array.isArray(path), "module path must be a string or an Array.");
  22548. }
  22549. this._modules.unregister(path);
  22550. this._withCommit(function () {
  22551. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  22552. Vue.delete(parentState, path[path.length - 1]);
  22553. });
  22554. resetStore(this);
  22555. };
  22556. Store.prototype.hasModule = function hasModule (path) {
  22557. if (typeof path === 'string') { path = [path]; }
  22558. if ((true)) {
  22559. assert(Array.isArray(path), "module path must be a string or an Array.");
  22560. }
  22561. return this._modules.isRegistered(path)
  22562. };
  22563. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  22564. this._modules.update(newOptions);
  22565. resetStore(this, true);
  22566. };
  22567. Store.prototype._withCommit = function _withCommit (fn) {
  22568. var committing = this._committing;
  22569. this._committing = true;
  22570. fn();
  22571. this._committing = committing;
  22572. };
  22573. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  22574. function genericSubscribe (fn, subs, options) {
  22575. if (subs.indexOf(fn) < 0) {
  22576. options && options.prepend
  22577. ? subs.unshift(fn)
  22578. : subs.push(fn);
  22579. }
  22580. return function () {
  22581. var i = subs.indexOf(fn);
  22582. if (i > -1) {
  22583. subs.splice(i, 1);
  22584. }
  22585. }
  22586. }
  22587. function resetStore (store, hot) {
  22588. store._actions = Object.create(null);
  22589. store._mutations = Object.create(null);
  22590. store._wrappedGetters = Object.create(null);
  22591. store._modulesNamespaceMap = Object.create(null);
  22592. var state = store.state;
  22593. // init all modules
  22594. installModule(store, state, [], store._modules.root, true);
  22595. // reset vm
  22596. resetStoreVM(store, state, hot);
  22597. }
  22598. function resetStoreVM (store, state, hot) {
  22599. var oldVm = store._vm;
  22600. // bind store public getters
  22601. store.getters = {};
  22602. // reset local getters cache
  22603. store._makeLocalGettersCache = Object.create(null);
  22604. var wrappedGetters = store._wrappedGetters;
  22605. var computed = {};
  22606. forEachValue(wrappedGetters, function (fn, key) {
  22607. // use computed to leverage its lazy-caching mechanism
  22608. // direct inline function use will lead to closure preserving oldVm.
  22609. // using partial to return function with only arguments preserved in closure environment.
  22610. computed[key] = partial(fn, store);
  22611. Object.defineProperty(store.getters, key, {
  22612. get: function () { return store._vm[key]; },
  22613. enumerable: true // for local getters
  22614. });
  22615. });
  22616. // use a Vue instance to store the state tree
  22617. // suppress warnings just in case the user has added
  22618. // some funky global mixins
  22619. var silent = Vue.config.silent;
  22620. Vue.config.silent = true;
  22621. store._vm = new Vue({
  22622. data: {
  22623. $$state: state
  22624. },
  22625. computed: computed
  22626. });
  22627. Vue.config.silent = silent;
  22628. // enable strict mode for new vm
  22629. if (store.strict) {
  22630. enableStrictMode(store);
  22631. }
  22632. if (oldVm) {
  22633. if (hot) {
  22634. // dispatch changes in all subscribed watchers
  22635. // to force getter re-evaluation for hot reloading.
  22636. store._withCommit(function () {
  22637. oldVm._data.$$state = null;
  22638. });
  22639. }
  22640. Vue.nextTick(function () { return oldVm.$destroy(); });
  22641. }
  22642. }
  22643. function installModule (store, rootState, path, module, hot) {
  22644. var isRoot = !path.length;
  22645. var namespace = store._modules.getNamespace(path);
  22646. // register in namespace map
  22647. if (module.namespaced) {
  22648. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  22649. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  22650. }
  22651. store._modulesNamespaceMap[namespace] = module;
  22652. }
  22653. // set state
  22654. if (!isRoot && !hot) {
  22655. var parentState = getNestedState(rootState, path.slice(0, -1));
  22656. var moduleName = path[path.length - 1];
  22657. store._withCommit(function () {
  22658. if ((true)) {
  22659. if (moduleName in parentState) {
  22660. console.warn(
  22661. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  22662. );
  22663. }
  22664. }
  22665. Vue.set(parentState, moduleName, module.state);
  22666. });
  22667. }
  22668. var local = module.context = makeLocalContext(store, namespace, path);
  22669. module.forEachMutation(function (mutation, key) {
  22670. var namespacedType = namespace + key;
  22671. registerMutation(store, namespacedType, mutation, local);
  22672. });
  22673. module.forEachAction(function (action, key) {
  22674. var type = action.root ? key : namespace + key;
  22675. var handler = action.handler || action;
  22676. registerAction(store, type, handler, local);
  22677. });
  22678. module.forEachGetter(function (getter, key) {
  22679. var namespacedType = namespace + key;
  22680. registerGetter(store, namespacedType, getter, local);
  22681. });
  22682. module.forEachChild(function (child, key) {
  22683. installModule(store, rootState, path.concat(key), child, hot);
  22684. });
  22685. }
  22686. /**
  22687. * make localized dispatch, commit, getters and state
  22688. * if there is no namespace, just use root ones
  22689. */
  22690. function makeLocalContext (store, namespace, path) {
  22691. var noNamespace = namespace === '';
  22692. var local = {
  22693. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  22694. var args = unifyObjectStyle(_type, _payload, _options);
  22695. var payload = args.payload;
  22696. var options = args.options;
  22697. var type = args.type;
  22698. if (!options || !options.root) {
  22699. type = namespace + type;
  22700. if (( true) && !store._actions[type]) {
  22701. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  22702. return
  22703. }
  22704. }
  22705. return store.dispatch(type, payload)
  22706. },
  22707. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  22708. var args = unifyObjectStyle(_type, _payload, _options);
  22709. var payload = args.payload;
  22710. var options = args.options;
  22711. var type = args.type;
  22712. if (!options || !options.root) {
  22713. type = namespace + type;
  22714. if (( true) && !store._mutations[type]) {
  22715. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  22716. return
  22717. }
  22718. }
  22719. store.commit(type, payload, options);
  22720. }
  22721. };
  22722. // getters and state object must be gotten lazily
  22723. // because they will be changed by vm update
  22724. Object.defineProperties(local, {
  22725. getters: {
  22726. get: noNamespace
  22727. ? function () { return store.getters; }
  22728. : function () { return makeLocalGetters(store, namespace); }
  22729. },
  22730. state: {
  22731. get: function () { return getNestedState(store.state, path); }
  22732. }
  22733. });
  22734. return local
  22735. }
  22736. function makeLocalGetters (store, namespace) {
  22737. if (!store._makeLocalGettersCache[namespace]) {
  22738. var gettersProxy = {};
  22739. var splitPos = namespace.length;
  22740. Object.keys(store.getters).forEach(function (type) {
  22741. // skip if the target getter is not match this namespace
  22742. if (type.slice(0, splitPos) !== namespace) { return }
  22743. // extract local getter type
  22744. var localType = type.slice(splitPos);
  22745. // Add a port to the getters proxy.
  22746. // Define as getter property because
  22747. // we do not want to evaluate the getters in this time.
  22748. Object.defineProperty(gettersProxy, localType, {
  22749. get: function () { return store.getters[type]; },
  22750. enumerable: true
  22751. });
  22752. });
  22753. store._makeLocalGettersCache[namespace] = gettersProxy;
  22754. }
  22755. return store._makeLocalGettersCache[namespace]
  22756. }
  22757. function registerMutation (store, type, handler, local) {
  22758. var entry = store._mutations[type] || (store._mutations[type] = []);
  22759. entry.push(function wrappedMutationHandler (payload) {
  22760. handler.call(store, local.state, payload);
  22761. });
  22762. }
  22763. function registerAction (store, type, handler, local) {
  22764. var entry = store._actions[type] || (store._actions[type] = []);
  22765. entry.push(function wrappedActionHandler (payload) {
  22766. var res = handler.call(store, {
  22767. dispatch: local.dispatch,
  22768. commit: local.commit,
  22769. getters: local.getters,
  22770. state: local.state,
  22771. rootGetters: store.getters,
  22772. rootState: store.state
  22773. }, payload);
  22774. if (!isPromise(res)) {
  22775. res = Promise.resolve(res);
  22776. }
  22777. if (store._devtoolHook) {
  22778. return res.catch(function (err) {
  22779. store._devtoolHook.emit('vuex:error', err);
  22780. throw err
  22781. })
  22782. } else {
  22783. return res
  22784. }
  22785. });
  22786. }
  22787. function registerGetter (store, type, rawGetter, local) {
  22788. if (store._wrappedGetters[type]) {
  22789. if ((true)) {
  22790. console.error(("[vuex] duplicate getter key: " + type));
  22791. }
  22792. return
  22793. }
  22794. store._wrappedGetters[type] = function wrappedGetter (store) {
  22795. return rawGetter(
  22796. local.state, // local state
  22797. local.getters, // local getters
  22798. store.state, // root state
  22799. store.getters // root getters
  22800. )
  22801. };
  22802. }
  22803. function enableStrictMode (store) {
  22804. store._vm.$watch(function () { return this._data.$$state }, function () {
  22805. if ((true)) {
  22806. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  22807. }
  22808. }, { deep: true, sync: true });
  22809. }
  22810. function getNestedState (state, path) {
  22811. return path.reduce(function (state, key) { return state[key]; }, state)
  22812. }
  22813. function unifyObjectStyle (type, payload, options) {
  22814. if (isObject(type) && type.type) {
  22815. options = payload;
  22816. payload = type;
  22817. type = type.type;
  22818. }
  22819. if ((true)) {
  22820. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  22821. }
  22822. return { type: type, payload: payload, options: options }
  22823. }
  22824. function install (_Vue) {
  22825. if (Vue && _Vue === Vue) {
  22826. if ((true)) {
  22827. console.error(
  22828. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  22829. );
  22830. }
  22831. return
  22832. }
  22833. Vue = _Vue;
  22834. applyMixin(Vue);
  22835. }
  22836. /**
  22837. * Reduce the code which written in Vue.js for getting the state.
  22838. * @param {String} [namespace] - Module's namespace
  22839. * @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.
  22840. * @param {Object}
  22841. */
  22842. var mapState = normalizeNamespace(function (namespace, states) {
  22843. var res = {};
  22844. if (( true) && !isValidMap(states)) {
  22845. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  22846. }
  22847. normalizeMap(states).forEach(function (ref) {
  22848. var key = ref.key;
  22849. var val = ref.val;
  22850. res[key] = function mappedState () {
  22851. var state = this.$store.state;
  22852. var getters = this.$store.getters;
  22853. if (namespace) {
  22854. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  22855. if (!module) {
  22856. return
  22857. }
  22858. state = module.context.state;
  22859. getters = module.context.getters;
  22860. }
  22861. return typeof val === 'function'
  22862. ? val.call(this, state, getters)
  22863. : state[val]
  22864. };
  22865. // mark vuex getter for devtools
  22866. res[key].vuex = true;
  22867. });
  22868. return res
  22869. });
  22870. /**
  22871. * Reduce the code which written in Vue.js for committing the mutation
  22872. * @param {String} [namespace] - Module's namespace
  22873. * @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.
  22874. * @return {Object}
  22875. */
  22876. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  22877. var res = {};
  22878. if (( true) && !isValidMap(mutations)) {
  22879. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  22880. }
  22881. normalizeMap(mutations).forEach(function (ref) {
  22882. var key = ref.key;
  22883. var val = ref.val;
  22884. res[key] = function mappedMutation () {
  22885. var args = [], len = arguments.length;
  22886. while ( len-- ) args[ len ] = arguments[ len ];
  22887. // Get the commit method from store
  22888. var commit = this.$store.commit;
  22889. if (namespace) {
  22890. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  22891. if (!module) {
  22892. return
  22893. }
  22894. commit = module.context.commit;
  22895. }
  22896. return typeof val === 'function'
  22897. ? val.apply(this, [commit].concat(args))
  22898. : commit.apply(this.$store, [val].concat(args))
  22899. };
  22900. });
  22901. return res
  22902. });
  22903. /**
  22904. * Reduce the code which written in Vue.js for getting the getters
  22905. * @param {String} [namespace] - Module's namespace
  22906. * @param {Object|Array} getters
  22907. * @return {Object}
  22908. */
  22909. var mapGetters = normalizeNamespace(function (namespace, getters) {
  22910. var res = {};
  22911. if (( true) && !isValidMap(getters)) {
  22912. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  22913. }
  22914. normalizeMap(getters).forEach(function (ref) {
  22915. var key = ref.key;
  22916. var val = ref.val;
  22917. // The namespace has been mutated by normalizeNamespace
  22918. val = namespace + val;
  22919. res[key] = function mappedGetter () {
  22920. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  22921. return
  22922. }
  22923. if (( true) && !(val in this.$store.getters)) {
  22924. console.error(("[vuex] unknown getter: " + val));
  22925. return
  22926. }
  22927. return this.$store.getters[val]
  22928. };
  22929. // mark vuex getter for devtools
  22930. res[key].vuex = true;
  22931. });
  22932. return res
  22933. });
  22934. /**
  22935. * Reduce the code which written in Vue.js for dispatch the action
  22936. * @param {String} [namespace] - Module's namespace
  22937. * @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.
  22938. * @return {Object}
  22939. */
  22940. var mapActions = normalizeNamespace(function (namespace, actions) {
  22941. var res = {};
  22942. if (( true) && !isValidMap(actions)) {
  22943. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  22944. }
  22945. normalizeMap(actions).forEach(function (ref) {
  22946. var key = ref.key;
  22947. var val = ref.val;
  22948. res[key] = function mappedAction () {
  22949. var args = [], len = arguments.length;
  22950. while ( len-- ) args[ len ] = arguments[ len ];
  22951. // get dispatch function from store
  22952. var dispatch = this.$store.dispatch;
  22953. if (namespace) {
  22954. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  22955. if (!module) {
  22956. return
  22957. }
  22958. dispatch = module.context.dispatch;
  22959. }
  22960. return typeof val === 'function'
  22961. ? val.apply(this, [dispatch].concat(args))
  22962. : dispatch.apply(this.$store, [val].concat(args))
  22963. };
  22964. });
  22965. return res
  22966. });
  22967. /**
  22968. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  22969. * @param {String} namespace
  22970. * @return {Object}
  22971. */
  22972. var createNamespacedHelpers = function (namespace) { return ({
  22973. mapState: mapState.bind(null, namespace),
  22974. mapGetters: mapGetters.bind(null, namespace),
  22975. mapMutations: mapMutations.bind(null, namespace),
  22976. mapActions: mapActions.bind(null, namespace)
  22977. }); };
  22978. /**
  22979. * Normalize the map
  22980. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  22981. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  22982. * @param {Array|Object} map
  22983. * @return {Object}
  22984. */
  22985. function normalizeMap (map) {
  22986. if (!isValidMap(map)) {
  22987. return []
  22988. }
  22989. return Array.isArray(map)
  22990. ? map.map(function (key) { return ({ key: key, val: key }); })
  22991. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  22992. }
  22993. /**
  22994. * Validate whether given map is valid or not
  22995. * @param {*} map
  22996. * @return {Boolean}
  22997. */
  22998. function isValidMap (map) {
  22999. return Array.isArray(map) || isObject(map)
  23000. }
  23001. /**
  23002. * 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.
  23003. * @param {Function} fn
  23004. * @return {Function}
  23005. */
  23006. function normalizeNamespace (fn) {
  23007. return function (namespace, map) {
  23008. if (typeof namespace !== 'string') {
  23009. map = namespace;
  23010. namespace = '';
  23011. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  23012. namespace += '/';
  23013. }
  23014. return fn(namespace, map)
  23015. }
  23016. }
  23017. /**
  23018. * Search a special module from store by namespace. if module not exist, print error message.
  23019. * @param {Object} store
  23020. * @param {String} helper
  23021. * @param {String} namespace
  23022. * @return {Object}
  23023. */
  23024. function getModuleByNamespace (store, helper, namespace) {
  23025. var module = store._modulesNamespaceMap[namespace];
  23026. if (( true) && !module) {
  23027. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  23028. }
  23029. return module
  23030. }
  23031. // Credits: borrowed code from fcomb/redux-logger
  23032. function createLogger (ref) {
  23033. if ( ref === void 0 ) ref = {};
  23034. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  23035. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  23036. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  23037. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  23038. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  23039. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  23040. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  23041. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  23042. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  23043. return function (store) {
  23044. var prevState = deepCopy(store.state);
  23045. if (typeof logger === 'undefined') {
  23046. return
  23047. }
  23048. if (logMutations) {
  23049. store.subscribe(function (mutation, state) {
  23050. var nextState = deepCopy(state);
  23051. if (filter(mutation, prevState, nextState)) {
  23052. var formattedTime = getFormattedTime();
  23053. var formattedMutation = mutationTransformer(mutation);
  23054. var message = "mutation " + (mutation.type) + formattedTime;
  23055. startMessage(logger, message, collapsed);
  23056. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  23057. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  23058. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  23059. endMessage(logger);
  23060. }
  23061. prevState = nextState;
  23062. });
  23063. }
  23064. if (logActions) {
  23065. store.subscribeAction(function (action, state) {
  23066. if (actionFilter(action, state)) {
  23067. var formattedTime = getFormattedTime();
  23068. var formattedAction = actionTransformer(action);
  23069. var message = "action " + (action.type) + formattedTime;
  23070. startMessage(logger, message, collapsed);
  23071. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  23072. endMessage(logger);
  23073. }
  23074. });
  23075. }
  23076. }
  23077. }
  23078. function startMessage (logger, message, collapsed) {
  23079. var startMessage = collapsed
  23080. ? logger.groupCollapsed
  23081. : logger.group;
  23082. // render
  23083. try {
  23084. startMessage.call(logger, message);
  23085. } catch (e) {
  23086. logger.log(message);
  23087. }
  23088. }
  23089. function endMessage (logger) {
  23090. try {
  23091. logger.groupEnd();
  23092. } catch (e) {
  23093. logger.log('—— log end ——');
  23094. }
  23095. }
  23096. function getFormattedTime () {
  23097. var time = new Date();
  23098. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  23099. }
  23100. function repeat (str, times) {
  23101. return (new Array(times + 1)).join(str)
  23102. }
  23103. function pad (num, maxLength) {
  23104. return repeat('0', maxLength - num.toString().length) + num
  23105. }
  23106. var index_cjs = {
  23107. Store: Store,
  23108. install: install,
  23109. version: '3.6.2',
  23110. mapState: mapState,
  23111. mapMutations: mapMutations,
  23112. mapGetters: mapGetters,
  23113. mapActions: mapActions,
  23114. createNamespacedHelpers: createNamespacedHelpers,
  23115. createLogger: createLogger
  23116. };
  23117. module.exports = index_cjs;
  23118. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  23119. /***/ })
  23120. }]);
  23121. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map