vendor.js 753 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616
  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.8.7",
  1352. uniRuntimeVersion: "3.8.7",
  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({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","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. /***/ 25:
  3676. /*!******************************************************************************************!*\
  3677. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3678. \******************************************************************************************/
  3679. /*! exports provided: default */
  3680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3681. "use strict";
  3682. __webpack_require__.r(__webpack_exports__);
  3683. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3684. * Vue.js v2.6.11
  3685. * (c) 2014-2023 Evan You
  3686. * Released under the MIT License.
  3687. */
  3688. /* */
  3689. var emptyObject = Object.freeze({});
  3690. // These helpers produce better VM code in JS engines due to their
  3691. // explicitness and function inlining.
  3692. function isUndef (v) {
  3693. return v === undefined || v === null
  3694. }
  3695. function isDef (v) {
  3696. return v !== undefined && v !== null
  3697. }
  3698. function isTrue (v) {
  3699. return v === true
  3700. }
  3701. function isFalse (v) {
  3702. return v === false
  3703. }
  3704. /**
  3705. * Check if value is primitive.
  3706. */
  3707. function isPrimitive (value) {
  3708. return (
  3709. typeof value === 'string' ||
  3710. typeof value === 'number' ||
  3711. // $flow-disable-line
  3712. typeof value === 'symbol' ||
  3713. typeof value === 'boolean'
  3714. )
  3715. }
  3716. /**
  3717. * Quick object check - this is primarily used to tell
  3718. * Objects from primitive values when we know the value
  3719. * is a JSON-compliant type.
  3720. */
  3721. function isObject (obj) {
  3722. return obj !== null && typeof obj === 'object'
  3723. }
  3724. /**
  3725. * Get the raw type string of a value, e.g., [object Object].
  3726. */
  3727. var _toString = Object.prototype.toString;
  3728. function toRawType (value) {
  3729. return _toString.call(value).slice(8, -1)
  3730. }
  3731. /**
  3732. * Strict object type check. Only returns true
  3733. * for plain JavaScript objects.
  3734. */
  3735. function isPlainObject (obj) {
  3736. return _toString.call(obj) === '[object Object]'
  3737. }
  3738. function isRegExp (v) {
  3739. return _toString.call(v) === '[object RegExp]'
  3740. }
  3741. /**
  3742. * Check if val is a valid array index.
  3743. */
  3744. function isValidArrayIndex (val) {
  3745. var n = parseFloat(String(val));
  3746. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3747. }
  3748. function isPromise (val) {
  3749. return (
  3750. isDef(val) &&
  3751. typeof val.then === 'function' &&
  3752. typeof val.catch === 'function'
  3753. )
  3754. }
  3755. /**
  3756. * Convert a value to a string that is actually rendered.
  3757. */
  3758. function toString (val) {
  3759. return val == null
  3760. ? ''
  3761. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3762. ? JSON.stringify(val, null, 2)
  3763. : String(val)
  3764. }
  3765. /**
  3766. * Convert an input value to a number for persistence.
  3767. * If the conversion fails, return original string.
  3768. */
  3769. function toNumber (val) {
  3770. var n = parseFloat(val);
  3771. return isNaN(n) ? val : n
  3772. }
  3773. /**
  3774. * Make a map and return a function for checking if a key
  3775. * is in that map.
  3776. */
  3777. function makeMap (
  3778. str,
  3779. expectsLowerCase
  3780. ) {
  3781. var map = Object.create(null);
  3782. var list = str.split(',');
  3783. for (var i = 0; i < list.length; i++) {
  3784. map[list[i]] = true;
  3785. }
  3786. return expectsLowerCase
  3787. ? function (val) { return map[val.toLowerCase()]; }
  3788. : function (val) { return map[val]; }
  3789. }
  3790. /**
  3791. * Check if a tag is a built-in tag.
  3792. */
  3793. var isBuiltInTag = makeMap('slot,component', true);
  3794. /**
  3795. * Check if an attribute is a reserved attribute.
  3796. */
  3797. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3798. /**
  3799. * Remove an item from an array.
  3800. */
  3801. function remove (arr, item) {
  3802. if (arr.length) {
  3803. var index = arr.indexOf(item);
  3804. if (index > -1) {
  3805. return arr.splice(index, 1)
  3806. }
  3807. }
  3808. }
  3809. /**
  3810. * Check whether an object has the property.
  3811. */
  3812. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3813. function hasOwn (obj, key) {
  3814. return hasOwnProperty.call(obj, key)
  3815. }
  3816. /**
  3817. * Create a cached version of a pure function.
  3818. */
  3819. function cached (fn) {
  3820. var cache = Object.create(null);
  3821. return (function cachedFn (str) {
  3822. var hit = cache[str];
  3823. return hit || (cache[str] = fn(str))
  3824. })
  3825. }
  3826. /**
  3827. * Camelize a hyphen-delimited string.
  3828. */
  3829. var camelizeRE = /-(\w)/g;
  3830. var camelize = cached(function (str) {
  3831. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3832. });
  3833. /**
  3834. * Capitalize a string.
  3835. */
  3836. var capitalize = cached(function (str) {
  3837. return str.charAt(0).toUpperCase() + str.slice(1)
  3838. });
  3839. /**
  3840. * Hyphenate a camelCase string.
  3841. */
  3842. var hyphenateRE = /\B([A-Z])/g;
  3843. var hyphenate = cached(function (str) {
  3844. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3845. });
  3846. /**
  3847. * Simple bind polyfill for environments that do not support it,
  3848. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3849. * since native bind is now performant enough in most browsers.
  3850. * But removing it would mean breaking code that was able to run in
  3851. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3852. */
  3853. /* istanbul ignore next */
  3854. function polyfillBind (fn, ctx) {
  3855. function boundFn (a) {
  3856. var l = arguments.length;
  3857. return l
  3858. ? l > 1
  3859. ? fn.apply(ctx, arguments)
  3860. : fn.call(ctx, a)
  3861. : fn.call(ctx)
  3862. }
  3863. boundFn._length = fn.length;
  3864. return boundFn
  3865. }
  3866. function nativeBind (fn, ctx) {
  3867. return fn.bind(ctx)
  3868. }
  3869. var bind = Function.prototype.bind
  3870. ? nativeBind
  3871. : polyfillBind;
  3872. /**
  3873. * Convert an Array-like object to a real Array.
  3874. */
  3875. function toArray (list, start) {
  3876. start = start || 0;
  3877. var i = list.length - start;
  3878. var ret = new Array(i);
  3879. while (i--) {
  3880. ret[i] = list[i + start];
  3881. }
  3882. return ret
  3883. }
  3884. /**
  3885. * Mix properties into target object.
  3886. */
  3887. function extend (to, _from) {
  3888. for (var key in _from) {
  3889. to[key] = _from[key];
  3890. }
  3891. return to
  3892. }
  3893. /**
  3894. * Merge an Array of Objects into a single Object.
  3895. */
  3896. function toObject (arr) {
  3897. var res = {};
  3898. for (var i = 0; i < arr.length; i++) {
  3899. if (arr[i]) {
  3900. extend(res, arr[i]);
  3901. }
  3902. }
  3903. return res
  3904. }
  3905. /* eslint-disable no-unused-vars */
  3906. /**
  3907. * Perform no operation.
  3908. * Stubbing args to make Flow happy without leaving useless transpiled code
  3909. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3910. */
  3911. function noop (a, b, c) {}
  3912. /**
  3913. * Always return false.
  3914. */
  3915. var no = function (a, b, c) { return false; };
  3916. /* eslint-enable no-unused-vars */
  3917. /**
  3918. * Return the same value.
  3919. */
  3920. var identity = function (_) { return _; };
  3921. /**
  3922. * Check if two values are loosely equal - that is,
  3923. * if they are plain objects, do they have the same shape?
  3924. */
  3925. function looseEqual (a, b) {
  3926. if (a === b) { return true }
  3927. var isObjectA = isObject(a);
  3928. var isObjectB = isObject(b);
  3929. if (isObjectA && isObjectB) {
  3930. try {
  3931. var isArrayA = Array.isArray(a);
  3932. var isArrayB = Array.isArray(b);
  3933. if (isArrayA && isArrayB) {
  3934. return a.length === b.length && a.every(function (e, i) {
  3935. return looseEqual(e, b[i])
  3936. })
  3937. } else if (a instanceof Date && b instanceof Date) {
  3938. return a.getTime() === b.getTime()
  3939. } else if (!isArrayA && !isArrayB) {
  3940. var keysA = Object.keys(a);
  3941. var keysB = Object.keys(b);
  3942. return keysA.length === keysB.length && keysA.every(function (key) {
  3943. return looseEqual(a[key], b[key])
  3944. })
  3945. } else {
  3946. /* istanbul ignore next */
  3947. return false
  3948. }
  3949. } catch (e) {
  3950. /* istanbul ignore next */
  3951. return false
  3952. }
  3953. } else if (!isObjectA && !isObjectB) {
  3954. return String(a) === String(b)
  3955. } else {
  3956. return false
  3957. }
  3958. }
  3959. /**
  3960. * Return the first index at which a loosely equal value can be
  3961. * found in the array (if value is a plain object, the array must
  3962. * contain an object of the same shape), or -1 if it is not present.
  3963. */
  3964. function looseIndexOf (arr, val) {
  3965. for (var i = 0; i < arr.length; i++) {
  3966. if (looseEqual(arr[i], val)) { return i }
  3967. }
  3968. return -1
  3969. }
  3970. /**
  3971. * Ensure a function is called only once.
  3972. */
  3973. function once (fn) {
  3974. var called = false;
  3975. return function () {
  3976. if (!called) {
  3977. called = true;
  3978. fn.apply(this, arguments);
  3979. }
  3980. }
  3981. }
  3982. var ASSET_TYPES = [
  3983. 'component',
  3984. 'directive',
  3985. 'filter'
  3986. ];
  3987. var LIFECYCLE_HOOKS = [
  3988. 'beforeCreate',
  3989. 'created',
  3990. 'beforeMount',
  3991. 'mounted',
  3992. 'beforeUpdate',
  3993. 'updated',
  3994. 'beforeDestroy',
  3995. 'destroyed',
  3996. 'activated',
  3997. 'deactivated',
  3998. 'errorCaptured',
  3999. 'serverPrefetch'
  4000. ];
  4001. /* */
  4002. var config = ({
  4003. /**
  4004. * Option merge strategies (used in core/util/options)
  4005. */
  4006. // $flow-disable-line
  4007. optionMergeStrategies: Object.create(null),
  4008. /**
  4009. * Whether to suppress warnings.
  4010. */
  4011. silent: false,
  4012. /**
  4013. * Show production mode tip message on boot?
  4014. */
  4015. productionTip: "development" !== 'production',
  4016. /**
  4017. * Whether to enable devtools
  4018. */
  4019. devtools: "development" !== 'production',
  4020. /**
  4021. * Whether to record perf
  4022. */
  4023. performance: false,
  4024. /**
  4025. * Error handler for watcher errors
  4026. */
  4027. errorHandler: null,
  4028. /**
  4029. * Warn handler for watcher warns
  4030. */
  4031. warnHandler: null,
  4032. /**
  4033. * Ignore certain custom elements
  4034. */
  4035. ignoredElements: [],
  4036. /**
  4037. * Custom user key aliases for v-on
  4038. */
  4039. // $flow-disable-line
  4040. keyCodes: Object.create(null),
  4041. /**
  4042. * Check if a tag is reserved so that it cannot be registered as a
  4043. * component. This is platform-dependent and may be overwritten.
  4044. */
  4045. isReservedTag: no,
  4046. /**
  4047. * Check if an attribute is reserved so that it cannot be used as a component
  4048. * prop. This is platform-dependent and may be overwritten.
  4049. */
  4050. isReservedAttr: no,
  4051. /**
  4052. * Check if a tag is an unknown element.
  4053. * Platform-dependent.
  4054. */
  4055. isUnknownElement: no,
  4056. /**
  4057. * Get the namespace of an element
  4058. */
  4059. getTagNamespace: noop,
  4060. /**
  4061. * Parse the real tag name for the specific platform.
  4062. */
  4063. parsePlatformTagName: identity,
  4064. /**
  4065. * Check if an attribute must be bound using property, e.g. value
  4066. * Platform-dependent.
  4067. */
  4068. mustUseProp: no,
  4069. /**
  4070. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4071. * This will significantly reduce performance if set to false.
  4072. */
  4073. async: true,
  4074. /**
  4075. * Exposed for legacy reasons
  4076. */
  4077. _lifecycleHooks: LIFECYCLE_HOOKS
  4078. });
  4079. /* */
  4080. /**
  4081. * unicode letters used for parsing html tags, component names and property paths.
  4082. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4083. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4084. */
  4085. 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/;
  4086. /**
  4087. * Check if a string starts with $ or _
  4088. */
  4089. function isReserved (str) {
  4090. var c = (str + '').charCodeAt(0);
  4091. return c === 0x24 || c === 0x5F
  4092. }
  4093. /**
  4094. * Define a property.
  4095. */
  4096. function def (obj, key, val, enumerable) {
  4097. Object.defineProperty(obj, key, {
  4098. value: val,
  4099. enumerable: !!enumerable,
  4100. writable: true,
  4101. configurable: true
  4102. });
  4103. }
  4104. /**
  4105. * Parse simple path.
  4106. */
  4107. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4108. function parsePath (path) {
  4109. if (bailRE.test(path)) {
  4110. return
  4111. }
  4112. var segments = path.split('.');
  4113. return function (obj) {
  4114. for (var i = 0; i < segments.length; i++) {
  4115. if (!obj) { return }
  4116. obj = obj[segments[i]];
  4117. }
  4118. return obj
  4119. }
  4120. }
  4121. /* */
  4122. // can we use __proto__?
  4123. var hasProto = '__proto__' in {};
  4124. // Browser environment sniffing
  4125. var inBrowser = typeof window !== 'undefined';
  4126. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4127. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4128. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4129. var isIE = UA && /msie|trident/.test(UA);
  4130. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4131. var isEdge = UA && UA.indexOf('edge/') > 0;
  4132. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4133. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4134. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4135. var isPhantomJS = UA && /phantomjs/.test(UA);
  4136. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4137. // Firefox has a "watch" function on Object.prototype...
  4138. var nativeWatch = ({}).watch;
  4139. if (inBrowser) {
  4140. try {
  4141. var opts = {};
  4142. Object.defineProperty(opts, 'passive', ({
  4143. get: function get () {
  4144. }
  4145. })); // https://github.com/facebook/flow/issues/285
  4146. window.addEventListener('test-passive', null, opts);
  4147. } catch (e) {}
  4148. }
  4149. // this needs to be lazy-evaled because vue may be required before
  4150. // vue-server-renderer can set VUE_ENV
  4151. var _isServer;
  4152. var isServerRendering = function () {
  4153. if (_isServer === undefined) {
  4154. /* istanbul ignore if */
  4155. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4156. // detect presence of vue-server-renderer and avoid
  4157. // Webpack shimming the process
  4158. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4159. } else {
  4160. _isServer = false;
  4161. }
  4162. }
  4163. return _isServer
  4164. };
  4165. // detect devtools
  4166. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4167. /* istanbul ignore next */
  4168. function isNative (Ctor) {
  4169. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4170. }
  4171. var hasSymbol =
  4172. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4173. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4174. var _Set;
  4175. /* istanbul ignore if */ // $flow-disable-line
  4176. if (typeof Set !== 'undefined' && isNative(Set)) {
  4177. // use native Set when available.
  4178. _Set = Set;
  4179. } else {
  4180. // a non-standard Set polyfill that only works with primitive keys.
  4181. _Set = /*@__PURE__*/(function () {
  4182. function Set () {
  4183. this.set = Object.create(null);
  4184. }
  4185. Set.prototype.has = function has (key) {
  4186. return this.set[key] === true
  4187. };
  4188. Set.prototype.add = function add (key) {
  4189. this.set[key] = true;
  4190. };
  4191. Set.prototype.clear = function clear () {
  4192. this.set = Object.create(null);
  4193. };
  4194. return Set;
  4195. }());
  4196. }
  4197. /* */
  4198. var warn = noop;
  4199. var tip = noop;
  4200. var generateComponentTrace = (noop); // work around flow check
  4201. var formatComponentName = (noop);
  4202. if (true) {
  4203. var hasConsole = typeof console !== 'undefined';
  4204. var classifyRE = /(?:^|[-_])(\w)/g;
  4205. var classify = function (str) { return str
  4206. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4207. .replace(/[-_]/g, ''); };
  4208. warn = function (msg, vm) {
  4209. var trace = vm ? generateComponentTrace(vm) : '';
  4210. if (config.warnHandler) {
  4211. config.warnHandler.call(null, msg, vm, trace);
  4212. } else if (hasConsole && (!config.silent)) {
  4213. console.error(("[Vue warn]: " + msg + trace));
  4214. }
  4215. };
  4216. tip = function (msg, vm) {
  4217. if (hasConsole && (!config.silent)) {
  4218. console.warn("[Vue tip]: " + msg + (
  4219. vm ? generateComponentTrace(vm) : ''
  4220. ));
  4221. }
  4222. };
  4223. formatComponentName = function (vm, includeFile) {
  4224. if (vm.$root === vm) {
  4225. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4226. return ('') + vm.$options.__file
  4227. }
  4228. return '<Root>'
  4229. }
  4230. var options = typeof vm === 'function' && vm.cid != null
  4231. ? vm.options
  4232. : vm._isVue
  4233. ? vm.$options || vm.constructor.options
  4234. : vm;
  4235. var name = options.name || options._componentTag;
  4236. var file = options.__file;
  4237. if (!name && file) {
  4238. var match = file.match(/([^/\\]+)\.vue$/);
  4239. name = match && match[1];
  4240. }
  4241. return (
  4242. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4243. (file && includeFile !== false ? (" at " + file) : '')
  4244. )
  4245. };
  4246. var repeat = function (str, n) {
  4247. var res = '';
  4248. while (n) {
  4249. if (n % 2 === 1) { res += str; }
  4250. if (n > 1) { str += str; }
  4251. n >>= 1;
  4252. }
  4253. return res
  4254. };
  4255. generateComponentTrace = function (vm) {
  4256. if (vm._isVue && vm.$parent) {
  4257. var tree = [];
  4258. var currentRecursiveSequence = 0;
  4259. while (vm && vm.$options.name !== 'PageBody') {
  4260. if (tree.length > 0) {
  4261. var last = tree[tree.length - 1];
  4262. if (last.constructor === vm.constructor) {
  4263. currentRecursiveSequence++;
  4264. vm = vm.$parent;
  4265. continue
  4266. } else if (currentRecursiveSequence > 0) {
  4267. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4268. currentRecursiveSequence = 0;
  4269. }
  4270. }
  4271. !vm.$options.isReserved && tree.push(vm);
  4272. vm = vm.$parent;
  4273. }
  4274. return '\n\nfound in\n\n' + tree
  4275. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4276. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4277. : formatComponentName(vm))); })
  4278. .join('\n')
  4279. } else {
  4280. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4281. }
  4282. };
  4283. }
  4284. /* */
  4285. var uid = 0;
  4286. /**
  4287. * A dep is an observable that can have multiple
  4288. * directives subscribing to it.
  4289. */
  4290. var Dep = function Dep () {
  4291. this.id = uid++;
  4292. this.subs = [];
  4293. };
  4294. Dep.prototype.addSub = function addSub (sub) {
  4295. this.subs.push(sub);
  4296. };
  4297. Dep.prototype.removeSub = function removeSub (sub) {
  4298. remove(this.subs, sub);
  4299. };
  4300. Dep.prototype.depend = function depend () {
  4301. if (Dep.SharedObject.target) {
  4302. Dep.SharedObject.target.addDep(this);
  4303. }
  4304. };
  4305. Dep.prototype.notify = function notify () {
  4306. // stabilize the subscriber list first
  4307. var subs = this.subs.slice();
  4308. if ( true && !config.async) {
  4309. // subs aren't sorted in scheduler if not running async
  4310. // we need to sort them now to make sure they fire in correct
  4311. // order
  4312. subs.sort(function (a, b) { return a.id - b.id; });
  4313. }
  4314. for (var i = 0, l = subs.length; i < l; i++) {
  4315. subs[i].update();
  4316. }
  4317. };
  4318. // The current target watcher being evaluated.
  4319. // This is globally unique because only one watcher
  4320. // can be evaluated at a time.
  4321. // fixed by xxxxxx (nvue shared vuex)
  4322. /* eslint-disable no-undef */
  4323. Dep.SharedObject = {};
  4324. Dep.SharedObject.target = null;
  4325. Dep.SharedObject.targetStack = [];
  4326. function pushTarget (target) {
  4327. Dep.SharedObject.targetStack.push(target);
  4328. Dep.SharedObject.target = target;
  4329. Dep.target = target;
  4330. }
  4331. function popTarget () {
  4332. Dep.SharedObject.targetStack.pop();
  4333. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4334. Dep.target = Dep.SharedObject.target;
  4335. }
  4336. /* */
  4337. var VNode = function VNode (
  4338. tag,
  4339. data,
  4340. children,
  4341. text,
  4342. elm,
  4343. context,
  4344. componentOptions,
  4345. asyncFactory
  4346. ) {
  4347. this.tag = tag;
  4348. this.data = data;
  4349. this.children = children;
  4350. this.text = text;
  4351. this.elm = elm;
  4352. this.ns = undefined;
  4353. this.context = context;
  4354. this.fnContext = undefined;
  4355. this.fnOptions = undefined;
  4356. this.fnScopeId = undefined;
  4357. this.key = data && data.key;
  4358. this.componentOptions = componentOptions;
  4359. this.componentInstance = undefined;
  4360. this.parent = undefined;
  4361. this.raw = false;
  4362. this.isStatic = false;
  4363. this.isRootInsert = true;
  4364. this.isComment = false;
  4365. this.isCloned = false;
  4366. this.isOnce = false;
  4367. this.asyncFactory = asyncFactory;
  4368. this.asyncMeta = undefined;
  4369. this.isAsyncPlaceholder = false;
  4370. };
  4371. var prototypeAccessors = { child: { configurable: true } };
  4372. // DEPRECATED: alias for componentInstance for backwards compat.
  4373. /* istanbul ignore next */
  4374. prototypeAccessors.child.get = function () {
  4375. return this.componentInstance
  4376. };
  4377. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4378. var createEmptyVNode = function (text) {
  4379. if ( text === void 0 ) text = '';
  4380. var node = new VNode();
  4381. node.text = text;
  4382. node.isComment = true;
  4383. return node
  4384. };
  4385. function createTextVNode (val) {
  4386. return new VNode(undefined, undefined, undefined, String(val))
  4387. }
  4388. // optimized shallow clone
  4389. // used for static nodes and slot nodes because they may be reused across
  4390. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4391. // on their elm reference.
  4392. function cloneVNode (vnode) {
  4393. var cloned = new VNode(
  4394. vnode.tag,
  4395. vnode.data,
  4396. // #7975
  4397. // clone children array to avoid mutating original in case of cloning
  4398. // a child.
  4399. vnode.children && vnode.children.slice(),
  4400. vnode.text,
  4401. vnode.elm,
  4402. vnode.context,
  4403. vnode.componentOptions,
  4404. vnode.asyncFactory
  4405. );
  4406. cloned.ns = vnode.ns;
  4407. cloned.isStatic = vnode.isStatic;
  4408. cloned.key = vnode.key;
  4409. cloned.isComment = vnode.isComment;
  4410. cloned.fnContext = vnode.fnContext;
  4411. cloned.fnOptions = vnode.fnOptions;
  4412. cloned.fnScopeId = vnode.fnScopeId;
  4413. cloned.asyncMeta = vnode.asyncMeta;
  4414. cloned.isCloned = true;
  4415. return cloned
  4416. }
  4417. /*
  4418. * not type checking this file because flow doesn't play well with
  4419. * dynamically accessing methods on Array prototype
  4420. */
  4421. var arrayProto = Array.prototype;
  4422. var arrayMethods = Object.create(arrayProto);
  4423. var methodsToPatch = [
  4424. 'push',
  4425. 'pop',
  4426. 'shift',
  4427. 'unshift',
  4428. 'splice',
  4429. 'sort',
  4430. 'reverse'
  4431. ];
  4432. /**
  4433. * Intercept mutating methods and emit events
  4434. */
  4435. methodsToPatch.forEach(function (method) {
  4436. // cache original method
  4437. var original = arrayProto[method];
  4438. def(arrayMethods, method, function mutator () {
  4439. var args = [], len = arguments.length;
  4440. while ( len-- ) args[ len ] = arguments[ len ];
  4441. var result = original.apply(this, args);
  4442. var ob = this.__ob__;
  4443. var inserted;
  4444. switch (method) {
  4445. case 'push':
  4446. case 'unshift':
  4447. inserted = args;
  4448. break
  4449. case 'splice':
  4450. inserted = args.slice(2);
  4451. break
  4452. }
  4453. if (inserted) { ob.observeArray(inserted); }
  4454. // notify change
  4455. ob.dep.notify();
  4456. return result
  4457. });
  4458. });
  4459. /* */
  4460. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4461. /**
  4462. * In some cases we may want to disable observation inside a component's
  4463. * update computation.
  4464. */
  4465. var shouldObserve = true;
  4466. function toggleObserving (value) {
  4467. shouldObserve = value;
  4468. }
  4469. /**
  4470. * Observer class that is attached to each observed
  4471. * object. Once attached, the observer converts the target
  4472. * object's property keys into getter/setters that
  4473. * collect dependencies and dispatch updates.
  4474. */
  4475. var Observer = function Observer (value) {
  4476. this.value = value;
  4477. this.dep = new Dep();
  4478. this.vmCount = 0;
  4479. def(value, '__ob__', this);
  4480. if (Array.isArray(value)) {
  4481. if (hasProto) {
  4482. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4483. if(value.push !== value.__proto__.push){
  4484. copyAugment(value, arrayMethods, arrayKeys);
  4485. } else {
  4486. protoAugment(value, arrayMethods);
  4487. }
  4488. }
  4489. } else {
  4490. copyAugment(value, arrayMethods, arrayKeys);
  4491. }
  4492. this.observeArray(value);
  4493. } else {
  4494. this.walk(value);
  4495. }
  4496. };
  4497. /**
  4498. * Walk through all properties and convert them into
  4499. * getter/setters. This method should only be called when
  4500. * value type is Object.
  4501. */
  4502. Observer.prototype.walk = function walk (obj) {
  4503. var keys = Object.keys(obj);
  4504. for (var i = 0; i < keys.length; i++) {
  4505. defineReactive$$1(obj, keys[i]);
  4506. }
  4507. };
  4508. /**
  4509. * Observe a list of Array items.
  4510. */
  4511. Observer.prototype.observeArray = function observeArray (items) {
  4512. for (var i = 0, l = items.length; i < l; i++) {
  4513. observe(items[i]);
  4514. }
  4515. };
  4516. // helpers
  4517. /**
  4518. * Augment a target Object or Array by intercepting
  4519. * the prototype chain using __proto__
  4520. */
  4521. function protoAugment (target, src) {
  4522. /* eslint-disable no-proto */
  4523. target.__proto__ = src;
  4524. /* eslint-enable no-proto */
  4525. }
  4526. /**
  4527. * Augment a target Object or Array by defining
  4528. * hidden properties.
  4529. */
  4530. /* istanbul ignore next */
  4531. function copyAugment (target, src, keys) {
  4532. for (var i = 0, l = keys.length; i < l; i++) {
  4533. var key = keys[i];
  4534. def(target, key, src[key]);
  4535. }
  4536. }
  4537. /**
  4538. * Attempt to create an observer instance for a value,
  4539. * returns the new observer if successfully observed,
  4540. * or the existing observer if the value already has one.
  4541. */
  4542. function observe (value, asRootData) {
  4543. if (!isObject(value) || value instanceof VNode) {
  4544. return
  4545. }
  4546. var ob;
  4547. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4548. ob = value.__ob__;
  4549. } else if (
  4550. shouldObserve &&
  4551. !isServerRendering() &&
  4552. (Array.isArray(value) || isPlainObject(value)) &&
  4553. Object.isExtensible(value) &&
  4554. !value._isVue &&
  4555. !value.__v_isMPComponent
  4556. ) {
  4557. ob = new Observer(value);
  4558. }
  4559. if (asRootData && ob) {
  4560. ob.vmCount++;
  4561. }
  4562. return ob
  4563. }
  4564. /**
  4565. * Define a reactive property on an Object.
  4566. */
  4567. function defineReactive$$1 (
  4568. obj,
  4569. key,
  4570. val,
  4571. customSetter,
  4572. shallow
  4573. ) {
  4574. var dep = new Dep();
  4575. var property = Object.getOwnPropertyDescriptor(obj, key);
  4576. if (property && property.configurable === false) {
  4577. return
  4578. }
  4579. // cater for pre-defined getter/setters
  4580. var getter = property && property.get;
  4581. var setter = property && property.set;
  4582. if ((!getter || setter) && arguments.length === 2) {
  4583. val = obj[key];
  4584. }
  4585. var childOb = !shallow && observe(val);
  4586. Object.defineProperty(obj, key, {
  4587. enumerable: true,
  4588. configurable: true,
  4589. get: function reactiveGetter () {
  4590. var value = getter ? getter.call(obj) : val;
  4591. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4592. dep.depend();
  4593. if (childOb) {
  4594. childOb.dep.depend();
  4595. if (Array.isArray(value)) {
  4596. dependArray(value);
  4597. }
  4598. }
  4599. }
  4600. return value
  4601. },
  4602. set: function reactiveSetter (newVal) {
  4603. var value = getter ? getter.call(obj) : val;
  4604. /* eslint-disable no-self-compare */
  4605. if (newVal === value || (newVal !== newVal && value !== value)) {
  4606. return
  4607. }
  4608. /* eslint-enable no-self-compare */
  4609. if ( true && customSetter) {
  4610. customSetter();
  4611. }
  4612. // #7981: for accessor properties without setter
  4613. if (getter && !setter) { return }
  4614. if (setter) {
  4615. setter.call(obj, newVal);
  4616. } else {
  4617. val = newVal;
  4618. }
  4619. childOb = !shallow && observe(newVal);
  4620. dep.notify();
  4621. }
  4622. });
  4623. }
  4624. /**
  4625. * Set a property on an object. Adds the new property and
  4626. * triggers change notification if the property doesn't
  4627. * already exist.
  4628. */
  4629. function set (target, key, val) {
  4630. if ( true &&
  4631. (isUndef(target) || isPrimitive(target))
  4632. ) {
  4633. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4634. }
  4635. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4636. target.length = Math.max(target.length, key);
  4637. target.splice(key, 1, val);
  4638. return val
  4639. }
  4640. if (key in target && !(key in Object.prototype)) {
  4641. target[key] = val;
  4642. return val
  4643. }
  4644. var ob = (target).__ob__;
  4645. if (target._isVue || (ob && ob.vmCount)) {
  4646. true && warn(
  4647. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4648. 'at runtime - declare it upfront in the data option.'
  4649. );
  4650. return val
  4651. }
  4652. if (!ob) {
  4653. target[key] = val;
  4654. return val
  4655. }
  4656. defineReactive$$1(ob.value, key, val);
  4657. ob.dep.notify();
  4658. return val
  4659. }
  4660. /**
  4661. * Delete a property and trigger change if necessary.
  4662. */
  4663. function del (target, key) {
  4664. if ( true &&
  4665. (isUndef(target) || isPrimitive(target))
  4666. ) {
  4667. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4668. }
  4669. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4670. target.splice(key, 1);
  4671. return
  4672. }
  4673. var ob = (target).__ob__;
  4674. if (target._isVue || (ob && ob.vmCount)) {
  4675. true && warn(
  4676. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4677. '- just set it to null.'
  4678. );
  4679. return
  4680. }
  4681. if (!hasOwn(target, key)) {
  4682. return
  4683. }
  4684. delete target[key];
  4685. if (!ob) {
  4686. return
  4687. }
  4688. ob.dep.notify();
  4689. }
  4690. /**
  4691. * Collect dependencies on array elements when the array is touched, since
  4692. * we cannot intercept array element access like property getters.
  4693. */
  4694. function dependArray (value) {
  4695. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4696. e = value[i];
  4697. e && e.__ob__ && e.__ob__.dep.depend();
  4698. if (Array.isArray(e)) {
  4699. dependArray(e);
  4700. }
  4701. }
  4702. }
  4703. /* */
  4704. /**
  4705. * Option overwriting strategies are functions that handle
  4706. * how to merge a parent option value and a child option
  4707. * value into the final value.
  4708. */
  4709. var strats = config.optionMergeStrategies;
  4710. /**
  4711. * Options with restrictions
  4712. */
  4713. if (true) {
  4714. strats.el = strats.propsData = function (parent, child, vm, key) {
  4715. if (!vm) {
  4716. warn(
  4717. "option \"" + key + "\" can only be used during instance " +
  4718. 'creation with the `new` keyword.'
  4719. );
  4720. }
  4721. return defaultStrat(parent, child)
  4722. };
  4723. }
  4724. /**
  4725. * Helper that recursively merges two data objects together.
  4726. */
  4727. function mergeData (to, from) {
  4728. if (!from) { return to }
  4729. var key, toVal, fromVal;
  4730. var keys = hasSymbol
  4731. ? Reflect.ownKeys(from)
  4732. : Object.keys(from);
  4733. for (var i = 0; i < keys.length; i++) {
  4734. key = keys[i];
  4735. // in case the object is already observed...
  4736. if (key === '__ob__') { continue }
  4737. toVal = to[key];
  4738. fromVal = from[key];
  4739. if (!hasOwn(to, key)) {
  4740. set(to, key, fromVal);
  4741. } else if (
  4742. toVal !== fromVal &&
  4743. isPlainObject(toVal) &&
  4744. isPlainObject(fromVal)
  4745. ) {
  4746. mergeData(toVal, fromVal);
  4747. }
  4748. }
  4749. return to
  4750. }
  4751. /**
  4752. * Data
  4753. */
  4754. function mergeDataOrFn (
  4755. parentVal,
  4756. childVal,
  4757. vm
  4758. ) {
  4759. if (!vm) {
  4760. // in a Vue.extend merge, both should be functions
  4761. if (!childVal) {
  4762. return parentVal
  4763. }
  4764. if (!parentVal) {
  4765. return childVal
  4766. }
  4767. // when parentVal & childVal are both present,
  4768. // we need to return a function that returns the
  4769. // merged result of both functions... no need to
  4770. // check if parentVal is a function here because
  4771. // it has to be a function to pass previous merges.
  4772. return function mergedDataFn () {
  4773. return mergeData(
  4774. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4775. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4776. )
  4777. }
  4778. } else {
  4779. return function mergedInstanceDataFn () {
  4780. // instance merge
  4781. var instanceData = typeof childVal === 'function'
  4782. ? childVal.call(vm, vm)
  4783. : childVal;
  4784. var defaultData = typeof parentVal === 'function'
  4785. ? parentVal.call(vm, vm)
  4786. : parentVal;
  4787. if (instanceData) {
  4788. return mergeData(instanceData, defaultData)
  4789. } else {
  4790. return defaultData
  4791. }
  4792. }
  4793. }
  4794. }
  4795. strats.data = function (
  4796. parentVal,
  4797. childVal,
  4798. vm
  4799. ) {
  4800. if (!vm) {
  4801. if (childVal && typeof childVal !== 'function') {
  4802. true && warn(
  4803. 'The "data" option should be a function ' +
  4804. 'that returns a per-instance value in component ' +
  4805. 'definitions.',
  4806. vm
  4807. );
  4808. return parentVal
  4809. }
  4810. return mergeDataOrFn(parentVal, childVal)
  4811. }
  4812. return mergeDataOrFn(parentVal, childVal, vm)
  4813. };
  4814. /**
  4815. * Hooks and props are merged as arrays.
  4816. */
  4817. function mergeHook (
  4818. parentVal,
  4819. childVal
  4820. ) {
  4821. var res = childVal
  4822. ? parentVal
  4823. ? parentVal.concat(childVal)
  4824. : Array.isArray(childVal)
  4825. ? childVal
  4826. : [childVal]
  4827. : parentVal;
  4828. return res
  4829. ? dedupeHooks(res)
  4830. : res
  4831. }
  4832. function dedupeHooks (hooks) {
  4833. var res = [];
  4834. for (var i = 0; i < hooks.length; i++) {
  4835. if (res.indexOf(hooks[i]) === -1) {
  4836. res.push(hooks[i]);
  4837. }
  4838. }
  4839. return res
  4840. }
  4841. LIFECYCLE_HOOKS.forEach(function (hook) {
  4842. strats[hook] = mergeHook;
  4843. });
  4844. /**
  4845. * Assets
  4846. *
  4847. * When a vm is present (instance creation), we need to do
  4848. * a three-way merge between constructor options, instance
  4849. * options and parent options.
  4850. */
  4851. function mergeAssets (
  4852. parentVal,
  4853. childVal,
  4854. vm,
  4855. key
  4856. ) {
  4857. var res = Object.create(parentVal || null);
  4858. if (childVal) {
  4859. true && assertObjectType(key, childVal, vm);
  4860. return extend(res, childVal)
  4861. } else {
  4862. return res
  4863. }
  4864. }
  4865. ASSET_TYPES.forEach(function (type) {
  4866. strats[type + 's'] = mergeAssets;
  4867. });
  4868. /**
  4869. * Watchers.
  4870. *
  4871. * Watchers hashes should not overwrite one
  4872. * another, so we merge them as arrays.
  4873. */
  4874. strats.watch = function (
  4875. parentVal,
  4876. childVal,
  4877. vm,
  4878. key
  4879. ) {
  4880. // work around Firefox's Object.prototype.watch...
  4881. if (parentVal === nativeWatch) { parentVal = undefined; }
  4882. if (childVal === nativeWatch) { childVal = undefined; }
  4883. /* istanbul ignore if */
  4884. if (!childVal) { return Object.create(parentVal || null) }
  4885. if (true) {
  4886. assertObjectType(key, childVal, vm);
  4887. }
  4888. if (!parentVal) { return childVal }
  4889. var ret = {};
  4890. extend(ret, parentVal);
  4891. for (var key$1 in childVal) {
  4892. var parent = ret[key$1];
  4893. var child = childVal[key$1];
  4894. if (parent && !Array.isArray(parent)) {
  4895. parent = [parent];
  4896. }
  4897. ret[key$1] = parent
  4898. ? parent.concat(child)
  4899. : Array.isArray(child) ? child : [child];
  4900. }
  4901. return ret
  4902. };
  4903. /**
  4904. * Other object hashes.
  4905. */
  4906. strats.props =
  4907. strats.methods =
  4908. strats.inject =
  4909. strats.computed = function (
  4910. parentVal,
  4911. childVal,
  4912. vm,
  4913. key
  4914. ) {
  4915. if (childVal && "development" !== 'production') {
  4916. assertObjectType(key, childVal, vm);
  4917. }
  4918. if (!parentVal) { return childVal }
  4919. var ret = Object.create(null);
  4920. extend(ret, parentVal);
  4921. if (childVal) { extend(ret, childVal); }
  4922. return ret
  4923. };
  4924. strats.provide = mergeDataOrFn;
  4925. /**
  4926. * Default strategy.
  4927. */
  4928. var defaultStrat = function (parentVal, childVal) {
  4929. return childVal === undefined
  4930. ? parentVal
  4931. : childVal
  4932. };
  4933. /**
  4934. * Validate component names
  4935. */
  4936. function checkComponents (options) {
  4937. for (var key in options.components) {
  4938. validateComponentName(key);
  4939. }
  4940. }
  4941. function validateComponentName (name) {
  4942. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4943. warn(
  4944. 'Invalid component name: "' + name + '". Component names ' +
  4945. 'should conform to valid custom element name in html5 specification.'
  4946. );
  4947. }
  4948. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4949. warn(
  4950. 'Do not use built-in or reserved HTML elements as component ' +
  4951. 'id: ' + name
  4952. );
  4953. }
  4954. }
  4955. /**
  4956. * Ensure all props option syntax are normalized into the
  4957. * Object-based format.
  4958. */
  4959. function normalizeProps (options, vm) {
  4960. var props = options.props;
  4961. if (!props) { return }
  4962. var res = {};
  4963. var i, val, name;
  4964. if (Array.isArray(props)) {
  4965. i = props.length;
  4966. while (i--) {
  4967. val = props[i];
  4968. if (typeof val === 'string') {
  4969. name = camelize(val);
  4970. res[name] = { type: null };
  4971. } else if (true) {
  4972. warn('props must be strings when using array syntax.');
  4973. }
  4974. }
  4975. } else if (isPlainObject(props)) {
  4976. for (var key in props) {
  4977. val = props[key];
  4978. name = camelize(key);
  4979. res[name] = isPlainObject(val)
  4980. ? val
  4981. : { type: val };
  4982. }
  4983. } else if (true) {
  4984. warn(
  4985. "Invalid value for option \"props\": expected an Array or an Object, " +
  4986. "but got " + (toRawType(props)) + ".",
  4987. vm
  4988. );
  4989. }
  4990. options.props = res;
  4991. }
  4992. /**
  4993. * Normalize all injections into Object-based format
  4994. */
  4995. function normalizeInject (options, vm) {
  4996. var inject = options.inject;
  4997. if (!inject) { return }
  4998. var normalized = options.inject = {};
  4999. if (Array.isArray(inject)) {
  5000. for (var i = 0; i < inject.length; i++) {
  5001. normalized[inject[i]] = { from: inject[i] };
  5002. }
  5003. } else if (isPlainObject(inject)) {
  5004. for (var key in inject) {
  5005. var val = inject[key];
  5006. normalized[key] = isPlainObject(val)
  5007. ? extend({ from: key }, val)
  5008. : { from: val };
  5009. }
  5010. } else if (true) {
  5011. warn(
  5012. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5013. "but got " + (toRawType(inject)) + ".",
  5014. vm
  5015. );
  5016. }
  5017. }
  5018. /**
  5019. * Normalize raw function directives into object format.
  5020. */
  5021. function normalizeDirectives (options) {
  5022. var dirs = options.directives;
  5023. if (dirs) {
  5024. for (var key in dirs) {
  5025. var def$$1 = dirs[key];
  5026. if (typeof def$$1 === 'function') {
  5027. dirs[key] = { bind: def$$1, update: def$$1 };
  5028. }
  5029. }
  5030. }
  5031. }
  5032. function assertObjectType (name, value, vm) {
  5033. if (!isPlainObject(value)) {
  5034. warn(
  5035. "Invalid value for option \"" + name + "\": expected an Object, " +
  5036. "but got " + (toRawType(value)) + ".",
  5037. vm
  5038. );
  5039. }
  5040. }
  5041. /**
  5042. * Merge two option objects into a new one.
  5043. * Core utility used in both instantiation and inheritance.
  5044. */
  5045. function mergeOptions (
  5046. parent,
  5047. child,
  5048. vm
  5049. ) {
  5050. if (true) {
  5051. checkComponents(child);
  5052. }
  5053. if (typeof child === 'function') {
  5054. child = child.options;
  5055. }
  5056. normalizeProps(child, vm);
  5057. normalizeInject(child, vm);
  5058. normalizeDirectives(child);
  5059. // Apply extends and mixins on the child options,
  5060. // but only if it is a raw options object that isn't
  5061. // the result of another mergeOptions call.
  5062. // Only merged options has the _base property.
  5063. if (!child._base) {
  5064. if (child.extends) {
  5065. parent = mergeOptions(parent, child.extends, vm);
  5066. }
  5067. if (child.mixins) {
  5068. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5069. parent = mergeOptions(parent, child.mixins[i], vm);
  5070. }
  5071. }
  5072. }
  5073. var options = {};
  5074. var key;
  5075. for (key in parent) {
  5076. mergeField(key);
  5077. }
  5078. for (key in child) {
  5079. if (!hasOwn(parent, key)) {
  5080. mergeField(key);
  5081. }
  5082. }
  5083. function mergeField (key) {
  5084. var strat = strats[key] || defaultStrat;
  5085. options[key] = strat(parent[key], child[key], vm, key);
  5086. }
  5087. return options
  5088. }
  5089. /**
  5090. * Resolve an asset.
  5091. * This function is used because child instances need access
  5092. * to assets defined in its ancestor chain.
  5093. */
  5094. function resolveAsset (
  5095. options,
  5096. type,
  5097. id,
  5098. warnMissing
  5099. ) {
  5100. /* istanbul ignore if */
  5101. if (typeof id !== 'string') {
  5102. return
  5103. }
  5104. var assets = options[type];
  5105. // check local registration variations first
  5106. if (hasOwn(assets, id)) { return assets[id] }
  5107. var camelizedId = camelize(id);
  5108. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5109. var PascalCaseId = capitalize(camelizedId);
  5110. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5111. // fallback to prototype chain
  5112. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5113. if ( true && warnMissing && !res) {
  5114. warn(
  5115. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5116. options
  5117. );
  5118. }
  5119. return res
  5120. }
  5121. /* */
  5122. function validateProp (
  5123. key,
  5124. propOptions,
  5125. propsData,
  5126. vm
  5127. ) {
  5128. var prop = propOptions[key];
  5129. var absent = !hasOwn(propsData, key);
  5130. var value = propsData[key];
  5131. // boolean casting
  5132. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5133. if (booleanIndex > -1) {
  5134. if (absent && !hasOwn(prop, 'default')) {
  5135. value = false;
  5136. } else if (value === '' || value === hyphenate(key)) {
  5137. // only cast empty string / same name to boolean if
  5138. // boolean has higher priority
  5139. var stringIndex = getTypeIndex(String, prop.type);
  5140. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5141. value = true;
  5142. }
  5143. }
  5144. }
  5145. // check default value
  5146. if (value === undefined) {
  5147. value = getPropDefaultValue(vm, prop, key);
  5148. // since the default value is a fresh copy,
  5149. // make sure to observe it.
  5150. var prevShouldObserve = shouldObserve;
  5151. toggleObserving(true);
  5152. observe(value);
  5153. toggleObserving(prevShouldObserve);
  5154. }
  5155. if (
  5156. true
  5157. ) {
  5158. assertProp(prop, key, value, vm, absent);
  5159. }
  5160. return value
  5161. }
  5162. /**
  5163. * Get the default value of a prop.
  5164. */
  5165. function getPropDefaultValue (vm, prop, key) {
  5166. // no default, return undefined
  5167. if (!hasOwn(prop, 'default')) {
  5168. return undefined
  5169. }
  5170. var def = prop.default;
  5171. // warn against non-factory defaults for Object & Array
  5172. if ( true && isObject(def)) {
  5173. warn(
  5174. 'Invalid default value for prop "' + key + '": ' +
  5175. 'Props with type Object/Array must use a factory function ' +
  5176. 'to return the default value.',
  5177. vm
  5178. );
  5179. }
  5180. // the raw prop value was also undefined from previous render,
  5181. // return previous default value to avoid unnecessary watcher trigger
  5182. if (vm && vm.$options.propsData &&
  5183. vm.$options.propsData[key] === undefined &&
  5184. vm._props[key] !== undefined
  5185. ) {
  5186. return vm._props[key]
  5187. }
  5188. // call factory function for non-Function types
  5189. // a value is Function if its prototype is function even across different execution context
  5190. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5191. ? def.call(vm)
  5192. : def
  5193. }
  5194. /**
  5195. * Assert whether a prop is valid.
  5196. */
  5197. function assertProp (
  5198. prop,
  5199. name,
  5200. value,
  5201. vm,
  5202. absent
  5203. ) {
  5204. if (prop.required && absent) {
  5205. warn(
  5206. 'Missing required prop: "' + name + '"',
  5207. vm
  5208. );
  5209. return
  5210. }
  5211. if (value == null && !prop.required) {
  5212. return
  5213. }
  5214. var type = prop.type;
  5215. var valid = !type || type === true;
  5216. var expectedTypes = [];
  5217. if (type) {
  5218. if (!Array.isArray(type)) {
  5219. type = [type];
  5220. }
  5221. for (var i = 0; i < type.length && !valid; i++) {
  5222. var assertedType = assertType(value, type[i]);
  5223. expectedTypes.push(assertedType.expectedType || '');
  5224. valid = assertedType.valid;
  5225. }
  5226. }
  5227. if (!valid) {
  5228. warn(
  5229. getInvalidTypeMessage(name, value, expectedTypes),
  5230. vm
  5231. );
  5232. return
  5233. }
  5234. var validator = prop.validator;
  5235. if (validator) {
  5236. if (!validator(value)) {
  5237. warn(
  5238. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5239. vm
  5240. );
  5241. }
  5242. }
  5243. }
  5244. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5245. function assertType (value, type) {
  5246. var valid;
  5247. var expectedType = getType(type);
  5248. if (simpleCheckRE.test(expectedType)) {
  5249. var t = typeof value;
  5250. valid = t === expectedType.toLowerCase();
  5251. // for primitive wrapper objects
  5252. if (!valid && t === 'object') {
  5253. valid = value instanceof type;
  5254. }
  5255. } else if (expectedType === 'Object') {
  5256. valid = isPlainObject(value);
  5257. } else if (expectedType === 'Array') {
  5258. valid = Array.isArray(value);
  5259. } else {
  5260. valid = value instanceof type;
  5261. }
  5262. return {
  5263. valid: valid,
  5264. expectedType: expectedType
  5265. }
  5266. }
  5267. /**
  5268. * Use function string name to check built-in types,
  5269. * because a simple equality check will fail when running
  5270. * across different vms / iframes.
  5271. */
  5272. function getType (fn) {
  5273. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5274. return match ? match[1] : ''
  5275. }
  5276. function isSameType (a, b) {
  5277. return getType(a) === getType(b)
  5278. }
  5279. function getTypeIndex (type, expectedTypes) {
  5280. if (!Array.isArray(expectedTypes)) {
  5281. return isSameType(expectedTypes, type) ? 0 : -1
  5282. }
  5283. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5284. if (isSameType(expectedTypes[i], type)) {
  5285. return i
  5286. }
  5287. }
  5288. return -1
  5289. }
  5290. function getInvalidTypeMessage (name, value, expectedTypes) {
  5291. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5292. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5293. var expectedType = expectedTypes[0];
  5294. var receivedType = toRawType(value);
  5295. var expectedValue = styleValue(value, expectedType);
  5296. var receivedValue = styleValue(value, receivedType);
  5297. // check if we need to specify expected value
  5298. if (expectedTypes.length === 1 &&
  5299. isExplicable(expectedType) &&
  5300. !isBoolean(expectedType, receivedType)) {
  5301. message += " with value " + expectedValue;
  5302. }
  5303. message += ", got " + receivedType + " ";
  5304. // check if we need to specify received value
  5305. if (isExplicable(receivedType)) {
  5306. message += "with value " + receivedValue + ".";
  5307. }
  5308. return message
  5309. }
  5310. function styleValue (value, type) {
  5311. if (type === 'String') {
  5312. return ("\"" + value + "\"")
  5313. } else if (type === 'Number') {
  5314. return ("" + (Number(value)))
  5315. } else {
  5316. return ("" + value)
  5317. }
  5318. }
  5319. function isExplicable (value) {
  5320. var explicitTypes = ['string', 'number', 'boolean'];
  5321. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5322. }
  5323. function isBoolean () {
  5324. var args = [], len = arguments.length;
  5325. while ( len-- ) args[ len ] = arguments[ len ];
  5326. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5327. }
  5328. /* */
  5329. function handleError (err, vm, info) {
  5330. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5331. // See: https://github.com/vuejs/vuex/issues/1505
  5332. pushTarget();
  5333. try {
  5334. if (vm) {
  5335. var cur = vm;
  5336. while ((cur = cur.$parent)) {
  5337. var hooks = cur.$options.errorCaptured;
  5338. if (hooks) {
  5339. for (var i = 0; i < hooks.length; i++) {
  5340. try {
  5341. var capture = hooks[i].call(cur, err, vm, info) === false;
  5342. if (capture) { return }
  5343. } catch (e) {
  5344. globalHandleError(e, cur, 'errorCaptured hook');
  5345. }
  5346. }
  5347. }
  5348. }
  5349. }
  5350. globalHandleError(err, vm, info);
  5351. } finally {
  5352. popTarget();
  5353. }
  5354. }
  5355. function invokeWithErrorHandling (
  5356. handler,
  5357. context,
  5358. args,
  5359. vm,
  5360. info
  5361. ) {
  5362. var res;
  5363. try {
  5364. res = args ? handler.apply(context, args) : handler.call(context);
  5365. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5366. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5367. // issue #9511
  5368. // avoid catch triggering multiple times when nested calls
  5369. res._handled = true;
  5370. }
  5371. } catch (e) {
  5372. handleError(e, vm, info);
  5373. }
  5374. return res
  5375. }
  5376. function globalHandleError (err, vm, info) {
  5377. if (config.errorHandler) {
  5378. try {
  5379. return config.errorHandler.call(null, err, vm, info)
  5380. } catch (e) {
  5381. // if the user intentionally throws the original error in the handler,
  5382. // do not log it twice
  5383. if (e !== err) {
  5384. logError(e, null, 'config.errorHandler');
  5385. }
  5386. }
  5387. }
  5388. logError(err, vm, info);
  5389. }
  5390. function logError (err, vm, info) {
  5391. if (true) {
  5392. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5393. }
  5394. /* istanbul ignore else */
  5395. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5396. console.error(err);
  5397. } else {
  5398. throw err
  5399. }
  5400. }
  5401. /* */
  5402. var callbacks = [];
  5403. var pending = false;
  5404. function flushCallbacks () {
  5405. pending = false;
  5406. var copies = callbacks.slice(0);
  5407. callbacks.length = 0;
  5408. for (var i = 0; i < copies.length; i++) {
  5409. copies[i]();
  5410. }
  5411. }
  5412. // Here we have async deferring wrappers using microtasks.
  5413. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5414. // However, it has subtle problems when state is changed right before repaint
  5415. // (e.g. #6813, out-in transitions).
  5416. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5417. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5418. // So we now use microtasks everywhere, again.
  5419. // A major drawback of this tradeoff is that there are some scenarios
  5420. // where microtasks have too high a priority and fire in between supposedly
  5421. // sequential events (e.g. #4521, #6690, which have workarounds)
  5422. // or even between bubbling of the same event (#6566).
  5423. var timerFunc;
  5424. // The nextTick behavior leverages the microtask queue, which can be accessed
  5425. // via either native Promise.then or MutationObserver.
  5426. // MutationObserver has wider support, however it is seriously bugged in
  5427. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5428. // completely stops working after triggering a few times... so, if native
  5429. // Promise is available, we will use it:
  5430. /* istanbul ignore next, $flow-disable-line */
  5431. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5432. var p = Promise.resolve();
  5433. timerFunc = function () {
  5434. p.then(flushCallbacks);
  5435. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5436. // it can get stuck in a weird state where callbacks are pushed into the
  5437. // microtask queue but the queue isn't being flushed, until the browser
  5438. // needs to do some other work, e.g. handle a timer. Therefore we can
  5439. // "force" the microtask queue to be flushed by adding an empty timer.
  5440. if (isIOS) { setTimeout(noop); }
  5441. };
  5442. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5443. isNative(MutationObserver) ||
  5444. // PhantomJS and iOS 7.x
  5445. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5446. )) {
  5447. // Use MutationObserver where native Promise is not available,
  5448. // e.g. PhantomJS, iOS7, Android 4.4
  5449. // (#6466 MutationObserver is unreliable in IE11)
  5450. var counter = 1;
  5451. var observer = new MutationObserver(flushCallbacks);
  5452. var textNode = document.createTextNode(String(counter));
  5453. observer.observe(textNode, {
  5454. characterData: true
  5455. });
  5456. timerFunc = function () {
  5457. counter = (counter + 1) % 2;
  5458. textNode.data = String(counter);
  5459. };
  5460. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5461. // Fallback to setImmediate.
  5462. // Technically it leverages the (macro) task queue,
  5463. // but it is still a better choice than setTimeout.
  5464. timerFunc = function () {
  5465. setImmediate(flushCallbacks);
  5466. };
  5467. } else {
  5468. // Fallback to setTimeout.
  5469. timerFunc = function () {
  5470. setTimeout(flushCallbacks, 0);
  5471. };
  5472. }
  5473. function nextTick (cb, ctx) {
  5474. var _resolve;
  5475. callbacks.push(function () {
  5476. if (cb) {
  5477. try {
  5478. cb.call(ctx);
  5479. } catch (e) {
  5480. handleError(e, ctx, 'nextTick');
  5481. }
  5482. } else if (_resolve) {
  5483. _resolve(ctx);
  5484. }
  5485. });
  5486. if (!pending) {
  5487. pending = true;
  5488. timerFunc();
  5489. }
  5490. // $flow-disable-line
  5491. if (!cb && typeof Promise !== 'undefined') {
  5492. return new Promise(function (resolve) {
  5493. _resolve = resolve;
  5494. })
  5495. }
  5496. }
  5497. /* */
  5498. /* not type checking this file because flow doesn't play well with Proxy */
  5499. var initProxy;
  5500. if (true) {
  5501. var allowedGlobals = makeMap(
  5502. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5503. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5504. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5505. 'require' // for Webpack/Browserify
  5506. );
  5507. var warnNonPresent = function (target, key) {
  5508. warn(
  5509. "Property or method \"" + key + "\" is not defined on the instance but " +
  5510. 'referenced during render. Make sure that this property is reactive, ' +
  5511. 'either in the data option, or for class-based components, by ' +
  5512. 'initializing the property. ' +
  5513. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5514. target
  5515. );
  5516. };
  5517. var warnReservedPrefix = function (target, key) {
  5518. warn(
  5519. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5520. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5521. 'prevent conflicts with Vue internals. ' +
  5522. 'See: https://vuejs.org/v2/api/#data',
  5523. target
  5524. );
  5525. };
  5526. var hasProxy =
  5527. typeof Proxy !== 'undefined' && isNative(Proxy);
  5528. if (hasProxy) {
  5529. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5530. config.keyCodes = new Proxy(config.keyCodes, {
  5531. set: function set (target, key, value) {
  5532. if (isBuiltInModifier(key)) {
  5533. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5534. return false
  5535. } else {
  5536. target[key] = value;
  5537. return true
  5538. }
  5539. }
  5540. });
  5541. }
  5542. var hasHandler = {
  5543. has: function has (target, key) {
  5544. var has = key in target;
  5545. var isAllowed = allowedGlobals(key) ||
  5546. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5547. if (!has && !isAllowed) {
  5548. if (key in target.$data) { warnReservedPrefix(target, key); }
  5549. else { warnNonPresent(target, key); }
  5550. }
  5551. return has || !isAllowed
  5552. }
  5553. };
  5554. var getHandler = {
  5555. get: function get (target, key) {
  5556. if (typeof key === 'string' && !(key in target)) {
  5557. if (key in target.$data) { warnReservedPrefix(target, key); }
  5558. else { warnNonPresent(target, key); }
  5559. }
  5560. return target[key]
  5561. }
  5562. };
  5563. initProxy = function initProxy (vm) {
  5564. if (hasProxy) {
  5565. // determine which proxy handler to use
  5566. var options = vm.$options;
  5567. var handlers = options.render && options.render._withStripped
  5568. ? getHandler
  5569. : hasHandler;
  5570. vm._renderProxy = new Proxy(vm, handlers);
  5571. } else {
  5572. vm._renderProxy = vm;
  5573. }
  5574. };
  5575. }
  5576. /* */
  5577. var seenObjects = new _Set();
  5578. /**
  5579. * Recursively traverse an object to evoke all converted
  5580. * getters, so that every nested property inside the object
  5581. * is collected as a "deep" dependency.
  5582. */
  5583. function traverse (val) {
  5584. _traverse(val, seenObjects);
  5585. seenObjects.clear();
  5586. }
  5587. function _traverse (val, seen) {
  5588. var i, keys;
  5589. var isA = Array.isArray(val);
  5590. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5591. return
  5592. }
  5593. if (val.__ob__) {
  5594. var depId = val.__ob__.dep.id;
  5595. if (seen.has(depId)) {
  5596. return
  5597. }
  5598. seen.add(depId);
  5599. }
  5600. if (isA) {
  5601. i = val.length;
  5602. while (i--) { _traverse(val[i], seen); }
  5603. } else {
  5604. keys = Object.keys(val);
  5605. i = keys.length;
  5606. while (i--) { _traverse(val[keys[i]], seen); }
  5607. }
  5608. }
  5609. var mark;
  5610. var measure;
  5611. if (true) {
  5612. var perf = inBrowser && window.performance;
  5613. /* istanbul ignore if */
  5614. if (
  5615. perf &&
  5616. perf.mark &&
  5617. perf.measure &&
  5618. perf.clearMarks &&
  5619. perf.clearMeasures
  5620. ) {
  5621. mark = function (tag) { return perf.mark(tag); };
  5622. measure = function (name, startTag, endTag) {
  5623. perf.measure(name, startTag, endTag);
  5624. perf.clearMarks(startTag);
  5625. perf.clearMarks(endTag);
  5626. // perf.clearMeasures(name)
  5627. };
  5628. }
  5629. }
  5630. /* */
  5631. var normalizeEvent = cached(function (name) {
  5632. var passive = name.charAt(0) === '&';
  5633. name = passive ? name.slice(1) : name;
  5634. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5635. name = once$$1 ? name.slice(1) : name;
  5636. var capture = name.charAt(0) === '!';
  5637. name = capture ? name.slice(1) : name;
  5638. return {
  5639. name: name,
  5640. once: once$$1,
  5641. capture: capture,
  5642. passive: passive
  5643. }
  5644. });
  5645. function createFnInvoker (fns, vm) {
  5646. function invoker () {
  5647. var arguments$1 = arguments;
  5648. var fns = invoker.fns;
  5649. if (Array.isArray(fns)) {
  5650. var cloned = fns.slice();
  5651. for (var i = 0; i < cloned.length; i++) {
  5652. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5653. }
  5654. } else {
  5655. // return handler return value for single handlers
  5656. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5657. }
  5658. }
  5659. invoker.fns = fns;
  5660. return invoker
  5661. }
  5662. function updateListeners (
  5663. on,
  5664. oldOn,
  5665. add,
  5666. remove$$1,
  5667. createOnceHandler,
  5668. vm
  5669. ) {
  5670. var name, def$$1, cur, old, event;
  5671. for (name in on) {
  5672. def$$1 = cur = on[name];
  5673. old = oldOn[name];
  5674. event = normalizeEvent(name);
  5675. if (isUndef(cur)) {
  5676. true && warn(
  5677. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5678. vm
  5679. );
  5680. } else if (isUndef(old)) {
  5681. if (isUndef(cur.fns)) {
  5682. cur = on[name] = createFnInvoker(cur, vm);
  5683. }
  5684. if (isTrue(event.once)) {
  5685. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5686. }
  5687. add(event.name, cur, event.capture, event.passive, event.params);
  5688. } else if (cur !== old) {
  5689. old.fns = cur;
  5690. on[name] = old;
  5691. }
  5692. }
  5693. for (name in oldOn) {
  5694. if (isUndef(on[name])) {
  5695. event = normalizeEvent(name);
  5696. remove$$1(event.name, oldOn[name], event.capture);
  5697. }
  5698. }
  5699. }
  5700. /* */
  5701. /* */
  5702. // fixed by xxxxxx (mp properties)
  5703. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5704. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5705. if (isUndef(propOptions)) {
  5706. return res
  5707. }
  5708. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5709. var attrs = data.attrs;
  5710. var props = data.props;
  5711. if (isDef(attrs) || isDef(props)) {
  5712. for (var key in propOptions) {
  5713. var altKey = hyphenate(key);
  5714. var result = checkProp(res, props, key, altKey, true) ||
  5715. checkProp(res, attrs, key, altKey, false);
  5716. // externalClass
  5717. if (
  5718. result &&
  5719. res[key] &&
  5720. externalClasses.indexOf(altKey) !== -1 &&
  5721. context[camelize(res[key])]
  5722. ) {
  5723. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5724. res[key] = context[camelize(res[key])];
  5725. }
  5726. }
  5727. }
  5728. return res
  5729. }
  5730. function extractPropsFromVNodeData (
  5731. data,
  5732. Ctor,
  5733. tag,
  5734. context// fixed by xxxxxx
  5735. ) {
  5736. // we are only extracting raw values here.
  5737. // validation and default values are handled in the child
  5738. // component itself.
  5739. var propOptions = Ctor.options.props;
  5740. if (isUndef(propOptions)) {
  5741. // fixed by xxxxxx
  5742. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5743. }
  5744. var res = {};
  5745. var attrs = data.attrs;
  5746. var props = data.props;
  5747. if (isDef(attrs) || isDef(props)) {
  5748. for (var key in propOptions) {
  5749. var altKey = hyphenate(key);
  5750. if (true) {
  5751. var keyInLowerCase = key.toLowerCase();
  5752. if (
  5753. key !== keyInLowerCase &&
  5754. attrs && hasOwn(attrs, keyInLowerCase)
  5755. ) {
  5756. tip(
  5757. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5758. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5759. " \"" + key + "\". " +
  5760. "Note that HTML attributes are case-insensitive and camelCased " +
  5761. "props need to use their kebab-case equivalents when using in-DOM " +
  5762. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5763. );
  5764. }
  5765. }
  5766. checkProp(res, props, key, altKey, true) ||
  5767. checkProp(res, attrs, key, altKey, false);
  5768. }
  5769. }
  5770. // fixed by xxxxxx
  5771. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5772. }
  5773. function checkProp (
  5774. res,
  5775. hash,
  5776. key,
  5777. altKey,
  5778. preserve
  5779. ) {
  5780. if (isDef(hash)) {
  5781. if (hasOwn(hash, key)) {
  5782. res[key] = hash[key];
  5783. if (!preserve) {
  5784. delete hash[key];
  5785. }
  5786. return true
  5787. } else if (hasOwn(hash, altKey)) {
  5788. res[key] = hash[altKey];
  5789. if (!preserve) {
  5790. delete hash[altKey];
  5791. }
  5792. return true
  5793. }
  5794. }
  5795. return false
  5796. }
  5797. /* */
  5798. // The template compiler attempts to minimize the need for normalization by
  5799. // statically analyzing the template at compile time.
  5800. //
  5801. // For plain HTML markup, normalization can be completely skipped because the
  5802. // generated render function is guaranteed to return Array<VNode>. There are
  5803. // two cases where extra normalization is needed:
  5804. // 1. When the children contains components - because a functional component
  5805. // may return an Array instead of a single root. In this case, just a simple
  5806. // normalization is needed - if any child is an Array, we flatten the whole
  5807. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5808. // because functional components already normalize their own children.
  5809. function simpleNormalizeChildren (children) {
  5810. for (var i = 0; i < children.length; i++) {
  5811. if (Array.isArray(children[i])) {
  5812. return Array.prototype.concat.apply([], children)
  5813. }
  5814. }
  5815. return children
  5816. }
  5817. // 2. When the children contains constructs that always generated nested Arrays,
  5818. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5819. // with hand-written render functions / JSX. In such cases a full normalization
  5820. // is needed to cater to all possible types of children values.
  5821. function normalizeChildren (children) {
  5822. return isPrimitive(children)
  5823. ? [createTextVNode(children)]
  5824. : Array.isArray(children)
  5825. ? normalizeArrayChildren(children)
  5826. : undefined
  5827. }
  5828. function isTextNode (node) {
  5829. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5830. }
  5831. function normalizeArrayChildren (children, nestedIndex) {
  5832. var res = [];
  5833. var i, c, lastIndex, last;
  5834. for (i = 0; i < children.length; i++) {
  5835. c = children[i];
  5836. if (isUndef(c) || typeof c === 'boolean') { continue }
  5837. lastIndex = res.length - 1;
  5838. last = res[lastIndex];
  5839. // nested
  5840. if (Array.isArray(c)) {
  5841. if (c.length > 0) {
  5842. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5843. // merge adjacent text nodes
  5844. if (isTextNode(c[0]) && isTextNode(last)) {
  5845. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5846. c.shift();
  5847. }
  5848. res.push.apply(res, c);
  5849. }
  5850. } else if (isPrimitive(c)) {
  5851. if (isTextNode(last)) {
  5852. // merge adjacent text nodes
  5853. // this is necessary for SSR hydration because text nodes are
  5854. // essentially merged when rendered to HTML strings
  5855. res[lastIndex] = createTextVNode(last.text + c);
  5856. } else if (c !== '') {
  5857. // convert primitive to vnode
  5858. res.push(createTextVNode(c));
  5859. }
  5860. } else {
  5861. if (isTextNode(c) && isTextNode(last)) {
  5862. // merge adjacent text nodes
  5863. res[lastIndex] = createTextVNode(last.text + c.text);
  5864. } else {
  5865. // default key for nested array children (likely generated by v-for)
  5866. if (isTrue(children._isVList) &&
  5867. isDef(c.tag) &&
  5868. isUndef(c.key) &&
  5869. isDef(nestedIndex)) {
  5870. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5871. }
  5872. res.push(c);
  5873. }
  5874. }
  5875. }
  5876. return res
  5877. }
  5878. /* */
  5879. function initProvide (vm) {
  5880. var provide = vm.$options.provide;
  5881. if (provide) {
  5882. vm._provided = typeof provide === 'function'
  5883. ? provide.call(vm)
  5884. : provide;
  5885. }
  5886. }
  5887. function initInjections (vm) {
  5888. var result = resolveInject(vm.$options.inject, vm);
  5889. if (result) {
  5890. toggleObserving(false);
  5891. Object.keys(result).forEach(function (key) {
  5892. /* istanbul ignore else */
  5893. if (true) {
  5894. defineReactive$$1(vm, key, result[key], function () {
  5895. warn(
  5896. "Avoid mutating an injected value directly since the changes will be " +
  5897. "overwritten whenever the provided component re-renders. " +
  5898. "injection being mutated: \"" + key + "\"",
  5899. vm
  5900. );
  5901. });
  5902. } else {}
  5903. });
  5904. toggleObserving(true);
  5905. }
  5906. }
  5907. function resolveInject (inject, vm) {
  5908. if (inject) {
  5909. // inject is :any because flow is not smart enough to figure out cached
  5910. var result = Object.create(null);
  5911. var keys = hasSymbol
  5912. ? Reflect.ownKeys(inject)
  5913. : Object.keys(inject);
  5914. for (var i = 0; i < keys.length; i++) {
  5915. var key = keys[i];
  5916. // #6574 in case the inject object is observed...
  5917. if (key === '__ob__') { continue }
  5918. var provideKey = inject[key].from;
  5919. var source = vm;
  5920. while (source) {
  5921. if (source._provided && hasOwn(source._provided, provideKey)) {
  5922. result[key] = source._provided[provideKey];
  5923. break
  5924. }
  5925. source = source.$parent;
  5926. }
  5927. if (!source) {
  5928. if ('default' in inject[key]) {
  5929. var provideDefault = inject[key].default;
  5930. result[key] = typeof provideDefault === 'function'
  5931. ? provideDefault.call(vm)
  5932. : provideDefault;
  5933. } else if (true) {
  5934. warn(("Injection \"" + key + "\" not found"), vm);
  5935. }
  5936. }
  5937. }
  5938. return result
  5939. }
  5940. }
  5941. /* */
  5942. /**
  5943. * Runtime helper for resolving raw children VNodes into a slot object.
  5944. */
  5945. function resolveSlots (
  5946. children,
  5947. context
  5948. ) {
  5949. if (!children || !children.length) {
  5950. return {}
  5951. }
  5952. var slots = {};
  5953. for (var i = 0, l = children.length; i < l; i++) {
  5954. var child = children[i];
  5955. var data = child.data;
  5956. // remove slot attribute if the node is resolved as a Vue slot node
  5957. if (data && data.attrs && data.attrs.slot) {
  5958. delete data.attrs.slot;
  5959. }
  5960. // named slots should only be respected if the vnode was rendered in the
  5961. // same context.
  5962. if ((child.context === context || child.fnContext === context) &&
  5963. data && data.slot != null
  5964. ) {
  5965. var name = data.slot;
  5966. var slot = (slots[name] || (slots[name] = []));
  5967. if (child.tag === 'template') {
  5968. slot.push.apply(slot, child.children || []);
  5969. } else {
  5970. slot.push(child);
  5971. }
  5972. } else {
  5973. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5974. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5975. (slots['page'] || (slots['page'] = [])).push(child);
  5976. }else{
  5977. (slots.default || (slots.default = [])).push(child);
  5978. }
  5979. }
  5980. }
  5981. // ignore slots that contains only whitespace
  5982. for (var name$1 in slots) {
  5983. if (slots[name$1].every(isWhitespace)) {
  5984. delete slots[name$1];
  5985. }
  5986. }
  5987. return slots
  5988. }
  5989. function isWhitespace (node) {
  5990. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5991. }
  5992. /* */
  5993. function normalizeScopedSlots (
  5994. slots,
  5995. normalSlots,
  5996. prevSlots
  5997. ) {
  5998. var res;
  5999. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6000. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6001. var key = slots && slots.$key;
  6002. if (!slots) {
  6003. res = {};
  6004. } else if (slots._normalized) {
  6005. // fast path 1: child component re-render only, parent did not change
  6006. return slots._normalized
  6007. } else if (
  6008. isStable &&
  6009. prevSlots &&
  6010. prevSlots !== emptyObject &&
  6011. key === prevSlots.$key &&
  6012. !hasNormalSlots &&
  6013. !prevSlots.$hasNormal
  6014. ) {
  6015. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6016. // only need to normalize once
  6017. return prevSlots
  6018. } else {
  6019. res = {};
  6020. for (var key$1 in slots) {
  6021. if (slots[key$1] && key$1[0] !== '$') {
  6022. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6023. }
  6024. }
  6025. }
  6026. // expose normal slots on scopedSlots
  6027. for (var key$2 in normalSlots) {
  6028. if (!(key$2 in res)) {
  6029. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6030. }
  6031. }
  6032. // avoriaz seems to mock a non-extensible $scopedSlots object
  6033. // and when that is passed down this would cause an error
  6034. if (slots && Object.isExtensible(slots)) {
  6035. (slots)._normalized = res;
  6036. }
  6037. def(res, '$stable', isStable);
  6038. def(res, '$key', key);
  6039. def(res, '$hasNormal', hasNormalSlots);
  6040. return res
  6041. }
  6042. function normalizeScopedSlot(normalSlots, key, fn) {
  6043. var normalized = function () {
  6044. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6045. res = res && typeof res === 'object' && !Array.isArray(res)
  6046. ? [res] // single vnode
  6047. : normalizeChildren(res);
  6048. return res && (
  6049. res.length === 0 ||
  6050. (res.length === 1 && res[0].isComment) // #9658
  6051. ) ? undefined
  6052. : res
  6053. };
  6054. // this is a slot using the new v-slot syntax without scope. although it is
  6055. // compiled as a scoped slot, render fn users would expect it to be present
  6056. // on this.$slots because the usage is semantically a normal slot.
  6057. if (fn.proxy) {
  6058. Object.defineProperty(normalSlots, key, {
  6059. get: normalized,
  6060. enumerable: true,
  6061. configurable: true
  6062. });
  6063. }
  6064. return normalized
  6065. }
  6066. function proxyNormalSlot(slots, key) {
  6067. return function () { return slots[key]; }
  6068. }
  6069. /* */
  6070. /**
  6071. * Runtime helper for rendering v-for lists.
  6072. */
  6073. function renderList (
  6074. val,
  6075. render
  6076. ) {
  6077. var ret, i, l, keys, key;
  6078. if (Array.isArray(val) || typeof val === 'string') {
  6079. ret = new Array(val.length);
  6080. for (i = 0, l = val.length; i < l; i++) {
  6081. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6082. }
  6083. } else if (typeof val === 'number') {
  6084. ret = new Array(val);
  6085. for (i = 0; i < val; i++) {
  6086. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6087. }
  6088. } else if (isObject(val)) {
  6089. if (hasSymbol && val[Symbol.iterator]) {
  6090. ret = [];
  6091. var iterator = val[Symbol.iterator]();
  6092. var result = iterator.next();
  6093. while (!result.done) {
  6094. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6095. result = iterator.next();
  6096. }
  6097. } else {
  6098. keys = Object.keys(val);
  6099. ret = new Array(keys.length);
  6100. for (i = 0, l = keys.length; i < l; i++) {
  6101. key = keys[i];
  6102. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6103. }
  6104. }
  6105. }
  6106. if (!isDef(ret)) {
  6107. ret = [];
  6108. }
  6109. (ret)._isVList = true;
  6110. return ret
  6111. }
  6112. /* */
  6113. /**
  6114. * Runtime helper for rendering <slot>
  6115. */
  6116. function renderSlot (
  6117. name,
  6118. fallback,
  6119. props,
  6120. bindObject
  6121. ) {
  6122. var scopedSlotFn = this.$scopedSlots[name];
  6123. var nodes;
  6124. if (scopedSlotFn) { // scoped slot
  6125. props = props || {};
  6126. if (bindObject) {
  6127. if ( true && !isObject(bindObject)) {
  6128. warn(
  6129. 'slot v-bind without argument expects an Object',
  6130. this
  6131. );
  6132. }
  6133. props = extend(extend({}, bindObject), props);
  6134. }
  6135. // fixed by xxxxxx app-plus scopedSlot
  6136. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6137. } else {
  6138. nodes = this.$slots[name] || fallback;
  6139. }
  6140. var target = props && props.slot;
  6141. if (target) {
  6142. return this.$createElement('template', { slot: target }, nodes)
  6143. } else {
  6144. return nodes
  6145. }
  6146. }
  6147. /* */
  6148. /**
  6149. * Runtime helper for resolving filters
  6150. */
  6151. function resolveFilter (id) {
  6152. return resolveAsset(this.$options, 'filters', id, true) || identity
  6153. }
  6154. /* */
  6155. function isKeyNotMatch (expect, actual) {
  6156. if (Array.isArray(expect)) {
  6157. return expect.indexOf(actual) === -1
  6158. } else {
  6159. return expect !== actual
  6160. }
  6161. }
  6162. /**
  6163. * Runtime helper for checking keyCodes from config.
  6164. * exposed as Vue.prototype._k
  6165. * passing in eventKeyName as last argument separately for backwards compat
  6166. */
  6167. function checkKeyCodes (
  6168. eventKeyCode,
  6169. key,
  6170. builtInKeyCode,
  6171. eventKeyName,
  6172. builtInKeyName
  6173. ) {
  6174. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6175. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6176. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6177. } else if (mappedKeyCode) {
  6178. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6179. } else if (eventKeyName) {
  6180. return hyphenate(eventKeyName) !== key
  6181. }
  6182. }
  6183. /* */
  6184. /**
  6185. * Runtime helper for merging v-bind="object" into a VNode's data.
  6186. */
  6187. function bindObjectProps (
  6188. data,
  6189. tag,
  6190. value,
  6191. asProp,
  6192. isSync
  6193. ) {
  6194. if (value) {
  6195. if (!isObject(value)) {
  6196. true && warn(
  6197. 'v-bind without argument expects an Object or Array value',
  6198. this
  6199. );
  6200. } else {
  6201. if (Array.isArray(value)) {
  6202. value = toObject(value);
  6203. }
  6204. var hash;
  6205. var loop = function ( key ) {
  6206. if (
  6207. key === 'class' ||
  6208. key === 'style' ||
  6209. isReservedAttribute(key)
  6210. ) {
  6211. hash = data;
  6212. } else {
  6213. var type = data.attrs && data.attrs.type;
  6214. hash = asProp || config.mustUseProp(tag, type, key)
  6215. ? data.domProps || (data.domProps = {})
  6216. : data.attrs || (data.attrs = {});
  6217. }
  6218. var camelizedKey = camelize(key);
  6219. var hyphenatedKey = hyphenate(key);
  6220. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6221. hash[key] = value[key];
  6222. if (isSync) {
  6223. var on = data.on || (data.on = {});
  6224. on[("update:" + key)] = function ($event) {
  6225. value[key] = $event;
  6226. };
  6227. }
  6228. }
  6229. };
  6230. for (var key in value) loop( key );
  6231. }
  6232. }
  6233. return data
  6234. }
  6235. /* */
  6236. /**
  6237. * Runtime helper for rendering static trees.
  6238. */
  6239. function renderStatic (
  6240. index,
  6241. isInFor
  6242. ) {
  6243. var cached = this._staticTrees || (this._staticTrees = []);
  6244. var tree = cached[index];
  6245. // if has already-rendered static tree and not inside v-for,
  6246. // we can reuse the same tree.
  6247. if (tree && !isInFor) {
  6248. return tree
  6249. }
  6250. // otherwise, render a fresh tree.
  6251. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6252. this._renderProxy,
  6253. null,
  6254. this // for render fns generated for functional component templates
  6255. );
  6256. markStatic(tree, ("__static__" + index), false);
  6257. return tree
  6258. }
  6259. /**
  6260. * Runtime helper for v-once.
  6261. * Effectively it means marking the node as static with a unique key.
  6262. */
  6263. function markOnce (
  6264. tree,
  6265. index,
  6266. key
  6267. ) {
  6268. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6269. return tree
  6270. }
  6271. function markStatic (
  6272. tree,
  6273. key,
  6274. isOnce
  6275. ) {
  6276. if (Array.isArray(tree)) {
  6277. for (var i = 0; i < tree.length; i++) {
  6278. if (tree[i] && typeof tree[i] !== 'string') {
  6279. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6280. }
  6281. }
  6282. } else {
  6283. markStaticNode(tree, key, isOnce);
  6284. }
  6285. }
  6286. function markStaticNode (node, key, isOnce) {
  6287. node.isStatic = true;
  6288. node.key = key;
  6289. node.isOnce = isOnce;
  6290. }
  6291. /* */
  6292. function bindObjectListeners (data, value) {
  6293. if (value) {
  6294. if (!isPlainObject(value)) {
  6295. true && warn(
  6296. 'v-on without argument expects an Object value',
  6297. this
  6298. );
  6299. } else {
  6300. var on = data.on = data.on ? extend({}, data.on) : {};
  6301. for (var key in value) {
  6302. var existing = on[key];
  6303. var ours = value[key];
  6304. on[key] = existing ? [].concat(existing, ours) : ours;
  6305. }
  6306. }
  6307. }
  6308. return data
  6309. }
  6310. /* */
  6311. function resolveScopedSlots (
  6312. fns, // see flow/vnode
  6313. res,
  6314. // the following are added in 2.6
  6315. hasDynamicKeys,
  6316. contentHashKey
  6317. ) {
  6318. res = res || { $stable: !hasDynamicKeys };
  6319. for (var i = 0; i < fns.length; i++) {
  6320. var slot = fns[i];
  6321. if (Array.isArray(slot)) {
  6322. resolveScopedSlots(slot, res, hasDynamicKeys);
  6323. } else if (slot) {
  6324. // marker for reverse proxying v-slot without scope on this.$slots
  6325. if (slot.proxy) {
  6326. slot.fn.proxy = true;
  6327. }
  6328. res[slot.key] = slot.fn;
  6329. }
  6330. }
  6331. if (contentHashKey) {
  6332. (res).$key = contentHashKey;
  6333. }
  6334. return res
  6335. }
  6336. /* */
  6337. function bindDynamicKeys (baseObj, values) {
  6338. for (var i = 0; i < values.length; i += 2) {
  6339. var key = values[i];
  6340. if (typeof key === 'string' && key) {
  6341. baseObj[values[i]] = values[i + 1];
  6342. } else if ( true && key !== '' && key !== null) {
  6343. // null is a special value for explicitly removing a binding
  6344. warn(
  6345. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6346. this
  6347. );
  6348. }
  6349. }
  6350. return baseObj
  6351. }
  6352. // helper to dynamically append modifier runtime markers to event names.
  6353. // ensure only append when value is already string, otherwise it will be cast
  6354. // to string and cause the type check to miss.
  6355. function prependModifier (value, symbol) {
  6356. return typeof value === 'string' ? symbol + value : value
  6357. }
  6358. /* */
  6359. function installRenderHelpers (target) {
  6360. target._o = markOnce;
  6361. target._n = toNumber;
  6362. target._s = toString;
  6363. target._l = renderList;
  6364. target._t = renderSlot;
  6365. target._q = looseEqual;
  6366. target._i = looseIndexOf;
  6367. target._m = renderStatic;
  6368. target._f = resolveFilter;
  6369. target._k = checkKeyCodes;
  6370. target._b = bindObjectProps;
  6371. target._v = createTextVNode;
  6372. target._e = createEmptyVNode;
  6373. target._u = resolveScopedSlots;
  6374. target._g = bindObjectListeners;
  6375. target._d = bindDynamicKeys;
  6376. target._p = prependModifier;
  6377. }
  6378. /* */
  6379. function FunctionalRenderContext (
  6380. data,
  6381. props,
  6382. children,
  6383. parent,
  6384. Ctor
  6385. ) {
  6386. var this$1 = this;
  6387. var options = Ctor.options;
  6388. // ensure the createElement function in functional components
  6389. // gets a unique context - this is necessary for correct named slot check
  6390. var contextVm;
  6391. if (hasOwn(parent, '_uid')) {
  6392. contextVm = Object.create(parent);
  6393. // $flow-disable-line
  6394. contextVm._original = parent;
  6395. } else {
  6396. // the context vm passed in is a functional context as well.
  6397. // in this case we want to make sure we are able to get a hold to the
  6398. // real context instance.
  6399. contextVm = parent;
  6400. // $flow-disable-line
  6401. parent = parent._original;
  6402. }
  6403. var isCompiled = isTrue(options._compiled);
  6404. var needNormalization = !isCompiled;
  6405. this.data = data;
  6406. this.props = props;
  6407. this.children = children;
  6408. this.parent = parent;
  6409. this.listeners = data.on || emptyObject;
  6410. this.injections = resolveInject(options.inject, parent);
  6411. this.slots = function () {
  6412. if (!this$1.$slots) {
  6413. normalizeScopedSlots(
  6414. data.scopedSlots,
  6415. this$1.$slots = resolveSlots(children, parent)
  6416. );
  6417. }
  6418. return this$1.$slots
  6419. };
  6420. Object.defineProperty(this, 'scopedSlots', ({
  6421. enumerable: true,
  6422. get: function get () {
  6423. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6424. }
  6425. }));
  6426. // support for compiled functional template
  6427. if (isCompiled) {
  6428. // exposing $options for renderStatic()
  6429. this.$options = options;
  6430. // pre-resolve slots for renderSlot()
  6431. this.$slots = this.slots();
  6432. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6433. }
  6434. if (options._scopeId) {
  6435. this._c = function (a, b, c, d) {
  6436. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6437. if (vnode && !Array.isArray(vnode)) {
  6438. vnode.fnScopeId = options._scopeId;
  6439. vnode.fnContext = parent;
  6440. }
  6441. return vnode
  6442. };
  6443. } else {
  6444. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6445. }
  6446. }
  6447. installRenderHelpers(FunctionalRenderContext.prototype);
  6448. function createFunctionalComponent (
  6449. Ctor,
  6450. propsData,
  6451. data,
  6452. contextVm,
  6453. children
  6454. ) {
  6455. var options = Ctor.options;
  6456. var props = {};
  6457. var propOptions = options.props;
  6458. if (isDef(propOptions)) {
  6459. for (var key in propOptions) {
  6460. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6461. }
  6462. } else {
  6463. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6464. if (isDef(data.props)) { mergeProps(props, data.props); }
  6465. }
  6466. var renderContext = new FunctionalRenderContext(
  6467. data,
  6468. props,
  6469. children,
  6470. contextVm,
  6471. Ctor
  6472. );
  6473. var vnode = options.render.call(null, renderContext._c, renderContext);
  6474. if (vnode instanceof VNode) {
  6475. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6476. } else if (Array.isArray(vnode)) {
  6477. var vnodes = normalizeChildren(vnode) || [];
  6478. var res = new Array(vnodes.length);
  6479. for (var i = 0; i < vnodes.length; i++) {
  6480. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6481. }
  6482. return res
  6483. }
  6484. }
  6485. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6486. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6487. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6488. // that should not be matched to match.
  6489. var clone = cloneVNode(vnode);
  6490. clone.fnContext = contextVm;
  6491. clone.fnOptions = options;
  6492. if (true) {
  6493. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6494. }
  6495. if (data.slot) {
  6496. (clone.data || (clone.data = {})).slot = data.slot;
  6497. }
  6498. return clone
  6499. }
  6500. function mergeProps (to, from) {
  6501. for (var key in from) {
  6502. to[camelize(key)] = from[key];
  6503. }
  6504. }
  6505. /* */
  6506. /* */
  6507. /* */
  6508. /* */
  6509. // inline hooks to be invoked on component VNodes during patch
  6510. var componentVNodeHooks = {
  6511. init: function init (vnode, hydrating) {
  6512. if (
  6513. vnode.componentInstance &&
  6514. !vnode.componentInstance._isDestroyed &&
  6515. vnode.data.keepAlive
  6516. ) {
  6517. // kept-alive components, treat as a patch
  6518. var mountedNode = vnode; // work around flow
  6519. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6520. } else {
  6521. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6522. vnode,
  6523. activeInstance
  6524. );
  6525. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6526. }
  6527. },
  6528. prepatch: function prepatch (oldVnode, vnode) {
  6529. var options = vnode.componentOptions;
  6530. var child = vnode.componentInstance = oldVnode.componentInstance;
  6531. updateChildComponent(
  6532. child,
  6533. options.propsData, // updated props
  6534. options.listeners, // updated listeners
  6535. vnode, // new parent vnode
  6536. options.children // new children
  6537. );
  6538. },
  6539. insert: function insert (vnode) {
  6540. var context = vnode.context;
  6541. var componentInstance = vnode.componentInstance;
  6542. if (!componentInstance._isMounted) {
  6543. callHook(componentInstance, 'onServiceCreated');
  6544. callHook(componentInstance, 'onServiceAttached');
  6545. componentInstance._isMounted = true;
  6546. callHook(componentInstance, 'mounted');
  6547. }
  6548. if (vnode.data.keepAlive) {
  6549. if (context._isMounted) {
  6550. // vue-router#1212
  6551. // During updates, a kept-alive component's child components may
  6552. // change, so directly walking the tree here may call activated hooks
  6553. // on incorrect children. Instead we push them into a queue which will
  6554. // be processed after the whole patch process ended.
  6555. queueActivatedComponent(componentInstance);
  6556. } else {
  6557. activateChildComponent(componentInstance, true /* direct */);
  6558. }
  6559. }
  6560. },
  6561. destroy: function destroy (vnode) {
  6562. var componentInstance = vnode.componentInstance;
  6563. if (!componentInstance._isDestroyed) {
  6564. if (!vnode.data.keepAlive) {
  6565. componentInstance.$destroy();
  6566. } else {
  6567. deactivateChildComponent(componentInstance, true /* direct */);
  6568. }
  6569. }
  6570. }
  6571. };
  6572. var hooksToMerge = Object.keys(componentVNodeHooks);
  6573. function createComponent (
  6574. Ctor,
  6575. data,
  6576. context,
  6577. children,
  6578. tag
  6579. ) {
  6580. if (isUndef(Ctor)) {
  6581. return
  6582. }
  6583. var baseCtor = context.$options._base;
  6584. // plain options object: turn it into a constructor
  6585. if (isObject(Ctor)) {
  6586. Ctor = baseCtor.extend(Ctor);
  6587. }
  6588. // if at this stage it's not a constructor or an async component factory,
  6589. // reject.
  6590. if (typeof Ctor !== 'function') {
  6591. if (true) {
  6592. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6593. }
  6594. return
  6595. }
  6596. // async component
  6597. var asyncFactory;
  6598. if (isUndef(Ctor.cid)) {
  6599. asyncFactory = Ctor;
  6600. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6601. if (Ctor === undefined) {
  6602. // return a placeholder node for async component, which is rendered
  6603. // as a comment node but preserves all the raw information for the node.
  6604. // the information will be used for async server-rendering and hydration.
  6605. return createAsyncPlaceholder(
  6606. asyncFactory,
  6607. data,
  6608. context,
  6609. children,
  6610. tag
  6611. )
  6612. }
  6613. }
  6614. data = data || {};
  6615. // resolve constructor options in case global mixins are applied after
  6616. // component constructor creation
  6617. resolveConstructorOptions(Ctor);
  6618. // transform component v-model data into props & events
  6619. if (isDef(data.model)) {
  6620. transformModel(Ctor.options, data);
  6621. }
  6622. // extract props
  6623. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6624. // functional component
  6625. if (isTrue(Ctor.options.functional)) {
  6626. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6627. }
  6628. // extract listeners, since these needs to be treated as
  6629. // child component listeners instead of DOM listeners
  6630. var listeners = data.on;
  6631. // replace with listeners with .native modifier
  6632. // so it gets processed during parent component patch.
  6633. data.on = data.nativeOn;
  6634. if (isTrue(Ctor.options.abstract)) {
  6635. // abstract components do not keep anything
  6636. // other than props & listeners & slot
  6637. // work around flow
  6638. var slot = data.slot;
  6639. data = {};
  6640. if (slot) {
  6641. data.slot = slot;
  6642. }
  6643. }
  6644. // install component management hooks onto the placeholder node
  6645. installComponentHooks(data);
  6646. // return a placeholder vnode
  6647. var name = Ctor.options.name || tag;
  6648. var vnode = new VNode(
  6649. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6650. data, undefined, undefined, undefined, context,
  6651. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6652. asyncFactory
  6653. );
  6654. return vnode
  6655. }
  6656. function createComponentInstanceForVnode (
  6657. vnode, // we know it's MountedComponentVNode but flow doesn't
  6658. parent // activeInstance in lifecycle state
  6659. ) {
  6660. var options = {
  6661. _isComponent: true,
  6662. _parentVnode: vnode,
  6663. parent: parent
  6664. };
  6665. // check inline-template render functions
  6666. var inlineTemplate = vnode.data.inlineTemplate;
  6667. if (isDef(inlineTemplate)) {
  6668. options.render = inlineTemplate.render;
  6669. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6670. }
  6671. return new vnode.componentOptions.Ctor(options)
  6672. }
  6673. function installComponentHooks (data) {
  6674. var hooks = data.hook || (data.hook = {});
  6675. for (var i = 0; i < hooksToMerge.length; i++) {
  6676. var key = hooksToMerge[i];
  6677. var existing = hooks[key];
  6678. var toMerge = componentVNodeHooks[key];
  6679. if (existing !== toMerge && !(existing && existing._merged)) {
  6680. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6681. }
  6682. }
  6683. }
  6684. function mergeHook$1 (f1, f2) {
  6685. var merged = function (a, b) {
  6686. // flow complains about extra args which is why we use any
  6687. f1(a, b);
  6688. f2(a, b);
  6689. };
  6690. merged._merged = true;
  6691. return merged
  6692. }
  6693. // transform component v-model info (value and callback) into
  6694. // prop and event handler respectively.
  6695. function transformModel (options, data) {
  6696. var prop = (options.model && options.model.prop) || 'value';
  6697. var event = (options.model && options.model.event) || 'input'
  6698. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6699. var on = data.on || (data.on = {});
  6700. var existing = on[event];
  6701. var callback = data.model.callback;
  6702. if (isDef(existing)) {
  6703. if (
  6704. Array.isArray(existing)
  6705. ? existing.indexOf(callback) === -1
  6706. : existing !== callback
  6707. ) {
  6708. on[event] = [callback].concat(existing);
  6709. }
  6710. } else {
  6711. on[event] = callback;
  6712. }
  6713. }
  6714. /* */
  6715. var SIMPLE_NORMALIZE = 1;
  6716. var ALWAYS_NORMALIZE = 2;
  6717. // wrapper function for providing a more flexible interface
  6718. // without getting yelled at by flow
  6719. function createElement (
  6720. context,
  6721. tag,
  6722. data,
  6723. children,
  6724. normalizationType,
  6725. alwaysNormalize
  6726. ) {
  6727. if (Array.isArray(data) || isPrimitive(data)) {
  6728. normalizationType = children;
  6729. children = data;
  6730. data = undefined;
  6731. }
  6732. if (isTrue(alwaysNormalize)) {
  6733. normalizationType = ALWAYS_NORMALIZE;
  6734. }
  6735. return _createElement(context, tag, data, children, normalizationType)
  6736. }
  6737. function _createElement (
  6738. context,
  6739. tag,
  6740. data,
  6741. children,
  6742. normalizationType
  6743. ) {
  6744. if (isDef(data) && isDef((data).__ob__)) {
  6745. true && warn(
  6746. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6747. 'Always create fresh vnode data objects in each render!',
  6748. context
  6749. );
  6750. return createEmptyVNode()
  6751. }
  6752. // object syntax in v-bind
  6753. if (isDef(data) && isDef(data.is)) {
  6754. tag = data.is;
  6755. }
  6756. if (!tag) {
  6757. // in case of component :is set to falsy value
  6758. return createEmptyVNode()
  6759. }
  6760. // warn against non-primitive key
  6761. if ( true &&
  6762. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6763. ) {
  6764. {
  6765. warn(
  6766. 'Avoid using non-primitive value as key, ' +
  6767. 'use string/number value instead.',
  6768. context
  6769. );
  6770. }
  6771. }
  6772. // support single function children as default scoped slot
  6773. if (Array.isArray(children) &&
  6774. typeof children[0] === 'function'
  6775. ) {
  6776. data = data || {};
  6777. data.scopedSlots = { default: children[0] };
  6778. children.length = 0;
  6779. }
  6780. if (normalizationType === ALWAYS_NORMALIZE) {
  6781. children = normalizeChildren(children);
  6782. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6783. children = simpleNormalizeChildren(children);
  6784. }
  6785. var vnode, ns;
  6786. if (typeof tag === 'string') {
  6787. var Ctor;
  6788. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6789. if (config.isReservedTag(tag)) {
  6790. // platform built-in elements
  6791. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6792. warn(
  6793. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6794. context
  6795. );
  6796. }
  6797. vnode = new VNode(
  6798. config.parsePlatformTagName(tag), data, children,
  6799. undefined, undefined, context
  6800. );
  6801. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6802. // component
  6803. vnode = createComponent(Ctor, data, context, children, tag);
  6804. } else {
  6805. // unknown or unlisted namespaced elements
  6806. // check at runtime because it may get assigned a namespace when its
  6807. // parent normalizes children
  6808. vnode = new VNode(
  6809. tag, data, children,
  6810. undefined, undefined, context
  6811. );
  6812. }
  6813. } else {
  6814. // direct component options / constructor
  6815. vnode = createComponent(tag, data, context, children);
  6816. }
  6817. if (Array.isArray(vnode)) {
  6818. return vnode
  6819. } else if (isDef(vnode)) {
  6820. if (isDef(ns)) { applyNS(vnode, ns); }
  6821. if (isDef(data)) { registerDeepBindings(data); }
  6822. return vnode
  6823. } else {
  6824. return createEmptyVNode()
  6825. }
  6826. }
  6827. function applyNS (vnode, ns, force) {
  6828. vnode.ns = ns;
  6829. if (vnode.tag === 'foreignObject') {
  6830. // use default namespace inside foreignObject
  6831. ns = undefined;
  6832. force = true;
  6833. }
  6834. if (isDef(vnode.children)) {
  6835. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6836. var child = vnode.children[i];
  6837. if (isDef(child.tag) && (
  6838. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6839. applyNS(child, ns, force);
  6840. }
  6841. }
  6842. }
  6843. }
  6844. // ref #5318
  6845. // necessary to ensure parent re-render when deep bindings like :style and
  6846. // :class are used on slot nodes
  6847. function registerDeepBindings (data) {
  6848. if (isObject(data.style)) {
  6849. traverse(data.style);
  6850. }
  6851. if (isObject(data.class)) {
  6852. traverse(data.class);
  6853. }
  6854. }
  6855. /* */
  6856. function initRender (vm) {
  6857. vm._vnode = null; // the root of the child tree
  6858. vm._staticTrees = null; // v-once cached trees
  6859. var options = vm.$options;
  6860. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6861. var renderContext = parentVnode && parentVnode.context;
  6862. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6863. vm.$scopedSlots = emptyObject;
  6864. // bind the createElement fn to this instance
  6865. // so that we get proper render context inside it.
  6866. // args order: tag, data, children, normalizationType, alwaysNormalize
  6867. // internal version is used by render functions compiled from templates
  6868. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6869. // normalization is always applied for the public version, used in
  6870. // user-written render functions.
  6871. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6872. // $attrs & $listeners are exposed for easier HOC creation.
  6873. // they need to be reactive so that HOCs using them are always updated
  6874. var parentData = parentVnode && parentVnode.data;
  6875. /* istanbul ignore else */
  6876. if (true) {
  6877. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6878. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6879. }, true);
  6880. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6881. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6882. }, true);
  6883. } else {}
  6884. }
  6885. var currentRenderingInstance = null;
  6886. function renderMixin (Vue) {
  6887. // install runtime convenience helpers
  6888. installRenderHelpers(Vue.prototype);
  6889. Vue.prototype.$nextTick = function (fn) {
  6890. return nextTick(fn, this)
  6891. };
  6892. Vue.prototype._render = function () {
  6893. var vm = this;
  6894. var ref = vm.$options;
  6895. var render = ref.render;
  6896. var _parentVnode = ref._parentVnode;
  6897. if (_parentVnode) {
  6898. vm.$scopedSlots = normalizeScopedSlots(
  6899. _parentVnode.data.scopedSlots,
  6900. vm.$slots,
  6901. vm.$scopedSlots
  6902. );
  6903. }
  6904. // set parent vnode. this allows render functions to have access
  6905. // to the data on the placeholder node.
  6906. vm.$vnode = _parentVnode;
  6907. // render self
  6908. var vnode;
  6909. try {
  6910. // There's no need to maintain a stack because all render fns are called
  6911. // separately from one another. Nested component's render fns are called
  6912. // when parent component is patched.
  6913. currentRenderingInstance = vm;
  6914. vnode = render.call(vm._renderProxy, vm.$createElement);
  6915. } catch (e) {
  6916. handleError(e, vm, "render");
  6917. // return error render result,
  6918. // or previous vnode to prevent render error causing blank component
  6919. /* istanbul ignore else */
  6920. if ( true && vm.$options.renderError) {
  6921. try {
  6922. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6923. } catch (e) {
  6924. handleError(e, vm, "renderError");
  6925. vnode = vm._vnode;
  6926. }
  6927. } else {
  6928. vnode = vm._vnode;
  6929. }
  6930. } finally {
  6931. currentRenderingInstance = null;
  6932. }
  6933. // if the returned array contains only a single node, allow it
  6934. if (Array.isArray(vnode) && vnode.length === 1) {
  6935. vnode = vnode[0];
  6936. }
  6937. // return empty vnode in case the render function errored out
  6938. if (!(vnode instanceof VNode)) {
  6939. if ( true && Array.isArray(vnode)) {
  6940. warn(
  6941. 'Multiple root nodes returned from render function. Render function ' +
  6942. 'should return a single root node.',
  6943. vm
  6944. );
  6945. }
  6946. vnode = createEmptyVNode();
  6947. }
  6948. // set parent
  6949. vnode.parent = _parentVnode;
  6950. return vnode
  6951. };
  6952. }
  6953. /* */
  6954. function ensureCtor (comp, base) {
  6955. if (
  6956. comp.__esModule ||
  6957. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6958. ) {
  6959. comp = comp.default;
  6960. }
  6961. return isObject(comp)
  6962. ? base.extend(comp)
  6963. : comp
  6964. }
  6965. function createAsyncPlaceholder (
  6966. factory,
  6967. data,
  6968. context,
  6969. children,
  6970. tag
  6971. ) {
  6972. var node = createEmptyVNode();
  6973. node.asyncFactory = factory;
  6974. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6975. return node
  6976. }
  6977. function resolveAsyncComponent (
  6978. factory,
  6979. baseCtor
  6980. ) {
  6981. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6982. return factory.errorComp
  6983. }
  6984. if (isDef(factory.resolved)) {
  6985. return factory.resolved
  6986. }
  6987. var owner = currentRenderingInstance;
  6988. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6989. // already pending
  6990. factory.owners.push(owner);
  6991. }
  6992. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6993. return factory.loadingComp
  6994. }
  6995. if (owner && !isDef(factory.owners)) {
  6996. var owners = factory.owners = [owner];
  6997. var sync = true;
  6998. var timerLoading = null;
  6999. var timerTimeout = null
  7000. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7001. var forceRender = function (renderCompleted) {
  7002. for (var i = 0, l = owners.length; i < l; i++) {
  7003. (owners[i]).$forceUpdate();
  7004. }
  7005. if (renderCompleted) {
  7006. owners.length = 0;
  7007. if (timerLoading !== null) {
  7008. clearTimeout(timerLoading);
  7009. timerLoading = null;
  7010. }
  7011. if (timerTimeout !== null) {
  7012. clearTimeout(timerTimeout);
  7013. timerTimeout = null;
  7014. }
  7015. }
  7016. };
  7017. var resolve = once(function (res) {
  7018. // cache resolved
  7019. factory.resolved = ensureCtor(res, baseCtor);
  7020. // invoke callbacks only if this is not a synchronous resolve
  7021. // (async resolves are shimmed as synchronous during SSR)
  7022. if (!sync) {
  7023. forceRender(true);
  7024. } else {
  7025. owners.length = 0;
  7026. }
  7027. });
  7028. var reject = once(function (reason) {
  7029. true && warn(
  7030. "Failed to resolve async component: " + (String(factory)) +
  7031. (reason ? ("\nReason: " + reason) : '')
  7032. );
  7033. if (isDef(factory.errorComp)) {
  7034. factory.error = true;
  7035. forceRender(true);
  7036. }
  7037. });
  7038. var res = factory(resolve, reject);
  7039. if (isObject(res)) {
  7040. if (isPromise(res)) {
  7041. // () => Promise
  7042. if (isUndef(factory.resolved)) {
  7043. res.then(resolve, reject);
  7044. }
  7045. } else if (isPromise(res.component)) {
  7046. res.component.then(resolve, reject);
  7047. if (isDef(res.error)) {
  7048. factory.errorComp = ensureCtor(res.error, baseCtor);
  7049. }
  7050. if (isDef(res.loading)) {
  7051. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7052. if (res.delay === 0) {
  7053. factory.loading = true;
  7054. } else {
  7055. timerLoading = setTimeout(function () {
  7056. timerLoading = null;
  7057. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7058. factory.loading = true;
  7059. forceRender(false);
  7060. }
  7061. }, res.delay || 200);
  7062. }
  7063. }
  7064. if (isDef(res.timeout)) {
  7065. timerTimeout = setTimeout(function () {
  7066. timerTimeout = null;
  7067. if (isUndef(factory.resolved)) {
  7068. reject(
  7069. true
  7070. ? ("timeout (" + (res.timeout) + "ms)")
  7071. : undefined
  7072. );
  7073. }
  7074. }, res.timeout);
  7075. }
  7076. }
  7077. }
  7078. sync = false;
  7079. // return in case resolved synchronously
  7080. return factory.loading
  7081. ? factory.loadingComp
  7082. : factory.resolved
  7083. }
  7084. }
  7085. /* */
  7086. function isAsyncPlaceholder (node) {
  7087. return node.isComment && node.asyncFactory
  7088. }
  7089. /* */
  7090. function getFirstComponentChild (children) {
  7091. if (Array.isArray(children)) {
  7092. for (var i = 0; i < children.length; i++) {
  7093. var c = children[i];
  7094. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7095. return c
  7096. }
  7097. }
  7098. }
  7099. }
  7100. /* */
  7101. /* */
  7102. function initEvents (vm) {
  7103. vm._events = Object.create(null);
  7104. vm._hasHookEvent = false;
  7105. // init parent attached events
  7106. var listeners = vm.$options._parentListeners;
  7107. if (listeners) {
  7108. updateComponentListeners(vm, listeners);
  7109. }
  7110. }
  7111. var target;
  7112. function add (event, fn) {
  7113. target.$on(event, fn);
  7114. }
  7115. function remove$1 (event, fn) {
  7116. target.$off(event, fn);
  7117. }
  7118. function createOnceHandler (event, fn) {
  7119. var _target = target;
  7120. return function onceHandler () {
  7121. var res = fn.apply(null, arguments);
  7122. if (res !== null) {
  7123. _target.$off(event, onceHandler);
  7124. }
  7125. }
  7126. }
  7127. function updateComponentListeners (
  7128. vm,
  7129. listeners,
  7130. oldListeners
  7131. ) {
  7132. target = vm;
  7133. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7134. target = undefined;
  7135. }
  7136. function eventsMixin (Vue) {
  7137. var hookRE = /^hook:/;
  7138. Vue.prototype.$on = function (event, fn) {
  7139. var vm = this;
  7140. if (Array.isArray(event)) {
  7141. for (var i = 0, l = event.length; i < l; i++) {
  7142. vm.$on(event[i], fn);
  7143. }
  7144. } else {
  7145. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7146. // optimize hook:event cost by using a boolean flag marked at registration
  7147. // instead of a hash lookup
  7148. if (hookRE.test(event)) {
  7149. vm._hasHookEvent = true;
  7150. }
  7151. }
  7152. return vm
  7153. };
  7154. Vue.prototype.$once = function (event, fn) {
  7155. var vm = this;
  7156. function on () {
  7157. vm.$off(event, on);
  7158. fn.apply(vm, arguments);
  7159. }
  7160. on.fn = fn;
  7161. vm.$on(event, on);
  7162. return vm
  7163. };
  7164. Vue.prototype.$off = function (event, fn) {
  7165. var vm = this;
  7166. // all
  7167. if (!arguments.length) {
  7168. vm._events = Object.create(null);
  7169. return vm
  7170. }
  7171. // array of events
  7172. if (Array.isArray(event)) {
  7173. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7174. vm.$off(event[i$1], fn);
  7175. }
  7176. return vm
  7177. }
  7178. // specific event
  7179. var cbs = vm._events[event];
  7180. if (!cbs) {
  7181. return vm
  7182. }
  7183. if (!fn) {
  7184. vm._events[event] = null;
  7185. return vm
  7186. }
  7187. // specific handler
  7188. var cb;
  7189. var i = cbs.length;
  7190. while (i--) {
  7191. cb = cbs[i];
  7192. if (cb === fn || cb.fn === fn) {
  7193. cbs.splice(i, 1);
  7194. break
  7195. }
  7196. }
  7197. return vm
  7198. };
  7199. Vue.prototype.$emit = function (event) {
  7200. var vm = this;
  7201. if (true) {
  7202. var lowerCaseEvent = event.toLowerCase();
  7203. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7204. tip(
  7205. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7206. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7207. "Note that HTML attributes are case-insensitive and you cannot use " +
  7208. "v-on to listen to camelCase events when using in-DOM templates. " +
  7209. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7210. );
  7211. }
  7212. }
  7213. var cbs = vm._events[event];
  7214. if (cbs) {
  7215. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7216. var args = toArray(arguments, 1);
  7217. var info = "event handler for \"" + event + "\"";
  7218. for (var i = 0, l = cbs.length; i < l; i++) {
  7219. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7220. }
  7221. }
  7222. return vm
  7223. };
  7224. }
  7225. /* */
  7226. var activeInstance = null;
  7227. var isUpdatingChildComponent = false;
  7228. function setActiveInstance(vm) {
  7229. var prevActiveInstance = activeInstance;
  7230. activeInstance = vm;
  7231. return function () {
  7232. activeInstance = prevActiveInstance;
  7233. }
  7234. }
  7235. function initLifecycle (vm) {
  7236. var options = vm.$options;
  7237. // locate first non-abstract parent
  7238. var parent = options.parent;
  7239. if (parent && !options.abstract) {
  7240. while (parent.$options.abstract && parent.$parent) {
  7241. parent = parent.$parent;
  7242. }
  7243. parent.$children.push(vm);
  7244. }
  7245. vm.$parent = parent;
  7246. vm.$root = parent ? parent.$root : vm;
  7247. vm.$children = [];
  7248. vm.$refs = {};
  7249. vm._watcher = null;
  7250. vm._inactive = null;
  7251. vm._directInactive = false;
  7252. vm._isMounted = false;
  7253. vm._isDestroyed = false;
  7254. vm._isBeingDestroyed = false;
  7255. }
  7256. function lifecycleMixin (Vue) {
  7257. Vue.prototype._update = function (vnode, hydrating) {
  7258. var vm = this;
  7259. var prevEl = vm.$el;
  7260. var prevVnode = vm._vnode;
  7261. var restoreActiveInstance = setActiveInstance(vm);
  7262. vm._vnode = vnode;
  7263. // Vue.prototype.__patch__ is injected in entry points
  7264. // based on the rendering backend used.
  7265. if (!prevVnode) {
  7266. // initial render
  7267. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7268. } else {
  7269. // updates
  7270. vm.$el = vm.__patch__(prevVnode, vnode);
  7271. }
  7272. restoreActiveInstance();
  7273. // update __vue__ reference
  7274. if (prevEl) {
  7275. prevEl.__vue__ = null;
  7276. }
  7277. if (vm.$el) {
  7278. vm.$el.__vue__ = vm;
  7279. }
  7280. // if parent is an HOC, update its $el as well
  7281. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7282. vm.$parent.$el = vm.$el;
  7283. }
  7284. // updated hook is called by the scheduler to ensure that children are
  7285. // updated in a parent's updated hook.
  7286. };
  7287. Vue.prototype.$forceUpdate = function () {
  7288. var vm = this;
  7289. if (vm._watcher) {
  7290. vm._watcher.update();
  7291. }
  7292. };
  7293. Vue.prototype.$destroy = function () {
  7294. var vm = this;
  7295. if (vm._isBeingDestroyed) {
  7296. return
  7297. }
  7298. callHook(vm, 'beforeDestroy');
  7299. vm._isBeingDestroyed = true;
  7300. // remove self from parent
  7301. var parent = vm.$parent;
  7302. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7303. remove(parent.$children, vm);
  7304. }
  7305. // teardown watchers
  7306. if (vm._watcher) {
  7307. vm._watcher.teardown();
  7308. }
  7309. var i = vm._watchers.length;
  7310. while (i--) {
  7311. vm._watchers[i].teardown();
  7312. }
  7313. // remove reference from data ob
  7314. // frozen object may not have observer.
  7315. if (vm._data.__ob__) {
  7316. vm._data.__ob__.vmCount--;
  7317. }
  7318. // call the last hook...
  7319. vm._isDestroyed = true;
  7320. // invoke destroy hooks on current rendered tree
  7321. vm.__patch__(vm._vnode, null);
  7322. // fire destroyed hook
  7323. callHook(vm, 'destroyed');
  7324. // turn off all instance listeners.
  7325. vm.$off();
  7326. // remove __vue__ reference
  7327. if (vm.$el) {
  7328. vm.$el.__vue__ = null;
  7329. }
  7330. // release circular reference (#6759)
  7331. if (vm.$vnode) {
  7332. vm.$vnode.parent = null;
  7333. }
  7334. };
  7335. }
  7336. function updateChildComponent (
  7337. vm,
  7338. propsData,
  7339. listeners,
  7340. parentVnode,
  7341. renderChildren
  7342. ) {
  7343. if (true) {
  7344. isUpdatingChildComponent = true;
  7345. }
  7346. // determine whether component has slot children
  7347. // we need to do this before overwriting $options._renderChildren.
  7348. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7349. // dynamic slot names). Static scoped slots compiled from template has the
  7350. // "$stable" marker.
  7351. var newScopedSlots = parentVnode.data.scopedSlots;
  7352. var oldScopedSlots = vm.$scopedSlots;
  7353. var hasDynamicScopedSlot = !!(
  7354. (newScopedSlots && !newScopedSlots.$stable) ||
  7355. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7356. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7357. );
  7358. // Any static slot children from the parent may have changed during parent's
  7359. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7360. // update is necessary to ensure correctness.
  7361. var needsForceUpdate = !!(
  7362. renderChildren || // has new static slots
  7363. vm.$options._renderChildren || // has old static slots
  7364. hasDynamicScopedSlot
  7365. );
  7366. vm.$options._parentVnode = parentVnode;
  7367. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7368. if (vm._vnode) { // update child tree's parent
  7369. vm._vnode.parent = parentVnode;
  7370. }
  7371. vm.$options._renderChildren = renderChildren;
  7372. // update $attrs and $listeners hash
  7373. // these are also reactive so they may trigger child update if the child
  7374. // used them during render
  7375. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7376. vm.$listeners = listeners || emptyObject;
  7377. // update props
  7378. if (propsData && vm.$options.props) {
  7379. toggleObserving(false);
  7380. var props = vm._props;
  7381. var propKeys = vm.$options._propKeys || [];
  7382. for (var i = 0; i < propKeys.length; i++) {
  7383. var key = propKeys[i];
  7384. var propOptions = vm.$options.props; // wtf flow?
  7385. props[key] = validateProp(key, propOptions, propsData, vm);
  7386. }
  7387. toggleObserving(true);
  7388. // keep a copy of raw propsData
  7389. vm.$options.propsData = propsData;
  7390. }
  7391. // fixed by xxxxxx update properties(mp runtime)
  7392. vm._$updateProperties && vm._$updateProperties(vm);
  7393. // update listeners
  7394. listeners = listeners || emptyObject;
  7395. var oldListeners = vm.$options._parentListeners;
  7396. vm.$options._parentListeners = listeners;
  7397. updateComponentListeners(vm, listeners, oldListeners);
  7398. // resolve slots + force update if has children
  7399. if (needsForceUpdate) {
  7400. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7401. vm.$forceUpdate();
  7402. }
  7403. if (true) {
  7404. isUpdatingChildComponent = false;
  7405. }
  7406. }
  7407. function isInInactiveTree (vm) {
  7408. while (vm && (vm = vm.$parent)) {
  7409. if (vm._inactive) { return true }
  7410. }
  7411. return false
  7412. }
  7413. function activateChildComponent (vm, direct) {
  7414. if (direct) {
  7415. vm._directInactive = false;
  7416. if (isInInactiveTree(vm)) {
  7417. return
  7418. }
  7419. } else if (vm._directInactive) {
  7420. return
  7421. }
  7422. if (vm._inactive || vm._inactive === null) {
  7423. vm._inactive = false;
  7424. for (var i = 0; i < vm.$children.length; i++) {
  7425. activateChildComponent(vm.$children[i]);
  7426. }
  7427. callHook(vm, 'activated');
  7428. }
  7429. }
  7430. function deactivateChildComponent (vm, direct) {
  7431. if (direct) {
  7432. vm._directInactive = true;
  7433. if (isInInactiveTree(vm)) {
  7434. return
  7435. }
  7436. }
  7437. if (!vm._inactive) {
  7438. vm._inactive = true;
  7439. for (var i = 0; i < vm.$children.length; i++) {
  7440. deactivateChildComponent(vm.$children[i]);
  7441. }
  7442. callHook(vm, 'deactivated');
  7443. }
  7444. }
  7445. function callHook (vm, hook) {
  7446. // #7573 disable dep collection when invoking lifecycle hooks
  7447. pushTarget();
  7448. var handlers = vm.$options[hook];
  7449. var info = hook + " hook";
  7450. if (handlers) {
  7451. for (var i = 0, j = handlers.length; i < j; i++) {
  7452. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7453. }
  7454. }
  7455. if (vm._hasHookEvent) {
  7456. vm.$emit('hook:' + hook);
  7457. }
  7458. popTarget();
  7459. }
  7460. /* */
  7461. var MAX_UPDATE_COUNT = 100;
  7462. var queue = [];
  7463. var activatedChildren = [];
  7464. var has = {};
  7465. var circular = {};
  7466. var waiting = false;
  7467. var flushing = false;
  7468. var index = 0;
  7469. /**
  7470. * Reset the scheduler's state.
  7471. */
  7472. function resetSchedulerState () {
  7473. index = queue.length = activatedChildren.length = 0;
  7474. has = {};
  7475. if (true) {
  7476. circular = {};
  7477. }
  7478. waiting = flushing = false;
  7479. }
  7480. // Async edge case #6566 requires saving the timestamp when event listeners are
  7481. // attached. However, calling performance.now() has a perf overhead especially
  7482. // if the page has thousands of event listeners. Instead, we take a timestamp
  7483. // every time the scheduler flushes and use that for all event listeners
  7484. // attached during that flush.
  7485. var currentFlushTimestamp = 0;
  7486. // Async edge case fix requires storing an event listener's attach timestamp.
  7487. var getNow = Date.now;
  7488. // Determine what event timestamp the browser is using. Annoyingly, the
  7489. // timestamp can either be hi-res (relative to page load) or low-res
  7490. // (relative to UNIX epoch), so in order to compare time we have to use the
  7491. // same timestamp type when saving the flush timestamp.
  7492. // All IE versions use low-res event timestamps, and have problematic clock
  7493. // implementations (#9632)
  7494. if (inBrowser && !isIE) {
  7495. var performance = window.performance;
  7496. if (
  7497. performance &&
  7498. typeof performance.now === 'function' &&
  7499. getNow() > document.createEvent('Event').timeStamp
  7500. ) {
  7501. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7502. // smaller than it, it means the event is using a hi-res timestamp,
  7503. // and we need to use the hi-res version for event listener timestamps as
  7504. // well.
  7505. getNow = function () { return performance.now(); };
  7506. }
  7507. }
  7508. /**
  7509. * Flush both queues and run the watchers.
  7510. */
  7511. function flushSchedulerQueue () {
  7512. currentFlushTimestamp = getNow();
  7513. flushing = true;
  7514. var watcher, id;
  7515. // Sort queue before flush.
  7516. // This ensures that:
  7517. // 1. Components are updated from parent to child. (because parent is always
  7518. // created before the child)
  7519. // 2. A component's user watchers are run before its render watcher (because
  7520. // user watchers are created before the render watcher)
  7521. // 3. If a component is destroyed during a parent component's watcher run,
  7522. // its watchers can be skipped.
  7523. queue.sort(function (a, b) { return a.id - b.id; });
  7524. // do not cache length because more watchers might be pushed
  7525. // as we run existing watchers
  7526. for (index = 0; index < queue.length; index++) {
  7527. watcher = queue[index];
  7528. if (watcher.before) {
  7529. watcher.before();
  7530. }
  7531. id = watcher.id;
  7532. has[id] = null;
  7533. watcher.run();
  7534. // in dev build, check and stop circular updates.
  7535. if ( true && has[id] != null) {
  7536. circular[id] = (circular[id] || 0) + 1;
  7537. if (circular[id] > MAX_UPDATE_COUNT) {
  7538. warn(
  7539. 'You may have an infinite update loop ' + (
  7540. watcher.user
  7541. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7542. : "in a component render function."
  7543. ),
  7544. watcher.vm
  7545. );
  7546. break
  7547. }
  7548. }
  7549. }
  7550. // keep copies of post queues before resetting state
  7551. var activatedQueue = activatedChildren.slice();
  7552. var updatedQueue = queue.slice();
  7553. resetSchedulerState();
  7554. // call component updated and activated hooks
  7555. callActivatedHooks(activatedQueue);
  7556. callUpdatedHooks(updatedQueue);
  7557. // devtool hook
  7558. /* istanbul ignore if */
  7559. if (devtools && config.devtools) {
  7560. devtools.emit('flush');
  7561. }
  7562. }
  7563. function callUpdatedHooks (queue) {
  7564. var i = queue.length;
  7565. while (i--) {
  7566. var watcher = queue[i];
  7567. var vm = watcher.vm;
  7568. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7569. callHook(vm, 'updated');
  7570. }
  7571. }
  7572. }
  7573. /**
  7574. * Queue a kept-alive component that was activated during patch.
  7575. * The queue will be processed after the entire tree has been patched.
  7576. */
  7577. function queueActivatedComponent (vm) {
  7578. // setting _inactive to false here so that a render function can
  7579. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7580. vm._inactive = false;
  7581. activatedChildren.push(vm);
  7582. }
  7583. function callActivatedHooks (queue) {
  7584. for (var i = 0; i < queue.length; i++) {
  7585. queue[i]._inactive = true;
  7586. activateChildComponent(queue[i], true /* true */);
  7587. }
  7588. }
  7589. /**
  7590. * Push a watcher into the watcher queue.
  7591. * Jobs with duplicate IDs will be skipped unless it's
  7592. * pushed when the queue is being flushed.
  7593. */
  7594. function queueWatcher (watcher) {
  7595. var id = watcher.id;
  7596. if (has[id] == null) {
  7597. has[id] = true;
  7598. if (!flushing) {
  7599. queue.push(watcher);
  7600. } else {
  7601. // if already flushing, splice the watcher based on its id
  7602. // if already past its id, it will be run next immediately.
  7603. var i = queue.length - 1;
  7604. while (i > index && queue[i].id > watcher.id) {
  7605. i--;
  7606. }
  7607. queue.splice(i + 1, 0, watcher);
  7608. }
  7609. // queue the flush
  7610. if (!waiting) {
  7611. waiting = true;
  7612. if ( true && !config.async) {
  7613. flushSchedulerQueue();
  7614. return
  7615. }
  7616. nextTick(flushSchedulerQueue);
  7617. }
  7618. }
  7619. }
  7620. /* */
  7621. var uid$2 = 0;
  7622. /**
  7623. * A watcher parses an expression, collects dependencies,
  7624. * and fires callback when the expression value changes.
  7625. * This is used for both the $watch() api and directives.
  7626. */
  7627. var Watcher = function Watcher (
  7628. vm,
  7629. expOrFn,
  7630. cb,
  7631. options,
  7632. isRenderWatcher
  7633. ) {
  7634. this.vm = vm;
  7635. if (isRenderWatcher) {
  7636. vm._watcher = this;
  7637. }
  7638. vm._watchers.push(this);
  7639. // options
  7640. if (options) {
  7641. this.deep = !!options.deep;
  7642. this.user = !!options.user;
  7643. this.lazy = !!options.lazy;
  7644. this.sync = !!options.sync;
  7645. this.before = options.before;
  7646. } else {
  7647. this.deep = this.user = this.lazy = this.sync = false;
  7648. }
  7649. this.cb = cb;
  7650. this.id = ++uid$2; // uid for batching
  7651. this.active = true;
  7652. this.dirty = this.lazy; // for lazy watchers
  7653. this.deps = [];
  7654. this.newDeps = [];
  7655. this.depIds = new _Set();
  7656. this.newDepIds = new _Set();
  7657. this.expression = true
  7658. ? expOrFn.toString()
  7659. : undefined;
  7660. // parse expression for getter
  7661. if (typeof expOrFn === 'function') {
  7662. this.getter = expOrFn;
  7663. } else {
  7664. this.getter = parsePath(expOrFn);
  7665. if (!this.getter) {
  7666. this.getter = noop;
  7667. true && warn(
  7668. "Failed watching path: \"" + expOrFn + "\" " +
  7669. 'Watcher only accepts simple dot-delimited paths. ' +
  7670. 'For full control, use a function instead.',
  7671. vm
  7672. );
  7673. }
  7674. }
  7675. this.value = this.lazy
  7676. ? undefined
  7677. : this.get();
  7678. };
  7679. /**
  7680. * Evaluate the getter, and re-collect dependencies.
  7681. */
  7682. Watcher.prototype.get = function get () {
  7683. pushTarget(this);
  7684. var value;
  7685. var vm = this.vm;
  7686. try {
  7687. value = this.getter.call(vm, vm);
  7688. } catch (e) {
  7689. if (this.user) {
  7690. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7691. } else {
  7692. throw e
  7693. }
  7694. } finally {
  7695. // "touch" every property so they are all tracked as
  7696. // dependencies for deep watching
  7697. if (this.deep) {
  7698. traverse(value);
  7699. }
  7700. popTarget();
  7701. this.cleanupDeps();
  7702. }
  7703. return value
  7704. };
  7705. /**
  7706. * Add a dependency to this directive.
  7707. */
  7708. Watcher.prototype.addDep = function addDep (dep) {
  7709. var id = dep.id;
  7710. if (!this.newDepIds.has(id)) {
  7711. this.newDepIds.add(id);
  7712. this.newDeps.push(dep);
  7713. if (!this.depIds.has(id)) {
  7714. dep.addSub(this);
  7715. }
  7716. }
  7717. };
  7718. /**
  7719. * Clean up for dependency collection.
  7720. */
  7721. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7722. var i = this.deps.length;
  7723. while (i--) {
  7724. var dep = this.deps[i];
  7725. if (!this.newDepIds.has(dep.id)) {
  7726. dep.removeSub(this);
  7727. }
  7728. }
  7729. var tmp = this.depIds;
  7730. this.depIds = this.newDepIds;
  7731. this.newDepIds = tmp;
  7732. this.newDepIds.clear();
  7733. tmp = this.deps;
  7734. this.deps = this.newDeps;
  7735. this.newDeps = tmp;
  7736. this.newDeps.length = 0;
  7737. };
  7738. /**
  7739. * Subscriber interface.
  7740. * Will be called when a dependency changes.
  7741. */
  7742. Watcher.prototype.update = function update () {
  7743. /* istanbul ignore else */
  7744. if (this.lazy) {
  7745. this.dirty = true;
  7746. } else if (this.sync) {
  7747. this.run();
  7748. } else {
  7749. queueWatcher(this);
  7750. }
  7751. };
  7752. /**
  7753. * Scheduler job interface.
  7754. * Will be called by the scheduler.
  7755. */
  7756. Watcher.prototype.run = function run () {
  7757. if (this.active) {
  7758. var value = this.get();
  7759. if (
  7760. value !== this.value ||
  7761. // Deep watchers and watchers on Object/Arrays should fire even
  7762. // when the value is the same, because the value may
  7763. // have mutated.
  7764. isObject(value) ||
  7765. this.deep
  7766. ) {
  7767. // set new value
  7768. var oldValue = this.value;
  7769. this.value = value;
  7770. if (this.user) {
  7771. try {
  7772. this.cb.call(this.vm, value, oldValue);
  7773. } catch (e) {
  7774. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7775. }
  7776. } else {
  7777. this.cb.call(this.vm, value, oldValue);
  7778. }
  7779. }
  7780. }
  7781. };
  7782. /**
  7783. * Evaluate the value of the watcher.
  7784. * This only gets called for lazy watchers.
  7785. */
  7786. Watcher.prototype.evaluate = function evaluate () {
  7787. this.value = this.get();
  7788. this.dirty = false;
  7789. };
  7790. /**
  7791. * Depend on all deps collected by this watcher.
  7792. */
  7793. Watcher.prototype.depend = function depend () {
  7794. var i = this.deps.length;
  7795. while (i--) {
  7796. this.deps[i].depend();
  7797. }
  7798. };
  7799. /**
  7800. * Remove self from all dependencies' subscriber list.
  7801. */
  7802. Watcher.prototype.teardown = function teardown () {
  7803. if (this.active) {
  7804. // remove self from vm's watcher list
  7805. // this is a somewhat expensive operation so we skip it
  7806. // if the vm is being destroyed.
  7807. if (!this.vm._isBeingDestroyed) {
  7808. remove(this.vm._watchers, this);
  7809. }
  7810. var i = this.deps.length;
  7811. while (i--) {
  7812. this.deps[i].removeSub(this);
  7813. }
  7814. this.active = false;
  7815. }
  7816. };
  7817. /* */
  7818. var sharedPropertyDefinition = {
  7819. enumerable: true,
  7820. configurable: true,
  7821. get: noop,
  7822. set: noop
  7823. };
  7824. function proxy (target, sourceKey, key) {
  7825. sharedPropertyDefinition.get = function proxyGetter () {
  7826. return this[sourceKey][key]
  7827. };
  7828. sharedPropertyDefinition.set = function proxySetter (val) {
  7829. this[sourceKey][key] = val;
  7830. };
  7831. Object.defineProperty(target, key, sharedPropertyDefinition);
  7832. }
  7833. function initState (vm) {
  7834. vm._watchers = [];
  7835. var opts = vm.$options;
  7836. if (opts.props) { initProps(vm, opts.props); }
  7837. if (opts.methods) { initMethods(vm, opts.methods); }
  7838. if (opts.data) {
  7839. initData(vm);
  7840. } else {
  7841. observe(vm._data = {}, true /* asRootData */);
  7842. }
  7843. if (opts.computed) { initComputed(vm, opts.computed); }
  7844. if (opts.watch && opts.watch !== nativeWatch) {
  7845. initWatch(vm, opts.watch);
  7846. }
  7847. }
  7848. function initProps (vm, propsOptions) {
  7849. var propsData = vm.$options.propsData || {};
  7850. var props = vm._props = {};
  7851. // cache prop keys so that future props updates can iterate using Array
  7852. // instead of dynamic object key enumeration.
  7853. var keys = vm.$options._propKeys = [];
  7854. var isRoot = !vm.$parent;
  7855. // root instance props should be converted
  7856. if (!isRoot) {
  7857. toggleObserving(false);
  7858. }
  7859. var loop = function ( key ) {
  7860. keys.push(key);
  7861. var value = validateProp(key, propsOptions, propsData, vm);
  7862. /* istanbul ignore else */
  7863. if (true) {
  7864. var hyphenatedKey = hyphenate(key);
  7865. if (isReservedAttribute(hyphenatedKey) ||
  7866. config.isReservedAttr(hyphenatedKey)) {
  7867. warn(
  7868. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7869. vm
  7870. );
  7871. }
  7872. defineReactive$$1(props, key, value, function () {
  7873. if (!isRoot && !isUpdatingChildComponent) {
  7874. {
  7875. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7876. return
  7877. }
  7878. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7879. if(
  7880. key === 'value' &&
  7881. Array.isArray(vm.$options.behaviors) &&
  7882. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7883. ){
  7884. return
  7885. }
  7886. if(vm._getFormData){
  7887. return
  7888. }
  7889. var $parent = vm.$parent;
  7890. while($parent){
  7891. if($parent.__next_tick_pending){
  7892. return
  7893. }
  7894. $parent = $parent.$parent;
  7895. }
  7896. }
  7897. warn(
  7898. "Avoid mutating a prop directly since the value will be " +
  7899. "overwritten whenever the parent component re-renders. " +
  7900. "Instead, use a data or computed property based on the prop's " +
  7901. "value. Prop being mutated: \"" + key + "\"",
  7902. vm
  7903. );
  7904. }
  7905. });
  7906. } else {}
  7907. // static props are already proxied on the component's prototype
  7908. // during Vue.extend(). We only need to proxy props defined at
  7909. // instantiation here.
  7910. if (!(key in vm)) {
  7911. proxy(vm, "_props", key);
  7912. }
  7913. };
  7914. for (var key in propsOptions) loop( key );
  7915. toggleObserving(true);
  7916. }
  7917. function initData (vm) {
  7918. var data = vm.$options.data;
  7919. data = vm._data = typeof data === 'function'
  7920. ? getData(data, vm)
  7921. : data || {};
  7922. if (!isPlainObject(data)) {
  7923. data = {};
  7924. true && warn(
  7925. 'data functions should return an object:\n' +
  7926. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7927. vm
  7928. );
  7929. }
  7930. // proxy data on instance
  7931. var keys = Object.keys(data);
  7932. var props = vm.$options.props;
  7933. var methods = vm.$options.methods;
  7934. var i = keys.length;
  7935. while (i--) {
  7936. var key = keys[i];
  7937. if (true) {
  7938. if (methods && hasOwn(methods, key)) {
  7939. warn(
  7940. ("Method \"" + key + "\" has already been defined as a data property."),
  7941. vm
  7942. );
  7943. }
  7944. }
  7945. if (props && hasOwn(props, key)) {
  7946. true && warn(
  7947. "The data property \"" + key + "\" is already declared as a prop. " +
  7948. "Use prop default value instead.",
  7949. vm
  7950. );
  7951. } else if (!isReserved(key)) {
  7952. proxy(vm, "_data", key);
  7953. }
  7954. }
  7955. // observe data
  7956. observe(data, true /* asRootData */);
  7957. }
  7958. function getData (data, vm) {
  7959. // #7573 disable dep collection when invoking data getters
  7960. pushTarget();
  7961. try {
  7962. return data.call(vm, vm)
  7963. } catch (e) {
  7964. handleError(e, vm, "data()");
  7965. return {}
  7966. } finally {
  7967. popTarget();
  7968. }
  7969. }
  7970. var computedWatcherOptions = { lazy: true };
  7971. function initComputed (vm, computed) {
  7972. // $flow-disable-line
  7973. var watchers = vm._computedWatchers = Object.create(null);
  7974. // computed properties are just getters during SSR
  7975. var isSSR = isServerRendering();
  7976. for (var key in computed) {
  7977. var userDef = computed[key];
  7978. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7979. if ( true && getter == null) {
  7980. warn(
  7981. ("Getter is missing for computed property \"" + key + "\"."),
  7982. vm
  7983. );
  7984. }
  7985. if (!isSSR) {
  7986. // create internal watcher for the computed property.
  7987. watchers[key] = new Watcher(
  7988. vm,
  7989. getter || noop,
  7990. noop,
  7991. computedWatcherOptions
  7992. );
  7993. }
  7994. // component-defined computed properties are already defined on the
  7995. // component prototype. We only need to define computed properties defined
  7996. // at instantiation here.
  7997. if (!(key in vm)) {
  7998. defineComputed(vm, key, userDef);
  7999. } else if (true) {
  8000. if (key in vm.$data) {
  8001. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8002. } else if (vm.$options.props && key in vm.$options.props) {
  8003. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8004. }
  8005. }
  8006. }
  8007. }
  8008. function defineComputed (
  8009. target,
  8010. key,
  8011. userDef
  8012. ) {
  8013. var shouldCache = !isServerRendering();
  8014. if (typeof userDef === 'function') {
  8015. sharedPropertyDefinition.get = shouldCache
  8016. ? createComputedGetter(key)
  8017. : createGetterInvoker(userDef);
  8018. sharedPropertyDefinition.set = noop;
  8019. } else {
  8020. sharedPropertyDefinition.get = userDef.get
  8021. ? shouldCache && userDef.cache !== false
  8022. ? createComputedGetter(key)
  8023. : createGetterInvoker(userDef.get)
  8024. : noop;
  8025. sharedPropertyDefinition.set = userDef.set || noop;
  8026. }
  8027. if ( true &&
  8028. sharedPropertyDefinition.set === noop) {
  8029. sharedPropertyDefinition.set = function () {
  8030. warn(
  8031. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8032. this
  8033. );
  8034. };
  8035. }
  8036. Object.defineProperty(target, key, sharedPropertyDefinition);
  8037. }
  8038. function createComputedGetter (key) {
  8039. return function computedGetter () {
  8040. var watcher = this._computedWatchers && this._computedWatchers[key];
  8041. if (watcher) {
  8042. if (watcher.dirty) {
  8043. watcher.evaluate();
  8044. }
  8045. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8046. watcher.depend();
  8047. }
  8048. return watcher.value
  8049. }
  8050. }
  8051. }
  8052. function createGetterInvoker(fn) {
  8053. return function computedGetter () {
  8054. return fn.call(this, this)
  8055. }
  8056. }
  8057. function initMethods (vm, methods) {
  8058. var props = vm.$options.props;
  8059. for (var key in methods) {
  8060. if (true) {
  8061. if (typeof methods[key] !== 'function') {
  8062. warn(
  8063. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8064. "Did you reference the function correctly?",
  8065. vm
  8066. );
  8067. }
  8068. if (props && hasOwn(props, key)) {
  8069. warn(
  8070. ("Method \"" + key + "\" has already been defined as a prop."),
  8071. vm
  8072. );
  8073. }
  8074. if ((key in vm) && isReserved(key)) {
  8075. warn(
  8076. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8077. "Avoid defining component methods that start with _ or $."
  8078. );
  8079. }
  8080. }
  8081. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8082. }
  8083. }
  8084. function initWatch (vm, watch) {
  8085. for (var key in watch) {
  8086. var handler = watch[key];
  8087. if (Array.isArray(handler)) {
  8088. for (var i = 0; i < handler.length; i++) {
  8089. createWatcher(vm, key, handler[i]);
  8090. }
  8091. } else {
  8092. createWatcher(vm, key, handler);
  8093. }
  8094. }
  8095. }
  8096. function createWatcher (
  8097. vm,
  8098. expOrFn,
  8099. handler,
  8100. options
  8101. ) {
  8102. if (isPlainObject(handler)) {
  8103. options = handler;
  8104. handler = handler.handler;
  8105. }
  8106. if (typeof handler === 'string') {
  8107. handler = vm[handler];
  8108. }
  8109. return vm.$watch(expOrFn, handler, options)
  8110. }
  8111. function stateMixin (Vue) {
  8112. // flow somehow has problems with directly declared definition object
  8113. // when using Object.defineProperty, so we have to procedurally build up
  8114. // the object here.
  8115. var dataDef = {};
  8116. dataDef.get = function () { return this._data };
  8117. var propsDef = {};
  8118. propsDef.get = function () { return this._props };
  8119. if (true) {
  8120. dataDef.set = function () {
  8121. warn(
  8122. 'Avoid replacing instance root $data. ' +
  8123. 'Use nested data properties instead.',
  8124. this
  8125. );
  8126. };
  8127. propsDef.set = function () {
  8128. warn("$props is readonly.", this);
  8129. };
  8130. }
  8131. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8132. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8133. Vue.prototype.$set = set;
  8134. Vue.prototype.$delete = del;
  8135. Vue.prototype.$watch = function (
  8136. expOrFn,
  8137. cb,
  8138. options
  8139. ) {
  8140. var vm = this;
  8141. if (isPlainObject(cb)) {
  8142. return createWatcher(vm, expOrFn, cb, options)
  8143. }
  8144. options = options || {};
  8145. options.user = true;
  8146. var watcher = new Watcher(vm, expOrFn, cb, options);
  8147. if (options.immediate) {
  8148. try {
  8149. cb.call(vm, watcher.value);
  8150. } catch (error) {
  8151. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8152. }
  8153. }
  8154. return function unwatchFn () {
  8155. watcher.teardown();
  8156. }
  8157. };
  8158. }
  8159. /* */
  8160. var uid$3 = 0;
  8161. function initMixin (Vue) {
  8162. Vue.prototype._init = function (options) {
  8163. var vm = this;
  8164. // a uid
  8165. vm._uid = uid$3++;
  8166. var startTag, endTag;
  8167. /* istanbul ignore if */
  8168. if ( true && config.performance && mark) {
  8169. startTag = "vue-perf-start:" + (vm._uid);
  8170. endTag = "vue-perf-end:" + (vm._uid);
  8171. mark(startTag);
  8172. }
  8173. // a flag to avoid this being observed
  8174. vm._isVue = true;
  8175. // merge options
  8176. if (options && options._isComponent) {
  8177. // optimize internal component instantiation
  8178. // since dynamic options merging is pretty slow, and none of the
  8179. // internal component options needs special treatment.
  8180. initInternalComponent(vm, options);
  8181. } else {
  8182. vm.$options = mergeOptions(
  8183. resolveConstructorOptions(vm.constructor),
  8184. options || {},
  8185. vm
  8186. );
  8187. }
  8188. /* istanbul ignore else */
  8189. if (true) {
  8190. initProxy(vm);
  8191. } else {}
  8192. // expose real self
  8193. vm._self = vm;
  8194. initLifecycle(vm);
  8195. initEvents(vm);
  8196. initRender(vm);
  8197. callHook(vm, 'beforeCreate');
  8198. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8199. initState(vm);
  8200. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8201. !vm._$fallback && callHook(vm, 'created');
  8202. /* istanbul ignore if */
  8203. if ( true && config.performance && mark) {
  8204. vm._name = formatComponentName(vm, false);
  8205. mark(endTag);
  8206. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8207. }
  8208. if (vm.$options.el) {
  8209. vm.$mount(vm.$options.el);
  8210. }
  8211. };
  8212. }
  8213. function initInternalComponent (vm, options) {
  8214. var opts = vm.$options = Object.create(vm.constructor.options);
  8215. // doing this because it's faster than dynamic enumeration.
  8216. var parentVnode = options._parentVnode;
  8217. opts.parent = options.parent;
  8218. opts._parentVnode = parentVnode;
  8219. var vnodeComponentOptions = parentVnode.componentOptions;
  8220. opts.propsData = vnodeComponentOptions.propsData;
  8221. opts._parentListeners = vnodeComponentOptions.listeners;
  8222. opts._renderChildren = vnodeComponentOptions.children;
  8223. opts._componentTag = vnodeComponentOptions.tag;
  8224. if (options.render) {
  8225. opts.render = options.render;
  8226. opts.staticRenderFns = options.staticRenderFns;
  8227. }
  8228. }
  8229. function resolveConstructorOptions (Ctor) {
  8230. var options = Ctor.options;
  8231. if (Ctor.super) {
  8232. var superOptions = resolveConstructorOptions(Ctor.super);
  8233. var cachedSuperOptions = Ctor.superOptions;
  8234. if (superOptions !== cachedSuperOptions) {
  8235. // super option changed,
  8236. // need to resolve new options.
  8237. Ctor.superOptions = superOptions;
  8238. // check if there are any late-modified/attached options (#4976)
  8239. var modifiedOptions = resolveModifiedOptions(Ctor);
  8240. // update base extend options
  8241. if (modifiedOptions) {
  8242. extend(Ctor.extendOptions, modifiedOptions);
  8243. }
  8244. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8245. if (options.name) {
  8246. options.components[options.name] = Ctor;
  8247. }
  8248. }
  8249. }
  8250. return options
  8251. }
  8252. function resolveModifiedOptions (Ctor) {
  8253. var modified;
  8254. var latest = Ctor.options;
  8255. var sealed = Ctor.sealedOptions;
  8256. for (var key in latest) {
  8257. if (latest[key] !== sealed[key]) {
  8258. if (!modified) { modified = {}; }
  8259. modified[key] = latest[key];
  8260. }
  8261. }
  8262. return modified
  8263. }
  8264. function Vue (options) {
  8265. if ( true &&
  8266. !(this instanceof Vue)
  8267. ) {
  8268. warn('Vue is a constructor and should be called with the `new` keyword');
  8269. }
  8270. this._init(options);
  8271. }
  8272. initMixin(Vue);
  8273. stateMixin(Vue);
  8274. eventsMixin(Vue);
  8275. lifecycleMixin(Vue);
  8276. renderMixin(Vue);
  8277. /* */
  8278. function initUse (Vue) {
  8279. Vue.use = function (plugin) {
  8280. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8281. if (installedPlugins.indexOf(plugin) > -1) {
  8282. return this
  8283. }
  8284. // additional parameters
  8285. var args = toArray(arguments, 1);
  8286. args.unshift(this);
  8287. if (typeof plugin.install === 'function') {
  8288. plugin.install.apply(plugin, args);
  8289. } else if (typeof plugin === 'function') {
  8290. plugin.apply(null, args);
  8291. }
  8292. installedPlugins.push(plugin);
  8293. return this
  8294. };
  8295. }
  8296. /* */
  8297. function initMixin$1 (Vue) {
  8298. Vue.mixin = function (mixin) {
  8299. this.options = mergeOptions(this.options, mixin);
  8300. return this
  8301. };
  8302. }
  8303. /* */
  8304. function initExtend (Vue) {
  8305. /**
  8306. * Each instance constructor, including Vue, has a unique
  8307. * cid. This enables us to create wrapped "child
  8308. * constructors" for prototypal inheritance and cache them.
  8309. */
  8310. Vue.cid = 0;
  8311. var cid = 1;
  8312. /**
  8313. * Class inheritance
  8314. */
  8315. Vue.extend = function (extendOptions) {
  8316. extendOptions = extendOptions || {};
  8317. var Super = this;
  8318. var SuperId = Super.cid;
  8319. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8320. if (cachedCtors[SuperId]) {
  8321. return cachedCtors[SuperId]
  8322. }
  8323. var name = extendOptions.name || Super.options.name;
  8324. if ( true && name) {
  8325. validateComponentName(name);
  8326. }
  8327. var Sub = function VueComponent (options) {
  8328. this._init(options);
  8329. };
  8330. Sub.prototype = Object.create(Super.prototype);
  8331. Sub.prototype.constructor = Sub;
  8332. Sub.cid = cid++;
  8333. Sub.options = mergeOptions(
  8334. Super.options,
  8335. extendOptions
  8336. );
  8337. Sub['super'] = Super;
  8338. // For props and computed properties, we define the proxy getters on
  8339. // the Vue instances at extension time, on the extended prototype. This
  8340. // avoids Object.defineProperty calls for each instance created.
  8341. if (Sub.options.props) {
  8342. initProps$1(Sub);
  8343. }
  8344. if (Sub.options.computed) {
  8345. initComputed$1(Sub);
  8346. }
  8347. // allow further extension/mixin/plugin usage
  8348. Sub.extend = Super.extend;
  8349. Sub.mixin = Super.mixin;
  8350. Sub.use = Super.use;
  8351. // create asset registers, so extended classes
  8352. // can have their private assets too.
  8353. ASSET_TYPES.forEach(function (type) {
  8354. Sub[type] = Super[type];
  8355. });
  8356. // enable recursive self-lookup
  8357. if (name) {
  8358. Sub.options.components[name] = Sub;
  8359. }
  8360. // keep a reference to the super options at extension time.
  8361. // later at instantiation we can check if Super's options have
  8362. // been updated.
  8363. Sub.superOptions = Super.options;
  8364. Sub.extendOptions = extendOptions;
  8365. Sub.sealedOptions = extend({}, Sub.options);
  8366. // cache constructor
  8367. cachedCtors[SuperId] = Sub;
  8368. return Sub
  8369. };
  8370. }
  8371. function initProps$1 (Comp) {
  8372. var props = Comp.options.props;
  8373. for (var key in props) {
  8374. proxy(Comp.prototype, "_props", key);
  8375. }
  8376. }
  8377. function initComputed$1 (Comp) {
  8378. var computed = Comp.options.computed;
  8379. for (var key in computed) {
  8380. defineComputed(Comp.prototype, key, computed[key]);
  8381. }
  8382. }
  8383. /* */
  8384. function initAssetRegisters (Vue) {
  8385. /**
  8386. * Create asset registration methods.
  8387. */
  8388. ASSET_TYPES.forEach(function (type) {
  8389. Vue[type] = function (
  8390. id,
  8391. definition
  8392. ) {
  8393. if (!definition) {
  8394. return this.options[type + 's'][id]
  8395. } else {
  8396. /* istanbul ignore if */
  8397. if ( true && type === 'component') {
  8398. validateComponentName(id);
  8399. }
  8400. if (type === 'component' && isPlainObject(definition)) {
  8401. definition.name = definition.name || id;
  8402. definition = this.options._base.extend(definition);
  8403. }
  8404. if (type === 'directive' && typeof definition === 'function') {
  8405. definition = { bind: definition, update: definition };
  8406. }
  8407. this.options[type + 's'][id] = definition;
  8408. return definition
  8409. }
  8410. };
  8411. });
  8412. }
  8413. /* */
  8414. function getComponentName (opts) {
  8415. return opts && (opts.Ctor.options.name || opts.tag)
  8416. }
  8417. function matches (pattern, name) {
  8418. if (Array.isArray(pattern)) {
  8419. return pattern.indexOf(name) > -1
  8420. } else if (typeof pattern === 'string') {
  8421. return pattern.split(',').indexOf(name) > -1
  8422. } else if (isRegExp(pattern)) {
  8423. return pattern.test(name)
  8424. }
  8425. /* istanbul ignore next */
  8426. return false
  8427. }
  8428. function pruneCache (keepAliveInstance, filter) {
  8429. var cache = keepAliveInstance.cache;
  8430. var keys = keepAliveInstance.keys;
  8431. var _vnode = keepAliveInstance._vnode;
  8432. for (var key in cache) {
  8433. var cachedNode = cache[key];
  8434. if (cachedNode) {
  8435. var name = getComponentName(cachedNode.componentOptions);
  8436. if (name && !filter(name)) {
  8437. pruneCacheEntry(cache, key, keys, _vnode);
  8438. }
  8439. }
  8440. }
  8441. }
  8442. function pruneCacheEntry (
  8443. cache,
  8444. key,
  8445. keys,
  8446. current
  8447. ) {
  8448. var cached$$1 = cache[key];
  8449. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8450. cached$$1.componentInstance.$destroy();
  8451. }
  8452. cache[key] = null;
  8453. remove(keys, key);
  8454. }
  8455. var patternTypes = [String, RegExp, Array];
  8456. var KeepAlive = {
  8457. name: 'keep-alive',
  8458. abstract: true,
  8459. props: {
  8460. include: patternTypes,
  8461. exclude: patternTypes,
  8462. max: [String, Number]
  8463. },
  8464. created: function created () {
  8465. this.cache = Object.create(null);
  8466. this.keys = [];
  8467. },
  8468. destroyed: function destroyed () {
  8469. for (var key in this.cache) {
  8470. pruneCacheEntry(this.cache, key, this.keys);
  8471. }
  8472. },
  8473. mounted: function mounted () {
  8474. var this$1 = this;
  8475. this.$watch('include', function (val) {
  8476. pruneCache(this$1, function (name) { return matches(val, name); });
  8477. });
  8478. this.$watch('exclude', function (val) {
  8479. pruneCache(this$1, function (name) { return !matches(val, name); });
  8480. });
  8481. },
  8482. render: function render () {
  8483. var slot = this.$slots.default;
  8484. var vnode = getFirstComponentChild(slot);
  8485. var componentOptions = vnode && vnode.componentOptions;
  8486. if (componentOptions) {
  8487. // check pattern
  8488. var name = getComponentName(componentOptions);
  8489. var ref = this;
  8490. var include = ref.include;
  8491. var exclude = ref.exclude;
  8492. if (
  8493. // not included
  8494. (include && (!name || !matches(include, name))) ||
  8495. // excluded
  8496. (exclude && name && matches(exclude, name))
  8497. ) {
  8498. return vnode
  8499. }
  8500. var ref$1 = this;
  8501. var cache = ref$1.cache;
  8502. var keys = ref$1.keys;
  8503. var key = vnode.key == null
  8504. // same constructor may get registered as different local components
  8505. // so cid alone is not enough (#3269)
  8506. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8507. : vnode.key;
  8508. if (cache[key]) {
  8509. vnode.componentInstance = cache[key].componentInstance;
  8510. // make current key freshest
  8511. remove(keys, key);
  8512. keys.push(key);
  8513. } else {
  8514. cache[key] = vnode;
  8515. keys.push(key);
  8516. // prune oldest entry
  8517. if (this.max && keys.length > parseInt(this.max)) {
  8518. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8519. }
  8520. }
  8521. vnode.data.keepAlive = true;
  8522. }
  8523. return vnode || (slot && slot[0])
  8524. }
  8525. };
  8526. var builtInComponents = {
  8527. KeepAlive: KeepAlive
  8528. };
  8529. /* */
  8530. function initGlobalAPI (Vue) {
  8531. // config
  8532. var configDef = {};
  8533. configDef.get = function () { return config; };
  8534. if (true) {
  8535. configDef.set = function () {
  8536. warn(
  8537. 'Do not replace the Vue.config object, set individual fields instead.'
  8538. );
  8539. };
  8540. }
  8541. Object.defineProperty(Vue, 'config', configDef);
  8542. // exposed util methods.
  8543. // NOTE: these are not considered part of the public API - avoid relying on
  8544. // them unless you are aware of the risk.
  8545. Vue.util = {
  8546. warn: warn,
  8547. extend: extend,
  8548. mergeOptions: mergeOptions,
  8549. defineReactive: defineReactive$$1
  8550. };
  8551. Vue.set = set;
  8552. Vue.delete = del;
  8553. Vue.nextTick = nextTick;
  8554. // 2.6 explicit observable API
  8555. Vue.observable = function (obj) {
  8556. observe(obj);
  8557. return obj
  8558. };
  8559. Vue.options = Object.create(null);
  8560. ASSET_TYPES.forEach(function (type) {
  8561. Vue.options[type + 's'] = Object.create(null);
  8562. });
  8563. // this is used to identify the "base" constructor to extend all plain-object
  8564. // components with in Weex's multi-instance scenarios.
  8565. Vue.options._base = Vue;
  8566. extend(Vue.options.components, builtInComponents);
  8567. initUse(Vue);
  8568. initMixin$1(Vue);
  8569. initExtend(Vue);
  8570. initAssetRegisters(Vue);
  8571. }
  8572. initGlobalAPI(Vue);
  8573. Object.defineProperty(Vue.prototype, '$isServer', {
  8574. get: isServerRendering
  8575. });
  8576. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8577. get: function get () {
  8578. /* istanbul ignore next */
  8579. return this.$vnode && this.$vnode.ssrContext
  8580. }
  8581. });
  8582. // expose FunctionalRenderContext for ssr runtime helper installation
  8583. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8584. value: FunctionalRenderContext
  8585. });
  8586. Vue.version = '2.6.11';
  8587. /**
  8588. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8589. */
  8590. var ARRAYTYPE = '[object Array]';
  8591. var OBJECTTYPE = '[object Object]';
  8592. var NULLTYPE = '[object Null]';
  8593. var UNDEFINEDTYPE = '[object Undefined]';
  8594. // const FUNCTIONTYPE = '[object Function]'
  8595. function diff(current, pre) {
  8596. var result = {};
  8597. syncKeys(current, pre);
  8598. _diff(current, pre, '', result);
  8599. return result
  8600. }
  8601. function syncKeys(current, pre) {
  8602. if (current === pre) { return }
  8603. var rootCurrentType = type(current);
  8604. var rootPreType = type(pre);
  8605. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8606. if(Object.keys(current).length >= Object.keys(pre).length){
  8607. for (var key in pre) {
  8608. var currentValue = current[key];
  8609. if (currentValue === undefined) {
  8610. current[key] = null;
  8611. } else {
  8612. syncKeys(currentValue, pre[key]);
  8613. }
  8614. }
  8615. }
  8616. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8617. if (current.length >= pre.length) {
  8618. pre.forEach(function (item, index) {
  8619. syncKeys(current[index], item);
  8620. });
  8621. }
  8622. }
  8623. }
  8624. function nullOrUndefined(currentType, preType) {
  8625. if(
  8626. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8627. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8628. ) {
  8629. return false
  8630. }
  8631. return true
  8632. }
  8633. function _diff(current, pre, path, result) {
  8634. if (current === pre) { return }
  8635. var rootCurrentType = type(current);
  8636. var rootPreType = type(pre);
  8637. if (rootCurrentType == OBJECTTYPE) {
  8638. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8639. setResult(result, path, current);
  8640. } else {
  8641. var loop = function ( key ) {
  8642. var currentValue = current[key];
  8643. var preValue = pre[key];
  8644. var currentType = type(currentValue);
  8645. var preType = type(preValue);
  8646. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8647. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8648. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8649. }
  8650. } else if (currentType == ARRAYTYPE) {
  8651. if (preType != ARRAYTYPE) {
  8652. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8653. } else {
  8654. if (currentValue.length < preValue.length) {
  8655. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8656. } else {
  8657. currentValue.forEach(function (item, index) {
  8658. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8659. });
  8660. }
  8661. }
  8662. } else if (currentType == OBJECTTYPE) {
  8663. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8664. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8665. } else {
  8666. for (var subKey in currentValue) {
  8667. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8668. }
  8669. }
  8670. }
  8671. };
  8672. for (var key in current) loop( key );
  8673. }
  8674. } else if (rootCurrentType == ARRAYTYPE) {
  8675. if (rootPreType != ARRAYTYPE) {
  8676. setResult(result, path, current);
  8677. } else {
  8678. if (current.length < pre.length) {
  8679. setResult(result, path, current);
  8680. } else {
  8681. current.forEach(function (item, index) {
  8682. _diff(item, pre[index], path + '[' + index + ']', result);
  8683. });
  8684. }
  8685. }
  8686. } else {
  8687. setResult(result, path, current);
  8688. }
  8689. }
  8690. function setResult(result, k, v) {
  8691. // if (type(v) != FUNCTIONTYPE) {
  8692. result[k] = v;
  8693. // }
  8694. }
  8695. function type(obj) {
  8696. return Object.prototype.toString.call(obj)
  8697. }
  8698. /* */
  8699. function flushCallbacks$1(vm) {
  8700. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8701. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8702. var mpInstance = vm.$scope;
  8703. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8704. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8705. }
  8706. var copies = vm.__next_tick_callbacks.slice(0);
  8707. vm.__next_tick_callbacks.length = 0;
  8708. for (var i = 0; i < copies.length; i++) {
  8709. copies[i]();
  8710. }
  8711. }
  8712. }
  8713. function hasRenderWatcher(vm) {
  8714. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8715. }
  8716. function nextTick$1(vm, cb) {
  8717. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8718. //2.nextTick 之前存在 render watcher
  8719. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8720. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8721. var mpInstance = vm.$scope;
  8722. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8723. ']:nextVueTick');
  8724. }
  8725. return nextTick(cb, vm)
  8726. }else{
  8727. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8728. var mpInstance$1 = vm.$scope;
  8729. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8730. ']:nextMPTick');
  8731. }
  8732. }
  8733. var _resolve;
  8734. if (!vm.__next_tick_callbacks) {
  8735. vm.__next_tick_callbacks = [];
  8736. }
  8737. vm.__next_tick_callbacks.push(function () {
  8738. if (cb) {
  8739. try {
  8740. cb.call(vm);
  8741. } catch (e) {
  8742. handleError(e, vm, 'nextTick');
  8743. }
  8744. } else if (_resolve) {
  8745. _resolve(vm);
  8746. }
  8747. });
  8748. // $flow-disable-line
  8749. if (!cb && typeof Promise !== 'undefined') {
  8750. return new Promise(function (resolve) {
  8751. _resolve = resolve;
  8752. })
  8753. }
  8754. }
  8755. /* */
  8756. function clearInstance(key, value) {
  8757. // 简易去除 Vue 和小程序组件实例
  8758. if (value) {
  8759. if (value._isVue || value.__v_isMPComponent) {
  8760. return {}
  8761. }
  8762. }
  8763. return value
  8764. }
  8765. function cloneWithData(vm) {
  8766. // 确保当前 vm 所有数据被同步
  8767. var ret = Object.create(null);
  8768. var dataKeys = [].concat(
  8769. Object.keys(vm._data || {}),
  8770. Object.keys(vm._computedWatchers || {}));
  8771. dataKeys.reduce(function(ret, key) {
  8772. ret[key] = vm[key];
  8773. return ret
  8774. }, ret);
  8775. // vue-composition-api
  8776. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8777. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8778. if (rawBindings) {
  8779. Object.keys(rawBindings).forEach(function (key) {
  8780. ret[key] = vm[key];
  8781. });
  8782. }
  8783. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8784. Object.assign(ret, vm.$mp.data || {});
  8785. if (
  8786. Array.isArray(vm.$options.behaviors) &&
  8787. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8788. ) { //form-field
  8789. ret['name'] = vm.name;
  8790. ret['value'] = vm.value;
  8791. }
  8792. return JSON.parse(JSON.stringify(ret, clearInstance))
  8793. }
  8794. var patch = function(oldVnode, vnode) {
  8795. var this$1 = this;
  8796. if (vnode === null) { //destroy
  8797. return
  8798. }
  8799. if (this.mpType === 'page' || this.mpType === 'component') {
  8800. var mpInstance = this.$scope;
  8801. var data = Object.create(null);
  8802. try {
  8803. data = cloneWithData(this);
  8804. } catch (err) {
  8805. console.error(err);
  8806. }
  8807. data.__webviewId__ = mpInstance.data.__webviewId__;
  8808. var mpData = Object.create(null);
  8809. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8810. mpData[key] = mpInstance.data[key];
  8811. });
  8812. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8813. if (Object.keys(diffData).length) {
  8814. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8815. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8816. ']差量更新',
  8817. JSON.stringify(diffData));
  8818. }
  8819. this.__next_tick_pending = true;
  8820. mpInstance.setData(diffData, function () {
  8821. this$1.__next_tick_pending = false;
  8822. flushCallbacks$1(this$1);
  8823. });
  8824. } else {
  8825. flushCallbacks$1(this);
  8826. }
  8827. }
  8828. };
  8829. /* */
  8830. function createEmptyRender() {
  8831. }
  8832. function mountComponent$1(
  8833. vm,
  8834. el,
  8835. hydrating
  8836. ) {
  8837. if (!vm.mpType) {//main.js 中的 new Vue
  8838. return vm
  8839. }
  8840. if (vm.mpType === 'app') {
  8841. vm.$options.render = createEmptyRender;
  8842. }
  8843. if (!vm.$options.render) {
  8844. vm.$options.render = createEmptyRender;
  8845. if (true) {
  8846. /* istanbul ignore if */
  8847. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8848. vm.$options.el || el) {
  8849. warn(
  8850. 'You are using the runtime-only build of Vue where the template ' +
  8851. 'compiler is not available. Either pre-compile the templates into ' +
  8852. 'render functions, or use the compiler-included build.',
  8853. vm
  8854. );
  8855. } else {
  8856. warn(
  8857. 'Failed to mount component: template or render function not defined.',
  8858. vm
  8859. );
  8860. }
  8861. }
  8862. }
  8863. !vm._$fallback && callHook(vm, 'beforeMount');
  8864. var updateComponent = function () {
  8865. vm._update(vm._render(), hydrating);
  8866. };
  8867. // we set this to vm._watcher inside the watcher's constructor
  8868. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8869. // component's mounted hook), which relies on vm._watcher being already defined
  8870. new Watcher(vm, updateComponent, noop, {
  8871. before: function before() {
  8872. if (vm._isMounted && !vm._isDestroyed) {
  8873. callHook(vm, 'beforeUpdate');
  8874. }
  8875. }
  8876. }, true /* isRenderWatcher */);
  8877. hydrating = false;
  8878. return vm
  8879. }
  8880. /* */
  8881. function renderClass (
  8882. staticClass,
  8883. dynamicClass
  8884. ) {
  8885. if (isDef(staticClass) || isDef(dynamicClass)) {
  8886. return concat(staticClass, stringifyClass(dynamicClass))
  8887. }
  8888. /* istanbul ignore next */
  8889. return ''
  8890. }
  8891. function concat (a, b) {
  8892. return a ? b ? (a + ' ' + b) : a : (b || '')
  8893. }
  8894. function stringifyClass (value) {
  8895. if (Array.isArray(value)) {
  8896. return stringifyArray(value)
  8897. }
  8898. if (isObject(value)) {
  8899. return stringifyObject(value)
  8900. }
  8901. if (typeof value === 'string') {
  8902. return value
  8903. }
  8904. /* istanbul ignore next */
  8905. return ''
  8906. }
  8907. function stringifyArray (value) {
  8908. var res = '';
  8909. var stringified;
  8910. for (var i = 0, l = value.length; i < l; i++) {
  8911. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8912. if (res) { res += ' '; }
  8913. res += stringified;
  8914. }
  8915. }
  8916. return res
  8917. }
  8918. function stringifyObject (value) {
  8919. var res = '';
  8920. for (var key in value) {
  8921. if (value[key]) {
  8922. if (res) { res += ' '; }
  8923. res += key;
  8924. }
  8925. }
  8926. return res
  8927. }
  8928. /* */
  8929. var parseStyleText = cached(function (cssText) {
  8930. var res = {};
  8931. var listDelimiter = /;(?![^(]*\))/g;
  8932. var propertyDelimiter = /:(.+)/;
  8933. cssText.split(listDelimiter).forEach(function (item) {
  8934. if (item) {
  8935. var tmp = item.split(propertyDelimiter);
  8936. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8937. }
  8938. });
  8939. return res
  8940. });
  8941. // normalize possible array / string values into Object
  8942. function normalizeStyleBinding (bindingStyle) {
  8943. if (Array.isArray(bindingStyle)) {
  8944. return toObject(bindingStyle)
  8945. }
  8946. if (typeof bindingStyle === 'string') {
  8947. return parseStyleText(bindingStyle)
  8948. }
  8949. return bindingStyle
  8950. }
  8951. /* */
  8952. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8953. function getTarget(obj, path) {
  8954. var parts = path.split('.');
  8955. var key = parts[0];
  8956. if (key.indexOf('__$n') === 0) { //number index
  8957. key = parseInt(key.replace('__$n', ''));
  8958. }
  8959. if (parts.length === 1) {
  8960. return obj[key]
  8961. }
  8962. return getTarget(obj[key], parts.slice(1).join('.'))
  8963. }
  8964. function internalMixin(Vue) {
  8965. Vue.config.errorHandler = function(err, vm, info) {
  8966. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8967. console.error(err);
  8968. /* eslint-disable no-undef */
  8969. var app = typeof getApp === 'function' && getApp();
  8970. if (app && app.onError) {
  8971. app.onError(err);
  8972. }
  8973. };
  8974. var oldEmit = Vue.prototype.$emit;
  8975. Vue.prototype.$emit = function(event) {
  8976. if (this.$scope && event) {
  8977. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8978. if (triggerEvent) {
  8979. try {
  8980. triggerEvent.call(this.$scope, event, {
  8981. __args__: toArray(arguments, 1)
  8982. });
  8983. } catch (error) {
  8984. }
  8985. }
  8986. }
  8987. return oldEmit.apply(this, arguments)
  8988. };
  8989. Vue.prototype.$nextTick = function(fn) {
  8990. return nextTick$1(this, fn)
  8991. };
  8992. MP_METHODS.forEach(function (method) {
  8993. Vue.prototype[method] = function(args) {
  8994. if (this.$scope && this.$scope[method]) {
  8995. return this.$scope[method](args)
  8996. }
  8997. // mp-alipay
  8998. if (typeof my === 'undefined') {
  8999. return
  9000. }
  9001. if (method === 'createSelectorQuery') {
  9002. /* eslint-disable no-undef */
  9003. return my.createSelectorQuery(args)
  9004. } else if (method === 'createIntersectionObserver') {
  9005. /* eslint-disable no-undef */
  9006. return my.createIntersectionObserver(args)
  9007. }
  9008. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9009. };
  9010. });
  9011. Vue.prototype.__init_provide = initProvide;
  9012. Vue.prototype.__init_injections = initInjections;
  9013. Vue.prototype.__call_hook = function(hook, args) {
  9014. var vm = this;
  9015. // #7573 disable dep collection when invoking lifecycle hooks
  9016. pushTarget();
  9017. var handlers = vm.$options[hook];
  9018. var info = hook + " hook";
  9019. var ret;
  9020. if (handlers) {
  9021. for (var i = 0, j = handlers.length; i < j; i++) {
  9022. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9023. }
  9024. }
  9025. if (vm._hasHookEvent) {
  9026. vm.$emit('hook:' + hook, args);
  9027. }
  9028. popTarget();
  9029. return ret
  9030. };
  9031. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9032. if (Array.isArray(modifiers)) {
  9033. if (modifiers.indexOf('trim') !== -1) {
  9034. value = value.trim();
  9035. }
  9036. if (modifiers.indexOf('number') !== -1) {
  9037. value = this._n(value);
  9038. }
  9039. }
  9040. if (!target) {
  9041. target = this;
  9042. }
  9043. // 解决动态属性添加
  9044. Vue.set(target, key, value);
  9045. };
  9046. Vue.prototype.__set_sync = function(target, key, value) {
  9047. if (!target) {
  9048. target = this;
  9049. }
  9050. // 解决动态属性添加
  9051. Vue.set(target, key, value);
  9052. };
  9053. Vue.prototype.__get_orig = function(item) {
  9054. if (isPlainObject(item)) {
  9055. return item['$orig'] || item
  9056. }
  9057. return item
  9058. };
  9059. Vue.prototype.__get_value = function(dataPath, target) {
  9060. return getTarget(target || this, dataPath)
  9061. };
  9062. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9063. return renderClass(staticClass, dynamicClass)
  9064. };
  9065. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9066. if (!dynamicStyle && !staticStyle) {
  9067. return ''
  9068. }
  9069. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9070. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9071. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9072. };
  9073. Vue.prototype.__map = function(val, iteratee) {
  9074. //TODO 暂不考虑 string
  9075. var ret, i, l, keys, key;
  9076. if (Array.isArray(val)) {
  9077. ret = new Array(val.length);
  9078. for (i = 0, l = val.length; i < l; i++) {
  9079. ret[i] = iteratee(val[i], i);
  9080. }
  9081. return ret
  9082. } else if (isObject(val)) {
  9083. keys = Object.keys(val);
  9084. ret = Object.create(null);
  9085. for (i = 0, l = keys.length; i < l; i++) {
  9086. key = keys[i];
  9087. ret[key] = iteratee(val[key], key, i);
  9088. }
  9089. return ret
  9090. } else if (typeof val === 'number') {
  9091. ret = new Array(val);
  9092. for (i = 0, l = val; i < l; i++) {
  9093. // 第一个参数暂时仍和小程序一致
  9094. ret[i] = iteratee(i, i);
  9095. }
  9096. return ret
  9097. }
  9098. return []
  9099. };
  9100. }
  9101. /* */
  9102. var LIFECYCLE_HOOKS$1 = [
  9103. //App
  9104. 'onLaunch',
  9105. 'onShow',
  9106. 'onHide',
  9107. 'onUniNViewMessage',
  9108. 'onPageNotFound',
  9109. 'onThemeChange',
  9110. 'onError',
  9111. 'onUnhandledRejection',
  9112. //Page
  9113. 'onInit',
  9114. 'onLoad',
  9115. // 'onShow',
  9116. 'onReady',
  9117. // 'onHide',
  9118. 'onUnload',
  9119. 'onPullDownRefresh',
  9120. 'onReachBottom',
  9121. 'onTabItemTap',
  9122. 'onAddToFavorites',
  9123. 'onShareTimeline',
  9124. 'onShareAppMessage',
  9125. 'onResize',
  9126. 'onPageScroll',
  9127. 'onNavigationBarButtonTap',
  9128. 'onBackPress',
  9129. 'onNavigationBarSearchInputChanged',
  9130. 'onNavigationBarSearchInputConfirmed',
  9131. 'onNavigationBarSearchInputClicked',
  9132. 'onUploadDouyinVideo',
  9133. 'onNFCReadMessage',
  9134. //Component
  9135. // 'onReady', // 兼容旧版本,应该移除该事件
  9136. 'onPageShow',
  9137. 'onPageHide',
  9138. 'onPageResize'
  9139. ];
  9140. function lifecycleMixin$1(Vue) {
  9141. //fixed vue-class-component
  9142. var oldExtend = Vue.extend;
  9143. Vue.extend = function(extendOptions) {
  9144. extendOptions = extendOptions || {};
  9145. var methods = extendOptions.methods;
  9146. if (methods) {
  9147. Object.keys(methods).forEach(function (methodName) {
  9148. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9149. extendOptions[methodName] = methods[methodName];
  9150. delete methods[methodName];
  9151. }
  9152. });
  9153. }
  9154. return oldExtend.call(this, extendOptions)
  9155. };
  9156. var strategies = Vue.config.optionMergeStrategies;
  9157. var mergeHook = strategies.created;
  9158. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9159. strategies[hook] = mergeHook;
  9160. });
  9161. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9162. }
  9163. /* */
  9164. // install platform patch function
  9165. Vue.prototype.__patch__ = patch;
  9166. // public mount method
  9167. Vue.prototype.$mount = function(
  9168. el ,
  9169. hydrating
  9170. ) {
  9171. return mountComponent$1(this, el, hydrating)
  9172. };
  9173. lifecycleMixin$1(Vue);
  9174. internalMixin(Vue);
  9175. /* */
  9176. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9177. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9178. /***/ }),
  9179. /***/ 252:
  9180. /*!******************************************************************************************************!*\
  9181. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  9182. \******************************************************************************************************/
  9183. /*! no static exports found */
  9184. /***/ (function(module, exports, __webpack_require__) {
  9185. "use strict";
  9186. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9187. Object.defineProperty(exports, "__esModule", {
  9188. value: true
  9189. });
  9190. exports.default = void 0;
  9191. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  9192. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 253));
  9193. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 254));
  9194. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 256));
  9195. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  9196. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9197. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9198. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9199. 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); }; }
  9200. 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; } }
  9201. var pattern = {
  9202. email: /^\S+?@\S+?\.\S+?$/,
  9203. 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]$/,
  9204. 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')
  9205. };
  9206. var FORMAT_MAPPING = {
  9207. "int": 'integer',
  9208. "bool": 'boolean',
  9209. "double": 'number',
  9210. "long": 'number',
  9211. "password": 'string'
  9212. // "fileurls": 'array'
  9213. };
  9214. function formatMessage(args) {
  9215. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  9216. var defaultMessage = ['label'];
  9217. defaultMessage.forEach(function (item) {
  9218. if (args[item] === undefined) {
  9219. args[item] = '';
  9220. }
  9221. });
  9222. var str = resources;
  9223. for (var key in args) {
  9224. var reg = new RegExp('{' + key + '}');
  9225. str = str.replace(reg, args[key]);
  9226. }
  9227. return str;
  9228. }
  9229. function isEmptyValue(value, type) {
  9230. if (value === undefined || value === null) {
  9231. return true;
  9232. }
  9233. if (typeof value === 'string' && !value) {
  9234. return true;
  9235. }
  9236. if (Array.isArray(value) && !value.length) {
  9237. return true;
  9238. }
  9239. if (type === 'object' && !Object.keys(value).length) {
  9240. return true;
  9241. }
  9242. return false;
  9243. }
  9244. var types = {
  9245. integer: function integer(value) {
  9246. return types.number(value) && parseInt(value, 10) === value;
  9247. },
  9248. string: function string(value) {
  9249. return typeof value === 'string';
  9250. },
  9251. number: function number(value) {
  9252. if (isNaN(value)) {
  9253. return false;
  9254. }
  9255. return typeof value === 'number';
  9256. },
  9257. "boolean": function boolean(value) {
  9258. return typeof value === 'boolean';
  9259. },
  9260. "float": function float(value) {
  9261. return types.number(value) && !types.integer(value);
  9262. },
  9263. array: function array(value) {
  9264. return Array.isArray(value);
  9265. },
  9266. object: function object(value) {
  9267. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  9268. },
  9269. date: function date(value) {
  9270. return value instanceof Date;
  9271. },
  9272. timestamp: function timestamp(value) {
  9273. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  9274. return false;
  9275. }
  9276. return true;
  9277. },
  9278. file: function file(value) {
  9279. return typeof value.url === 'string';
  9280. },
  9281. email: function email(value) {
  9282. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  9283. },
  9284. url: function url(value) {
  9285. return typeof value === 'string' && !!value.match(pattern.url);
  9286. },
  9287. pattern: function pattern(reg, value) {
  9288. try {
  9289. return new RegExp(reg).test(value);
  9290. } catch (e) {
  9291. return false;
  9292. }
  9293. },
  9294. method: function method(value) {
  9295. return typeof value === 'function';
  9296. },
  9297. idcard: function idcard(value) {
  9298. return typeof value === 'string' && !!value.match(pattern.idcard);
  9299. },
  9300. 'url-https': function urlHttps(value) {
  9301. return this.url(value) && value.startsWith('https://');
  9302. },
  9303. 'url-scheme': function urlScheme(value) {
  9304. return value.startsWith('://');
  9305. },
  9306. 'url-web': function urlWeb(value) {
  9307. return false;
  9308. }
  9309. };
  9310. var RuleValidator = /*#__PURE__*/function () {
  9311. function RuleValidator(message) {
  9312. (0, _classCallCheck2.default)(this, RuleValidator);
  9313. this._message = message;
  9314. }
  9315. (0, _createClass2.default)(RuleValidator, [{
  9316. key: "validateRule",
  9317. value: function () {
  9318. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  9319. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  9320. return _regenerator.default.wrap(function _callee$(_context) {
  9321. while (1) {
  9322. switch (_context.prev = _context.next) {
  9323. case 0:
  9324. result = null;
  9325. rules = fieldValue.rules;
  9326. hasRequired = rules.findIndex(function (item) {
  9327. return item.required;
  9328. });
  9329. if (!(hasRequired < 0)) {
  9330. _context.next = 8;
  9331. break;
  9332. }
  9333. if (!(value === null || value === undefined)) {
  9334. _context.next = 6;
  9335. break;
  9336. }
  9337. return _context.abrupt("return", result);
  9338. case 6:
  9339. if (!(typeof value === 'string' && !value.length)) {
  9340. _context.next = 8;
  9341. break;
  9342. }
  9343. return _context.abrupt("return", result);
  9344. case 8:
  9345. message = this._message;
  9346. if (!(rules === undefined)) {
  9347. _context.next = 11;
  9348. break;
  9349. }
  9350. return _context.abrupt("return", message['default']);
  9351. case 11:
  9352. i = 0;
  9353. case 12:
  9354. if (!(i < rules.length)) {
  9355. _context.next = 35;
  9356. break;
  9357. }
  9358. rule = rules[i];
  9359. vt = this._getValidateType(rule);
  9360. Object.assign(rule, {
  9361. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  9362. });
  9363. if (!RuleValidatorHelper[vt]) {
  9364. _context.next = 20;
  9365. break;
  9366. }
  9367. result = RuleValidatorHelper[vt](rule, value, message);
  9368. if (!(result != null)) {
  9369. _context.next = 20;
  9370. break;
  9371. }
  9372. return _context.abrupt("break", 35);
  9373. case 20:
  9374. if (!rule.validateExpr) {
  9375. _context.next = 26;
  9376. break;
  9377. }
  9378. now = Date.now();
  9379. resultExpr = rule.validateExpr(value, allData, now);
  9380. if (!(resultExpr === false)) {
  9381. _context.next = 26;
  9382. break;
  9383. }
  9384. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  9385. return _context.abrupt("break", 35);
  9386. case 26:
  9387. if (!rule.validateFunction) {
  9388. _context.next = 32;
  9389. break;
  9390. }
  9391. _context.next = 29;
  9392. return this.validateFunction(rule, value, data, allData, vt);
  9393. case 29:
  9394. result = _context.sent;
  9395. if (!(result !== null)) {
  9396. _context.next = 32;
  9397. break;
  9398. }
  9399. return _context.abrupt("break", 35);
  9400. case 32:
  9401. i++;
  9402. _context.next = 12;
  9403. break;
  9404. case 35:
  9405. if (result !== null) {
  9406. result = message.TAG + result;
  9407. }
  9408. return _context.abrupt("return", result);
  9409. case 37:
  9410. case "end":
  9411. return _context.stop();
  9412. }
  9413. }
  9414. }, _callee, this);
  9415. }));
  9416. function validateRule(_x, _x2, _x3, _x4, _x5) {
  9417. return _validateRule.apply(this, arguments);
  9418. }
  9419. return validateRule;
  9420. }()
  9421. }, {
  9422. key: "validateFunction",
  9423. value: function () {
  9424. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  9425. var result, callbackMessage, res;
  9426. return _regenerator.default.wrap(function _callee2$(_context2) {
  9427. while (1) {
  9428. switch (_context2.prev = _context2.next) {
  9429. case 0:
  9430. result = null;
  9431. _context2.prev = 1;
  9432. callbackMessage = null;
  9433. _context2.next = 5;
  9434. return rule.validateFunction(rule, value, allData || data, function (message) {
  9435. callbackMessage = message;
  9436. });
  9437. case 5:
  9438. res = _context2.sent;
  9439. if (callbackMessage || typeof res === 'string' && res || res === false) {
  9440. result = this._getMessage(rule, callbackMessage || res, vt);
  9441. }
  9442. _context2.next = 12;
  9443. break;
  9444. case 9:
  9445. _context2.prev = 9;
  9446. _context2.t0 = _context2["catch"](1);
  9447. result = this._getMessage(rule, _context2.t0.message, vt);
  9448. case 12:
  9449. return _context2.abrupt("return", result);
  9450. case 13:
  9451. case "end":
  9452. return _context2.stop();
  9453. }
  9454. }
  9455. }, _callee2, this, [[1, 9]]);
  9456. }));
  9457. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  9458. return _validateFunction.apply(this, arguments);
  9459. }
  9460. return validateFunction;
  9461. }()
  9462. }, {
  9463. key: "_getMessage",
  9464. value: function _getMessage(rule, message, vt) {
  9465. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  9466. }
  9467. }, {
  9468. key: "_getValidateType",
  9469. value: function _getValidateType(rule) {
  9470. var result = '';
  9471. if (rule.required) {
  9472. result = 'required';
  9473. } else if (rule.format) {
  9474. result = 'format';
  9475. } else if (rule.arrayType) {
  9476. result = 'arrayTypeFormat';
  9477. } else if (rule.range) {
  9478. result = 'range';
  9479. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  9480. result = 'rangeNumber';
  9481. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  9482. result = 'rangeLength';
  9483. } else if (rule.pattern) {
  9484. result = 'pattern';
  9485. } else if (rule.validateFunction) {
  9486. result = 'validateFunction';
  9487. }
  9488. return result;
  9489. }
  9490. }]);
  9491. return RuleValidator;
  9492. }();
  9493. var RuleValidatorHelper = {
  9494. required: function required(rule, value, message) {
  9495. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  9496. return formatMessage(rule, rule.errorMessage || message.required);
  9497. }
  9498. return null;
  9499. },
  9500. range: function range(rule, value, message) {
  9501. var range = rule.range,
  9502. errorMessage = rule.errorMessage;
  9503. var list = new Array(range.length);
  9504. for (var i = 0; i < range.length; i++) {
  9505. var item = range[i];
  9506. if (types.object(item) && item.value !== undefined) {
  9507. list[i] = item.value;
  9508. } else {
  9509. list[i] = item;
  9510. }
  9511. }
  9512. var result = false;
  9513. if (Array.isArray(value)) {
  9514. result = new Set(value.concat(list)).size === list.length;
  9515. } else {
  9516. if (list.indexOf(value) > -1) {
  9517. result = true;
  9518. }
  9519. }
  9520. if (!result) {
  9521. return formatMessage(rule, errorMessage || message['enum']);
  9522. }
  9523. return null;
  9524. },
  9525. rangeNumber: function rangeNumber(rule, value, message) {
  9526. if (!types.number(value)) {
  9527. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9528. }
  9529. var minimum = rule.minimum,
  9530. maximum = rule.maximum,
  9531. exclusiveMinimum = rule.exclusiveMinimum,
  9532. exclusiveMaximum = rule.exclusiveMaximum;
  9533. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  9534. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  9535. if (minimum !== undefined && min) {
  9536. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  9537. } else if (maximum !== undefined && max) {
  9538. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  9539. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  9540. return formatMessage(rule, rule.errorMessage || message['number'].range);
  9541. }
  9542. return null;
  9543. },
  9544. rangeLength: function rangeLength(rule, value, message) {
  9545. if (!types.string(value) && !types.array(value)) {
  9546. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9547. }
  9548. var min = rule.minLength;
  9549. var max = rule.maxLength;
  9550. var val = value.length;
  9551. if (min !== undefined && val < min) {
  9552. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  9553. } else if (max !== undefined && val > max) {
  9554. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  9555. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  9556. return formatMessage(rule, rule.errorMessage || message['length'].range);
  9557. }
  9558. return null;
  9559. },
  9560. pattern: function pattern(rule, value, message) {
  9561. if (!types['pattern'](rule.pattern, value)) {
  9562. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9563. }
  9564. return null;
  9565. },
  9566. format: function format(rule, value, message) {
  9567. var customTypes = Object.keys(types);
  9568. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  9569. if (customTypes.indexOf(format) > -1) {
  9570. if (!types[format](value)) {
  9571. return formatMessage(rule, rule.errorMessage || message.typeError);
  9572. }
  9573. }
  9574. return null;
  9575. },
  9576. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  9577. if (!Array.isArray(value)) {
  9578. return formatMessage(rule, rule.errorMessage || message.typeError);
  9579. }
  9580. for (var i = 0; i < value.length; i++) {
  9581. var element = value[i];
  9582. var formatResult = this.format(rule, element, message);
  9583. if (formatResult !== null) {
  9584. return formatResult;
  9585. }
  9586. }
  9587. return null;
  9588. }
  9589. };
  9590. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  9591. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  9592. var _super = _createSuper(SchemaValidator);
  9593. function SchemaValidator(schema, options) {
  9594. var _this;
  9595. (0, _classCallCheck2.default)(this, SchemaValidator);
  9596. _this = _super.call(this, SchemaValidator.message);
  9597. _this._schema = schema;
  9598. _this._options = options || null;
  9599. return _this;
  9600. }
  9601. (0, _createClass2.default)(SchemaValidator, [{
  9602. key: "updateSchema",
  9603. value: function updateSchema(schema) {
  9604. this._schema = schema;
  9605. }
  9606. }, {
  9607. key: "validate",
  9608. value: function () {
  9609. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  9610. var result;
  9611. return _regenerator.default.wrap(function _callee3$(_context3) {
  9612. while (1) {
  9613. switch (_context3.prev = _context3.next) {
  9614. case 0:
  9615. result = this._checkFieldInSchema(data);
  9616. if (result) {
  9617. _context3.next = 5;
  9618. break;
  9619. }
  9620. _context3.next = 4;
  9621. return this.invokeValidate(data, false, allData);
  9622. case 4:
  9623. result = _context3.sent;
  9624. case 5:
  9625. return _context3.abrupt("return", result.length ? result[0] : null);
  9626. case 6:
  9627. case "end":
  9628. return _context3.stop();
  9629. }
  9630. }
  9631. }, _callee3, this);
  9632. }));
  9633. function validate(_x11, _x12) {
  9634. return _validate.apply(this, arguments);
  9635. }
  9636. return validate;
  9637. }()
  9638. }, {
  9639. key: "validateAll",
  9640. value: function () {
  9641. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  9642. var result;
  9643. return _regenerator.default.wrap(function _callee4$(_context4) {
  9644. while (1) {
  9645. switch (_context4.prev = _context4.next) {
  9646. case 0:
  9647. result = this._checkFieldInSchema(data);
  9648. if (result) {
  9649. _context4.next = 5;
  9650. break;
  9651. }
  9652. _context4.next = 4;
  9653. return this.invokeValidate(data, true, allData);
  9654. case 4:
  9655. result = _context4.sent;
  9656. case 5:
  9657. return _context4.abrupt("return", result);
  9658. case 6:
  9659. case "end":
  9660. return _context4.stop();
  9661. }
  9662. }
  9663. }, _callee4, this);
  9664. }));
  9665. function validateAll(_x13, _x14) {
  9666. return _validateAll.apply(this, arguments);
  9667. }
  9668. return validateAll;
  9669. }()
  9670. }, {
  9671. key: "validateUpdate",
  9672. value: function () {
  9673. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  9674. var result;
  9675. return _regenerator.default.wrap(function _callee5$(_context5) {
  9676. while (1) {
  9677. switch (_context5.prev = _context5.next) {
  9678. case 0:
  9679. result = this._checkFieldInSchema(data);
  9680. if (result) {
  9681. _context5.next = 5;
  9682. break;
  9683. }
  9684. _context5.next = 4;
  9685. return this.invokeValidateUpdate(data, false, allData);
  9686. case 4:
  9687. result = _context5.sent;
  9688. case 5:
  9689. return _context5.abrupt("return", result.length ? result[0] : null);
  9690. case 6:
  9691. case "end":
  9692. return _context5.stop();
  9693. }
  9694. }
  9695. }, _callee5, this);
  9696. }));
  9697. function validateUpdate(_x15, _x16) {
  9698. return _validateUpdate.apply(this, arguments);
  9699. }
  9700. return validateUpdate;
  9701. }()
  9702. }, {
  9703. key: "invokeValidate",
  9704. value: function () {
  9705. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  9706. var result, schema, key, value, errorMessage;
  9707. return _regenerator.default.wrap(function _callee6$(_context6) {
  9708. while (1) {
  9709. switch (_context6.prev = _context6.next) {
  9710. case 0:
  9711. result = [];
  9712. schema = this._schema;
  9713. _context6.t0 = _regenerator.default.keys(schema);
  9714. case 3:
  9715. if ((_context6.t1 = _context6.t0()).done) {
  9716. _context6.next = 15;
  9717. break;
  9718. }
  9719. key = _context6.t1.value;
  9720. value = schema[key];
  9721. _context6.next = 8;
  9722. return this.validateRule(key, value, data[key], data, allData);
  9723. case 8:
  9724. errorMessage = _context6.sent;
  9725. if (!(errorMessage != null)) {
  9726. _context6.next = 13;
  9727. break;
  9728. }
  9729. result.push({
  9730. key: key,
  9731. errorMessage: errorMessage
  9732. });
  9733. if (all) {
  9734. _context6.next = 13;
  9735. break;
  9736. }
  9737. return _context6.abrupt("break", 15);
  9738. case 13:
  9739. _context6.next = 3;
  9740. break;
  9741. case 15:
  9742. return _context6.abrupt("return", result);
  9743. case 16:
  9744. case "end":
  9745. return _context6.stop();
  9746. }
  9747. }
  9748. }, _callee6, this);
  9749. }));
  9750. function invokeValidate(_x17, _x18, _x19) {
  9751. return _invokeValidate.apply(this, arguments);
  9752. }
  9753. return invokeValidate;
  9754. }()
  9755. }, {
  9756. key: "invokeValidateUpdate",
  9757. value: function () {
  9758. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  9759. var result, key, errorMessage;
  9760. return _regenerator.default.wrap(function _callee7$(_context7) {
  9761. while (1) {
  9762. switch (_context7.prev = _context7.next) {
  9763. case 0:
  9764. result = [];
  9765. _context7.t0 = _regenerator.default.keys(data);
  9766. case 2:
  9767. if ((_context7.t1 = _context7.t0()).done) {
  9768. _context7.next = 13;
  9769. break;
  9770. }
  9771. key = _context7.t1.value;
  9772. _context7.next = 6;
  9773. return this.validateRule(key, this._schema[key], data[key], data, allData);
  9774. case 6:
  9775. errorMessage = _context7.sent;
  9776. if (!(errorMessage != null)) {
  9777. _context7.next = 11;
  9778. break;
  9779. }
  9780. result.push({
  9781. key: key,
  9782. errorMessage: errorMessage
  9783. });
  9784. if (all) {
  9785. _context7.next = 11;
  9786. break;
  9787. }
  9788. return _context7.abrupt("break", 13);
  9789. case 11:
  9790. _context7.next = 2;
  9791. break;
  9792. case 13:
  9793. return _context7.abrupt("return", result);
  9794. case 14:
  9795. case "end":
  9796. return _context7.stop();
  9797. }
  9798. }
  9799. }, _callee7, this);
  9800. }));
  9801. function invokeValidateUpdate(_x20, _x21, _x22) {
  9802. return _invokeValidateUpdate.apply(this, arguments);
  9803. }
  9804. return invokeValidateUpdate;
  9805. }()
  9806. }, {
  9807. key: "_checkFieldInSchema",
  9808. value: function _checkFieldInSchema(data) {
  9809. var keys = Object.keys(data);
  9810. var keys2 = Object.keys(this._schema);
  9811. if (new Set(keys.concat(keys2)).size === keys2.length) {
  9812. return '';
  9813. }
  9814. var noExistFields = keys.filter(function (key) {
  9815. return keys2.indexOf(key) < 0;
  9816. });
  9817. var errorMessage = formatMessage({
  9818. field: JSON.stringify(noExistFields)
  9819. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  9820. return [{
  9821. key: 'invalid',
  9822. errorMessage: errorMessage
  9823. }];
  9824. }
  9825. }]);
  9826. return SchemaValidator;
  9827. }(RuleValidator);
  9828. function Message() {
  9829. return {
  9830. TAG: "",
  9831. default: '验证错误',
  9832. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  9833. validateFunction: '验证无效',
  9834. required: '{label}必填',
  9835. 'enum': '{label}超出范围',
  9836. timestamp: '{label}格式无效',
  9837. whitespace: '{label}不能为空',
  9838. typeError: '{label}类型无效',
  9839. date: {
  9840. format: '{label}日期{value}格式无效',
  9841. parse: '{label}日期无法解析,{value}无效',
  9842. invalid: '{label}日期{value}无效'
  9843. },
  9844. length: {
  9845. minLength: '{label}长度不能少于{minLength}',
  9846. maxLength: '{label}长度不能超过{maxLength}',
  9847. range: '{label}必须介于{minLength}和{maxLength}之间'
  9848. },
  9849. number: {
  9850. minimum: '{label}不能小于{minimum}',
  9851. maximum: '{label}不能大于{maximum}',
  9852. exclusiveMinimum: '{label}不能小于等于{minimum}',
  9853. exclusiveMaximum: '{label}不能大于等于{maximum}',
  9854. range: '{label}必须介于{minimum}and{maximum}之间'
  9855. },
  9856. pattern: {
  9857. mismatch: '{label}格式不匹配'
  9858. }
  9859. };
  9860. }
  9861. SchemaValidator.message = new Message();
  9862. var _default = SchemaValidator;
  9863. exports.default = _default;
  9864. /***/ }),
  9865. /***/ 253:
  9866. /*!*********************************************************!*\
  9867. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  9868. \*********************************************************/
  9869. /*! no static exports found */
  9870. /***/ (function(module, exports, __webpack_require__) {
  9871. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  9872. function _inherits(subClass, superClass) {
  9873. if (typeof superClass !== "function" && superClass !== null) {
  9874. throw new TypeError("Super expression must either be null or a function");
  9875. }
  9876. subClass.prototype = Object.create(superClass && superClass.prototype, {
  9877. constructor: {
  9878. value: subClass,
  9879. writable: true,
  9880. configurable: true
  9881. }
  9882. });
  9883. Object.defineProperty(subClass, "prototype", {
  9884. writable: false
  9885. });
  9886. if (superClass) setPrototypeOf(subClass, superClass);
  9887. }
  9888. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9889. /***/ }),
  9890. /***/ 254:
  9891. /*!**************************************************************************!*\
  9892. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  9893. \**************************************************************************/
  9894. /*! no static exports found */
  9895. /***/ (function(module, exports, __webpack_require__) {
  9896. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9897. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 255);
  9898. function _possibleConstructorReturn(self, call) {
  9899. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  9900. return call;
  9901. } else if (call !== void 0) {
  9902. throw new TypeError("Derived constructors may only return object or undefined");
  9903. }
  9904. return assertThisInitialized(self);
  9905. }
  9906. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9907. /***/ }),
  9908. /***/ 255:
  9909. /*!**********************************************************************!*\
  9910. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  9911. \**********************************************************************/
  9912. /*! no static exports found */
  9913. /***/ (function(module, exports) {
  9914. function _assertThisInitialized(self) {
  9915. if (self === void 0) {
  9916. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9917. }
  9918. return self;
  9919. }
  9920. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9921. /***/ }),
  9922. /***/ 256:
  9923. /*!***************************************************************!*\
  9924. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  9925. \***************************************************************/
  9926. /*! no static exports found */
  9927. /***/ (function(module, exports) {
  9928. function _getPrototypeOf(o) {
  9929. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  9930. return o.__proto__ || Object.getPrototypeOf(o);
  9931. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9932. return _getPrototypeOf(o);
  9933. }
  9934. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9935. /***/ }),
  9936. /***/ 257:
  9937. /*!***************************************************************************************************!*\
  9938. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  9939. \***************************************************************************************************/
  9940. /*! no static exports found */
  9941. /***/ (function(module, exports, __webpack_require__) {
  9942. "use strict";
  9943. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9944. Object.defineProperty(exports, "__esModule", {
  9945. value: true
  9946. });
  9947. 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;
  9948. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9949. /**
  9950. * 简单处理对象拷贝
  9951. * @param {Obejct} 被拷贝对象
  9952. * @@return {Object} 拷贝对象
  9953. */
  9954. var deepCopy = function deepCopy(val) {
  9955. return JSON.parse(JSON.stringify(val));
  9956. };
  9957. /**
  9958. * 过滤数字类型
  9959. * @param {String} format 数字类型
  9960. * @@return {Boolean} 返回是否为数字类型
  9961. */
  9962. exports.deepCopy = deepCopy;
  9963. var typeFilter = function typeFilter(format) {
  9964. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  9965. };
  9966. /**
  9967. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  9968. * @param {String} key 字段名
  9969. * @param {any} value 字段值
  9970. * @param {Object} rules 表单校验规则
  9971. */
  9972. exports.typeFilter = typeFilter;
  9973. var getValue = function getValue(key, value, rules) {
  9974. var isRuleNumType = rules.find(function (val) {
  9975. return val.format && typeFilter(val.format);
  9976. });
  9977. var isRuleBoolType = rules.find(function (val) {
  9978. return val.format && val.format === 'boolean' || val.format === 'bool';
  9979. });
  9980. // 输入类型为 number
  9981. if (!!isRuleNumType) {
  9982. if (!value && value !== 0) {
  9983. value = null;
  9984. } else {
  9985. value = isNumber(Number(value)) ? Number(value) : value;
  9986. }
  9987. }
  9988. // 输入类型为 boolean
  9989. if (!!isRuleBoolType) {
  9990. value = isBoolean(value) ? value : false;
  9991. }
  9992. return value;
  9993. };
  9994. /**
  9995. * 获取表单数据
  9996. * @param {String|Array} name 真实名称,需要使用 realName 获取
  9997. * @param {Object} data 原始数据
  9998. * @param {any} value 需要设置的值
  9999. */
  10000. exports.getValue = getValue;
  10001. var setDataValue = function setDataValue(field, formdata, value) {
  10002. formdata[field] = value;
  10003. return value || '';
  10004. };
  10005. /**
  10006. * 获取表单数据
  10007. * @param {String|Array} field 真实名称,需要使用 realName 获取
  10008. * @param {Object} data 原始数据
  10009. */
  10010. exports.setDataValue = setDataValue;
  10011. var getDataValue = function getDataValue(field, data) {
  10012. return objGet(data, field);
  10013. };
  10014. /**
  10015. * 获取表单类型
  10016. * @param {String|Array} field 真实名称,需要使用 realName 获取
  10017. */
  10018. exports.getDataValue = getDataValue;
  10019. var getDataValueType = function getDataValueType(field, data) {
  10020. var value = getDataValue(field, data);
  10021. return {
  10022. type: type(value),
  10023. value: value
  10024. };
  10025. };
  10026. /**
  10027. * 获取表单可用的真实name
  10028. * @param {String|Array} name 表单name
  10029. * @@return {String} 表单可用的真实name
  10030. */
  10031. exports.getDataValueType = getDataValueType;
  10032. var realName = function realName(name) {
  10033. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10034. var base_name = _basePath(name);
  10035. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  10036. var realname = base_name.reduce(function (a, b) {
  10037. return a += "#".concat(b);
  10038. }, '_formdata_');
  10039. return realname;
  10040. }
  10041. return base_name[0] || name;
  10042. };
  10043. /**
  10044. * 判断是否表单可用的真实name
  10045. * @param {String|Array} name 表单name
  10046. * @@return {String} 表单可用的真实name
  10047. */
  10048. exports.realName = realName;
  10049. var isRealName = function isRealName(name) {
  10050. var reg = /^_formdata_#*/;
  10051. return reg.test(name);
  10052. };
  10053. /**
  10054. * 获取表单数据的原始格式
  10055. * @@return {Object|Array} object 需要解析的数据
  10056. */
  10057. exports.isRealName = isRealName;
  10058. var rawData = function rawData() {
  10059. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10060. var name = arguments.length > 1 ? arguments[1] : undefined;
  10061. var newData = JSON.parse(JSON.stringify(object));
  10062. var formData = {};
  10063. for (var i in newData) {
  10064. var path = name2arr(i);
  10065. objSet(formData, path, newData[i]);
  10066. }
  10067. return formData;
  10068. };
  10069. /**
  10070. * 真实name还原为 array
  10071. * @param {*} name
  10072. */
  10073. exports.rawData = rawData;
  10074. var name2arr = function name2arr(name) {
  10075. var field = name.replace('_formdata_#', '');
  10076. field = field.split('#').map(function (v) {
  10077. return isNumber(v) ? Number(v) : v;
  10078. });
  10079. return field;
  10080. };
  10081. /**
  10082. * 对象中设置值
  10083. * @param {Object|Array} object 源数据
  10084. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  10085. * @param {String} value 需要设置的值
  10086. */
  10087. exports.name2arr = name2arr;
  10088. var objSet = function objSet(object, path, value) {
  10089. if ((0, _typeof2.default)(object) !== 'object') return object;
  10090. _basePath(path).reduce(function (o, k, i, _) {
  10091. if (i === _.length - 1) {
  10092. // 若遍历结束直接赋值
  10093. o[k] = value;
  10094. return null;
  10095. } else if (k in o) {
  10096. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  10097. return o[k];
  10098. } else {
  10099. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  10100. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  10101. return o[k];
  10102. }
  10103. }, object);
  10104. // 返回object
  10105. return object;
  10106. };
  10107. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  10108. exports.objSet = objSet;
  10109. function _basePath(path) {
  10110. // 若是数组,则直接返回
  10111. if (Array.isArray(path)) return path;
  10112. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  10113. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  10114. }
  10115. /**
  10116. * 从对象中获取值
  10117. * @param {Object|Array} object 源数据
  10118. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  10119. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  10120. */
  10121. var objGet = function objGet(object, path) {
  10122. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  10123. // 先将path处理成统一格式
  10124. var newPath = _basePath(path);
  10125. // 递归处理,返回最后结果
  10126. var val = newPath.reduce(function (o, k) {
  10127. return (o || {})[k];
  10128. }, object);
  10129. return !val || val !== undefined ? val : defaultVal;
  10130. };
  10131. /**
  10132. * 是否为 number 类型
  10133. * @param {any} num 需要判断的值
  10134. * @return {Boolean} 是否为 number
  10135. */
  10136. exports.objGet = objGet;
  10137. var isNumber = function isNumber(num) {
  10138. return !isNaN(Number(num));
  10139. };
  10140. /**
  10141. * 是否为 boolean 类型
  10142. * @param {any} bool 需要判断的值
  10143. * @return {Boolean} 是否为 boolean
  10144. */
  10145. exports.isNumber = isNumber;
  10146. var isBoolean = function isBoolean(bool) {
  10147. return typeof bool === 'boolean';
  10148. };
  10149. /**
  10150. * 是否有必填字段
  10151. * @param {Object} rules 规则
  10152. * @return {Boolean} 是否有必填字段
  10153. */
  10154. exports.isBoolean = isBoolean;
  10155. var isRequiredField = function isRequiredField(rules) {
  10156. var isNoField = false;
  10157. for (var i = 0; i < rules.length; i++) {
  10158. var ruleData = rules[i];
  10159. if (ruleData.required) {
  10160. isNoField = true;
  10161. break;
  10162. }
  10163. }
  10164. return isNoField;
  10165. };
  10166. /**
  10167. * 获取数据类型
  10168. * @param {Any} obj 需要获取数据类型的值
  10169. */
  10170. exports.isRequiredField = isRequiredField;
  10171. var type = function type(obj) {
  10172. var class2type = {};
  10173. // 生成class2type映射
  10174. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  10175. class2type["[object " + item + "]"] = item.toLowerCase();
  10176. });
  10177. if (obj == null) {
  10178. return obj + "";
  10179. }
  10180. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  10181. };
  10182. /**
  10183. * 判断两个值是否相等
  10184. * @param {any} a 值
  10185. * @param {any} b 值
  10186. * @return {Boolean} 是否相等
  10187. */
  10188. exports.type = type;
  10189. var isEqual = function isEqual(a, b) {
  10190. //如果a和b本来就全等
  10191. if (a === b) {
  10192. //判断是否为0和-0
  10193. return a !== 0 || 1 / a === 1 / b;
  10194. }
  10195. //判断是否为null和undefined
  10196. if (a == null || b == null) {
  10197. return a === b;
  10198. }
  10199. //接下来判断a和b的数据类型
  10200. var classNameA = toString.call(a),
  10201. classNameB = toString.call(b);
  10202. //如果数据类型不相等,则返回false
  10203. if (classNameA !== classNameB) {
  10204. return false;
  10205. }
  10206. //如果数据类型相等,再根据不同数据类型分别判断
  10207. switch (classNameA) {
  10208. case '[object RegExp]':
  10209. case '[object String]':
  10210. //进行字符串转换比较
  10211. return '' + a === '' + b;
  10212. case '[object Number]':
  10213. //进行数字转换比较,判断是否为NaN
  10214. if (+a !== +a) {
  10215. return +b !== +b;
  10216. }
  10217. //判断是否为0或-0
  10218. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  10219. case '[object Date]':
  10220. case '[object Boolean]':
  10221. return +a === +b;
  10222. }
  10223. //如果是对象类型
  10224. if (classNameA == '[object Object]') {
  10225. //获取a和b的属性长度
  10226. var propsA = Object.getOwnPropertyNames(a),
  10227. propsB = Object.getOwnPropertyNames(b);
  10228. if (propsA.length != propsB.length) {
  10229. return false;
  10230. }
  10231. for (var i = 0; i < propsA.length; i++) {
  10232. var propName = propsA[i];
  10233. //如果对应属性对应值不相等,则返回false
  10234. if (a[propName] !== b[propName]) {
  10235. return false;
  10236. }
  10237. }
  10238. return true;
  10239. }
  10240. //如果是数组类型
  10241. if (classNameA == '[object Array]') {
  10242. if (a.toString() == b.toString()) {
  10243. return true;
  10244. }
  10245. return false;
  10246. }
  10247. };
  10248. exports.isEqual = isEqual;
  10249. /***/ }),
  10250. /***/ 26:
  10251. /*!**********************************************************!*\
  10252. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json ***!
  10253. \**********************************************************/
  10254. /*! no static exports found */
  10255. /***/ (function(module, exports) {
  10256. /***/ }),
  10257. /***/ 272:
  10258. /*!************************************************************************************!*\
  10259. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  10260. \************************************************************************************/
  10261. /*! no static exports found */
  10262. /***/ (function(module, exports, __webpack_require__) {
  10263. "use strict";
  10264. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  10265. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10266. Object.defineProperty(exports, "__esModule", {
  10267. value: true
  10268. });
  10269. exports.default = void 0;
  10270. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  10271. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 255));
  10272. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  10273. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10274. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  10275. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  10276. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10277. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 253));
  10278. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 254));
  10279. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 256));
  10280. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 273));
  10281. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10282. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10283. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  10284. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 275));
  10285. 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(_e35) { throw _e35; }, 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(_e36) { didErr = true; err = _e36; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  10286. 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); }
  10287. 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; }
  10288. 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; }
  10289. 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; }
  10290. 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); }; }
  10291. 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; } }
  10292. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  10293. function n(e) {
  10294. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  10295. }
  10296. function s(e, t, n) {
  10297. return e(n = {
  10298. path: t,
  10299. exports: {},
  10300. require: function require(e, t) {
  10301. return function () {
  10302. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  10303. }(null == t && n.path);
  10304. }
  10305. }, n.exports), n.exports;
  10306. }
  10307. var r = s(function (e, t) {
  10308. var n;
  10309. e.exports = (n = n || function (e, t) {
  10310. var n = Object.create || function () {
  10311. function e() {}
  10312. return function (t) {
  10313. var n;
  10314. return e.prototype = t, n = new e(), e.prototype = null, n;
  10315. };
  10316. }(),
  10317. s = {},
  10318. r = s.lib = {},
  10319. i = r.Base = {
  10320. extend: function extend(e) {
  10321. var t = n(this);
  10322. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  10323. t.$super.init.apply(this, arguments);
  10324. }), t.init.prototype = t, t.$super = this, t;
  10325. },
  10326. create: function create() {
  10327. var e = this.extend();
  10328. return e.init.apply(e, arguments), e;
  10329. },
  10330. init: function init() {},
  10331. mixIn: function mixIn(e) {
  10332. for (var t in e) {
  10333. e.hasOwnProperty(t) && (this[t] = e[t]);
  10334. }
  10335. e.hasOwnProperty("toString") && (this.toString = e.toString);
  10336. },
  10337. clone: function clone() {
  10338. return this.init.prototype.extend(this);
  10339. }
  10340. },
  10341. o = r.WordArray = i.extend({
  10342. init: function init(e, n) {
  10343. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  10344. },
  10345. toString: function toString(e) {
  10346. return (e || c).stringify(this);
  10347. },
  10348. concat: function concat(e) {
  10349. var t = this.words,
  10350. n = e.words,
  10351. s = this.sigBytes,
  10352. r = e.sigBytes;
  10353. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  10354. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  10355. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  10356. } else for (i = 0; i < r; i += 4) {
  10357. t[s + i >>> 2] = n[i >>> 2];
  10358. }
  10359. return this.sigBytes += r, this;
  10360. },
  10361. clamp: function clamp() {
  10362. var t = this.words,
  10363. n = this.sigBytes;
  10364. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  10365. },
  10366. clone: function clone() {
  10367. var e = i.clone.call(this);
  10368. return e.words = this.words.slice(0), e;
  10369. },
  10370. random: function random(t) {
  10371. for (var n, s = [], r = function r(t) {
  10372. t = t;
  10373. var n = 987654321,
  10374. s = 4294967295;
  10375. return function () {
  10376. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  10377. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  10378. };
  10379. }, i = 0; i < t; i += 4) {
  10380. var a = r(4294967296 * (n || e.random()));
  10381. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  10382. }
  10383. return new o.init(s, t);
  10384. }
  10385. }),
  10386. a = s.enc = {},
  10387. c = a.Hex = {
  10388. stringify: function stringify(e) {
  10389. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10390. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10391. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10392. }
  10393. return s.join("");
  10394. },
  10395. parse: function parse(e) {
  10396. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10397. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10398. }
  10399. return new o.init(n, t / 2);
  10400. }
  10401. },
  10402. u = a.Latin1 = {
  10403. stringify: function stringify(e) {
  10404. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10405. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10406. s.push(String.fromCharCode(i));
  10407. }
  10408. return s.join("");
  10409. },
  10410. parse: function parse(e) {
  10411. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10412. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10413. }
  10414. return new o.init(n, t);
  10415. }
  10416. },
  10417. h = a.Utf8 = {
  10418. stringify: function stringify(e) {
  10419. try {
  10420. return decodeURIComponent(escape(u.stringify(e)));
  10421. } catch (e) {
  10422. throw new Error("Malformed UTF-8 data");
  10423. }
  10424. },
  10425. parse: function parse(e) {
  10426. return u.parse(unescape(encodeURIComponent(e)));
  10427. }
  10428. },
  10429. l = r.BufferedBlockAlgorithm = i.extend({
  10430. reset: function reset() {
  10431. this._data = new o.init(), this._nDataBytes = 0;
  10432. },
  10433. _append: function _append(e) {
  10434. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10435. },
  10436. _process: function _process(t) {
  10437. var n = this._data,
  10438. s = n.words,
  10439. r = n.sigBytes,
  10440. i = this.blockSize,
  10441. a = r / (4 * i),
  10442. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10443. u = e.min(4 * c, r);
  10444. if (c) {
  10445. for (var h = 0; h < c; h += i) {
  10446. this._doProcessBlock(s, h);
  10447. }
  10448. var l = s.splice(0, c);
  10449. n.sigBytes -= u;
  10450. }
  10451. return new o.init(l, u);
  10452. },
  10453. clone: function clone() {
  10454. var e = i.clone.call(this);
  10455. return e._data = this._data.clone(), e;
  10456. },
  10457. _minBufferSize: 0
  10458. });
  10459. r.Hasher = l.extend({
  10460. cfg: i.extend(),
  10461. init: function init(e) {
  10462. this.cfg = this.cfg.extend(e), this.reset();
  10463. },
  10464. reset: function reset() {
  10465. l.reset.call(this), this._doReset();
  10466. },
  10467. update: function update(e) {
  10468. return this._append(e), this._process(), this;
  10469. },
  10470. finalize: function finalize(e) {
  10471. return e && this._append(e), this._doFinalize();
  10472. },
  10473. blockSize: 16,
  10474. _createHelper: function _createHelper(e) {
  10475. return function (t, n) {
  10476. return new e.init(n).finalize(t);
  10477. };
  10478. },
  10479. _createHmacHelper: function _createHmacHelper(e) {
  10480. return function (t, n) {
  10481. return new d.HMAC.init(e, n).finalize(t);
  10482. };
  10483. }
  10484. });
  10485. var d = s.algo = {};
  10486. return s;
  10487. }(Math), n);
  10488. }),
  10489. i = r,
  10490. o = (s(function (e, t) {
  10491. var n;
  10492. e.exports = (n = i, function (e) {
  10493. var t = n,
  10494. s = t.lib,
  10495. r = s.WordArray,
  10496. i = s.Hasher,
  10497. o = t.algo,
  10498. a = [];
  10499. !function () {
  10500. for (var t = 0; t < 64; t++) {
  10501. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10502. }
  10503. }();
  10504. var c = o.MD5 = i.extend({
  10505. _doReset: function _doReset() {
  10506. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10507. },
  10508. _doProcessBlock: function _doProcessBlock(e, t) {
  10509. for (var n = 0; n < 16; n++) {
  10510. var s = t + n,
  10511. r = e[s];
  10512. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10513. }
  10514. var i = this._hash.words,
  10515. o = e[t + 0],
  10516. c = e[t + 1],
  10517. p = e[t + 2],
  10518. f = e[t + 3],
  10519. g = e[t + 4],
  10520. m = e[t + 5],
  10521. y = e[t + 6],
  10522. _ = e[t + 7],
  10523. w = e[t + 8],
  10524. v = e[t + 9],
  10525. I = e[t + 10],
  10526. S = e[t + 11],
  10527. b = e[t + 12],
  10528. k = e[t + 13],
  10529. C = e[t + 14],
  10530. T = e[t + 15],
  10531. P = i[0],
  10532. A = i[1],
  10533. E = i[2],
  10534. O = i[3];
  10535. P = u(P, A, E, O, o, 7, a[0]), O = u(O, P, A, E, c, 12, a[1]), E = u(E, O, P, A, p, 17, a[2]), A = u(A, E, O, P, f, 22, a[3]), P = u(P, A, E, O, g, 7, a[4]), O = u(O, P, A, E, m, 12, a[5]), E = u(E, O, P, A, y, 17, a[6]), A = u(A, E, O, P, _, 22, a[7]), P = u(P, A, E, O, w, 7, a[8]), O = u(O, P, A, E, v, 12, a[9]), E = u(E, O, P, A, I, 17, a[10]), A = u(A, E, O, P, S, 22, a[11]), P = u(P, A, E, O, b, 7, a[12]), O = u(O, P, A, E, k, 12, a[13]), E = u(E, O, P, A, C, 17, a[14]), P = h(P, A = u(A, E, O, P, T, 22, a[15]), E, O, c, 5, a[16]), O = h(O, P, A, E, y, 9, a[17]), E = h(E, O, P, A, S, 14, a[18]), A = h(A, E, O, P, o, 20, a[19]), P = h(P, A, E, O, m, 5, a[20]), O = h(O, P, A, E, I, 9, a[21]), E = h(E, O, P, A, T, 14, a[22]), A = h(A, E, O, P, g, 20, a[23]), P = h(P, A, E, O, v, 5, a[24]), O = h(O, P, A, E, C, 9, a[25]), E = h(E, O, P, A, f, 14, a[26]), A = h(A, E, O, P, w, 20, a[27]), P = h(P, A, E, O, k, 5, a[28]), O = h(O, P, A, E, p, 9, a[29]), E = h(E, O, P, A, _, 14, a[30]), P = l(P, A = h(A, E, O, P, b, 20, a[31]), E, O, m, 4, a[32]), O = l(O, P, A, E, w, 11, a[33]), E = l(E, O, P, A, S, 16, a[34]), A = l(A, E, O, P, C, 23, a[35]), P = l(P, A, E, O, c, 4, a[36]), O = l(O, P, A, E, g, 11, a[37]), E = l(E, O, P, A, _, 16, a[38]), A = l(A, E, O, P, I, 23, a[39]), P = l(P, A, E, O, k, 4, a[40]), O = l(O, P, A, E, o, 11, a[41]), E = l(E, O, P, A, f, 16, a[42]), A = l(A, E, O, P, y, 23, a[43]), P = l(P, A, E, O, v, 4, a[44]), O = l(O, P, A, E, b, 11, a[45]), E = l(E, O, P, A, T, 16, a[46]), P = d(P, A = l(A, E, O, P, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, P, A, E, _, 10, a[49]), E = d(E, O, P, A, C, 15, a[50]), A = d(A, E, O, P, m, 21, a[51]), P = d(P, A, E, O, b, 6, a[52]), O = d(O, P, A, E, f, 10, a[53]), E = d(E, O, P, A, I, 15, a[54]), A = d(A, E, O, P, c, 21, a[55]), P = d(P, A, E, O, w, 6, a[56]), O = d(O, P, A, E, T, 10, a[57]), E = d(E, O, P, A, y, 15, a[58]), A = d(A, E, O, P, k, 21, a[59]), P = d(P, A, E, O, g, 6, a[60]), O = d(O, P, A, E, S, 10, a[61]), E = d(E, O, P, A, p, 15, a[62]), A = d(A, E, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + A | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  10536. },
  10537. _doFinalize: function _doFinalize() {
  10538. var t = this._data,
  10539. n = t.words,
  10540. s = 8 * this._nDataBytes,
  10541. r = 8 * t.sigBytes;
  10542. n[r >>> 5] |= 128 << 24 - r % 32;
  10543. var i = e.floor(s / 4294967296),
  10544. o = s;
  10545. 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();
  10546. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10547. var h = c[u];
  10548. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  10549. }
  10550. return a;
  10551. },
  10552. clone: function clone() {
  10553. var e = i.clone.call(this);
  10554. return e._hash = this._hash.clone(), e;
  10555. }
  10556. });
  10557. function u(e, t, n, s, r, i, o) {
  10558. var a = e + (t & n | ~t & s) + r + o;
  10559. return (a << i | a >>> 32 - i) + t;
  10560. }
  10561. function h(e, t, n, s, r, i, o) {
  10562. var a = e + (t & s | n & ~s) + r + o;
  10563. return (a << i | a >>> 32 - i) + t;
  10564. }
  10565. function l(e, t, n, s, r, i, o) {
  10566. var a = e + (t ^ n ^ s) + r + o;
  10567. return (a << i | a >>> 32 - i) + t;
  10568. }
  10569. function d(e, t, n, s, r, i, o) {
  10570. var a = e + (n ^ (t | ~s)) + r + o;
  10571. return (a << i | a >>> 32 - i) + t;
  10572. }
  10573. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  10574. }(Math), n.MD5);
  10575. }), s(function (e, t) {
  10576. var n;
  10577. e.exports = (n = i, void function () {
  10578. var e = n,
  10579. t = e.lib.Base,
  10580. s = e.enc.Utf8;
  10581. e.algo.HMAC = t.extend({
  10582. init: function init(e, t) {
  10583. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  10584. var n = e.blockSize,
  10585. r = 4 * n;
  10586. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  10587. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  10588. a[u] ^= 1549556828, c[u] ^= 909522486;
  10589. }
  10590. i.sigBytes = o.sigBytes = r, this.reset();
  10591. },
  10592. reset: function reset() {
  10593. var e = this._hasher;
  10594. e.reset(), e.update(this._iKey);
  10595. },
  10596. update: function update(e) {
  10597. return this._hasher.update(e), this;
  10598. },
  10599. finalize: function finalize(e) {
  10600. var t = this._hasher,
  10601. n = t.finalize(e);
  10602. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  10603. }
  10604. });
  10605. }());
  10606. }), s(function (e, t) {
  10607. e.exports = i.HmacMD5;
  10608. })),
  10609. a = s(function (e, t) {
  10610. e.exports = i.enc.Utf8;
  10611. }),
  10612. c = s(function (e, t) {
  10613. var n;
  10614. e.exports = (n = i, function () {
  10615. var e = n,
  10616. t = e.lib.WordArray;
  10617. function s(e, n, s) {
  10618. for (var r = [], i = 0, o = 0; o < n; o++) {
  10619. if (o % 4) {
  10620. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  10621. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  10622. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  10623. }
  10624. }
  10625. return t.create(r, i);
  10626. }
  10627. e.enc.Base64 = {
  10628. stringify: function stringify(e) {
  10629. var t = e.words,
  10630. n = e.sigBytes,
  10631. s = this._map;
  10632. e.clamp();
  10633. for (var r = [], i = 0; i < n; i += 3) {
  10634. 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++) {
  10635. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  10636. }
  10637. }
  10638. var c = s.charAt(64);
  10639. if (c) for (; r.length % 4;) {
  10640. r.push(c);
  10641. }
  10642. return r.join("");
  10643. },
  10644. parse: function parse(e) {
  10645. var t = e.length,
  10646. n = this._map,
  10647. r = this._reverseMap;
  10648. if (!r) {
  10649. r = this._reverseMap = [];
  10650. for (var i = 0; i < n.length; i++) {
  10651. r[n.charCodeAt(i)] = i;
  10652. }
  10653. }
  10654. var o = n.charAt(64);
  10655. if (o) {
  10656. var a = e.indexOf(o);
  10657. -1 !== a && (t = a);
  10658. }
  10659. return s(e, t, r);
  10660. },
  10661. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  10662. };
  10663. }(), n.enc.Base64);
  10664. });
  10665. var u = "FUNCTION",
  10666. h = "OBJECT",
  10667. l = "CLIENT_DB",
  10668. d = "pending",
  10669. p = "fullfilled",
  10670. f = "rejected";
  10671. function g(e) {
  10672. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  10673. }
  10674. function m(e) {
  10675. return "object" === g(e);
  10676. }
  10677. function y(e) {
  10678. return "function" == typeof e;
  10679. }
  10680. function _(e) {
  10681. return function () {
  10682. try {
  10683. return e.apply(e, arguments);
  10684. } catch (e) {
  10685. console.error(e);
  10686. }
  10687. };
  10688. }
  10689. var w = "REJECTED",
  10690. v = "NOT_PENDING";
  10691. var I = /*#__PURE__*/function () {
  10692. function I() {
  10693. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10694. e = _ref.createPromise,
  10695. _ref$retryRule = _ref.retryRule,
  10696. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  10697. (0, _classCallCheck2.default)(this, I);
  10698. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  10699. }
  10700. (0, _createClass2.default)(I, [{
  10701. key: "needRetry",
  10702. get: function get() {
  10703. if (!this.status) return !0;
  10704. switch (this.retryRule) {
  10705. case w:
  10706. return this.status === f;
  10707. case v:
  10708. return this.status !== d;
  10709. }
  10710. }
  10711. }, {
  10712. key: "exec",
  10713. value: function exec() {
  10714. var _this = this;
  10715. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  10716. return _this.status = p, Promise.resolve(e);
  10717. }, function (e) {
  10718. return _this.status = f, Promise.reject(e);
  10719. }), this.promise) : this.promise;
  10720. }
  10721. }]);
  10722. return I;
  10723. }();
  10724. function S(e) {
  10725. return e && "string" == typeof e ? JSON.parse(e) : e;
  10726. }
  10727. var b = "development" === "development",
  10728. k = "mp-weixin",
  10729. C = "true" === undefined || !0 === undefined,
  10730. T = S([]),
  10731. P = "h5" === k ? "web" : "app-plus" === k ? "app" : k,
  10732. A = S(undefined),
  10733. E = S([]) || [],
  10734. O = true;
  10735. var x = "";
  10736. try {
  10737. x = (__webpack_require__(/*! uni-stat-config */ 276).default || __webpack_require__(/*! uni-stat-config */ 276)).appid;
  10738. } catch (e) {}
  10739. var R = {};
  10740. function U(e) {
  10741. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10742. var n, s;
  10743. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  10744. }
  10745. "app" === P && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  10746. var L = ["invoke", "success", "fail", "complete"],
  10747. N = U("_globalUniCloudInterceptor");
  10748. function D(e, t) {
  10749. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  10750. L.indexOf(n) > -1 && function (e, t, n) {
  10751. var s = N[e][t];
  10752. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  10753. }(e, n, t[n]);
  10754. });
  10755. }
  10756. function F(e, t) {
  10757. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  10758. L.indexOf(n) > -1 && function (e, t, n) {
  10759. var s = N[e][t];
  10760. if (!s) return;
  10761. var r = s.indexOf(n);
  10762. r > -1 && s.splice(r, 1);
  10763. }(e, n, t[n]);
  10764. }) : delete N[e];
  10765. }
  10766. function q(e, t) {
  10767. return e && 0 !== e.length ? e.reduce(function (e, n) {
  10768. return e.then(function () {
  10769. return n(t);
  10770. });
  10771. }, Promise.resolve()) : Promise.resolve();
  10772. }
  10773. function M(e, t) {
  10774. return N[e] && N[e][t] || [];
  10775. }
  10776. function K(e) {
  10777. D("callObject", e);
  10778. }
  10779. var j = U("_globalUniCloudListener"),
  10780. B = "response",
  10781. $ = "needLogin",
  10782. W = "refreshToken",
  10783. z = "clientdb",
  10784. J = "cloudfunction",
  10785. H = "cloudobject";
  10786. function G(e) {
  10787. return j[e] || (j[e] = []), j[e];
  10788. }
  10789. function V(e, t) {
  10790. var n = G(e);
  10791. n.includes(t) || n.push(t);
  10792. }
  10793. function Y(e, t) {
  10794. var n = G(e),
  10795. s = n.indexOf(t);
  10796. -1 !== s && n.splice(s, 1);
  10797. }
  10798. function Q(e, t) {
  10799. var n = G(e);
  10800. for (var _e2 = 0; _e2 < n.length; _e2++) {
  10801. (0, n[_e2])(t);
  10802. }
  10803. }
  10804. var X,
  10805. Z = !1;
  10806. function ee() {
  10807. return X || (X = new Promise(function (e) {
  10808. Z && e(), function t() {
  10809. if ("function" == typeof getCurrentPages) {
  10810. var _t2 = getCurrentPages();
  10811. _t2 && _t2[0] && (Z = !0, e());
  10812. }
  10813. Z || setTimeout(function () {
  10814. t();
  10815. }, 30);
  10816. }();
  10817. }), X);
  10818. }
  10819. function te(e) {
  10820. var t = {};
  10821. for (var _n2 in e) {
  10822. var _s2 = e[_n2];
  10823. y(_s2) && (t[_n2] = _(_s2));
  10824. }
  10825. return t;
  10826. }
  10827. var ne = /*#__PURE__*/function (_Error) {
  10828. (0, _inherits2.default)(ne, _Error);
  10829. var _super = _createSuper(ne);
  10830. function ne(e) {
  10831. var _this2;
  10832. (0, _classCallCheck2.default)(this, ne);
  10833. _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;
  10834. return _this2;
  10835. }
  10836. (0, _createClass2.default)(ne, [{
  10837. key: "toJson",
  10838. value: function toJson() {
  10839. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10840. if (!(e >= 10)) return e++, {
  10841. errCode: this.errCode,
  10842. errMsg: this.errMsg,
  10843. errSubject: this.errSubject,
  10844. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  10845. };
  10846. }
  10847. }]);
  10848. return ne;
  10849. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  10850. var se = {
  10851. request: function request(e) {
  10852. return uni.request(e);
  10853. },
  10854. uploadFile: function uploadFile(e) {
  10855. return uni.uploadFile(e);
  10856. },
  10857. setStorageSync: function setStorageSync(e, t) {
  10858. return uni.setStorageSync(e, t);
  10859. },
  10860. getStorageSync: function getStorageSync(e) {
  10861. return uni.getStorageSync(e);
  10862. },
  10863. removeStorageSync: function removeStorageSync(e) {
  10864. return uni.removeStorageSync(e);
  10865. },
  10866. clearStorageSync: function clearStorageSync() {
  10867. return uni.clearStorageSync();
  10868. }
  10869. };
  10870. function re() {
  10871. return {
  10872. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  10873. tokenExpired: se.getStorageSync("uni_id_token_expired")
  10874. };
  10875. }
  10876. function ie() {
  10877. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10878. e = _ref2.token,
  10879. t = _ref2.tokenExpired;
  10880. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  10881. }
  10882. var oe, ae;
  10883. function ce() {
  10884. return oe || (oe = uni.getSystemInfoSync()), oe;
  10885. }
  10886. function ue() {
  10887. var e, t;
  10888. try {
  10889. if (uni.getLaunchOptionsSync) {
  10890. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  10891. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  10892. _n3 = _uni$getLaunchOptions.scene,
  10893. _s3 = _uni$getLaunchOptions.channel;
  10894. e = _s3, t = _n3;
  10895. }
  10896. } catch (e) {}
  10897. return {
  10898. channel: e,
  10899. scene: t
  10900. };
  10901. }
  10902. function he() {
  10903. var e = uni.getLocale && uni.getLocale() || "en";
  10904. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  10905. locale: e,
  10906. LOCALE: e
  10907. });
  10908. var t = ce(),
  10909. n = t.deviceId,
  10910. s = t.osName,
  10911. r = t.uniPlatform,
  10912. i = t.appId,
  10913. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10914. for (var _e3 = 0; _e3 < o.length; _e3++) {
  10915. delete t[o[_e3]];
  10916. }
  10917. return ae = _objectSpread(_objectSpread({
  10918. PLATFORM: r,
  10919. OS: s,
  10920. APPID: i,
  10921. DEVICEID: n
  10922. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  10923. locale: e,
  10924. LOCALE: e
  10925. });
  10926. }
  10927. var le = {
  10928. sign: function sign(e, t) {
  10929. var n = "";
  10930. return Object.keys(e).sort().forEach(function (t) {
  10931. e[t] && (n = n + "&" + t + "=" + e[t]);
  10932. }), n = n.slice(1), o(n, t).toString();
  10933. },
  10934. wrappedRequest: function wrappedRequest(e, t) {
  10935. return new Promise(function (n, s) {
  10936. t(Object.assign(e, {
  10937. complete: function complete(e) {
  10938. e || (e = {}), b && "web" === P && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  10939. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  10940. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  10941. code: "SYS_ERR",
  10942. message: e.errMsg || "request:fail",
  10943. requestId: t
  10944. }));
  10945. var r = e.data;
  10946. if (r.error) return s(new ne({
  10947. code: r.error.code,
  10948. message: r.error.message,
  10949. requestId: t
  10950. }));
  10951. r.result = r.data, r.requestId = t, delete r.data, n(r);
  10952. }
  10953. }));
  10954. });
  10955. },
  10956. toBase64: function toBase64(e) {
  10957. return c.stringify(a.parse(e));
  10958. }
  10959. },
  10960. de = {
  10961. "uniCloud.init.paramRequired": "{param} required",
  10962. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10963. };
  10964. var _e4 = (0, _uniI18n.initVueI18n)({
  10965. "zh-Hans": {
  10966. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10967. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10968. },
  10969. "zh-Hant": {
  10970. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10971. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10972. },
  10973. en: de,
  10974. fr: {
  10975. "uniCloud.init.paramRequired": "{param} required",
  10976. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10977. },
  10978. es: {
  10979. "uniCloud.init.paramRequired": "{param} required",
  10980. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10981. },
  10982. ja: de
  10983. }, "zh-Hans"),
  10984. pe = _e4.t;
  10985. var fe = /*#__PURE__*/function () {
  10986. function fe(e) {
  10987. var _this3 = this;
  10988. (0, _classCallCheck2.default)(this, fe);
  10989. ["spaceId", "clientSecret"].forEach(function (t) {
  10990. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  10991. param: t
  10992. }));
  10993. }), this.config = Object.assign({}, {
  10994. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  10995. }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = se, this._getAccessTokenPromiseHub = new I({
  10996. createPromise: function createPromise() {
  10997. return _this3.requestAuth(_this3.setupRequest({
  10998. method: "serverless.auth.user.anonymousAuthorize",
  10999. params: "{}"
  11000. }, "auth")).then(function (e) {
  11001. if (!e.result || !e.result.accessToken) throw new ne({
  11002. code: "AUTH_FAILED",
  11003. message: "获取accessToken失败"
  11004. });
  11005. _this3.setAccessToken(e.result.accessToken);
  11006. });
  11007. },
  11008. retryRule: v
  11009. });
  11010. }
  11011. (0, _createClass2.default)(fe, [{
  11012. key: "hasAccessToken",
  11013. get: function get() {
  11014. return !!this.accessToken;
  11015. }
  11016. }, {
  11017. key: "setAccessToken",
  11018. value: function setAccessToken(e) {
  11019. this.accessToken = e;
  11020. }
  11021. }, {
  11022. key: "requestWrapped",
  11023. value: function requestWrapped(e) {
  11024. return le.wrappedRequest(e, this.adapter.request);
  11025. }
  11026. }, {
  11027. key: "requestAuth",
  11028. value: function requestAuth(e) {
  11029. return this.requestWrapped(e);
  11030. }
  11031. }, {
  11032. key: "request",
  11033. value: function request(e, t) {
  11034. var _this4 = this;
  11035. return Promise.resolve().then(function () {
  11036. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  11037. return new Promise(function (e, n) {
  11038. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  11039. }).then(function () {
  11040. return _this4.getAccessToken();
  11041. }).then(function () {
  11042. var t = _this4.rebuildRequest(e);
  11043. return _this4.request(t, !0);
  11044. });
  11045. }) : _this4.getAccessToken().then(function () {
  11046. var t = _this4.rebuildRequest(e);
  11047. return _this4.request(t, !0);
  11048. });
  11049. });
  11050. }
  11051. }, {
  11052. key: "rebuildRequest",
  11053. value: function rebuildRequest(e) {
  11054. var t = Object.assign({}, e);
  11055. 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;
  11056. }
  11057. }, {
  11058. key: "setupRequest",
  11059. value: function setupRequest(e, t) {
  11060. var n = Object.assign({}, e, {
  11061. spaceId: this.config.spaceId,
  11062. timestamp: Date.now()
  11063. }),
  11064. s = {
  11065. "Content-Type": "application/json"
  11066. };
  11067. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret), {
  11068. url: this.config.requestUrl,
  11069. method: "POST",
  11070. data: n,
  11071. dataType: "json",
  11072. header: s
  11073. };
  11074. }
  11075. }, {
  11076. key: "getAccessToken",
  11077. value: function getAccessToken() {
  11078. return this._getAccessTokenPromiseHub.exec();
  11079. }
  11080. }, {
  11081. key: "authorize",
  11082. value: function () {
  11083. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11084. return _regenerator.default.wrap(function _callee$(_context) {
  11085. while (1) {
  11086. switch (_context.prev = _context.next) {
  11087. case 0:
  11088. _context.next = 2;
  11089. return this.getAccessToken();
  11090. case 2:
  11091. case "end":
  11092. return _context.stop();
  11093. }
  11094. }
  11095. }, _callee, this);
  11096. }));
  11097. function authorize() {
  11098. return _authorize.apply(this, arguments);
  11099. }
  11100. return authorize;
  11101. }()
  11102. }, {
  11103. key: "callFunction",
  11104. value: function callFunction(e) {
  11105. var t = {
  11106. method: "serverless.function.runtime.invoke",
  11107. params: JSON.stringify({
  11108. functionTarget: e.name,
  11109. functionArgs: e.data || {}
  11110. })
  11111. };
  11112. return this.request(this.setupRequest(t));
  11113. }
  11114. }, {
  11115. key: "getOSSUploadOptionsFromPath",
  11116. value: function getOSSUploadOptionsFromPath(e) {
  11117. var t = {
  11118. method: "serverless.file.resource.generateProximalSign",
  11119. params: JSON.stringify(e)
  11120. };
  11121. return this.request(this.setupRequest(t));
  11122. }
  11123. }, {
  11124. key: "uploadFileToOSS",
  11125. value: function uploadFileToOSS(_ref3) {
  11126. var _this5 = this;
  11127. var e = _ref3.url,
  11128. t = _ref3.formData,
  11129. n = _ref3.name,
  11130. s = _ref3.filePath,
  11131. r = _ref3.fileType,
  11132. i = _ref3.onUploadProgress;
  11133. return new Promise(function (o, a) {
  11134. var c = _this5.adapter.uploadFile({
  11135. url: e,
  11136. formData: t,
  11137. name: n,
  11138. filePath: s,
  11139. fileType: r,
  11140. header: {
  11141. "X-OSS-server-side-encrpytion": "AES256"
  11142. },
  11143. success: function success(e) {
  11144. e && e.statusCode < 400 ? o(e) : a(new ne({
  11145. code: "UPLOAD_FAILED",
  11146. message: "文件上传失败"
  11147. }));
  11148. },
  11149. fail: function fail(e) {
  11150. a(new ne({
  11151. code: e.code || "UPLOAD_FAILED",
  11152. message: e.message || e.errMsg || "文件上传失败"
  11153. }));
  11154. }
  11155. });
  11156. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  11157. i({
  11158. loaded: e.totalBytesSent,
  11159. total: e.totalBytesExpectedToSend
  11160. });
  11161. });
  11162. });
  11163. }
  11164. }, {
  11165. key: "reportOSSUpload",
  11166. value: function reportOSSUpload(e) {
  11167. var t = {
  11168. method: "serverless.file.resource.report",
  11169. params: JSON.stringify(e)
  11170. };
  11171. return this.request(this.setupRequest(t));
  11172. }
  11173. }, {
  11174. key: "uploadFile",
  11175. value: function () {
  11176. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  11177. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, h, l, d, p, f, m, y, _, _e5, w;
  11178. return _regenerator.default.wrap(function _callee2$(_context2) {
  11179. while (1) {
  11180. switch (_context2.prev = _context2.next) {
  11181. case 0:
  11182. 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;
  11183. if (!("string" !== g(t))) {
  11184. _context2.next = 3;
  11185. break;
  11186. }
  11187. throw new ne({
  11188. code: "INVALID_PARAM",
  11189. message: "cloudPath必须为字符串类型"
  11190. });
  11191. case 3:
  11192. if (t = t.trim()) {
  11193. _context2.next = 5;
  11194. break;
  11195. }
  11196. throw new ne({
  11197. code: "INVALID_PARAM",
  11198. message: "cloudPath不可为空"
  11199. });
  11200. case 5:
  11201. if (!/:\/\//.test(t)) {
  11202. _context2.next = 7;
  11203. break;
  11204. }
  11205. throw new ne({
  11206. code: "INVALID_PARAM",
  11207. message: "cloudPath不合法"
  11208. });
  11209. case 7:
  11210. o = i && i.envType || this.config.envType;
  11211. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  11212. _context2.next = 10;
  11213. break;
  11214. }
  11215. throw new ne({
  11216. code: "INVALID_PARAM",
  11217. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  11218. });
  11219. case 10:
  11220. _context2.next = 12;
  11221. return this.getOSSUploadOptionsFromPath({
  11222. env: o,
  11223. filename: s ? t.split("/").pop() : t,
  11224. fileId: s ? t : void 0
  11225. });
  11226. case 12:
  11227. a = _context2.sent.result;
  11228. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  11229. u = a.securityToken;
  11230. h = a.accessKeyId;
  11231. l = a.signature;
  11232. d = a.host;
  11233. p = a.ossPath;
  11234. f = a.id;
  11235. m = a.policy;
  11236. y = a.ossCallbackUrl;
  11237. _ = {
  11238. "Cache-Control": "max-age=2592000",
  11239. "Content-Disposition": "attachment",
  11240. OSSAccessKeyId: h,
  11241. Signature: l,
  11242. host: d,
  11243. id: f,
  11244. key: p,
  11245. policy: m,
  11246. success_action_status: 200
  11247. };
  11248. if (u && (_["x-oss-security-token"] = u), y) {
  11249. _e5 = JSON.stringify({
  11250. callbackUrl: y,
  11251. callbackBody: JSON.stringify({
  11252. fileId: f,
  11253. spaceId: this.config.spaceId
  11254. }),
  11255. callbackBodyType: "application/json"
  11256. });
  11257. _.callback = le.toBase64(_e5);
  11258. }
  11259. w = {
  11260. url: "https://" + a.host,
  11261. formData: _,
  11262. fileName: "file",
  11263. name: "file",
  11264. filePath: e,
  11265. fileType: n
  11266. };
  11267. _context2.next = 27;
  11268. return this.uploadFileToOSS(Object.assign({}, w, {
  11269. onUploadProgress: r
  11270. }));
  11271. case 27:
  11272. if (!y) {
  11273. _context2.next = 29;
  11274. break;
  11275. }
  11276. return _context2.abrupt("return", {
  11277. success: !0,
  11278. filePath: e,
  11279. fileID: c
  11280. });
  11281. case 29:
  11282. _context2.next = 31;
  11283. return this.reportOSSUpload({
  11284. id: f
  11285. });
  11286. case 31:
  11287. if (!_context2.sent.success) {
  11288. _context2.next = 33;
  11289. break;
  11290. }
  11291. return _context2.abrupt("return", {
  11292. success: !0,
  11293. filePath: e,
  11294. fileID: c
  11295. });
  11296. case 33:
  11297. throw new ne({
  11298. code: "UPLOAD_FAILED",
  11299. message: "文件上传失败"
  11300. });
  11301. case 34:
  11302. case "end":
  11303. return _context2.stop();
  11304. }
  11305. }
  11306. }, _callee2, this);
  11307. }));
  11308. function uploadFile(_x) {
  11309. return _uploadFile.apply(this, arguments);
  11310. }
  11311. return uploadFile;
  11312. }()
  11313. }, {
  11314. key: "getTempFileURL",
  11315. value: function getTempFileURL() {
  11316. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11317. e = _ref5.fileList;
  11318. return new Promise(function (t, n) {
  11319. Array.isArray(e) && 0 !== e.length || n(new ne({
  11320. code: "INVALID_PARAM",
  11321. message: "fileList的元素必须是非空的字符串"
  11322. })), t({
  11323. fileList: e.map(function (e) {
  11324. return {
  11325. fileID: e,
  11326. tempFileURL: e
  11327. };
  11328. })
  11329. });
  11330. });
  11331. }
  11332. }, {
  11333. key: "getFileInfo",
  11334. value: function () {
  11335. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  11336. var _ref6,
  11337. e,
  11338. t,
  11339. _args3 = arguments;
  11340. return _regenerator.default.wrap(function _callee3$(_context3) {
  11341. while (1) {
  11342. switch (_context3.prev = _context3.next) {
  11343. case 0:
  11344. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  11345. if (!(!Array.isArray(e) || 0 === e.length)) {
  11346. _context3.next = 3;
  11347. break;
  11348. }
  11349. throw new ne({
  11350. code: "INVALID_PARAM",
  11351. message: "fileList的元素必须是非空的字符串"
  11352. });
  11353. case 3:
  11354. t = {
  11355. method: "serverless.file.resource.info",
  11356. params: JSON.stringify({
  11357. id: e.map(function (e) {
  11358. return e.split("?")[0];
  11359. }).join(",")
  11360. })
  11361. };
  11362. _context3.next = 6;
  11363. return this.request(this.setupRequest(t));
  11364. case 6:
  11365. _context3.t0 = _context3.sent.result;
  11366. return _context3.abrupt("return", {
  11367. fileList: _context3.t0
  11368. });
  11369. case 8:
  11370. case "end":
  11371. return _context3.stop();
  11372. }
  11373. }
  11374. }, _callee3, this);
  11375. }));
  11376. function getFileInfo() {
  11377. return _getFileInfo.apply(this, arguments);
  11378. }
  11379. return getFileInfo;
  11380. }()
  11381. }]);
  11382. return fe;
  11383. }();
  11384. var ge = {
  11385. init: function init(e) {
  11386. var t = new fe(e),
  11387. n = {
  11388. signInAnonymously: function signInAnonymously() {
  11389. return t.authorize();
  11390. },
  11391. getLoginState: function getLoginState() {
  11392. return Promise.resolve(!1);
  11393. }
  11394. };
  11395. return t.auth = function () {
  11396. return n;
  11397. }, t.customAuth = t.auth, t;
  11398. }
  11399. };
  11400. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11401. var ye;
  11402. !function (e) {
  11403. e.local = "local", e.none = "none", e.session = "session";
  11404. }(ye || (ye = {}));
  11405. var _e = function _e() {};
  11406. var we = function we() {
  11407. var e;
  11408. if (!Promise) {
  11409. e = function e() {}, e.promise = {};
  11410. var _t3 = function _t3() {
  11411. throw new ne({
  11412. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11413. });
  11414. };
  11415. return Object.defineProperty(e.promise, "then", {
  11416. get: _t3
  11417. }), Object.defineProperty(e.promise, "catch", {
  11418. get: _t3
  11419. }), e;
  11420. }
  11421. var t = new Promise(function (t, n) {
  11422. e = function e(_e6, s) {
  11423. return _e6 ? n(_e6) : t(s);
  11424. };
  11425. });
  11426. return e.promise = t, e;
  11427. };
  11428. function ve(e) {
  11429. return void 0 === e;
  11430. }
  11431. function Ie(e) {
  11432. return "[object Null]" === Object.prototype.toString.call(e);
  11433. }
  11434. var Se;
  11435. function be(e) {
  11436. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11437. var n;
  11438. var _iterator = _createForOfIteratorHelper(t),
  11439. _step;
  11440. try {
  11441. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11442. var _e7 = _step.value;
  11443. var _t4 = _e7.isMatch,
  11444. _n4 = _e7.genAdapter,
  11445. _s4 = _e7.runtime;
  11446. if (_t4()) return {
  11447. adapter: _n4(),
  11448. runtime: _s4
  11449. };
  11450. }
  11451. } catch (err) {
  11452. _iterator.e(err);
  11453. } finally {
  11454. _iterator.f();
  11455. }
  11456. }
  11457. !function (e) {
  11458. e.WEB = "web", e.WX_MP = "wx_mp";
  11459. }(Se || (Se = {}));
  11460. var ke = {
  11461. adapter: null,
  11462. runtime: void 0
  11463. },
  11464. Ce = ["anonymousUuidKey"];
  11465. var Te = /*#__PURE__*/function (_e8) {
  11466. (0, _inherits2.default)(Te, _e8);
  11467. var _super2 = _createSuper(Te);
  11468. function Te() {
  11469. var _this6;
  11470. (0, _classCallCheck2.default)(this, Te);
  11471. _this6 = _super2.call(this), ke.adapter.root.tcbObject || (ke.adapter.root.tcbObject = {});
  11472. return _this6;
  11473. }
  11474. (0, _createClass2.default)(Te, [{
  11475. key: "setItem",
  11476. value: function setItem(e, t) {
  11477. ke.adapter.root.tcbObject[e] = t;
  11478. }
  11479. }, {
  11480. key: "getItem",
  11481. value: function getItem(e) {
  11482. return ke.adapter.root.tcbObject[e];
  11483. }
  11484. }, {
  11485. key: "removeItem",
  11486. value: function removeItem(e) {
  11487. delete ke.adapter.root.tcbObject[e];
  11488. }
  11489. }, {
  11490. key: "clear",
  11491. value: function clear() {
  11492. delete ke.adapter.root.tcbObject;
  11493. }
  11494. }]);
  11495. return Te;
  11496. }(_e);
  11497. function Pe(e, t) {
  11498. switch (e) {
  11499. case "local":
  11500. return t.localStorage || new Te();
  11501. case "none":
  11502. return new Te();
  11503. default:
  11504. return t.sessionStorage || new Te();
  11505. }
  11506. }
  11507. var Ae = /*#__PURE__*/function () {
  11508. function Ae(e) {
  11509. (0, _classCallCheck2.default)(this, Ae);
  11510. if (!this._storage) {
  11511. this._persistence = ke.adapter.primaryStorage || e.persistence, this._storage = Pe(this._persistence, ke.adapter);
  11512. var _t5 = "access_token_".concat(e.env),
  11513. _n5 = "access_token_expire_".concat(e.env),
  11514. _s5 = "refresh_token_".concat(e.env),
  11515. _r = "anonymous_uuid_".concat(e.env),
  11516. _i = "login_type_".concat(e.env),
  11517. _o = "user_info_".concat(e.env);
  11518. this.keys = {
  11519. accessTokenKey: _t5,
  11520. accessTokenExpireKey: _n5,
  11521. refreshTokenKey: _s5,
  11522. anonymousUuidKey: _r,
  11523. loginTypeKey: _i,
  11524. userInfoKey: _o
  11525. };
  11526. }
  11527. }
  11528. (0, _createClass2.default)(Ae, [{
  11529. key: "updatePersistence",
  11530. value: function updatePersistence(e) {
  11531. if (e === this._persistence) return;
  11532. var t = "local" === this._persistence;
  11533. this._persistence = e;
  11534. var n = Pe(e, ke.adapter);
  11535. for (var _e9 in this.keys) {
  11536. var _s6 = this.keys[_e9];
  11537. if (t && Ce.includes(_e9)) continue;
  11538. var _r2 = this._storage.getItem(_s6);
  11539. ve(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  11540. }
  11541. this._storage = n;
  11542. }
  11543. }, {
  11544. key: "setStore",
  11545. value: function setStore(e, t, n) {
  11546. if (!this._storage) return;
  11547. var s = {
  11548. version: n || "localCachev1",
  11549. content: t
  11550. },
  11551. r = JSON.stringify(s);
  11552. try {
  11553. this._storage.setItem(e, r);
  11554. } catch (e) {
  11555. throw e;
  11556. }
  11557. }
  11558. }, {
  11559. key: "getStore",
  11560. value: function getStore(e, t) {
  11561. try {
  11562. if (!this._storage) return;
  11563. } catch (e) {
  11564. return "";
  11565. }
  11566. t = t || "localCachev1";
  11567. var n = this._storage.getItem(e);
  11568. if (!n) return "";
  11569. if (n.indexOf(t) >= 0) {
  11570. return JSON.parse(n).content;
  11571. }
  11572. return "";
  11573. }
  11574. }, {
  11575. key: "removeStore",
  11576. value: function removeStore(e) {
  11577. this._storage.removeItem(e);
  11578. }
  11579. }]);
  11580. return Ae;
  11581. }();
  11582. var Ee = {},
  11583. Oe = {};
  11584. function xe(e) {
  11585. return Ee[e];
  11586. }
  11587. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  11588. (0, _classCallCheck2.default)(this, Re);
  11589. this.data = t || null, this.name = e;
  11590. });
  11591. var Ue = /*#__PURE__*/function (_Re) {
  11592. (0, _inherits2.default)(Ue, _Re);
  11593. var _super3 = _createSuper(Ue);
  11594. function Ue(e, t) {
  11595. var _this7;
  11596. (0, _classCallCheck2.default)(this, Ue);
  11597. _this7 = _super3.call(this, "error", {
  11598. error: e,
  11599. data: t
  11600. }), _this7.error = e;
  11601. return _this7;
  11602. }
  11603. return (0, _createClass2.default)(Ue);
  11604. }(Re);
  11605. var Le = new ( /*#__PURE__*/function () {
  11606. function _class() {
  11607. (0, _classCallCheck2.default)(this, _class);
  11608. this._listeners = {};
  11609. }
  11610. (0, _createClass2.default)(_class, [{
  11611. key: "on",
  11612. value: function on(e, t) {
  11613. return function (e, t, n) {
  11614. n[e] = n[e] || [], n[e].push(t);
  11615. }(e, t, this._listeners), this;
  11616. }
  11617. }, {
  11618. key: "off",
  11619. value: function off(e, t) {
  11620. return function (e, t, n) {
  11621. if (n && n[e]) {
  11622. var _s7 = n[e].indexOf(t);
  11623. -1 !== _s7 && n[e].splice(_s7, 1);
  11624. }
  11625. }(e, t, this._listeners), this;
  11626. }
  11627. }, {
  11628. key: "fire",
  11629. value: function fire(e, t) {
  11630. if (e instanceof Ue) return console.error(e.error), this;
  11631. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  11632. var s = n.name;
  11633. if (this._listens(s)) {
  11634. n.target = this;
  11635. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  11636. var _iterator2 = _createForOfIteratorHelper(_e10),
  11637. _step2;
  11638. try {
  11639. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  11640. var _t6 = _step2.value;
  11641. _t6.call(this, n);
  11642. }
  11643. } catch (err) {
  11644. _iterator2.e(err);
  11645. } finally {
  11646. _iterator2.f();
  11647. }
  11648. }
  11649. return this;
  11650. }
  11651. }, {
  11652. key: "_listens",
  11653. value: function _listens(e) {
  11654. return this._listeners[e] && this._listeners[e].length > 0;
  11655. }
  11656. }]);
  11657. return _class;
  11658. }())();
  11659. function Ne(e, t) {
  11660. Le.on(e, t);
  11661. }
  11662. function De(e) {
  11663. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11664. Le.fire(e, t);
  11665. }
  11666. function Fe(e, t) {
  11667. Le.off(e, t);
  11668. }
  11669. var qe = "loginStateChanged",
  11670. Me = "loginStateExpire",
  11671. Ke = "loginTypeChanged",
  11672. je = "anonymousConverted",
  11673. Be = "refreshAccessToken";
  11674. var $e;
  11675. !function (e) {
  11676. 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";
  11677. }($e || ($e = {}));
  11678. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  11679. ze = {
  11680. "X-SDK-Version": "1.3.5"
  11681. };
  11682. function Je(e, t, n) {
  11683. var s = e[t];
  11684. e[t] = function (t) {
  11685. var r = {},
  11686. i = {};
  11687. n.forEach(function (n) {
  11688. var _n$call = n.call(e, t),
  11689. s = _n$call.data,
  11690. o = _n$call.headers;
  11691. Object.assign(r, s), Object.assign(i, o);
  11692. });
  11693. var o = t.data;
  11694. return o && function () {
  11695. var e;
  11696. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  11697. o.append(_e11, r[_e11]);
  11698. }
  11699. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  11700. };
  11701. }
  11702. function He() {
  11703. var e = Math.random().toString(16).slice(2);
  11704. return {
  11705. data: {
  11706. seqId: e
  11707. },
  11708. headers: _objectSpread(_objectSpread({}, ze), {}, {
  11709. "x-seqid": e
  11710. })
  11711. };
  11712. }
  11713. var Ge = /*#__PURE__*/function () {
  11714. function Ge() {
  11715. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11716. (0, _classCallCheck2.default)(this, Ge);
  11717. var t;
  11718. this.config = e, this._reqClass = new ke.adapter.reqClass({
  11719. timeout: this.config.timeout,
  11720. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  11721. restrictedMethods: ["post"]
  11722. }), this._cache = xe(this.config.env), this._localCache = (t = this.config.env, Oe[t]), Je(this._reqClass, "post", [He]), Je(this._reqClass, "upload", [He]), Je(this._reqClass, "download", [He]);
  11723. }
  11724. (0, _createClass2.default)(Ge, [{
  11725. key: "post",
  11726. value: function () {
  11727. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  11728. return _regenerator.default.wrap(function _callee4$(_context4) {
  11729. while (1) {
  11730. switch (_context4.prev = _context4.next) {
  11731. case 0:
  11732. _context4.next = 2;
  11733. return this._reqClass.post(e);
  11734. case 2:
  11735. return _context4.abrupt("return", _context4.sent);
  11736. case 3:
  11737. case "end":
  11738. return _context4.stop();
  11739. }
  11740. }
  11741. }, _callee4, this);
  11742. }));
  11743. function post(_x2) {
  11744. return _post.apply(this, arguments);
  11745. }
  11746. return post;
  11747. }()
  11748. }, {
  11749. key: "upload",
  11750. value: function () {
  11751. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  11752. return _regenerator.default.wrap(function _callee5$(_context5) {
  11753. while (1) {
  11754. switch (_context5.prev = _context5.next) {
  11755. case 0:
  11756. _context5.next = 2;
  11757. return this._reqClass.upload(e);
  11758. case 2:
  11759. return _context5.abrupt("return", _context5.sent);
  11760. case 3:
  11761. case "end":
  11762. return _context5.stop();
  11763. }
  11764. }
  11765. }, _callee5, this);
  11766. }));
  11767. function upload(_x3) {
  11768. return _upload.apply(this, arguments);
  11769. }
  11770. return upload;
  11771. }()
  11772. }, {
  11773. key: "download",
  11774. value: function () {
  11775. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  11776. return _regenerator.default.wrap(function _callee6$(_context6) {
  11777. while (1) {
  11778. switch (_context6.prev = _context6.next) {
  11779. case 0:
  11780. _context6.next = 2;
  11781. return this._reqClass.download(e);
  11782. case 2:
  11783. return _context6.abrupt("return", _context6.sent);
  11784. case 3:
  11785. case "end":
  11786. return _context6.stop();
  11787. }
  11788. }
  11789. }, _callee6, this);
  11790. }));
  11791. function download(_x4) {
  11792. return _download.apply(this, arguments);
  11793. }
  11794. return download;
  11795. }()
  11796. }, {
  11797. key: "refreshAccessToken",
  11798. value: function () {
  11799. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  11800. var e, t;
  11801. return _regenerator.default.wrap(function _callee7$(_context7) {
  11802. while (1) {
  11803. switch (_context7.prev = _context7.next) {
  11804. case 0:
  11805. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11806. _context7.prev = 1;
  11807. _context7.next = 4;
  11808. return this._refreshAccessTokenPromise;
  11809. case 4:
  11810. e = _context7.sent;
  11811. _context7.next = 10;
  11812. break;
  11813. case 7:
  11814. _context7.prev = 7;
  11815. _context7.t0 = _context7["catch"](1);
  11816. t = _context7.t0;
  11817. case 10:
  11818. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  11819. _context7.next = 12;
  11820. break;
  11821. }
  11822. throw t;
  11823. case 12:
  11824. return _context7.abrupt("return", e);
  11825. case 13:
  11826. case "end":
  11827. return _context7.stop();
  11828. }
  11829. }
  11830. }, _callee7, this, [[1, 7]]);
  11831. }));
  11832. function refreshAccessToken() {
  11833. return _refreshAccessToken2.apply(this, arguments);
  11834. }
  11835. return refreshAccessToken;
  11836. }()
  11837. }, {
  11838. key: "_refreshAccessToken",
  11839. value: function () {
  11840. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  11841. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  11842. return _regenerator.default.wrap(function _callee8$(_context8) {
  11843. while (1) {
  11844. switch (_context8.prev = _context8.next) {
  11845. case 0:
  11846. _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;
  11847. this._cache.removeStore(e), this._cache.removeStore(t);
  11848. i = this._cache.getStore(n);
  11849. if (i) {
  11850. _context8.next = 5;
  11851. break;
  11852. }
  11853. throw new ne({
  11854. message: "未登录CloudBase"
  11855. });
  11856. case 5:
  11857. o = {
  11858. refresh_token: i
  11859. };
  11860. _context8.next = 8;
  11861. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  11862. case 8:
  11863. a = _context8.sent;
  11864. if (!a.data.code) {
  11865. _context8.next = 21;
  11866. break;
  11867. }
  11868. _e12 = a.data.code;
  11869. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  11870. _context8.next = 20;
  11871. break;
  11872. }
  11873. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  11874. _context8.next = 19;
  11875. break;
  11876. }
  11877. _e13 = this._cache.getStore(r);
  11878. _t7 = this._cache.getStore(n);
  11879. _context8.next = 17;
  11880. return this.send("auth.signInAnonymously", {
  11881. anonymous_uuid: _e13,
  11882. refresh_token: _t7
  11883. });
  11884. case 17:
  11885. _s8 = _context8.sent;
  11886. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  11887. case 19:
  11888. De(Me), this._cache.removeStore(n);
  11889. case 20:
  11890. throw new ne({
  11891. code: a.data.code,
  11892. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  11893. });
  11894. case 21:
  11895. if (!a.data.access_token) {
  11896. _context8.next = 23;
  11897. break;
  11898. }
  11899. 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()), {
  11900. accessToken: a.data.access_token,
  11901. accessTokenExpire: a.data.access_token_expire
  11902. }));
  11903. case 23:
  11904. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  11905. case 24:
  11906. case "end":
  11907. return _context8.stop();
  11908. }
  11909. }
  11910. }, _callee8, this);
  11911. }));
  11912. function _refreshAccessToken() {
  11913. return _refreshAccessToken3.apply(this, arguments);
  11914. }
  11915. return _refreshAccessToken;
  11916. }()
  11917. }, {
  11918. key: "getAccessToken",
  11919. value: function () {
  11920. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  11921. var _this$_cache$keys2, e, t, n, s, r, i;
  11922. return _regenerator.default.wrap(function _callee9$(_context9) {
  11923. while (1) {
  11924. switch (_context9.prev = _context9.next) {
  11925. case 0:
  11926. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  11927. if (this._cache.getStore(n)) {
  11928. _context9.next = 3;
  11929. break;
  11930. }
  11931. throw new ne({
  11932. message: "refresh token不存在,登录状态异常"
  11933. });
  11934. case 3:
  11935. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  11936. _context9.t0 = this._shouldRefreshAccessTokenHook;
  11937. if (!_context9.t0) {
  11938. _context9.next = 9;
  11939. break;
  11940. }
  11941. _context9.next = 8;
  11942. return this._shouldRefreshAccessTokenHook(s, r);
  11943. case 8:
  11944. _context9.t0 = !_context9.sent;
  11945. case 9:
  11946. _context9.t1 = _context9.t0;
  11947. if (!_context9.t1) {
  11948. _context9.next = 12;
  11949. break;
  11950. }
  11951. i = !1;
  11952. case 12:
  11953. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  11954. accessToken: s,
  11955. accessTokenExpire: r
  11956. });
  11957. case 13:
  11958. case "end":
  11959. return _context9.stop();
  11960. }
  11961. }
  11962. }, _callee9, this);
  11963. }));
  11964. function getAccessToken() {
  11965. return _getAccessToken.apply(this, arguments);
  11966. }
  11967. return getAccessToken;
  11968. }()
  11969. }, {
  11970. key: "request",
  11971. value: function () {
  11972. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  11973. var s, r, i, _e14, o, _e15, _e16, a, c, u, h, l, d, p, f, g;
  11974. return _regenerator.default.wrap(function _callee10$(_context10) {
  11975. while (1) {
  11976. switch (_context10.prev = _context10.next) {
  11977. case 0:
  11978. s = "x-tcb-trace_".concat(this.config.env);
  11979. r = "application/x-www-form-urlencoded";
  11980. i = _objectSpread({
  11981. action: e,
  11982. env: this.config.env,
  11983. dataVersion: "2019-08-16"
  11984. }, t);
  11985. if (!(-1 === We.indexOf(e))) {
  11986. _context10.next = 10;
  11987. break;
  11988. }
  11989. _e14 = this._cache.keys.refreshTokenKey;
  11990. _context10.t0 = this._cache.getStore(_e14);
  11991. if (!_context10.t0) {
  11992. _context10.next = 10;
  11993. break;
  11994. }
  11995. _context10.next = 9;
  11996. return this.getAccessToken();
  11997. case 9:
  11998. i.access_token = _context10.sent.accessToken;
  11999. case 10:
  12000. if ("storage.uploadFile" === e) {
  12001. o = new FormData();
  12002. for (_e15 in o) {
  12003. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  12004. }
  12005. r = "multipart/form-data";
  12006. } else {
  12007. r = "application/json", o = {};
  12008. for (_e16 in i) {
  12009. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  12010. }
  12011. }
  12012. a = {
  12013. headers: {
  12014. "content-type": r
  12015. }
  12016. };
  12017. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  12018. c = this._localCache.getStore(s);
  12019. c && (a.headers["X-TCB-Trace"] = c);
  12020. u = t.parse, h = t.inQuery, l = t.search;
  12021. d = {
  12022. env: this.config.env
  12023. };
  12024. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  12025. p = function (e, t) {
  12026. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12027. var s = /\?/.test(t);
  12028. var r = "";
  12029. for (var _e17 in n) {
  12030. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  12031. }
  12032. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  12033. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  12034. l && (p += l);
  12035. _context10.next = 22;
  12036. return this.post(_objectSpread({
  12037. url: p,
  12038. data: o
  12039. }, a));
  12040. case 22:
  12041. f = _context10.sent;
  12042. g = f.header && f.header["x-tcb-trace"];
  12043. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  12044. _context10.next = 26;
  12045. break;
  12046. }
  12047. throw new ne({
  12048. code: "NETWORK_ERROR",
  12049. message: "network request error"
  12050. });
  12051. case 26:
  12052. return _context10.abrupt("return", f);
  12053. case 27:
  12054. case "end":
  12055. return _context10.stop();
  12056. }
  12057. }
  12058. }, _callee10, this);
  12059. }));
  12060. function request(_x5, _x6, _x7) {
  12061. return _request.apply(this, arguments);
  12062. }
  12063. return request;
  12064. }()
  12065. }, {
  12066. key: "send",
  12067. value: function () {
  12068. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  12069. var t,
  12070. n,
  12071. _n6,
  12072. _args11 = arguments;
  12073. return _regenerator.default.wrap(function _callee11$(_context11) {
  12074. while (1) {
  12075. switch (_context11.prev = _context11.next) {
  12076. case 0:
  12077. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  12078. _context11.next = 3;
  12079. return this.request(e, t, {
  12080. onUploadProgress: t.onUploadProgress
  12081. });
  12082. case 3:
  12083. n = _context11.sent;
  12084. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  12085. _context11.next = 13;
  12086. break;
  12087. }
  12088. _context11.next = 7;
  12089. return this.refreshAccessToken();
  12090. case 7:
  12091. _context11.next = 9;
  12092. return this.request(e, t, {
  12093. onUploadProgress: t.onUploadProgress
  12094. });
  12095. case 9:
  12096. _n6 = _context11.sent;
  12097. if (!_n6.data.code) {
  12098. _context11.next = 12;
  12099. break;
  12100. }
  12101. throw new ne({
  12102. code: _n6.data.code,
  12103. message: _n6.data.message
  12104. });
  12105. case 12:
  12106. return _context11.abrupt("return", _n6.data);
  12107. case 13:
  12108. if (!n.data.code) {
  12109. _context11.next = 15;
  12110. break;
  12111. }
  12112. throw new ne({
  12113. code: n.data.code,
  12114. message: n.data.message
  12115. });
  12116. case 15:
  12117. return _context11.abrupt("return", n.data);
  12118. case 16:
  12119. case "end":
  12120. return _context11.stop();
  12121. }
  12122. }
  12123. }, _callee11, this);
  12124. }));
  12125. function send(_x8) {
  12126. return _send.apply(this, arguments);
  12127. }
  12128. return send;
  12129. }()
  12130. }, {
  12131. key: "setRefreshToken",
  12132. value: function setRefreshToken(e) {
  12133. var _this$_cache$keys3 = this._cache.keys,
  12134. t = _this$_cache$keys3.accessTokenKey,
  12135. n = _this$_cache$keys3.accessTokenExpireKey,
  12136. s = _this$_cache$keys3.refreshTokenKey;
  12137. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12138. }
  12139. }]);
  12140. return Ge;
  12141. }();
  12142. var Ve = {};
  12143. function Ye(e) {
  12144. return Ve[e];
  12145. }
  12146. var Qe = /*#__PURE__*/function () {
  12147. function Qe(e) {
  12148. (0, _classCallCheck2.default)(this, Qe);
  12149. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  12150. }
  12151. (0, _createClass2.default)(Qe, [{
  12152. key: "setRefreshToken",
  12153. value: function setRefreshToken(e) {
  12154. var _this$_cache$keys4 = this._cache.keys,
  12155. t = _this$_cache$keys4.accessTokenKey,
  12156. n = _this$_cache$keys4.accessTokenExpireKey,
  12157. s = _this$_cache$keys4.refreshTokenKey;
  12158. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12159. }
  12160. }, {
  12161. key: "setAccessToken",
  12162. value: function setAccessToken(e, t) {
  12163. var _this$_cache$keys5 = this._cache.keys,
  12164. n = _this$_cache$keys5.accessTokenKey,
  12165. s = _this$_cache$keys5.accessTokenExpireKey;
  12166. this._cache.setStore(n, e), this._cache.setStore(s, t);
  12167. }
  12168. }, {
  12169. key: "refreshUserInfo",
  12170. value: function () {
  12171. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  12172. var _yield$this$_request$, e;
  12173. return _regenerator.default.wrap(function _callee12$(_context12) {
  12174. while (1) {
  12175. switch (_context12.prev = _context12.next) {
  12176. case 0:
  12177. _context12.next = 2;
  12178. return this._request.send("auth.getUserInfo", {});
  12179. case 2:
  12180. _yield$this$_request$ = _context12.sent;
  12181. e = _yield$this$_request$.data;
  12182. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  12183. case 5:
  12184. case "end":
  12185. return _context12.stop();
  12186. }
  12187. }
  12188. }, _callee12, this);
  12189. }));
  12190. function refreshUserInfo() {
  12191. return _refreshUserInfo.apply(this, arguments);
  12192. }
  12193. return refreshUserInfo;
  12194. }()
  12195. }, {
  12196. key: "setLocalUserInfo",
  12197. value: function setLocalUserInfo(e) {
  12198. var t = this._cache.keys.userInfoKey;
  12199. this._cache.setStore(t, e);
  12200. }
  12201. }]);
  12202. return Qe;
  12203. }();
  12204. var Xe = /*#__PURE__*/function () {
  12205. function Xe(e) {
  12206. (0, _classCallCheck2.default)(this, Xe);
  12207. if (!e) throw new ne({
  12208. code: "PARAM_ERROR",
  12209. message: "envId is not defined"
  12210. });
  12211. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  12212. }
  12213. (0, _createClass2.default)(Xe, [{
  12214. key: "linkWithTicket",
  12215. value: function linkWithTicket(e) {
  12216. if ("string" != typeof e) throw new ne({
  12217. code: "PARAM_ERROR",
  12218. message: "ticket must be string"
  12219. });
  12220. return this._request.send("auth.linkWithTicket", {
  12221. ticket: e
  12222. });
  12223. }
  12224. }, {
  12225. key: "linkWithRedirect",
  12226. value: function linkWithRedirect(e) {
  12227. e.signInWithRedirect();
  12228. }
  12229. }, {
  12230. key: "updatePassword",
  12231. value: function updatePassword(e, t) {
  12232. return this._request.send("auth.updatePassword", {
  12233. oldPassword: t,
  12234. newPassword: e
  12235. });
  12236. }
  12237. }, {
  12238. key: "updateEmail",
  12239. value: function updateEmail(e) {
  12240. return this._request.send("auth.updateEmail", {
  12241. newEmail: e
  12242. });
  12243. }
  12244. }, {
  12245. key: "updateUsername",
  12246. value: function updateUsername(e) {
  12247. if ("string" != typeof e) throw new ne({
  12248. code: "PARAM_ERROR",
  12249. message: "username must be a string"
  12250. });
  12251. return this._request.send("auth.updateUsername", {
  12252. username: e
  12253. });
  12254. }
  12255. }, {
  12256. key: "getLinkedUidList",
  12257. value: function () {
  12258. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  12259. var _yield$this$_request$2, e, t, n;
  12260. return _regenerator.default.wrap(function _callee13$(_context13) {
  12261. while (1) {
  12262. switch (_context13.prev = _context13.next) {
  12263. case 0:
  12264. _context13.next = 2;
  12265. return this._request.send("auth.getLinkedUidList", {});
  12266. case 2:
  12267. _yield$this$_request$2 = _context13.sent;
  12268. e = _yield$this$_request$2.data;
  12269. t = !1;
  12270. n = e.users;
  12271. return _context13.abrupt("return", (n.forEach(function (e) {
  12272. e.wxOpenId && e.wxPublicId && (t = !0);
  12273. }), {
  12274. users: n,
  12275. hasPrimaryUid: t
  12276. }));
  12277. case 7:
  12278. case "end":
  12279. return _context13.stop();
  12280. }
  12281. }
  12282. }, _callee13, this);
  12283. }));
  12284. function getLinkedUidList() {
  12285. return _getLinkedUidList.apply(this, arguments);
  12286. }
  12287. return getLinkedUidList;
  12288. }()
  12289. }, {
  12290. key: "setPrimaryUid",
  12291. value: function setPrimaryUid(e) {
  12292. return this._request.send("auth.setPrimaryUid", {
  12293. uid: e
  12294. });
  12295. }
  12296. }, {
  12297. key: "unlink",
  12298. value: function unlink(e) {
  12299. return this._request.send("auth.unlink", {
  12300. platform: e
  12301. });
  12302. }
  12303. }, {
  12304. key: "update",
  12305. value: function () {
  12306. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  12307. var t, n, s, r, i, o, _yield$this$_request$3, a;
  12308. return _regenerator.default.wrap(function _callee14$(_context14) {
  12309. while (1) {
  12310. switch (_context14.prev = _context14.next) {
  12311. case 0:
  12312. t = e.nickName;
  12313. n = e.gender;
  12314. s = e.avatarUrl;
  12315. r = e.province;
  12316. i = e.country;
  12317. o = e.city;
  12318. _context14.next = 8;
  12319. return this._request.send("auth.updateUserInfo", {
  12320. nickName: t,
  12321. gender: n,
  12322. avatarUrl: s,
  12323. province: r,
  12324. country: i,
  12325. city: o
  12326. });
  12327. case 8:
  12328. _yield$this$_request$3 = _context14.sent;
  12329. a = _yield$this$_request$3.data;
  12330. this.setLocalUserInfo(a);
  12331. case 11:
  12332. case "end":
  12333. return _context14.stop();
  12334. }
  12335. }
  12336. }, _callee14, this);
  12337. }));
  12338. function update(_x9) {
  12339. return _update.apply(this, arguments);
  12340. }
  12341. return update;
  12342. }()
  12343. }, {
  12344. key: "refresh",
  12345. value: function () {
  12346. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  12347. var _yield$this$_request$4, e;
  12348. return _regenerator.default.wrap(function _callee15$(_context15) {
  12349. while (1) {
  12350. switch (_context15.prev = _context15.next) {
  12351. case 0:
  12352. _context15.next = 2;
  12353. return this._request.send("auth.getUserInfo", {});
  12354. case 2:
  12355. _yield$this$_request$4 = _context15.sent;
  12356. e = _yield$this$_request$4.data;
  12357. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  12358. case 5:
  12359. case "end":
  12360. return _context15.stop();
  12361. }
  12362. }
  12363. }, _callee15, this);
  12364. }));
  12365. function refresh() {
  12366. return _refresh.apply(this, arguments);
  12367. }
  12368. return refresh;
  12369. }()
  12370. }, {
  12371. key: "setUserInfo",
  12372. value: function setUserInfo() {
  12373. var _this8 = this;
  12374. var e = this._cache.keys.userInfoKey,
  12375. t = this._cache.getStore(e);
  12376. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  12377. _this8[e] = t[e];
  12378. }), this.location = {
  12379. country: t.country,
  12380. province: t.province,
  12381. city: t.city
  12382. };
  12383. }
  12384. }, {
  12385. key: "setLocalUserInfo",
  12386. value: function setLocalUserInfo(e) {
  12387. var t = this._cache.keys.userInfoKey;
  12388. this._cache.setStore(t, e), this.setUserInfo();
  12389. }
  12390. }]);
  12391. return Xe;
  12392. }();
  12393. var Ze = /*#__PURE__*/function () {
  12394. function Ze(e) {
  12395. (0, _classCallCheck2.default)(this, Ze);
  12396. if (!e) throw new ne({
  12397. code: "PARAM_ERROR",
  12398. message: "envId is not defined"
  12399. });
  12400. this._cache = xe(e);
  12401. var _this$_cache$keys6 = this._cache.keys,
  12402. t = _this$_cache$keys6.refreshTokenKey,
  12403. n = _this$_cache$keys6.accessTokenKey,
  12404. s = _this$_cache$keys6.accessTokenExpireKey,
  12405. r = this._cache.getStore(t),
  12406. i = this._cache.getStore(n),
  12407. o = this._cache.getStore(s);
  12408. this.credential = {
  12409. refreshToken: r,
  12410. accessToken: i,
  12411. accessTokenExpire: o
  12412. }, this.user = new Xe(e);
  12413. }
  12414. (0, _createClass2.default)(Ze, [{
  12415. key: "isAnonymousAuth",
  12416. get: function get() {
  12417. return this.loginType === $e.ANONYMOUS;
  12418. }
  12419. }, {
  12420. key: "isCustomAuth",
  12421. get: function get() {
  12422. return this.loginType === $e.CUSTOM;
  12423. }
  12424. }, {
  12425. key: "isWeixinAuth",
  12426. get: function get() {
  12427. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  12428. }
  12429. }, {
  12430. key: "loginType",
  12431. get: function get() {
  12432. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12433. }
  12434. }]);
  12435. return Ze;
  12436. }();
  12437. var et = /*#__PURE__*/function (_Qe) {
  12438. (0, _inherits2.default)(et, _Qe);
  12439. var _super4 = _createSuper(et);
  12440. function et() {
  12441. (0, _classCallCheck2.default)(this, et);
  12442. return _super4.apply(this, arguments);
  12443. }
  12444. (0, _createClass2.default)(et, [{
  12445. key: "signIn",
  12446. value: function () {
  12447. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12448. var _this$_cache$keys7, e, t, n, s, r, _e18;
  12449. return _regenerator.default.wrap(function _callee16$(_context16) {
  12450. while (1) {
  12451. switch (_context16.prev = _context16.next) {
  12452. case 0:
  12453. this._cache.updatePersistence("local");
  12454. _this$_cache$keys7 = this._cache.keys;
  12455. e = _this$_cache$keys7.anonymousUuidKey;
  12456. t = _this$_cache$keys7.refreshTokenKey;
  12457. n = this._cache.getStore(e) || void 0;
  12458. s = this._cache.getStore(t) || void 0;
  12459. _context16.next = 8;
  12460. return this._request.send("auth.signInAnonymously", {
  12461. anonymous_uuid: n,
  12462. refresh_token: s
  12463. });
  12464. case 8:
  12465. r = _context16.sent;
  12466. if (!(r.uuid && r.refresh_token)) {
  12467. _context16.next = 20;
  12468. break;
  12469. }
  12470. this._setAnonymousUUID(r.uuid);
  12471. this.setRefreshToken(r.refresh_token);
  12472. _context16.next = 14;
  12473. return this._request.refreshAccessToken();
  12474. case 14:
  12475. De(qe);
  12476. De(Ke, {
  12477. env: this.config.env,
  12478. loginType: $e.ANONYMOUS,
  12479. persistence: "local"
  12480. });
  12481. _e18 = new Ze(this.config.env);
  12482. _context16.next = 19;
  12483. return _e18.user.refresh();
  12484. case 19:
  12485. return _context16.abrupt("return", _e18);
  12486. case 20:
  12487. throw new ne({
  12488. message: "匿名登录失败"
  12489. });
  12490. case 21:
  12491. case "end":
  12492. return _context16.stop();
  12493. }
  12494. }
  12495. }, _callee16, this);
  12496. }));
  12497. function signIn() {
  12498. return _signIn.apply(this, arguments);
  12499. }
  12500. return signIn;
  12501. }()
  12502. }, {
  12503. key: "linkAndRetrieveDataWithTicket",
  12504. value: function () {
  12505. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12506. var _this$_cache$keys8, t, n, s, r, i;
  12507. return _regenerator.default.wrap(function _callee17$(_context17) {
  12508. while (1) {
  12509. switch (_context17.prev = _context17.next) {
  12510. case 0:
  12511. _this$_cache$keys8 = this._cache.keys;
  12512. t = _this$_cache$keys8.anonymousUuidKey;
  12513. n = _this$_cache$keys8.refreshTokenKey;
  12514. s = this._cache.getStore(t);
  12515. r = this._cache.getStore(n);
  12516. _context17.next = 7;
  12517. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12518. anonymous_uuid: s,
  12519. refresh_token: r,
  12520. ticket: e
  12521. });
  12522. case 7:
  12523. i = _context17.sent;
  12524. if (!i.refresh_token) {
  12525. _context17.next = 16;
  12526. break;
  12527. }
  12528. this._clearAnonymousUUID();
  12529. this.setRefreshToken(i.refresh_token);
  12530. _context17.next = 13;
  12531. return this._request.refreshAccessToken();
  12532. case 13:
  12533. De(je, {
  12534. env: this.config.env
  12535. });
  12536. De(Ke, {
  12537. loginType: $e.CUSTOM,
  12538. persistence: "local"
  12539. });
  12540. return _context17.abrupt("return", {
  12541. credential: {
  12542. refreshToken: i.refresh_token
  12543. }
  12544. });
  12545. case 16:
  12546. throw new ne({
  12547. message: "匿名转化失败"
  12548. });
  12549. case 17:
  12550. case "end":
  12551. return _context17.stop();
  12552. }
  12553. }
  12554. }, _callee17, this);
  12555. }));
  12556. function linkAndRetrieveDataWithTicket(_x10) {
  12557. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  12558. }
  12559. return linkAndRetrieveDataWithTicket;
  12560. }()
  12561. }, {
  12562. key: "_setAnonymousUUID",
  12563. value: function _setAnonymousUUID(e) {
  12564. var _this$_cache$keys9 = this._cache.keys,
  12565. t = _this$_cache$keys9.anonymousUuidKey,
  12566. n = _this$_cache$keys9.loginTypeKey;
  12567. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  12568. }
  12569. }, {
  12570. key: "_clearAnonymousUUID",
  12571. value: function _clearAnonymousUUID() {
  12572. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12573. }
  12574. }]);
  12575. return et;
  12576. }(Qe);
  12577. var tt = /*#__PURE__*/function (_Qe2) {
  12578. (0, _inherits2.default)(tt, _Qe2);
  12579. var _super5 = _createSuper(tt);
  12580. function tt() {
  12581. (0, _classCallCheck2.default)(this, tt);
  12582. return _super5.apply(this, arguments);
  12583. }
  12584. (0, _createClass2.default)(tt, [{
  12585. key: "signIn",
  12586. value: function () {
  12587. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  12588. var t, n;
  12589. return _regenerator.default.wrap(function _callee18$(_context18) {
  12590. while (1) {
  12591. switch (_context18.prev = _context18.next) {
  12592. case 0:
  12593. if (!("string" != typeof e)) {
  12594. _context18.next = 2;
  12595. break;
  12596. }
  12597. throw new ne({
  12598. code: "PARAM_ERROR",
  12599. message: "ticket must be a string"
  12600. });
  12601. case 2:
  12602. t = this._cache.keys.refreshTokenKey;
  12603. _context18.next = 5;
  12604. return this._request.send("auth.signInWithTicket", {
  12605. ticket: e,
  12606. refresh_token: this._cache.getStore(t) || ""
  12607. });
  12608. case 5:
  12609. n = _context18.sent;
  12610. if (!n.refresh_token) {
  12611. _context18.next = 15;
  12612. break;
  12613. }
  12614. this.setRefreshToken(n.refresh_token);
  12615. _context18.next = 10;
  12616. return this._request.refreshAccessToken();
  12617. case 10:
  12618. De(qe);
  12619. De(Ke, {
  12620. env: this.config.env,
  12621. loginType: $e.CUSTOM,
  12622. persistence: this.config.persistence
  12623. });
  12624. _context18.next = 14;
  12625. return this.refreshUserInfo();
  12626. case 14:
  12627. return _context18.abrupt("return", new Ze(this.config.env));
  12628. case 15:
  12629. throw new ne({
  12630. message: "自定义登录失败"
  12631. });
  12632. case 16:
  12633. case "end":
  12634. return _context18.stop();
  12635. }
  12636. }
  12637. }, _callee18, this);
  12638. }));
  12639. function signIn(_x11) {
  12640. return _signIn2.apply(this, arguments);
  12641. }
  12642. return signIn;
  12643. }()
  12644. }]);
  12645. return tt;
  12646. }(Qe);
  12647. var nt = /*#__PURE__*/function (_Qe3) {
  12648. (0, _inherits2.default)(nt, _Qe3);
  12649. var _super6 = _createSuper(nt);
  12650. function nt() {
  12651. (0, _classCallCheck2.default)(this, nt);
  12652. return _super6.apply(this, arguments);
  12653. }
  12654. (0, _createClass2.default)(nt, [{
  12655. key: "signIn",
  12656. value: function () {
  12657. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  12658. var n, s, r, i, o;
  12659. return _regenerator.default.wrap(function _callee19$(_context19) {
  12660. while (1) {
  12661. switch (_context19.prev = _context19.next) {
  12662. case 0:
  12663. if (!("string" != typeof e)) {
  12664. _context19.next = 2;
  12665. break;
  12666. }
  12667. throw new ne({
  12668. code: "PARAM_ERROR",
  12669. message: "email must be a string"
  12670. });
  12671. case 2:
  12672. n = this._cache.keys.refreshTokenKey;
  12673. _context19.next = 5;
  12674. return this._request.send("auth.signIn", {
  12675. loginType: "EMAIL",
  12676. email: e,
  12677. password: t,
  12678. refresh_token: this._cache.getStore(n) || ""
  12679. });
  12680. case 5:
  12681. s = _context19.sent;
  12682. r = s.refresh_token;
  12683. i = s.access_token;
  12684. o = s.access_token_expire;
  12685. if (!r) {
  12686. _context19.next = 22;
  12687. break;
  12688. }
  12689. this.setRefreshToken(r);
  12690. if (!(i && o)) {
  12691. _context19.next = 15;
  12692. break;
  12693. }
  12694. this.setAccessToken(i, o);
  12695. _context19.next = 17;
  12696. break;
  12697. case 15:
  12698. _context19.next = 17;
  12699. return this._request.refreshAccessToken();
  12700. case 17:
  12701. _context19.next = 19;
  12702. return this.refreshUserInfo();
  12703. case 19:
  12704. De(qe);
  12705. De(Ke, {
  12706. env: this.config.env,
  12707. loginType: $e.EMAIL,
  12708. persistence: this.config.persistence
  12709. });
  12710. return _context19.abrupt("return", new Ze(this.config.env));
  12711. case 22:
  12712. throw s.code ? new ne({
  12713. code: s.code,
  12714. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12715. }) : new ne({
  12716. message: "邮箱登录失败"
  12717. });
  12718. case 23:
  12719. case "end":
  12720. return _context19.stop();
  12721. }
  12722. }
  12723. }, _callee19, this);
  12724. }));
  12725. function signIn(_x12, _x13) {
  12726. return _signIn3.apply(this, arguments);
  12727. }
  12728. return signIn;
  12729. }()
  12730. }, {
  12731. key: "activate",
  12732. value: function () {
  12733. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  12734. return _regenerator.default.wrap(function _callee20$(_context20) {
  12735. while (1) {
  12736. switch (_context20.prev = _context20.next) {
  12737. case 0:
  12738. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  12739. token: e
  12740. }));
  12741. case 1:
  12742. case "end":
  12743. return _context20.stop();
  12744. }
  12745. }
  12746. }, _callee20, this);
  12747. }));
  12748. function activate(_x14) {
  12749. return _activate.apply(this, arguments);
  12750. }
  12751. return activate;
  12752. }()
  12753. }, {
  12754. key: "resetPasswordWithToken",
  12755. value: function () {
  12756. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  12757. return _regenerator.default.wrap(function _callee21$(_context21) {
  12758. while (1) {
  12759. switch (_context21.prev = _context21.next) {
  12760. case 0:
  12761. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  12762. token: e,
  12763. newPassword: t
  12764. }));
  12765. case 1:
  12766. case "end":
  12767. return _context21.stop();
  12768. }
  12769. }
  12770. }, _callee21, this);
  12771. }));
  12772. function resetPasswordWithToken(_x15, _x16) {
  12773. return _resetPasswordWithToken.apply(this, arguments);
  12774. }
  12775. return resetPasswordWithToken;
  12776. }()
  12777. }]);
  12778. return nt;
  12779. }(Qe);
  12780. var st = /*#__PURE__*/function (_Qe4) {
  12781. (0, _inherits2.default)(st, _Qe4);
  12782. var _super7 = _createSuper(st);
  12783. function st() {
  12784. (0, _classCallCheck2.default)(this, st);
  12785. return _super7.apply(this, arguments);
  12786. }
  12787. (0, _createClass2.default)(st, [{
  12788. key: "signIn",
  12789. value: function () {
  12790. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  12791. var n, s, r, i, o;
  12792. return _regenerator.default.wrap(function _callee22$(_context22) {
  12793. while (1) {
  12794. switch (_context22.prev = _context22.next) {
  12795. case 0:
  12796. if (!("string" != typeof e)) {
  12797. _context22.next = 2;
  12798. break;
  12799. }
  12800. throw new ne({
  12801. code: "PARAM_ERROR",
  12802. message: "username must be a string"
  12803. });
  12804. case 2:
  12805. "string" != typeof t && (t = "", console.warn("password is empty"));
  12806. n = this._cache.keys.refreshTokenKey;
  12807. _context22.next = 6;
  12808. return this._request.send("auth.signIn", {
  12809. loginType: $e.USERNAME,
  12810. username: e,
  12811. password: t,
  12812. refresh_token: this._cache.getStore(n) || ""
  12813. });
  12814. case 6:
  12815. s = _context22.sent;
  12816. r = s.refresh_token;
  12817. i = s.access_token_expire;
  12818. o = s.access_token;
  12819. if (!r) {
  12820. _context22.next = 23;
  12821. break;
  12822. }
  12823. this.setRefreshToken(r);
  12824. if (!(o && i)) {
  12825. _context22.next = 16;
  12826. break;
  12827. }
  12828. this.setAccessToken(o, i);
  12829. _context22.next = 18;
  12830. break;
  12831. case 16:
  12832. _context22.next = 18;
  12833. return this._request.refreshAccessToken();
  12834. case 18:
  12835. _context22.next = 20;
  12836. return this.refreshUserInfo();
  12837. case 20:
  12838. De(qe);
  12839. De(Ke, {
  12840. env: this.config.env,
  12841. loginType: $e.USERNAME,
  12842. persistence: this.config.persistence
  12843. });
  12844. return _context22.abrupt("return", new Ze(this.config.env));
  12845. case 23:
  12846. throw s.code ? new ne({
  12847. code: s.code,
  12848. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12849. }) : new ne({
  12850. message: "用户名密码登录失败"
  12851. });
  12852. case 24:
  12853. case "end":
  12854. return _context22.stop();
  12855. }
  12856. }
  12857. }, _callee22, this);
  12858. }));
  12859. function signIn(_x17, _x18) {
  12860. return _signIn4.apply(this, arguments);
  12861. }
  12862. return signIn;
  12863. }()
  12864. }]);
  12865. return st;
  12866. }(Qe);
  12867. var rt = /*#__PURE__*/function () {
  12868. function rt(e) {
  12869. (0, _classCallCheck2.default)(this, rt);
  12870. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Ke, this._onLoginTypeChanged);
  12871. }
  12872. (0, _createClass2.default)(rt, [{
  12873. key: "currentUser",
  12874. get: function get() {
  12875. var e = this.hasLoginState();
  12876. return e && e.user || null;
  12877. }
  12878. }, {
  12879. key: "loginType",
  12880. get: function get() {
  12881. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12882. }
  12883. }, {
  12884. key: "anonymousAuthProvider",
  12885. value: function anonymousAuthProvider() {
  12886. return new et(this.config);
  12887. }
  12888. }, {
  12889. key: "customAuthProvider",
  12890. value: function customAuthProvider() {
  12891. return new tt(this.config);
  12892. }
  12893. }, {
  12894. key: "emailAuthProvider",
  12895. value: function emailAuthProvider() {
  12896. return new nt(this.config);
  12897. }
  12898. }, {
  12899. key: "usernameAuthProvider",
  12900. value: function usernameAuthProvider() {
  12901. return new st(this.config);
  12902. }
  12903. }, {
  12904. key: "signInAnonymously",
  12905. value: function () {
  12906. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  12907. return _regenerator.default.wrap(function _callee23$(_context23) {
  12908. while (1) {
  12909. switch (_context23.prev = _context23.next) {
  12910. case 0:
  12911. return _context23.abrupt("return", new et(this.config).signIn());
  12912. case 1:
  12913. case "end":
  12914. return _context23.stop();
  12915. }
  12916. }
  12917. }, _callee23, this);
  12918. }));
  12919. function signInAnonymously() {
  12920. return _signInAnonymously.apply(this, arguments);
  12921. }
  12922. return signInAnonymously;
  12923. }()
  12924. }, {
  12925. key: "signInWithEmailAndPassword",
  12926. value: function () {
  12927. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  12928. return _regenerator.default.wrap(function _callee24$(_context24) {
  12929. while (1) {
  12930. switch (_context24.prev = _context24.next) {
  12931. case 0:
  12932. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  12933. case 1:
  12934. case "end":
  12935. return _context24.stop();
  12936. }
  12937. }
  12938. }, _callee24, this);
  12939. }));
  12940. function signInWithEmailAndPassword(_x19, _x20) {
  12941. return _signInWithEmailAndPassword.apply(this, arguments);
  12942. }
  12943. return signInWithEmailAndPassword;
  12944. }()
  12945. }, {
  12946. key: "signInWithUsernameAndPassword",
  12947. value: function signInWithUsernameAndPassword(e, t) {
  12948. return new st(this.config).signIn(e, t);
  12949. }
  12950. }, {
  12951. key: "linkAndRetrieveDataWithTicket",
  12952. value: function () {
  12953. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  12954. return _regenerator.default.wrap(function _callee25$(_context25) {
  12955. while (1) {
  12956. switch (_context25.prev = _context25.next) {
  12957. case 0:
  12958. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  12959. _context25.next = 3;
  12960. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  12961. case 3:
  12962. return _context25.abrupt("return", _context25.sent);
  12963. case 4:
  12964. case "end":
  12965. return _context25.stop();
  12966. }
  12967. }
  12968. }, _callee25, this);
  12969. }));
  12970. function linkAndRetrieveDataWithTicket(_x21) {
  12971. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  12972. }
  12973. return linkAndRetrieveDataWithTicket;
  12974. }()
  12975. }, {
  12976. key: "signOut",
  12977. value: function () {
  12978. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  12979. var _this$_cache$keys10, e, t, n, s, r;
  12980. return _regenerator.default.wrap(function _callee26$(_context26) {
  12981. while (1) {
  12982. switch (_context26.prev = _context26.next) {
  12983. case 0:
  12984. if (!(this.loginType === $e.ANONYMOUS)) {
  12985. _context26.next = 2;
  12986. break;
  12987. }
  12988. throw new ne({
  12989. message: "匿名用户不支持登出操作"
  12990. });
  12991. case 2:
  12992. _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);
  12993. if (s) {
  12994. _context26.next = 5;
  12995. break;
  12996. }
  12997. return _context26.abrupt("return");
  12998. case 5:
  12999. _context26.next = 7;
  13000. return this._request.send("auth.logout", {
  13001. refresh_token: s
  13002. });
  13003. case 7:
  13004. r = _context26.sent;
  13005. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Ke, {
  13006. env: this.config.env,
  13007. loginType: $e.NULL,
  13008. persistence: this.config.persistence
  13009. }), r));
  13010. case 9:
  13011. case "end":
  13012. return _context26.stop();
  13013. }
  13014. }
  13015. }, _callee26, this);
  13016. }));
  13017. function signOut() {
  13018. return _signOut.apply(this, arguments);
  13019. }
  13020. return signOut;
  13021. }()
  13022. }, {
  13023. key: "signUpWithEmailAndPassword",
  13024. value: function () {
  13025. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  13026. return _regenerator.default.wrap(function _callee27$(_context27) {
  13027. while (1) {
  13028. switch (_context27.prev = _context27.next) {
  13029. case 0:
  13030. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  13031. email: e,
  13032. password: t
  13033. }));
  13034. case 1:
  13035. case "end":
  13036. return _context27.stop();
  13037. }
  13038. }
  13039. }, _callee27, this);
  13040. }));
  13041. function signUpWithEmailAndPassword(_x22, _x23) {
  13042. return _signUpWithEmailAndPassword.apply(this, arguments);
  13043. }
  13044. return signUpWithEmailAndPassword;
  13045. }()
  13046. }, {
  13047. key: "sendPasswordResetEmail",
  13048. value: function () {
  13049. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  13050. return _regenerator.default.wrap(function _callee28$(_context28) {
  13051. while (1) {
  13052. switch (_context28.prev = _context28.next) {
  13053. case 0:
  13054. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  13055. email: e
  13056. }));
  13057. case 1:
  13058. case "end":
  13059. return _context28.stop();
  13060. }
  13061. }
  13062. }, _callee28, this);
  13063. }));
  13064. function sendPasswordResetEmail(_x24) {
  13065. return _sendPasswordResetEmail.apply(this, arguments);
  13066. }
  13067. return sendPasswordResetEmail;
  13068. }()
  13069. }, {
  13070. key: "onLoginStateChanged",
  13071. value: function onLoginStateChanged(e) {
  13072. var _this9 = this;
  13073. Ne(qe, function () {
  13074. var t = _this9.hasLoginState();
  13075. e.call(_this9, t);
  13076. });
  13077. var t = this.hasLoginState();
  13078. e.call(this, t);
  13079. }
  13080. }, {
  13081. key: "onLoginStateExpired",
  13082. value: function onLoginStateExpired(e) {
  13083. Ne(Me, e.bind(this));
  13084. }
  13085. }, {
  13086. key: "onAccessTokenRefreshed",
  13087. value: function onAccessTokenRefreshed(e) {
  13088. Ne(Be, e.bind(this));
  13089. }
  13090. }, {
  13091. key: "onAnonymousConverted",
  13092. value: function onAnonymousConverted(e) {
  13093. Ne(je, e.bind(this));
  13094. }
  13095. }, {
  13096. key: "onLoginTypeChanged",
  13097. value: function onLoginTypeChanged(e) {
  13098. var _this10 = this;
  13099. Ne(Ke, function () {
  13100. var t = _this10.hasLoginState();
  13101. e.call(_this10, t);
  13102. });
  13103. }
  13104. }, {
  13105. key: "getAccessToken",
  13106. value: function () {
  13107. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  13108. return _regenerator.default.wrap(function _callee29$(_context29) {
  13109. while (1) {
  13110. switch (_context29.prev = _context29.next) {
  13111. case 0:
  13112. _context29.next = 2;
  13113. return this._request.getAccessToken();
  13114. case 2:
  13115. _context29.t0 = _context29.sent.accessToken;
  13116. _context29.t1 = this.config.env;
  13117. return _context29.abrupt("return", {
  13118. accessToken: _context29.t0,
  13119. env: _context29.t1
  13120. });
  13121. case 5:
  13122. case "end":
  13123. return _context29.stop();
  13124. }
  13125. }
  13126. }, _callee29, this);
  13127. }));
  13128. function getAccessToken() {
  13129. return _getAccessToken2.apply(this, arguments);
  13130. }
  13131. return getAccessToken;
  13132. }()
  13133. }, {
  13134. key: "hasLoginState",
  13135. value: function hasLoginState() {
  13136. var e = this._cache.keys.refreshTokenKey;
  13137. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  13138. }
  13139. }, {
  13140. key: "isUsernameRegistered",
  13141. value: function () {
  13142. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  13143. var _yield$this$_request$5, t;
  13144. return _regenerator.default.wrap(function _callee30$(_context30) {
  13145. while (1) {
  13146. switch (_context30.prev = _context30.next) {
  13147. case 0:
  13148. if (!("string" != typeof e)) {
  13149. _context30.next = 2;
  13150. break;
  13151. }
  13152. throw new ne({
  13153. code: "PARAM_ERROR",
  13154. message: "username must be a string"
  13155. });
  13156. case 2:
  13157. _context30.next = 4;
  13158. return this._request.send("auth.isUsernameRegistered", {
  13159. username: e
  13160. });
  13161. case 4:
  13162. _yield$this$_request$5 = _context30.sent;
  13163. t = _yield$this$_request$5.data;
  13164. return _context30.abrupt("return", t && t.isRegistered);
  13165. case 7:
  13166. case "end":
  13167. return _context30.stop();
  13168. }
  13169. }
  13170. }, _callee30, this);
  13171. }));
  13172. function isUsernameRegistered(_x25) {
  13173. return _isUsernameRegistered.apply(this, arguments);
  13174. }
  13175. return isUsernameRegistered;
  13176. }()
  13177. }, {
  13178. key: "getLoginState",
  13179. value: function getLoginState() {
  13180. return Promise.resolve(this.hasLoginState());
  13181. }
  13182. }, {
  13183. key: "signInWithTicket",
  13184. value: function () {
  13185. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  13186. return _regenerator.default.wrap(function _callee31$(_context31) {
  13187. while (1) {
  13188. switch (_context31.prev = _context31.next) {
  13189. case 0:
  13190. return _context31.abrupt("return", new tt(this.config).signIn(e));
  13191. case 1:
  13192. case "end":
  13193. return _context31.stop();
  13194. }
  13195. }
  13196. }, _callee31, this);
  13197. }));
  13198. function signInWithTicket(_x26) {
  13199. return _signInWithTicket.apply(this, arguments);
  13200. }
  13201. return signInWithTicket;
  13202. }()
  13203. }, {
  13204. key: "shouldRefreshAccessToken",
  13205. value: function shouldRefreshAccessToken(e) {
  13206. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  13207. }
  13208. }, {
  13209. key: "getUserInfo",
  13210. value: function getUserInfo() {
  13211. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  13212. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  13213. requestId: e.seqId
  13214. });
  13215. });
  13216. }
  13217. }, {
  13218. key: "getAuthHeader",
  13219. value: function getAuthHeader() {
  13220. var _this$_cache$keys11 = this._cache.keys,
  13221. e = _this$_cache$keys11.refreshTokenKey,
  13222. t = _this$_cache$keys11.accessTokenKey,
  13223. n = this._cache.getStore(e);
  13224. return {
  13225. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  13226. };
  13227. }
  13228. }, {
  13229. key: "_onAnonymousConverted",
  13230. value: function _onAnonymousConverted(e) {
  13231. var t = e.data.env;
  13232. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  13233. }
  13234. }, {
  13235. key: "_onLoginTypeChanged",
  13236. value: function _onLoginTypeChanged(e) {
  13237. var _e$data = e.data,
  13238. t = _e$data.loginType,
  13239. n = _e$data.persistence,
  13240. s = _e$data.env;
  13241. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  13242. }
  13243. }]);
  13244. return rt;
  13245. }();
  13246. var it = function it(e, t) {
  13247. t = t || we();
  13248. var n = Ye(this.config.env),
  13249. s = e.cloudPath,
  13250. r = e.filePath,
  13251. i = e.onUploadProgress,
  13252. _e$fileType = e.fileType,
  13253. o = _e$fileType === void 0 ? "image" : _e$fileType;
  13254. return n.send("storage.getUploadMetadata", {
  13255. path: s
  13256. }).then(function (e) {
  13257. var _e$data2 = e.data,
  13258. a = _e$data2.url,
  13259. c = _e$data2.authorization,
  13260. u = _e$data2.token,
  13261. h = _e$data2.fileId,
  13262. l = _e$data2.cosFileId,
  13263. d = e.requestId,
  13264. p = {
  13265. key: s,
  13266. signature: c,
  13267. "x-cos-meta-fileid": l,
  13268. success_action_status: "201",
  13269. "x-cos-security-token": u
  13270. };
  13271. n.upload({
  13272. url: a,
  13273. data: p,
  13274. file: r,
  13275. name: s,
  13276. fileType: o,
  13277. onUploadProgress: i
  13278. }).then(function (e) {
  13279. 201 === e.statusCode ? t(null, {
  13280. fileID: h,
  13281. requestId: d
  13282. }) : t(new ne({
  13283. code: "STORAGE_REQUEST_FAIL",
  13284. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  13285. }));
  13286. }).catch(function (e) {
  13287. t(e);
  13288. });
  13289. }).catch(function (e) {
  13290. t(e);
  13291. }), t.promise;
  13292. },
  13293. ot = function ot(e, t) {
  13294. t = t || we();
  13295. var n = Ye(this.config.env),
  13296. s = e.cloudPath;
  13297. return n.send("storage.getUploadMetadata", {
  13298. path: s
  13299. }).then(function (e) {
  13300. t(null, e);
  13301. }).catch(function (e) {
  13302. t(e);
  13303. }), t.promise;
  13304. },
  13305. at = function at(_ref7, t) {
  13306. var e = _ref7.fileList;
  13307. if (t = t || we(), !e || !Array.isArray(e)) return {
  13308. code: "INVALID_PARAM",
  13309. message: "fileList必须是非空的数组"
  13310. };
  13311. var _iterator3 = _createForOfIteratorHelper(e),
  13312. _step3;
  13313. try {
  13314. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  13315. var _t8 = _step3.value;
  13316. if (!_t8 || "string" != typeof _t8) return {
  13317. code: "INVALID_PARAM",
  13318. message: "fileList的元素必须是非空的字符串"
  13319. };
  13320. }
  13321. } catch (err) {
  13322. _iterator3.e(err);
  13323. } finally {
  13324. _iterator3.f();
  13325. }
  13326. var n = {
  13327. fileid_list: e
  13328. };
  13329. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  13330. e.code ? t(null, e) : t(null, {
  13331. fileList: e.data.delete_list,
  13332. requestId: e.requestId
  13333. });
  13334. }).catch(function (e) {
  13335. t(e);
  13336. }), t.promise;
  13337. },
  13338. ct = function ct(_ref8, t) {
  13339. var e = _ref8.fileList;
  13340. t = t || we(), e && Array.isArray(e) || t(null, {
  13341. code: "INVALID_PARAM",
  13342. message: "fileList必须是非空的数组"
  13343. });
  13344. var n = [];
  13345. var _iterator4 = _createForOfIteratorHelper(e),
  13346. _step4;
  13347. try {
  13348. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  13349. var _s9 = _step4.value;
  13350. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  13351. code: "INVALID_PARAM",
  13352. message: "fileList的元素必须是包含fileID和maxAge的对象"
  13353. }), n.push({
  13354. fileid: _s9.fileID,
  13355. max_age: _s9.maxAge
  13356. })) : "string" == typeof _s9 ? n.push({
  13357. fileid: _s9
  13358. }) : t(null, {
  13359. code: "INVALID_PARAM",
  13360. message: "fileList的元素必须是字符串"
  13361. });
  13362. }
  13363. } catch (err) {
  13364. _iterator4.e(err);
  13365. } finally {
  13366. _iterator4.f();
  13367. }
  13368. var s = {
  13369. file_list: n
  13370. };
  13371. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  13372. e.code ? t(null, e) : t(null, {
  13373. fileList: e.data.download_list,
  13374. requestId: e.requestId
  13375. });
  13376. }).catch(function (e) {
  13377. t(e);
  13378. }), t.promise;
  13379. },
  13380. ut = /*#__PURE__*/function () {
  13381. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  13382. var e, n, s, r;
  13383. return _regenerator.default.wrap(function _callee32$(_context32) {
  13384. while (1) {
  13385. switch (_context32.prev = _context32.next) {
  13386. case 0:
  13387. e = _ref9.fileID;
  13388. _context32.next = 3;
  13389. return ct.call(this, {
  13390. fileList: [{
  13391. fileID: e,
  13392. maxAge: 600
  13393. }]
  13394. });
  13395. case 3:
  13396. n = _context32.sent.fileList[0];
  13397. if (!("SUCCESS" !== n.code)) {
  13398. _context32.next = 6;
  13399. break;
  13400. }
  13401. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13402. e(n);
  13403. }));
  13404. case 6:
  13405. s = Ye(this.config.env);
  13406. r = n.download_url;
  13407. if (!(r = encodeURI(r), !t)) {
  13408. _context32.next = 10;
  13409. break;
  13410. }
  13411. return _context32.abrupt("return", s.download({
  13412. url: r
  13413. }));
  13414. case 10:
  13415. _context32.t0 = t;
  13416. _context32.next = 13;
  13417. return s.download({
  13418. url: r
  13419. });
  13420. case 13:
  13421. _context32.t1 = _context32.sent;
  13422. (0, _context32.t0)(_context32.t1);
  13423. case 15:
  13424. case "end":
  13425. return _context32.stop();
  13426. }
  13427. }
  13428. }, _callee32, this);
  13429. }));
  13430. return function ut(_x27, _x28) {
  13431. return _ref10.apply(this, arguments);
  13432. };
  13433. }(),
  13434. ht = function ht(_ref11, i) {
  13435. var e = _ref11.name,
  13436. t = _ref11.data,
  13437. n = _ref11.query,
  13438. s = _ref11.parse,
  13439. r = _ref11.search;
  13440. var o = i || we();
  13441. var a;
  13442. try {
  13443. a = t ? JSON.stringify(t) : "";
  13444. } catch (e) {
  13445. return Promise.reject(e);
  13446. }
  13447. if (!e) return Promise.reject(new ne({
  13448. code: "PARAM_ERROR",
  13449. message: "函数名不能为空"
  13450. }));
  13451. var c = {
  13452. inQuery: n,
  13453. parse: s,
  13454. search: r,
  13455. function_name: e,
  13456. request_data: a
  13457. };
  13458. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13459. if (e.code) o(null, e);else {
  13460. var _t9 = e.data.response_data;
  13461. if (s) o(null, {
  13462. result: _t9,
  13463. requestId: e.requestId
  13464. });else try {
  13465. _t9 = JSON.parse(e.data.response_data), o(null, {
  13466. result: _t9,
  13467. requestId: e.requestId
  13468. });
  13469. } catch (e) {
  13470. o(new ne({
  13471. message: "response data must be json"
  13472. }));
  13473. }
  13474. }
  13475. return o.promise;
  13476. }).catch(function (e) {
  13477. o(e);
  13478. }), o.promise;
  13479. },
  13480. lt = {
  13481. timeout: 15e3,
  13482. persistence: "session"
  13483. },
  13484. dt = {};
  13485. var pt = /*#__PURE__*/function () {
  13486. function pt(e) {
  13487. (0, _classCallCheck2.default)(this, pt);
  13488. this.config = e || this.config, this.authObj = void 0;
  13489. }
  13490. (0, _createClass2.default)(pt, [{
  13491. key: "init",
  13492. value: function init(e) {
  13493. switch (ke.adapter || (this.requestClient = new ke.adapter.reqClass({
  13494. timeout: e.timeout || 5e3,
  13495. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13496. })), this.config = _objectSpread(_objectSpread({}, lt), e), !0) {
  13497. case this.config.timeout > 6e5:
  13498. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13499. break;
  13500. case this.config.timeout < 100:
  13501. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13502. }
  13503. return new pt(this.config);
  13504. }
  13505. }, {
  13506. key: "auth",
  13507. value: function auth() {
  13508. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13509. e = _ref12.persistence;
  13510. if (this.authObj) return this.authObj;
  13511. var t = e || ke.adapter.primaryStorage || lt.persistence;
  13512. var n;
  13513. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13514. var t = e.env;
  13515. Ee[t] = new Ae(e), Oe[t] = new Ae(_objectSpread(_objectSpread({}, e), {}, {
  13516. persistence: "local"
  13517. }));
  13518. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  13519. }
  13520. }, {
  13521. key: "on",
  13522. value: function on(e, t) {
  13523. return Ne.apply(this, [e, t]);
  13524. }
  13525. }, {
  13526. key: "off",
  13527. value: function off(e, t) {
  13528. return Fe.apply(this, [e, t]);
  13529. }
  13530. }, {
  13531. key: "callFunction",
  13532. value: function callFunction(e, t) {
  13533. return ht.apply(this, [e, t]);
  13534. }
  13535. }, {
  13536. key: "deleteFile",
  13537. value: function deleteFile(e, t) {
  13538. return at.apply(this, [e, t]);
  13539. }
  13540. }, {
  13541. key: "getTempFileURL",
  13542. value: function getTempFileURL(e, t) {
  13543. return ct.apply(this, [e, t]);
  13544. }
  13545. }, {
  13546. key: "downloadFile",
  13547. value: function downloadFile(e, t) {
  13548. return ut.apply(this, [e, t]);
  13549. }
  13550. }, {
  13551. key: "uploadFile",
  13552. value: function uploadFile(e, t) {
  13553. return it.apply(this, [e, t]);
  13554. }
  13555. }, {
  13556. key: "getUploadMetadata",
  13557. value: function getUploadMetadata(e, t) {
  13558. return ot.apply(this, [e, t]);
  13559. }
  13560. }, {
  13561. key: "registerExtension",
  13562. value: function registerExtension(e) {
  13563. dt[e.name] = e;
  13564. }
  13565. }, {
  13566. key: "invokeExtension",
  13567. value: function () {
  13568. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  13569. var n;
  13570. return _regenerator.default.wrap(function _callee33$(_context33) {
  13571. while (1) {
  13572. switch (_context33.prev = _context33.next) {
  13573. case 0:
  13574. n = dt[e];
  13575. if (n) {
  13576. _context33.next = 3;
  13577. break;
  13578. }
  13579. throw new ne({
  13580. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  13581. });
  13582. case 3:
  13583. _context33.next = 5;
  13584. return n.invoke(t, this);
  13585. case 5:
  13586. return _context33.abrupt("return", _context33.sent);
  13587. case 6:
  13588. case "end":
  13589. return _context33.stop();
  13590. }
  13591. }
  13592. }, _callee33, this);
  13593. }));
  13594. function invokeExtension(_x29, _x30) {
  13595. return _invokeExtension.apply(this, arguments);
  13596. }
  13597. return invokeExtension;
  13598. }()
  13599. }, {
  13600. key: "useAdapters",
  13601. value: function useAdapters(e) {
  13602. var _ref13 = be(e) || {},
  13603. t = _ref13.adapter,
  13604. n = _ref13.runtime;
  13605. t && (ke.adapter = t), n && (ke.runtime = n);
  13606. }
  13607. }]);
  13608. return pt;
  13609. }();
  13610. var ft = new pt();
  13611. function gt(e, t, n) {
  13612. void 0 === n && (n = {});
  13613. var s = /\?/.test(t),
  13614. r = "";
  13615. for (var i in n) {
  13616. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  13617. }
  13618. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  13619. }
  13620. var mt = /*#__PURE__*/function () {
  13621. function mt() {
  13622. (0, _classCallCheck2.default)(this, mt);
  13623. }
  13624. (0, _createClass2.default)(mt, [{
  13625. key: "post",
  13626. value: function post(e) {
  13627. var t = e.url,
  13628. n = e.data,
  13629. s = e.headers;
  13630. return new Promise(function (e, r) {
  13631. se.request({
  13632. url: gt("https:", t),
  13633. data: n,
  13634. method: "POST",
  13635. header: s,
  13636. success: function success(t) {
  13637. e(t);
  13638. },
  13639. fail: function fail(e) {
  13640. r(e);
  13641. }
  13642. });
  13643. });
  13644. }
  13645. }, {
  13646. key: "upload",
  13647. value: function upload(e) {
  13648. return new Promise(function (t, n) {
  13649. var s = e.url,
  13650. r = e.file,
  13651. i = e.data,
  13652. o = e.headers,
  13653. a = e.fileType,
  13654. c = se.uploadFile({
  13655. url: gt("https:", s),
  13656. name: "file",
  13657. formData: Object.assign({}, i),
  13658. filePath: r,
  13659. fileType: a,
  13660. header: o,
  13661. success: function success(e) {
  13662. var n = {
  13663. statusCode: e.statusCode,
  13664. data: e.data || {}
  13665. };
  13666. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  13667. },
  13668. fail: function fail(e) {
  13669. n(new Error(e.errMsg || "uploadFile:fail"));
  13670. }
  13671. });
  13672. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  13673. e.onUploadProgress({
  13674. loaded: t.totalBytesSent,
  13675. total: t.totalBytesExpectedToSend
  13676. });
  13677. });
  13678. });
  13679. }
  13680. }]);
  13681. return mt;
  13682. }();
  13683. var yt = {
  13684. setItem: function setItem(e, t) {
  13685. se.setStorageSync(e, t);
  13686. },
  13687. getItem: function getItem(e) {
  13688. return se.getStorageSync(e);
  13689. },
  13690. removeItem: function removeItem(e) {
  13691. se.removeStorageSync(e);
  13692. },
  13693. clear: function clear() {
  13694. se.clearStorageSync();
  13695. }
  13696. };
  13697. var _t = {
  13698. genAdapter: function genAdapter() {
  13699. return {
  13700. root: {},
  13701. reqClass: mt,
  13702. localStorage: yt,
  13703. primaryStorage: "local"
  13704. };
  13705. },
  13706. isMatch: function isMatch() {
  13707. return !0;
  13708. },
  13709. runtime: "uni_app"
  13710. };
  13711. ft.useAdapters(_t);
  13712. var wt = ft,
  13713. vt = wt.init;
  13714. wt.init = function (e) {
  13715. e.env = e.spaceId;
  13716. var t = vt.call(this, e);
  13717. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  13718. var n = t.auth;
  13719. return t.auth = function (e) {
  13720. var t = n.call(this, e);
  13721. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  13722. var n;
  13723. t[e] = (n = t[e], function (e) {
  13724. e = e || {};
  13725. var _te = te(e),
  13726. t = _te.success,
  13727. s = _te.fail,
  13728. r = _te.complete;
  13729. if (!(t || s || r)) return n.call(this, e);
  13730. n.call(this, e).then(function (e) {
  13731. t && t(e), r && r(e);
  13732. }, function (e) {
  13733. s && s(e), r && r(e);
  13734. });
  13735. }).bind(t);
  13736. }), t;
  13737. }, t.customAuth = t.auth, t;
  13738. };
  13739. var It = wt;
  13740. var St = /*#__PURE__*/function (_fe) {
  13741. (0, _inherits2.default)(St, _fe);
  13742. var _super8 = _createSuper(St);
  13743. function St() {
  13744. (0, _classCallCheck2.default)(this, St);
  13745. return _super8.apply(this, arguments);
  13746. }
  13747. (0, _createClass2.default)(St, [{
  13748. key: "getAccessToken",
  13749. value: function getAccessToken() {
  13750. var _this11 = this;
  13751. return new Promise(function (e, t) {
  13752. var n = "Anonymous_Access_token";
  13753. _this11.setAccessToken(n), e(n);
  13754. });
  13755. }
  13756. }, {
  13757. key: "setupRequest",
  13758. value: function setupRequest(e, t) {
  13759. var n = Object.assign({}, e, {
  13760. spaceId: this.config.spaceId,
  13761. timestamp: Date.now()
  13762. }),
  13763. s = {
  13764. "Content-Type": "application/json"
  13765. };
  13766. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret);
  13767. var r = he();
  13768. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  13769. var _re = re(),
  13770. i = _re.token;
  13771. return s["x-client-token"] = i, {
  13772. url: this.config.requestUrl,
  13773. method: "POST",
  13774. data: n,
  13775. dataType: "json",
  13776. header: JSON.parse(JSON.stringify(s))
  13777. };
  13778. }
  13779. }, {
  13780. key: "uploadFileToOSS",
  13781. value: function uploadFileToOSS(_ref14) {
  13782. var _this12 = this;
  13783. var e = _ref14.url,
  13784. t = _ref14.formData,
  13785. n = _ref14.name,
  13786. s = _ref14.filePath,
  13787. r = _ref14.fileType,
  13788. i = _ref14.onUploadProgress;
  13789. return new Promise(function (o, a) {
  13790. var c = _this12.adapter.uploadFile({
  13791. url: e,
  13792. formData: t,
  13793. name: n,
  13794. filePath: s,
  13795. fileType: r,
  13796. success: function success(e) {
  13797. e && e.statusCode < 400 ? o(e) : a(new ne({
  13798. code: "UPLOAD_FAILED",
  13799. message: "文件上传失败"
  13800. }));
  13801. },
  13802. fail: function fail(e) {
  13803. a(new ne({
  13804. code: e.code || "UPLOAD_FAILED",
  13805. message: e.message || e.errMsg || "文件上传失败"
  13806. }));
  13807. }
  13808. });
  13809. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  13810. i({
  13811. loaded: e.totalBytesSent,
  13812. total: e.totalBytesExpectedToSend
  13813. });
  13814. });
  13815. });
  13816. }
  13817. }, {
  13818. key: "uploadFile",
  13819. value: function uploadFile(_ref15) {
  13820. var _this13 = this;
  13821. var e = _ref15.filePath,
  13822. t = _ref15.cloudPath,
  13823. _ref15$fileType = _ref15.fileType,
  13824. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  13825. s = _ref15.onUploadProgress;
  13826. if (!t) throw new ne({
  13827. code: "CLOUDPATH_REQUIRED",
  13828. message: "cloudPath不可为空"
  13829. });
  13830. var r;
  13831. return this.getOSSUploadOptionsFromPath({
  13832. cloudPath: t
  13833. }).then(function (t) {
  13834. var _t$result = t.result,
  13835. i = _t$result.url,
  13836. o = _t$result.formData,
  13837. a = _t$result.name;
  13838. r = t.result.fileUrl;
  13839. var c = {
  13840. url: i,
  13841. formData: o,
  13842. name: a,
  13843. filePath: e,
  13844. fileType: n
  13845. };
  13846. return _this13.uploadFileToOSS(Object.assign({}, c, {
  13847. onUploadProgress: s
  13848. }));
  13849. }).then(function () {
  13850. return _this13.reportOSSUpload({
  13851. cloudPath: t
  13852. });
  13853. }).then(function (t) {
  13854. return new Promise(function (n, s) {
  13855. t.success ? n({
  13856. success: !0,
  13857. filePath: e,
  13858. fileID: r
  13859. }) : s(new ne({
  13860. code: "UPLOAD_FAILED",
  13861. message: "文件上传失败"
  13862. }));
  13863. });
  13864. });
  13865. }
  13866. }, {
  13867. key: "deleteFile",
  13868. value: function deleteFile(_ref16) {
  13869. var e = _ref16.fileList;
  13870. var t = {
  13871. method: "serverless.file.resource.delete",
  13872. params: JSON.stringify({
  13873. fileList: e
  13874. })
  13875. };
  13876. return this.request(this.setupRequest(t)).then(function (e) {
  13877. if (e.success) return e.result;
  13878. throw new ne({
  13879. code: "DELETE_FILE_FAILED",
  13880. message: "删除文件失败"
  13881. });
  13882. });
  13883. }
  13884. }, {
  13885. key: "getTempFileURL",
  13886. value: function getTempFileURL() {
  13887. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13888. e = _ref17.fileList;
  13889. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  13890. code: "INVALID_PARAM",
  13891. message: "fileList的元素必须是非空的字符串"
  13892. });
  13893. var t = {
  13894. method: "serverless.file.resource.getTempFileURL",
  13895. params: JSON.stringify({
  13896. fileList: e
  13897. })
  13898. };
  13899. return this.request(this.setupRequest(t)).then(function (e) {
  13900. if (e.success) return {
  13901. fileList: e.result.fileList.map(function (e) {
  13902. return {
  13903. fileID: e.fileID,
  13904. tempFileURL: e.tempFileURL
  13905. };
  13906. })
  13907. };
  13908. throw new ne({
  13909. code: "GET_TEMP_FILE_URL_FAILED",
  13910. message: "获取临时文件链接失败"
  13911. });
  13912. });
  13913. }
  13914. }]);
  13915. return St;
  13916. }(fe);
  13917. var bt = {
  13918. init: function init(e) {
  13919. var t = new St(e),
  13920. n = {
  13921. signInAnonymously: function signInAnonymously() {
  13922. return t.authorize();
  13923. },
  13924. getLoginState: function getLoginState() {
  13925. return Promise.resolve(!1);
  13926. }
  13927. };
  13928. return t.auth = function () {
  13929. return n;
  13930. }, t.customAuth = t.auth, t;
  13931. }
  13932. };
  13933. function kt(_ref18) {
  13934. var e = _ref18.data;
  13935. var t;
  13936. t = he();
  13937. var n = JSON.parse(JSON.stringify(e || {}));
  13938. if (Object.assign(n, {
  13939. clientInfo: t
  13940. }), !n.uniIdToken) {
  13941. var _re2 = re(),
  13942. _e19 = _re2.token;
  13943. _e19 && (n.uniIdToken = _e19);
  13944. }
  13945. return n;
  13946. }
  13947. function Ct() {
  13948. return _Ct.apply(this, arguments);
  13949. }
  13950. function _Ct() {
  13951. _Ct = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  13952. var _this26 = this;
  13953. var _ref60,
  13954. e,
  13955. t,
  13956. _this$__dev__,
  13957. n,
  13958. s,
  13959. r,
  13960. i,
  13961. o,
  13962. a,
  13963. _args6 = arguments;
  13964. return _regenerator.default.wrap(function _callee54$(_context54) {
  13965. while (1) {
  13966. switch (_context54.prev = _context54.next) {
  13967. case 0:
  13968. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.name, t = _ref60.data;
  13969. _context54.next = 3;
  13970. return this.__dev__.initLocalNetwork();
  13971. case 3:
  13972. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  13973. aliyun: "aliyun",
  13974. tencent: "tcb"
  13975. }[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);
  13976. return _context54.abrupt("return", new Promise(function (t, n) {
  13977. se.request({
  13978. method: "POST",
  13979. url: o,
  13980. data: {
  13981. name: e,
  13982. platform: P,
  13983. provider: r,
  13984. spaceId: i
  13985. },
  13986. timeout: 3e3,
  13987. success: function success(e) {
  13988. t(e);
  13989. },
  13990. fail: function fail() {
  13991. t({
  13992. data: {
  13993. code: "NETWORK_ERROR",
  13994. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  13995. }
  13996. });
  13997. }
  13998. });
  13999. }).then(function () {
  14000. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14001. e = _ref61.data;
  14002. var _ref62 = e || {},
  14003. t = _ref62.code,
  14004. n = _ref62.message;
  14005. return {
  14006. code: 0 === t ? 0 : t || "SYS_ERR",
  14007. message: n || "SYS_ERR"
  14008. };
  14009. }).then(function (_ref63) {
  14010. var n = _ref63.code,
  14011. s = _ref63.message;
  14012. if (0 !== n) {
  14013. switch (n) {
  14014. case "MODULE_ENCRYPTED":
  14015. 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"));
  14016. break;
  14017. case "FUNCTION_ENCRYPTED":
  14018. 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"));
  14019. break;
  14020. case "ACTION_ENCRYPTED":
  14021. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  14022. break;
  14023. case "NETWORK_ERROR":
  14024. {
  14025. var _e31 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  14026. throw console.error(_e31), new Error(_e31);
  14027. }
  14028. case "SWITCH_TO_CLOUD":
  14029. break;
  14030. default:
  14031. {
  14032. var _e32 = "\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");
  14033. throw console.error(_e32), new Error(_e32);
  14034. }
  14035. }
  14036. return _this26._callCloudFunction({
  14037. name: e,
  14038. data: t
  14039. });
  14040. }
  14041. return new Promise(function (e, n) {
  14042. var s = kt.call(_this26, {
  14043. data: t
  14044. });
  14045. se.request({
  14046. method: "POST",
  14047. url: a,
  14048. data: {
  14049. provider: r,
  14050. platform: P,
  14051. param: s
  14052. },
  14053. success: function success() {
  14054. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14055. t = _ref64.statusCode,
  14056. s = _ref64.data;
  14057. return !t || t >= 400 ? n(new ne({
  14058. code: s.code || "SYS_ERR",
  14059. message: s.message || "request:fail"
  14060. })) : e({
  14061. result: s
  14062. });
  14063. },
  14064. fail: function fail(e) {
  14065. n(new ne({
  14066. code: e.code || e.errCode || "SYS_ERR",
  14067. message: e.message || e.errMsg || "request:fail"
  14068. }));
  14069. }
  14070. });
  14071. });
  14072. }));
  14073. case 5:
  14074. case "end":
  14075. return _context54.stop();
  14076. }
  14077. }
  14078. }, _callee54, this);
  14079. }));
  14080. return _Ct.apply(this, arguments);
  14081. }
  14082. var Tt = [{
  14083. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  14084. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  14085. mode: "append"
  14086. }];
  14087. var Pt = /[\\^$.*+?()[\]{}|]/g,
  14088. At = RegExp(Pt.source);
  14089. function Et(e, t, n) {
  14090. return e.replace(new RegExp((s = t) && At.test(s) ? s.replace(Pt, "\\$&") : s, "g"), n);
  14091. var s;
  14092. }
  14093. var Ot = "none",
  14094. xt = "request",
  14095. Rt = "response",
  14096. Ut = "both";
  14097. var Lt = /*#__PURE__*/function () {
  14098. function Lt() {
  14099. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14100. e = _ref19.secretType,
  14101. t = _ref19.uniCloudIns;
  14102. (0, _classCallCheck2.default)(this, Lt);
  14103. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  14104. var _this$uniCloudIns$con = this.uniCloudIns.config,
  14105. n = _this$uniCloudIns$con.provider,
  14106. s = _this$uniCloudIns$con.spaceId;
  14107. var r;
  14108. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  14109. }
  14110. (0, _createClass2.default)(Lt, [{
  14111. key: "getSystemInfo",
  14112. value: function getSystemInfo() {
  14113. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  14114. }
  14115. }, {
  14116. key: "appId",
  14117. get: function get() {
  14118. return this.getSystemInfo().appId;
  14119. }
  14120. }, {
  14121. key: "deviceId",
  14122. get: function get() {
  14123. return this.getSystemInfo().deviceId;
  14124. }
  14125. }, {
  14126. key: "encryptData",
  14127. value: function () {
  14128. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  14129. return _regenerator.default.wrap(function _callee34$(_context34) {
  14130. while (1) {
  14131. switch (_context34.prev = _context34.next) {
  14132. case 0:
  14133. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  14134. case 1:
  14135. case "end":
  14136. return _context34.stop();
  14137. }
  14138. }
  14139. }, _callee34, this);
  14140. }));
  14141. function encryptData(_x31) {
  14142. return _encryptData.apply(this, arguments);
  14143. }
  14144. return encryptData;
  14145. }()
  14146. }, {
  14147. key: "decryptResult",
  14148. value: function () {
  14149. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  14150. var _ref20, t, n;
  14151. return _regenerator.default.wrap(function _callee35$(_context35) {
  14152. while (1) {
  14153. switch (_context35.prev = _context35.next) {
  14154. case 0:
  14155. if (!(this.secretType === Ot)) {
  14156. _context35.next = 2;
  14157. break;
  14158. }
  14159. return _context35.abrupt("return", e);
  14160. case 2:
  14161. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  14162. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  14163. case 4:
  14164. case "end":
  14165. return _context35.stop();
  14166. }
  14167. }
  14168. }, _callee35, this);
  14169. }));
  14170. function decryptResult(_x32) {
  14171. return _decryptResult.apply(this, arguments);
  14172. }
  14173. return decryptResult;
  14174. }()
  14175. }, {
  14176. key: "wrapVerifyClientCallFunction",
  14177. value: function wrapVerifyClientCallFunction(e) {
  14178. var t = this;
  14179. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  14180. var _ref22,
  14181. n,
  14182. _ref22$data,
  14183. s,
  14184. r,
  14185. _args36 = arguments;
  14186. return _regenerator.default.wrap(function _callee36$(_context36) {
  14187. while (1) {
  14188. switch (_context36.prev = _context36.next) {
  14189. case 0:
  14190. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  14191. _context36.next = 3;
  14192. return t.prepare();
  14193. case 3:
  14194. _context36.next = 5;
  14195. return t.platformGetSignOption();
  14196. case 5:
  14197. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  14198. _context36.next = 8;
  14199. return e({
  14200. name: n,
  14201. data: s
  14202. });
  14203. case 8:
  14204. r = _context36.sent;
  14205. _context36.t0 = t.isClientKeyNotFound(r);
  14206. if (!_context36.t0) {
  14207. _context36.next = 19;
  14208. break;
  14209. }
  14210. _context36.next = 13;
  14211. return t.prepare({
  14212. forceUpdate: !0
  14213. });
  14214. case 13:
  14215. _context36.next = 15;
  14216. return t.platformGetSignOption();
  14217. case 15:
  14218. s._uniCloudOptions = _context36.sent;
  14219. _context36.next = 18;
  14220. return e({
  14221. name: n,
  14222. data: s
  14223. });
  14224. case 18:
  14225. r = _context36.sent;
  14226. case 19:
  14227. return _context36.abrupt("return", r);
  14228. case 20:
  14229. case "end":
  14230. return _context36.stop();
  14231. }
  14232. }
  14233. }, _callee36);
  14234. }));
  14235. }
  14236. }, {
  14237. key: "wrapEncryptDataCallFunction",
  14238. value: function wrapEncryptDataCallFunction(e) {
  14239. var t = this;
  14240. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  14241. var _ref24,
  14242. n,
  14243. _ref24$data,
  14244. s,
  14245. r,
  14246. i,
  14247. _r3,
  14248. _args37 = arguments;
  14249. return _regenerator.default.wrap(function _callee37$(_context37) {
  14250. while (1) {
  14251. switch (_context37.prev = _context37.next) {
  14252. case 0:
  14253. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  14254. _context37.next = 3;
  14255. return t.prepare();
  14256. case 3:
  14257. _context37.next = 5;
  14258. return t.encryptData(s);
  14259. case 5:
  14260. r = _context37.sent;
  14261. _context37.next = 8;
  14262. return e({
  14263. name: n,
  14264. data: r
  14265. });
  14266. case 8:
  14267. i = _context37.sent;
  14268. if (!t.isClientKeyNotFound(i)) {
  14269. _context37.next = 21;
  14270. break;
  14271. }
  14272. _context37.next = 12;
  14273. return t.prepare({
  14274. forceUpdate: !0
  14275. });
  14276. case 12:
  14277. _context37.next = 14;
  14278. return t.encryptData(s);
  14279. case 14:
  14280. _r3 = _context37.sent;
  14281. _context37.next = 17;
  14282. return t.platformGetSignOption();
  14283. case 17:
  14284. s._uniCloudOptions = _context37.sent;
  14285. _context37.next = 20;
  14286. return e({
  14287. name: n,
  14288. data: _r3
  14289. });
  14290. case 20:
  14291. i = _context37.sent;
  14292. case 21:
  14293. _context37.next = 23;
  14294. return t.decryptResult(i.result);
  14295. case 23:
  14296. i.result = _context37.sent;
  14297. return _context37.abrupt("return", i);
  14298. case 25:
  14299. case "end":
  14300. return _context37.stop();
  14301. }
  14302. }
  14303. }, _callee37);
  14304. }));
  14305. }
  14306. }]);
  14307. return Lt;
  14308. }();
  14309. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  14310. function Nt(e) {
  14311. return parseInt(e) === e;
  14312. }
  14313. function Dt(e) {
  14314. if (!Nt(e.length)) return !1;
  14315. for (var t = 0; t < e.length; t++) {
  14316. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  14317. }
  14318. return !0;
  14319. }
  14320. function Ft(e, t) {
  14321. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  14322. if (Array.isArray(e)) {
  14323. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  14324. return new Uint8Array(e);
  14325. }
  14326. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  14327. throw new Error("unsupported array-like object");
  14328. }
  14329. function qt(e) {
  14330. return new Uint8Array(e);
  14331. }
  14332. function Mt(e, t, n, s, r) {
  14333. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  14334. }
  14335. var Kt,
  14336. jt = {
  14337. toBytes: function toBytes(e) {
  14338. var t = [],
  14339. n = 0;
  14340. for (e = encodeURI(e); n < e.length;) {
  14341. var s = e.charCodeAt(n++);
  14342. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  14343. }
  14344. return Ft(t);
  14345. },
  14346. fromBytes: function fromBytes(e) {
  14347. for (var t = [], n = 0; n < e.length;) {
  14348. var s = e[n];
  14349. 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);
  14350. }
  14351. return t.join("");
  14352. }
  14353. },
  14354. Bt = (Kt = "0123456789abcdef", {
  14355. toBytes: function toBytes(e) {
  14356. for (var t = [], n = 0; n < e.length; n += 2) {
  14357. t.push(parseInt(e.substr(n, 2), 16));
  14358. }
  14359. return t;
  14360. },
  14361. fromBytes: function fromBytes(e) {
  14362. for (var t = [], n = 0; n < e.length; n++) {
  14363. var s = e[n];
  14364. t.push(Kt[(240 & s) >> 4] + Kt[15 & s]);
  14365. }
  14366. return t.join("");
  14367. }
  14368. }),
  14369. $t = {
  14370. 16: 10,
  14371. 24: 12,
  14372. 32: 14
  14373. },
  14374. Wt = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  14375. zt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  14376. Jt = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  14377. Ht = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  14378. Gt = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  14379. Vt = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  14380. Yt = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  14381. Qt = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  14382. Xt = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  14383. Zt = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  14384. en = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  14385. tn = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  14386. nn = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  14387. sn = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  14388. rn = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  14389. function on(e) {
  14390. for (var t = [], n = 0; n < e.length; n += 4) {
  14391. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  14392. }
  14393. return t;
  14394. }
  14395. var an = /*#__PURE__*/function () {
  14396. function an(e) {
  14397. (0, _classCallCheck2.default)(this, an);
  14398. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  14399. Object.defineProperty(this, "key", {
  14400. value: Ft(e, !0)
  14401. }), this._prepare();
  14402. }
  14403. (0, _createClass2.default)(an, [{
  14404. key: "_prepare",
  14405. value: function _prepare() {
  14406. var e = $t[this.key.length];
  14407. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  14408. this._Ke = [], this._Kd = [];
  14409. for (var t = 0; t <= e; t++) {
  14410. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  14411. }
  14412. var n,
  14413. s = 4 * (e + 1),
  14414. r = this.key.length / 4,
  14415. i = on(this.key);
  14416. for (t = 0; t < r; t++) {
  14417. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  14418. }
  14419. for (var o, a = 0, c = r; c < s;) {
  14420. if (o = i[r - 1], i[0] ^= zt[o >> 16 & 255] << 24 ^ zt[o >> 8 & 255] << 16 ^ zt[255 & o] << 8 ^ zt[o >> 24 & 255] ^ Wt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  14421. i[t] ^= i[t - 1];
  14422. } else {
  14423. for (t = 1; t < r / 2; t++) {
  14424. i[t] ^= i[t - 1];
  14425. }
  14426. o = i[r / 2 - 1], i[r / 2] ^= zt[255 & o] ^ zt[o >> 8 & 255] << 8 ^ zt[o >> 16 & 255] << 16 ^ zt[o >> 24 & 255] << 24;
  14427. for (t = r / 2 + 1; t < r; t++) {
  14428. i[t] ^= i[t - 1];
  14429. }
  14430. }
  14431. for (t = 0; t < r && c < s;) {
  14432. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  14433. }
  14434. }
  14435. for (var u = 1; u < e; u++) {
  14436. for (var h = 0; h < 4; h++) {
  14437. o = this._Kd[u][h], this._Kd[u][h] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  14438. }
  14439. }
  14440. }
  14441. }, {
  14442. key: "encrypt",
  14443. value: function encrypt(e) {
  14444. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  14445. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14446. s[r] ^= this._Ke[0][r];
  14447. }
  14448. for (var i = 1; i < t; i++) {
  14449. for (r = 0; r < 4; r++) {
  14450. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 1) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  14451. }
  14452. s = n.slice();
  14453. }
  14454. var o,
  14455. a = qt(16);
  14456. for (r = 0; r < 4; r++) {
  14457. o = this._Ke[t][r], a[4 * r] = 255 & (zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (zt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (zt[255 & s[(r + 3) % 4]] ^ o);
  14458. }
  14459. return a;
  14460. }
  14461. }, {
  14462. key: "decrypt",
  14463. value: function decrypt(e) {
  14464. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  14465. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14466. s[r] ^= this._Kd[0][r];
  14467. }
  14468. for (var i = 1; i < t; i++) {
  14469. for (r = 0; r < 4; r++) {
  14470. n[r] = Qt[s[r] >> 24 & 255] ^ Xt[s[(r + 3) % 4] >> 16 & 255] ^ Zt[s[(r + 2) % 4] >> 8 & 255] ^ en[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  14471. }
  14472. s = n.slice();
  14473. }
  14474. var o,
  14475. a = qt(16);
  14476. for (r = 0; r < 4; r++) {
  14477. o = this._Kd[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 1) % 4]] ^ o);
  14478. }
  14479. return a;
  14480. }
  14481. }]);
  14482. return an;
  14483. }();
  14484. var cn = /*#__PURE__*/function () {
  14485. function cn(e) {
  14486. (0, _classCallCheck2.default)(this, cn);
  14487. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  14488. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  14489. }
  14490. (0, _createClass2.default)(cn, [{
  14491. key: "encrypt",
  14492. value: function encrypt(e) {
  14493. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14494. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14495. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.encrypt(n), t, s);
  14496. }
  14497. return t;
  14498. }
  14499. }, {
  14500. key: "decrypt",
  14501. value: function decrypt(e) {
  14502. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14503. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14504. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.decrypt(n), t, s);
  14505. }
  14506. return t;
  14507. }
  14508. }]);
  14509. return cn;
  14510. }();
  14511. var un = /*#__PURE__*/function () {
  14512. function un(e, t) {
  14513. (0, _classCallCheck2.default)(this, un);
  14514. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  14515. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  14516. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14517. } else t = qt(16);
  14518. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  14519. }
  14520. (0, _createClass2.default)(un, [{
  14521. key: "encrypt",
  14522. value: function encrypt(e) {
  14523. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14524. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14525. Mt(e, n, 0, s, s + 16);
  14526. for (var r = 0; r < 16; r++) {
  14527. n[r] ^= this._lastCipherblock[r];
  14528. }
  14529. this._lastCipherblock = this._aes.encrypt(n), Mt(this._lastCipherblock, t, s);
  14530. }
  14531. return t;
  14532. }
  14533. }, {
  14534. key: "decrypt",
  14535. value: function decrypt(e) {
  14536. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14537. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14538. Mt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  14539. for (var r = 0; r < 16; r++) {
  14540. t[s + r] = n[r] ^ this._lastCipherblock[r];
  14541. }
  14542. Mt(e, this._lastCipherblock, 0, s, s + 16);
  14543. }
  14544. return t;
  14545. }
  14546. }]);
  14547. return un;
  14548. }();
  14549. var hn = /*#__PURE__*/function () {
  14550. function hn(e, t, n) {
  14551. (0, _classCallCheck2.default)(this, hn);
  14552. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  14553. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  14554. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  14555. } else t = qt(16);
  14556. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  14557. }
  14558. (0, _createClass2.default)(hn, [{
  14559. key: "encrypt",
  14560. value: function encrypt(e) {
  14561. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  14562. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14563. t = this._aes.encrypt(this._shiftRegister);
  14564. for (var r = 0; r < this.segmentSize; r++) {
  14565. n[s + r] ^= t[r];
  14566. }
  14567. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14568. }
  14569. return n;
  14570. }
  14571. }, {
  14572. key: "decrypt",
  14573. value: function decrypt(e) {
  14574. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  14575. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14576. t = this._aes.encrypt(this._shiftRegister);
  14577. for (var r = 0; r < this.segmentSize; r++) {
  14578. n[s + r] ^= t[r];
  14579. }
  14580. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14581. }
  14582. return n;
  14583. }
  14584. }]);
  14585. return hn;
  14586. }();
  14587. var ln = /*#__PURE__*/function () {
  14588. function ln(e, t) {
  14589. (0, _classCallCheck2.default)(this, ln);
  14590. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  14591. if (this.description = "Output Feedback", this.name = "ofb", t) {
  14592. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14593. } else t = qt(16);
  14594. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  14595. }
  14596. (0, _createClass2.default)(ln, [{
  14597. key: "encrypt",
  14598. value: function encrypt(e) {
  14599. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14600. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  14601. }
  14602. return t;
  14603. }
  14604. }, {
  14605. key: "decrypt",
  14606. value: function decrypt(e) {
  14607. return this.encrypt(e);
  14608. }
  14609. }]);
  14610. return ln;
  14611. }();
  14612. var dn = /*#__PURE__*/function () {
  14613. function dn(e) {
  14614. (0, _classCallCheck2.default)(this, dn);
  14615. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  14616. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  14617. }
  14618. (0, _createClass2.default)(dn, [{
  14619. key: "setValue",
  14620. value: function setValue(e) {
  14621. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  14622. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  14623. for (var t = 15; t >= 0; --t) {
  14624. this._counter[t] = e % 256, e = parseInt(e / 256);
  14625. }
  14626. }
  14627. }, {
  14628. key: "setBytes",
  14629. value: function setBytes(e) {
  14630. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  14631. this._counter = e;
  14632. }
  14633. }, {
  14634. key: "increment",
  14635. value: function increment() {
  14636. for (var e = 15; e >= 0; e--) {
  14637. if (255 !== this._counter[e]) {
  14638. this._counter[e]++;
  14639. break;
  14640. }
  14641. this._counter[e] = 0;
  14642. }
  14643. }
  14644. }]);
  14645. return dn;
  14646. }();
  14647. var pn = /*#__PURE__*/function () {
  14648. function pn(e, t) {
  14649. (0, _classCallCheck2.default)(this, pn);
  14650. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  14651. this.description = "Counter", this.name = "ctr", t instanceof dn || (t = new dn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new an(e);
  14652. }
  14653. (0, _createClass2.default)(pn, [{
  14654. key: "encrypt",
  14655. value: function encrypt(e) {
  14656. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14657. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  14658. }
  14659. return t;
  14660. }
  14661. }, {
  14662. key: "decrypt",
  14663. value: function decrypt(e) {
  14664. return this.encrypt(e);
  14665. }
  14666. }]);
  14667. return pn;
  14668. }();
  14669. var fn = {
  14670. AES: an,
  14671. Counter: dn,
  14672. ModeOfOperation: {
  14673. ecb: cn,
  14674. cbc: un,
  14675. cfb: hn,
  14676. ofb: ln,
  14677. ctr: pn
  14678. },
  14679. utils: {
  14680. hex: Bt,
  14681. utf8: jt
  14682. },
  14683. padding: {
  14684. pkcs7: {
  14685. pad: function pad(e) {
  14686. var t = 16 - (e = Ft(e, !0)).length % 16,
  14687. n = qt(e.length + t);
  14688. Mt(e, n);
  14689. for (var s = e.length; s < n.length; s++) {
  14690. n[s] = t;
  14691. }
  14692. return n;
  14693. },
  14694. strip: function strip(e) {
  14695. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  14696. var t = e[e.length - 1];
  14697. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  14698. for (var n = e.length - t, s = 0; s < t; s++) {
  14699. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  14700. }
  14701. var r = qt(n);
  14702. return Mt(e, r, 0, 0, n), r;
  14703. }
  14704. }
  14705. },
  14706. _arrayTest: {
  14707. coerceArray: Ft,
  14708. createArray: qt,
  14709. copyArray: Mt
  14710. }
  14711. };
  14712. function gn(e, t, n) {
  14713. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14714. r = fn.utils.utf8.toBytes(n),
  14715. i = fn.utils.utf8.toBytes(e),
  14716. o = new fn.ModeOfOperation.cbc(s, r),
  14717. a = fn.padding.pkcs7.pad(i),
  14718. c = o.encrypt(a);
  14719. return uni.arrayBufferToBase64(c);
  14720. }
  14721. var mn = {
  14722. code: 2e4,
  14723. message: "System error"
  14724. },
  14725. yn = {
  14726. code: 20101,
  14727. message: "Invalid client"
  14728. },
  14729. _n = {
  14730. code: 20102,
  14731. message: "Get encrypt key failed"
  14732. },
  14733. wn = {
  14734. 10001: "Secure network is not supported on current playground or unimpsdk",
  14735. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  14736. 10009: "Encrypt payload failed",
  14737. 10010: "Decrypt response failed"
  14738. };
  14739. function vn(e) {
  14740. var _ref25 = e || {},
  14741. t = _ref25.errSubject,
  14742. n = _ref25.subject,
  14743. s = _ref25.errCode,
  14744. r = _ref25.errMsg,
  14745. i = _ref25.code,
  14746. o = _ref25.message,
  14747. a = _ref25.cause;
  14748. return new ne({
  14749. subject: t || n || "uni-secure-network",
  14750. code: s || i || mn.code,
  14751. message: r || o,
  14752. cause: a
  14753. });
  14754. }
  14755. var In,
  14756. Sn,
  14757. bn = null;
  14758. var kn = /*#__PURE__*/function (_Lt) {
  14759. (0, _inherits2.default)(kn, _Lt);
  14760. var _super9 = _createSuper(kn);
  14761. function kn(e) {
  14762. var _this14;
  14763. (0, _classCallCheck2.default)(this, kn);
  14764. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  14765. return _this14;
  14766. }
  14767. (0, _createClass2.default)(kn, [{
  14768. key: "isLogin",
  14769. value: function isLogin() {
  14770. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  14771. }
  14772. }, {
  14773. key: "prepare",
  14774. value: function () {
  14775. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  14776. return _regenerator.default.wrap(function _callee38$(_context38) {
  14777. while (1) {
  14778. switch (_context38.prev = _context38.next) {
  14779. case 0:
  14780. if (this.isLogin()) {
  14781. _context38.next = 7;
  14782. break;
  14783. }
  14784. if (this.scopedGlobalCache.initPromise) {
  14785. _context38.next = 3;
  14786. break;
  14787. }
  14788. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  14789. case 3:
  14790. _context38.next = 5;
  14791. return this.scopedGlobalCache.initPromise;
  14792. case 5:
  14793. if (this.isLogin()) {
  14794. _context38.next = 7;
  14795. break;
  14796. }
  14797. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  14798. case 7:
  14799. case "end":
  14800. return _context38.stop();
  14801. }
  14802. }
  14803. }, _callee38, this);
  14804. }));
  14805. function prepare() {
  14806. return _prepare2.apply(this, arguments);
  14807. }
  14808. return prepare;
  14809. }()
  14810. }, {
  14811. key: "getUserEncryptKey",
  14812. value: function () {
  14813. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  14814. var _this15 = this;
  14815. var e;
  14816. return _regenerator.default.wrap(function _callee39$(_context39) {
  14817. while (1) {
  14818. switch (_context39.prev = _context39.next) {
  14819. case 0:
  14820. if (!this.userEncryptKey) {
  14821. _context39.next = 2;
  14822. break;
  14823. }
  14824. return _context39.abrupt("return", this.userEncryptKey);
  14825. case 2:
  14826. if (!(bn && bn.expireTime)) {
  14827. _context39.next = 6;
  14828. break;
  14829. }
  14830. e = Date.now();
  14831. if (!(bn.expireTime - e > 0)) {
  14832. _context39.next = 6;
  14833. break;
  14834. }
  14835. return _context39.abrupt("return", (this.userEncryptKey = bn, this.userEncryptKey));
  14836. case 6:
  14837. return _context39.abrupt("return", new Promise(function (e, t) {
  14838. uni.getUserCryptoManager().getLatestUserKey({
  14839. success: function success(t) {
  14840. bn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  14841. },
  14842. fail: function fail(e) {
  14843. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  14844. cause: e
  14845. })));
  14846. }
  14847. });
  14848. }));
  14849. case 7:
  14850. case "end":
  14851. return _context39.stop();
  14852. }
  14853. }
  14854. }, _callee39, this);
  14855. }));
  14856. function getUserEncryptKey() {
  14857. return _getUserEncryptKey.apply(this, arguments);
  14858. }
  14859. return getUserEncryptKey;
  14860. }()
  14861. }, {
  14862. key: "getWxAppId",
  14863. value: function getWxAppId() {
  14864. return wx.getAccountInfoSync().miniProgram.appId;
  14865. }
  14866. }, {
  14867. key: "platformGetSignOption",
  14868. value: function () {
  14869. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  14870. var _yield$this$getUserEn, e, t, n;
  14871. return _regenerator.default.wrap(function _callee40$(_context40) {
  14872. while (1) {
  14873. switch (_context40.prev = _context40.next) {
  14874. case 0:
  14875. _context40.next = 2;
  14876. return this.getUserEncryptKey();
  14877. case 2:
  14878. _yield$this$getUserEn = _context40.sent;
  14879. e = _yield$this$getUserEn.encryptKey;
  14880. t = _yield$this$getUserEn.iv;
  14881. n = _yield$this$getUserEn.version;
  14882. return _context40.abrupt("return", {
  14883. verifyClientSign: gn(JSON.stringify({
  14884. data: JSON.stringify({}),
  14885. appId: this.appId,
  14886. deviceId: this.deviceId,
  14887. wxAppId: this.getWxAppId(),
  14888. simulator: "devtools" === ce().platform,
  14889. timestamp: Date.now()
  14890. }), e, t),
  14891. encryptKeyId: n,
  14892. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14893. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14894. });
  14895. case 7:
  14896. case "end":
  14897. return _context40.stop();
  14898. }
  14899. }
  14900. }, _callee40, this);
  14901. }));
  14902. function platformGetSignOption() {
  14903. return _platformGetSignOption.apply(this, arguments);
  14904. }
  14905. return platformGetSignOption;
  14906. }()
  14907. }, {
  14908. key: "platformEncryptData",
  14909. value: function () {
  14910. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  14911. var _yield$this$getUserEn2, t, n, s, r;
  14912. return _regenerator.default.wrap(function _callee41$(_context41) {
  14913. while (1) {
  14914. switch (_context41.prev = _context41.next) {
  14915. case 0:
  14916. _context41.next = 2;
  14917. return this.getUserEncryptKey();
  14918. case 2:
  14919. _yield$this$getUserEn2 = _context41.sent;
  14920. t = _yield$this$getUserEn2.encryptKey;
  14921. n = _yield$this$getUserEn2.iv;
  14922. s = _yield$this$getUserEn2.version;
  14923. r = {
  14924. secretType: this.secretType,
  14925. encryptKeyId: s,
  14926. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14927. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14928. };
  14929. return _context41.abrupt("return", this.secretType === Rt ? {
  14930. content: e,
  14931. _uniCloudOptions: r
  14932. } : {
  14933. content: gn(JSON.stringify({
  14934. data: JSON.stringify(e),
  14935. appId: this.appId,
  14936. deviceId: this.deviceId,
  14937. wxAppId: this.getWxAppId(),
  14938. simulator: "devtools" === ce().platform,
  14939. timestamp: Date.now()
  14940. }), t, n),
  14941. _uniCloudOptions: r
  14942. });
  14943. case 8:
  14944. case "end":
  14945. return _context41.stop();
  14946. }
  14947. }
  14948. }, _callee41, this);
  14949. }));
  14950. function platformEncryptData(_x33) {
  14951. return _platformEncryptData.apply(this, arguments);
  14952. }
  14953. return platformEncryptData;
  14954. }()
  14955. }, {
  14956. key: "platformDecryptResult",
  14957. value: function () {
  14958. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  14959. var t, _yield$this$getUserEn3, n, s;
  14960. return _regenerator.default.wrap(function _callee42$(_context42) {
  14961. while (1) {
  14962. switch (_context42.prev = _context42.next) {
  14963. case 0:
  14964. t = e.content;
  14965. _context42.next = 3;
  14966. return this.getUserEncryptKey();
  14967. case 3:
  14968. _yield$this$getUserEn3 = _context42.sent;
  14969. n = _yield$this$getUserEn3.encryptKey;
  14970. s = _yield$this$getUserEn3.iv;
  14971. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  14972. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  14973. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14974. i = fn.utils.utf8.toBytes(n),
  14975. o = new fn.ModeOfOperation.cbc(r, i),
  14976. a = fn.padding.pkcs7.strip(o.decrypt(s));
  14977. return fn.utils.utf8.fromBytes(a);
  14978. }(t, n, s)));
  14979. case 7:
  14980. case "end":
  14981. return _context42.stop();
  14982. }
  14983. }
  14984. }, _callee42, this);
  14985. }));
  14986. function platformDecryptResult(_x34) {
  14987. return _platformDecryptResult.apply(this, arguments);
  14988. }
  14989. return platformDecryptResult;
  14990. }()
  14991. }, {
  14992. key: "isClientKeyNotFound",
  14993. value: function isClientKeyNotFound() {
  14994. return !1;
  14995. }
  14996. }]);
  14997. return kn;
  14998. }(Lt);
  14999. function Cn(e) {
  15000. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  15001. n = {};
  15002. var _loop = function _loop(_s10) {
  15003. var r = t[_s10];
  15004. n[r] = function () {
  15005. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  15006. t[_key] = arguments[_key];
  15007. }
  15008. return new Promise(function (n, s) {
  15009. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  15010. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15011. e = _ref26.type,
  15012. t = _ref26.data,
  15013. r = _ref26.errCode,
  15014. i = _ref26.errMsg,
  15015. o = _ref26.errSubject,
  15016. a = _ref26.message;
  15017. "success" === e ? n(t) : s(vn({
  15018. errCode: r,
  15019. errMsg: wn[r] || i || a,
  15020. errSubject: o
  15021. }));
  15022. }])) : s(vn({
  15023. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  15024. }));
  15025. });
  15026. };
  15027. };
  15028. for (var _s10 = 0; _s10 < t.length; _s10++) {
  15029. _loop(_s10);
  15030. }
  15031. return n;
  15032. }
  15033. var Tn = /*#__PURE__*/function (_Lt2) {
  15034. (0, _inherits2.default)(Tn, _Lt2);
  15035. var _super10 = _createSuper(Tn);
  15036. function Tn(e) {
  15037. var _this16;
  15038. (0, _classCallCheck2.default)(this, Tn);
  15039. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Cn(uni.requireNativePlugin("plus"))), _this16.systemInfo = In || (In = ce());
  15040. return _this16;
  15041. }
  15042. (0, _createClass2.default)(Tn, [{
  15043. key: "hasClientKey",
  15044. value: function () {
  15045. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  15046. return _regenerator.default.wrap(function _callee43$(_context43) {
  15047. while (1) {
  15048. switch (_context43.prev = _context43.next) {
  15049. case 0:
  15050. _context43.next = 2;
  15051. return this.appUtils.hasClientKey({
  15052. provider: this.provider,
  15053. spaceId: this.spaceId
  15054. });
  15055. case 2:
  15056. this._hasClientKey = _context43.sent;
  15057. return _context43.abrupt("return", this._hasClientKey);
  15058. case 4:
  15059. case "end":
  15060. return _context43.stop();
  15061. }
  15062. }
  15063. }, _callee43, this);
  15064. }));
  15065. function hasClientKey() {
  15066. return _hasClientKey.apply(this, arguments);
  15067. }
  15068. return hasClientKey;
  15069. }()
  15070. }, {
  15071. key: "getAppClientKey",
  15072. value: function () {
  15073. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  15074. var _yield$this$appUtils$, e, t, n, s, r;
  15075. return _regenerator.default.wrap(function _callee44$(_context44) {
  15076. while (1) {
  15077. switch (_context44.prev = _context44.next) {
  15078. case 0:
  15079. _context44.next = 2;
  15080. return this.appUtils.encryptGetClientKeyPayload({
  15081. data: JSON.stringify({})
  15082. });
  15083. case 2:
  15084. _yield$this$appUtils$ = _context44.sent;
  15085. e = _yield$this$appUtils$.data;
  15086. t = _yield$this$appUtils$.key;
  15087. _context44.next = 7;
  15088. return this.uniCloudIns.callFunction({
  15089. name: "DCloud-clientDB",
  15090. data: {
  15091. redirectTo: "encryption",
  15092. action: "getAppClientKey",
  15093. data: e,
  15094. key: t
  15095. }
  15096. });
  15097. case 7:
  15098. _context44.t0 = _context44.sent.result;
  15099. if (_context44.t0) {
  15100. _context44.next = 10;
  15101. break;
  15102. }
  15103. _context44.t0 = {};
  15104. case 10:
  15105. n = _context44.t0;
  15106. if (!(0 !== n.errCode)) {
  15107. _context44.next = 13;
  15108. break;
  15109. }
  15110. throw function (e) {
  15111. return new ne({
  15112. subject: e.errSubject || "uni-secure-network",
  15113. code: e.errCode || e.code || mn.code,
  15114. message: e.errMsg || e.message
  15115. });
  15116. }(n);
  15117. case 13:
  15118. s = n.clientKey, r = n.key;
  15119. _context44.next = 16;
  15120. return this.appUtils.setClientKey({
  15121. provider: this.provider,
  15122. spaceId: this.spaceId,
  15123. clientKey: s,
  15124. key: r
  15125. });
  15126. case 16:
  15127. case "end":
  15128. return _context44.stop();
  15129. }
  15130. }
  15131. }, _callee44, this);
  15132. }));
  15133. function getAppClientKey() {
  15134. return _getAppClientKey.apply(this, arguments);
  15135. }
  15136. return getAppClientKey;
  15137. }()
  15138. }, {
  15139. key: "ensureClientKey",
  15140. value: function () {
  15141. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  15142. var _this17 = this;
  15143. var _ref27,
  15144. _ref27$forceUpdate,
  15145. e,
  15146. _args45 = arguments;
  15147. return _regenerator.default.wrap(function _callee45$(_context45) {
  15148. while (1) {
  15149. switch (_context45.prev = _context45.next) {
  15150. case 0:
  15151. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  15152. _context45.t1 = !0;
  15153. _context45.next = 4;
  15154. return this.hasClientKey();
  15155. case 4:
  15156. _context45.t2 = _context45.sent;
  15157. _context45.t0 = _context45.t1 !== _context45.t2;
  15158. if (_context45.t0) {
  15159. _context45.next = 8;
  15160. break;
  15161. }
  15162. _context45.t0 = e;
  15163. case 8:
  15164. if (!_context45.t0) {
  15165. _context45.next = 10;
  15166. break;
  15167. }
  15168. return _context45.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === d || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== f || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  15169. _this17.scopedGlobalCache.initStatus = p;
  15170. }).catch(function (e) {
  15171. throw _this17.scopedGlobalCache.initStatus = f, e;
  15172. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  15173. case 10:
  15174. case "end":
  15175. return _context45.stop();
  15176. }
  15177. }
  15178. }, _callee45, this);
  15179. }));
  15180. function ensureClientKey() {
  15181. return _ensureClientKey.apply(this, arguments);
  15182. }
  15183. return ensureClientKey;
  15184. }()
  15185. }, {
  15186. key: "prepare",
  15187. value: function () {
  15188. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  15189. var _ref28,
  15190. _ref28$forceUpdate,
  15191. e,
  15192. _args46 = arguments;
  15193. return _regenerator.default.wrap(function _callee46$(_context46) {
  15194. while (1) {
  15195. switch (_context46.prev = _context46.next) {
  15196. case 0:
  15197. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  15198. _context46.next = 3;
  15199. return this.ensureClientKey({
  15200. forceUpdate: e
  15201. });
  15202. case 3:
  15203. case "end":
  15204. return _context46.stop();
  15205. }
  15206. }
  15207. }, _callee46, this);
  15208. }));
  15209. function prepare() {
  15210. return _prepare3.apply(this, arguments);
  15211. }
  15212. return prepare;
  15213. }()
  15214. }, {
  15215. key: "platformGetSignOption",
  15216. value: function () {
  15217. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  15218. var _yield$this$appUtils$2, e, t;
  15219. return _regenerator.default.wrap(function _callee47$(_context47) {
  15220. while (1) {
  15221. switch (_context47.prev = _context47.next) {
  15222. case 0:
  15223. _context47.next = 2;
  15224. return this.appUtils.encrypt({
  15225. provider: this.provider,
  15226. spaceId: this.spaceId,
  15227. data: JSON.stringify({})
  15228. });
  15229. case 2:
  15230. _yield$this$appUtils$2 = _context47.sent;
  15231. e = _yield$this$appUtils$2.data;
  15232. t = _yield$this$appUtils$2.key;
  15233. return _context47.abrupt("return", {
  15234. verifyClientSign: e,
  15235. encryptKeyId: t
  15236. });
  15237. case 6:
  15238. case "end":
  15239. return _context47.stop();
  15240. }
  15241. }
  15242. }, _callee47, this);
  15243. }));
  15244. function platformGetSignOption() {
  15245. return _platformGetSignOption2.apply(this, arguments);
  15246. }
  15247. return platformGetSignOption;
  15248. }()
  15249. }, {
  15250. key: "platformEncryptData",
  15251. value: function () {
  15252. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  15253. var _yield$this$appUtils$3, t, n, s;
  15254. return _regenerator.default.wrap(function _callee48$(_context48) {
  15255. while (1) {
  15256. switch (_context48.prev = _context48.next) {
  15257. case 0:
  15258. _context48.next = 2;
  15259. return this.appUtils.encrypt({
  15260. provider: this.provider,
  15261. spaceId: this.spaceId,
  15262. data: JSON.stringify(e)
  15263. });
  15264. case 2:
  15265. _yield$this$appUtils$3 = _context48.sent;
  15266. t = _yield$this$appUtils$3.data;
  15267. n = _yield$this$appUtils$3.key;
  15268. s = {
  15269. secretType: this.secretType,
  15270. encryptKeyId: n
  15271. };
  15272. return _context48.abrupt("return", this.secretType === Rt ? {
  15273. content: e,
  15274. _uniCloudOptions: s
  15275. } : {
  15276. content: t,
  15277. _uniCloudOptions: s
  15278. });
  15279. case 7:
  15280. case "end":
  15281. return _context48.stop();
  15282. }
  15283. }
  15284. }, _callee48, this);
  15285. }));
  15286. function platformEncryptData(_x35) {
  15287. return _platformEncryptData2.apply(this, arguments);
  15288. }
  15289. return platformEncryptData;
  15290. }()
  15291. }, {
  15292. key: "platformDecryptResult",
  15293. value: function () {
  15294. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  15295. var t, _e$_uniCloudOptions, n, s, r;
  15296. return _regenerator.default.wrap(function _callee49$(_context49) {
  15297. while (1) {
  15298. switch (_context49.prev = _context49.next) {
  15299. case 0:
  15300. t = e.content;
  15301. _e$_uniCloudOptions = e._uniCloudOptions;
  15302. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  15303. s = n.encryptKeyId;
  15304. _context49.next = 6;
  15305. return this.appUtils.decrypt({
  15306. provider: this.provider,
  15307. spaceId: this.spaceId,
  15308. data: t,
  15309. key: s
  15310. });
  15311. case 6:
  15312. r = _context49.sent;
  15313. return _context49.abrupt("return", JSON.parse(r.data));
  15314. case 8:
  15315. case "end":
  15316. return _context49.stop();
  15317. }
  15318. }
  15319. }, _callee49, this);
  15320. }));
  15321. function platformDecryptResult(_x36) {
  15322. return _platformDecryptResult2.apply(this, arguments);
  15323. }
  15324. return platformDecryptResult;
  15325. }()
  15326. }, {
  15327. key: "isClientKeyNotFound",
  15328. value: function isClientKeyNotFound() {
  15329. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15330. var t = e.result || {};
  15331. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  15332. }
  15333. }]);
  15334. return Tn;
  15335. }(Lt);
  15336. function Pn() {
  15337. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15338. e = _ref29.secretType;
  15339. return e === xt || e === Rt || e === Ut;
  15340. }
  15341. function An() {
  15342. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15343. e = _ref30.name,
  15344. _ref30$data = _ref30.data,
  15345. t = _ref30$data === void 0 ? {} : _ref30$data;
  15346. return "app" === P && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  15347. }
  15348. function En() {
  15349. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15350. e = _ref31.provider,
  15351. t = _ref31.spaceId,
  15352. n = _ref31.functionName;
  15353. var _ce = ce(),
  15354. s = _ce.appId,
  15355. r = _ce.uniPlatform,
  15356. i = _ce.osName;
  15357. var o = r;
  15358. "app" === r && (o = i);
  15359. var a = function () {
  15360. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15361. e = _ref32.provider,
  15362. t = _ref32.spaceId;
  15363. var n = T;
  15364. if (!n) return {};
  15365. e = function (e) {
  15366. return "tencent" === e ? "tcb" : e;
  15367. }(e);
  15368. var s = n.find(function (n) {
  15369. return n.provider === e && n.spaceId === t;
  15370. });
  15371. return s && s.config;
  15372. }({
  15373. provider: e,
  15374. spaceId: t
  15375. });
  15376. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  15377. var c = a.accessControl.function || {},
  15378. u = Object.keys(c);
  15379. if (0 === u.length) return !0;
  15380. var h = function (e, t) {
  15381. var n, s, r;
  15382. for (var _i2 = 0; _i2 < e.length; _i2++) {
  15383. var _o2 = e[_i2];
  15384. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  15385. return e.trim();
  15386. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  15387. }
  15388. return n || s || r;
  15389. }(u, n);
  15390. if (!h) return !1;
  15391. if ((c[h] || []).find(function () {
  15392. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15393. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  15394. })) return !0;
  15395. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), vn(yn);
  15396. }
  15397. function On(_ref33) {
  15398. var e = _ref33.functionName,
  15399. t = _ref33.result,
  15400. n = _ref33.logPvd;
  15401. if (b && this.__dev__.debugLog && t && t.requestId) {
  15402. var _s11 = JSON.stringify({
  15403. spaceId: this.config.spaceId,
  15404. functionName: e,
  15405. requestId: t.requestId
  15406. });
  15407. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  15408. }
  15409. }
  15410. function xn(e) {
  15411. var t = e.callFunction,
  15412. n = function n(_n7) {
  15413. var _this18 = this;
  15414. var s = _n7.name;
  15415. _n7.data = kt.call(e, {
  15416. data: _n7.data
  15417. });
  15418. var r = {
  15419. aliyun: "aliyun",
  15420. tencent: "tcb",
  15421. tcb: "tcb"
  15422. }[this.config.provider],
  15423. i = Pn(_n7),
  15424. o = An(_n7),
  15425. a = i || o;
  15426. return t.call(this, _n7).then(function (e) {
  15427. return e.errCode = 0, !a && On.call(_this18, {
  15428. functionName: s,
  15429. result: e,
  15430. logPvd: r
  15431. }), Promise.resolve(e);
  15432. }, function (e) {
  15433. return !a && On.call(_this18, {
  15434. functionName: s,
  15435. result: e,
  15436. logPvd: r
  15437. }), e && e.message && (e.message = function () {
  15438. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15439. _ref34$message = _ref34.message,
  15440. e = _ref34$message === void 0 ? "" : _ref34$message,
  15441. _ref34$extraInfo = _ref34.extraInfo,
  15442. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  15443. _ref34$formatter = _ref34.formatter,
  15444. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  15445. for (var _s12 = 0; _s12 < n.length; _s12++) {
  15446. var _n$_s = n[_s12],
  15447. _r4 = _n$_s.rule,
  15448. _i3 = _n$_s.content,
  15449. _o3 = _n$_s.mode,
  15450. _a = e.match(_r4);
  15451. if (!_a) continue;
  15452. var _c = _i3;
  15453. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  15454. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  15455. }
  15456. for (var _e21 in t) {
  15457. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  15458. }
  15459. return "replace" === _o3 ? _c : e + _c;
  15460. }
  15461. return e;
  15462. }({
  15463. message: "[".concat(_n7.name, "]: ").concat(e.message),
  15464. formatter: Tt,
  15465. extraInfo: {
  15466. functionName: s
  15467. }
  15468. })), Promise.reject(e);
  15469. });
  15470. };
  15471. e.callFunction = function (t) {
  15472. var _e$config = e.config,
  15473. s = _e$config.provider,
  15474. r = _e$config.spaceId,
  15475. i = t.name;
  15476. var o, a;
  15477. if (t.data = t.data || {}, b && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && E ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ct), o = Ct) : o = n, o = o.bind(e), An(t)) a = n.call(e, t);else if (function (_ref35) {
  15478. var e = _ref35.name,
  15479. _ref35$data = _ref35.data,
  15480. t = _ref35$data === void 0 ? {} : _ref35$data;
  15481. return "mp-weixin" === P && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  15482. }(t)) a = o.call(e, t);else if (Pn(t)) {
  15483. a = new Sn({
  15484. secretType: t.secretType,
  15485. uniCloudIns: e
  15486. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  15487. } else if (En({
  15488. provider: s,
  15489. spaceId: r,
  15490. functionName: i
  15491. })) {
  15492. a = new Sn({
  15493. secretType: t.secretType,
  15494. uniCloudIns: e
  15495. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  15496. } else a = o(t);
  15497. return Object.defineProperty(a, "result", {
  15498. get: function get() {
  15499. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  15500. }
  15501. }), a;
  15502. };
  15503. }
  15504. Sn = "mp-weixin" !== P && "app" !== P ? /*#__PURE__*/function () {
  15505. function _class2() {
  15506. (0, _classCallCheck2.default)(this, _class2);
  15507. throw vn({
  15508. message: "Platform ".concat(P, " is not supported by secure network")
  15509. });
  15510. }
  15511. return (0, _createClass2.default)(_class2);
  15512. }() : C ? "mp-weixin" === P ? kn : Tn : /*#__PURE__*/function () {
  15513. function _class3() {
  15514. (0, _classCallCheck2.default)(this, _class3);
  15515. throw vn({
  15516. message: "Platform ".concat(P, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  15517. });
  15518. }
  15519. return (0, _createClass2.default)(_class3);
  15520. }();
  15521. var Rn = Symbol("CLIENT_DB_INTERNAL");
  15522. function Un(e, t) {
  15523. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  15524. get: function get(e, n, s) {
  15525. if ("_uniClient" === n) return null;
  15526. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  15527. if (n in e || "string" != typeof n) {
  15528. var _t10 = e[n];
  15529. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  15530. }
  15531. return t.get(e, n, s);
  15532. }
  15533. });
  15534. }
  15535. function Ln(e) {
  15536. return {
  15537. on: function on(t, n) {
  15538. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  15539. },
  15540. off: function off(t, n) {
  15541. e[t] = e[t] || [];
  15542. var s = e[t].indexOf(n);
  15543. -1 !== s && e[t].splice(s, 1);
  15544. }
  15545. };
  15546. }
  15547. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  15548. function Dn(e, t) {
  15549. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  15550. }
  15551. function Fn(e) {
  15552. switch (g(e)) {
  15553. case "array":
  15554. return e.map(function (e) {
  15555. return Fn(e);
  15556. });
  15557. case "object":
  15558. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  15559. e[t] = Fn(e[t]);
  15560. }), e;
  15561. case "regexp":
  15562. return {
  15563. $regexp: {
  15564. source: e.source,
  15565. flags: e.flags
  15566. }
  15567. };
  15568. case "date":
  15569. return {
  15570. $date: e.toISOString()
  15571. };
  15572. default:
  15573. return e;
  15574. }
  15575. }
  15576. function qn(e) {
  15577. return e && e.content && e.content.$method;
  15578. }
  15579. var Mn = /*#__PURE__*/function () {
  15580. function Mn(e, t, n) {
  15581. (0, _classCallCheck2.default)(this, Mn);
  15582. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  15583. }
  15584. (0, _createClass2.default)(Mn, [{
  15585. key: "toJSON",
  15586. value: function toJSON() {
  15587. var e = this;
  15588. var t = [e.content];
  15589. for (; e.prevStage;) {
  15590. e = e.prevStage, t.push(e.content);
  15591. }
  15592. return {
  15593. $db: t.reverse().map(function (e) {
  15594. return {
  15595. $method: e.$method,
  15596. $param: Fn(e.$param)
  15597. };
  15598. })
  15599. };
  15600. }
  15601. }, {
  15602. key: "toString",
  15603. value: function toString() {
  15604. return JSON.stringify(this.toJSON());
  15605. }
  15606. }, {
  15607. key: "getAction",
  15608. value: function getAction() {
  15609. var e = this.toJSON().$db.find(function (e) {
  15610. return "action" === e.$method;
  15611. });
  15612. return e && e.$param && e.$param[0];
  15613. }
  15614. }, {
  15615. key: "getCommand",
  15616. value: function getCommand() {
  15617. return {
  15618. $db: this.toJSON().$db.filter(function (e) {
  15619. return "action" !== e.$method;
  15620. })
  15621. };
  15622. }
  15623. }, {
  15624. key: "isAggregate",
  15625. get: function get() {
  15626. var e = this;
  15627. for (; e;) {
  15628. var t = qn(e),
  15629. _n8 = qn(e.prevStage);
  15630. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  15631. e = e.prevStage;
  15632. }
  15633. return !1;
  15634. }
  15635. }, {
  15636. key: "isCommand",
  15637. get: function get() {
  15638. var e = this;
  15639. for (; e;) {
  15640. if ("command" === qn(e)) return !0;
  15641. e = e.prevStage;
  15642. }
  15643. return !1;
  15644. }
  15645. }, {
  15646. key: "isAggregateCommand",
  15647. get: function get() {
  15648. var e = this;
  15649. for (; e;) {
  15650. var t = qn(e),
  15651. _n9 = qn(e.prevStage);
  15652. if ("aggregate" === t && "command" === _n9) return !0;
  15653. e = e.prevStage;
  15654. }
  15655. return !1;
  15656. }
  15657. }, {
  15658. key: "getNextStageFn",
  15659. value: function getNextStageFn(e) {
  15660. var t = this;
  15661. return function () {
  15662. return Kn({
  15663. $method: e,
  15664. $param: Fn(Array.from(arguments))
  15665. }, t, t._database);
  15666. };
  15667. }
  15668. }, {
  15669. key: "count",
  15670. get: function get() {
  15671. return this.isAggregate ? this.getNextStageFn("count") : function () {
  15672. return this._send("count", Array.from(arguments));
  15673. };
  15674. }
  15675. }, {
  15676. key: "remove",
  15677. get: function get() {
  15678. return this.isCommand ? this.getNextStageFn("remove") : function () {
  15679. return this._send("remove", Array.from(arguments));
  15680. };
  15681. }
  15682. }, {
  15683. key: "get",
  15684. value: function get() {
  15685. return this._send("get", Array.from(arguments));
  15686. }
  15687. }, {
  15688. key: "add",
  15689. get: function get() {
  15690. return this.isCommand ? this.getNextStageFn("add") : function () {
  15691. return this._send("add", Array.from(arguments));
  15692. };
  15693. }
  15694. }, {
  15695. key: "update",
  15696. value: function update() {
  15697. return this._send("update", Array.from(arguments));
  15698. }
  15699. }, {
  15700. key: "end",
  15701. value: function end() {
  15702. return this._send("end", Array.from(arguments));
  15703. }
  15704. }, {
  15705. key: "set",
  15706. get: function get() {
  15707. return this.isCommand ? this.getNextStageFn("set") : function () {
  15708. throw new Error("JQL禁止使用set方法");
  15709. };
  15710. }
  15711. }, {
  15712. key: "_send",
  15713. value: function _send(e, t) {
  15714. var n = this.getAction(),
  15715. s = this.getCommand();
  15716. if (s.$db.push({
  15717. $method: e,
  15718. $param: Fn(t)
  15719. }), b) {
  15720. var _e22 = s.$db.find(function (e) {
  15721. return "collection" === e.$method;
  15722. }),
  15723. _t11 = _e22 && _e22.$param;
  15724. _t11 && 1 === _t11.length && "string" == typeof _e22.$param[0] && _e22.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  15725. }
  15726. return this._database._callCloudFunction({
  15727. action: n,
  15728. command: s
  15729. });
  15730. }
  15731. }]);
  15732. return Mn;
  15733. }();
  15734. function Kn(e, t, n) {
  15735. return Un(new Mn(e, t, n), {
  15736. get: function get(e, t) {
  15737. var s = "db";
  15738. return e && e.content && (s = e.content.$method), Dn(s, t) ? Kn({
  15739. $method: t
  15740. }, e, n) : function () {
  15741. return Kn({
  15742. $method: t,
  15743. $param: Fn(Array.from(arguments))
  15744. }, e, n);
  15745. };
  15746. }
  15747. });
  15748. }
  15749. function jn(_ref36) {
  15750. var e = _ref36.path,
  15751. t = _ref36.method;
  15752. return /*#__PURE__*/function () {
  15753. function _class4() {
  15754. (0, _classCallCheck2.default)(this, _class4);
  15755. this.param = Array.from(arguments);
  15756. }
  15757. (0, _createClass2.default)(_class4, [{
  15758. key: "toJSON",
  15759. value: function toJSON() {
  15760. return {
  15761. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  15762. return {
  15763. $method: e
  15764. };
  15765. })), [{
  15766. $method: t,
  15767. $param: this.param
  15768. }])
  15769. };
  15770. }
  15771. }, {
  15772. key: "toString",
  15773. value: function toString() {
  15774. return JSON.stringify(this.toJSON());
  15775. }
  15776. }]);
  15777. return _class4;
  15778. }();
  15779. }
  15780. function Bn(e) {
  15781. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15782. return Un(new e(t), {
  15783. get: function get(e, t) {
  15784. return Dn("db", t) ? Kn({
  15785. $method: t
  15786. }, null, e) : function () {
  15787. return Kn({
  15788. $method: t,
  15789. $param: Fn(Array.from(arguments))
  15790. }, null, e);
  15791. };
  15792. }
  15793. });
  15794. }
  15795. var $n = /*#__PURE__*/function (_ref37) {
  15796. (0, _inherits2.default)($n, _ref37);
  15797. var _super11 = _createSuper($n);
  15798. function $n() {
  15799. (0, _classCallCheck2.default)(this, $n);
  15800. return _super11.apply(this, arguments);
  15801. }
  15802. (0, _createClass2.default)($n, [{
  15803. key: "_parseResult",
  15804. value: function _parseResult(e) {
  15805. return this._isJQL ? e.result : e;
  15806. }
  15807. }, {
  15808. key: "_callCloudFunction",
  15809. value: function _callCloudFunction(_ref38) {
  15810. var _this19 = this;
  15811. var e = _ref38.action,
  15812. t = _ref38.command,
  15813. n = _ref38.multiCommand,
  15814. s = _ref38.queryList;
  15815. function r(e, t) {
  15816. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  15817. var _r5 = s[_n10];
  15818. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  15819. }
  15820. }
  15821. var i = this,
  15822. o = this._isJQL ? "databaseForJQL" : "database";
  15823. function a(e) {
  15824. return i._callback("error", [e]), q(M(o, "fail"), e).then(function () {
  15825. return q(M(o, "complete"), e);
  15826. }).then(function () {
  15827. return r(null, e), Q(B, {
  15828. type: z,
  15829. content: e
  15830. }), Promise.reject(e);
  15831. });
  15832. }
  15833. var c = q(M(o, "invoke")),
  15834. u = this._uniClient;
  15835. return c.then(function () {
  15836. return u.callFunction({
  15837. name: "DCloud-clientDB",
  15838. type: l,
  15839. data: {
  15840. action: e,
  15841. command: t,
  15842. multiCommand: n
  15843. }
  15844. });
  15845. }).then(function (e) {
  15846. var _e$result = e.result,
  15847. t = _e$result.code,
  15848. n = _e$result.message,
  15849. s = _e$result.token,
  15850. c = _e$result.tokenExpired,
  15851. _e$result$systemInfo = _e$result.systemInfo,
  15852. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  15853. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  15854. var _u$_e = u[_e23],
  15855. _t12 = _u$_e.level,
  15856. _n11 = _u$_e.message,
  15857. _s13 = _u$_e.detail,
  15858. _r6 = console["app" === P && "warn" === _t12 ? "error" : _t12] || console.log;
  15859. var _i4 = "[System Info]" + _n11;
  15860. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  15861. }
  15862. if (t) {
  15863. return a(new ne({
  15864. code: t,
  15865. message: n,
  15866. requestId: e.requestId
  15867. }));
  15868. }
  15869. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  15870. token: s,
  15871. tokenExpired: c
  15872. }), _this19._callbackAuth("refreshToken", [{
  15873. token: s,
  15874. tokenExpired: c
  15875. }]), _this19._callback("refreshToken", [{
  15876. token: s,
  15877. tokenExpired: c
  15878. }]), Q(W, {
  15879. token: s,
  15880. tokenExpired: c
  15881. }));
  15882. var h = [{
  15883. prop: "affectedDocs",
  15884. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  15885. }, {
  15886. prop: "code",
  15887. tips: "code不再推荐使用,请使用errCode替代"
  15888. }, {
  15889. prop: "message",
  15890. tips: "message不再推荐使用,请使用errMsg替代"
  15891. }];
  15892. var _loop2 = function _loop2(_t13) {
  15893. var _h$_t = h[_t13],
  15894. n = _h$_t.prop,
  15895. s = _h$_t.tips;
  15896. if (n in e.result) {
  15897. var _t14 = e.result[n];
  15898. Object.defineProperty(e.result, n, {
  15899. get: function get() {
  15900. return console.warn(s), _t14;
  15901. }
  15902. });
  15903. }
  15904. };
  15905. for (var _t13 = 0; _t13 < h.length; _t13++) {
  15906. _loop2(_t13);
  15907. }
  15908. return function (e) {
  15909. return q(M(o, "success"), e).then(function () {
  15910. return q(M(o, "complete"), e);
  15911. }).then(function () {
  15912. r(e, null);
  15913. var t = i._parseResult(e);
  15914. return Q(B, {
  15915. type: z,
  15916. content: t
  15917. }), Promise.resolve(t);
  15918. });
  15919. }(e);
  15920. }, function (e) {
  15921. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  15922. return a(new ne({
  15923. code: e.code || "SYSTEM_ERROR",
  15924. message: e.message,
  15925. requestId: e.requestId
  15926. }));
  15927. });
  15928. }
  15929. }]);
  15930. return $n;
  15931. }( /*#__PURE__*/function () {
  15932. function _class5() {
  15933. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15934. _ref39$uniClient = _ref39.uniClient,
  15935. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  15936. _ref39$isJQL = _ref39.isJQL,
  15937. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  15938. (0, _classCallCheck2.default)(this, _class5);
  15939. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t || (this.auth = Ln(this._authCallBacks)), this._isJQL = t, Object.assign(this, Ln(this._dbCallBacks)), this.env = Un({}, {
  15940. get: function get(e, t) {
  15941. return {
  15942. $env: t
  15943. };
  15944. }
  15945. }), this.Geo = Un({}, {
  15946. get: function get(e, t) {
  15947. return jn({
  15948. path: ["Geo"],
  15949. method: t
  15950. });
  15951. }
  15952. }), this.serverDate = jn({
  15953. path: [],
  15954. method: "serverDate"
  15955. }), this.RegExp = jn({
  15956. path: [],
  15957. method: "RegExp"
  15958. });
  15959. }
  15960. (0, _createClass2.default)(_class5, [{
  15961. key: "getCloudEnv",
  15962. value: function getCloudEnv(e) {
  15963. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  15964. return {
  15965. $env: e.replace("$cloudEnv_", "")
  15966. };
  15967. }
  15968. }, {
  15969. key: "_callback",
  15970. value: function _callback(e, t) {
  15971. var n = this._dbCallBacks;
  15972. n[e] && n[e].forEach(function (e) {
  15973. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15974. });
  15975. }
  15976. }, {
  15977. key: "_callbackAuth",
  15978. value: function _callbackAuth(e, t) {
  15979. var n = this._authCallBacks;
  15980. n[e] && n[e].forEach(function (e) {
  15981. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15982. });
  15983. }
  15984. }, {
  15985. key: "multiSend",
  15986. value: function multiSend() {
  15987. var e = Array.from(arguments),
  15988. t = e.map(function (e) {
  15989. var t = e.getAction(),
  15990. n = e.getCommand();
  15991. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  15992. return {
  15993. action: t,
  15994. command: n
  15995. };
  15996. });
  15997. return this._callCloudFunction({
  15998. multiCommand: t,
  15999. queryList: e
  16000. });
  16001. }
  16002. }]);
  16003. return _class5;
  16004. }());
  16005. var Wn = "token无效,跳转登录页面",
  16006. zn = "token过期,跳转登录页面",
  16007. Jn = {
  16008. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  16009. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  16010. TOKEN_INVALID: Wn,
  16011. TOKEN_INVALID_WRONG_TOKEN: Wn,
  16012. TOKEN_INVALID_ANONYMOUS_USER: Wn
  16013. },
  16014. Hn = {
  16015. "uni-id-token-expired": zn,
  16016. "uni-id-check-token-failed": Wn,
  16017. "uni-id-token-not-exist": Wn,
  16018. "uni-id-check-device-feature-failed": Wn
  16019. };
  16020. function Gn(e, t) {
  16021. var n = "";
  16022. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  16023. }
  16024. function Vn() {
  16025. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16026. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  16027. var n = [],
  16028. s = [];
  16029. return e.forEach(function (e) {
  16030. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  16031. }), {
  16032. needLoginPage: n,
  16033. notNeedLoginPage: s
  16034. };
  16035. }
  16036. function Yn(e) {
  16037. return e.split("?")[0].replace(/^\//, "");
  16038. }
  16039. function Qn() {
  16040. return function (e) {
  16041. var t = e && e.$page && e.$page.fullPath || "";
  16042. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  16043. }(function () {
  16044. var e = getCurrentPages();
  16045. return e[e.length - 1];
  16046. }());
  16047. }
  16048. function Xn() {
  16049. return Yn(Qn());
  16050. }
  16051. function Zn() {
  16052. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  16053. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16054. if (!e) return !1;
  16055. if (!(t && t.list && t.list.length)) return !1;
  16056. var n = t.list,
  16057. s = Yn(e);
  16058. return n.some(function (e) {
  16059. return e.pagePath === s;
  16060. });
  16061. }
  16062. var es = !!_pages.default.uniIdRouter;
  16063. var _ref40 = function () {
  16064. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  16065. _ref21$pages = _ref21.pages,
  16066. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  16067. _ref21$subPackages = _ref21.subPackages,
  16068. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  16069. _ref21$uniIdRouter = _ref21.uniIdRouter,
  16070. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  16071. _ref21$tabBar = _ref21.tabBar,
  16072. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  16073. var i = s.loginPage,
  16074. _s$needLogin = s.needLogin,
  16075. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  16076. _s$resToLogin = s.resToLogin,
  16077. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  16078. _Vn = Vn(e),
  16079. c = _Vn.needLoginPage,
  16080. u = _Vn.notNeedLoginPage,
  16081. _ref23 = function () {
  16082. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16083. var t = [],
  16084. n = [];
  16085. return e.forEach(function (e) {
  16086. var s = e.root,
  16087. _e$pages = e.pages,
  16088. r = _e$pages === void 0 ? [] : _e$pages,
  16089. _Vn2 = Vn(r, s),
  16090. i = _Vn2.needLoginPage,
  16091. o = _Vn2.notNeedLoginPage;
  16092. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  16093. }), {
  16094. needLoginPage: t,
  16095. notNeedLoginPage: n
  16096. };
  16097. }(n),
  16098. h = _ref23.needLoginPage,
  16099. l = _ref23.notNeedLoginPage;
  16100. return {
  16101. loginPage: i,
  16102. routerNeedLogin: o,
  16103. resToLogin: a,
  16104. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  16105. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  16106. loginPageInTabBar: Zn(i, r)
  16107. };
  16108. }(),
  16109. ts = _ref40.loginPage,
  16110. ns = _ref40.routerNeedLogin,
  16111. ss = _ref40.resToLogin,
  16112. rs = _ref40.needLoginPage,
  16113. is = _ref40.notNeedLoginPage,
  16114. os = _ref40.loginPageInTabBar;
  16115. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  16116. function as(e) {
  16117. var t = Xn();
  16118. if ("/" === e.charAt(0)) return e;
  16119. var _e$split = e.split("?"),
  16120. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  16121. n = _e$split2[0],
  16122. s = _e$split2[1],
  16123. r = n.replace(/^\//, "").split("/"),
  16124. i = t.split("/");
  16125. i.pop();
  16126. for (var _e24 = 0; _e24 < r.length; _e24++) {
  16127. var _t15 = r[_e24];
  16128. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  16129. }
  16130. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  16131. }
  16132. function cs(e) {
  16133. var t = Yn(as(e));
  16134. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  16135. return function (e, t) {
  16136. return new RegExp(t).test(e);
  16137. }(e, t);
  16138. }));
  16139. }
  16140. function us(_ref41) {
  16141. var e = _ref41.redirect;
  16142. var t = Yn(e),
  16143. n = Yn(ts);
  16144. return Xn() !== n && t !== n;
  16145. }
  16146. function hs() {
  16147. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16148. e = _ref42.api,
  16149. t = _ref42.redirect;
  16150. if (!t || !us({
  16151. redirect: t
  16152. })) return;
  16153. var n = function (e, t) {
  16154. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  16155. }(ts, t);
  16156. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  16157. var s = {
  16158. navigateTo: uni.navigateTo,
  16159. redirectTo: uni.redirectTo,
  16160. switchTab: uni.switchTab,
  16161. reLaunch: uni.reLaunch
  16162. };
  16163. setTimeout(function () {
  16164. s[e]({
  16165. url: n
  16166. });
  16167. });
  16168. }
  16169. function ls() {
  16170. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16171. e = _ref43.url;
  16172. var t = {
  16173. abortLoginPageJump: !1,
  16174. autoToLoginPage: !1
  16175. },
  16176. n = function () {
  16177. var _re3 = re(),
  16178. e = _re3.token,
  16179. t = _re3.tokenExpired;
  16180. var n;
  16181. if (e) {
  16182. if (t < Date.now()) {
  16183. var _e25 = "uni-id-token-expired";
  16184. n = {
  16185. errCode: _e25,
  16186. errMsg: Hn[_e25]
  16187. };
  16188. }
  16189. } else {
  16190. var _e26 = "uni-id-check-token-failed";
  16191. n = {
  16192. errCode: _e26,
  16193. errMsg: Hn[_e26]
  16194. };
  16195. }
  16196. return n;
  16197. }();
  16198. if (cs(e) && n) {
  16199. n.uniIdRedirectUrl = e;
  16200. if (G($).length > 0) return setTimeout(function () {
  16201. Q($, n);
  16202. }, 0), t.abortLoginPageJump = !0, t;
  16203. t.autoToLoginPage = !0;
  16204. }
  16205. return t;
  16206. }
  16207. function ds() {
  16208. !function () {
  16209. var e = Qn(),
  16210. _ls = ls({
  16211. url: e
  16212. }),
  16213. t = _ls.abortLoginPageJump,
  16214. n = _ls.autoToLoginPage;
  16215. t || n && hs({
  16216. api: "redirectTo",
  16217. redirect: e
  16218. });
  16219. }();
  16220. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  16221. var _loop3 = function _loop3(_t16) {
  16222. var n = e[_t16];
  16223. uni.addInterceptor(n, {
  16224. invoke: function invoke(e) {
  16225. var _ls2 = ls({
  16226. url: e.url
  16227. }),
  16228. t = _ls2.abortLoginPageJump,
  16229. s = _ls2.autoToLoginPage;
  16230. return t ? e : s ? (hs({
  16231. api: n,
  16232. redirect: as(e.url)
  16233. }), !1) : e;
  16234. }
  16235. });
  16236. };
  16237. for (var _t16 = 0; _t16 < e.length; _t16++) {
  16238. _loop3(_t16);
  16239. }
  16240. }
  16241. function ps() {
  16242. this.onResponse(function (e) {
  16243. var t = e.type,
  16244. n = e.content;
  16245. var s = !1;
  16246. switch (t) {
  16247. case "cloudobject":
  16248. s = function (e) {
  16249. if ("object" != (0, _typeof2.default)(e)) return !1;
  16250. var _ref44 = e || {},
  16251. t = _ref44.errCode;
  16252. return t in Hn;
  16253. }(n);
  16254. break;
  16255. case "clientdb":
  16256. s = function (e) {
  16257. if ("object" != (0, _typeof2.default)(e)) return !1;
  16258. var _ref45 = e || {},
  16259. t = _ref45.errCode;
  16260. return t in Jn;
  16261. }(n);
  16262. }
  16263. s && function () {
  16264. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16265. var t = G($);
  16266. ee().then(function () {
  16267. var n = Qn();
  16268. if (n && us({
  16269. redirect: n
  16270. })) return t.length > 0 ? Q($, Object.assign({
  16271. uniIdRedirectUrl: n
  16272. }, e)) : void (ts && hs({
  16273. api: "navigateTo",
  16274. redirect: n
  16275. }));
  16276. });
  16277. }(n);
  16278. });
  16279. }
  16280. function fs(e) {
  16281. !function (e) {
  16282. e.onResponse = function (e) {
  16283. V(B, e);
  16284. }, e.offResponse = function (e) {
  16285. Y(B, e);
  16286. };
  16287. }(e), function (e) {
  16288. e.onNeedLogin = function (e) {
  16289. V($, e);
  16290. }, e.offNeedLogin = function (e) {
  16291. Y($, e);
  16292. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  16293. ds.call(e);
  16294. }), ss && ps.call(e)));
  16295. }(e), function (e) {
  16296. e.onRefreshToken = function (e) {
  16297. V(W, e);
  16298. }, e.offRefreshToken = function (e) {
  16299. Y(W, e);
  16300. };
  16301. }(e);
  16302. }
  16303. var gs;
  16304. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  16305. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  16306. function _s() {
  16307. var e = re().token || "",
  16308. t = e.split(".");
  16309. if (!e || 3 !== t.length) return {
  16310. uid: null,
  16311. role: [],
  16312. permission: [],
  16313. tokenExpired: 0
  16314. };
  16315. var n;
  16316. try {
  16317. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  16318. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  16319. }).join(""))));
  16320. } catch (e) {
  16321. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  16322. }
  16323. var s;
  16324. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  16325. }
  16326. gs = "function" != typeof atob ? function (e) {
  16327. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !ys.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  16328. var t;
  16329. e += "==".slice(2 - (3 & e.length));
  16330. for (var n, s, r = "", i = 0; i < e.length;) {
  16331. t = ms.indexOf(e.charAt(i++)) << 18 | ms.indexOf(e.charAt(i++)) << 12 | (n = ms.indexOf(e.charAt(i++))) << 6 | (s = ms.indexOf(e.charAt(i++))), r += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);
  16332. }
  16333. return r;
  16334. } : atob;
  16335. var ws = s(function (e, t) {
  16336. Object.defineProperty(t, "__esModule", {
  16337. value: !0
  16338. });
  16339. var n = "chooseAndUploadFile:ok",
  16340. s = "chooseAndUploadFile:fail";
  16341. function r(e, t) {
  16342. return e.tempFiles.forEach(function (e, n) {
  16343. 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("."));
  16344. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  16345. return e.path;
  16346. })), e;
  16347. }
  16348. function i(e, t, _ref46) {
  16349. var s = _ref46.onChooseFile,
  16350. r = _ref46.onUploadProgress;
  16351. return t.then(function (e) {
  16352. if (s) {
  16353. var _t17 = s(e);
  16354. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  16355. return void 0 === t ? e : t;
  16356. });
  16357. }
  16358. return e;
  16359. }).then(function (t) {
  16360. return !1 === t ? {
  16361. errMsg: n,
  16362. tempFilePaths: [],
  16363. tempFiles: []
  16364. } : function (e, t) {
  16365. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  16366. var r = arguments.length > 3 ? arguments[3] : undefined;
  16367. (t = Object.assign({}, t)).errMsg = n;
  16368. var i = t.tempFiles,
  16369. o = i.length;
  16370. var a = 0;
  16371. return new Promise(function (n) {
  16372. for (; a < s;) {
  16373. c();
  16374. }
  16375. function c() {
  16376. var s = a++;
  16377. if (s >= o) return void (!i.find(function (e) {
  16378. return !e.url && !e.errMsg;
  16379. }) && n(t));
  16380. var u = i[s];
  16381. e.uploadFile({
  16382. filePath: u.path,
  16383. cloudPath: u.cloudPath,
  16384. fileType: u.fileType,
  16385. onUploadProgress: function onUploadProgress(e) {
  16386. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  16387. }
  16388. }).then(function (e) {
  16389. u.url = e.fileID, s < o && c();
  16390. }).catch(function (e) {
  16391. u.errMsg = e.errMsg || e.message, s < o && c();
  16392. });
  16393. }
  16394. });
  16395. }(e, t, 5, r);
  16396. });
  16397. }
  16398. t.initChooseAndUploadFile = function (e) {
  16399. return function () {
  16400. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  16401. type: "all"
  16402. };
  16403. return "image" === t.type ? i(e, function (e) {
  16404. var t = e.count,
  16405. n = e.sizeType,
  16406. _e$sourceType = e.sourceType,
  16407. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  16408. o = e.extension;
  16409. return new Promise(function (e, a) {
  16410. uni.chooseImage({
  16411. count: t,
  16412. sizeType: n,
  16413. sourceType: i,
  16414. extension: o,
  16415. success: function success(t) {
  16416. e(r(t, "image"));
  16417. },
  16418. fail: function fail(e) {
  16419. a({
  16420. errMsg: e.errMsg.replace("chooseImage:fail", s)
  16421. });
  16422. }
  16423. });
  16424. });
  16425. }(t), t) : "video" === t.type ? i(e, function (e) {
  16426. var t = e.camera,
  16427. n = e.compressed,
  16428. i = e.maxDuration,
  16429. _e$sourceType2 = e.sourceType,
  16430. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  16431. a = e.extension;
  16432. return new Promise(function (e, c) {
  16433. uni.chooseVideo({
  16434. camera: t,
  16435. compressed: n,
  16436. maxDuration: i,
  16437. sourceType: o,
  16438. extension: a,
  16439. success: function success(t) {
  16440. var n = t.tempFilePath,
  16441. s = t.duration,
  16442. i = t.size,
  16443. o = t.height,
  16444. a = t.width;
  16445. e(r({
  16446. errMsg: "chooseVideo:ok",
  16447. tempFilePaths: [n],
  16448. tempFiles: [{
  16449. name: t.tempFile && t.tempFile.name || "",
  16450. path: n,
  16451. size: i,
  16452. type: t.tempFile && t.tempFile.type || "",
  16453. width: a,
  16454. height: o,
  16455. duration: s,
  16456. fileType: "video",
  16457. cloudPath: ""
  16458. }]
  16459. }, "video"));
  16460. },
  16461. fail: function fail(e) {
  16462. c({
  16463. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  16464. });
  16465. }
  16466. });
  16467. });
  16468. }(t), t) : i(e, function (e) {
  16469. var t = e.count,
  16470. n = e.extension;
  16471. return new Promise(function (e, i) {
  16472. var o = uni.chooseFile;
  16473. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  16474. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  16475. });
  16476. o({
  16477. type: "all",
  16478. count: t,
  16479. extension: n,
  16480. success: function success(t) {
  16481. e(r(t));
  16482. },
  16483. fail: function fail(e) {
  16484. i({
  16485. errMsg: e.errMsg.replace("chooseFile:fail", s)
  16486. });
  16487. }
  16488. });
  16489. });
  16490. }(t), t);
  16491. };
  16492. };
  16493. }),
  16494. vs = n(ws);
  16495. var Is = "manual";
  16496. function Ss(e) {
  16497. return {
  16498. props: {
  16499. localdata: {
  16500. type: Array,
  16501. default: function _default() {
  16502. return [];
  16503. }
  16504. },
  16505. options: {
  16506. type: [Object, Array],
  16507. default: function _default() {
  16508. return {};
  16509. }
  16510. },
  16511. spaceInfo: {
  16512. type: Object,
  16513. default: function _default() {
  16514. return {};
  16515. }
  16516. },
  16517. collection: {
  16518. type: [String, Array],
  16519. default: ""
  16520. },
  16521. action: {
  16522. type: String,
  16523. default: ""
  16524. },
  16525. field: {
  16526. type: String,
  16527. default: ""
  16528. },
  16529. orderby: {
  16530. type: String,
  16531. default: ""
  16532. },
  16533. where: {
  16534. type: [String, Object],
  16535. default: ""
  16536. },
  16537. pageData: {
  16538. type: String,
  16539. default: "add"
  16540. },
  16541. pageCurrent: {
  16542. type: Number,
  16543. default: 1
  16544. },
  16545. pageSize: {
  16546. type: Number,
  16547. default: 20
  16548. },
  16549. getcount: {
  16550. type: [Boolean, String],
  16551. default: !1
  16552. },
  16553. gettree: {
  16554. type: [Boolean, String],
  16555. default: !1
  16556. },
  16557. gettreepath: {
  16558. type: [Boolean, String],
  16559. default: !1
  16560. },
  16561. startwith: {
  16562. type: String,
  16563. default: ""
  16564. },
  16565. limitlevel: {
  16566. type: Number,
  16567. default: 10
  16568. },
  16569. groupby: {
  16570. type: String,
  16571. default: ""
  16572. },
  16573. groupField: {
  16574. type: String,
  16575. default: ""
  16576. },
  16577. distinct: {
  16578. type: [Boolean, String],
  16579. default: !1
  16580. },
  16581. foreignKey: {
  16582. type: String,
  16583. default: ""
  16584. },
  16585. loadtime: {
  16586. type: String,
  16587. default: "auto"
  16588. },
  16589. manual: {
  16590. type: Boolean,
  16591. default: !1
  16592. }
  16593. },
  16594. data: function data() {
  16595. return {
  16596. mixinDatacomLoading: !1,
  16597. mixinDatacomHasMore: !1,
  16598. mixinDatacomResData: [],
  16599. mixinDatacomErrorMessage: "",
  16600. mixinDatacomPage: {}
  16601. };
  16602. },
  16603. created: function created() {
  16604. var _this20 = this;
  16605. this.mixinDatacomPage = {
  16606. current: this.pageCurrent,
  16607. size: this.pageSize,
  16608. count: 0
  16609. }, this.$watch(function () {
  16610. var e = [];
  16611. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  16612. e.push(_this20[t]);
  16613. }), e;
  16614. }, function (e, t) {
  16615. if (_this20.loadtime === Is) return;
  16616. var n = !1;
  16617. var s = [];
  16618. for (var _r7 = 2; _r7 < e.length; _r7++) {
  16619. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  16620. }
  16621. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  16622. });
  16623. },
  16624. methods: {
  16625. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  16626. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  16627. var _this21 = this;
  16628. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16629. _ref47$getone = _ref47.getone,
  16630. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  16631. t = _ref47.success,
  16632. n = _ref47.fail;
  16633. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  16634. _this21.mixinDatacomLoading = !1;
  16635. var _n$result = n.result,
  16636. s = _n$result.data,
  16637. r = _n$result.count;
  16638. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  16639. var i = e ? s.length ? s[0] : void 0 : s;
  16640. _this21.mixinDatacomResData = i, t && t(i);
  16641. }).catch(function (e) {
  16642. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  16643. }));
  16644. },
  16645. mixinDatacomGet: function mixinDatacomGet() {
  16646. var _n12;
  16647. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16648. var n = e.database(this.spaceInfo);
  16649. var s = t.action || this.action;
  16650. s && (n = n.action(s));
  16651. var r = t.collection || this.collection;
  16652. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  16653. var i = t.where || this.where;
  16654. i && Object.keys(i).length && (n = n.where(i));
  16655. var o = t.field || this.field;
  16656. o && (n = n.field(o));
  16657. var a = t.foreignKey || this.foreignKey;
  16658. a && (n = n.foreignKey(a));
  16659. var c = t.groupby || this.groupby;
  16660. c && (n = n.groupBy(c));
  16661. var u = t.groupField || this.groupField;
  16662. u && (n = n.groupField(u));
  16663. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  16664. var h = t.orderby || this.orderby;
  16665. h && (n = n.orderBy(h));
  16666. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  16667. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  16668. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  16669. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  16670. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  16671. m = {
  16672. getCount: p
  16673. },
  16674. y = {
  16675. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  16676. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  16677. };
  16678. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  16679. }
  16680. }
  16681. };
  16682. }
  16683. function bs(e) {
  16684. return function (t) {
  16685. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16686. n = function (e) {
  16687. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16688. 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;
  16689. }({
  16690. customUI: !1,
  16691. loadingOptions: {
  16692. title: "加载中...",
  16693. mask: !0
  16694. },
  16695. errorOptions: {
  16696. type: "modal",
  16697. retry: !1
  16698. }
  16699. }, n);
  16700. var _n13 = n,
  16701. s = _n13.customUI,
  16702. r = _n13.loadingOptions,
  16703. i = _n13.errorOptions,
  16704. o = _n13.parseSystemError,
  16705. a = !s;
  16706. return new Proxy({}, {
  16707. get: function get(s, c) {
  16708. return function () {
  16709. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16710. e = _ref48.fn,
  16711. t = _ref48.interceptorName,
  16712. n = _ref48.getCallbackArgs;
  16713. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16714. var _len2,
  16715. s,
  16716. _key2,
  16717. r,
  16718. i,
  16719. o,
  16720. _args = arguments;
  16721. return _regenerator.default.wrap(function _callee50$(_context50) {
  16722. while (1) {
  16723. switch (_context50.prev = _context50.next) {
  16724. case 0:
  16725. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  16726. s[_key2] = _args[_key2];
  16727. }
  16728. r = n ? n({
  16729. params: s
  16730. }) : {};
  16731. _context50.prev = 2;
  16732. _context50.next = 5;
  16733. return q(M(t, "invoke"), _objectSpread({}, r));
  16734. case 5:
  16735. _context50.next = 7;
  16736. return e.apply(void 0, s);
  16737. case 7:
  16738. i = _context50.sent;
  16739. _context50.next = 10;
  16740. return q(M(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  16741. result: i
  16742. }));
  16743. case 10:
  16744. return _context50.abrupt("return", i);
  16745. case 13:
  16746. _context50.prev = 13;
  16747. _context50.t0 = _context50["catch"](2);
  16748. o = _context50.t0;
  16749. _context50.next = 18;
  16750. return q(M(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  16751. error: o
  16752. }));
  16753. case 18:
  16754. throw o;
  16755. case 19:
  16756. _context50.prev = 19;
  16757. _context50.next = 22;
  16758. return q(M(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  16759. error: o
  16760. }) : _objectSpread(_objectSpread({}, r), {}, {
  16761. result: i
  16762. }));
  16763. case 22:
  16764. return _context50.finish(19);
  16765. case 23:
  16766. case "end":
  16767. return _context50.stop();
  16768. }
  16769. }
  16770. }, _callee50, null, [[2, 13, 19, 23]]);
  16771. }));
  16772. }({
  16773. fn: function () {
  16774. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  16775. var l,
  16776. _len3,
  16777. u,
  16778. _key3,
  16779. d,
  16780. p,
  16781. _ref50,
  16782. f,
  16783. g,
  16784. m,
  16785. y,
  16786. _e27,
  16787. _yield,
  16788. _t18,
  16789. _n14,
  16790. _args4 = arguments;
  16791. return _regenerator.default.wrap(function _callee52$(_context52) {
  16792. while (1) {
  16793. switch (_context52.prev = _context52.next) {
  16794. case 0:
  16795. a && uni.showLoading({
  16796. title: r.title,
  16797. mask: r.mask
  16798. });
  16799. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  16800. u[_key3] = _args4[_key3];
  16801. }
  16802. d = {
  16803. name: t,
  16804. type: h,
  16805. data: {
  16806. method: c,
  16807. params: u
  16808. }
  16809. };
  16810. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  16811. var n = t.data.method,
  16812. s = e.secretMethods || {},
  16813. r = s[n] || s["*"];
  16814. r && (t.secretType = r);
  16815. }(n, d);
  16816. p = !1;
  16817. _context52.prev = 5;
  16818. _context52.next = 8;
  16819. return e.callFunction(d);
  16820. case 8:
  16821. l = _context52.sent;
  16822. _context52.next = 14;
  16823. break;
  16824. case 11:
  16825. _context52.prev = 11;
  16826. _context52.t0 = _context52["catch"](5);
  16827. p = !0, l = {
  16828. result: new ne(_context52.t0)
  16829. };
  16830. case 14:
  16831. _ref50 = l.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  16832. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  16833. _context52.next = 39;
  16834. break;
  16835. }
  16836. _e27 = m;
  16837. if (!(p && o)) {
  16838. _context52.next = 24;
  16839. break;
  16840. }
  16841. _context52.next = 20;
  16842. return o({
  16843. objectName: t,
  16844. methodName: c,
  16845. params: u,
  16846. errSubject: f,
  16847. errCode: g,
  16848. errMsg: m
  16849. });
  16850. case 20:
  16851. _context52.t1 = _context52.sent.errMsg;
  16852. if (_context52.t1) {
  16853. _context52.next = 23;
  16854. break;
  16855. }
  16856. _context52.t1 = m;
  16857. case 23:
  16858. _e27 = _context52.t1;
  16859. case 24:
  16860. if (!a) {
  16861. _context52.next = 37;
  16862. break;
  16863. }
  16864. if (!("toast" === i.type)) {
  16865. _context52.next = 29;
  16866. break;
  16867. }
  16868. uni.showToast({
  16869. title: _e27,
  16870. icon: "none"
  16871. });
  16872. _context52.next = 37;
  16873. break;
  16874. case 29:
  16875. if (!("modal" !== i.type)) {
  16876. _context52.next = 31;
  16877. break;
  16878. }
  16879. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  16880. case 31:
  16881. _context52.next = 33;
  16882. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  16883. var _ref52,
  16884. e,
  16885. t,
  16886. n,
  16887. s,
  16888. r,
  16889. _args2 = arguments;
  16890. return _regenerator.default.wrap(function _callee51$(_context51) {
  16891. while (1) {
  16892. switch (_context51.prev = _context51.next) {
  16893. case 0:
  16894. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  16895. return _context51.abrupt("return", new Promise(function (i, o) {
  16896. uni.showModal({
  16897. title: e,
  16898. content: t,
  16899. showCancel: n,
  16900. cancelText: s,
  16901. confirmText: r,
  16902. success: function success(e) {
  16903. i(e);
  16904. },
  16905. fail: function fail() {
  16906. i({
  16907. confirm: !1,
  16908. cancel: !0
  16909. });
  16910. }
  16911. });
  16912. }));
  16913. case 2:
  16914. case "end":
  16915. return _context51.stop();
  16916. }
  16917. }
  16918. }, _callee51);
  16919. }))({
  16920. title: "提示",
  16921. content: _e27,
  16922. showCancel: i.retry,
  16923. cancelText: "取消",
  16924. confirmText: i.retry ? "重试" : "确定"
  16925. });
  16926. case 33:
  16927. _yield = _context52.sent;
  16928. _t18 = _yield.confirm;
  16929. if (!(i.retry && _t18)) {
  16930. _context52.next = 37;
  16931. break;
  16932. }
  16933. return _context52.abrupt("return", s.apply(void 0, u));
  16934. case 37:
  16935. _n14 = new ne({
  16936. subject: f,
  16937. code: g,
  16938. message: m,
  16939. requestId: l.requestId
  16940. });
  16941. throw _n14.detail = l.result, Q(B, {
  16942. type: H,
  16943. content: _n14
  16944. }), _n14;
  16945. case 39:
  16946. return _context52.abrupt("return", (Q(B, {
  16947. type: H,
  16948. content: l.result
  16949. }), l.result));
  16950. case 40:
  16951. case "end":
  16952. return _context52.stop();
  16953. }
  16954. }
  16955. }, _callee52, null, [[5, 11]]);
  16956. }));
  16957. function s() {
  16958. return _s14.apply(this, arguments);
  16959. }
  16960. return s;
  16961. }(),
  16962. interceptorName: "callObject",
  16963. getCallbackArgs: function getCallbackArgs() {
  16964. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16965. e = _ref53.params;
  16966. return {
  16967. objectName: t,
  16968. methodName: c,
  16969. params: e
  16970. };
  16971. }
  16972. });
  16973. }
  16974. });
  16975. };
  16976. }
  16977. function ks(e) {
  16978. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  16979. }
  16980. function Cs() {
  16981. return _Cs.apply(this, arguments);
  16982. }
  16983. function _Cs() {
  16984. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  16985. var _ref65,
  16986. e,
  16987. _ref65$callLoginByWei,
  16988. t,
  16989. n,
  16990. s,
  16991. r,
  16992. _args7 = arguments;
  16993. return _regenerator.default.wrap(function _callee55$(_context55) {
  16994. while (1) {
  16995. switch (_context55.prev = _context55.next) {
  16996. case 0:
  16997. _ref65 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref65.openid, _ref65$callLoginByWei = _ref65.callLoginByWeixin, t = _ref65$callLoginByWei === void 0 ? !1 : _ref65$callLoginByWei;
  16998. n = ks(this);
  16999. if (!("mp-weixin" !== P)) {
  17000. _context55.next = 4;
  17001. break;
  17002. }
  17003. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(P, "`"));
  17004. case 4:
  17005. if (!(e && t)) {
  17006. _context55.next = 6;
  17007. break;
  17008. }
  17009. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  17010. case 6:
  17011. if (!e) {
  17012. _context55.next = 8;
  17013. break;
  17014. }
  17015. return _context55.abrupt("return", (n.mpWeixinOpenid = e, {}));
  17016. case 8:
  17017. _context55.next = 10;
  17018. return new Promise(function (e, t) {
  17019. uni.login({
  17020. success: function success(t) {
  17021. e(t.code);
  17022. },
  17023. fail: function fail(e) {
  17024. t(new Error(e.errMsg));
  17025. }
  17026. });
  17027. });
  17028. case 10:
  17029. s = _context55.sent;
  17030. r = this.importObject("uni-id-co", {
  17031. customUI: !0
  17032. });
  17033. _context55.next = 14;
  17034. return r.secureNetworkHandshakeByWeixin({
  17035. code: s,
  17036. callLoginByWeixin: t
  17037. });
  17038. case 14:
  17039. n.mpWeixinCode = s;
  17040. return _context55.abrupt("return", {
  17041. code: s
  17042. });
  17043. case 16:
  17044. case "end":
  17045. return _context55.stop();
  17046. }
  17047. }
  17048. }, _callee55, this);
  17049. }));
  17050. return _Cs.apply(this, arguments);
  17051. }
  17052. function Ts(_x37) {
  17053. return _Ts.apply(this, arguments);
  17054. }
  17055. function _Ts() {
  17056. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e) {
  17057. var t;
  17058. return _regenerator.default.wrap(function _callee56$(_context56) {
  17059. while (1) {
  17060. switch (_context56.prev = _context56.next) {
  17061. case 0:
  17062. t = ks(this);
  17063. return _context56.abrupt("return", (t.initPromise || (t.initPromise = Cs.call(this, e)), t.initPromise));
  17064. case 2:
  17065. case "end":
  17066. return _context56.stop();
  17067. }
  17068. }
  17069. }, _callee56, this);
  17070. }));
  17071. return _Ts.apply(this, arguments);
  17072. }
  17073. function Ps(e) {
  17074. return function () {
  17075. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17076. t = _ref54.openid,
  17077. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  17078. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  17079. return Ts.call(e, {
  17080. openid: t,
  17081. callLoginByWeixin: n
  17082. });
  17083. };
  17084. }
  17085. function As(e) {
  17086. var t = {
  17087. getSystemInfo: uni.getSystemInfo,
  17088. getPushClientId: uni.getPushClientId
  17089. };
  17090. return function (n) {
  17091. return new Promise(function (s, r) {
  17092. t[e](_objectSpread(_objectSpread({}, n), {}, {
  17093. success: function success(e) {
  17094. s(e);
  17095. },
  17096. fail: function fail(e) {
  17097. r(e);
  17098. }
  17099. }));
  17100. });
  17101. };
  17102. }
  17103. var Es = /*#__PURE__*/function (_ref55) {
  17104. (0, _inherits2.default)(Es, _ref55);
  17105. var _super12 = _createSuper(Es);
  17106. function Es() {
  17107. var _this22;
  17108. (0, _classCallCheck2.default)(this, Es);
  17109. _this22 = _super12.call(this), _this22._uniPushMessageCallback = _this22._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this22)), _this22._currentMessageId = -1, _this22._payloadQueue = [];
  17110. return _this22;
  17111. }
  17112. (0, _createClass2.default)(Es, [{
  17113. key: "init",
  17114. value: function init() {
  17115. var _this23 = this;
  17116. return Promise.all([As("getSystemInfo")(), As("getPushClientId")()]).then(function () {
  17117. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  17118. _ref57 = (0, _slicedToArray2.default)(_ref56, 2),
  17119. _ref57$ = _ref57[0];
  17120. _ref57$ = _ref57$ === void 0 ? {} : _ref57$;
  17121. var e = _ref57$.appId,
  17122. _ref57$2 = _ref57[1];
  17123. _ref57$2 = _ref57$2 === void 0 ? {} : _ref57$2;
  17124. var t = _ref57$2.cid;
  17125. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  17126. if (!t) throw new Error("Invalid push client id");
  17127. _this23._appId = e, _this23._pushClientId = t, _this23._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this23.emit("open"), _this23._initMessageListener();
  17128. }, function (e) {
  17129. throw _this23.emit("error", e), _this23.close(), e;
  17130. });
  17131. }
  17132. }, {
  17133. key: "open",
  17134. value: function () {
  17135. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  17136. return _regenerator.default.wrap(function _callee53$(_context53) {
  17137. while (1) {
  17138. switch (_context53.prev = _context53.next) {
  17139. case 0:
  17140. return _context53.abrupt("return", this.init());
  17141. case 1:
  17142. case "end":
  17143. return _context53.stop();
  17144. }
  17145. }
  17146. }, _callee53, this);
  17147. }));
  17148. function open() {
  17149. return _open.apply(this, arguments);
  17150. }
  17151. return open;
  17152. }()
  17153. }, {
  17154. key: "_isUniCloudSSE",
  17155. value: function _isUniCloudSSE(e) {
  17156. if ("receive" !== e.type) return !1;
  17157. var t = e && e.data && e.data.payload;
  17158. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  17159. }
  17160. }, {
  17161. key: "_receivePushMessage",
  17162. value: function _receivePushMessage(e) {
  17163. if (!this._isUniCloudSSE(e)) return;
  17164. var t = e && e.data && e.data.payload,
  17165. n = t.action,
  17166. s = t.messageId,
  17167. r = t.message;
  17168. this._payloadQueue.push({
  17169. action: n,
  17170. messageId: s,
  17171. message: r
  17172. }), this._consumMessage();
  17173. }
  17174. }, {
  17175. key: "_consumMessage",
  17176. value: function _consumMessage() {
  17177. var _this24 = this;
  17178. for (;;) {
  17179. var _e28 = this._payloadQueue.find(function (e) {
  17180. return e.messageId === _this24._currentMessageId + 1;
  17181. });
  17182. if (!_e28) break;
  17183. this._currentMessageId++, this._parseMessagePayload(_e28);
  17184. }
  17185. }
  17186. }, {
  17187. key: "_parseMessagePayload",
  17188. value: function _parseMessagePayload(e) {
  17189. var t = e.action,
  17190. n = e.messageId,
  17191. s = e.message;
  17192. "end" === t ? this._end({
  17193. messageId: n,
  17194. message: s
  17195. }) : "message" === t && this._appendMessage({
  17196. messageId: n,
  17197. message: s
  17198. });
  17199. }
  17200. }, {
  17201. key: "_appendMessage",
  17202. value: function _appendMessage() {
  17203. var _ref58 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17204. e = _ref58.messageId,
  17205. t = _ref58.message;
  17206. this.emit("message", t);
  17207. }
  17208. }, {
  17209. key: "_end",
  17210. value: function _end() {
  17211. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17212. e = _ref59.messageId,
  17213. t = _ref59.message;
  17214. this.emit("end", t), this.close();
  17215. }
  17216. }, {
  17217. key: "_initMessageListener",
  17218. value: function _initMessageListener() {
  17219. uni.onPushMessage(this._uniPushMessageCallback);
  17220. }
  17221. }, {
  17222. key: "_destroy",
  17223. value: function _destroy() {
  17224. uni.offPushMessage(this._uniPushMessageCallback);
  17225. }
  17226. }, {
  17227. key: "toJSON",
  17228. value: function toJSON() {
  17229. return {
  17230. appId: this._appId,
  17231. pushClientId: this._pushClientId,
  17232. seqId: this._seqId
  17233. };
  17234. }
  17235. }, {
  17236. key: "close",
  17237. value: function close() {
  17238. this._destroy(), this.emit("close");
  17239. }
  17240. }]);
  17241. return Es;
  17242. }( /*#__PURE__*/function () {
  17243. function _class6() {
  17244. (0, _classCallCheck2.default)(this, _class6);
  17245. this._callback = {};
  17246. }
  17247. (0, _createClass2.default)(_class6, [{
  17248. key: "addListener",
  17249. value: function addListener(e, t) {
  17250. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  17251. }
  17252. }, {
  17253. key: "on",
  17254. value: function on(e, t) {
  17255. return this.addListener(e, t);
  17256. }
  17257. }, {
  17258. key: "removeListener",
  17259. value: function removeListener(e, t) {
  17260. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  17261. var n = this._callback[e];
  17262. if (!n) return;
  17263. var s = function (e, t) {
  17264. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  17265. if (e[_n15] === t) return _n15;
  17266. }
  17267. return -1;
  17268. }(n, t);
  17269. n.splice(s, 1);
  17270. }
  17271. }, {
  17272. key: "off",
  17273. value: function off(e, t) {
  17274. return this.removeListener(e, t);
  17275. }
  17276. }, {
  17277. key: "removeAllListener",
  17278. value: function removeAllListener(e) {
  17279. delete this._callback[e];
  17280. }
  17281. }, {
  17282. key: "emit",
  17283. value: function emit(e) {
  17284. var n = this._callback[e];
  17285. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  17286. t[_key4 - 1] = arguments[_key4];
  17287. }
  17288. if (n) for (var _e29 = 0; _e29 < n.length; _e29++) {
  17289. n[_e29].apply(n, t);
  17290. }
  17291. }
  17292. }]);
  17293. return _class6;
  17294. }());
  17295. function Os(_x38, _x39) {
  17296. return _Os.apply(this, arguments);
  17297. }
  17298. function _Os() {
  17299. _Os = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  17300. var n, _e33, s;
  17301. return _regenerator.default.wrap(function _callee57$(_context57) {
  17302. while (1) {
  17303. switch (_context57.prev = _context57.next) {
  17304. case 0:
  17305. n = "http://".concat(e, ":").concat(t, "/system/ping");
  17306. _context57.prev = 1;
  17307. _context57.next = 4;
  17308. return s = {
  17309. url: n,
  17310. timeout: 500
  17311. }, new Promise(function (e, t) {
  17312. se.request(_objectSpread(_objectSpread({}, s), {}, {
  17313. success: function success(t) {
  17314. e(t);
  17315. },
  17316. fail: function fail(e) {
  17317. t(e);
  17318. }
  17319. }));
  17320. });
  17321. case 4:
  17322. _e33 = _context57.sent;
  17323. return _context57.abrupt("return", !(!_e33.data || 0 !== _e33.data.code));
  17324. case 8:
  17325. _context57.prev = 8;
  17326. _context57.t0 = _context57["catch"](1);
  17327. return _context57.abrupt("return", !1);
  17328. case 11:
  17329. case "end":
  17330. return _context57.stop();
  17331. }
  17332. }
  17333. }, _callee57, null, [[1, 8]]);
  17334. }));
  17335. return _Os.apply(this, arguments);
  17336. }
  17337. function xs(_x40) {
  17338. return _xs.apply(this, arguments);
  17339. }
  17340. function _xs() {
  17341. _xs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  17342. var _ce2, _e34, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  17343. return _regenerator.default.wrap(function _callee59$(_context59) {
  17344. while (1) {
  17345. switch (_context59.prev = _context59.next) {
  17346. case 0:
  17347. if (b) {
  17348. _context59.next = 2;
  17349. break;
  17350. }
  17351. return _context59.abrupt("return", Promise.resolve());
  17352. case 2:
  17353. if ("app" === P) {
  17354. _ce2 = ce(), _e34 = _ce2.osName, _t20 = _ce2.osVersion;
  17355. "ios" === _e34 && function (e) {
  17356. if (!e || "string" != typeof e) return 0;
  17357. var t = e.match(/^(\d+)./);
  17358. return t && t[1] ? parseInt(t[1]) : 0;
  17359. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  17360. }
  17361. t = e.__dev__;
  17362. if (t.debugInfo) {
  17363. _context59.next = 6;
  17364. break;
  17365. }
  17366. return _context59.abrupt("return");
  17367. case 6:
  17368. _t$debugInfo = t.debugInfo;
  17369. n = _t$debugInfo.address;
  17370. s = _t$debugInfo.servePort;
  17371. _context59.next = 11;
  17372. return function () {
  17373. var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e, t) {
  17374. var n, _s15, _r8;
  17375. return _regenerator.default.wrap(function _callee58$(_context58) {
  17376. while (1) {
  17377. switch (_context58.prev = _context58.next) {
  17378. case 0:
  17379. _s15 = 0;
  17380. case 1:
  17381. if (!(_s15 < e.length)) {
  17382. _context58.next = 11;
  17383. break;
  17384. }
  17385. _r8 = e[_s15];
  17386. _context58.next = 5;
  17387. return Os(_r8, t);
  17388. case 5:
  17389. if (!_context58.sent) {
  17390. _context58.next = 8;
  17391. break;
  17392. }
  17393. n = _r8;
  17394. return _context58.abrupt("break", 11);
  17395. case 8:
  17396. _s15++;
  17397. _context58.next = 1;
  17398. break;
  17399. case 11:
  17400. return _context58.abrupt("return", {
  17401. address: n,
  17402. port: t
  17403. });
  17404. case 12:
  17405. case "end":
  17406. return _context58.stop();
  17407. }
  17408. }
  17409. }, _callee58);
  17410. }));
  17411. return function (_x41, _x42) {
  17412. return _ref66.apply(this, arguments);
  17413. };
  17414. }()(n, s);
  17415. case 11:
  17416. _yield2 = _context59.sent;
  17417. r = _yield2.address;
  17418. if (!r) {
  17419. _context59.next = 15;
  17420. break;
  17421. }
  17422. return _context59.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  17423. case 15:
  17424. i = console["app" === P ? "error" : "warn"];
  17425. o = "";
  17426. 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)) {
  17427. _context59.next = 19;
  17428. break;
  17429. }
  17430. throw new Error(o);
  17431. case 19:
  17432. i(o);
  17433. case 20:
  17434. case "end":
  17435. return _context59.stop();
  17436. }
  17437. }
  17438. }, _callee59);
  17439. }));
  17440. return _xs.apply(this, arguments);
  17441. }
  17442. function Rs(e) {
  17443. e._initPromiseHub || (e._initPromiseHub = new I({
  17444. createPromise: function createPromise() {
  17445. var t = Promise.resolve();
  17446. var n;
  17447. n = 1, t = new Promise(function (e) {
  17448. setTimeout(function () {
  17449. e();
  17450. }, n);
  17451. });
  17452. var s = e.auth();
  17453. return t.then(function () {
  17454. return s.getLoginState();
  17455. }).then(function (e) {
  17456. return e ? Promise.resolve() : s.signInAnonymously();
  17457. });
  17458. }
  17459. }));
  17460. }
  17461. var Us = {
  17462. tcb: It,
  17463. tencent: It,
  17464. aliyun: ge,
  17465. private: bt
  17466. };
  17467. var Ls = new ( /*#__PURE__*/function () {
  17468. function _class7() {
  17469. (0, _classCallCheck2.default)(this, _class7);
  17470. }
  17471. (0, _createClass2.default)(_class7, [{
  17472. key: "init",
  17473. value: function init(e) {
  17474. var t = {};
  17475. var n = Us[e.provider];
  17476. if (!n) throw new Error("未提供正确的provider参数");
  17477. t = n.init(e), b && function (e) {
  17478. if (!b) return;
  17479. var t = {};
  17480. e.__dev__ = t, t.debugLog = b && ("web" === P && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === P);
  17481. var n = A;
  17482. n && !n.code && (t.debugInfo = n);
  17483. var s = new I({
  17484. createPromise: function createPromise() {
  17485. return xs(e);
  17486. }
  17487. });
  17488. t.initLocalNetwork = function () {
  17489. return s.exec();
  17490. };
  17491. }(t), Rs(t), xn(t), function (e) {
  17492. var t = e.uploadFile;
  17493. e.uploadFile = function (e) {
  17494. return t.call(this, e);
  17495. };
  17496. }(t), function (e) {
  17497. e.database = function (t) {
  17498. if (t && Object.keys(t).length > 0) return e.init(t).database();
  17499. if (this._database) return this._database;
  17500. var n = Bn($n, {
  17501. uniClient: e
  17502. });
  17503. return this._database = n, n;
  17504. }, e.databaseForJQL = function (t) {
  17505. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  17506. if (this._databaseForJQL) return this._databaseForJQL;
  17507. var n = Bn($n, {
  17508. uniClient: e,
  17509. isJQL: !0
  17510. });
  17511. return this._databaseForJQL = n, n;
  17512. };
  17513. }(t), function (e) {
  17514. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  17515. get mixinDatacom() {
  17516. return Ss(e);
  17517. }
  17518. }), e.SSEChannel = Es, e.initSecureNetworkByWeixin = Ps(e), e.importObject = bs(e);
  17519. }(t);
  17520. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  17521. if (!t[e]) return;
  17522. var n = t[e];
  17523. t[e] = function () {
  17524. return n.apply(t, Array.from(arguments));
  17525. }, t[e] = function (e, t) {
  17526. return function (n) {
  17527. var _this25 = this;
  17528. var s = !1;
  17529. if ("callFunction" === t) {
  17530. var _e30 = n && n.type || u;
  17531. s = _e30 !== u;
  17532. }
  17533. var r = "callFunction" === t && !s,
  17534. i = this._initPromiseHub.exec();
  17535. n = n || {};
  17536. var _te2 = te(n),
  17537. o = _te2.success,
  17538. a = _te2.fail,
  17539. c = _te2.complete,
  17540. h = i.then(function () {
  17541. return s ? Promise.resolve() : q(M(t, "invoke"), n);
  17542. }).then(function () {
  17543. return e.call(_this25, n);
  17544. }).then(function (e) {
  17545. return s ? Promise.resolve(e) : q(M(t, "success"), e).then(function () {
  17546. return q(M(t, "complete"), e);
  17547. }).then(function () {
  17548. return r && Q(B, {
  17549. type: J,
  17550. content: e
  17551. }), Promise.resolve(e);
  17552. });
  17553. }, function (e) {
  17554. return s ? Promise.reject(e) : q(M(t, "fail"), e).then(function () {
  17555. return q(M(t, "complete"), e);
  17556. }).then(function () {
  17557. return Q(B, {
  17558. type: J,
  17559. content: e
  17560. }), Promise.reject(e);
  17561. });
  17562. });
  17563. if (!(o || a || c)) return h;
  17564. h.then(function (e) {
  17565. o && o(e), c && c(e), r && Q(B, {
  17566. type: J,
  17567. content: e
  17568. });
  17569. }, function (e) {
  17570. a && a(e), c && c(e), r && Q(B, {
  17571. type: J,
  17572. content: e
  17573. });
  17574. });
  17575. };
  17576. }(t[e], e).bind(t);
  17577. }), t.init = this.init, t;
  17578. }
  17579. }]);
  17580. return _class7;
  17581. }())();
  17582. (function () {
  17583. var e = E;
  17584. var t = {};
  17585. if (e && 1 === e.length) t = e[0], Ls = Ls.init(t), Ls._isDefault = !0;else {
  17586. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  17587. var _n16;
  17588. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  17589. Ls[e] = function () {
  17590. return console.error(_n16), Promise.reject(new ne({
  17591. code: "SYS_ERR",
  17592. message: _n16
  17593. }));
  17594. };
  17595. });
  17596. }
  17597. Object.assign(Ls, {
  17598. get mixinDatacom() {
  17599. return Ss(Ls);
  17600. }
  17601. }), fs(Ls), Ls.addInterceptor = D, Ls.removeInterceptor = F, Ls.interceptObject = K, b && "web" === P && (window.uniCloud = Ls);
  17602. })();
  17603. var Ns = Ls;
  17604. exports.default = Ns;
  17605. /* 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"]))
  17606. /***/ }),
  17607. /***/ 273:
  17608. /*!****************************************************************!*\
  17609. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  17610. \****************************************************************/
  17611. /*! no static exports found */
  17612. /***/ (function(module, exports, __webpack_require__) {
  17613. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 256);
  17614. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  17615. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 274);
  17616. var construct = __webpack_require__(/*! ./construct.js */ 15);
  17617. function _wrapNativeSuper(Class) {
  17618. var _cache = typeof Map === "function" ? new Map() : undefined;
  17619. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  17620. if (Class === null || !isNativeFunction(Class)) return Class;
  17621. if (typeof Class !== "function") {
  17622. throw new TypeError("Super expression must either be null or a function");
  17623. }
  17624. if (typeof _cache !== "undefined") {
  17625. if (_cache.has(Class)) return _cache.get(Class);
  17626. _cache.set(Class, Wrapper);
  17627. }
  17628. function Wrapper() {
  17629. return construct(Class, arguments, getPrototypeOf(this).constructor);
  17630. }
  17631. Wrapper.prototype = Object.create(Class.prototype, {
  17632. constructor: {
  17633. value: Wrapper,
  17634. enumerable: false,
  17635. writable: true,
  17636. configurable: true
  17637. }
  17638. });
  17639. return setPrototypeOf(Wrapper, Class);
  17640. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17641. return _wrapNativeSuper(Class);
  17642. }
  17643. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17644. /***/ }),
  17645. /***/ 274:
  17646. /*!*****************************************************************!*\
  17647. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  17648. \*****************************************************************/
  17649. /*! no static exports found */
  17650. /***/ (function(module, exports) {
  17651. function _isNativeFunction(fn) {
  17652. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  17653. }
  17654. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17655. /***/ }),
  17656. /***/ 275:
  17657. /*!***************************************************************************************!*\
  17658. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"origin-pages-json"} ***!
  17659. \***************************************************************************************/
  17660. /*! no static exports found */
  17661. /***/ (function(module, exports, __webpack_require__) {
  17662. "use strict";
  17663. Object.defineProperty(exports, "__esModule", {
  17664. value: true
  17665. });
  17666. exports.default = void 0;
  17667. var _default = {
  17668. "pages": [{
  17669. "path": "pages/index/index",
  17670. "style": {
  17671. "navigationBarTitleText": "六院联创促进医院高质量发展"
  17672. }
  17673. }, {
  17674. "path": "pages/history/history",
  17675. "style": {
  17676. "navigationBarTitleText": "操作记录",
  17677. "enablePullDownRefresh": true
  17678. }
  17679. }, {
  17680. "path": "pages/history/detail/detail",
  17681. "style": {
  17682. "navigationBarTitleText": "操作记录详情"
  17683. }
  17684. }, {
  17685. "path": "pages/myCenter/myCenter",
  17686. "style": {
  17687. "navigationBarTitleText": "我的",
  17688. "enablePullDownRefresh": true
  17689. }
  17690. }, {
  17691. "path": "pages/login/index",
  17692. "style": {
  17693. "navigationBarTitleText": "登录"
  17694. }
  17695. }, {
  17696. "path": "pages/authorizedLogin/index",
  17697. "style": {
  17698. "navigationBarTitleText": "授权登录"
  17699. }
  17700. }, {
  17701. "path": "pages/service_agreement/service_agreement",
  17702. "style": {
  17703. "navigationBarTitleText": "隐私协议"
  17704. }
  17705. }, {
  17706. "path": "pages/app_views/satisfaction_evaluation/satisfaction_evaluation",
  17707. "style": {
  17708. "navigationBarTitleText": "满意度评价",
  17709. "enablePullDownRefresh": false
  17710. }
  17711. }, {
  17712. "path": "pages/app_views/safe_checked/safe_checked",
  17713. "style": {
  17714. "navigationBarTitleText": "安全巡检",
  17715. "enablePullDownRefresh": false
  17716. }
  17717. }, {
  17718. "path": "pages/app_views/danger/submit/submit",
  17719. "style": {
  17720. "navigationBarTitleText": "登记隐患",
  17721. "enablePullDownRefresh": false
  17722. }
  17723. }, {
  17724. "path": "pages/app_views/equipment_maintenance/equipment_maintenance",
  17725. "style": {
  17726. "navigationBarTitleText": "设备保养",
  17727. "enablePullDownRefresh": false
  17728. }
  17729. }, {
  17730. "path": "pages/app_views/problem_feedback/problem_feedback",
  17731. "style": {
  17732. "navigationBarTitleText": "问题反馈",
  17733. "enablePullDownRefresh": false
  17734. }
  17735. }, {
  17736. "path": "pages/app_views/danger/handle/handle",
  17737. "style": {
  17738. "navigationBarTitleText": "隐患处理",
  17739. "enablePullDownRefresh": false
  17740. }
  17741. }, {
  17742. "path": "pages/app_views/checkList/index/index",
  17743. "style": {
  17744. "navigationBarTitleText": "清单",
  17745. "enablePullDownRefresh": false
  17746. }
  17747. }, {
  17748. "path": "pages/app_views/checkList/form/form",
  17749. "style": {
  17750. "navigationBarTitleText": "风险点巡检",
  17751. "enablePullDownRefresh": false
  17752. }
  17753. }, {
  17754. "path": "pages/app_views/hazard/index/index",
  17755. "style": {
  17756. "navigationBarTitleText": "危险源",
  17757. "enablePullDownRefresh": false
  17758. }
  17759. }, {
  17760. "path": "pages/app_views/hazard/form/form",
  17761. "style": {
  17762. "navigationBarTitleText": "隐患提交",
  17763. "enablePullDownRefresh": false
  17764. }
  17765. }, {
  17766. "path": "pages/myCenter/profile/profile",
  17767. "style": {
  17768. "navigationBarTitleText": "个人信息",
  17769. "enablePullDownRefresh": false
  17770. }
  17771. }, {
  17772. "path": "pages/task/task",
  17773. "style": {
  17774. "navigationBarTitleText": "代办任务",
  17775. "enablePullDownRefresh": true
  17776. }
  17777. }, {
  17778. "path": "pages/danger/danger",
  17779. "style": {
  17780. "navigationBarTitleText": "待处理隐患",
  17781. "enablePullDownRefresh": true
  17782. }
  17783. }, {
  17784. "path": "pages/app_views/problem_feedback/record/record",
  17785. "style": {
  17786. "navigationBarTitleText": "问题反馈记录",
  17787. "enablePullDownRefresh": false
  17788. }
  17789. }, {
  17790. "path": "pages/app_views/problem_feedback/form/form",
  17791. "style": {
  17792. "navigationBarTitleText": "反馈处理",
  17793. "enablePullDownRefresh": false
  17794. }
  17795. }],
  17796. "tabBar": {
  17797. "color": "#7A7E83",
  17798. "selectedColor": "#1296db",
  17799. "borderStyle": "black",
  17800. "backgroundColor": "#ffffff",
  17801. "list": [{
  17802. "pagePath": "pages/index/index",
  17803. "iconPath": "static/tabbar/index.png",
  17804. "selectedIconPath": "static/tabbar/indexEd.png",
  17805. "text": "首页"
  17806. }, {
  17807. "pagePath": "pages/history/history",
  17808. "iconPath": "static/tabbar/history.png",
  17809. "selectedIconPath": "static/tabbar/historyEd.png",
  17810. "text": "操作记录"
  17811. }, {
  17812. "pagePath": "pages/myCenter/myCenter",
  17813. "iconPath": "static/tabbar/myCenter.png",
  17814. "selectedIconPath": "static/tabbar/myCenterEd.png",
  17815. "text": "我的"
  17816. }]
  17817. },
  17818. "globalStyle": {
  17819. "navigationBarTextStyle": "black",
  17820. "navigationBarTitleText": "uni-app",
  17821. "navigationBarBackgroundColor": "#F8F8F8",
  17822. "backgroundColor": "#F8F8F8"
  17823. },
  17824. "uniIdRouter": {}
  17825. };
  17826. exports.default = _default;
  17827. /***/ }),
  17828. /***/ 276:
  17829. /*!**************************************************************************!*\
  17830. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"stat"} ***!
  17831. \**************************************************************************/
  17832. /*! no static exports found */
  17833. /***/ (function(module, exports, __webpack_require__) {
  17834. "use strict";
  17835. Object.defineProperty(exports, "__esModule", {
  17836. value: true
  17837. });
  17838. exports.default = void 0;
  17839. var _default = {
  17840. "appid": "__UNI__2E20170"
  17841. };
  17842. exports.default = _default;
  17843. /***/ }),
  17844. /***/ 291:
  17845. /*!****************************************************************************************************************************!*\
  17846. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  17847. \****************************************************************************************************************************/
  17848. /*! no static exports found */
  17849. /***/ (function(module, exports, __webpack_require__) {
  17850. "use strict";
  17851. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17852. Object.defineProperty(exports, "__esModule", {
  17853. value: true
  17854. });
  17855. exports.default = void 0;
  17856. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 292));
  17857. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 293));
  17858. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 294));
  17859. var _default = {
  17860. en: _en.default,
  17861. 'zh-Hans': _zhHans.default,
  17862. 'zh-Hant': _zhHant.default
  17863. };
  17864. exports.default = _default;
  17865. /***/ }),
  17866. /***/ 292:
  17867. /*!***************************************************************************************************************************!*\
  17868. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  17869. \***************************************************************************************************************************/
  17870. /*! 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 */
  17871. /***/ (function(module) {
  17872. 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\"}");
  17873. /***/ }),
  17874. /***/ 293:
  17875. /*!********************************************************************************************************************************!*\
  17876. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  17877. \********************************************************************************************************************************/
  17878. /*! 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 */
  17879. /***/ (function(module) {
  17880. 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\":\"确认\"}");
  17881. /***/ }),
  17882. /***/ 294:
  17883. /*!********************************************************************************************************************************!*\
  17884. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  17885. \********************************************************************************************************************************/
  17886. /*! 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 */
  17887. /***/ (function(module) {
  17888. 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\":\"確認\"}");
  17889. /***/ }),
  17890. /***/ 295:
  17891. /*!**********************************************************************************************************************!*\
  17892. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  17893. \**********************************************************************************************************************/
  17894. /*! no static exports found */
  17895. /***/ (function(module, exports, __webpack_require__) {
  17896. "use strict";
  17897. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17898. Object.defineProperty(exports, "__esModule", {
  17899. value: true
  17900. });
  17901. exports.Calendar = void 0;
  17902. exports.addZero = addZero;
  17903. exports.checkDate = checkDate;
  17904. exports.dateCompare = dateCompare;
  17905. exports.fixIosDateFormat = fixIosDateFormat;
  17906. exports.getDate = getDate;
  17907. exports.getDateTime = getDateTime;
  17908. exports.getDefaultSecond = getDefaultSecond;
  17909. exports.getTime = getTime;
  17910. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  17911. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  17912. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  17913. var Calendar = /*#__PURE__*/function () {
  17914. function Calendar() {
  17915. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17916. selected = _ref.selected,
  17917. startDate = _ref.startDate,
  17918. endDate = _ref.endDate,
  17919. range = _ref.range;
  17920. (0, _classCallCheck2.default)(this, Calendar);
  17921. // 当前日期
  17922. this.date = this.getDateObj(new Date()); // 当前初入日期
  17923. // 打点信息
  17924. this.selected = selected || [];
  17925. // 起始时间
  17926. this.startDate = startDate;
  17927. // 终止时间
  17928. this.endDate = endDate;
  17929. // 是否范围选择
  17930. this.range = range;
  17931. // 多选状态
  17932. this.cleanMultipleStatus();
  17933. // 每周日期
  17934. this.weeks = {};
  17935. this.lastHover = false;
  17936. }
  17937. /**
  17938. * 设置日期
  17939. * @param {Object} date
  17940. */
  17941. (0, _createClass2.default)(Calendar, [{
  17942. key: "setDate",
  17943. value: function setDate(date) {
  17944. var selectDate = this.getDateObj(date);
  17945. this.getWeeks(selectDate.fullDate);
  17946. }
  17947. /**
  17948. * 清理多选状态
  17949. */
  17950. }, {
  17951. key: "cleanMultipleStatus",
  17952. value: function cleanMultipleStatus() {
  17953. this.multipleStatus = {
  17954. before: '',
  17955. after: '',
  17956. data: []
  17957. };
  17958. }
  17959. }, {
  17960. key: "setStartDate",
  17961. value: function setStartDate(startDate) {
  17962. this.startDate = startDate;
  17963. }
  17964. }, {
  17965. key: "setEndDate",
  17966. value: function setEndDate(endDate) {
  17967. this.endDate = endDate;
  17968. }
  17969. }, {
  17970. key: "getPreMonthObj",
  17971. value: function getPreMonthObj(date) {
  17972. date = fixIosDateFormat(date);
  17973. date = new Date(date);
  17974. var oldMonth = date.getMonth();
  17975. date.setMonth(oldMonth - 1);
  17976. var newMonth = date.getMonth();
  17977. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  17978. date.setMonth(newMonth - 1);
  17979. }
  17980. return this.getDateObj(date);
  17981. }
  17982. }, {
  17983. key: "getNextMonthObj",
  17984. value: function getNextMonthObj(date) {
  17985. date = fixIosDateFormat(date);
  17986. date = new Date(date);
  17987. var oldMonth = date.getMonth();
  17988. date.setMonth(oldMonth + 1);
  17989. var newMonth = date.getMonth();
  17990. if (newMonth - oldMonth > 1) {
  17991. date.setMonth(newMonth - 1);
  17992. }
  17993. return this.getDateObj(date);
  17994. }
  17995. /**
  17996. * 获取指定格式Date对象
  17997. */
  17998. }, {
  17999. key: "getDateObj",
  18000. value: function getDateObj(date) {
  18001. date = fixIosDateFormat(date);
  18002. date = new Date(date);
  18003. return {
  18004. fullDate: getDate(date),
  18005. year: date.getFullYear(),
  18006. month: addZero(date.getMonth() + 1),
  18007. date: addZero(date.getDate()),
  18008. day: date.getDay()
  18009. };
  18010. }
  18011. /**
  18012. * 获取上一个月日期集合
  18013. */
  18014. }, {
  18015. key: "getPreMonthDays",
  18016. value: function getPreMonthDays(amount, dateObj) {
  18017. var _this = this;
  18018. var result = [];
  18019. var _loop = function _loop(i) {
  18020. var month = dateObj.month > 1 ? dateObj.month - 1 : 12;
  18021. var year = month === 12 ? dateObj.year - 1 : dateObj.year;
  18022. var date = new Date(year, month, -i).getDate();
  18023. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(date));
  18024. var multiples = _this.multipleStatus.data;
  18025. var multiplesStatus = -1;
  18026. if (_this.range && multiples) {
  18027. multiplesStatus = multiples.findIndex(function (item) {
  18028. return _this.dateEqual(item, fullDate);
  18029. });
  18030. }
  18031. var checked = multiplesStatus !== -1;
  18032. // 获取打点信息
  18033. var extraInfo = _this.selected && _this.selected.find(function (item) {
  18034. if (_this.dateEqual(fullDate, item.date)) {
  18035. return item;
  18036. }
  18037. });
  18038. result.push({
  18039. fullDate: fullDate,
  18040. year: year,
  18041. month: month,
  18042. date: date,
  18043. multiple: _this.range ? checked : false,
  18044. beforeMultiple: _this.isLogicBefore(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18045. afterMultiple: _this.isLogicAfter(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18046. disable: _this.startDate && !dateCompare(_this.startDate, fullDate) || _this.endDate && !dateCompare(fullDate, _this.endDate),
  18047. isToday: fullDate === _this.date.fullDate,
  18048. userChecked: false,
  18049. extraInfo: extraInfo
  18050. });
  18051. };
  18052. for (var i = amount - 1; i >= 0; i--) {
  18053. _loop(i);
  18054. }
  18055. return result;
  18056. }
  18057. /**
  18058. * 获取本月日期集合
  18059. */
  18060. }, {
  18061. key: "getCurrentMonthDays",
  18062. value: function getCurrentMonthDays(amount, dateObj) {
  18063. var _this2 = this;
  18064. var result = [];
  18065. var fullDate = this.date.fullDate;
  18066. var _loop2 = function _loop2(i) {
  18067. var currentDate = "".concat(dateObj.year, "-").concat(dateObj.month, "-").concat(addZero(i));
  18068. var isToday = fullDate === currentDate;
  18069. // 获取打点信息
  18070. var extraInfo = _this2.selected && _this2.selected.find(function (item) {
  18071. if (_this2.dateEqual(currentDate, item.date)) {
  18072. return item;
  18073. }
  18074. });
  18075. // 日期禁用
  18076. var disableBefore = true;
  18077. var disableAfter = true;
  18078. if (_this2.startDate) {
  18079. disableBefore = dateCompare(_this2.startDate, currentDate);
  18080. }
  18081. if (_this2.endDate) {
  18082. disableAfter = dateCompare(currentDate, _this2.endDate);
  18083. }
  18084. var multiples = _this2.multipleStatus.data;
  18085. var multiplesStatus = -1;
  18086. if (_this2.range && multiples) {
  18087. multiplesStatus = multiples.findIndex(function (item) {
  18088. return _this2.dateEqual(item, currentDate);
  18089. });
  18090. }
  18091. var checked = multiplesStatus !== -1;
  18092. result.push({
  18093. fullDate: currentDate,
  18094. year: dateObj.year,
  18095. month: dateObj.month,
  18096. date: i,
  18097. multiple: _this2.range ? checked : false,
  18098. beforeMultiple: _this2.isLogicBefore(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  18099. afterMultiple: _this2.isLogicAfter(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  18100. disable: _this2.startDate && !dateCompare(_this2.startDate, currentDate) || _this2.endDate && !dateCompare(currentDate, _this2.endDate),
  18101. isToday: isToday,
  18102. userChecked: false,
  18103. extraInfo: extraInfo
  18104. });
  18105. };
  18106. for (var i = 1; i <= amount; i++) {
  18107. _loop2(i);
  18108. }
  18109. return result;
  18110. }
  18111. /**
  18112. * 获取下一个月日期集合
  18113. */
  18114. }, {
  18115. key: "_getNextMonthDays",
  18116. value: function _getNextMonthDays(amount, dateObj) {
  18117. var _this3 = this;
  18118. var result = [];
  18119. var month = dateObj.month + 1;
  18120. var _loop3 = function _loop3(i) {
  18121. var month = dateObj.month === 12 ? 1 : dateObj.month * 1 + 1;
  18122. var year = month === 1 ? dateObj.year + 1 : dateObj.year;
  18123. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(i));
  18124. var multiples = _this3.multipleStatus.data;
  18125. var multiplesStatus = -1;
  18126. if (_this3.range && multiples) {
  18127. multiplesStatus = multiples.findIndex(function (item) {
  18128. return _this3.dateEqual(item, fullDate);
  18129. });
  18130. }
  18131. var checked = multiplesStatus !== -1;
  18132. // 获取打点信息
  18133. var extraInfo = _this3.selected && _this3.selected.find(function (item) {
  18134. if (_this3.dateEqual(fullDate, item.date)) {
  18135. return item;
  18136. }
  18137. });
  18138. result.push({
  18139. fullDate: fullDate,
  18140. year: year,
  18141. date: i,
  18142. month: month,
  18143. multiple: _this3.range ? checked : false,
  18144. beforeMultiple: _this3.isLogicBefore(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  18145. afterMultiple: _this3.isLogicAfter(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  18146. disable: _this3.startDate && !dateCompare(_this3.startDate, fullDate) || _this3.endDate && !dateCompare(fullDate, _this3.endDate),
  18147. isToday: fullDate === _this3.date.fullDate,
  18148. userChecked: false,
  18149. extraInfo: extraInfo
  18150. });
  18151. };
  18152. for (var i = 1; i <= amount; i++) {
  18153. _loop3(i);
  18154. }
  18155. return result;
  18156. }
  18157. /**
  18158. * 获取当前日期详情
  18159. * @param {Object} date
  18160. */
  18161. }, {
  18162. key: "getInfo",
  18163. value: function getInfo(date) {
  18164. var _this4 = this;
  18165. if (!date) {
  18166. date = new Date();
  18167. }
  18168. return this.calendar.find(function (item) {
  18169. return item.fullDate === _this4.getDateObj(date).fullDate;
  18170. });
  18171. }
  18172. /**
  18173. * 比较时间是否相等
  18174. */
  18175. }, {
  18176. key: "dateEqual",
  18177. value: function dateEqual(before, after) {
  18178. before = new Date(fixIosDateFormat(before));
  18179. after = new Date(fixIosDateFormat(after));
  18180. return before.valueOf() === after.valueOf();
  18181. }
  18182. /**
  18183. * 比较真实起始日期
  18184. */
  18185. }, {
  18186. key: "isLogicBefore",
  18187. value: function isLogicBefore(currentDate, before, after) {
  18188. var logicBefore = before;
  18189. if (before && after) {
  18190. logicBefore = dateCompare(before, after) ? before : after;
  18191. }
  18192. return this.dateEqual(logicBefore, currentDate);
  18193. }
  18194. }, {
  18195. key: "isLogicAfter",
  18196. value: function isLogicAfter(currentDate, before, after) {
  18197. var logicAfter = after;
  18198. if (before && after) {
  18199. logicAfter = dateCompare(before, after) ? after : before;
  18200. }
  18201. return this.dateEqual(logicAfter, currentDate);
  18202. }
  18203. /**
  18204. * 获取日期范围内所有日期
  18205. * @param {Object} begin
  18206. * @param {Object} end
  18207. */
  18208. }, {
  18209. key: "geDateAll",
  18210. value: function geDateAll(begin, end) {
  18211. var arr = [];
  18212. var ab = begin.split('-');
  18213. var ae = end.split('-');
  18214. var db = new Date();
  18215. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  18216. var de = new Date();
  18217. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  18218. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  18219. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  18220. for (var k = unixDb; k <= unixDe;) {
  18221. k = k + 24 * 60 * 60 * 1000;
  18222. arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
  18223. }
  18224. return arr;
  18225. }
  18226. /**
  18227. * 获取多选状态
  18228. */
  18229. }, {
  18230. key: "setMultiple",
  18231. value: function setMultiple(fullDate) {
  18232. if (!this.range) return;
  18233. var _this$multipleStatus = this.multipleStatus,
  18234. before = _this$multipleStatus.before,
  18235. after = _this$multipleStatus.after;
  18236. if (before && after) {
  18237. if (!this.lastHover) {
  18238. this.lastHover = true;
  18239. return;
  18240. }
  18241. this.multipleStatus.before = fullDate;
  18242. this.multipleStatus.after = '';
  18243. this.multipleStatus.data = [];
  18244. this.multipleStatus.fulldate = '';
  18245. this.lastHover = false;
  18246. } else {
  18247. if (!before) {
  18248. this.multipleStatus.before = fullDate;
  18249. this.lastHover = false;
  18250. } else {
  18251. this.multipleStatus.after = fullDate;
  18252. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18253. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18254. } else {
  18255. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18256. }
  18257. this.lastHover = true;
  18258. }
  18259. }
  18260. this.getWeeks(fullDate);
  18261. }
  18262. /**
  18263. * 鼠标 hover 更新多选状态
  18264. */
  18265. }, {
  18266. key: "setHoverMultiple",
  18267. value: function setHoverMultiple(fullDate) {
  18268. if (!this.range || this.lastHover) return;
  18269. var before = this.multipleStatus.before;
  18270. if (!before) {
  18271. this.multipleStatus.before = fullDate;
  18272. } else {
  18273. this.multipleStatus.after = fullDate;
  18274. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18275. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18276. } else {
  18277. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18278. }
  18279. }
  18280. this.getWeeks(fullDate);
  18281. }
  18282. /**
  18283. * 更新默认值多选状态
  18284. */
  18285. }, {
  18286. key: "setDefaultMultiple",
  18287. value: function setDefaultMultiple(before, after) {
  18288. this.multipleStatus.before = before;
  18289. this.multipleStatus.after = after;
  18290. if (before && after) {
  18291. if (dateCompare(before, after)) {
  18292. this.multipleStatus.data = this.geDateAll(before, after);
  18293. this.getWeeks(after);
  18294. } else {
  18295. this.multipleStatus.data = this.geDateAll(after, before);
  18296. this.getWeeks(before);
  18297. }
  18298. }
  18299. }
  18300. /**
  18301. * 获取每周数据
  18302. * @param {Object} dateData
  18303. */
  18304. }, {
  18305. key: "getWeeks",
  18306. value: function getWeeks(dateData) {
  18307. var _this$getDateObj = this.getDateObj(dateData),
  18308. year = _this$getDateObj.year,
  18309. month = _this$getDateObj.month;
  18310. var preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  18311. var preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  18312. var currentMonthDayAmount = new Date(year, month, 0).getDate();
  18313. var currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  18314. var nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  18315. var nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  18316. var calendarDays = [].concat((0, _toConsumableArray2.default)(preMonthDays), (0, _toConsumableArray2.default)(currentMonthDays), (0, _toConsumableArray2.default)(nextMonthDays));
  18317. var weeks = new Array(6);
  18318. for (var i = 0; i < calendarDays.length; i++) {
  18319. var index = Math.floor(i / 7);
  18320. if (!weeks[index]) {
  18321. weeks[index] = new Array(7);
  18322. }
  18323. weeks[index][i % 7] = calendarDays[i];
  18324. }
  18325. this.calendar = calendarDays;
  18326. this.weeks = weeks;
  18327. }
  18328. }]);
  18329. return Calendar;
  18330. }();
  18331. exports.Calendar = Calendar;
  18332. function getDateTime(date, hideSecond) {
  18333. return "".concat(getDate(date), " ").concat(getTime(date, hideSecond));
  18334. }
  18335. function getDate(date) {
  18336. date = fixIosDateFormat(date);
  18337. date = new Date(date);
  18338. var year = date.getFullYear();
  18339. var month = date.getMonth() + 1;
  18340. var day = date.getDate();
  18341. return "".concat(year, "-").concat(addZero(month), "-").concat(addZero(day));
  18342. }
  18343. function getTime(date, hideSecond) {
  18344. date = fixIosDateFormat(date);
  18345. date = new Date(date);
  18346. var hour = date.getHours();
  18347. var minute = date.getMinutes();
  18348. var second = date.getSeconds();
  18349. return hideSecond ? "".concat(addZero(hour), ":").concat(addZero(minute)) : "".concat(addZero(hour), ":").concat(addZero(minute), ":").concat(addZero(second));
  18350. }
  18351. function addZero(num) {
  18352. if (num < 10) {
  18353. num = "0".concat(num);
  18354. }
  18355. return num;
  18356. }
  18357. function getDefaultSecond(hideSecond) {
  18358. return hideSecond ? '00:00' : '00:00:00';
  18359. }
  18360. function dateCompare(startDate, endDate) {
  18361. startDate = new Date(fixIosDateFormat(startDate));
  18362. endDate = new Date(fixIosDateFormat(endDate));
  18363. return startDate <= endDate;
  18364. }
  18365. function checkDate(date) {
  18366. var dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  18367. return date.match(dateReg);
  18368. }
  18369. 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])?$/;
  18370. function fixIosDateFormat(value) {
  18371. if (typeof value === 'string' && dateTimeReg.test(value)) {
  18372. value = value.replace(/-/g, '/');
  18373. }
  18374. return value;
  18375. }
  18376. /***/ }),
  18377. /***/ 3:
  18378. /*!***********************************!*\
  18379. !*** (webpack)/buildin/global.js ***!
  18380. \***********************************/
  18381. /*! no static exports found */
  18382. /***/ (function(module, exports) {
  18383. var g;
  18384. // This works in non-strict mode
  18385. g = (function() {
  18386. return this;
  18387. })();
  18388. try {
  18389. // This works if eval is allowed (see CSP)
  18390. g = g || new Function("return this")();
  18391. } catch (e) {
  18392. // This works if the window reference is available
  18393. if (typeof window === "object") g = window;
  18394. }
  18395. // g can still be undefined, but nothing to do about it...
  18396. // We return undefined, instead of nothing here, so it's
  18397. // easier to handle this case. if(!global) { ...}
  18398. module.exports = g;
  18399. /***/ }),
  18400. /***/ 310:
  18401. /*!********************************************************************************************************************************!*\
  18402. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  18403. \********************************************************************************************************************************/
  18404. /*! no static exports found */
  18405. /***/ (function(module, exports, __webpack_require__) {
  18406. "use strict";
  18407. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  18408. Object.defineProperty(exports, "__esModule", {
  18409. value: true
  18410. });
  18411. exports.chooseAndUploadFile = chooseAndUploadFile;
  18412. exports.uploadCloudFiles = uploadCloudFiles;
  18413. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  18414. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  18415. function chooseImage(opts) {
  18416. var count = opts.count,
  18417. _opts$sizeType = opts.sizeType,
  18418. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  18419. sourceType = opts.sourceType,
  18420. extension = opts.extension;
  18421. return new Promise(function (resolve, reject) {
  18422. uni.chooseImage({
  18423. count: count,
  18424. sizeType: sizeType,
  18425. sourceType: sourceType,
  18426. extension: extension,
  18427. success: function success(res) {
  18428. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  18429. },
  18430. fail: function fail(res) {
  18431. reject({
  18432. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  18433. });
  18434. }
  18435. });
  18436. });
  18437. }
  18438. function chooseVideo(opts) {
  18439. var camera = opts.camera,
  18440. compressed = opts.compressed,
  18441. maxDuration = opts.maxDuration,
  18442. sourceType = opts.sourceType,
  18443. extension = opts.extension;
  18444. return new Promise(function (resolve, reject) {
  18445. uni.chooseVideo({
  18446. camera: camera,
  18447. compressed: compressed,
  18448. maxDuration: maxDuration,
  18449. sourceType: sourceType,
  18450. extension: extension,
  18451. success: function success(res) {
  18452. var tempFilePath = res.tempFilePath,
  18453. duration = res.duration,
  18454. size = res.size,
  18455. height = res.height,
  18456. width = res.width;
  18457. resolve(normalizeChooseAndUploadFileRes({
  18458. errMsg: 'chooseVideo:ok',
  18459. tempFilePaths: [tempFilePath],
  18460. tempFiles: [{
  18461. name: res.tempFile && res.tempFile.name || '',
  18462. path: tempFilePath,
  18463. size: size,
  18464. type: res.tempFile && res.tempFile.type || '',
  18465. width: width,
  18466. height: height,
  18467. duration: duration,
  18468. fileType: 'video',
  18469. cloudPath: ''
  18470. }]
  18471. }, 'video'));
  18472. },
  18473. fail: function fail(res) {
  18474. reject({
  18475. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  18476. });
  18477. }
  18478. });
  18479. });
  18480. }
  18481. function chooseAll(opts) {
  18482. var count = opts.count,
  18483. extension = opts.extension;
  18484. return new Promise(function (resolve, reject) {
  18485. var chooseFile = uni.chooseFile;
  18486. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  18487. chooseFile = wx.chooseMessageFile;
  18488. }
  18489. if (typeof chooseFile !== 'function') {
  18490. return reject({
  18491. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  18492. });
  18493. }
  18494. chooseFile({
  18495. type: 'all',
  18496. count: count,
  18497. extension: extension,
  18498. success: function success(res) {
  18499. resolve(normalizeChooseAndUploadFileRes(res));
  18500. },
  18501. fail: function fail(res) {
  18502. reject({
  18503. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  18504. });
  18505. }
  18506. });
  18507. });
  18508. }
  18509. function normalizeChooseAndUploadFileRes(res, fileType) {
  18510. res.tempFiles.forEach(function (item, index) {
  18511. if (!item.name) {
  18512. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  18513. }
  18514. if (fileType) {
  18515. item.fileType = fileType;
  18516. }
  18517. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  18518. });
  18519. if (!res.tempFilePaths) {
  18520. res.tempFilePaths = res.tempFiles.map(function (file) {
  18521. return file.path;
  18522. });
  18523. }
  18524. return res;
  18525. }
  18526. function uploadCloudFiles(files) {
  18527. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  18528. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  18529. files = JSON.parse(JSON.stringify(files));
  18530. var len = files.length;
  18531. var count = 0;
  18532. var self = this;
  18533. return new Promise(function (resolve) {
  18534. while (count < max) {
  18535. next();
  18536. }
  18537. function next() {
  18538. var cur = count++;
  18539. if (cur >= len) {
  18540. !files.find(function (item) {
  18541. return !item.url && !item.errMsg;
  18542. }) && resolve(files);
  18543. return;
  18544. }
  18545. var fileItem = files[cur];
  18546. var index = self.files.findIndex(function (v) {
  18547. return v.uuid === fileItem.uuid;
  18548. });
  18549. fileItem.url = '';
  18550. delete fileItem.errMsg;
  18551. uniCloud.uploadFile({
  18552. filePath: fileItem.path,
  18553. cloudPath: fileItem.cloudPath,
  18554. fileType: fileItem.fileType,
  18555. onUploadProgress: function onUploadProgress(res) {
  18556. res.index = index;
  18557. _onUploadProgress && _onUploadProgress(res);
  18558. }
  18559. }).then(function (res) {
  18560. fileItem.url = res.fileID;
  18561. fileItem.index = index;
  18562. if (cur < len) {
  18563. next();
  18564. }
  18565. }).catch(function (res) {
  18566. fileItem.errMsg = res.errMsg || res.message;
  18567. fileItem.index = index;
  18568. if (cur < len) {
  18569. next();
  18570. }
  18571. });
  18572. }
  18573. });
  18574. }
  18575. function uploadFiles(choosePromise, _ref) {
  18576. var onChooseFile = _ref.onChooseFile,
  18577. onUploadProgress = _ref.onUploadProgress;
  18578. return choosePromise.then(function (res) {
  18579. if (onChooseFile) {
  18580. var customChooseRes = onChooseFile(res);
  18581. if (typeof customChooseRes !== 'undefined') {
  18582. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  18583. return typeof chooseRes === 'undefined' ? res : chooseRes;
  18584. });
  18585. }
  18586. }
  18587. return res;
  18588. }).then(function (res) {
  18589. if (res === false) {
  18590. return {
  18591. errMsg: ERR_MSG_OK,
  18592. tempFilePaths: [],
  18593. tempFiles: []
  18594. };
  18595. }
  18596. return res;
  18597. });
  18598. }
  18599. function chooseAndUploadFile() {
  18600. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  18601. type: 'all'
  18602. };
  18603. if (opts.type === 'image') {
  18604. return uploadFiles(chooseImage(opts), opts);
  18605. } else if (opts.type === 'video') {
  18606. return uploadFiles(chooseVideo(opts), opts);
  18607. }
  18608. return uploadFiles(chooseAll(opts), opts);
  18609. }
  18610. /* 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 */ 272)["default"]))
  18611. /***/ }),
  18612. /***/ 311:
  18613. /*!***************************************************************************************************************!*\
  18614. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  18615. \***************************************************************************************************************/
  18616. /*! no static exports found */
  18617. /***/ (function(module, exports, __webpack_require__) {
  18618. "use strict";
  18619. /* WEBPACK VAR INJECTION */(function(uni) {
  18620. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18621. Object.defineProperty(exports, "__esModule", {
  18622. value: true
  18623. });
  18624. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  18625. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  18626. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  18627. /**
  18628. * 获取文件名和后缀
  18629. * @param {String} name
  18630. */
  18631. var get_file_ext = function get_file_ext(name) {
  18632. var last_len = name.lastIndexOf('.');
  18633. var len = name.length;
  18634. return {
  18635. name: name.substring(0, last_len),
  18636. ext: name.substring(last_len + 1, len)
  18637. };
  18638. };
  18639. /**
  18640. * 获取扩展名
  18641. * @param {Array} fileExtname
  18642. */
  18643. exports.get_file_ext = get_file_ext;
  18644. var get_extname = function get_extname(fileExtname) {
  18645. if (!Array.isArray(fileExtname)) {
  18646. var extname = fileExtname.replace(/(\[|\])/g, '');
  18647. return extname.split(',');
  18648. } else {
  18649. return fileExtname;
  18650. }
  18651. return [];
  18652. };
  18653. /**
  18654. * 获取文件和检测是否可选
  18655. */
  18656. exports.get_extname = get_extname;
  18657. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  18658. var filePaths = [];
  18659. var files = [];
  18660. if (!_extname || _extname.length === 0) {
  18661. return {
  18662. filePaths: filePaths,
  18663. files: files
  18664. };
  18665. }
  18666. res.tempFiles.forEach(function (v) {
  18667. var fileFullName = get_file_ext(v.name);
  18668. var extname = fileFullName.ext.toLowerCase();
  18669. if (_extname.indexOf(extname) !== -1) {
  18670. files.push(v);
  18671. filePaths.push(v.path);
  18672. }
  18673. });
  18674. if (files.length !== res.tempFiles.length) {
  18675. uni.showToast({
  18676. 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"),
  18677. icon: 'none',
  18678. duration: 5000
  18679. });
  18680. }
  18681. return {
  18682. filePaths: filePaths,
  18683. files: files
  18684. };
  18685. };
  18686. /**
  18687. * 获取图片信息
  18688. * @param {Object} filepath
  18689. */
  18690. exports.get_files_and_is_max = get_files_and_is_max;
  18691. var get_file_info = function get_file_info(filepath) {
  18692. return new Promise(function (resolve, reject) {
  18693. uni.getImageInfo({
  18694. src: filepath,
  18695. success: function success(res) {
  18696. resolve(res);
  18697. },
  18698. fail: function fail(err) {
  18699. reject(err);
  18700. }
  18701. });
  18702. });
  18703. };
  18704. /**
  18705. * 获取封装数据
  18706. */
  18707. exports.get_file_info = get_file_info;
  18708. var get_file_data = /*#__PURE__*/function () {
  18709. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  18710. var type,
  18711. fileFullName,
  18712. extname,
  18713. filedata,
  18714. imageinfo,
  18715. _args = arguments;
  18716. return _regenerator.default.wrap(function _callee$(_context) {
  18717. while (1) {
  18718. switch (_context.prev = _context.next) {
  18719. case 0:
  18720. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  18721. // 最终需要上传数据库的数据
  18722. fileFullName = get_file_ext(files.name);
  18723. extname = fileFullName.ext.toLowerCase();
  18724. filedata = {
  18725. name: files.name,
  18726. uuid: files.uuid,
  18727. extname: extname || '',
  18728. cloudPath: files.cloudPath,
  18729. fileType: files.fileType,
  18730. url: files.path || files.path,
  18731. size: files.size,
  18732. //单位是字节
  18733. image: {},
  18734. path: files.path,
  18735. video: {}
  18736. };
  18737. if (!(type === 'image')) {
  18738. _context.next = 14;
  18739. break;
  18740. }
  18741. _context.next = 7;
  18742. return get_file_info(files.path);
  18743. case 7:
  18744. imageinfo = _context.sent;
  18745. delete filedata.video;
  18746. filedata.image.width = imageinfo.width;
  18747. filedata.image.height = imageinfo.height;
  18748. filedata.image.location = imageinfo.path;
  18749. _context.next = 15;
  18750. break;
  18751. case 14:
  18752. delete filedata.image;
  18753. case 15:
  18754. return _context.abrupt("return", filedata);
  18755. case 16:
  18756. case "end":
  18757. return _context.stop();
  18758. }
  18759. }
  18760. }, _callee);
  18761. }));
  18762. return function get_file_data(_x) {
  18763. return _ref.apply(this, arguments);
  18764. };
  18765. }();
  18766. exports.get_file_data = get_file_data;
  18767. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18768. /***/ }),
  18769. /***/ 32:
  18770. /*!**********************************************************************************************************!*\
  18771. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  18772. \**********************************************************************************************************/
  18773. /*! exports provided: default */
  18774. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18775. "use strict";
  18776. __webpack_require__.r(__webpack_exports__);
  18777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  18778. /* globals __VUE_SSR_CONTEXT__ */
  18779. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  18780. // This module is a runtime utility for cleaner component module output and will
  18781. // be included in the final webpack user bundle.
  18782. function normalizeComponent (
  18783. scriptExports,
  18784. render,
  18785. staticRenderFns,
  18786. functionalTemplate,
  18787. injectStyles,
  18788. scopeId,
  18789. moduleIdentifier, /* server only */
  18790. shadowMode, /* vue-cli only */
  18791. components, // fixed by xxxxxx auto components
  18792. renderjs // fixed by xxxxxx renderjs
  18793. ) {
  18794. // Vue.extend constructor export interop
  18795. var options = typeof scriptExports === 'function'
  18796. ? scriptExports.options
  18797. : scriptExports
  18798. // fixed by xxxxxx auto components
  18799. if (components) {
  18800. if (!options.components) {
  18801. options.components = {}
  18802. }
  18803. var hasOwn = Object.prototype.hasOwnProperty
  18804. for (var name in components) {
  18805. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  18806. options.components[name] = components[name]
  18807. }
  18808. }
  18809. }
  18810. // fixed by xxxxxx renderjs
  18811. if (renderjs) {
  18812. if(typeof renderjs.beforeCreate === 'function'){
  18813. renderjs.beforeCreate = [renderjs.beforeCreate]
  18814. }
  18815. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  18816. this[renderjs.__module] = this
  18817. });
  18818. (options.mixins || (options.mixins = [])).push(renderjs)
  18819. }
  18820. // render functions
  18821. if (render) {
  18822. options.render = render
  18823. options.staticRenderFns = staticRenderFns
  18824. options._compiled = true
  18825. }
  18826. // functional template
  18827. if (functionalTemplate) {
  18828. options.functional = true
  18829. }
  18830. // scopedId
  18831. if (scopeId) {
  18832. options._scopeId = 'data-v-' + scopeId
  18833. }
  18834. var hook
  18835. if (moduleIdentifier) { // server build
  18836. hook = function (context) {
  18837. // 2.3 injection
  18838. context =
  18839. context || // cached call
  18840. (this.$vnode && this.$vnode.ssrContext) || // stateful
  18841. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  18842. // 2.2 with runInNewContext: true
  18843. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  18844. context = __VUE_SSR_CONTEXT__
  18845. }
  18846. // inject component styles
  18847. if (injectStyles) {
  18848. injectStyles.call(this, context)
  18849. }
  18850. // register component module identifier for async chunk inferrence
  18851. if (context && context._registeredComponents) {
  18852. context._registeredComponents.add(moduleIdentifier)
  18853. }
  18854. }
  18855. // used by ssr in case component is cached and beforeCreate
  18856. // never gets called
  18857. options._ssrRegister = hook
  18858. } else if (injectStyles) {
  18859. hook = shadowMode
  18860. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  18861. : injectStyles
  18862. }
  18863. if (hook) {
  18864. if (options.functional) {
  18865. // for template-only hot-reload because in that case the render fn doesn't
  18866. // go through the normalizer
  18867. options._injectStyles = hook
  18868. // register for functioal component in vue file
  18869. var originalRender = options.render
  18870. options.render = function renderWithStyleInjection (h, context) {
  18871. hook.call(context)
  18872. return originalRender(h, context)
  18873. }
  18874. } else {
  18875. // inject component registration as beforeCreate hook
  18876. var existing = options.beforeCreate
  18877. options.beforeCreate = existing
  18878. ? [].concat(existing, hook)
  18879. : [hook]
  18880. }
  18881. }
  18882. return {
  18883. exports: scriptExports,
  18884. options: options
  18885. }
  18886. }
  18887. /***/ }),
  18888. /***/ 33:
  18889. /*!************************************************************************!*\
  18890. !*** E:/work/Project_newGit/hptwxMiniProgram/uni.promisify.adaptor.js ***!
  18891. \************************************************************************/
  18892. /*! no static exports found */
  18893. /***/ (function(module, exports, __webpack_require__) {
  18894. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  18895. uni.addInterceptor({
  18896. returnValue: function returnValue(res) {
  18897. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  18898. return res;
  18899. }
  18900. return new Promise(function (resolve, reject) {
  18901. res.then(function (res) {
  18902. return res[0] ? reject(res[0]) : resolve(res[1]);
  18903. });
  18904. });
  18905. }
  18906. });
  18907. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18908. /***/ }),
  18909. /***/ 354:
  18910. /*!***************************************************************************************************!*\
  18911. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  18912. \***************************************************************************************************/
  18913. /*! no static exports found */
  18914. /***/ (function(module, exports, __webpack_require__) {
  18915. "use strict";
  18916. Object.defineProperty(exports, "__esModule", {
  18917. value: true
  18918. });
  18919. exports.default = void 0;
  18920. var _default = {
  18921. "id": "2852637",
  18922. "name": "uniui图标库",
  18923. "font_family": "uniicons",
  18924. "css_prefix_text": "uniui-",
  18925. "description": "",
  18926. "glyphs": [{
  18927. "icon_id": "25027049",
  18928. "name": "yanse",
  18929. "font_class": "color",
  18930. "unicode": "e6cf",
  18931. "unicode_decimal": 59087
  18932. }, {
  18933. "icon_id": "25027048",
  18934. "name": "wallet",
  18935. "font_class": "wallet",
  18936. "unicode": "e6b1",
  18937. "unicode_decimal": 59057
  18938. }, {
  18939. "icon_id": "25015720",
  18940. "name": "settings-filled",
  18941. "font_class": "settings-filled",
  18942. "unicode": "e6ce",
  18943. "unicode_decimal": 59086
  18944. }, {
  18945. "icon_id": "25015434",
  18946. "name": "shimingrenzheng-filled",
  18947. "font_class": "auth-filled",
  18948. "unicode": "e6cc",
  18949. "unicode_decimal": 59084
  18950. }, {
  18951. "icon_id": "24934246",
  18952. "name": "shop-filled",
  18953. "font_class": "shop-filled",
  18954. "unicode": "e6cd",
  18955. "unicode_decimal": 59085
  18956. }, {
  18957. "icon_id": "24934159",
  18958. "name": "staff-filled-01",
  18959. "font_class": "staff-filled",
  18960. "unicode": "e6cb",
  18961. "unicode_decimal": 59083
  18962. }, {
  18963. "icon_id": "24932461",
  18964. "name": "VIP-filled",
  18965. "font_class": "vip-filled",
  18966. "unicode": "e6c6",
  18967. "unicode_decimal": 59078
  18968. }, {
  18969. "icon_id": "24932462",
  18970. "name": "plus_circle_fill",
  18971. "font_class": "plus-filled",
  18972. "unicode": "e6c7",
  18973. "unicode_decimal": 59079
  18974. }, {
  18975. "icon_id": "24932463",
  18976. "name": "folder_add-filled",
  18977. "font_class": "folder-add-filled",
  18978. "unicode": "e6c8",
  18979. "unicode_decimal": 59080
  18980. }, {
  18981. "icon_id": "24932464",
  18982. "name": "yanse-filled",
  18983. "font_class": "color-filled",
  18984. "unicode": "e6c9",
  18985. "unicode_decimal": 59081
  18986. }, {
  18987. "icon_id": "24932465",
  18988. "name": "tune-filled",
  18989. "font_class": "tune-filled",
  18990. "unicode": "e6ca",
  18991. "unicode_decimal": 59082
  18992. }, {
  18993. "icon_id": "24932455",
  18994. "name": "a-rilidaka-filled",
  18995. "font_class": "calendar-filled",
  18996. "unicode": "e6c0",
  18997. "unicode_decimal": 59072
  18998. }, {
  18999. "icon_id": "24932456",
  19000. "name": "notification-filled",
  19001. "font_class": "notification-filled",
  19002. "unicode": "e6c1",
  19003. "unicode_decimal": 59073
  19004. }, {
  19005. "icon_id": "24932457",
  19006. "name": "wallet-filled",
  19007. "font_class": "wallet-filled",
  19008. "unicode": "e6c2",
  19009. "unicode_decimal": 59074
  19010. }, {
  19011. "icon_id": "24932458",
  19012. "name": "paihangbang-filled",
  19013. "font_class": "medal-filled",
  19014. "unicode": "e6c3",
  19015. "unicode_decimal": 59075
  19016. }, {
  19017. "icon_id": "24932459",
  19018. "name": "gift-filled",
  19019. "font_class": "gift-filled",
  19020. "unicode": "e6c4",
  19021. "unicode_decimal": 59076
  19022. }, {
  19023. "icon_id": "24932460",
  19024. "name": "fire-filled",
  19025. "font_class": "fire-filled",
  19026. "unicode": "e6c5",
  19027. "unicode_decimal": 59077
  19028. }, {
  19029. "icon_id": "24928001",
  19030. "name": "refreshempty",
  19031. "font_class": "refreshempty",
  19032. "unicode": "e6bf",
  19033. "unicode_decimal": 59071
  19034. }, {
  19035. "icon_id": "24926853",
  19036. "name": "location-ellipse",
  19037. "font_class": "location-filled",
  19038. "unicode": "e6af",
  19039. "unicode_decimal": 59055
  19040. }, {
  19041. "icon_id": "24926735",
  19042. "name": "person-filled",
  19043. "font_class": "person-filled",
  19044. "unicode": "e69d",
  19045. "unicode_decimal": 59037
  19046. }, {
  19047. "icon_id": "24926703",
  19048. "name": "personadd-filled",
  19049. "font_class": "personadd-filled",
  19050. "unicode": "e698",
  19051. "unicode_decimal": 59032
  19052. }, {
  19053. "icon_id": "24923351",
  19054. "name": "back",
  19055. "font_class": "back",
  19056. "unicode": "e6b9",
  19057. "unicode_decimal": 59065
  19058. }, {
  19059. "icon_id": "24923352",
  19060. "name": "forward",
  19061. "font_class": "forward",
  19062. "unicode": "e6ba",
  19063. "unicode_decimal": 59066
  19064. }, {
  19065. "icon_id": "24923353",
  19066. "name": "arrowthinright",
  19067. "font_class": "arrow-right",
  19068. "unicode": "e6bb",
  19069. "unicode_decimal": 59067
  19070. }, {
  19071. "icon_id": "24923353",
  19072. "name": "arrowthinright",
  19073. "font_class": "arrowthinright",
  19074. "unicode": "e6bb",
  19075. "unicode_decimal": 59067
  19076. }, {
  19077. "icon_id": "24923354",
  19078. "name": "arrowthinleft",
  19079. "font_class": "arrow-left",
  19080. "unicode": "e6bc",
  19081. "unicode_decimal": 59068
  19082. }, {
  19083. "icon_id": "24923354",
  19084. "name": "arrowthinleft",
  19085. "font_class": "arrowthinleft",
  19086. "unicode": "e6bc",
  19087. "unicode_decimal": 59068
  19088. }, {
  19089. "icon_id": "24923355",
  19090. "name": "arrowthinup",
  19091. "font_class": "arrow-up",
  19092. "unicode": "e6bd",
  19093. "unicode_decimal": 59069
  19094. }, {
  19095. "icon_id": "24923355",
  19096. "name": "arrowthinup",
  19097. "font_class": "arrowthinup",
  19098. "unicode": "e6bd",
  19099. "unicode_decimal": 59069
  19100. }, {
  19101. "icon_id": "24923356",
  19102. "name": "arrowthindown",
  19103. "font_class": "arrow-down",
  19104. "unicode": "e6be",
  19105. "unicode_decimal": 59070
  19106. }, {
  19107. "icon_id": "24923356",
  19108. "name": "arrowthindown",
  19109. "font_class": "arrowthindown",
  19110. "unicode": "e6be",
  19111. "unicode_decimal": 59070
  19112. }, {
  19113. "icon_id": "24923349",
  19114. "name": "arrowdown",
  19115. "font_class": "bottom",
  19116. "unicode": "e6b8",
  19117. "unicode_decimal": 59064
  19118. }, {
  19119. "icon_id": "24923349",
  19120. "name": "arrowdown",
  19121. "font_class": "arrowdown",
  19122. "unicode": "e6b8",
  19123. "unicode_decimal": 59064
  19124. }, {
  19125. "icon_id": "24923346",
  19126. "name": "arrowright",
  19127. "font_class": "right",
  19128. "unicode": "e6b5",
  19129. "unicode_decimal": 59061
  19130. }, {
  19131. "icon_id": "24923346",
  19132. "name": "arrowright",
  19133. "font_class": "arrowright",
  19134. "unicode": "e6b5",
  19135. "unicode_decimal": 59061
  19136. }, {
  19137. "icon_id": "24923347",
  19138. "name": "arrowup",
  19139. "font_class": "top",
  19140. "unicode": "e6b6",
  19141. "unicode_decimal": 59062
  19142. }, {
  19143. "icon_id": "24923347",
  19144. "name": "arrowup",
  19145. "font_class": "arrowup",
  19146. "unicode": "e6b6",
  19147. "unicode_decimal": 59062
  19148. }, {
  19149. "icon_id": "24923348",
  19150. "name": "arrowleft",
  19151. "font_class": "left",
  19152. "unicode": "e6b7",
  19153. "unicode_decimal": 59063
  19154. }, {
  19155. "icon_id": "24923348",
  19156. "name": "arrowleft",
  19157. "font_class": "arrowleft",
  19158. "unicode": "e6b7",
  19159. "unicode_decimal": 59063
  19160. }, {
  19161. "icon_id": "24923334",
  19162. "name": "eye",
  19163. "font_class": "eye",
  19164. "unicode": "e651",
  19165. "unicode_decimal": 58961
  19166. }, {
  19167. "icon_id": "24923335",
  19168. "name": "eye-filled",
  19169. "font_class": "eye-filled",
  19170. "unicode": "e66a",
  19171. "unicode_decimal": 58986
  19172. }, {
  19173. "icon_id": "24923336",
  19174. "name": "eye-slash",
  19175. "font_class": "eye-slash",
  19176. "unicode": "e6b3",
  19177. "unicode_decimal": 59059
  19178. }, {
  19179. "icon_id": "24923337",
  19180. "name": "eye-slash-filled",
  19181. "font_class": "eye-slash-filled",
  19182. "unicode": "e6b4",
  19183. "unicode_decimal": 59060
  19184. }, {
  19185. "icon_id": "24923305",
  19186. "name": "info-filled",
  19187. "font_class": "info-filled",
  19188. "unicode": "e649",
  19189. "unicode_decimal": 58953
  19190. }, {
  19191. "icon_id": "24923299",
  19192. "name": "reload-01",
  19193. "font_class": "reload",
  19194. "unicode": "e6b2",
  19195. "unicode_decimal": 59058
  19196. }, {
  19197. "icon_id": "24923195",
  19198. "name": "mic_slash_fill",
  19199. "font_class": "micoff-filled",
  19200. "unicode": "e6b0",
  19201. "unicode_decimal": 59056
  19202. }, {
  19203. "icon_id": "24923165",
  19204. "name": "map-pin-ellipse",
  19205. "font_class": "map-pin-ellipse",
  19206. "unicode": "e6ac",
  19207. "unicode_decimal": 59052
  19208. }, {
  19209. "icon_id": "24923166",
  19210. "name": "map-pin",
  19211. "font_class": "map-pin",
  19212. "unicode": "e6ad",
  19213. "unicode_decimal": 59053
  19214. }, {
  19215. "icon_id": "24923167",
  19216. "name": "location",
  19217. "font_class": "location",
  19218. "unicode": "e6ae",
  19219. "unicode_decimal": 59054
  19220. }, {
  19221. "icon_id": "24923064",
  19222. "name": "starhalf",
  19223. "font_class": "starhalf",
  19224. "unicode": "e683",
  19225. "unicode_decimal": 59011
  19226. }, {
  19227. "icon_id": "24923065",
  19228. "name": "star",
  19229. "font_class": "star",
  19230. "unicode": "e688",
  19231. "unicode_decimal": 59016
  19232. }, {
  19233. "icon_id": "24923066",
  19234. "name": "star-filled",
  19235. "font_class": "star-filled",
  19236. "unicode": "e68f",
  19237. "unicode_decimal": 59023
  19238. }, {
  19239. "icon_id": "24899646",
  19240. "name": "a-rilidaka",
  19241. "font_class": "calendar",
  19242. "unicode": "e6a0",
  19243. "unicode_decimal": 59040
  19244. }, {
  19245. "icon_id": "24899647",
  19246. "name": "fire",
  19247. "font_class": "fire",
  19248. "unicode": "e6a1",
  19249. "unicode_decimal": 59041
  19250. }, {
  19251. "icon_id": "24899648",
  19252. "name": "paihangbang",
  19253. "font_class": "medal",
  19254. "unicode": "e6a2",
  19255. "unicode_decimal": 59042
  19256. }, {
  19257. "icon_id": "24899649",
  19258. "name": "font",
  19259. "font_class": "font",
  19260. "unicode": "e6a3",
  19261. "unicode_decimal": 59043
  19262. }, {
  19263. "icon_id": "24899650",
  19264. "name": "gift",
  19265. "font_class": "gift",
  19266. "unicode": "e6a4",
  19267. "unicode_decimal": 59044
  19268. }, {
  19269. "icon_id": "24899651",
  19270. "name": "link",
  19271. "font_class": "link",
  19272. "unicode": "e6a5",
  19273. "unicode_decimal": 59045
  19274. }, {
  19275. "icon_id": "24899652",
  19276. "name": "notification",
  19277. "font_class": "notification",
  19278. "unicode": "e6a6",
  19279. "unicode_decimal": 59046
  19280. }, {
  19281. "icon_id": "24899653",
  19282. "name": "staff",
  19283. "font_class": "staff",
  19284. "unicode": "e6a7",
  19285. "unicode_decimal": 59047
  19286. }, {
  19287. "icon_id": "24899654",
  19288. "name": "VIP",
  19289. "font_class": "vip",
  19290. "unicode": "e6a8",
  19291. "unicode_decimal": 59048
  19292. }, {
  19293. "icon_id": "24899655",
  19294. "name": "folder_add",
  19295. "font_class": "folder-add",
  19296. "unicode": "e6a9",
  19297. "unicode_decimal": 59049
  19298. }, {
  19299. "icon_id": "24899656",
  19300. "name": "tune",
  19301. "font_class": "tune",
  19302. "unicode": "e6aa",
  19303. "unicode_decimal": 59050
  19304. }, {
  19305. "icon_id": "24899657",
  19306. "name": "shimingrenzheng",
  19307. "font_class": "auth",
  19308. "unicode": "e6ab",
  19309. "unicode_decimal": 59051
  19310. }, {
  19311. "icon_id": "24899565",
  19312. "name": "person",
  19313. "font_class": "person",
  19314. "unicode": "e699",
  19315. "unicode_decimal": 59033
  19316. }, {
  19317. "icon_id": "24899566",
  19318. "name": "email-filled",
  19319. "font_class": "email-filled",
  19320. "unicode": "e69a",
  19321. "unicode_decimal": 59034
  19322. }, {
  19323. "icon_id": "24899567",
  19324. "name": "phone-filled",
  19325. "font_class": "phone-filled",
  19326. "unicode": "e69b",
  19327. "unicode_decimal": 59035
  19328. }, {
  19329. "icon_id": "24899568",
  19330. "name": "phone",
  19331. "font_class": "phone",
  19332. "unicode": "e69c",
  19333. "unicode_decimal": 59036
  19334. }, {
  19335. "icon_id": "24899570",
  19336. "name": "email",
  19337. "font_class": "email",
  19338. "unicode": "e69e",
  19339. "unicode_decimal": 59038
  19340. }, {
  19341. "icon_id": "24899571",
  19342. "name": "personadd",
  19343. "font_class": "personadd",
  19344. "unicode": "e69f",
  19345. "unicode_decimal": 59039
  19346. }, {
  19347. "icon_id": "24899558",
  19348. "name": "chatboxes-filled",
  19349. "font_class": "chatboxes-filled",
  19350. "unicode": "e692",
  19351. "unicode_decimal": 59026
  19352. }, {
  19353. "icon_id": "24899559",
  19354. "name": "contact",
  19355. "font_class": "contact",
  19356. "unicode": "e693",
  19357. "unicode_decimal": 59027
  19358. }, {
  19359. "icon_id": "24899560",
  19360. "name": "chatbubble-filled",
  19361. "font_class": "chatbubble-filled",
  19362. "unicode": "e694",
  19363. "unicode_decimal": 59028
  19364. }, {
  19365. "icon_id": "24899561",
  19366. "name": "contact-filled",
  19367. "font_class": "contact-filled",
  19368. "unicode": "e695",
  19369. "unicode_decimal": 59029
  19370. }, {
  19371. "icon_id": "24899562",
  19372. "name": "chatboxes",
  19373. "font_class": "chatboxes",
  19374. "unicode": "e696",
  19375. "unicode_decimal": 59030
  19376. }, {
  19377. "icon_id": "24899563",
  19378. "name": "chatbubble",
  19379. "font_class": "chatbubble",
  19380. "unicode": "e697",
  19381. "unicode_decimal": 59031
  19382. }, {
  19383. "icon_id": "24881290",
  19384. "name": "upload-filled",
  19385. "font_class": "upload-filled",
  19386. "unicode": "e68e",
  19387. "unicode_decimal": 59022
  19388. }, {
  19389. "icon_id": "24881292",
  19390. "name": "upload",
  19391. "font_class": "upload",
  19392. "unicode": "e690",
  19393. "unicode_decimal": 59024
  19394. }, {
  19395. "icon_id": "24881293",
  19396. "name": "weixin",
  19397. "font_class": "weixin",
  19398. "unicode": "e691",
  19399. "unicode_decimal": 59025
  19400. }, {
  19401. "icon_id": "24881274",
  19402. "name": "compose",
  19403. "font_class": "compose",
  19404. "unicode": "e67f",
  19405. "unicode_decimal": 59007
  19406. }, {
  19407. "icon_id": "24881275",
  19408. "name": "qq",
  19409. "font_class": "qq",
  19410. "unicode": "e680",
  19411. "unicode_decimal": 59008
  19412. }, {
  19413. "icon_id": "24881276",
  19414. "name": "download-filled",
  19415. "font_class": "download-filled",
  19416. "unicode": "e681",
  19417. "unicode_decimal": 59009
  19418. }, {
  19419. "icon_id": "24881277",
  19420. "name": "pengyouquan",
  19421. "font_class": "pyq",
  19422. "unicode": "e682",
  19423. "unicode_decimal": 59010
  19424. }, {
  19425. "icon_id": "24881279",
  19426. "name": "sound",
  19427. "font_class": "sound",
  19428. "unicode": "e684",
  19429. "unicode_decimal": 59012
  19430. }, {
  19431. "icon_id": "24881280",
  19432. "name": "trash-filled",
  19433. "font_class": "trash-filled",
  19434. "unicode": "e685",
  19435. "unicode_decimal": 59013
  19436. }, {
  19437. "icon_id": "24881281",
  19438. "name": "sound-filled",
  19439. "font_class": "sound-filled",
  19440. "unicode": "e686",
  19441. "unicode_decimal": 59014
  19442. }, {
  19443. "icon_id": "24881282",
  19444. "name": "trash",
  19445. "font_class": "trash",
  19446. "unicode": "e687",
  19447. "unicode_decimal": 59015
  19448. }, {
  19449. "icon_id": "24881284",
  19450. "name": "videocam-filled",
  19451. "font_class": "videocam-filled",
  19452. "unicode": "e689",
  19453. "unicode_decimal": 59017
  19454. }, {
  19455. "icon_id": "24881285",
  19456. "name": "spinner-cycle",
  19457. "font_class": "spinner-cycle",
  19458. "unicode": "e68a",
  19459. "unicode_decimal": 59018
  19460. }, {
  19461. "icon_id": "24881286",
  19462. "name": "weibo",
  19463. "font_class": "weibo",
  19464. "unicode": "e68b",
  19465. "unicode_decimal": 59019
  19466. }, {
  19467. "icon_id": "24881288",
  19468. "name": "videocam",
  19469. "font_class": "videocam",
  19470. "unicode": "e68c",
  19471. "unicode_decimal": 59020
  19472. }, {
  19473. "icon_id": "24881289",
  19474. "name": "download",
  19475. "font_class": "download",
  19476. "unicode": "e68d",
  19477. "unicode_decimal": 59021
  19478. }, {
  19479. "icon_id": "24879601",
  19480. "name": "help",
  19481. "font_class": "help",
  19482. "unicode": "e679",
  19483. "unicode_decimal": 59001
  19484. }, {
  19485. "icon_id": "24879602",
  19486. "name": "navigate-filled",
  19487. "font_class": "navigate-filled",
  19488. "unicode": "e67a",
  19489. "unicode_decimal": 59002
  19490. }, {
  19491. "icon_id": "24879603",
  19492. "name": "plusempty",
  19493. "font_class": "plusempty",
  19494. "unicode": "e67b",
  19495. "unicode_decimal": 59003
  19496. }, {
  19497. "icon_id": "24879604",
  19498. "name": "smallcircle",
  19499. "font_class": "smallcircle",
  19500. "unicode": "e67c",
  19501. "unicode_decimal": 59004
  19502. }, {
  19503. "icon_id": "24879605",
  19504. "name": "minus-filled",
  19505. "font_class": "minus-filled",
  19506. "unicode": "e67d",
  19507. "unicode_decimal": 59005
  19508. }, {
  19509. "icon_id": "24879606",
  19510. "name": "micoff",
  19511. "font_class": "micoff",
  19512. "unicode": "e67e",
  19513. "unicode_decimal": 59006
  19514. }, {
  19515. "icon_id": "24879588",
  19516. "name": "closeempty",
  19517. "font_class": "closeempty",
  19518. "unicode": "e66c",
  19519. "unicode_decimal": 58988
  19520. }, {
  19521. "icon_id": "24879589",
  19522. "name": "clear",
  19523. "font_class": "clear",
  19524. "unicode": "e66d",
  19525. "unicode_decimal": 58989
  19526. }, {
  19527. "icon_id": "24879590",
  19528. "name": "navigate",
  19529. "font_class": "navigate",
  19530. "unicode": "e66e",
  19531. "unicode_decimal": 58990
  19532. }, {
  19533. "icon_id": "24879591",
  19534. "name": "minus",
  19535. "font_class": "minus",
  19536. "unicode": "e66f",
  19537. "unicode_decimal": 58991
  19538. }, {
  19539. "icon_id": "24879592",
  19540. "name": "image",
  19541. "font_class": "image",
  19542. "unicode": "e670",
  19543. "unicode_decimal": 58992
  19544. }, {
  19545. "icon_id": "24879593",
  19546. "name": "mic",
  19547. "font_class": "mic",
  19548. "unicode": "e671",
  19549. "unicode_decimal": 58993
  19550. }, {
  19551. "icon_id": "24879594",
  19552. "name": "paperplane",
  19553. "font_class": "paperplane",
  19554. "unicode": "e672",
  19555. "unicode_decimal": 58994
  19556. }, {
  19557. "icon_id": "24879595",
  19558. "name": "close",
  19559. "font_class": "close",
  19560. "unicode": "e673",
  19561. "unicode_decimal": 58995
  19562. }, {
  19563. "icon_id": "24879596",
  19564. "name": "help-filled",
  19565. "font_class": "help-filled",
  19566. "unicode": "e674",
  19567. "unicode_decimal": 58996
  19568. }, {
  19569. "icon_id": "24879597",
  19570. "name": "plus-filled",
  19571. "font_class": "paperplane-filled",
  19572. "unicode": "e675",
  19573. "unicode_decimal": 58997
  19574. }, {
  19575. "icon_id": "24879598",
  19576. "name": "plus",
  19577. "font_class": "plus",
  19578. "unicode": "e676",
  19579. "unicode_decimal": 58998
  19580. }, {
  19581. "icon_id": "24879599",
  19582. "name": "mic-filled",
  19583. "font_class": "mic-filled",
  19584. "unicode": "e677",
  19585. "unicode_decimal": 58999
  19586. }, {
  19587. "icon_id": "24879600",
  19588. "name": "image-filled",
  19589. "font_class": "image-filled",
  19590. "unicode": "e678",
  19591. "unicode_decimal": 59000
  19592. }, {
  19593. "icon_id": "24855900",
  19594. "name": "locked-filled",
  19595. "font_class": "locked-filled",
  19596. "unicode": "e668",
  19597. "unicode_decimal": 58984
  19598. }, {
  19599. "icon_id": "24855901",
  19600. "name": "info",
  19601. "font_class": "info",
  19602. "unicode": "e669",
  19603. "unicode_decimal": 58985
  19604. }, {
  19605. "icon_id": "24855903",
  19606. "name": "locked",
  19607. "font_class": "locked",
  19608. "unicode": "e66b",
  19609. "unicode_decimal": 58987
  19610. }, {
  19611. "icon_id": "24855884",
  19612. "name": "camera-filled",
  19613. "font_class": "camera-filled",
  19614. "unicode": "e658",
  19615. "unicode_decimal": 58968
  19616. }, {
  19617. "icon_id": "24855885",
  19618. "name": "chat-filled",
  19619. "font_class": "chat-filled",
  19620. "unicode": "e659",
  19621. "unicode_decimal": 58969
  19622. }, {
  19623. "icon_id": "24855886",
  19624. "name": "camera",
  19625. "font_class": "camera",
  19626. "unicode": "e65a",
  19627. "unicode_decimal": 58970
  19628. }, {
  19629. "icon_id": "24855887",
  19630. "name": "circle",
  19631. "font_class": "circle",
  19632. "unicode": "e65b",
  19633. "unicode_decimal": 58971
  19634. }, {
  19635. "icon_id": "24855888",
  19636. "name": "checkmarkempty",
  19637. "font_class": "checkmarkempty",
  19638. "unicode": "e65c",
  19639. "unicode_decimal": 58972
  19640. }, {
  19641. "icon_id": "24855889",
  19642. "name": "chat",
  19643. "font_class": "chat",
  19644. "unicode": "e65d",
  19645. "unicode_decimal": 58973
  19646. }, {
  19647. "icon_id": "24855890",
  19648. "name": "circle-filled",
  19649. "font_class": "circle-filled",
  19650. "unicode": "e65e",
  19651. "unicode_decimal": 58974
  19652. }, {
  19653. "icon_id": "24855891",
  19654. "name": "flag",
  19655. "font_class": "flag",
  19656. "unicode": "e65f",
  19657. "unicode_decimal": 58975
  19658. }, {
  19659. "icon_id": "24855892",
  19660. "name": "flag-filled",
  19661. "font_class": "flag-filled",
  19662. "unicode": "e660",
  19663. "unicode_decimal": 58976
  19664. }, {
  19665. "icon_id": "24855893",
  19666. "name": "gear-filled",
  19667. "font_class": "gear-filled",
  19668. "unicode": "e661",
  19669. "unicode_decimal": 58977
  19670. }, {
  19671. "icon_id": "24855894",
  19672. "name": "home",
  19673. "font_class": "home",
  19674. "unicode": "e662",
  19675. "unicode_decimal": 58978
  19676. }, {
  19677. "icon_id": "24855895",
  19678. "name": "home-filled",
  19679. "font_class": "home-filled",
  19680. "unicode": "e663",
  19681. "unicode_decimal": 58979
  19682. }, {
  19683. "icon_id": "24855896",
  19684. "name": "gear",
  19685. "font_class": "gear",
  19686. "unicode": "e664",
  19687. "unicode_decimal": 58980
  19688. }, {
  19689. "icon_id": "24855897",
  19690. "name": "smallcircle-filled",
  19691. "font_class": "smallcircle-filled",
  19692. "unicode": "e665",
  19693. "unicode_decimal": 58981
  19694. }, {
  19695. "icon_id": "24855898",
  19696. "name": "map-filled",
  19697. "font_class": "map-filled",
  19698. "unicode": "e666",
  19699. "unicode_decimal": 58982
  19700. }, {
  19701. "icon_id": "24855899",
  19702. "name": "map",
  19703. "font_class": "map",
  19704. "unicode": "e667",
  19705. "unicode_decimal": 58983
  19706. }, {
  19707. "icon_id": "24855825",
  19708. "name": "refresh-filled",
  19709. "font_class": "refresh-filled",
  19710. "unicode": "e656",
  19711. "unicode_decimal": 58966
  19712. }, {
  19713. "icon_id": "24855826",
  19714. "name": "refresh",
  19715. "font_class": "refresh",
  19716. "unicode": "e657",
  19717. "unicode_decimal": 58967
  19718. }, {
  19719. "icon_id": "24855808",
  19720. "name": "cloud-upload",
  19721. "font_class": "cloud-upload",
  19722. "unicode": "e645",
  19723. "unicode_decimal": 58949
  19724. }, {
  19725. "icon_id": "24855809",
  19726. "name": "cloud-download-filled",
  19727. "font_class": "cloud-download-filled",
  19728. "unicode": "e646",
  19729. "unicode_decimal": 58950
  19730. }, {
  19731. "icon_id": "24855810",
  19732. "name": "cloud-download",
  19733. "font_class": "cloud-download",
  19734. "unicode": "e647",
  19735. "unicode_decimal": 58951
  19736. }, {
  19737. "icon_id": "24855811",
  19738. "name": "cloud-upload-filled",
  19739. "font_class": "cloud-upload-filled",
  19740. "unicode": "e648",
  19741. "unicode_decimal": 58952
  19742. }, {
  19743. "icon_id": "24855813",
  19744. "name": "redo",
  19745. "font_class": "redo",
  19746. "unicode": "e64a",
  19747. "unicode_decimal": 58954
  19748. }, {
  19749. "icon_id": "24855814",
  19750. "name": "images-filled",
  19751. "font_class": "images-filled",
  19752. "unicode": "e64b",
  19753. "unicode_decimal": 58955
  19754. }, {
  19755. "icon_id": "24855815",
  19756. "name": "undo-filled",
  19757. "font_class": "undo-filled",
  19758. "unicode": "e64c",
  19759. "unicode_decimal": 58956
  19760. }, {
  19761. "icon_id": "24855816",
  19762. "name": "more",
  19763. "font_class": "more",
  19764. "unicode": "e64d",
  19765. "unicode_decimal": 58957
  19766. }, {
  19767. "icon_id": "24855817",
  19768. "name": "more-filled",
  19769. "font_class": "more-filled",
  19770. "unicode": "e64e",
  19771. "unicode_decimal": 58958
  19772. }, {
  19773. "icon_id": "24855818",
  19774. "name": "undo",
  19775. "font_class": "undo",
  19776. "unicode": "e64f",
  19777. "unicode_decimal": 58959
  19778. }, {
  19779. "icon_id": "24855819",
  19780. "name": "images",
  19781. "font_class": "images",
  19782. "unicode": "e650",
  19783. "unicode_decimal": 58960
  19784. }, {
  19785. "icon_id": "24855821",
  19786. "name": "paperclip",
  19787. "font_class": "paperclip",
  19788. "unicode": "e652",
  19789. "unicode_decimal": 58962
  19790. }, {
  19791. "icon_id": "24855822",
  19792. "name": "settings",
  19793. "font_class": "settings",
  19794. "unicode": "e653",
  19795. "unicode_decimal": 58963
  19796. }, {
  19797. "icon_id": "24855823",
  19798. "name": "search",
  19799. "font_class": "search",
  19800. "unicode": "e654",
  19801. "unicode_decimal": 58964
  19802. }, {
  19803. "icon_id": "24855824",
  19804. "name": "redo-filled",
  19805. "font_class": "redo-filled",
  19806. "unicode": "e655",
  19807. "unicode_decimal": 58965
  19808. }, {
  19809. "icon_id": "24841702",
  19810. "name": "list",
  19811. "font_class": "list",
  19812. "unicode": "e644",
  19813. "unicode_decimal": 58948
  19814. }, {
  19815. "icon_id": "24841489",
  19816. "name": "mail-open-filled",
  19817. "font_class": "mail-open-filled",
  19818. "unicode": "e63a",
  19819. "unicode_decimal": 58938
  19820. }, {
  19821. "icon_id": "24841491",
  19822. "name": "hand-thumbsdown-filled",
  19823. "font_class": "hand-down-filled",
  19824. "unicode": "e63c",
  19825. "unicode_decimal": 58940
  19826. }, {
  19827. "icon_id": "24841492",
  19828. "name": "hand-thumbsdown",
  19829. "font_class": "hand-down",
  19830. "unicode": "e63d",
  19831. "unicode_decimal": 58941
  19832. }, {
  19833. "icon_id": "24841493",
  19834. "name": "hand-thumbsup-filled",
  19835. "font_class": "hand-up-filled",
  19836. "unicode": "e63e",
  19837. "unicode_decimal": 58942
  19838. }, {
  19839. "icon_id": "24841494",
  19840. "name": "hand-thumbsup",
  19841. "font_class": "hand-up",
  19842. "unicode": "e63f",
  19843. "unicode_decimal": 58943
  19844. }, {
  19845. "icon_id": "24841496",
  19846. "name": "heart-filled",
  19847. "font_class": "heart-filled",
  19848. "unicode": "e641",
  19849. "unicode_decimal": 58945
  19850. }, {
  19851. "icon_id": "24841498",
  19852. "name": "mail-open",
  19853. "font_class": "mail-open",
  19854. "unicode": "e643",
  19855. "unicode_decimal": 58947
  19856. }, {
  19857. "icon_id": "24841488",
  19858. "name": "heart",
  19859. "font_class": "heart",
  19860. "unicode": "e639",
  19861. "unicode_decimal": 58937
  19862. }, {
  19863. "icon_id": "24839963",
  19864. "name": "loop",
  19865. "font_class": "loop",
  19866. "unicode": "e633",
  19867. "unicode_decimal": 58931
  19868. }, {
  19869. "icon_id": "24839866",
  19870. "name": "pulldown",
  19871. "font_class": "pulldown",
  19872. "unicode": "e632",
  19873. "unicode_decimal": 58930
  19874. }, {
  19875. "icon_id": "24813798",
  19876. "name": "scan",
  19877. "font_class": "scan",
  19878. "unicode": "e62a",
  19879. "unicode_decimal": 58922
  19880. }, {
  19881. "icon_id": "24813786",
  19882. "name": "bars",
  19883. "font_class": "bars",
  19884. "unicode": "e627",
  19885. "unicode_decimal": 58919
  19886. }, {
  19887. "icon_id": "24813788",
  19888. "name": "cart-filled",
  19889. "font_class": "cart-filled",
  19890. "unicode": "e629",
  19891. "unicode_decimal": 58921
  19892. }, {
  19893. "icon_id": "24813790",
  19894. "name": "checkbox",
  19895. "font_class": "checkbox",
  19896. "unicode": "e62b",
  19897. "unicode_decimal": 58923
  19898. }, {
  19899. "icon_id": "24813791",
  19900. "name": "checkbox-filled",
  19901. "font_class": "checkbox-filled",
  19902. "unicode": "e62c",
  19903. "unicode_decimal": 58924
  19904. }, {
  19905. "icon_id": "24813794",
  19906. "name": "shop",
  19907. "font_class": "shop",
  19908. "unicode": "e62f",
  19909. "unicode_decimal": 58927
  19910. }, {
  19911. "icon_id": "24813795",
  19912. "name": "headphones",
  19913. "font_class": "headphones",
  19914. "unicode": "e630",
  19915. "unicode_decimal": 58928
  19916. }, {
  19917. "icon_id": "24813796",
  19918. "name": "cart",
  19919. "font_class": "cart",
  19920. "unicode": "e631",
  19921. "unicode_decimal": 58929
  19922. }]
  19923. };
  19924. exports.default = _default;
  19925. /***/ }),
  19926. /***/ 362:
  19927. /*!****************************************************************************************************************!*\
  19928. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  19929. \****************************************************************************************************************/
  19930. /*! no static exports found */
  19931. /***/ (function(module, exports, __webpack_require__) {
  19932. "use strict";
  19933. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19934. Object.defineProperty(exports, "__esModule", {
  19935. value: true
  19936. });
  19937. exports.default = void 0;
  19938. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 363));
  19939. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 364));
  19940. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 365));
  19941. var _default = {
  19942. en: _en.default,
  19943. 'zh-Hans': _zhHans.default,
  19944. 'zh-Hant': _zhHant.default
  19945. };
  19946. exports.default = _default;
  19947. /***/ }),
  19948. /***/ 363:
  19949. /*!***************************************************************************************************************!*\
  19950. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  19951. \***************************************************************************************************************/
  19952. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19953. /***/ (function(module) {
  19954. 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\"}");
  19955. /***/ }),
  19956. /***/ 364:
  19957. /*!********************************************************************************************************************!*\
  19958. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  19959. \********************************************************************************************************************/
  19960. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19961. /***/ (function(module) {
  19962. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  19963. /***/ }),
  19964. /***/ 365:
  19965. /*!********************************************************************************************************************!*\
  19966. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  19967. \********************************************************************************************************************/
  19968. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19969. /***/ (function(module) {
  19970. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  19971. /***/ }),
  19972. /***/ 4:
  19973. /*!**********************************************************************!*\
  19974. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  19975. \**********************************************************************/
  19976. /*! no static exports found */
  19977. /***/ (function(module, exports) {
  19978. function _interopRequireDefault(obj) {
  19979. return obj && obj.__esModule ? obj : {
  19980. "default": obj
  19981. };
  19982. }
  19983. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19984. /***/ }),
  19985. /***/ 40:
  19986. /*!************************************************************************************************!*\
  19987. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  19988. \************************************************************************************************/
  19989. /*! no static exports found */
  19990. /***/ (function(module, exports, __webpack_require__) {
  19991. // TODO(Babel 8): Remove this file.
  19992. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 41)();
  19993. module.exports = runtime;
  19994. /***/ }),
  19995. /***/ 41:
  19996. /*!*******************************************************************!*\
  19997. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  19998. \*******************************************************************/
  19999. /*! no static exports found */
  20000. /***/ (function(module, exports, __webpack_require__) {
  20001. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  20002. function _regeneratorRuntime() {
  20003. "use strict";
  20004. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  20005. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  20006. return exports;
  20007. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20008. var exports = {},
  20009. Op = Object.prototype,
  20010. hasOwn = Op.hasOwnProperty,
  20011. defineProperty = Object.defineProperty || function (obj, key, desc) {
  20012. obj[key] = desc.value;
  20013. },
  20014. $Symbol = "function" == typeof Symbol ? Symbol : {},
  20015. iteratorSymbol = $Symbol.iterator || "@@iterator",
  20016. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  20017. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  20018. function define(obj, key, value) {
  20019. return Object.defineProperty(obj, key, {
  20020. value: value,
  20021. enumerable: !0,
  20022. configurable: !0,
  20023. writable: !0
  20024. }), obj[key];
  20025. }
  20026. try {
  20027. define({}, "");
  20028. } catch (err) {
  20029. define = function define(obj, key, value) {
  20030. return obj[key] = value;
  20031. };
  20032. }
  20033. function wrap(innerFn, outerFn, self, tryLocsList) {
  20034. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  20035. generator = Object.create(protoGenerator.prototype),
  20036. context = new Context(tryLocsList || []);
  20037. return defineProperty(generator, "_invoke", {
  20038. value: makeInvokeMethod(innerFn, self, context)
  20039. }), generator;
  20040. }
  20041. function tryCatch(fn, obj, arg) {
  20042. try {
  20043. return {
  20044. type: "normal",
  20045. arg: fn.call(obj, arg)
  20046. };
  20047. } catch (err) {
  20048. return {
  20049. type: "throw",
  20050. arg: err
  20051. };
  20052. }
  20053. }
  20054. exports.wrap = wrap;
  20055. var ContinueSentinel = {};
  20056. function Generator() {}
  20057. function GeneratorFunction() {}
  20058. function GeneratorFunctionPrototype() {}
  20059. var IteratorPrototype = {};
  20060. define(IteratorPrototype, iteratorSymbol, function () {
  20061. return this;
  20062. });
  20063. var getProto = Object.getPrototypeOf,
  20064. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  20065. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  20066. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  20067. function defineIteratorMethods(prototype) {
  20068. ["next", "throw", "return"].forEach(function (method) {
  20069. define(prototype, method, function (arg) {
  20070. return this._invoke(method, arg);
  20071. });
  20072. });
  20073. }
  20074. function AsyncIterator(generator, PromiseImpl) {
  20075. function invoke(method, arg, resolve, reject) {
  20076. var record = tryCatch(generator[method], generator, arg);
  20077. if ("throw" !== record.type) {
  20078. var result = record.arg,
  20079. value = result.value;
  20080. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  20081. invoke("next", value, resolve, reject);
  20082. }, function (err) {
  20083. invoke("throw", err, resolve, reject);
  20084. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  20085. result.value = unwrapped, resolve(result);
  20086. }, function (error) {
  20087. return invoke("throw", error, resolve, reject);
  20088. });
  20089. }
  20090. reject(record.arg);
  20091. }
  20092. var previousPromise;
  20093. defineProperty(this, "_invoke", {
  20094. value: function value(method, arg) {
  20095. function callInvokeWithMethodAndArg() {
  20096. return new PromiseImpl(function (resolve, reject) {
  20097. invoke(method, arg, resolve, reject);
  20098. });
  20099. }
  20100. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  20101. }
  20102. });
  20103. }
  20104. function makeInvokeMethod(innerFn, self, context) {
  20105. var state = "suspendedStart";
  20106. return function (method, arg) {
  20107. if ("executing" === state) throw new Error("Generator is already running");
  20108. if ("completed" === state) {
  20109. if ("throw" === method) throw arg;
  20110. return doneResult();
  20111. }
  20112. for (context.method = method, context.arg = arg;;) {
  20113. var delegate = context.delegate;
  20114. if (delegate) {
  20115. var delegateResult = maybeInvokeDelegate(delegate, context);
  20116. if (delegateResult) {
  20117. if (delegateResult === ContinueSentinel) continue;
  20118. return delegateResult;
  20119. }
  20120. }
  20121. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  20122. if ("suspendedStart" === state) throw state = "completed", context.arg;
  20123. context.dispatchException(context.arg);
  20124. } else "return" === context.method && context.abrupt("return", context.arg);
  20125. state = "executing";
  20126. var record = tryCatch(innerFn, self, context);
  20127. if ("normal" === record.type) {
  20128. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  20129. return {
  20130. value: record.arg,
  20131. done: context.done
  20132. };
  20133. }
  20134. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  20135. }
  20136. };
  20137. }
  20138. function maybeInvokeDelegate(delegate, context) {
  20139. var methodName = context.method,
  20140. method = delegate.iterator[methodName];
  20141. 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;
  20142. var record = tryCatch(method, delegate.iterator, context.arg);
  20143. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  20144. var info = record.arg;
  20145. 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);
  20146. }
  20147. function pushTryEntry(locs) {
  20148. var entry = {
  20149. tryLoc: locs[0]
  20150. };
  20151. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  20152. }
  20153. function resetTryEntry(entry) {
  20154. var record = entry.completion || {};
  20155. record.type = "normal", delete record.arg, entry.completion = record;
  20156. }
  20157. function Context(tryLocsList) {
  20158. this.tryEntries = [{
  20159. tryLoc: "root"
  20160. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  20161. }
  20162. function values(iterable) {
  20163. if (iterable) {
  20164. var iteratorMethod = iterable[iteratorSymbol];
  20165. if (iteratorMethod) return iteratorMethod.call(iterable);
  20166. if ("function" == typeof iterable.next) return iterable;
  20167. if (!isNaN(iterable.length)) {
  20168. var i = -1,
  20169. next = function next() {
  20170. for (; ++i < iterable.length;) {
  20171. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  20172. }
  20173. return next.value = undefined, next.done = !0, next;
  20174. };
  20175. return next.next = next;
  20176. }
  20177. }
  20178. return {
  20179. next: doneResult
  20180. };
  20181. }
  20182. function doneResult() {
  20183. return {
  20184. value: undefined,
  20185. done: !0
  20186. };
  20187. }
  20188. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  20189. value: GeneratorFunctionPrototype,
  20190. configurable: !0
  20191. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  20192. value: GeneratorFunction,
  20193. configurable: !0
  20194. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  20195. var ctor = "function" == typeof genFun && genFun.constructor;
  20196. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  20197. }, exports.mark = function (genFun) {
  20198. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  20199. }, exports.awrap = function (arg) {
  20200. return {
  20201. __await: arg
  20202. };
  20203. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  20204. return this;
  20205. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  20206. void 0 === PromiseImpl && (PromiseImpl = Promise);
  20207. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  20208. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  20209. return result.done ? result.value : iter.next();
  20210. });
  20211. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  20212. return this;
  20213. }), define(Gp, "toString", function () {
  20214. return "[object Generator]";
  20215. }), exports.keys = function (val) {
  20216. var object = Object(val),
  20217. keys = [];
  20218. for (var key in object) {
  20219. keys.push(key);
  20220. }
  20221. return keys.reverse(), function next() {
  20222. for (; keys.length;) {
  20223. var key = keys.pop();
  20224. if (key in object) return next.value = key, next.done = !1, next;
  20225. }
  20226. return next.done = !0, next;
  20227. };
  20228. }, exports.values = values, Context.prototype = {
  20229. constructor: Context,
  20230. reset: function reset(skipTempReset) {
  20231. 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) {
  20232. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  20233. }
  20234. },
  20235. stop: function stop() {
  20236. this.done = !0;
  20237. var rootRecord = this.tryEntries[0].completion;
  20238. if ("throw" === rootRecord.type) throw rootRecord.arg;
  20239. return this.rval;
  20240. },
  20241. dispatchException: function dispatchException(exception) {
  20242. if (this.done) throw exception;
  20243. var context = this;
  20244. function handle(loc, caught) {
  20245. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  20246. }
  20247. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20248. var entry = this.tryEntries[i],
  20249. record = entry.completion;
  20250. if ("root" === entry.tryLoc) return handle("end");
  20251. if (entry.tryLoc <= this.prev) {
  20252. var hasCatch = hasOwn.call(entry, "catchLoc"),
  20253. hasFinally = hasOwn.call(entry, "finallyLoc");
  20254. if (hasCatch && hasFinally) {
  20255. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20256. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20257. } else if (hasCatch) {
  20258. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20259. } else {
  20260. if (!hasFinally) throw new Error("try statement without catch or finally");
  20261. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20262. }
  20263. }
  20264. }
  20265. },
  20266. abrupt: function abrupt(type, arg) {
  20267. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20268. var entry = this.tryEntries[i];
  20269. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  20270. var finallyEntry = entry;
  20271. break;
  20272. }
  20273. }
  20274. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  20275. var record = finallyEntry ? finallyEntry.completion : {};
  20276. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  20277. },
  20278. complete: function complete(record, afterLoc) {
  20279. if ("throw" === record.type) throw record.arg;
  20280. 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;
  20281. },
  20282. finish: function finish(finallyLoc) {
  20283. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20284. var entry = this.tryEntries[i];
  20285. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  20286. }
  20287. },
  20288. "catch": function _catch(tryLoc) {
  20289. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20290. var entry = this.tryEntries[i];
  20291. if (entry.tryLoc === tryLoc) {
  20292. var record = entry.completion;
  20293. if ("throw" === record.type) {
  20294. var thrown = record.arg;
  20295. resetTryEntry(entry);
  20296. }
  20297. return thrown;
  20298. }
  20299. }
  20300. throw new Error("illegal catch attempt");
  20301. },
  20302. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  20303. return this.delegate = {
  20304. iterator: values(iterable),
  20305. resultName: resultName,
  20306. nextLoc: nextLoc
  20307. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  20308. }
  20309. }, exports;
  20310. }
  20311. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20312. /***/ }),
  20313. /***/ 42:
  20314. /*!*****************************************************************!*\
  20315. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  20316. \*****************************************************************/
  20317. /*! no static exports found */
  20318. /***/ (function(module, exports) {
  20319. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  20320. try {
  20321. var info = gen[key](arg);
  20322. var value = info.value;
  20323. } catch (error) {
  20324. reject(error);
  20325. return;
  20326. }
  20327. if (info.done) {
  20328. resolve(value);
  20329. } else {
  20330. Promise.resolve(value).then(_next, _throw);
  20331. }
  20332. }
  20333. function _asyncToGenerator(fn) {
  20334. return function () {
  20335. var self = this,
  20336. args = arguments;
  20337. return new Promise(function (resolve, reject) {
  20338. var gen = fn.apply(self, args);
  20339. function _next(value) {
  20340. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  20341. }
  20342. function _throw(err) {
  20343. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  20344. }
  20345. _next(undefined);
  20346. });
  20347. };
  20348. }
  20349. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20350. /***/ }),
  20351. /***/ 43:
  20352. /*!*****************************************************************!*\
  20353. !*** E:/work/Project_newGit/hptwxMiniProgram/static/avatar.png ***!
  20354. \*****************************************************************/
  20355. /*! no static exports found */
  20356. /***/ (function(module, exports) {
  20357. 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=="
  20358. /***/ }),
  20359. /***/ 44:
  20360. /*!**************************************************************!*\
  20361. !*** E:/work/Project_newGit/hptwxMiniProgram/api/openApi.js ***!
  20362. \**************************************************************/
  20363. /*! no static exports found */
  20364. /***/ (function(module, exports, __webpack_require__) {
  20365. "use strict";
  20366. Object.defineProperty(exports, "__esModule", {
  20367. value: true
  20368. });
  20369. exports.wxDecryptUserInfo = wxDecryptUserInfo;
  20370. exports.wxLogin = wxLogin;
  20371. var _openRequest = __webpack_require__(/*! @/utils/openRequest.js */ 45);
  20372. /**
  20373. * WX登陆
  20374. * @param jsCode 二维码
  20375. * @returns
  20376. */
  20377. function wxLogin(data) {
  20378. return (0, _openRequest.request)({
  20379. url: "/wx/login",
  20380. method: 'GET',
  20381. data: data
  20382. });
  20383. }
  20384. /**
  20385. * 解密WX用户数据
  20386. * @param jsCode 二维码
  20387. * @returns
  20388. */
  20389. function wxDecryptUserInfo(data) {
  20390. return (0, _openRequest.request)({
  20391. url: "/wx/userInfo/decrypt",
  20392. method: 'POST',
  20393. data: data
  20394. });
  20395. }
  20396. /***/ }),
  20397. /***/ 45:
  20398. /*!********************************************************************!*\
  20399. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/openRequest.js ***!
  20400. \********************************************************************/
  20401. /*! no static exports found */
  20402. /***/ (function(module, exports, __webpack_require__) {
  20403. "use strict";
  20404. /* WEBPACK VAR INJECTION */(function(uni) {
  20405. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20406. Object.defineProperty(exports, "__esModule", {
  20407. value: true
  20408. });
  20409. exports.request = request;
  20410. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  20411. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  20412. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  20413. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  20414. 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; }
  20415. 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; }
  20416. var baseUrl = true ? _index.default.base.dev : undefined;
  20417. function request(_x) {
  20418. return _request.apply(this, arguments);
  20419. }
  20420. function _request() {
  20421. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  20422. return _regenerator.default.wrap(function _callee$(_context) {
  20423. while (1) {
  20424. switch (_context.prev = _context.next) {
  20425. case 0:
  20426. return _context.abrupt("return", new Promise(function (resolve, reject) {
  20427. try {
  20428. uni.showLoading({
  20429. title: '加载中',
  20430. mask: true
  20431. });
  20432. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  20433. success: function success(response) {
  20434. var data = response.data;
  20435. var code = data.code;
  20436. var msg = data.msg;
  20437. if (code === 200) {
  20438. resolve(data);
  20439. } else {
  20440. if (code === 401) {
  20441. uni.showToast({
  20442. title: msg || "登录失效!",
  20443. mask: true,
  20444. icon: "none",
  20445. complete: function complete() {
  20446. uni.redirectTo({
  20447. url: '/pages/authorizedLogin/index'
  20448. });
  20449. }
  20450. });
  20451. } else {
  20452. reject(data);
  20453. uni.showToast({
  20454. title: msg,
  20455. mask: true,
  20456. icon: "none"
  20457. });
  20458. }
  20459. }
  20460. },
  20461. fail: function fail(res) {
  20462. uni.showToast({
  20463. title: res,
  20464. mask: true,
  20465. icon: "none"
  20466. });
  20467. reject(res);
  20468. },
  20469. complete: function complete(res) {
  20470. uni.hideLoading();
  20471. }
  20472. }));
  20473. } catch (err) {
  20474. console.log(err);
  20475. reject(err);
  20476. }
  20477. }));
  20478. case 1:
  20479. case "end":
  20480. return _context.stop();
  20481. }
  20482. }
  20483. }, _callee);
  20484. }));
  20485. return _request.apply(this, arguments);
  20486. }
  20487. function formatRequestBody(parmas) {
  20488. var url = parmas.url;
  20489. url = baseUrl + url;
  20490. var data = _objectSpread({}, parmas.data);
  20491. var header = _objectSpread({}, parmas.header);
  20492. header['AppID'] = _index.default.appID;
  20493. header['AppKey'] = _index.default.appKey;
  20494. header['AppSecret'] = _index.default.appSecret;
  20495. var method = parmas.method || "get";
  20496. var dataType = parmas.dataType || "json";
  20497. var requestBody = {
  20498. url: url,
  20499. data: data,
  20500. header: header,
  20501. method: method,
  20502. dataType: dataType
  20503. };
  20504. return requestBody;
  20505. }
  20506. ;
  20507. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20508. /***/ }),
  20509. /***/ 46:
  20510. /*!***************************************************************!*\
  20511. !*** E:/work/Project_newGit/hptwxMiniProgram/config/index.js ***!
  20512. \***************************************************************/
  20513. /*! no static exports found */
  20514. /***/ (function(module, exports, __webpack_require__) {
  20515. "use strict";
  20516. Object.defineProperty(exports, "__esModule", {
  20517. value: true
  20518. });
  20519. exports.default = void 0;
  20520. var _default = {
  20521. base: {
  20522. dev: 'https://api.xazhyc.com',
  20523. // dev: 'http://1.15.92.205:6001',
  20524. // dev: 'http://192.168.3.253:7001',
  20525. pro: 'https://api.xazhyc.com'
  20526. },
  20527. appID: '10007',
  20528. appKey: '82a8bf439373e311',
  20529. appSecret: '82a8bf439373e311',
  20530. permitTplId: 7,
  20531. TokenKey: "Authorization"
  20532. };
  20533. exports.default = _default;
  20534. /***/ }),
  20535. /***/ 47:
  20536. /*!******************************************************************!*\
  20537. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/scan.js ***!
  20538. \******************************************************************/
  20539. /*! no static exports found */
  20540. /***/ (function(module, exports, __webpack_require__) {
  20541. "use strict";
  20542. Object.defineProperty(exports, "__esModule", {
  20543. value: true
  20544. });
  20545. exports.getApps = getApps;
  20546. exports.getByQr = getByQr;
  20547. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  20548. /**
  20549. * 扫码请求
  20550. * @param ocId 单位ID
  20551. * @param qrCode 二维码
  20552. * @returns
  20553. */
  20554. function getByQr(ocId, qrCode) {
  20555. return (0, _request.request)({
  20556. url: "/qr/request/".concat(ocId, "/").concat(qrCode),
  20557. method: 'GET'
  20558. });
  20559. }
  20560. function getApps(targetId) {
  20561. return (0, _request.request)({
  20562. url: "/mini/permitted/".concat(targetId, " "),
  20563. method: 'GET'
  20564. });
  20565. }
  20566. /***/ }),
  20567. /***/ 48:
  20568. /*!****************************************************************!*\
  20569. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/request.js ***!
  20570. \****************************************************************/
  20571. /*! no static exports found */
  20572. /***/ (function(module, exports, __webpack_require__) {
  20573. "use strict";
  20574. /* WEBPACK VAR INJECTION */(function(uni) {
  20575. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20576. Object.defineProperty(exports, "__esModule", {
  20577. value: true
  20578. });
  20579. exports.request = request;
  20580. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  20581. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  20582. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  20583. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  20584. var _auth = __webpack_require__(/*! @/utils/auth.js */ 49);
  20585. 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; }
  20586. 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; }
  20587. var baseUrl = true ? _index.default.base.dev : undefined;
  20588. function request(_x) {
  20589. return _request.apply(this, arguments);
  20590. }
  20591. function _request() {
  20592. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  20593. return _regenerator.default.wrap(function _callee$(_context) {
  20594. while (1) {
  20595. switch (_context.prev = _context.next) {
  20596. case 0:
  20597. return _context.abrupt("return", new Promise(function (resolve, reject) {
  20598. try {
  20599. uni.showLoading({
  20600. title: '加载中',
  20601. mask: true
  20602. });
  20603. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  20604. success: function success(response) {
  20605. var data = response.data;
  20606. var code = data.code;
  20607. var msg = data.msg;
  20608. if (code === 200) {
  20609. resolve(data);
  20610. } else {
  20611. if (code === 401) {
  20612. uni.showToast({
  20613. title: msg || "登录失效!",
  20614. mask: true,
  20615. icon: "none",
  20616. complete: function complete() {
  20617. uni.redirectTo({
  20618. url: '/pages/authorizedLogin/index'
  20619. });
  20620. }
  20621. });
  20622. } else {
  20623. reject(data);
  20624. uni.showToast({
  20625. title: msg,
  20626. mask: true,
  20627. icon: "none"
  20628. });
  20629. }
  20630. }
  20631. },
  20632. fail: function fail(res) {
  20633. uni.showToast({
  20634. title: res,
  20635. mask: true,
  20636. icon: "none"
  20637. });
  20638. reject(res);
  20639. },
  20640. complete: function complete(res) {
  20641. uni.hideLoading();
  20642. }
  20643. }));
  20644. } catch (err) {
  20645. console.log(err);
  20646. reject(err);
  20647. }
  20648. }));
  20649. case 1:
  20650. case "end":
  20651. return _context.stop();
  20652. }
  20653. }
  20654. }, _callee);
  20655. }));
  20656. return _request.apply(this, arguments);
  20657. }
  20658. function formatRequestBody(parmas) {
  20659. var unionid = uni.getStorageSync('unionid');
  20660. var isAccount = uni.getStorageSync('isAccount');
  20661. var qrcode = uni.getStorageSync('qrcode');
  20662. var url = parmas.url;
  20663. url = baseUrl + url;
  20664. var data = _objectSpread({}, parmas.data);
  20665. var header = _objectSpread({}, parmas.header);
  20666. header[_index.default.TokenKey] = (0, _auth.getToken)();
  20667. header['AppID'] = _index.default.appID;
  20668. header['AppKey'] = _index.default.appKey;
  20669. header['AppSecret'] = _index.default.appSecret;
  20670. header['wxCode'] = unionid;
  20671. header['ocId'] = qrcode.ocId;
  20672. header['isAccount'] = isAccount;
  20673. header['AppType'] = 'mini';
  20674. var method = parmas.method || "get";
  20675. var dataType = parmas.dataType || "json";
  20676. var requestBody = {
  20677. url: url,
  20678. data: data,
  20679. header: header,
  20680. method: method,
  20681. dataType: dataType
  20682. };
  20683. return requestBody;
  20684. }
  20685. ;
  20686. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20687. /***/ }),
  20688. /***/ 49:
  20689. /*!*************************************************************!*\
  20690. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/auth.js ***!
  20691. \*************************************************************/
  20692. /*! no static exports found */
  20693. /***/ (function(module, exports, __webpack_require__) {
  20694. "use strict";
  20695. /* WEBPACK VAR INJECTION */(function(uni) {
  20696. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20697. Object.defineProperty(exports, "__esModule", {
  20698. value: true
  20699. });
  20700. exports.getToken = getToken;
  20701. exports.removeToken = removeToken;
  20702. exports.setToken = setToken;
  20703. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 46));
  20704. var TokenKey = _index.default.TokenKey;
  20705. function getToken() {
  20706. return uni.getStorageSync(TokenKey);
  20707. }
  20708. function setToken(token) {
  20709. return uni.setStorageSync(TokenKey, token);
  20710. }
  20711. function removeToken() {
  20712. return uni.removeStorageSync(TokenKey);
  20713. }
  20714. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20715. /***/ }),
  20716. /***/ 5:
  20717. /*!**************************************************************!*\
  20718. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  20719. \**************************************************************/
  20720. /*! no static exports found */
  20721. /***/ (function(module, exports, __webpack_require__) {
  20722. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  20723. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  20724. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  20725. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  20726. function _slicedToArray(arr, i) {
  20727. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  20728. }
  20729. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20730. /***/ }),
  20731. /***/ 50:
  20732. /*!**************************************************************!*\
  20733. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/index.js ***!
  20734. \**************************************************************/
  20735. /*! no static exports found */
  20736. /***/ (function(module, exports, __webpack_require__) {
  20737. "use strict";
  20738. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20739. Object.defineProperty(exports, "__esModule", {
  20740. value: true
  20741. });
  20742. exports.getQueryParams = getQueryParams;
  20743. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  20744. function getQueryParams(url) {
  20745. var paramArr = url.slice(url.indexOf("?") + 1).split("&");
  20746. var params = {};
  20747. paramArr.map(function (param) {
  20748. var _param$split = param.split("="),
  20749. _param$split2 = (0, _slicedToArray2.default)(_param$split, 2),
  20750. key = _param$split2[0],
  20751. val = _param$split2[1];
  20752. params[key] = decodeURIComponent(val);
  20753. });
  20754. return params;
  20755. }
  20756. /***/ }),
  20757. /***/ 59:
  20758. /*!*********************************************************************!*\
  20759. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/dangerApi.js ***!
  20760. \*********************************************************************/
  20761. /*! no static exports found */
  20762. /***/ (function(module, exports, __webpack_require__) {
  20763. "use strict";
  20764. Object.defineProperty(exports, "__esModule", {
  20765. value: true
  20766. });
  20767. exports.deleteDangerById = deleteDangerById;
  20768. exports.getDangerById = getDangerById;
  20769. exports.getDangerByList = getDangerByList;
  20770. exports.getDangerByPage = getDangerByPage;
  20771. exports.getMyHandlingDangerByPage = getMyHandlingDangerByPage;
  20772. exports.handleDanger = handleDanger;
  20773. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  20774. /**
  20775. * 获取Danger列表
  20776. * @param data
  20777. * @returns
  20778. */
  20779. function getDangerByList(data) {
  20780. return (0, _request.request)({
  20781. url: '/danger',
  20782. method: 'GET',
  20783. data: data
  20784. });
  20785. }
  20786. /**
  20787. * 获取Danger分页
  20788. * @param data
  20789. * @returns
  20790. */
  20791. function getDangerByPage(data) {
  20792. return (0, _request.request)({
  20793. url: '/danger/page',
  20794. method: 'GET',
  20795. data: data
  20796. });
  20797. }
  20798. /**
  20799. * 根据Id获取Danger
  20800. * @param dangerId
  20801. * @returns
  20802. */
  20803. function getDangerById(dangerId) {
  20804. return (0, _request.request)({
  20805. url: "/danger/".concat(dangerId),
  20806. method: 'GET'
  20807. });
  20808. }
  20809. /**
  20810. * 删除Danger
  20811. * @param dangerId
  20812. * @returns
  20813. */
  20814. function deleteDangerById(dangerId) {
  20815. return (0, _request.request)({
  20816. url: "/danger/".concat(dangerId),
  20817. method: 'DELETE'
  20818. });
  20819. }
  20820. /**
  20821. * 处理Danger
  20822. * @param data
  20823. * @returns
  20824. */
  20825. function handleDanger(data) {
  20826. return (0, _request.request)({
  20827. url: "/danger/handle",
  20828. method: 'POST',
  20829. data: data
  20830. });
  20831. }
  20832. /**
  20833. * 待处理Danger
  20834. * @param data
  20835. * @returns
  20836. */
  20837. function getMyHandlingDangerByPage(data) {
  20838. return (0, _request.request)({
  20839. url: "/danger/myHandling/page",
  20840. method: 'GET',
  20841. data: data
  20842. });
  20843. }
  20844. /***/ }),
  20845. /***/ 6:
  20846. /*!***************************************************************!*\
  20847. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  20848. \***************************************************************/
  20849. /*! no static exports found */
  20850. /***/ (function(module, exports) {
  20851. function _arrayWithHoles(arr) {
  20852. if (Array.isArray(arr)) return arr;
  20853. }
  20854. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20855. /***/ }),
  20856. /***/ 60:
  20857. /*!**************************************************************************!*\
  20858. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistPoint.js ***!
  20859. \**************************************************************************/
  20860. /*! no static exports found */
  20861. /***/ (function(module, exports, __webpack_require__) {
  20862. "use strict";
  20863. Object.defineProperty(exports, "__esModule", {
  20864. value: true
  20865. });
  20866. exports.checklistBatchUpdate = checklistBatchUpdate;
  20867. exports.checklistCancel = checklistCancel;
  20868. exports.checklistComplete = checklistComplete;
  20869. exports.checklistInit = checklistInit;
  20870. exports.getchecklistByPage = getchecklistByPage;
  20871. exports.getchecklistRecord = getchecklistRecord;
  20872. exports.updateChecklistPoint = updateChecklistPoint;
  20873. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  20874. /**
  20875. * 清单初始化
  20876. * ocId
  20877. * targetId ,targetType,targetTitle,targetGroupId,,targetGroupName
  20878. * checklistId
  20879. */
  20880. function checklistInit(data) {
  20881. return (0, _request.request)({
  20882. url: "/checklist/point/record/init",
  20883. method: 'POST',
  20884. data: data
  20885. });
  20886. }
  20887. function updateChecklistPoint(data) {
  20888. return (0, _request.request)({
  20889. url: "/checklist/point/record/doing/update",
  20890. method: 'PUT',
  20891. data: data
  20892. });
  20893. }
  20894. function getchecklistRecord(checklistId, recordId) {
  20895. return (0, _request.request)({
  20896. url: "/checklist/point/record/view/".concat(recordId, "/").concat(checklistId),
  20897. method: 'GET'
  20898. });
  20899. }
  20900. function getchecklistByPage(data) {
  20901. return (0, _request.request)({
  20902. url: "/checklist/record/page",
  20903. method: 'GET',
  20904. data: data
  20905. });
  20906. }
  20907. // 巡检完成
  20908. function checklistComplete(recordId) {
  20909. return (0, _request.request)({
  20910. url: "/checklist/point/record/complete/".concat(recordId),
  20911. method: 'PUT'
  20912. });
  20913. }
  20914. // 巡检放弃
  20915. function checklistCancel(recordId) {
  20916. return (0, _request.request)({
  20917. url: "/checklist/point/record/cancel/".concat(recordId),
  20918. method: 'PUT'
  20919. });
  20920. }
  20921. // 批量操作
  20922. function checklistBatchUpdate(recordId, checkResult) {
  20923. return (0, _request.request)({
  20924. url: "/checklist/point/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  20925. method: 'PUT'
  20926. });
  20927. }
  20928. /***/ }),
  20929. /***/ 61:
  20930. /*!***********************************************************************!*\
  20931. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/snapshotApi.js ***!
  20932. \***********************************************************************/
  20933. /*! no static exports found */
  20934. /***/ (function(module, exports, __webpack_require__) {
  20935. "use strict";
  20936. Object.defineProperty(exports, "__esModule", {
  20937. value: true
  20938. });
  20939. exports.cancelSnapshot = cancelSnapshot;
  20940. exports.completeSnapshot = completeSnapshot;
  20941. exports.createSnapshot = createSnapshot;
  20942. exports.deleteSnapshotById = deleteSnapshotById;
  20943. exports.getSnapshotById = getSnapshotById;
  20944. exports.getSnapshotByList = getSnapshotByList;
  20945. exports.getSnapshotByPage = getSnapshotByPage;
  20946. exports.getSnapshotCounter = getSnapshotCounter;
  20947. exports.transferSnapshot = transferSnapshot;
  20948. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  20949. /**
  20950. * 问题反馈列表
  20951. * @param data
  20952. * @returns
  20953. */
  20954. function getSnapshotByList(data) {
  20955. return (0, _request.request)({
  20956. url: '/snapshot',
  20957. method: 'GET',
  20958. params: data
  20959. });
  20960. }
  20961. /**
  20962. * 问题反馈列表
  20963. * @param data
  20964. * @returns
  20965. */
  20966. function getSnapshotByPage(data) {
  20967. return (0, _request.request)({
  20968. url: '/snapshot/page',
  20969. method: 'GET',
  20970. data: data
  20971. });
  20972. }
  20973. /**
  20974. * 获取问题反馈详情
  20975. * @param snapshotId
  20976. * @returns
  20977. */
  20978. function getSnapshotById(snapshotId) {
  20979. return (0, _request.request)({
  20980. url: "/snapshot/".concat(snapshotId),
  20981. method: 'GET'
  20982. });
  20983. }
  20984. /**
  20985. * 添加问题反馈
  20986. * @param data
  20987. * @returns
  20988. */
  20989. function createSnapshot(data) {
  20990. return (0, _request.request)({
  20991. url: "/snapshot/add",
  20992. method: 'POST',
  20993. data: data
  20994. });
  20995. }
  20996. /**
  20997. * 完成处理
  20998. * @param snapshotId
  20999. * @param data
  21000. * @returns
  21001. */
  21002. function completeSnapshot(snapshotId, data) {
  21003. return (0, _request.request)({
  21004. url: "/snapshot/complete",
  21005. method: 'POST',
  21006. data: data
  21007. });
  21008. }
  21009. /**
  21010. * 转交他人
  21011. * @param snapshotId
  21012. * @param data
  21013. * @returns
  21014. */
  21015. function transferSnapshot(snapshotId, data) {
  21016. return (0, _request.request)({
  21017. url: "/snapshot/transfer/".concat(snapshotId),
  21018. method: 'POST',
  21019. data: data
  21020. });
  21021. }
  21022. /**
  21023. * 撤消
  21024. * @param snapshotId
  21025. * @returns
  21026. */
  21027. function cancelSnapshot(snapshotId) {
  21028. return (0, _request.request)({
  21029. url: "/snapshot/cancel/".concat(snapshotId),
  21030. method: 'GET'
  21031. });
  21032. }
  21033. /**
  21034. * 基于ID删除
  21035. * @param snapshotId
  21036. * @returns
  21037. */
  21038. function deleteSnapshotById(snapshotId) {
  21039. return (0, _request.request)({
  21040. url: "/snapshot/".concat(snapshotId),
  21041. method: 'DELETE'
  21042. });
  21043. }
  21044. /**
  21045. * 查询统计结果
  21046. */
  21047. function getSnapshotCounter() {
  21048. return (0, _request.request)({
  21049. url: '/snapshot/statis/counterByStatus',
  21050. method: 'GET'
  21051. });
  21052. }
  21053. /***/ }),
  21054. /***/ 7:
  21055. /*!*********************************************************************!*\
  21056. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  21057. \*********************************************************************/
  21058. /*! no static exports found */
  21059. /***/ (function(module, exports) {
  21060. function _iterableToArrayLimit(arr, i) {
  21061. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  21062. if (null != _i) {
  21063. var _s,
  21064. _e,
  21065. _x,
  21066. _r,
  21067. _arr = [],
  21068. _n = !0,
  21069. _d = !1;
  21070. try {
  21071. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  21072. if (Object(_i) !== _i) return;
  21073. _n = !1;
  21074. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  21075. ;
  21076. }
  21077. } catch (err) {
  21078. _d = !0, _e = err;
  21079. } finally {
  21080. try {
  21081. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  21082. } finally {
  21083. if (_d) throw _e;
  21084. }
  21085. }
  21086. return _arr;
  21087. }
  21088. }
  21089. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21090. /***/ }),
  21091. /***/ 70:
  21092. /*!*******************************************************************!*\
  21093. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/wfApi.js ***!
  21094. \*******************************************************************/
  21095. /*! no static exports found */
  21096. /***/ (function(module, exports, __webpack_require__) {
  21097. "use strict";
  21098. Object.defineProperty(exports, "__esModule", {
  21099. value: true
  21100. });
  21101. exports.cancelWorkflow = cancelWorkflow;
  21102. exports.getWorkflowById = getWorkflowById;
  21103. exports.getWorkflowById2 = getWorkflowById2;
  21104. exports.getWorkflowById3 = getWorkflowById3;
  21105. exports.getWorkflowDetailsById = getWorkflowDetailsById;
  21106. exports.getWorkflowRecordById = getWorkflowRecordById;
  21107. exports.handleWorkflow = handleWorkflow;
  21108. exports.startWorkflow = startWorkflow;
  21109. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21110. /**
  21111. * 启动Workflow
  21112. * @param wfDefId
  21113. * @returns
  21114. */
  21115. function startWorkflow(wfDefId) {
  21116. return (0, _request.request)({
  21117. url: "/wf/start/".concat(wfDefId),
  21118. method: 'GET'
  21119. });
  21120. }
  21121. function getWorkflowById(wfInsId) {
  21122. return (0, _request.request)({
  21123. url: "/wf/getIns/".concat(wfInsId),
  21124. method: 'GET'
  21125. });
  21126. }
  21127. function getWorkflowById2(wfInsId, activityInsId) {
  21128. return (0, _request.request)({
  21129. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId),
  21130. method: 'GET'
  21131. });
  21132. }
  21133. function getWorkflowById3(wfInsId, activityInsId, actionInsId) {
  21134. return (0, _request.request)({
  21135. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId, "/").concat(actionInsId),
  21136. method: 'GET'
  21137. });
  21138. }
  21139. function getWorkflowDetailsById(wfInsId) {
  21140. return (0, _request.request)({
  21141. url: "/wf/details/".concat(wfInsId),
  21142. method: 'GET'
  21143. });
  21144. }
  21145. function getWorkflowRecordById(wfInsId) {
  21146. return (0, _request.request)({
  21147. url: "/wf/record/".concat(wfInsId),
  21148. method: 'GET'
  21149. });
  21150. }
  21151. /**
  21152. * 处理
  21153. * @param data
  21154. * @returns
  21155. */
  21156. function handleWorkflow(data) {
  21157. return (0, _request.request)({
  21158. url: "/wf/handle",
  21159. method: 'POST',
  21160. data: data
  21161. });
  21162. }
  21163. /**
  21164. * 撤消
  21165. * @param wfInsId
  21166. * @returns
  21167. */
  21168. function cancelWorkflow(wfInsId) {
  21169. return (0, _request.request)({
  21170. url: "/wf/cancel/".concat(wfInsId),
  21171. method: 'GET'
  21172. });
  21173. }
  21174. /***/ }),
  21175. /***/ 79:
  21176. /*!******************************************************************!*\
  21177. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/user.js ***!
  21178. \******************************************************************/
  21179. /*! no static exports found */
  21180. /***/ (function(module, exports, __webpack_require__) {
  21181. "use strict";
  21182. Object.defineProperty(exports, "__esModule", {
  21183. value: true
  21184. });
  21185. exports.getUserInfo = getUserInfo;
  21186. exports.getUserList = getUserList;
  21187. exports.login = login;
  21188. exports.logout = logout;
  21189. exports.register = register;
  21190. exports.updatePwd = updatePwd;
  21191. exports.uploadFile = uploadFile;
  21192. exports.wxWorkLogin = wxWorkLogin;
  21193. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21194. function login(data) {
  21195. return (0, _request.request)({
  21196. url: '/login',
  21197. method: 'post',
  21198. header: {
  21199. 'content-type': "application/x-www-form-urlencoded"
  21200. },
  21201. data: data
  21202. });
  21203. }
  21204. function getUserInfo() {
  21205. return (0, _request.request)({
  21206. url: '/user/profile'
  21207. });
  21208. }
  21209. function logout() {
  21210. return (0, _request.request)({
  21211. url: '/logout',
  21212. method: 'GET'
  21213. });
  21214. }
  21215. function register(data) {
  21216. return (0, _request.request)({
  21217. url: '/user/register',
  21218. method: 'post',
  21219. data: data
  21220. });
  21221. }
  21222. /**公用上传接口 */
  21223. function uploadFile(data) {
  21224. return (0, _request.request)({
  21225. url: '/upload/file',
  21226. method: "post",
  21227. headers: {
  21228. 'Content-Type': 'multipart/form-data'
  21229. },
  21230. data: data
  21231. });
  21232. }
  21233. function updatePwd(data) {
  21234. return (0, _request.request)({
  21235. url: '/user/updatePwd',
  21236. method: "post",
  21237. data: data
  21238. });
  21239. }
  21240. //查询用户的带岗位
  21241. function getUserList() {
  21242. return (0, _request.request)({
  21243. url: '/user/select',
  21244. method: 'get'
  21245. });
  21246. }
  21247. //企业微信登录
  21248. function wxWorkLogin(_ref) {
  21249. var userId = _ref.userId,
  21250. code = _ref.code;
  21251. return (0, _request.request)({
  21252. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  21253. method: 'post'
  21254. });
  21255. }
  21256. /***/ }),
  21257. /***/ 8:
  21258. /*!***************************************************************************!*\
  21259. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  21260. \***************************************************************************/
  21261. /*! no static exports found */
  21262. /***/ (function(module, exports, __webpack_require__) {
  21263. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  21264. function _unsupportedIterableToArray(o, minLen) {
  21265. if (!o) return;
  21266. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  21267. var n = Object.prototype.toString.call(o).slice(8, -1);
  21268. if (n === "Object" && o.constructor) n = o.constructor.name;
  21269. if (n === "Map" || n === "Set") return Array.from(o);
  21270. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  21271. }
  21272. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21273. /***/ }),
  21274. /***/ 80:
  21275. /*!****************************************************************!*\
  21276. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/task.js ***!
  21277. \****************************************************************/
  21278. /*! no static exports found */
  21279. /***/ (function(module, exports, __webpack_require__) {
  21280. "use strict";
  21281. Object.defineProperty(exports, "__esModule", {
  21282. value: true
  21283. });
  21284. exports.getTaskMyHandlingByList = getTaskMyHandlingByList;
  21285. exports.handleCheckTask = handleCheckTask;
  21286. exports.waitHandleStatistics = waitHandleStatistics;
  21287. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21288. /**
  21289. * 列表查询Danger Category
  21290. * @returns
  21291. */
  21292. function getTaskMyHandlingByList(data) {
  21293. return (0, _request.request)({
  21294. url: '/task/myHandling/page',
  21295. method: 'GET',
  21296. data: data
  21297. });
  21298. }
  21299. /**
  21300. * Handle CheckTask
  21301. * @param taskId
  21302. */
  21303. function handleCheckTask(taskId) {
  21304. return (0, _request.request)({
  21305. url: "/check/task/handle/".concat(taskId),
  21306. method: 'PUT'
  21307. });
  21308. }
  21309. /**
  21310. * Handle CheckTask
  21311. * @param taskId
  21312. */
  21313. function waitHandleStatistics() {
  21314. return (0, _request.request)({
  21315. url: "/myCounter"
  21316. });
  21317. }
  21318. /***/ }),
  21319. /***/ 89:
  21320. /*!**************************************************************!*\
  21321. !*** E:/work/Project_newGit/hptwxMiniProgram/store/index.js ***!
  21322. \**************************************************************/
  21323. /*! no static exports found */
  21324. /***/ (function(module, exports, __webpack_require__) {
  21325. "use strict";
  21326. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  21327. Object.defineProperty(exports, "__esModule", {
  21328. value: true
  21329. });
  21330. exports.default = void 0;
  21331. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  21332. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 90));
  21333. _vue.default.use(_vuex.default);
  21334. //实例store对象
  21335. var store = new _vuex.default.Store({
  21336. state: {
  21337. access_token: "",
  21338. jpush: null
  21339. },
  21340. mutations: {
  21341. setToken: function setToken(state, token) {
  21342. state.access_token = token;
  21343. },
  21344. initJpush: function initJpush(state, jpush) {
  21345. state.jpush = jpush;
  21346. }
  21347. }
  21348. });
  21349. //导出store对象
  21350. var _default = store;
  21351. exports.default = _default;
  21352. /***/ }),
  21353. /***/ 9:
  21354. /*!*****************************************************************!*\
  21355. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  21356. \*****************************************************************/
  21357. /*! no static exports found */
  21358. /***/ (function(module, exports) {
  21359. function _arrayLikeToArray(arr, len) {
  21360. if (len == null || len > arr.length) len = arr.length;
  21361. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  21362. arr2[i] = arr[i];
  21363. }
  21364. return arr2;
  21365. }
  21366. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21367. /***/ }),
  21368. /***/ 90:
  21369. /*!**************************************************************************************!*\
  21370. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  21371. \**************************************************************************************/
  21372. /*! no static exports found */
  21373. /***/ (function(module, exports, __webpack_require__) {
  21374. "use strict";
  21375. /* WEBPACK VAR INJECTION */(function(global) {/*!
  21376. * vuex v3.6.2
  21377. * (c) 2021 Evan You
  21378. * @license MIT
  21379. */
  21380. function applyMixin (Vue) {
  21381. var version = Number(Vue.version.split('.')[0]);
  21382. if (version >= 2) {
  21383. Vue.mixin({ beforeCreate: vuexInit });
  21384. } else {
  21385. // override init and inject vuex init procedure
  21386. // for 1.x backwards compatibility.
  21387. var _init = Vue.prototype._init;
  21388. Vue.prototype._init = function (options) {
  21389. if ( options === void 0 ) options = {};
  21390. options.init = options.init
  21391. ? [vuexInit].concat(options.init)
  21392. : vuexInit;
  21393. _init.call(this, options);
  21394. };
  21395. }
  21396. /**
  21397. * Vuex init hook, injected into each instances init hooks list.
  21398. */
  21399. function vuexInit () {
  21400. var options = this.$options;
  21401. // store injection
  21402. if (options.store) {
  21403. this.$store = typeof options.store === 'function'
  21404. ? options.store()
  21405. : options.store;
  21406. } else if (options.parent && options.parent.$store) {
  21407. this.$store = options.parent.$store;
  21408. }
  21409. }
  21410. }
  21411. var target = typeof window !== 'undefined'
  21412. ? window
  21413. : typeof global !== 'undefined'
  21414. ? global
  21415. : {};
  21416. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  21417. function devtoolPlugin (store) {
  21418. if (!devtoolHook) { return }
  21419. store._devtoolHook = devtoolHook;
  21420. devtoolHook.emit('vuex:init', store);
  21421. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  21422. store.replaceState(targetState);
  21423. });
  21424. store.subscribe(function (mutation, state) {
  21425. devtoolHook.emit('vuex:mutation', mutation, state);
  21426. }, { prepend: true });
  21427. store.subscribeAction(function (action, state) {
  21428. devtoolHook.emit('vuex:action', action, state);
  21429. }, { prepend: true });
  21430. }
  21431. /**
  21432. * Get the first item that pass the test
  21433. * by second argument function
  21434. *
  21435. * @param {Array} list
  21436. * @param {Function} f
  21437. * @return {*}
  21438. */
  21439. function find (list, f) {
  21440. return list.filter(f)[0]
  21441. }
  21442. /**
  21443. * Deep copy the given object considering circular structure.
  21444. * This function caches all nested objects and its copies.
  21445. * If it detects circular structure, use cached copy to avoid infinite loop.
  21446. *
  21447. * @param {*} obj
  21448. * @param {Array<Object>} cache
  21449. * @return {*}
  21450. */
  21451. function deepCopy (obj, cache) {
  21452. if ( cache === void 0 ) cache = [];
  21453. // just return if obj is immutable value
  21454. if (obj === null || typeof obj !== 'object') {
  21455. return obj
  21456. }
  21457. // if obj is hit, it is in circular structure
  21458. var hit = find(cache, function (c) { return c.original === obj; });
  21459. if (hit) {
  21460. return hit.copy
  21461. }
  21462. var copy = Array.isArray(obj) ? [] : {};
  21463. // put the copy into cache at first
  21464. // because we want to refer it in recursive deepCopy
  21465. cache.push({
  21466. original: obj,
  21467. copy: copy
  21468. });
  21469. Object.keys(obj).forEach(function (key) {
  21470. copy[key] = deepCopy(obj[key], cache);
  21471. });
  21472. return copy
  21473. }
  21474. /**
  21475. * forEach for object
  21476. */
  21477. function forEachValue (obj, fn) {
  21478. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  21479. }
  21480. function isObject (obj) {
  21481. return obj !== null && typeof obj === 'object'
  21482. }
  21483. function isPromise (val) {
  21484. return val && typeof val.then === 'function'
  21485. }
  21486. function assert (condition, msg) {
  21487. if (!condition) { throw new Error(("[vuex] " + msg)) }
  21488. }
  21489. function partial (fn, arg) {
  21490. return function () {
  21491. return fn(arg)
  21492. }
  21493. }
  21494. // Base data struct for store's module, package with some attribute and method
  21495. var Module = function Module (rawModule, runtime) {
  21496. this.runtime = runtime;
  21497. // Store some children item
  21498. this._children = Object.create(null);
  21499. // Store the origin module object which passed by programmer
  21500. this._rawModule = rawModule;
  21501. var rawState = rawModule.state;
  21502. // Store the origin module's state
  21503. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  21504. };
  21505. var prototypeAccessors = { namespaced: { configurable: true } };
  21506. prototypeAccessors.namespaced.get = function () {
  21507. return !!this._rawModule.namespaced
  21508. };
  21509. Module.prototype.addChild = function addChild (key, module) {
  21510. this._children[key] = module;
  21511. };
  21512. Module.prototype.removeChild = function removeChild (key) {
  21513. delete this._children[key];
  21514. };
  21515. Module.prototype.getChild = function getChild (key) {
  21516. return this._children[key]
  21517. };
  21518. Module.prototype.hasChild = function hasChild (key) {
  21519. return key in this._children
  21520. };
  21521. Module.prototype.update = function update (rawModule) {
  21522. this._rawModule.namespaced = rawModule.namespaced;
  21523. if (rawModule.actions) {
  21524. this._rawModule.actions = rawModule.actions;
  21525. }
  21526. if (rawModule.mutations) {
  21527. this._rawModule.mutations = rawModule.mutations;
  21528. }
  21529. if (rawModule.getters) {
  21530. this._rawModule.getters = rawModule.getters;
  21531. }
  21532. };
  21533. Module.prototype.forEachChild = function forEachChild (fn) {
  21534. forEachValue(this._children, fn);
  21535. };
  21536. Module.prototype.forEachGetter = function forEachGetter (fn) {
  21537. if (this._rawModule.getters) {
  21538. forEachValue(this._rawModule.getters, fn);
  21539. }
  21540. };
  21541. Module.prototype.forEachAction = function forEachAction (fn) {
  21542. if (this._rawModule.actions) {
  21543. forEachValue(this._rawModule.actions, fn);
  21544. }
  21545. };
  21546. Module.prototype.forEachMutation = function forEachMutation (fn) {
  21547. if (this._rawModule.mutations) {
  21548. forEachValue(this._rawModule.mutations, fn);
  21549. }
  21550. };
  21551. Object.defineProperties( Module.prototype, prototypeAccessors );
  21552. var ModuleCollection = function ModuleCollection (rawRootModule) {
  21553. // register root module (Vuex.Store options)
  21554. this.register([], rawRootModule, false);
  21555. };
  21556. ModuleCollection.prototype.get = function get (path) {
  21557. return path.reduce(function (module, key) {
  21558. return module.getChild(key)
  21559. }, this.root)
  21560. };
  21561. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  21562. var module = this.root;
  21563. return path.reduce(function (namespace, key) {
  21564. module = module.getChild(key);
  21565. return namespace + (module.namespaced ? key + '/' : '')
  21566. }, '')
  21567. };
  21568. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  21569. update([], this.root, rawRootModule);
  21570. };
  21571. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  21572. var this$1 = this;
  21573. if ( runtime === void 0 ) runtime = true;
  21574. if ((true)) {
  21575. assertRawModule(path, rawModule);
  21576. }
  21577. var newModule = new Module(rawModule, runtime);
  21578. if (path.length === 0) {
  21579. this.root = newModule;
  21580. } else {
  21581. var parent = this.get(path.slice(0, -1));
  21582. parent.addChild(path[path.length - 1], newModule);
  21583. }
  21584. // register nested modules
  21585. if (rawModule.modules) {
  21586. forEachValue(rawModule.modules, function (rawChildModule, key) {
  21587. this$1.register(path.concat(key), rawChildModule, runtime);
  21588. });
  21589. }
  21590. };
  21591. ModuleCollection.prototype.unregister = function unregister (path) {
  21592. var parent = this.get(path.slice(0, -1));
  21593. var key = path[path.length - 1];
  21594. var child = parent.getChild(key);
  21595. if (!child) {
  21596. if ((true)) {
  21597. console.warn(
  21598. "[vuex] trying to unregister module '" + key + "', which is " +
  21599. "not registered"
  21600. );
  21601. }
  21602. return
  21603. }
  21604. if (!child.runtime) {
  21605. return
  21606. }
  21607. parent.removeChild(key);
  21608. };
  21609. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  21610. var parent = this.get(path.slice(0, -1));
  21611. var key = path[path.length - 1];
  21612. if (parent) {
  21613. return parent.hasChild(key)
  21614. }
  21615. return false
  21616. };
  21617. function update (path, targetModule, newModule) {
  21618. if ((true)) {
  21619. assertRawModule(path, newModule);
  21620. }
  21621. // update target module
  21622. targetModule.update(newModule);
  21623. // update nested modules
  21624. if (newModule.modules) {
  21625. for (var key in newModule.modules) {
  21626. if (!targetModule.getChild(key)) {
  21627. if ((true)) {
  21628. console.warn(
  21629. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  21630. 'manual reload is needed'
  21631. );
  21632. }
  21633. return
  21634. }
  21635. update(
  21636. path.concat(key),
  21637. targetModule.getChild(key),
  21638. newModule.modules[key]
  21639. );
  21640. }
  21641. }
  21642. }
  21643. var functionAssert = {
  21644. assert: function (value) { return typeof value === 'function'; },
  21645. expected: 'function'
  21646. };
  21647. var objectAssert = {
  21648. assert: function (value) { return typeof value === 'function' ||
  21649. (typeof value === 'object' && typeof value.handler === 'function'); },
  21650. expected: 'function or object with "handler" function'
  21651. };
  21652. var assertTypes = {
  21653. getters: functionAssert,
  21654. mutations: functionAssert,
  21655. actions: objectAssert
  21656. };
  21657. function assertRawModule (path, rawModule) {
  21658. Object.keys(assertTypes).forEach(function (key) {
  21659. if (!rawModule[key]) { return }
  21660. var assertOptions = assertTypes[key];
  21661. forEachValue(rawModule[key], function (value, type) {
  21662. assert(
  21663. assertOptions.assert(value),
  21664. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  21665. );
  21666. });
  21667. });
  21668. }
  21669. function makeAssertionMessage (path, key, type, value, expected) {
  21670. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  21671. if (path.length > 0) {
  21672. buf += " in module \"" + (path.join('.')) + "\"";
  21673. }
  21674. buf += " is " + (JSON.stringify(value)) + ".";
  21675. return buf
  21676. }
  21677. var Vue; // bind on install
  21678. var Store = function Store (options) {
  21679. var this$1 = this;
  21680. if ( options === void 0 ) options = {};
  21681. // Auto install if it is not done yet and `window` has `Vue`.
  21682. // To allow users to avoid auto-installation in some cases,
  21683. // this code should be placed here. See #731
  21684. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  21685. install(window.Vue);
  21686. }
  21687. if ((true)) {
  21688. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  21689. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  21690. assert(this instanceof Store, "store must be called with the new operator.");
  21691. }
  21692. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  21693. var strict = options.strict; if ( strict === void 0 ) strict = false;
  21694. // store internal state
  21695. this._committing = false;
  21696. this._actions = Object.create(null);
  21697. this._actionSubscribers = [];
  21698. this._mutations = Object.create(null);
  21699. this._wrappedGetters = Object.create(null);
  21700. this._modules = new ModuleCollection(options);
  21701. this._modulesNamespaceMap = Object.create(null);
  21702. this._subscribers = [];
  21703. this._watcherVM = new Vue();
  21704. this._makeLocalGettersCache = Object.create(null);
  21705. // bind commit and dispatch to self
  21706. var store = this;
  21707. var ref = this;
  21708. var dispatch = ref.dispatch;
  21709. var commit = ref.commit;
  21710. this.dispatch = function boundDispatch (type, payload) {
  21711. return dispatch.call(store, type, payload)
  21712. };
  21713. this.commit = function boundCommit (type, payload, options) {
  21714. return commit.call(store, type, payload, options)
  21715. };
  21716. // strict mode
  21717. this.strict = strict;
  21718. var state = this._modules.root.state;
  21719. // init root module.
  21720. // this also recursively registers all sub-modules
  21721. // and collects all module getters inside this._wrappedGetters
  21722. installModule(this, state, [], this._modules.root);
  21723. // initialize the store vm, which is responsible for the reactivity
  21724. // (also registers _wrappedGetters as computed properties)
  21725. resetStoreVM(this, state);
  21726. // apply plugins
  21727. plugins.forEach(function (plugin) { return plugin(this$1); });
  21728. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  21729. if (useDevtools) {
  21730. devtoolPlugin(this);
  21731. }
  21732. };
  21733. var prototypeAccessors$1 = { state: { configurable: true } };
  21734. prototypeAccessors$1.state.get = function () {
  21735. return this._vm._data.$$state
  21736. };
  21737. prototypeAccessors$1.state.set = function (v) {
  21738. if ((true)) {
  21739. assert(false, "use store.replaceState() to explicit replace store state.");
  21740. }
  21741. };
  21742. Store.prototype.commit = function commit (_type, _payload, _options) {
  21743. var this$1 = this;
  21744. // check object-style commit
  21745. var ref = unifyObjectStyle(_type, _payload, _options);
  21746. var type = ref.type;
  21747. var payload = ref.payload;
  21748. var options = ref.options;
  21749. var mutation = { type: type, payload: payload };
  21750. var entry = this._mutations[type];
  21751. if (!entry) {
  21752. if ((true)) {
  21753. console.error(("[vuex] unknown mutation type: " + type));
  21754. }
  21755. return
  21756. }
  21757. this._withCommit(function () {
  21758. entry.forEach(function commitIterator (handler) {
  21759. handler(payload);
  21760. });
  21761. });
  21762. this._subscribers
  21763. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  21764. .forEach(function (sub) { return sub(mutation, this$1.state); });
  21765. if (
  21766. ( true) &&
  21767. options && options.silent
  21768. ) {
  21769. console.warn(
  21770. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  21771. 'Use the filter functionality in the vue-devtools'
  21772. );
  21773. }
  21774. };
  21775. Store.prototype.dispatch = function dispatch (_type, _payload) {
  21776. var this$1 = this;
  21777. // check object-style dispatch
  21778. var ref = unifyObjectStyle(_type, _payload);
  21779. var type = ref.type;
  21780. var payload = ref.payload;
  21781. var action = { type: type, payload: payload };
  21782. var entry = this._actions[type];
  21783. if (!entry) {
  21784. if ((true)) {
  21785. console.error(("[vuex] unknown action type: " + type));
  21786. }
  21787. return
  21788. }
  21789. try {
  21790. this._actionSubscribers
  21791. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  21792. .filter(function (sub) { return sub.before; })
  21793. .forEach(function (sub) { return sub.before(action, this$1.state); });
  21794. } catch (e) {
  21795. if ((true)) {
  21796. console.warn("[vuex] error in before action subscribers: ");
  21797. console.error(e);
  21798. }
  21799. }
  21800. var result = entry.length > 1
  21801. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  21802. : entry[0](payload);
  21803. return new Promise(function (resolve, reject) {
  21804. result.then(function (res) {
  21805. try {
  21806. this$1._actionSubscribers
  21807. .filter(function (sub) { return sub.after; })
  21808. .forEach(function (sub) { return sub.after(action, this$1.state); });
  21809. } catch (e) {
  21810. if ((true)) {
  21811. console.warn("[vuex] error in after action subscribers: ");
  21812. console.error(e);
  21813. }
  21814. }
  21815. resolve(res);
  21816. }, function (error) {
  21817. try {
  21818. this$1._actionSubscribers
  21819. .filter(function (sub) { return sub.error; })
  21820. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  21821. } catch (e) {
  21822. if ((true)) {
  21823. console.warn("[vuex] error in error action subscribers: ");
  21824. console.error(e);
  21825. }
  21826. }
  21827. reject(error);
  21828. });
  21829. })
  21830. };
  21831. Store.prototype.subscribe = function subscribe (fn, options) {
  21832. return genericSubscribe(fn, this._subscribers, options)
  21833. };
  21834. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  21835. var subs = typeof fn === 'function' ? { before: fn } : fn;
  21836. return genericSubscribe(subs, this._actionSubscribers, options)
  21837. };
  21838. Store.prototype.watch = function watch (getter, cb, options) {
  21839. var this$1 = this;
  21840. if ((true)) {
  21841. assert(typeof getter === 'function', "store.watch only accepts a function.");
  21842. }
  21843. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  21844. };
  21845. Store.prototype.replaceState = function replaceState (state) {
  21846. var this$1 = this;
  21847. this._withCommit(function () {
  21848. this$1._vm._data.$$state = state;
  21849. });
  21850. };
  21851. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  21852. if ( options === void 0 ) options = {};
  21853. if (typeof path === 'string') { path = [path]; }
  21854. if ((true)) {
  21855. assert(Array.isArray(path), "module path must be a string or an Array.");
  21856. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  21857. }
  21858. this._modules.register(path, rawModule);
  21859. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  21860. // reset store to update getters...
  21861. resetStoreVM(this, this.state);
  21862. };
  21863. Store.prototype.unregisterModule = function unregisterModule (path) {
  21864. var this$1 = this;
  21865. if (typeof path === 'string') { path = [path]; }
  21866. if ((true)) {
  21867. assert(Array.isArray(path), "module path must be a string or an Array.");
  21868. }
  21869. this._modules.unregister(path);
  21870. this._withCommit(function () {
  21871. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  21872. Vue.delete(parentState, path[path.length - 1]);
  21873. });
  21874. resetStore(this);
  21875. };
  21876. Store.prototype.hasModule = function hasModule (path) {
  21877. if (typeof path === 'string') { path = [path]; }
  21878. if ((true)) {
  21879. assert(Array.isArray(path), "module path must be a string or an Array.");
  21880. }
  21881. return this._modules.isRegistered(path)
  21882. };
  21883. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  21884. this._modules.update(newOptions);
  21885. resetStore(this, true);
  21886. };
  21887. Store.prototype._withCommit = function _withCommit (fn) {
  21888. var committing = this._committing;
  21889. this._committing = true;
  21890. fn();
  21891. this._committing = committing;
  21892. };
  21893. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  21894. function genericSubscribe (fn, subs, options) {
  21895. if (subs.indexOf(fn) < 0) {
  21896. options && options.prepend
  21897. ? subs.unshift(fn)
  21898. : subs.push(fn);
  21899. }
  21900. return function () {
  21901. var i = subs.indexOf(fn);
  21902. if (i > -1) {
  21903. subs.splice(i, 1);
  21904. }
  21905. }
  21906. }
  21907. function resetStore (store, hot) {
  21908. store._actions = Object.create(null);
  21909. store._mutations = Object.create(null);
  21910. store._wrappedGetters = Object.create(null);
  21911. store._modulesNamespaceMap = Object.create(null);
  21912. var state = store.state;
  21913. // init all modules
  21914. installModule(store, state, [], store._modules.root, true);
  21915. // reset vm
  21916. resetStoreVM(store, state, hot);
  21917. }
  21918. function resetStoreVM (store, state, hot) {
  21919. var oldVm = store._vm;
  21920. // bind store public getters
  21921. store.getters = {};
  21922. // reset local getters cache
  21923. store._makeLocalGettersCache = Object.create(null);
  21924. var wrappedGetters = store._wrappedGetters;
  21925. var computed = {};
  21926. forEachValue(wrappedGetters, function (fn, key) {
  21927. // use computed to leverage its lazy-caching mechanism
  21928. // direct inline function use will lead to closure preserving oldVm.
  21929. // using partial to return function with only arguments preserved in closure environment.
  21930. computed[key] = partial(fn, store);
  21931. Object.defineProperty(store.getters, key, {
  21932. get: function () { return store._vm[key]; },
  21933. enumerable: true // for local getters
  21934. });
  21935. });
  21936. // use a Vue instance to store the state tree
  21937. // suppress warnings just in case the user has added
  21938. // some funky global mixins
  21939. var silent = Vue.config.silent;
  21940. Vue.config.silent = true;
  21941. store._vm = new Vue({
  21942. data: {
  21943. $$state: state
  21944. },
  21945. computed: computed
  21946. });
  21947. Vue.config.silent = silent;
  21948. // enable strict mode for new vm
  21949. if (store.strict) {
  21950. enableStrictMode(store);
  21951. }
  21952. if (oldVm) {
  21953. if (hot) {
  21954. // dispatch changes in all subscribed watchers
  21955. // to force getter re-evaluation for hot reloading.
  21956. store._withCommit(function () {
  21957. oldVm._data.$$state = null;
  21958. });
  21959. }
  21960. Vue.nextTick(function () { return oldVm.$destroy(); });
  21961. }
  21962. }
  21963. function installModule (store, rootState, path, module, hot) {
  21964. var isRoot = !path.length;
  21965. var namespace = store._modules.getNamespace(path);
  21966. // register in namespace map
  21967. if (module.namespaced) {
  21968. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  21969. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  21970. }
  21971. store._modulesNamespaceMap[namespace] = module;
  21972. }
  21973. // set state
  21974. if (!isRoot && !hot) {
  21975. var parentState = getNestedState(rootState, path.slice(0, -1));
  21976. var moduleName = path[path.length - 1];
  21977. store._withCommit(function () {
  21978. if ((true)) {
  21979. if (moduleName in parentState) {
  21980. console.warn(
  21981. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  21982. );
  21983. }
  21984. }
  21985. Vue.set(parentState, moduleName, module.state);
  21986. });
  21987. }
  21988. var local = module.context = makeLocalContext(store, namespace, path);
  21989. module.forEachMutation(function (mutation, key) {
  21990. var namespacedType = namespace + key;
  21991. registerMutation(store, namespacedType, mutation, local);
  21992. });
  21993. module.forEachAction(function (action, key) {
  21994. var type = action.root ? key : namespace + key;
  21995. var handler = action.handler || action;
  21996. registerAction(store, type, handler, local);
  21997. });
  21998. module.forEachGetter(function (getter, key) {
  21999. var namespacedType = namespace + key;
  22000. registerGetter(store, namespacedType, getter, local);
  22001. });
  22002. module.forEachChild(function (child, key) {
  22003. installModule(store, rootState, path.concat(key), child, hot);
  22004. });
  22005. }
  22006. /**
  22007. * make localized dispatch, commit, getters and state
  22008. * if there is no namespace, just use root ones
  22009. */
  22010. function makeLocalContext (store, namespace, path) {
  22011. var noNamespace = namespace === '';
  22012. var local = {
  22013. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  22014. var args = unifyObjectStyle(_type, _payload, _options);
  22015. var payload = args.payload;
  22016. var options = args.options;
  22017. var type = args.type;
  22018. if (!options || !options.root) {
  22019. type = namespace + type;
  22020. if (( true) && !store._actions[type]) {
  22021. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  22022. return
  22023. }
  22024. }
  22025. return store.dispatch(type, payload)
  22026. },
  22027. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  22028. var args = unifyObjectStyle(_type, _payload, _options);
  22029. var payload = args.payload;
  22030. var options = args.options;
  22031. var type = args.type;
  22032. if (!options || !options.root) {
  22033. type = namespace + type;
  22034. if (( true) && !store._mutations[type]) {
  22035. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  22036. return
  22037. }
  22038. }
  22039. store.commit(type, payload, options);
  22040. }
  22041. };
  22042. // getters and state object must be gotten lazily
  22043. // because they will be changed by vm update
  22044. Object.defineProperties(local, {
  22045. getters: {
  22046. get: noNamespace
  22047. ? function () { return store.getters; }
  22048. : function () { return makeLocalGetters(store, namespace); }
  22049. },
  22050. state: {
  22051. get: function () { return getNestedState(store.state, path); }
  22052. }
  22053. });
  22054. return local
  22055. }
  22056. function makeLocalGetters (store, namespace) {
  22057. if (!store._makeLocalGettersCache[namespace]) {
  22058. var gettersProxy = {};
  22059. var splitPos = namespace.length;
  22060. Object.keys(store.getters).forEach(function (type) {
  22061. // skip if the target getter is not match this namespace
  22062. if (type.slice(0, splitPos) !== namespace) { return }
  22063. // extract local getter type
  22064. var localType = type.slice(splitPos);
  22065. // Add a port to the getters proxy.
  22066. // Define as getter property because
  22067. // we do not want to evaluate the getters in this time.
  22068. Object.defineProperty(gettersProxy, localType, {
  22069. get: function () { return store.getters[type]; },
  22070. enumerable: true
  22071. });
  22072. });
  22073. store._makeLocalGettersCache[namespace] = gettersProxy;
  22074. }
  22075. return store._makeLocalGettersCache[namespace]
  22076. }
  22077. function registerMutation (store, type, handler, local) {
  22078. var entry = store._mutations[type] || (store._mutations[type] = []);
  22079. entry.push(function wrappedMutationHandler (payload) {
  22080. handler.call(store, local.state, payload);
  22081. });
  22082. }
  22083. function registerAction (store, type, handler, local) {
  22084. var entry = store._actions[type] || (store._actions[type] = []);
  22085. entry.push(function wrappedActionHandler (payload) {
  22086. var res = handler.call(store, {
  22087. dispatch: local.dispatch,
  22088. commit: local.commit,
  22089. getters: local.getters,
  22090. state: local.state,
  22091. rootGetters: store.getters,
  22092. rootState: store.state
  22093. }, payload);
  22094. if (!isPromise(res)) {
  22095. res = Promise.resolve(res);
  22096. }
  22097. if (store._devtoolHook) {
  22098. return res.catch(function (err) {
  22099. store._devtoolHook.emit('vuex:error', err);
  22100. throw err
  22101. })
  22102. } else {
  22103. return res
  22104. }
  22105. });
  22106. }
  22107. function registerGetter (store, type, rawGetter, local) {
  22108. if (store._wrappedGetters[type]) {
  22109. if ((true)) {
  22110. console.error(("[vuex] duplicate getter key: " + type));
  22111. }
  22112. return
  22113. }
  22114. store._wrappedGetters[type] = function wrappedGetter (store) {
  22115. return rawGetter(
  22116. local.state, // local state
  22117. local.getters, // local getters
  22118. store.state, // root state
  22119. store.getters // root getters
  22120. )
  22121. };
  22122. }
  22123. function enableStrictMode (store) {
  22124. store._vm.$watch(function () { return this._data.$$state }, function () {
  22125. if ((true)) {
  22126. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  22127. }
  22128. }, { deep: true, sync: true });
  22129. }
  22130. function getNestedState (state, path) {
  22131. return path.reduce(function (state, key) { return state[key]; }, state)
  22132. }
  22133. function unifyObjectStyle (type, payload, options) {
  22134. if (isObject(type) && type.type) {
  22135. options = payload;
  22136. payload = type;
  22137. type = type.type;
  22138. }
  22139. if ((true)) {
  22140. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  22141. }
  22142. return { type: type, payload: payload, options: options }
  22143. }
  22144. function install (_Vue) {
  22145. if (Vue && _Vue === Vue) {
  22146. if ((true)) {
  22147. console.error(
  22148. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  22149. );
  22150. }
  22151. return
  22152. }
  22153. Vue = _Vue;
  22154. applyMixin(Vue);
  22155. }
  22156. /**
  22157. * Reduce the code which written in Vue.js for getting the state.
  22158. * @param {String} [namespace] - Module's namespace
  22159. * @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.
  22160. * @param {Object}
  22161. */
  22162. var mapState = normalizeNamespace(function (namespace, states) {
  22163. var res = {};
  22164. if (( true) && !isValidMap(states)) {
  22165. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  22166. }
  22167. normalizeMap(states).forEach(function (ref) {
  22168. var key = ref.key;
  22169. var val = ref.val;
  22170. res[key] = function mappedState () {
  22171. var state = this.$store.state;
  22172. var getters = this.$store.getters;
  22173. if (namespace) {
  22174. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  22175. if (!module) {
  22176. return
  22177. }
  22178. state = module.context.state;
  22179. getters = module.context.getters;
  22180. }
  22181. return typeof val === 'function'
  22182. ? val.call(this, state, getters)
  22183. : state[val]
  22184. };
  22185. // mark vuex getter for devtools
  22186. res[key].vuex = true;
  22187. });
  22188. return res
  22189. });
  22190. /**
  22191. * Reduce the code which written in Vue.js for committing the mutation
  22192. * @param {String} [namespace] - Module's namespace
  22193. * @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.
  22194. * @return {Object}
  22195. */
  22196. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  22197. var res = {};
  22198. if (( true) && !isValidMap(mutations)) {
  22199. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  22200. }
  22201. normalizeMap(mutations).forEach(function (ref) {
  22202. var key = ref.key;
  22203. var val = ref.val;
  22204. res[key] = function mappedMutation () {
  22205. var args = [], len = arguments.length;
  22206. while ( len-- ) args[ len ] = arguments[ len ];
  22207. // Get the commit method from store
  22208. var commit = this.$store.commit;
  22209. if (namespace) {
  22210. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  22211. if (!module) {
  22212. return
  22213. }
  22214. commit = module.context.commit;
  22215. }
  22216. return typeof val === 'function'
  22217. ? val.apply(this, [commit].concat(args))
  22218. : commit.apply(this.$store, [val].concat(args))
  22219. };
  22220. });
  22221. return res
  22222. });
  22223. /**
  22224. * Reduce the code which written in Vue.js for getting the getters
  22225. * @param {String} [namespace] - Module's namespace
  22226. * @param {Object|Array} getters
  22227. * @return {Object}
  22228. */
  22229. var mapGetters = normalizeNamespace(function (namespace, getters) {
  22230. var res = {};
  22231. if (( true) && !isValidMap(getters)) {
  22232. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  22233. }
  22234. normalizeMap(getters).forEach(function (ref) {
  22235. var key = ref.key;
  22236. var val = ref.val;
  22237. // The namespace has been mutated by normalizeNamespace
  22238. val = namespace + val;
  22239. res[key] = function mappedGetter () {
  22240. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  22241. return
  22242. }
  22243. if (( true) && !(val in this.$store.getters)) {
  22244. console.error(("[vuex] unknown getter: " + val));
  22245. return
  22246. }
  22247. return this.$store.getters[val]
  22248. };
  22249. // mark vuex getter for devtools
  22250. res[key].vuex = true;
  22251. });
  22252. return res
  22253. });
  22254. /**
  22255. * Reduce the code which written in Vue.js for dispatch the action
  22256. * @param {String} [namespace] - Module's namespace
  22257. * @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.
  22258. * @return {Object}
  22259. */
  22260. var mapActions = normalizeNamespace(function (namespace, actions) {
  22261. var res = {};
  22262. if (( true) && !isValidMap(actions)) {
  22263. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  22264. }
  22265. normalizeMap(actions).forEach(function (ref) {
  22266. var key = ref.key;
  22267. var val = ref.val;
  22268. res[key] = function mappedAction () {
  22269. var args = [], len = arguments.length;
  22270. while ( len-- ) args[ len ] = arguments[ len ];
  22271. // get dispatch function from store
  22272. var dispatch = this.$store.dispatch;
  22273. if (namespace) {
  22274. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  22275. if (!module) {
  22276. return
  22277. }
  22278. dispatch = module.context.dispatch;
  22279. }
  22280. return typeof val === 'function'
  22281. ? val.apply(this, [dispatch].concat(args))
  22282. : dispatch.apply(this.$store, [val].concat(args))
  22283. };
  22284. });
  22285. return res
  22286. });
  22287. /**
  22288. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  22289. * @param {String} namespace
  22290. * @return {Object}
  22291. */
  22292. var createNamespacedHelpers = function (namespace) { return ({
  22293. mapState: mapState.bind(null, namespace),
  22294. mapGetters: mapGetters.bind(null, namespace),
  22295. mapMutations: mapMutations.bind(null, namespace),
  22296. mapActions: mapActions.bind(null, namespace)
  22297. }); };
  22298. /**
  22299. * Normalize the map
  22300. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  22301. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  22302. * @param {Array|Object} map
  22303. * @return {Object}
  22304. */
  22305. function normalizeMap (map) {
  22306. if (!isValidMap(map)) {
  22307. return []
  22308. }
  22309. return Array.isArray(map)
  22310. ? map.map(function (key) { return ({ key: key, val: key }); })
  22311. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  22312. }
  22313. /**
  22314. * Validate whether given map is valid or not
  22315. * @param {*} map
  22316. * @return {Boolean}
  22317. */
  22318. function isValidMap (map) {
  22319. return Array.isArray(map) || isObject(map)
  22320. }
  22321. /**
  22322. * 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.
  22323. * @param {Function} fn
  22324. * @return {Function}
  22325. */
  22326. function normalizeNamespace (fn) {
  22327. return function (namespace, map) {
  22328. if (typeof namespace !== 'string') {
  22329. map = namespace;
  22330. namespace = '';
  22331. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  22332. namespace += '/';
  22333. }
  22334. return fn(namespace, map)
  22335. }
  22336. }
  22337. /**
  22338. * Search a special module from store by namespace. if module not exist, print error message.
  22339. * @param {Object} store
  22340. * @param {String} helper
  22341. * @param {String} namespace
  22342. * @return {Object}
  22343. */
  22344. function getModuleByNamespace (store, helper, namespace) {
  22345. var module = store._modulesNamespaceMap[namespace];
  22346. if (( true) && !module) {
  22347. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  22348. }
  22349. return module
  22350. }
  22351. // Credits: borrowed code from fcomb/redux-logger
  22352. function createLogger (ref) {
  22353. if ( ref === void 0 ) ref = {};
  22354. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  22355. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  22356. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  22357. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  22358. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  22359. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  22360. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  22361. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  22362. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  22363. return function (store) {
  22364. var prevState = deepCopy(store.state);
  22365. if (typeof logger === 'undefined') {
  22366. return
  22367. }
  22368. if (logMutations) {
  22369. store.subscribe(function (mutation, state) {
  22370. var nextState = deepCopy(state);
  22371. if (filter(mutation, prevState, nextState)) {
  22372. var formattedTime = getFormattedTime();
  22373. var formattedMutation = mutationTransformer(mutation);
  22374. var message = "mutation " + (mutation.type) + formattedTime;
  22375. startMessage(logger, message, collapsed);
  22376. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  22377. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  22378. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  22379. endMessage(logger);
  22380. }
  22381. prevState = nextState;
  22382. });
  22383. }
  22384. if (logActions) {
  22385. store.subscribeAction(function (action, state) {
  22386. if (actionFilter(action, state)) {
  22387. var formattedTime = getFormattedTime();
  22388. var formattedAction = actionTransformer(action);
  22389. var message = "action " + (action.type) + formattedTime;
  22390. startMessage(logger, message, collapsed);
  22391. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  22392. endMessage(logger);
  22393. }
  22394. });
  22395. }
  22396. }
  22397. }
  22398. function startMessage (logger, message, collapsed) {
  22399. var startMessage = collapsed
  22400. ? logger.groupCollapsed
  22401. : logger.group;
  22402. // render
  22403. try {
  22404. startMessage.call(logger, message);
  22405. } catch (e) {
  22406. logger.log(message);
  22407. }
  22408. }
  22409. function endMessage (logger) {
  22410. try {
  22411. logger.groupEnd();
  22412. } catch (e) {
  22413. logger.log('—— log end ——');
  22414. }
  22415. }
  22416. function getFormattedTime () {
  22417. var time = new Date();
  22418. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  22419. }
  22420. function repeat (str, times) {
  22421. return (new Array(times + 1)).join(str)
  22422. }
  22423. function pad (num, maxLength) {
  22424. return repeat('0', maxLength - num.toString().length) + num
  22425. }
  22426. var index_cjs = {
  22427. Store: Store,
  22428. install: install,
  22429. version: '3.6.2',
  22430. mapState: mapState,
  22431. mapMutations: mapMutations,
  22432. mapGetters: mapGetters,
  22433. mapActions: mapActions,
  22434. createNamespacedHelpers: createNamespacedHelpers,
  22435. createLogger: createLogger
  22436. };
  22437. module.exports = index_cjs;
  22438. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  22439. /***/ })
  22440. }]);
  22441. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map