vendor.js 845 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function _toPropertyKey(arg) {
  84. var key = toPrimitive(arg, "string");
  85. return _typeof(key) === "symbol" ? key : String(key);
  86. }
  87. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(obj) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  98. return typeof obj;
  99. } : function (obj) {
  100. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 14:
  106. /*!************************************************************!*\
  107. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  108. \************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  112. function _toPrimitive(input, hint) {
  113. if (_typeof(input) !== "object" || input === null) return input;
  114. var prim = input[Symbol.toPrimitive];
  115. if (prim !== undefined) {
  116. var res = prim.call(input, hint || "default");
  117. if (_typeof(res) !== "object") return res;
  118. throw new TypeError("@@toPrimitive must return a primitive value.");
  119. }
  120. return (hint === "string" ? String : Number)(input);
  121. }
  122. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  123. /***/ }),
  124. /***/ 15:
  125. /*!**********************************************************!*\
  126. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  127. \**********************************************************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  131. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  132. function _construct(Parent, args, Class) {
  133. if (isNativeReflectConstruct()) {
  134. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  135. } else {
  136. module.exports = _construct = function _construct(Parent, args, Class) {
  137. var a = [null];
  138. a.push.apply(a, args);
  139. var Constructor = Function.bind.apply(Parent, a);
  140. var instance = new Constructor();
  141. if (Class) setPrototypeOf(instance, Class.prototype);
  142. return instance;
  143. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  144. }
  145. return _construct.apply(null, arguments);
  146. }
  147. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  148. /***/ }),
  149. /***/ 16:
  150. /*!***************************************************************!*\
  151. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  152. \***************************************************************/
  153. /*! no static exports found */
  154. /***/ (function(module, exports) {
  155. function _setPrototypeOf(o, p) {
  156. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  157. o.__proto__ = p;
  158. return o;
  159. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  160. return _setPrototypeOf(o, p);
  161. }
  162. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  163. /***/ }),
  164. /***/ 17:
  165. /*!*************************************************************************!*\
  166. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  167. \*************************************************************************/
  168. /*! no static exports found */
  169. /***/ (function(module, exports) {
  170. function _isNativeReflectConstruct() {
  171. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  172. if (Reflect.construct.sham) return false;
  173. if (typeof Proxy === "function") return true;
  174. try {
  175. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  176. return true;
  177. } catch (e) {
  178. return false;
  179. }
  180. }
  181. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  182. /***/ }),
  183. /***/ 18:
  184. /*!******************************************************************!*\
  185. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  186. \******************************************************************/
  187. /*! no static exports found */
  188. /***/ (function(module, exports, __webpack_require__) {
  189. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  190. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  191. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  192. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  193. function _toConsumableArray(arr) {
  194. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  195. }
  196. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  197. /***/ }),
  198. /***/ 19:
  199. /*!******************************************************************!*\
  200. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  201. \******************************************************************/
  202. /*! no static exports found */
  203. /***/ (function(module, exports, __webpack_require__) {
  204. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  205. function _arrayWithoutHoles(arr) {
  206. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  207. }
  208. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  209. /***/ }),
  210. /***/ 2:
  211. /*!************************************************************!*\
  212. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  213. \************************************************************/
  214. /*! no static exports found */
  215. /***/ (function(module, exports, __webpack_require__) {
  216. "use strict";
  217. /* WEBPACK VAR INJECTION */(function(wx, global) {
  218. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  219. Object.defineProperty(exports, "__esModule", {
  220. value: true
  221. });
  222. exports.createApp = createApp;
  223. exports.createComponent = createComponent;
  224. exports.createPage = createPage;
  225. exports.createPlugin = createPlugin;
  226. exports.createSubpackageApp = createSubpackageApp;
  227. exports.default = void 0;
  228. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  229. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  230. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  231. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  232. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  233. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  234. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  235. 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; }
  236. 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; }
  237. var realAtob;
  238. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  239. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  240. if (typeof atob !== 'function') {
  241. realAtob = function realAtob(str) {
  242. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  243. if (!b64re.test(str)) {
  244. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  245. }
  246. // Adding the padding if missing, for semplicity
  247. str += '=='.slice(2 - (str.length & 3));
  248. var bitmap;
  249. var result = '';
  250. var r1;
  251. var r2;
  252. var i = 0;
  253. for (; i < str.length;) {
  254. 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++)));
  255. 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);
  256. }
  257. return result;
  258. };
  259. } else {
  260. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  261. realAtob = atob;
  262. }
  263. function b64DecodeUnicode(str) {
  264. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  265. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  266. }).join(''));
  267. }
  268. function getCurrentUserInfo() {
  269. var token = wx.getStorageSync('uni_id_token') || '';
  270. var tokenArr = token.split('.');
  271. if (!token || tokenArr.length !== 3) {
  272. return {
  273. uid: null,
  274. role: [],
  275. permission: [],
  276. tokenExpired: 0
  277. };
  278. }
  279. var userInfo;
  280. try {
  281. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  282. } catch (error) {
  283. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  284. }
  285. userInfo.tokenExpired = userInfo.exp * 1000;
  286. delete userInfo.exp;
  287. delete userInfo.iat;
  288. return userInfo;
  289. }
  290. function uniIdMixin(Vue) {
  291. Vue.prototype.uniIDHasRole = function (roleId) {
  292. var _getCurrentUserInfo = getCurrentUserInfo(),
  293. role = _getCurrentUserInfo.role;
  294. return role.indexOf(roleId) > -1;
  295. };
  296. Vue.prototype.uniIDHasPermission = function (permissionId) {
  297. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  298. permission = _getCurrentUserInfo2.permission;
  299. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  300. };
  301. Vue.prototype.uniIDTokenValid = function () {
  302. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  303. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  304. return tokenExpired > Date.now();
  305. };
  306. }
  307. var _toString = Object.prototype.toString;
  308. var hasOwnProperty = Object.prototype.hasOwnProperty;
  309. function isFn(fn) {
  310. return typeof fn === 'function';
  311. }
  312. function isStr(str) {
  313. return typeof str === 'string';
  314. }
  315. function isObject(obj) {
  316. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  317. }
  318. function isPlainObject(obj) {
  319. return _toString.call(obj) === '[object Object]';
  320. }
  321. function hasOwn(obj, key) {
  322. return hasOwnProperty.call(obj, key);
  323. }
  324. function noop() {}
  325. /**
  326. * Create a cached version of a pure function.
  327. */
  328. function cached(fn) {
  329. var cache = Object.create(null);
  330. return function cachedFn(str) {
  331. var hit = cache[str];
  332. return hit || (cache[str] = fn(str));
  333. };
  334. }
  335. /**
  336. * Camelize a hyphen-delimited string.
  337. */
  338. var camelizeRE = /-(\w)/g;
  339. var camelize = cached(function (str) {
  340. return str.replace(camelizeRE, function (_, c) {
  341. return c ? c.toUpperCase() : '';
  342. });
  343. });
  344. function sortObject(obj) {
  345. var sortObj = {};
  346. if (isPlainObject(obj)) {
  347. Object.keys(obj).sort().forEach(function (key) {
  348. sortObj[key] = obj[key];
  349. });
  350. }
  351. return !Object.keys(sortObj) ? obj : sortObj;
  352. }
  353. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  354. var globalInterceptors = {};
  355. var scopedInterceptors = {};
  356. function mergeHook(parentVal, childVal) {
  357. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  358. return res ? dedupeHooks(res) : res;
  359. }
  360. function dedupeHooks(hooks) {
  361. var res = [];
  362. for (var i = 0; i < hooks.length; i++) {
  363. if (res.indexOf(hooks[i]) === -1) {
  364. res.push(hooks[i]);
  365. }
  366. }
  367. return res;
  368. }
  369. function removeHook(hooks, hook) {
  370. var index = hooks.indexOf(hook);
  371. if (index !== -1) {
  372. hooks.splice(index, 1);
  373. }
  374. }
  375. function mergeInterceptorHook(interceptor, option) {
  376. Object.keys(option).forEach(function (hook) {
  377. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  378. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  379. }
  380. });
  381. }
  382. function removeInterceptorHook(interceptor, option) {
  383. if (!interceptor || !option) {
  384. return;
  385. }
  386. Object.keys(option).forEach(function (hook) {
  387. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  388. removeHook(interceptor[hook], option[hook]);
  389. }
  390. });
  391. }
  392. function addInterceptor(method, option) {
  393. if (typeof method === 'string' && isPlainObject(option)) {
  394. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  395. } else if (isPlainObject(method)) {
  396. mergeInterceptorHook(globalInterceptors, method);
  397. }
  398. }
  399. function removeInterceptor(method, option) {
  400. if (typeof method === 'string') {
  401. if (isPlainObject(option)) {
  402. removeInterceptorHook(scopedInterceptors[method], option);
  403. } else {
  404. delete scopedInterceptors[method];
  405. }
  406. } else if (isPlainObject(method)) {
  407. removeInterceptorHook(globalInterceptors, method);
  408. }
  409. }
  410. function wrapperHook(hook, params) {
  411. return function (data) {
  412. return hook(data, params) || data;
  413. };
  414. }
  415. function isPromise(obj) {
  416. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  417. }
  418. function queue(hooks, data, params) {
  419. var promise = false;
  420. for (var i = 0; i < hooks.length; i++) {
  421. var hook = hooks[i];
  422. if (promise) {
  423. promise = Promise.resolve(wrapperHook(hook, params));
  424. } else {
  425. var res = hook(data, params);
  426. if (isPromise(res)) {
  427. promise = Promise.resolve(res);
  428. }
  429. if (res === false) {
  430. return {
  431. then: function then() {}
  432. };
  433. }
  434. }
  435. }
  436. return promise || {
  437. then: function then(callback) {
  438. return callback(data);
  439. }
  440. };
  441. }
  442. function wrapperOptions(interceptor) {
  443. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  444. ['success', 'fail', 'complete'].forEach(function (name) {
  445. if (Array.isArray(interceptor[name])) {
  446. var oldCallback = options[name];
  447. options[name] = function callbackInterceptor(res) {
  448. queue(interceptor[name], res, options).then(function (res) {
  449. /* eslint-disable no-mixed-operators */
  450. return isFn(oldCallback) && oldCallback(res) || res;
  451. });
  452. };
  453. }
  454. });
  455. return options;
  456. }
  457. function wrapperReturnValue(method, returnValue) {
  458. var returnValueHooks = [];
  459. if (Array.isArray(globalInterceptors.returnValue)) {
  460. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  461. }
  462. var interceptor = scopedInterceptors[method];
  463. if (interceptor && Array.isArray(interceptor.returnValue)) {
  464. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  465. }
  466. returnValueHooks.forEach(function (hook) {
  467. returnValue = hook(returnValue) || returnValue;
  468. });
  469. return returnValue;
  470. }
  471. function getApiInterceptorHooks(method) {
  472. var interceptor = Object.create(null);
  473. Object.keys(globalInterceptors).forEach(function (hook) {
  474. if (hook !== 'returnValue') {
  475. interceptor[hook] = globalInterceptors[hook].slice();
  476. }
  477. });
  478. var scopedInterceptor = scopedInterceptors[method];
  479. if (scopedInterceptor) {
  480. Object.keys(scopedInterceptor).forEach(function (hook) {
  481. if (hook !== 'returnValue') {
  482. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  483. }
  484. });
  485. }
  486. return interceptor;
  487. }
  488. function invokeApi(method, api, options) {
  489. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  490. params[_key - 3] = arguments[_key];
  491. }
  492. var interceptor = getApiInterceptorHooks(method);
  493. if (interceptor && Object.keys(interceptor).length) {
  494. if (Array.isArray(interceptor.invoke)) {
  495. var res = queue(interceptor.invoke, options);
  496. return res.then(function (options) {
  497. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  498. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  499. });
  500. } else {
  501. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  502. }
  503. }
  504. return api.apply(void 0, [options].concat(params));
  505. }
  506. var promiseInterceptor = {
  507. returnValue: function returnValue(res) {
  508. if (!isPromise(res)) {
  509. return res;
  510. }
  511. return new Promise(function (resolve, reject) {
  512. res.then(function (res) {
  513. if (res[0]) {
  514. reject(res[0]);
  515. } else {
  516. resolve(res[1]);
  517. }
  518. });
  519. });
  520. }
  521. };
  522. 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/;
  523. var CONTEXT_API_RE = /^create|Manager$/;
  524. // Context例外情况
  525. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  526. // 同步例外情况
  527. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  528. var CALLBACK_API_RE = /^on|^off/;
  529. function isContextApi(name) {
  530. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  531. }
  532. function isSyncApi(name) {
  533. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  534. }
  535. function isCallbackApi(name) {
  536. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  537. }
  538. function handlePromise(promise) {
  539. return promise.then(function (data) {
  540. return [null, data];
  541. }).catch(function (err) {
  542. return [err];
  543. });
  544. }
  545. function shouldPromise(name) {
  546. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  547. return false;
  548. }
  549. return true;
  550. }
  551. /* eslint-disable no-extend-native */
  552. if (!Promise.prototype.finally) {
  553. Promise.prototype.finally = function (callback) {
  554. var promise = this.constructor;
  555. return this.then(function (value) {
  556. return promise.resolve(callback()).then(function () {
  557. return value;
  558. });
  559. }, function (reason) {
  560. return promise.resolve(callback()).then(function () {
  561. throw reason;
  562. });
  563. });
  564. };
  565. }
  566. function promisify(name, api) {
  567. if (!shouldPromise(name) || !isFn(api)) {
  568. return api;
  569. }
  570. return function promiseApi() {
  571. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  572. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  573. params[_key2 - 1] = arguments[_key2];
  574. }
  575. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  576. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  577. }
  578. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  579. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  580. success: resolve,
  581. fail: reject
  582. })].concat(params));
  583. })));
  584. };
  585. }
  586. var EPS = 1e-4;
  587. var BASE_DEVICE_WIDTH = 750;
  588. var isIOS = false;
  589. var deviceWidth = 0;
  590. var deviceDPR = 0;
  591. function checkDeviceWidth() {
  592. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  593. platform = _wx$getSystemInfoSync.platform,
  594. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  595. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  596. deviceWidth = windowWidth;
  597. deviceDPR = pixelRatio;
  598. isIOS = platform === 'ios';
  599. }
  600. function upx2px(number, newDeviceWidth) {
  601. if (deviceWidth === 0) {
  602. checkDeviceWidth();
  603. }
  604. number = Number(number);
  605. if (number === 0) {
  606. return 0;
  607. }
  608. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  609. if (result < 0) {
  610. result = -result;
  611. }
  612. result = Math.floor(result + EPS);
  613. if (result === 0) {
  614. if (deviceDPR === 1 || !isIOS) {
  615. result = 1;
  616. } else {
  617. result = 0.5;
  618. }
  619. }
  620. return number < 0 ? -result : result;
  621. }
  622. var LOCALE_ZH_HANS = 'zh-Hans';
  623. var LOCALE_ZH_HANT = 'zh-Hant';
  624. var LOCALE_EN = 'en';
  625. var LOCALE_FR = 'fr';
  626. var LOCALE_ES = 'es';
  627. var messages = {};
  628. var locale;
  629. {
  630. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  631. }
  632. function initI18nMessages() {
  633. if (!isEnableLocale()) {
  634. return;
  635. }
  636. var localeKeys = Object.keys(__uniConfig.locales);
  637. if (localeKeys.length) {
  638. localeKeys.forEach(function (locale) {
  639. var curMessages = messages[locale];
  640. var userMessages = __uniConfig.locales[locale];
  641. if (curMessages) {
  642. Object.assign(curMessages, userMessages);
  643. } else {
  644. messages[locale] = userMessages;
  645. }
  646. });
  647. }
  648. }
  649. initI18nMessages();
  650. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  651. var t = i18n.t;
  652. var i18nMixin = i18n.mixin = {
  653. beforeCreate: function beforeCreate() {
  654. var _this = this;
  655. var unwatch = i18n.i18n.watchLocale(function () {
  656. _this.$forceUpdate();
  657. });
  658. this.$once('hook:beforeDestroy', function () {
  659. unwatch();
  660. });
  661. },
  662. methods: {
  663. $$t: function $$t(key, values) {
  664. return t(key, values);
  665. }
  666. }
  667. };
  668. var setLocale = i18n.setLocale;
  669. var getLocale = i18n.getLocale;
  670. function initAppLocale(Vue, appVm, locale) {
  671. var state = Vue.observable({
  672. locale: locale || i18n.getLocale()
  673. });
  674. var localeWatchers = [];
  675. appVm.$watchLocale = function (fn) {
  676. localeWatchers.push(fn);
  677. };
  678. Object.defineProperty(appVm, '$locale', {
  679. get: function get() {
  680. return state.locale;
  681. },
  682. set: function set(v) {
  683. state.locale = v;
  684. localeWatchers.forEach(function (watch) {
  685. return watch(v);
  686. });
  687. }
  688. });
  689. }
  690. function isEnableLocale() {
  691. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  692. }
  693. function include(str, parts) {
  694. return !!parts.find(function (part) {
  695. return str.indexOf(part) !== -1;
  696. });
  697. }
  698. function startsWith(str, parts) {
  699. return parts.find(function (part) {
  700. return str.indexOf(part) === 0;
  701. });
  702. }
  703. function normalizeLocale(locale, messages) {
  704. if (!locale) {
  705. return;
  706. }
  707. locale = locale.trim().replace(/_/g, '-');
  708. if (messages && messages[locale]) {
  709. return locale;
  710. }
  711. locale = locale.toLowerCase();
  712. if (locale === 'chinese') {
  713. // 支付宝
  714. return LOCALE_ZH_HANS;
  715. }
  716. if (locale.indexOf('zh') === 0) {
  717. if (locale.indexOf('-hans') > -1) {
  718. return LOCALE_ZH_HANS;
  719. }
  720. if (locale.indexOf('-hant') > -1) {
  721. return LOCALE_ZH_HANT;
  722. }
  723. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  724. return LOCALE_ZH_HANT;
  725. }
  726. return LOCALE_ZH_HANS;
  727. }
  728. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  729. if (lang) {
  730. return lang;
  731. }
  732. }
  733. // export function initI18n() {
  734. // const localeKeys = Object.keys(__uniConfig.locales || {})
  735. // if (localeKeys.length) {
  736. // localeKeys.forEach((locale) =>
  737. // i18n.add(locale, __uniConfig.locales[locale])
  738. // )
  739. // }
  740. // }
  741. function getLocale$1() {
  742. // 优先使用 $locale
  743. if (isFn(getApp)) {
  744. var app = getApp({
  745. allowDefault: true
  746. });
  747. if (app && app.$vm) {
  748. return app.$vm.$locale;
  749. }
  750. }
  751. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  752. }
  753. function setLocale$1(locale) {
  754. var app = isFn(getApp) ? getApp() : false;
  755. if (!app) {
  756. return false;
  757. }
  758. var oldLocale = app.$vm.$locale;
  759. if (oldLocale !== locale) {
  760. app.$vm.$locale = locale;
  761. onLocaleChangeCallbacks.forEach(function (fn) {
  762. return fn({
  763. locale: locale
  764. });
  765. });
  766. return true;
  767. }
  768. return false;
  769. }
  770. var onLocaleChangeCallbacks = [];
  771. function onLocaleChange(fn) {
  772. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  773. onLocaleChangeCallbacks.push(fn);
  774. }
  775. }
  776. if (typeof global !== 'undefined') {
  777. global.getLocale = getLocale$1;
  778. }
  779. var interceptors = {
  780. promiseInterceptor: promiseInterceptor
  781. };
  782. var baseApi = /*#__PURE__*/Object.freeze({
  783. __proto__: null,
  784. upx2px: upx2px,
  785. getLocale: getLocale$1,
  786. setLocale: setLocale$1,
  787. onLocaleChange: onLocaleChange,
  788. addInterceptor: addInterceptor,
  789. removeInterceptor: removeInterceptor,
  790. interceptors: interceptors
  791. });
  792. function findExistsPageIndex(url) {
  793. var pages = getCurrentPages();
  794. var len = pages.length;
  795. while (len--) {
  796. var page = pages[len];
  797. if (page.$page && page.$page.fullPath === url) {
  798. return len;
  799. }
  800. }
  801. return -1;
  802. }
  803. var redirectTo = {
  804. name: function name(fromArgs) {
  805. if (fromArgs.exists === 'back' && fromArgs.delta) {
  806. return 'navigateBack';
  807. }
  808. return 'redirectTo';
  809. },
  810. args: function args(fromArgs) {
  811. if (fromArgs.exists === 'back' && fromArgs.url) {
  812. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  813. if (existsPageIndex !== -1) {
  814. var delta = getCurrentPages().length - 1 - existsPageIndex;
  815. if (delta > 0) {
  816. fromArgs.delta = delta;
  817. }
  818. }
  819. }
  820. }
  821. };
  822. var previewImage = {
  823. args: function args(fromArgs) {
  824. var currentIndex = parseInt(fromArgs.current);
  825. if (isNaN(currentIndex)) {
  826. return;
  827. }
  828. var urls = fromArgs.urls;
  829. if (!Array.isArray(urls)) {
  830. return;
  831. }
  832. var len = urls.length;
  833. if (!len) {
  834. return;
  835. }
  836. if (currentIndex < 0) {
  837. currentIndex = 0;
  838. } else if (currentIndex >= len) {
  839. currentIndex = len - 1;
  840. }
  841. if (currentIndex > 0) {
  842. fromArgs.current = urls[currentIndex];
  843. fromArgs.urls = urls.filter(function (item, index) {
  844. return index < currentIndex ? item !== urls[currentIndex] : true;
  845. });
  846. } else {
  847. fromArgs.current = urls[0];
  848. }
  849. return {
  850. indicator: false,
  851. loop: false
  852. };
  853. }
  854. };
  855. var UUID_KEY = '__DC_STAT_UUID';
  856. var deviceId;
  857. function useDeviceId(result) {
  858. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  859. if (!deviceId) {
  860. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  861. wx.setStorage({
  862. key: UUID_KEY,
  863. data: deviceId
  864. });
  865. }
  866. result.deviceId = deviceId;
  867. }
  868. function addSafeAreaInsets(result) {
  869. if (result.safeArea) {
  870. var safeArea = result.safeArea;
  871. result.safeAreaInsets = {
  872. top: safeArea.top,
  873. left: safeArea.left,
  874. right: result.windowWidth - safeArea.right,
  875. bottom: result.screenHeight - safeArea.bottom
  876. };
  877. }
  878. }
  879. function populateParameters(result) {
  880. var _result$brand = result.brand,
  881. brand = _result$brand === void 0 ? '' : _result$brand,
  882. _result$model = result.model,
  883. model = _result$model === void 0 ? '' : _result$model,
  884. _result$system = result.system,
  885. system = _result$system === void 0 ? '' : _result$system,
  886. _result$language = result.language,
  887. language = _result$language === void 0 ? '' : _result$language,
  888. theme = result.theme,
  889. version = result.version,
  890. platform = result.platform,
  891. fontSizeSetting = result.fontSizeSetting,
  892. SDKVersion = result.SDKVersion,
  893. pixelRatio = result.pixelRatio,
  894. deviceOrientation = result.deviceOrientation;
  895. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  896. var extraParam = {};
  897. // osName osVersion
  898. var osName = '';
  899. var osVersion = '';
  900. {
  901. osName = system.split(' ')[0] || '';
  902. osVersion = system.split(' ')[1] || '';
  903. }
  904. var hostVersion = version;
  905. // deviceType
  906. var deviceType = getGetDeviceType(result, model);
  907. // deviceModel
  908. var deviceBrand = getDeviceBrand(brand);
  909. // hostName
  910. var _hostName = getHostName(result);
  911. // deviceOrientation
  912. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  913. // devicePixelRatio
  914. var _devicePixelRatio = pixelRatio;
  915. // SDKVersion
  916. var _SDKVersion = SDKVersion;
  917. // hostLanguage
  918. var hostLanguage = language.replace(/_/g, '-');
  919. // wx.getAccountInfoSync
  920. var parameters = {
  921. appId: "__UNI__617FB52",
  922. appName: "test",
  923. appVersion: "1.0.0",
  924. appVersionCode: "100",
  925. appLanguage: getAppLanguage(hostLanguage),
  926. uniCompileVersion: "3.8.7",
  927. uniRuntimeVersion: "3.8.7",
  928. uniPlatform: undefined || "mp-weixin",
  929. deviceBrand: deviceBrand,
  930. deviceModel: model,
  931. deviceType: deviceType,
  932. devicePixelRatio: _devicePixelRatio,
  933. deviceOrientation: _deviceOrientation,
  934. osName: osName.toLocaleLowerCase(),
  935. osVersion: osVersion,
  936. hostTheme: theme,
  937. hostVersion: hostVersion,
  938. hostLanguage: hostLanguage,
  939. hostName: _hostName,
  940. hostSDKVersion: _SDKVersion,
  941. hostFontSizeSetting: fontSizeSetting,
  942. windowTop: 0,
  943. windowBottom: 0,
  944. // TODO
  945. osLanguage: undefined,
  946. osTheme: undefined,
  947. ua: undefined,
  948. hostPackageName: undefined,
  949. browserName: undefined,
  950. browserVersion: undefined
  951. };
  952. Object.assign(result, parameters, extraParam);
  953. }
  954. function getGetDeviceType(result, model) {
  955. var deviceType = result.deviceType || 'phone';
  956. {
  957. var deviceTypeMaps = {
  958. ipad: 'pad',
  959. windows: 'pc',
  960. mac: 'pc'
  961. };
  962. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  963. var _model = model.toLocaleLowerCase();
  964. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  965. var _m = deviceTypeMapsKeys[index];
  966. if (_model.indexOf(_m) !== -1) {
  967. deviceType = deviceTypeMaps[_m];
  968. break;
  969. }
  970. }
  971. }
  972. return deviceType;
  973. }
  974. function getDeviceBrand(brand) {
  975. var deviceBrand = brand;
  976. if (deviceBrand) {
  977. deviceBrand = brand.toLocaleLowerCase();
  978. }
  979. return deviceBrand;
  980. }
  981. function getAppLanguage(defaultLanguage) {
  982. return getLocale$1 ? getLocale$1() : defaultLanguage;
  983. }
  984. function getHostName(result) {
  985. var _platform = 'WeChat';
  986. var _hostName = result.hostName || _platform; // mp-jd
  987. {
  988. if (result.environment) {
  989. _hostName = result.environment;
  990. } else if (result.host && result.host.env) {
  991. _hostName = result.host.env;
  992. }
  993. }
  994. return _hostName;
  995. }
  996. var getSystemInfo = {
  997. returnValue: function returnValue(result) {
  998. useDeviceId(result);
  999. addSafeAreaInsets(result);
  1000. populateParameters(result);
  1001. }
  1002. };
  1003. var showActionSheet = {
  1004. args: function args(fromArgs) {
  1005. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1006. fromArgs.alertText = fromArgs.title;
  1007. }
  1008. }
  1009. };
  1010. var getAppBaseInfo = {
  1011. returnValue: function returnValue(result) {
  1012. var _result = result,
  1013. version = _result.version,
  1014. language = _result.language,
  1015. SDKVersion = _result.SDKVersion,
  1016. theme = _result.theme;
  1017. var _hostName = getHostName(result);
  1018. var hostLanguage = language.replace('_', '-');
  1019. result = sortObject(Object.assign(result, {
  1020. appId: "__UNI__617FB52",
  1021. appName: "test",
  1022. appVersion: "1.0.0",
  1023. appVersionCode: "100",
  1024. appLanguage: getAppLanguage(hostLanguage),
  1025. hostVersion: version,
  1026. hostLanguage: hostLanguage,
  1027. hostName: _hostName,
  1028. hostSDKVersion: SDKVersion,
  1029. hostTheme: theme
  1030. }));
  1031. }
  1032. };
  1033. var getDeviceInfo = {
  1034. returnValue: function returnValue(result) {
  1035. var _result2 = result,
  1036. brand = _result2.brand,
  1037. model = _result2.model;
  1038. var deviceType = getGetDeviceType(result, model);
  1039. var deviceBrand = getDeviceBrand(brand);
  1040. useDeviceId(result);
  1041. result = sortObject(Object.assign(result, {
  1042. deviceType: deviceType,
  1043. deviceBrand: deviceBrand,
  1044. deviceModel: model
  1045. }));
  1046. }
  1047. };
  1048. var getWindowInfo = {
  1049. returnValue: function returnValue(result) {
  1050. addSafeAreaInsets(result);
  1051. result = sortObject(Object.assign(result, {
  1052. windowTop: 0,
  1053. windowBottom: 0
  1054. }));
  1055. }
  1056. };
  1057. var getAppAuthorizeSetting = {
  1058. returnValue: function returnValue(result) {
  1059. var locationReducedAccuracy = result.locationReducedAccuracy;
  1060. result.locationAccuracy = 'unsupported';
  1061. if (locationReducedAccuracy === true) {
  1062. result.locationAccuracy = 'reduced';
  1063. } else if (locationReducedAccuracy === false) {
  1064. result.locationAccuracy = 'full';
  1065. }
  1066. }
  1067. };
  1068. // import navigateTo from 'uni-helpers/navigate-to'
  1069. var compressImage = {
  1070. args: function args(fromArgs) {
  1071. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1072. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1073. fromArgs.compressHeight = fromArgs.compressedHeight;
  1074. }
  1075. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1076. fromArgs.compressWidth = fromArgs.compressedWidth;
  1077. }
  1078. }
  1079. };
  1080. var protocols = {
  1081. redirectTo: redirectTo,
  1082. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1083. previewImage: previewImage,
  1084. getSystemInfo: getSystemInfo,
  1085. getSystemInfoSync: getSystemInfo,
  1086. showActionSheet: showActionSheet,
  1087. getAppBaseInfo: getAppBaseInfo,
  1088. getDeviceInfo: getDeviceInfo,
  1089. getWindowInfo: getWindowInfo,
  1090. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1091. compressImage: compressImage
  1092. };
  1093. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1094. var canIUses = [];
  1095. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1096. function processCallback(methodName, method, returnValue) {
  1097. return function (res) {
  1098. return method(processReturnValue(methodName, res, returnValue));
  1099. };
  1100. }
  1101. function processArgs(methodName, fromArgs) {
  1102. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1103. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1104. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1105. if (isPlainObject(fromArgs)) {
  1106. // 一般 api 的参数解析
  1107. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1108. if (isFn(argsOption)) {
  1109. argsOption = argsOption(fromArgs, toArgs) || {};
  1110. }
  1111. for (var key in fromArgs) {
  1112. if (hasOwn(argsOption, key)) {
  1113. var keyOption = argsOption[key];
  1114. if (isFn(keyOption)) {
  1115. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1116. }
  1117. if (!keyOption) {
  1118. // 不支持的参数
  1119. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1120. } else if (isStr(keyOption)) {
  1121. // 重写参数 key
  1122. toArgs[keyOption] = fromArgs[key];
  1123. } else if (isPlainObject(keyOption)) {
  1124. // {name:newName,value:value}可重新指定参数 key:value
  1125. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1126. }
  1127. } else if (CALLBACKS.indexOf(key) !== -1) {
  1128. if (isFn(fromArgs[key])) {
  1129. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1130. }
  1131. } else {
  1132. if (!keepFromArgs) {
  1133. toArgs[key] = fromArgs[key];
  1134. }
  1135. }
  1136. }
  1137. return toArgs;
  1138. } else if (isFn(fromArgs)) {
  1139. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1140. }
  1141. return fromArgs;
  1142. }
  1143. function processReturnValue(methodName, res, returnValue) {
  1144. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1145. if (isFn(protocols.returnValue)) {
  1146. // 处理通用 returnValue
  1147. res = protocols.returnValue(methodName, res);
  1148. }
  1149. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1150. }
  1151. function wrapper(methodName, method) {
  1152. if (hasOwn(protocols, methodName)) {
  1153. var protocol = protocols[methodName];
  1154. if (!protocol) {
  1155. // 暂不支持的 api
  1156. return function () {
  1157. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1158. };
  1159. }
  1160. return function (arg1, arg2) {
  1161. // 目前 api 最多两个参数
  1162. var options = protocol;
  1163. if (isFn(protocol)) {
  1164. options = protocol(arg1);
  1165. }
  1166. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1167. var args = [arg1];
  1168. if (typeof arg2 !== 'undefined') {
  1169. args.push(arg2);
  1170. }
  1171. if (isFn(options.name)) {
  1172. methodName = options.name(arg1);
  1173. } else if (isStr(options.name)) {
  1174. methodName = options.name;
  1175. }
  1176. var returnValue = wx[methodName].apply(wx, args);
  1177. if (isSyncApi(methodName)) {
  1178. // 同步 api
  1179. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1180. }
  1181. return returnValue;
  1182. };
  1183. }
  1184. return method;
  1185. }
  1186. var todoApis = Object.create(null);
  1187. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1188. function createTodoApi(name) {
  1189. return function todoApi(_ref) {
  1190. var fail = _ref.fail,
  1191. complete = _ref.complete;
  1192. var res = {
  1193. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1194. };
  1195. isFn(fail) && fail(res);
  1196. isFn(complete) && complete(res);
  1197. };
  1198. }
  1199. TODOS.forEach(function (name) {
  1200. todoApis[name] = createTodoApi(name);
  1201. });
  1202. var providers = {
  1203. oauth: ['weixin'],
  1204. share: ['weixin'],
  1205. payment: ['wxpay'],
  1206. push: ['weixin']
  1207. };
  1208. function getProvider(_ref2) {
  1209. var service = _ref2.service,
  1210. success = _ref2.success,
  1211. fail = _ref2.fail,
  1212. complete = _ref2.complete;
  1213. var res = false;
  1214. if (providers[service]) {
  1215. res = {
  1216. errMsg: 'getProvider:ok',
  1217. service: service,
  1218. provider: providers[service]
  1219. };
  1220. isFn(success) && success(res);
  1221. } else {
  1222. res = {
  1223. errMsg: 'getProvider:fail service not found'
  1224. };
  1225. isFn(fail) && fail(res);
  1226. }
  1227. isFn(complete) && complete(res);
  1228. }
  1229. var extraApi = /*#__PURE__*/Object.freeze({
  1230. __proto__: null,
  1231. getProvider: getProvider
  1232. });
  1233. var getEmitter = function () {
  1234. var Emitter;
  1235. return function getUniEmitter() {
  1236. if (!Emitter) {
  1237. Emitter = new _vue.default();
  1238. }
  1239. return Emitter;
  1240. };
  1241. }();
  1242. function apply(ctx, method, args) {
  1243. return ctx[method].apply(ctx, args);
  1244. }
  1245. function $on() {
  1246. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1247. }
  1248. function $off() {
  1249. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1250. }
  1251. function $once() {
  1252. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1253. }
  1254. function $emit() {
  1255. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1256. }
  1257. var eventApi = /*#__PURE__*/Object.freeze({
  1258. __proto__: null,
  1259. $on: $on,
  1260. $off: $off,
  1261. $once: $once,
  1262. $emit: $emit
  1263. });
  1264. /**
  1265. * 框架内 try-catch
  1266. */
  1267. /**
  1268. * 开发者 try-catch
  1269. */
  1270. function tryCatch(fn) {
  1271. return function () {
  1272. try {
  1273. return fn.apply(fn, arguments);
  1274. } catch (e) {
  1275. // TODO
  1276. console.error(e);
  1277. }
  1278. };
  1279. }
  1280. function getApiCallbacks(params) {
  1281. var apiCallbacks = {};
  1282. for (var name in params) {
  1283. var param = params[name];
  1284. if (isFn(param)) {
  1285. apiCallbacks[name] = tryCatch(param);
  1286. delete params[name];
  1287. }
  1288. }
  1289. return apiCallbacks;
  1290. }
  1291. var cid;
  1292. var cidErrMsg;
  1293. var enabled;
  1294. function normalizePushMessage(message) {
  1295. try {
  1296. return JSON.parse(message);
  1297. } catch (e) {}
  1298. return message;
  1299. }
  1300. function invokePushCallback(args) {
  1301. if (args.type === 'enabled') {
  1302. enabled = true;
  1303. } else if (args.type === 'clientId') {
  1304. cid = args.cid;
  1305. cidErrMsg = args.errMsg;
  1306. invokeGetPushCidCallbacks(cid, args.errMsg);
  1307. } else if (args.type === 'pushMsg') {
  1308. var message = {
  1309. type: 'receive',
  1310. data: normalizePushMessage(args.message)
  1311. };
  1312. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1313. var callback = onPushMessageCallbacks[i];
  1314. callback(message);
  1315. // 该消息已被阻止
  1316. if (message.stopped) {
  1317. break;
  1318. }
  1319. }
  1320. } else if (args.type === 'click') {
  1321. onPushMessageCallbacks.forEach(function (callback) {
  1322. callback({
  1323. type: 'click',
  1324. data: normalizePushMessage(args.message)
  1325. });
  1326. });
  1327. }
  1328. }
  1329. var getPushCidCallbacks = [];
  1330. function invokeGetPushCidCallbacks(cid, errMsg) {
  1331. getPushCidCallbacks.forEach(function (callback) {
  1332. callback(cid, errMsg);
  1333. });
  1334. getPushCidCallbacks.length = 0;
  1335. }
  1336. function getPushClientId(args) {
  1337. if (!isPlainObject(args)) {
  1338. args = {};
  1339. }
  1340. var _getApiCallbacks = getApiCallbacks(args),
  1341. success = _getApiCallbacks.success,
  1342. fail = _getApiCallbacks.fail,
  1343. complete = _getApiCallbacks.complete;
  1344. var hasSuccess = isFn(success);
  1345. var hasFail = isFn(fail);
  1346. var hasComplete = isFn(complete);
  1347. Promise.resolve().then(function () {
  1348. if (typeof enabled === 'undefined') {
  1349. enabled = false;
  1350. cid = '';
  1351. cidErrMsg = 'uniPush is not enabled';
  1352. }
  1353. getPushCidCallbacks.push(function (cid, errMsg) {
  1354. var res;
  1355. if (cid) {
  1356. res = {
  1357. errMsg: 'getPushClientId:ok',
  1358. cid: cid
  1359. };
  1360. hasSuccess && success(res);
  1361. } else {
  1362. res = {
  1363. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1364. };
  1365. hasFail && fail(res);
  1366. }
  1367. hasComplete && complete(res);
  1368. });
  1369. if (typeof cid !== 'undefined') {
  1370. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1371. }
  1372. });
  1373. }
  1374. var onPushMessageCallbacks = [];
  1375. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1376. var onPushMessage = function onPushMessage(fn) {
  1377. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1378. onPushMessageCallbacks.push(fn);
  1379. }
  1380. };
  1381. var offPushMessage = function offPushMessage(fn) {
  1382. if (!fn) {
  1383. onPushMessageCallbacks.length = 0;
  1384. } else {
  1385. var index = onPushMessageCallbacks.indexOf(fn);
  1386. if (index > -1) {
  1387. onPushMessageCallbacks.splice(index, 1);
  1388. }
  1389. }
  1390. };
  1391. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1392. if (!baseInfo) {
  1393. baseInfo = wx.getSystemInfoSync();
  1394. }
  1395. var host = baseInfo ? baseInfo.host : null;
  1396. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1397. var api = /*#__PURE__*/Object.freeze({
  1398. __proto__: null,
  1399. shareVideoMessage: shareVideoMessage,
  1400. getPushClientId: getPushClientId,
  1401. onPushMessage: onPushMessage,
  1402. offPushMessage: offPushMessage,
  1403. invokePushCallback: invokePushCallback
  1404. });
  1405. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1406. function findVmByVueId(vm, vuePid) {
  1407. var $children = vm.$children;
  1408. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1409. for (var i = $children.length - 1; i >= 0; i--) {
  1410. var childVm = $children[i];
  1411. if (childVm.$scope._$vueId === vuePid) {
  1412. return childVm;
  1413. }
  1414. }
  1415. // 反向递归查找
  1416. var parentVm;
  1417. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1418. parentVm = findVmByVueId($children[_i], vuePid);
  1419. if (parentVm) {
  1420. return parentVm;
  1421. }
  1422. }
  1423. }
  1424. function initBehavior(options) {
  1425. return Behavior(options);
  1426. }
  1427. function isPage() {
  1428. return !!this.route;
  1429. }
  1430. function initRelation(detail) {
  1431. this.triggerEvent('__l', detail);
  1432. }
  1433. function selectAllComponents(mpInstance, selector, $refs) {
  1434. var components = mpInstance.selectAllComponents(selector) || [];
  1435. components.forEach(function (component) {
  1436. var ref = component.dataset.ref;
  1437. $refs[ref] = component.$vm || toSkip(component);
  1438. {
  1439. if (component.dataset.vueGeneric === 'scoped') {
  1440. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1441. selectAllComponents(scopedComponent, selector, $refs);
  1442. });
  1443. }
  1444. }
  1445. });
  1446. }
  1447. function syncRefs(refs, newRefs) {
  1448. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1449. var newKeys = Object.keys(newRefs);
  1450. newKeys.forEach(function (key) {
  1451. var oldValue = refs[key];
  1452. var newValue = newRefs[key];
  1453. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1454. return oldValue.includes(value);
  1455. })) {
  1456. return;
  1457. }
  1458. refs[key] = newValue;
  1459. oldKeys.delete(key);
  1460. });
  1461. oldKeys.forEach(function (key) {
  1462. delete refs[key];
  1463. });
  1464. return refs;
  1465. }
  1466. function initRefs(vm) {
  1467. var mpInstance = vm.$scope;
  1468. var refs = {};
  1469. Object.defineProperty(vm, '$refs', {
  1470. get: function get() {
  1471. var $refs = {};
  1472. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1473. // TODO 暂不考虑 for 中的 scoped
  1474. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1475. forComponents.forEach(function (component) {
  1476. var ref = component.dataset.ref;
  1477. if (!$refs[ref]) {
  1478. $refs[ref] = [];
  1479. }
  1480. $refs[ref].push(component.$vm || toSkip(component));
  1481. });
  1482. return syncRefs(refs, $refs);
  1483. }
  1484. });
  1485. }
  1486. function handleLink(event) {
  1487. var _ref3 = event.detail || event.value,
  1488. vuePid = _ref3.vuePid,
  1489. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1490. var parentVm;
  1491. if (vuePid) {
  1492. parentVm = findVmByVueId(this.$vm, vuePid);
  1493. }
  1494. if (!parentVm) {
  1495. parentVm = this.$vm;
  1496. }
  1497. vueOptions.parent = parentVm;
  1498. }
  1499. function markMPComponent(component) {
  1500. // 在 Vue 中标记为小程序组件
  1501. var IS_MP = '__v_isMPComponent';
  1502. Object.defineProperty(component, IS_MP, {
  1503. configurable: true,
  1504. enumerable: false,
  1505. value: true
  1506. });
  1507. return component;
  1508. }
  1509. function toSkip(obj) {
  1510. var OB = '__ob__';
  1511. var SKIP = '__v_skip';
  1512. if (isObject(obj) && Object.isExtensible(obj)) {
  1513. // 避免被 @vue/composition-api 观测
  1514. Object.defineProperty(obj, OB, {
  1515. configurable: true,
  1516. enumerable: false,
  1517. value: (0, _defineProperty2.default)({}, SKIP, true)
  1518. });
  1519. }
  1520. return obj;
  1521. }
  1522. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1523. function initWorkletMethods(mpMethods, vueMethods) {
  1524. if (vueMethods) {
  1525. Object.keys(vueMethods).forEach(function (name) {
  1526. var matches = name.match(WORKLET_RE);
  1527. if (matches) {
  1528. var workletName = matches[1];
  1529. mpMethods[name] = vueMethods[name];
  1530. mpMethods[workletName] = vueMethods[workletName];
  1531. }
  1532. });
  1533. }
  1534. }
  1535. var MPPage = Page;
  1536. var MPComponent = Component;
  1537. var customizeRE = /:/g;
  1538. var customize = cached(function (str) {
  1539. return camelize(str.replace(customizeRE, '-'));
  1540. });
  1541. function initTriggerEvent(mpInstance) {
  1542. var oldTriggerEvent = mpInstance.triggerEvent;
  1543. var newTriggerEvent = function newTriggerEvent(event) {
  1544. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1545. args[_key3 - 1] = arguments[_key3];
  1546. }
  1547. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1548. if (this.$vm || this.dataset && this.dataset.comType) {
  1549. event = customize(event);
  1550. } else {
  1551. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1552. var newEvent = customize(event);
  1553. if (newEvent !== event) {
  1554. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1555. }
  1556. }
  1557. return oldTriggerEvent.apply(this, [event].concat(args));
  1558. };
  1559. try {
  1560. // 京东小程序 triggerEvent 为只读
  1561. mpInstance.triggerEvent = newTriggerEvent;
  1562. } catch (error) {
  1563. mpInstance._triggerEvent = newTriggerEvent;
  1564. }
  1565. }
  1566. function initHook(name, options, isComponent) {
  1567. var oldHook = options[name];
  1568. options[name] = function () {
  1569. markMPComponent(this);
  1570. initTriggerEvent(this);
  1571. if (oldHook) {
  1572. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1573. args[_key4] = arguments[_key4];
  1574. }
  1575. return oldHook.apply(this, args);
  1576. }
  1577. };
  1578. }
  1579. if (!MPPage.__$wrappered) {
  1580. MPPage.__$wrappered = true;
  1581. Page = function Page() {
  1582. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1583. initHook('onLoad', options);
  1584. return MPPage(options);
  1585. };
  1586. Page.after = MPPage.after;
  1587. Component = function Component() {
  1588. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1589. initHook('created', options);
  1590. return MPComponent(options);
  1591. };
  1592. }
  1593. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1594. function initMocks(vm, mocks) {
  1595. var mpInstance = vm.$mp[vm.mpType];
  1596. mocks.forEach(function (mock) {
  1597. if (hasOwn(mpInstance, mock)) {
  1598. vm[mock] = mpInstance[mock];
  1599. }
  1600. });
  1601. }
  1602. function hasHook(hook, vueOptions) {
  1603. if (!vueOptions) {
  1604. return true;
  1605. }
  1606. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1607. return true;
  1608. }
  1609. vueOptions = vueOptions.default || vueOptions;
  1610. if (isFn(vueOptions)) {
  1611. if (isFn(vueOptions.extendOptions[hook])) {
  1612. return true;
  1613. }
  1614. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1615. return true;
  1616. }
  1617. return false;
  1618. }
  1619. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1620. return true;
  1621. }
  1622. var mixins = vueOptions.mixins;
  1623. if (Array.isArray(mixins)) {
  1624. return !!mixins.find(function (mixin) {
  1625. return hasHook(hook, mixin);
  1626. });
  1627. }
  1628. }
  1629. function initHooks(mpOptions, hooks, vueOptions) {
  1630. hooks.forEach(function (hook) {
  1631. if (hasHook(hook, vueOptions)) {
  1632. mpOptions[hook] = function (args) {
  1633. return this.$vm && this.$vm.__call_hook(hook, args);
  1634. };
  1635. }
  1636. });
  1637. }
  1638. function initUnknownHooks(mpOptions, vueOptions) {
  1639. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1640. findHooks(vueOptions).forEach(function (hook) {
  1641. return initHook$1(mpOptions, hook, excludes);
  1642. });
  1643. }
  1644. function findHooks(vueOptions) {
  1645. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1646. if (vueOptions) {
  1647. Object.keys(vueOptions).forEach(function (name) {
  1648. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1649. hooks.push(name);
  1650. }
  1651. });
  1652. }
  1653. return hooks;
  1654. }
  1655. function initHook$1(mpOptions, hook, excludes) {
  1656. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1657. mpOptions[hook] = function (args) {
  1658. return this.$vm && this.$vm.__call_hook(hook, args);
  1659. };
  1660. }
  1661. }
  1662. function initVueComponent(Vue, vueOptions) {
  1663. vueOptions = vueOptions.default || vueOptions;
  1664. var VueComponent;
  1665. if (isFn(vueOptions)) {
  1666. VueComponent = vueOptions;
  1667. } else {
  1668. VueComponent = Vue.extend(vueOptions);
  1669. }
  1670. vueOptions = VueComponent.options;
  1671. return [VueComponent, vueOptions];
  1672. }
  1673. function initSlots(vm, vueSlots) {
  1674. if (Array.isArray(vueSlots) && vueSlots.length) {
  1675. var $slots = Object.create(null);
  1676. vueSlots.forEach(function (slotName) {
  1677. $slots[slotName] = true;
  1678. });
  1679. vm.$scopedSlots = vm.$slots = $slots;
  1680. }
  1681. }
  1682. function initVueIds(vueIds, mpInstance) {
  1683. vueIds = (vueIds || '').split(',');
  1684. var len = vueIds.length;
  1685. if (len === 1) {
  1686. mpInstance._$vueId = vueIds[0];
  1687. } else if (len === 2) {
  1688. mpInstance._$vueId = vueIds[0];
  1689. mpInstance._$vuePid = vueIds[1];
  1690. }
  1691. }
  1692. function initData(vueOptions, context) {
  1693. var data = vueOptions.data || {};
  1694. var methods = vueOptions.methods || {};
  1695. if (typeof data === 'function') {
  1696. try {
  1697. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1698. } catch (e) {
  1699. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1700. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1701. }
  1702. }
  1703. } else {
  1704. try {
  1705. // 对 data 格式化
  1706. data = JSON.parse(JSON.stringify(data));
  1707. } catch (e) {}
  1708. }
  1709. if (!isPlainObject(data)) {
  1710. data = {};
  1711. }
  1712. Object.keys(methods).forEach(function (methodName) {
  1713. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1714. data[methodName] = methods[methodName];
  1715. }
  1716. });
  1717. return data;
  1718. }
  1719. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1720. function createObserver(name) {
  1721. return function observer(newVal, oldVal) {
  1722. if (this.$vm) {
  1723. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1724. }
  1725. };
  1726. }
  1727. function initBehaviors(vueOptions, initBehavior) {
  1728. var vueBehaviors = vueOptions.behaviors;
  1729. var vueExtends = vueOptions.extends;
  1730. var vueMixins = vueOptions.mixins;
  1731. var vueProps = vueOptions.props;
  1732. if (!vueProps) {
  1733. vueOptions.props = vueProps = [];
  1734. }
  1735. var behaviors = [];
  1736. if (Array.isArray(vueBehaviors)) {
  1737. vueBehaviors.forEach(function (behavior) {
  1738. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1739. if (behavior === 'uni://form-field') {
  1740. if (Array.isArray(vueProps)) {
  1741. vueProps.push('name');
  1742. vueProps.push('value');
  1743. } else {
  1744. vueProps.name = {
  1745. type: String,
  1746. default: ''
  1747. };
  1748. vueProps.value = {
  1749. type: [String, Number, Boolean, Array, Object, Date],
  1750. default: ''
  1751. };
  1752. }
  1753. }
  1754. });
  1755. }
  1756. if (isPlainObject(vueExtends) && vueExtends.props) {
  1757. behaviors.push(initBehavior({
  1758. properties: initProperties(vueExtends.props, true)
  1759. }));
  1760. }
  1761. if (Array.isArray(vueMixins)) {
  1762. vueMixins.forEach(function (vueMixin) {
  1763. if (isPlainObject(vueMixin) && vueMixin.props) {
  1764. behaviors.push(initBehavior({
  1765. properties: initProperties(vueMixin.props, true)
  1766. }));
  1767. }
  1768. });
  1769. }
  1770. return behaviors;
  1771. }
  1772. function parsePropType(key, type, defaultValue, file) {
  1773. // [String]=>String
  1774. if (Array.isArray(type) && type.length === 1) {
  1775. return type[0];
  1776. }
  1777. return type;
  1778. }
  1779. function initProperties(props) {
  1780. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1781. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1782. var options = arguments.length > 3 ? arguments[3] : undefined;
  1783. var properties = {};
  1784. if (!isBehavior) {
  1785. properties.vueId = {
  1786. type: String,
  1787. value: ''
  1788. };
  1789. {
  1790. if (options.virtualHost) {
  1791. properties.virtualHostStyle = {
  1792. type: null,
  1793. value: ''
  1794. };
  1795. properties.virtualHostClass = {
  1796. type: null,
  1797. value: ''
  1798. };
  1799. }
  1800. }
  1801. // scopedSlotsCompiler auto
  1802. properties.scopedSlotsCompiler = {
  1803. type: String,
  1804. value: ''
  1805. };
  1806. properties.vueSlots = {
  1807. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1808. type: null,
  1809. value: [],
  1810. observer: function observer(newVal, oldVal) {
  1811. var $slots = Object.create(null);
  1812. newVal.forEach(function (slotName) {
  1813. $slots[slotName] = true;
  1814. });
  1815. this.setData({
  1816. $slots: $slots
  1817. });
  1818. }
  1819. };
  1820. }
  1821. if (Array.isArray(props)) {
  1822. // ['title']
  1823. props.forEach(function (key) {
  1824. properties[key] = {
  1825. type: null,
  1826. observer: createObserver(key)
  1827. };
  1828. });
  1829. } else if (isPlainObject(props)) {
  1830. // {title:{type:String,default:''},content:String}
  1831. Object.keys(props).forEach(function (key) {
  1832. var opts = props[key];
  1833. if (isPlainObject(opts)) {
  1834. // title:{type:String,default:''}
  1835. var value = opts.default;
  1836. if (isFn(value)) {
  1837. value = value();
  1838. }
  1839. opts.type = parsePropType(key, opts.type);
  1840. properties[key] = {
  1841. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1842. value: value,
  1843. observer: createObserver(key)
  1844. };
  1845. } else {
  1846. // content:String
  1847. var type = parsePropType(key, opts);
  1848. properties[key] = {
  1849. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1850. observer: createObserver(key)
  1851. };
  1852. }
  1853. });
  1854. }
  1855. return properties;
  1856. }
  1857. function wrapper$1(event) {
  1858. // TODO 又得兼容 mpvue 的 mp 对象
  1859. try {
  1860. event.mp = JSON.parse(JSON.stringify(event));
  1861. } catch (e) {}
  1862. event.stopPropagation = noop;
  1863. event.preventDefault = noop;
  1864. event.target = event.target || {};
  1865. if (!hasOwn(event, 'detail')) {
  1866. event.detail = {};
  1867. }
  1868. if (hasOwn(event, 'markerId')) {
  1869. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1870. event.detail.markerId = event.markerId;
  1871. }
  1872. if (isPlainObject(event.detail)) {
  1873. event.target = Object.assign({}, event.target, event.detail);
  1874. }
  1875. return event;
  1876. }
  1877. function getExtraValue(vm, dataPathsArray) {
  1878. var context = vm;
  1879. dataPathsArray.forEach(function (dataPathArray) {
  1880. var dataPath = dataPathArray[0];
  1881. var value = dataPathArray[2];
  1882. if (dataPath || typeof value !== 'undefined') {
  1883. // ['','',index,'disable']
  1884. var propPath = dataPathArray[1];
  1885. var valuePath = dataPathArray[3];
  1886. var vFor;
  1887. if (Number.isInteger(dataPath)) {
  1888. vFor = dataPath;
  1889. } else if (!dataPath) {
  1890. vFor = context;
  1891. } else if (typeof dataPath === 'string' && dataPath) {
  1892. if (dataPath.indexOf('#s#') === 0) {
  1893. vFor = dataPath.substr(3);
  1894. } else {
  1895. vFor = vm.__get_value(dataPath, context);
  1896. }
  1897. }
  1898. if (Number.isInteger(vFor)) {
  1899. context = value;
  1900. } else if (!propPath) {
  1901. context = vFor[value];
  1902. } else {
  1903. if (Array.isArray(vFor)) {
  1904. context = vFor.find(function (vForItem) {
  1905. return vm.__get_value(propPath, vForItem) === value;
  1906. });
  1907. } else if (isPlainObject(vFor)) {
  1908. context = Object.keys(vFor).find(function (vForKey) {
  1909. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1910. });
  1911. } else {
  1912. console.error('v-for 暂不支持循环数据:', vFor);
  1913. }
  1914. }
  1915. if (valuePath) {
  1916. context = vm.__get_value(valuePath, context);
  1917. }
  1918. }
  1919. });
  1920. return context;
  1921. }
  1922. function processEventExtra(vm, extra, event, __args__) {
  1923. var extraObj = {};
  1924. if (Array.isArray(extra) && extra.length) {
  1925. /**
  1926. *[
  1927. * ['data.items', 'data.id', item.data.id],
  1928. * ['metas', 'id', meta.id]
  1929. *],
  1930. *[
  1931. * ['data.items', 'data.id', item.data.id],
  1932. * ['metas', 'id', meta.id]
  1933. *],
  1934. *'test'
  1935. */
  1936. extra.forEach(function (dataPath, index) {
  1937. if (typeof dataPath === 'string') {
  1938. if (!dataPath) {
  1939. // model,prop.sync
  1940. extraObj['$' + index] = vm;
  1941. } else {
  1942. if (dataPath === '$event') {
  1943. // $event
  1944. extraObj['$' + index] = event;
  1945. } else if (dataPath === 'arguments') {
  1946. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1947. } else if (dataPath.indexOf('$event.') === 0) {
  1948. // $event.target.value
  1949. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1950. } else {
  1951. extraObj['$' + index] = vm.__get_value(dataPath);
  1952. }
  1953. }
  1954. } else {
  1955. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1956. }
  1957. });
  1958. }
  1959. return extraObj;
  1960. }
  1961. function getObjByArray(arr) {
  1962. var obj = {};
  1963. for (var i = 1; i < arr.length; i++) {
  1964. var element = arr[i];
  1965. obj[element[0]] = element[1];
  1966. }
  1967. return obj;
  1968. }
  1969. function processEventArgs(vm, event) {
  1970. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1971. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1972. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1973. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1974. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1975. // fixed 用户直接触发 mpInstance.triggerEvent
  1976. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1977. if (isCustom) {
  1978. // 自定义事件
  1979. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1980. if (!args.length) {
  1981. // 无参数,直接传入 event 或 detail 数组
  1982. if (isCustomMPEvent) {
  1983. return [event];
  1984. }
  1985. return __args__;
  1986. }
  1987. }
  1988. var extraObj = processEventExtra(vm, extra, event, __args__);
  1989. var ret = [];
  1990. args.forEach(function (arg) {
  1991. if (arg === '$event') {
  1992. if (methodName === '__set_model' && !isCustom) {
  1993. // input v-model value
  1994. ret.push(event.target.value);
  1995. } else {
  1996. if (isCustom && !isCustomMPEvent) {
  1997. ret.push(__args__[0]);
  1998. } else {
  1999. // wxcomponent 组件或内置组件
  2000. ret.push(event);
  2001. }
  2002. }
  2003. } else {
  2004. if (Array.isArray(arg) && arg[0] === 'o') {
  2005. ret.push(getObjByArray(arg));
  2006. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2007. ret.push(extraObj[arg]);
  2008. } else {
  2009. ret.push(arg);
  2010. }
  2011. }
  2012. });
  2013. return ret;
  2014. }
  2015. var ONCE = '~';
  2016. var CUSTOM = '^';
  2017. function isMatchEventType(eventType, optType) {
  2018. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2019. }
  2020. function getContextVm(vm) {
  2021. var $parent = vm.$parent;
  2022. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2023. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2024. $parent = $parent.$parent;
  2025. }
  2026. return $parent && $parent.$parent;
  2027. }
  2028. function handleEvent(event) {
  2029. var _this2 = this;
  2030. event = wrapper$1(event);
  2031. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2032. var dataset = (event.currentTarget || event.target).dataset;
  2033. if (!dataset) {
  2034. return console.warn('事件信息不存在');
  2035. }
  2036. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2037. if (!eventOpts) {
  2038. return console.warn('事件信息不存在');
  2039. }
  2040. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2041. var eventType = event.type;
  2042. var ret = [];
  2043. eventOpts.forEach(function (eventOpt) {
  2044. var type = eventOpt[0];
  2045. var eventsArray = eventOpt[1];
  2046. var isCustom = type.charAt(0) === CUSTOM;
  2047. type = isCustom ? type.slice(1) : type;
  2048. var isOnce = type.charAt(0) === ONCE;
  2049. type = isOnce ? type.slice(1) : type;
  2050. if (eventsArray && isMatchEventType(eventType, type)) {
  2051. eventsArray.forEach(function (eventArray) {
  2052. var methodName = eventArray[0];
  2053. if (methodName) {
  2054. var handlerCtx = _this2.$vm;
  2055. if (handlerCtx.$options.generic) {
  2056. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2057. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2058. }
  2059. if (methodName === '$emit') {
  2060. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2061. return;
  2062. }
  2063. var handler = handlerCtx[methodName];
  2064. if (!isFn(handler)) {
  2065. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2066. var path = _this2.route || _this2.is;
  2067. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2068. }
  2069. if (isOnce) {
  2070. if (handler.once) {
  2071. return;
  2072. }
  2073. handler.once = true;
  2074. }
  2075. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2076. params = Array.isArray(params) ? params : [];
  2077. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2078. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2079. // eslint-disable-next-line no-sparse-arrays
  2080. params = params.concat([,,,,,,,,,, event]);
  2081. }
  2082. ret.push(handler.apply(handlerCtx, params));
  2083. }
  2084. });
  2085. }
  2086. });
  2087. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2088. return ret[0];
  2089. }
  2090. }
  2091. var eventChannels = {};
  2092. function getEventChannel(id) {
  2093. var eventChannel = eventChannels[id];
  2094. delete eventChannels[id];
  2095. return eventChannel;
  2096. }
  2097. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2098. function initEventChannel() {
  2099. _vue.default.prototype.getOpenerEventChannel = function () {
  2100. // 微信小程序使用自身getOpenerEventChannel
  2101. {
  2102. return this.$scope.getOpenerEventChannel();
  2103. }
  2104. };
  2105. var callHook = _vue.default.prototype.__call_hook;
  2106. _vue.default.prototype.__call_hook = function (hook, args) {
  2107. if (hook === 'onLoad' && args && args.__id__) {
  2108. this.__eventChannel__ = getEventChannel(args.__id__);
  2109. delete args.__id__;
  2110. }
  2111. return callHook.call(this, hook, args);
  2112. };
  2113. }
  2114. function initScopedSlotsParams() {
  2115. var center = {};
  2116. var parents = {};
  2117. function currentId(fn) {
  2118. var vueIds = this.$options.propsData.vueId;
  2119. if (vueIds) {
  2120. var vueId = vueIds.split(',')[0];
  2121. fn(vueId);
  2122. }
  2123. }
  2124. _vue.default.prototype.$hasSSP = function (vueId) {
  2125. var slot = center[vueId];
  2126. if (!slot) {
  2127. parents[vueId] = this;
  2128. this.$on('hook:destroyed', function () {
  2129. delete parents[vueId];
  2130. });
  2131. }
  2132. return slot;
  2133. };
  2134. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2135. var slot = center[vueId];
  2136. if (slot) {
  2137. var params = slot[name] || [];
  2138. if (needAll) {
  2139. return params;
  2140. }
  2141. return params[0];
  2142. }
  2143. };
  2144. _vue.default.prototype.$setSSP = function (name, value) {
  2145. var index = 0;
  2146. currentId.call(this, function (vueId) {
  2147. var slot = center[vueId];
  2148. var params = slot[name] = slot[name] || [];
  2149. params.push(value);
  2150. index = params.length - 1;
  2151. });
  2152. return index;
  2153. };
  2154. _vue.default.prototype.$initSSP = function () {
  2155. currentId.call(this, function (vueId) {
  2156. center[vueId] = {};
  2157. });
  2158. };
  2159. _vue.default.prototype.$callSSP = function () {
  2160. currentId.call(this, function (vueId) {
  2161. if (parents[vueId]) {
  2162. parents[vueId].$forceUpdate();
  2163. }
  2164. });
  2165. };
  2166. _vue.default.mixin({
  2167. destroyed: function destroyed() {
  2168. var propsData = this.$options.propsData;
  2169. var vueId = propsData && propsData.vueId;
  2170. if (vueId) {
  2171. delete center[vueId];
  2172. delete parents[vueId];
  2173. }
  2174. }
  2175. });
  2176. }
  2177. function parseBaseApp(vm, _ref4) {
  2178. var mocks = _ref4.mocks,
  2179. initRefs = _ref4.initRefs;
  2180. initEventChannel();
  2181. {
  2182. initScopedSlotsParams();
  2183. }
  2184. if (vm.$options.store) {
  2185. _vue.default.prototype.$store = vm.$options.store;
  2186. }
  2187. uniIdMixin(_vue.default);
  2188. _vue.default.prototype.mpHost = "mp-weixin";
  2189. _vue.default.mixin({
  2190. beforeCreate: function beforeCreate() {
  2191. if (!this.$options.mpType) {
  2192. return;
  2193. }
  2194. this.mpType = this.$options.mpType;
  2195. this.$mp = (0, _defineProperty2.default)({
  2196. data: {}
  2197. }, this.mpType, this.$options.mpInstance);
  2198. this.$scope = this.$options.mpInstance;
  2199. delete this.$options.mpType;
  2200. delete this.$options.mpInstance;
  2201. if (this.mpType === 'page' && typeof getApp === 'function') {
  2202. // hack vue-i18n
  2203. var app = getApp();
  2204. if (app.$vm && app.$vm.$i18n) {
  2205. this._i18n = app.$vm.$i18n;
  2206. }
  2207. }
  2208. if (this.mpType !== 'app') {
  2209. initRefs(this);
  2210. initMocks(this, mocks);
  2211. }
  2212. }
  2213. });
  2214. var appOptions = {
  2215. onLaunch: function onLaunch(args) {
  2216. if (this.$vm) {
  2217. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2218. return;
  2219. }
  2220. {
  2221. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2222. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2223. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2224. }
  2225. }
  2226. this.$vm = vm;
  2227. this.$vm.$mp = {
  2228. app: this
  2229. };
  2230. this.$vm.$scope = this;
  2231. // vm 上也挂载 globalData
  2232. this.$vm.globalData = this.globalData;
  2233. this.$vm._isMounted = true;
  2234. this.$vm.__call_hook('mounted', args);
  2235. this.$vm.__call_hook('onLaunch', args);
  2236. }
  2237. };
  2238. // 兼容旧版本 globalData
  2239. appOptions.globalData = vm.$options.globalData || {};
  2240. // 将 methods 中的方法挂在 getApp() 中
  2241. var methods = vm.$options.methods;
  2242. if (methods) {
  2243. Object.keys(methods).forEach(function (name) {
  2244. appOptions[name] = methods[name];
  2245. });
  2246. }
  2247. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2248. initHooks(appOptions, hooks);
  2249. initUnknownHooks(appOptions, vm.$options);
  2250. return appOptions;
  2251. }
  2252. function parseApp(vm) {
  2253. return parseBaseApp(vm, {
  2254. mocks: mocks,
  2255. initRefs: initRefs
  2256. });
  2257. }
  2258. function createApp(vm) {
  2259. App(parseApp(vm));
  2260. return vm;
  2261. }
  2262. var encodeReserveRE = /[!'()*]/g;
  2263. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2264. return '%' + c.charCodeAt(0).toString(16);
  2265. };
  2266. var commaRE = /%2C/g;
  2267. // fixed encodeURIComponent which is more conformant to RFC3986:
  2268. // - escapes [!'()*]
  2269. // - preserve commas
  2270. var encode = function encode(str) {
  2271. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2272. };
  2273. function stringifyQuery(obj) {
  2274. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2275. var res = obj ? Object.keys(obj).map(function (key) {
  2276. var val = obj[key];
  2277. if (val === undefined) {
  2278. return '';
  2279. }
  2280. if (val === null) {
  2281. return encodeStr(key);
  2282. }
  2283. if (Array.isArray(val)) {
  2284. var result = [];
  2285. val.forEach(function (val2) {
  2286. if (val2 === undefined) {
  2287. return;
  2288. }
  2289. if (val2 === null) {
  2290. result.push(encodeStr(key));
  2291. } else {
  2292. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2293. }
  2294. });
  2295. return result.join('&');
  2296. }
  2297. return encodeStr(key) + '=' + encodeStr(val);
  2298. }).filter(function (x) {
  2299. return x.length > 0;
  2300. }).join('&') : null;
  2301. return res ? "?".concat(res) : '';
  2302. }
  2303. function parseBaseComponent(vueComponentOptions) {
  2304. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2305. isPage = _ref5.isPage,
  2306. initRelation = _ref5.initRelation;
  2307. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2308. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2309. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2310. VueComponent = _initVueComponent2[0],
  2311. vueOptions = _initVueComponent2[1];
  2312. var options = _objectSpread({
  2313. multipleSlots: true,
  2314. // styleIsolation: 'apply-shared',
  2315. addGlobalClass: true
  2316. }, vueOptions.options || {});
  2317. {
  2318. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2319. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2320. Object.assign(options, vueOptions['mp-weixin'].options);
  2321. }
  2322. }
  2323. var componentOptions = {
  2324. options: options,
  2325. data: initData(vueOptions, _vue.default.prototype),
  2326. behaviors: initBehaviors(vueOptions, initBehavior),
  2327. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2328. lifetimes: {
  2329. attached: function attached() {
  2330. var properties = this.properties;
  2331. var options = {
  2332. mpType: isPage.call(this) ? 'page' : 'component',
  2333. mpInstance: this,
  2334. propsData: properties
  2335. };
  2336. initVueIds(properties.vueId, this);
  2337. // 处理父子关系
  2338. initRelation.call(this, {
  2339. vuePid: this._$vuePid,
  2340. vueOptions: options
  2341. });
  2342. // 初始化 vue 实例
  2343. this.$vm = new VueComponent(options);
  2344. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2345. initSlots(this.$vm, properties.vueSlots);
  2346. // 触发首次 setData
  2347. this.$vm.$mount();
  2348. },
  2349. ready: function ready() {
  2350. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2351. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2352. if (this.$vm) {
  2353. this.$vm._isMounted = true;
  2354. this.$vm.__call_hook('mounted');
  2355. this.$vm.__call_hook('onReady');
  2356. }
  2357. },
  2358. detached: function detached() {
  2359. this.$vm && this.$vm.$destroy();
  2360. }
  2361. },
  2362. pageLifetimes: {
  2363. show: function show(args) {
  2364. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2365. },
  2366. hide: function hide() {
  2367. this.$vm && this.$vm.__call_hook('onPageHide');
  2368. },
  2369. resize: function resize(size) {
  2370. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2371. }
  2372. },
  2373. methods: {
  2374. __l: handleLink,
  2375. __e: handleEvent
  2376. }
  2377. };
  2378. // externalClasses
  2379. if (vueOptions.externalClasses) {
  2380. componentOptions.externalClasses = vueOptions.externalClasses;
  2381. }
  2382. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2383. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2384. componentOptions.methods[callMethod] = function (args) {
  2385. return this.$vm[callMethod](args);
  2386. };
  2387. });
  2388. }
  2389. if (needVueOptions) {
  2390. return [componentOptions, vueOptions, VueComponent];
  2391. }
  2392. if (isPage) {
  2393. return componentOptions;
  2394. }
  2395. return [componentOptions, VueComponent];
  2396. }
  2397. function parseComponent(vueComponentOptions, needVueOptions) {
  2398. return parseBaseComponent(vueComponentOptions, {
  2399. isPage: isPage,
  2400. initRelation: initRelation
  2401. }, needVueOptions);
  2402. }
  2403. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2404. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2405. function parseBasePage(vuePageOptions) {
  2406. var _parseComponent = parseComponent(vuePageOptions, true),
  2407. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2408. pageOptions = _parseComponent2[0],
  2409. vueOptions = _parseComponent2[1];
  2410. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2411. pageOptions.methods.onLoad = function (query) {
  2412. this.options = query;
  2413. var copyQuery = Object.assign({}, query);
  2414. delete copyQuery.__id__;
  2415. this.$page = {
  2416. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2417. };
  2418. this.$vm.$mp.query = query; // 兼容 mpvue
  2419. this.$vm.__call_hook('onLoad', query);
  2420. };
  2421. {
  2422. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2423. }
  2424. {
  2425. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2426. }
  2427. return pageOptions;
  2428. }
  2429. function parsePage(vuePageOptions) {
  2430. return parseBasePage(vuePageOptions);
  2431. }
  2432. function createPage(vuePageOptions) {
  2433. {
  2434. return Component(parsePage(vuePageOptions));
  2435. }
  2436. }
  2437. function createComponent(vueOptions) {
  2438. {
  2439. return Component(parseComponent(vueOptions));
  2440. }
  2441. }
  2442. function createSubpackageApp(vm) {
  2443. var appOptions = parseApp(vm);
  2444. var app = getApp({
  2445. allowDefault: true
  2446. });
  2447. vm.$scope = app;
  2448. var globalData = app.globalData;
  2449. if (globalData) {
  2450. Object.keys(appOptions.globalData).forEach(function (name) {
  2451. if (!hasOwn(globalData, name)) {
  2452. globalData[name] = appOptions.globalData[name];
  2453. }
  2454. });
  2455. }
  2456. Object.keys(appOptions).forEach(function (name) {
  2457. if (!hasOwn(app, name)) {
  2458. app[name] = appOptions[name];
  2459. }
  2460. });
  2461. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2462. wx.onAppShow(function () {
  2463. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2464. args[_key5] = arguments[_key5];
  2465. }
  2466. vm.__call_hook('onShow', args);
  2467. });
  2468. }
  2469. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2470. wx.onAppHide(function () {
  2471. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2472. args[_key6] = arguments[_key6];
  2473. }
  2474. vm.__call_hook('onHide', args);
  2475. });
  2476. }
  2477. if (isFn(appOptions.onLaunch)) {
  2478. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2479. vm.__call_hook('onLaunch', args);
  2480. }
  2481. return vm;
  2482. }
  2483. function createPlugin(vm) {
  2484. var appOptions = parseApp(vm);
  2485. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2486. wx.onAppShow(function () {
  2487. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2488. args[_key7] = arguments[_key7];
  2489. }
  2490. vm.__call_hook('onShow', args);
  2491. });
  2492. }
  2493. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2494. wx.onAppHide(function () {
  2495. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2496. args[_key8] = arguments[_key8];
  2497. }
  2498. vm.__call_hook('onHide', args);
  2499. });
  2500. }
  2501. if (isFn(appOptions.onLaunch)) {
  2502. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2503. vm.__call_hook('onLaunch', args);
  2504. }
  2505. return vm;
  2506. }
  2507. todos.forEach(function (todoApi) {
  2508. protocols[todoApi] = false;
  2509. });
  2510. canIUses.forEach(function (canIUseApi) {
  2511. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2512. if (!wx.canIUse(apiName)) {
  2513. protocols[canIUseApi] = false;
  2514. }
  2515. });
  2516. var uni = {};
  2517. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2518. uni = new Proxy({}, {
  2519. get: function get(target, name) {
  2520. if (hasOwn(target, name)) {
  2521. return target[name];
  2522. }
  2523. if (baseApi[name]) {
  2524. return baseApi[name];
  2525. }
  2526. if (api[name]) {
  2527. return promisify(name, api[name]);
  2528. }
  2529. {
  2530. if (extraApi[name]) {
  2531. return promisify(name, extraApi[name]);
  2532. }
  2533. if (todoApis[name]) {
  2534. return promisify(name, todoApis[name]);
  2535. }
  2536. }
  2537. if (eventApi[name]) {
  2538. return eventApi[name];
  2539. }
  2540. return promisify(name, wrapper(name, wx[name]));
  2541. },
  2542. set: function set(target, name, value) {
  2543. target[name] = value;
  2544. return true;
  2545. }
  2546. });
  2547. } else {
  2548. Object.keys(baseApi).forEach(function (name) {
  2549. uni[name] = baseApi[name];
  2550. });
  2551. {
  2552. Object.keys(todoApis).forEach(function (name) {
  2553. uni[name] = promisify(name, todoApis[name]);
  2554. });
  2555. Object.keys(extraApi).forEach(function (name) {
  2556. uni[name] = promisify(name, extraApi[name]);
  2557. });
  2558. }
  2559. Object.keys(eventApi).forEach(function (name) {
  2560. uni[name] = eventApi[name];
  2561. });
  2562. Object.keys(api).forEach(function (name) {
  2563. uni[name] = promisify(name, api[name]);
  2564. });
  2565. Object.keys(wx).forEach(function (name) {
  2566. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2567. uni[name] = promisify(name, wrapper(name, wx[name]));
  2568. }
  2569. });
  2570. }
  2571. wx.createApp = createApp;
  2572. wx.createPage = createPage;
  2573. wx.createComponent = createComponent;
  2574. wx.createSubpackageApp = createSubpackageApp;
  2575. wx.createPlugin = createPlugin;
  2576. var uni$1 = uni;
  2577. var _default = uni$1;
  2578. exports.default = _default;
  2579. /* 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)))
  2580. /***/ }),
  2581. /***/ 20:
  2582. /*!****************************************************************!*\
  2583. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2584. \****************************************************************/
  2585. /*! no static exports found */
  2586. /***/ (function(module, exports) {
  2587. function _iterableToArray(iter) {
  2588. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2589. }
  2590. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2591. /***/ }),
  2592. /***/ 21:
  2593. /*!******************************************************************!*\
  2594. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2595. \******************************************************************/
  2596. /*! no static exports found */
  2597. /***/ (function(module, exports) {
  2598. function _nonIterableSpread() {
  2599. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2600. }
  2601. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2602. /***/ }),
  2603. /***/ 22:
  2604. /*!*************************************************************!*\
  2605. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2606. \*************************************************************/
  2607. /*! no static exports found */
  2608. /***/ (function(module, exports, __webpack_require__) {
  2609. "use strict";
  2610. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2611. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2612. Object.defineProperty(exports, "__esModule", {
  2613. value: true
  2614. });
  2615. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2616. exports.compileI18nJsonStr = compileI18nJsonStr;
  2617. exports.hasI18nJson = hasI18nJson;
  2618. exports.initVueI18n = initVueI18n;
  2619. exports.isI18nStr = isI18nStr;
  2620. exports.isString = void 0;
  2621. exports.normalizeLocale = normalizeLocale;
  2622. exports.parseI18nJson = parseI18nJson;
  2623. exports.resolveLocale = resolveLocale;
  2624. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2625. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2626. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2627. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2628. var isObject = function isObject(val) {
  2629. return val !== null && (0, _typeof2.default)(val) === 'object';
  2630. };
  2631. var defaultDelimiters = ['{', '}'];
  2632. var BaseFormatter = /*#__PURE__*/function () {
  2633. function BaseFormatter() {
  2634. (0, _classCallCheck2.default)(this, BaseFormatter);
  2635. this._caches = Object.create(null);
  2636. }
  2637. (0, _createClass2.default)(BaseFormatter, [{
  2638. key: "interpolate",
  2639. value: function interpolate(message, values) {
  2640. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2641. if (!values) {
  2642. return [message];
  2643. }
  2644. var tokens = this._caches[message];
  2645. if (!tokens) {
  2646. tokens = parse(message, delimiters);
  2647. this._caches[message] = tokens;
  2648. }
  2649. return compile(tokens, values);
  2650. }
  2651. }]);
  2652. return BaseFormatter;
  2653. }();
  2654. exports.Formatter = BaseFormatter;
  2655. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2656. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2657. function parse(format, _ref) {
  2658. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2659. startDelimiter = _ref2[0],
  2660. endDelimiter = _ref2[1];
  2661. var tokens = [];
  2662. var position = 0;
  2663. var text = '';
  2664. while (position < format.length) {
  2665. var char = format[position++];
  2666. if (char === startDelimiter) {
  2667. if (text) {
  2668. tokens.push({
  2669. type: 'text',
  2670. value: text
  2671. });
  2672. }
  2673. text = '';
  2674. var sub = '';
  2675. char = format[position++];
  2676. while (char !== undefined && char !== endDelimiter) {
  2677. sub += char;
  2678. char = format[position++];
  2679. }
  2680. var isClosed = char === endDelimiter;
  2681. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2682. tokens.push({
  2683. value: sub,
  2684. type: type
  2685. });
  2686. }
  2687. // else if (char === '%') {
  2688. // // when found rails i18n syntax, skip text capture
  2689. // if (format[position] !== '{') {
  2690. // text += char
  2691. // }
  2692. // }
  2693. else {
  2694. text += char;
  2695. }
  2696. }
  2697. text && tokens.push({
  2698. type: 'text',
  2699. value: text
  2700. });
  2701. return tokens;
  2702. }
  2703. function compile(tokens, values) {
  2704. var compiled = [];
  2705. var index = 0;
  2706. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2707. if (mode === 'unknown') {
  2708. return compiled;
  2709. }
  2710. while (index < tokens.length) {
  2711. var token = tokens[index];
  2712. switch (token.type) {
  2713. case 'text':
  2714. compiled.push(token.value);
  2715. break;
  2716. case 'list':
  2717. compiled.push(values[parseInt(token.value, 10)]);
  2718. break;
  2719. case 'named':
  2720. if (mode === 'named') {
  2721. compiled.push(values[token.value]);
  2722. } else {
  2723. if (true) {
  2724. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2725. }
  2726. }
  2727. break;
  2728. case 'unknown':
  2729. if (true) {
  2730. console.warn("Detect 'unknown' type of token!");
  2731. }
  2732. break;
  2733. }
  2734. index++;
  2735. }
  2736. return compiled;
  2737. }
  2738. var LOCALE_ZH_HANS = 'zh-Hans';
  2739. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2740. var LOCALE_ZH_HANT = 'zh-Hant';
  2741. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2742. var LOCALE_EN = 'en';
  2743. exports.LOCALE_EN = LOCALE_EN;
  2744. var LOCALE_FR = 'fr';
  2745. exports.LOCALE_FR = LOCALE_FR;
  2746. var LOCALE_ES = 'es';
  2747. exports.LOCALE_ES = LOCALE_ES;
  2748. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2749. var hasOwn = function hasOwn(val, key) {
  2750. return hasOwnProperty.call(val, key);
  2751. };
  2752. var defaultFormatter = new BaseFormatter();
  2753. function include(str, parts) {
  2754. return !!parts.find(function (part) {
  2755. return str.indexOf(part) !== -1;
  2756. });
  2757. }
  2758. function startsWith(str, parts) {
  2759. return parts.find(function (part) {
  2760. return str.indexOf(part) === 0;
  2761. });
  2762. }
  2763. function normalizeLocale(locale, messages) {
  2764. if (!locale) {
  2765. return;
  2766. }
  2767. locale = locale.trim().replace(/_/g, '-');
  2768. if (messages && messages[locale]) {
  2769. return locale;
  2770. }
  2771. locale = locale.toLowerCase();
  2772. if (locale === 'chinese') {
  2773. // 支付宝
  2774. return LOCALE_ZH_HANS;
  2775. }
  2776. if (locale.indexOf('zh') === 0) {
  2777. if (locale.indexOf('-hans') > -1) {
  2778. return LOCALE_ZH_HANS;
  2779. }
  2780. if (locale.indexOf('-hant') > -1) {
  2781. return LOCALE_ZH_HANT;
  2782. }
  2783. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2784. return LOCALE_ZH_HANT;
  2785. }
  2786. return LOCALE_ZH_HANS;
  2787. }
  2788. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  2789. if (messages && Object.keys(messages).length > 0) {
  2790. locales = Object.keys(messages);
  2791. }
  2792. var lang = startsWith(locale, locales);
  2793. if (lang) {
  2794. return lang;
  2795. }
  2796. }
  2797. var I18n = /*#__PURE__*/function () {
  2798. function I18n(_ref3) {
  2799. var locale = _ref3.locale,
  2800. fallbackLocale = _ref3.fallbackLocale,
  2801. messages = _ref3.messages,
  2802. watcher = _ref3.watcher,
  2803. formater = _ref3.formater;
  2804. (0, _classCallCheck2.default)(this, I18n);
  2805. this.locale = LOCALE_EN;
  2806. this.fallbackLocale = LOCALE_EN;
  2807. this.message = {};
  2808. this.messages = {};
  2809. this.watchers = [];
  2810. if (fallbackLocale) {
  2811. this.fallbackLocale = fallbackLocale;
  2812. }
  2813. this.formater = formater || defaultFormatter;
  2814. this.messages = messages || {};
  2815. this.setLocale(locale || LOCALE_EN);
  2816. if (watcher) {
  2817. this.watchLocale(watcher);
  2818. }
  2819. }
  2820. (0, _createClass2.default)(I18n, [{
  2821. key: "setLocale",
  2822. value: function setLocale(locale) {
  2823. var _this = this;
  2824. var oldLocale = this.locale;
  2825. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2826. if (!this.messages[this.locale]) {
  2827. // 可能初始化时不存在
  2828. this.messages[this.locale] = {};
  2829. }
  2830. this.message = this.messages[this.locale];
  2831. // 仅发生变化时,通知
  2832. if (oldLocale !== this.locale) {
  2833. this.watchers.forEach(function (watcher) {
  2834. watcher(_this.locale, oldLocale);
  2835. });
  2836. }
  2837. }
  2838. }, {
  2839. key: "getLocale",
  2840. value: function getLocale() {
  2841. return this.locale;
  2842. }
  2843. }, {
  2844. key: "watchLocale",
  2845. value: function watchLocale(fn) {
  2846. var _this2 = this;
  2847. var index = this.watchers.push(fn) - 1;
  2848. return function () {
  2849. _this2.watchers.splice(index, 1);
  2850. };
  2851. }
  2852. }, {
  2853. key: "add",
  2854. value: function add(locale, message) {
  2855. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2856. var curMessages = this.messages[locale];
  2857. if (curMessages) {
  2858. if (override) {
  2859. Object.assign(curMessages, message);
  2860. } else {
  2861. Object.keys(message).forEach(function (key) {
  2862. if (!hasOwn(curMessages, key)) {
  2863. curMessages[key] = message[key];
  2864. }
  2865. });
  2866. }
  2867. } else {
  2868. this.messages[locale] = message;
  2869. }
  2870. }
  2871. }, {
  2872. key: "f",
  2873. value: function f(message, values, delimiters) {
  2874. return this.formater.interpolate(message, values, delimiters).join('');
  2875. }
  2876. }, {
  2877. key: "t",
  2878. value: function t(key, locale, values) {
  2879. var message = this.message;
  2880. if (typeof locale === 'string') {
  2881. locale = normalizeLocale(locale, this.messages);
  2882. locale && (message = this.messages[locale]);
  2883. } else {
  2884. values = locale;
  2885. }
  2886. if (!hasOwn(message, key)) {
  2887. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2888. return key;
  2889. }
  2890. return this.formater.interpolate(message[key], values).join('');
  2891. }
  2892. }]);
  2893. return I18n;
  2894. }();
  2895. exports.I18n = I18n;
  2896. function watchAppLocale(appVm, i18n) {
  2897. // 需要保证 watch 的触发在组件渲染之前
  2898. if (appVm.$watchLocale) {
  2899. // vue2
  2900. appVm.$watchLocale(function (newLocale) {
  2901. i18n.setLocale(newLocale);
  2902. });
  2903. } else {
  2904. appVm.$watch(function () {
  2905. return appVm.$locale;
  2906. }, function (newLocale) {
  2907. i18n.setLocale(newLocale);
  2908. });
  2909. }
  2910. }
  2911. function getDefaultLocale() {
  2912. if (typeof uni !== 'undefined' && uni.getLocale) {
  2913. return uni.getLocale();
  2914. }
  2915. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2916. if (typeof global !== 'undefined' && global.getLocale) {
  2917. return global.getLocale();
  2918. }
  2919. return LOCALE_EN;
  2920. }
  2921. function initVueI18n(locale) {
  2922. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2923. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  2924. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  2925. // 兼容旧版本入参
  2926. if (typeof locale !== 'string') {
  2927. var _ref4 = [messages, locale];
  2928. locale = _ref4[0];
  2929. messages = _ref4[1];
  2930. }
  2931. if (typeof locale !== 'string') {
  2932. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  2933. locale = getDefaultLocale();
  2934. }
  2935. if (typeof fallbackLocale !== 'string') {
  2936. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  2937. }
  2938. var i18n = new I18n({
  2939. locale: locale,
  2940. fallbackLocale: fallbackLocale,
  2941. messages: messages,
  2942. watcher: watcher
  2943. });
  2944. var _t = function t(key, values) {
  2945. if (typeof getApp !== 'function') {
  2946. // app view
  2947. /* eslint-disable no-func-assign */
  2948. _t = function t(key, values) {
  2949. return i18n.t(key, values);
  2950. };
  2951. } else {
  2952. var isWatchedAppLocale = false;
  2953. _t = function t(key, values) {
  2954. var appVm = getApp().$vm;
  2955. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  2956. // options: {
  2957. // type: Array,
  2958. // default () {
  2959. // return [{
  2960. // icon: 'shop',
  2961. // text: t("uni-goods-nav.options.shop"),
  2962. // }, {
  2963. // icon: 'cart',
  2964. // text: t("uni-goods-nav.options.cart")
  2965. // }]
  2966. // }
  2967. // },
  2968. if (appVm) {
  2969. // 触发响应式
  2970. appVm.$locale;
  2971. if (!isWatchedAppLocale) {
  2972. isWatchedAppLocale = true;
  2973. watchAppLocale(appVm, i18n);
  2974. }
  2975. }
  2976. return i18n.t(key, values);
  2977. };
  2978. }
  2979. return _t(key, values);
  2980. };
  2981. return {
  2982. i18n: i18n,
  2983. f: function f(message, values, delimiters) {
  2984. return i18n.f(message, values, delimiters);
  2985. },
  2986. t: function t(key, values) {
  2987. return _t(key, values);
  2988. },
  2989. add: function add(locale, message) {
  2990. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2991. return i18n.add(locale, message, override);
  2992. },
  2993. watch: function watch(fn) {
  2994. return i18n.watchLocale(fn);
  2995. },
  2996. getLocale: function getLocale() {
  2997. return i18n.getLocale();
  2998. },
  2999. setLocale: function setLocale(newLocale) {
  3000. return i18n.setLocale(newLocale);
  3001. }
  3002. };
  3003. }
  3004. var isString = function isString(val) {
  3005. return typeof val === 'string';
  3006. };
  3007. exports.isString = isString;
  3008. var formater;
  3009. function hasI18nJson(jsonObj, delimiters) {
  3010. if (!formater) {
  3011. formater = new BaseFormatter();
  3012. }
  3013. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3014. var value = jsonObj[key];
  3015. if (isString(value)) {
  3016. if (isI18nStr(value, delimiters)) {
  3017. return true;
  3018. }
  3019. } else {
  3020. return hasI18nJson(value, delimiters);
  3021. }
  3022. });
  3023. }
  3024. function parseI18nJson(jsonObj, values, delimiters) {
  3025. if (!formater) {
  3026. formater = new BaseFormatter();
  3027. }
  3028. walkJsonObj(jsonObj, function (jsonObj, key) {
  3029. var value = jsonObj[key];
  3030. if (isString(value)) {
  3031. if (isI18nStr(value, delimiters)) {
  3032. jsonObj[key] = compileStr(value, values, delimiters);
  3033. }
  3034. } else {
  3035. parseI18nJson(value, values, delimiters);
  3036. }
  3037. });
  3038. return jsonObj;
  3039. }
  3040. function compileI18nJsonStr(jsonStr, _ref5) {
  3041. var locale = _ref5.locale,
  3042. locales = _ref5.locales,
  3043. delimiters = _ref5.delimiters;
  3044. if (!isI18nStr(jsonStr, delimiters)) {
  3045. return jsonStr;
  3046. }
  3047. if (!formater) {
  3048. formater = new BaseFormatter();
  3049. }
  3050. var localeValues = [];
  3051. Object.keys(locales).forEach(function (name) {
  3052. if (name !== locale) {
  3053. localeValues.push({
  3054. locale: name,
  3055. values: locales[name]
  3056. });
  3057. }
  3058. });
  3059. localeValues.unshift({
  3060. locale: locale,
  3061. values: locales[locale]
  3062. });
  3063. try {
  3064. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3065. } catch (e) {}
  3066. return jsonStr;
  3067. }
  3068. function isI18nStr(value, delimiters) {
  3069. return value.indexOf(delimiters[0]) > -1;
  3070. }
  3071. function compileStr(value, values, delimiters) {
  3072. return formater.interpolate(value, values, delimiters).join('');
  3073. }
  3074. function compileValue(jsonObj, key, localeValues, delimiters) {
  3075. var value = jsonObj[key];
  3076. if (isString(value)) {
  3077. // 存在国际化
  3078. if (isI18nStr(value, delimiters)) {
  3079. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3080. if (localeValues.length > 1) {
  3081. // 格式化国际化语言
  3082. var valueLocales = jsonObj[key + 'Locales'] = {};
  3083. localeValues.forEach(function (localValue) {
  3084. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3085. });
  3086. }
  3087. }
  3088. } else {
  3089. compileJsonObj(value, localeValues, delimiters);
  3090. }
  3091. }
  3092. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3093. walkJsonObj(jsonObj, function (jsonObj, key) {
  3094. compileValue(jsonObj, key, localeValues, delimiters);
  3095. });
  3096. return jsonObj;
  3097. }
  3098. function walkJsonObj(jsonObj, walk) {
  3099. if (Array.isArray(jsonObj)) {
  3100. for (var i = 0; i < jsonObj.length; i++) {
  3101. if (walk(jsonObj, i)) {
  3102. return true;
  3103. }
  3104. }
  3105. } else if (isObject(jsonObj)) {
  3106. for (var key in jsonObj) {
  3107. if (walk(jsonObj, key)) {
  3108. return true;
  3109. }
  3110. }
  3111. }
  3112. return false;
  3113. }
  3114. function resolveLocale(locales) {
  3115. return function (locale) {
  3116. if (!locale) {
  3117. return locale;
  3118. }
  3119. locale = normalizeLocale(locale) || locale;
  3120. return resolveLocaleChain(locale).find(function (locale) {
  3121. return locales.indexOf(locale) > -1;
  3122. });
  3123. };
  3124. }
  3125. function resolveLocaleChain(locale) {
  3126. var chain = [];
  3127. var tokens = locale.split('-');
  3128. while (tokens.length) {
  3129. chain.push(tokens.join('-'));
  3130. tokens.pop();
  3131. }
  3132. return chain;
  3133. }
  3134. /* 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)))
  3135. /***/ }),
  3136. /***/ 23:
  3137. /*!***************************************************************!*\
  3138. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3139. \***************************************************************/
  3140. /*! no static exports found */
  3141. /***/ (function(module, exports) {
  3142. function _classCallCheck(instance, Constructor) {
  3143. if (!(instance instanceof Constructor)) {
  3144. throw new TypeError("Cannot call a class as a function");
  3145. }
  3146. }
  3147. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3148. /***/ }),
  3149. /***/ 24:
  3150. /*!************************************************************!*\
  3151. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3152. \************************************************************/
  3153. /*! no static exports found */
  3154. /***/ (function(module, exports, __webpack_require__) {
  3155. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3156. function _defineProperties(target, props) {
  3157. for (var i = 0; i < props.length; i++) {
  3158. var descriptor = props[i];
  3159. descriptor.enumerable = descriptor.enumerable || false;
  3160. descriptor.configurable = true;
  3161. if ("value" in descriptor) descriptor.writable = true;
  3162. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3163. }
  3164. }
  3165. function _createClass(Constructor, protoProps, staticProps) {
  3166. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3167. if (staticProps) _defineProperties(Constructor, staticProps);
  3168. Object.defineProperty(Constructor, "prototype", {
  3169. writable: false
  3170. });
  3171. return Constructor;
  3172. }
  3173. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3174. /***/ }),
  3175. /***/ 25:
  3176. /*!******************************************************************************************!*\
  3177. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3178. \******************************************************************************************/
  3179. /*! exports provided: default */
  3180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3181. "use strict";
  3182. __webpack_require__.r(__webpack_exports__);
  3183. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3184. * Vue.js v2.6.11
  3185. * (c) 2014-2023 Evan You
  3186. * Released under the MIT License.
  3187. */
  3188. /* */
  3189. var emptyObject = Object.freeze({});
  3190. // These helpers produce better VM code in JS engines due to their
  3191. // explicitness and function inlining.
  3192. function isUndef (v) {
  3193. return v === undefined || v === null
  3194. }
  3195. function isDef (v) {
  3196. return v !== undefined && v !== null
  3197. }
  3198. function isTrue (v) {
  3199. return v === true
  3200. }
  3201. function isFalse (v) {
  3202. return v === false
  3203. }
  3204. /**
  3205. * Check if value is primitive.
  3206. */
  3207. function isPrimitive (value) {
  3208. return (
  3209. typeof value === 'string' ||
  3210. typeof value === 'number' ||
  3211. // $flow-disable-line
  3212. typeof value === 'symbol' ||
  3213. typeof value === 'boolean'
  3214. )
  3215. }
  3216. /**
  3217. * Quick object check - this is primarily used to tell
  3218. * Objects from primitive values when we know the value
  3219. * is a JSON-compliant type.
  3220. */
  3221. function isObject (obj) {
  3222. return obj !== null && typeof obj === 'object'
  3223. }
  3224. /**
  3225. * Get the raw type string of a value, e.g., [object Object].
  3226. */
  3227. var _toString = Object.prototype.toString;
  3228. function toRawType (value) {
  3229. return _toString.call(value).slice(8, -1)
  3230. }
  3231. /**
  3232. * Strict object type check. Only returns true
  3233. * for plain JavaScript objects.
  3234. */
  3235. function isPlainObject (obj) {
  3236. return _toString.call(obj) === '[object Object]'
  3237. }
  3238. function isRegExp (v) {
  3239. return _toString.call(v) === '[object RegExp]'
  3240. }
  3241. /**
  3242. * Check if val is a valid array index.
  3243. */
  3244. function isValidArrayIndex (val) {
  3245. var n = parseFloat(String(val));
  3246. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3247. }
  3248. function isPromise (val) {
  3249. return (
  3250. isDef(val) &&
  3251. typeof val.then === 'function' &&
  3252. typeof val.catch === 'function'
  3253. )
  3254. }
  3255. /**
  3256. * Convert a value to a string that is actually rendered.
  3257. */
  3258. function toString (val) {
  3259. return val == null
  3260. ? ''
  3261. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3262. ? JSON.stringify(val, null, 2)
  3263. : String(val)
  3264. }
  3265. /**
  3266. * Convert an input value to a number for persistence.
  3267. * If the conversion fails, return original string.
  3268. */
  3269. function toNumber (val) {
  3270. var n = parseFloat(val);
  3271. return isNaN(n) ? val : n
  3272. }
  3273. /**
  3274. * Make a map and return a function for checking if a key
  3275. * is in that map.
  3276. */
  3277. function makeMap (
  3278. str,
  3279. expectsLowerCase
  3280. ) {
  3281. var map = Object.create(null);
  3282. var list = str.split(',');
  3283. for (var i = 0; i < list.length; i++) {
  3284. map[list[i]] = true;
  3285. }
  3286. return expectsLowerCase
  3287. ? function (val) { return map[val.toLowerCase()]; }
  3288. : function (val) { return map[val]; }
  3289. }
  3290. /**
  3291. * Check if a tag is a built-in tag.
  3292. */
  3293. var isBuiltInTag = makeMap('slot,component', true);
  3294. /**
  3295. * Check if an attribute is a reserved attribute.
  3296. */
  3297. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3298. /**
  3299. * Remove an item from an array.
  3300. */
  3301. function remove (arr, item) {
  3302. if (arr.length) {
  3303. var index = arr.indexOf(item);
  3304. if (index > -1) {
  3305. return arr.splice(index, 1)
  3306. }
  3307. }
  3308. }
  3309. /**
  3310. * Check whether an object has the property.
  3311. */
  3312. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3313. function hasOwn (obj, key) {
  3314. return hasOwnProperty.call(obj, key)
  3315. }
  3316. /**
  3317. * Create a cached version of a pure function.
  3318. */
  3319. function cached (fn) {
  3320. var cache = Object.create(null);
  3321. return (function cachedFn (str) {
  3322. var hit = cache[str];
  3323. return hit || (cache[str] = fn(str))
  3324. })
  3325. }
  3326. /**
  3327. * Camelize a hyphen-delimited string.
  3328. */
  3329. var camelizeRE = /-(\w)/g;
  3330. var camelize = cached(function (str) {
  3331. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3332. });
  3333. /**
  3334. * Capitalize a string.
  3335. */
  3336. var capitalize = cached(function (str) {
  3337. return str.charAt(0).toUpperCase() + str.slice(1)
  3338. });
  3339. /**
  3340. * Hyphenate a camelCase string.
  3341. */
  3342. var hyphenateRE = /\B([A-Z])/g;
  3343. var hyphenate = cached(function (str) {
  3344. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3345. });
  3346. /**
  3347. * Simple bind polyfill for environments that do not support it,
  3348. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3349. * since native bind is now performant enough in most browsers.
  3350. * But removing it would mean breaking code that was able to run in
  3351. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3352. */
  3353. /* istanbul ignore next */
  3354. function polyfillBind (fn, ctx) {
  3355. function boundFn (a) {
  3356. var l = arguments.length;
  3357. return l
  3358. ? l > 1
  3359. ? fn.apply(ctx, arguments)
  3360. : fn.call(ctx, a)
  3361. : fn.call(ctx)
  3362. }
  3363. boundFn._length = fn.length;
  3364. return boundFn
  3365. }
  3366. function nativeBind (fn, ctx) {
  3367. return fn.bind(ctx)
  3368. }
  3369. var bind = Function.prototype.bind
  3370. ? nativeBind
  3371. : polyfillBind;
  3372. /**
  3373. * Convert an Array-like object to a real Array.
  3374. */
  3375. function toArray (list, start) {
  3376. start = start || 0;
  3377. var i = list.length - start;
  3378. var ret = new Array(i);
  3379. while (i--) {
  3380. ret[i] = list[i + start];
  3381. }
  3382. return ret
  3383. }
  3384. /**
  3385. * Mix properties into target object.
  3386. */
  3387. function extend (to, _from) {
  3388. for (var key in _from) {
  3389. to[key] = _from[key];
  3390. }
  3391. return to
  3392. }
  3393. /**
  3394. * Merge an Array of Objects into a single Object.
  3395. */
  3396. function toObject (arr) {
  3397. var res = {};
  3398. for (var i = 0; i < arr.length; i++) {
  3399. if (arr[i]) {
  3400. extend(res, arr[i]);
  3401. }
  3402. }
  3403. return res
  3404. }
  3405. /* eslint-disable no-unused-vars */
  3406. /**
  3407. * Perform no operation.
  3408. * Stubbing args to make Flow happy without leaving useless transpiled code
  3409. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3410. */
  3411. function noop (a, b, c) {}
  3412. /**
  3413. * Always return false.
  3414. */
  3415. var no = function (a, b, c) { return false; };
  3416. /* eslint-enable no-unused-vars */
  3417. /**
  3418. * Return the same value.
  3419. */
  3420. var identity = function (_) { return _; };
  3421. /**
  3422. * Check if two values are loosely equal - that is,
  3423. * if they are plain objects, do they have the same shape?
  3424. */
  3425. function looseEqual (a, b) {
  3426. if (a === b) { return true }
  3427. var isObjectA = isObject(a);
  3428. var isObjectB = isObject(b);
  3429. if (isObjectA && isObjectB) {
  3430. try {
  3431. var isArrayA = Array.isArray(a);
  3432. var isArrayB = Array.isArray(b);
  3433. if (isArrayA && isArrayB) {
  3434. return a.length === b.length && a.every(function (e, i) {
  3435. return looseEqual(e, b[i])
  3436. })
  3437. } else if (a instanceof Date && b instanceof Date) {
  3438. return a.getTime() === b.getTime()
  3439. } else if (!isArrayA && !isArrayB) {
  3440. var keysA = Object.keys(a);
  3441. var keysB = Object.keys(b);
  3442. return keysA.length === keysB.length && keysA.every(function (key) {
  3443. return looseEqual(a[key], b[key])
  3444. })
  3445. } else {
  3446. /* istanbul ignore next */
  3447. return false
  3448. }
  3449. } catch (e) {
  3450. /* istanbul ignore next */
  3451. return false
  3452. }
  3453. } else if (!isObjectA && !isObjectB) {
  3454. return String(a) === String(b)
  3455. } else {
  3456. return false
  3457. }
  3458. }
  3459. /**
  3460. * Return the first index at which a loosely equal value can be
  3461. * found in the array (if value is a plain object, the array must
  3462. * contain an object of the same shape), or -1 if it is not present.
  3463. */
  3464. function looseIndexOf (arr, val) {
  3465. for (var i = 0; i < arr.length; i++) {
  3466. if (looseEqual(arr[i], val)) { return i }
  3467. }
  3468. return -1
  3469. }
  3470. /**
  3471. * Ensure a function is called only once.
  3472. */
  3473. function once (fn) {
  3474. var called = false;
  3475. return function () {
  3476. if (!called) {
  3477. called = true;
  3478. fn.apply(this, arguments);
  3479. }
  3480. }
  3481. }
  3482. var ASSET_TYPES = [
  3483. 'component',
  3484. 'directive',
  3485. 'filter'
  3486. ];
  3487. var LIFECYCLE_HOOKS = [
  3488. 'beforeCreate',
  3489. 'created',
  3490. 'beforeMount',
  3491. 'mounted',
  3492. 'beforeUpdate',
  3493. 'updated',
  3494. 'beforeDestroy',
  3495. 'destroyed',
  3496. 'activated',
  3497. 'deactivated',
  3498. 'errorCaptured',
  3499. 'serverPrefetch'
  3500. ];
  3501. /* */
  3502. var config = ({
  3503. /**
  3504. * Option merge strategies (used in core/util/options)
  3505. */
  3506. // $flow-disable-line
  3507. optionMergeStrategies: Object.create(null),
  3508. /**
  3509. * Whether to suppress warnings.
  3510. */
  3511. silent: false,
  3512. /**
  3513. * Show production mode tip message on boot?
  3514. */
  3515. productionTip: "development" !== 'production',
  3516. /**
  3517. * Whether to enable devtools
  3518. */
  3519. devtools: "development" !== 'production',
  3520. /**
  3521. * Whether to record perf
  3522. */
  3523. performance: false,
  3524. /**
  3525. * Error handler for watcher errors
  3526. */
  3527. errorHandler: null,
  3528. /**
  3529. * Warn handler for watcher warns
  3530. */
  3531. warnHandler: null,
  3532. /**
  3533. * Ignore certain custom elements
  3534. */
  3535. ignoredElements: [],
  3536. /**
  3537. * Custom user key aliases for v-on
  3538. */
  3539. // $flow-disable-line
  3540. keyCodes: Object.create(null),
  3541. /**
  3542. * Check if a tag is reserved so that it cannot be registered as a
  3543. * component. This is platform-dependent and may be overwritten.
  3544. */
  3545. isReservedTag: no,
  3546. /**
  3547. * Check if an attribute is reserved so that it cannot be used as a component
  3548. * prop. This is platform-dependent and may be overwritten.
  3549. */
  3550. isReservedAttr: no,
  3551. /**
  3552. * Check if a tag is an unknown element.
  3553. * Platform-dependent.
  3554. */
  3555. isUnknownElement: no,
  3556. /**
  3557. * Get the namespace of an element
  3558. */
  3559. getTagNamespace: noop,
  3560. /**
  3561. * Parse the real tag name for the specific platform.
  3562. */
  3563. parsePlatformTagName: identity,
  3564. /**
  3565. * Check if an attribute must be bound using property, e.g. value
  3566. * Platform-dependent.
  3567. */
  3568. mustUseProp: no,
  3569. /**
  3570. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3571. * This will significantly reduce performance if set to false.
  3572. */
  3573. async: true,
  3574. /**
  3575. * Exposed for legacy reasons
  3576. */
  3577. _lifecycleHooks: LIFECYCLE_HOOKS
  3578. });
  3579. /* */
  3580. /**
  3581. * unicode letters used for parsing html tags, component names and property paths.
  3582. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3583. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3584. */
  3585. 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/;
  3586. /**
  3587. * Check if a string starts with $ or _
  3588. */
  3589. function isReserved (str) {
  3590. var c = (str + '').charCodeAt(0);
  3591. return c === 0x24 || c === 0x5F
  3592. }
  3593. /**
  3594. * Define a property.
  3595. */
  3596. function def (obj, key, val, enumerable) {
  3597. Object.defineProperty(obj, key, {
  3598. value: val,
  3599. enumerable: !!enumerable,
  3600. writable: true,
  3601. configurable: true
  3602. });
  3603. }
  3604. /**
  3605. * Parse simple path.
  3606. */
  3607. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3608. function parsePath (path) {
  3609. if (bailRE.test(path)) {
  3610. return
  3611. }
  3612. var segments = path.split('.');
  3613. return function (obj) {
  3614. for (var i = 0; i < segments.length; i++) {
  3615. if (!obj) { return }
  3616. obj = obj[segments[i]];
  3617. }
  3618. return obj
  3619. }
  3620. }
  3621. /* */
  3622. // can we use __proto__?
  3623. var hasProto = '__proto__' in {};
  3624. // Browser environment sniffing
  3625. var inBrowser = typeof window !== 'undefined';
  3626. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3627. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3628. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3629. var isIE = UA && /msie|trident/.test(UA);
  3630. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3631. var isEdge = UA && UA.indexOf('edge/') > 0;
  3632. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3633. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3634. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3635. var isPhantomJS = UA && /phantomjs/.test(UA);
  3636. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3637. // Firefox has a "watch" function on Object.prototype...
  3638. var nativeWatch = ({}).watch;
  3639. if (inBrowser) {
  3640. try {
  3641. var opts = {};
  3642. Object.defineProperty(opts, 'passive', ({
  3643. get: function get () {
  3644. }
  3645. })); // https://github.com/facebook/flow/issues/285
  3646. window.addEventListener('test-passive', null, opts);
  3647. } catch (e) {}
  3648. }
  3649. // this needs to be lazy-evaled because vue may be required before
  3650. // vue-server-renderer can set VUE_ENV
  3651. var _isServer;
  3652. var isServerRendering = function () {
  3653. if (_isServer === undefined) {
  3654. /* istanbul ignore if */
  3655. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3656. // detect presence of vue-server-renderer and avoid
  3657. // Webpack shimming the process
  3658. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3659. } else {
  3660. _isServer = false;
  3661. }
  3662. }
  3663. return _isServer
  3664. };
  3665. // detect devtools
  3666. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3667. /* istanbul ignore next */
  3668. function isNative (Ctor) {
  3669. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3670. }
  3671. var hasSymbol =
  3672. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3673. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3674. var _Set;
  3675. /* istanbul ignore if */ // $flow-disable-line
  3676. if (typeof Set !== 'undefined' && isNative(Set)) {
  3677. // use native Set when available.
  3678. _Set = Set;
  3679. } else {
  3680. // a non-standard Set polyfill that only works with primitive keys.
  3681. _Set = /*@__PURE__*/(function () {
  3682. function Set () {
  3683. this.set = Object.create(null);
  3684. }
  3685. Set.prototype.has = function has (key) {
  3686. return this.set[key] === true
  3687. };
  3688. Set.prototype.add = function add (key) {
  3689. this.set[key] = true;
  3690. };
  3691. Set.prototype.clear = function clear () {
  3692. this.set = Object.create(null);
  3693. };
  3694. return Set;
  3695. }());
  3696. }
  3697. /* */
  3698. var warn = noop;
  3699. var tip = noop;
  3700. var generateComponentTrace = (noop); // work around flow check
  3701. var formatComponentName = (noop);
  3702. if (true) {
  3703. var hasConsole = typeof console !== 'undefined';
  3704. var classifyRE = /(?:^|[-_])(\w)/g;
  3705. var classify = function (str) { return str
  3706. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3707. .replace(/[-_]/g, ''); };
  3708. warn = function (msg, vm) {
  3709. var trace = vm ? generateComponentTrace(vm) : '';
  3710. if (config.warnHandler) {
  3711. config.warnHandler.call(null, msg, vm, trace);
  3712. } else if (hasConsole && (!config.silent)) {
  3713. console.error(("[Vue warn]: " + msg + trace));
  3714. }
  3715. };
  3716. tip = function (msg, vm) {
  3717. if (hasConsole && (!config.silent)) {
  3718. console.warn("[Vue tip]: " + msg + (
  3719. vm ? generateComponentTrace(vm) : ''
  3720. ));
  3721. }
  3722. };
  3723. formatComponentName = function (vm, includeFile) {
  3724. if (vm.$root === vm) {
  3725. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3726. return ('') + vm.$options.__file
  3727. }
  3728. return '<Root>'
  3729. }
  3730. var options = typeof vm === 'function' && vm.cid != null
  3731. ? vm.options
  3732. : vm._isVue
  3733. ? vm.$options || vm.constructor.options
  3734. : vm;
  3735. var name = options.name || options._componentTag;
  3736. var file = options.__file;
  3737. if (!name && file) {
  3738. var match = file.match(/([^/\\]+)\.vue$/);
  3739. name = match && match[1];
  3740. }
  3741. return (
  3742. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3743. (file && includeFile !== false ? (" at " + file) : '')
  3744. )
  3745. };
  3746. var repeat = function (str, n) {
  3747. var res = '';
  3748. while (n) {
  3749. if (n % 2 === 1) { res += str; }
  3750. if (n > 1) { str += str; }
  3751. n >>= 1;
  3752. }
  3753. return res
  3754. };
  3755. generateComponentTrace = function (vm) {
  3756. if (vm._isVue && vm.$parent) {
  3757. var tree = [];
  3758. var currentRecursiveSequence = 0;
  3759. while (vm && vm.$options.name !== 'PageBody') {
  3760. if (tree.length > 0) {
  3761. var last = tree[tree.length - 1];
  3762. if (last.constructor === vm.constructor) {
  3763. currentRecursiveSequence++;
  3764. vm = vm.$parent;
  3765. continue
  3766. } else if (currentRecursiveSequence > 0) {
  3767. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3768. currentRecursiveSequence = 0;
  3769. }
  3770. }
  3771. !vm.$options.isReserved && tree.push(vm);
  3772. vm = vm.$parent;
  3773. }
  3774. return '\n\nfound in\n\n' + tree
  3775. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3776. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3777. : formatComponentName(vm))); })
  3778. .join('\n')
  3779. } else {
  3780. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3781. }
  3782. };
  3783. }
  3784. /* */
  3785. var uid = 0;
  3786. /**
  3787. * A dep is an observable that can have multiple
  3788. * directives subscribing to it.
  3789. */
  3790. var Dep = function Dep () {
  3791. this.id = uid++;
  3792. this.subs = [];
  3793. };
  3794. Dep.prototype.addSub = function addSub (sub) {
  3795. this.subs.push(sub);
  3796. };
  3797. Dep.prototype.removeSub = function removeSub (sub) {
  3798. remove(this.subs, sub);
  3799. };
  3800. Dep.prototype.depend = function depend () {
  3801. if (Dep.SharedObject.target) {
  3802. Dep.SharedObject.target.addDep(this);
  3803. }
  3804. };
  3805. Dep.prototype.notify = function notify () {
  3806. // stabilize the subscriber list first
  3807. var subs = this.subs.slice();
  3808. if ( true && !config.async) {
  3809. // subs aren't sorted in scheduler if not running async
  3810. // we need to sort them now to make sure they fire in correct
  3811. // order
  3812. subs.sort(function (a, b) { return a.id - b.id; });
  3813. }
  3814. for (var i = 0, l = subs.length; i < l; i++) {
  3815. subs[i].update();
  3816. }
  3817. };
  3818. // The current target watcher being evaluated.
  3819. // This is globally unique because only one watcher
  3820. // can be evaluated at a time.
  3821. // fixed by xxxxxx (nvue shared vuex)
  3822. /* eslint-disable no-undef */
  3823. Dep.SharedObject = {};
  3824. Dep.SharedObject.target = null;
  3825. Dep.SharedObject.targetStack = [];
  3826. function pushTarget (target) {
  3827. Dep.SharedObject.targetStack.push(target);
  3828. Dep.SharedObject.target = target;
  3829. Dep.target = target;
  3830. }
  3831. function popTarget () {
  3832. Dep.SharedObject.targetStack.pop();
  3833. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3834. Dep.target = Dep.SharedObject.target;
  3835. }
  3836. /* */
  3837. var VNode = function VNode (
  3838. tag,
  3839. data,
  3840. children,
  3841. text,
  3842. elm,
  3843. context,
  3844. componentOptions,
  3845. asyncFactory
  3846. ) {
  3847. this.tag = tag;
  3848. this.data = data;
  3849. this.children = children;
  3850. this.text = text;
  3851. this.elm = elm;
  3852. this.ns = undefined;
  3853. this.context = context;
  3854. this.fnContext = undefined;
  3855. this.fnOptions = undefined;
  3856. this.fnScopeId = undefined;
  3857. this.key = data && data.key;
  3858. this.componentOptions = componentOptions;
  3859. this.componentInstance = undefined;
  3860. this.parent = undefined;
  3861. this.raw = false;
  3862. this.isStatic = false;
  3863. this.isRootInsert = true;
  3864. this.isComment = false;
  3865. this.isCloned = false;
  3866. this.isOnce = false;
  3867. this.asyncFactory = asyncFactory;
  3868. this.asyncMeta = undefined;
  3869. this.isAsyncPlaceholder = false;
  3870. };
  3871. var prototypeAccessors = { child: { configurable: true } };
  3872. // DEPRECATED: alias for componentInstance for backwards compat.
  3873. /* istanbul ignore next */
  3874. prototypeAccessors.child.get = function () {
  3875. return this.componentInstance
  3876. };
  3877. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3878. var createEmptyVNode = function (text) {
  3879. if ( text === void 0 ) text = '';
  3880. var node = new VNode();
  3881. node.text = text;
  3882. node.isComment = true;
  3883. return node
  3884. };
  3885. function createTextVNode (val) {
  3886. return new VNode(undefined, undefined, undefined, String(val))
  3887. }
  3888. // optimized shallow clone
  3889. // used for static nodes and slot nodes because they may be reused across
  3890. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3891. // on their elm reference.
  3892. function cloneVNode (vnode) {
  3893. var cloned = new VNode(
  3894. vnode.tag,
  3895. vnode.data,
  3896. // #7975
  3897. // clone children array to avoid mutating original in case of cloning
  3898. // a child.
  3899. vnode.children && vnode.children.slice(),
  3900. vnode.text,
  3901. vnode.elm,
  3902. vnode.context,
  3903. vnode.componentOptions,
  3904. vnode.asyncFactory
  3905. );
  3906. cloned.ns = vnode.ns;
  3907. cloned.isStatic = vnode.isStatic;
  3908. cloned.key = vnode.key;
  3909. cloned.isComment = vnode.isComment;
  3910. cloned.fnContext = vnode.fnContext;
  3911. cloned.fnOptions = vnode.fnOptions;
  3912. cloned.fnScopeId = vnode.fnScopeId;
  3913. cloned.asyncMeta = vnode.asyncMeta;
  3914. cloned.isCloned = true;
  3915. return cloned
  3916. }
  3917. /*
  3918. * not type checking this file because flow doesn't play well with
  3919. * dynamically accessing methods on Array prototype
  3920. */
  3921. var arrayProto = Array.prototype;
  3922. var arrayMethods = Object.create(arrayProto);
  3923. var methodsToPatch = [
  3924. 'push',
  3925. 'pop',
  3926. 'shift',
  3927. 'unshift',
  3928. 'splice',
  3929. 'sort',
  3930. 'reverse'
  3931. ];
  3932. /**
  3933. * Intercept mutating methods and emit events
  3934. */
  3935. methodsToPatch.forEach(function (method) {
  3936. // cache original method
  3937. var original = arrayProto[method];
  3938. def(arrayMethods, method, function mutator () {
  3939. var args = [], len = arguments.length;
  3940. while ( len-- ) args[ len ] = arguments[ len ];
  3941. var result = original.apply(this, args);
  3942. var ob = this.__ob__;
  3943. var inserted;
  3944. switch (method) {
  3945. case 'push':
  3946. case 'unshift':
  3947. inserted = args;
  3948. break
  3949. case 'splice':
  3950. inserted = args.slice(2);
  3951. break
  3952. }
  3953. if (inserted) { ob.observeArray(inserted); }
  3954. // notify change
  3955. ob.dep.notify();
  3956. return result
  3957. });
  3958. });
  3959. /* */
  3960. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3961. /**
  3962. * In some cases we may want to disable observation inside a component's
  3963. * update computation.
  3964. */
  3965. var shouldObserve = true;
  3966. function toggleObserving (value) {
  3967. shouldObserve = value;
  3968. }
  3969. /**
  3970. * Observer class that is attached to each observed
  3971. * object. Once attached, the observer converts the target
  3972. * object's property keys into getter/setters that
  3973. * collect dependencies and dispatch updates.
  3974. */
  3975. var Observer = function Observer (value) {
  3976. this.value = value;
  3977. this.dep = new Dep();
  3978. this.vmCount = 0;
  3979. def(value, '__ob__', this);
  3980. if (Array.isArray(value)) {
  3981. if (hasProto) {
  3982. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3983. if(value.push !== value.__proto__.push){
  3984. copyAugment(value, arrayMethods, arrayKeys);
  3985. } else {
  3986. protoAugment(value, arrayMethods);
  3987. }
  3988. }
  3989. } else {
  3990. copyAugment(value, arrayMethods, arrayKeys);
  3991. }
  3992. this.observeArray(value);
  3993. } else {
  3994. this.walk(value);
  3995. }
  3996. };
  3997. /**
  3998. * Walk through all properties and convert them into
  3999. * getter/setters. This method should only be called when
  4000. * value type is Object.
  4001. */
  4002. Observer.prototype.walk = function walk (obj) {
  4003. var keys = Object.keys(obj);
  4004. for (var i = 0; i < keys.length; i++) {
  4005. defineReactive$$1(obj, keys[i]);
  4006. }
  4007. };
  4008. /**
  4009. * Observe a list of Array items.
  4010. */
  4011. Observer.prototype.observeArray = function observeArray (items) {
  4012. for (var i = 0, l = items.length; i < l; i++) {
  4013. observe(items[i]);
  4014. }
  4015. };
  4016. // helpers
  4017. /**
  4018. * Augment a target Object or Array by intercepting
  4019. * the prototype chain using __proto__
  4020. */
  4021. function protoAugment (target, src) {
  4022. /* eslint-disable no-proto */
  4023. target.__proto__ = src;
  4024. /* eslint-enable no-proto */
  4025. }
  4026. /**
  4027. * Augment a target Object or Array by defining
  4028. * hidden properties.
  4029. */
  4030. /* istanbul ignore next */
  4031. function copyAugment (target, src, keys) {
  4032. for (var i = 0, l = keys.length; i < l; i++) {
  4033. var key = keys[i];
  4034. def(target, key, src[key]);
  4035. }
  4036. }
  4037. /**
  4038. * Attempt to create an observer instance for a value,
  4039. * returns the new observer if successfully observed,
  4040. * or the existing observer if the value already has one.
  4041. */
  4042. function observe (value, asRootData) {
  4043. if (!isObject(value) || value instanceof VNode) {
  4044. return
  4045. }
  4046. var ob;
  4047. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4048. ob = value.__ob__;
  4049. } else if (
  4050. shouldObserve &&
  4051. !isServerRendering() &&
  4052. (Array.isArray(value) || isPlainObject(value)) &&
  4053. Object.isExtensible(value) &&
  4054. !value._isVue &&
  4055. !value.__v_isMPComponent
  4056. ) {
  4057. ob = new Observer(value);
  4058. }
  4059. if (asRootData && ob) {
  4060. ob.vmCount++;
  4061. }
  4062. return ob
  4063. }
  4064. /**
  4065. * Define a reactive property on an Object.
  4066. */
  4067. function defineReactive$$1 (
  4068. obj,
  4069. key,
  4070. val,
  4071. customSetter,
  4072. shallow
  4073. ) {
  4074. var dep = new Dep();
  4075. var property = Object.getOwnPropertyDescriptor(obj, key);
  4076. if (property && property.configurable === false) {
  4077. return
  4078. }
  4079. // cater for pre-defined getter/setters
  4080. var getter = property && property.get;
  4081. var setter = property && property.set;
  4082. if ((!getter || setter) && arguments.length === 2) {
  4083. val = obj[key];
  4084. }
  4085. var childOb = !shallow && observe(val);
  4086. Object.defineProperty(obj, key, {
  4087. enumerable: true,
  4088. configurable: true,
  4089. get: function reactiveGetter () {
  4090. var value = getter ? getter.call(obj) : val;
  4091. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4092. dep.depend();
  4093. if (childOb) {
  4094. childOb.dep.depend();
  4095. if (Array.isArray(value)) {
  4096. dependArray(value);
  4097. }
  4098. }
  4099. }
  4100. return value
  4101. },
  4102. set: function reactiveSetter (newVal) {
  4103. var value = getter ? getter.call(obj) : val;
  4104. /* eslint-disable no-self-compare */
  4105. if (newVal === value || (newVal !== newVal && value !== value)) {
  4106. return
  4107. }
  4108. /* eslint-enable no-self-compare */
  4109. if ( true && customSetter) {
  4110. customSetter();
  4111. }
  4112. // #7981: for accessor properties without setter
  4113. if (getter && !setter) { return }
  4114. if (setter) {
  4115. setter.call(obj, newVal);
  4116. } else {
  4117. val = newVal;
  4118. }
  4119. childOb = !shallow && observe(newVal);
  4120. dep.notify();
  4121. }
  4122. });
  4123. }
  4124. /**
  4125. * Set a property on an object. Adds the new property and
  4126. * triggers change notification if the property doesn't
  4127. * already exist.
  4128. */
  4129. function set (target, key, val) {
  4130. if ( true &&
  4131. (isUndef(target) || isPrimitive(target))
  4132. ) {
  4133. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4134. }
  4135. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4136. target.length = Math.max(target.length, key);
  4137. target.splice(key, 1, val);
  4138. return val
  4139. }
  4140. if (key in target && !(key in Object.prototype)) {
  4141. target[key] = val;
  4142. return val
  4143. }
  4144. var ob = (target).__ob__;
  4145. if (target._isVue || (ob && ob.vmCount)) {
  4146. true && warn(
  4147. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4148. 'at runtime - declare it upfront in the data option.'
  4149. );
  4150. return val
  4151. }
  4152. if (!ob) {
  4153. target[key] = val;
  4154. return val
  4155. }
  4156. defineReactive$$1(ob.value, key, val);
  4157. ob.dep.notify();
  4158. return val
  4159. }
  4160. /**
  4161. * Delete a property and trigger change if necessary.
  4162. */
  4163. function del (target, key) {
  4164. if ( true &&
  4165. (isUndef(target) || isPrimitive(target))
  4166. ) {
  4167. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4168. }
  4169. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4170. target.splice(key, 1);
  4171. return
  4172. }
  4173. var ob = (target).__ob__;
  4174. if (target._isVue || (ob && ob.vmCount)) {
  4175. true && warn(
  4176. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4177. '- just set it to null.'
  4178. );
  4179. return
  4180. }
  4181. if (!hasOwn(target, key)) {
  4182. return
  4183. }
  4184. delete target[key];
  4185. if (!ob) {
  4186. return
  4187. }
  4188. ob.dep.notify();
  4189. }
  4190. /**
  4191. * Collect dependencies on array elements when the array is touched, since
  4192. * we cannot intercept array element access like property getters.
  4193. */
  4194. function dependArray (value) {
  4195. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4196. e = value[i];
  4197. e && e.__ob__ && e.__ob__.dep.depend();
  4198. if (Array.isArray(e)) {
  4199. dependArray(e);
  4200. }
  4201. }
  4202. }
  4203. /* */
  4204. /**
  4205. * Option overwriting strategies are functions that handle
  4206. * how to merge a parent option value and a child option
  4207. * value into the final value.
  4208. */
  4209. var strats = config.optionMergeStrategies;
  4210. /**
  4211. * Options with restrictions
  4212. */
  4213. if (true) {
  4214. strats.el = strats.propsData = function (parent, child, vm, key) {
  4215. if (!vm) {
  4216. warn(
  4217. "option \"" + key + "\" can only be used during instance " +
  4218. 'creation with the `new` keyword.'
  4219. );
  4220. }
  4221. return defaultStrat(parent, child)
  4222. };
  4223. }
  4224. /**
  4225. * Helper that recursively merges two data objects together.
  4226. */
  4227. function mergeData (to, from) {
  4228. if (!from) { return to }
  4229. var key, toVal, fromVal;
  4230. var keys = hasSymbol
  4231. ? Reflect.ownKeys(from)
  4232. : Object.keys(from);
  4233. for (var i = 0; i < keys.length; i++) {
  4234. key = keys[i];
  4235. // in case the object is already observed...
  4236. if (key === '__ob__') { continue }
  4237. toVal = to[key];
  4238. fromVal = from[key];
  4239. if (!hasOwn(to, key)) {
  4240. set(to, key, fromVal);
  4241. } else if (
  4242. toVal !== fromVal &&
  4243. isPlainObject(toVal) &&
  4244. isPlainObject(fromVal)
  4245. ) {
  4246. mergeData(toVal, fromVal);
  4247. }
  4248. }
  4249. return to
  4250. }
  4251. /**
  4252. * Data
  4253. */
  4254. function mergeDataOrFn (
  4255. parentVal,
  4256. childVal,
  4257. vm
  4258. ) {
  4259. if (!vm) {
  4260. // in a Vue.extend merge, both should be functions
  4261. if (!childVal) {
  4262. return parentVal
  4263. }
  4264. if (!parentVal) {
  4265. return childVal
  4266. }
  4267. // when parentVal & childVal are both present,
  4268. // we need to return a function that returns the
  4269. // merged result of both functions... no need to
  4270. // check if parentVal is a function here because
  4271. // it has to be a function to pass previous merges.
  4272. return function mergedDataFn () {
  4273. return mergeData(
  4274. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4275. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4276. )
  4277. }
  4278. } else {
  4279. return function mergedInstanceDataFn () {
  4280. // instance merge
  4281. var instanceData = typeof childVal === 'function'
  4282. ? childVal.call(vm, vm)
  4283. : childVal;
  4284. var defaultData = typeof parentVal === 'function'
  4285. ? parentVal.call(vm, vm)
  4286. : parentVal;
  4287. if (instanceData) {
  4288. return mergeData(instanceData, defaultData)
  4289. } else {
  4290. return defaultData
  4291. }
  4292. }
  4293. }
  4294. }
  4295. strats.data = function (
  4296. parentVal,
  4297. childVal,
  4298. vm
  4299. ) {
  4300. if (!vm) {
  4301. if (childVal && typeof childVal !== 'function') {
  4302. true && warn(
  4303. 'The "data" option should be a function ' +
  4304. 'that returns a per-instance value in component ' +
  4305. 'definitions.',
  4306. vm
  4307. );
  4308. return parentVal
  4309. }
  4310. return mergeDataOrFn(parentVal, childVal)
  4311. }
  4312. return mergeDataOrFn(parentVal, childVal, vm)
  4313. };
  4314. /**
  4315. * Hooks and props are merged as arrays.
  4316. */
  4317. function mergeHook (
  4318. parentVal,
  4319. childVal
  4320. ) {
  4321. var res = childVal
  4322. ? parentVal
  4323. ? parentVal.concat(childVal)
  4324. : Array.isArray(childVal)
  4325. ? childVal
  4326. : [childVal]
  4327. : parentVal;
  4328. return res
  4329. ? dedupeHooks(res)
  4330. : res
  4331. }
  4332. function dedupeHooks (hooks) {
  4333. var res = [];
  4334. for (var i = 0; i < hooks.length; i++) {
  4335. if (res.indexOf(hooks[i]) === -1) {
  4336. res.push(hooks[i]);
  4337. }
  4338. }
  4339. return res
  4340. }
  4341. LIFECYCLE_HOOKS.forEach(function (hook) {
  4342. strats[hook] = mergeHook;
  4343. });
  4344. /**
  4345. * Assets
  4346. *
  4347. * When a vm is present (instance creation), we need to do
  4348. * a three-way merge between constructor options, instance
  4349. * options and parent options.
  4350. */
  4351. function mergeAssets (
  4352. parentVal,
  4353. childVal,
  4354. vm,
  4355. key
  4356. ) {
  4357. var res = Object.create(parentVal || null);
  4358. if (childVal) {
  4359. true && assertObjectType(key, childVal, vm);
  4360. return extend(res, childVal)
  4361. } else {
  4362. return res
  4363. }
  4364. }
  4365. ASSET_TYPES.forEach(function (type) {
  4366. strats[type + 's'] = mergeAssets;
  4367. });
  4368. /**
  4369. * Watchers.
  4370. *
  4371. * Watchers hashes should not overwrite one
  4372. * another, so we merge them as arrays.
  4373. */
  4374. strats.watch = function (
  4375. parentVal,
  4376. childVal,
  4377. vm,
  4378. key
  4379. ) {
  4380. // work around Firefox's Object.prototype.watch...
  4381. if (parentVal === nativeWatch) { parentVal = undefined; }
  4382. if (childVal === nativeWatch) { childVal = undefined; }
  4383. /* istanbul ignore if */
  4384. if (!childVal) { return Object.create(parentVal || null) }
  4385. if (true) {
  4386. assertObjectType(key, childVal, vm);
  4387. }
  4388. if (!parentVal) { return childVal }
  4389. var ret = {};
  4390. extend(ret, parentVal);
  4391. for (var key$1 in childVal) {
  4392. var parent = ret[key$1];
  4393. var child = childVal[key$1];
  4394. if (parent && !Array.isArray(parent)) {
  4395. parent = [parent];
  4396. }
  4397. ret[key$1] = parent
  4398. ? parent.concat(child)
  4399. : Array.isArray(child) ? child : [child];
  4400. }
  4401. return ret
  4402. };
  4403. /**
  4404. * Other object hashes.
  4405. */
  4406. strats.props =
  4407. strats.methods =
  4408. strats.inject =
  4409. strats.computed = function (
  4410. parentVal,
  4411. childVal,
  4412. vm,
  4413. key
  4414. ) {
  4415. if (childVal && "development" !== 'production') {
  4416. assertObjectType(key, childVal, vm);
  4417. }
  4418. if (!parentVal) { return childVal }
  4419. var ret = Object.create(null);
  4420. extend(ret, parentVal);
  4421. if (childVal) { extend(ret, childVal); }
  4422. return ret
  4423. };
  4424. strats.provide = mergeDataOrFn;
  4425. /**
  4426. * Default strategy.
  4427. */
  4428. var defaultStrat = function (parentVal, childVal) {
  4429. return childVal === undefined
  4430. ? parentVal
  4431. : childVal
  4432. };
  4433. /**
  4434. * Validate component names
  4435. */
  4436. function checkComponents (options) {
  4437. for (var key in options.components) {
  4438. validateComponentName(key);
  4439. }
  4440. }
  4441. function validateComponentName (name) {
  4442. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4443. warn(
  4444. 'Invalid component name: "' + name + '". Component names ' +
  4445. 'should conform to valid custom element name in html5 specification.'
  4446. );
  4447. }
  4448. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4449. warn(
  4450. 'Do not use built-in or reserved HTML elements as component ' +
  4451. 'id: ' + name
  4452. );
  4453. }
  4454. }
  4455. /**
  4456. * Ensure all props option syntax are normalized into the
  4457. * Object-based format.
  4458. */
  4459. function normalizeProps (options, vm) {
  4460. var props = options.props;
  4461. if (!props) { return }
  4462. var res = {};
  4463. var i, val, name;
  4464. if (Array.isArray(props)) {
  4465. i = props.length;
  4466. while (i--) {
  4467. val = props[i];
  4468. if (typeof val === 'string') {
  4469. name = camelize(val);
  4470. res[name] = { type: null };
  4471. } else if (true) {
  4472. warn('props must be strings when using array syntax.');
  4473. }
  4474. }
  4475. } else if (isPlainObject(props)) {
  4476. for (var key in props) {
  4477. val = props[key];
  4478. name = camelize(key);
  4479. res[name] = isPlainObject(val)
  4480. ? val
  4481. : { type: val };
  4482. }
  4483. } else if (true) {
  4484. warn(
  4485. "Invalid value for option \"props\": expected an Array or an Object, " +
  4486. "but got " + (toRawType(props)) + ".",
  4487. vm
  4488. );
  4489. }
  4490. options.props = res;
  4491. }
  4492. /**
  4493. * Normalize all injections into Object-based format
  4494. */
  4495. function normalizeInject (options, vm) {
  4496. var inject = options.inject;
  4497. if (!inject) { return }
  4498. var normalized = options.inject = {};
  4499. if (Array.isArray(inject)) {
  4500. for (var i = 0; i < inject.length; i++) {
  4501. normalized[inject[i]] = { from: inject[i] };
  4502. }
  4503. } else if (isPlainObject(inject)) {
  4504. for (var key in inject) {
  4505. var val = inject[key];
  4506. normalized[key] = isPlainObject(val)
  4507. ? extend({ from: key }, val)
  4508. : { from: val };
  4509. }
  4510. } else if (true) {
  4511. warn(
  4512. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4513. "but got " + (toRawType(inject)) + ".",
  4514. vm
  4515. );
  4516. }
  4517. }
  4518. /**
  4519. * Normalize raw function directives into object format.
  4520. */
  4521. function normalizeDirectives (options) {
  4522. var dirs = options.directives;
  4523. if (dirs) {
  4524. for (var key in dirs) {
  4525. var def$$1 = dirs[key];
  4526. if (typeof def$$1 === 'function') {
  4527. dirs[key] = { bind: def$$1, update: def$$1 };
  4528. }
  4529. }
  4530. }
  4531. }
  4532. function assertObjectType (name, value, vm) {
  4533. if (!isPlainObject(value)) {
  4534. warn(
  4535. "Invalid value for option \"" + name + "\": expected an Object, " +
  4536. "but got " + (toRawType(value)) + ".",
  4537. vm
  4538. );
  4539. }
  4540. }
  4541. /**
  4542. * Merge two option objects into a new one.
  4543. * Core utility used in both instantiation and inheritance.
  4544. */
  4545. function mergeOptions (
  4546. parent,
  4547. child,
  4548. vm
  4549. ) {
  4550. if (true) {
  4551. checkComponents(child);
  4552. }
  4553. if (typeof child === 'function') {
  4554. child = child.options;
  4555. }
  4556. normalizeProps(child, vm);
  4557. normalizeInject(child, vm);
  4558. normalizeDirectives(child);
  4559. // Apply extends and mixins on the child options,
  4560. // but only if it is a raw options object that isn't
  4561. // the result of another mergeOptions call.
  4562. // Only merged options has the _base property.
  4563. if (!child._base) {
  4564. if (child.extends) {
  4565. parent = mergeOptions(parent, child.extends, vm);
  4566. }
  4567. if (child.mixins) {
  4568. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4569. parent = mergeOptions(parent, child.mixins[i], vm);
  4570. }
  4571. }
  4572. }
  4573. var options = {};
  4574. var key;
  4575. for (key in parent) {
  4576. mergeField(key);
  4577. }
  4578. for (key in child) {
  4579. if (!hasOwn(parent, key)) {
  4580. mergeField(key);
  4581. }
  4582. }
  4583. function mergeField (key) {
  4584. var strat = strats[key] || defaultStrat;
  4585. options[key] = strat(parent[key], child[key], vm, key);
  4586. }
  4587. return options
  4588. }
  4589. /**
  4590. * Resolve an asset.
  4591. * This function is used because child instances need access
  4592. * to assets defined in its ancestor chain.
  4593. */
  4594. function resolveAsset (
  4595. options,
  4596. type,
  4597. id,
  4598. warnMissing
  4599. ) {
  4600. /* istanbul ignore if */
  4601. if (typeof id !== 'string') {
  4602. return
  4603. }
  4604. var assets = options[type];
  4605. // check local registration variations first
  4606. if (hasOwn(assets, id)) { return assets[id] }
  4607. var camelizedId = camelize(id);
  4608. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4609. var PascalCaseId = capitalize(camelizedId);
  4610. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4611. // fallback to prototype chain
  4612. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4613. if ( true && warnMissing && !res) {
  4614. warn(
  4615. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4616. options
  4617. );
  4618. }
  4619. return res
  4620. }
  4621. /* */
  4622. function validateProp (
  4623. key,
  4624. propOptions,
  4625. propsData,
  4626. vm
  4627. ) {
  4628. var prop = propOptions[key];
  4629. var absent = !hasOwn(propsData, key);
  4630. var value = propsData[key];
  4631. // boolean casting
  4632. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4633. if (booleanIndex > -1) {
  4634. if (absent && !hasOwn(prop, 'default')) {
  4635. value = false;
  4636. } else if (value === '' || value === hyphenate(key)) {
  4637. // only cast empty string / same name to boolean if
  4638. // boolean has higher priority
  4639. var stringIndex = getTypeIndex(String, prop.type);
  4640. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4641. value = true;
  4642. }
  4643. }
  4644. }
  4645. // check default value
  4646. if (value === undefined) {
  4647. value = getPropDefaultValue(vm, prop, key);
  4648. // since the default value is a fresh copy,
  4649. // make sure to observe it.
  4650. var prevShouldObserve = shouldObserve;
  4651. toggleObserving(true);
  4652. observe(value);
  4653. toggleObserving(prevShouldObserve);
  4654. }
  4655. if (
  4656. true
  4657. ) {
  4658. assertProp(prop, key, value, vm, absent);
  4659. }
  4660. return value
  4661. }
  4662. /**
  4663. * Get the default value of a prop.
  4664. */
  4665. function getPropDefaultValue (vm, prop, key) {
  4666. // no default, return undefined
  4667. if (!hasOwn(prop, 'default')) {
  4668. return undefined
  4669. }
  4670. var def = prop.default;
  4671. // warn against non-factory defaults for Object & Array
  4672. if ( true && isObject(def)) {
  4673. warn(
  4674. 'Invalid default value for prop "' + key + '": ' +
  4675. 'Props with type Object/Array must use a factory function ' +
  4676. 'to return the default value.',
  4677. vm
  4678. );
  4679. }
  4680. // the raw prop value was also undefined from previous render,
  4681. // return previous default value to avoid unnecessary watcher trigger
  4682. if (vm && vm.$options.propsData &&
  4683. vm.$options.propsData[key] === undefined &&
  4684. vm._props[key] !== undefined
  4685. ) {
  4686. return vm._props[key]
  4687. }
  4688. // call factory function for non-Function types
  4689. // a value is Function if its prototype is function even across different execution context
  4690. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4691. ? def.call(vm)
  4692. : def
  4693. }
  4694. /**
  4695. * Assert whether a prop is valid.
  4696. */
  4697. function assertProp (
  4698. prop,
  4699. name,
  4700. value,
  4701. vm,
  4702. absent
  4703. ) {
  4704. if (prop.required && absent) {
  4705. warn(
  4706. 'Missing required prop: "' + name + '"',
  4707. vm
  4708. );
  4709. return
  4710. }
  4711. if (value == null && !prop.required) {
  4712. return
  4713. }
  4714. var type = prop.type;
  4715. var valid = !type || type === true;
  4716. var expectedTypes = [];
  4717. if (type) {
  4718. if (!Array.isArray(type)) {
  4719. type = [type];
  4720. }
  4721. for (var i = 0; i < type.length && !valid; i++) {
  4722. var assertedType = assertType(value, type[i]);
  4723. expectedTypes.push(assertedType.expectedType || '');
  4724. valid = assertedType.valid;
  4725. }
  4726. }
  4727. if (!valid) {
  4728. warn(
  4729. getInvalidTypeMessage(name, value, expectedTypes),
  4730. vm
  4731. );
  4732. return
  4733. }
  4734. var validator = prop.validator;
  4735. if (validator) {
  4736. if (!validator(value)) {
  4737. warn(
  4738. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4739. vm
  4740. );
  4741. }
  4742. }
  4743. }
  4744. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4745. function assertType (value, type) {
  4746. var valid;
  4747. var expectedType = getType(type);
  4748. if (simpleCheckRE.test(expectedType)) {
  4749. var t = typeof value;
  4750. valid = t === expectedType.toLowerCase();
  4751. // for primitive wrapper objects
  4752. if (!valid && t === 'object') {
  4753. valid = value instanceof type;
  4754. }
  4755. } else if (expectedType === 'Object') {
  4756. valid = isPlainObject(value);
  4757. } else if (expectedType === 'Array') {
  4758. valid = Array.isArray(value);
  4759. } else {
  4760. valid = value instanceof type;
  4761. }
  4762. return {
  4763. valid: valid,
  4764. expectedType: expectedType
  4765. }
  4766. }
  4767. /**
  4768. * Use function string name to check built-in types,
  4769. * because a simple equality check will fail when running
  4770. * across different vms / iframes.
  4771. */
  4772. function getType (fn) {
  4773. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4774. return match ? match[1] : ''
  4775. }
  4776. function isSameType (a, b) {
  4777. return getType(a) === getType(b)
  4778. }
  4779. function getTypeIndex (type, expectedTypes) {
  4780. if (!Array.isArray(expectedTypes)) {
  4781. return isSameType(expectedTypes, type) ? 0 : -1
  4782. }
  4783. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4784. if (isSameType(expectedTypes[i], type)) {
  4785. return i
  4786. }
  4787. }
  4788. return -1
  4789. }
  4790. function getInvalidTypeMessage (name, value, expectedTypes) {
  4791. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4792. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4793. var expectedType = expectedTypes[0];
  4794. var receivedType = toRawType(value);
  4795. var expectedValue = styleValue(value, expectedType);
  4796. var receivedValue = styleValue(value, receivedType);
  4797. // check if we need to specify expected value
  4798. if (expectedTypes.length === 1 &&
  4799. isExplicable(expectedType) &&
  4800. !isBoolean(expectedType, receivedType)) {
  4801. message += " with value " + expectedValue;
  4802. }
  4803. message += ", got " + receivedType + " ";
  4804. // check if we need to specify received value
  4805. if (isExplicable(receivedType)) {
  4806. message += "with value " + receivedValue + ".";
  4807. }
  4808. return message
  4809. }
  4810. function styleValue (value, type) {
  4811. if (type === 'String') {
  4812. return ("\"" + value + "\"")
  4813. } else if (type === 'Number') {
  4814. return ("" + (Number(value)))
  4815. } else {
  4816. return ("" + value)
  4817. }
  4818. }
  4819. function isExplicable (value) {
  4820. var explicitTypes = ['string', 'number', 'boolean'];
  4821. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4822. }
  4823. function isBoolean () {
  4824. var args = [], len = arguments.length;
  4825. while ( len-- ) args[ len ] = arguments[ len ];
  4826. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4827. }
  4828. /* */
  4829. function handleError (err, vm, info) {
  4830. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4831. // See: https://github.com/vuejs/vuex/issues/1505
  4832. pushTarget();
  4833. try {
  4834. if (vm) {
  4835. var cur = vm;
  4836. while ((cur = cur.$parent)) {
  4837. var hooks = cur.$options.errorCaptured;
  4838. if (hooks) {
  4839. for (var i = 0; i < hooks.length; i++) {
  4840. try {
  4841. var capture = hooks[i].call(cur, err, vm, info) === false;
  4842. if (capture) { return }
  4843. } catch (e) {
  4844. globalHandleError(e, cur, 'errorCaptured hook');
  4845. }
  4846. }
  4847. }
  4848. }
  4849. }
  4850. globalHandleError(err, vm, info);
  4851. } finally {
  4852. popTarget();
  4853. }
  4854. }
  4855. function invokeWithErrorHandling (
  4856. handler,
  4857. context,
  4858. args,
  4859. vm,
  4860. info
  4861. ) {
  4862. var res;
  4863. try {
  4864. res = args ? handler.apply(context, args) : handler.call(context);
  4865. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4866. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4867. // issue #9511
  4868. // avoid catch triggering multiple times when nested calls
  4869. res._handled = true;
  4870. }
  4871. } catch (e) {
  4872. handleError(e, vm, info);
  4873. }
  4874. return res
  4875. }
  4876. function globalHandleError (err, vm, info) {
  4877. if (config.errorHandler) {
  4878. try {
  4879. return config.errorHandler.call(null, err, vm, info)
  4880. } catch (e) {
  4881. // if the user intentionally throws the original error in the handler,
  4882. // do not log it twice
  4883. if (e !== err) {
  4884. logError(e, null, 'config.errorHandler');
  4885. }
  4886. }
  4887. }
  4888. logError(err, vm, info);
  4889. }
  4890. function logError (err, vm, info) {
  4891. if (true) {
  4892. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4893. }
  4894. /* istanbul ignore else */
  4895. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4896. console.error(err);
  4897. } else {
  4898. throw err
  4899. }
  4900. }
  4901. /* */
  4902. var callbacks = [];
  4903. var pending = false;
  4904. function flushCallbacks () {
  4905. pending = false;
  4906. var copies = callbacks.slice(0);
  4907. callbacks.length = 0;
  4908. for (var i = 0; i < copies.length; i++) {
  4909. copies[i]();
  4910. }
  4911. }
  4912. // Here we have async deferring wrappers using microtasks.
  4913. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4914. // However, it has subtle problems when state is changed right before repaint
  4915. // (e.g. #6813, out-in transitions).
  4916. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4917. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4918. // So we now use microtasks everywhere, again.
  4919. // A major drawback of this tradeoff is that there are some scenarios
  4920. // where microtasks have too high a priority and fire in between supposedly
  4921. // sequential events (e.g. #4521, #6690, which have workarounds)
  4922. // or even between bubbling of the same event (#6566).
  4923. var timerFunc;
  4924. // The nextTick behavior leverages the microtask queue, which can be accessed
  4925. // via either native Promise.then or MutationObserver.
  4926. // MutationObserver has wider support, however it is seriously bugged in
  4927. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4928. // completely stops working after triggering a few times... so, if native
  4929. // Promise is available, we will use it:
  4930. /* istanbul ignore next, $flow-disable-line */
  4931. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4932. var p = Promise.resolve();
  4933. timerFunc = function () {
  4934. p.then(flushCallbacks);
  4935. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4936. // it can get stuck in a weird state where callbacks are pushed into the
  4937. // microtask queue but the queue isn't being flushed, until the browser
  4938. // needs to do some other work, e.g. handle a timer. Therefore we can
  4939. // "force" the microtask queue to be flushed by adding an empty timer.
  4940. if (isIOS) { setTimeout(noop); }
  4941. };
  4942. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4943. isNative(MutationObserver) ||
  4944. // PhantomJS and iOS 7.x
  4945. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4946. )) {
  4947. // Use MutationObserver where native Promise is not available,
  4948. // e.g. PhantomJS, iOS7, Android 4.4
  4949. // (#6466 MutationObserver is unreliable in IE11)
  4950. var counter = 1;
  4951. var observer = new MutationObserver(flushCallbacks);
  4952. var textNode = document.createTextNode(String(counter));
  4953. observer.observe(textNode, {
  4954. characterData: true
  4955. });
  4956. timerFunc = function () {
  4957. counter = (counter + 1) % 2;
  4958. textNode.data = String(counter);
  4959. };
  4960. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4961. // Fallback to setImmediate.
  4962. // Technically it leverages the (macro) task queue,
  4963. // but it is still a better choice than setTimeout.
  4964. timerFunc = function () {
  4965. setImmediate(flushCallbacks);
  4966. };
  4967. } else {
  4968. // Fallback to setTimeout.
  4969. timerFunc = function () {
  4970. setTimeout(flushCallbacks, 0);
  4971. };
  4972. }
  4973. function nextTick (cb, ctx) {
  4974. var _resolve;
  4975. callbacks.push(function () {
  4976. if (cb) {
  4977. try {
  4978. cb.call(ctx);
  4979. } catch (e) {
  4980. handleError(e, ctx, 'nextTick');
  4981. }
  4982. } else if (_resolve) {
  4983. _resolve(ctx);
  4984. }
  4985. });
  4986. if (!pending) {
  4987. pending = true;
  4988. timerFunc();
  4989. }
  4990. // $flow-disable-line
  4991. if (!cb && typeof Promise !== 'undefined') {
  4992. return new Promise(function (resolve) {
  4993. _resolve = resolve;
  4994. })
  4995. }
  4996. }
  4997. /* */
  4998. /* not type checking this file because flow doesn't play well with Proxy */
  4999. var initProxy;
  5000. if (true) {
  5001. var allowedGlobals = makeMap(
  5002. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5003. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5004. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5005. 'require' // for Webpack/Browserify
  5006. );
  5007. var warnNonPresent = function (target, key) {
  5008. warn(
  5009. "Property or method \"" + key + "\" is not defined on the instance but " +
  5010. 'referenced during render. Make sure that this property is reactive, ' +
  5011. 'either in the data option, or for class-based components, by ' +
  5012. 'initializing the property. ' +
  5013. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5014. target
  5015. );
  5016. };
  5017. var warnReservedPrefix = function (target, key) {
  5018. warn(
  5019. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5020. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5021. 'prevent conflicts with Vue internals. ' +
  5022. 'See: https://vuejs.org/v2/api/#data',
  5023. target
  5024. );
  5025. };
  5026. var hasProxy =
  5027. typeof Proxy !== 'undefined' && isNative(Proxy);
  5028. if (hasProxy) {
  5029. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5030. config.keyCodes = new Proxy(config.keyCodes, {
  5031. set: function set (target, key, value) {
  5032. if (isBuiltInModifier(key)) {
  5033. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5034. return false
  5035. } else {
  5036. target[key] = value;
  5037. return true
  5038. }
  5039. }
  5040. });
  5041. }
  5042. var hasHandler = {
  5043. has: function has (target, key) {
  5044. var has = key in target;
  5045. var isAllowed = allowedGlobals(key) ||
  5046. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5047. if (!has && !isAllowed) {
  5048. if (key in target.$data) { warnReservedPrefix(target, key); }
  5049. else { warnNonPresent(target, key); }
  5050. }
  5051. return has || !isAllowed
  5052. }
  5053. };
  5054. var getHandler = {
  5055. get: function get (target, key) {
  5056. if (typeof key === 'string' && !(key in target)) {
  5057. if (key in target.$data) { warnReservedPrefix(target, key); }
  5058. else { warnNonPresent(target, key); }
  5059. }
  5060. return target[key]
  5061. }
  5062. };
  5063. initProxy = function initProxy (vm) {
  5064. if (hasProxy) {
  5065. // determine which proxy handler to use
  5066. var options = vm.$options;
  5067. var handlers = options.render && options.render._withStripped
  5068. ? getHandler
  5069. : hasHandler;
  5070. vm._renderProxy = new Proxy(vm, handlers);
  5071. } else {
  5072. vm._renderProxy = vm;
  5073. }
  5074. };
  5075. }
  5076. /* */
  5077. var seenObjects = new _Set();
  5078. /**
  5079. * Recursively traverse an object to evoke all converted
  5080. * getters, so that every nested property inside the object
  5081. * is collected as a "deep" dependency.
  5082. */
  5083. function traverse (val) {
  5084. _traverse(val, seenObjects);
  5085. seenObjects.clear();
  5086. }
  5087. function _traverse (val, seen) {
  5088. var i, keys;
  5089. var isA = Array.isArray(val);
  5090. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5091. return
  5092. }
  5093. if (val.__ob__) {
  5094. var depId = val.__ob__.dep.id;
  5095. if (seen.has(depId)) {
  5096. return
  5097. }
  5098. seen.add(depId);
  5099. }
  5100. if (isA) {
  5101. i = val.length;
  5102. while (i--) { _traverse(val[i], seen); }
  5103. } else {
  5104. keys = Object.keys(val);
  5105. i = keys.length;
  5106. while (i--) { _traverse(val[keys[i]], seen); }
  5107. }
  5108. }
  5109. var mark;
  5110. var measure;
  5111. if (true) {
  5112. var perf = inBrowser && window.performance;
  5113. /* istanbul ignore if */
  5114. if (
  5115. perf &&
  5116. perf.mark &&
  5117. perf.measure &&
  5118. perf.clearMarks &&
  5119. perf.clearMeasures
  5120. ) {
  5121. mark = function (tag) { return perf.mark(tag); };
  5122. measure = function (name, startTag, endTag) {
  5123. perf.measure(name, startTag, endTag);
  5124. perf.clearMarks(startTag);
  5125. perf.clearMarks(endTag);
  5126. // perf.clearMeasures(name)
  5127. };
  5128. }
  5129. }
  5130. /* */
  5131. var normalizeEvent = cached(function (name) {
  5132. var passive = name.charAt(0) === '&';
  5133. name = passive ? name.slice(1) : name;
  5134. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5135. name = once$$1 ? name.slice(1) : name;
  5136. var capture = name.charAt(0) === '!';
  5137. name = capture ? name.slice(1) : name;
  5138. return {
  5139. name: name,
  5140. once: once$$1,
  5141. capture: capture,
  5142. passive: passive
  5143. }
  5144. });
  5145. function createFnInvoker (fns, vm) {
  5146. function invoker () {
  5147. var arguments$1 = arguments;
  5148. var fns = invoker.fns;
  5149. if (Array.isArray(fns)) {
  5150. var cloned = fns.slice();
  5151. for (var i = 0; i < cloned.length; i++) {
  5152. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5153. }
  5154. } else {
  5155. // return handler return value for single handlers
  5156. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5157. }
  5158. }
  5159. invoker.fns = fns;
  5160. return invoker
  5161. }
  5162. function updateListeners (
  5163. on,
  5164. oldOn,
  5165. add,
  5166. remove$$1,
  5167. createOnceHandler,
  5168. vm
  5169. ) {
  5170. var name, def$$1, cur, old, event;
  5171. for (name in on) {
  5172. def$$1 = cur = on[name];
  5173. old = oldOn[name];
  5174. event = normalizeEvent(name);
  5175. if (isUndef(cur)) {
  5176. true && warn(
  5177. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5178. vm
  5179. );
  5180. } else if (isUndef(old)) {
  5181. if (isUndef(cur.fns)) {
  5182. cur = on[name] = createFnInvoker(cur, vm);
  5183. }
  5184. if (isTrue(event.once)) {
  5185. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5186. }
  5187. add(event.name, cur, event.capture, event.passive, event.params);
  5188. } else if (cur !== old) {
  5189. old.fns = cur;
  5190. on[name] = old;
  5191. }
  5192. }
  5193. for (name in oldOn) {
  5194. if (isUndef(on[name])) {
  5195. event = normalizeEvent(name);
  5196. remove$$1(event.name, oldOn[name], event.capture);
  5197. }
  5198. }
  5199. }
  5200. /* */
  5201. /* */
  5202. // fixed by xxxxxx (mp properties)
  5203. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5204. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5205. if (isUndef(propOptions)) {
  5206. return res
  5207. }
  5208. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5209. var attrs = data.attrs;
  5210. var props = data.props;
  5211. if (isDef(attrs) || isDef(props)) {
  5212. for (var key in propOptions) {
  5213. var altKey = hyphenate(key);
  5214. var result = checkProp(res, props, key, altKey, true) ||
  5215. checkProp(res, attrs, key, altKey, false);
  5216. // externalClass
  5217. if (
  5218. result &&
  5219. res[key] &&
  5220. externalClasses.indexOf(altKey) !== -1 &&
  5221. context[camelize(res[key])]
  5222. ) {
  5223. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5224. res[key] = context[camelize(res[key])];
  5225. }
  5226. }
  5227. }
  5228. return res
  5229. }
  5230. function extractPropsFromVNodeData (
  5231. data,
  5232. Ctor,
  5233. tag,
  5234. context// fixed by xxxxxx
  5235. ) {
  5236. // we are only extracting raw values here.
  5237. // validation and default values are handled in the child
  5238. // component itself.
  5239. var propOptions = Ctor.options.props;
  5240. if (isUndef(propOptions)) {
  5241. // fixed by xxxxxx
  5242. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5243. }
  5244. var res = {};
  5245. var attrs = data.attrs;
  5246. var props = data.props;
  5247. if (isDef(attrs) || isDef(props)) {
  5248. for (var key in propOptions) {
  5249. var altKey = hyphenate(key);
  5250. if (true) {
  5251. var keyInLowerCase = key.toLowerCase();
  5252. if (
  5253. key !== keyInLowerCase &&
  5254. attrs && hasOwn(attrs, keyInLowerCase)
  5255. ) {
  5256. tip(
  5257. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5258. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5259. " \"" + key + "\". " +
  5260. "Note that HTML attributes are case-insensitive and camelCased " +
  5261. "props need to use their kebab-case equivalents when using in-DOM " +
  5262. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5263. );
  5264. }
  5265. }
  5266. checkProp(res, props, key, altKey, true) ||
  5267. checkProp(res, attrs, key, altKey, false);
  5268. }
  5269. }
  5270. // fixed by xxxxxx
  5271. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5272. }
  5273. function checkProp (
  5274. res,
  5275. hash,
  5276. key,
  5277. altKey,
  5278. preserve
  5279. ) {
  5280. if (isDef(hash)) {
  5281. if (hasOwn(hash, key)) {
  5282. res[key] = hash[key];
  5283. if (!preserve) {
  5284. delete hash[key];
  5285. }
  5286. return true
  5287. } else if (hasOwn(hash, altKey)) {
  5288. res[key] = hash[altKey];
  5289. if (!preserve) {
  5290. delete hash[altKey];
  5291. }
  5292. return true
  5293. }
  5294. }
  5295. return false
  5296. }
  5297. /* */
  5298. // The template compiler attempts to minimize the need for normalization by
  5299. // statically analyzing the template at compile time.
  5300. //
  5301. // For plain HTML markup, normalization can be completely skipped because the
  5302. // generated render function is guaranteed to return Array<VNode>. There are
  5303. // two cases where extra normalization is needed:
  5304. // 1. When the children contains components - because a functional component
  5305. // may return an Array instead of a single root. In this case, just a simple
  5306. // normalization is needed - if any child is an Array, we flatten the whole
  5307. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5308. // because functional components already normalize their own children.
  5309. function simpleNormalizeChildren (children) {
  5310. for (var i = 0; i < children.length; i++) {
  5311. if (Array.isArray(children[i])) {
  5312. return Array.prototype.concat.apply([], children)
  5313. }
  5314. }
  5315. return children
  5316. }
  5317. // 2. When the children contains constructs that always generated nested Arrays,
  5318. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5319. // with hand-written render functions / JSX. In such cases a full normalization
  5320. // is needed to cater to all possible types of children values.
  5321. function normalizeChildren (children) {
  5322. return isPrimitive(children)
  5323. ? [createTextVNode(children)]
  5324. : Array.isArray(children)
  5325. ? normalizeArrayChildren(children)
  5326. : undefined
  5327. }
  5328. function isTextNode (node) {
  5329. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5330. }
  5331. function normalizeArrayChildren (children, nestedIndex) {
  5332. var res = [];
  5333. var i, c, lastIndex, last;
  5334. for (i = 0; i < children.length; i++) {
  5335. c = children[i];
  5336. if (isUndef(c) || typeof c === 'boolean') { continue }
  5337. lastIndex = res.length - 1;
  5338. last = res[lastIndex];
  5339. // nested
  5340. if (Array.isArray(c)) {
  5341. if (c.length > 0) {
  5342. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5343. // merge adjacent text nodes
  5344. if (isTextNode(c[0]) && isTextNode(last)) {
  5345. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5346. c.shift();
  5347. }
  5348. res.push.apply(res, c);
  5349. }
  5350. } else if (isPrimitive(c)) {
  5351. if (isTextNode(last)) {
  5352. // merge adjacent text nodes
  5353. // this is necessary for SSR hydration because text nodes are
  5354. // essentially merged when rendered to HTML strings
  5355. res[lastIndex] = createTextVNode(last.text + c);
  5356. } else if (c !== '') {
  5357. // convert primitive to vnode
  5358. res.push(createTextVNode(c));
  5359. }
  5360. } else {
  5361. if (isTextNode(c) && isTextNode(last)) {
  5362. // merge adjacent text nodes
  5363. res[lastIndex] = createTextVNode(last.text + c.text);
  5364. } else {
  5365. // default key for nested array children (likely generated by v-for)
  5366. if (isTrue(children._isVList) &&
  5367. isDef(c.tag) &&
  5368. isUndef(c.key) &&
  5369. isDef(nestedIndex)) {
  5370. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5371. }
  5372. res.push(c);
  5373. }
  5374. }
  5375. }
  5376. return res
  5377. }
  5378. /* */
  5379. function initProvide (vm) {
  5380. var provide = vm.$options.provide;
  5381. if (provide) {
  5382. vm._provided = typeof provide === 'function'
  5383. ? provide.call(vm)
  5384. : provide;
  5385. }
  5386. }
  5387. function initInjections (vm) {
  5388. var result = resolveInject(vm.$options.inject, vm);
  5389. if (result) {
  5390. toggleObserving(false);
  5391. Object.keys(result).forEach(function (key) {
  5392. /* istanbul ignore else */
  5393. if (true) {
  5394. defineReactive$$1(vm, key, result[key], function () {
  5395. warn(
  5396. "Avoid mutating an injected value directly since the changes will be " +
  5397. "overwritten whenever the provided component re-renders. " +
  5398. "injection being mutated: \"" + key + "\"",
  5399. vm
  5400. );
  5401. });
  5402. } else {}
  5403. });
  5404. toggleObserving(true);
  5405. }
  5406. }
  5407. function resolveInject (inject, vm) {
  5408. if (inject) {
  5409. // inject is :any because flow is not smart enough to figure out cached
  5410. var result = Object.create(null);
  5411. var keys = hasSymbol
  5412. ? Reflect.ownKeys(inject)
  5413. : Object.keys(inject);
  5414. for (var i = 0; i < keys.length; i++) {
  5415. var key = keys[i];
  5416. // #6574 in case the inject object is observed...
  5417. if (key === '__ob__') { continue }
  5418. var provideKey = inject[key].from;
  5419. var source = vm;
  5420. while (source) {
  5421. if (source._provided && hasOwn(source._provided, provideKey)) {
  5422. result[key] = source._provided[provideKey];
  5423. break
  5424. }
  5425. source = source.$parent;
  5426. }
  5427. if (!source) {
  5428. if ('default' in inject[key]) {
  5429. var provideDefault = inject[key].default;
  5430. result[key] = typeof provideDefault === 'function'
  5431. ? provideDefault.call(vm)
  5432. : provideDefault;
  5433. } else if (true) {
  5434. warn(("Injection \"" + key + "\" not found"), vm);
  5435. }
  5436. }
  5437. }
  5438. return result
  5439. }
  5440. }
  5441. /* */
  5442. /**
  5443. * Runtime helper for resolving raw children VNodes into a slot object.
  5444. */
  5445. function resolveSlots (
  5446. children,
  5447. context
  5448. ) {
  5449. if (!children || !children.length) {
  5450. return {}
  5451. }
  5452. var slots = {};
  5453. for (var i = 0, l = children.length; i < l; i++) {
  5454. var child = children[i];
  5455. var data = child.data;
  5456. // remove slot attribute if the node is resolved as a Vue slot node
  5457. if (data && data.attrs && data.attrs.slot) {
  5458. delete data.attrs.slot;
  5459. }
  5460. // named slots should only be respected if the vnode was rendered in the
  5461. // same context.
  5462. if ((child.context === context || child.fnContext === context) &&
  5463. data && data.slot != null
  5464. ) {
  5465. var name = data.slot;
  5466. var slot = (slots[name] || (slots[name] = []));
  5467. if (child.tag === 'template') {
  5468. slot.push.apply(slot, child.children || []);
  5469. } else {
  5470. slot.push(child);
  5471. }
  5472. } else {
  5473. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5474. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5475. (slots['page'] || (slots['page'] = [])).push(child);
  5476. }else{
  5477. (slots.default || (slots.default = [])).push(child);
  5478. }
  5479. }
  5480. }
  5481. // ignore slots that contains only whitespace
  5482. for (var name$1 in slots) {
  5483. if (slots[name$1].every(isWhitespace)) {
  5484. delete slots[name$1];
  5485. }
  5486. }
  5487. return slots
  5488. }
  5489. function isWhitespace (node) {
  5490. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5491. }
  5492. /* */
  5493. function normalizeScopedSlots (
  5494. slots,
  5495. normalSlots,
  5496. prevSlots
  5497. ) {
  5498. var res;
  5499. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5500. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5501. var key = slots && slots.$key;
  5502. if (!slots) {
  5503. res = {};
  5504. } else if (slots._normalized) {
  5505. // fast path 1: child component re-render only, parent did not change
  5506. return slots._normalized
  5507. } else if (
  5508. isStable &&
  5509. prevSlots &&
  5510. prevSlots !== emptyObject &&
  5511. key === prevSlots.$key &&
  5512. !hasNormalSlots &&
  5513. !prevSlots.$hasNormal
  5514. ) {
  5515. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5516. // only need to normalize once
  5517. return prevSlots
  5518. } else {
  5519. res = {};
  5520. for (var key$1 in slots) {
  5521. if (slots[key$1] && key$1[0] !== '$') {
  5522. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5523. }
  5524. }
  5525. }
  5526. // expose normal slots on scopedSlots
  5527. for (var key$2 in normalSlots) {
  5528. if (!(key$2 in res)) {
  5529. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5530. }
  5531. }
  5532. // avoriaz seems to mock a non-extensible $scopedSlots object
  5533. // and when that is passed down this would cause an error
  5534. if (slots && Object.isExtensible(slots)) {
  5535. (slots)._normalized = res;
  5536. }
  5537. def(res, '$stable', isStable);
  5538. def(res, '$key', key);
  5539. def(res, '$hasNormal', hasNormalSlots);
  5540. return res
  5541. }
  5542. function normalizeScopedSlot(normalSlots, key, fn) {
  5543. var normalized = function () {
  5544. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5545. res = res && typeof res === 'object' && !Array.isArray(res)
  5546. ? [res] // single vnode
  5547. : normalizeChildren(res);
  5548. return res && (
  5549. res.length === 0 ||
  5550. (res.length === 1 && res[0].isComment) // #9658
  5551. ) ? undefined
  5552. : res
  5553. };
  5554. // this is a slot using the new v-slot syntax without scope. although it is
  5555. // compiled as a scoped slot, render fn users would expect it to be present
  5556. // on this.$slots because the usage is semantically a normal slot.
  5557. if (fn.proxy) {
  5558. Object.defineProperty(normalSlots, key, {
  5559. get: normalized,
  5560. enumerable: true,
  5561. configurable: true
  5562. });
  5563. }
  5564. return normalized
  5565. }
  5566. function proxyNormalSlot(slots, key) {
  5567. return function () { return slots[key]; }
  5568. }
  5569. /* */
  5570. /**
  5571. * Runtime helper for rendering v-for lists.
  5572. */
  5573. function renderList (
  5574. val,
  5575. render
  5576. ) {
  5577. var ret, i, l, keys, key;
  5578. if (Array.isArray(val) || typeof val === 'string') {
  5579. ret = new Array(val.length);
  5580. for (i = 0, l = val.length; i < l; i++) {
  5581. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5582. }
  5583. } else if (typeof val === 'number') {
  5584. ret = new Array(val);
  5585. for (i = 0; i < val; i++) {
  5586. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5587. }
  5588. } else if (isObject(val)) {
  5589. if (hasSymbol && val[Symbol.iterator]) {
  5590. ret = [];
  5591. var iterator = val[Symbol.iterator]();
  5592. var result = iterator.next();
  5593. while (!result.done) {
  5594. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5595. result = iterator.next();
  5596. }
  5597. } else {
  5598. keys = Object.keys(val);
  5599. ret = new Array(keys.length);
  5600. for (i = 0, l = keys.length; i < l; i++) {
  5601. key = keys[i];
  5602. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5603. }
  5604. }
  5605. }
  5606. if (!isDef(ret)) {
  5607. ret = [];
  5608. }
  5609. (ret)._isVList = true;
  5610. return ret
  5611. }
  5612. /* */
  5613. /**
  5614. * Runtime helper for rendering <slot>
  5615. */
  5616. function renderSlot (
  5617. name,
  5618. fallback,
  5619. props,
  5620. bindObject
  5621. ) {
  5622. var scopedSlotFn = this.$scopedSlots[name];
  5623. var nodes;
  5624. if (scopedSlotFn) { // scoped slot
  5625. props = props || {};
  5626. if (bindObject) {
  5627. if ( true && !isObject(bindObject)) {
  5628. warn(
  5629. 'slot v-bind without argument expects an Object',
  5630. this
  5631. );
  5632. }
  5633. props = extend(extend({}, bindObject), props);
  5634. }
  5635. // fixed by xxxxxx app-plus scopedSlot
  5636. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5637. } else {
  5638. nodes = this.$slots[name] || fallback;
  5639. }
  5640. var target = props && props.slot;
  5641. if (target) {
  5642. return this.$createElement('template', { slot: target }, nodes)
  5643. } else {
  5644. return nodes
  5645. }
  5646. }
  5647. /* */
  5648. /**
  5649. * Runtime helper for resolving filters
  5650. */
  5651. function resolveFilter (id) {
  5652. return resolveAsset(this.$options, 'filters', id, true) || identity
  5653. }
  5654. /* */
  5655. function isKeyNotMatch (expect, actual) {
  5656. if (Array.isArray(expect)) {
  5657. return expect.indexOf(actual) === -1
  5658. } else {
  5659. return expect !== actual
  5660. }
  5661. }
  5662. /**
  5663. * Runtime helper for checking keyCodes from config.
  5664. * exposed as Vue.prototype._k
  5665. * passing in eventKeyName as last argument separately for backwards compat
  5666. */
  5667. function checkKeyCodes (
  5668. eventKeyCode,
  5669. key,
  5670. builtInKeyCode,
  5671. eventKeyName,
  5672. builtInKeyName
  5673. ) {
  5674. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5675. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5676. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5677. } else if (mappedKeyCode) {
  5678. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5679. } else if (eventKeyName) {
  5680. return hyphenate(eventKeyName) !== key
  5681. }
  5682. }
  5683. /* */
  5684. /**
  5685. * Runtime helper for merging v-bind="object" into a VNode's data.
  5686. */
  5687. function bindObjectProps (
  5688. data,
  5689. tag,
  5690. value,
  5691. asProp,
  5692. isSync
  5693. ) {
  5694. if (value) {
  5695. if (!isObject(value)) {
  5696. true && warn(
  5697. 'v-bind without argument expects an Object or Array value',
  5698. this
  5699. );
  5700. } else {
  5701. if (Array.isArray(value)) {
  5702. value = toObject(value);
  5703. }
  5704. var hash;
  5705. var loop = function ( key ) {
  5706. if (
  5707. key === 'class' ||
  5708. key === 'style' ||
  5709. isReservedAttribute(key)
  5710. ) {
  5711. hash = data;
  5712. } else {
  5713. var type = data.attrs && data.attrs.type;
  5714. hash = asProp || config.mustUseProp(tag, type, key)
  5715. ? data.domProps || (data.domProps = {})
  5716. : data.attrs || (data.attrs = {});
  5717. }
  5718. var camelizedKey = camelize(key);
  5719. var hyphenatedKey = hyphenate(key);
  5720. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5721. hash[key] = value[key];
  5722. if (isSync) {
  5723. var on = data.on || (data.on = {});
  5724. on[("update:" + key)] = function ($event) {
  5725. value[key] = $event;
  5726. };
  5727. }
  5728. }
  5729. };
  5730. for (var key in value) loop( key );
  5731. }
  5732. }
  5733. return data
  5734. }
  5735. /* */
  5736. /**
  5737. * Runtime helper for rendering static trees.
  5738. */
  5739. function renderStatic (
  5740. index,
  5741. isInFor
  5742. ) {
  5743. var cached = this._staticTrees || (this._staticTrees = []);
  5744. var tree = cached[index];
  5745. // if has already-rendered static tree and not inside v-for,
  5746. // we can reuse the same tree.
  5747. if (tree && !isInFor) {
  5748. return tree
  5749. }
  5750. // otherwise, render a fresh tree.
  5751. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5752. this._renderProxy,
  5753. null,
  5754. this // for render fns generated for functional component templates
  5755. );
  5756. markStatic(tree, ("__static__" + index), false);
  5757. return tree
  5758. }
  5759. /**
  5760. * Runtime helper for v-once.
  5761. * Effectively it means marking the node as static with a unique key.
  5762. */
  5763. function markOnce (
  5764. tree,
  5765. index,
  5766. key
  5767. ) {
  5768. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5769. return tree
  5770. }
  5771. function markStatic (
  5772. tree,
  5773. key,
  5774. isOnce
  5775. ) {
  5776. if (Array.isArray(tree)) {
  5777. for (var i = 0; i < tree.length; i++) {
  5778. if (tree[i] && typeof tree[i] !== 'string') {
  5779. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5780. }
  5781. }
  5782. } else {
  5783. markStaticNode(tree, key, isOnce);
  5784. }
  5785. }
  5786. function markStaticNode (node, key, isOnce) {
  5787. node.isStatic = true;
  5788. node.key = key;
  5789. node.isOnce = isOnce;
  5790. }
  5791. /* */
  5792. function bindObjectListeners (data, value) {
  5793. if (value) {
  5794. if (!isPlainObject(value)) {
  5795. true && warn(
  5796. 'v-on without argument expects an Object value',
  5797. this
  5798. );
  5799. } else {
  5800. var on = data.on = data.on ? extend({}, data.on) : {};
  5801. for (var key in value) {
  5802. var existing = on[key];
  5803. var ours = value[key];
  5804. on[key] = existing ? [].concat(existing, ours) : ours;
  5805. }
  5806. }
  5807. }
  5808. return data
  5809. }
  5810. /* */
  5811. function resolveScopedSlots (
  5812. fns, // see flow/vnode
  5813. res,
  5814. // the following are added in 2.6
  5815. hasDynamicKeys,
  5816. contentHashKey
  5817. ) {
  5818. res = res || { $stable: !hasDynamicKeys };
  5819. for (var i = 0; i < fns.length; i++) {
  5820. var slot = fns[i];
  5821. if (Array.isArray(slot)) {
  5822. resolveScopedSlots(slot, res, hasDynamicKeys);
  5823. } else if (slot) {
  5824. // marker for reverse proxying v-slot without scope on this.$slots
  5825. if (slot.proxy) {
  5826. slot.fn.proxy = true;
  5827. }
  5828. res[slot.key] = slot.fn;
  5829. }
  5830. }
  5831. if (contentHashKey) {
  5832. (res).$key = contentHashKey;
  5833. }
  5834. return res
  5835. }
  5836. /* */
  5837. function bindDynamicKeys (baseObj, values) {
  5838. for (var i = 0; i < values.length; i += 2) {
  5839. var key = values[i];
  5840. if (typeof key === 'string' && key) {
  5841. baseObj[values[i]] = values[i + 1];
  5842. } else if ( true && key !== '' && key !== null) {
  5843. // null is a special value for explicitly removing a binding
  5844. warn(
  5845. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5846. this
  5847. );
  5848. }
  5849. }
  5850. return baseObj
  5851. }
  5852. // helper to dynamically append modifier runtime markers to event names.
  5853. // ensure only append when value is already string, otherwise it will be cast
  5854. // to string and cause the type check to miss.
  5855. function prependModifier (value, symbol) {
  5856. return typeof value === 'string' ? symbol + value : value
  5857. }
  5858. /* */
  5859. function installRenderHelpers (target) {
  5860. target._o = markOnce;
  5861. target._n = toNumber;
  5862. target._s = toString;
  5863. target._l = renderList;
  5864. target._t = renderSlot;
  5865. target._q = looseEqual;
  5866. target._i = looseIndexOf;
  5867. target._m = renderStatic;
  5868. target._f = resolveFilter;
  5869. target._k = checkKeyCodes;
  5870. target._b = bindObjectProps;
  5871. target._v = createTextVNode;
  5872. target._e = createEmptyVNode;
  5873. target._u = resolveScopedSlots;
  5874. target._g = bindObjectListeners;
  5875. target._d = bindDynamicKeys;
  5876. target._p = prependModifier;
  5877. }
  5878. /* */
  5879. function FunctionalRenderContext (
  5880. data,
  5881. props,
  5882. children,
  5883. parent,
  5884. Ctor
  5885. ) {
  5886. var this$1 = this;
  5887. var options = Ctor.options;
  5888. // ensure the createElement function in functional components
  5889. // gets a unique context - this is necessary for correct named slot check
  5890. var contextVm;
  5891. if (hasOwn(parent, '_uid')) {
  5892. contextVm = Object.create(parent);
  5893. // $flow-disable-line
  5894. contextVm._original = parent;
  5895. } else {
  5896. // the context vm passed in is a functional context as well.
  5897. // in this case we want to make sure we are able to get a hold to the
  5898. // real context instance.
  5899. contextVm = parent;
  5900. // $flow-disable-line
  5901. parent = parent._original;
  5902. }
  5903. var isCompiled = isTrue(options._compiled);
  5904. var needNormalization = !isCompiled;
  5905. this.data = data;
  5906. this.props = props;
  5907. this.children = children;
  5908. this.parent = parent;
  5909. this.listeners = data.on || emptyObject;
  5910. this.injections = resolveInject(options.inject, parent);
  5911. this.slots = function () {
  5912. if (!this$1.$slots) {
  5913. normalizeScopedSlots(
  5914. data.scopedSlots,
  5915. this$1.$slots = resolveSlots(children, parent)
  5916. );
  5917. }
  5918. return this$1.$slots
  5919. };
  5920. Object.defineProperty(this, 'scopedSlots', ({
  5921. enumerable: true,
  5922. get: function get () {
  5923. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5924. }
  5925. }));
  5926. // support for compiled functional template
  5927. if (isCompiled) {
  5928. // exposing $options for renderStatic()
  5929. this.$options = options;
  5930. // pre-resolve slots for renderSlot()
  5931. this.$slots = this.slots();
  5932. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5933. }
  5934. if (options._scopeId) {
  5935. this._c = function (a, b, c, d) {
  5936. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5937. if (vnode && !Array.isArray(vnode)) {
  5938. vnode.fnScopeId = options._scopeId;
  5939. vnode.fnContext = parent;
  5940. }
  5941. return vnode
  5942. };
  5943. } else {
  5944. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5945. }
  5946. }
  5947. installRenderHelpers(FunctionalRenderContext.prototype);
  5948. function createFunctionalComponent (
  5949. Ctor,
  5950. propsData,
  5951. data,
  5952. contextVm,
  5953. children
  5954. ) {
  5955. var options = Ctor.options;
  5956. var props = {};
  5957. var propOptions = options.props;
  5958. if (isDef(propOptions)) {
  5959. for (var key in propOptions) {
  5960. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5961. }
  5962. } else {
  5963. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5964. if (isDef(data.props)) { mergeProps(props, data.props); }
  5965. }
  5966. var renderContext = new FunctionalRenderContext(
  5967. data,
  5968. props,
  5969. children,
  5970. contextVm,
  5971. Ctor
  5972. );
  5973. var vnode = options.render.call(null, renderContext._c, renderContext);
  5974. if (vnode instanceof VNode) {
  5975. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5976. } else if (Array.isArray(vnode)) {
  5977. var vnodes = normalizeChildren(vnode) || [];
  5978. var res = new Array(vnodes.length);
  5979. for (var i = 0; i < vnodes.length; i++) {
  5980. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5981. }
  5982. return res
  5983. }
  5984. }
  5985. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5986. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5987. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5988. // that should not be matched to match.
  5989. var clone = cloneVNode(vnode);
  5990. clone.fnContext = contextVm;
  5991. clone.fnOptions = options;
  5992. if (true) {
  5993. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5994. }
  5995. if (data.slot) {
  5996. (clone.data || (clone.data = {})).slot = data.slot;
  5997. }
  5998. return clone
  5999. }
  6000. function mergeProps (to, from) {
  6001. for (var key in from) {
  6002. to[camelize(key)] = from[key];
  6003. }
  6004. }
  6005. /* */
  6006. /* */
  6007. /* */
  6008. /* */
  6009. // inline hooks to be invoked on component VNodes during patch
  6010. var componentVNodeHooks = {
  6011. init: function init (vnode, hydrating) {
  6012. if (
  6013. vnode.componentInstance &&
  6014. !vnode.componentInstance._isDestroyed &&
  6015. vnode.data.keepAlive
  6016. ) {
  6017. // kept-alive components, treat as a patch
  6018. var mountedNode = vnode; // work around flow
  6019. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6020. } else {
  6021. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6022. vnode,
  6023. activeInstance
  6024. );
  6025. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6026. }
  6027. },
  6028. prepatch: function prepatch (oldVnode, vnode) {
  6029. var options = vnode.componentOptions;
  6030. var child = vnode.componentInstance = oldVnode.componentInstance;
  6031. updateChildComponent(
  6032. child,
  6033. options.propsData, // updated props
  6034. options.listeners, // updated listeners
  6035. vnode, // new parent vnode
  6036. options.children // new children
  6037. );
  6038. },
  6039. insert: function insert (vnode) {
  6040. var context = vnode.context;
  6041. var componentInstance = vnode.componentInstance;
  6042. if (!componentInstance._isMounted) {
  6043. callHook(componentInstance, 'onServiceCreated');
  6044. callHook(componentInstance, 'onServiceAttached');
  6045. componentInstance._isMounted = true;
  6046. callHook(componentInstance, 'mounted');
  6047. }
  6048. if (vnode.data.keepAlive) {
  6049. if (context._isMounted) {
  6050. // vue-router#1212
  6051. // During updates, a kept-alive component's child components may
  6052. // change, so directly walking the tree here may call activated hooks
  6053. // on incorrect children. Instead we push them into a queue which will
  6054. // be processed after the whole patch process ended.
  6055. queueActivatedComponent(componentInstance);
  6056. } else {
  6057. activateChildComponent(componentInstance, true /* direct */);
  6058. }
  6059. }
  6060. },
  6061. destroy: function destroy (vnode) {
  6062. var componentInstance = vnode.componentInstance;
  6063. if (!componentInstance._isDestroyed) {
  6064. if (!vnode.data.keepAlive) {
  6065. componentInstance.$destroy();
  6066. } else {
  6067. deactivateChildComponent(componentInstance, true /* direct */);
  6068. }
  6069. }
  6070. }
  6071. };
  6072. var hooksToMerge = Object.keys(componentVNodeHooks);
  6073. function createComponent (
  6074. Ctor,
  6075. data,
  6076. context,
  6077. children,
  6078. tag
  6079. ) {
  6080. if (isUndef(Ctor)) {
  6081. return
  6082. }
  6083. var baseCtor = context.$options._base;
  6084. // plain options object: turn it into a constructor
  6085. if (isObject(Ctor)) {
  6086. Ctor = baseCtor.extend(Ctor);
  6087. }
  6088. // if at this stage it's not a constructor or an async component factory,
  6089. // reject.
  6090. if (typeof Ctor !== 'function') {
  6091. if (true) {
  6092. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6093. }
  6094. return
  6095. }
  6096. // async component
  6097. var asyncFactory;
  6098. if (isUndef(Ctor.cid)) {
  6099. asyncFactory = Ctor;
  6100. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6101. if (Ctor === undefined) {
  6102. // return a placeholder node for async component, which is rendered
  6103. // as a comment node but preserves all the raw information for the node.
  6104. // the information will be used for async server-rendering and hydration.
  6105. return createAsyncPlaceholder(
  6106. asyncFactory,
  6107. data,
  6108. context,
  6109. children,
  6110. tag
  6111. )
  6112. }
  6113. }
  6114. data = data || {};
  6115. // resolve constructor options in case global mixins are applied after
  6116. // component constructor creation
  6117. resolveConstructorOptions(Ctor);
  6118. // transform component v-model data into props & events
  6119. if (isDef(data.model)) {
  6120. transformModel(Ctor.options, data);
  6121. }
  6122. // extract props
  6123. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6124. // functional component
  6125. if (isTrue(Ctor.options.functional)) {
  6126. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6127. }
  6128. // extract listeners, since these needs to be treated as
  6129. // child component listeners instead of DOM listeners
  6130. var listeners = data.on;
  6131. // replace with listeners with .native modifier
  6132. // so it gets processed during parent component patch.
  6133. data.on = data.nativeOn;
  6134. if (isTrue(Ctor.options.abstract)) {
  6135. // abstract components do not keep anything
  6136. // other than props & listeners & slot
  6137. // work around flow
  6138. var slot = data.slot;
  6139. data = {};
  6140. if (slot) {
  6141. data.slot = slot;
  6142. }
  6143. }
  6144. // install component management hooks onto the placeholder node
  6145. installComponentHooks(data);
  6146. // return a placeholder vnode
  6147. var name = Ctor.options.name || tag;
  6148. var vnode = new VNode(
  6149. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6150. data, undefined, undefined, undefined, context,
  6151. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6152. asyncFactory
  6153. );
  6154. return vnode
  6155. }
  6156. function createComponentInstanceForVnode (
  6157. vnode, // we know it's MountedComponentVNode but flow doesn't
  6158. parent // activeInstance in lifecycle state
  6159. ) {
  6160. var options = {
  6161. _isComponent: true,
  6162. _parentVnode: vnode,
  6163. parent: parent
  6164. };
  6165. // check inline-template render functions
  6166. var inlineTemplate = vnode.data.inlineTemplate;
  6167. if (isDef(inlineTemplate)) {
  6168. options.render = inlineTemplate.render;
  6169. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6170. }
  6171. return new vnode.componentOptions.Ctor(options)
  6172. }
  6173. function installComponentHooks (data) {
  6174. var hooks = data.hook || (data.hook = {});
  6175. for (var i = 0; i < hooksToMerge.length; i++) {
  6176. var key = hooksToMerge[i];
  6177. var existing = hooks[key];
  6178. var toMerge = componentVNodeHooks[key];
  6179. if (existing !== toMerge && !(existing && existing._merged)) {
  6180. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6181. }
  6182. }
  6183. }
  6184. function mergeHook$1 (f1, f2) {
  6185. var merged = function (a, b) {
  6186. // flow complains about extra args which is why we use any
  6187. f1(a, b);
  6188. f2(a, b);
  6189. };
  6190. merged._merged = true;
  6191. return merged
  6192. }
  6193. // transform component v-model info (value and callback) into
  6194. // prop and event handler respectively.
  6195. function transformModel (options, data) {
  6196. var prop = (options.model && options.model.prop) || 'value';
  6197. var event = (options.model && options.model.event) || 'input'
  6198. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6199. var on = data.on || (data.on = {});
  6200. var existing = on[event];
  6201. var callback = data.model.callback;
  6202. if (isDef(existing)) {
  6203. if (
  6204. Array.isArray(existing)
  6205. ? existing.indexOf(callback) === -1
  6206. : existing !== callback
  6207. ) {
  6208. on[event] = [callback].concat(existing);
  6209. }
  6210. } else {
  6211. on[event] = callback;
  6212. }
  6213. }
  6214. /* */
  6215. var SIMPLE_NORMALIZE = 1;
  6216. var ALWAYS_NORMALIZE = 2;
  6217. // wrapper function for providing a more flexible interface
  6218. // without getting yelled at by flow
  6219. function createElement (
  6220. context,
  6221. tag,
  6222. data,
  6223. children,
  6224. normalizationType,
  6225. alwaysNormalize
  6226. ) {
  6227. if (Array.isArray(data) || isPrimitive(data)) {
  6228. normalizationType = children;
  6229. children = data;
  6230. data = undefined;
  6231. }
  6232. if (isTrue(alwaysNormalize)) {
  6233. normalizationType = ALWAYS_NORMALIZE;
  6234. }
  6235. return _createElement(context, tag, data, children, normalizationType)
  6236. }
  6237. function _createElement (
  6238. context,
  6239. tag,
  6240. data,
  6241. children,
  6242. normalizationType
  6243. ) {
  6244. if (isDef(data) && isDef((data).__ob__)) {
  6245. true && warn(
  6246. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6247. 'Always create fresh vnode data objects in each render!',
  6248. context
  6249. );
  6250. return createEmptyVNode()
  6251. }
  6252. // object syntax in v-bind
  6253. if (isDef(data) && isDef(data.is)) {
  6254. tag = data.is;
  6255. }
  6256. if (!tag) {
  6257. // in case of component :is set to falsy value
  6258. return createEmptyVNode()
  6259. }
  6260. // warn against non-primitive key
  6261. if ( true &&
  6262. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6263. ) {
  6264. {
  6265. warn(
  6266. 'Avoid using non-primitive value as key, ' +
  6267. 'use string/number value instead.',
  6268. context
  6269. );
  6270. }
  6271. }
  6272. // support single function children as default scoped slot
  6273. if (Array.isArray(children) &&
  6274. typeof children[0] === 'function'
  6275. ) {
  6276. data = data || {};
  6277. data.scopedSlots = { default: children[0] };
  6278. children.length = 0;
  6279. }
  6280. if (normalizationType === ALWAYS_NORMALIZE) {
  6281. children = normalizeChildren(children);
  6282. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6283. children = simpleNormalizeChildren(children);
  6284. }
  6285. var vnode, ns;
  6286. if (typeof tag === 'string') {
  6287. var Ctor;
  6288. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6289. if (config.isReservedTag(tag)) {
  6290. // platform built-in elements
  6291. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6292. warn(
  6293. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6294. context
  6295. );
  6296. }
  6297. vnode = new VNode(
  6298. config.parsePlatformTagName(tag), data, children,
  6299. undefined, undefined, context
  6300. );
  6301. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6302. // component
  6303. vnode = createComponent(Ctor, data, context, children, tag);
  6304. } else {
  6305. // unknown or unlisted namespaced elements
  6306. // check at runtime because it may get assigned a namespace when its
  6307. // parent normalizes children
  6308. vnode = new VNode(
  6309. tag, data, children,
  6310. undefined, undefined, context
  6311. );
  6312. }
  6313. } else {
  6314. // direct component options / constructor
  6315. vnode = createComponent(tag, data, context, children);
  6316. }
  6317. if (Array.isArray(vnode)) {
  6318. return vnode
  6319. } else if (isDef(vnode)) {
  6320. if (isDef(ns)) { applyNS(vnode, ns); }
  6321. if (isDef(data)) { registerDeepBindings(data); }
  6322. return vnode
  6323. } else {
  6324. return createEmptyVNode()
  6325. }
  6326. }
  6327. function applyNS (vnode, ns, force) {
  6328. vnode.ns = ns;
  6329. if (vnode.tag === 'foreignObject') {
  6330. // use default namespace inside foreignObject
  6331. ns = undefined;
  6332. force = true;
  6333. }
  6334. if (isDef(vnode.children)) {
  6335. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6336. var child = vnode.children[i];
  6337. if (isDef(child.tag) && (
  6338. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6339. applyNS(child, ns, force);
  6340. }
  6341. }
  6342. }
  6343. }
  6344. // ref #5318
  6345. // necessary to ensure parent re-render when deep bindings like :style and
  6346. // :class are used on slot nodes
  6347. function registerDeepBindings (data) {
  6348. if (isObject(data.style)) {
  6349. traverse(data.style);
  6350. }
  6351. if (isObject(data.class)) {
  6352. traverse(data.class);
  6353. }
  6354. }
  6355. /* */
  6356. function initRender (vm) {
  6357. vm._vnode = null; // the root of the child tree
  6358. vm._staticTrees = null; // v-once cached trees
  6359. var options = vm.$options;
  6360. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6361. var renderContext = parentVnode && parentVnode.context;
  6362. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6363. vm.$scopedSlots = emptyObject;
  6364. // bind the createElement fn to this instance
  6365. // so that we get proper render context inside it.
  6366. // args order: tag, data, children, normalizationType, alwaysNormalize
  6367. // internal version is used by render functions compiled from templates
  6368. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6369. // normalization is always applied for the public version, used in
  6370. // user-written render functions.
  6371. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6372. // $attrs & $listeners are exposed for easier HOC creation.
  6373. // they need to be reactive so that HOCs using them are always updated
  6374. var parentData = parentVnode && parentVnode.data;
  6375. /* istanbul ignore else */
  6376. if (true) {
  6377. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6378. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6379. }, true);
  6380. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6381. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6382. }, true);
  6383. } else {}
  6384. }
  6385. var currentRenderingInstance = null;
  6386. function renderMixin (Vue) {
  6387. // install runtime convenience helpers
  6388. installRenderHelpers(Vue.prototype);
  6389. Vue.prototype.$nextTick = function (fn) {
  6390. return nextTick(fn, this)
  6391. };
  6392. Vue.prototype._render = function () {
  6393. var vm = this;
  6394. var ref = vm.$options;
  6395. var render = ref.render;
  6396. var _parentVnode = ref._parentVnode;
  6397. if (_parentVnode) {
  6398. vm.$scopedSlots = normalizeScopedSlots(
  6399. _parentVnode.data.scopedSlots,
  6400. vm.$slots,
  6401. vm.$scopedSlots
  6402. );
  6403. }
  6404. // set parent vnode. this allows render functions to have access
  6405. // to the data on the placeholder node.
  6406. vm.$vnode = _parentVnode;
  6407. // render self
  6408. var vnode;
  6409. try {
  6410. // There's no need to maintain a stack because all render fns are called
  6411. // separately from one another. Nested component's render fns are called
  6412. // when parent component is patched.
  6413. currentRenderingInstance = vm;
  6414. vnode = render.call(vm._renderProxy, vm.$createElement);
  6415. } catch (e) {
  6416. handleError(e, vm, "render");
  6417. // return error render result,
  6418. // or previous vnode to prevent render error causing blank component
  6419. /* istanbul ignore else */
  6420. if ( true && vm.$options.renderError) {
  6421. try {
  6422. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6423. } catch (e) {
  6424. handleError(e, vm, "renderError");
  6425. vnode = vm._vnode;
  6426. }
  6427. } else {
  6428. vnode = vm._vnode;
  6429. }
  6430. } finally {
  6431. currentRenderingInstance = null;
  6432. }
  6433. // if the returned array contains only a single node, allow it
  6434. if (Array.isArray(vnode) && vnode.length === 1) {
  6435. vnode = vnode[0];
  6436. }
  6437. // return empty vnode in case the render function errored out
  6438. if (!(vnode instanceof VNode)) {
  6439. if ( true && Array.isArray(vnode)) {
  6440. warn(
  6441. 'Multiple root nodes returned from render function. Render function ' +
  6442. 'should return a single root node.',
  6443. vm
  6444. );
  6445. }
  6446. vnode = createEmptyVNode();
  6447. }
  6448. // set parent
  6449. vnode.parent = _parentVnode;
  6450. return vnode
  6451. };
  6452. }
  6453. /* */
  6454. function ensureCtor (comp, base) {
  6455. if (
  6456. comp.__esModule ||
  6457. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6458. ) {
  6459. comp = comp.default;
  6460. }
  6461. return isObject(comp)
  6462. ? base.extend(comp)
  6463. : comp
  6464. }
  6465. function createAsyncPlaceholder (
  6466. factory,
  6467. data,
  6468. context,
  6469. children,
  6470. tag
  6471. ) {
  6472. var node = createEmptyVNode();
  6473. node.asyncFactory = factory;
  6474. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6475. return node
  6476. }
  6477. function resolveAsyncComponent (
  6478. factory,
  6479. baseCtor
  6480. ) {
  6481. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6482. return factory.errorComp
  6483. }
  6484. if (isDef(factory.resolved)) {
  6485. return factory.resolved
  6486. }
  6487. var owner = currentRenderingInstance;
  6488. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6489. // already pending
  6490. factory.owners.push(owner);
  6491. }
  6492. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6493. return factory.loadingComp
  6494. }
  6495. if (owner && !isDef(factory.owners)) {
  6496. var owners = factory.owners = [owner];
  6497. var sync = true;
  6498. var timerLoading = null;
  6499. var timerTimeout = null
  6500. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6501. var forceRender = function (renderCompleted) {
  6502. for (var i = 0, l = owners.length; i < l; i++) {
  6503. (owners[i]).$forceUpdate();
  6504. }
  6505. if (renderCompleted) {
  6506. owners.length = 0;
  6507. if (timerLoading !== null) {
  6508. clearTimeout(timerLoading);
  6509. timerLoading = null;
  6510. }
  6511. if (timerTimeout !== null) {
  6512. clearTimeout(timerTimeout);
  6513. timerTimeout = null;
  6514. }
  6515. }
  6516. };
  6517. var resolve = once(function (res) {
  6518. // cache resolved
  6519. factory.resolved = ensureCtor(res, baseCtor);
  6520. // invoke callbacks only if this is not a synchronous resolve
  6521. // (async resolves are shimmed as synchronous during SSR)
  6522. if (!sync) {
  6523. forceRender(true);
  6524. } else {
  6525. owners.length = 0;
  6526. }
  6527. });
  6528. var reject = once(function (reason) {
  6529. true && warn(
  6530. "Failed to resolve async component: " + (String(factory)) +
  6531. (reason ? ("\nReason: " + reason) : '')
  6532. );
  6533. if (isDef(factory.errorComp)) {
  6534. factory.error = true;
  6535. forceRender(true);
  6536. }
  6537. });
  6538. var res = factory(resolve, reject);
  6539. if (isObject(res)) {
  6540. if (isPromise(res)) {
  6541. // () => Promise
  6542. if (isUndef(factory.resolved)) {
  6543. res.then(resolve, reject);
  6544. }
  6545. } else if (isPromise(res.component)) {
  6546. res.component.then(resolve, reject);
  6547. if (isDef(res.error)) {
  6548. factory.errorComp = ensureCtor(res.error, baseCtor);
  6549. }
  6550. if (isDef(res.loading)) {
  6551. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6552. if (res.delay === 0) {
  6553. factory.loading = true;
  6554. } else {
  6555. timerLoading = setTimeout(function () {
  6556. timerLoading = null;
  6557. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6558. factory.loading = true;
  6559. forceRender(false);
  6560. }
  6561. }, res.delay || 200);
  6562. }
  6563. }
  6564. if (isDef(res.timeout)) {
  6565. timerTimeout = setTimeout(function () {
  6566. timerTimeout = null;
  6567. if (isUndef(factory.resolved)) {
  6568. reject(
  6569. true
  6570. ? ("timeout (" + (res.timeout) + "ms)")
  6571. : undefined
  6572. );
  6573. }
  6574. }, res.timeout);
  6575. }
  6576. }
  6577. }
  6578. sync = false;
  6579. // return in case resolved synchronously
  6580. return factory.loading
  6581. ? factory.loadingComp
  6582. : factory.resolved
  6583. }
  6584. }
  6585. /* */
  6586. function isAsyncPlaceholder (node) {
  6587. return node.isComment && node.asyncFactory
  6588. }
  6589. /* */
  6590. function getFirstComponentChild (children) {
  6591. if (Array.isArray(children)) {
  6592. for (var i = 0; i < children.length; i++) {
  6593. var c = children[i];
  6594. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6595. return c
  6596. }
  6597. }
  6598. }
  6599. }
  6600. /* */
  6601. /* */
  6602. function initEvents (vm) {
  6603. vm._events = Object.create(null);
  6604. vm._hasHookEvent = false;
  6605. // init parent attached events
  6606. var listeners = vm.$options._parentListeners;
  6607. if (listeners) {
  6608. updateComponentListeners(vm, listeners);
  6609. }
  6610. }
  6611. var target;
  6612. function add (event, fn) {
  6613. target.$on(event, fn);
  6614. }
  6615. function remove$1 (event, fn) {
  6616. target.$off(event, fn);
  6617. }
  6618. function createOnceHandler (event, fn) {
  6619. var _target = target;
  6620. return function onceHandler () {
  6621. var res = fn.apply(null, arguments);
  6622. if (res !== null) {
  6623. _target.$off(event, onceHandler);
  6624. }
  6625. }
  6626. }
  6627. function updateComponentListeners (
  6628. vm,
  6629. listeners,
  6630. oldListeners
  6631. ) {
  6632. target = vm;
  6633. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6634. target = undefined;
  6635. }
  6636. function eventsMixin (Vue) {
  6637. var hookRE = /^hook:/;
  6638. Vue.prototype.$on = function (event, fn) {
  6639. var vm = this;
  6640. if (Array.isArray(event)) {
  6641. for (var i = 0, l = event.length; i < l; i++) {
  6642. vm.$on(event[i], fn);
  6643. }
  6644. } else {
  6645. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6646. // optimize hook:event cost by using a boolean flag marked at registration
  6647. // instead of a hash lookup
  6648. if (hookRE.test(event)) {
  6649. vm._hasHookEvent = true;
  6650. }
  6651. }
  6652. return vm
  6653. };
  6654. Vue.prototype.$once = function (event, fn) {
  6655. var vm = this;
  6656. function on () {
  6657. vm.$off(event, on);
  6658. fn.apply(vm, arguments);
  6659. }
  6660. on.fn = fn;
  6661. vm.$on(event, on);
  6662. return vm
  6663. };
  6664. Vue.prototype.$off = function (event, fn) {
  6665. var vm = this;
  6666. // all
  6667. if (!arguments.length) {
  6668. vm._events = Object.create(null);
  6669. return vm
  6670. }
  6671. // array of events
  6672. if (Array.isArray(event)) {
  6673. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6674. vm.$off(event[i$1], fn);
  6675. }
  6676. return vm
  6677. }
  6678. // specific event
  6679. var cbs = vm._events[event];
  6680. if (!cbs) {
  6681. return vm
  6682. }
  6683. if (!fn) {
  6684. vm._events[event] = null;
  6685. return vm
  6686. }
  6687. // specific handler
  6688. var cb;
  6689. var i = cbs.length;
  6690. while (i--) {
  6691. cb = cbs[i];
  6692. if (cb === fn || cb.fn === fn) {
  6693. cbs.splice(i, 1);
  6694. break
  6695. }
  6696. }
  6697. return vm
  6698. };
  6699. Vue.prototype.$emit = function (event) {
  6700. var vm = this;
  6701. if (true) {
  6702. var lowerCaseEvent = event.toLowerCase();
  6703. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6704. tip(
  6705. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6706. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6707. "Note that HTML attributes are case-insensitive and you cannot use " +
  6708. "v-on to listen to camelCase events when using in-DOM templates. " +
  6709. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6710. );
  6711. }
  6712. }
  6713. var cbs = vm._events[event];
  6714. if (cbs) {
  6715. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6716. var args = toArray(arguments, 1);
  6717. var info = "event handler for \"" + event + "\"";
  6718. for (var i = 0, l = cbs.length; i < l; i++) {
  6719. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6720. }
  6721. }
  6722. return vm
  6723. };
  6724. }
  6725. /* */
  6726. var activeInstance = null;
  6727. var isUpdatingChildComponent = false;
  6728. function setActiveInstance(vm) {
  6729. var prevActiveInstance = activeInstance;
  6730. activeInstance = vm;
  6731. return function () {
  6732. activeInstance = prevActiveInstance;
  6733. }
  6734. }
  6735. function initLifecycle (vm) {
  6736. var options = vm.$options;
  6737. // locate first non-abstract parent
  6738. var parent = options.parent;
  6739. if (parent && !options.abstract) {
  6740. while (parent.$options.abstract && parent.$parent) {
  6741. parent = parent.$parent;
  6742. }
  6743. parent.$children.push(vm);
  6744. }
  6745. vm.$parent = parent;
  6746. vm.$root = parent ? parent.$root : vm;
  6747. vm.$children = [];
  6748. vm.$refs = {};
  6749. vm._watcher = null;
  6750. vm._inactive = null;
  6751. vm._directInactive = false;
  6752. vm._isMounted = false;
  6753. vm._isDestroyed = false;
  6754. vm._isBeingDestroyed = false;
  6755. }
  6756. function lifecycleMixin (Vue) {
  6757. Vue.prototype._update = function (vnode, hydrating) {
  6758. var vm = this;
  6759. var prevEl = vm.$el;
  6760. var prevVnode = vm._vnode;
  6761. var restoreActiveInstance = setActiveInstance(vm);
  6762. vm._vnode = vnode;
  6763. // Vue.prototype.__patch__ is injected in entry points
  6764. // based on the rendering backend used.
  6765. if (!prevVnode) {
  6766. // initial render
  6767. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6768. } else {
  6769. // updates
  6770. vm.$el = vm.__patch__(prevVnode, vnode);
  6771. }
  6772. restoreActiveInstance();
  6773. // update __vue__ reference
  6774. if (prevEl) {
  6775. prevEl.__vue__ = null;
  6776. }
  6777. if (vm.$el) {
  6778. vm.$el.__vue__ = vm;
  6779. }
  6780. // if parent is an HOC, update its $el as well
  6781. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6782. vm.$parent.$el = vm.$el;
  6783. }
  6784. // updated hook is called by the scheduler to ensure that children are
  6785. // updated in a parent's updated hook.
  6786. };
  6787. Vue.prototype.$forceUpdate = function () {
  6788. var vm = this;
  6789. if (vm._watcher) {
  6790. vm._watcher.update();
  6791. }
  6792. };
  6793. Vue.prototype.$destroy = function () {
  6794. var vm = this;
  6795. if (vm._isBeingDestroyed) {
  6796. return
  6797. }
  6798. callHook(vm, 'beforeDestroy');
  6799. vm._isBeingDestroyed = true;
  6800. // remove self from parent
  6801. var parent = vm.$parent;
  6802. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6803. remove(parent.$children, vm);
  6804. }
  6805. // teardown watchers
  6806. if (vm._watcher) {
  6807. vm._watcher.teardown();
  6808. }
  6809. var i = vm._watchers.length;
  6810. while (i--) {
  6811. vm._watchers[i].teardown();
  6812. }
  6813. // remove reference from data ob
  6814. // frozen object may not have observer.
  6815. if (vm._data.__ob__) {
  6816. vm._data.__ob__.vmCount--;
  6817. }
  6818. // call the last hook...
  6819. vm._isDestroyed = true;
  6820. // invoke destroy hooks on current rendered tree
  6821. vm.__patch__(vm._vnode, null);
  6822. // fire destroyed hook
  6823. callHook(vm, 'destroyed');
  6824. // turn off all instance listeners.
  6825. vm.$off();
  6826. // remove __vue__ reference
  6827. if (vm.$el) {
  6828. vm.$el.__vue__ = null;
  6829. }
  6830. // release circular reference (#6759)
  6831. if (vm.$vnode) {
  6832. vm.$vnode.parent = null;
  6833. }
  6834. };
  6835. }
  6836. function updateChildComponent (
  6837. vm,
  6838. propsData,
  6839. listeners,
  6840. parentVnode,
  6841. renderChildren
  6842. ) {
  6843. if (true) {
  6844. isUpdatingChildComponent = true;
  6845. }
  6846. // determine whether component has slot children
  6847. // we need to do this before overwriting $options._renderChildren.
  6848. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6849. // dynamic slot names). Static scoped slots compiled from template has the
  6850. // "$stable" marker.
  6851. var newScopedSlots = parentVnode.data.scopedSlots;
  6852. var oldScopedSlots = vm.$scopedSlots;
  6853. var hasDynamicScopedSlot = !!(
  6854. (newScopedSlots && !newScopedSlots.$stable) ||
  6855. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6856. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6857. );
  6858. // Any static slot children from the parent may have changed during parent's
  6859. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6860. // update is necessary to ensure correctness.
  6861. var needsForceUpdate = !!(
  6862. renderChildren || // has new static slots
  6863. vm.$options._renderChildren || // has old static slots
  6864. hasDynamicScopedSlot
  6865. );
  6866. vm.$options._parentVnode = parentVnode;
  6867. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6868. if (vm._vnode) { // update child tree's parent
  6869. vm._vnode.parent = parentVnode;
  6870. }
  6871. vm.$options._renderChildren = renderChildren;
  6872. // update $attrs and $listeners hash
  6873. // these are also reactive so they may trigger child update if the child
  6874. // used them during render
  6875. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6876. vm.$listeners = listeners || emptyObject;
  6877. // update props
  6878. if (propsData && vm.$options.props) {
  6879. toggleObserving(false);
  6880. var props = vm._props;
  6881. var propKeys = vm.$options._propKeys || [];
  6882. for (var i = 0; i < propKeys.length; i++) {
  6883. var key = propKeys[i];
  6884. var propOptions = vm.$options.props; // wtf flow?
  6885. props[key] = validateProp(key, propOptions, propsData, vm);
  6886. }
  6887. toggleObserving(true);
  6888. // keep a copy of raw propsData
  6889. vm.$options.propsData = propsData;
  6890. }
  6891. // fixed by xxxxxx update properties(mp runtime)
  6892. vm._$updateProperties && vm._$updateProperties(vm);
  6893. // update listeners
  6894. listeners = listeners || emptyObject;
  6895. var oldListeners = vm.$options._parentListeners;
  6896. vm.$options._parentListeners = listeners;
  6897. updateComponentListeners(vm, listeners, oldListeners);
  6898. // resolve slots + force update if has children
  6899. if (needsForceUpdate) {
  6900. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6901. vm.$forceUpdate();
  6902. }
  6903. if (true) {
  6904. isUpdatingChildComponent = false;
  6905. }
  6906. }
  6907. function isInInactiveTree (vm) {
  6908. while (vm && (vm = vm.$parent)) {
  6909. if (vm._inactive) { return true }
  6910. }
  6911. return false
  6912. }
  6913. function activateChildComponent (vm, direct) {
  6914. if (direct) {
  6915. vm._directInactive = false;
  6916. if (isInInactiveTree(vm)) {
  6917. return
  6918. }
  6919. } else if (vm._directInactive) {
  6920. return
  6921. }
  6922. if (vm._inactive || vm._inactive === null) {
  6923. vm._inactive = false;
  6924. for (var i = 0; i < vm.$children.length; i++) {
  6925. activateChildComponent(vm.$children[i]);
  6926. }
  6927. callHook(vm, 'activated');
  6928. }
  6929. }
  6930. function deactivateChildComponent (vm, direct) {
  6931. if (direct) {
  6932. vm._directInactive = true;
  6933. if (isInInactiveTree(vm)) {
  6934. return
  6935. }
  6936. }
  6937. if (!vm._inactive) {
  6938. vm._inactive = true;
  6939. for (var i = 0; i < vm.$children.length; i++) {
  6940. deactivateChildComponent(vm.$children[i]);
  6941. }
  6942. callHook(vm, 'deactivated');
  6943. }
  6944. }
  6945. function callHook (vm, hook) {
  6946. // #7573 disable dep collection when invoking lifecycle hooks
  6947. pushTarget();
  6948. var handlers = vm.$options[hook];
  6949. var info = hook + " hook";
  6950. if (handlers) {
  6951. for (var i = 0, j = handlers.length; i < j; i++) {
  6952. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6953. }
  6954. }
  6955. if (vm._hasHookEvent) {
  6956. vm.$emit('hook:' + hook);
  6957. }
  6958. popTarget();
  6959. }
  6960. /* */
  6961. var MAX_UPDATE_COUNT = 100;
  6962. var queue = [];
  6963. var activatedChildren = [];
  6964. var has = {};
  6965. var circular = {};
  6966. var waiting = false;
  6967. var flushing = false;
  6968. var index = 0;
  6969. /**
  6970. * Reset the scheduler's state.
  6971. */
  6972. function resetSchedulerState () {
  6973. index = queue.length = activatedChildren.length = 0;
  6974. has = {};
  6975. if (true) {
  6976. circular = {};
  6977. }
  6978. waiting = flushing = false;
  6979. }
  6980. // Async edge case #6566 requires saving the timestamp when event listeners are
  6981. // attached. However, calling performance.now() has a perf overhead especially
  6982. // if the page has thousands of event listeners. Instead, we take a timestamp
  6983. // every time the scheduler flushes and use that for all event listeners
  6984. // attached during that flush.
  6985. var currentFlushTimestamp = 0;
  6986. // Async edge case fix requires storing an event listener's attach timestamp.
  6987. var getNow = Date.now;
  6988. // Determine what event timestamp the browser is using. Annoyingly, the
  6989. // timestamp can either be hi-res (relative to page load) or low-res
  6990. // (relative to UNIX epoch), so in order to compare time we have to use the
  6991. // same timestamp type when saving the flush timestamp.
  6992. // All IE versions use low-res event timestamps, and have problematic clock
  6993. // implementations (#9632)
  6994. if (inBrowser && !isIE) {
  6995. var performance = window.performance;
  6996. if (
  6997. performance &&
  6998. typeof performance.now === 'function' &&
  6999. getNow() > document.createEvent('Event').timeStamp
  7000. ) {
  7001. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7002. // smaller than it, it means the event is using a hi-res timestamp,
  7003. // and we need to use the hi-res version for event listener timestamps as
  7004. // well.
  7005. getNow = function () { return performance.now(); };
  7006. }
  7007. }
  7008. /**
  7009. * Flush both queues and run the watchers.
  7010. */
  7011. function flushSchedulerQueue () {
  7012. currentFlushTimestamp = getNow();
  7013. flushing = true;
  7014. var watcher, id;
  7015. // Sort queue before flush.
  7016. // This ensures that:
  7017. // 1. Components are updated from parent to child. (because parent is always
  7018. // created before the child)
  7019. // 2. A component's user watchers are run before its render watcher (because
  7020. // user watchers are created before the render watcher)
  7021. // 3. If a component is destroyed during a parent component's watcher run,
  7022. // its watchers can be skipped.
  7023. queue.sort(function (a, b) { return a.id - b.id; });
  7024. // do not cache length because more watchers might be pushed
  7025. // as we run existing watchers
  7026. for (index = 0; index < queue.length; index++) {
  7027. watcher = queue[index];
  7028. if (watcher.before) {
  7029. watcher.before();
  7030. }
  7031. id = watcher.id;
  7032. has[id] = null;
  7033. watcher.run();
  7034. // in dev build, check and stop circular updates.
  7035. if ( true && has[id] != null) {
  7036. circular[id] = (circular[id] || 0) + 1;
  7037. if (circular[id] > MAX_UPDATE_COUNT) {
  7038. warn(
  7039. 'You may have an infinite update loop ' + (
  7040. watcher.user
  7041. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7042. : "in a component render function."
  7043. ),
  7044. watcher.vm
  7045. );
  7046. break
  7047. }
  7048. }
  7049. }
  7050. // keep copies of post queues before resetting state
  7051. var activatedQueue = activatedChildren.slice();
  7052. var updatedQueue = queue.slice();
  7053. resetSchedulerState();
  7054. // call component updated and activated hooks
  7055. callActivatedHooks(activatedQueue);
  7056. callUpdatedHooks(updatedQueue);
  7057. // devtool hook
  7058. /* istanbul ignore if */
  7059. if (devtools && config.devtools) {
  7060. devtools.emit('flush');
  7061. }
  7062. }
  7063. function callUpdatedHooks (queue) {
  7064. var i = queue.length;
  7065. while (i--) {
  7066. var watcher = queue[i];
  7067. var vm = watcher.vm;
  7068. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7069. callHook(vm, 'updated');
  7070. }
  7071. }
  7072. }
  7073. /**
  7074. * Queue a kept-alive component that was activated during patch.
  7075. * The queue will be processed after the entire tree has been patched.
  7076. */
  7077. function queueActivatedComponent (vm) {
  7078. // setting _inactive to false here so that a render function can
  7079. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7080. vm._inactive = false;
  7081. activatedChildren.push(vm);
  7082. }
  7083. function callActivatedHooks (queue) {
  7084. for (var i = 0; i < queue.length; i++) {
  7085. queue[i]._inactive = true;
  7086. activateChildComponent(queue[i], true /* true */);
  7087. }
  7088. }
  7089. /**
  7090. * Push a watcher into the watcher queue.
  7091. * Jobs with duplicate IDs will be skipped unless it's
  7092. * pushed when the queue is being flushed.
  7093. */
  7094. function queueWatcher (watcher) {
  7095. var id = watcher.id;
  7096. if (has[id] == null) {
  7097. has[id] = true;
  7098. if (!flushing) {
  7099. queue.push(watcher);
  7100. } else {
  7101. // if already flushing, splice the watcher based on its id
  7102. // if already past its id, it will be run next immediately.
  7103. var i = queue.length - 1;
  7104. while (i > index && queue[i].id > watcher.id) {
  7105. i--;
  7106. }
  7107. queue.splice(i + 1, 0, watcher);
  7108. }
  7109. // queue the flush
  7110. if (!waiting) {
  7111. waiting = true;
  7112. if ( true && !config.async) {
  7113. flushSchedulerQueue();
  7114. return
  7115. }
  7116. nextTick(flushSchedulerQueue);
  7117. }
  7118. }
  7119. }
  7120. /* */
  7121. var uid$2 = 0;
  7122. /**
  7123. * A watcher parses an expression, collects dependencies,
  7124. * and fires callback when the expression value changes.
  7125. * This is used for both the $watch() api and directives.
  7126. */
  7127. var Watcher = function Watcher (
  7128. vm,
  7129. expOrFn,
  7130. cb,
  7131. options,
  7132. isRenderWatcher
  7133. ) {
  7134. this.vm = vm;
  7135. if (isRenderWatcher) {
  7136. vm._watcher = this;
  7137. }
  7138. vm._watchers.push(this);
  7139. // options
  7140. if (options) {
  7141. this.deep = !!options.deep;
  7142. this.user = !!options.user;
  7143. this.lazy = !!options.lazy;
  7144. this.sync = !!options.sync;
  7145. this.before = options.before;
  7146. } else {
  7147. this.deep = this.user = this.lazy = this.sync = false;
  7148. }
  7149. this.cb = cb;
  7150. this.id = ++uid$2; // uid for batching
  7151. this.active = true;
  7152. this.dirty = this.lazy; // for lazy watchers
  7153. this.deps = [];
  7154. this.newDeps = [];
  7155. this.depIds = new _Set();
  7156. this.newDepIds = new _Set();
  7157. this.expression = true
  7158. ? expOrFn.toString()
  7159. : undefined;
  7160. // parse expression for getter
  7161. if (typeof expOrFn === 'function') {
  7162. this.getter = expOrFn;
  7163. } else {
  7164. this.getter = parsePath(expOrFn);
  7165. if (!this.getter) {
  7166. this.getter = noop;
  7167. true && warn(
  7168. "Failed watching path: \"" + expOrFn + "\" " +
  7169. 'Watcher only accepts simple dot-delimited paths. ' +
  7170. 'For full control, use a function instead.',
  7171. vm
  7172. );
  7173. }
  7174. }
  7175. this.value = this.lazy
  7176. ? undefined
  7177. : this.get();
  7178. };
  7179. /**
  7180. * Evaluate the getter, and re-collect dependencies.
  7181. */
  7182. Watcher.prototype.get = function get () {
  7183. pushTarget(this);
  7184. var value;
  7185. var vm = this.vm;
  7186. try {
  7187. value = this.getter.call(vm, vm);
  7188. } catch (e) {
  7189. if (this.user) {
  7190. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7191. } else {
  7192. throw e
  7193. }
  7194. } finally {
  7195. // "touch" every property so they are all tracked as
  7196. // dependencies for deep watching
  7197. if (this.deep) {
  7198. traverse(value);
  7199. }
  7200. popTarget();
  7201. this.cleanupDeps();
  7202. }
  7203. return value
  7204. };
  7205. /**
  7206. * Add a dependency to this directive.
  7207. */
  7208. Watcher.prototype.addDep = function addDep (dep) {
  7209. var id = dep.id;
  7210. if (!this.newDepIds.has(id)) {
  7211. this.newDepIds.add(id);
  7212. this.newDeps.push(dep);
  7213. if (!this.depIds.has(id)) {
  7214. dep.addSub(this);
  7215. }
  7216. }
  7217. };
  7218. /**
  7219. * Clean up for dependency collection.
  7220. */
  7221. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7222. var i = this.deps.length;
  7223. while (i--) {
  7224. var dep = this.deps[i];
  7225. if (!this.newDepIds.has(dep.id)) {
  7226. dep.removeSub(this);
  7227. }
  7228. }
  7229. var tmp = this.depIds;
  7230. this.depIds = this.newDepIds;
  7231. this.newDepIds = tmp;
  7232. this.newDepIds.clear();
  7233. tmp = this.deps;
  7234. this.deps = this.newDeps;
  7235. this.newDeps = tmp;
  7236. this.newDeps.length = 0;
  7237. };
  7238. /**
  7239. * Subscriber interface.
  7240. * Will be called when a dependency changes.
  7241. */
  7242. Watcher.prototype.update = function update () {
  7243. /* istanbul ignore else */
  7244. if (this.lazy) {
  7245. this.dirty = true;
  7246. } else if (this.sync) {
  7247. this.run();
  7248. } else {
  7249. queueWatcher(this);
  7250. }
  7251. };
  7252. /**
  7253. * Scheduler job interface.
  7254. * Will be called by the scheduler.
  7255. */
  7256. Watcher.prototype.run = function run () {
  7257. if (this.active) {
  7258. var value = this.get();
  7259. if (
  7260. value !== this.value ||
  7261. // Deep watchers and watchers on Object/Arrays should fire even
  7262. // when the value is the same, because the value may
  7263. // have mutated.
  7264. isObject(value) ||
  7265. this.deep
  7266. ) {
  7267. // set new value
  7268. var oldValue = this.value;
  7269. this.value = value;
  7270. if (this.user) {
  7271. try {
  7272. this.cb.call(this.vm, value, oldValue);
  7273. } catch (e) {
  7274. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7275. }
  7276. } else {
  7277. this.cb.call(this.vm, value, oldValue);
  7278. }
  7279. }
  7280. }
  7281. };
  7282. /**
  7283. * Evaluate the value of the watcher.
  7284. * This only gets called for lazy watchers.
  7285. */
  7286. Watcher.prototype.evaluate = function evaluate () {
  7287. this.value = this.get();
  7288. this.dirty = false;
  7289. };
  7290. /**
  7291. * Depend on all deps collected by this watcher.
  7292. */
  7293. Watcher.prototype.depend = function depend () {
  7294. var i = this.deps.length;
  7295. while (i--) {
  7296. this.deps[i].depend();
  7297. }
  7298. };
  7299. /**
  7300. * Remove self from all dependencies' subscriber list.
  7301. */
  7302. Watcher.prototype.teardown = function teardown () {
  7303. if (this.active) {
  7304. // remove self from vm's watcher list
  7305. // this is a somewhat expensive operation so we skip it
  7306. // if the vm is being destroyed.
  7307. if (!this.vm._isBeingDestroyed) {
  7308. remove(this.vm._watchers, this);
  7309. }
  7310. var i = this.deps.length;
  7311. while (i--) {
  7312. this.deps[i].removeSub(this);
  7313. }
  7314. this.active = false;
  7315. }
  7316. };
  7317. /* */
  7318. var sharedPropertyDefinition = {
  7319. enumerable: true,
  7320. configurable: true,
  7321. get: noop,
  7322. set: noop
  7323. };
  7324. function proxy (target, sourceKey, key) {
  7325. sharedPropertyDefinition.get = function proxyGetter () {
  7326. return this[sourceKey][key]
  7327. };
  7328. sharedPropertyDefinition.set = function proxySetter (val) {
  7329. this[sourceKey][key] = val;
  7330. };
  7331. Object.defineProperty(target, key, sharedPropertyDefinition);
  7332. }
  7333. function initState (vm) {
  7334. vm._watchers = [];
  7335. var opts = vm.$options;
  7336. if (opts.props) { initProps(vm, opts.props); }
  7337. if (opts.methods) { initMethods(vm, opts.methods); }
  7338. if (opts.data) {
  7339. initData(vm);
  7340. } else {
  7341. observe(vm._data = {}, true /* asRootData */);
  7342. }
  7343. if (opts.computed) { initComputed(vm, opts.computed); }
  7344. if (opts.watch && opts.watch !== nativeWatch) {
  7345. initWatch(vm, opts.watch);
  7346. }
  7347. }
  7348. function initProps (vm, propsOptions) {
  7349. var propsData = vm.$options.propsData || {};
  7350. var props = vm._props = {};
  7351. // cache prop keys so that future props updates can iterate using Array
  7352. // instead of dynamic object key enumeration.
  7353. var keys = vm.$options._propKeys = [];
  7354. var isRoot = !vm.$parent;
  7355. // root instance props should be converted
  7356. if (!isRoot) {
  7357. toggleObserving(false);
  7358. }
  7359. var loop = function ( key ) {
  7360. keys.push(key);
  7361. var value = validateProp(key, propsOptions, propsData, vm);
  7362. /* istanbul ignore else */
  7363. if (true) {
  7364. var hyphenatedKey = hyphenate(key);
  7365. if (isReservedAttribute(hyphenatedKey) ||
  7366. config.isReservedAttr(hyphenatedKey)) {
  7367. warn(
  7368. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7369. vm
  7370. );
  7371. }
  7372. defineReactive$$1(props, key, value, function () {
  7373. if (!isRoot && !isUpdatingChildComponent) {
  7374. {
  7375. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7376. return
  7377. }
  7378. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7379. if(
  7380. key === 'value' &&
  7381. Array.isArray(vm.$options.behaviors) &&
  7382. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7383. ){
  7384. return
  7385. }
  7386. if(vm._getFormData){
  7387. return
  7388. }
  7389. var $parent = vm.$parent;
  7390. while($parent){
  7391. if($parent.__next_tick_pending){
  7392. return
  7393. }
  7394. $parent = $parent.$parent;
  7395. }
  7396. }
  7397. warn(
  7398. "Avoid mutating a prop directly since the value will be " +
  7399. "overwritten whenever the parent component re-renders. " +
  7400. "Instead, use a data or computed property based on the prop's " +
  7401. "value. Prop being mutated: \"" + key + "\"",
  7402. vm
  7403. );
  7404. }
  7405. });
  7406. } else {}
  7407. // static props are already proxied on the component's prototype
  7408. // during Vue.extend(). We only need to proxy props defined at
  7409. // instantiation here.
  7410. if (!(key in vm)) {
  7411. proxy(vm, "_props", key);
  7412. }
  7413. };
  7414. for (var key in propsOptions) loop( key );
  7415. toggleObserving(true);
  7416. }
  7417. function initData (vm) {
  7418. var data = vm.$options.data;
  7419. data = vm._data = typeof data === 'function'
  7420. ? getData(data, vm)
  7421. : data || {};
  7422. if (!isPlainObject(data)) {
  7423. data = {};
  7424. true && warn(
  7425. 'data functions should return an object:\n' +
  7426. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7427. vm
  7428. );
  7429. }
  7430. // proxy data on instance
  7431. var keys = Object.keys(data);
  7432. var props = vm.$options.props;
  7433. var methods = vm.$options.methods;
  7434. var i = keys.length;
  7435. while (i--) {
  7436. var key = keys[i];
  7437. if (true) {
  7438. if (methods && hasOwn(methods, key)) {
  7439. warn(
  7440. ("Method \"" + key + "\" has already been defined as a data property."),
  7441. vm
  7442. );
  7443. }
  7444. }
  7445. if (props && hasOwn(props, key)) {
  7446. true && warn(
  7447. "The data property \"" + key + "\" is already declared as a prop. " +
  7448. "Use prop default value instead.",
  7449. vm
  7450. );
  7451. } else if (!isReserved(key)) {
  7452. proxy(vm, "_data", key);
  7453. }
  7454. }
  7455. // observe data
  7456. observe(data, true /* asRootData */);
  7457. }
  7458. function getData (data, vm) {
  7459. // #7573 disable dep collection when invoking data getters
  7460. pushTarget();
  7461. try {
  7462. return data.call(vm, vm)
  7463. } catch (e) {
  7464. handleError(e, vm, "data()");
  7465. return {}
  7466. } finally {
  7467. popTarget();
  7468. }
  7469. }
  7470. var computedWatcherOptions = { lazy: true };
  7471. function initComputed (vm, computed) {
  7472. // $flow-disable-line
  7473. var watchers = vm._computedWatchers = Object.create(null);
  7474. // computed properties are just getters during SSR
  7475. var isSSR = isServerRendering();
  7476. for (var key in computed) {
  7477. var userDef = computed[key];
  7478. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7479. if ( true && getter == null) {
  7480. warn(
  7481. ("Getter is missing for computed property \"" + key + "\"."),
  7482. vm
  7483. );
  7484. }
  7485. if (!isSSR) {
  7486. // create internal watcher for the computed property.
  7487. watchers[key] = new Watcher(
  7488. vm,
  7489. getter || noop,
  7490. noop,
  7491. computedWatcherOptions
  7492. );
  7493. }
  7494. // component-defined computed properties are already defined on the
  7495. // component prototype. We only need to define computed properties defined
  7496. // at instantiation here.
  7497. if (!(key in vm)) {
  7498. defineComputed(vm, key, userDef);
  7499. } else if (true) {
  7500. if (key in vm.$data) {
  7501. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7502. } else if (vm.$options.props && key in vm.$options.props) {
  7503. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7504. }
  7505. }
  7506. }
  7507. }
  7508. function defineComputed (
  7509. target,
  7510. key,
  7511. userDef
  7512. ) {
  7513. var shouldCache = !isServerRendering();
  7514. if (typeof userDef === 'function') {
  7515. sharedPropertyDefinition.get = shouldCache
  7516. ? createComputedGetter(key)
  7517. : createGetterInvoker(userDef);
  7518. sharedPropertyDefinition.set = noop;
  7519. } else {
  7520. sharedPropertyDefinition.get = userDef.get
  7521. ? shouldCache && userDef.cache !== false
  7522. ? createComputedGetter(key)
  7523. : createGetterInvoker(userDef.get)
  7524. : noop;
  7525. sharedPropertyDefinition.set = userDef.set || noop;
  7526. }
  7527. if ( true &&
  7528. sharedPropertyDefinition.set === noop) {
  7529. sharedPropertyDefinition.set = function () {
  7530. warn(
  7531. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7532. this
  7533. );
  7534. };
  7535. }
  7536. Object.defineProperty(target, key, sharedPropertyDefinition);
  7537. }
  7538. function createComputedGetter (key) {
  7539. return function computedGetter () {
  7540. var watcher = this._computedWatchers && this._computedWatchers[key];
  7541. if (watcher) {
  7542. if (watcher.dirty) {
  7543. watcher.evaluate();
  7544. }
  7545. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7546. watcher.depend();
  7547. }
  7548. return watcher.value
  7549. }
  7550. }
  7551. }
  7552. function createGetterInvoker(fn) {
  7553. return function computedGetter () {
  7554. return fn.call(this, this)
  7555. }
  7556. }
  7557. function initMethods (vm, methods) {
  7558. var props = vm.$options.props;
  7559. for (var key in methods) {
  7560. if (true) {
  7561. if (typeof methods[key] !== 'function') {
  7562. warn(
  7563. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7564. "Did you reference the function correctly?",
  7565. vm
  7566. );
  7567. }
  7568. if (props && hasOwn(props, key)) {
  7569. warn(
  7570. ("Method \"" + key + "\" has already been defined as a prop."),
  7571. vm
  7572. );
  7573. }
  7574. if ((key in vm) && isReserved(key)) {
  7575. warn(
  7576. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7577. "Avoid defining component methods that start with _ or $."
  7578. );
  7579. }
  7580. }
  7581. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7582. }
  7583. }
  7584. function initWatch (vm, watch) {
  7585. for (var key in watch) {
  7586. var handler = watch[key];
  7587. if (Array.isArray(handler)) {
  7588. for (var i = 0; i < handler.length; i++) {
  7589. createWatcher(vm, key, handler[i]);
  7590. }
  7591. } else {
  7592. createWatcher(vm, key, handler);
  7593. }
  7594. }
  7595. }
  7596. function createWatcher (
  7597. vm,
  7598. expOrFn,
  7599. handler,
  7600. options
  7601. ) {
  7602. if (isPlainObject(handler)) {
  7603. options = handler;
  7604. handler = handler.handler;
  7605. }
  7606. if (typeof handler === 'string') {
  7607. handler = vm[handler];
  7608. }
  7609. return vm.$watch(expOrFn, handler, options)
  7610. }
  7611. function stateMixin (Vue) {
  7612. // flow somehow has problems with directly declared definition object
  7613. // when using Object.defineProperty, so we have to procedurally build up
  7614. // the object here.
  7615. var dataDef = {};
  7616. dataDef.get = function () { return this._data };
  7617. var propsDef = {};
  7618. propsDef.get = function () { return this._props };
  7619. if (true) {
  7620. dataDef.set = function () {
  7621. warn(
  7622. 'Avoid replacing instance root $data. ' +
  7623. 'Use nested data properties instead.',
  7624. this
  7625. );
  7626. };
  7627. propsDef.set = function () {
  7628. warn("$props is readonly.", this);
  7629. };
  7630. }
  7631. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7632. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7633. Vue.prototype.$set = set;
  7634. Vue.prototype.$delete = del;
  7635. Vue.prototype.$watch = function (
  7636. expOrFn,
  7637. cb,
  7638. options
  7639. ) {
  7640. var vm = this;
  7641. if (isPlainObject(cb)) {
  7642. return createWatcher(vm, expOrFn, cb, options)
  7643. }
  7644. options = options || {};
  7645. options.user = true;
  7646. var watcher = new Watcher(vm, expOrFn, cb, options);
  7647. if (options.immediate) {
  7648. try {
  7649. cb.call(vm, watcher.value);
  7650. } catch (error) {
  7651. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7652. }
  7653. }
  7654. return function unwatchFn () {
  7655. watcher.teardown();
  7656. }
  7657. };
  7658. }
  7659. /* */
  7660. var uid$3 = 0;
  7661. function initMixin (Vue) {
  7662. Vue.prototype._init = function (options) {
  7663. var vm = this;
  7664. // a uid
  7665. vm._uid = uid$3++;
  7666. var startTag, endTag;
  7667. /* istanbul ignore if */
  7668. if ( true && config.performance && mark) {
  7669. startTag = "vue-perf-start:" + (vm._uid);
  7670. endTag = "vue-perf-end:" + (vm._uid);
  7671. mark(startTag);
  7672. }
  7673. // a flag to avoid this being observed
  7674. vm._isVue = true;
  7675. // merge options
  7676. if (options && options._isComponent) {
  7677. // optimize internal component instantiation
  7678. // since dynamic options merging is pretty slow, and none of the
  7679. // internal component options needs special treatment.
  7680. initInternalComponent(vm, options);
  7681. } else {
  7682. vm.$options = mergeOptions(
  7683. resolveConstructorOptions(vm.constructor),
  7684. options || {},
  7685. vm
  7686. );
  7687. }
  7688. /* istanbul ignore else */
  7689. if (true) {
  7690. initProxy(vm);
  7691. } else {}
  7692. // expose real self
  7693. vm._self = vm;
  7694. initLifecycle(vm);
  7695. initEvents(vm);
  7696. initRender(vm);
  7697. callHook(vm, 'beforeCreate');
  7698. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7699. initState(vm);
  7700. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7701. !vm._$fallback && callHook(vm, 'created');
  7702. /* istanbul ignore if */
  7703. if ( true && config.performance && mark) {
  7704. vm._name = formatComponentName(vm, false);
  7705. mark(endTag);
  7706. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7707. }
  7708. if (vm.$options.el) {
  7709. vm.$mount(vm.$options.el);
  7710. }
  7711. };
  7712. }
  7713. function initInternalComponent (vm, options) {
  7714. var opts = vm.$options = Object.create(vm.constructor.options);
  7715. // doing this because it's faster than dynamic enumeration.
  7716. var parentVnode = options._parentVnode;
  7717. opts.parent = options.parent;
  7718. opts._parentVnode = parentVnode;
  7719. var vnodeComponentOptions = parentVnode.componentOptions;
  7720. opts.propsData = vnodeComponentOptions.propsData;
  7721. opts._parentListeners = vnodeComponentOptions.listeners;
  7722. opts._renderChildren = vnodeComponentOptions.children;
  7723. opts._componentTag = vnodeComponentOptions.tag;
  7724. if (options.render) {
  7725. opts.render = options.render;
  7726. opts.staticRenderFns = options.staticRenderFns;
  7727. }
  7728. }
  7729. function resolveConstructorOptions (Ctor) {
  7730. var options = Ctor.options;
  7731. if (Ctor.super) {
  7732. var superOptions = resolveConstructorOptions(Ctor.super);
  7733. var cachedSuperOptions = Ctor.superOptions;
  7734. if (superOptions !== cachedSuperOptions) {
  7735. // super option changed,
  7736. // need to resolve new options.
  7737. Ctor.superOptions = superOptions;
  7738. // check if there are any late-modified/attached options (#4976)
  7739. var modifiedOptions = resolveModifiedOptions(Ctor);
  7740. // update base extend options
  7741. if (modifiedOptions) {
  7742. extend(Ctor.extendOptions, modifiedOptions);
  7743. }
  7744. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7745. if (options.name) {
  7746. options.components[options.name] = Ctor;
  7747. }
  7748. }
  7749. }
  7750. return options
  7751. }
  7752. function resolveModifiedOptions (Ctor) {
  7753. var modified;
  7754. var latest = Ctor.options;
  7755. var sealed = Ctor.sealedOptions;
  7756. for (var key in latest) {
  7757. if (latest[key] !== sealed[key]) {
  7758. if (!modified) { modified = {}; }
  7759. modified[key] = latest[key];
  7760. }
  7761. }
  7762. return modified
  7763. }
  7764. function Vue (options) {
  7765. if ( true &&
  7766. !(this instanceof Vue)
  7767. ) {
  7768. warn('Vue is a constructor and should be called with the `new` keyword');
  7769. }
  7770. this._init(options);
  7771. }
  7772. initMixin(Vue);
  7773. stateMixin(Vue);
  7774. eventsMixin(Vue);
  7775. lifecycleMixin(Vue);
  7776. renderMixin(Vue);
  7777. /* */
  7778. function initUse (Vue) {
  7779. Vue.use = function (plugin) {
  7780. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7781. if (installedPlugins.indexOf(plugin) > -1) {
  7782. return this
  7783. }
  7784. // additional parameters
  7785. var args = toArray(arguments, 1);
  7786. args.unshift(this);
  7787. if (typeof plugin.install === 'function') {
  7788. plugin.install.apply(plugin, args);
  7789. } else if (typeof plugin === 'function') {
  7790. plugin.apply(null, args);
  7791. }
  7792. installedPlugins.push(plugin);
  7793. return this
  7794. };
  7795. }
  7796. /* */
  7797. function initMixin$1 (Vue) {
  7798. Vue.mixin = function (mixin) {
  7799. this.options = mergeOptions(this.options, mixin);
  7800. return this
  7801. };
  7802. }
  7803. /* */
  7804. function initExtend (Vue) {
  7805. /**
  7806. * Each instance constructor, including Vue, has a unique
  7807. * cid. This enables us to create wrapped "child
  7808. * constructors" for prototypal inheritance and cache them.
  7809. */
  7810. Vue.cid = 0;
  7811. var cid = 1;
  7812. /**
  7813. * Class inheritance
  7814. */
  7815. Vue.extend = function (extendOptions) {
  7816. extendOptions = extendOptions || {};
  7817. var Super = this;
  7818. var SuperId = Super.cid;
  7819. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7820. if (cachedCtors[SuperId]) {
  7821. return cachedCtors[SuperId]
  7822. }
  7823. var name = extendOptions.name || Super.options.name;
  7824. if ( true && name) {
  7825. validateComponentName(name);
  7826. }
  7827. var Sub = function VueComponent (options) {
  7828. this._init(options);
  7829. };
  7830. Sub.prototype = Object.create(Super.prototype);
  7831. Sub.prototype.constructor = Sub;
  7832. Sub.cid = cid++;
  7833. Sub.options = mergeOptions(
  7834. Super.options,
  7835. extendOptions
  7836. );
  7837. Sub['super'] = Super;
  7838. // For props and computed properties, we define the proxy getters on
  7839. // the Vue instances at extension time, on the extended prototype. This
  7840. // avoids Object.defineProperty calls for each instance created.
  7841. if (Sub.options.props) {
  7842. initProps$1(Sub);
  7843. }
  7844. if (Sub.options.computed) {
  7845. initComputed$1(Sub);
  7846. }
  7847. // allow further extension/mixin/plugin usage
  7848. Sub.extend = Super.extend;
  7849. Sub.mixin = Super.mixin;
  7850. Sub.use = Super.use;
  7851. // create asset registers, so extended classes
  7852. // can have their private assets too.
  7853. ASSET_TYPES.forEach(function (type) {
  7854. Sub[type] = Super[type];
  7855. });
  7856. // enable recursive self-lookup
  7857. if (name) {
  7858. Sub.options.components[name] = Sub;
  7859. }
  7860. // keep a reference to the super options at extension time.
  7861. // later at instantiation we can check if Super's options have
  7862. // been updated.
  7863. Sub.superOptions = Super.options;
  7864. Sub.extendOptions = extendOptions;
  7865. Sub.sealedOptions = extend({}, Sub.options);
  7866. // cache constructor
  7867. cachedCtors[SuperId] = Sub;
  7868. return Sub
  7869. };
  7870. }
  7871. function initProps$1 (Comp) {
  7872. var props = Comp.options.props;
  7873. for (var key in props) {
  7874. proxy(Comp.prototype, "_props", key);
  7875. }
  7876. }
  7877. function initComputed$1 (Comp) {
  7878. var computed = Comp.options.computed;
  7879. for (var key in computed) {
  7880. defineComputed(Comp.prototype, key, computed[key]);
  7881. }
  7882. }
  7883. /* */
  7884. function initAssetRegisters (Vue) {
  7885. /**
  7886. * Create asset registration methods.
  7887. */
  7888. ASSET_TYPES.forEach(function (type) {
  7889. Vue[type] = function (
  7890. id,
  7891. definition
  7892. ) {
  7893. if (!definition) {
  7894. return this.options[type + 's'][id]
  7895. } else {
  7896. /* istanbul ignore if */
  7897. if ( true && type === 'component') {
  7898. validateComponentName(id);
  7899. }
  7900. if (type === 'component' && isPlainObject(definition)) {
  7901. definition.name = definition.name || id;
  7902. definition = this.options._base.extend(definition);
  7903. }
  7904. if (type === 'directive' && typeof definition === 'function') {
  7905. definition = { bind: definition, update: definition };
  7906. }
  7907. this.options[type + 's'][id] = definition;
  7908. return definition
  7909. }
  7910. };
  7911. });
  7912. }
  7913. /* */
  7914. function getComponentName (opts) {
  7915. return opts && (opts.Ctor.options.name || opts.tag)
  7916. }
  7917. function matches (pattern, name) {
  7918. if (Array.isArray(pattern)) {
  7919. return pattern.indexOf(name) > -1
  7920. } else if (typeof pattern === 'string') {
  7921. return pattern.split(',').indexOf(name) > -1
  7922. } else if (isRegExp(pattern)) {
  7923. return pattern.test(name)
  7924. }
  7925. /* istanbul ignore next */
  7926. return false
  7927. }
  7928. function pruneCache (keepAliveInstance, filter) {
  7929. var cache = keepAliveInstance.cache;
  7930. var keys = keepAliveInstance.keys;
  7931. var _vnode = keepAliveInstance._vnode;
  7932. for (var key in cache) {
  7933. var cachedNode = cache[key];
  7934. if (cachedNode) {
  7935. var name = getComponentName(cachedNode.componentOptions);
  7936. if (name && !filter(name)) {
  7937. pruneCacheEntry(cache, key, keys, _vnode);
  7938. }
  7939. }
  7940. }
  7941. }
  7942. function pruneCacheEntry (
  7943. cache,
  7944. key,
  7945. keys,
  7946. current
  7947. ) {
  7948. var cached$$1 = cache[key];
  7949. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7950. cached$$1.componentInstance.$destroy();
  7951. }
  7952. cache[key] = null;
  7953. remove(keys, key);
  7954. }
  7955. var patternTypes = [String, RegExp, Array];
  7956. var KeepAlive = {
  7957. name: 'keep-alive',
  7958. abstract: true,
  7959. props: {
  7960. include: patternTypes,
  7961. exclude: patternTypes,
  7962. max: [String, Number]
  7963. },
  7964. created: function created () {
  7965. this.cache = Object.create(null);
  7966. this.keys = [];
  7967. },
  7968. destroyed: function destroyed () {
  7969. for (var key in this.cache) {
  7970. pruneCacheEntry(this.cache, key, this.keys);
  7971. }
  7972. },
  7973. mounted: function mounted () {
  7974. var this$1 = this;
  7975. this.$watch('include', function (val) {
  7976. pruneCache(this$1, function (name) { return matches(val, name); });
  7977. });
  7978. this.$watch('exclude', function (val) {
  7979. pruneCache(this$1, function (name) { return !matches(val, name); });
  7980. });
  7981. },
  7982. render: function render () {
  7983. var slot = this.$slots.default;
  7984. var vnode = getFirstComponentChild(slot);
  7985. var componentOptions = vnode && vnode.componentOptions;
  7986. if (componentOptions) {
  7987. // check pattern
  7988. var name = getComponentName(componentOptions);
  7989. var ref = this;
  7990. var include = ref.include;
  7991. var exclude = ref.exclude;
  7992. if (
  7993. // not included
  7994. (include && (!name || !matches(include, name))) ||
  7995. // excluded
  7996. (exclude && name && matches(exclude, name))
  7997. ) {
  7998. return vnode
  7999. }
  8000. var ref$1 = this;
  8001. var cache = ref$1.cache;
  8002. var keys = ref$1.keys;
  8003. var key = vnode.key == null
  8004. // same constructor may get registered as different local components
  8005. // so cid alone is not enough (#3269)
  8006. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8007. : vnode.key;
  8008. if (cache[key]) {
  8009. vnode.componentInstance = cache[key].componentInstance;
  8010. // make current key freshest
  8011. remove(keys, key);
  8012. keys.push(key);
  8013. } else {
  8014. cache[key] = vnode;
  8015. keys.push(key);
  8016. // prune oldest entry
  8017. if (this.max && keys.length > parseInt(this.max)) {
  8018. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8019. }
  8020. }
  8021. vnode.data.keepAlive = true;
  8022. }
  8023. return vnode || (slot && slot[0])
  8024. }
  8025. };
  8026. var builtInComponents = {
  8027. KeepAlive: KeepAlive
  8028. };
  8029. /* */
  8030. function initGlobalAPI (Vue) {
  8031. // config
  8032. var configDef = {};
  8033. configDef.get = function () { return config; };
  8034. if (true) {
  8035. configDef.set = function () {
  8036. warn(
  8037. 'Do not replace the Vue.config object, set individual fields instead.'
  8038. );
  8039. };
  8040. }
  8041. Object.defineProperty(Vue, 'config', configDef);
  8042. // exposed util methods.
  8043. // NOTE: these are not considered part of the public API - avoid relying on
  8044. // them unless you are aware of the risk.
  8045. Vue.util = {
  8046. warn: warn,
  8047. extend: extend,
  8048. mergeOptions: mergeOptions,
  8049. defineReactive: defineReactive$$1
  8050. };
  8051. Vue.set = set;
  8052. Vue.delete = del;
  8053. Vue.nextTick = nextTick;
  8054. // 2.6 explicit observable API
  8055. Vue.observable = function (obj) {
  8056. observe(obj);
  8057. return obj
  8058. };
  8059. Vue.options = Object.create(null);
  8060. ASSET_TYPES.forEach(function (type) {
  8061. Vue.options[type + 's'] = Object.create(null);
  8062. });
  8063. // this is used to identify the "base" constructor to extend all plain-object
  8064. // components with in Weex's multi-instance scenarios.
  8065. Vue.options._base = Vue;
  8066. extend(Vue.options.components, builtInComponents);
  8067. initUse(Vue);
  8068. initMixin$1(Vue);
  8069. initExtend(Vue);
  8070. initAssetRegisters(Vue);
  8071. }
  8072. initGlobalAPI(Vue);
  8073. Object.defineProperty(Vue.prototype, '$isServer', {
  8074. get: isServerRendering
  8075. });
  8076. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8077. get: function get () {
  8078. /* istanbul ignore next */
  8079. return this.$vnode && this.$vnode.ssrContext
  8080. }
  8081. });
  8082. // expose FunctionalRenderContext for ssr runtime helper installation
  8083. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8084. value: FunctionalRenderContext
  8085. });
  8086. Vue.version = '2.6.11';
  8087. /**
  8088. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8089. */
  8090. var ARRAYTYPE = '[object Array]';
  8091. var OBJECTTYPE = '[object Object]';
  8092. var NULLTYPE = '[object Null]';
  8093. var UNDEFINEDTYPE = '[object Undefined]';
  8094. // const FUNCTIONTYPE = '[object Function]'
  8095. function diff(current, pre) {
  8096. var result = {};
  8097. syncKeys(current, pre);
  8098. _diff(current, pre, '', result);
  8099. return result
  8100. }
  8101. function syncKeys(current, pre) {
  8102. if (current === pre) { return }
  8103. var rootCurrentType = type(current);
  8104. var rootPreType = type(pre);
  8105. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8106. if(Object.keys(current).length >= Object.keys(pre).length){
  8107. for (var key in pre) {
  8108. var currentValue = current[key];
  8109. if (currentValue === undefined) {
  8110. current[key] = null;
  8111. } else {
  8112. syncKeys(currentValue, pre[key]);
  8113. }
  8114. }
  8115. }
  8116. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8117. if (current.length >= pre.length) {
  8118. pre.forEach(function (item, index) {
  8119. syncKeys(current[index], item);
  8120. });
  8121. }
  8122. }
  8123. }
  8124. function nullOrUndefined(currentType, preType) {
  8125. if(
  8126. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8127. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8128. ) {
  8129. return false
  8130. }
  8131. return true
  8132. }
  8133. function _diff(current, pre, path, result) {
  8134. if (current === pre) { return }
  8135. var rootCurrentType = type(current);
  8136. var rootPreType = type(pre);
  8137. if (rootCurrentType == OBJECTTYPE) {
  8138. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8139. setResult(result, path, current);
  8140. } else {
  8141. var loop = function ( key ) {
  8142. var currentValue = current[key];
  8143. var preValue = pre[key];
  8144. var currentType = type(currentValue);
  8145. var preType = type(preValue);
  8146. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8147. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8148. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8149. }
  8150. } else if (currentType == ARRAYTYPE) {
  8151. if (preType != ARRAYTYPE) {
  8152. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8153. } else {
  8154. if (currentValue.length < preValue.length) {
  8155. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8156. } else {
  8157. currentValue.forEach(function (item, index) {
  8158. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8159. });
  8160. }
  8161. }
  8162. } else if (currentType == OBJECTTYPE) {
  8163. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8164. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8165. } else {
  8166. for (var subKey in currentValue) {
  8167. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8168. }
  8169. }
  8170. }
  8171. };
  8172. for (var key in current) loop( key );
  8173. }
  8174. } else if (rootCurrentType == ARRAYTYPE) {
  8175. if (rootPreType != ARRAYTYPE) {
  8176. setResult(result, path, current);
  8177. } else {
  8178. if (current.length < pre.length) {
  8179. setResult(result, path, current);
  8180. } else {
  8181. current.forEach(function (item, index) {
  8182. _diff(item, pre[index], path + '[' + index + ']', result);
  8183. });
  8184. }
  8185. }
  8186. } else {
  8187. setResult(result, path, current);
  8188. }
  8189. }
  8190. function setResult(result, k, v) {
  8191. // if (type(v) != FUNCTIONTYPE) {
  8192. result[k] = v;
  8193. // }
  8194. }
  8195. function type(obj) {
  8196. return Object.prototype.toString.call(obj)
  8197. }
  8198. /* */
  8199. function flushCallbacks$1(vm) {
  8200. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8201. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8202. var mpInstance = vm.$scope;
  8203. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8204. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8205. }
  8206. var copies = vm.__next_tick_callbacks.slice(0);
  8207. vm.__next_tick_callbacks.length = 0;
  8208. for (var i = 0; i < copies.length; i++) {
  8209. copies[i]();
  8210. }
  8211. }
  8212. }
  8213. function hasRenderWatcher(vm) {
  8214. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8215. }
  8216. function nextTick$1(vm, cb) {
  8217. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8218. //2.nextTick 之前存在 render watcher
  8219. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8220. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8221. var mpInstance = vm.$scope;
  8222. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8223. ']:nextVueTick');
  8224. }
  8225. return nextTick(cb, vm)
  8226. }else{
  8227. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8228. var mpInstance$1 = vm.$scope;
  8229. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8230. ']:nextMPTick');
  8231. }
  8232. }
  8233. var _resolve;
  8234. if (!vm.__next_tick_callbacks) {
  8235. vm.__next_tick_callbacks = [];
  8236. }
  8237. vm.__next_tick_callbacks.push(function () {
  8238. if (cb) {
  8239. try {
  8240. cb.call(vm);
  8241. } catch (e) {
  8242. handleError(e, vm, 'nextTick');
  8243. }
  8244. } else if (_resolve) {
  8245. _resolve(vm);
  8246. }
  8247. });
  8248. // $flow-disable-line
  8249. if (!cb && typeof Promise !== 'undefined') {
  8250. return new Promise(function (resolve) {
  8251. _resolve = resolve;
  8252. })
  8253. }
  8254. }
  8255. /* */
  8256. function clearInstance(key, value) {
  8257. // 简易去除 Vue 和小程序组件实例
  8258. if (value) {
  8259. if (value._isVue || value.__v_isMPComponent) {
  8260. return {}
  8261. }
  8262. }
  8263. return value
  8264. }
  8265. function cloneWithData(vm) {
  8266. // 确保当前 vm 所有数据被同步
  8267. var ret = Object.create(null);
  8268. var dataKeys = [].concat(
  8269. Object.keys(vm._data || {}),
  8270. Object.keys(vm._computedWatchers || {}));
  8271. dataKeys.reduce(function(ret, key) {
  8272. ret[key] = vm[key];
  8273. return ret
  8274. }, ret);
  8275. // vue-composition-api
  8276. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8277. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8278. if (rawBindings) {
  8279. Object.keys(rawBindings).forEach(function (key) {
  8280. ret[key] = vm[key];
  8281. });
  8282. }
  8283. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8284. Object.assign(ret, vm.$mp.data || {});
  8285. if (
  8286. Array.isArray(vm.$options.behaviors) &&
  8287. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8288. ) { //form-field
  8289. ret['name'] = vm.name;
  8290. ret['value'] = vm.value;
  8291. }
  8292. return JSON.parse(JSON.stringify(ret, clearInstance))
  8293. }
  8294. var patch = function(oldVnode, vnode) {
  8295. var this$1 = this;
  8296. if (vnode === null) { //destroy
  8297. return
  8298. }
  8299. if (this.mpType === 'page' || this.mpType === 'component') {
  8300. var mpInstance = this.$scope;
  8301. var data = Object.create(null);
  8302. try {
  8303. data = cloneWithData(this);
  8304. } catch (err) {
  8305. console.error(err);
  8306. }
  8307. data.__webviewId__ = mpInstance.data.__webviewId__;
  8308. var mpData = Object.create(null);
  8309. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8310. mpData[key] = mpInstance.data[key];
  8311. });
  8312. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8313. if (Object.keys(diffData).length) {
  8314. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8315. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8316. ']差量更新',
  8317. JSON.stringify(diffData));
  8318. }
  8319. this.__next_tick_pending = true;
  8320. mpInstance.setData(diffData, function () {
  8321. this$1.__next_tick_pending = false;
  8322. flushCallbacks$1(this$1);
  8323. });
  8324. } else {
  8325. flushCallbacks$1(this);
  8326. }
  8327. }
  8328. };
  8329. /* */
  8330. function createEmptyRender() {
  8331. }
  8332. function mountComponent$1(
  8333. vm,
  8334. el,
  8335. hydrating
  8336. ) {
  8337. if (!vm.mpType) {//main.js 中的 new Vue
  8338. return vm
  8339. }
  8340. if (vm.mpType === 'app') {
  8341. vm.$options.render = createEmptyRender;
  8342. }
  8343. if (!vm.$options.render) {
  8344. vm.$options.render = createEmptyRender;
  8345. if (true) {
  8346. /* istanbul ignore if */
  8347. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8348. vm.$options.el || el) {
  8349. warn(
  8350. 'You are using the runtime-only build of Vue where the template ' +
  8351. 'compiler is not available. Either pre-compile the templates into ' +
  8352. 'render functions, or use the compiler-included build.',
  8353. vm
  8354. );
  8355. } else {
  8356. warn(
  8357. 'Failed to mount component: template or render function not defined.',
  8358. vm
  8359. );
  8360. }
  8361. }
  8362. }
  8363. !vm._$fallback && callHook(vm, 'beforeMount');
  8364. var updateComponent = function () {
  8365. vm._update(vm._render(), hydrating);
  8366. };
  8367. // we set this to vm._watcher inside the watcher's constructor
  8368. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8369. // component's mounted hook), which relies on vm._watcher being already defined
  8370. new Watcher(vm, updateComponent, noop, {
  8371. before: function before() {
  8372. if (vm._isMounted && !vm._isDestroyed) {
  8373. callHook(vm, 'beforeUpdate');
  8374. }
  8375. }
  8376. }, true /* isRenderWatcher */);
  8377. hydrating = false;
  8378. return vm
  8379. }
  8380. /* */
  8381. function renderClass (
  8382. staticClass,
  8383. dynamicClass
  8384. ) {
  8385. if (isDef(staticClass) || isDef(dynamicClass)) {
  8386. return concat(staticClass, stringifyClass(dynamicClass))
  8387. }
  8388. /* istanbul ignore next */
  8389. return ''
  8390. }
  8391. function concat (a, b) {
  8392. return a ? b ? (a + ' ' + b) : a : (b || '')
  8393. }
  8394. function stringifyClass (value) {
  8395. if (Array.isArray(value)) {
  8396. return stringifyArray(value)
  8397. }
  8398. if (isObject(value)) {
  8399. return stringifyObject(value)
  8400. }
  8401. if (typeof value === 'string') {
  8402. return value
  8403. }
  8404. /* istanbul ignore next */
  8405. return ''
  8406. }
  8407. function stringifyArray (value) {
  8408. var res = '';
  8409. var stringified;
  8410. for (var i = 0, l = value.length; i < l; i++) {
  8411. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8412. if (res) { res += ' '; }
  8413. res += stringified;
  8414. }
  8415. }
  8416. return res
  8417. }
  8418. function stringifyObject (value) {
  8419. var res = '';
  8420. for (var key in value) {
  8421. if (value[key]) {
  8422. if (res) { res += ' '; }
  8423. res += key;
  8424. }
  8425. }
  8426. return res
  8427. }
  8428. /* */
  8429. var parseStyleText = cached(function (cssText) {
  8430. var res = {};
  8431. var listDelimiter = /;(?![^(]*\))/g;
  8432. var propertyDelimiter = /:(.+)/;
  8433. cssText.split(listDelimiter).forEach(function (item) {
  8434. if (item) {
  8435. var tmp = item.split(propertyDelimiter);
  8436. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8437. }
  8438. });
  8439. return res
  8440. });
  8441. // normalize possible array / string values into Object
  8442. function normalizeStyleBinding (bindingStyle) {
  8443. if (Array.isArray(bindingStyle)) {
  8444. return toObject(bindingStyle)
  8445. }
  8446. if (typeof bindingStyle === 'string') {
  8447. return parseStyleText(bindingStyle)
  8448. }
  8449. return bindingStyle
  8450. }
  8451. /* */
  8452. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8453. function getTarget(obj, path) {
  8454. var parts = path.split('.');
  8455. var key = parts[0];
  8456. if (key.indexOf('__$n') === 0) { //number index
  8457. key = parseInt(key.replace('__$n', ''));
  8458. }
  8459. if (parts.length === 1) {
  8460. return obj[key]
  8461. }
  8462. return getTarget(obj[key], parts.slice(1).join('.'))
  8463. }
  8464. function internalMixin(Vue) {
  8465. Vue.config.errorHandler = function(err, vm, info) {
  8466. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8467. console.error(err);
  8468. /* eslint-disable no-undef */
  8469. var app = typeof getApp === 'function' && getApp();
  8470. if (app && app.onError) {
  8471. app.onError(err);
  8472. }
  8473. };
  8474. var oldEmit = Vue.prototype.$emit;
  8475. Vue.prototype.$emit = function(event) {
  8476. if (this.$scope && event) {
  8477. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8478. if (triggerEvent) {
  8479. try {
  8480. triggerEvent.call(this.$scope, event, {
  8481. __args__: toArray(arguments, 1)
  8482. });
  8483. } catch (error) {
  8484. }
  8485. }
  8486. }
  8487. return oldEmit.apply(this, arguments)
  8488. };
  8489. Vue.prototype.$nextTick = function(fn) {
  8490. return nextTick$1(this, fn)
  8491. };
  8492. MP_METHODS.forEach(function (method) {
  8493. Vue.prototype[method] = function(args) {
  8494. if (this.$scope && this.$scope[method]) {
  8495. return this.$scope[method](args)
  8496. }
  8497. // mp-alipay
  8498. if (typeof my === 'undefined') {
  8499. return
  8500. }
  8501. if (method === 'createSelectorQuery') {
  8502. /* eslint-disable no-undef */
  8503. return my.createSelectorQuery(args)
  8504. } else if (method === 'createIntersectionObserver') {
  8505. /* eslint-disable no-undef */
  8506. return my.createIntersectionObserver(args)
  8507. }
  8508. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8509. };
  8510. });
  8511. Vue.prototype.__init_provide = initProvide;
  8512. Vue.prototype.__init_injections = initInjections;
  8513. Vue.prototype.__call_hook = function(hook, args) {
  8514. var vm = this;
  8515. // #7573 disable dep collection when invoking lifecycle hooks
  8516. pushTarget();
  8517. var handlers = vm.$options[hook];
  8518. var info = hook + " hook";
  8519. var ret;
  8520. if (handlers) {
  8521. for (var i = 0, j = handlers.length; i < j; i++) {
  8522. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8523. }
  8524. }
  8525. if (vm._hasHookEvent) {
  8526. vm.$emit('hook:' + hook, args);
  8527. }
  8528. popTarget();
  8529. return ret
  8530. };
  8531. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8532. if (Array.isArray(modifiers)) {
  8533. if (modifiers.indexOf('trim') !== -1) {
  8534. value = value.trim();
  8535. }
  8536. if (modifiers.indexOf('number') !== -1) {
  8537. value = this._n(value);
  8538. }
  8539. }
  8540. if (!target) {
  8541. target = this;
  8542. }
  8543. // 解决动态属性添加
  8544. Vue.set(target, key, value);
  8545. };
  8546. Vue.prototype.__set_sync = function(target, key, value) {
  8547. if (!target) {
  8548. target = this;
  8549. }
  8550. // 解决动态属性添加
  8551. Vue.set(target, key, value);
  8552. };
  8553. Vue.prototype.__get_orig = function(item) {
  8554. if (isPlainObject(item)) {
  8555. return item['$orig'] || item
  8556. }
  8557. return item
  8558. };
  8559. Vue.prototype.__get_value = function(dataPath, target) {
  8560. return getTarget(target || this, dataPath)
  8561. };
  8562. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8563. return renderClass(staticClass, dynamicClass)
  8564. };
  8565. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8566. if (!dynamicStyle && !staticStyle) {
  8567. return ''
  8568. }
  8569. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8570. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8571. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8572. };
  8573. Vue.prototype.__map = function(val, iteratee) {
  8574. //TODO 暂不考虑 string
  8575. var ret, i, l, keys, key;
  8576. if (Array.isArray(val)) {
  8577. ret = new Array(val.length);
  8578. for (i = 0, l = val.length; i < l; i++) {
  8579. ret[i] = iteratee(val[i], i);
  8580. }
  8581. return ret
  8582. } else if (isObject(val)) {
  8583. keys = Object.keys(val);
  8584. ret = Object.create(null);
  8585. for (i = 0, l = keys.length; i < l; i++) {
  8586. key = keys[i];
  8587. ret[key] = iteratee(val[key], key, i);
  8588. }
  8589. return ret
  8590. } else if (typeof val === 'number') {
  8591. ret = new Array(val);
  8592. for (i = 0, l = val; i < l; i++) {
  8593. // 第一个参数暂时仍和小程序一致
  8594. ret[i] = iteratee(i, i);
  8595. }
  8596. return ret
  8597. }
  8598. return []
  8599. };
  8600. }
  8601. /* */
  8602. var LIFECYCLE_HOOKS$1 = [
  8603. //App
  8604. 'onLaunch',
  8605. 'onShow',
  8606. 'onHide',
  8607. 'onUniNViewMessage',
  8608. 'onPageNotFound',
  8609. 'onThemeChange',
  8610. 'onError',
  8611. 'onUnhandledRejection',
  8612. //Page
  8613. 'onInit',
  8614. 'onLoad',
  8615. // 'onShow',
  8616. 'onReady',
  8617. // 'onHide',
  8618. 'onUnload',
  8619. 'onPullDownRefresh',
  8620. 'onReachBottom',
  8621. 'onTabItemTap',
  8622. 'onAddToFavorites',
  8623. 'onShareTimeline',
  8624. 'onShareAppMessage',
  8625. 'onResize',
  8626. 'onPageScroll',
  8627. 'onNavigationBarButtonTap',
  8628. 'onBackPress',
  8629. 'onNavigationBarSearchInputChanged',
  8630. 'onNavigationBarSearchInputConfirmed',
  8631. 'onNavigationBarSearchInputClicked',
  8632. 'onUploadDouyinVideo',
  8633. 'onNFCReadMessage',
  8634. //Component
  8635. // 'onReady', // 兼容旧版本,应该移除该事件
  8636. 'onPageShow',
  8637. 'onPageHide',
  8638. 'onPageResize'
  8639. ];
  8640. function lifecycleMixin$1(Vue) {
  8641. //fixed vue-class-component
  8642. var oldExtend = Vue.extend;
  8643. Vue.extend = function(extendOptions) {
  8644. extendOptions = extendOptions || {};
  8645. var methods = extendOptions.methods;
  8646. if (methods) {
  8647. Object.keys(methods).forEach(function (methodName) {
  8648. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8649. extendOptions[methodName] = methods[methodName];
  8650. delete methods[methodName];
  8651. }
  8652. });
  8653. }
  8654. return oldExtend.call(this, extendOptions)
  8655. };
  8656. var strategies = Vue.config.optionMergeStrategies;
  8657. var mergeHook = strategies.created;
  8658. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8659. strategies[hook] = mergeHook;
  8660. });
  8661. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8662. }
  8663. /* */
  8664. // install platform patch function
  8665. Vue.prototype.__patch__ = patch;
  8666. // public mount method
  8667. Vue.prototype.$mount = function(
  8668. el ,
  8669. hydrating
  8670. ) {
  8671. return mountComponent$1(this, el, hydrating)
  8672. };
  8673. lifecycleMixin$1(Vue);
  8674. internalMixin(Vue);
  8675. /* */
  8676. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8677. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8678. /***/ }),
  8679. /***/ 26:
  8680. /*!*********************************************!*\
  8681. !*** D:/project/material_applet/pages.json ***!
  8682. \*********************************************/
  8683. /*! no static exports found */
  8684. /***/ (function(module, exports) {
  8685. /***/ }),
  8686. /***/ 3:
  8687. /*!***********************************!*\
  8688. !*** (webpack)/buildin/global.js ***!
  8689. \***********************************/
  8690. /*! no static exports found */
  8691. /***/ (function(module, exports) {
  8692. var g;
  8693. // This works in non-strict mode
  8694. g = (function() {
  8695. return this;
  8696. })();
  8697. try {
  8698. // This works if eval is allowed (see CSP)
  8699. g = g || new Function("return this")();
  8700. } catch (e) {
  8701. // This works if the window reference is available
  8702. if (typeof window === "object") g = window;
  8703. }
  8704. // g can still be undefined, but nothing to do about it...
  8705. // We return undefined, instead of nothing here, so it's
  8706. // easier to handle this case. if(!global) { ...}
  8707. module.exports = g;
  8708. /***/ }),
  8709. /***/ 30:
  8710. /*!************************************************************************************************!*\
  8711. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  8712. \************************************************************************************************/
  8713. /*! no static exports found */
  8714. /***/ (function(module, exports, __webpack_require__) {
  8715. // TODO(Babel 8): Remove this file.
  8716. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 31)();
  8717. module.exports = runtime;
  8718. /***/ }),
  8719. /***/ 31:
  8720. /*!*******************************************************************!*\
  8721. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  8722. \*******************************************************************/
  8723. /*! no static exports found */
  8724. /***/ (function(module, exports, __webpack_require__) {
  8725. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  8726. function _regeneratorRuntime() {
  8727. "use strict";
  8728. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  8729. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  8730. return exports;
  8731. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  8732. var exports = {},
  8733. Op = Object.prototype,
  8734. hasOwn = Op.hasOwnProperty,
  8735. defineProperty = Object.defineProperty || function (obj, key, desc) {
  8736. obj[key] = desc.value;
  8737. },
  8738. $Symbol = "function" == typeof Symbol ? Symbol : {},
  8739. iteratorSymbol = $Symbol.iterator || "@@iterator",
  8740. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  8741. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8742. function define(obj, key, value) {
  8743. return Object.defineProperty(obj, key, {
  8744. value: value,
  8745. enumerable: !0,
  8746. configurable: !0,
  8747. writable: !0
  8748. }), obj[key];
  8749. }
  8750. try {
  8751. define({}, "");
  8752. } catch (err) {
  8753. define = function define(obj, key, value) {
  8754. return obj[key] = value;
  8755. };
  8756. }
  8757. function wrap(innerFn, outerFn, self, tryLocsList) {
  8758. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  8759. generator = Object.create(protoGenerator.prototype),
  8760. context = new Context(tryLocsList || []);
  8761. return defineProperty(generator, "_invoke", {
  8762. value: makeInvokeMethod(innerFn, self, context)
  8763. }), generator;
  8764. }
  8765. function tryCatch(fn, obj, arg) {
  8766. try {
  8767. return {
  8768. type: "normal",
  8769. arg: fn.call(obj, arg)
  8770. };
  8771. } catch (err) {
  8772. return {
  8773. type: "throw",
  8774. arg: err
  8775. };
  8776. }
  8777. }
  8778. exports.wrap = wrap;
  8779. var ContinueSentinel = {};
  8780. function Generator() {}
  8781. function GeneratorFunction() {}
  8782. function GeneratorFunctionPrototype() {}
  8783. var IteratorPrototype = {};
  8784. define(IteratorPrototype, iteratorSymbol, function () {
  8785. return this;
  8786. });
  8787. var getProto = Object.getPrototypeOf,
  8788. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8789. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  8790. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  8791. function defineIteratorMethods(prototype) {
  8792. ["next", "throw", "return"].forEach(function (method) {
  8793. define(prototype, method, function (arg) {
  8794. return this._invoke(method, arg);
  8795. });
  8796. });
  8797. }
  8798. function AsyncIterator(generator, PromiseImpl) {
  8799. function invoke(method, arg, resolve, reject) {
  8800. var record = tryCatch(generator[method], generator, arg);
  8801. if ("throw" !== record.type) {
  8802. var result = record.arg,
  8803. value = result.value;
  8804. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  8805. invoke("next", value, resolve, reject);
  8806. }, function (err) {
  8807. invoke("throw", err, resolve, reject);
  8808. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  8809. result.value = unwrapped, resolve(result);
  8810. }, function (error) {
  8811. return invoke("throw", error, resolve, reject);
  8812. });
  8813. }
  8814. reject(record.arg);
  8815. }
  8816. var previousPromise;
  8817. defineProperty(this, "_invoke", {
  8818. value: function value(method, arg) {
  8819. function callInvokeWithMethodAndArg() {
  8820. return new PromiseImpl(function (resolve, reject) {
  8821. invoke(method, arg, resolve, reject);
  8822. });
  8823. }
  8824. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  8825. }
  8826. });
  8827. }
  8828. function makeInvokeMethod(innerFn, self, context) {
  8829. var state = "suspendedStart";
  8830. return function (method, arg) {
  8831. if ("executing" === state) throw new Error("Generator is already running");
  8832. if ("completed" === state) {
  8833. if ("throw" === method) throw arg;
  8834. return doneResult();
  8835. }
  8836. for (context.method = method, context.arg = arg;;) {
  8837. var delegate = context.delegate;
  8838. if (delegate) {
  8839. var delegateResult = maybeInvokeDelegate(delegate, context);
  8840. if (delegateResult) {
  8841. if (delegateResult === ContinueSentinel) continue;
  8842. return delegateResult;
  8843. }
  8844. }
  8845. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  8846. if ("suspendedStart" === state) throw state = "completed", context.arg;
  8847. context.dispatchException(context.arg);
  8848. } else "return" === context.method && context.abrupt("return", context.arg);
  8849. state = "executing";
  8850. var record = tryCatch(innerFn, self, context);
  8851. if ("normal" === record.type) {
  8852. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  8853. return {
  8854. value: record.arg,
  8855. done: context.done
  8856. };
  8857. }
  8858. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  8859. }
  8860. };
  8861. }
  8862. function maybeInvokeDelegate(delegate, context) {
  8863. var methodName = context.method,
  8864. method = delegate.iterator[methodName];
  8865. 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;
  8866. var record = tryCatch(method, delegate.iterator, context.arg);
  8867. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  8868. var info = record.arg;
  8869. 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);
  8870. }
  8871. function pushTryEntry(locs) {
  8872. var entry = {
  8873. tryLoc: locs[0]
  8874. };
  8875. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  8876. }
  8877. function resetTryEntry(entry) {
  8878. var record = entry.completion || {};
  8879. record.type = "normal", delete record.arg, entry.completion = record;
  8880. }
  8881. function Context(tryLocsList) {
  8882. this.tryEntries = [{
  8883. tryLoc: "root"
  8884. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  8885. }
  8886. function values(iterable) {
  8887. if (iterable) {
  8888. var iteratorMethod = iterable[iteratorSymbol];
  8889. if (iteratorMethod) return iteratorMethod.call(iterable);
  8890. if ("function" == typeof iterable.next) return iterable;
  8891. if (!isNaN(iterable.length)) {
  8892. var i = -1,
  8893. next = function next() {
  8894. for (; ++i < iterable.length;) {
  8895. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  8896. }
  8897. return next.value = undefined, next.done = !0, next;
  8898. };
  8899. return next.next = next;
  8900. }
  8901. }
  8902. return {
  8903. next: doneResult
  8904. };
  8905. }
  8906. function doneResult() {
  8907. return {
  8908. value: undefined,
  8909. done: !0
  8910. };
  8911. }
  8912. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  8913. value: GeneratorFunctionPrototype,
  8914. configurable: !0
  8915. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  8916. value: GeneratorFunction,
  8917. configurable: !0
  8918. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  8919. var ctor = "function" == typeof genFun && genFun.constructor;
  8920. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  8921. }, exports.mark = function (genFun) {
  8922. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  8923. }, exports.awrap = function (arg) {
  8924. return {
  8925. __await: arg
  8926. };
  8927. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  8928. return this;
  8929. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  8930. void 0 === PromiseImpl && (PromiseImpl = Promise);
  8931. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  8932. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  8933. return result.done ? result.value : iter.next();
  8934. });
  8935. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  8936. return this;
  8937. }), define(Gp, "toString", function () {
  8938. return "[object Generator]";
  8939. }), exports.keys = function (val) {
  8940. var object = Object(val),
  8941. keys = [];
  8942. for (var key in object) {
  8943. keys.push(key);
  8944. }
  8945. return keys.reverse(), function next() {
  8946. for (; keys.length;) {
  8947. var key = keys.pop();
  8948. if (key in object) return next.value = key, next.done = !1, next;
  8949. }
  8950. return next.done = !0, next;
  8951. };
  8952. }, exports.values = values, Context.prototype = {
  8953. constructor: Context,
  8954. reset: function reset(skipTempReset) {
  8955. 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) {
  8956. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  8957. }
  8958. },
  8959. stop: function stop() {
  8960. this.done = !0;
  8961. var rootRecord = this.tryEntries[0].completion;
  8962. if ("throw" === rootRecord.type) throw rootRecord.arg;
  8963. return this.rval;
  8964. },
  8965. dispatchException: function dispatchException(exception) {
  8966. if (this.done) throw exception;
  8967. var context = this;
  8968. function handle(loc, caught) {
  8969. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  8970. }
  8971. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8972. var entry = this.tryEntries[i],
  8973. record = entry.completion;
  8974. if ("root" === entry.tryLoc) return handle("end");
  8975. if (entry.tryLoc <= this.prev) {
  8976. var hasCatch = hasOwn.call(entry, "catchLoc"),
  8977. hasFinally = hasOwn.call(entry, "finallyLoc");
  8978. if (hasCatch && hasFinally) {
  8979. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  8980. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  8981. } else if (hasCatch) {
  8982. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  8983. } else {
  8984. if (!hasFinally) throw new Error("try statement without catch or finally");
  8985. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  8986. }
  8987. }
  8988. }
  8989. },
  8990. abrupt: function abrupt(type, arg) {
  8991. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8992. var entry = this.tryEntries[i];
  8993. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  8994. var finallyEntry = entry;
  8995. break;
  8996. }
  8997. }
  8998. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  8999. var record = finallyEntry ? finallyEntry.completion : {};
  9000. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9001. },
  9002. complete: function complete(record, afterLoc) {
  9003. if ("throw" === record.type) throw record.arg;
  9004. 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;
  9005. },
  9006. finish: function finish(finallyLoc) {
  9007. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9008. var entry = this.tryEntries[i];
  9009. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9010. }
  9011. },
  9012. "catch": function _catch(tryLoc) {
  9013. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9014. var entry = this.tryEntries[i];
  9015. if (entry.tryLoc === tryLoc) {
  9016. var record = entry.completion;
  9017. if ("throw" === record.type) {
  9018. var thrown = record.arg;
  9019. resetTryEntry(entry);
  9020. }
  9021. return thrown;
  9022. }
  9023. }
  9024. throw new Error("illegal catch attempt");
  9025. },
  9026. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9027. return this.delegate = {
  9028. iterator: values(iterable),
  9029. resultName: resultName,
  9030. nextLoc: nextLoc
  9031. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9032. }
  9033. }, exports;
  9034. }
  9035. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9036. /***/ }),
  9037. /***/ 32:
  9038. /*!*****************************************************************!*\
  9039. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9040. \*****************************************************************/
  9041. /*! no static exports found */
  9042. /***/ (function(module, exports) {
  9043. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9044. try {
  9045. var info = gen[key](arg);
  9046. var value = info.value;
  9047. } catch (error) {
  9048. reject(error);
  9049. return;
  9050. }
  9051. if (info.done) {
  9052. resolve(value);
  9053. } else {
  9054. Promise.resolve(value).then(_next, _throw);
  9055. }
  9056. }
  9057. function _asyncToGenerator(fn) {
  9058. return function () {
  9059. var self = this,
  9060. args = arguments;
  9061. return new Promise(function (resolve, reject) {
  9062. var gen = fn.apply(self, args);
  9063. function _next(value) {
  9064. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9065. }
  9066. function _throw(err) {
  9067. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9068. }
  9069. _next(undefined);
  9070. });
  9071. };
  9072. }
  9073. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9074. /***/ }),
  9075. /***/ 35:
  9076. /*!**********************************************************************************************************!*\
  9077. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9078. \**********************************************************************************************************/
  9079. /*! exports provided: default */
  9080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9081. "use strict";
  9082. __webpack_require__.r(__webpack_exports__);
  9083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9084. /* globals __VUE_SSR_CONTEXT__ */
  9085. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9086. // This module is a runtime utility for cleaner component module output and will
  9087. // be included in the final webpack user bundle.
  9088. function normalizeComponent (
  9089. scriptExports,
  9090. render,
  9091. staticRenderFns,
  9092. functionalTemplate,
  9093. injectStyles,
  9094. scopeId,
  9095. moduleIdentifier, /* server only */
  9096. shadowMode, /* vue-cli only */
  9097. components, // fixed by xxxxxx auto components
  9098. renderjs // fixed by xxxxxx renderjs
  9099. ) {
  9100. // Vue.extend constructor export interop
  9101. var options = typeof scriptExports === 'function'
  9102. ? scriptExports.options
  9103. : scriptExports
  9104. // fixed by xxxxxx auto components
  9105. if (components) {
  9106. if (!options.components) {
  9107. options.components = {}
  9108. }
  9109. var hasOwn = Object.prototype.hasOwnProperty
  9110. for (var name in components) {
  9111. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9112. options.components[name] = components[name]
  9113. }
  9114. }
  9115. }
  9116. // fixed by xxxxxx renderjs
  9117. if (renderjs) {
  9118. if(typeof renderjs.beforeCreate === 'function'){
  9119. renderjs.beforeCreate = [renderjs.beforeCreate]
  9120. }
  9121. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9122. this[renderjs.__module] = this
  9123. });
  9124. (options.mixins || (options.mixins = [])).push(renderjs)
  9125. }
  9126. // render functions
  9127. if (render) {
  9128. options.render = render
  9129. options.staticRenderFns = staticRenderFns
  9130. options._compiled = true
  9131. }
  9132. // functional template
  9133. if (functionalTemplate) {
  9134. options.functional = true
  9135. }
  9136. // scopedId
  9137. if (scopeId) {
  9138. options._scopeId = 'data-v-' + scopeId
  9139. }
  9140. var hook
  9141. if (moduleIdentifier) { // server build
  9142. hook = function (context) {
  9143. // 2.3 injection
  9144. context =
  9145. context || // cached call
  9146. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9147. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9148. // 2.2 with runInNewContext: true
  9149. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9150. context = __VUE_SSR_CONTEXT__
  9151. }
  9152. // inject component styles
  9153. if (injectStyles) {
  9154. injectStyles.call(this, context)
  9155. }
  9156. // register component module identifier for async chunk inferrence
  9157. if (context && context._registeredComponents) {
  9158. context._registeredComponents.add(moduleIdentifier)
  9159. }
  9160. }
  9161. // used by ssr in case component is cached and beforeCreate
  9162. // never gets called
  9163. options._ssrRegister = hook
  9164. } else if (injectStyles) {
  9165. hook = shadowMode
  9166. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9167. : injectStyles
  9168. }
  9169. if (hook) {
  9170. if (options.functional) {
  9171. // for template-only hot-reload because in that case the render fn doesn't
  9172. // go through the normalizer
  9173. options._injectStyles = hook
  9174. // register for functioal component in vue file
  9175. var originalRender = options.render
  9176. options.render = function renderWithStyleInjection (h, context) {
  9177. hook.call(context)
  9178. return originalRender(h, context)
  9179. }
  9180. } else {
  9181. // inject component registration as beforeCreate hook
  9182. var existing = options.beforeCreate
  9183. options.beforeCreate = existing
  9184. ? [].concat(existing, hook)
  9185. : [hook]
  9186. }
  9187. }
  9188. return {
  9189. exports: scriptExports,
  9190. options: options
  9191. }
  9192. }
  9193. /***/ }),
  9194. /***/ 36:
  9195. /*!************************************************!*\
  9196. !*** D:/project/material_applet/common/api.js ***!
  9197. \************************************************/
  9198. /*! no static exports found */
  9199. /***/ (function(module, exports, __webpack_require__) {
  9200. "use strict";
  9201. /* WEBPACK VAR INJECTION */(function(uni) {
  9202. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9203. Object.defineProperty(exports, "__esModule", {
  9204. value: true
  9205. });
  9206. exports.requestFile = exports.requestBase = exports.getToken = void 0;
  9207. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
  9208. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
  9209. var _config = _interopRequireDefault(__webpack_require__(/*! ../config.js */ 37));
  9210. var getDomain = function getDomain(uri, method, type) {
  9211. var wx_env = _config.default.wx_miniProgram;
  9212. var system = _config.default.system;
  9213. var url = _config.default.serverUrl;
  9214. var Fileurl = _config.default.serverFile;
  9215. if (type && type == 'file') return Fileurl + "/files" + uri;else return url + "/material/v1/api" + uri;
  9216. };
  9217. // 获取token
  9218. var getToken = /*#__PURE__*/function () {
  9219. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {
  9220. var method,
  9221. data,
  9222. type,
  9223. baseUrl,
  9224. header,
  9225. _args = arguments;
  9226. return _regenerator.default.wrap(function _callee$(_context) {
  9227. while (1) {
  9228. switch (_context.prev = _context.next) {
  9229. case 0:
  9230. method = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'GET';
  9231. data = _args.length > 2 ? _args[2] : undefined;
  9232. type = _args.length > 3 ? _args[3] : undefined;
  9233. baseUrl = getDomain(uri, method, type);
  9234. header = {
  9235. token: data.token
  9236. };
  9237. return _context.abrupt("return", new Promise(function (resolve, reject) {
  9238. uni.request({
  9239. url: baseUrl,
  9240. method: method || 'GET',
  9241. data: data || {},
  9242. header: header,
  9243. success: function success(res) {
  9244. resolve(res.data);
  9245. },
  9246. fail: function fail(err) {
  9247. uni.showToast({
  9248. title: '请求接口失败',
  9249. icon: 'fail'
  9250. });
  9251. reject(err.data);
  9252. }
  9253. });
  9254. }));
  9255. case 6:
  9256. case "end":
  9257. return _context.stop();
  9258. }
  9259. }
  9260. }, _callee);
  9261. }));
  9262. return function getToken(_x) {
  9263. return _ref.apply(this, arguments);
  9264. };
  9265. }();
  9266. exports.getToken = getToken;
  9267. var requestBase = /*#__PURE__*/function () {
  9268. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(uri) {
  9269. var method,
  9270. data,
  9271. type,
  9272. baseUrl,
  9273. header,
  9274. token,
  9275. _args2 = arguments;
  9276. return _regenerator.default.wrap(function _callee2$(_context2) {
  9277. while (1) {
  9278. switch (_context2.prev = _context2.next) {
  9279. case 0:
  9280. method = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'GET';
  9281. data = _args2.length > 2 ? _args2[2] : undefined;
  9282. type = _args2.length > 3 ? _args2[3] : undefined;
  9283. baseUrl = getDomain(uri, method, type);
  9284. header = {};
  9285. token = uni.getStorageSync('token');
  9286. if (token) header.token = token;
  9287. return _context2.abrupt("return", new Promise(function (resolve, reject) {
  9288. uni.request({
  9289. url: baseUrl,
  9290. method: method || 'GET',
  9291. data: data || {},
  9292. header: header,
  9293. success: function success(res) {
  9294. resolve(res.data);
  9295. },
  9296. fail: function fail(err) {
  9297. uni.showToast({
  9298. title: '请求接口失败',
  9299. icon: 'fail'
  9300. });
  9301. reject(err.data);
  9302. }
  9303. });
  9304. }));
  9305. case 8:
  9306. case "end":
  9307. return _context2.stop();
  9308. }
  9309. }
  9310. }, _callee2);
  9311. }));
  9312. return function requestBase(_x2) {
  9313. return _ref2.apply(this, arguments);
  9314. };
  9315. }();
  9316. exports.requestBase = requestBase;
  9317. var requestFile = function requestFile(uri, method, data, type) {
  9318. var baseUrl = getDomain(uri, method, type);
  9319. return new Promise(function (resolve, reject) {
  9320. uni.uploadFile({
  9321. url: baseUrl,
  9322. filePath: data,
  9323. name: method || 'file',
  9324. formData: {},
  9325. success: function success(res) {
  9326. var data = JSON.parse(res.data);
  9327. if (data.errcode != '0') {
  9328. return uni.showToast({
  9329. title: data.errmsg,
  9330. icon: 'error'
  9331. });
  9332. }
  9333. resolve(data);
  9334. },
  9335. fail: function fail(err) {
  9336. var data = JSON.parse(err.data);
  9337. uni.showToast({
  9338. title: '请求接口失败',
  9339. icon: 'fail'
  9340. });
  9341. reject(data);
  9342. }
  9343. });
  9344. });
  9345. };
  9346. exports.requestFile = requestFile;
  9347. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9348. /***/ }),
  9349. /***/ 37:
  9350. /*!********************************************!*\
  9351. !*** D:/project/material_applet/config.js ***!
  9352. \********************************************/
  9353. /*! no static exports found */
  9354. /***/ (function(module, exports, __webpack_require__) {
  9355. "use strict";
  9356. /* WEBPACK VAR INJECTION */(function(uni) {
  9357. Object.defineProperty(exports, "__esModule", {
  9358. value: true
  9359. });
  9360. exports.default = void 0;
  9361. // 微信版本
  9362. var wx_min = uni.getAccountInfoSync();
  9363. // 设备信息
  9364. var system = uni.getSystemInfoSync();
  9365. var wx_projectkey = 'materialApp';
  9366. if (system.uniPlatform == 'mp-weixin') {
  9367. var envV = wx_min.miniProgram.envVersion;
  9368. }
  9369. var _default = {
  9370. serverFile: 'https://broadcast.waityou24.cn',
  9371. serverUrl: 'http://192.168.1.113:13004',
  9372. wx_projectkey: wx_projectkey,
  9373. wx_miniProgram: wx_min.miniProgram,
  9374. system: system,
  9375. share: {},
  9376. orderList: [{
  9377. icon: "icon-shenpi",
  9378. title: "待审批",
  9379. status: "0",
  9380. type: "order",
  9381. route: "pagesMy/order/index"
  9382. }, {
  9383. icon: "icon-31daifahuo",
  9384. title: "待发货",
  9385. status: "4",
  9386. type: "order",
  9387. route: "pagesMy/order/index"
  9388. }, {
  9389. icon: "icon-daishouhuo",
  9390. title: "待收货",
  9391. status: "5",
  9392. type: "order",
  9393. route: "pagesMy/order/index"
  9394. }, {
  9395. icon: "icon-transaction",
  9396. title: "收货成功",
  9397. status: "6",
  9398. type: "order",
  9399. route: "pagesMy/order/index"
  9400. }, {
  9401. icon: "icon-shezhi",
  9402. title: "待维修",
  9403. status: "4",
  9404. type: "order",
  9405. route: "pagesMy/repair/index"
  9406. }],
  9407. menuList: [{
  9408. icon: "icon-shenpi1",
  9409. title: "用户管理",
  9410. role: ['jdgly'],
  9411. route: "pagesMy/user/index"
  9412. }, {
  9413. icon: "icon-shangpinguanli",
  9414. title: "商品管理",
  9415. role: ['cs'],
  9416. route: "pagesMy/goods/index"
  9417. }, {
  9418. icon: "icon-zhuyuanriqingdanchaxunbeifen",
  9419. title: "订单管理",
  9420. role: ['cs'],
  9421. route: "pagesMy/order/order"
  9422. }, {
  9423. icon: "icon-shenpi1",
  9424. title: "采购审批",
  9425. role: ['ld', 'kj'],
  9426. route: "pagesMy/buyExamine/index"
  9427. }, {
  9428. icon: "icon-shenpi1",
  9429. title: "回款审批",
  9430. role: ['ld', 'kj'],
  9431. route: "pagesMy/collectionExamin/index"
  9432. }, {
  9433. icon: "icon-zhuyuanriqingdanchaxunbeifen",
  9434. title: "回款记录",
  9435. role: ['cs'],
  9436. route: "pagesMy/record/index"
  9437. }, {
  9438. icon: "icon-shenpi1",
  9439. title: "维修记录",
  9440. role: ['cs'],
  9441. route: "pagesMy/maintenance/index"
  9442. }, {
  9443. icon: "icon-yonghu",
  9444. title: "账号设置",
  9445. role: ['jdgly', 'jdry', 'sqry', 'cs', 'ld', 'kj'],
  9446. route: "pagesMy/account/index"
  9447. }],
  9448. china: [
  9449. //全国地址
  9450. {
  9451. name: '北京市',
  9452. city: [{
  9453. name: '北京市',
  9454. area: ['东城区', '西城区', '崇文区', '宣武区', '朝阳区', '丰台区', '石景山区', '海淀区', '门头沟区', '房山区', '通州区', '顺义区', '昌平区', '大兴区', '平谷区', '怀柔区', '密云县', '延庆县']
  9455. }]
  9456. }, {
  9457. name: '天津市',
  9458. city: [{
  9459. name: '天津市',
  9460. area: ['和平区', '河东区', '河西区', '南开区', '河北区', '红桥区', '塘沽区', '汉沽区', '大港区', '东丽区', '西青区', '津南区', '北辰区', '武清区', '宝坻区', '宁河县', '静海县', '蓟 县']
  9461. }]
  9462. }, {
  9463. name: '河北省',
  9464. city: [{
  9465. name: '石家庄市',
  9466. area: ['长安区', '桥东区', '桥西区', '新华区', '郊 区', '井陉矿区', '井陉县', '正定县', '栾城县', '行唐县', '灵寿县', '高邑县', '深泽县', '赞皇县', '无极县', '平山县', '元氏县', '赵 县', '辛集市', '藁', '晋州市', '新乐市', '鹿泉市']
  9467. }, {
  9468. name: '唐山市',
  9469. area: ['路南区', '路北区', '古冶区', '开平区', '新 区', '丰润县', '滦 县', '滦南县', '乐亭县', '迁西县', '玉田县', '唐海县', '遵化市', '丰南市', '迁安市']
  9470. }, {
  9471. name: '秦皇岛市',
  9472. area: ['海港区', '山海关区', '北戴河区', '青龙满族自治县', '昌黎县', '抚宁县', '卢龙县']
  9473. }, {
  9474. name: '邯郸市',
  9475. area: ['邯山区', '丛台区', '复兴区', '峰峰矿区', '邯郸县', '临漳县', '成安县', '大名县', '涉 县', '磁 县', '肥乡县', '永年县', '邱 县', '鸡泽县', '广平县', '馆陶县', '魏 县', '曲周县', '武安市']
  9476. }, {
  9477. name: '邢台市',
  9478. area: ['桥东区', '桥西区', '邢台县', '临城县', '内丘县', '柏乡县', '隆尧县', '任 县', '南和县', '宁晋县', '巨鹿县', '新河县', '广宗县', '平乡县', '威 县', '清河县', '临西县', '南宫市', '沙河市']
  9479. }, {
  9480. name: '保定市',
  9481. area: ['新市区', '北市区', '南市区', '满城县', '清苑县', '涞水县', '阜平县', '徐水县', '定兴县', '唐 县', '高阳县', '容城县', '涞源县', '望都县', '安新县', '易 县', '曲阳县', '蠡 县', '顺平县', '博野', '雄县', '涿州市', '定州市', '安国市', '高碑店市']
  9482. }, {
  9483. name: '张家口',
  9484. area: ['桥东区', '桥西区', '宣化区', '下花园区', '宣化县', '张北县', '康保县', '沽源县', '尚义县', '蔚 县', '阳原县', '怀安县', '万全县', '怀来县', '涿鹿县', '赤城县', '崇礼县']
  9485. }, {
  9486. name: '承德市',
  9487. area: ['双桥区', '双滦区', '鹰手营子矿区', '承德县', '兴隆县', '平泉县', '滦平县', '隆化县', '丰宁满族自治县', '宽城满族自治县', '围场满族蒙古族自治县']
  9488. }, {
  9489. name: '沧州市',
  9490. area: ['新华区', '运河区', '沧 县', '青 县', '东光县', '海兴县', '盐山县', '肃宁县', '南皮县', '吴桥县', '献 县', '孟村回族自治县', '泊头市', '任丘市', '黄骅市', '河间市']
  9491. }, {
  9492. name: '廊坊市',
  9493. area: ['安次区', '固安县', '永清县', '香河县', '大城县', '文安县', '大厂回族自治县', '霸州市', '三河市']
  9494. }, {
  9495. name: '衡水市',
  9496. area: ['桃城区', '枣强县', '武邑县', '武强县', '饶阳县', '安平县', '故城县', '景 县', '阜城县', '冀州市', '深州市']
  9497. }]
  9498. }, {
  9499. name: '山西省',
  9500. city: [{
  9501. name: '太原市',
  9502. area: ['小店区', '迎泽区', '杏花岭区', '尖草坪区', '万柏林区', '晋源区', '清徐县', '阳曲县', '娄烦县', '古交市']
  9503. }, {
  9504. name: '大同市',
  9505. area: ['城 区', '矿 区', '南郊区', '新荣区', '阳高县', '天镇县', '广灵县', '灵丘县', '浑源县', '左云县', '大同县']
  9506. }, {
  9507. name: '阳泉市',
  9508. area: ['城 区', '矿 区', '郊 区', '平定县', '盂 县']
  9509. }, {
  9510. name: '长治市',
  9511. area: ['城 区', '郊 区', '长治县', '襄垣县', '屯留县', '平顺县', '黎城县', '壶关县', '长子县', '武乡县', '沁 县', '沁源县', '潞城市']
  9512. }, {
  9513. name: '晋城市',
  9514. area: ['城 区', '沁水县', '阳城县', '陵川县', '泽州县', '高平市']
  9515. }, {
  9516. name: '朔州市',
  9517. area: ['朔城区', '平鲁区', '山阴县', '应 县', '右玉县', '怀仁县']
  9518. }, {
  9519. name: '忻州市',
  9520. area: ['忻府区', '原平市', '定襄县', '五台县', '代 县', '繁峙县', '宁武县', '静乐县', '神池县', '五寨县', '岢岚县', '河曲县', '保德县', '偏关县']
  9521. }, {
  9522. name: '吕梁市',
  9523. area: ['离石区', '孝义市', '汾阳市', '文水县', '交城县', '兴 县', '临 县', '柳林县', '石楼县', '岚 县', '方山县', '中阳县', '交口县']
  9524. }, {
  9525. name: '晋中市',
  9526. area: ['榆次市', '介休市', '榆社县', '左权县', '和顺县', '昔阳县', '寿阳县', '太谷县', '祁 县', '平遥县', '灵石县']
  9527. }, {
  9528. name: '临汾市',
  9529. area: ['临汾市', '侯马市', '霍州市', '曲沃县', '翼城县', '襄汾县', '洪洞县', '古 县', '安泽县', '浮山县', '吉 县', '乡宁县', '蒲 县', '大宁县', '永和县', '隰 县', '汾西县']
  9530. }, {
  9531. name: '运城市',
  9532. area: ['运城市', '永济市', '河津市', '芮城县', '临猗县', '万荣县', '新绛县', '稷山县', '闻喜县', '夏 县', '绛 县', '平陆县', '垣曲县']
  9533. }]
  9534. }, {
  9535. name: '内蒙古',
  9536. city: [{
  9537. name: '呼和浩特市',
  9538. area: ['新城区', '回民区', '玉泉区', '郊 区', '土默特左旗', '托克托县', '和林格尔县', '清水河县', '武川县']
  9539. }, {
  9540. name: '包头市',
  9541. area: ['东河区', '昆都伦区', '青山区', '石拐矿区', '白云矿区', '郊 区', '土默特右旗', '固阳县', '达尔罕茂明安联合旗']
  9542. }, {
  9543. name: '乌海市',
  9544. area: ['海勃湾区', '海南区', '乌达区']
  9545. }, {
  9546. name: '赤峰市',
  9547. area: ['红山区', '元宝山区', '松山区', '阿鲁科尔沁旗', '巴林左旗', '巴林右旗', '林西县', '克什克腾旗', '翁牛特旗', '喀喇沁旗', '宁城县', '敖汉旗']
  9548. }, {
  9549. name: '呼伦贝尔市',
  9550. area: ['海拉尔市', '满洲里市', '扎兰屯市', '牙克石市', '根河市', '额尔古纳市', '阿荣旗', '莫力达瓦达斡尔族自治旗', '鄂伦春自治旗', '鄂温克族自治旗', '新巴尔虎右旗', '新巴尔虎左旗', '陈巴尔虎旗']
  9551. }, {
  9552. name: '兴安盟',
  9553. area: ['乌兰浩特市', '阿尔山市', '科尔沁右翼前旗', '科尔沁右翼中旗', '扎赉特旗', '突泉县']
  9554. }, {
  9555. name: '通辽市',
  9556. area: ['科尔沁区', '霍林郭勒市', '科尔沁左翼中旗', '科尔沁左翼后旗', '开鲁县', '库伦旗', '奈曼旗', '扎鲁特旗']
  9557. }, {
  9558. name: '锡林郭勒盟',
  9559. area: ['二连浩特市', '锡林浩特市', '阿巴嘎旗', '苏尼特左旗', '苏尼特右旗', '东乌珠穆沁旗', '西乌珠穆沁旗', '太仆寺旗', '镶黄旗', '正镶白旗', '正蓝旗', '多伦县']
  9560. }, {
  9561. name: '乌兰察布盟',
  9562. area: ['集宁市', '丰镇市', '卓资县', '化德县', '商都县', '兴和县', '凉城县', '察哈尔右翼前旗', '察哈尔右翼中旗', '察哈尔右翼后旗', '四子王旗']
  9563. }, {
  9564. name: '伊克昭盟',
  9565. area: ['东胜市', '达拉特旗', '准格尔旗', '鄂托克前旗', '鄂托克旗', '杭锦旗', '乌审旗', '伊金霍洛旗']
  9566. }, {
  9567. name: '巴彦淖尔盟',
  9568. area: ['临河市', '五原县', '磴口县', '乌拉特前旗', '乌拉特中旗', '乌拉特后旗', '杭锦后旗']
  9569. }, {
  9570. name: '阿拉善盟',
  9571. area: ['阿拉善左旗', '阿拉善右旗', '额济纳旗']
  9572. }]
  9573. }, {
  9574. name: '辽宁省',
  9575. city: [{
  9576. name: '沈阳市',
  9577. area: ['沈河区', '皇姑区', '和平区', '大东区', '铁西区', '苏家屯区', '东陵区', '于洪区', '新民市', '法库县', '辽中县', '康平县', '新城子区']
  9578. }, {
  9579. name: '大连市',
  9580. area: ['西岗区', '中山区', '沙河口区', '甘井子区', '旅顺口区', '金州区', '瓦房店市', '普兰店市', '庄河市', '长海县']
  9581. }, {
  9582. name: '鞍山市',
  9583. area: ['铁东区', '铁西区', '立山区', '千山区', '海城市', '台安县', '岫岩满族自治县']
  9584. }, {
  9585. name: '抚顺市',
  9586. area: ['顺城区', '新抚区', '东洲区', '望花区', '抚顺县', '清原满族自治县', '新宾满族自治县']
  9587. }, {
  9588. name: '本溪市',
  9589. area: ['平山区', '明山区', '溪湖区', '南芬区', '本溪满族自治县', '桓仁满族自治县']
  9590. }, {
  9591. name: '丹东市',
  9592. area: ['振兴区', '元宝区', '振安区', '东港市', '凤城市', '宽甸满族自治县']
  9593. }, {
  9594. name: '锦州市',
  9595. area: ['太和区', '古塔区', '凌河区', '凌海市', '黑山县', '义县', '北宁市']
  9596. }, {
  9597. name: '营口市',
  9598. area: ['站前区', '西市区', '鲅鱼圈区', '老边区', '大石桥市', '盖州市']
  9599. }, {
  9600. name: '阜新市',
  9601. area: ['海州区', '新邱区', '太平区', '清河门区', '细河区', '彰武县', '阜新蒙古族自治县']
  9602. }, {
  9603. name: '辽阳市',
  9604. area: ['白塔区', '文圣区', '宏伟区', '太子河区', '弓长岭区', '灯塔市', '辽阳县']
  9605. }, {
  9606. name: '盘锦',
  9607. area: ['双台子区', '兴隆台区', '盘山县', '大洼县']
  9608. }, {
  9609. name: '铁岭市',
  9610. area: ['银州区', '清河区', '调兵山市', '开原市', '铁岭县', '昌图县', '西丰县']
  9611. }, {
  9612. name: '朝阳市',
  9613. area: ['双塔区', '龙城区', '凌源市', '北票市', '朝阳县', '建平县', '喀喇沁左翼蒙古族自治县']
  9614. }, {
  9615. name: '葫芦岛市',
  9616. area: ['龙港区', '南票区', '连山区', '兴城市', '绥中县', '建昌县']
  9617. }]
  9618. }, {
  9619. name: '吉林省',
  9620. city: [{
  9621. name: '长春市',
  9622. area: ['朝阳区', '宽城区', '二道区', '南关区', '绿园区', '双阳区', '九台市', '榆树市', '德惠市', '农安县']
  9623. }, {
  9624. name: '吉林市',
  9625. area: ['船营区', '昌邑区', '龙潭区', '丰满区', '舒兰市', '桦甸市', '蛟河市', '磐石市', '永吉县']
  9626. }, {
  9627. name: '四平',
  9628. area: ['铁西区', '铁东区', '公主岭市', '双辽市', '梨树县', '伊通满族自治县']
  9629. }, {
  9630. name: '辽源市',
  9631. area: ['龙山区', '西安区', '东辽县', '东丰县']
  9632. }, {
  9633. name: '通化市',
  9634. area: ['东昌区', '二道江区', '梅河口市', '集安市', '通化县', '辉南县', '柳河县']
  9635. }, {
  9636. name: '白山市',
  9637. area: ['八道江区', '江源区', '临江市', '靖宇县', '抚松县', '长白朝鲜族自治县']
  9638. }, {
  9639. name: '松原市',
  9640. area: ['宁江区', '乾安县', '长岭县', '扶余县', '前郭尔罗斯蒙古族自治县']
  9641. }, {
  9642. name: '白城市',
  9643. area: ['洮北区', '大安市', '洮南市', '镇赉县', '通榆县']
  9644. }, {
  9645. name: '延边朝鲜族自治州',
  9646. area: ['延吉市', '图们市', '敦化市', '龙井市', '珲春市', '和龙市', '安图县', '汪清县']
  9647. }]
  9648. }, {
  9649. name: '黑龙江省',
  9650. city: [{
  9651. name: '哈尔滨市',
  9652. area: ['松北区', '道里区', '南岗区', '平房区', '香坊区', '道外区', '呼兰区', '阿城区', '双城市', '尚志市', '五常市', '宾县', '方正县', '通河县', '巴彦县', '延寿县', '木兰县', '依兰县']
  9653. }, {
  9654. name: '齐齐哈尔市',
  9655. area: ['龙沙区', '昂昂溪区', '铁锋区', '建华区', '富拉尔基区', '碾子山区', '梅里斯达斡尔族区', '讷河市', '富裕县', '拜泉县', '甘南县', '依安县', '克山县', '泰来县', '克东县', '龙江县']
  9656. }, {
  9657. name: '鹤岗市',
  9658. area: ['兴山区', '工农区', '南山区', '兴安区', '向阳区', '东山区', '萝北县', '绥滨县']
  9659. }, {
  9660. name: '双鸭山',
  9661. area: ['尖山区', '岭东区', '四方台区', '宝山区', '集贤县', '宝清县', '友谊县', '饶河县']
  9662. }, {
  9663. name: '鸡西市',
  9664. area: ['鸡冠区', '恒山区', '城子河区', '滴道区', '梨树区', '麻山区', '密山市', '虎林市', '鸡东县']
  9665. }, {
  9666. name: '大庆市',
  9667. area: ['萨尔图区', '红岗区', '龙凤区', '让胡路区', '大同区', '林甸县', '肇州县', '肇源县', '杜尔伯特蒙古族自治县']
  9668. }, {
  9669. name: '伊春市',
  9670. area: ['伊春区', '带岭区', '南岔区', '金山屯区', '西林区', '美溪区', '乌马河区', '翠峦区', '友好区', '上甘岭区', '五营区', '红星区', '新青区', '汤旺河区', '乌伊岭区', '铁力市', '嘉荫县']
  9671. }, {
  9672. name: '牡丹江市',
  9673. area: ['爱民区', '东安区', '阳明区', '西安区', '绥芬河市', '宁安市', '海林市', '穆棱市', '林口县', '东宁县']
  9674. }, {
  9675. name: '佳木斯市',
  9676. area: ['向阳区', '前进区', '东风区', '郊区', '同江市', '富锦市', '桦川县', '抚远县', '桦南县', '汤原县']
  9677. }, {
  9678. name: '七台河市',
  9679. area: ['桃山区', '新兴区', '茄子河区', '勃利县']
  9680. }, {
  9681. name: '黑河市',
  9682. area: ['爱辉区', '北安市', '五大连池市', '逊克县', '嫩江县', '孙吴县']
  9683. }, {
  9684. name: '绥化市',
  9685. area: ['北林区', '安达市', '肇东市', '海伦市', '绥棱县', '兰西县', '明水县', '青冈县', '庆安县', '望奎县']
  9686. }, {
  9687. name: '大兴安岭地区',
  9688. area: ['呼玛县', '塔河县', '漠河县', '大兴安岭辖区']
  9689. }]
  9690. }, {
  9691. name: '上海市',
  9692. city: [{
  9693. name: '上海市',
  9694. area: ['黄浦区', '卢湾区', '徐汇区', '长宁区', '静安区', '普陀区', '闸北区', '虹口区', '杨浦区', '宝山区', '闵行区', '嘉定区', '松江区', '金山区', '青浦区', '南汇区', '奉贤区', '浦东新区', '崇明县']
  9695. }]
  9696. }, {
  9697. name: '江苏省',
  9698. city: [{
  9699. name: '南京市',
  9700. area: ['玄武区', '白下区', '秦淮区', '建邺区', '鼓楼区', '下关区', '栖霞区', '雨花台区', '浦口区', '江宁区', '六合区', '溧水县', '高淳县']
  9701. }, {
  9702. name: '苏州市',
  9703. area: ['金阊区', '平江区', '沧浪区', '虎丘区', '吴中区', '相城区', '常熟市', '张家港市', '昆山市', '吴江市', '太仓市']
  9704. }, {
  9705. name: '无锡市',
  9706. area: ['崇安区', '南长区', '北塘区', '滨湖区', '锡山区', '惠山区', '江阴市', '宜兴市']
  9707. }, {
  9708. name: '常州市',
  9709. area: ['钟楼区', '天宁区', '戚墅堰区', '新北区', '武进区', '金坛市', '溧阳市']
  9710. }, {
  9711. name: '镇江市',
  9712. area: ['京口区', '润州区', '丹徒区', '丹阳市', '扬中市', '句容市']
  9713. }, {
  9714. name: '南通市',
  9715. area: ['崇川区', '港闸区', '通州市', '如皋市', '海门市', '启东市', '海安县', '如东县']
  9716. }, {
  9717. name: '泰州市',
  9718. area: ['海陵区', '高港区', '姜堰市', '泰兴市', '靖江市', '兴化市']
  9719. }, {
  9720. name: '扬州市',
  9721. area: ['广陵区', '维扬区', '邗江区', '江都市', '仪征市', '高邮市', '宝应县']
  9722. }, {
  9723. name: '盐城市',
  9724. area: ['亭湖区', '盐都区', '大丰市', '东台市', '建湖县', '射阳县', '阜宁县', '滨海县', '响水县']
  9725. }, {
  9726. name: '连云港市',
  9727. area: ['新浦区', '海州区', '连云区', '东海县', '灌云县', '赣榆县', '灌南县']
  9728. }, {
  9729. name: '徐州市',
  9730. area: ['云龙区', '鼓楼区', '九里区', '泉山区', '贾汪区', '邳州市', '新沂市', '铜山县', '睢宁县', '沛县', '丰县']
  9731. }, {
  9732. name: '淮安市',
  9733. area: ['清河区', '清浦区', '楚州区', '淮阴区', '涟水县', '洪泽县', '金湖县', '盱眙县']
  9734. }, {
  9735. name: '宿迁市',
  9736. area: ['宿城区', '宿豫区', '沭阳县', '泗阳县', '泗洪县']
  9737. }]
  9738. }, {
  9739. name: '浙江省',
  9740. city: [{
  9741. name: '杭州市',
  9742. area: ['拱墅区', '西湖区', '上城区', '下城区', '江干区', '滨江区', '余杭区', '萧山区', '建德市', '富阳市', '临安市', '桐庐县', '淳安县']
  9743. }, {
  9744. name: '宁波市',
  9745. area: ['海曙区', '江东区', '江北区', '镇海区', '北仑区', '鄞州区', '余姚市', '慈溪市', '奉化市', '宁海县', '象山县']
  9746. }, {
  9747. name: '温州市',
  9748. area: ['鹿城区', '龙湾区', '瓯海区', '瑞安市', '乐清市', '永嘉县', '洞头县', '平阳县', '苍南县', '文成县', '泰顺县']
  9749. }, {
  9750. name: '嘉兴市',
  9751. area: ['秀城区', '秀洲区', '海宁市', '平湖市', '桐乡市', '嘉善县', '海盐县']
  9752. }, {
  9753. name: '湖州市',
  9754. area: ['吴兴区', '南浔区', '长兴县', '德清县', '安吉县']
  9755. }, {
  9756. name: '绍兴市',
  9757. area: ['越城区', '诸暨市', '上虞市', '嵊州市', '绍兴县', '新昌县']
  9758. }, {
  9759. name: '金华市',
  9760. area: ['婺城区', '金东区', '兰溪市', '义乌市', '东阳市', '永康市', '武义县', '浦江县', '磐安县']
  9761. }, {
  9762. name: '衢州市',
  9763. area: ['柯城区', '衢江区', '江山市', '龙游县', '常山县', '开化县']
  9764. }, {
  9765. name: '舟山市',
  9766. area: ['定海区', '普陀区', '岱山县', '嵊泗县']
  9767. }, {
  9768. name: '台州市',
  9769. area: ['椒江区', '黄岩区', '路桥区', '临海市', '温岭市', '玉环县', '天台县', '仙居县', '三门县']
  9770. }, {
  9771. name: '丽水市',
  9772. area: ['莲都区', '龙泉市', '缙云县', '青田县', '云和县', '遂昌县', '松阳县', '庆元县', '景宁畲族自治县']
  9773. }]
  9774. }, {
  9775. name: '安徽省',
  9776. city: [{
  9777. name: '合肥市',
  9778. area: ['庐阳区', '瑶海区', '蜀山区', '包河区', '长丰县', '肥东县', '肥西县']
  9779. }, {
  9780. name: '芜湖市',
  9781. area: ['镜湖区', '弋江区', '鸠江区', '三山区', '芜湖县', '南陵县', '繁昌县']
  9782. }, {
  9783. name: '蚌埠市',
  9784. area: ['蚌山区', '龙子湖区', '禹会区', '淮上区', '怀远县', '固镇县', '五河县']
  9785. }, {
  9786. name: '淮南市',
  9787. area: ['田家庵区', '大通区', '谢家集区', '八公山区', '潘集区', '凤台县']
  9788. }, {
  9789. name: '马鞍山市',
  9790. area: ['雨山区', '花山区', '金家庄区', '当涂县']
  9791. }, {
  9792. name: '淮北市',
  9793. area: ['相山区', '杜集区', '烈山区', '濉溪县']
  9794. }, {
  9795. name: '铜陵市',
  9796. area: ['铜官山区', '狮子山区', '郊区', '铜陵县']
  9797. }, {
  9798. name: '安庆市',
  9799. area: ['迎江区', '大观区', '宜秀区', '桐城市', '宿松县', '枞阳县', '太湖县', '怀宁县', '岳西县', '望江县', '潜山县']
  9800. }, {
  9801. name: '黄山市',
  9802. area: ['屯溪区', '黄山区', '徽州区', '休宁县', '歙县', '祁门县', '黟县']
  9803. }, {
  9804. name: '滁州市',
  9805. area: ['琅琊区', '南谯区', '天长市', '明光市', '全椒县', '来安县', '定远县', '凤阳县']
  9806. }, {
  9807. name: '阜阳市',
  9808. area: ['颍州区', '颍东区', '颍泉区', '界首市', '临泉县', '颍上县', '阜南县', '太和县']
  9809. }, {
  9810. name: '宿州市',
  9811. area: ['埇桥区', '萧县', '泗县', '砀山县', '灵璧县']
  9812. }, {
  9813. name: '巢湖市',
  9814. area: ['居巢区', '含山县', '无为县', '庐江县', '和县']
  9815. }, {
  9816. name: '六安市',
  9817. area: ['金安区', '裕安区', '寿县', '霍山县', '霍邱县', '舒城县', '金寨县']
  9818. }, {
  9819. name: '亳州市',
  9820. area: ['谯城区', '利辛县', '涡阳县', '蒙城县']
  9821. }, {
  9822. name: '池州市',
  9823. area: ['贵池区', '东至县', '石台县', '青阳县']
  9824. }, {
  9825. name: '宣城市',
  9826. area: ['宣州区', '宁国市', '广德县', '郎溪县', '泾县', '旌德县', '绩溪县']
  9827. }]
  9828. }, {
  9829. name: '福建省',
  9830. city: [{
  9831. name: '福州市',
  9832. area: ['鼓楼区', '台江区', '仓山区', '马尾区', '晋安区', '福清市', '长乐市', '闽侯县', '闽清县', '永泰县', '连江县', '罗源县', '平潭县']
  9833. }, {
  9834. name: '厦门市',
  9835. area: ['思明区', '海沧区', '湖里区', '集美区', '同安区', '翔安区']
  9836. }, {
  9837. name: '莆田市',
  9838. area: ['城厢区', '涵江区', '荔城区', '秀屿区', '仙游县']
  9839. }, {
  9840. name: '三明市',
  9841. area: ['梅列区', '三元区', '永安市', '明溪县', '将乐县', '大田县', '宁化县', '建宁县', '沙县', '尤溪县', '清流县', '泰宁县']
  9842. }, {
  9843. name: '泉州市',
  9844. area: ['鲤城区', '丰泽区', '洛江区', '泉港区', '石狮市', '晋江市', '南安市', '惠安县', '永春县', '安溪县', '德化县', '金门县']
  9845. }, {
  9846. name: '漳州市',
  9847. area: ['芗城区', '龙文区', '龙海市', '平和县', '南靖县', '诏安县', '漳浦县', '华安县', '东山县', '长泰县', '云霄县']
  9848. }, {
  9849. name: '南平市',
  9850. area: ['延平区', '建瓯市', '邵武市', '武夷山市', '建阳市', '松溪县', '光泽县', '顺昌县', '浦城县', '政和县']
  9851. }, {
  9852. name: '龙岩市',
  9853. area: ['新罗区', '漳平市', '长汀县', '武平县', '上杭县', '永定县', '连城县']
  9854. }, {
  9855. name: '宁德市',
  9856. area: ['蕉城区', '福安市', '福鼎市', '寿宁县', '霞浦县', '柘荣县', '屏南县', '古田县', '周宁县']
  9857. }]
  9858. }, {
  9859. name: '江西省',
  9860. city: [{
  9861. name: '南昌市',
  9862. area: ['东湖区', '西湖区', '青云谱区', '湾里区', '青山湖区', '新建县', '南昌县', '进贤县', '安义县']
  9863. }, {
  9864. name: '景德镇市',
  9865. area: ['珠山区', '昌江区', '乐平市', '浮梁县']
  9866. }, {
  9867. name: '萍乡市',
  9868. area: ['安源区', '湘东区', '莲花县', '上栗县', '芦溪县']
  9869. }, {
  9870. name: '九江市',
  9871. area: ['浔阳区', '庐山区', '瑞昌市', '九江县', '星子县', '武宁县', '彭泽县', '永修县', '修水县', '湖口县', '德安县', '都昌县']
  9872. }, {
  9873. name: '新余市',
  9874. area: ['渝水区', '分宜县']
  9875. }, {
  9876. name: '鹰潭市',
  9877. area: ['月湖区', '贵溪市', '余江县']
  9878. }, {
  9879. name: '赣州市',
  9880. area: ['章贡区', '瑞金市', '南康市', '石城县', '安远县', '赣县', '宁都县', '寻乌县', '兴国县', '定南县', '上犹县', '于都县', '龙南县', '崇义县', '信丰县', '全南县', '大余县', '会昌县']
  9881. }, {
  9882. name: '吉安市',
  9883. area: ['吉州区', '青原区', '井冈山市', '吉安县', '永丰县', '永新县', '新干县', '泰和县', '峡江县', '遂川县', '安福县', '吉水县', '万安县']
  9884. }, {
  9885. name: '宜春市',
  9886. area: ['袁州区', '丰城市', '樟树市', '高安市', '铜鼓县', '靖安县', '宜丰县', '奉新县', '万载县', '上高县']
  9887. }, {
  9888. name: '抚州市',
  9889. area: ['临川区', '南丰县', '乐安县', '金溪县', '南城县', '东乡县', '资溪县', '宜黄县', '广昌县', '黎川县', '崇仁县']
  9890. }, {
  9891. name: '上饶市',
  9892. area: ['信州区', '德兴市', '上饶县', '广丰县', '鄱阳县', '婺源县', '铅山县', '余干县', '横峰县', '弋阳县', '玉山县', '万年县']
  9893. }]
  9894. }, {
  9895. name: '山东省',
  9896. city: [{
  9897. name: '济南市',
  9898. area: ['市中区', '历下区', '天桥区', '槐荫区', '历城区', '长清区', '章丘市', '平阴县', '济阳县', '商河县']
  9899. }, {
  9900. name: '青岛市',
  9901. area: ['市南区', '市北区', '城阳区', '四方区', '李沧区', '黄岛区', '崂山区', '胶南市', '胶州市', '平度市', '莱西市', '即墨市']
  9902. }, {
  9903. name: '淄博市',
  9904. area: ['张店区', '临淄区', '淄川区', '博山区', '周村区', '桓台县', '高青县', '沂源县']
  9905. }, {
  9906. name: '枣庄市',
  9907. area: ['市中区', '山亭区', '峄城区', '台儿庄区', '薛城区', '滕州市']
  9908. }, {
  9909. name: '东营市',
  9910. area: ['东营区', '河口区', '垦利县', '广饶县', '利津县']
  9911. }, {
  9912. name: '烟台市',
  9913. area: ['芝罘区', '福山区', '牟平区', '莱山区', '龙口市', '莱阳市', '莱州市', '招远市', '蓬莱市', '栖霞市', '海阳市', '长岛县']
  9914. }, {
  9915. name: '潍坊市',
  9916. area: ['潍城区', '寒亭区', '坊子区', '奎文区', '青州市', '诸城市', '寿光市', '安丘市', '高密市', '昌邑市', '昌乐县', '临朐县']
  9917. }, {
  9918. name: '济宁市',
  9919. area: ['市中区', '任城区', '曲阜市', '兖州市', '邹城市', '鱼台县', '金乡县', '嘉祥县', '微山县', '汶上县', '泗水县', '梁山县']
  9920. }, {
  9921. name: '泰安市',
  9922. area: ['泰山区', '岱岳区', '新泰市', '肥城市', '宁阳县', '东平县']
  9923. }, {
  9924. name: '威海市',
  9925. area: ['环翠区', '乳山市', '文登市', '荣成市']
  9926. }, {
  9927. name: '日照市',
  9928. area: ['东港区', '岚山区', '五莲县', '莒县']
  9929. }, {
  9930. name: '莱芜市',
  9931. area: ['莱城区', '钢城区']
  9932. }, {
  9933. name: '临沂市',
  9934. area: ['兰山区', '罗庄区', '河东区', '沂南县', '郯城县', '沂水县', '苍山县', '费县', '平邑县', '莒南县', '蒙阴县', '临沭县']
  9935. }, {
  9936. name: '德州市',
  9937. area: ['德城区', '乐陵市', '禹城市', '陵县', '宁津县', '齐河县', '武城县', '庆云县', '平原县', '夏津县', '临邑县']
  9938. }, {
  9939. name: '聊城市',
  9940. area: ['东昌府区', '临清市', '高唐县', '阳谷县', '茌平县', '莘县', '东阿县', '冠县']
  9941. }, {
  9942. name: '滨州市',
  9943. area: ['滨城区', '邹平县', '沾化县', '惠民县', '博兴县', '阳信县', '无棣县']
  9944. }, {
  9945. name: '菏泽市',
  9946. area: ['牡丹区', '鄄城县', '单县', '郓城县', '曹县', '定陶县', '巨野县', '东明县', '成武县']
  9947. }]
  9948. }, {
  9949. name: '河南省',
  9950. city: [{
  9951. name: '郑州市',
  9952. area: ['中原区', '金水区', '二七区', '管城回族区', '上街区', '惠济区', '巩义市', '新郑市', '新密市', '登封市', '荥阳市', '中牟县']
  9953. }, {
  9954. name: '开封市',
  9955. area: ['鼓楼区', '龙亭区', '顺河回族区', '禹王台区', '金明区', '开封县', '尉氏县', '兰考县', '杞县', '通许县']
  9956. }, {
  9957. name: '洛阳市',
  9958. area: ['西工区', '老城区', '涧西区', '瀍河回族区', '洛龙区', '吉利区', '偃师市', '孟津县', '汝阳县', '伊川县', '洛宁县', '嵩县', '宜阳县', '新安县', '栾川县']
  9959. }, {
  9960. name: '平顶山市',
  9961. area: ['新华区', '卫东区', '湛河区', '石龙区', '汝州市', '舞钢市', '宝丰县', '叶县', '郏县', '鲁山县']
  9962. }, {
  9963. name: '安阳市',
  9964. area: ['北关区', '文峰区', '殷都区', '龙安区', '林州市', '安阳县', '滑县', '内黄县', '汤阴县']
  9965. }, {
  9966. name: '鹤壁市',
  9967. area: ['淇滨区', '山城区', '鹤山区', '浚县', '淇县']
  9968. }, {
  9969. name: '新乡市',
  9970. area: ['卫滨区', '红旗区', '凤泉区', '牧野区', '卫辉市', '辉县市', '新乡县', '获嘉县', '原阳县', '长垣县', '封丘县', '延津县']
  9971. }, {
  9972. name: '焦作市',
  9973. area: ['解放区', '中站区', '马村区', '山阳区', '沁阳市', '孟州市', '修武县', '温县', '武陟县', '博爱县']
  9974. }, {
  9975. name: '濮阳市',
  9976. area: ['华龙区', '濮阳县', '南乐县', '台前县', '清丰县', '范县']
  9977. }, {
  9978. name: '许昌市',
  9979. area: ['魏都区', '禹州市', '长葛市', '许昌县', '鄢陵县', '襄城县']
  9980. }, {
  9981. name: '漯河市',
  9982. area: ['源汇区', '郾城区', '召陵区', '临颍县', '舞阳县']
  9983. }, {
  9984. name: '三门峡市',
  9985. area: ['湖滨区', '义马市', '灵宝市', '渑池县', '卢氏县', '陕县']
  9986. }, {
  9987. name: '南阳市',
  9988. area: ['卧龙区', '宛城区', '邓州市', '桐柏县', '方城县', '淅川县', '镇平县', '唐河县', '南召县', '内乡县', '新野县', '社旗县', '西峡县']
  9989. }, {
  9990. name: '商丘市',
  9991. area: ['梁园区', '睢阳区', '永城市', '宁陵县', '虞城县', '民权县', '夏邑县', '柘城县', '睢县']
  9992. }, {
  9993. name: '信阳市',
  9994. area: ['浉河区', '平桥区', '潢川县', '淮滨县', '息县', '新县', '商城县', '固始县', '罗山县', '光山县']
  9995. }, {
  9996. name: '周口市',
  9997. area: ['川汇区', '项城市', '商水县', '淮阳县', '太康县', '鹿邑县', '西华县', '扶沟县', '沈丘县', '郸城县']
  9998. }, {
  9999. name: '驻马店市',
  10000. area: ['驿城区', '确山县', '新蔡县', '上蔡县', '西平县', '泌阳县', '平舆县', '汝南县', '遂平县', '正阳县']
  10001. }, {
  10002. name: '焦作市',
  10003. area: ['济源市']
  10004. }]
  10005. }, {
  10006. name: '湖北省',
  10007. city: [{
  10008. name: '武汉市',
  10009. area: ['江岸区', '武昌区', '江汉区', '硚口区', '汉阳区', '青山区', '洪山区', '东西湖区', '汉南区', '蔡甸区', '江夏区', '黄陂区', '新洲区']
  10010. }, {
  10011. name: '黄石市',
  10012. area: ['黄石港区', '西塞山区', '下陆区', '铁山区', '大冶市', '阳新县']
  10013. }, {
  10014. name: '十堰市',
  10015. area: ['张湾区', '茅箭区', '丹江口市', '郧县', '竹山县', '房县', '郧西县', '竹溪县']
  10016. }, {
  10017. name: '荆州市',
  10018. area: ['沙市区', '荆州区', '洪湖市', '石首市', '松滋市', '监利县', '公安县', '江陵县']
  10019. }, {
  10020. name: '宜昌市',
  10021. area: ['西陵区', '伍家岗区', '点军区', '猇亭区', '夷陵区', '宜都市', '当阳市', '枝江市', '秭归县', '远安县', '兴山县', '五峰土家族自治县', '长阳土家族自治县']
  10022. }, {
  10023. name: '襄樊市',
  10024. area: ['襄城区', '樊城区', '襄阳区', '老河口市', '枣阳市', '宜城市', '南漳县', '谷城县', '保康县']
  10025. }, {
  10026. name: '鄂州市',
  10027. area: ['鄂城区', '华容区', '梁子湖区']
  10028. }, {
  10029. name: '荆门市',
  10030. area: ['东宝区', '掇刀区', '钟祥市', '京山县', '沙洋县']
  10031. }, {
  10032. name: '孝感市',
  10033. area: ['孝南区', '应城市', '安陆市', '汉川市', '云梦县', '大悟县', '孝昌县']
  10034. }, {
  10035. name: '黄冈市',
  10036. area: ['黄州区', '麻城市', '武穴市', '红安县', '罗田县', '浠水县', '蕲春县', '黄梅县', '英山县', '团风县']
  10037. }, {
  10038. name: '咸宁市',
  10039. area: ['咸安区', '赤壁市', '嘉鱼县', '通山县', '崇阳县', '通城县']
  10040. }, {
  10041. name: '随州市',
  10042. area: ['曾都区', '广水市']
  10043. }, {
  10044. name: '恩施土家族苗族自治州',
  10045. area: ['恩施市', '利川市', '建始县', '来凤县', '巴东县', '鹤峰县', '宣恩县', '咸丰县']
  10046. }, {
  10047. name: '仙桃市',
  10048. area: ['仙桃']
  10049. }, {
  10050. name: '天门市',
  10051. area: ['天门']
  10052. }, {
  10053. name: '潜江市',
  10054. area: ['潜江']
  10055. }, {
  10056. name: '神农架林区',
  10057. area: ['神农架林区']
  10058. }]
  10059. }, {
  10060. name: '湖南省',
  10061. city: [{
  10062. name: '长沙市',
  10063. area: ['岳麓区', '芙蓉区', '天心区', '开福区', '雨花区', '浏阳市', '长沙县', '望城县', '宁乡县']
  10064. }, {
  10065. name: '株洲市',
  10066. area: ['天元区', '荷塘区', '芦淞区', '石峰区', '醴陵市', '株洲县', '炎陵县', '茶陵县', '攸县']
  10067. }, {
  10068. name: '湘潭市',
  10069. area: ['岳塘区', '雨湖区', '湘乡市', '韶山市', '湘潭县']
  10070. }, {
  10071. name: '衡阳市',
  10072. area: ['雁峰区', '珠晖区', '石鼓区', '蒸湘区', '南岳区', '耒阳市', '常宁市', '衡阳县', '衡东县', '衡山县', '衡南县', '祁东县']
  10073. }, {
  10074. name: '邵阳市',
  10075. area: ['双清区', '大祥区', '北塔区', '武冈市', '邵东县', '洞口县', '新邵县', '绥宁县', '新宁县', '邵阳县', '隆回县', '城步苗族自治县']
  10076. }, {
  10077. name: '岳阳市',
  10078. area: ['岳阳楼区', '云溪区', '君山区', '临湘市', '汨罗市', '岳阳县', '湘阴县', '平江县', '华容县']
  10079. }, {
  10080. name: '常德市',
  10081. area: ['武陵区', '鼎城区', '津市市', '澧县', '临澧县', '桃源县', '汉寿县', '安乡县', '石门县']
  10082. }, {
  10083. name: '张家界市',
  10084. area: ['永定区', '武陵源区', '慈利县', '桑植县']
  10085. }, {
  10086. name: '益阳市',
  10087. area: ['赫山区', '资阳区', '沅江市', '桃江县', '南县', '安化县']
  10088. }, {
  10089. name: '郴州市',
  10090. area: ['北湖区', '苏仙区', '资兴市', '宜章县', '汝城县', '安仁县', '嘉禾县', '临武县', '桂东县', '永兴县', '桂阳县']
  10091. }, {
  10092. name: '永州市',
  10093. area: ['冷水滩区', '零陵区', '祁阳县', '蓝山县', '宁远县', '新田县', '东安县', '江永县', '道县', '双牌县', '江华瑶族自治县']
  10094. }, {
  10095. name: '怀化市',
  10096. area: ['鹤城区', '洪江市', '会同县', '沅陵县', '辰溪县', '溆浦县', '中方县', '新晃侗族自治县', '芷江侗族自治县', '通道侗族自治县', '靖州苗族侗族自治县', '麻阳苗族自治县']
  10097. }, {
  10098. name: '娄底市',
  10099. area: ['娄星区', '冷水江市', '涟源市', '新化县', '双峰县']
  10100. }, {
  10101. name: '湘西土家族苗族自治州',
  10102. area: ['吉首市', '古丈县', '龙山县', '永顺县', '凤凰县', '泸溪县', '保靖县', '花垣县']
  10103. }]
  10104. }, {
  10105. name: '广东省',
  10106. city: [{
  10107. name: '广州市',
  10108. area: ['越秀区', '荔湾区', '海珠区', '天河区', '白云区', '黄埔区', '番禺区', '花都区', '南沙区', '萝岗区', '增城市', '从化市']
  10109. }, {
  10110. name: '深圳市',
  10111. area: ['福田区', '罗湖区', '南山区', '宝安区', '龙岗区', '盐田区']
  10112. }, {
  10113. name: '东莞市',
  10114. area: ['莞城', '常平', '塘厦', '塘厦', '塘厦']
  10115. }, {
  10116. name: '中山市',
  10117. area: ['中山']
  10118. }, {
  10119. name: '潮州市',
  10120. area: ['湘桥区', '潮安县', '饶平县']
  10121. }, {
  10122. name: '揭阳市',
  10123. area: ['榕城区', '揭东县', '揭西县', '惠来县', '普宁市']
  10124. }, {
  10125. name: '云浮市',
  10126. area: ['云城区', '新兴县', '郁南县', '云安县', '罗定市']
  10127. }, {
  10128. name: '珠海市',
  10129. area: ['香洲区', '斗门区', '金湾区']
  10130. }, {
  10131. name: '汕头市',
  10132. area: ['金平区', '濠江区', '龙湖区', '潮阳区', '潮南区', '澄海区', '南澳县']
  10133. }, {
  10134. name: '韶关市',
  10135. area: ['浈江区', '武江区', '曲江区', '乐昌市', '南雄市', '始兴县', '仁化县', '翁源县', '新丰县', '乳源瑶族自治县']
  10136. }, {
  10137. name: '佛山市',
  10138. area: ['禅城区', '南海区', '顺德区', '三水区', '高明区']
  10139. }, {
  10140. name: '江门市',
  10141. area: ['蓬江区', '江海区', '新会区', '恩平市', '台山市', '开平市', '鹤山市']
  10142. }, {
  10143. name: '湛江市',
  10144. area: ['赤坎区', '霞山区', '坡头区', '麻章区', '吴川市', '廉江市', '雷州市', '遂溪县', '徐闻县']
  10145. }, {
  10146. name: '茂名市',
  10147. area: ['茂南区', '茂港区', '化州市', '信宜市', '高州市', '电白县']
  10148. }, {
  10149. name: '肇庆市',
  10150. area: ['端州区', '鼎湖区', '高要市', '四会市', '广宁县', '怀集县', '封开县', '德庆县']
  10151. }, {
  10152. name: '惠州市',
  10153. area: ['惠城区', '惠阳区', '博罗县', '惠东县', '龙门县']
  10154. }, {
  10155. name: '梅州市',
  10156. area: ['梅江区', '兴宁市', '梅县', '大埔县', '丰顺县', '五华县', '平远县', '蕉岭县']
  10157. }, {
  10158. name: '汕尾市',
  10159. area: ['城区', '陆丰市', '海丰县', '陆河县']
  10160. }, {
  10161. name: '河源市',
  10162. area: ['源城区', '紫金县', '龙川县', '连平县', '和平县', '东源县']
  10163. }, {
  10164. name: '阳江市',
  10165. area: ['江城区', '阳春市', '阳西县', '阳东县']
  10166. }, {
  10167. name: '清远市',
  10168. area: ['清城区', '英德市', '连州市', '佛冈县', '阳山县', '清新县', '连山壮族瑶族自治县', '连南瑶族自治县']
  10169. }]
  10170. }, {
  10171. name: '广西',
  10172. city: [{
  10173. name: '南宁市',
  10174. area: ['青秀区', '兴宁区', '西乡塘区', '良庆区', '江南区', '邕宁区', '武鸣县', '隆安县', '马山县', '上林县', '宾阳县', '横县']
  10175. }, {
  10176. name: '柳州市',
  10177. area: ['城中区', '鱼峰区', '柳北区', '柳南区', '柳江县', '柳城县', '鹿寨县', '融安县', '融水苗族自治县', '三江侗族自治县']
  10178. }, {
  10179. name: '桂林市',
  10180. area: ['象山区', '秀峰区', '叠彩区', '七星区', '雁山区', '阳朔县', '临桂县', '灵川县', '全州县', '平乐县', '兴安县', '灌阳县', '荔浦县', '资源县', '永福县', '龙胜各族自治县', '恭城瑶族自治县']
  10181. }, {
  10182. name: '梧州市',
  10183. area: ['万秀区', '蝶山区', '长洲区', '岑溪市', '苍梧县', '藤县', '蒙山县']
  10184. }, {
  10185. name: '北海市',
  10186. area: ['海城区', '银海区', '铁山港区', '合浦县']
  10187. }, {
  10188. name: '防城港市',
  10189. area: ['港口区', '防城区', '东兴市', '上思县']
  10190. }, {
  10191. name: '钦州市',
  10192. area: ['钦南区', '钦北区', '灵山县', '浦北县']
  10193. }, {
  10194. name: '贵港市',
  10195. area: ['港北区', '港南区', '覃塘区', '桂平市', '平南县']
  10196. }, {
  10197. name: '玉林市',
  10198. area: ['玉州区', '北流市', '容县', '陆川县', '博白县', '兴业县']
  10199. }, {
  10200. name: '百色市',
  10201. area: ['右江区', '凌云县', '平果县', '西林县', '乐业县', '德保县', '田林县', '田阳县', '靖西县', '田东县', '那坡县', '隆林各族自治县']
  10202. }, {
  10203. name: '贺州市',
  10204. area: ['八步区', '钟山县', '昭平县', '富川瑶族自治县']
  10205. }, {
  10206. name: '河池市',
  10207. area: ['金城江区', '宜州市', '天峨县', '凤山县', '南丹县', '东兰县', '都安瑶族自治县', '罗城仫佬族自治县', '巴马瑶族自治县', '环江毛南族自治县', '大化瑶族自治县']
  10208. }, {
  10209. name: '来宾市',
  10210. area: ['兴宾区', '合山市', '象州县', '武宣县', '忻城县', '金秀瑶族自治县']
  10211. }, {
  10212. name: '崇左市',
  10213. area: ['江州区', '凭祥市', '宁明县', '扶绥县', '龙州县', '大新县', '天等县']
  10214. }]
  10215. }, {
  10216. name: '海南省',
  10217. city: [{
  10218. name: '海口市',
  10219. area: ['龙华区', '秀英区', '琼山区', '美兰区']
  10220. }, {
  10221. name: '三亚市',
  10222. area: ['三亚市']
  10223. }, {
  10224. name: '五指山市',
  10225. area: ['五指山']
  10226. }, {
  10227. name: '琼海市',
  10228. area: ['琼海']
  10229. }, {
  10230. name: '儋州市',
  10231. area: ['儋州']
  10232. }, {
  10233. name: '文昌市',
  10234. area: ['文昌']
  10235. }, {
  10236. name: '万宁市',
  10237. area: ['万宁']
  10238. }, {
  10239. name: '东方市',
  10240. area: ['东方']
  10241. }, {
  10242. name: '澄迈县',
  10243. area: ['澄迈县']
  10244. }, {
  10245. name: '定安县',
  10246. area: ['定安县']
  10247. }, {
  10248. name: '屯昌县',
  10249. area: ['屯昌县']
  10250. }, {
  10251. name: '临高县',
  10252. area: ['临高县']
  10253. }, {
  10254. name: '白沙黎族自治县',
  10255. area: ['白沙黎族自治县']
  10256. }, {
  10257. name: '昌江黎族自治县',
  10258. area: ['昌江黎族自治县']
  10259. }, {
  10260. name: '乐东黎族自治县',
  10261. area: ['乐东黎族自治县']
  10262. }, {
  10263. name: '陵水黎族自治县',
  10264. area: ['陵水黎族自治县']
  10265. }, {
  10266. name: '保亭黎族苗族自治县',
  10267. area: ['保亭黎族苗族自治县']
  10268. }, {
  10269. name: '琼中黎族苗族自治县',
  10270. area: ['琼中黎族苗族自治县']
  10271. }]
  10272. }, {
  10273. name: '重庆市',
  10274. city: [{
  10275. name: '重庆市',
  10276. area: ['渝中区', '大渡口区', '江北区', '南岸区', '北碚区', '渝北区', '巴南区', '长寿区', '双桥区', '沙坪坝区', '万盛区', '万州区', '涪陵区', '黔江区', '永川区', '合川区', '江津区', '九龙坡区', '南川区', '綦江县', '潼南县', '荣昌县', '璧山县', '大足县', '铜梁县', '梁平县', '开县', '忠县', '城口县', '垫江县', '武隆县', '丰都县', '奉节县', '云阳县', '巫溪县', '巫山县', '石柱土家族自治县', '秀山土家族苗族自治县', '酉阳土家族苗族自治县', '彭水苗族土家族自治县']
  10277. }]
  10278. }, {
  10279. name: '四川省',
  10280. city: [{
  10281. name: '成都市',
  10282. area: ['青羊区', '锦江区', '金牛区', '武侯区', '成华区', '龙泉驿区', '青白江区', '新都区', '温江区', '都江堰市', '彭州市', '邛崃市', '崇州市', '金堂县', '郫县', '新津县', '双流县', '蒲江县', '大邑县']
  10283. }, {
  10284. name: '自贡市',
  10285. area: ['大安区', '自流井区', '贡井区', '沿滩区', '荣县', '富顺县']
  10286. }, {
  10287. name: '攀枝花市',
  10288. area: ['仁和区', '米易县', '盐边县', '东区', '西区']
  10289. }, {
  10290. name: '泸州市',
  10291. area: ['江阳区', '纳溪区', '龙马潭区', '泸县', '合江县', '叙永县', '古蔺县']
  10292. }, {
  10293. name: '德阳市',
  10294. area: ['旌阳区', '广汉市', '什邡市', '绵竹市', '罗江县', '中江县']
  10295. }, {
  10296. name: '绵阳市',
  10297. area: ['涪城区', '游仙区', '江油市', '盐亭县', '三台县', '平武县', '安县', '梓潼县', '北川羌族自治县']
  10298. }, {
  10299. name: '广元市',
  10300. area: ['元坝区', '朝天区', '青川县', '旺苍县', '剑阁县', '苍溪县', '市中区']
  10301. }, {
  10302. name: '遂宁市',
  10303. area: ['船山区', '安居区', '射洪县', '蓬溪县', '大英县']
  10304. }, {
  10305. name: '内江市',
  10306. area: ['市中区', '东兴区', '资中县', '隆昌县', '威远县']
  10307. }, {
  10308. name: '乐山市',
  10309. area: ['市中区', '五通桥区', '沙湾区', '金口河区', '峨眉山市', '夹江县', '井研县', '犍为县', '沐川县', '马边彝族自治县', '峨边彝族自治县']
  10310. }, {
  10311. name: '南充',
  10312. area: ['顺庆区', '高坪区', '嘉陵区', '阆中市', '营山县', '蓬安县', '仪陇县', '南部县', '西充县']
  10313. }, {
  10314. name: '眉山市',
  10315. area: ['东坡区', '仁寿县', '彭山县', '洪雅县', '丹棱县', '青神县']
  10316. }, {
  10317. name: '宜宾市',
  10318. area: ['翠屏区', '宜宾县', '兴文县', '南溪县', '珙县', '长宁县', '高县', '江安县', '筠连县', '屏山县']
  10319. }, {
  10320. name: '广安市',
  10321. area: ['广安区', '华蓥市', '岳池县', '邻水县', '武胜县']
  10322. }, {
  10323. name: '达州市',
  10324. area: ['通川区', '万源市', '达县', '渠县', '宣汉县', '开江县', '大竹县']
  10325. }, {
  10326. name: '雅安市',
  10327. area: ['雨城区', '芦山县', '石棉县', '名山县', '天全县', '荥经县', '宝兴县', '汉源县']
  10328. }, {
  10329. name: '巴中市',
  10330. area: ['巴州区', '南江县', '平昌县', '通江县']
  10331. }, {
  10332. name: '资阳市',
  10333. area: ['雁江区', '简阳市', '安岳县', '乐至县']
  10334. }, {
  10335. name: '阿坝藏族羌族自治州',
  10336. area: ['马尔康县', '九寨沟县', '红原县', '汶川县', '阿坝县', '理县', '若尔盖县', '小金县', '黑水县', '金川县', '松潘县', '壤塘县', '茂县']
  10337. }, {
  10338. name: '甘孜藏族自治州',
  10339. area: ['康定县', '丹巴县', '炉霍县', '九龙县', '甘孜县', '雅江县', '新龙县', '道孚县', '白玉县', '理塘县', '德格县', '乡城县', '石渠县', '稻城县', '色达县', '巴塘县', '泸定县', '得荣县']
  10340. }, {
  10341. name: '凉山彝族自治州',
  10342. area: ['西昌市', '美姑县', '昭觉县', '金阳县', '甘洛县', '布拖县', '雷波县', '普格县', '宁南县', '喜德县', '会东县', '越西县', '会理县', '盐源县', '德昌县', '冕宁县', '木里藏族自治县']
  10343. }]
  10344. }, {
  10345. name: '贵州省',
  10346. city: [{
  10347. name: '贵阳市',
  10348. area: ['南明区', '云岩区', '花溪区', '乌当区', '白云区', '小河区', '清镇市', '开阳县', '修文县', '息烽县']
  10349. }, {
  10350. name: '六盘水市',
  10351. area: ['钟山区', '水城县', '盘县', '六枝特区']
  10352. }, {
  10353. name: '遵义市',
  10354. area: ['红花岗区', '汇川区', '赤水市', '仁怀市', '遵义县', '绥阳县', '桐梓县', '习水县', '凤冈县', '正安县', '余庆县', '湄潭县', '道真仡佬族苗族自治县', '务川仡佬族苗族自治县']
  10355. }, {
  10356. name: '安顺市',
  10357. area: ['西秀区', '普定县', '平坝县', '镇宁布依族苗族自治县', '紫云苗族布依族自治县', '关岭布依族苗族自治县']
  10358. }, {
  10359. name: '铜仁地区',
  10360. area: ['铜仁市', '德江县', '江口县', '思南县', '石阡县', '玉屏侗族自治县', '松桃苗族自治县', '印江土家族苗族自治县', '沿河土家族自治县', '万山特区']
  10361. }, {
  10362. name: '毕节地区',
  10363. area: ['毕节市', '黔西县', '大方县', '织金县', '金沙县', '赫章县', '纳雍县', '威宁彝族回族苗族自治县']
  10364. }, {
  10365. name: '黔西南布依族苗族自治州',
  10366. area: ['兴义市', '望谟县', '兴仁县', '普安县', '册亨县', '晴隆县', '贞丰县', '安龙县']
  10367. }, {
  10368. name: '黔东南苗族侗族自治州',
  10369. area: ['凯里市', '施秉县', '从江县', '锦屏县', '镇远县', '麻江县', '台江县', '天柱县', '黄平县', '榕江县', '剑河县', '三穗县', '雷山县', '黎平县', '岑巩县', '丹寨县']
  10370. }, {
  10371. name: '黔南布依族苗族自治州',
  10372. area: ['都匀市', '福泉市', '贵定县', '惠水县', '罗甸县', '瓮安县', '荔波县', '龙里县', '平塘县', '长顺县', '独山县', '三都水族自治县']
  10373. }]
  10374. }, {
  10375. name: '云南省',
  10376. city: [{
  10377. name: '昆明市',
  10378. area: ['盘龙区', '五华区', '官渡区', '西山区', '东川区', '安宁市', '呈贡县', '晋宁县', '富民县', '宜良县', '嵩明县', '石林彝族自治县', '禄劝彝族苗族自治县', '寻甸回族彝族自治县']
  10379. }, {
  10380. name: '曲靖市',
  10381. area: ['麒麟区', '宣威市', '马龙县', '沾益县', '富源县', '罗平县', '师宗县', '陆良县', '会泽县']
  10382. }, {
  10383. name: '玉溪市',
  10384. area: ['红塔区', '江川县', '澄江县', '通海县', '华宁县', '易门县', '峨山彝族自治县', '新平彝族傣族自治县', '元江哈尼族彝族傣族自治县']
  10385. }, {
  10386. name: '保山市',
  10387. area: ['隆阳区', '施甸县', '腾冲县', '龙陵县', '昌宁县']
  10388. }, {
  10389. name: '昭通市',
  10390. area: ['昭阳区', '鲁甸县', '巧家县', '盐津县', '大关县', '永善县', '绥江县', '镇雄县', '彝良县', '威信县', '水富县']
  10391. }, {
  10392. name: '丽江市',
  10393. area: ['古城区', '永胜县', '华坪县', '玉龙纳西族自治县', '宁蒗彝族自治县']
  10394. }, {
  10395. name: '普洱市',
  10396. area: ['思茅区', '普洱哈尼族彝族自治县', '墨江哈尼族自治县', '景东彝族自治县', '景谷傣族彝族自治县', '镇沅彝族哈尼族拉祜族自治县', '江城哈尼族彝族自治县', '孟连傣族拉祜族佤族自治县', '澜沧拉祜族自治县', '西盟佤族自治县']
  10397. }, {
  10398. name: '临沧市',
  10399. area: ['临翔区', '凤庆县', '云县', '永德县', '镇康县', '双江拉祜族佤族布朗族傣族自治县', '耿马傣族佤族自治县', '沧源佤族自治县']
  10400. }, {
  10401. name: '德宏傣族景颇族自治州',
  10402. area: ['潞西市', '瑞丽市', '梁河县', '盈江县', '陇川县']
  10403. }, {
  10404. name: '怒江傈僳族自治州',
  10405. area: ['泸水县', '福贡县', '贡山独龙族怒族自治县', '兰坪白族普米族自治县']
  10406. }, {
  10407. name: '迪庆藏族自治州',
  10408. area: ['香格里拉县', '德钦县', '维西傈僳族自治县']
  10409. }, {
  10410. name: '大理白族自治州',
  10411. area: ['大理市', '祥云县', '宾川县', '弥渡县', '永平县', '云龙县', '洱源县', '剑川县', '鹤庆县', '漾濞彝族自治县', '南涧彝族自治县', '巍山彝族回族自治县']
  10412. }, {
  10413. name: '楚雄彝族自治州',
  10414. area: ['楚雄市', '双柏县', '牟定县', '南华县', '姚安县', '大姚县', '永仁县', '元谋县', '武定县', '禄丰县']
  10415. }, {
  10416. name: '红河哈尼族彝族自治州',
  10417. area: ['蒙自县', '个旧市', '开远市', '绿春县', '建水县', '石屏县', '弥勒县', '泸西县', '元阳县', '红河县', '金平苗族瑶族傣族自治县', '河口瑶族自治县', '屏边苗族自治县']
  10418. }, {
  10419. name: '文山壮族苗族自治州',
  10420. area: ['文山县', '砚山县', '西畴县', '麻栗坡县', '马关县', '丘北县', '广南县', '富宁县']
  10421. }, {
  10422. name: '西双版纳傣族自治州',
  10423. area: ['景洪市', '勐海县', '勐腊县']
  10424. }]
  10425. }, {
  10426. name: '西藏',
  10427. city: [{
  10428. name: '拉萨市',
  10429. area: ['城关区', '林周县', '当雄县', '尼木县', '曲水县', '堆龙德庆县', '达孜县', '墨竹工卡县']
  10430. }, {
  10431. name: '那曲地区',
  10432. area: ['那曲县', '嘉黎县', '比如县', '聂荣县', '安多县', '申扎县', '索县', '班戈县', '巴青县', '尼玛县']
  10433. }, {
  10434. name: '昌都地区',
  10435. area: ['昌都县', '江达县', '贡觉县', '类乌齐县', '丁青县', '察雅县', '八宿县', '左贡县', '芒康县', '洛隆县', '边坝县']
  10436. }, {
  10437. name: '林芝地区',
  10438. area: ['林芝县', '工布江达县', '米林县', '墨脱县', '波密县', '察隅县', '朗县']
  10439. }, {
  10440. name: '山南地区',
  10441. area: ['乃东县', '扎囊县', '贡嘎县', '桑日县', '琼结县', '曲松县', '措美县', '洛扎县', '加查县', '隆子县', '错那县', '浪卡子县']
  10442. }, {
  10443. name: '日喀则地区',
  10444. area: ['日喀则市', '南木林县', '江孜县', '定日县', '萨迦县', '拉孜县', '昂仁县', '谢通门县', '白朗县', '仁布县', '康马县', '定结县', '仲巴县', '亚东县', '吉隆县', '聂拉木县', '萨嘎县', '岗巴县']
  10445. }, {
  10446. name: '阿里地区',
  10447. area: ['噶尔县', '普兰县', '札达县', '日土县', '革吉县', '改则县', '措勤县']
  10448. }]
  10449. }, {
  10450. name: '陕西省',
  10451. city: [{
  10452. name: '西安市',
  10453. area: ['莲湖区', '新城区', '碑林区', '雁塔区', '灞桥区', '未央区', '阎良区', '临潼区', '长安区', '高陵县', '蓝田县', '户县', '周至县']
  10454. }, {
  10455. name: '铜川市',
  10456. area: ['耀州区', '王益区', '印台区', '宜君县']
  10457. }, {
  10458. name: '宝鸡市',
  10459. area: ['渭滨区', '金台区', '陈仓区', '岐山县', '凤翔县', '陇县', '太白县', '麟游县', '扶风县', '千阳县', '眉县', '凤县']
  10460. }, {
  10461. name: '咸阳市',
  10462. area: ['秦都区', '渭城区', '杨陵区', '兴平市', '礼泉县', '泾阳县', '永寿县', '三原县', '彬县', '旬邑县', '长武县', '乾县', '武功县', '淳化县']
  10463. }, {
  10464. name: '渭南市',
  10465. area: ['临渭区', '韩城市', '华阴市', '蒲城县', '潼关县', '白水县', '澄城县', '华县', '合阳县', '富平县', '大荔县']
  10466. }, {
  10467. name: '延安市',
  10468. area: ['宝塔区', '安塞县', '洛川县', '子长县', '黄陵县', '延川县', '富县', '延长县', '甘泉县', '宜川县', '志丹县', '黄龙县', '吴起县']
  10469. }, {
  10470. name: '汉中市',
  10471. area: ['汉台区', '留坝县', '镇巴县', '城固县', '南郑县', '洋县', '宁强县', '佛坪县', '勉县', '西乡县', '略阳县']
  10472. }, {
  10473. name: '榆林市',
  10474. area: ['榆阳区', '清涧县', '绥德县', '神木县', '佳县', '府谷县', '子洲县', '靖边县', '横山县', '米脂县', '吴堡县', '定边县']
  10475. }, {
  10476. name: '安康市',
  10477. area: ['汉滨区', '紫阳县', '岚皋县', '旬阳县', '镇坪县', '平利县', '石泉县', '宁陕县', '白河县', '汉阴县']
  10478. }, {
  10479. name: '商洛市',
  10480. area: ['商州区', '镇安县', '山阳县', '洛南县', '商南县', '丹凤县', '柞水县']
  10481. }]
  10482. }, {
  10483. name: '甘肃省',
  10484. city: [{
  10485. name: '兰州市',
  10486. area: ['城关区', '七里河区', '西固区', '安宁区', '红古区', '永登县', '皋兰县', '榆中县']
  10487. }, {
  10488. name: '嘉峪关市',
  10489. area: ['嘉峪关市']
  10490. }, {
  10491. name: '金昌市',
  10492. area: ['金川区', '永昌县']
  10493. }, {
  10494. name: '白银市',
  10495. area: ['白银区', '平川区', '靖远县', '会宁县', '景泰县']
  10496. }, {
  10497. name: '天水市',
  10498. area: ['清水县', '秦安县', '甘谷县', '武山县', '张家川回族自治县', '北道区', '秦城区']
  10499. }, {
  10500. name: '武威市',
  10501. area: ['凉州区', '民勤县', '古浪县', '天祝藏族自治县']
  10502. }, {
  10503. name: '酒泉市',
  10504. area: ['肃州区', '玉门市', '敦煌市', '金塔县', '肃北蒙古族自治县', '阿克塞哈萨克族自治县', '安西县']
  10505. }, {
  10506. name: '张掖市',
  10507. area: ['甘州区', '民乐县', '临泽县', '高台县', '山丹县', '肃南裕固族自治县']
  10508. }, {
  10509. name: '庆阳市',
  10510. area: ['西峰区', '庆城县', '环县', '华池县', '合水县', '正宁县', '宁县', '镇原县']
  10511. }, {
  10512. name: '平凉市',
  10513. area: ['崆峒区', '泾川县', '灵台县', '崇信县', '华亭县', '庄浪县', '静宁县']
  10514. }, {
  10515. name: '定西市',
  10516. area: ['安定区', '通渭县', '临洮县', '漳县', '岷县', '渭源县', '陇西县']
  10517. }, {
  10518. name: '陇南市',
  10519. area: ['武都区', '成县', '宕昌县', '康县', '文县', '西和县', '礼县', '两当县', '徽县']
  10520. }, {
  10521. name: '临夏回族自治州',
  10522. area: ['临夏市', '临夏县', '康乐县', '永靖县', '广河县', '和政县', '东乡族自治县', '积石山保安族东乡族撒拉族自治县']
  10523. }, {
  10524. name: '甘南藏族自治州',
  10525. area: ['合作市', '临潭县', '卓尼县', '舟曲县', '迭部县', '玛曲县', '碌曲县', '夏河县']
  10526. }]
  10527. }, {
  10528. name: '青海省',
  10529. city: [{
  10530. name: '西宁市',
  10531. area: ['城中区', '城东区', '城西区', '城北区', '湟源县', '湟中县', '大通回族土族自治县']
  10532. }, {
  10533. name: '海东地区',
  10534. area: ['平安县', '乐都县', '民和回族土族自治县', '互助土族自治县', '化隆回族自治县', '循化撒拉族自治县']
  10535. }, {
  10536. name: '海北藏族自治州',
  10537. area: ['海晏县', '祁连县', '刚察县', '门源回族自治县']
  10538. }, {
  10539. name: '海南藏族自治州',
  10540. area: ['共和县', '同德县', '贵德县', '兴海县', '贵南县']
  10541. }, {
  10542. name: '黄南藏族自治州',
  10543. area: ['同仁县', '尖扎县', '泽库县', '河南蒙古族自治县']
  10544. }, {
  10545. name: '果洛藏族自治州',
  10546. area: ['玛沁县', '班玛县', '甘德县', '达日县', '久治县', '玛多县']
  10547. }, {
  10548. name: '玉树藏族自治州',
  10549. area: ['玉树县', '杂多县', '称多县', '治多县', '囊谦县', '曲麻莱县']
  10550. }, {
  10551. name: '海西蒙古族藏族自治州',
  10552. area: ['德令哈市', '格尔木市', '乌兰县', '都兰县', '天峻县']
  10553. }]
  10554. }, {
  10555. name: '宁夏',
  10556. city: [{
  10557. name: '银川市',
  10558. area: ['兴庆区', '西夏区', '金凤区', '灵武市', '永宁县', '贺兰县']
  10559. }, {
  10560. name: '石嘴山市',
  10561. area: ['大武口区', '惠农区', '平罗县']
  10562. }, {
  10563. name: '吴忠市',
  10564. area: ['利通区', '青铜峡市', '盐池县', '同心县']
  10565. }, {
  10566. name: '固原市',
  10567. area: ['原州区', '西吉县', '隆德县', '泾源县', '彭阳县']
  10568. }, {
  10569. name: '中卫市',
  10570. area: ['沙坡头区', '中宁县', '海原县']
  10571. }]
  10572. }, {
  10573. name: '新疆',
  10574. city: [{
  10575. name: '乌鲁木齐市',
  10576. area: ['天山区', '沙依巴克区', '新市区', '水磨沟区', '头屯河区', '达坂城区', '东山区', '乌鲁木齐县']
  10577. }, {
  10578. name: '克拉玛依市',
  10579. area: ['克拉玛依区', '独山子区', '白碱滩区', '乌尔禾区']
  10580. }, {
  10581. name: '吐鲁番地区',
  10582. area: ['吐鲁番市', '托克逊县', '鄯善县']
  10583. }, {
  10584. name: '哈密地区',
  10585. area: ['哈密市', '伊吾县', '巴里坤哈萨克自治县']
  10586. }, {
  10587. name: '和田地区',
  10588. area: ['和田市', '和田县', '洛浦县', '民丰县', '皮山县', '策勒县', '于田县', '墨玉县']
  10589. }, {
  10590. name: '阿克苏地区',
  10591. area: ['阿克苏市', '温宿县', '沙雅县', '拜城县', '阿瓦提县', '库车县', '柯坪县', '新和县', '乌什县']
  10592. }, {
  10593. name: '喀什地区',
  10594. area: ['喀什市', '巴楚县', '泽普县', '伽师县', '叶城县', '岳普湖县', '疏勒县', '麦盖提县', '英吉沙县', '莎车县', '疏附县', '塔什库尔干塔吉克自治县']
  10595. }, {
  10596. name: '克孜勒苏柯尔克孜自治州',
  10597. area: ['阿图什市', '阿合奇县', '乌恰县', '阿克陶县']
  10598. }, {
  10599. name: '巴音郭楞蒙古自治州',
  10600. area: ['库尔勒市', '和静县', '尉犁县', '和硕县', '且末县', '博湖县', '轮台县', '若羌县', '焉耆回族自治县']
  10601. }, {
  10602. name: '昌吉回族自治州',
  10603. area: ['昌吉市', '阜康市', '奇台县', '玛纳斯县', '吉木萨尔县', '呼图壁县', '木垒哈萨克自治县', '米泉市']
  10604. }, {
  10605. name: '博尔塔拉蒙古自治州',
  10606. area: ['博乐市', '精河县', '温泉县']
  10607. }, {
  10608. name: '石河子',
  10609. area: ['石河子']
  10610. }, {
  10611. name: '阿拉尔',
  10612. area: ['阿拉尔']
  10613. }, {
  10614. name: '图木舒克',
  10615. area: ['图木舒克']
  10616. }, {
  10617. name: '五家渠',
  10618. area: ['五家渠']
  10619. }, {
  10620. name: '伊犁哈萨克自治州',
  10621. area: ['伊宁市', '奎屯市', '伊宁县', '特克斯县', '尼勒克县', '昭苏县', '新源县', '霍城县', '巩留县', '察布查尔锡伯自治县', '塔城地区', '阿勒泰地区']
  10622. }]
  10623. }, {
  10624. name: '台湾省',
  10625. city: [{
  10626. name: '台北市',
  10627. area: ['内湖区', '南港区', '中正区', '万华区', '大同区', '中山区', '松山区', '大安区', '信义区', '文山区', '士林区', '北投区']
  10628. }, {
  10629. name: '新北市',
  10630. area: ['板桥区', '汐止区', '新店区']
  10631. }, {
  10632. name: '桃园市',
  10633. area: ['其他']
  10634. }, {
  10635. name: '台中市',
  10636. area: ['其他']
  10637. }, {
  10638. name: '台南市',
  10639. area: ['其他']
  10640. }, {
  10641. name: '高雄市',
  10642. area: ['其他']
  10643. }]
  10644. }, {
  10645. name: '澳门',
  10646. city: [{
  10647. name: '澳门',
  10648. area: ['花地玛堂区', '圣安多尼堂区', '大堂区', '望德堂区', '风顺堂区', '嘉模堂区', '圣方济各堂区', '路凼']
  10649. }]
  10650. }, {
  10651. name: '香港',
  10652. city: [{
  10653. name: '香港',
  10654. area: ['深水埗区', '油尖旺区', '九龙城区', '黄大仙区', '观塘区', '北区', '大埔区', '沙田区', '西贡区', '元朗区', '屯门区', '荃湾区', '葵青区', '离岛区', '中西区', '湾仔区', '东区', '南区']
  10655. }]
  10656. }],
  10657. debug: true
  10658. };
  10659. exports.default = _default;
  10660. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10661. /***/ }),
  10662. /***/ 38:
  10663. /*!*****************************************************!*\
  10664. !*** D:/project/material_applet/common/computed.js ***!
  10665. \*****************************************************/
  10666. /*! no static exports found */
  10667. /***/ (function(module, exports, __webpack_require__) {
  10668. "use strict";
  10669. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10670. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  10671. var _decimal = _interopRequireDefault(__webpack_require__(/*! decimal.js */ 39));
  10672. var toNumber = function toNumber(num) {
  10673. return new _decimal.default(num).toNumber();
  10674. };
  10675. var plus = function plus() {
  10676. var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10677. var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  10678. var number1 = new _decimal.default(n1);
  10679. var number2 = new _decimal.default(n2);
  10680. var result = number1.add(number2);
  10681. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  10682. return toNumber(result);
  10683. };
  10684. var minus = function minus() {
  10685. var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10686. var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  10687. var number1 = new _decimal.default(n1);
  10688. var number2 = new _decimal.default(n2);
  10689. var result = number1.minus(number2);
  10690. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  10691. return toNumber(result);
  10692. };
  10693. var multiply = function multiply() {
  10694. var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10695. var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  10696. var number1 = new _decimal.default(n1);
  10697. var number2 = new _decimal.default(n2);
  10698. var result = number1.mul(number2);
  10699. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  10700. return toNumber(result);
  10701. };
  10702. var divide = function divide() {
  10703. var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10704. var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  10705. var number1 = new _decimal.default(n1);
  10706. var number2 = new _decimal.default(n2);
  10707. var result = number1.div(number2);
  10708. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  10709. return toNumber(result);
  10710. };
  10711. _vue.default.prototype.$plus = plus;
  10712. _vue.default.prototype.$minus = minus;
  10713. _vue.default.prototype.$multiply = multiply;
  10714. _vue.default.prototype.$divide = divide;
  10715. /***/ }),
  10716. /***/ 39:
  10717. /*!*********************************************************************!*\
  10718. !*** D:/project/material_applet/node_modules/decimal.js/decimal.js ***!
  10719. \*********************************************************************/
  10720. /*! no static exports found */
  10721. /***/ (function(module, exports, __webpack_require__) {
  10722. var __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  10723. ;
  10724. (function (globalScope) {
  10725. 'use strict';
  10726. /*!
  10727. * decimal.js v10.4.3
  10728. * An arbitrary-precision Decimal type for JavaScript.
  10729. * https://github.com/MikeMcl/decimal.js
  10730. * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
  10731. * MIT Licence
  10732. */
  10733. // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //
  10734. // The maximum exponent magnitude.
  10735. // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.
  10736. var EXP_LIMIT = 9e15,
  10737. // 0 to 9e15
  10738. // The limit on the value of `precision`, and on the value of the first argument to
  10739. // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.
  10740. MAX_DIGITS = 1e9,
  10741. // 0 to 1e9
  10742. // Base conversion alphabet.
  10743. NUMERALS = '0123456789abcdef',
  10744. // The natural logarithm of 10 (1025 digits).
  10745. LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',
  10746. // Pi (1025 digits).
  10747. PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',
  10748. // The initial configuration properties of the Decimal constructor.
  10749. DEFAULTS = {
  10750. // These values must be integers within the stated ranges (inclusive).
  10751. // Most of these values can be changed at run-time using the `Decimal.config` method.
  10752. // The maximum number of significant digits of the result of a calculation or base conversion.
  10753. // E.g. `Decimal.config({ precision: 20 });`
  10754. precision: 20,
  10755. // 1 to MAX_DIGITS
  10756. // The rounding mode used when rounding to `precision`.
  10757. //
  10758. // ROUND_UP 0 Away from zero.
  10759. // ROUND_DOWN 1 Towards zero.
  10760. // ROUND_CEIL 2 Towards +Infinity.
  10761. // ROUND_FLOOR 3 Towards -Infinity.
  10762. // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
  10763. // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
  10764. // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
  10765. // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
  10766. // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
  10767. //
  10768. // E.g.
  10769. // `Decimal.rounding = 4;`
  10770. // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
  10771. rounding: 4,
  10772. // 0 to 8
  10773. // The modulo mode used when calculating the modulus: a mod n.
  10774. // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
  10775. // The remainder (r) is calculated as: r = a - n * q.
  10776. //
  10777. // UP 0 The remainder is positive if the dividend is negative, else is negative.
  10778. // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
  10779. // FLOOR 3 The remainder has the same sign as the divisor (Python %).
  10780. // HALF_EVEN 6 The IEEE 754 remainder function.
  10781. // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
  10782. //
  10783. // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
  10784. // division (9) are commonly used for the modulus operation. The other rounding modes can also
  10785. // be used, but they may not give useful results.
  10786. modulo: 1,
  10787. // 0 to 9
  10788. // The exponent value at and beneath which `toString` returns exponential notation.
  10789. // JavaScript numbers: -7
  10790. toExpNeg: -7,
  10791. // 0 to -EXP_LIMIT
  10792. // The exponent value at and above which `toString` returns exponential notation.
  10793. // JavaScript numbers: 21
  10794. toExpPos: 21,
  10795. // 0 to EXP_LIMIT
  10796. // The minimum exponent value, beneath which underflow to zero occurs.
  10797. // JavaScript numbers: -324 (5e-324)
  10798. minE: -EXP_LIMIT,
  10799. // -1 to -EXP_LIMIT
  10800. // The maximum exponent value, above which overflow to Infinity occurs.
  10801. // JavaScript numbers: 308 (1.7976931348623157e+308)
  10802. maxE: EXP_LIMIT,
  10803. // 1 to EXP_LIMIT
  10804. // Whether to use cryptographically-secure random number generation, if available.
  10805. crypto: false // true/false
  10806. },
  10807. // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //
  10808. Decimal,
  10809. inexact,
  10810. noConflict,
  10811. quadrant,
  10812. external = true,
  10813. decimalError = '[DecimalError] ',
  10814. invalidArgument = decimalError + 'Invalid argument: ',
  10815. precisionLimitExceeded = decimalError + 'Precision limit exceeded',
  10816. cryptoUnavailable = decimalError + 'crypto unavailable',
  10817. tag = '[object Decimal]',
  10818. mathfloor = Math.floor,
  10819. mathpow = Math.pow,
  10820. isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,
  10821. isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,
  10822. isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,
  10823. isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
  10824. BASE = 1e7,
  10825. LOG_BASE = 7,
  10826. MAX_SAFE_INTEGER = 9007199254740991,
  10827. LN10_PRECISION = LN10.length - 1,
  10828. PI_PRECISION = PI.length - 1,
  10829. // Decimal.prototype object
  10830. P = {
  10831. toStringTag: tag
  10832. };
  10833. // Decimal prototype methods
  10834. /*
  10835. * absoluteValue abs
  10836. * ceil
  10837. * clampedTo clamp
  10838. * comparedTo cmp
  10839. * cosine cos
  10840. * cubeRoot cbrt
  10841. * decimalPlaces dp
  10842. * dividedBy div
  10843. * dividedToIntegerBy divToInt
  10844. * equals eq
  10845. * floor
  10846. * greaterThan gt
  10847. * greaterThanOrEqualTo gte
  10848. * hyperbolicCosine cosh
  10849. * hyperbolicSine sinh
  10850. * hyperbolicTangent tanh
  10851. * inverseCosine acos
  10852. * inverseHyperbolicCosine acosh
  10853. * inverseHyperbolicSine asinh
  10854. * inverseHyperbolicTangent atanh
  10855. * inverseSine asin
  10856. * inverseTangent atan
  10857. * isFinite
  10858. * isInteger isInt
  10859. * isNaN
  10860. * isNegative isNeg
  10861. * isPositive isPos
  10862. * isZero
  10863. * lessThan lt
  10864. * lessThanOrEqualTo lte
  10865. * logarithm log
  10866. * [maximum] [max]
  10867. * [minimum] [min]
  10868. * minus sub
  10869. * modulo mod
  10870. * naturalExponential exp
  10871. * naturalLogarithm ln
  10872. * negated neg
  10873. * plus add
  10874. * precision sd
  10875. * round
  10876. * sine sin
  10877. * squareRoot sqrt
  10878. * tangent tan
  10879. * times mul
  10880. * toBinary
  10881. * toDecimalPlaces toDP
  10882. * toExponential
  10883. * toFixed
  10884. * toFraction
  10885. * toHexadecimal toHex
  10886. * toNearest
  10887. * toNumber
  10888. * toOctal
  10889. * toPower pow
  10890. * toPrecision
  10891. * toSignificantDigits toSD
  10892. * toString
  10893. * truncated trunc
  10894. * valueOf toJSON
  10895. */
  10896. /*
  10897. * Return a new Decimal whose value is the absolute value of this Decimal.
  10898. *
  10899. */
  10900. P.absoluteValue = P.abs = function () {
  10901. var x = new this.constructor(this);
  10902. if (x.s < 0) x.s = 1;
  10903. return finalise(x);
  10904. };
  10905. /*
  10906. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  10907. * direction of positive Infinity.
  10908. *
  10909. */
  10910. P.ceil = function () {
  10911. return finalise(new this.constructor(this), this.e + 1, 2);
  10912. };
  10913. /*
  10914. * Return a new Decimal whose value is the value of this Decimal clamped to the range
  10915. * delineated by `min` and `max`.
  10916. *
  10917. * min {number|string|Decimal}
  10918. * max {number|string|Decimal}
  10919. *
  10920. */
  10921. P.clampedTo = P.clamp = function (min, max) {
  10922. var k,
  10923. x = this,
  10924. Ctor = x.constructor;
  10925. min = new Ctor(min);
  10926. max = new Ctor(max);
  10927. if (!min.s || !max.s) return new Ctor(NaN);
  10928. if (min.gt(max)) throw Error(invalidArgument + max);
  10929. k = x.cmp(min);
  10930. return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);
  10931. };
  10932. /*
  10933. * Return
  10934. * 1 if the value of this Decimal is greater than the value of `y`,
  10935. * -1 if the value of this Decimal is less than the value of `y`,
  10936. * 0 if they have the same value,
  10937. * NaN if the value of either Decimal is NaN.
  10938. *
  10939. */
  10940. P.comparedTo = P.cmp = function (y) {
  10941. var i,
  10942. j,
  10943. xdL,
  10944. ydL,
  10945. x = this,
  10946. xd = x.d,
  10947. yd = (y = new x.constructor(y)).d,
  10948. xs = x.s,
  10949. ys = y.s;
  10950. // Either NaN or ±Infinity?
  10951. if (!xd || !yd) {
  10952. return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;
  10953. }
  10954. // Either zero?
  10955. if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;
  10956. // Signs differ?
  10957. if (xs !== ys) return xs;
  10958. // Compare exponents.
  10959. if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;
  10960. xdL = xd.length;
  10961. ydL = yd.length;
  10962. // Compare digit by digit.
  10963. for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {
  10964. if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;
  10965. }
  10966. // Compare lengths.
  10967. return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;
  10968. };
  10969. /*
  10970. * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.
  10971. *
  10972. * Domain: [-Infinity, Infinity]
  10973. * Range: [-1, 1]
  10974. *
  10975. * cos(0) = 1
  10976. * cos(-0) = 1
  10977. * cos(Infinity) = NaN
  10978. * cos(-Infinity) = NaN
  10979. * cos(NaN) = NaN
  10980. *
  10981. */
  10982. P.cosine = P.cos = function () {
  10983. var pr,
  10984. rm,
  10985. x = this,
  10986. Ctor = x.constructor;
  10987. if (!x.d) return new Ctor(NaN);
  10988. // cos(0) = cos(-0) = 1
  10989. if (!x.d[0]) return new Ctor(1);
  10990. pr = Ctor.precision;
  10991. rm = Ctor.rounding;
  10992. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  10993. Ctor.rounding = 1;
  10994. x = cosine(Ctor, toLessThanHalfPi(Ctor, x));
  10995. Ctor.precision = pr;
  10996. Ctor.rounding = rm;
  10997. return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);
  10998. };
  10999. /*
  11000. *
  11001. * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to
  11002. * `precision` significant digits using rounding mode `rounding`.
  11003. *
  11004. * cbrt(0) = 0
  11005. * cbrt(-0) = -0
  11006. * cbrt(1) = 1
  11007. * cbrt(-1) = -1
  11008. * cbrt(N) = N
  11009. * cbrt(-I) = -I
  11010. * cbrt(I) = I
  11011. *
  11012. * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))
  11013. *
  11014. */
  11015. P.cubeRoot = P.cbrt = function () {
  11016. var e,
  11017. m,
  11018. n,
  11019. r,
  11020. rep,
  11021. s,
  11022. sd,
  11023. t,
  11024. t3,
  11025. t3plusx,
  11026. x = this,
  11027. Ctor = x.constructor;
  11028. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  11029. external = false;
  11030. // Initial estimate.
  11031. s = x.s * mathpow(x.s * x, 1 / 3);
  11032. // Math.cbrt underflow/overflow?
  11033. // Pass x to Math.pow as integer, then adjust the exponent of the result.
  11034. if (!s || Math.abs(s) == 1 / 0) {
  11035. n = digitsToString(x.d);
  11036. e = x.e;
  11037. // Adjust n exponent so it is a multiple of 3 away from x exponent.
  11038. if (s = (e - n.length + 1) % 3) n += s == 1 || s == -2 ? '0' : '00';
  11039. s = mathpow(n, 1 / 3);
  11040. // Rarely, e may be one less than the result exponent value.
  11041. e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));
  11042. if (s == 1 / 0) {
  11043. n = '5e' + e;
  11044. } else {
  11045. n = s.toExponential();
  11046. n = n.slice(0, n.indexOf('e') + 1) + e;
  11047. }
  11048. r = new Ctor(n);
  11049. r.s = x.s;
  11050. } else {
  11051. r = new Ctor(s.toString());
  11052. }
  11053. sd = (e = Ctor.precision) + 3;
  11054. // Halley's method.
  11055. // TODO? Compare Newton's method.
  11056. for (;;) {
  11057. t = r;
  11058. t3 = t.times(t).times(t);
  11059. t3plusx = t3.plus(x);
  11060. r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);
  11061. // TODO? Replace with for-loop and checkRoundingDigits.
  11062. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  11063. n = n.slice(sd - 3, sd + 1);
  11064. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999
  11065. // , i.e. approaching a rounding boundary, continue the iteration.
  11066. if (n == '9999' || !rep && n == '4999') {
  11067. // On the first iteration only, check to see if rounding up gives the exact result as the
  11068. // nines may infinitely repeat.
  11069. if (!rep) {
  11070. finalise(t, e + 1, 0);
  11071. if (t.times(t).times(t).eq(x)) {
  11072. r = t;
  11073. break;
  11074. }
  11075. }
  11076. sd += 4;
  11077. rep = 1;
  11078. } else {
  11079. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  11080. // If not, then there are further digits and m will be truthy.
  11081. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  11082. // Truncate to the first rounding digit.
  11083. finalise(r, e + 1, 1);
  11084. m = !r.times(r).times(r).eq(x);
  11085. }
  11086. break;
  11087. }
  11088. }
  11089. }
  11090. external = true;
  11091. return finalise(r, e, Ctor.rounding, m);
  11092. };
  11093. /*
  11094. * Return the number of decimal places of the value of this Decimal.
  11095. *
  11096. */
  11097. P.decimalPlaces = P.dp = function () {
  11098. var w,
  11099. d = this.d,
  11100. n = NaN;
  11101. if (d) {
  11102. w = d.length - 1;
  11103. n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;
  11104. // Subtract the number of trailing zeros of the last word.
  11105. w = d[w];
  11106. if (w) for (; w % 10 == 0; w /= 10) {
  11107. n--;
  11108. }
  11109. if (n < 0) n = 0;
  11110. }
  11111. return n;
  11112. };
  11113. /*
  11114. * n / 0 = I
  11115. * n / N = N
  11116. * n / I = 0
  11117. * 0 / n = 0
  11118. * 0 / 0 = N
  11119. * 0 / N = N
  11120. * 0 / I = 0
  11121. * N / n = N
  11122. * N / 0 = N
  11123. * N / N = N
  11124. * N / I = N
  11125. * I / n = I
  11126. * I / 0 = I
  11127. * I / N = N
  11128. * I / I = N
  11129. *
  11130. * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to
  11131. * `precision` significant digits using rounding mode `rounding`.
  11132. *
  11133. */
  11134. P.dividedBy = P.div = function (y) {
  11135. return divide(this, new this.constructor(y));
  11136. };
  11137. /*
  11138. * Return a new Decimal whose value is the integer part of dividing the value of this Decimal
  11139. * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.
  11140. *
  11141. */
  11142. P.dividedToIntegerBy = P.divToInt = function (y) {
  11143. var x = this,
  11144. Ctor = x.constructor;
  11145. return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);
  11146. };
  11147. /*
  11148. * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.
  11149. *
  11150. */
  11151. P.equals = P.eq = function (y) {
  11152. return this.cmp(y) === 0;
  11153. };
  11154. /*
  11155. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  11156. * direction of negative Infinity.
  11157. *
  11158. */
  11159. P.floor = function () {
  11160. return finalise(new this.constructor(this), this.e + 1, 3);
  11161. };
  11162. /*
  11163. * Return true if the value of this Decimal is greater than the value of `y`, otherwise return
  11164. * false.
  11165. *
  11166. */
  11167. P.greaterThan = P.gt = function (y) {
  11168. return this.cmp(y) > 0;
  11169. };
  11170. /*
  11171. * Return true if the value of this Decimal is greater than or equal to the value of `y`,
  11172. * otherwise return false.
  11173. *
  11174. */
  11175. P.greaterThanOrEqualTo = P.gte = function (y) {
  11176. var k = this.cmp(y);
  11177. return k == 1 || k === 0;
  11178. };
  11179. /*
  11180. * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this
  11181. * Decimal.
  11182. *
  11183. * Domain: [-Infinity, Infinity]
  11184. * Range: [1, Infinity]
  11185. *
  11186. * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...
  11187. *
  11188. * cosh(0) = 1
  11189. * cosh(-0) = 1
  11190. * cosh(Infinity) = Infinity
  11191. * cosh(-Infinity) = Infinity
  11192. * cosh(NaN) = NaN
  11193. *
  11194. * x time taken (ms) result
  11195. * 1000 9 9.8503555700852349694e+433
  11196. * 10000 25 4.4034091128314607936e+4342
  11197. * 100000 171 1.4033316802130615897e+43429
  11198. * 1000000 3817 1.5166076984010437725e+434294
  11199. * 10000000 abandoned after 2 minute wait
  11200. *
  11201. * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))
  11202. *
  11203. */
  11204. P.hyperbolicCosine = P.cosh = function () {
  11205. var k,
  11206. n,
  11207. pr,
  11208. rm,
  11209. len,
  11210. x = this,
  11211. Ctor = x.constructor,
  11212. one = new Ctor(1);
  11213. if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);
  11214. if (x.isZero()) return one;
  11215. pr = Ctor.precision;
  11216. rm = Ctor.rounding;
  11217. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  11218. Ctor.rounding = 1;
  11219. len = x.d.length;
  11220. // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1
  11221. // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))
  11222. // Estimate the optimum number of times to use the argument reduction.
  11223. // TODO? Estimation reused from cosine() and may not be optimal here.
  11224. if (len < 32) {
  11225. k = Math.ceil(len / 3);
  11226. n = (1 / tinyPow(4, k)).toString();
  11227. } else {
  11228. k = 16;
  11229. n = '2.3283064365386962890625e-10';
  11230. }
  11231. x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);
  11232. // Reverse argument reduction
  11233. var cosh2_x,
  11234. i = k,
  11235. d8 = new Ctor(8);
  11236. for (; i--;) {
  11237. cosh2_x = x.times(x);
  11238. x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));
  11239. }
  11240. return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);
  11241. };
  11242. /*
  11243. * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this
  11244. * Decimal.
  11245. *
  11246. * Domain: [-Infinity, Infinity]
  11247. * Range: [-Infinity, Infinity]
  11248. *
  11249. * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...
  11250. *
  11251. * sinh(0) = 0
  11252. * sinh(-0) = -0
  11253. * sinh(Infinity) = Infinity
  11254. * sinh(-Infinity) = -Infinity
  11255. * sinh(NaN) = NaN
  11256. *
  11257. * x time taken (ms)
  11258. * 10 2 ms
  11259. * 100 5 ms
  11260. * 1000 14 ms
  11261. * 10000 82 ms
  11262. * 100000 886 ms 1.4033316802130615897e+43429
  11263. * 200000 2613 ms
  11264. * 300000 5407 ms
  11265. * 400000 8824 ms
  11266. * 500000 13026 ms 8.7080643612718084129e+217146
  11267. * 1000000 48543 ms
  11268. *
  11269. * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))
  11270. *
  11271. */
  11272. P.hyperbolicSine = P.sinh = function () {
  11273. var k,
  11274. pr,
  11275. rm,
  11276. len,
  11277. x = this,
  11278. Ctor = x.constructor;
  11279. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  11280. pr = Ctor.precision;
  11281. rm = Ctor.rounding;
  11282. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  11283. Ctor.rounding = 1;
  11284. len = x.d.length;
  11285. if (len < 3) {
  11286. x = taylorSeries(Ctor, 2, x, x, true);
  11287. } else {
  11288. // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))
  11289. // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))
  11290. // 3 multiplications and 1 addition
  11291. // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))
  11292. // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))
  11293. // 4 multiplications and 2 additions
  11294. // Estimate the optimum number of times to use the argument reduction.
  11295. k = 1.4 * Math.sqrt(len);
  11296. k = k > 16 ? 16 : k | 0;
  11297. x = x.times(1 / tinyPow(5, k));
  11298. x = taylorSeries(Ctor, 2, x, x, true);
  11299. // Reverse argument reduction
  11300. var sinh2_x,
  11301. d5 = new Ctor(5),
  11302. d16 = new Ctor(16),
  11303. d20 = new Ctor(20);
  11304. for (; k--;) {
  11305. sinh2_x = x.times(x);
  11306. x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));
  11307. }
  11308. }
  11309. Ctor.precision = pr;
  11310. Ctor.rounding = rm;
  11311. return finalise(x, pr, rm, true);
  11312. };
  11313. /*
  11314. * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this
  11315. * Decimal.
  11316. *
  11317. * Domain: [-Infinity, Infinity]
  11318. * Range: [-1, 1]
  11319. *
  11320. * tanh(x) = sinh(x) / cosh(x)
  11321. *
  11322. * tanh(0) = 0
  11323. * tanh(-0) = -0
  11324. * tanh(Infinity) = 1
  11325. * tanh(-Infinity) = -1
  11326. * tanh(NaN) = NaN
  11327. *
  11328. */
  11329. P.hyperbolicTangent = P.tanh = function () {
  11330. var pr,
  11331. rm,
  11332. x = this,
  11333. Ctor = x.constructor;
  11334. if (!x.isFinite()) return new Ctor(x.s);
  11335. if (x.isZero()) return new Ctor(x);
  11336. pr = Ctor.precision;
  11337. rm = Ctor.rounding;
  11338. Ctor.precision = pr + 7;
  11339. Ctor.rounding = 1;
  11340. return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
  11341. };
  11342. /*
  11343. * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of
  11344. * this Decimal.
  11345. *
  11346. * Domain: [-1, 1]
  11347. * Range: [0, pi]
  11348. *
  11349. * acos(x) = pi/2 - asin(x)
  11350. *
  11351. * acos(0) = pi/2
  11352. * acos(-0) = pi/2
  11353. * acos(1) = 0
  11354. * acos(-1) = pi
  11355. * acos(1/2) = pi/3
  11356. * acos(-1/2) = 2*pi/3
  11357. * acos(|x| > 1) = NaN
  11358. * acos(NaN) = NaN
  11359. *
  11360. */
  11361. P.inverseCosine = P.acos = function () {
  11362. var halfPi,
  11363. x = this,
  11364. Ctor = x.constructor,
  11365. k = x.abs().cmp(1),
  11366. pr = Ctor.precision,
  11367. rm = Ctor.rounding;
  11368. if (k !== -1) {
  11369. return k === 0
  11370. // |x| is 1
  11371. ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)
  11372. // |x| > 1 or x is NaN
  11373. : new Ctor(NaN);
  11374. }
  11375. if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);
  11376. // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3
  11377. Ctor.precision = pr + 6;
  11378. Ctor.rounding = 1;
  11379. x = x.asin();
  11380. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  11381. Ctor.precision = pr;
  11382. Ctor.rounding = rm;
  11383. return halfPi.minus(x);
  11384. };
  11385. /*
  11386. * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the
  11387. * value of this Decimal.
  11388. *
  11389. * Domain: [1, Infinity]
  11390. * Range: [0, Infinity]
  11391. *
  11392. * acosh(x) = ln(x + sqrt(x^2 - 1))
  11393. *
  11394. * acosh(x < 1) = NaN
  11395. * acosh(NaN) = NaN
  11396. * acosh(Infinity) = Infinity
  11397. * acosh(-Infinity) = NaN
  11398. * acosh(0) = NaN
  11399. * acosh(-0) = NaN
  11400. * acosh(1) = 0
  11401. * acosh(-1) = NaN
  11402. *
  11403. */
  11404. P.inverseHyperbolicCosine = P.acosh = function () {
  11405. var pr,
  11406. rm,
  11407. x = this,
  11408. Ctor = x.constructor;
  11409. if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);
  11410. if (!x.isFinite()) return new Ctor(x);
  11411. pr = Ctor.precision;
  11412. rm = Ctor.rounding;
  11413. Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
  11414. Ctor.rounding = 1;
  11415. external = false;
  11416. x = x.times(x).minus(1).sqrt().plus(x);
  11417. external = true;
  11418. Ctor.precision = pr;
  11419. Ctor.rounding = rm;
  11420. return x.ln();
  11421. };
  11422. /*
  11423. * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value
  11424. * of this Decimal.
  11425. *
  11426. * Domain: [-Infinity, Infinity]
  11427. * Range: [-Infinity, Infinity]
  11428. *
  11429. * asinh(x) = ln(x + sqrt(x^2 + 1))
  11430. *
  11431. * asinh(NaN) = NaN
  11432. * asinh(Infinity) = Infinity
  11433. * asinh(-Infinity) = -Infinity
  11434. * asinh(0) = 0
  11435. * asinh(-0) = -0
  11436. *
  11437. */
  11438. P.inverseHyperbolicSine = P.asinh = function () {
  11439. var pr,
  11440. rm,
  11441. x = this,
  11442. Ctor = x.constructor;
  11443. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  11444. pr = Ctor.precision;
  11445. rm = Ctor.rounding;
  11446. Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
  11447. Ctor.rounding = 1;
  11448. external = false;
  11449. x = x.times(x).plus(1).sqrt().plus(x);
  11450. external = true;
  11451. Ctor.precision = pr;
  11452. Ctor.rounding = rm;
  11453. return x.ln();
  11454. };
  11455. /*
  11456. * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the
  11457. * value of this Decimal.
  11458. *
  11459. * Domain: [-1, 1]
  11460. * Range: [-Infinity, Infinity]
  11461. *
  11462. * atanh(x) = 0.5 * ln((1 + x) / (1 - x))
  11463. *
  11464. * atanh(|x| > 1) = NaN
  11465. * atanh(NaN) = NaN
  11466. * atanh(Infinity) = NaN
  11467. * atanh(-Infinity) = NaN
  11468. * atanh(0) = 0
  11469. * atanh(-0) = -0
  11470. * atanh(1) = Infinity
  11471. * atanh(-1) = -Infinity
  11472. *
  11473. */
  11474. P.inverseHyperbolicTangent = P.atanh = function () {
  11475. var pr,
  11476. rm,
  11477. wpr,
  11478. xsd,
  11479. x = this,
  11480. Ctor = x.constructor;
  11481. if (!x.isFinite()) return new Ctor(NaN);
  11482. if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);
  11483. pr = Ctor.precision;
  11484. rm = Ctor.rounding;
  11485. xsd = x.sd();
  11486. if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);
  11487. Ctor.precision = wpr = xsd - x.e;
  11488. x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);
  11489. Ctor.precision = pr + 4;
  11490. Ctor.rounding = 1;
  11491. x = x.ln();
  11492. Ctor.precision = pr;
  11493. Ctor.rounding = rm;
  11494. return x.times(0.5);
  11495. };
  11496. /*
  11497. * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this
  11498. * Decimal.
  11499. *
  11500. * Domain: [-Infinity, Infinity]
  11501. * Range: [-pi/2, pi/2]
  11502. *
  11503. * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))
  11504. *
  11505. * asin(0) = 0
  11506. * asin(-0) = -0
  11507. * asin(1/2) = pi/6
  11508. * asin(-1/2) = -pi/6
  11509. * asin(1) = pi/2
  11510. * asin(-1) = -pi/2
  11511. * asin(|x| > 1) = NaN
  11512. * asin(NaN) = NaN
  11513. *
  11514. * TODO? Compare performance of Taylor series.
  11515. *
  11516. */
  11517. P.inverseSine = P.asin = function () {
  11518. var halfPi,
  11519. k,
  11520. pr,
  11521. rm,
  11522. x = this,
  11523. Ctor = x.constructor;
  11524. if (x.isZero()) return new Ctor(x);
  11525. k = x.abs().cmp(1);
  11526. pr = Ctor.precision;
  11527. rm = Ctor.rounding;
  11528. if (k !== -1) {
  11529. // |x| is 1
  11530. if (k === 0) {
  11531. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  11532. halfPi.s = x.s;
  11533. return halfPi;
  11534. }
  11535. // |x| > 1 or x is NaN
  11536. return new Ctor(NaN);
  11537. }
  11538. // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6
  11539. Ctor.precision = pr + 6;
  11540. Ctor.rounding = 1;
  11541. x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();
  11542. Ctor.precision = pr;
  11543. Ctor.rounding = rm;
  11544. return x.times(2);
  11545. };
  11546. /*
  11547. * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value
  11548. * of this Decimal.
  11549. *
  11550. * Domain: [-Infinity, Infinity]
  11551. * Range: [-pi/2, pi/2]
  11552. *
  11553. * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  11554. *
  11555. * atan(0) = 0
  11556. * atan(-0) = -0
  11557. * atan(1) = pi/4
  11558. * atan(-1) = -pi/4
  11559. * atan(Infinity) = pi/2
  11560. * atan(-Infinity) = -pi/2
  11561. * atan(NaN) = NaN
  11562. *
  11563. */
  11564. P.inverseTangent = P.atan = function () {
  11565. var i,
  11566. j,
  11567. k,
  11568. n,
  11569. px,
  11570. t,
  11571. r,
  11572. wpr,
  11573. x2,
  11574. x = this,
  11575. Ctor = x.constructor,
  11576. pr = Ctor.precision,
  11577. rm = Ctor.rounding;
  11578. if (!x.isFinite()) {
  11579. if (!x.s) return new Ctor(NaN);
  11580. if (pr + 4 <= PI_PRECISION) {
  11581. r = getPi(Ctor, pr + 4, rm).times(0.5);
  11582. r.s = x.s;
  11583. return r;
  11584. }
  11585. } else if (x.isZero()) {
  11586. return new Ctor(x);
  11587. } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {
  11588. r = getPi(Ctor, pr + 4, rm).times(0.25);
  11589. r.s = x.s;
  11590. return r;
  11591. }
  11592. Ctor.precision = wpr = pr + 10;
  11593. Ctor.rounding = 1;
  11594. // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);
  11595. // Argument reduction
  11596. // Ensure |x| < 0.42
  11597. // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))
  11598. k = Math.min(28, wpr / LOG_BASE + 2 | 0);
  11599. for (i = k; i; --i) {
  11600. x = x.div(x.times(x).plus(1).sqrt().plus(1));
  11601. }
  11602. external = false;
  11603. j = Math.ceil(wpr / LOG_BASE);
  11604. n = 1;
  11605. x2 = x.times(x);
  11606. r = new Ctor(x);
  11607. px = x;
  11608. // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  11609. for (; i !== -1;) {
  11610. px = px.times(x2);
  11611. t = r.minus(px.div(n += 2));
  11612. px = px.times(x2);
  11613. r = t.plus(px.div(n += 2));
  11614. if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;) {
  11615. ;
  11616. }
  11617. }
  11618. if (k) r = r.times(2 << k - 1);
  11619. external = true;
  11620. return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
  11621. };
  11622. /*
  11623. * Return true if the value of this Decimal is a finite number, otherwise return false.
  11624. *
  11625. */
  11626. P.isFinite = function () {
  11627. return !!this.d;
  11628. };
  11629. /*
  11630. * Return true if the value of this Decimal is an integer, otherwise return false.
  11631. *
  11632. */
  11633. P.isInteger = P.isInt = function () {
  11634. return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;
  11635. };
  11636. /*
  11637. * Return true if the value of this Decimal is NaN, otherwise return false.
  11638. *
  11639. */
  11640. P.isNaN = function () {
  11641. return !this.s;
  11642. };
  11643. /*
  11644. * Return true if the value of this Decimal is negative, otherwise return false.
  11645. *
  11646. */
  11647. P.isNegative = P.isNeg = function () {
  11648. return this.s < 0;
  11649. };
  11650. /*
  11651. * Return true if the value of this Decimal is positive, otherwise return false.
  11652. *
  11653. */
  11654. P.isPositive = P.isPos = function () {
  11655. return this.s > 0;
  11656. };
  11657. /*
  11658. * Return true if the value of this Decimal is 0 or -0, otherwise return false.
  11659. *
  11660. */
  11661. P.isZero = function () {
  11662. return !!this.d && this.d[0] === 0;
  11663. };
  11664. /*
  11665. * Return true if the value of this Decimal is less than `y`, otherwise return false.
  11666. *
  11667. */
  11668. P.lessThan = P.lt = function (y) {
  11669. return this.cmp(y) < 0;
  11670. };
  11671. /*
  11672. * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.
  11673. *
  11674. */
  11675. P.lessThanOrEqualTo = P.lte = function (y) {
  11676. return this.cmp(y) < 1;
  11677. };
  11678. /*
  11679. * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`
  11680. * significant digits using rounding mode `rounding`.
  11681. *
  11682. * If no base is specified, return log[10](arg).
  11683. *
  11684. * log[base](arg) = ln(arg) / ln(base)
  11685. *
  11686. * The result will always be correctly rounded if the base of the log is 10, and 'almost always'
  11687. * otherwise:
  11688. *
  11689. * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen
  11690. * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error
  11691. * between the result and the correctly rounded result will be one ulp (unit in the last place).
  11692. *
  11693. * log[-b](a) = NaN
  11694. * log[0](a) = NaN
  11695. * log[1](a) = NaN
  11696. * log[NaN](a) = NaN
  11697. * log[Infinity](a) = NaN
  11698. * log[b](0) = -Infinity
  11699. * log[b](-0) = -Infinity
  11700. * log[b](-a) = NaN
  11701. * log[b](1) = 0
  11702. * log[b](Infinity) = Infinity
  11703. * log[b](NaN) = NaN
  11704. *
  11705. * [base] {number|string|Decimal} The base of the logarithm.
  11706. *
  11707. */
  11708. P.logarithm = P.log = function (base) {
  11709. var isBase10,
  11710. d,
  11711. denominator,
  11712. k,
  11713. inf,
  11714. num,
  11715. sd,
  11716. r,
  11717. arg = this,
  11718. Ctor = arg.constructor,
  11719. pr = Ctor.precision,
  11720. rm = Ctor.rounding,
  11721. guard = 5;
  11722. // Default base is 10.
  11723. if (base == null) {
  11724. base = new Ctor(10);
  11725. isBase10 = true;
  11726. } else {
  11727. base = new Ctor(base);
  11728. d = base.d;
  11729. // Return NaN if base is negative, or non-finite, or is 0 or 1.
  11730. if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);
  11731. isBase10 = base.eq(10);
  11732. }
  11733. d = arg.d;
  11734. // Is arg negative, non-finite, 0 or 1?
  11735. if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {
  11736. return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);
  11737. }
  11738. // The result will have a non-terminating decimal expansion if base is 10 and arg is not an
  11739. // integer power of 10.
  11740. if (isBase10) {
  11741. if (d.length > 1) {
  11742. inf = true;
  11743. } else {
  11744. for (k = d[0]; k % 10 === 0;) {
  11745. k /= 10;
  11746. }
  11747. inf = k !== 1;
  11748. }
  11749. }
  11750. external = false;
  11751. sd = pr + guard;
  11752. num = naturalLogarithm(arg, sd);
  11753. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  11754. // The result will have 5 rounding digits.
  11755. r = divide(num, denominator, sd, 1);
  11756. // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,
  11757. // calculate 10 further digits.
  11758. //
  11759. // If the result is known to have an infinite decimal expansion, repeat this until it is clear
  11760. // that the result is above or below the boundary. Otherwise, if after calculating the 10
  11761. // further digits, the last 14 are nines, round up and assume the result is exact.
  11762. // Also assume the result is exact if the last 14 are zero.
  11763. //
  11764. // Example of a result that will be incorrectly rounded:
  11765. // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...
  11766. // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it
  11767. // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so
  11768. // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal
  11769. // place is still 2.6.
  11770. if (checkRoundingDigits(r.d, k = pr, rm)) {
  11771. do {
  11772. sd += 10;
  11773. num = naturalLogarithm(arg, sd);
  11774. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  11775. r = divide(num, denominator, sd, 1);
  11776. if (!inf) {
  11777. // Check for 14 nines from the 2nd rounding digit, as the first may be 4.
  11778. if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {
  11779. r = finalise(r, pr + 1, 0);
  11780. }
  11781. break;
  11782. }
  11783. } while (checkRoundingDigits(r.d, k += 10, rm));
  11784. }
  11785. external = true;
  11786. return finalise(r, pr, rm);
  11787. };
  11788. /*
  11789. * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.
  11790. *
  11791. * arguments {number|string|Decimal}
  11792. *
  11793. P.max = function () {
  11794. Array.prototype.push.call(arguments, this);
  11795. return maxOrMin(this.constructor, arguments, 'lt');
  11796. };
  11797. */
  11798. /*
  11799. * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.
  11800. *
  11801. * arguments {number|string|Decimal}
  11802. *
  11803. P.min = function () {
  11804. Array.prototype.push.call(arguments, this);
  11805. return maxOrMin(this.constructor, arguments, 'gt');
  11806. };
  11807. */
  11808. /*
  11809. * n - 0 = n
  11810. * n - N = N
  11811. * n - I = -I
  11812. * 0 - n = -n
  11813. * 0 - 0 = 0
  11814. * 0 - N = N
  11815. * 0 - I = -I
  11816. * N - n = N
  11817. * N - 0 = N
  11818. * N - N = N
  11819. * N - I = N
  11820. * I - n = I
  11821. * I - 0 = I
  11822. * I - N = N
  11823. * I - I = N
  11824. *
  11825. * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`
  11826. * significant digits using rounding mode `rounding`.
  11827. *
  11828. */
  11829. P.minus = P.sub = function (y) {
  11830. var d,
  11831. e,
  11832. i,
  11833. j,
  11834. k,
  11835. len,
  11836. pr,
  11837. rm,
  11838. xd,
  11839. xe,
  11840. xLTy,
  11841. yd,
  11842. x = this,
  11843. Ctor = x.constructor;
  11844. y = new Ctor(y);
  11845. // If either is not finite...
  11846. if (!x.d || !y.d) {
  11847. // Return NaN if either is NaN.
  11848. if (!x.s || !y.s) y = new Ctor(NaN);
  11849. // Return y negated if x is finite and y is ±Infinity.
  11850. else if (x.d) y.s = -y.s;
  11851. // Return x if y is finite and x is ±Infinity.
  11852. // Return x if both are ±Infinity with different signs.
  11853. // Return NaN if both are ±Infinity with the same sign.
  11854. else y = new Ctor(y.d || x.s !== y.s ? x : NaN);
  11855. return y;
  11856. }
  11857. // If signs differ...
  11858. if (x.s != y.s) {
  11859. y.s = -y.s;
  11860. return x.plus(y);
  11861. }
  11862. xd = x.d;
  11863. yd = y.d;
  11864. pr = Ctor.precision;
  11865. rm = Ctor.rounding;
  11866. // If either is zero...
  11867. if (!xd[0] || !yd[0]) {
  11868. // Return y negated if x is zero and y is non-zero.
  11869. if (yd[0]) y.s = -y.s;
  11870. // Return x if y is zero and x is non-zero.
  11871. else if (xd[0]) y = new Ctor(x);
  11872. // Return zero if both are zero.
  11873. // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.
  11874. else return new Ctor(rm === 3 ? -0 : 0);
  11875. return external ? finalise(y, pr, rm) : y;
  11876. }
  11877. // x and y are finite, non-zero numbers with the same sign.
  11878. // Calculate base 1e7 exponents.
  11879. e = mathfloor(y.e / LOG_BASE);
  11880. xe = mathfloor(x.e / LOG_BASE);
  11881. xd = xd.slice();
  11882. k = xe - e;
  11883. // If base 1e7 exponents differ...
  11884. if (k) {
  11885. xLTy = k < 0;
  11886. if (xLTy) {
  11887. d = xd;
  11888. k = -k;
  11889. len = yd.length;
  11890. } else {
  11891. d = yd;
  11892. e = xe;
  11893. len = xd.length;
  11894. }
  11895. // Numbers with massively different exponents would result in a very high number of
  11896. // zeros needing to be prepended, but this can be avoided while still ensuring correct
  11897. // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.
  11898. i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;
  11899. if (k > i) {
  11900. k = i;
  11901. d.length = 1;
  11902. }
  11903. // Prepend zeros to equalise exponents.
  11904. d.reverse();
  11905. for (i = k; i--;) {
  11906. d.push(0);
  11907. }
  11908. d.reverse();
  11909. // Base 1e7 exponents equal.
  11910. } else {
  11911. // Check digits to determine which is the bigger number.
  11912. i = xd.length;
  11913. len = yd.length;
  11914. xLTy = i < len;
  11915. if (xLTy) len = i;
  11916. for (i = 0; i < len; i++) {
  11917. if (xd[i] != yd[i]) {
  11918. xLTy = xd[i] < yd[i];
  11919. break;
  11920. }
  11921. }
  11922. k = 0;
  11923. }
  11924. if (xLTy) {
  11925. d = xd;
  11926. xd = yd;
  11927. yd = d;
  11928. y.s = -y.s;
  11929. }
  11930. len = xd.length;
  11931. // Append zeros to `xd` if shorter.
  11932. // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.
  11933. for (i = yd.length - len; i > 0; --i) {
  11934. xd[len++] = 0;
  11935. }
  11936. // Subtract yd from xd.
  11937. for (i = yd.length; i > k;) {
  11938. if (xd[--i] < yd[i]) {
  11939. for (j = i; j && xd[--j] === 0;) {
  11940. xd[j] = BASE - 1;
  11941. }
  11942. --xd[j];
  11943. xd[i] += BASE;
  11944. }
  11945. xd[i] -= yd[i];
  11946. }
  11947. // Remove trailing zeros.
  11948. for (; xd[--len] === 0;) {
  11949. xd.pop();
  11950. }
  11951. // Remove leading zeros and adjust exponent accordingly.
  11952. for (; xd[0] === 0; xd.shift()) {
  11953. --e;
  11954. }
  11955. // Zero?
  11956. if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);
  11957. y.d = xd;
  11958. y.e = getBase10Exponent(xd, e);
  11959. return external ? finalise(y, pr, rm) : y;
  11960. };
  11961. /*
  11962. * n % 0 = N
  11963. * n % N = N
  11964. * n % I = n
  11965. * 0 % n = 0
  11966. * -0 % n = -0
  11967. * 0 % 0 = N
  11968. * 0 % N = N
  11969. * 0 % I = 0
  11970. * N % n = N
  11971. * N % 0 = N
  11972. * N % N = N
  11973. * N % I = N
  11974. * I % n = N
  11975. * I % 0 = N
  11976. * I % N = N
  11977. * I % I = N
  11978. *
  11979. * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to
  11980. * `precision` significant digits using rounding mode `rounding`.
  11981. *
  11982. * The result depends on the modulo mode.
  11983. *
  11984. */
  11985. P.modulo = P.mod = function (y) {
  11986. var q,
  11987. x = this,
  11988. Ctor = x.constructor;
  11989. y = new Ctor(y);
  11990. // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.
  11991. if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);
  11992. // Return x if y is ±Infinity or x is ±0.
  11993. if (!y.d || x.d && !x.d[0]) {
  11994. return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
  11995. }
  11996. // Prevent rounding of intermediate calculations.
  11997. external = false;
  11998. if (Ctor.modulo == 9) {
  11999. // Euclidian division: q = sign(y) * floor(x / abs(y))
  12000. // result = x - q * y where 0 <= result < abs(y)
  12001. q = divide(x, y.abs(), 0, 3, 1);
  12002. q.s *= y.s;
  12003. } else {
  12004. q = divide(x, y, 0, Ctor.modulo, 1);
  12005. }
  12006. q = q.times(y);
  12007. external = true;
  12008. return x.minus(q);
  12009. };
  12010. /*
  12011. * Return a new Decimal whose value is the natural exponential of the value of this Decimal,
  12012. * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`
  12013. * significant digits using rounding mode `rounding`.
  12014. *
  12015. */
  12016. P.naturalExponential = P.exp = function () {
  12017. return naturalExponential(this);
  12018. };
  12019. /*
  12020. * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
  12021. * rounded to `precision` significant digits using rounding mode `rounding`.
  12022. *
  12023. */
  12024. P.naturalLogarithm = P.ln = function () {
  12025. return naturalLogarithm(this);
  12026. };
  12027. /*
  12028. * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by
  12029. * -1.
  12030. *
  12031. */
  12032. P.negated = P.neg = function () {
  12033. var x = new this.constructor(this);
  12034. x.s = -x.s;
  12035. return finalise(x);
  12036. };
  12037. /*
  12038. * n + 0 = n
  12039. * n + N = N
  12040. * n + I = I
  12041. * 0 + n = n
  12042. * 0 + 0 = 0
  12043. * 0 + N = N
  12044. * 0 + I = I
  12045. * N + n = N
  12046. * N + 0 = N
  12047. * N + N = N
  12048. * N + I = N
  12049. * I + n = I
  12050. * I + 0 = I
  12051. * I + N = N
  12052. * I + I = I
  12053. *
  12054. * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`
  12055. * significant digits using rounding mode `rounding`.
  12056. *
  12057. */
  12058. P.plus = P.add = function (y) {
  12059. var carry,
  12060. d,
  12061. e,
  12062. i,
  12063. k,
  12064. len,
  12065. pr,
  12066. rm,
  12067. xd,
  12068. yd,
  12069. x = this,
  12070. Ctor = x.constructor;
  12071. y = new Ctor(y);
  12072. // If either is not finite...
  12073. if (!x.d || !y.d) {
  12074. // Return NaN if either is NaN.
  12075. if (!x.s || !y.s) y = new Ctor(NaN);
  12076. // Return x if y is finite and x is ±Infinity.
  12077. // Return x if both are ±Infinity with the same sign.
  12078. // Return NaN if both are ±Infinity with different signs.
  12079. // Return y if x is finite and y is ±Infinity.
  12080. else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);
  12081. return y;
  12082. }
  12083. // If signs differ...
  12084. if (x.s != y.s) {
  12085. y.s = -y.s;
  12086. return x.minus(y);
  12087. }
  12088. xd = x.d;
  12089. yd = y.d;
  12090. pr = Ctor.precision;
  12091. rm = Ctor.rounding;
  12092. // If either is zero...
  12093. if (!xd[0] || !yd[0]) {
  12094. // Return x if y is zero.
  12095. // Return y if y is non-zero.
  12096. if (!yd[0]) y = new Ctor(x);
  12097. return external ? finalise(y, pr, rm) : y;
  12098. }
  12099. // x and y are finite, non-zero numbers with the same sign.
  12100. // Calculate base 1e7 exponents.
  12101. k = mathfloor(x.e / LOG_BASE);
  12102. e = mathfloor(y.e / LOG_BASE);
  12103. xd = xd.slice();
  12104. i = k - e;
  12105. // If base 1e7 exponents differ...
  12106. if (i) {
  12107. if (i < 0) {
  12108. d = xd;
  12109. i = -i;
  12110. len = yd.length;
  12111. } else {
  12112. d = yd;
  12113. e = k;
  12114. len = xd.length;
  12115. }
  12116. // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.
  12117. k = Math.ceil(pr / LOG_BASE);
  12118. len = k > len ? k + 1 : len + 1;
  12119. if (i > len) {
  12120. i = len;
  12121. d.length = 1;
  12122. }
  12123. // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.
  12124. d.reverse();
  12125. for (; i--;) {
  12126. d.push(0);
  12127. }
  12128. d.reverse();
  12129. }
  12130. len = xd.length;
  12131. i = yd.length;
  12132. // If yd is longer than xd, swap xd and yd so xd points to the longer array.
  12133. if (len - i < 0) {
  12134. i = len;
  12135. d = yd;
  12136. yd = xd;
  12137. xd = d;
  12138. }
  12139. // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.
  12140. for (carry = 0; i;) {
  12141. carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;
  12142. xd[i] %= BASE;
  12143. }
  12144. if (carry) {
  12145. xd.unshift(carry);
  12146. ++e;
  12147. }
  12148. // Remove trailing zeros.
  12149. // No need to check for zero, as +x + +y != 0 && -x + -y != 0
  12150. for (len = xd.length; xd[--len] == 0;) {
  12151. xd.pop();
  12152. }
  12153. y.d = xd;
  12154. y.e = getBase10Exponent(xd, e);
  12155. return external ? finalise(y, pr, rm) : y;
  12156. };
  12157. /*
  12158. * Return the number of significant digits of the value of this Decimal.
  12159. *
  12160. * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
  12161. *
  12162. */
  12163. P.precision = P.sd = function (z) {
  12164. var k,
  12165. x = this;
  12166. if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);
  12167. if (x.d) {
  12168. k = getPrecision(x.d);
  12169. if (z && x.e + 1 > k) k = x.e + 1;
  12170. } else {
  12171. k = NaN;
  12172. }
  12173. return k;
  12174. };
  12175. /*
  12176. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
  12177. * rounding mode `rounding`.
  12178. *
  12179. */
  12180. P.round = function () {
  12181. var x = this,
  12182. Ctor = x.constructor;
  12183. return finalise(new Ctor(x), x.e + 1, Ctor.rounding);
  12184. };
  12185. /*
  12186. * Return a new Decimal whose value is the sine of the value in radians of this Decimal.
  12187. *
  12188. * Domain: [-Infinity, Infinity]
  12189. * Range: [-1, 1]
  12190. *
  12191. * sin(x) = x - x^3/3! + x^5/5! - ...
  12192. *
  12193. * sin(0) = 0
  12194. * sin(-0) = -0
  12195. * sin(Infinity) = NaN
  12196. * sin(-Infinity) = NaN
  12197. * sin(NaN) = NaN
  12198. *
  12199. */
  12200. P.sine = P.sin = function () {
  12201. var pr,
  12202. rm,
  12203. x = this,
  12204. Ctor = x.constructor;
  12205. if (!x.isFinite()) return new Ctor(NaN);
  12206. if (x.isZero()) return new Ctor(x);
  12207. pr = Ctor.precision;
  12208. rm = Ctor.rounding;
  12209. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  12210. Ctor.rounding = 1;
  12211. x = sine(Ctor, toLessThanHalfPi(Ctor, x));
  12212. Ctor.precision = pr;
  12213. Ctor.rounding = rm;
  12214. return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);
  12215. };
  12216. /*
  12217. * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`
  12218. * significant digits using rounding mode `rounding`.
  12219. *
  12220. * sqrt(-n) = N
  12221. * sqrt(N) = N
  12222. * sqrt(-I) = N
  12223. * sqrt(I) = I
  12224. * sqrt(0) = 0
  12225. * sqrt(-0) = -0
  12226. *
  12227. */
  12228. P.squareRoot = P.sqrt = function () {
  12229. var m,
  12230. n,
  12231. sd,
  12232. r,
  12233. rep,
  12234. t,
  12235. x = this,
  12236. d = x.d,
  12237. e = x.e,
  12238. s = x.s,
  12239. Ctor = x.constructor;
  12240. // Negative/NaN/Infinity/zero?
  12241. if (s !== 1 || !d || !d[0]) {
  12242. return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
  12243. }
  12244. external = false;
  12245. // Initial estimate.
  12246. s = Math.sqrt(+x);
  12247. // Math.sqrt underflow/overflow?
  12248. // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
  12249. if (s == 0 || s == 1 / 0) {
  12250. n = digitsToString(d);
  12251. if ((n.length + e) % 2 == 0) n += '0';
  12252. s = Math.sqrt(n);
  12253. e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
  12254. if (s == 1 / 0) {
  12255. n = '5e' + e;
  12256. } else {
  12257. n = s.toExponential();
  12258. n = n.slice(0, n.indexOf('e') + 1) + e;
  12259. }
  12260. r = new Ctor(n);
  12261. } else {
  12262. r = new Ctor(s.toString());
  12263. }
  12264. sd = (e = Ctor.precision) + 3;
  12265. // Newton-Raphson iteration.
  12266. for (;;) {
  12267. t = r;
  12268. r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);
  12269. // TODO? Replace with for-loop and checkRoundingDigits.
  12270. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  12271. n = n.slice(sd - 3, sd + 1);
  12272. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or
  12273. // 4999, i.e. approaching a rounding boundary, continue the iteration.
  12274. if (n == '9999' || !rep && n == '4999') {
  12275. // On the first iteration only, check to see if rounding up gives the exact result as the
  12276. // nines may infinitely repeat.
  12277. if (!rep) {
  12278. finalise(t, e + 1, 0);
  12279. if (t.times(t).eq(x)) {
  12280. r = t;
  12281. break;
  12282. }
  12283. }
  12284. sd += 4;
  12285. rep = 1;
  12286. } else {
  12287. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  12288. // If not, then there are further digits and m will be truthy.
  12289. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  12290. // Truncate to the first rounding digit.
  12291. finalise(r, e + 1, 1);
  12292. m = !r.times(r).eq(x);
  12293. }
  12294. break;
  12295. }
  12296. }
  12297. }
  12298. external = true;
  12299. return finalise(r, e, Ctor.rounding, m);
  12300. };
  12301. /*
  12302. * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.
  12303. *
  12304. * Domain: [-Infinity, Infinity]
  12305. * Range: [-Infinity, Infinity]
  12306. *
  12307. * tan(0) = 0
  12308. * tan(-0) = -0
  12309. * tan(Infinity) = NaN
  12310. * tan(-Infinity) = NaN
  12311. * tan(NaN) = NaN
  12312. *
  12313. */
  12314. P.tangent = P.tan = function () {
  12315. var pr,
  12316. rm,
  12317. x = this,
  12318. Ctor = x.constructor;
  12319. if (!x.isFinite()) return new Ctor(NaN);
  12320. if (x.isZero()) return new Ctor(x);
  12321. pr = Ctor.precision;
  12322. rm = Ctor.rounding;
  12323. Ctor.precision = pr + 10;
  12324. Ctor.rounding = 1;
  12325. x = x.sin();
  12326. x.s = 1;
  12327. x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);
  12328. Ctor.precision = pr;
  12329. Ctor.rounding = rm;
  12330. return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);
  12331. };
  12332. /*
  12333. * n * 0 = 0
  12334. * n * N = N
  12335. * n * I = I
  12336. * 0 * n = 0
  12337. * 0 * 0 = 0
  12338. * 0 * N = N
  12339. * 0 * I = N
  12340. * N * n = N
  12341. * N * 0 = N
  12342. * N * N = N
  12343. * N * I = N
  12344. * I * n = I
  12345. * I * 0 = N
  12346. * I * N = N
  12347. * I * I = I
  12348. *
  12349. * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant
  12350. * digits using rounding mode `rounding`.
  12351. *
  12352. */
  12353. P.times = P.mul = function (y) {
  12354. var carry,
  12355. e,
  12356. i,
  12357. k,
  12358. r,
  12359. rL,
  12360. t,
  12361. xdL,
  12362. ydL,
  12363. x = this,
  12364. Ctor = x.constructor,
  12365. xd = x.d,
  12366. yd = (y = new Ctor(y)).d;
  12367. y.s *= x.s;
  12368. // If either is NaN, ±Infinity or ±0...
  12369. if (!xd || !xd[0] || !yd || !yd[0]) {
  12370. return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd
  12371. // Return NaN if either is NaN.
  12372. // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.
  12373. ? NaN
  12374. // Return ±Infinity if either is ±Infinity.
  12375. // Return ±0 if either is ±0.
  12376. : !xd || !yd ? y.s / 0 : y.s * 0);
  12377. }
  12378. e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);
  12379. xdL = xd.length;
  12380. ydL = yd.length;
  12381. // Ensure xd points to the longer array.
  12382. if (xdL < ydL) {
  12383. r = xd;
  12384. xd = yd;
  12385. yd = r;
  12386. rL = xdL;
  12387. xdL = ydL;
  12388. ydL = rL;
  12389. }
  12390. // Initialise the result array with zeros.
  12391. r = [];
  12392. rL = xdL + ydL;
  12393. for (i = rL; i--;) {
  12394. r.push(0);
  12395. }
  12396. // Multiply!
  12397. for (i = ydL; --i >= 0;) {
  12398. carry = 0;
  12399. for (k = xdL + i; k > i;) {
  12400. t = r[k] + yd[i] * xd[k - i - 1] + carry;
  12401. r[k--] = t % BASE | 0;
  12402. carry = t / BASE | 0;
  12403. }
  12404. r[k] = (r[k] + carry) % BASE | 0;
  12405. }
  12406. // Remove trailing zeros.
  12407. for (; !r[--rL];) {
  12408. r.pop();
  12409. }
  12410. if (carry) ++e;else r.shift();
  12411. y.d = r;
  12412. y.e = getBase10Exponent(r, e);
  12413. return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;
  12414. };
  12415. /*
  12416. * Return a string representing the value of this Decimal in base 2, round to `sd` significant
  12417. * digits using rounding mode `rm`.
  12418. *
  12419. * If the optional `sd` argument is present then return binary exponential notation.
  12420. *
  12421. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  12422. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12423. *
  12424. */
  12425. P.toBinary = function (sd, rm) {
  12426. return toStringBinary(this, 2, sd, rm);
  12427. };
  12428. /*
  12429. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`
  12430. * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.
  12431. *
  12432. * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.
  12433. *
  12434. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  12435. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12436. *
  12437. */
  12438. P.toDecimalPlaces = P.toDP = function (dp, rm) {
  12439. var x = this,
  12440. Ctor = x.constructor;
  12441. x = new Ctor(x);
  12442. if (dp === void 0) return x;
  12443. checkInt32(dp, 0, MAX_DIGITS);
  12444. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  12445. return finalise(x, dp + x.e + 1, rm);
  12446. };
  12447. /*
  12448. * Return a string representing the value of this Decimal in exponential notation rounded to
  12449. * `dp` fixed decimal places using rounding mode `rounding`.
  12450. *
  12451. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  12452. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12453. *
  12454. */
  12455. P.toExponential = function (dp, rm) {
  12456. var str,
  12457. x = this,
  12458. Ctor = x.constructor;
  12459. if (dp === void 0) {
  12460. str = finiteToString(x, true);
  12461. } else {
  12462. checkInt32(dp, 0, MAX_DIGITS);
  12463. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  12464. x = finalise(new Ctor(x), dp + 1, rm);
  12465. str = finiteToString(x, true, dp + 1);
  12466. }
  12467. return x.isNeg() && !x.isZero() ? '-' + str : str;
  12468. };
  12469. /*
  12470. * Return a string representing the value of this Decimal in normal (fixed-point) notation to
  12471. * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is
  12472. * omitted.
  12473. *
  12474. * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
  12475. *
  12476. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  12477. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12478. *
  12479. * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
  12480. * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
  12481. * (-0).toFixed(3) is '0.000'.
  12482. * (-0.5).toFixed(0) is '-0'.
  12483. *
  12484. */
  12485. P.toFixed = function (dp, rm) {
  12486. var str,
  12487. y,
  12488. x = this,
  12489. Ctor = x.constructor;
  12490. if (dp === void 0) {
  12491. str = finiteToString(x);
  12492. } else {
  12493. checkInt32(dp, 0, MAX_DIGITS);
  12494. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  12495. y = finalise(new Ctor(x), dp + x.e + 1, rm);
  12496. str = finiteToString(y, false, dp + y.e + 1);
  12497. }
  12498. // To determine whether to add the minus sign look at the value before it was rounded,
  12499. // i.e. look at `x` rather than `y`.
  12500. return x.isNeg() && !x.isZero() ? '-' + str : str;
  12501. };
  12502. /*
  12503. * Return an array representing the value of this Decimal as a simple fraction with an integer
  12504. * numerator and an integer denominator.
  12505. *
  12506. * The denominator will be a positive non-zero value less than or equal to the specified maximum
  12507. * denominator. If a maximum denominator is not specified, the denominator will be the lowest
  12508. * value necessary to represent the number exactly.
  12509. *
  12510. * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.
  12511. *
  12512. */
  12513. P.toFraction = function (maxD) {
  12514. var d,
  12515. d0,
  12516. d1,
  12517. d2,
  12518. e,
  12519. k,
  12520. n,
  12521. n0,
  12522. n1,
  12523. pr,
  12524. q,
  12525. r,
  12526. x = this,
  12527. xd = x.d,
  12528. Ctor = x.constructor;
  12529. if (!xd) return new Ctor(x);
  12530. n1 = d0 = new Ctor(1);
  12531. d1 = n0 = new Ctor(0);
  12532. d = new Ctor(d1);
  12533. e = d.e = getPrecision(xd) - x.e - 1;
  12534. k = e % LOG_BASE;
  12535. d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);
  12536. if (maxD == null) {
  12537. // d is 10**e, the minimum max-denominator needed.
  12538. maxD = e > 0 ? d : n1;
  12539. } else {
  12540. n = new Ctor(maxD);
  12541. if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);
  12542. maxD = n.gt(d) ? e > 0 ? d : n1 : n;
  12543. }
  12544. external = false;
  12545. n = new Ctor(digitsToString(xd));
  12546. pr = Ctor.precision;
  12547. Ctor.precision = e = xd.length * LOG_BASE * 2;
  12548. for (;;) {
  12549. q = divide(n, d, 0, 1, 1);
  12550. d2 = d0.plus(q.times(d1));
  12551. if (d2.cmp(maxD) == 1) break;
  12552. d0 = d1;
  12553. d1 = d2;
  12554. d2 = n1;
  12555. n1 = n0.plus(q.times(d2));
  12556. n0 = d2;
  12557. d2 = d;
  12558. d = n.minus(q.times(d2));
  12559. n = d2;
  12560. }
  12561. d2 = divide(maxD.minus(d0), d1, 0, 1, 1);
  12562. n0 = n0.plus(d2.times(n1));
  12563. d0 = d0.plus(d2.times(d1));
  12564. n0.s = n1.s = x.s;
  12565. // Determine which fraction is closer to x, n0/d0 or n1/d1?
  12566. r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
  12567. Ctor.precision = pr;
  12568. external = true;
  12569. return r;
  12570. };
  12571. /*
  12572. * Return a string representing the value of this Decimal in base 16, round to `sd` significant
  12573. * digits using rounding mode `rm`.
  12574. *
  12575. * If the optional `sd` argument is present then return binary exponential notation.
  12576. *
  12577. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  12578. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12579. *
  12580. */
  12581. P.toHexadecimal = P.toHex = function (sd, rm) {
  12582. return toStringBinary(this, 16, sd, rm);
  12583. };
  12584. /*
  12585. * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding
  12586. * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.
  12587. *
  12588. * The return value will always have the same sign as this Decimal, unless either this Decimal
  12589. * or `y` is NaN, in which case the return value will be also be NaN.
  12590. *
  12591. * The return value is not affected by the value of `precision`.
  12592. *
  12593. * y {number|string|Decimal} The magnitude to round to a multiple of.
  12594. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12595. *
  12596. * 'toNearest() rounding mode not an integer: {rm}'
  12597. * 'toNearest() rounding mode out of range: {rm}'
  12598. *
  12599. */
  12600. P.toNearest = function (y, rm) {
  12601. var x = this,
  12602. Ctor = x.constructor;
  12603. x = new Ctor(x);
  12604. if (y == null) {
  12605. // If x is not finite, return x.
  12606. if (!x.d) return x;
  12607. y = new Ctor(1);
  12608. rm = Ctor.rounding;
  12609. } else {
  12610. y = new Ctor(y);
  12611. if (rm === void 0) {
  12612. rm = Ctor.rounding;
  12613. } else {
  12614. checkInt32(rm, 0, 8);
  12615. }
  12616. // If x is not finite, return x if y is not NaN, else NaN.
  12617. if (!x.d) return y.s ? x : y;
  12618. // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.
  12619. if (!y.d) {
  12620. if (y.s) y.s = x.s;
  12621. return y;
  12622. }
  12623. }
  12624. // If y is not zero, calculate the nearest multiple of y to x.
  12625. if (y.d[0]) {
  12626. external = false;
  12627. x = divide(x, y, 0, rm, 1).times(y);
  12628. external = true;
  12629. finalise(x);
  12630. // If y is zero, return zero with the sign of x.
  12631. } else {
  12632. y.s = x.s;
  12633. x = y;
  12634. }
  12635. return x;
  12636. };
  12637. /*
  12638. * Return the value of this Decimal converted to a number primitive.
  12639. * Zero keeps its sign.
  12640. *
  12641. */
  12642. P.toNumber = function () {
  12643. return +this;
  12644. };
  12645. /*
  12646. * Return a string representing the value of this Decimal in base 8, round to `sd` significant
  12647. * digits using rounding mode `rm`.
  12648. *
  12649. * If the optional `sd` argument is present then return binary exponential notation.
  12650. *
  12651. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  12652. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12653. *
  12654. */
  12655. P.toOctal = function (sd, rm) {
  12656. return toStringBinary(this, 8, sd, rm);
  12657. };
  12658. /*
  12659. * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded
  12660. * to `precision` significant digits using rounding mode `rounding`.
  12661. *
  12662. * ECMAScript compliant.
  12663. *
  12664. * pow(x, NaN) = NaN
  12665. * pow(x, ±0) = 1
  12666. * pow(NaN, non-zero) = NaN
  12667. * pow(abs(x) > 1, +Infinity) = +Infinity
  12668. * pow(abs(x) > 1, -Infinity) = +0
  12669. * pow(abs(x) == 1, ±Infinity) = NaN
  12670. * pow(abs(x) < 1, +Infinity) = +0
  12671. * pow(abs(x) < 1, -Infinity) = +Infinity
  12672. * pow(+Infinity, y > 0) = +Infinity
  12673. * pow(+Infinity, y < 0) = +0
  12674. * pow(-Infinity, odd integer > 0) = -Infinity
  12675. * pow(-Infinity, even integer > 0) = +Infinity
  12676. * pow(-Infinity, odd integer < 0) = -0
  12677. * pow(-Infinity, even integer < 0) = +0
  12678. * pow(+0, y > 0) = +0
  12679. * pow(+0, y < 0) = +Infinity
  12680. * pow(-0, odd integer > 0) = -0
  12681. * pow(-0, even integer > 0) = +0
  12682. * pow(-0, odd integer < 0) = -Infinity
  12683. * pow(-0, even integer < 0) = +Infinity
  12684. * pow(finite x < 0, finite non-integer) = NaN
  12685. *
  12686. * For non-integer or very large exponents pow(x, y) is calculated using
  12687. *
  12688. * x^y = exp(y*ln(x))
  12689. *
  12690. * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the
  12691. * probability of an incorrectly rounded result
  12692. * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14
  12693. * i.e. 1 in 250,000,000,000,000
  12694. *
  12695. * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).
  12696. *
  12697. * y {number|string|Decimal} The power to which to raise this Decimal.
  12698. *
  12699. */
  12700. P.toPower = P.pow = function (y) {
  12701. var e,
  12702. k,
  12703. pr,
  12704. r,
  12705. rm,
  12706. s,
  12707. x = this,
  12708. Ctor = x.constructor,
  12709. yn = +(y = new Ctor(y));
  12710. // Either ±Infinity, NaN or ±0?
  12711. if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));
  12712. x = new Ctor(x);
  12713. if (x.eq(1)) return x;
  12714. pr = Ctor.precision;
  12715. rm = Ctor.rounding;
  12716. if (y.eq(1)) return finalise(x, pr, rm);
  12717. // y exponent
  12718. e = mathfloor(y.e / LOG_BASE);
  12719. // If y is a small integer use the 'exponentiation by squaring' algorithm.
  12720. if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
  12721. r = intPow(Ctor, x, k, pr);
  12722. return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
  12723. }
  12724. s = x.s;
  12725. // if x is negative
  12726. if (s < 0) {
  12727. // if y is not an integer
  12728. if (e < y.d.length - 1) return new Ctor(NaN);
  12729. // Result is positive if x is negative and the last digit of integer y is even.
  12730. if ((y.d[e] & 1) == 0) s = 1;
  12731. // if x.eq(-1)
  12732. if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {
  12733. x.s = s;
  12734. return x;
  12735. }
  12736. }
  12737. // Estimate result exponent.
  12738. // x^y = 10^e, where e = y * log10(x)
  12739. // log10(x) = log10(x_significand) + x_exponent
  12740. // log10(x_significand) = ln(x_significand) / ln(10)
  12741. k = mathpow(+x, yn);
  12742. e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + '').e;
  12743. // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.
  12744. // Overflow/underflow?
  12745. if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);
  12746. external = false;
  12747. Ctor.rounding = x.s = 1;
  12748. // Estimate the extra guard digits needed to ensure five correct rounding digits from
  12749. // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):
  12750. // new Decimal(2.32456).pow('2087987436534566.46411')
  12751. // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815
  12752. k = Math.min(12, (e + '').length);
  12753. // r = x^y = exp(y*ln(x))
  12754. r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);
  12755. // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)
  12756. if (r.d) {
  12757. // Truncate to the required precision plus five rounding digits.
  12758. r = finalise(r, pr + 5, 1);
  12759. // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate
  12760. // the result.
  12761. if (checkRoundingDigits(r.d, pr, rm)) {
  12762. e = pr + 10;
  12763. // Truncate to the increased precision plus five rounding digits.
  12764. r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);
  12765. // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).
  12766. if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {
  12767. r = finalise(r, pr + 1, 0);
  12768. }
  12769. }
  12770. }
  12771. r.s = s;
  12772. external = true;
  12773. Ctor.rounding = rm;
  12774. return finalise(r, pr, rm);
  12775. };
  12776. /*
  12777. * Return a string representing the value of this Decimal rounded to `sd` significant digits
  12778. * using rounding mode `rounding`.
  12779. *
  12780. * Return exponential notation if `sd` is less than the number of digits necessary to represent
  12781. * the integer part of the value in normal notation.
  12782. *
  12783. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  12784. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12785. *
  12786. */
  12787. P.toPrecision = function (sd, rm) {
  12788. var str,
  12789. x = this,
  12790. Ctor = x.constructor;
  12791. if (sd === void 0) {
  12792. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  12793. } else {
  12794. checkInt32(sd, 1, MAX_DIGITS);
  12795. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  12796. x = finalise(new Ctor(x), sd, rm);
  12797. str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);
  12798. }
  12799. return x.isNeg() && !x.isZero() ? '-' + str : str;
  12800. };
  12801. /*
  12802. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`
  12803. * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if
  12804. * omitted.
  12805. *
  12806. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  12807. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  12808. *
  12809. * 'toSD() digits out of range: {sd}'
  12810. * 'toSD() digits not an integer: {sd}'
  12811. * 'toSD() rounding mode not an integer: {rm}'
  12812. * 'toSD() rounding mode out of range: {rm}'
  12813. *
  12814. */
  12815. P.toSignificantDigits = P.toSD = function (sd, rm) {
  12816. var x = this,
  12817. Ctor = x.constructor;
  12818. if (sd === void 0) {
  12819. sd = Ctor.precision;
  12820. rm = Ctor.rounding;
  12821. } else {
  12822. checkInt32(sd, 1, MAX_DIGITS);
  12823. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  12824. }
  12825. return finalise(new Ctor(x), sd, rm);
  12826. };
  12827. /*
  12828. * Return a string representing the value of this Decimal.
  12829. *
  12830. * Return exponential notation if this Decimal has a positive exponent equal to or greater than
  12831. * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.
  12832. *
  12833. */
  12834. P.toString = function () {
  12835. var x = this,
  12836. Ctor = x.constructor,
  12837. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  12838. return x.isNeg() && !x.isZero() ? '-' + str : str;
  12839. };
  12840. /*
  12841. * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.
  12842. *
  12843. */
  12844. P.truncated = P.trunc = function () {
  12845. return finalise(new this.constructor(this), this.e + 1, 1);
  12846. };
  12847. /*
  12848. * Return a string representing the value of this Decimal.
  12849. * Unlike `toString`, negative zero will include the minus sign.
  12850. *
  12851. */
  12852. P.valueOf = P.toJSON = function () {
  12853. var x = this,
  12854. Ctor = x.constructor,
  12855. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  12856. return x.isNeg() ? '-' + str : str;
  12857. };
  12858. // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.
  12859. /*
  12860. * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,
  12861. * finiteToString, naturalExponential, naturalLogarithm
  12862. * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,
  12863. * P.toPrecision, P.toSignificantDigits, toStringBinary, random
  12864. * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm
  12865. * convertBase toStringBinary, parseOther
  12866. * cos P.cos
  12867. * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,
  12868. * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,
  12869. * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,
  12870. * taylorSeries, atan2, parseOther
  12871. * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,
  12872. * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,
  12873. * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,
  12874. * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,
  12875. * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,
  12876. * P.truncated, divide, getLn10, getPi, naturalExponential,
  12877. * naturalLogarithm, ceil, floor, round, trunc
  12878. * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,
  12879. * toStringBinary
  12880. * getBase10Exponent P.minus, P.plus, P.times, parseOther
  12881. * getLn10 P.logarithm, naturalLogarithm
  12882. * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2
  12883. * getPrecision P.precision, P.toFraction
  12884. * getZeroString digitsToString, finiteToString
  12885. * intPow P.toPower, parseOther
  12886. * isOdd toLessThanHalfPi
  12887. * maxOrMin max, min
  12888. * naturalExponential P.naturalExponential, P.toPower
  12889. * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,
  12890. * P.toPower, naturalExponential
  12891. * nonFiniteToString finiteToString, toStringBinary
  12892. * parseDecimal Decimal
  12893. * parseOther Decimal
  12894. * sin P.sin
  12895. * taylorSeries P.cosh, P.sinh, cos, sin
  12896. * toLessThanHalfPi P.cos, P.sin
  12897. * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal
  12898. * truncate intPow
  12899. *
  12900. * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,
  12901. * naturalLogarithm, config, parseOther, random, Decimal
  12902. */
  12903. function digitsToString(d) {
  12904. var i,
  12905. k,
  12906. ws,
  12907. indexOfLastWord = d.length - 1,
  12908. str = '',
  12909. w = d[0];
  12910. if (indexOfLastWord > 0) {
  12911. str += w;
  12912. for (i = 1; i < indexOfLastWord; i++) {
  12913. ws = d[i] + '';
  12914. k = LOG_BASE - ws.length;
  12915. if (k) str += getZeroString(k);
  12916. str += ws;
  12917. }
  12918. w = d[i];
  12919. ws = w + '';
  12920. k = LOG_BASE - ws.length;
  12921. if (k) str += getZeroString(k);
  12922. } else if (w === 0) {
  12923. return '0';
  12924. }
  12925. // Remove trailing zeros of last w.
  12926. for (; w % 10 === 0;) {
  12927. w /= 10;
  12928. }
  12929. return str + w;
  12930. }
  12931. function checkInt32(i, min, max) {
  12932. if (i !== ~~i || i < min || i > max) {
  12933. throw Error(invalidArgument + i);
  12934. }
  12935. }
  12936. /*
  12937. * Check 5 rounding digits if `repeating` is null, 4 otherwise.
  12938. * `repeating == null` if caller is `log` or `pow`,
  12939. * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.
  12940. */
  12941. function checkRoundingDigits(d, i, rm, repeating) {
  12942. var di, k, r, rd;
  12943. // Get the length of the first word of the array d.
  12944. for (k = d[0]; k >= 10; k /= 10) {
  12945. --i;
  12946. }
  12947. // Is the rounding digit in the first word of d?
  12948. if (--i < 0) {
  12949. i += LOG_BASE;
  12950. di = 0;
  12951. } else {
  12952. di = Math.ceil((i + 1) / LOG_BASE);
  12953. i %= LOG_BASE;
  12954. }
  12955. // i is the index (0 - 6) of the rounding digit.
  12956. // E.g. if within the word 3487563 the first rounding digit is 5,
  12957. // then i = 4, k = 1000, rd = 3487563 % 1000 = 563
  12958. k = mathpow(10, LOG_BASE - i);
  12959. rd = d[di] % k | 0;
  12960. if (repeating == null) {
  12961. if (i < 3) {
  12962. if (i == 0) rd = rd / 100 | 0;else if (i == 1) rd = rd / 10 | 0;
  12963. r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;
  12964. } else {
  12965. r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
  12966. }
  12967. } else {
  12968. if (i < 4) {
  12969. if (i == 0) rd = rd / 1000 | 0;else if (i == 1) rd = rd / 100 | 0;else if (i == 2) rd = rd / 10 | 0;
  12970. r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;
  12971. } else {
  12972. r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;
  12973. }
  12974. }
  12975. return r;
  12976. }
  12977. // Convert string of `baseIn` to an array of numbers of `baseOut`.
  12978. // Eg. convertBase('255', 10, 16) returns [15, 15].
  12979. // Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
  12980. function convertBase(str, baseIn, baseOut) {
  12981. var j,
  12982. arr = [0],
  12983. arrL,
  12984. i = 0,
  12985. strL = str.length;
  12986. for (; i < strL;) {
  12987. for (arrL = arr.length; arrL--;) {
  12988. arr[arrL] *= baseIn;
  12989. }
  12990. arr[0] += NUMERALS.indexOf(str.charAt(i++));
  12991. for (j = 0; j < arr.length; j++) {
  12992. if (arr[j] > baseOut - 1) {
  12993. if (arr[j + 1] === void 0) arr[j + 1] = 0;
  12994. arr[j + 1] += arr[j] / baseOut | 0;
  12995. arr[j] %= baseOut;
  12996. }
  12997. }
  12998. }
  12999. return arr.reverse();
  13000. }
  13001. /*
  13002. * cos(x) = 1 - x^2/2! + x^4/4! - ...
  13003. * |x| < pi/2
  13004. *
  13005. */
  13006. function cosine(Ctor, x) {
  13007. var k, len, y;
  13008. if (x.isZero()) return x;
  13009. // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1
  13010. // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1
  13011. // Estimate the optimum number of times to use the argument reduction.
  13012. len = x.d.length;
  13013. if (len < 32) {
  13014. k = Math.ceil(len / 3);
  13015. y = (1 / tinyPow(4, k)).toString();
  13016. } else {
  13017. k = 16;
  13018. y = '2.3283064365386962890625e-10';
  13019. }
  13020. Ctor.precision += k;
  13021. x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));
  13022. // Reverse argument reduction
  13023. for (var i = k; i--;) {
  13024. var cos2x = x.times(x);
  13025. x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);
  13026. }
  13027. Ctor.precision -= k;
  13028. return x;
  13029. }
  13030. /*
  13031. * Perform division in the specified base.
  13032. */
  13033. var divide = function () {
  13034. // Assumes non-zero x and k, and hence non-zero result.
  13035. function multiplyInteger(x, k, base) {
  13036. var temp,
  13037. carry = 0,
  13038. i = x.length;
  13039. for (x = x.slice(); i--;) {
  13040. temp = x[i] * k + carry;
  13041. x[i] = temp % base | 0;
  13042. carry = temp / base | 0;
  13043. }
  13044. if (carry) x.unshift(carry);
  13045. return x;
  13046. }
  13047. function compare(a, b, aL, bL) {
  13048. var i, r;
  13049. if (aL != bL) {
  13050. r = aL > bL ? 1 : -1;
  13051. } else {
  13052. for (i = r = 0; i < aL; i++) {
  13053. if (a[i] != b[i]) {
  13054. r = a[i] > b[i] ? 1 : -1;
  13055. break;
  13056. }
  13057. }
  13058. }
  13059. return r;
  13060. }
  13061. function subtract(a, b, aL, base) {
  13062. var i = 0;
  13063. // Subtract b from a.
  13064. for (; aL--;) {
  13065. a[aL] -= i;
  13066. i = a[aL] < b[aL] ? 1 : 0;
  13067. a[aL] = i * base + a[aL] - b[aL];
  13068. }
  13069. // Remove leading zeros.
  13070. for (; !a[0] && a.length > 1;) {
  13071. a.shift();
  13072. }
  13073. }
  13074. return function (x, y, pr, rm, dp, base) {
  13075. var cmp,
  13076. e,
  13077. i,
  13078. k,
  13079. logBase,
  13080. more,
  13081. prod,
  13082. prodL,
  13083. q,
  13084. qd,
  13085. rem,
  13086. remL,
  13087. rem0,
  13088. sd,
  13089. t,
  13090. xi,
  13091. xL,
  13092. yd0,
  13093. yL,
  13094. yz,
  13095. Ctor = x.constructor,
  13096. sign = x.s == y.s ? 1 : -1,
  13097. xd = x.d,
  13098. yd = y.d;
  13099. // Either NaN, Infinity or 0?
  13100. if (!xd || !xd[0] || !yd || !yd[0]) {
  13101. return new Ctor(
  13102. // Return NaN if either NaN, or both Infinity or 0.
  13103. !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :
  13104. // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
  13105. xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);
  13106. }
  13107. if (base) {
  13108. logBase = 1;
  13109. e = x.e - y.e;
  13110. } else {
  13111. base = BASE;
  13112. logBase = LOG_BASE;
  13113. e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);
  13114. }
  13115. yL = yd.length;
  13116. xL = xd.length;
  13117. q = new Ctor(sign);
  13118. qd = q.d = [];
  13119. // Result exponent may be one less than e.
  13120. // The digit array of a Decimal from toStringBinary may have trailing zeros.
  13121. for (i = 0; yd[i] == (xd[i] || 0); i++) {
  13122. ;
  13123. }
  13124. if (yd[i] > (xd[i] || 0)) e--;
  13125. if (pr == null) {
  13126. sd = pr = Ctor.precision;
  13127. rm = Ctor.rounding;
  13128. } else if (dp) {
  13129. sd = pr + (x.e - y.e) + 1;
  13130. } else {
  13131. sd = pr;
  13132. }
  13133. if (sd < 0) {
  13134. qd.push(1);
  13135. more = true;
  13136. } else {
  13137. // Convert precision in number of base 10 digits to base 1e7 digits.
  13138. sd = sd / logBase + 2 | 0;
  13139. i = 0;
  13140. // divisor < 1e7
  13141. if (yL == 1) {
  13142. k = 0;
  13143. yd = yd[0];
  13144. sd++;
  13145. // k is the carry.
  13146. for (; (i < xL || k) && sd--; i++) {
  13147. t = k * base + (xd[i] || 0);
  13148. qd[i] = t / yd | 0;
  13149. k = t % yd | 0;
  13150. }
  13151. more = k || i < xL;
  13152. // divisor >= 1e7
  13153. } else {
  13154. // Normalise xd and yd so highest order digit of yd is >= base/2
  13155. k = base / (yd[0] + 1) | 0;
  13156. if (k > 1) {
  13157. yd = multiplyInteger(yd, k, base);
  13158. xd = multiplyInteger(xd, k, base);
  13159. yL = yd.length;
  13160. xL = xd.length;
  13161. }
  13162. xi = yL;
  13163. rem = xd.slice(0, yL);
  13164. remL = rem.length;
  13165. // Add zeros to make remainder as long as divisor.
  13166. for (; remL < yL;) {
  13167. rem[remL++] = 0;
  13168. }
  13169. yz = yd.slice();
  13170. yz.unshift(0);
  13171. yd0 = yd[0];
  13172. if (yd[1] >= base / 2) ++yd0;
  13173. do {
  13174. k = 0;
  13175. // Compare divisor and remainder.
  13176. cmp = compare(yd, rem, yL, remL);
  13177. // If divisor < remainder.
  13178. if (cmp < 0) {
  13179. // Calculate trial digit, k.
  13180. rem0 = rem[0];
  13181. if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
  13182. // k will be how many times the divisor goes into the current remainder.
  13183. k = rem0 / yd0 | 0;
  13184. // Algorithm:
  13185. // 1. product = divisor * trial digit (k)
  13186. // 2. if product > remainder: product -= divisor, k--
  13187. // 3. remainder -= product
  13188. // 4. if product was < remainder at 2:
  13189. // 5. compare new remainder and divisor
  13190. // 6. If remainder > divisor: remainder -= divisor, k++
  13191. if (k > 1) {
  13192. if (k >= base) k = base - 1;
  13193. // product = divisor * trial digit.
  13194. prod = multiplyInteger(yd, k, base);
  13195. prodL = prod.length;
  13196. remL = rem.length;
  13197. // Compare product and remainder.
  13198. cmp = compare(prod, rem, prodL, remL);
  13199. // product > remainder.
  13200. if (cmp == 1) {
  13201. k--;
  13202. // Subtract divisor from product.
  13203. subtract(prod, yL < prodL ? yz : yd, prodL, base);
  13204. }
  13205. } else {
  13206. // cmp is -1.
  13207. // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1
  13208. // to avoid it. If k is 1 there is a need to compare yd and rem again below.
  13209. if (k == 0) cmp = k = 1;
  13210. prod = yd.slice();
  13211. }
  13212. prodL = prod.length;
  13213. if (prodL < remL) prod.unshift(0);
  13214. // Subtract product from remainder.
  13215. subtract(rem, prod, remL, base);
  13216. // If product was < previous remainder.
  13217. if (cmp == -1) {
  13218. remL = rem.length;
  13219. // Compare divisor and new remainder.
  13220. cmp = compare(yd, rem, yL, remL);
  13221. // If divisor < new remainder, subtract divisor from remainder.
  13222. if (cmp < 1) {
  13223. k++;
  13224. // Subtract divisor from remainder.
  13225. subtract(rem, yL < remL ? yz : yd, remL, base);
  13226. }
  13227. }
  13228. remL = rem.length;
  13229. } else if (cmp === 0) {
  13230. k++;
  13231. rem = [0];
  13232. } // if cmp === 1, k will be 0
  13233. // Add the next digit, k, to the result array.
  13234. qd[i++] = k;
  13235. // Update the remainder.
  13236. if (cmp && rem[0]) {
  13237. rem[remL++] = xd[xi] || 0;
  13238. } else {
  13239. rem = [xd[xi]];
  13240. remL = 1;
  13241. }
  13242. } while ((xi++ < xL || rem[0] !== void 0) && sd--);
  13243. more = rem[0] !== void 0;
  13244. }
  13245. // Leading zero?
  13246. if (!qd[0]) qd.shift();
  13247. }
  13248. // logBase is 1 when divide is being used for base conversion.
  13249. if (logBase == 1) {
  13250. q.e = e;
  13251. inexact = more;
  13252. } else {
  13253. // To calculate q.e, first get the number of digits of qd[0].
  13254. for (i = 1, k = qd[0]; k >= 10; k /= 10) {
  13255. i++;
  13256. }
  13257. q.e = i + e * logBase - 1;
  13258. finalise(q, dp ? pr + q.e + 1 : pr, rm, more);
  13259. }
  13260. return q;
  13261. };
  13262. }();
  13263. /*
  13264. * Round `x` to `sd` significant digits using rounding mode `rm`.
  13265. * Check for over/under-flow.
  13266. */
  13267. function finalise(x, sd, rm, isTruncated) {
  13268. var digits,
  13269. i,
  13270. j,
  13271. k,
  13272. rd,
  13273. roundUp,
  13274. w,
  13275. xd,
  13276. xdi,
  13277. Ctor = x.constructor;
  13278. // Don't round if sd is null or undefined.
  13279. out: if (sd != null) {
  13280. xd = x.d;
  13281. // Infinity/NaN.
  13282. if (!xd) return x;
  13283. // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
  13284. // w: the word of xd containing rd, a base 1e7 number.
  13285. // xdi: the index of w within xd.
  13286. // digits: the number of digits of w.
  13287. // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
  13288. // they had leading zeros)
  13289. // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).
  13290. // Get the length of the first word of the digits array xd.
  13291. for (digits = 1, k = xd[0]; k >= 10; k /= 10) {
  13292. digits++;
  13293. }
  13294. i = sd - digits;
  13295. // Is the rounding digit in the first word of xd?
  13296. if (i < 0) {
  13297. i += LOG_BASE;
  13298. j = sd;
  13299. w = xd[xdi = 0];
  13300. // Get the rounding digit at index j of w.
  13301. rd = w / mathpow(10, digits - j - 1) % 10 | 0;
  13302. } else {
  13303. xdi = Math.ceil((i + 1) / LOG_BASE);
  13304. k = xd.length;
  13305. if (xdi >= k) {
  13306. if (isTruncated) {
  13307. // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.
  13308. for (; k++ <= xdi;) {
  13309. xd.push(0);
  13310. }
  13311. w = rd = 0;
  13312. digits = 1;
  13313. i %= LOG_BASE;
  13314. j = i - LOG_BASE + 1;
  13315. } else {
  13316. break out;
  13317. }
  13318. } else {
  13319. w = k = xd[xdi];
  13320. // Get the number of digits of w.
  13321. for (digits = 1; k >= 10; k /= 10) {
  13322. digits++;
  13323. }
  13324. // Get the index of rd within w.
  13325. i %= LOG_BASE;
  13326. // Get the index of rd within w, adjusted for leading zeros.
  13327. // The number of leading zeros of w is given by LOG_BASE - digits.
  13328. j = i - LOG_BASE + digits;
  13329. // Get the rounding digit at index j of w.
  13330. rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
  13331. }
  13332. }
  13333. // Are there any non-zero digits after the rounding digit?
  13334. isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
  13335. // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right
  13336. // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression
  13337. // will give 714.
  13338. roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&
  13339. // Check whether the digit to the left of the rounding digit is odd.
  13340. (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
  13341. if (sd < 1 || !xd[0]) {
  13342. xd.length = 0;
  13343. if (roundUp) {
  13344. // Convert sd to decimal places.
  13345. sd -= x.e + 1;
  13346. // 1, 0.1, 0.01, 0.001, 0.0001 etc.
  13347. xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
  13348. x.e = -sd || 0;
  13349. } else {
  13350. // Zero.
  13351. xd[0] = x.e = 0;
  13352. }
  13353. return x;
  13354. }
  13355. // Remove excess digits.
  13356. if (i == 0) {
  13357. xd.length = xdi;
  13358. k = 1;
  13359. xdi--;
  13360. } else {
  13361. xd.length = xdi + 1;
  13362. k = mathpow(10, LOG_BASE - i);
  13363. // E.g. 56700 becomes 56000 if 7 is the rounding digit.
  13364. // j > 0 means i > number of leading zeros of w.
  13365. xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;
  13366. }
  13367. if (roundUp) {
  13368. for (;;) {
  13369. // Is the digit to be rounded up in the first word of xd?
  13370. if (xdi == 0) {
  13371. // i will be the length of xd[0] before k is added.
  13372. for (i = 1, j = xd[0]; j >= 10; j /= 10) {
  13373. i++;
  13374. }
  13375. j = xd[0] += k;
  13376. for (k = 1; j >= 10; j /= 10) {
  13377. k++;
  13378. }
  13379. // if i != k the length has increased.
  13380. if (i != k) {
  13381. x.e++;
  13382. if (xd[0] == BASE) xd[0] = 1;
  13383. }
  13384. break;
  13385. } else {
  13386. xd[xdi] += k;
  13387. if (xd[xdi] != BASE) break;
  13388. xd[xdi--] = 0;
  13389. k = 1;
  13390. }
  13391. }
  13392. }
  13393. // Remove trailing zeros.
  13394. for (i = xd.length; xd[--i] === 0;) {
  13395. xd.pop();
  13396. }
  13397. }
  13398. if (external) {
  13399. // Overflow?
  13400. if (x.e > Ctor.maxE) {
  13401. // Infinity.
  13402. x.d = null;
  13403. x.e = NaN;
  13404. // Underflow?
  13405. } else if (x.e < Ctor.minE) {
  13406. // Zero.
  13407. x.e = 0;
  13408. x.d = [0];
  13409. // Ctor.underflow = true;
  13410. } // else Ctor.underflow = false;
  13411. }
  13412. return x;
  13413. }
  13414. function finiteToString(x, isExp, sd) {
  13415. if (!x.isFinite()) return nonFiniteToString(x);
  13416. var k,
  13417. e = x.e,
  13418. str = digitsToString(x.d),
  13419. len = str.length;
  13420. if (isExp) {
  13421. if (sd && (k = sd - len) > 0) {
  13422. str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);
  13423. } else if (len > 1) {
  13424. str = str.charAt(0) + '.' + str.slice(1);
  13425. }
  13426. str = str + (x.e < 0 ? 'e' : 'e+') + x.e;
  13427. } else if (e < 0) {
  13428. str = '0.' + getZeroString(-e - 1) + str;
  13429. if (sd && (k = sd - len) > 0) str += getZeroString(k);
  13430. } else if (e >= len) {
  13431. str += getZeroString(e + 1 - len);
  13432. if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);
  13433. } else {
  13434. if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);
  13435. if (sd && (k = sd - len) > 0) {
  13436. if (e + 1 === len) str += '.';
  13437. str += getZeroString(k);
  13438. }
  13439. }
  13440. return str;
  13441. }
  13442. // Calculate the base 10 exponent from the base 1e7 exponent.
  13443. function getBase10Exponent(digits, e) {
  13444. var w = digits[0];
  13445. // Add the number of digits of the first word of the digits array.
  13446. for (e *= LOG_BASE; w >= 10; w /= 10) {
  13447. e++;
  13448. }
  13449. return e;
  13450. }
  13451. function getLn10(Ctor, sd, pr) {
  13452. if (sd > LN10_PRECISION) {
  13453. // Reset global state in case the exception is caught.
  13454. external = true;
  13455. if (pr) Ctor.precision = pr;
  13456. throw Error(precisionLimitExceeded);
  13457. }
  13458. return finalise(new Ctor(LN10), sd, 1, true);
  13459. }
  13460. function getPi(Ctor, sd, rm) {
  13461. if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);
  13462. return finalise(new Ctor(PI), sd, rm, true);
  13463. }
  13464. function getPrecision(digits) {
  13465. var w = digits.length - 1,
  13466. len = w * LOG_BASE + 1;
  13467. w = digits[w];
  13468. // If non-zero...
  13469. if (w) {
  13470. // Subtract the number of trailing zeros of the last word.
  13471. for (; w % 10 == 0; w /= 10) {
  13472. len--;
  13473. }
  13474. // Add the number of digits of the first word.
  13475. for (w = digits[0]; w >= 10; w /= 10) {
  13476. len++;
  13477. }
  13478. }
  13479. return len;
  13480. }
  13481. function getZeroString(k) {
  13482. var zs = '';
  13483. for (; k--;) {
  13484. zs += '0';
  13485. }
  13486. return zs;
  13487. }
  13488. /*
  13489. * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an
  13490. * integer of type number.
  13491. *
  13492. * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.
  13493. *
  13494. */
  13495. function intPow(Ctor, x, n, pr) {
  13496. var isTruncated,
  13497. r = new Ctor(1),
  13498. // Max n of 9007199254740991 takes 53 loop iterations.
  13499. // Maximum digits array length; leaves [28, 34] guard digits.
  13500. k = Math.ceil(pr / LOG_BASE + 4);
  13501. external = false;
  13502. for (;;) {
  13503. if (n % 2) {
  13504. r = r.times(x);
  13505. if (truncate(r.d, k)) isTruncated = true;
  13506. }
  13507. n = mathfloor(n / 2);
  13508. if (n === 0) {
  13509. // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.
  13510. n = r.d.length - 1;
  13511. if (isTruncated && r.d[n] === 0) ++r.d[n];
  13512. break;
  13513. }
  13514. x = x.times(x);
  13515. truncate(x.d, k);
  13516. }
  13517. external = true;
  13518. return r;
  13519. }
  13520. function isOdd(n) {
  13521. return n.d[n.d.length - 1] & 1;
  13522. }
  13523. /*
  13524. * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.
  13525. */
  13526. function maxOrMin(Ctor, args, ltgt) {
  13527. var y,
  13528. x = new Ctor(args[0]),
  13529. i = 0;
  13530. for (; ++i < args.length;) {
  13531. y = new Ctor(args[i]);
  13532. if (!y.s) {
  13533. x = y;
  13534. break;
  13535. } else if (x[ltgt](y)) {
  13536. x = y;
  13537. }
  13538. }
  13539. return x;
  13540. }
  13541. /*
  13542. * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant
  13543. * digits.
  13544. *
  13545. * Taylor/Maclaurin series.
  13546. *
  13547. * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...
  13548. *
  13549. * Argument reduction:
  13550. * Repeat x = x / 32, k += 5, until |x| < 0.1
  13551. * exp(x) = exp(x / 2^k)^(2^k)
  13552. *
  13553. * Previously, the argument was initially reduced by
  13554. * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)
  13555. * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was
  13556. * found to be slower than just dividing repeatedly by 32 as above.
  13557. *
  13558. * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000
  13559. * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000
  13560. * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)
  13561. *
  13562. * exp(Infinity) = Infinity
  13563. * exp(-Infinity) = 0
  13564. * exp(NaN) = NaN
  13565. * exp(±0) = 1
  13566. *
  13567. * exp(x) is non-terminating for any finite, non-zero x.
  13568. *
  13569. * The result will always be correctly rounded.
  13570. *
  13571. */
  13572. function naturalExponential(x, sd) {
  13573. var denominator,
  13574. guard,
  13575. j,
  13576. pow,
  13577. sum,
  13578. t,
  13579. wpr,
  13580. rep = 0,
  13581. i = 0,
  13582. k = 0,
  13583. Ctor = x.constructor,
  13584. rm = Ctor.rounding,
  13585. pr = Ctor.precision;
  13586. // 0/NaN/Infinity?
  13587. if (!x.d || !x.d[0] || x.e > 17) {
  13588. return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0);
  13589. }
  13590. if (sd == null) {
  13591. external = false;
  13592. wpr = pr;
  13593. } else {
  13594. wpr = sd;
  13595. }
  13596. t = new Ctor(0.03125);
  13597. // while abs(x) >= 0.1
  13598. while (x.e > -2) {
  13599. // x = x / 2^5
  13600. x = x.times(t);
  13601. k += 5;
  13602. }
  13603. // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision
  13604. // necessary to ensure the first 4 rounding digits are correct.
  13605. guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;
  13606. wpr += guard;
  13607. denominator = pow = sum = new Ctor(1);
  13608. Ctor.precision = wpr;
  13609. for (;;) {
  13610. pow = finalise(pow.times(x), wpr, 1);
  13611. denominator = denominator.times(++i);
  13612. t = sum.plus(divide(pow, denominator, wpr, 1));
  13613. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  13614. j = k;
  13615. while (j--) {
  13616. sum = finalise(sum.times(sum), wpr, 1);
  13617. }
  13618. // Check to see if the first 4 rounding digits are [49]999.
  13619. // If so, repeat the summation with a higher precision, otherwise
  13620. // e.g. with precision: 18, rounding: 1
  13621. // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)
  13622. // `wpr - guard` is the index of first rounding digit.
  13623. if (sd == null) {
  13624. if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  13625. Ctor.precision = wpr += 10;
  13626. denominator = pow = t = new Ctor(1);
  13627. i = 0;
  13628. rep++;
  13629. } else {
  13630. return finalise(sum, Ctor.precision = pr, rm, external = true);
  13631. }
  13632. } else {
  13633. Ctor.precision = pr;
  13634. return sum;
  13635. }
  13636. }
  13637. sum = t;
  13638. }
  13639. }
  13640. /*
  13641. * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant
  13642. * digits.
  13643. *
  13644. * ln(-n) = NaN
  13645. * ln(0) = -Infinity
  13646. * ln(-0) = -Infinity
  13647. * ln(1) = 0
  13648. * ln(Infinity) = Infinity
  13649. * ln(-Infinity) = NaN
  13650. * ln(NaN) = NaN
  13651. *
  13652. * ln(n) (n != 1) is non-terminating.
  13653. *
  13654. */
  13655. function naturalLogarithm(y, sd) {
  13656. var c,
  13657. c0,
  13658. denominator,
  13659. e,
  13660. numerator,
  13661. rep,
  13662. sum,
  13663. t,
  13664. wpr,
  13665. x1,
  13666. x2,
  13667. n = 1,
  13668. guard = 10,
  13669. x = y,
  13670. xd = x.d,
  13671. Ctor = x.constructor,
  13672. rm = Ctor.rounding,
  13673. pr = Ctor.precision;
  13674. // Is x negative or Infinity, NaN, 0 or 1?
  13675. if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {
  13676. return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
  13677. }
  13678. if (sd == null) {
  13679. external = false;
  13680. wpr = pr;
  13681. } else {
  13682. wpr = sd;
  13683. }
  13684. Ctor.precision = wpr += guard;
  13685. c = digitsToString(xd);
  13686. c0 = c.charAt(0);
  13687. if (Math.abs(e = x.e) < 1.5e15) {
  13688. // Argument reduction.
  13689. // The series converges faster the closer the argument is to 1, so using
  13690. // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b
  13691. // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,
  13692. // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can
  13693. // later be divided by this number, then separate out the power of 10 using
  13694. // ln(a*10^b) = ln(a) + b*ln(10).
  13695. // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).
  13696. //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {
  13697. // max n is 6 (gives 0.7 - 1.3)
  13698. while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {
  13699. x = x.times(y);
  13700. c = digitsToString(x.d);
  13701. c0 = c.charAt(0);
  13702. n++;
  13703. }
  13704. e = x.e;
  13705. if (c0 > 1) {
  13706. x = new Ctor('0.' + c);
  13707. e++;
  13708. } else {
  13709. x = new Ctor(c0 + '.' + c.slice(1));
  13710. }
  13711. } else {
  13712. // The argument reduction method above may result in overflow if the argument y is a massive
  13713. // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this
  13714. // function using ln(x*10^e) = ln(x) + e*ln(10).
  13715. t = getLn10(Ctor, wpr + 2, pr).times(e + '');
  13716. x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);
  13717. Ctor.precision = pr;
  13718. return sd == null ? finalise(x, pr, rm, external = true) : x;
  13719. }
  13720. // x1 is x reduced to a value near 1.
  13721. x1 = x;
  13722. // Taylor series.
  13723. // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)
  13724. // where x = (y - 1)/(y + 1) (|x| < 1)
  13725. sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);
  13726. x2 = finalise(x.times(x), wpr, 1);
  13727. denominator = 3;
  13728. for (;;) {
  13729. numerator = finalise(numerator.times(x2), wpr, 1);
  13730. t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));
  13731. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  13732. sum = sum.times(2);
  13733. // Reverse the argument reduction. Check that e is not 0 because, besides preventing an
  13734. // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.
  13735. if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));
  13736. sum = divide(sum, new Ctor(n), wpr, 1);
  13737. // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has
  13738. // been repeated previously) and the first 4 rounding digits 9999?
  13739. // If so, restart the summation with a higher precision, otherwise
  13740. // e.g. with precision: 12, rounding: 1
  13741. // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.
  13742. // `wpr - guard` is the index of first rounding digit.
  13743. if (sd == null) {
  13744. if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  13745. Ctor.precision = wpr += guard;
  13746. t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);
  13747. x2 = finalise(x.times(x), wpr, 1);
  13748. denominator = rep = 1;
  13749. } else {
  13750. return finalise(sum, Ctor.precision = pr, rm, external = true);
  13751. }
  13752. } else {
  13753. Ctor.precision = pr;
  13754. return sum;
  13755. }
  13756. }
  13757. sum = t;
  13758. denominator += 2;
  13759. }
  13760. }
  13761. // ±Infinity, NaN.
  13762. function nonFiniteToString(x) {
  13763. // Unsigned.
  13764. return String(x.s * x.s / 0);
  13765. }
  13766. /*
  13767. * Parse the value of a new Decimal `x` from string `str`.
  13768. */
  13769. function parseDecimal(x, str) {
  13770. var e, i, len;
  13771. // Decimal point?
  13772. if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
  13773. // Exponential form?
  13774. if ((i = str.search(/e/i)) > 0) {
  13775. // Determine exponent.
  13776. if (e < 0) e = i;
  13777. e += +str.slice(i + 1);
  13778. str = str.substring(0, i);
  13779. } else if (e < 0) {
  13780. // Integer.
  13781. e = str.length;
  13782. }
  13783. // Determine leading zeros.
  13784. for (i = 0; str.charCodeAt(i) === 48; i++) {
  13785. ;
  13786. }
  13787. // Determine trailing zeros.
  13788. for (len = str.length; str.charCodeAt(len - 1) === 48; --len) {
  13789. ;
  13790. }
  13791. str = str.slice(i, len);
  13792. if (str) {
  13793. len -= i;
  13794. x.e = e = e - i - 1;
  13795. x.d = [];
  13796. // Transform base
  13797. // e is the base 10 exponent.
  13798. // i is where to slice str to get the first word of the digits array.
  13799. i = (e + 1) % LOG_BASE;
  13800. if (e < 0) i += LOG_BASE;
  13801. if (i < len) {
  13802. if (i) x.d.push(+str.slice(0, i));
  13803. for (len -= LOG_BASE; i < len;) {
  13804. x.d.push(+str.slice(i, i += LOG_BASE));
  13805. }
  13806. str = str.slice(i);
  13807. i = LOG_BASE - str.length;
  13808. } else {
  13809. i -= len;
  13810. }
  13811. for (; i--;) {
  13812. str += '0';
  13813. }
  13814. x.d.push(+str);
  13815. if (external) {
  13816. // Overflow?
  13817. if (x.e > x.constructor.maxE) {
  13818. // Infinity.
  13819. x.d = null;
  13820. x.e = NaN;
  13821. // Underflow?
  13822. } else if (x.e < x.constructor.minE) {
  13823. // Zero.
  13824. x.e = 0;
  13825. x.d = [0];
  13826. // x.constructor.underflow = true;
  13827. } // else x.constructor.underflow = false;
  13828. }
  13829. } else {
  13830. // Zero.
  13831. x.e = 0;
  13832. x.d = [0];
  13833. }
  13834. return x;
  13835. }
  13836. /*
  13837. * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.
  13838. */
  13839. function parseOther(x, str) {
  13840. var base, Ctor, divisor, i, isFloat, len, p, xd, xe;
  13841. if (str.indexOf('_') > -1) {
  13842. str = str.replace(/(\d)_(?=\d)/g, '$1');
  13843. if (isDecimal.test(str)) return parseDecimal(x, str);
  13844. } else if (str === 'Infinity' || str === 'NaN') {
  13845. if (!+str) x.s = NaN;
  13846. x.e = NaN;
  13847. x.d = null;
  13848. return x;
  13849. }
  13850. if (isHex.test(str)) {
  13851. base = 16;
  13852. str = str.toLowerCase();
  13853. } else if (isBinary.test(str)) {
  13854. base = 2;
  13855. } else if (isOctal.test(str)) {
  13856. base = 8;
  13857. } else {
  13858. throw Error(invalidArgument + str);
  13859. }
  13860. // Is there a binary exponent part?
  13861. i = str.search(/p/i);
  13862. if (i > 0) {
  13863. p = +str.slice(i + 1);
  13864. str = str.substring(2, i);
  13865. } else {
  13866. str = str.slice(2);
  13867. }
  13868. // Convert `str` as an integer then divide the result by `base` raised to a power such that the
  13869. // fraction part will be restored.
  13870. i = str.indexOf('.');
  13871. isFloat = i >= 0;
  13872. Ctor = x.constructor;
  13873. if (isFloat) {
  13874. str = str.replace('.', '');
  13875. len = str.length;
  13876. i = len - i;
  13877. // log[10](16) = 1.2041... , log[10](88) = 1.9444....
  13878. divisor = intPow(Ctor, new Ctor(base), i, i * 2);
  13879. }
  13880. xd = convertBase(str, base, BASE);
  13881. xe = xd.length - 1;
  13882. // Remove trailing zeros.
  13883. for (i = xe; xd[i] === 0; --i) {
  13884. xd.pop();
  13885. }
  13886. if (i < 0) return new Ctor(x.s * 0);
  13887. x.e = getBase10Exponent(xd, xe);
  13888. x.d = xd;
  13889. external = false;
  13890. // At what precision to perform the division to ensure exact conversion?
  13891. // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)
  13892. // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412
  13893. // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.
  13894. // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount
  13895. // Therefore using 4 * the number of digits of str will always be enough.
  13896. if (isFloat) x = divide(x, divisor, len * 4);
  13897. // Multiply by the binary exponent part if present.
  13898. if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
  13899. external = true;
  13900. return x;
  13901. }
  13902. /*
  13903. * sin(x) = x - x^3/3! + x^5/5! - ...
  13904. * |x| < pi/2
  13905. *
  13906. */
  13907. function sine(Ctor, x) {
  13908. var k,
  13909. len = x.d.length;
  13910. if (len < 3) {
  13911. return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);
  13912. }
  13913. // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)
  13914. // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)
  13915. // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))
  13916. // Estimate the optimum number of times to use the argument reduction.
  13917. k = 1.4 * Math.sqrt(len);
  13918. k = k > 16 ? 16 : k | 0;
  13919. x = x.times(1 / tinyPow(5, k));
  13920. x = taylorSeries(Ctor, 2, x, x);
  13921. // Reverse argument reduction
  13922. var sin2_x,
  13923. d5 = new Ctor(5),
  13924. d16 = new Ctor(16),
  13925. d20 = new Ctor(20);
  13926. for (; k--;) {
  13927. sin2_x = x.times(x);
  13928. x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));
  13929. }
  13930. return x;
  13931. }
  13932. // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.
  13933. function taylorSeries(Ctor, n, x, y, isHyperbolic) {
  13934. var j,
  13935. t,
  13936. u,
  13937. x2,
  13938. i = 1,
  13939. pr = Ctor.precision,
  13940. k = Math.ceil(pr / LOG_BASE);
  13941. external = false;
  13942. x2 = x.times(x);
  13943. u = new Ctor(y);
  13944. for (;;) {
  13945. t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);
  13946. u = isHyperbolic ? y.plus(t) : y.minus(t);
  13947. y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);
  13948. t = u.plus(y);
  13949. if (t.d[k] !== void 0) {
  13950. for (j = k; t.d[j] === u.d[j] && j--;) {
  13951. ;
  13952. }
  13953. if (j == -1) break;
  13954. }
  13955. j = u;
  13956. u = y;
  13957. y = t;
  13958. t = j;
  13959. i++;
  13960. }
  13961. external = true;
  13962. t.d.length = k + 1;
  13963. return t;
  13964. }
  13965. // Exponent e must be positive and non-zero.
  13966. function tinyPow(b, e) {
  13967. var n = b;
  13968. while (--e) {
  13969. n *= b;
  13970. }
  13971. return n;
  13972. }
  13973. // Return the absolute value of `x` reduced to less than or equal to half pi.
  13974. function toLessThanHalfPi(Ctor, x) {
  13975. var t,
  13976. isNeg = x.s < 0,
  13977. pi = getPi(Ctor, Ctor.precision, 1),
  13978. halfPi = pi.times(0.5);
  13979. x = x.abs();
  13980. if (x.lte(halfPi)) {
  13981. quadrant = isNeg ? 4 : 1;
  13982. return x;
  13983. }
  13984. t = x.divToInt(pi);
  13985. if (t.isZero()) {
  13986. quadrant = isNeg ? 3 : 2;
  13987. } else {
  13988. x = x.minus(t.times(pi));
  13989. // 0 <= x < pi
  13990. if (x.lte(halfPi)) {
  13991. quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1;
  13992. return x;
  13993. }
  13994. quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2;
  13995. }
  13996. return x.minus(pi).abs();
  13997. }
  13998. /*
  13999. * Return the value of Decimal `x` as a string in base `baseOut`.
  14000. *
  14001. * If the optional `sd` argument is present include a binary exponent suffix.
  14002. */
  14003. function toStringBinary(x, baseOut, sd, rm) {
  14004. var base,
  14005. e,
  14006. i,
  14007. k,
  14008. len,
  14009. roundUp,
  14010. str,
  14011. xd,
  14012. y,
  14013. Ctor = x.constructor,
  14014. isExp = sd !== void 0;
  14015. if (isExp) {
  14016. checkInt32(sd, 1, MAX_DIGITS);
  14017. if (rm === void 0) rm = Ctor.rounding;else checkInt32(rm, 0, 8);
  14018. } else {
  14019. sd = Ctor.precision;
  14020. rm = Ctor.rounding;
  14021. }
  14022. if (!x.isFinite()) {
  14023. str = nonFiniteToString(x);
  14024. } else {
  14025. str = finiteToString(x);
  14026. i = str.indexOf('.');
  14027. // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:
  14028. // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))
  14029. // minBinaryExponent = floor(decimalExponent * log[2](10))
  14030. // log[2](10) = 3.321928094887362347870319429489390175864
  14031. if (isExp) {
  14032. base = 2;
  14033. if (baseOut == 16) {
  14034. sd = sd * 4 - 3;
  14035. } else if (baseOut == 8) {
  14036. sd = sd * 3 - 2;
  14037. }
  14038. } else {
  14039. base = baseOut;
  14040. }
  14041. // Convert the number as an integer then divide the result by its base raised to a power such
  14042. // that the fraction part will be restored.
  14043. // Non-integer.
  14044. if (i >= 0) {
  14045. str = str.replace('.', '');
  14046. y = new Ctor(1);
  14047. y.e = str.length - i;
  14048. y.d = convertBase(finiteToString(y), 10, base);
  14049. y.e = y.d.length;
  14050. }
  14051. xd = convertBase(str, 10, base);
  14052. e = len = xd.length;
  14053. // Remove trailing zeros.
  14054. for (; xd[--len] == 0;) {
  14055. xd.pop();
  14056. }
  14057. if (!xd[0]) {
  14058. str = isExp ? '0p+0' : '0';
  14059. } else {
  14060. if (i < 0) {
  14061. e--;
  14062. } else {
  14063. x = new Ctor(x);
  14064. x.d = xd;
  14065. x.e = e;
  14066. x = divide(x, y, sd, rm, 0, base);
  14067. xd = x.d;
  14068. e = x.e;
  14069. roundUp = inexact;
  14070. }
  14071. // The rounding digit, i.e. the digit after the digit that may be rounded up.
  14072. i = xd[sd];
  14073. k = base / 2;
  14074. roundUp = roundUp || xd[sd + 1] !== void 0;
  14075. roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7));
  14076. xd.length = sd;
  14077. if (roundUp) {
  14078. // Rounding up may mean the previous digit has to be rounded up and so on.
  14079. for (; ++xd[--sd] > base - 1;) {
  14080. xd[sd] = 0;
  14081. if (!sd) {
  14082. ++e;
  14083. xd.unshift(1);
  14084. }
  14085. }
  14086. }
  14087. // Determine trailing zeros.
  14088. for (len = xd.length; !xd[len - 1]; --len) {
  14089. ;
  14090. }
  14091. // E.g. [4, 11, 15] becomes 4bf.
  14092. for (i = 0, str = ''; i < len; i++) {
  14093. str += NUMERALS.charAt(xd[i]);
  14094. }
  14095. // Add binary exponent suffix?
  14096. if (isExp) {
  14097. if (len > 1) {
  14098. if (baseOut == 16 || baseOut == 8) {
  14099. i = baseOut == 16 ? 4 : 3;
  14100. for (--len; len % i; len++) {
  14101. str += '0';
  14102. }
  14103. xd = convertBase(str, base, baseOut);
  14104. for (len = xd.length; !xd[len - 1]; --len) {
  14105. ;
  14106. }
  14107. // xd[0] will always be be 1
  14108. for (i = 1, str = '1.'; i < len; i++) {
  14109. str += NUMERALS.charAt(xd[i]);
  14110. }
  14111. } else {
  14112. str = str.charAt(0) + '.' + str.slice(1);
  14113. }
  14114. }
  14115. str = str + (e < 0 ? 'p' : 'p+') + e;
  14116. } else if (e < 0) {
  14117. for (; ++e;) {
  14118. str = '0' + str;
  14119. }
  14120. str = '0.' + str;
  14121. } else {
  14122. if (++e > len) for (e -= len; e--;) {
  14123. str += '0';
  14124. } else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);
  14125. }
  14126. }
  14127. str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;
  14128. }
  14129. return x.s < 0 ? '-' + str : str;
  14130. }
  14131. // Does not strip trailing zeros.
  14132. function truncate(arr, len) {
  14133. if (arr.length > len) {
  14134. arr.length = len;
  14135. return true;
  14136. }
  14137. }
  14138. // Decimal methods
  14139. /*
  14140. * abs
  14141. * acos
  14142. * acosh
  14143. * add
  14144. * asin
  14145. * asinh
  14146. * atan
  14147. * atanh
  14148. * atan2
  14149. * cbrt
  14150. * ceil
  14151. * clamp
  14152. * clone
  14153. * config
  14154. * cos
  14155. * cosh
  14156. * div
  14157. * exp
  14158. * floor
  14159. * hypot
  14160. * ln
  14161. * log
  14162. * log2
  14163. * log10
  14164. * max
  14165. * min
  14166. * mod
  14167. * mul
  14168. * pow
  14169. * random
  14170. * round
  14171. * set
  14172. * sign
  14173. * sin
  14174. * sinh
  14175. * sqrt
  14176. * sub
  14177. * sum
  14178. * tan
  14179. * tanh
  14180. * trunc
  14181. */
  14182. /*
  14183. * Return a new Decimal whose value is the absolute value of `x`.
  14184. *
  14185. * x {number|string|Decimal}
  14186. *
  14187. */
  14188. function abs(x) {
  14189. return new this(x).abs();
  14190. }
  14191. /*
  14192. * Return a new Decimal whose value is the arccosine in radians of `x`.
  14193. *
  14194. * x {number|string|Decimal}
  14195. *
  14196. */
  14197. function acos(x) {
  14198. return new this(x).acos();
  14199. }
  14200. /*
  14201. * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to
  14202. * `precision` significant digits using rounding mode `rounding`.
  14203. *
  14204. * x {number|string|Decimal} A value in radians.
  14205. *
  14206. */
  14207. function acosh(x) {
  14208. return new this(x).acosh();
  14209. }
  14210. /*
  14211. * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant
  14212. * digits using rounding mode `rounding`.
  14213. *
  14214. * x {number|string|Decimal}
  14215. * y {number|string|Decimal}
  14216. *
  14217. */
  14218. function add(x, y) {
  14219. return new this(x).plus(y);
  14220. }
  14221. /*
  14222. * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`
  14223. * significant digits using rounding mode `rounding`.
  14224. *
  14225. * x {number|string|Decimal}
  14226. *
  14227. */
  14228. function asin(x) {
  14229. return new this(x).asin();
  14230. }
  14231. /*
  14232. * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to
  14233. * `precision` significant digits using rounding mode `rounding`.
  14234. *
  14235. * x {number|string|Decimal} A value in radians.
  14236. *
  14237. */
  14238. function asinh(x) {
  14239. return new this(x).asinh();
  14240. }
  14241. /*
  14242. * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`
  14243. * significant digits using rounding mode `rounding`.
  14244. *
  14245. * x {number|string|Decimal}
  14246. *
  14247. */
  14248. function atan(x) {
  14249. return new this(x).atan();
  14250. }
  14251. /*
  14252. * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to
  14253. * `precision` significant digits using rounding mode `rounding`.
  14254. *
  14255. * x {number|string|Decimal} A value in radians.
  14256. *
  14257. */
  14258. function atanh(x) {
  14259. return new this(x).atanh();
  14260. }
  14261. /*
  14262. * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi
  14263. * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.
  14264. *
  14265. * Domain: [-Infinity, Infinity]
  14266. * Range: [-pi, pi]
  14267. *
  14268. * y {number|string|Decimal} The y-coordinate.
  14269. * x {number|string|Decimal} The x-coordinate.
  14270. *
  14271. * atan2(±0, -0) = ±pi
  14272. * atan2(±0, +0) = ±0
  14273. * atan2(±0, -x) = ±pi for x > 0
  14274. * atan2(±0, x) = ±0 for x > 0
  14275. * atan2(-y, ±0) = -pi/2 for y > 0
  14276. * atan2(y, ±0) = pi/2 for y > 0
  14277. * atan2(±y, -Infinity) = ±pi for finite y > 0
  14278. * atan2(±y, +Infinity) = ±0 for finite y > 0
  14279. * atan2(±Infinity, x) = ±pi/2 for finite x
  14280. * atan2(±Infinity, -Infinity) = ±3*pi/4
  14281. * atan2(±Infinity, +Infinity) = ±pi/4
  14282. * atan2(NaN, x) = NaN
  14283. * atan2(y, NaN) = NaN
  14284. *
  14285. */
  14286. function atan2(y, x) {
  14287. y = new this(y);
  14288. x = new this(x);
  14289. var r,
  14290. pr = this.precision,
  14291. rm = this.rounding,
  14292. wpr = pr + 4;
  14293. // Either NaN
  14294. if (!y.s || !x.s) {
  14295. r = new this(NaN);
  14296. // Both ±Infinity
  14297. } else if (!y.d && !x.d) {
  14298. r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);
  14299. r.s = y.s;
  14300. // x is ±Infinity or y is ±0
  14301. } else if (!x.d || y.isZero()) {
  14302. r = x.s < 0 ? getPi(this, pr, rm) : new this(0);
  14303. r.s = y.s;
  14304. // y is ±Infinity or x is ±0
  14305. } else if (!y.d || x.isZero()) {
  14306. r = getPi(this, wpr, 1).times(0.5);
  14307. r.s = y.s;
  14308. // Both non-zero and finite
  14309. } else if (x.s < 0) {
  14310. this.precision = wpr;
  14311. this.rounding = 1;
  14312. r = this.atan(divide(y, x, wpr, 1));
  14313. x = getPi(this, wpr, 1);
  14314. this.precision = pr;
  14315. this.rounding = rm;
  14316. r = y.s < 0 ? r.minus(x) : r.plus(x);
  14317. } else {
  14318. r = this.atan(divide(y, x, wpr, 1));
  14319. }
  14320. return r;
  14321. }
  14322. /*
  14323. * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant
  14324. * digits using rounding mode `rounding`.
  14325. *
  14326. * x {number|string|Decimal}
  14327. *
  14328. */
  14329. function cbrt(x) {
  14330. return new this(x).cbrt();
  14331. }
  14332. /*
  14333. * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.
  14334. *
  14335. * x {number|string|Decimal}
  14336. *
  14337. */
  14338. function ceil(x) {
  14339. return finalise(x = new this(x), x.e + 1, 2);
  14340. }
  14341. /*
  14342. * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.
  14343. *
  14344. * x {number|string|Decimal}
  14345. * min {number|string|Decimal}
  14346. * max {number|string|Decimal}
  14347. *
  14348. */
  14349. function clamp(x, min, max) {
  14350. return new this(x).clamp(min, max);
  14351. }
  14352. /*
  14353. * Configure global settings for a Decimal constructor.
  14354. *
  14355. * `obj` is an object with one or more of the following properties,
  14356. *
  14357. * precision {number}
  14358. * rounding {number}
  14359. * toExpNeg {number}
  14360. * toExpPos {number}
  14361. * maxE {number}
  14362. * minE {number}
  14363. * modulo {number}
  14364. * crypto {boolean|number}
  14365. * defaults {true}
  14366. *
  14367. * E.g. Decimal.config({ precision: 20, rounding: 4 })
  14368. *
  14369. */
  14370. function config(obj) {
  14371. if (!obj || _typeof(obj) !== 'object') throw Error(decimalError + 'Object expected');
  14372. var i,
  14373. p,
  14374. v,
  14375. useDefaults = obj.defaults === true,
  14376. ps = ['precision', 1, MAX_DIGITS, 'rounding', 0, 8, 'toExpNeg', -EXP_LIMIT, 0, 'toExpPos', 0, EXP_LIMIT, 'maxE', 0, EXP_LIMIT, 'minE', -EXP_LIMIT, 0, 'modulo', 0, 9];
  14377. for (i = 0; i < ps.length; i += 3) {
  14378. if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];
  14379. if ((v = obj[p]) !== void 0) {
  14380. if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;else throw Error(invalidArgument + p + ': ' + v);
  14381. }
  14382. }
  14383. if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];
  14384. if ((v = obj[p]) !== void 0) {
  14385. if (v === true || v === false || v === 0 || v === 1) {
  14386. if (v) {
  14387. if (typeof crypto != 'undefined' && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
  14388. this[p] = true;
  14389. } else {
  14390. throw Error(cryptoUnavailable);
  14391. }
  14392. } else {
  14393. this[p] = false;
  14394. }
  14395. } else {
  14396. throw Error(invalidArgument + p + ': ' + v);
  14397. }
  14398. }
  14399. return this;
  14400. }
  14401. /*
  14402. * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant
  14403. * digits using rounding mode `rounding`.
  14404. *
  14405. * x {number|string|Decimal} A value in radians.
  14406. *
  14407. */
  14408. function cos(x) {
  14409. return new this(x).cos();
  14410. }
  14411. /*
  14412. * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision
  14413. * significant digits using rounding mode `rounding`.
  14414. *
  14415. * x {number|string|Decimal} A value in radians.
  14416. *
  14417. */
  14418. function cosh(x) {
  14419. return new this(x).cosh();
  14420. }
  14421. /*
  14422. * Create and return a Decimal constructor with the same configuration properties as this Decimal
  14423. * constructor.
  14424. *
  14425. */
  14426. function clone(obj) {
  14427. var i, p, ps;
  14428. /*
  14429. * The Decimal constructor and exported function.
  14430. * Return a new Decimal instance.
  14431. *
  14432. * v {number|string|Decimal} A numeric value.
  14433. *
  14434. */
  14435. function Decimal(v) {
  14436. var e,
  14437. i,
  14438. t,
  14439. x = this;
  14440. // Decimal called without new.
  14441. if (!(x instanceof Decimal)) return new Decimal(v);
  14442. // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor
  14443. // which points to Object.
  14444. x.constructor = Decimal;
  14445. // Duplicate.
  14446. if (isDecimalInstance(v)) {
  14447. x.s = v.s;
  14448. if (external) {
  14449. if (!v.d || v.e > Decimal.maxE) {
  14450. // Infinity.
  14451. x.e = NaN;
  14452. x.d = null;
  14453. } else if (v.e < Decimal.minE) {
  14454. // Zero.
  14455. x.e = 0;
  14456. x.d = [0];
  14457. } else {
  14458. x.e = v.e;
  14459. x.d = v.d.slice();
  14460. }
  14461. } else {
  14462. x.e = v.e;
  14463. x.d = v.d ? v.d.slice() : v.d;
  14464. }
  14465. return;
  14466. }
  14467. t = _typeof(v);
  14468. if (t === 'number') {
  14469. if (v === 0) {
  14470. x.s = 1 / v < 0 ? -1 : 1;
  14471. x.e = 0;
  14472. x.d = [0];
  14473. return;
  14474. }
  14475. if (v < 0) {
  14476. v = -v;
  14477. x.s = -1;
  14478. } else {
  14479. x.s = 1;
  14480. }
  14481. // Fast path for small integers.
  14482. if (v === ~~v && v < 1e7) {
  14483. for (e = 0, i = v; i >= 10; i /= 10) {
  14484. e++;
  14485. }
  14486. if (external) {
  14487. if (e > Decimal.maxE) {
  14488. x.e = NaN;
  14489. x.d = null;
  14490. } else if (e < Decimal.minE) {
  14491. x.e = 0;
  14492. x.d = [0];
  14493. } else {
  14494. x.e = e;
  14495. x.d = [v];
  14496. }
  14497. } else {
  14498. x.e = e;
  14499. x.d = [v];
  14500. }
  14501. return;
  14502. // Infinity, NaN.
  14503. } else if (v * 0 !== 0) {
  14504. if (!v) x.s = NaN;
  14505. x.e = NaN;
  14506. x.d = null;
  14507. return;
  14508. }
  14509. return parseDecimal(x, v.toString());
  14510. } else if (t !== 'string') {
  14511. throw Error(invalidArgument + v);
  14512. }
  14513. // Minus sign?
  14514. if ((i = v.charCodeAt(0)) === 45) {
  14515. v = v.slice(1);
  14516. x.s = -1;
  14517. } else {
  14518. // Plus sign?
  14519. if (i === 43) v = v.slice(1);
  14520. x.s = 1;
  14521. }
  14522. return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
  14523. }
  14524. Decimal.prototype = P;
  14525. Decimal.ROUND_UP = 0;
  14526. Decimal.ROUND_DOWN = 1;
  14527. Decimal.ROUND_CEIL = 2;
  14528. Decimal.ROUND_FLOOR = 3;
  14529. Decimal.ROUND_HALF_UP = 4;
  14530. Decimal.ROUND_HALF_DOWN = 5;
  14531. Decimal.ROUND_HALF_EVEN = 6;
  14532. Decimal.ROUND_HALF_CEIL = 7;
  14533. Decimal.ROUND_HALF_FLOOR = 8;
  14534. Decimal.EUCLID = 9;
  14535. Decimal.config = Decimal.set = config;
  14536. Decimal.clone = clone;
  14537. Decimal.isDecimal = isDecimalInstance;
  14538. Decimal.abs = abs;
  14539. Decimal.acos = acos;
  14540. Decimal.acosh = acosh; // ES6
  14541. Decimal.add = add;
  14542. Decimal.asin = asin;
  14543. Decimal.asinh = asinh; // ES6
  14544. Decimal.atan = atan;
  14545. Decimal.atanh = atanh; // ES6
  14546. Decimal.atan2 = atan2;
  14547. Decimal.cbrt = cbrt; // ES6
  14548. Decimal.ceil = ceil;
  14549. Decimal.clamp = clamp;
  14550. Decimal.cos = cos;
  14551. Decimal.cosh = cosh; // ES6
  14552. Decimal.div = div;
  14553. Decimal.exp = exp;
  14554. Decimal.floor = floor;
  14555. Decimal.hypot = hypot; // ES6
  14556. Decimal.ln = ln;
  14557. Decimal.log = log;
  14558. Decimal.log10 = log10; // ES6
  14559. Decimal.log2 = log2; // ES6
  14560. Decimal.max = max;
  14561. Decimal.min = min;
  14562. Decimal.mod = mod;
  14563. Decimal.mul = mul;
  14564. Decimal.pow = pow;
  14565. Decimal.random = random;
  14566. Decimal.round = round;
  14567. Decimal.sign = sign; // ES6
  14568. Decimal.sin = sin;
  14569. Decimal.sinh = sinh; // ES6
  14570. Decimal.sqrt = sqrt;
  14571. Decimal.sub = sub;
  14572. Decimal.sum = sum;
  14573. Decimal.tan = tan;
  14574. Decimal.tanh = tanh; // ES6
  14575. Decimal.trunc = trunc; // ES6
  14576. if (obj === void 0) obj = {};
  14577. if (obj) {
  14578. if (obj.defaults !== true) {
  14579. ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];
  14580. for (i = 0; i < ps.length;) {
  14581. if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];
  14582. }
  14583. }
  14584. }
  14585. Decimal.config(obj);
  14586. return Decimal;
  14587. }
  14588. /*
  14589. * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant
  14590. * digits using rounding mode `rounding`.
  14591. *
  14592. * x {number|string|Decimal}
  14593. * y {number|string|Decimal}
  14594. *
  14595. */
  14596. function div(x, y) {
  14597. return new this(x).div(y);
  14598. }
  14599. /*
  14600. * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`
  14601. * significant digits using rounding mode `rounding`.
  14602. *
  14603. * x {number|string|Decimal} The power to which to raise the base of the natural log.
  14604. *
  14605. */
  14606. function exp(x) {
  14607. return new this(x).exp();
  14608. }
  14609. /*
  14610. * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.
  14611. *
  14612. * x {number|string|Decimal}
  14613. *
  14614. */
  14615. function floor(x) {
  14616. return finalise(x = new this(x), x.e + 1, 3);
  14617. }
  14618. /*
  14619. * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,
  14620. * rounded to `precision` significant digits using rounding mode `rounding`.
  14621. *
  14622. * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)
  14623. *
  14624. * arguments {number|string|Decimal}
  14625. *
  14626. */
  14627. function hypot() {
  14628. var i,
  14629. n,
  14630. t = new this(0);
  14631. external = false;
  14632. for (i = 0; i < arguments.length;) {
  14633. n = new this(arguments[i++]);
  14634. if (!n.d) {
  14635. if (n.s) {
  14636. external = true;
  14637. return new this(1 / 0);
  14638. }
  14639. t = n;
  14640. } else if (t.d) {
  14641. t = t.plus(n.times(n));
  14642. }
  14643. }
  14644. external = true;
  14645. return t.sqrt();
  14646. }
  14647. /*
  14648. * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),
  14649. * otherwise return false.
  14650. *
  14651. */
  14652. function isDecimalInstance(obj) {
  14653. return obj instanceof Decimal || obj && obj.toStringTag === tag || false;
  14654. }
  14655. /*
  14656. * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`
  14657. * significant digits using rounding mode `rounding`.
  14658. *
  14659. * x {number|string|Decimal}
  14660. *
  14661. */
  14662. function ln(x) {
  14663. return new this(x).ln();
  14664. }
  14665. /*
  14666. * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base
  14667. * is specified, rounded to `precision` significant digits using rounding mode `rounding`.
  14668. *
  14669. * log[y](x)
  14670. *
  14671. * x {number|string|Decimal} The argument of the logarithm.
  14672. * y {number|string|Decimal} The base of the logarithm.
  14673. *
  14674. */
  14675. function log(x, y) {
  14676. return new this(x).log(y);
  14677. }
  14678. /*
  14679. * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`
  14680. * significant digits using rounding mode `rounding`.
  14681. *
  14682. * x {number|string|Decimal}
  14683. *
  14684. */
  14685. function log2(x) {
  14686. return new this(x).log(2);
  14687. }
  14688. /*
  14689. * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`
  14690. * significant digits using rounding mode `rounding`.
  14691. *
  14692. * x {number|string|Decimal}
  14693. *
  14694. */
  14695. function log10(x) {
  14696. return new this(x).log(10);
  14697. }
  14698. /*
  14699. * Return a new Decimal whose value is the maximum of the arguments.
  14700. *
  14701. * arguments {number|string|Decimal}
  14702. *
  14703. */
  14704. function max() {
  14705. return maxOrMin(this, arguments, 'lt');
  14706. }
  14707. /*
  14708. * Return a new Decimal whose value is the minimum of the arguments.
  14709. *
  14710. * arguments {number|string|Decimal}
  14711. *
  14712. */
  14713. function min() {
  14714. return maxOrMin(this, arguments, 'gt');
  14715. }
  14716. /*
  14717. * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits
  14718. * using rounding mode `rounding`.
  14719. *
  14720. * x {number|string|Decimal}
  14721. * y {number|string|Decimal}
  14722. *
  14723. */
  14724. function mod(x, y) {
  14725. return new this(x).mod(y);
  14726. }
  14727. /*
  14728. * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant
  14729. * digits using rounding mode `rounding`.
  14730. *
  14731. * x {number|string|Decimal}
  14732. * y {number|string|Decimal}
  14733. *
  14734. */
  14735. function mul(x, y) {
  14736. return new this(x).mul(y);
  14737. }
  14738. /*
  14739. * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision
  14740. * significant digits using rounding mode `rounding`.
  14741. *
  14742. * x {number|string|Decimal} The base.
  14743. * y {number|string|Decimal} The exponent.
  14744. *
  14745. */
  14746. function pow(x, y) {
  14747. return new this(x).pow(y);
  14748. }
  14749. /*
  14750. * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with
  14751. * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros
  14752. * are produced).
  14753. *
  14754. * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.
  14755. *
  14756. */
  14757. function random(sd) {
  14758. var d,
  14759. e,
  14760. k,
  14761. n,
  14762. i = 0,
  14763. r = new this(1),
  14764. rd = [];
  14765. if (sd === void 0) sd = this.precision;else checkInt32(sd, 1, MAX_DIGITS);
  14766. k = Math.ceil(sd / LOG_BASE);
  14767. if (!this.crypto) {
  14768. for (; i < k;) {
  14769. rd[i++] = Math.random() * 1e7 | 0;
  14770. }
  14771. // Browsers supporting crypto.getRandomValues.
  14772. } else if (crypto.getRandomValues) {
  14773. d = crypto.getRandomValues(new Uint32Array(k));
  14774. for (; i < k;) {
  14775. n = d[i];
  14776. // 0 <= n < 4294967296
  14777. // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).
  14778. if (n >= 4.29e9) {
  14779. d[i] = crypto.getRandomValues(new Uint32Array(1))[0];
  14780. } else {
  14781. // 0 <= n <= 4289999999
  14782. // 0 <= (n % 1e7) <= 9999999
  14783. rd[i++] = n % 1e7;
  14784. }
  14785. }
  14786. // Node.js supporting crypto.randomBytes.
  14787. } else if (crypto.randomBytes) {
  14788. // buffer
  14789. d = crypto.randomBytes(k *= 4);
  14790. for (; i < k;) {
  14791. // 0 <= n < 2147483648
  14792. n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);
  14793. // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).
  14794. if (n >= 2.14e9) {
  14795. crypto.randomBytes(4).copy(d, i);
  14796. } else {
  14797. // 0 <= n <= 2139999999
  14798. // 0 <= (n % 1e7) <= 9999999
  14799. rd.push(n % 1e7);
  14800. i += 4;
  14801. }
  14802. }
  14803. i = k / 4;
  14804. } else {
  14805. throw Error(cryptoUnavailable);
  14806. }
  14807. k = rd[--i];
  14808. sd %= LOG_BASE;
  14809. // Convert trailing digits to zeros according to sd.
  14810. if (k && sd) {
  14811. n = mathpow(10, LOG_BASE - sd);
  14812. rd[i] = (k / n | 0) * n;
  14813. }
  14814. // Remove trailing words which are zero.
  14815. for (; rd[i] === 0; i--) {
  14816. rd.pop();
  14817. }
  14818. // Zero?
  14819. if (i < 0) {
  14820. e = 0;
  14821. rd = [0];
  14822. } else {
  14823. e = -1;
  14824. // Remove leading words which are zero and adjust exponent accordingly.
  14825. for (; rd[0] === 0; e -= LOG_BASE) {
  14826. rd.shift();
  14827. }
  14828. // Count the digits of the first word of rd to determine leading zeros.
  14829. for (k = 1, n = rd[0]; n >= 10; n /= 10) {
  14830. k++;
  14831. }
  14832. // Adjust the exponent for leading zeros of the first word of rd.
  14833. if (k < LOG_BASE) e -= LOG_BASE - k;
  14834. }
  14835. r.e = e;
  14836. r.d = rd;
  14837. return r;
  14838. }
  14839. /*
  14840. * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.
  14841. *
  14842. * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).
  14843. *
  14844. * x {number|string|Decimal}
  14845. *
  14846. */
  14847. function round(x) {
  14848. return finalise(x = new this(x), x.e + 1, this.rounding);
  14849. }
  14850. /*
  14851. * Return
  14852. * 1 if x > 0,
  14853. * -1 if x < 0,
  14854. * 0 if x is 0,
  14855. * -0 if x is -0,
  14856. * NaN otherwise
  14857. *
  14858. * x {number|string|Decimal}
  14859. *
  14860. */
  14861. function sign(x) {
  14862. x = new this(x);
  14863. return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN;
  14864. }
  14865. /*
  14866. * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits
  14867. * using rounding mode `rounding`.
  14868. *
  14869. * x {number|string|Decimal} A value in radians.
  14870. *
  14871. */
  14872. function sin(x) {
  14873. return new this(x).sin();
  14874. }
  14875. /*
  14876. * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`
  14877. * significant digits using rounding mode `rounding`.
  14878. *
  14879. * x {number|string|Decimal} A value in radians.
  14880. *
  14881. */
  14882. function sinh(x) {
  14883. return new this(x).sinh();
  14884. }
  14885. /*
  14886. * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant
  14887. * digits using rounding mode `rounding`.
  14888. *
  14889. * x {number|string|Decimal}
  14890. *
  14891. */
  14892. function sqrt(x) {
  14893. return new this(x).sqrt();
  14894. }
  14895. /*
  14896. * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits
  14897. * using rounding mode `rounding`.
  14898. *
  14899. * x {number|string|Decimal}
  14900. * y {number|string|Decimal}
  14901. *
  14902. */
  14903. function sub(x, y) {
  14904. return new this(x).sub(y);
  14905. }
  14906. /*
  14907. * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`
  14908. * significant digits using rounding mode `rounding`.
  14909. *
  14910. * Only the result is rounded, not the intermediate calculations.
  14911. *
  14912. * arguments {number|string|Decimal}
  14913. *
  14914. */
  14915. function sum() {
  14916. var i = 0,
  14917. args = arguments,
  14918. x = new this(args[i]);
  14919. external = false;
  14920. for (; x.s && ++i < args.length;) {
  14921. x = x.plus(args[i]);
  14922. }
  14923. external = true;
  14924. return finalise(x, this.precision, this.rounding);
  14925. }
  14926. /*
  14927. * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant
  14928. * digits using rounding mode `rounding`.
  14929. *
  14930. * x {number|string|Decimal} A value in radians.
  14931. *
  14932. */
  14933. function tan(x) {
  14934. return new this(x).tan();
  14935. }
  14936. /*
  14937. * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`
  14938. * significant digits using rounding mode `rounding`.
  14939. *
  14940. * x {number|string|Decimal} A value in radians.
  14941. *
  14942. */
  14943. function tanh(x) {
  14944. return new this(x).tanh();
  14945. }
  14946. /*
  14947. * Return a new Decimal whose value is `x` truncated to an integer.
  14948. *
  14949. * x {number|string|Decimal}
  14950. *
  14951. */
  14952. function trunc(x) {
  14953. return finalise(x = new this(x), x.e + 1, 1);
  14954. }
  14955. // Create and configure initial Decimal constructor.
  14956. Decimal = clone(DEFAULTS);
  14957. Decimal.prototype.constructor = Decimal;
  14958. Decimal['default'] = Decimal.Decimal = Decimal;
  14959. // Create the internal constants from their string values.
  14960. LN10 = new Decimal(LN10);
  14961. PI = new Decimal(PI);
  14962. // Export.
  14963. // AMD.
  14964. if (true) {
  14965. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  14966. return Decimal;
  14967. }).call(exports, __webpack_require__, exports, module),
  14968. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  14969. // Node and other environments that support module.exports.
  14970. } else {}
  14971. })(this);
  14972. /***/ }),
  14973. /***/ 399:
  14974. /*!*****************************************************************************************!*\
  14975. !*** D:/project/material_applet/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  14976. \*****************************************************************************************/
  14977. /*! no static exports found */
  14978. /***/ (function(module, exports, __webpack_require__) {
  14979. "use strict";
  14980. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14981. Object.defineProperty(exports, "__esModule", {
  14982. value: true
  14983. });
  14984. exports.default = void 0;
  14985. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
  14986. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 400));
  14987. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 401));
  14988. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 403));
  14989. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
  14990. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  14991. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  14992. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14993. 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); }; }
  14994. 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; } }
  14995. var pattern = {
  14996. email: /^\S+?@\S+?\.\S+?$/,
  14997. 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]$/,
  14998. 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')
  14999. };
  15000. var FORMAT_MAPPING = {
  15001. "int": 'integer',
  15002. "bool": 'boolean',
  15003. "double": 'number',
  15004. "long": 'number',
  15005. "password": 'string'
  15006. // "fileurls": 'array'
  15007. };
  15008. function formatMessage(args) {
  15009. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  15010. var defaultMessage = ['label'];
  15011. defaultMessage.forEach(function (item) {
  15012. if (args[item] === undefined) {
  15013. args[item] = '';
  15014. }
  15015. });
  15016. var str = resources;
  15017. for (var key in args) {
  15018. var reg = new RegExp('{' + key + '}');
  15019. str = str.replace(reg, args[key]);
  15020. }
  15021. return str;
  15022. }
  15023. function isEmptyValue(value, type) {
  15024. if (value === undefined || value === null) {
  15025. return true;
  15026. }
  15027. if (typeof value === 'string' && !value) {
  15028. return true;
  15029. }
  15030. if (Array.isArray(value) && !value.length) {
  15031. return true;
  15032. }
  15033. if (type === 'object' && !Object.keys(value).length) {
  15034. return true;
  15035. }
  15036. return false;
  15037. }
  15038. var types = {
  15039. integer: function integer(value) {
  15040. return types.number(value) && parseInt(value, 10) === value;
  15041. },
  15042. string: function string(value) {
  15043. return typeof value === 'string';
  15044. },
  15045. number: function number(value) {
  15046. if (isNaN(value)) {
  15047. return false;
  15048. }
  15049. return typeof value === 'number';
  15050. },
  15051. "boolean": function boolean(value) {
  15052. return typeof value === 'boolean';
  15053. },
  15054. "float": function float(value) {
  15055. return types.number(value) && !types.integer(value);
  15056. },
  15057. array: function array(value) {
  15058. return Array.isArray(value);
  15059. },
  15060. object: function object(value) {
  15061. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  15062. },
  15063. date: function date(value) {
  15064. return value instanceof Date;
  15065. },
  15066. timestamp: function timestamp(value) {
  15067. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  15068. return false;
  15069. }
  15070. return true;
  15071. },
  15072. file: function file(value) {
  15073. return typeof value.url === 'string';
  15074. },
  15075. email: function email(value) {
  15076. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  15077. },
  15078. url: function url(value) {
  15079. return typeof value === 'string' && !!value.match(pattern.url);
  15080. },
  15081. pattern: function pattern(reg, value) {
  15082. try {
  15083. return new RegExp(reg).test(value);
  15084. } catch (e) {
  15085. return false;
  15086. }
  15087. },
  15088. method: function method(value) {
  15089. return typeof value === 'function';
  15090. },
  15091. idcard: function idcard(value) {
  15092. return typeof value === 'string' && !!value.match(pattern.idcard);
  15093. },
  15094. 'url-https': function urlHttps(value) {
  15095. return this.url(value) && value.startsWith('https://');
  15096. },
  15097. 'url-scheme': function urlScheme(value) {
  15098. return value.startsWith('://');
  15099. },
  15100. 'url-web': function urlWeb(value) {
  15101. return false;
  15102. }
  15103. };
  15104. var RuleValidator = /*#__PURE__*/function () {
  15105. function RuleValidator(message) {
  15106. (0, _classCallCheck2.default)(this, RuleValidator);
  15107. this._message = message;
  15108. }
  15109. (0, _createClass2.default)(RuleValidator, [{
  15110. key: "validateRule",
  15111. value: function () {
  15112. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  15113. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  15114. return _regenerator.default.wrap(function _callee$(_context) {
  15115. while (1) {
  15116. switch (_context.prev = _context.next) {
  15117. case 0:
  15118. result = null;
  15119. rules = fieldValue.rules;
  15120. hasRequired = rules.findIndex(function (item) {
  15121. return item.required;
  15122. });
  15123. if (!(hasRequired < 0)) {
  15124. _context.next = 8;
  15125. break;
  15126. }
  15127. if (!(value === null || value === undefined)) {
  15128. _context.next = 6;
  15129. break;
  15130. }
  15131. return _context.abrupt("return", result);
  15132. case 6:
  15133. if (!(typeof value === 'string' && !value.length)) {
  15134. _context.next = 8;
  15135. break;
  15136. }
  15137. return _context.abrupt("return", result);
  15138. case 8:
  15139. message = this._message;
  15140. if (!(rules === undefined)) {
  15141. _context.next = 11;
  15142. break;
  15143. }
  15144. return _context.abrupt("return", message['default']);
  15145. case 11:
  15146. i = 0;
  15147. case 12:
  15148. if (!(i < rules.length)) {
  15149. _context.next = 35;
  15150. break;
  15151. }
  15152. rule = rules[i];
  15153. vt = this._getValidateType(rule);
  15154. Object.assign(rule, {
  15155. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  15156. });
  15157. if (!RuleValidatorHelper[vt]) {
  15158. _context.next = 20;
  15159. break;
  15160. }
  15161. result = RuleValidatorHelper[vt](rule, value, message);
  15162. if (!(result != null)) {
  15163. _context.next = 20;
  15164. break;
  15165. }
  15166. return _context.abrupt("break", 35);
  15167. case 20:
  15168. if (!rule.validateExpr) {
  15169. _context.next = 26;
  15170. break;
  15171. }
  15172. now = Date.now();
  15173. resultExpr = rule.validateExpr(value, allData, now);
  15174. if (!(resultExpr === false)) {
  15175. _context.next = 26;
  15176. break;
  15177. }
  15178. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  15179. return _context.abrupt("break", 35);
  15180. case 26:
  15181. if (!rule.validateFunction) {
  15182. _context.next = 32;
  15183. break;
  15184. }
  15185. _context.next = 29;
  15186. return this.validateFunction(rule, value, data, allData, vt);
  15187. case 29:
  15188. result = _context.sent;
  15189. if (!(result !== null)) {
  15190. _context.next = 32;
  15191. break;
  15192. }
  15193. return _context.abrupt("break", 35);
  15194. case 32:
  15195. i++;
  15196. _context.next = 12;
  15197. break;
  15198. case 35:
  15199. if (result !== null) {
  15200. result = message.TAG + result;
  15201. }
  15202. return _context.abrupt("return", result);
  15203. case 37:
  15204. case "end":
  15205. return _context.stop();
  15206. }
  15207. }
  15208. }, _callee, this);
  15209. }));
  15210. function validateRule(_x, _x2, _x3, _x4, _x5) {
  15211. return _validateRule.apply(this, arguments);
  15212. }
  15213. return validateRule;
  15214. }()
  15215. }, {
  15216. key: "validateFunction",
  15217. value: function () {
  15218. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  15219. var result, callbackMessage, res;
  15220. return _regenerator.default.wrap(function _callee2$(_context2) {
  15221. while (1) {
  15222. switch (_context2.prev = _context2.next) {
  15223. case 0:
  15224. result = null;
  15225. _context2.prev = 1;
  15226. callbackMessage = null;
  15227. _context2.next = 5;
  15228. return rule.validateFunction(rule, value, allData || data, function (message) {
  15229. callbackMessage = message;
  15230. });
  15231. case 5:
  15232. res = _context2.sent;
  15233. if (callbackMessage || typeof res === 'string' && res || res === false) {
  15234. result = this._getMessage(rule, callbackMessage || res, vt);
  15235. }
  15236. _context2.next = 12;
  15237. break;
  15238. case 9:
  15239. _context2.prev = 9;
  15240. _context2.t0 = _context2["catch"](1);
  15241. result = this._getMessage(rule, _context2.t0.message, vt);
  15242. case 12:
  15243. return _context2.abrupt("return", result);
  15244. case 13:
  15245. case "end":
  15246. return _context2.stop();
  15247. }
  15248. }
  15249. }, _callee2, this, [[1, 9]]);
  15250. }));
  15251. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  15252. return _validateFunction.apply(this, arguments);
  15253. }
  15254. return validateFunction;
  15255. }()
  15256. }, {
  15257. key: "_getMessage",
  15258. value: function _getMessage(rule, message, vt) {
  15259. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  15260. }
  15261. }, {
  15262. key: "_getValidateType",
  15263. value: function _getValidateType(rule) {
  15264. var result = '';
  15265. if (rule.required) {
  15266. result = 'required';
  15267. } else if (rule.format) {
  15268. result = 'format';
  15269. } else if (rule.arrayType) {
  15270. result = 'arrayTypeFormat';
  15271. } else if (rule.range) {
  15272. result = 'range';
  15273. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  15274. result = 'rangeNumber';
  15275. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  15276. result = 'rangeLength';
  15277. } else if (rule.pattern) {
  15278. result = 'pattern';
  15279. } else if (rule.validateFunction) {
  15280. result = 'validateFunction';
  15281. }
  15282. return result;
  15283. }
  15284. }]);
  15285. return RuleValidator;
  15286. }();
  15287. var RuleValidatorHelper = {
  15288. required: function required(rule, value, message) {
  15289. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  15290. return formatMessage(rule, rule.errorMessage || message.required);
  15291. }
  15292. return null;
  15293. },
  15294. range: function range(rule, value, message) {
  15295. var range = rule.range,
  15296. errorMessage = rule.errorMessage;
  15297. var list = new Array(range.length);
  15298. for (var i = 0; i < range.length; i++) {
  15299. var item = range[i];
  15300. if (types.object(item) && item.value !== undefined) {
  15301. list[i] = item.value;
  15302. } else {
  15303. list[i] = item;
  15304. }
  15305. }
  15306. var result = false;
  15307. if (Array.isArray(value)) {
  15308. result = new Set(value.concat(list)).size === list.length;
  15309. } else {
  15310. if (list.indexOf(value) > -1) {
  15311. result = true;
  15312. }
  15313. }
  15314. if (!result) {
  15315. return formatMessage(rule, errorMessage || message['enum']);
  15316. }
  15317. return null;
  15318. },
  15319. rangeNumber: function rangeNumber(rule, value, message) {
  15320. if (!types.number(value)) {
  15321. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  15322. }
  15323. var minimum = rule.minimum,
  15324. maximum = rule.maximum,
  15325. exclusiveMinimum = rule.exclusiveMinimum,
  15326. exclusiveMaximum = rule.exclusiveMaximum;
  15327. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  15328. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  15329. if (minimum !== undefined && min) {
  15330. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  15331. } else if (maximum !== undefined && max) {
  15332. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  15333. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  15334. return formatMessage(rule, rule.errorMessage || message['number'].range);
  15335. }
  15336. return null;
  15337. },
  15338. rangeLength: function rangeLength(rule, value, message) {
  15339. if (!types.string(value) && !types.array(value)) {
  15340. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  15341. }
  15342. var min = rule.minLength;
  15343. var max = rule.maxLength;
  15344. var val = value.length;
  15345. if (min !== undefined && val < min) {
  15346. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  15347. } else if (max !== undefined && val > max) {
  15348. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  15349. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  15350. return formatMessage(rule, rule.errorMessage || message['length'].range);
  15351. }
  15352. return null;
  15353. },
  15354. pattern: function pattern(rule, value, message) {
  15355. if (!types['pattern'](rule.pattern, value)) {
  15356. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  15357. }
  15358. return null;
  15359. },
  15360. format: function format(rule, value, message) {
  15361. var customTypes = Object.keys(types);
  15362. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  15363. if (customTypes.indexOf(format) > -1) {
  15364. if (!types[format](value)) {
  15365. return formatMessage(rule, rule.errorMessage || message.typeError);
  15366. }
  15367. }
  15368. return null;
  15369. },
  15370. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  15371. if (!Array.isArray(value)) {
  15372. return formatMessage(rule, rule.errorMessage || message.typeError);
  15373. }
  15374. for (var i = 0; i < value.length; i++) {
  15375. var element = value[i];
  15376. var formatResult = this.format(rule, element, message);
  15377. if (formatResult !== null) {
  15378. return formatResult;
  15379. }
  15380. }
  15381. return null;
  15382. }
  15383. };
  15384. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  15385. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  15386. var _super = _createSuper(SchemaValidator);
  15387. function SchemaValidator(schema, options) {
  15388. var _this;
  15389. (0, _classCallCheck2.default)(this, SchemaValidator);
  15390. _this = _super.call(this, SchemaValidator.message);
  15391. _this._schema = schema;
  15392. _this._options = options || null;
  15393. return _this;
  15394. }
  15395. (0, _createClass2.default)(SchemaValidator, [{
  15396. key: "updateSchema",
  15397. value: function updateSchema(schema) {
  15398. this._schema = schema;
  15399. }
  15400. }, {
  15401. key: "validate",
  15402. value: function () {
  15403. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  15404. var result;
  15405. return _regenerator.default.wrap(function _callee3$(_context3) {
  15406. while (1) {
  15407. switch (_context3.prev = _context3.next) {
  15408. case 0:
  15409. result = this._checkFieldInSchema(data);
  15410. if (result) {
  15411. _context3.next = 5;
  15412. break;
  15413. }
  15414. _context3.next = 4;
  15415. return this.invokeValidate(data, false, allData);
  15416. case 4:
  15417. result = _context3.sent;
  15418. case 5:
  15419. return _context3.abrupt("return", result.length ? result[0] : null);
  15420. case 6:
  15421. case "end":
  15422. return _context3.stop();
  15423. }
  15424. }
  15425. }, _callee3, this);
  15426. }));
  15427. function validate(_x11, _x12) {
  15428. return _validate.apply(this, arguments);
  15429. }
  15430. return validate;
  15431. }()
  15432. }, {
  15433. key: "validateAll",
  15434. value: function () {
  15435. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  15436. var result;
  15437. return _regenerator.default.wrap(function _callee4$(_context4) {
  15438. while (1) {
  15439. switch (_context4.prev = _context4.next) {
  15440. case 0:
  15441. result = this._checkFieldInSchema(data);
  15442. if (result) {
  15443. _context4.next = 5;
  15444. break;
  15445. }
  15446. _context4.next = 4;
  15447. return this.invokeValidate(data, true, allData);
  15448. case 4:
  15449. result = _context4.sent;
  15450. case 5:
  15451. return _context4.abrupt("return", result);
  15452. case 6:
  15453. case "end":
  15454. return _context4.stop();
  15455. }
  15456. }
  15457. }, _callee4, this);
  15458. }));
  15459. function validateAll(_x13, _x14) {
  15460. return _validateAll.apply(this, arguments);
  15461. }
  15462. return validateAll;
  15463. }()
  15464. }, {
  15465. key: "validateUpdate",
  15466. value: function () {
  15467. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  15468. var result;
  15469. return _regenerator.default.wrap(function _callee5$(_context5) {
  15470. while (1) {
  15471. switch (_context5.prev = _context5.next) {
  15472. case 0:
  15473. result = this._checkFieldInSchema(data);
  15474. if (result) {
  15475. _context5.next = 5;
  15476. break;
  15477. }
  15478. _context5.next = 4;
  15479. return this.invokeValidateUpdate(data, false, allData);
  15480. case 4:
  15481. result = _context5.sent;
  15482. case 5:
  15483. return _context5.abrupt("return", result.length ? result[0] : null);
  15484. case 6:
  15485. case "end":
  15486. return _context5.stop();
  15487. }
  15488. }
  15489. }, _callee5, this);
  15490. }));
  15491. function validateUpdate(_x15, _x16) {
  15492. return _validateUpdate.apply(this, arguments);
  15493. }
  15494. return validateUpdate;
  15495. }()
  15496. }, {
  15497. key: "invokeValidate",
  15498. value: function () {
  15499. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  15500. var result, schema, key, value, errorMessage;
  15501. return _regenerator.default.wrap(function _callee6$(_context6) {
  15502. while (1) {
  15503. switch (_context6.prev = _context6.next) {
  15504. case 0:
  15505. result = [];
  15506. schema = this._schema;
  15507. _context6.t0 = _regenerator.default.keys(schema);
  15508. case 3:
  15509. if ((_context6.t1 = _context6.t0()).done) {
  15510. _context6.next = 15;
  15511. break;
  15512. }
  15513. key = _context6.t1.value;
  15514. value = schema[key];
  15515. _context6.next = 8;
  15516. return this.validateRule(key, value, data[key], data, allData);
  15517. case 8:
  15518. errorMessage = _context6.sent;
  15519. if (!(errorMessage != null)) {
  15520. _context6.next = 13;
  15521. break;
  15522. }
  15523. result.push({
  15524. key: key,
  15525. errorMessage: errorMessage
  15526. });
  15527. if (all) {
  15528. _context6.next = 13;
  15529. break;
  15530. }
  15531. return _context6.abrupt("break", 15);
  15532. case 13:
  15533. _context6.next = 3;
  15534. break;
  15535. case 15:
  15536. return _context6.abrupt("return", result);
  15537. case 16:
  15538. case "end":
  15539. return _context6.stop();
  15540. }
  15541. }
  15542. }, _callee6, this);
  15543. }));
  15544. function invokeValidate(_x17, _x18, _x19) {
  15545. return _invokeValidate.apply(this, arguments);
  15546. }
  15547. return invokeValidate;
  15548. }()
  15549. }, {
  15550. key: "invokeValidateUpdate",
  15551. value: function () {
  15552. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  15553. var result, key, errorMessage;
  15554. return _regenerator.default.wrap(function _callee7$(_context7) {
  15555. while (1) {
  15556. switch (_context7.prev = _context7.next) {
  15557. case 0:
  15558. result = [];
  15559. _context7.t0 = _regenerator.default.keys(data);
  15560. case 2:
  15561. if ((_context7.t1 = _context7.t0()).done) {
  15562. _context7.next = 13;
  15563. break;
  15564. }
  15565. key = _context7.t1.value;
  15566. _context7.next = 6;
  15567. return this.validateRule(key, this._schema[key], data[key], data, allData);
  15568. case 6:
  15569. errorMessage = _context7.sent;
  15570. if (!(errorMessage != null)) {
  15571. _context7.next = 11;
  15572. break;
  15573. }
  15574. result.push({
  15575. key: key,
  15576. errorMessage: errorMessage
  15577. });
  15578. if (all) {
  15579. _context7.next = 11;
  15580. break;
  15581. }
  15582. return _context7.abrupt("break", 13);
  15583. case 11:
  15584. _context7.next = 2;
  15585. break;
  15586. case 13:
  15587. return _context7.abrupt("return", result);
  15588. case 14:
  15589. case "end":
  15590. return _context7.stop();
  15591. }
  15592. }
  15593. }, _callee7, this);
  15594. }));
  15595. function invokeValidateUpdate(_x20, _x21, _x22) {
  15596. return _invokeValidateUpdate.apply(this, arguments);
  15597. }
  15598. return invokeValidateUpdate;
  15599. }()
  15600. }, {
  15601. key: "_checkFieldInSchema",
  15602. value: function _checkFieldInSchema(data) {
  15603. var keys = Object.keys(data);
  15604. var keys2 = Object.keys(this._schema);
  15605. if (new Set(keys.concat(keys2)).size === keys2.length) {
  15606. return '';
  15607. }
  15608. var noExistFields = keys.filter(function (key) {
  15609. return keys2.indexOf(key) < 0;
  15610. });
  15611. var errorMessage = formatMessage({
  15612. field: JSON.stringify(noExistFields)
  15613. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  15614. return [{
  15615. key: 'invalid',
  15616. errorMessage: errorMessage
  15617. }];
  15618. }
  15619. }]);
  15620. return SchemaValidator;
  15621. }(RuleValidator);
  15622. function Message() {
  15623. return {
  15624. TAG: "",
  15625. default: '验证错误',
  15626. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  15627. validateFunction: '验证无效',
  15628. required: '{label}必填',
  15629. 'enum': '{label}超出范围',
  15630. timestamp: '{label}格式无效',
  15631. whitespace: '{label}不能为空',
  15632. typeError: '{label}类型无效',
  15633. date: {
  15634. format: '{label}日期{value}格式无效',
  15635. parse: '{label}日期无法解析,{value}无效',
  15636. invalid: '{label}日期{value}无效'
  15637. },
  15638. length: {
  15639. minLength: '{label}长度不能少于{minLength}',
  15640. maxLength: '{label}长度不能超过{maxLength}',
  15641. range: '{label}必须介于{minLength}和{maxLength}之间'
  15642. },
  15643. number: {
  15644. minimum: '{label}不能小于{minimum}',
  15645. maximum: '{label}不能大于{maximum}',
  15646. exclusiveMinimum: '{label}不能小于等于{minimum}',
  15647. exclusiveMaximum: '{label}不能大于等于{maximum}',
  15648. range: '{label}必须介于{minimum}and{maximum}之间'
  15649. },
  15650. pattern: {
  15651. mismatch: '{label}格式不匹配'
  15652. }
  15653. };
  15654. }
  15655. SchemaValidator.message = new Message();
  15656. var _default = SchemaValidator;
  15657. exports.default = _default;
  15658. /***/ }),
  15659. /***/ 4:
  15660. /*!**********************************************************************!*\
  15661. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  15662. \**********************************************************************/
  15663. /*! no static exports found */
  15664. /***/ (function(module, exports) {
  15665. function _interopRequireDefault(obj) {
  15666. return obj && obj.__esModule ? obj : {
  15667. "default": obj
  15668. };
  15669. }
  15670. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15671. /***/ }),
  15672. /***/ 400:
  15673. /*!*********************************************************!*\
  15674. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  15675. \*********************************************************/
  15676. /*! no static exports found */
  15677. /***/ (function(module, exports, __webpack_require__) {
  15678. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  15679. function _inherits(subClass, superClass) {
  15680. if (typeof superClass !== "function" && superClass !== null) {
  15681. throw new TypeError("Super expression must either be null or a function");
  15682. }
  15683. subClass.prototype = Object.create(superClass && superClass.prototype, {
  15684. constructor: {
  15685. value: subClass,
  15686. writable: true,
  15687. configurable: true
  15688. }
  15689. });
  15690. Object.defineProperty(subClass, "prototype", {
  15691. writable: false
  15692. });
  15693. if (superClass) setPrototypeOf(subClass, superClass);
  15694. }
  15695. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15696. /***/ }),
  15697. /***/ 401:
  15698. /*!**************************************************************************!*\
  15699. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  15700. \**************************************************************************/
  15701. /*! no static exports found */
  15702. /***/ (function(module, exports, __webpack_require__) {
  15703. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  15704. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 402);
  15705. function _possibleConstructorReturn(self, call) {
  15706. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  15707. return call;
  15708. } else if (call !== void 0) {
  15709. throw new TypeError("Derived constructors may only return object or undefined");
  15710. }
  15711. return assertThisInitialized(self);
  15712. }
  15713. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15714. /***/ }),
  15715. /***/ 402:
  15716. /*!**********************************************************************!*\
  15717. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  15718. \**********************************************************************/
  15719. /*! no static exports found */
  15720. /***/ (function(module, exports) {
  15721. function _assertThisInitialized(self) {
  15722. if (self === void 0) {
  15723. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  15724. }
  15725. return self;
  15726. }
  15727. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15728. /***/ }),
  15729. /***/ 403:
  15730. /*!***************************************************************!*\
  15731. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  15732. \***************************************************************/
  15733. /*! no static exports found */
  15734. /***/ (function(module, exports) {
  15735. function _getPrototypeOf(o) {
  15736. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  15737. return o.__proto__ || Object.getPrototypeOf(o);
  15738. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15739. return _getPrototypeOf(o);
  15740. }
  15741. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15742. /***/ }),
  15743. /***/ 404:
  15744. /*!**************************************************************************************!*\
  15745. !*** D:/project/material_applet/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  15746. \**************************************************************************************/
  15747. /*! no static exports found */
  15748. /***/ (function(module, exports, __webpack_require__) {
  15749. "use strict";
  15750. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15751. Object.defineProperty(exports, "__esModule", {
  15752. value: true
  15753. });
  15754. 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;
  15755. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  15756. /**
  15757. * 简单处理对象拷贝
  15758. * @param {Obejct} 被拷贝对象
  15759. * @@return {Object} 拷贝对象
  15760. */
  15761. var deepCopy = function deepCopy(val) {
  15762. return JSON.parse(JSON.stringify(val));
  15763. };
  15764. /**
  15765. * 过滤数字类型
  15766. * @param {String} format 数字类型
  15767. * @@return {Boolean} 返回是否为数字类型
  15768. */
  15769. exports.deepCopy = deepCopy;
  15770. var typeFilter = function typeFilter(format) {
  15771. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  15772. };
  15773. /**
  15774. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  15775. * @param {String} key 字段名
  15776. * @param {any} value 字段值
  15777. * @param {Object} rules 表单校验规则
  15778. */
  15779. exports.typeFilter = typeFilter;
  15780. var getValue = function getValue(key, value, rules) {
  15781. var isRuleNumType = rules.find(function (val) {
  15782. return val.format && typeFilter(val.format);
  15783. });
  15784. var isRuleBoolType = rules.find(function (val) {
  15785. return val.format && val.format === 'boolean' || val.format === 'bool';
  15786. });
  15787. // 输入类型为 number
  15788. if (!!isRuleNumType) {
  15789. if (!value && value !== 0) {
  15790. value = null;
  15791. } else {
  15792. value = isNumber(Number(value)) ? Number(value) : value;
  15793. }
  15794. }
  15795. // 输入类型为 boolean
  15796. if (!!isRuleBoolType) {
  15797. value = isBoolean(value) ? value : false;
  15798. }
  15799. return value;
  15800. };
  15801. /**
  15802. * 获取表单数据
  15803. * @param {String|Array} name 真实名称,需要使用 realName 获取
  15804. * @param {Object} data 原始数据
  15805. * @param {any} value 需要设置的值
  15806. */
  15807. exports.getValue = getValue;
  15808. var setDataValue = function setDataValue(field, formdata, value) {
  15809. formdata[field] = value;
  15810. return value || '';
  15811. };
  15812. /**
  15813. * 获取表单数据
  15814. * @param {String|Array} field 真实名称,需要使用 realName 获取
  15815. * @param {Object} data 原始数据
  15816. */
  15817. exports.setDataValue = setDataValue;
  15818. var getDataValue = function getDataValue(field, data) {
  15819. return objGet(data, field);
  15820. };
  15821. /**
  15822. * 获取表单类型
  15823. * @param {String|Array} field 真实名称,需要使用 realName 获取
  15824. */
  15825. exports.getDataValue = getDataValue;
  15826. var getDataValueType = function getDataValueType(field, data) {
  15827. var value = getDataValue(field, data);
  15828. return {
  15829. type: type(value),
  15830. value: value
  15831. };
  15832. };
  15833. /**
  15834. * 获取表单可用的真实name
  15835. * @param {String|Array} name 表单name
  15836. * @@return {String} 表单可用的真实name
  15837. */
  15838. exports.getDataValueType = getDataValueType;
  15839. var realName = function realName(name) {
  15840. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15841. var base_name = _basePath(name);
  15842. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  15843. var realname = base_name.reduce(function (a, b) {
  15844. return a += "#".concat(b);
  15845. }, '_formdata_');
  15846. return realname;
  15847. }
  15848. return base_name[0] || name;
  15849. };
  15850. /**
  15851. * 判断是否表单可用的真实name
  15852. * @param {String|Array} name 表单name
  15853. * @@return {String} 表单可用的真实name
  15854. */
  15855. exports.realName = realName;
  15856. var isRealName = function isRealName(name) {
  15857. var reg = /^_formdata_#*/;
  15858. return reg.test(name);
  15859. };
  15860. /**
  15861. * 获取表单数据的原始格式
  15862. * @@return {Object|Array} object 需要解析的数据
  15863. */
  15864. exports.isRealName = isRealName;
  15865. var rawData = function rawData() {
  15866. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15867. var name = arguments.length > 1 ? arguments[1] : undefined;
  15868. var newData = JSON.parse(JSON.stringify(object));
  15869. var formData = {};
  15870. for (var i in newData) {
  15871. var path = name2arr(i);
  15872. objSet(formData, path, newData[i]);
  15873. }
  15874. return formData;
  15875. };
  15876. /**
  15877. * 真实name还原为 array
  15878. * @param {*} name
  15879. */
  15880. exports.rawData = rawData;
  15881. var name2arr = function name2arr(name) {
  15882. var field = name.replace('_formdata_#', '');
  15883. field = field.split('#').map(function (v) {
  15884. return isNumber(v) ? Number(v) : v;
  15885. });
  15886. return field;
  15887. };
  15888. /**
  15889. * 对象中设置值
  15890. * @param {Object|Array} object 源数据
  15891. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  15892. * @param {String} value 需要设置的值
  15893. */
  15894. exports.name2arr = name2arr;
  15895. var objSet = function objSet(object, path, value) {
  15896. if ((0, _typeof2.default)(object) !== 'object') return object;
  15897. _basePath(path).reduce(function (o, k, i, _) {
  15898. if (i === _.length - 1) {
  15899. // 若遍历结束直接赋值
  15900. o[k] = value;
  15901. return null;
  15902. } else if (k in o) {
  15903. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  15904. return o[k];
  15905. } else {
  15906. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  15907. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  15908. return o[k];
  15909. }
  15910. }, object);
  15911. // 返回object
  15912. return object;
  15913. };
  15914. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  15915. exports.objSet = objSet;
  15916. function _basePath(path) {
  15917. // 若是数组,则直接返回
  15918. if (Array.isArray(path)) return path;
  15919. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  15920. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  15921. }
  15922. /**
  15923. * 从对象中获取值
  15924. * @param {Object|Array} object 源数据
  15925. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  15926. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  15927. */
  15928. var objGet = function objGet(object, path) {
  15929. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  15930. // 先将path处理成统一格式
  15931. var newPath = _basePath(path);
  15932. // 递归处理,返回最后结果
  15933. var val = newPath.reduce(function (o, k) {
  15934. return (o || {})[k];
  15935. }, object);
  15936. return !val || val !== undefined ? val : defaultVal;
  15937. };
  15938. /**
  15939. * 是否为 number 类型
  15940. * @param {any} num 需要判断的值
  15941. * @return {Boolean} 是否为 number
  15942. */
  15943. exports.objGet = objGet;
  15944. var isNumber = function isNumber(num) {
  15945. return !isNaN(Number(num));
  15946. };
  15947. /**
  15948. * 是否为 boolean 类型
  15949. * @param {any} bool 需要判断的值
  15950. * @return {Boolean} 是否为 boolean
  15951. */
  15952. exports.isNumber = isNumber;
  15953. var isBoolean = function isBoolean(bool) {
  15954. return typeof bool === 'boolean';
  15955. };
  15956. /**
  15957. * 是否有必填字段
  15958. * @param {Object} rules 规则
  15959. * @return {Boolean} 是否有必填字段
  15960. */
  15961. exports.isBoolean = isBoolean;
  15962. var isRequiredField = function isRequiredField(rules) {
  15963. var isNoField = false;
  15964. for (var i = 0; i < rules.length; i++) {
  15965. var ruleData = rules[i];
  15966. if (ruleData.required) {
  15967. isNoField = true;
  15968. break;
  15969. }
  15970. }
  15971. return isNoField;
  15972. };
  15973. /**
  15974. * 获取数据类型
  15975. * @param {Any} obj 需要获取数据类型的值
  15976. */
  15977. exports.isRequiredField = isRequiredField;
  15978. var type = function type(obj) {
  15979. var class2type = {};
  15980. // 生成class2type映射
  15981. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  15982. class2type["[object " + item + "]"] = item.toLowerCase();
  15983. });
  15984. if (obj == null) {
  15985. return obj + "";
  15986. }
  15987. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  15988. };
  15989. /**
  15990. * 判断两个值是否相等
  15991. * @param {any} a 值
  15992. * @param {any} b 值
  15993. * @return {Boolean} 是否相等
  15994. */
  15995. exports.type = type;
  15996. var isEqual = function isEqual(a, b) {
  15997. //如果a和b本来就全等
  15998. if (a === b) {
  15999. //判断是否为0和-0
  16000. return a !== 0 || 1 / a === 1 / b;
  16001. }
  16002. //判断是否为null和undefined
  16003. if (a == null || b == null) {
  16004. return a === b;
  16005. }
  16006. //接下来判断a和b的数据类型
  16007. var classNameA = toString.call(a),
  16008. classNameB = toString.call(b);
  16009. //如果数据类型不相等,则返回false
  16010. if (classNameA !== classNameB) {
  16011. return false;
  16012. }
  16013. //如果数据类型相等,再根据不同数据类型分别判断
  16014. switch (classNameA) {
  16015. case '[object RegExp]':
  16016. case '[object String]':
  16017. //进行字符串转换比较
  16018. return '' + a === '' + b;
  16019. case '[object Number]':
  16020. //进行数字转换比较,判断是否为NaN
  16021. if (+a !== +a) {
  16022. return +b !== +b;
  16023. }
  16024. //判断是否为0或-0
  16025. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  16026. case '[object Date]':
  16027. case '[object Boolean]':
  16028. return +a === +b;
  16029. }
  16030. //如果是对象类型
  16031. if (classNameA == '[object Object]') {
  16032. //获取a和b的属性长度
  16033. var propsA = Object.getOwnPropertyNames(a),
  16034. propsB = Object.getOwnPropertyNames(b);
  16035. if (propsA.length != propsB.length) {
  16036. return false;
  16037. }
  16038. for (var i = 0; i < propsA.length; i++) {
  16039. var propName = propsA[i];
  16040. //如果对应属性对应值不相等,则返回false
  16041. if (a[propName] !== b[propName]) {
  16042. return false;
  16043. }
  16044. }
  16045. return true;
  16046. }
  16047. //如果是数组类型
  16048. if (classNameA == '[object Array]') {
  16049. if (a.toString() == b.toString()) {
  16050. return true;
  16051. }
  16052. return false;
  16053. }
  16054. };
  16055. exports.isEqual = isEqual;
  16056. /***/ }),
  16057. /***/ 426:
  16058. /*!************************************************************************************!*\
  16059. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  16060. \************************************************************************************/
  16061. /*! no static exports found */
  16062. /***/ (function(module, exports, __webpack_require__) {
  16063. "use strict";
  16064. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  16065. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16066. Object.defineProperty(exports, "__esModule", {
  16067. value: true
  16068. });
  16069. exports.default = void 0;
  16070. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
  16071. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 402));
  16072. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  16073. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  16074. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  16075. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
  16076. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  16077. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 400));
  16078. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 401));
  16079. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 403));
  16080. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 427));
  16081. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  16082. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  16083. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  16084. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 429));
  16085. 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; } } }; }
  16086. 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); }
  16087. 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; }
  16088. 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; }
  16089. 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; }
  16090. 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); }; }
  16091. 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; } }
  16092. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  16093. function n(e) {
  16094. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  16095. }
  16096. function s(e, t, n) {
  16097. return e(n = {
  16098. path: t,
  16099. exports: {},
  16100. require: function require(e, t) {
  16101. return function () {
  16102. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  16103. }(null == t && n.path);
  16104. }
  16105. }, n.exports), n.exports;
  16106. }
  16107. var r = s(function (e, t) {
  16108. var n;
  16109. e.exports = (n = n || function (e, t) {
  16110. var n = Object.create || function () {
  16111. function e() {}
  16112. return function (t) {
  16113. var n;
  16114. return e.prototype = t, n = new e(), e.prototype = null, n;
  16115. };
  16116. }(),
  16117. s = {},
  16118. r = s.lib = {},
  16119. i = r.Base = {
  16120. extend: function extend(e) {
  16121. var t = n(this);
  16122. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  16123. t.$super.init.apply(this, arguments);
  16124. }), t.init.prototype = t, t.$super = this, t;
  16125. },
  16126. create: function create() {
  16127. var e = this.extend();
  16128. return e.init.apply(e, arguments), e;
  16129. },
  16130. init: function init() {},
  16131. mixIn: function mixIn(e) {
  16132. for (var t in e) {
  16133. e.hasOwnProperty(t) && (this[t] = e[t]);
  16134. }
  16135. e.hasOwnProperty("toString") && (this.toString = e.toString);
  16136. },
  16137. clone: function clone() {
  16138. return this.init.prototype.extend(this);
  16139. }
  16140. },
  16141. o = r.WordArray = i.extend({
  16142. init: function init(e, n) {
  16143. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  16144. },
  16145. toString: function toString(e) {
  16146. return (e || c).stringify(this);
  16147. },
  16148. concat: function concat(e) {
  16149. var t = this.words,
  16150. n = e.words,
  16151. s = this.sigBytes,
  16152. r = e.sigBytes;
  16153. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  16154. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  16155. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  16156. } else for (i = 0; i < r; i += 4) {
  16157. t[s + i >>> 2] = n[i >>> 2];
  16158. }
  16159. return this.sigBytes += r, this;
  16160. },
  16161. clamp: function clamp() {
  16162. var t = this.words,
  16163. n = this.sigBytes;
  16164. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  16165. },
  16166. clone: function clone() {
  16167. var e = i.clone.call(this);
  16168. return e.words = this.words.slice(0), e;
  16169. },
  16170. random: function random(t) {
  16171. for (var n, s = [], r = function r(t) {
  16172. t = t;
  16173. var n = 987654321,
  16174. s = 4294967295;
  16175. return function () {
  16176. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  16177. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  16178. };
  16179. }, i = 0; i < t; i += 4) {
  16180. var a = r(4294967296 * (n || e.random()));
  16181. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  16182. }
  16183. return new o.init(s, t);
  16184. }
  16185. }),
  16186. a = s.enc = {},
  16187. c = a.Hex = {
  16188. stringify: function stringify(e) {
  16189. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  16190. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  16191. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  16192. }
  16193. return s.join("");
  16194. },
  16195. parse: function parse(e) {
  16196. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  16197. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  16198. }
  16199. return new o.init(n, t / 2);
  16200. }
  16201. },
  16202. u = a.Latin1 = {
  16203. stringify: function stringify(e) {
  16204. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  16205. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  16206. s.push(String.fromCharCode(i));
  16207. }
  16208. return s.join("");
  16209. },
  16210. parse: function parse(e) {
  16211. for (var t = e.length, n = [], s = 0; s < t; s++) {
  16212. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  16213. }
  16214. return new o.init(n, t);
  16215. }
  16216. },
  16217. h = a.Utf8 = {
  16218. stringify: function stringify(e) {
  16219. try {
  16220. return decodeURIComponent(escape(u.stringify(e)));
  16221. } catch (e) {
  16222. throw new Error("Malformed UTF-8 data");
  16223. }
  16224. },
  16225. parse: function parse(e) {
  16226. return u.parse(unescape(encodeURIComponent(e)));
  16227. }
  16228. },
  16229. l = r.BufferedBlockAlgorithm = i.extend({
  16230. reset: function reset() {
  16231. this._data = new o.init(), this._nDataBytes = 0;
  16232. },
  16233. _append: function _append(e) {
  16234. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  16235. },
  16236. _process: function _process(t) {
  16237. var n = this._data,
  16238. s = n.words,
  16239. r = n.sigBytes,
  16240. i = this.blockSize,
  16241. a = r / (4 * i),
  16242. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  16243. u = e.min(4 * c, r);
  16244. if (c) {
  16245. for (var h = 0; h < c; h += i) {
  16246. this._doProcessBlock(s, h);
  16247. }
  16248. var l = s.splice(0, c);
  16249. n.sigBytes -= u;
  16250. }
  16251. return new o.init(l, u);
  16252. },
  16253. clone: function clone() {
  16254. var e = i.clone.call(this);
  16255. return e._data = this._data.clone(), e;
  16256. },
  16257. _minBufferSize: 0
  16258. });
  16259. r.Hasher = l.extend({
  16260. cfg: i.extend(),
  16261. init: function init(e) {
  16262. this.cfg = this.cfg.extend(e), this.reset();
  16263. },
  16264. reset: function reset() {
  16265. l.reset.call(this), this._doReset();
  16266. },
  16267. update: function update(e) {
  16268. return this._append(e), this._process(), this;
  16269. },
  16270. finalize: function finalize(e) {
  16271. return e && this._append(e), this._doFinalize();
  16272. },
  16273. blockSize: 16,
  16274. _createHelper: function _createHelper(e) {
  16275. return function (t, n) {
  16276. return new e.init(n).finalize(t);
  16277. };
  16278. },
  16279. _createHmacHelper: function _createHmacHelper(e) {
  16280. return function (t, n) {
  16281. return new d.HMAC.init(e, n).finalize(t);
  16282. };
  16283. }
  16284. });
  16285. var d = s.algo = {};
  16286. return s;
  16287. }(Math), n);
  16288. }),
  16289. i = r,
  16290. o = (s(function (e, t) {
  16291. var n;
  16292. e.exports = (n = i, function (e) {
  16293. var t = n,
  16294. s = t.lib,
  16295. r = s.WordArray,
  16296. i = s.Hasher,
  16297. o = t.algo,
  16298. a = [];
  16299. !function () {
  16300. for (var t = 0; t < 64; t++) {
  16301. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  16302. }
  16303. }();
  16304. var c = o.MD5 = i.extend({
  16305. _doReset: function _doReset() {
  16306. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  16307. },
  16308. _doProcessBlock: function _doProcessBlock(e, t) {
  16309. for (var n = 0; n < 16; n++) {
  16310. var s = t + n,
  16311. r = e[s];
  16312. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  16313. }
  16314. var i = this._hash.words,
  16315. o = e[t + 0],
  16316. c = e[t + 1],
  16317. p = e[t + 2],
  16318. f = e[t + 3],
  16319. g = e[t + 4],
  16320. m = e[t + 5],
  16321. y = e[t + 6],
  16322. _ = e[t + 7],
  16323. w = e[t + 8],
  16324. v = e[t + 9],
  16325. I = e[t + 10],
  16326. S = e[t + 11],
  16327. b = e[t + 12],
  16328. k = e[t + 13],
  16329. C = e[t + 14],
  16330. T = e[t + 15],
  16331. P = i[0],
  16332. A = i[1],
  16333. E = i[2],
  16334. O = i[3];
  16335. 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;
  16336. },
  16337. _doFinalize: function _doFinalize() {
  16338. var t = this._data,
  16339. n = t.words,
  16340. s = 8 * this._nDataBytes,
  16341. r = 8 * t.sigBytes;
  16342. n[r >>> 5] |= 128 << 24 - r % 32;
  16343. var i = e.floor(s / 4294967296),
  16344. o = s;
  16345. 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();
  16346. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  16347. var h = c[u];
  16348. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  16349. }
  16350. return a;
  16351. },
  16352. clone: function clone() {
  16353. var e = i.clone.call(this);
  16354. return e._hash = this._hash.clone(), e;
  16355. }
  16356. });
  16357. function u(e, t, n, s, r, i, o) {
  16358. var a = e + (t & n | ~t & s) + r + o;
  16359. return (a << i | a >>> 32 - i) + t;
  16360. }
  16361. function h(e, t, n, s, r, i, o) {
  16362. var a = e + (t & s | n & ~s) + r + o;
  16363. return (a << i | a >>> 32 - i) + t;
  16364. }
  16365. function l(e, t, n, s, r, i, o) {
  16366. var a = e + (t ^ n ^ s) + r + o;
  16367. return (a << i | a >>> 32 - i) + t;
  16368. }
  16369. function d(e, t, n, s, r, i, o) {
  16370. var a = e + (n ^ (t | ~s)) + r + o;
  16371. return (a << i | a >>> 32 - i) + t;
  16372. }
  16373. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  16374. }(Math), n.MD5);
  16375. }), s(function (e, t) {
  16376. var n;
  16377. e.exports = (n = i, void function () {
  16378. var e = n,
  16379. t = e.lib.Base,
  16380. s = e.enc.Utf8;
  16381. e.algo.HMAC = t.extend({
  16382. init: function init(e, t) {
  16383. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  16384. var n = e.blockSize,
  16385. r = 4 * n;
  16386. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  16387. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  16388. a[u] ^= 1549556828, c[u] ^= 909522486;
  16389. }
  16390. i.sigBytes = o.sigBytes = r, this.reset();
  16391. },
  16392. reset: function reset() {
  16393. var e = this._hasher;
  16394. e.reset(), e.update(this._iKey);
  16395. },
  16396. update: function update(e) {
  16397. return this._hasher.update(e), this;
  16398. },
  16399. finalize: function finalize(e) {
  16400. var t = this._hasher,
  16401. n = t.finalize(e);
  16402. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  16403. }
  16404. });
  16405. }());
  16406. }), s(function (e, t) {
  16407. e.exports = i.HmacMD5;
  16408. })),
  16409. a = s(function (e, t) {
  16410. e.exports = i.enc.Utf8;
  16411. }),
  16412. c = s(function (e, t) {
  16413. var n;
  16414. e.exports = (n = i, function () {
  16415. var e = n,
  16416. t = e.lib.WordArray;
  16417. function s(e, n, s) {
  16418. for (var r = [], i = 0, o = 0; o < n; o++) {
  16419. if (o % 4) {
  16420. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  16421. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  16422. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  16423. }
  16424. }
  16425. return t.create(r, i);
  16426. }
  16427. e.enc.Base64 = {
  16428. stringify: function stringify(e) {
  16429. var t = e.words,
  16430. n = e.sigBytes,
  16431. s = this._map;
  16432. e.clamp();
  16433. for (var r = [], i = 0; i < n; i += 3) {
  16434. 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++) {
  16435. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  16436. }
  16437. }
  16438. var c = s.charAt(64);
  16439. if (c) for (; r.length % 4;) {
  16440. r.push(c);
  16441. }
  16442. return r.join("");
  16443. },
  16444. parse: function parse(e) {
  16445. var t = e.length,
  16446. n = this._map,
  16447. r = this._reverseMap;
  16448. if (!r) {
  16449. r = this._reverseMap = [];
  16450. for (var i = 0; i < n.length; i++) {
  16451. r[n.charCodeAt(i)] = i;
  16452. }
  16453. }
  16454. var o = n.charAt(64);
  16455. if (o) {
  16456. var a = e.indexOf(o);
  16457. -1 !== a && (t = a);
  16458. }
  16459. return s(e, t, r);
  16460. },
  16461. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  16462. };
  16463. }(), n.enc.Base64);
  16464. });
  16465. var u = "FUNCTION",
  16466. h = "OBJECT",
  16467. l = "CLIENT_DB",
  16468. d = "pending",
  16469. p = "fullfilled",
  16470. f = "rejected";
  16471. function g(e) {
  16472. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  16473. }
  16474. function m(e) {
  16475. return "object" === g(e);
  16476. }
  16477. function y(e) {
  16478. return "function" == typeof e;
  16479. }
  16480. function _(e) {
  16481. return function () {
  16482. try {
  16483. return e.apply(e, arguments);
  16484. } catch (e) {
  16485. console.error(e);
  16486. }
  16487. };
  16488. }
  16489. var w = "REJECTED",
  16490. v = "NOT_PENDING";
  16491. var I = /*#__PURE__*/function () {
  16492. function I() {
  16493. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16494. e = _ref.createPromise,
  16495. _ref$retryRule = _ref.retryRule,
  16496. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  16497. (0, _classCallCheck2.default)(this, I);
  16498. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  16499. }
  16500. (0, _createClass2.default)(I, [{
  16501. key: "needRetry",
  16502. get: function get() {
  16503. if (!this.status) return !0;
  16504. switch (this.retryRule) {
  16505. case w:
  16506. return this.status === f;
  16507. case v:
  16508. return this.status !== d;
  16509. }
  16510. }
  16511. }, {
  16512. key: "exec",
  16513. value: function exec() {
  16514. var _this = this;
  16515. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  16516. return _this.status = p, Promise.resolve(e);
  16517. }, function (e) {
  16518. return _this.status = f, Promise.reject(e);
  16519. }), this.promise) : this.promise;
  16520. }
  16521. }]);
  16522. return I;
  16523. }();
  16524. function S(e) {
  16525. return e && "string" == typeof e ? JSON.parse(e) : e;
  16526. }
  16527. var b = "development" === "development",
  16528. k = "mp-weixin",
  16529. C = "true" === undefined || !0 === undefined,
  16530. T = S([]),
  16531. P = "h5" === k ? "web" : "app-plus" === k ? "app" : k,
  16532. A = S(undefined),
  16533. E = S(undefined) || [],
  16534. O = true;
  16535. var x = "";
  16536. try {
  16537. x = (__webpack_require__(/*! uni-stat-config */ 430).default || __webpack_require__(/*! uni-stat-config */ 430)).appid;
  16538. } catch (e) {}
  16539. var R = {};
  16540. function U(e) {
  16541. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16542. var n, s;
  16543. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  16544. }
  16545. "app" === P && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  16546. var L = ["invoke", "success", "fail", "complete"],
  16547. N = U("_globalUniCloudInterceptor");
  16548. function D(e, t) {
  16549. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  16550. L.indexOf(n) > -1 && function (e, t, n) {
  16551. var s = N[e][t];
  16552. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  16553. }(e, n, t[n]);
  16554. });
  16555. }
  16556. function F(e, t) {
  16557. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  16558. L.indexOf(n) > -1 && function (e, t, n) {
  16559. var s = N[e][t];
  16560. if (!s) return;
  16561. var r = s.indexOf(n);
  16562. r > -1 && s.splice(r, 1);
  16563. }(e, n, t[n]);
  16564. }) : delete N[e];
  16565. }
  16566. function q(e, t) {
  16567. return e && 0 !== e.length ? e.reduce(function (e, n) {
  16568. return e.then(function () {
  16569. return n(t);
  16570. });
  16571. }, Promise.resolve()) : Promise.resolve();
  16572. }
  16573. function M(e, t) {
  16574. return N[e] && N[e][t] || [];
  16575. }
  16576. function K(e) {
  16577. D("callObject", e);
  16578. }
  16579. var j = U("_globalUniCloudListener"),
  16580. B = "response",
  16581. $ = "needLogin",
  16582. W = "refreshToken",
  16583. z = "clientdb",
  16584. J = "cloudfunction",
  16585. H = "cloudobject";
  16586. function G(e) {
  16587. return j[e] || (j[e] = []), j[e];
  16588. }
  16589. function V(e, t) {
  16590. var n = G(e);
  16591. n.includes(t) || n.push(t);
  16592. }
  16593. function Y(e, t) {
  16594. var n = G(e),
  16595. s = n.indexOf(t);
  16596. -1 !== s && n.splice(s, 1);
  16597. }
  16598. function Q(e, t) {
  16599. var n = G(e);
  16600. for (var _e2 = 0; _e2 < n.length; _e2++) {
  16601. (0, n[_e2])(t);
  16602. }
  16603. }
  16604. var X,
  16605. Z = !1;
  16606. function ee() {
  16607. return X || (X = new Promise(function (e) {
  16608. Z && e(), function t() {
  16609. if ("function" == typeof getCurrentPages) {
  16610. var _t2 = getCurrentPages();
  16611. _t2 && _t2[0] && (Z = !0, e());
  16612. }
  16613. Z || setTimeout(function () {
  16614. t();
  16615. }, 30);
  16616. }();
  16617. }), X);
  16618. }
  16619. function te(e) {
  16620. var t = {};
  16621. for (var _n2 in e) {
  16622. var _s2 = e[_n2];
  16623. y(_s2) && (t[_n2] = _(_s2));
  16624. }
  16625. return t;
  16626. }
  16627. var ne = /*#__PURE__*/function (_Error) {
  16628. (0, _inherits2.default)(ne, _Error);
  16629. var _super = _createSuper(ne);
  16630. function ne(e) {
  16631. var _this2;
  16632. (0, _classCallCheck2.default)(this, ne);
  16633. _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;
  16634. return _this2;
  16635. }
  16636. (0, _createClass2.default)(ne, [{
  16637. key: "toJson",
  16638. value: function toJson() {
  16639. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  16640. if (!(e >= 10)) return e++, {
  16641. errCode: this.errCode,
  16642. errMsg: this.errMsg,
  16643. errSubject: this.errSubject,
  16644. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  16645. };
  16646. }
  16647. }]);
  16648. return ne;
  16649. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  16650. var se = {
  16651. request: function request(e) {
  16652. return uni.request(e);
  16653. },
  16654. uploadFile: function uploadFile(e) {
  16655. return uni.uploadFile(e);
  16656. },
  16657. setStorageSync: function setStorageSync(e, t) {
  16658. return uni.setStorageSync(e, t);
  16659. },
  16660. getStorageSync: function getStorageSync(e) {
  16661. return uni.getStorageSync(e);
  16662. },
  16663. removeStorageSync: function removeStorageSync(e) {
  16664. return uni.removeStorageSync(e);
  16665. },
  16666. clearStorageSync: function clearStorageSync() {
  16667. return uni.clearStorageSync();
  16668. }
  16669. };
  16670. function re() {
  16671. return {
  16672. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  16673. tokenExpired: se.getStorageSync("uni_id_token_expired")
  16674. };
  16675. }
  16676. function ie() {
  16677. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16678. e = _ref2.token,
  16679. t = _ref2.tokenExpired;
  16680. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  16681. }
  16682. var oe, ae;
  16683. function ce() {
  16684. return oe || (oe = uni.getSystemInfoSync()), oe;
  16685. }
  16686. function ue() {
  16687. var e, t;
  16688. try {
  16689. if (uni.getLaunchOptionsSync) {
  16690. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  16691. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  16692. _n3 = _uni$getLaunchOptions.scene,
  16693. _s3 = _uni$getLaunchOptions.channel;
  16694. e = _s3, t = _n3;
  16695. }
  16696. } catch (e) {}
  16697. return {
  16698. channel: e,
  16699. scene: t
  16700. };
  16701. }
  16702. function he() {
  16703. var e = uni.getLocale && uni.getLocale() || "en";
  16704. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  16705. locale: e,
  16706. LOCALE: e
  16707. });
  16708. var t = ce(),
  16709. n = t.deviceId,
  16710. s = t.osName,
  16711. r = t.uniPlatform,
  16712. i = t.appId,
  16713. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  16714. for (var _e3 = 0; _e3 < o.length; _e3++) {
  16715. delete t[o[_e3]];
  16716. }
  16717. return ae = _objectSpread(_objectSpread({
  16718. PLATFORM: r,
  16719. OS: s,
  16720. APPID: i,
  16721. DEVICEID: n
  16722. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  16723. locale: e,
  16724. LOCALE: e
  16725. });
  16726. }
  16727. var le = {
  16728. sign: function sign(e, t) {
  16729. var n = "";
  16730. return Object.keys(e).sort().forEach(function (t) {
  16731. e[t] && (n = n + "&" + t + "=" + e[t]);
  16732. }), n = n.slice(1), o(n, t).toString();
  16733. },
  16734. wrappedRequest: function wrappedRequest(e, t) {
  16735. return new Promise(function (n, s) {
  16736. t(Object.assign(e, {
  16737. complete: function complete(e) {
  16738. 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");
  16739. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  16740. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  16741. code: "SYS_ERR",
  16742. message: e.errMsg || "request:fail",
  16743. requestId: t
  16744. }));
  16745. var r = e.data;
  16746. if (r.error) return s(new ne({
  16747. code: r.error.code,
  16748. message: r.error.message,
  16749. requestId: t
  16750. }));
  16751. r.result = r.data, r.requestId = t, delete r.data, n(r);
  16752. }
  16753. }));
  16754. });
  16755. },
  16756. toBase64: function toBase64(e) {
  16757. return c.stringify(a.parse(e));
  16758. }
  16759. },
  16760. de = {
  16761. "uniCloud.init.paramRequired": "{param} required",
  16762. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  16763. };
  16764. var _e4 = (0, _uniI18n.initVueI18n)({
  16765. "zh-Hans": {
  16766. "uniCloud.init.paramRequired": "缺少参数:{param}",
  16767. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  16768. },
  16769. "zh-Hant": {
  16770. "uniCloud.init.paramRequired": "缺少参数:{param}",
  16771. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  16772. },
  16773. en: de,
  16774. fr: {
  16775. "uniCloud.init.paramRequired": "{param} required",
  16776. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  16777. },
  16778. es: {
  16779. "uniCloud.init.paramRequired": "{param} required",
  16780. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  16781. },
  16782. ja: de
  16783. }, "zh-Hans"),
  16784. pe = _e4.t;
  16785. var fe = /*#__PURE__*/function () {
  16786. function fe(e) {
  16787. var _this3 = this;
  16788. (0, _classCallCheck2.default)(this, fe);
  16789. ["spaceId", "clientSecret"].forEach(function (t) {
  16790. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  16791. param: t
  16792. }));
  16793. }), this.config = Object.assign({}, {
  16794. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  16795. }, 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({
  16796. createPromise: function createPromise() {
  16797. return _this3.requestAuth(_this3.setupRequest({
  16798. method: "serverless.auth.user.anonymousAuthorize",
  16799. params: "{}"
  16800. }, "auth")).then(function (e) {
  16801. if (!e.result || !e.result.accessToken) throw new ne({
  16802. code: "AUTH_FAILED",
  16803. message: "获取accessToken失败"
  16804. });
  16805. _this3.setAccessToken(e.result.accessToken);
  16806. });
  16807. },
  16808. retryRule: v
  16809. });
  16810. }
  16811. (0, _createClass2.default)(fe, [{
  16812. key: "hasAccessToken",
  16813. get: function get() {
  16814. return !!this.accessToken;
  16815. }
  16816. }, {
  16817. key: "setAccessToken",
  16818. value: function setAccessToken(e) {
  16819. this.accessToken = e;
  16820. }
  16821. }, {
  16822. key: "requestWrapped",
  16823. value: function requestWrapped(e) {
  16824. return le.wrappedRequest(e, this.adapter.request);
  16825. }
  16826. }, {
  16827. key: "requestAuth",
  16828. value: function requestAuth(e) {
  16829. return this.requestWrapped(e);
  16830. }
  16831. }, {
  16832. key: "request",
  16833. value: function request(e, t) {
  16834. var _this4 = this;
  16835. return Promise.resolve().then(function () {
  16836. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  16837. return new Promise(function (e, n) {
  16838. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  16839. }).then(function () {
  16840. return _this4.getAccessToken();
  16841. }).then(function () {
  16842. var t = _this4.rebuildRequest(e);
  16843. return _this4.request(t, !0);
  16844. });
  16845. }) : _this4.getAccessToken().then(function () {
  16846. var t = _this4.rebuildRequest(e);
  16847. return _this4.request(t, !0);
  16848. });
  16849. });
  16850. }
  16851. }, {
  16852. key: "rebuildRequest",
  16853. value: function rebuildRequest(e) {
  16854. var t = Object.assign({}, e);
  16855. 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;
  16856. }
  16857. }, {
  16858. key: "setupRequest",
  16859. value: function setupRequest(e, t) {
  16860. var n = Object.assign({}, e, {
  16861. spaceId: this.config.spaceId,
  16862. timestamp: Date.now()
  16863. }),
  16864. s = {
  16865. "Content-Type": "application/json"
  16866. };
  16867. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret), {
  16868. url: this.config.requestUrl,
  16869. method: "POST",
  16870. data: n,
  16871. dataType: "json",
  16872. header: s
  16873. };
  16874. }
  16875. }, {
  16876. key: "getAccessToken",
  16877. value: function getAccessToken() {
  16878. return this._getAccessTokenPromiseHub.exec();
  16879. }
  16880. }, {
  16881. key: "authorize",
  16882. value: function () {
  16883. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  16884. return _regenerator.default.wrap(function _callee$(_context) {
  16885. while (1) {
  16886. switch (_context.prev = _context.next) {
  16887. case 0:
  16888. _context.next = 2;
  16889. return this.getAccessToken();
  16890. case 2:
  16891. case "end":
  16892. return _context.stop();
  16893. }
  16894. }
  16895. }, _callee, this);
  16896. }));
  16897. function authorize() {
  16898. return _authorize.apply(this, arguments);
  16899. }
  16900. return authorize;
  16901. }()
  16902. }, {
  16903. key: "callFunction",
  16904. value: function callFunction(e) {
  16905. var t = {
  16906. method: "serverless.function.runtime.invoke",
  16907. params: JSON.stringify({
  16908. functionTarget: e.name,
  16909. functionArgs: e.data || {}
  16910. })
  16911. };
  16912. return this.request(this.setupRequest(t));
  16913. }
  16914. }, {
  16915. key: "getOSSUploadOptionsFromPath",
  16916. value: function getOSSUploadOptionsFromPath(e) {
  16917. var t = {
  16918. method: "serverless.file.resource.generateProximalSign",
  16919. params: JSON.stringify(e)
  16920. };
  16921. return this.request(this.setupRequest(t));
  16922. }
  16923. }, {
  16924. key: "uploadFileToOSS",
  16925. value: function uploadFileToOSS(_ref3) {
  16926. var _this5 = this;
  16927. var e = _ref3.url,
  16928. t = _ref3.formData,
  16929. n = _ref3.name,
  16930. s = _ref3.filePath,
  16931. r = _ref3.fileType,
  16932. i = _ref3.onUploadProgress;
  16933. return new Promise(function (o, a) {
  16934. var c = _this5.adapter.uploadFile({
  16935. url: e,
  16936. formData: t,
  16937. name: n,
  16938. filePath: s,
  16939. fileType: r,
  16940. header: {
  16941. "X-OSS-server-side-encrpytion": "AES256"
  16942. },
  16943. success: function success(e) {
  16944. e && e.statusCode < 400 ? o(e) : a(new ne({
  16945. code: "UPLOAD_FAILED",
  16946. message: "文件上传失败"
  16947. }));
  16948. },
  16949. fail: function fail(e) {
  16950. a(new ne({
  16951. code: e.code || "UPLOAD_FAILED",
  16952. message: e.message || e.errMsg || "文件上传失败"
  16953. }));
  16954. }
  16955. });
  16956. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  16957. i({
  16958. loaded: e.totalBytesSent,
  16959. total: e.totalBytesExpectedToSend
  16960. });
  16961. });
  16962. });
  16963. }
  16964. }, {
  16965. key: "reportOSSUpload",
  16966. value: function reportOSSUpload(e) {
  16967. var t = {
  16968. method: "serverless.file.resource.report",
  16969. params: JSON.stringify(e)
  16970. };
  16971. return this.request(this.setupRequest(t));
  16972. }
  16973. }, {
  16974. key: "uploadFile",
  16975. value: function () {
  16976. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  16977. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, h, l, d, p, f, m, y, _, _e5, w;
  16978. return _regenerator.default.wrap(function _callee2$(_context2) {
  16979. while (1) {
  16980. switch (_context2.prev = _context2.next) {
  16981. case 0:
  16982. 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;
  16983. if (!("string" !== g(t))) {
  16984. _context2.next = 3;
  16985. break;
  16986. }
  16987. throw new ne({
  16988. code: "INVALID_PARAM",
  16989. message: "cloudPath必须为字符串类型"
  16990. });
  16991. case 3:
  16992. if (t = t.trim()) {
  16993. _context2.next = 5;
  16994. break;
  16995. }
  16996. throw new ne({
  16997. code: "INVALID_PARAM",
  16998. message: "cloudPath不可为空"
  16999. });
  17000. case 5:
  17001. if (!/:\/\//.test(t)) {
  17002. _context2.next = 7;
  17003. break;
  17004. }
  17005. throw new ne({
  17006. code: "INVALID_PARAM",
  17007. message: "cloudPath不合法"
  17008. });
  17009. case 7:
  17010. o = i && i.envType || this.config.envType;
  17011. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  17012. _context2.next = 10;
  17013. break;
  17014. }
  17015. throw new ne({
  17016. code: "INVALID_PARAM",
  17017. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  17018. });
  17019. case 10:
  17020. _context2.next = 12;
  17021. return this.getOSSUploadOptionsFromPath({
  17022. env: o,
  17023. filename: s ? t.split("/").pop() : t,
  17024. fileId: s ? t : void 0
  17025. });
  17026. case 12:
  17027. a = _context2.sent.result;
  17028. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  17029. u = a.securityToken;
  17030. h = a.accessKeyId;
  17031. l = a.signature;
  17032. d = a.host;
  17033. p = a.ossPath;
  17034. f = a.id;
  17035. m = a.policy;
  17036. y = a.ossCallbackUrl;
  17037. _ = {
  17038. "Cache-Control": "max-age=2592000",
  17039. "Content-Disposition": "attachment",
  17040. OSSAccessKeyId: h,
  17041. Signature: l,
  17042. host: d,
  17043. id: f,
  17044. key: p,
  17045. policy: m,
  17046. success_action_status: 200
  17047. };
  17048. if (u && (_["x-oss-security-token"] = u), y) {
  17049. _e5 = JSON.stringify({
  17050. callbackUrl: y,
  17051. callbackBody: JSON.stringify({
  17052. fileId: f,
  17053. spaceId: this.config.spaceId
  17054. }),
  17055. callbackBodyType: "application/json"
  17056. });
  17057. _.callback = le.toBase64(_e5);
  17058. }
  17059. w = {
  17060. url: "https://" + a.host,
  17061. formData: _,
  17062. fileName: "file",
  17063. name: "file",
  17064. filePath: e,
  17065. fileType: n
  17066. };
  17067. _context2.next = 27;
  17068. return this.uploadFileToOSS(Object.assign({}, w, {
  17069. onUploadProgress: r
  17070. }));
  17071. case 27:
  17072. if (!y) {
  17073. _context2.next = 29;
  17074. break;
  17075. }
  17076. return _context2.abrupt("return", {
  17077. success: !0,
  17078. filePath: e,
  17079. fileID: c
  17080. });
  17081. case 29:
  17082. _context2.next = 31;
  17083. return this.reportOSSUpload({
  17084. id: f
  17085. });
  17086. case 31:
  17087. if (!_context2.sent.success) {
  17088. _context2.next = 33;
  17089. break;
  17090. }
  17091. return _context2.abrupt("return", {
  17092. success: !0,
  17093. filePath: e,
  17094. fileID: c
  17095. });
  17096. case 33:
  17097. throw new ne({
  17098. code: "UPLOAD_FAILED",
  17099. message: "文件上传失败"
  17100. });
  17101. case 34:
  17102. case "end":
  17103. return _context2.stop();
  17104. }
  17105. }
  17106. }, _callee2, this);
  17107. }));
  17108. function uploadFile(_x) {
  17109. return _uploadFile.apply(this, arguments);
  17110. }
  17111. return uploadFile;
  17112. }()
  17113. }, {
  17114. key: "getTempFileURL",
  17115. value: function getTempFileURL() {
  17116. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17117. e = _ref5.fileList;
  17118. return new Promise(function (t, n) {
  17119. Array.isArray(e) && 0 !== e.length || n(new ne({
  17120. code: "INVALID_PARAM",
  17121. message: "fileList的元素必须是非空的字符串"
  17122. })), t({
  17123. fileList: e.map(function (e) {
  17124. return {
  17125. fileID: e,
  17126. tempFileURL: e
  17127. };
  17128. })
  17129. });
  17130. });
  17131. }
  17132. }, {
  17133. key: "getFileInfo",
  17134. value: function () {
  17135. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  17136. var _ref6,
  17137. e,
  17138. t,
  17139. _args3 = arguments;
  17140. return _regenerator.default.wrap(function _callee3$(_context3) {
  17141. while (1) {
  17142. switch (_context3.prev = _context3.next) {
  17143. case 0:
  17144. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  17145. if (!(!Array.isArray(e) || 0 === e.length)) {
  17146. _context3.next = 3;
  17147. break;
  17148. }
  17149. throw new ne({
  17150. code: "INVALID_PARAM",
  17151. message: "fileList的元素必须是非空的字符串"
  17152. });
  17153. case 3:
  17154. t = {
  17155. method: "serverless.file.resource.info",
  17156. params: JSON.stringify({
  17157. id: e.map(function (e) {
  17158. return e.split("?")[0];
  17159. }).join(",")
  17160. })
  17161. };
  17162. _context3.next = 6;
  17163. return this.request(this.setupRequest(t));
  17164. case 6:
  17165. _context3.t0 = _context3.sent.result;
  17166. return _context3.abrupt("return", {
  17167. fileList: _context3.t0
  17168. });
  17169. case 8:
  17170. case "end":
  17171. return _context3.stop();
  17172. }
  17173. }
  17174. }, _callee3, this);
  17175. }));
  17176. function getFileInfo() {
  17177. return _getFileInfo.apply(this, arguments);
  17178. }
  17179. return getFileInfo;
  17180. }()
  17181. }]);
  17182. return fe;
  17183. }();
  17184. var ge = {
  17185. init: function init(e) {
  17186. var t = new fe(e),
  17187. n = {
  17188. signInAnonymously: function signInAnonymously() {
  17189. return t.authorize();
  17190. },
  17191. getLoginState: function getLoginState() {
  17192. return Promise.resolve(!1);
  17193. }
  17194. };
  17195. return t.auth = function () {
  17196. return n;
  17197. }, t.customAuth = t.auth, t;
  17198. }
  17199. };
  17200. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  17201. var ye;
  17202. !function (e) {
  17203. e.local = "local", e.none = "none", e.session = "session";
  17204. }(ye || (ye = {}));
  17205. var _e = function _e() {};
  17206. var we = function we() {
  17207. var e;
  17208. if (!Promise) {
  17209. e = function e() {}, e.promise = {};
  17210. var _t3 = function _t3() {
  17211. throw new ne({
  17212. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  17213. });
  17214. };
  17215. return Object.defineProperty(e.promise, "then", {
  17216. get: _t3
  17217. }), Object.defineProperty(e.promise, "catch", {
  17218. get: _t3
  17219. }), e;
  17220. }
  17221. var t = new Promise(function (t, n) {
  17222. e = function e(_e6, s) {
  17223. return _e6 ? n(_e6) : t(s);
  17224. };
  17225. });
  17226. return e.promise = t, e;
  17227. };
  17228. function ve(e) {
  17229. return void 0 === e;
  17230. }
  17231. function Ie(e) {
  17232. return "[object Null]" === Object.prototype.toString.call(e);
  17233. }
  17234. var Se;
  17235. function be(e) {
  17236. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  17237. var n;
  17238. var _iterator = _createForOfIteratorHelper(t),
  17239. _step;
  17240. try {
  17241. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  17242. var _e7 = _step.value;
  17243. var _t4 = _e7.isMatch,
  17244. _n4 = _e7.genAdapter,
  17245. _s4 = _e7.runtime;
  17246. if (_t4()) return {
  17247. adapter: _n4(),
  17248. runtime: _s4
  17249. };
  17250. }
  17251. } catch (err) {
  17252. _iterator.e(err);
  17253. } finally {
  17254. _iterator.f();
  17255. }
  17256. }
  17257. !function (e) {
  17258. e.WEB = "web", e.WX_MP = "wx_mp";
  17259. }(Se || (Se = {}));
  17260. var ke = {
  17261. adapter: null,
  17262. runtime: void 0
  17263. },
  17264. Ce = ["anonymousUuidKey"];
  17265. var Te = /*#__PURE__*/function (_e8) {
  17266. (0, _inherits2.default)(Te, _e8);
  17267. var _super2 = _createSuper(Te);
  17268. function Te() {
  17269. var _this6;
  17270. (0, _classCallCheck2.default)(this, Te);
  17271. _this6 = _super2.call(this), ke.adapter.root.tcbObject || (ke.adapter.root.tcbObject = {});
  17272. return _this6;
  17273. }
  17274. (0, _createClass2.default)(Te, [{
  17275. key: "setItem",
  17276. value: function setItem(e, t) {
  17277. ke.adapter.root.tcbObject[e] = t;
  17278. }
  17279. }, {
  17280. key: "getItem",
  17281. value: function getItem(e) {
  17282. return ke.adapter.root.tcbObject[e];
  17283. }
  17284. }, {
  17285. key: "removeItem",
  17286. value: function removeItem(e) {
  17287. delete ke.adapter.root.tcbObject[e];
  17288. }
  17289. }, {
  17290. key: "clear",
  17291. value: function clear() {
  17292. delete ke.adapter.root.tcbObject;
  17293. }
  17294. }]);
  17295. return Te;
  17296. }(_e);
  17297. function Pe(e, t) {
  17298. switch (e) {
  17299. case "local":
  17300. return t.localStorage || new Te();
  17301. case "none":
  17302. return new Te();
  17303. default:
  17304. return t.sessionStorage || new Te();
  17305. }
  17306. }
  17307. var Ae = /*#__PURE__*/function () {
  17308. function Ae(e) {
  17309. (0, _classCallCheck2.default)(this, Ae);
  17310. if (!this._storage) {
  17311. this._persistence = ke.adapter.primaryStorage || e.persistence, this._storage = Pe(this._persistence, ke.adapter);
  17312. var _t5 = "access_token_".concat(e.env),
  17313. _n5 = "access_token_expire_".concat(e.env),
  17314. _s5 = "refresh_token_".concat(e.env),
  17315. _r = "anonymous_uuid_".concat(e.env),
  17316. _i = "login_type_".concat(e.env),
  17317. _o = "user_info_".concat(e.env);
  17318. this.keys = {
  17319. accessTokenKey: _t5,
  17320. accessTokenExpireKey: _n5,
  17321. refreshTokenKey: _s5,
  17322. anonymousUuidKey: _r,
  17323. loginTypeKey: _i,
  17324. userInfoKey: _o
  17325. };
  17326. }
  17327. }
  17328. (0, _createClass2.default)(Ae, [{
  17329. key: "updatePersistence",
  17330. value: function updatePersistence(e) {
  17331. if (e === this._persistence) return;
  17332. var t = "local" === this._persistence;
  17333. this._persistence = e;
  17334. var n = Pe(e, ke.adapter);
  17335. for (var _e9 in this.keys) {
  17336. var _s6 = this.keys[_e9];
  17337. if (t && Ce.includes(_e9)) continue;
  17338. var _r2 = this._storage.getItem(_s6);
  17339. ve(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  17340. }
  17341. this._storage = n;
  17342. }
  17343. }, {
  17344. key: "setStore",
  17345. value: function setStore(e, t, n) {
  17346. if (!this._storage) return;
  17347. var s = {
  17348. version: n || "localCachev1",
  17349. content: t
  17350. },
  17351. r = JSON.stringify(s);
  17352. try {
  17353. this._storage.setItem(e, r);
  17354. } catch (e) {
  17355. throw e;
  17356. }
  17357. }
  17358. }, {
  17359. key: "getStore",
  17360. value: function getStore(e, t) {
  17361. try {
  17362. if (!this._storage) return;
  17363. } catch (e) {
  17364. return "";
  17365. }
  17366. t = t || "localCachev1";
  17367. var n = this._storage.getItem(e);
  17368. if (!n) return "";
  17369. if (n.indexOf(t) >= 0) {
  17370. return JSON.parse(n).content;
  17371. }
  17372. return "";
  17373. }
  17374. }, {
  17375. key: "removeStore",
  17376. value: function removeStore(e) {
  17377. this._storage.removeItem(e);
  17378. }
  17379. }]);
  17380. return Ae;
  17381. }();
  17382. var Ee = {},
  17383. Oe = {};
  17384. function xe(e) {
  17385. return Ee[e];
  17386. }
  17387. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  17388. (0, _classCallCheck2.default)(this, Re);
  17389. this.data = t || null, this.name = e;
  17390. });
  17391. var Ue = /*#__PURE__*/function (_Re) {
  17392. (0, _inherits2.default)(Ue, _Re);
  17393. var _super3 = _createSuper(Ue);
  17394. function Ue(e, t) {
  17395. var _this7;
  17396. (0, _classCallCheck2.default)(this, Ue);
  17397. _this7 = _super3.call(this, "error", {
  17398. error: e,
  17399. data: t
  17400. }), _this7.error = e;
  17401. return _this7;
  17402. }
  17403. return (0, _createClass2.default)(Ue);
  17404. }(Re);
  17405. var Le = new ( /*#__PURE__*/function () {
  17406. function _class() {
  17407. (0, _classCallCheck2.default)(this, _class);
  17408. this._listeners = {};
  17409. }
  17410. (0, _createClass2.default)(_class, [{
  17411. key: "on",
  17412. value: function on(e, t) {
  17413. return function (e, t, n) {
  17414. n[e] = n[e] || [], n[e].push(t);
  17415. }(e, t, this._listeners), this;
  17416. }
  17417. }, {
  17418. key: "off",
  17419. value: function off(e, t) {
  17420. return function (e, t, n) {
  17421. if (n && n[e]) {
  17422. var _s7 = n[e].indexOf(t);
  17423. -1 !== _s7 && n[e].splice(_s7, 1);
  17424. }
  17425. }(e, t, this._listeners), this;
  17426. }
  17427. }, {
  17428. key: "fire",
  17429. value: function fire(e, t) {
  17430. if (e instanceof Ue) return console.error(e.error), this;
  17431. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  17432. var s = n.name;
  17433. if (this._listens(s)) {
  17434. n.target = this;
  17435. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  17436. var _iterator2 = _createForOfIteratorHelper(_e10),
  17437. _step2;
  17438. try {
  17439. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  17440. var _t6 = _step2.value;
  17441. _t6.call(this, n);
  17442. }
  17443. } catch (err) {
  17444. _iterator2.e(err);
  17445. } finally {
  17446. _iterator2.f();
  17447. }
  17448. }
  17449. return this;
  17450. }
  17451. }, {
  17452. key: "_listens",
  17453. value: function _listens(e) {
  17454. return this._listeners[e] && this._listeners[e].length > 0;
  17455. }
  17456. }]);
  17457. return _class;
  17458. }())();
  17459. function Ne(e, t) {
  17460. Le.on(e, t);
  17461. }
  17462. function De(e) {
  17463. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17464. Le.fire(e, t);
  17465. }
  17466. function Fe(e, t) {
  17467. Le.off(e, t);
  17468. }
  17469. var qe = "loginStateChanged",
  17470. Me = "loginStateExpire",
  17471. Ke = "loginTypeChanged",
  17472. je = "anonymousConverted",
  17473. Be = "refreshAccessToken";
  17474. var $e;
  17475. !function (e) {
  17476. 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";
  17477. }($e || ($e = {}));
  17478. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  17479. ze = {
  17480. "X-SDK-Version": "1.3.5"
  17481. };
  17482. function Je(e, t, n) {
  17483. var s = e[t];
  17484. e[t] = function (t) {
  17485. var r = {},
  17486. i = {};
  17487. n.forEach(function (n) {
  17488. var _n$call = n.call(e, t),
  17489. s = _n$call.data,
  17490. o = _n$call.headers;
  17491. Object.assign(r, s), Object.assign(i, o);
  17492. });
  17493. var o = t.data;
  17494. return o && function () {
  17495. var e;
  17496. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  17497. o.append(_e11, r[_e11]);
  17498. }
  17499. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  17500. };
  17501. }
  17502. function He() {
  17503. var e = Math.random().toString(16).slice(2);
  17504. return {
  17505. data: {
  17506. seqId: e
  17507. },
  17508. headers: _objectSpread(_objectSpread({}, ze), {}, {
  17509. "x-seqid": e
  17510. })
  17511. };
  17512. }
  17513. var Ge = /*#__PURE__*/function () {
  17514. function Ge() {
  17515. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17516. (0, _classCallCheck2.default)(this, Ge);
  17517. var t;
  17518. this.config = e, this._reqClass = new ke.adapter.reqClass({
  17519. timeout: this.config.timeout,
  17520. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  17521. restrictedMethods: ["post"]
  17522. }), 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]);
  17523. }
  17524. (0, _createClass2.default)(Ge, [{
  17525. key: "post",
  17526. value: function () {
  17527. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  17528. return _regenerator.default.wrap(function _callee4$(_context4) {
  17529. while (1) {
  17530. switch (_context4.prev = _context4.next) {
  17531. case 0:
  17532. _context4.next = 2;
  17533. return this._reqClass.post(e);
  17534. case 2:
  17535. return _context4.abrupt("return", _context4.sent);
  17536. case 3:
  17537. case "end":
  17538. return _context4.stop();
  17539. }
  17540. }
  17541. }, _callee4, this);
  17542. }));
  17543. function post(_x2) {
  17544. return _post.apply(this, arguments);
  17545. }
  17546. return post;
  17547. }()
  17548. }, {
  17549. key: "upload",
  17550. value: function () {
  17551. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  17552. return _regenerator.default.wrap(function _callee5$(_context5) {
  17553. while (1) {
  17554. switch (_context5.prev = _context5.next) {
  17555. case 0:
  17556. _context5.next = 2;
  17557. return this._reqClass.upload(e);
  17558. case 2:
  17559. return _context5.abrupt("return", _context5.sent);
  17560. case 3:
  17561. case "end":
  17562. return _context5.stop();
  17563. }
  17564. }
  17565. }, _callee5, this);
  17566. }));
  17567. function upload(_x3) {
  17568. return _upload.apply(this, arguments);
  17569. }
  17570. return upload;
  17571. }()
  17572. }, {
  17573. key: "download",
  17574. value: function () {
  17575. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  17576. return _regenerator.default.wrap(function _callee6$(_context6) {
  17577. while (1) {
  17578. switch (_context6.prev = _context6.next) {
  17579. case 0:
  17580. _context6.next = 2;
  17581. return this._reqClass.download(e);
  17582. case 2:
  17583. return _context6.abrupt("return", _context6.sent);
  17584. case 3:
  17585. case "end":
  17586. return _context6.stop();
  17587. }
  17588. }
  17589. }, _callee6, this);
  17590. }));
  17591. function download(_x4) {
  17592. return _download.apply(this, arguments);
  17593. }
  17594. return download;
  17595. }()
  17596. }, {
  17597. key: "refreshAccessToken",
  17598. value: function () {
  17599. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  17600. var e, t;
  17601. return _regenerator.default.wrap(function _callee7$(_context7) {
  17602. while (1) {
  17603. switch (_context7.prev = _context7.next) {
  17604. case 0:
  17605. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  17606. _context7.prev = 1;
  17607. _context7.next = 4;
  17608. return this._refreshAccessTokenPromise;
  17609. case 4:
  17610. e = _context7.sent;
  17611. _context7.next = 10;
  17612. break;
  17613. case 7:
  17614. _context7.prev = 7;
  17615. _context7.t0 = _context7["catch"](1);
  17616. t = _context7.t0;
  17617. case 10:
  17618. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  17619. _context7.next = 12;
  17620. break;
  17621. }
  17622. throw t;
  17623. case 12:
  17624. return _context7.abrupt("return", e);
  17625. case 13:
  17626. case "end":
  17627. return _context7.stop();
  17628. }
  17629. }
  17630. }, _callee7, this, [[1, 7]]);
  17631. }));
  17632. function refreshAccessToken() {
  17633. return _refreshAccessToken2.apply(this, arguments);
  17634. }
  17635. return refreshAccessToken;
  17636. }()
  17637. }, {
  17638. key: "_refreshAccessToken",
  17639. value: function () {
  17640. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  17641. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  17642. return _regenerator.default.wrap(function _callee8$(_context8) {
  17643. while (1) {
  17644. switch (_context8.prev = _context8.next) {
  17645. case 0:
  17646. _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;
  17647. this._cache.removeStore(e), this._cache.removeStore(t);
  17648. i = this._cache.getStore(n);
  17649. if (i) {
  17650. _context8.next = 5;
  17651. break;
  17652. }
  17653. throw new ne({
  17654. message: "未登录CloudBase"
  17655. });
  17656. case 5:
  17657. o = {
  17658. refresh_token: i
  17659. };
  17660. _context8.next = 8;
  17661. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  17662. case 8:
  17663. a = _context8.sent;
  17664. if (!a.data.code) {
  17665. _context8.next = 21;
  17666. break;
  17667. }
  17668. _e12 = a.data.code;
  17669. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  17670. _context8.next = 20;
  17671. break;
  17672. }
  17673. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  17674. _context8.next = 19;
  17675. break;
  17676. }
  17677. _e13 = this._cache.getStore(r);
  17678. _t7 = this._cache.getStore(n);
  17679. _context8.next = 17;
  17680. return this.send("auth.signInAnonymously", {
  17681. anonymous_uuid: _e13,
  17682. refresh_token: _t7
  17683. });
  17684. case 17:
  17685. _s8 = _context8.sent;
  17686. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  17687. case 19:
  17688. De(Me), this._cache.removeStore(n);
  17689. case 20:
  17690. throw new ne({
  17691. code: a.data.code,
  17692. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  17693. });
  17694. case 21:
  17695. if (!a.data.access_token) {
  17696. _context8.next = 23;
  17697. break;
  17698. }
  17699. 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()), {
  17700. accessToken: a.data.access_token,
  17701. accessTokenExpire: a.data.access_token_expire
  17702. }));
  17703. case 23:
  17704. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  17705. case 24:
  17706. case "end":
  17707. return _context8.stop();
  17708. }
  17709. }
  17710. }, _callee8, this);
  17711. }));
  17712. function _refreshAccessToken() {
  17713. return _refreshAccessToken3.apply(this, arguments);
  17714. }
  17715. return _refreshAccessToken;
  17716. }()
  17717. }, {
  17718. key: "getAccessToken",
  17719. value: function () {
  17720. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  17721. var _this$_cache$keys2, e, t, n, s, r, i;
  17722. return _regenerator.default.wrap(function _callee9$(_context9) {
  17723. while (1) {
  17724. switch (_context9.prev = _context9.next) {
  17725. case 0:
  17726. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  17727. if (this._cache.getStore(n)) {
  17728. _context9.next = 3;
  17729. break;
  17730. }
  17731. throw new ne({
  17732. message: "refresh token不存在,登录状态异常"
  17733. });
  17734. case 3:
  17735. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  17736. _context9.t0 = this._shouldRefreshAccessTokenHook;
  17737. if (!_context9.t0) {
  17738. _context9.next = 9;
  17739. break;
  17740. }
  17741. _context9.next = 8;
  17742. return this._shouldRefreshAccessTokenHook(s, r);
  17743. case 8:
  17744. _context9.t0 = !_context9.sent;
  17745. case 9:
  17746. _context9.t1 = _context9.t0;
  17747. if (!_context9.t1) {
  17748. _context9.next = 12;
  17749. break;
  17750. }
  17751. i = !1;
  17752. case 12:
  17753. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  17754. accessToken: s,
  17755. accessTokenExpire: r
  17756. });
  17757. case 13:
  17758. case "end":
  17759. return _context9.stop();
  17760. }
  17761. }
  17762. }, _callee9, this);
  17763. }));
  17764. function getAccessToken() {
  17765. return _getAccessToken.apply(this, arguments);
  17766. }
  17767. return getAccessToken;
  17768. }()
  17769. }, {
  17770. key: "request",
  17771. value: function () {
  17772. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  17773. var s, r, i, _e14, o, _e15, _e16, a, c, u, h, l, d, p, f, g;
  17774. return _regenerator.default.wrap(function _callee10$(_context10) {
  17775. while (1) {
  17776. switch (_context10.prev = _context10.next) {
  17777. case 0:
  17778. s = "x-tcb-trace_".concat(this.config.env);
  17779. r = "application/x-www-form-urlencoded";
  17780. i = _objectSpread({
  17781. action: e,
  17782. env: this.config.env,
  17783. dataVersion: "2019-08-16"
  17784. }, t);
  17785. if (!(-1 === We.indexOf(e))) {
  17786. _context10.next = 10;
  17787. break;
  17788. }
  17789. _e14 = this._cache.keys.refreshTokenKey;
  17790. _context10.t0 = this._cache.getStore(_e14);
  17791. if (!_context10.t0) {
  17792. _context10.next = 10;
  17793. break;
  17794. }
  17795. _context10.next = 9;
  17796. return this.getAccessToken();
  17797. case 9:
  17798. i.access_token = _context10.sent.accessToken;
  17799. case 10:
  17800. if ("storage.uploadFile" === e) {
  17801. o = new FormData();
  17802. for (_e15 in o) {
  17803. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  17804. }
  17805. r = "multipart/form-data";
  17806. } else {
  17807. r = "application/json", o = {};
  17808. for (_e16 in i) {
  17809. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  17810. }
  17811. }
  17812. a = {
  17813. headers: {
  17814. "content-type": r
  17815. }
  17816. };
  17817. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  17818. c = this._localCache.getStore(s);
  17819. c && (a.headers["X-TCB-Trace"] = c);
  17820. u = t.parse, h = t.inQuery, l = t.search;
  17821. d = {
  17822. env: this.config.env
  17823. };
  17824. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  17825. p = function (e, t) {
  17826. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  17827. var s = /\?/.test(t);
  17828. var r = "";
  17829. for (var _e17 in n) {
  17830. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  17831. }
  17832. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  17833. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  17834. l && (p += l);
  17835. _context10.next = 22;
  17836. return this.post(_objectSpread({
  17837. url: p,
  17838. data: o
  17839. }, a));
  17840. case 22:
  17841. f = _context10.sent;
  17842. g = f.header && f.header["x-tcb-trace"];
  17843. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  17844. _context10.next = 26;
  17845. break;
  17846. }
  17847. throw new ne({
  17848. code: "NETWORK_ERROR",
  17849. message: "network request error"
  17850. });
  17851. case 26:
  17852. return _context10.abrupt("return", f);
  17853. case 27:
  17854. case "end":
  17855. return _context10.stop();
  17856. }
  17857. }
  17858. }, _callee10, this);
  17859. }));
  17860. function request(_x5, _x6, _x7) {
  17861. return _request.apply(this, arguments);
  17862. }
  17863. return request;
  17864. }()
  17865. }, {
  17866. key: "send",
  17867. value: function () {
  17868. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  17869. var t,
  17870. n,
  17871. _n6,
  17872. _args11 = arguments;
  17873. return _regenerator.default.wrap(function _callee11$(_context11) {
  17874. while (1) {
  17875. switch (_context11.prev = _context11.next) {
  17876. case 0:
  17877. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  17878. _context11.next = 3;
  17879. return this.request(e, t, {
  17880. onUploadProgress: t.onUploadProgress
  17881. });
  17882. case 3:
  17883. n = _context11.sent;
  17884. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  17885. _context11.next = 13;
  17886. break;
  17887. }
  17888. _context11.next = 7;
  17889. return this.refreshAccessToken();
  17890. case 7:
  17891. _context11.next = 9;
  17892. return this.request(e, t, {
  17893. onUploadProgress: t.onUploadProgress
  17894. });
  17895. case 9:
  17896. _n6 = _context11.sent;
  17897. if (!_n6.data.code) {
  17898. _context11.next = 12;
  17899. break;
  17900. }
  17901. throw new ne({
  17902. code: _n6.data.code,
  17903. message: _n6.data.message
  17904. });
  17905. case 12:
  17906. return _context11.abrupt("return", _n6.data);
  17907. case 13:
  17908. if (!n.data.code) {
  17909. _context11.next = 15;
  17910. break;
  17911. }
  17912. throw new ne({
  17913. code: n.data.code,
  17914. message: n.data.message
  17915. });
  17916. case 15:
  17917. return _context11.abrupt("return", n.data);
  17918. case 16:
  17919. case "end":
  17920. return _context11.stop();
  17921. }
  17922. }
  17923. }, _callee11, this);
  17924. }));
  17925. function send(_x8) {
  17926. return _send.apply(this, arguments);
  17927. }
  17928. return send;
  17929. }()
  17930. }, {
  17931. key: "setRefreshToken",
  17932. value: function setRefreshToken(e) {
  17933. var _this$_cache$keys3 = this._cache.keys,
  17934. t = _this$_cache$keys3.accessTokenKey,
  17935. n = _this$_cache$keys3.accessTokenExpireKey,
  17936. s = _this$_cache$keys3.refreshTokenKey;
  17937. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  17938. }
  17939. }]);
  17940. return Ge;
  17941. }();
  17942. var Ve = {};
  17943. function Ye(e) {
  17944. return Ve[e];
  17945. }
  17946. var Qe = /*#__PURE__*/function () {
  17947. function Qe(e) {
  17948. (0, _classCallCheck2.default)(this, Qe);
  17949. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  17950. }
  17951. (0, _createClass2.default)(Qe, [{
  17952. key: "setRefreshToken",
  17953. value: function setRefreshToken(e) {
  17954. var _this$_cache$keys4 = this._cache.keys,
  17955. t = _this$_cache$keys4.accessTokenKey,
  17956. n = _this$_cache$keys4.accessTokenExpireKey,
  17957. s = _this$_cache$keys4.refreshTokenKey;
  17958. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  17959. }
  17960. }, {
  17961. key: "setAccessToken",
  17962. value: function setAccessToken(e, t) {
  17963. var _this$_cache$keys5 = this._cache.keys,
  17964. n = _this$_cache$keys5.accessTokenKey,
  17965. s = _this$_cache$keys5.accessTokenExpireKey;
  17966. this._cache.setStore(n, e), this._cache.setStore(s, t);
  17967. }
  17968. }, {
  17969. key: "refreshUserInfo",
  17970. value: function () {
  17971. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  17972. var _yield$this$_request$, e;
  17973. return _regenerator.default.wrap(function _callee12$(_context12) {
  17974. while (1) {
  17975. switch (_context12.prev = _context12.next) {
  17976. case 0:
  17977. _context12.next = 2;
  17978. return this._request.send("auth.getUserInfo", {});
  17979. case 2:
  17980. _yield$this$_request$ = _context12.sent;
  17981. e = _yield$this$_request$.data;
  17982. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  17983. case 5:
  17984. case "end":
  17985. return _context12.stop();
  17986. }
  17987. }
  17988. }, _callee12, this);
  17989. }));
  17990. function refreshUserInfo() {
  17991. return _refreshUserInfo.apply(this, arguments);
  17992. }
  17993. return refreshUserInfo;
  17994. }()
  17995. }, {
  17996. key: "setLocalUserInfo",
  17997. value: function setLocalUserInfo(e) {
  17998. var t = this._cache.keys.userInfoKey;
  17999. this._cache.setStore(t, e);
  18000. }
  18001. }]);
  18002. return Qe;
  18003. }();
  18004. var Xe = /*#__PURE__*/function () {
  18005. function Xe(e) {
  18006. (0, _classCallCheck2.default)(this, Xe);
  18007. if (!e) throw new ne({
  18008. code: "PARAM_ERROR",
  18009. message: "envId is not defined"
  18010. });
  18011. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  18012. }
  18013. (0, _createClass2.default)(Xe, [{
  18014. key: "linkWithTicket",
  18015. value: function linkWithTicket(e) {
  18016. if ("string" != typeof e) throw new ne({
  18017. code: "PARAM_ERROR",
  18018. message: "ticket must be string"
  18019. });
  18020. return this._request.send("auth.linkWithTicket", {
  18021. ticket: e
  18022. });
  18023. }
  18024. }, {
  18025. key: "linkWithRedirect",
  18026. value: function linkWithRedirect(e) {
  18027. e.signInWithRedirect();
  18028. }
  18029. }, {
  18030. key: "updatePassword",
  18031. value: function updatePassword(e, t) {
  18032. return this._request.send("auth.updatePassword", {
  18033. oldPassword: t,
  18034. newPassword: e
  18035. });
  18036. }
  18037. }, {
  18038. key: "updateEmail",
  18039. value: function updateEmail(e) {
  18040. return this._request.send("auth.updateEmail", {
  18041. newEmail: e
  18042. });
  18043. }
  18044. }, {
  18045. key: "updateUsername",
  18046. value: function updateUsername(e) {
  18047. if ("string" != typeof e) throw new ne({
  18048. code: "PARAM_ERROR",
  18049. message: "username must be a string"
  18050. });
  18051. return this._request.send("auth.updateUsername", {
  18052. username: e
  18053. });
  18054. }
  18055. }, {
  18056. key: "getLinkedUidList",
  18057. value: function () {
  18058. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  18059. var _yield$this$_request$2, e, t, n;
  18060. return _regenerator.default.wrap(function _callee13$(_context13) {
  18061. while (1) {
  18062. switch (_context13.prev = _context13.next) {
  18063. case 0:
  18064. _context13.next = 2;
  18065. return this._request.send("auth.getLinkedUidList", {});
  18066. case 2:
  18067. _yield$this$_request$2 = _context13.sent;
  18068. e = _yield$this$_request$2.data;
  18069. t = !1;
  18070. n = e.users;
  18071. return _context13.abrupt("return", (n.forEach(function (e) {
  18072. e.wxOpenId && e.wxPublicId && (t = !0);
  18073. }), {
  18074. users: n,
  18075. hasPrimaryUid: t
  18076. }));
  18077. case 7:
  18078. case "end":
  18079. return _context13.stop();
  18080. }
  18081. }
  18082. }, _callee13, this);
  18083. }));
  18084. function getLinkedUidList() {
  18085. return _getLinkedUidList.apply(this, arguments);
  18086. }
  18087. return getLinkedUidList;
  18088. }()
  18089. }, {
  18090. key: "setPrimaryUid",
  18091. value: function setPrimaryUid(e) {
  18092. return this._request.send("auth.setPrimaryUid", {
  18093. uid: e
  18094. });
  18095. }
  18096. }, {
  18097. key: "unlink",
  18098. value: function unlink(e) {
  18099. return this._request.send("auth.unlink", {
  18100. platform: e
  18101. });
  18102. }
  18103. }, {
  18104. key: "update",
  18105. value: function () {
  18106. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  18107. var t, n, s, r, i, o, _yield$this$_request$3, a;
  18108. return _regenerator.default.wrap(function _callee14$(_context14) {
  18109. while (1) {
  18110. switch (_context14.prev = _context14.next) {
  18111. case 0:
  18112. t = e.nickName;
  18113. n = e.gender;
  18114. s = e.avatarUrl;
  18115. r = e.province;
  18116. i = e.country;
  18117. o = e.city;
  18118. _context14.next = 8;
  18119. return this._request.send("auth.updateUserInfo", {
  18120. nickName: t,
  18121. gender: n,
  18122. avatarUrl: s,
  18123. province: r,
  18124. country: i,
  18125. city: o
  18126. });
  18127. case 8:
  18128. _yield$this$_request$3 = _context14.sent;
  18129. a = _yield$this$_request$3.data;
  18130. this.setLocalUserInfo(a);
  18131. case 11:
  18132. case "end":
  18133. return _context14.stop();
  18134. }
  18135. }
  18136. }, _callee14, this);
  18137. }));
  18138. function update(_x9) {
  18139. return _update.apply(this, arguments);
  18140. }
  18141. return update;
  18142. }()
  18143. }, {
  18144. key: "refresh",
  18145. value: function () {
  18146. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  18147. var _yield$this$_request$4, e;
  18148. return _regenerator.default.wrap(function _callee15$(_context15) {
  18149. while (1) {
  18150. switch (_context15.prev = _context15.next) {
  18151. case 0:
  18152. _context15.next = 2;
  18153. return this._request.send("auth.getUserInfo", {});
  18154. case 2:
  18155. _yield$this$_request$4 = _context15.sent;
  18156. e = _yield$this$_request$4.data;
  18157. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  18158. case 5:
  18159. case "end":
  18160. return _context15.stop();
  18161. }
  18162. }
  18163. }, _callee15, this);
  18164. }));
  18165. function refresh() {
  18166. return _refresh.apply(this, arguments);
  18167. }
  18168. return refresh;
  18169. }()
  18170. }, {
  18171. key: "setUserInfo",
  18172. value: function setUserInfo() {
  18173. var _this8 = this;
  18174. var e = this._cache.keys.userInfoKey,
  18175. t = this._cache.getStore(e);
  18176. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  18177. _this8[e] = t[e];
  18178. }), this.location = {
  18179. country: t.country,
  18180. province: t.province,
  18181. city: t.city
  18182. };
  18183. }
  18184. }, {
  18185. key: "setLocalUserInfo",
  18186. value: function setLocalUserInfo(e) {
  18187. var t = this._cache.keys.userInfoKey;
  18188. this._cache.setStore(t, e), this.setUserInfo();
  18189. }
  18190. }]);
  18191. return Xe;
  18192. }();
  18193. var Ze = /*#__PURE__*/function () {
  18194. function Ze(e) {
  18195. (0, _classCallCheck2.default)(this, Ze);
  18196. if (!e) throw new ne({
  18197. code: "PARAM_ERROR",
  18198. message: "envId is not defined"
  18199. });
  18200. this._cache = xe(e);
  18201. var _this$_cache$keys6 = this._cache.keys,
  18202. t = _this$_cache$keys6.refreshTokenKey,
  18203. n = _this$_cache$keys6.accessTokenKey,
  18204. s = _this$_cache$keys6.accessTokenExpireKey,
  18205. r = this._cache.getStore(t),
  18206. i = this._cache.getStore(n),
  18207. o = this._cache.getStore(s);
  18208. this.credential = {
  18209. refreshToken: r,
  18210. accessToken: i,
  18211. accessTokenExpire: o
  18212. }, this.user = new Xe(e);
  18213. }
  18214. (0, _createClass2.default)(Ze, [{
  18215. key: "isAnonymousAuth",
  18216. get: function get() {
  18217. return this.loginType === $e.ANONYMOUS;
  18218. }
  18219. }, {
  18220. key: "isCustomAuth",
  18221. get: function get() {
  18222. return this.loginType === $e.CUSTOM;
  18223. }
  18224. }, {
  18225. key: "isWeixinAuth",
  18226. get: function get() {
  18227. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  18228. }
  18229. }, {
  18230. key: "loginType",
  18231. get: function get() {
  18232. return this._cache.getStore(this._cache.keys.loginTypeKey);
  18233. }
  18234. }]);
  18235. return Ze;
  18236. }();
  18237. var et = /*#__PURE__*/function (_Qe) {
  18238. (0, _inherits2.default)(et, _Qe);
  18239. var _super4 = _createSuper(et);
  18240. function et() {
  18241. (0, _classCallCheck2.default)(this, et);
  18242. return _super4.apply(this, arguments);
  18243. }
  18244. (0, _createClass2.default)(et, [{
  18245. key: "signIn",
  18246. value: function () {
  18247. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  18248. var _this$_cache$keys7, e, t, n, s, r, _e18;
  18249. return _regenerator.default.wrap(function _callee16$(_context16) {
  18250. while (1) {
  18251. switch (_context16.prev = _context16.next) {
  18252. case 0:
  18253. this._cache.updatePersistence("local");
  18254. _this$_cache$keys7 = this._cache.keys;
  18255. e = _this$_cache$keys7.anonymousUuidKey;
  18256. t = _this$_cache$keys7.refreshTokenKey;
  18257. n = this._cache.getStore(e) || void 0;
  18258. s = this._cache.getStore(t) || void 0;
  18259. _context16.next = 8;
  18260. return this._request.send("auth.signInAnonymously", {
  18261. anonymous_uuid: n,
  18262. refresh_token: s
  18263. });
  18264. case 8:
  18265. r = _context16.sent;
  18266. if (!(r.uuid && r.refresh_token)) {
  18267. _context16.next = 20;
  18268. break;
  18269. }
  18270. this._setAnonymousUUID(r.uuid);
  18271. this.setRefreshToken(r.refresh_token);
  18272. _context16.next = 14;
  18273. return this._request.refreshAccessToken();
  18274. case 14:
  18275. De(qe);
  18276. De(Ke, {
  18277. env: this.config.env,
  18278. loginType: $e.ANONYMOUS,
  18279. persistence: "local"
  18280. });
  18281. _e18 = new Ze(this.config.env);
  18282. _context16.next = 19;
  18283. return _e18.user.refresh();
  18284. case 19:
  18285. return _context16.abrupt("return", _e18);
  18286. case 20:
  18287. throw new ne({
  18288. message: "匿名登录失败"
  18289. });
  18290. case 21:
  18291. case "end":
  18292. return _context16.stop();
  18293. }
  18294. }
  18295. }, _callee16, this);
  18296. }));
  18297. function signIn() {
  18298. return _signIn.apply(this, arguments);
  18299. }
  18300. return signIn;
  18301. }()
  18302. }, {
  18303. key: "linkAndRetrieveDataWithTicket",
  18304. value: function () {
  18305. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  18306. var _this$_cache$keys8, t, n, s, r, i;
  18307. return _regenerator.default.wrap(function _callee17$(_context17) {
  18308. while (1) {
  18309. switch (_context17.prev = _context17.next) {
  18310. case 0:
  18311. _this$_cache$keys8 = this._cache.keys;
  18312. t = _this$_cache$keys8.anonymousUuidKey;
  18313. n = _this$_cache$keys8.refreshTokenKey;
  18314. s = this._cache.getStore(t);
  18315. r = this._cache.getStore(n);
  18316. _context17.next = 7;
  18317. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  18318. anonymous_uuid: s,
  18319. refresh_token: r,
  18320. ticket: e
  18321. });
  18322. case 7:
  18323. i = _context17.sent;
  18324. if (!i.refresh_token) {
  18325. _context17.next = 16;
  18326. break;
  18327. }
  18328. this._clearAnonymousUUID();
  18329. this.setRefreshToken(i.refresh_token);
  18330. _context17.next = 13;
  18331. return this._request.refreshAccessToken();
  18332. case 13:
  18333. De(je, {
  18334. env: this.config.env
  18335. });
  18336. De(Ke, {
  18337. loginType: $e.CUSTOM,
  18338. persistence: "local"
  18339. });
  18340. return _context17.abrupt("return", {
  18341. credential: {
  18342. refreshToken: i.refresh_token
  18343. }
  18344. });
  18345. case 16:
  18346. throw new ne({
  18347. message: "匿名转化失败"
  18348. });
  18349. case 17:
  18350. case "end":
  18351. return _context17.stop();
  18352. }
  18353. }
  18354. }, _callee17, this);
  18355. }));
  18356. function linkAndRetrieveDataWithTicket(_x10) {
  18357. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  18358. }
  18359. return linkAndRetrieveDataWithTicket;
  18360. }()
  18361. }, {
  18362. key: "_setAnonymousUUID",
  18363. value: function _setAnonymousUUID(e) {
  18364. var _this$_cache$keys9 = this._cache.keys,
  18365. t = _this$_cache$keys9.anonymousUuidKey,
  18366. n = _this$_cache$keys9.loginTypeKey;
  18367. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  18368. }
  18369. }, {
  18370. key: "_clearAnonymousUUID",
  18371. value: function _clearAnonymousUUID() {
  18372. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  18373. }
  18374. }]);
  18375. return et;
  18376. }(Qe);
  18377. var tt = /*#__PURE__*/function (_Qe2) {
  18378. (0, _inherits2.default)(tt, _Qe2);
  18379. var _super5 = _createSuper(tt);
  18380. function tt() {
  18381. (0, _classCallCheck2.default)(this, tt);
  18382. return _super5.apply(this, arguments);
  18383. }
  18384. (0, _createClass2.default)(tt, [{
  18385. key: "signIn",
  18386. value: function () {
  18387. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  18388. var t, n;
  18389. return _regenerator.default.wrap(function _callee18$(_context18) {
  18390. while (1) {
  18391. switch (_context18.prev = _context18.next) {
  18392. case 0:
  18393. if (!("string" != typeof e)) {
  18394. _context18.next = 2;
  18395. break;
  18396. }
  18397. throw new ne({
  18398. code: "PARAM_ERROR",
  18399. message: "ticket must be a string"
  18400. });
  18401. case 2:
  18402. t = this._cache.keys.refreshTokenKey;
  18403. _context18.next = 5;
  18404. return this._request.send("auth.signInWithTicket", {
  18405. ticket: e,
  18406. refresh_token: this._cache.getStore(t) || ""
  18407. });
  18408. case 5:
  18409. n = _context18.sent;
  18410. if (!n.refresh_token) {
  18411. _context18.next = 15;
  18412. break;
  18413. }
  18414. this.setRefreshToken(n.refresh_token);
  18415. _context18.next = 10;
  18416. return this._request.refreshAccessToken();
  18417. case 10:
  18418. De(qe);
  18419. De(Ke, {
  18420. env: this.config.env,
  18421. loginType: $e.CUSTOM,
  18422. persistence: this.config.persistence
  18423. });
  18424. _context18.next = 14;
  18425. return this.refreshUserInfo();
  18426. case 14:
  18427. return _context18.abrupt("return", new Ze(this.config.env));
  18428. case 15:
  18429. throw new ne({
  18430. message: "自定义登录失败"
  18431. });
  18432. case 16:
  18433. case "end":
  18434. return _context18.stop();
  18435. }
  18436. }
  18437. }, _callee18, this);
  18438. }));
  18439. function signIn(_x11) {
  18440. return _signIn2.apply(this, arguments);
  18441. }
  18442. return signIn;
  18443. }()
  18444. }]);
  18445. return tt;
  18446. }(Qe);
  18447. var nt = /*#__PURE__*/function (_Qe3) {
  18448. (0, _inherits2.default)(nt, _Qe3);
  18449. var _super6 = _createSuper(nt);
  18450. function nt() {
  18451. (0, _classCallCheck2.default)(this, nt);
  18452. return _super6.apply(this, arguments);
  18453. }
  18454. (0, _createClass2.default)(nt, [{
  18455. key: "signIn",
  18456. value: function () {
  18457. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  18458. var n, s, r, i, o;
  18459. return _regenerator.default.wrap(function _callee19$(_context19) {
  18460. while (1) {
  18461. switch (_context19.prev = _context19.next) {
  18462. case 0:
  18463. if (!("string" != typeof e)) {
  18464. _context19.next = 2;
  18465. break;
  18466. }
  18467. throw new ne({
  18468. code: "PARAM_ERROR",
  18469. message: "email must be a string"
  18470. });
  18471. case 2:
  18472. n = this._cache.keys.refreshTokenKey;
  18473. _context19.next = 5;
  18474. return this._request.send("auth.signIn", {
  18475. loginType: "EMAIL",
  18476. email: e,
  18477. password: t,
  18478. refresh_token: this._cache.getStore(n) || ""
  18479. });
  18480. case 5:
  18481. s = _context19.sent;
  18482. r = s.refresh_token;
  18483. i = s.access_token;
  18484. o = s.access_token_expire;
  18485. if (!r) {
  18486. _context19.next = 22;
  18487. break;
  18488. }
  18489. this.setRefreshToken(r);
  18490. if (!(i && o)) {
  18491. _context19.next = 15;
  18492. break;
  18493. }
  18494. this.setAccessToken(i, o);
  18495. _context19.next = 17;
  18496. break;
  18497. case 15:
  18498. _context19.next = 17;
  18499. return this._request.refreshAccessToken();
  18500. case 17:
  18501. _context19.next = 19;
  18502. return this.refreshUserInfo();
  18503. case 19:
  18504. De(qe);
  18505. De(Ke, {
  18506. env: this.config.env,
  18507. loginType: $e.EMAIL,
  18508. persistence: this.config.persistence
  18509. });
  18510. return _context19.abrupt("return", new Ze(this.config.env));
  18511. case 22:
  18512. throw s.code ? new ne({
  18513. code: s.code,
  18514. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  18515. }) : new ne({
  18516. message: "邮箱登录失败"
  18517. });
  18518. case 23:
  18519. case "end":
  18520. return _context19.stop();
  18521. }
  18522. }
  18523. }, _callee19, this);
  18524. }));
  18525. function signIn(_x12, _x13) {
  18526. return _signIn3.apply(this, arguments);
  18527. }
  18528. return signIn;
  18529. }()
  18530. }, {
  18531. key: "activate",
  18532. value: function () {
  18533. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  18534. return _regenerator.default.wrap(function _callee20$(_context20) {
  18535. while (1) {
  18536. switch (_context20.prev = _context20.next) {
  18537. case 0:
  18538. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  18539. token: e
  18540. }));
  18541. case 1:
  18542. case "end":
  18543. return _context20.stop();
  18544. }
  18545. }
  18546. }, _callee20, this);
  18547. }));
  18548. function activate(_x14) {
  18549. return _activate.apply(this, arguments);
  18550. }
  18551. return activate;
  18552. }()
  18553. }, {
  18554. key: "resetPasswordWithToken",
  18555. value: function () {
  18556. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  18557. return _regenerator.default.wrap(function _callee21$(_context21) {
  18558. while (1) {
  18559. switch (_context21.prev = _context21.next) {
  18560. case 0:
  18561. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  18562. token: e,
  18563. newPassword: t
  18564. }));
  18565. case 1:
  18566. case "end":
  18567. return _context21.stop();
  18568. }
  18569. }
  18570. }, _callee21, this);
  18571. }));
  18572. function resetPasswordWithToken(_x15, _x16) {
  18573. return _resetPasswordWithToken.apply(this, arguments);
  18574. }
  18575. return resetPasswordWithToken;
  18576. }()
  18577. }]);
  18578. return nt;
  18579. }(Qe);
  18580. var st = /*#__PURE__*/function (_Qe4) {
  18581. (0, _inherits2.default)(st, _Qe4);
  18582. var _super7 = _createSuper(st);
  18583. function st() {
  18584. (0, _classCallCheck2.default)(this, st);
  18585. return _super7.apply(this, arguments);
  18586. }
  18587. (0, _createClass2.default)(st, [{
  18588. key: "signIn",
  18589. value: function () {
  18590. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  18591. var n, s, r, i, o;
  18592. return _regenerator.default.wrap(function _callee22$(_context22) {
  18593. while (1) {
  18594. switch (_context22.prev = _context22.next) {
  18595. case 0:
  18596. if (!("string" != typeof e)) {
  18597. _context22.next = 2;
  18598. break;
  18599. }
  18600. throw new ne({
  18601. code: "PARAM_ERROR",
  18602. message: "username must be a string"
  18603. });
  18604. case 2:
  18605. "string" != typeof t && (t = "", console.warn("password is empty"));
  18606. n = this._cache.keys.refreshTokenKey;
  18607. _context22.next = 6;
  18608. return this._request.send("auth.signIn", {
  18609. loginType: $e.USERNAME,
  18610. username: e,
  18611. password: t,
  18612. refresh_token: this._cache.getStore(n) || ""
  18613. });
  18614. case 6:
  18615. s = _context22.sent;
  18616. r = s.refresh_token;
  18617. i = s.access_token_expire;
  18618. o = s.access_token;
  18619. if (!r) {
  18620. _context22.next = 23;
  18621. break;
  18622. }
  18623. this.setRefreshToken(r);
  18624. if (!(o && i)) {
  18625. _context22.next = 16;
  18626. break;
  18627. }
  18628. this.setAccessToken(o, i);
  18629. _context22.next = 18;
  18630. break;
  18631. case 16:
  18632. _context22.next = 18;
  18633. return this._request.refreshAccessToken();
  18634. case 18:
  18635. _context22.next = 20;
  18636. return this.refreshUserInfo();
  18637. case 20:
  18638. De(qe);
  18639. De(Ke, {
  18640. env: this.config.env,
  18641. loginType: $e.USERNAME,
  18642. persistence: this.config.persistence
  18643. });
  18644. return _context22.abrupt("return", new Ze(this.config.env));
  18645. case 23:
  18646. throw s.code ? new ne({
  18647. code: s.code,
  18648. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  18649. }) : new ne({
  18650. message: "用户名密码登录失败"
  18651. });
  18652. case 24:
  18653. case "end":
  18654. return _context22.stop();
  18655. }
  18656. }
  18657. }, _callee22, this);
  18658. }));
  18659. function signIn(_x17, _x18) {
  18660. return _signIn4.apply(this, arguments);
  18661. }
  18662. return signIn;
  18663. }()
  18664. }]);
  18665. return st;
  18666. }(Qe);
  18667. var rt = /*#__PURE__*/function () {
  18668. function rt(e) {
  18669. (0, _classCallCheck2.default)(this, rt);
  18670. 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);
  18671. }
  18672. (0, _createClass2.default)(rt, [{
  18673. key: "currentUser",
  18674. get: function get() {
  18675. var e = this.hasLoginState();
  18676. return e && e.user || null;
  18677. }
  18678. }, {
  18679. key: "loginType",
  18680. get: function get() {
  18681. return this._cache.getStore(this._cache.keys.loginTypeKey);
  18682. }
  18683. }, {
  18684. key: "anonymousAuthProvider",
  18685. value: function anonymousAuthProvider() {
  18686. return new et(this.config);
  18687. }
  18688. }, {
  18689. key: "customAuthProvider",
  18690. value: function customAuthProvider() {
  18691. return new tt(this.config);
  18692. }
  18693. }, {
  18694. key: "emailAuthProvider",
  18695. value: function emailAuthProvider() {
  18696. return new nt(this.config);
  18697. }
  18698. }, {
  18699. key: "usernameAuthProvider",
  18700. value: function usernameAuthProvider() {
  18701. return new st(this.config);
  18702. }
  18703. }, {
  18704. key: "signInAnonymously",
  18705. value: function () {
  18706. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  18707. return _regenerator.default.wrap(function _callee23$(_context23) {
  18708. while (1) {
  18709. switch (_context23.prev = _context23.next) {
  18710. case 0:
  18711. return _context23.abrupt("return", new et(this.config).signIn());
  18712. case 1:
  18713. case "end":
  18714. return _context23.stop();
  18715. }
  18716. }
  18717. }, _callee23, this);
  18718. }));
  18719. function signInAnonymously() {
  18720. return _signInAnonymously.apply(this, arguments);
  18721. }
  18722. return signInAnonymously;
  18723. }()
  18724. }, {
  18725. key: "signInWithEmailAndPassword",
  18726. value: function () {
  18727. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  18728. return _regenerator.default.wrap(function _callee24$(_context24) {
  18729. while (1) {
  18730. switch (_context24.prev = _context24.next) {
  18731. case 0:
  18732. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  18733. case 1:
  18734. case "end":
  18735. return _context24.stop();
  18736. }
  18737. }
  18738. }, _callee24, this);
  18739. }));
  18740. function signInWithEmailAndPassword(_x19, _x20) {
  18741. return _signInWithEmailAndPassword.apply(this, arguments);
  18742. }
  18743. return signInWithEmailAndPassword;
  18744. }()
  18745. }, {
  18746. key: "signInWithUsernameAndPassword",
  18747. value: function signInWithUsernameAndPassword(e, t) {
  18748. return new st(this.config).signIn(e, t);
  18749. }
  18750. }, {
  18751. key: "linkAndRetrieveDataWithTicket",
  18752. value: function () {
  18753. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  18754. return _regenerator.default.wrap(function _callee25$(_context25) {
  18755. while (1) {
  18756. switch (_context25.prev = _context25.next) {
  18757. case 0:
  18758. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  18759. _context25.next = 3;
  18760. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  18761. case 3:
  18762. return _context25.abrupt("return", _context25.sent);
  18763. case 4:
  18764. case "end":
  18765. return _context25.stop();
  18766. }
  18767. }
  18768. }, _callee25, this);
  18769. }));
  18770. function linkAndRetrieveDataWithTicket(_x21) {
  18771. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  18772. }
  18773. return linkAndRetrieveDataWithTicket;
  18774. }()
  18775. }, {
  18776. key: "signOut",
  18777. value: function () {
  18778. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  18779. var _this$_cache$keys10, e, t, n, s, r;
  18780. return _regenerator.default.wrap(function _callee26$(_context26) {
  18781. while (1) {
  18782. switch (_context26.prev = _context26.next) {
  18783. case 0:
  18784. if (!(this.loginType === $e.ANONYMOUS)) {
  18785. _context26.next = 2;
  18786. break;
  18787. }
  18788. throw new ne({
  18789. message: "匿名用户不支持登出操作"
  18790. });
  18791. case 2:
  18792. _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);
  18793. if (s) {
  18794. _context26.next = 5;
  18795. break;
  18796. }
  18797. return _context26.abrupt("return");
  18798. case 5:
  18799. _context26.next = 7;
  18800. return this._request.send("auth.logout", {
  18801. refresh_token: s
  18802. });
  18803. case 7:
  18804. r = _context26.sent;
  18805. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Ke, {
  18806. env: this.config.env,
  18807. loginType: $e.NULL,
  18808. persistence: this.config.persistence
  18809. }), r));
  18810. case 9:
  18811. case "end":
  18812. return _context26.stop();
  18813. }
  18814. }
  18815. }, _callee26, this);
  18816. }));
  18817. function signOut() {
  18818. return _signOut.apply(this, arguments);
  18819. }
  18820. return signOut;
  18821. }()
  18822. }, {
  18823. key: "signUpWithEmailAndPassword",
  18824. value: function () {
  18825. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  18826. return _regenerator.default.wrap(function _callee27$(_context27) {
  18827. while (1) {
  18828. switch (_context27.prev = _context27.next) {
  18829. case 0:
  18830. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  18831. email: e,
  18832. password: t
  18833. }));
  18834. case 1:
  18835. case "end":
  18836. return _context27.stop();
  18837. }
  18838. }
  18839. }, _callee27, this);
  18840. }));
  18841. function signUpWithEmailAndPassword(_x22, _x23) {
  18842. return _signUpWithEmailAndPassword.apply(this, arguments);
  18843. }
  18844. return signUpWithEmailAndPassword;
  18845. }()
  18846. }, {
  18847. key: "sendPasswordResetEmail",
  18848. value: function () {
  18849. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  18850. return _regenerator.default.wrap(function _callee28$(_context28) {
  18851. while (1) {
  18852. switch (_context28.prev = _context28.next) {
  18853. case 0:
  18854. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  18855. email: e
  18856. }));
  18857. case 1:
  18858. case "end":
  18859. return _context28.stop();
  18860. }
  18861. }
  18862. }, _callee28, this);
  18863. }));
  18864. function sendPasswordResetEmail(_x24) {
  18865. return _sendPasswordResetEmail.apply(this, arguments);
  18866. }
  18867. return sendPasswordResetEmail;
  18868. }()
  18869. }, {
  18870. key: "onLoginStateChanged",
  18871. value: function onLoginStateChanged(e) {
  18872. var _this9 = this;
  18873. Ne(qe, function () {
  18874. var t = _this9.hasLoginState();
  18875. e.call(_this9, t);
  18876. });
  18877. var t = this.hasLoginState();
  18878. e.call(this, t);
  18879. }
  18880. }, {
  18881. key: "onLoginStateExpired",
  18882. value: function onLoginStateExpired(e) {
  18883. Ne(Me, e.bind(this));
  18884. }
  18885. }, {
  18886. key: "onAccessTokenRefreshed",
  18887. value: function onAccessTokenRefreshed(e) {
  18888. Ne(Be, e.bind(this));
  18889. }
  18890. }, {
  18891. key: "onAnonymousConverted",
  18892. value: function onAnonymousConverted(e) {
  18893. Ne(je, e.bind(this));
  18894. }
  18895. }, {
  18896. key: "onLoginTypeChanged",
  18897. value: function onLoginTypeChanged(e) {
  18898. var _this10 = this;
  18899. Ne(Ke, function () {
  18900. var t = _this10.hasLoginState();
  18901. e.call(_this10, t);
  18902. });
  18903. }
  18904. }, {
  18905. key: "getAccessToken",
  18906. value: function () {
  18907. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  18908. return _regenerator.default.wrap(function _callee29$(_context29) {
  18909. while (1) {
  18910. switch (_context29.prev = _context29.next) {
  18911. case 0:
  18912. _context29.next = 2;
  18913. return this._request.getAccessToken();
  18914. case 2:
  18915. _context29.t0 = _context29.sent.accessToken;
  18916. _context29.t1 = this.config.env;
  18917. return _context29.abrupt("return", {
  18918. accessToken: _context29.t0,
  18919. env: _context29.t1
  18920. });
  18921. case 5:
  18922. case "end":
  18923. return _context29.stop();
  18924. }
  18925. }
  18926. }, _callee29, this);
  18927. }));
  18928. function getAccessToken() {
  18929. return _getAccessToken2.apply(this, arguments);
  18930. }
  18931. return getAccessToken;
  18932. }()
  18933. }, {
  18934. key: "hasLoginState",
  18935. value: function hasLoginState() {
  18936. var e = this._cache.keys.refreshTokenKey;
  18937. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  18938. }
  18939. }, {
  18940. key: "isUsernameRegistered",
  18941. value: function () {
  18942. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  18943. var _yield$this$_request$5, t;
  18944. return _regenerator.default.wrap(function _callee30$(_context30) {
  18945. while (1) {
  18946. switch (_context30.prev = _context30.next) {
  18947. case 0:
  18948. if (!("string" != typeof e)) {
  18949. _context30.next = 2;
  18950. break;
  18951. }
  18952. throw new ne({
  18953. code: "PARAM_ERROR",
  18954. message: "username must be a string"
  18955. });
  18956. case 2:
  18957. _context30.next = 4;
  18958. return this._request.send("auth.isUsernameRegistered", {
  18959. username: e
  18960. });
  18961. case 4:
  18962. _yield$this$_request$5 = _context30.sent;
  18963. t = _yield$this$_request$5.data;
  18964. return _context30.abrupt("return", t && t.isRegistered);
  18965. case 7:
  18966. case "end":
  18967. return _context30.stop();
  18968. }
  18969. }
  18970. }, _callee30, this);
  18971. }));
  18972. function isUsernameRegistered(_x25) {
  18973. return _isUsernameRegistered.apply(this, arguments);
  18974. }
  18975. return isUsernameRegistered;
  18976. }()
  18977. }, {
  18978. key: "getLoginState",
  18979. value: function getLoginState() {
  18980. return Promise.resolve(this.hasLoginState());
  18981. }
  18982. }, {
  18983. key: "signInWithTicket",
  18984. value: function () {
  18985. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  18986. return _regenerator.default.wrap(function _callee31$(_context31) {
  18987. while (1) {
  18988. switch (_context31.prev = _context31.next) {
  18989. case 0:
  18990. return _context31.abrupt("return", new tt(this.config).signIn(e));
  18991. case 1:
  18992. case "end":
  18993. return _context31.stop();
  18994. }
  18995. }
  18996. }, _callee31, this);
  18997. }));
  18998. function signInWithTicket(_x26) {
  18999. return _signInWithTicket.apply(this, arguments);
  19000. }
  19001. return signInWithTicket;
  19002. }()
  19003. }, {
  19004. key: "shouldRefreshAccessToken",
  19005. value: function shouldRefreshAccessToken(e) {
  19006. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  19007. }
  19008. }, {
  19009. key: "getUserInfo",
  19010. value: function getUserInfo() {
  19011. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  19012. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  19013. requestId: e.seqId
  19014. });
  19015. });
  19016. }
  19017. }, {
  19018. key: "getAuthHeader",
  19019. value: function getAuthHeader() {
  19020. var _this$_cache$keys11 = this._cache.keys,
  19021. e = _this$_cache$keys11.refreshTokenKey,
  19022. t = _this$_cache$keys11.accessTokenKey,
  19023. n = this._cache.getStore(e);
  19024. return {
  19025. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  19026. };
  19027. }
  19028. }, {
  19029. key: "_onAnonymousConverted",
  19030. value: function _onAnonymousConverted(e) {
  19031. var t = e.data.env;
  19032. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  19033. }
  19034. }, {
  19035. key: "_onLoginTypeChanged",
  19036. value: function _onLoginTypeChanged(e) {
  19037. var _e$data = e.data,
  19038. t = _e$data.loginType,
  19039. n = _e$data.persistence,
  19040. s = _e$data.env;
  19041. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  19042. }
  19043. }]);
  19044. return rt;
  19045. }();
  19046. var it = function it(e, t) {
  19047. t = t || we();
  19048. var n = Ye(this.config.env),
  19049. s = e.cloudPath,
  19050. r = e.filePath,
  19051. i = e.onUploadProgress,
  19052. _e$fileType = e.fileType,
  19053. o = _e$fileType === void 0 ? "image" : _e$fileType;
  19054. return n.send("storage.getUploadMetadata", {
  19055. path: s
  19056. }).then(function (e) {
  19057. var _e$data2 = e.data,
  19058. a = _e$data2.url,
  19059. c = _e$data2.authorization,
  19060. u = _e$data2.token,
  19061. h = _e$data2.fileId,
  19062. l = _e$data2.cosFileId,
  19063. d = e.requestId,
  19064. p = {
  19065. key: s,
  19066. signature: c,
  19067. "x-cos-meta-fileid": l,
  19068. success_action_status: "201",
  19069. "x-cos-security-token": u
  19070. };
  19071. n.upload({
  19072. url: a,
  19073. data: p,
  19074. file: r,
  19075. name: s,
  19076. fileType: o,
  19077. onUploadProgress: i
  19078. }).then(function (e) {
  19079. 201 === e.statusCode ? t(null, {
  19080. fileID: h,
  19081. requestId: d
  19082. }) : t(new ne({
  19083. code: "STORAGE_REQUEST_FAIL",
  19084. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  19085. }));
  19086. }).catch(function (e) {
  19087. t(e);
  19088. });
  19089. }).catch(function (e) {
  19090. t(e);
  19091. }), t.promise;
  19092. },
  19093. ot = function ot(e, t) {
  19094. t = t || we();
  19095. var n = Ye(this.config.env),
  19096. s = e.cloudPath;
  19097. return n.send("storage.getUploadMetadata", {
  19098. path: s
  19099. }).then(function (e) {
  19100. t(null, e);
  19101. }).catch(function (e) {
  19102. t(e);
  19103. }), t.promise;
  19104. },
  19105. at = function at(_ref7, t) {
  19106. var e = _ref7.fileList;
  19107. if (t = t || we(), !e || !Array.isArray(e)) return {
  19108. code: "INVALID_PARAM",
  19109. message: "fileList必须是非空的数组"
  19110. };
  19111. var _iterator3 = _createForOfIteratorHelper(e),
  19112. _step3;
  19113. try {
  19114. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  19115. var _t8 = _step3.value;
  19116. if (!_t8 || "string" != typeof _t8) return {
  19117. code: "INVALID_PARAM",
  19118. message: "fileList的元素必须是非空的字符串"
  19119. };
  19120. }
  19121. } catch (err) {
  19122. _iterator3.e(err);
  19123. } finally {
  19124. _iterator3.f();
  19125. }
  19126. var n = {
  19127. fileid_list: e
  19128. };
  19129. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  19130. e.code ? t(null, e) : t(null, {
  19131. fileList: e.data.delete_list,
  19132. requestId: e.requestId
  19133. });
  19134. }).catch(function (e) {
  19135. t(e);
  19136. }), t.promise;
  19137. },
  19138. ct = function ct(_ref8, t) {
  19139. var e = _ref8.fileList;
  19140. t = t || we(), e && Array.isArray(e) || t(null, {
  19141. code: "INVALID_PARAM",
  19142. message: "fileList必须是非空的数组"
  19143. });
  19144. var n = [];
  19145. var _iterator4 = _createForOfIteratorHelper(e),
  19146. _step4;
  19147. try {
  19148. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  19149. var _s9 = _step4.value;
  19150. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  19151. code: "INVALID_PARAM",
  19152. message: "fileList的元素必须是包含fileID和maxAge的对象"
  19153. }), n.push({
  19154. fileid: _s9.fileID,
  19155. max_age: _s9.maxAge
  19156. })) : "string" == typeof _s9 ? n.push({
  19157. fileid: _s9
  19158. }) : t(null, {
  19159. code: "INVALID_PARAM",
  19160. message: "fileList的元素必须是字符串"
  19161. });
  19162. }
  19163. } catch (err) {
  19164. _iterator4.e(err);
  19165. } finally {
  19166. _iterator4.f();
  19167. }
  19168. var s = {
  19169. file_list: n
  19170. };
  19171. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  19172. e.code ? t(null, e) : t(null, {
  19173. fileList: e.data.download_list,
  19174. requestId: e.requestId
  19175. });
  19176. }).catch(function (e) {
  19177. t(e);
  19178. }), t.promise;
  19179. },
  19180. ut = /*#__PURE__*/function () {
  19181. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  19182. var e, n, s, r;
  19183. return _regenerator.default.wrap(function _callee32$(_context32) {
  19184. while (1) {
  19185. switch (_context32.prev = _context32.next) {
  19186. case 0:
  19187. e = _ref9.fileID;
  19188. _context32.next = 3;
  19189. return ct.call(this, {
  19190. fileList: [{
  19191. fileID: e,
  19192. maxAge: 600
  19193. }]
  19194. });
  19195. case 3:
  19196. n = _context32.sent.fileList[0];
  19197. if (!("SUCCESS" !== n.code)) {
  19198. _context32.next = 6;
  19199. break;
  19200. }
  19201. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  19202. e(n);
  19203. }));
  19204. case 6:
  19205. s = Ye(this.config.env);
  19206. r = n.download_url;
  19207. if (!(r = encodeURI(r), !t)) {
  19208. _context32.next = 10;
  19209. break;
  19210. }
  19211. return _context32.abrupt("return", s.download({
  19212. url: r
  19213. }));
  19214. case 10:
  19215. _context32.t0 = t;
  19216. _context32.next = 13;
  19217. return s.download({
  19218. url: r
  19219. });
  19220. case 13:
  19221. _context32.t1 = _context32.sent;
  19222. (0, _context32.t0)(_context32.t1);
  19223. case 15:
  19224. case "end":
  19225. return _context32.stop();
  19226. }
  19227. }
  19228. }, _callee32, this);
  19229. }));
  19230. return function ut(_x27, _x28) {
  19231. return _ref10.apply(this, arguments);
  19232. };
  19233. }(),
  19234. ht = function ht(_ref11, i) {
  19235. var e = _ref11.name,
  19236. t = _ref11.data,
  19237. n = _ref11.query,
  19238. s = _ref11.parse,
  19239. r = _ref11.search;
  19240. var o = i || we();
  19241. var a;
  19242. try {
  19243. a = t ? JSON.stringify(t) : "";
  19244. } catch (e) {
  19245. return Promise.reject(e);
  19246. }
  19247. if (!e) return Promise.reject(new ne({
  19248. code: "PARAM_ERROR",
  19249. message: "函数名不能为空"
  19250. }));
  19251. var c = {
  19252. inQuery: n,
  19253. parse: s,
  19254. search: r,
  19255. function_name: e,
  19256. request_data: a
  19257. };
  19258. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  19259. if (e.code) o(null, e);else {
  19260. var _t9 = e.data.response_data;
  19261. if (s) o(null, {
  19262. result: _t9,
  19263. requestId: e.requestId
  19264. });else try {
  19265. _t9 = JSON.parse(e.data.response_data), o(null, {
  19266. result: _t9,
  19267. requestId: e.requestId
  19268. });
  19269. } catch (e) {
  19270. o(new ne({
  19271. message: "response data must be json"
  19272. }));
  19273. }
  19274. }
  19275. return o.promise;
  19276. }).catch(function (e) {
  19277. o(e);
  19278. }), o.promise;
  19279. },
  19280. lt = {
  19281. timeout: 15e3,
  19282. persistence: "session"
  19283. },
  19284. dt = {};
  19285. var pt = /*#__PURE__*/function () {
  19286. function pt(e) {
  19287. (0, _classCallCheck2.default)(this, pt);
  19288. this.config = e || this.config, this.authObj = void 0;
  19289. }
  19290. (0, _createClass2.default)(pt, [{
  19291. key: "init",
  19292. value: function init(e) {
  19293. switch (ke.adapter || (this.requestClient = new ke.adapter.reqClass({
  19294. timeout: e.timeout || 5e3,
  19295. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  19296. })), this.config = _objectSpread(_objectSpread({}, lt), e), !0) {
  19297. case this.config.timeout > 6e5:
  19298. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  19299. break;
  19300. case this.config.timeout < 100:
  19301. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  19302. }
  19303. return new pt(this.config);
  19304. }
  19305. }, {
  19306. key: "auth",
  19307. value: function auth() {
  19308. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19309. e = _ref12.persistence;
  19310. if (this.authObj) return this.authObj;
  19311. var t = e || ke.adapter.primaryStorage || lt.persistence;
  19312. var n;
  19313. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  19314. var t = e.env;
  19315. Ee[t] = new Ae(e), Oe[t] = new Ae(_objectSpread(_objectSpread({}, e), {}, {
  19316. persistence: "local"
  19317. }));
  19318. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  19319. }
  19320. }, {
  19321. key: "on",
  19322. value: function on(e, t) {
  19323. return Ne.apply(this, [e, t]);
  19324. }
  19325. }, {
  19326. key: "off",
  19327. value: function off(e, t) {
  19328. return Fe.apply(this, [e, t]);
  19329. }
  19330. }, {
  19331. key: "callFunction",
  19332. value: function callFunction(e, t) {
  19333. return ht.apply(this, [e, t]);
  19334. }
  19335. }, {
  19336. key: "deleteFile",
  19337. value: function deleteFile(e, t) {
  19338. return at.apply(this, [e, t]);
  19339. }
  19340. }, {
  19341. key: "getTempFileURL",
  19342. value: function getTempFileURL(e, t) {
  19343. return ct.apply(this, [e, t]);
  19344. }
  19345. }, {
  19346. key: "downloadFile",
  19347. value: function downloadFile(e, t) {
  19348. return ut.apply(this, [e, t]);
  19349. }
  19350. }, {
  19351. key: "uploadFile",
  19352. value: function uploadFile(e, t) {
  19353. return it.apply(this, [e, t]);
  19354. }
  19355. }, {
  19356. key: "getUploadMetadata",
  19357. value: function getUploadMetadata(e, t) {
  19358. return ot.apply(this, [e, t]);
  19359. }
  19360. }, {
  19361. key: "registerExtension",
  19362. value: function registerExtension(e) {
  19363. dt[e.name] = e;
  19364. }
  19365. }, {
  19366. key: "invokeExtension",
  19367. value: function () {
  19368. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  19369. var n;
  19370. return _regenerator.default.wrap(function _callee33$(_context33) {
  19371. while (1) {
  19372. switch (_context33.prev = _context33.next) {
  19373. case 0:
  19374. n = dt[e];
  19375. if (n) {
  19376. _context33.next = 3;
  19377. break;
  19378. }
  19379. throw new ne({
  19380. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  19381. });
  19382. case 3:
  19383. _context33.next = 5;
  19384. return n.invoke(t, this);
  19385. case 5:
  19386. return _context33.abrupt("return", _context33.sent);
  19387. case 6:
  19388. case "end":
  19389. return _context33.stop();
  19390. }
  19391. }
  19392. }, _callee33, this);
  19393. }));
  19394. function invokeExtension(_x29, _x30) {
  19395. return _invokeExtension.apply(this, arguments);
  19396. }
  19397. return invokeExtension;
  19398. }()
  19399. }, {
  19400. key: "useAdapters",
  19401. value: function useAdapters(e) {
  19402. var _ref13 = be(e) || {},
  19403. t = _ref13.adapter,
  19404. n = _ref13.runtime;
  19405. t && (ke.adapter = t), n && (ke.runtime = n);
  19406. }
  19407. }]);
  19408. return pt;
  19409. }();
  19410. var ft = new pt();
  19411. function gt(e, t, n) {
  19412. void 0 === n && (n = {});
  19413. var s = /\?/.test(t),
  19414. r = "";
  19415. for (var i in n) {
  19416. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  19417. }
  19418. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  19419. }
  19420. var mt = /*#__PURE__*/function () {
  19421. function mt() {
  19422. (0, _classCallCheck2.default)(this, mt);
  19423. }
  19424. (0, _createClass2.default)(mt, [{
  19425. key: "post",
  19426. value: function post(e) {
  19427. var t = e.url,
  19428. n = e.data,
  19429. s = e.headers;
  19430. return new Promise(function (e, r) {
  19431. se.request({
  19432. url: gt("https:", t),
  19433. data: n,
  19434. method: "POST",
  19435. header: s,
  19436. success: function success(t) {
  19437. e(t);
  19438. },
  19439. fail: function fail(e) {
  19440. r(e);
  19441. }
  19442. });
  19443. });
  19444. }
  19445. }, {
  19446. key: "upload",
  19447. value: function upload(e) {
  19448. return new Promise(function (t, n) {
  19449. var s = e.url,
  19450. r = e.file,
  19451. i = e.data,
  19452. o = e.headers,
  19453. a = e.fileType,
  19454. c = se.uploadFile({
  19455. url: gt("https:", s),
  19456. name: "file",
  19457. formData: Object.assign({}, i),
  19458. filePath: r,
  19459. fileType: a,
  19460. header: o,
  19461. success: function success(e) {
  19462. var n = {
  19463. statusCode: e.statusCode,
  19464. data: e.data || {}
  19465. };
  19466. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  19467. },
  19468. fail: function fail(e) {
  19469. n(new Error(e.errMsg || "uploadFile:fail"));
  19470. }
  19471. });
  19472. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  19473. e.onUploadProgress({
  19474. loaded: t.totalBytesSent,
  19475. total: t.totalBytesExpectedToSend
  19476. });
  19477. });
  19478. });
  19479. }
  19480. }]);
  19481. return mt;
  19482. }();
  19483. var yt = {
  19484. setItem: function setItem(e, t) {
  19485. se.setStorageSync(e, t);
  19486. },
  19487. getItem: function getItem(e) {
  19488. return se.getStorageSync(e);
  19489. },
  19490. removeItem: function removeItem(e) {
  19491. se.removeStorageSync(e);
  19492. },
  19493. clear: function clear() {
  19494. se.clearStorageSync();
  19495. }
  19496. };
  19497. var _t = {
  19498. genAdapter: function genAdapter() {
  19499. return {
  19500. root: {},
  19501. reqClass: mt,
  19502. localStorage: yt,
  19503. primaryStorage: "local"
  19504. };
  19505. },
  19506. isMatch: function isMatch() {
  19507. return !0;
  19508. },
  19509. runtime: "uni_app"
  19510. };
  19511. ft.useAdapters(_t);
  19512. var wt = ft,
  19513. vt = wt.init;
  19514. wt.init = function (e) {
  19515. e.env = e.spaceId;
  19516. var t = vt.call(this, e);
  19517. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  19518. var n = t.auth;
  19519. return t.auth = function (e) {
  19520. var t = n.call(this, e);
  19521. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  19522. var n;
  19523. t[e] = (n = t[e], function (e) {
  19524. e = e || {};
  19525. var _te = te(e),
  19526. t = _te.success,
  19527. s = _te.fail,
  19528. r = _te.complete;
  19529. if (!(t || s || r)) return n.call(this, e);
  19530. n.call(this, e).then(function (e) {
  19531. t && t(e), r && r(e);
  19532. }, function (e) {
  19533. s && s(e), r && r(e);
  19534. });
  19535. }).bind(t);
  19536. }), t;
  19537. }, t.customAuth = t.auth, t;
  19538. };
  19539. var It = wt;
  19540. var St = /*#__PURE__*/function (_fe) {
  19541. (0, _inherits2.default)(St, _fe);
  19542. var _super8 = _createSuper(St);
  19543. function St() {
  19544. (0, _classCallCheck2.default)(this, St);
  19545. return _super8.apply(this, arguments);
  19546. }
  19547. (0, _createClass2.default)(St, [{
  19548. key: "getAccessToken",
  19549. value: function getAccessToken() {
  19550. var _this11 = this;
  19551. return new Promise(function (e, t) {
  19552. var n = "Anonymous_Access_token";
  19553. _this11.setAccessToken(n), e(n);
  19554. });
  19555. }
  19556. }, {
  19557. key: "setupRequest",
  19558. value: function setupRequest(e, t) {
  19559. var n = Object.assign({}, e, {
  19560. spaceId: this.config.spaceId,
  19561. timestamp: Date.now()
  19562. }),
  19563. s = {
  19564. "Content-Type": "application/json"
  19565. };
  19566. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret);
  19567. var r = he();
  19568. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  19569. var _re = re(),
  19570. i = _re.token;
  19571. return s["x-client-token"] = i, {
  19572. url: this.config.requestUrl,
  19573. method: "POST",
  19574. data: n,
  19575. dataType: "json",
  19576. header: JSON.parse(JSON.stringify(s))
  19577. };
  19578. }
  19579. }, {
  19580. key: "uploadFileToOSS",
  19581. value: function uploadFileToOSS(_ref14) {
  19582. var _this12 = this;
  19583. var e = _ref14.url,
  19584. t = _ref14.formData,
  19585. n = _ref14.name,
  19586. s = _ref14.filePath,
  19587. r = _ref14.fileType,
  19588. i = _ref14.onUploadProgress;
  19589. return new Promise(function (o, a) {
  19590. var c = _this12.adapter.uploadFile({
  19591. url: e,
  19592. formData: t,
  19593. name: n,
  19594. filePath: s,
  19595. fileType: r,
  19596. success: function success(e) {
  19597. e && e.statusCode < 400 ? o(e) : a(new ne({
  19598. code: "UPLOAD_FAILED",
  19599. message: "文件上传失败"
  19600. }));
  19601. },
  19602. fail: function fail(e) {
  19603. a(new ne({
  19604. code: e.code || "UPLOAD_FAILED",
  19605. message: e.message || e.errMsg || "文件上传失败"
  19606. }));
  19607. }
  19608. });
  19609. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  19610. i({
  19611. loaded: e.totalBytesSent,
  19612. total: e.totalBytesExpectedToSend
  19613. });
  19614. });
  19615. });
  19616. }
  19617. }, {
  19618. key: "uploadFile",
  19619. value: function uploadFile(_ref15) {
  19620. var _this13 = this;
  19621. var e = _ref15.filePath,
  19622. t = _ref15.cloudPath,
  19623. _ref15$fileType = _ref15.fileType,
  19624. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  19625. s = _ref15.onUploadProgress;
  19626. if (!t) throw new ne({
  19627. code: "CLOUDPATH_REQUIRED",
  19628. message: "cloudPath不可为空"
  19629. });
  19630. var r;
  19631. return this.getOSSUploadOptionsFromPath({
  19632. cloudPath: t
  19633. }).then(function (t) {
  19634. var _t$result = t.result,
  19635. i = _t$result.url,
  19636. o = _t$result.formData,
  19637. a = _t$result.name;
  19638. r = t.result.fileUrl;
  19639. var c = {
  19640. url: i,
  19641. formData: o,
  19642. name: a,
  19643. filePath: e,
  19644. fileType: n
  19645. };
  19646. return _this13.uploadFileToOSS(Object.assign({}, c, {
  19647. onUploadProgress: s
  19648. }));
  19649. }).then(function () {
  19650. return _this13.reportOSSUpload({
  19651. cloudPath: t
  19652. });
  19653. }).then(function (t) {
  19654. return new Promise(function (n, s) {
  19655. t.success ? n({
  19656. success: !0,
  19657. filePath: e,
  19658. fileID: r
  19659. }) : s(new ne({
  19660. code: "UPLOAD_FAILED",
  19661. message: "文件上传失败"
  19662. }));
  19663. });
  19664. });
  19665. }
  19666. }, {
  19667. key: "deleteFile",
  19668. value: function deleteFile(_ref16) {
  19669. var e = _ref16.fileList;
  19670. var t = {
  19671. method: "serverless.file.resource.delete",
  19672. params: JSON.stringify({
  19673. fileList: e
  19674. })
  19675. };
  19676. return this.request(this.setupRequest(t)).then(function (e) {
  19677. if (e.success) return e.result;
  19678. throw new ne({
  19679. code: "DELETE_FILE_FAILED",
  19680. message: "删除文件失败"
  19681. });
  19682. });
  19683. }
  19684. }, {
  19685. key: "getTempFileURL",
  19686. value: function getTempFileURL() {
  19687. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19688. e = _ref17.fileList;
  19689. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  19690. code: "INVALID_PARAM",
  19691. message: "fileList的元素必须是非空的字符串"
  19692. });
  19693. var t = {
  19694. method: "serverless.file.resource.getTempFileURL",
  19695. params: JSON.stringify({
  19696. fileList: e
  19697. })
  19698. };
  19699. return this.request(this.setupRequest(t)).then(function (e) {
  19700. if (e.success) return {
  19701. fileList: e.result.fileList.map(function (e) {
  19702. return {
  19703. fileID: e.fileID,
  19704. tempFileURL: e.tempFileURL
  19705. };
  19706. })
  19707. };
  19708. throw new ne({
  19709. code: "GET_TEMP_FILE_URL_FAILED",
  19710. message: "获取临时文件链接失败"
  19711. });
  19712. });
  19713. }
  19714. }]);
  19715. return St;
  19716. }(fe);
  19717. var bt = {
  19718. init: function init(e) {
  19719. var t = new St(e),
  19720. n = {
  19721. signInAnonymously: function signInAnonymously() {
  19722. return t.authorize();
  19723. },
  19724. getLoginState: function getLoginState() {
  19725. return Promise.resolve(!1);
  19726. }
  19727. };
  19728. return t.auth = function () {
  19729. return n;
  19730. }, t.customAuth = t.auth, t;
  19731. }
  19732. };
  19733. function kt(_ref18) {
  19734. var e = _ref18.data;
  19735. var t;
  19736. t = he();
  19737. var n = JSON.parse(JSON.stringify(e || {}));
  19738. if (Object.assign(n, {
  19739. clientInfo: t
  19740. }), !n.uniIdToken) {
  19741. var _re2 = re(),
  19742. _e19 = _re2.token;
  19743. _e19 && (n.uniIdToken = _e19);
  19744. }
  19745. return n;
  19746. }
  19747. function Ct() {
  19748. return _Ct.apply(this, arguments);
  19749. }
  19750. function _Ct() {
  19751. _Ct = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  19752. var _this26 = this;
  19753. var _ref60,
  19754. e,
  19755. t,
  19756. _this$__dev__,
  19757. n,
  19758. s,
  19759. r,
  19760. i,
  19761. o,
  19762. a,
  19763. _args6 = arguments;
  19764. return _regenerator.default.wrap(function _callee54$(_context54) {
  19765. while (1) {
  19766. switch (_context54.prev = _context54.next) {
  19767. case 0:
  19768. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.name, t = _ref60.data;
  19769. _context54.next = 3;
  19770. return this.__dev__.initLocalNetwork();
  19771. case 3:
  19772. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  19773. aliyun: "aliyun",
  19774. tencent: "tcb"
  19775. }[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);
  19776. return _context54.abrupt("return", new Promise(function (t, n) {
  19777. se.request({
  19778. method: "POST",
  19779. url: o,
  19780. data: {
  19781. name: e,
  19782. platform: P,
  19783. provider: r,
  19784. spaceId: i
  19785. },
  19786. timeout: 3e3,
  19787. success: function success(e) {
  19788. t(e);
  19789. },
  19790. fail: function fail() {
  19791. t({
  19792. data: {
  19793. code: "NETWORK_ERROR",
  19794. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  19795. }
  19796. });
  19797. }
  19798. });
  19799. }).then(function () {
  19800. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19801. e = _ref61.data;
  19802. var _ref62 = e || {},
  19803. t = _ref62.code,
  19804. n = _ref62.message;
  19805. return {
  19806. code: 0 === t ? 0 : t || "SYS_ERR",
  19807. message: n || "SYS_ERR"
  19808. };
  19809. }).then(function (_ref63) {
  19810. var n = _ref63.code,
  19811. s = _ref63.message;
  19812. if (0 !== n) {
  19813. switch (n) {
  19814. case "MODULE_ENCRYPTED":
  19815. 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"));
  19816. break;
  19817. case "FUNCTION_ENCRYPTED":
  19818. 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"));
  19819. break;
  19820. case "ACTION_ENCRYPTED":
  19821. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  19822. break;
  19823. case "NETWORK_ERROR":
  19824. {
  19825. var _e31 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  19826. throw console.error(_e31), new Error(_e31);
  19827. }
  19828. case "SWITCH_TO_CLOUD":
  19829. break;
  19830. default:
  19831. {
  19832. 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");
  19833. throw console.error(_e32), new Error(_e32);
  19834. }
  19835. }
  19836. return _this26._callCloudFunction({
  19837. name: e,
  19838. data: t
  19839. });
  19840. }
  19841. return new Promise(function (e, n) {
  19842. var s = kt.call(_this26, {
  19843. data: t
  19844. });
  19845. se.request({
  19846. method: "POST",
  19847. url: a,
  19848. data: {
  19849. provider: r,
  19850. platform: P,
  19851. param: s
  19852. },
  19853. success: function success() {
  19854. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19855. t = _ref64.statusCode,
  19856. s = _ref64.data;
  19857. return !t || t >= 400 ? n(new ne({
  19858. code: s.code || "SYS_ERR",
  19859. message: s.message || "request:fail"
  19860. })) : e({
  19861. result: s
  19862. });
  19863. },
  19864. fail: function fail(e) {
  19865. n(new ne({
  19866. code: e.code || e.errCode || "SYS_ERR",
  19867. message: e.message || e.errMsg || "request:fail"
  19868. }));
  19869. }
  19870. });
  19871. });
  19872. }));
  19873. case 5:
  19874. case "end":
  19875. return _context54.stop();
  19876. }
  19877. }
  19878. }, _callee54, this);
  19879. }));
  19880. return _Ct.apply(this, arguments);
  19881. }
  19882. var Tt = [{
  19883. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  19884. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  19885. mode: "append"
  19886. }];
  19887. var Pt = /[\\^$.*+?()[\]{}|]/g,
  19888. At = RegExp(Pt.source);
  19889. function Et(e, t, n) {
  19890. return e.replace(new RegExp((s = t) && At.test(s) ? s.replace(Pt, "\\$&") : s, "g"), n);
  19891. var s;
  19892. }
  19893. var Ot = "none",
  19894. xt = "request",
  19895. Rt = "response",
  19896. Ut = "both";
  19897. var Lt = /*#__PURE__*/function () {
  19898. function Lt() {
  19899. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19900. e = _ref19.secretType,
  19901. t = _ref19.uniCloudIns;
  19902. (0, _classCallCheck2.default)(this, Lt);
  19903. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  19904. var _this$uniCloudIns$con = this.uniCloudIns.config,
  19905. n = _this$uniCloudIns$con.provider,
  19906. s = _this$uniCloudIns$con.spaceId;
  19907. var r;
  19908. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  19909. }
  19910. (0, _createClass2.default)(Lt, [{
  19911. key: "getSystemInfo",
  19912. value: function getSystemInfo() {
  19913. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  19914. }
  19915. }, {
  19916. key: "appId",
  19917. get: function get() {
  19918. return this.getSystemInfo().appId;
  19919. }
  19920. }, {
  19921. key: "deviceId",
  19922. get: function get() {
  19923. return this.getSystemInfo().deviceId;
  19924. }
  19925. }, {
  19926. key: "encryptData",
  19927. value: function () {
  19928. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  19929. return _regenerator.default.wrap(function _callee34$(_context34) {
  19930. while (1) {
  19931. switch (_context34.prev = _context34.next) {
  19932. case 0:
  19933. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  19934. case 1:
  19935. case "end":
  19936. return _context34.stop();
  19937. }
  19938. }
  19939. }, _callee34, this);
  19940. }));
  19941. function encryptData(_x31) {
  19942. return _encryptData.apply(this, arguments);
  19943. }
  19944. return encryptData;
  19945. }()
  19946. }, {
  19947. key: "decryptResult",
  19948. value: function () {
  19949. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  19950. var _ref20, t, n;
  19951. return _regenerator.default.wrap(function _callee35$(_context35) {
  19952. while (1) {
  19953. switch (_context35.prev = _context35.next) {
  19954. case 0:
  19955. if (!(this.secretType === Ot)) {
  19956. _context35.next = 2;
  19957. break;
  19958. }
  19959. return _context35.abrupt("return", e);
  19960. case 2:
  19961. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  19962. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  19963. case 4:
  19964. case "end":
  19965. return _context35.stop();
  19966. }
  19967. }
  19968. }, _callee35, this);
  19969. }));
  19970. function decryptResult(_x32) {
  19971. return _decryptResult.apply(this, arguments);
  19972. }
  19973. return decryptResult;
  19974. }()
  19975. }, {
  19976. key: "wrapVerifyClientCallFunction",
  19977. value: function wrapVerifyClientCallFunction(e) {
  19978. var t = this;
  19979. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  19980. var _ref22,
  19981. n,
  19982. _ref22$data,
  19983. s,
  19984. r,
  19985. _args36 = arguments;
  19986. return _regenerator.default.wrap(function _callee36$(_context36) {
  19987. while (1) {
  19988. switch (_context36.prev = _context36.next) {
  19989. case 0:
  19990. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  19991. _context36.next = 3;
  19992. return t.prepare();
  19993. case 3:
  19994. _context36.next = 5;
  19995. return t.platformGetSignOption();
  19996. case 5:
  19997. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  19998. _context36.next = 8;
  19999. return e({
  20000. name: n,
  20001. data: s
  20002. });
  20003. case 8:
  20004. r = _context36.sent;
  20005. _context36.t0 = t.isClientKeyNotFound(r);
  20006. if (!_context36.t0) {
  20007. _context36.next = 19;
  20008. break;
  20009. }
  20010. _context36.next = 13;
  20011. return t.prepare({
  20012. forceUpdate: !0
  20013. });
  20014. case 13:
  20015. _context36.next = 15;
  20016. return t.platformGetSignOption();
  20017. case 15:
  20018. s._uniCloudOptions = _context36.sent;
  20019. _context36.next = 18;
  20020. return e({
  20021. name: n,
  20022. data: s
  20023. });
  20024. case 18:
  20025. r = _context36.sent;
  20026. case 19:
  20027. return _context36.abrupt("return", r);
  20028. case 20:
  20029. case "end":
  20030. return _context36.stop();
  20031. }
  20032. }
  20033. }, _callee36);
  20034. }));
  20035. }
  20036. }, {
  20037. key: "wrapEncryptDataCallFunction",
  20038. value: function wrapEncryptDataCallFunction(e) {
  20039. var t = this;
  20040. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  20041. var _ref24,
  20042. n,
  20043. _ref24$data,
  20044. s,
  20045. r,
  20046. i,
  20047. _r3,
  20048. _args37 = arguments;
  20049. return _regenerator.default.wrap(function _callee37$(_context37) {
  20050. while (1) {
  20051. switch (_context37.prev = _context37.next) {
  20052. case 0:
  20053. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  20054. _context37.next = 3;
  20055. return t.prepare();
  20056. case 3:
  20057. _context37.next = 5;
  20058. return t.encryptData(s);
  20059. case 5:
  20060. r = _context37.sent;
  20061. _context37.next = 8;
  20062. return e({
  20063. name: n,
  20064. data: r
  20065. });
  20066. case 8:
  20067. i = _context37.sent;
  20068. if (!t.isClientKeyNotFound(i)) {
  20069. _context37.next = 21;
  20070. break;
  20071. }
  20072. _context37.next = 12;
  20073. return t.prepare({
  20074. forceUpdate: !0
  20075. });
  20076. case 12:
  20077. _context37.next = 14;
  20078. return t.encryptData(s);
  20079. case 14:
  20080. _r3 = _context37.sent;
  20081. _context37.next = 17;
  20082. return t.platformGetSignOption();
  20083. case 17:
  20084. s._uniCloudOptions = _context37.sent;
  20085. _context37.next = 20;
  20086. return e({
  20087. name: n,
  20088. data: _r3
  20089. });
  20090. case 20:
  20091. i = _context37.sent;
  20092. case 21:
  20093. _context37.next = 23;
  20094. return t.decryptResult(i.result);
  20095. case 23:
  20096. i.result = _context37.sent;
  20097. return _context37.abrupt("return", i);
  20098. case 25:
  20099. case "end":
  20100. return _context37.stop();
  20101. }
  20102. }
  20103. }, _callee37);
  20104. }));
  20105. }
  20106. }]);
  20107. return Lt;
  20108. }();
  20109. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  20110. function Nt(e) {
  20111. return parseInt(e) === e;
  20112. }
  20113. function Dt(e) {
  20114. if (!Nt(e.length)) return !1;
  20115. for (var t = 0; t < e.length; t++) {
  20116. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  20117. }
  20118. return !0;
  20119. }
  20120. function Ft(e, t) {
  20121. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  20122. if (Array.isArray(e)) {
  20123. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  20124. return new Uint8Array(e);
  20125. }
  20126. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  20127. throw new Error("unsupported array-like object");
  20128. }
  20129. function qt(e) {
  20130. return new Uint8Array(e);
  20131. }
  20132. function Mt(e, t, n, s, r) {
  20133. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  20134. }
  20135. var Kt,
  20136. jt = {
  20137. toBytes: function toBytes(e) {
  20138. var t = [],
  20139. n = 0;
  20140. for (e = encodeURI(e); n < e.length;) {
  20141. var s = e.charCodeAt(n++);
  20142. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  20143. }
  20144. return Ft(t);
  20145. },
  20146. fromBytes: function fromBytes(e) {
  20147. for (var t = [], n = 0; n < e.length;) {
  20148. var s = e[n];
  20149. 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);
  20150. }
  20151. return t.join("");
  20152. }
  20153. },
  20154. Bt = (Kt = "0123456789abcdef", {
  20155. toBytes: function toBytes(e) {
  20156. for (var t = [], n = 0; n < e.length; n += 2) {
  20157. t.push(parseInt(e.substr(n, 2), 16));
  20158. }
  20159. return t;
  20160. },
  20161. fromBytes: function fromBytes(e) {
  20162. for (var t = [], n = 0; n < e.length; n++) {
  20163. var s = e[n];
  20164. t.push(Kt[(240 & s) >> 4] + Kt[15 & s]);
  20165. }
  20166. return t.join("");
  20167. }
  20168. }),
  20169. $t = {
  20170. 16: 10,
  20171. 24: 12,
  20172. 32: 14
  20173. },
  20174. 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],
  20175. 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],
  20176. 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],
  20177. 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],
  20178. 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],
  20179. 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],
  20180. 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],
  20181. 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],
  20182. 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],
  20183. 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],
  20184. 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],
  20185. 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],
  20186. 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],
  20187. 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],
  20188. 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];
  20189. function on(e) {
  20190. for (var t = [], n = 0; n < e.length; n += 4) {
  20191. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  20192. }
  20193. return t;
  20194. }
  20195. var an = /*#__PURE__*/function () {
  20196. function an(e) {
  20197. (0, _classCallCheck2.default)(this, an);
  20198. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  20199. Object.defineProperty(this, "key", {
  20200. value: Ft(e, !0)
  20201. }), this._prepare();
  20202. }
  20203. (0, _createClass2.default)(an, [{
  20204. key: "_prepare",
  20205. value: function _prepare() {
  20206. var e = $t[this.key.length];
  20207. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  20208. this._Ke = [], this._Kd = [];
  20209. for (var t = 0; t <= e; t++) {
  20210. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  20211. }
  20212. var n,
  20213. s = 4 * (e + 1),
  20214. r = this.key.length / 4,
  20215. i = on(this.key);
  20216. for (t = 0; t < r; t++) {
  20217. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  20218. }
  20219. for (var o, a = 0, c = r; c < s;) {
  20220. 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++) {
  20221. i[t] ^= i[t - 1];
  20222. } else {
  20223. for (t = 1; t < r / 2; t++) {
  20224. i[t] ^= i[t - 1];
  20225. }
  20226. 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;
  20227. for (t = r / 2 + 1; t < r; t++) {
  20228. i[t] ^= i[t - 1];
  20229. }
  20230. }
  20231. for (t = 0; t < r && c < s;) {
  20232. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  20233. }
  20234. }
  20235. for (var u = 1; u < e; u++) {
  20236. for (var h = 0; h < 4; h++) {
  20237. o = this._Kd[u][h], this._Kd[u][h] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  20238. }
  20239. }
  20240. }
  20241. }, {
  20242. key: "encrypt",
  20243. value: function encrypt(e) {
  20244. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  20245. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  20246. s[r] ^= this._Ke[0][r];
  20247. }
  20248. for (var i = 1; i < t; i++) {
  20249. for (r = 0; r < 4; r++) {
  20250. 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];
  20251. }
  20252. s = n.slice();
  20253. }
  20254. var o,
  20255. a = qt(16);
  20256. for (r = 0; r < 4; r++) {
  20257. 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);
  20258. }
  20259. return a;
  20260. }
  20261. }, {
  20262. key: "decrypt",
  20263. value: function decrypt(e) {
  20264. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  20265. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  20266. s[r] ^= this._Kd[0][r];
  20267. }
  20268. for (var i = 1; i < t; i++) {
  20269. for (r = 0; r < 4; r++) {
  20270. 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];
  20271. }
  20272. s = n.slice();
  20273. }
  20274. var o,
  20275. a = qt(16);
  20276. for (r = 0; r < 4; r++) {
  20277. 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);
  20278. }
  20279. return a;
  20280. }
  20281. }]);
  20282. return an;
  20283. }();
  20284. var cn = /*#__PURE__*/function () {
  20285. function cn(e) {
  20286. (0, _classCallCheck2.default)(this, cn);
  20287. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  20288. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  20289. }
  20290. (0, _createClass2.default)(cn, [{
  20291. key: "encrypt",
  20292. value: function encrypt(e) {
  20293. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  20294. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  20295. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.encrypt(n), t, s);
  20296. }
  20297. return t;
  20298. }
  20299. }, {
  20300. key: "decrypt",
  20301. value: function decrypt(e) {
  20302. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  20303. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  20304. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.decrypt(n), t, s);
  20305. }
  20306. return t;
  20307. }
  20308. }]);
  20309. return cn;
  20310. }();
  20311. var un = /*#__PURE__*/function () {
  20312. function un(e, t) {
  20313. (0, _classCallCheck2.default)(this, un);
  20314. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  20315. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  20316. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  20317. } else t = qt(16);
  20318. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  20319. }
  20320. (0, _createClass2.default)(un, [{
  20321. key: "encrypt",
  20322. value: function encrypt(e) {
  20323. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  20324. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  20325. Mt(e, n, 0, s, s + 16);
  20326. for (var r = 0; r < 16; r++) {
  20327. n[r] ^= this._lastCipherblock[r];
  20328. }
  20329. this._lastCipherblock = this._aes.encrypt(n), Mt(this._lastCipherblock, t, s);
  20330. }
  20331. return t;
  20332. }
  20333. }, {
  20334. key: "decrypt",
  20335. value: function decrypt(e) {
  20336. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  20337. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  20338. Mt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  20339. for (var r = 0; r < 16; r++) {
  20340. t[s + r] = n[r] ^ this._lastCipherblock[r];
  20341. }
  20342. Mt(e, this._lastCipherblock, 0, s, s + 16);
  20343. }
  20344. return t;
  20345. }
  20346. }]);
  20347. return un;
  20348. }();
  20349. var hn = /*#__PURE__*/function () {
  20350. function hn(e, t, n) {
  20351. (0, _classCallCheck2.default)(this, hn);
  20352. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  20353. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  20354. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  20355. } else t = qt(16);
  20356. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  20357. }
  20358. (0, _createClass2.default)(hn, [{
  20359. key: "encrypt",
  20360. value: function encrypt(e) {
  20361. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  20362. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  20363. t = this._aes.encrypt(this._shiftRegister);
  20364. for (var r = 0; r < this.segmentSize; r++) {
  20365. n[s + r] ^= t[r];
  20366. }
  20367. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  20368. }
  20369. return n;
  20370. }
  20371. }, {
  20372. key: "decrypt",
  20373. value: function decrypt(e) {
  20374. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  20375. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  20376. t = this._aes.encrypt(this._shiftRegister);
  20377. for (var r = 0; r < this.segmentSize; r++) {
  20378. n[s + r] ^= t[r];
  20379. }
  20380. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  20381. }
  20382. return n;
  20383. }
  20384. }]);
  20385. return hn;
  20386. }();
  20387. var ln = /*#__PURE__*/function () {
  20388. function ln(e, t) {
  20389. (0, _classCallCheck2.default)(this, ln);
  20390. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  20391. if (this.description = "Output Feedback", this.name = "ofb", t) {
  20392. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  20393. } else t = qt(16);
  20394. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  20395. }
  20396. (0, _createClass2.default)(ln, [{
  20397. key: "encrypt",
  20398. value: function encrypt(e) {
  20399. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  20400. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  20401. }
  20402. return t;
  20403. }
  20404. }, {
  20405. key: "decrypt",
  20406. value: function decrypt(e) {
  20407. return this.encrypt(e);
  20408. }
  20409. }]);
  20410. return ln;
  20411. }();
  20412. var dn = /*#__PURE__*/function () {
  20413. function dn(e) {
  20414. (0, _classCallCheck2.default)(this, dn);
  20415. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  20416. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  20417. }
  20418. (0, _createClass2.default)(dn, [{
  20419. key: "setValue",
  20420. value: function setValue(e) {
  20421. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  20422. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  20423. for (var t = 15; t >= 0; --t) {
  20424. this._counter[t] = e % 256, e = parseInt(e / 256);
  20425. }
  20426. }
  20427. }, {
  20428. key: "setBytes",
  20429. value: function setBytes(e) {
  20430. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  20431. this._counter = e;
  20432. }
  20433. }, {
  20434. key: "increment",
  20435. value: function increment() {
  20436. for (var e = 15; e >= 0; e--) {
  20437. if (255 !== this._counter[e]) {
  20438. this._counter[e]++;
  20439. break;
  20440. }
  20441. this._counter[e] = 0;
  20442. }
  20443. }
  20444. }]);
  20445. return dn;
  20446. }();
  20447. var pn = /*#__PURE__*/function () {
  20448. function pn(e, t) {
  20449. (0, _classCallCheck2.default)(this, pn);
  20450. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  20451. 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);
  20452. }
  20453. (0, _createClass2.default)(pn, [{
  20454. key: "encrypt",
  20455. value: function encrypt(e) {
  20456. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  20457. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  20458. }
  20459. return t;
  20460. }
  20461. }, {
  20462. key: "decrypt",
  20463. value: function decrypt(e) {
  20464. return this.encrypt(e);
  20465. }
  20466. }]);
  20467. return pn;
  20468. }();
  20469. var fn = {
  20470. AES: an,
  20471. Counter: dn,
  20472. ModeOfOperation: {
  20473. ecb: cn,
  20474. cbc: un,
  20475. cfb: hn,
  20476. ofb: ln,
  20477. ctr: pn
  20478. },
  20479. utils: {
  20480. hex: Bt,
  20481. utf8: jt
  20482. },
  20483. padding: {
  20484. pkcs7: {
  20485. pad: function pad(e) {
  20486. var t = 16 - (e = Ft(e, !0)).length % 16,
  20487. n = qt(e.length + t);
  20488. Mt(e, n);
  20489. for (var s = e.length; s < n.length; s++) {
  20490. n[s] = t;
  20491. }
  20492. return n;
  20493. },
  20494. strip: function strip(e) {
  20495. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  20496. var t = e[e.length - 1];
  20497. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  20498. for (var n = e.length - t, s = 0; s < t; s++) {
  20499. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  20500. }
  20501. var r = qt(n);
  20502. return Mt(e, r, 0, 0, n), r;
  20503. }
  20504. }
  20505. },
  20506. _arrayTest: {
  20507. coerceArray: Ft,
  20508. createArray: qt,
  20509. copyArray: Mt
  20510. }
  20511. };
  20512. function gn(e, t, n) {
  20513. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  20514. r = fn.utils.utf8.toBytes(n),
  20515. i = fn.utils.utf8.toBytes(e),
  20516. o = new fn.ModeOfOperation.cbc(s, r),
  20517. a = fn.padding.pkcs7.pad(i),
  20518. c = o.encrypt(a);
  20519. return uni.arrayBufferToBase64(c);
  20520. }
  20521. var mn = {
  20522. code: 2e4,
  20523. message: "System error"
  20524. },
  20525. yn = {
  20526. code: 20101,
  20527. message: "Invalid client"
  20528. },
  20529. _n = {
  20530. code: 20102,
  20531. message: "Get encrypt key failed"
  20532. },
  20533. wn = {
  20534. 10001: "Secure network is not supported on current playground or unimpsdk",
  20535. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  20536. 10009: "Encrypt payload failed",
  20537. 10010: "Decrypt response failed"
  20538. };
  20539. function vn(e) {
  20540. var _ref25 = e || {},
  20541. t = _ref25.errSubject,
  20542. n = _ref25.subject,
  20543. s = _ref25.errCode,
  20544. r = _ref25.errMsg,
  20545. i = _ref25.code,
  20546. o = _ref25.message,
  20547. a = _ref25.cause;
  20548. return new ne({
  20549. subject: t || n || "uni-secure-network",
  20550. code: s || i || mn.code,
  20551. message: r || o,
  20552. cause: a
  20553. });
  20554. }
  20555. var In,
  20556. Sn,
  20557. bn = null;
  20558. var kn = /*#__PURE__*/function (_Lt) {
  20559. (0, _inherits2.default)(kn, _Lt);
  20560. var _super9 = _createSuper(kn);
  20561. function kn(e) {
  20562. var _this14;
  20563. (0, _classCallCheck2.default)(this, kn);
  20564. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  20565. return _this14;
  20566. }
  20567. (0, _createClass2.default)(kn, [{
  20568. key: "isLogin",
  20569. value: function isLogin() {
  20570. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  20571. }
  20572. }, {
  20573. key: "prepare",
  20574. value: function () {
  20575. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  20576. return _regenerator.default.wrap(function _callee38$(_context38) {
  20577. while (1) {
  20578. switch (_context38.prev = _context38.next) {
  20579. case 0:
  20580. if (this.isLogin()) {
  20581. _context38.next = 7;
  20582. break;
  20583. }
  20584. if (this.scopedGlobalCache.initPromise) {
  20585. _context38.next = 3;
  20586. break;
  20587. }
  20588. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  20589. case 3:
  20590. _context38.next = 5;
  20591. return this.scopedGlobalCache.initPromise;
  20592. case 5:
  20593. if (this.isLogin()) {
  20594. _context38.next = 7;
  20595. break;
  20596. }
  20597. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  20598. case 7:
  20599. case "end":
  20600. return _context38.stop();
  20601. }
  20602. }
  20603. }, _callee38, this);
  20604. }));
  20605. function prepare() {
  20606. return _prepare2.apply(this, arguments);
  20607. }
  20608. return prepare;
  20609. }()
  20610. }, {
  20611. key: "getUserEncryptKey",
  20612. value: function () {
  20613. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  20614. var _this15 = this;
  20615. var e;
  20616. return _regenerator.default.wrap(function _callee39$(_context39) {
  20617. while (1) {
  20618. switch (_context39.prev = _context39.next) {
  20619. case 0:
  20620. if (!this.userEncryptKey) {
  20621. _context39.next = 2;
  20622. break;
  20623. }
  20624. return _context39.abrupt("return", this.userEncryptKey);
  20625. case 2:
  20626. if (!(bn && bn.expireTime)) {
  20627. _context39.next = 6;
  20628. break;
  20629. }
  20630. e = Date.now();
  20631. if (!(bn.expireTime - e > 0)) {
  20632. _context39.next = 6;
  20633. break;
  20634. }
  20635. return _context39.abrupt("return", (this.userEncryptKey = bn, this.userEncryptKey));
  20636. case 6:
  20637. return _context39.abrupt("return", new Promise(function (e, t) {
  20638. uni.getUserCryptoManager().getLatestUserKey({
  20639. success: function success(t) {
  20640. bn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  20641. },
  20642. fail: function fail(e) {
  20643. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  20644. cause: e
  20645. })));
  20646. }
  20647. });
  20648. }));
  20649. case 7:
  20650. case "end":
  20651. return _context39.stop();
  20652. }
  20653. }
  20654. }, _callee39, this);
  20655. }));
  20656. function getUserEncryptKey() {
  20657. return _getUserEncryptKey.apply(this, arguments);
  20658. }
  20659. return getUserEncryptKey;
  20660. }()
  20661. }, {
  20662. key: "getWxAppId",
  20663. value: function getWxAppId() {
  20664. return wx.getAccountInfoSync().miniProgram.appId;
  20665. }
  20666. }, {
  20667. key: "platformGetSignOption",
  20668. value: function () {
  20669. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  20670. var _yield$this$getUserEn, e, t, n;
  20671. return _regenerator.default.wrap(function _callee40$(_context40) {
  20672. while (1) {
  20673. switch (_context40.prev = _context40.next) {
  20674. case 0:
  20675. _context40.next = 2;
  20676. return this.getUserEncryptKey();
  20677. case 2:
  20678. _yield$this$getUserEn = _context40.sent;
  20679. e = _yield$this$getUserEn.encryptKey;
  20680. t = _yield$this$getUserEn.iv;
  20681. n = _yield$this$getUserEn.version;
  20682. return _context40.abrupt("return", {
  20683. verifyClientSign: gn(JSON.stringify({
  20684. data: JSON.stringify({}),
  20685. appId: this.appId,
  20686. deviceId: this.deviceId,
  20687. wxAppId: this.getWxAppId(),
  20688. simulator: "devtools" === ce().platform,
  20689. timestamp: Date.now()
  20690. }), e, t),
  20691. encryptKeyId: n,
  20692. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  20693. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  20694. });
  20695. case 7:
  20696. case "end":
  20697. return _context40.stop();
  20698. }
  20699. }
  20700. }, _callee40, this);
  20701. }));
  20702. function platformGetSignOption() {
  20703. return _platformGetSignOption.apply(this, arguments);
  20704. }
  20705. return platformGetSignOption;
  20706. }()
  20707. }, {
  20708. key: "platformEncryptData",
  20709. value: function () {
  20710. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  20711. var _yield$this$getUserEn2, t, n, s, r;
  20712. return _regenerator.default.wrap(function _callee41$(_context41) {
  20713. while (1) {
  20714. switch (_context41.prev = _context41.next) {
  20715. case 0:
  20716. _context41.next = 2;
  20717. return this.getUserEncryptKey();
  20718. case 2:
  20719. _yield$this$getUserEn2 = _context41.sent;
  20720. t = _yield$this$getUserEn2.encryptKey;
  20721. n = _yield$this$getUserEn2.iv;
  20722. s = _yield$this$getUserEn2.version;
  20723. r = {
  20724. secretType: this.secretType,
  20725. encryptKeyId: s,
  20726. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  20727. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  20728. };
  20729. return _context41.abrupt("return", this.secretType === Rt ? {
  20730. content: e,
  20731. _uniCloudOptions: r
  20732. } : {
  20733. content: gn(JSON.stringify({
  20734. data: JSON.stringify(e),
  20735. appId: this.appId,
  20736. deviceId: this.deviceId,
  20737. wxAppId: this.getWxAppId(),
  20738. simulator: "devtools" === ce().platform,
  20739. timestamp: Date.now()
  20740. }), t, n),
  20741. _uniCloudOptions: r
  20742. });
  20743. case 8:
  20744. case "end":
  20745. return _context41.stop();
  20746. }
  20747. }
  20748. }, _callee41, this);
  20749. }));
  20750. function platformEncryptData(_x33) {
  20751. return _platformEncryptData.apply(this, arguments);
  20752. }
  20753. return platformEncryptData;
  20754. }()
  20755. }, {
  20756. key: "platformDecryptResult",
  20757. value: function () {
  20758. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  20759. var t, _yield$this$getUserEn3, n, s;
  20760. return _regenerator.default.wrap(function _callee42$(_context42) {
  20761. while (1) {
  20762. switch (_context42.prev = _context42.next) {
  20763. case 0:
  20764. t = e.content;
  20765. _context42.next = 3;
  20766. return this.getUserEncryptKey();
  20767. case 3:
  20768. _yield$this$getUserEn3 = _context42.sent;
  20769. n = _yield$this$getUserEn3.encryptKey;
  20770. s = _yield$this$getUserEn3.iv;
  20771. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  20772. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  20773. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  20774. i = fn.utils.utf8.toBytes(n),
  20775. o = new fn.ModeOfOperation.cbc(r, i),
  20776. a = fn.padding.pkcs7.strip(o.decrypt(s));
  20777. return fn.utils.utf8.fromBytes(a);
  20778. }(t, n, s)));
  20779. case 7:
  20780. case "end":
  20781. return _context42.stop();
  20782. }
  20783. }
  20784. }, _callee42, this);
  20785. }));
  20786. function platformDecryptResult(_x34) {
  20787. return _platformDecryptResult.apply(this, arguments);
  20788. }
  20789. return platformDecryptResult;
  20790. }()
  20791. }, {
  20792. key: "isClientKeyNotFound",
  20793. value: function isClientKeyNotFound() {
  20794. return !1;
  20795. }
  20796. }]);
  20797. return kn;
  20798. }(Lt);
  20799. function Cn(e) {
  20800. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  20801. n = {};
  20802. var _loop = function _loop(_s10) {
  20803. var r = t[_s10];
  20804. n[r] = function () {
  20805. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  20806. t[_key] = arguments[_key];
  20807. }
  20808. return new Promise(function (n, s) {
  20809. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  20810. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  20811. e = _ref26.type,
  20812. t = _ref26.data,
  20813. r = _ref26.errCode,
  20814. i = _ref26.errMsg,
  20815. o = _ref26.errSubject,
  20816. a = _ref26.message;
  20817. "success" === e ? n(t) : s(vn({
  20818. errCode: r,
  20819. errMsg: wn[r] || i || a,
  20820. errSubject: o
  20821. }));
  20822. }])) : s(vn({
  20823. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  20824. }));
  20825. });
  20826. };
  20827. };
  20828. for (var _s10 = 0; _s10 < t.length; _s10++) {
  20829. _loop(_s10);
  20830. }
  20831. return n;
  20832. }
  20833. var Tn = /*#__PURE__*/function (_Lt2) {
  20834. (0, _inherits2.default)(Tn, _Lt2);
  20835. var _super10 = _createSuper(Tn);
  20836. function Tn(e) {
  20837. var _this16;
  20838. (0, _classCallCheck2.default)(this, Tn);
  20839. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Cn(uni.requireNativePlugin("plus"))), _this16.systemInfo = In || (In = ce());
  20840. return _this16;
  20841. }
  20842. (0, _createClass2.default)(Tn, [{
  20843. key: "hasClientKey",
  20844. value: function () {
  20845. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  20846. return _regenerator.default.wrap(function _callee43$(_context43) {
  20847. while (1) {
  20848. switch (_context43.prev = _context43.next) {
  20849. case 0:
  20850. _context43.next = 2;
  20851. return this.appUtils.hasClientKey({
  20852. provider: this.provider,
  20853. spaceId: this.spaceId
  20854. });
  20855. case 2:
  20856. this._hasClientKey = _context43.sent;
  20857. return _context43.abrupt("return", this._hasClientKey);
  20858. case 4:
  20859. case "end":
  20860. return _context43.stop();
  20861. }
  20862. }
  20863. }, _callee43, this);
  20864. }));
  20865. function hasClientKey() {
  20866. return _hasClientKey.apply(this, arguments);
  20867. }
  20868. return hasClientKey;
  20869. }()
  20870. }, {
  20871. key: "getAppClientKey",
  20872. value: function () {
  20873. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  20874. var _yield$this$appUtils$, e, t, n, s, r;
  20875. return _regenerator.default.wrap(function _callee44$(_context44) {
  20876. while (1) {
  20877. switch (_context44.prev = _context44.next) {
  20878. case 0:
  20879. _context44.next = 2;
  20880. return this.appUtils.encryptGetClientKeyPayload({
  20881. data: JSON.stringify({})
  20882. });
  20883. case 2:
  20884. _yield$this$appUtils$ = _context44.sent;
  20885. e = _yield$this$appUtils$.data;
  20886. t = _yield$this$appUtils$.key;
  20887. _context44.next = 7;
  20888. return this.uniCloudIns.callFunction({
  20889. name: "DCloud-clientDB",
  20890. data: {
  20891. redirectTo: "encryption",
  20892. action: "getAppClientKey",
  20893. data: e,
  20894. key: t
  20895. }
  20896. });
  20897. case 7:
  20898. _context44.t0 = _context44.sent.result;
  20899. if (_context44.t0) {
  20900. _context44.next = 10;
  20901. break;
  20902. }
  20903. _context44.t0 = {};
  20904. case 10:
  20905. n = _context44.t0;
  20906. if (!(0 !== n.errCode)) {
  20907. _context44.next = 13;
  20908. break;
  20909. }
  20910. throw function (e) {
  20911. return new ne({
  20912. subject: e.errSubject || "uni-secure-network",
  20913. code: e.errCode || e.code || mn.code,
  20914. message: e.errMsg || e.message
  20915. });
  20916. }(n);
  20917. case 13:
  20918. s = n.clientKey, r = n.key;
  20919. _context44.next = 16;
  20920. return this.appUtils.setClientKey({
  20921. provider: this.provider,
  20922. spaceId: this.spaceId,
  20923. clientKey: s,
  20924. key: r
  20925. });
  20926. case 16:
  20927. case "end":
  20928. return _context44.stop();
  20929. }
  20930. }
  20931. }, _callee44, this);
  20932. }));
  20933. function getAppClientKey() {
  20934. return _getAppClientKey.apply(this, arguments);
  20935. }
  20936. return getAppClientKey;
  20937. }()
  20938. }, {
  20939. key: "ensureClientKey",
  20940. value: function () {
  20941. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  20942. var _this17 = this;
  20943. var _ref27,
  20944. _ref27$forceUpdate,
  20945. e,
  20946. _args45 = arguments;
  20947. return _regenerator.default.wrap(function _callee45$(_context45) {
  20948. while (1) {
  20949. switch (_context45.prev = _context45.next) {
  20950. case 0:
  20951. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  20952. _context45.t1 = !0;
  20953. _context45.next = 4;
  20954. return this.hasClientKey();
  20955. case 4:
  20956. _context45.t2 = _context45.sent;
  20957. _context45.t0 = _context45.t1 !== _context45.t2;
  20958. if (_context45.t0) {
  20959. _context45.next = 8;
  20960. break;
  20961. }
  20962. _context45.t0 = e;
  20963. case 8:
  20964. if (!_context45.t0) {
  20965. _context45.next = 10;
  20966. break;
  20967. }
  20968. 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) {
  20969. _this17.scopedGlobalCache.initStatus = p;
  20970. }).catch(function (e) {
  20971. throw _this17.scopedGlobalCache.initStatus = f, e;
  20972. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  20973. case 10:
  20974. case "end":
  20975. return _context45.stop();
  20976. }
  20977. }
  20978. }, _callee45, this);
  20979. }));
  20980. function ensureClientKey() {
  20981. return _ensureClientKey.apply(this, arguments);
  20982. }
  20983. return ensureClientKey;
  20984. }()
  20985. }, {
  20986. key: "prepare",
  20987. value: function () {
  20988. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  20989. var _ref28,
  20990. _ref28$forceUpdate,
  20991. e,
  20992. _args46 = arguments;
  20993. return _regenerator.default.wrap(function _callee46$(_context46) {
  20994. while (1) {
  20995. switch (_context46.prev = _context46.next) {
  20996. case 0:
  20997. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  20998. _context46.next = 3;
  20999. return this.ensureClientKey({
  21000. forceUpdate: e
  21001. });
  21002. case 3:
  21003. case "end":
  21004. return _context46.stop();
  21005. }
  21006. }
  21007. }, _callee46, this);
  21008. }));
  21009. function prepare() {
  21010. return _prepare3.apply(this, arguments);
  21011. }
  21012. return prepare;
  21013. }()
  21014. }, {
  21015. key: "platformGetSignOption",
  21016. value: function () {
  21017. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  21018. var _yield$this$appUtils$2, e, t;
  21019. return _regenerator.default.wrap(function _callee47$(_context47) {
  21020. while (1) {
  21021. switch (_context47.prev = _context47.next) {
  21022. case 0:
  21023. _context47.next = 2;
  21024. return this.appUtils.encrypt({
  21025. provider: this.provider,
  21026. spaceId: this.spaceId,
  21027. data: JSON.stringify({})
  21028. });
  21029. case 2:
  21030. _yield$this$appUtils$2 = _context47.sent;
  21031. e = _yield$this$appUtils$2.data;
  21032. t = _yield$this$appUtils$2.key;
  21033. return _context47.abrupt("return", {
  21034. verifyClientSign: e,
  21035. encryptKeyId: t
  21036. });
  21037. case 6:
  21038. case "end":
  21039. return _context47.stop();
  21040. }
  21041. }
  21042. }, _callee47, this);
  21043. }));
  21044. function platformGetSignOption() {
  21045. return _platformGetSignOption2.apply(this, arguments);
  21046. }
  21047. return platformGetSignOption;
  21048. }()
  21049. }, {
  21050. key: "platformEncryptData",
  21051. value: function () {
  21052. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  21053. var _yield$this$appUtils$3, t, n, s;
  21054. return _regenerator.default.wrap(function _callee48$(_context48) {
  21055. while (1) {
  21056. switch (_context48.prev = _context48.next) {
  21057. case 0:
  21058. _context48.next = 2;
  21059. return this.appUtils.encrypt({
  21060. provider: this.provider,
  21061. spaceId: this.spaceId,
  21062. data: JSON.stringify(e)
  21063. });
  21064. case 2:
  21065. _yield$this$appUtils$3 = _context48.sent;
  21066. t = _yield$this$appUtils$3.data;
  21067. n = _yield$this$appUtils$3.key;
  21068. s = {
  21069. secretType: this.secretType,
  21070. encryptKeyId: n
  21071. };
  21072. return _context48.abrupt("return", this.secretType === Rt ? {
  21073. content: e,
  21074. _uniCloudOptions: s
  21075. } : {
  21076. content: t,
  21077. _uniCloudOptions: s
  21078. });
  21079. case 7:
  21080. case "end":
  21081. return _context48.stop();
  21082. }
  21083. }
  21084. }, _callee48, this);
  21085. }));
  21086. function platformEncryptData(_x35) {
  21087. return _platformEncryptData2.apply(this, arguments);
  21088. }
  21089. return platformEncryptData;
  21090. }()
  21091. }, {
  21092. key: "platformDecryptResult",
  21093. value: function () {
  21094. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  21095. var t, _e$_uniCloudOptions, n, s, r;
  21096. return _regenerator.default.wrap(function _callee49$(_context49) {
  21097. while (1) {
  21098. switch (_context49.prev = _context49.next) {
  21099. case 0:
  21100. t = e.content;
  21101. _e$_uniCloudOptions = e._uniCloudOptions;
  21102. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  21103. s = n.encryptKeyId;
  21104. _context49.next = 6;
  21105. return this.appUtils.decrypt({
  21106. provider: this.provider,
  21107. spaceId: this.spaceId,
  21108. data: t,
  21109. key: s
  21110. });
  21111. case 6:
  21112. r = _context49.sent;
  21113. return _context49.abrupt("return", JSON.parse(r.data));
  21114. case 8:
  21115. case "end":
  21116. return _context49.stop();
  21117. }
  21118. }
  21119. }, _callee49, this);
  21120. }));
  21121. function platformDecryptResult(_x36) {
  21122. return _platformDecryptResult2.apply(this, arguments);
  21123. }
  21124. return platformDecryptResult;
  21125. }()
  21126. }, {
  21127. key: "isClientKeyNotFound",
  21128. value: function isClientKeyNotFound() {
  21129. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  21130. var t = e.result || {};
  21131. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  21132. }
  21133. }]);
  21134. return Tn;
  21135. }(Lt);
  21136. function Pn() {
  21137. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21138. e = _ref29.secretType;
  21139. return e === xt || e === Rt || e === Ut;
  21140. }
  21141. function An() {
  21142. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21143. e = _ref30.name,
  21144. _ref30$data = _ref30.data,
  21145. t = _ref30$data === void 0 ? {} : _ref30$data;
  21146. return "app" === P && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  21147. }
  21148. function En() {
  21149. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21150. e = _ref31.provider,
  21151. t = _ref31.spaceId,
  21152. n = _ref31.functionName;
  21153. var _ce = ce(),
  21154. s = _ce.appId,
  21155. r = _ce.uniPlatform,
  21156. i = _ce.osName;
  21157. var o = r;
  21158. "app" === r && (o = i);
  21159. var a = function () {
  21160. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21161. e = _ref32.provider,
  21162. t = _ref32.spaceId;
  21163. var n = T;
  21164. if (!n) return {};
  21165. e = function (e) {
  21166. return "tencent" === e ? "tcb" : e;
  21167. }(e);
  21168. var s = n.find(function (n) {
  21169. return n.provider === e && n.spaceId === t;
  21170. });
  21171. return s && s.config;
  21172. }({
  21173. provider: e,
  21174. spaceId: t
  21175. });
  21176. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  21177. var c = a.accessControl.function || {},
  21178. u = Object.keys(c);
  21179. if (0 === u.length) return !0;
  21180. var h = function (e, t) {
  21181. var n, s, r;
  21182. for (var _i2 = 0; _i2 < e.length; _i2++) {
  21183. var _o2 = e[_i2];
  21184. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  21185. return e.trim();
  21186. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  21187. }
  21188. return n || s || r;
  21189. }(u, n);
  21190. if (!h) return !1;
  21191. if ((c[h] || []).find(function () {
  21192. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  21193. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  21194. })) return !0;
  21195. 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);
  21196. }
  21197. function On(_ref33) {
  21198. var e = _ref33.functionName,
  21199. t = _ref33.result,
  21200. n = _ref33.logPvd;
  21201. if (b && this.__dev__.debugLog && t && t.requestId) {
  21202. var _s11 = JSON.stringify({
  21203. spaceId: this.config.spaceId,
  21204. functionName: e,
  21205. requestId: t.requestId
  21206. });
  21207. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  21208. }
  21209. }
  21210. function xn(e) {
  21211. var t = e.callFunction,
  21212. n = function n(_n7) {
  21213. var _this18 = this;
  21214. var s = _n7.name;
  21215. _n7.data = kt.call(e, {
  21216. data: _n7.data
  21217. });
  21218. var r = {
  21219. aliyun: "aliyun",
  21220. tencent: "tcb",
  21221. tcb: "tcb"
  21222. }[this.config.provider],
  21223. i = Pn(_n7),
  21224. o = An(_n7),
  21225. a = i || o;
  21226. return t.call(this, _n7).then(function (e) {
  21227. return e.errCode = 0, !a && On.call(_this18, {
  21228. functionName: s,
  21229. result: e,
  21230. logPvd: r
  21231. }), Promise.resolve(e);
  21232. }, function (e) {
  21233. return !a && On.call(_this18, {
  21234. functionName: s,
  21235. result: e,
  21236. logPvd: r
  21237. }), e && e.message && (e.message = function () {
  21238. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21239. _ref34$message = _ref34.message,
  21240. e = _ref34$message === void 0 ? "" : _ref34$message,
  21241. _ref34$extraInfo = _ref34.extraInfo,
  21242. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  21243. _ref34$formatter = _ref34.formatter,
  21244. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  21245. for (var _s12 = 0; _s12 < n.length; _s12++) {
  21246. var _n$_s = n[_s12],
  21247. _r4 = _n$_s.rule,
  21248. _i3 = _n$_s.content,
  21249. _o3 = _n$_s.mode,
  21250. _a = e.match(_r4);
  21251. if (!_a) continue;
  21252. var _c = _i3;
  21253. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  21254. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  21255. }
  21256. for (var _e21 in t) {
  21257. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  21258. }
  21259. return "replace" === _o3 ? _c : e + _c;
  21260. }
  21261. return e;
  21262. }({
  21263. message: "[".concat(_n7.name, "]: ").concat(e.message),
  21264. formatter: Tt,
  21265. extraInfo: {
  21266. functionName: s
  21267. }
  21268. })), Promise.reject(e);
  21269. });
  21270. };
  21271. e.callFunction = function (t) {
  21272. var _e$config = e.config,
  21273. s = _e$config.provider,
  21274. r = _e$config.spaceId,
  21275. i = t.name;
  21276. var o, a;
  21277. 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) {
  21278. var e = _ref35.name,
  21279. _ref35$data = _ref35.data,
  21280. t = _ref35$data === void 0 ? {} : _ref35$data;
  21281. return "mp-weixin" === P && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  21282. }(t)) a = o.call(e, t);else if (Pn(t)) {
  21283. a = new Sn({
  21284. secretType: t.secretType,
  21285. uniCloudIns: e
  21286. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  21287. } else if (En({
  21288. provider: s,
  21289. spaceId: r,
  21290. functionName: i
  21291. })) {
  21292. a = new Sn({
  21293. secretType: t.secretType,
  21294. uniCloudIns: e
  21295. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  21296. } else a = o(t);
  21297. return Object.defineProperty(a, "result", {
  21298. get: function get() {
  21299. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  21300. }
  21301. }), a;
  21302. };
  21303. }
  21304. Sn = "mp-weixin" !== P && "app" !== P ? /*#__PURE__*/function () {
  21305. function _class2() {
  21306. (0, _classCallCheck2.default)(this, _class2);
  21307. throw vn({
  21308. message: "Platform ".concat(P, " is not supported by secure network")
  21309. });
  21310. }
  21311. return (0, _createClass2.default)(_class2);
  21312. }() : C ? "mp-weixin" === P ? kn : Tn : /*#__PURE__*/function () {
  21313. function _class3() {
  21314. (0, _classCallCheck2.default)(this, _class3);
  21315. throw vn({
  21316. message: "Platform ".concat(P, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  21317. });
  21318. }
  21319. return (0, _createClass2.default)(_class3);
  21320. }();
  21321. var Rn = Symbol("CLIENT_DB_INTERNAL");
  21322. function Un(e, t) {
  21323. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  21324. get: function get(e, n, s) {
  21325. if ("_uniClient" === n) return null;
  21326. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  21327. if (n in e || "string" != typeof n) {
  21328. var _t10 = e[n];
  21329. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  21330. }
  21331. return t.get(e, n, s);
  21332. }
  21333. });
  21334. }
  21335. function Ln(e) {
  21336. return {
  21337. on: function on(t, n) {
  21338. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  21339. },
  21340. off: function off(t, n) {
  21341. e[t] = e[t] || [];
  21342. var s = e[t].indexOf(n);
  21343. -1 !== s && e[t].splice(s, 1);
  21344. }
  21345. };
  21346. }
  21347. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  21348. function Dn(e, t) {
  21349. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  21350. }
  21351. function Fn(e) {
  21352. switch (g(e)) {
  21353. case "array":
  21354. return e.map(function (e) {
  21355. return Fn(e);
  21356. });
  21357. case "object":
  21358. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  21359. e[t] = Fn(e[t]);
  21360. }), e;
  21361. case "regexp":
  21362. return {
  21363. $regexp: {
  21364. source: e.source,
  21365. flags: e.flags
  21366. }
  21367. };
  21368. case "date":
  21369. return {
  21370. $date: e.toISOString()
  21371. };
  21372. default:
  21373. return e;
  21374. }
  21375. }
  21376. function qn(e) {
  21377. return e && e.content && e.content.$method;
  21378. }
  21379. var Mn = /*#__PURE__*/function () {
  21380. function Mn(e, t, n) {
  21381. (0, _classCallCheck2.default)(this, Mn);
  21382. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  21383. }
  21384. (0, _createClass2.default)(Mn, [{
  21385. key: "toJSON",
  21386. value: function toJSON() {
  21387. var e = this;
  21388. var t = [e.content];
  21389. for (; e.prevStage;) {
  21390. e = e.prevStage, t.push(e.content);
  21391. }
  21392. return {
  21393. $db: t.reverse().map(function (e) {
  21394. return {
  21395. $method: e.$method,
  21396. $param: Fn(e.$param)
  21397. };
  21398. })
  21399. };
  21400. }
  21401. }, {
  21402. key: "toString",
  21403. value: function toString() {
  21404. return JSON.stringify(this.toJSON());
  21405. }
  21406. }, {
  21407. key: "getAction",
  21408. value: function getAction() {
  21409. var e = this.toJSON().$db.find(function (e) {
  21410. return "action" === e.$method;
  21411. });
  21412. return e && e.$param && e.$param[0];
  21413. }
  21414. }, {
  21415. key: "getCommand",
  21416. value: function getCommand() {
  21417. return {
  21418. $db: this.toJSON().$db.filter(function (e) {
  21419. return "action" !== e.$method;
  21420. })
  21421. };
  21422. }
  21423. }, {
  21424. key: "isAggregate",
  21425. get: function get() {
  21426. var e = this;
  21427. for (; e;) {
  21428. var t = qn(e),
  21429. _n8 = qn(e.prevStage);
  21430. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  21431. e = e.prevStage;
  21432. }
  21433. return !1;
  21434. }
  21435. }, {
  21436. key: "isCommand",
  21437. get: function get() {
  21438. var e = this;
  21439. for (; e;) {
  21440. if ("command" === qn(e)) return !0;
  21441. e = e.prevStage;
  21442. }
  21443. return !1;
  21444. }
  21445. }, {
  21446. key: "isAggregateCommand",
  21447. get: function get() {
  21448. var e = this;
  21449. for (; e;) {
  21450. var t = qn(e),
  21451. _n9 = qn(e.prevStage);
  21452. if ("aggregate" === t && "command" === _n9) return !0;
  21453. e = e.prevStage;
  21454. }
  21455. return !1;
  21456. }
  21457. }, {
  21458. key: "getNextStageFn",
  21459. value: function getNextStageFn(e) {
  21460. var t = this;
  21461. return function () {
  21462. return Kn({
  21463. $method: e,
  21464. $param: Fn(Array.from(arguments))
  21465. }, t, t._database);
  21466. };
  21467. }
  21468. }, {
  21469. key: "count",
  21470. get: function get() {
  21471. return this.isAggregate ? this.getNextStageFn("count") : function () {
  21472. return this._send("count", Array.from(arguments));
  21473. };
  21474. }
  21475. }, {
  21476. key: "remove",
  21477. get: function get() {
  21478. return this.isCommand ? this.getNextStageFn("remove") : function () {
  21479. return this._send("remove", Array.from(arguments));
  21480. };
  21481. }
  21482. }, {
  21483. key: "get",
  21484. value: function get() {
  21485. return this._send("get", Array.from(arguments));
  21486. }
  21487. }, {
  21488. key: "add",
  21489. get: function get() {
  21490. return this.isCommand ? this.getNextStageFn("add") : function () {
  21491. return this._send("add", Array.from(arguments));
  21492. };
  21493. }
  21494. }, {
  21495. key: "update",
  21496. value: function update() {
  21497. return this._send("update", Array.from(arguments));
  21498. }
  21499. }, {
  21500. key: "end",
  21501. value: function end() {
  21502. return this._send("end", Array.from(arguments));
  21503. }
  21504. }, {
  21505. key: "set",
  21506. get: function get() {
  21507. return this.isCommand ? this.getNextStageFn("set") : function () {
  21508. throw new Error("JQL禁止使用set方法");
  21509. };
  21510. }
  21511. }, {
  21512. key: "_send",
  21513. value: function _send(e, t) {
  21514. var n = this.getAction(),
  21515. s = this.getCommand();
  21516. if (s.$db.push({
  21517. $method: e,
  21518. $param: Fn(t)
  21519. }), b) {
  21520. var _e22 = s.$db.find(function (e) {
  21521. return "collection" === e.$method;
  21522. }),
  21523. _t11 = _e22 && _e22.$param;
  21524. _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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  21525. }
  21526. return this._database._callCloudFunction({
  21527. action: n,
  21528. command: s
  21529. });
  21530. }
  21531. }]);
  21532. return Mn;
  21533. }();
  21534. function Kn(e, t, n) {
  21535. return Un(new Mn(e, t, n), {
  21536. get: function get(e, t) {
  21537. var s = "db";
  21538. return e && e.content && (s = e.content.$method), Dn(s, t) ? Kn({
  21539. $method: t
  21540. }, e, n) : function () {
  21541. return Kn({
  21542. $method: t,
  21543. $param: Fn(Array.from(arguments))
  21544. }, e, n);
  21545. };
  21546. }
  21547. });
  21548. }
  21549. function jn(_ref36) {
  21550. var e = _ref36.path,
  21551. t = _ref36.method;
  21552. return /*#__PURE__*/function () {
  21553. function _class4() {
  21554. (0, _classCallCheck2.default)(this, _class4);
  21555. this.param = Array.from(arguments);
  21556. }
  21557. (0, _createClass2.default)(_class4, [{
  21558. key: "toJSON",
  21559. value: function toJSON() {
  21560. return {
  21561. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  21562. return {
  21563. $method: e
  21564. };
  21565. })), [{
  21566. $method: t,
  21567. $param: this.param
  21568. }])
  21569. };
  21570. }
  21571. }, {
  21572. key: "toString",
  21573. value: function toString() {
  21574. return JSON.stringify(this.toJSON());
  21575. }
  21576. }]);
  21577. return _class4;
  21578. }();
  21579. }
  21580. function Bn(e) {
  21581. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21582. return Un(new e(t), {
  21583. get: function get(e, t) {
  21584. return Dn("db", t) ? Kn({
  21585. $method: t
  21586. }, null, e) : function () {
  21587. return Kn({
  21588. $method: t,
  21589. $param: Fn(Array.from(arguments))
  21590. }, null, e);
  21591. };
  21592. }
  21593. });
  21594. }
  21595. var $n = /*#__PURE__*/function (_ref37) {
  21596. (0, _inherits2.default)($n, _ref37);
  21597. var _super11 = _createSuper($n);
  21598. function $n() {
  21599. (0, _classCallCheck2.default)(this, $n);
  21600. return _super11.apply(this, arguments);
  21601. }
  21602. (0, _createClass2.default)($n, [{
  21603. key: "_parseResult",
  21604. value: function _parseResult(e) {
  21605. return this._isJQL ? e.result : e;
  21606. }
  21607. }, {
  21608. key: "_callCloudFunction",
  21609. value: function _callCloudFunction(_ref38) {
  21610. var _this19 = this;
  21611. var e = _ref38.action,
  21612. t = _ref38.command,
  21613. n = _ref38.multiCommand,
  21614. s = _ref38.queryList;
  21615. function r(e, t) {
  21616. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  21617. var _r5 = s[_n10];
  21618. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  21619. }
  21620. }
  21621. var i = this,
  21622. o = this._isJQL ? "databaseForJQL" : "database";
  21623. function a(e) {
  21624. return i._callback("error", [e]), q(M(o, "fail"), e).then(function () {
  21625. return q(M(o, "complete"), e);
  21626. }).then(function () {
  21627. return r(null, e), Q(B, {
  21628. type: z,
  21629. content: e
  21630. }), Promise.reject(e);
  21631. });
  21632. }
  21633. var c = q(M(o, "invoke")),
  21634. u = this._uniClient;
  21635. return c.then(function () {
  21636. return u.callFunction({
  21637. name: "DCloud-clientDB",
  21638. type: l,
  21639. data: {
  21640. action: e,
  21641. command: t,
  21642. multiCommand: n
  21643. }
  21644. });
  21645. }).then(function (e) {
  21646. var _e$result = e.result,
  21647. t = _e$result.code,
  21648. n = _e$result.message,
  21649. s = _e$result.token,
  21650. c = _e$result.tokenExpired,
  21651. _e$result$systemInfo = _e$result.systemInfo,
  21652. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  21653. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  21654. var _u$_e = u[_e23],
  21655. _t12 = _u$_e.level,
  21656. _n11 = _u$_e.message,
  21657. _s13 = _u$_e.detail,
  21658. _r6 = console["app" === P && "warn" === _t12 ? "error" : _t12] || console.log;
  21659. var _i4 = "[System Info]" + _n11;
  21660. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  21661. }
  21662. if (t) {
  21663. return a(new ne({
  21664. code: t,
  21665. message: n,
  21666. requestId: e.requestId
  21667. }));
  21668. }
  21669. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  21670. token: s,
  21671. tokenExpired: c
  21672. }), _this19._callbackAuth("refreshToken", [{
  21673. token: s,
  21674. tokenExpired: c
  21675. }]), _this19._callback("refreshToken", [{
  21676. token: s,
  21677. tokenExpired: c
  21678. }]), Q(W, {
  21679. token: s,
  21680. tokenExpired: c
  21681. }));
  21682. var h = [{
  21683. prop: "affectedDocs",
  21684. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  21685. }, {
  21686. prop: "code",
  21687. tips: "code不再推荐使用,请使用errCode替代"
  21688. }, {
  21689. prop: "message",
  21690. tips: "message不再推荐使用,请使用errMsg替代"
  21691. }];
  21692. var _loop2 = function _loop2(_t13) {
  21693. var _h$_t = h[_t13],
  21694. n = _h$_t.prop,
  21695. s = _h$_t.tips;
  21696. if (n in e.result) {
  21697. var _t14 = e.result[n];
  21698. Object.defineProperty(e.result, n, {
  21699. get: function get() {
  21700. return console.warn(s), _t14;
  21701. }
  21702. });
  21703. }
  21704. };
  21705. for (var _t13 = 0; _t13 < h.length; _t13++) {
  21706. _loop2(_t13);
  21707. }
  21708. return function (e) {
  21709. return q(M(o, "success"), e).then(function () {
  21710. return q(M(o, "complete"), e);
  21711. }).then(function () {
  21712. r(e, null);
  21713. var t = i._parseResult(e);
  21714. return Q(B, {
  21715. type: z,
  21716. content: t
  21717. }), Promise.resolve(t);
  21718. });
  21719. }(e);
  21720. }, function (e) {
  21721. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  21722. return a(new ne({
  21723. code: e.code || "SYSTEM_ERROR",
  21724. message: e.message,
  21725. requestId: e.requestId
  21726. }));
  21727. });
  21728. }
  21729. }]);
  21730. return $n;
  21731. }( /*#__PURE__*/function () {
  21732. function _class5() {
  21733. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21734. _ref39$uniClient = _ref39.uniClient,
  21735. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  21736. _ref39$isJQL = _ref39.isJQL,
  21737. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  21738. (0, _classCallCheck2.default)(this, _class5);
  21739. 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({}, {
  21740. get: function get(e, t) {
  21741. return {
  21742. $env: t
  21743. };
  21744. }
  21745. }), this.Geo = Un({}, {
  21746. get: function get(e, t) {
  21747. return jn({
  21748. path: ["Geo"],
  21749. method: t
  21750. });
  21751. }
  21752. }), this.serverDate = jn({
  21753. path: [],
  21754. method: "serverDate"
  21755. }), this.RegExp = jn({
  21756. path: [],
  21757. method: "RegExp"
  21758. });
  21759. }
  21760. (0, _createClass2.default)(_class5, [{
  21761. key: "getCloudEnv",
  21762. value: function getCloudEnv(e) {
  21763. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  21764. return {
  21765. $env: e.replace("$cloudEnv_", "")
  21766. };
  21767. }
  21768. }, {
  21769. key: "_callback",
  21770. value: function _callback(e, t) {
  21771. var n = this._dbCallBacks;
  21772. n[e] && n[e].forEach(function (e) {
  21773. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  21774. });
  21775. }
  21776. }, {
  21777. key: "_callbackAuth",
  21778. value: function _callbackAuth(e, t) {
  21779. var n = this._authCallBacks;
  21780. n[e] && n[e].forEach(function (e) {
  21781. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  21782. });
  21783. }
  21784. }, {
  21785. key: "multiSend",
  21786. value: function multiSend() {
  21787. var e = Array.from(arguments),
  21788. t = e.map(function (e) {
  21789. var t = e.getAction(),
  21790. n = e.getCommand();
  21791. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  21792. return {
  21793. action: t,
  21794. command: n
  21795. };
  21796. });
  21797. return this._callCloudFunction({
  21798. multiCommand: t,
  21799. queryList: e
  21800. });
  21801. }
  21802. }]);
  21803. return _class5;
  21804. }());
  21805. var Wn = "token无效,跳转登录页面",
  21806. zn = "token过期,跳转登录页面",
  21807. Jn = {
  21808. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  21809. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  21810. TOKEN_INVALID: Wn,
  21811. TOKEN_INVALID_WRONG_TOKEN: Wn,
  21812. TOKEN_INVALID_ANONYMOUS_USER: Wn
  21813. },
  21814. Hn = {
  21815. "uni-id-token-expired": zn,
  21816. "uni-id-check-token-failed": Wn,
  21817. "uni-id-token-not-exist": Wn,
  21818. "uni-id-check-device-feature-failed": Wn
  21819. };
  21820. function Gn(e, t) {
  21821. var n = "";
  21822. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  21823. }
  21824. function Vn() {
  21825. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  21826. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  21827. var n = [],
  21828. s = [];
  21829. return e.forEach(function (e) {
  21830. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  21831. }), {
  21832. needLoginPage: n,
  21833. notNeedLoginPage: s
  21834. };
  21835. }
  21836. function Yn(e) {
  21837. return e.split("?")[0].replace(/^\//, "");
  21838. }
  21839. function Qn() {
  21840. return function (e) {
  21841. var t = e && e.$page && e.$page.fullPath || "";
  21842. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  21843. }(function () {
  21844. var e = getCurrentPages();
  21845. return e[e.length - 1];
  21846. }());
  21847. }
  21848. function Xn() {
  21849. return Yn(Qn());
  21850. }
  21851. function Zn() {
  21852. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  21853. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21854. if (!e) return !1;
  21855. if (!(t && t.list && t.list.length)) return !1;
  21856. var n = t.list,
  21857. s = Yn(e);
  21858. return n.some(function (e) {
  21859. return e.pagePath === s;
  21860. });
  21861. }
  21862. var es = !!_pages.default.uniIdRouter;
  21863. var _ref40 = function () {
  21864. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  21865. _ref21$pages = _ref21.pages,
  21866. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  21867. _ref21$subPackages = _ref21.subPackages,
  21868. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  21869. _ref21$uniIdRouter = _ref21.uniIdRouter,
  21870. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  21871. _ref21$tabBar = _ref21.tabBar,
  21872. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  21873. var i = s.loginPage,
  21874. _s$needLogin = s.needLogin,
  21875. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  21876. _s$resToLogin = s.resToLogin,
  21877. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  21878. _Vn = Vn(e),
  21879. c = _Vn.needLoginPage,
  21880. u = _Vn.notNeedLoginPage,
  21881. _ref23 = function () {
  21882. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  21883. var t = [],
  21884. n = [];
  21885. return e.forEach(function (e) {
  21886. var s = e.root,
  21887. _e$pages = e.pages,
  21888. r = _e$pages === void 0 ? [] : _e$pages,
  21889. _Vn2 = Vn(r, s),
  21890. i = _Vn2.needLoginPage,
  21891. o = _Vn2.notNeedLoginPage;
  21892. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  21893. }), {
  21894. needLoginPage: t,
  21895. notNeedLoginPage: n
  21896. };
  21897. }(n),
  21898. h = _ref23.needLoginPage,
  21899. l = _ref23.notNeedLoginPage;
  21900. return {
  21901. loginPage: i,
  21902. routerNeedLogin: o,
  21903. resToLogin: a,
  21904. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  21905. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  21906. loginPageInTabBar: Zn(i, r)
  21907. };
  21908. }(),
  21909. ts = _ref40.loginPage,
  21910. ns = _ref40.routerNeedLogin,
  21911. ss = _ref40.resToLogin,
  21912. rs = _ref40.needLoginPage,
  21913. is = _ref40.notNeedLoginPage,
  21914. os = _ref40.loginPageInTabBar;
  21915. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  21916. function as(e) {
  21917. var t = Xn();
  21918. if ("/" === e.charAt(0)) return e;
  21919. var _e$split = e.split("?"),
  21920. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  21921. n = _e$split2[0],
  21922. s = _e$split2[1],
  21923. r = n.replace(/^\//, "").split("/"),
  21924. i = t.split("/");
  21925. i.pop();
  21926. for (var _e24 = 0; _e24 < r.length; _e24++) {
  21927. var _t15 = r[_e24];
  21928. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  21929. }
  21930. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  21931. }
  21932. function cs(e) {
  21933. var t = Yn(as(e));
  21934. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  21935. return function (e, t) {
  21936. return new RegExp(t).test(e);
  21937. }(e, t);
  21938. }));
  21939. }
  21940. function us(_ref41) {
  21941. var e = _ref41.redirect;
  21942. var t = Yn(e),
  21943. n = Yn(ts);
  21944. return Xn() !== n && t !== n;
  21945. }
  21946. function hs() {
  21947. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21948. e = _ref42.api,
  21949. t = _ref42.redirect;
  21950. if (!t || !us({
  21951. redirect: t
  21952. })) return;
  21953. var n = function (e, t) {
  21954. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  21955. }(ts, t);
  21956. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  21957. var s = {
  21958. navigateTo: uni.navigateTo,
  21959. redirectTo: uni.redirectTo,
  21960. switchTab: uni.switchTab,
  21961. reLaunch: uni.reLaunch
  21962. };
  21963. setTimeout(function () {
  21964. s[e]({
  21965. url: n
  21966. });
  21967. });
  21968. }
  21969. function ls() {
  21970. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  21971. e = _ref43.url;
  21972. var t = {
  21973. abortLoginPageJump: !1,
  21974. autoToLoginPage: !1
  21975. },
  21976. n = function () {
  21977. var _re3 = re(),
  21978. e = _re3.token,
  21979. t = _re3.tokenExpired;
  21980. var n;
  21981. if (e) {
  21982. if (t < Date.now()) {
  21983. var _e25 = "uni-id-token-expired";
  21984. n = {
  21985. errCode: _e25,
  21986. errMsg: Hn[_e25]
  21987. };
  21988. }
  21989. } else {
  21990. var _e26 = "uni-id-check-token-failed";
  21991. n = {
  21992. errCode: _e26,
  21993. errMsg: Hn[_e26]
  21994. };
  21995. }
  21996. return n;
  21997. }();
  21998. if (cs(e) && n) {
  21999. n.uniIdRedirectUrl = e;
  22000. if (G($).length > 0) return setTimeout(function () {
  22001. Q($, n);
  22002. }, 0), t.abortLoginPageJump = !0, t;
  22003. t.autoToLoginPage = !0;
  22004. }
  22005. return t;
  22006. }
  22007. function ds() {
  22008. !function () {
  22009. var e = Qn(),
  22010. _ls = ls({
  22011. url: e
  22012. }),
  22013. t = _ls.abortLoginPageJump,
  22014. n = _ls.autoToLoginPage;
  22015. t || n && hs({
  22016. api: "redirectTo",
  22017. redirect: e
  22018. });
  22019. }();
  22020. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  22021. var _loop3 = function _loop3(_t16) {
  22022. var n = e[_t16];
  22023. uni.addInterceptor(n, {
  22024. invoke: function invoke(e) {
  22025. var _ls2 = ls({
  22026. url: e.url
  22027. }),
  22028. t = _ls2.abortLoginPageJump,
  22029. s = _ls2.autoToLoginPage;
  22030. return t ? e : s ? (hs({
  22031. api: n,
  22032. redirect: as(e.url)
  22033. }), !1) : e;
  22034. }
  22035. });
  22036. };
  22037. for (var _t16 = 0; _t16 < e.length; _t16++) {
  22038. _loop3(_t16);
  22039. }
  22040. }
  22041. function ps() {
  22042. this.onResponse(function (e) {
  22043. var t = e.type,
  22044. n = e.content;
  22045. var s = !1;
  22046. switch (t) {
  22047. case "cloudobject":
  22048. s = function (e) {
  22049. if ("object" != (0, _typeof2.default)(e)) return !1;
  22050. var _ref44 = e || {},
  22051. t = _ref44.errCode;
  22052. return t in Hn;
  22053. }(n);
  22054. break;
  22055. case "clientdb":
  22056. s = function (e) {
  22057. if ("object" != (0, _typeof2.default)(e)) return !1;
  22058. var _ref45 = e || {},
  22059. t = _ref45.errCode;
  22060. return t in Jn;
  22061. }(n);
  22062. }
  22063. s && function () {
  22064. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22065. var t = G($);
  22066. ee().then(function () {
  22067. var n = Qn();
  22068. if (n && us({
  22069. redirect: n
  22070. })) return t.length > 0 ? Q($, Object.assign({
  22071. uniIdRedirectUrl: n
  22072. }, e)) : void (ts && hs({
  22073. api: "navigateTo",
  22074. redirect: n
  22075. }));
  22076. });
  22077. }(n);
  22078. });
  22079. }
  22080. function fs(e) {
  22081. !function (e) {
  22082. e.onResponse = function (e) {
  22083. V(B, e);
  22084. }, e.offResponse = function (e) {
  22085. Y(B, e);
  22086. };
  22087. }(e), function (e) {
  22088. e.onNeedLogin = function (e) {
  22089. V($, e);
  22090. }, e.offNeedLogin = function (e) {
  22091. Y($, e);
  22092. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  22093. ds.call(e);
  22094. }), ss && ps.call(e)));
  22095. }(e), function (e) {
  22096. e.onRefreshToken = function (e) {
  22097. V(W, e);
  22098. }, e.offRefreshToken = function (e) {
  22099. Y(W, e);
  22100. };
  22101. }(e);
  22102. }
  22103. var gs;
  22104. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  22105. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  22106. function _s() {
  22107. var e = re().token || "",
  22108. t = e.split(".");
  22109. if (!e || 3 !== t.length) return {
  22110. uid: null,
  22111. role: [],
  22112. permission: [],
  22113. tokenExpired: 0
  22114. };
  22115. var n;
  22116. try {
  22117. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  22118. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  22119. }).join(""))));
  22120. } catch (e) {
  22121. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  22122. }
  22123. var s;
  22124. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  22125. }
  22126. gs = "function" != typeof atob ? function (e) {
  22127. 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.");
  22128. var t;
  22129. e += "==".slice(2 - (3 & e.length));
  22130. for (var n, s, r = "", i = 0; i < e.length;) {
  22131. 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);
  22132. }
  22133. return r;
  22134. } : atob;
  22135. var ws = s(function (e, t) {
  22136. Object.defineProperty(t, "__esModule", {
  22137. value: !0
  22138. });
  22139. var n = "chooseAndUploadFile:ok",
  22140. s = "chooseAndUploadFile:fail";
  22141. function r(e, t) {
  22142. return e.tempFiles.forEach(function (e, n) {
  22143. 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("."));
  22144. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  22145. return e.path;
  22146. })), e;
  22147. }
  22148. function i(e, t, _ref46) {
  22149. var s = _ref46.onChooseFile,
  22150. r = _ref46.onUploadProgress;
  22151. return t.then(function (e) {
  22152. if (s) {
  22153. var _t17 = s(e);
  22154. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  22155. return void 0 === t ? e : t;
  22156. });
  22157. }
  22158. return e;
  22159. }).then(function (t) {
  22160. return !1 === t ? {
  22161. errMsg: n,
  22162. tempFilePaths: [],
  22163. tempFiles: []
  22164. } : function (e, t) {
  22165. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  22166. var r = arguments.length > 3 ? arguments[3] : undefined;
  22167. (t = Object.assign({}, t)).errMsg = n;
  22168. var i = t.tempFiles,
  22169. o = i.length;
  22170. var a = 0;
  22171. return new Promise(function (n) {
  22172. for (; a < s;) {
  22173. c();
  22174. }
  22175. function c() {
  22176. var s = a++;
  22177. if (s >= o) return void (!i.find(function (e) {
  22178. return !e.url && !e.errMsg;
  22179. }) && n(t));
  22180. var u = i[s];
  22181. e.uploadFile({
  22182. filePath: u.path,
  22183. cloudPath: u.cloudPath,
  22184. fileType: u.fileType,
  22185. onUploadProgress: function onUploadProgress(e) {
  22186. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  22187. }
  22188. }).then(function (e) {
  22189. u.url = e.fileID, s < o && c();
  22190. }).catch(function (e) {
  22191. u.errMsg = e.errMsg || e.message, s < o && c();
  22192. });
  22193. }
  22194. });
  22195. }(e, t, 5, r);
  22196. });
  22197. }
  22198. t.initChooseAndUploadFile = function (e) {
  22199. return function () {
  22200. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  22201. type: "all"
  22202. };
  22203. return "image" === t.type ? i(e, function (e) {
  22204. var t = e.count,
  22205. n = e.sizeType,
  22206. _e$sourceType = e.sourceType,
  22207. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  22208. o = e.extension;
  22209. return new Promise(function (e, a) {
  22210. uni.chooseImage({
  22211. count: t,
  22212. sizeType: n,
  22213. sourceType: i,
  22214. extension: o,
  22215. success: function success(t) {
  22216. e(r(t, "image"));
  22217. },
  22218. fail: function fail(e) {
  22219. a({
  22220. errMsg: e.errMsg.replace("chooseImage:fail", s)
  22221. });
  22222. }
  22223. });
  22224. });
  22225. }(t), t) : "video" === t.type ? i(e, function (e) {
  22226. var t = e.camera,
  22227. n = e.compressed,
  22228. i = e.maxDuration,
  22229. _e$sourceType2 = e.sourceType,
  22230. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  22231. a = e.extension;
  22232. return new Promise(function (e, c) {
  22233. uni.chooseVideo({
  22234. camera: t,
  22235. compressed: n,
  22236. maxDuration: i,
  22237. sourceType: o,
  22238. extension: a,
  22239. success: function success(t) {
  22240. var n = t.tempFilePath,
  22241. s = t.duration,
  22242. i = t.size,
  22243. o = t.height,
  22244. a = t.width;
  22245. e(r({
  22246. errMsg: "chooseVideo:ok",
  22247. tempFilePaths: [n],
  22248. tempFiles: [{
  22249. name: t.tempFile && t.tempFile.name || "",
  22250. path: n,
  22251. size: i,
  22252. type: t.tempFile && t.tempFile.type || "",
  22253. width: a,
  22254. height: o,
  22255. duration: s,
  22256. fileType: "video",
  22257. cloudPath: ""
  22258. }]
  22259. }, "video"));
  22260. },
  22261. fail: function fail(e) {
  22262. c({
  22263. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  22264. });
  22265. }
  22266. });
  22267. });
  22268. }(t), t) : i(e, function (e) {
  22269. var t = e.count,
  22270. n = e.extension;
  22271. return new Promise(function (e, i) {
  22272. var o = uni.chooseFile;
  22273. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  22274. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  22275. });
  22276. o({
  22277. type: "all",
  22278. count: t,
  22279. extension: n,
  22280. success: function success(t) {
  22281. e(r(t));
  22282. },
  22283. fail: function fail(e) {
  22284. i({
  22285. errMsg: e.errMsg.replace("chooseFile:fail", s)
  22286. });
  22287. }
  22288. });
  22289. });
  22290. }(t), t);
  22291. };
  22292. };
  22293. }),
  22294. vs = n(ws);
  22295. var Is = "manual";
  22296. function Ss(e) {
  22297. return {
  22298. props: {
  22299. localdata: {
  22300. type: Array,
  22301. default: function _default() {
  22302. return [];
  22303. }
  22304. },
  22305. options: {
  22306. type: [Object, Array],
  22307. default: function _default() {
  22308. return {};
  22309. }
  22310. },
  22311. spaceInfo: {
  22312. type: Object,
  22313. default: function _default() {
  22314. return {};
  22315. }
  22316. },
  22317. collection: {
  22318. type: [String, Array],
  22319. default: ""
  22320. },
  22321. action: {
  22322. type: String,
  22323. default: ""
  22324. },
  22325. field: {
  22326. type: String,
  22327. default: ""
  22328. },
  22329. orderby: {
  22330. type: String,
  22331. default: ""
  22332. },
  22333. where: {
  22334. type: [String, Object],
  22335. default: ""
  22336. },
  22337. pageData: {
  22338. type: String,
  22339. default: "add"
  22340. },
  22341. pageCurrent: {
  22342. type: Number,
  22343. default: 1
  22344. },
  22345. pageSize: {
  22346. type: Number,
  22347. default: 20
  22348. },
  22349. getcount: {
  22350. type: [Boolean, String],
  22351. default: !1
  22352. },
  22353. gettree: {
  22354. type: [Boolean, String],
  22355. default: !1
  22356. },
  22357. gettreepath: {
  22358. type: [Boolean, String],
  22359. default: !1
  22360. },
  22361. startwith: {
  22362. type: String,
  22363. default: ""
  22364. },
  22365. limitlevel: {
  22366. type: Number,
  22367. default: 10
  22368. },
  22369. groupby: {
  22370. type: String,
  22371. default: ""
  22372. },
  22373. groupField: {
  22374. type: String,
  22375. default: ""
  22376. },
  22377. distinct: {
  22378. type: [Boolean, String],
  22379. default: !1
  22380. },
  22381. foreignKey: {
  22382. type: String,
  22383. default: ""
  22384. },
  22385. loadtime: {
  22386. type: String,
  22387. default: "auto"
  22388. },
  22389. manual: {
  22390. type: Boolean,
  22391. default: !1
  22392. }
  22393. },
  22394. data: function data() {
  22395. return {
  22396. mixinDatacomLoading: !1,
  22397. mixinDatacomHasMore: !1,
  22398. mixinDatacomResData: [],
  22399. mixinDatacomErrorMessage: "",
  22400. mixinDatacomPage: {}
  22401. };
  22402. },
  22403. created: function created() {
  22404. var _this20 = this;
  22405. this.mixinDatacomPage = {
  22406. current: this.pageCurrent,
  22407. size: this.pageSize,
  22408. count: 0
  22409. }, this.$watch(function () {
  22410. var e = [];
  22411. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  22412. e.push(_this20[t]);
  22413. }), e;
  22414. }, function (e, t) {
  22415. if (_this20.loadtime === Is) return;
  22416. var n = !1;
  22417. var s = [];
  22418. for (var _r7 = 2; _r7 < e.length; _r7++) {
  22419. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  22420. }
  22421. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  22422. });
  22423. },
  22424. methods: {
  22425. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  22426. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  22427. var _this21 = this;
  22428. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  22429. _ref47$getone = _ref47.getone,
  22430. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  22431. t = _ref47.success,
  22432. n = _ref47.fail;
  22433. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  22434. _this21.mixinDatacomLoading = !1;
  22435. var _n$result = n.result,
  22436. s = _n$result.data,
  22437. r = _n$result.count;
  22438. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  22439. var i = e ? s.length ? s[0] : void 0 : s;
  22440. _this21.mixinDatacomResData = i, t && t(i);
  22441. }).catch(function (e) {
  22442. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  22443. }));
  22444. },
  22445. mixinDatacomGet: function mixinDatacomGet() {
  22446. var _n12;
  22447. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22448. var n = e.database(this.spaceInfo);
  22449. var s = t.action || this.action;
  22450. s && (n = n.action(s));
  22451. var r = t.collection || this.collection;
  22452. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  22453. var i = t.where || this.where;
  22454. i && Object.keys(i).length && (n = n.where(i));
  22455. var o = t.field || this.field;
  22456. o && (n = n.field(o));
  22457. var a = t.foreignKey || this.foreignKey;
  22458. a && (n = n.foreignKey(a));
  22459. var c = t.groupby || this.groupby;
  22460. c && (n = n.groupBy(c));
  22461. var u = t.groupField || this.groupField;
  22462. u && (n = n.groupField(u));
  22463. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  22464. var h = t.orderby || this.orderby;
  22465. h && (n = n.orderBy(h));
  22466. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  22467. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  22468. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  22469. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  22470. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  22471. m = {
  22472. getCount: p
  22473. },
  22474. y = {
  22475. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  22476. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  22477. };
  22478. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  22479. }
  22480. }
  22481. };
  22482. }
  22483. function bs(e) {
  22484. return function (t) {
  22485. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22486. n = function (e) {
  22487. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22488. 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;
  22489. }({
  22490. customUI: !1,
  22491. loadingOptions: {
  22492. title: "加载中...",
  22493. mask: !0
  22494. },
  22495. errorOptions: {
  22496. type: "modal",
  22497. retry: !1
  22498. }
  22499. }, n);
  22500. var _n13 = n,
  22501. s = _n13.customUI,
  22502. r = _n13.loadingOptions,
  22503. i = _n13.errorOptions,
  22504. o = _n13.parseSystemError,
  22505. a = !s;
  22506. return new Proxy({}, {
  22507. get: function get(s, c) {
  22508. return function () {
  22509. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  22510. e = _ref48.fn,
  22511. t = _ref48.interceptorName,
  22512. n = _ref48.getCallbackArgs;
  22513. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  22514. var _len2,
  22515. s,
  22516. _key2,
  22517. r,
  22518. i,
  22519. o,
  22520. _args = arguments;
  22521. return _regenerator.default.wrap(function _callee50$(_context50) {
  22522. while (1) {
  22523. switch (_context50.prev = _context50.next) {
  22524. case 0:
  22525. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  22526. s[_key2] = _args[_key2];
  22527. }
  22528. r = n ? n({
  22529. params: s
  22530. }) : {};
  22531. _context50.prev = 2;
  22532. _context50.next = 5;
  22533. return q(M(t, "invoke"), _objectSpread({}, r));
  22534. case 5:
  22535. _context50.next = 7;
  22536. return e.apply(void 0, s);
  22537. case 7:
  22538. i = _context50.sent;
  22539. _context50.next = 10;
  22540. return q(M(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  22541. result: i
  22542. }));
  22543. case 10:
  22544. return _context50.abrupt("return", i);
  22545. case 13:
  22546. _context50.prev = 13;
  22547. _context50.t0 = _context50["catch"](2);
  22548. o = _context50.t0;
  22549. _context50.next = 18;
  22550. return q(M(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  22551. error: o
  22552. }));
  22553. case 18:
  22554. throw o;
  22555. case 19:
  22556. _context50.prev = 19;
  22557. _context50.next = 22;
  22558. return q(M(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  22559. error: o
  22560. }) : _objectSpread(_objectSpread({}, r), {}, {
  22561. result: i
  22562. }));
  22563. case 22:
  22564. return _context50.finish(19);
  22565. case 23:
  22566. case "end":
  22567. return _context50.stop();
  22568. }
  22569. }
  22570. }, _callee50, null, [[2, 13, 19, 23]]);
  22571. }));
  22572. }({
  22573. fn: function () {
  22574. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  22575. var l,
  22576. _len3,
  22577. u,
  22578. _key3,
  22579. d,
  22580. p,
  22581. _ref50,
  22582. f,
  22583. g,
  22584. m,
  22585. y,
  22586. _e27,
  22587. _yield,
  22588. _t18,
  22589. _n14,
  22590. _args4 = arguments;
  22591. return _regenerator.default.wrap(function _callee52$(_context52) {
  22592. while (1) {
  22593. switch (_context52.prev = _context52.next) {
  22594. case 0:
  22595. a && uni.showLoading({
  22596. title: r.title,
  22597. mask: r.mask
  22598. });
  22599. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  22600. u[_key3] = _args4[_key3];
  22601. }
  22602. d = {
  22603. name: t,
  22604. type: h,
  22605. data: {
  22606. method: c,
  22607. params: u
  22608. }
  22609. };
  22610. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  22611. var n = t.data.method,
  22612. s = e.secretMethods || {},
  22613. r = s[n] || s["*"];
  22614. r && (t.secretType = r);
  22615. }(n, d);
  22616. p = !1;
  22617. _context52.prev = 5;
  22618. _context52.next = 8;
  22619. return e.callFunction(d);
  22620. case 8:
  22621. l = _context52.sent;
  22622. _context52.next = 14;
  22623. break;
  22624. case 11:
  22625. _context52.prev = 11;
  22626. _context52.t0 = _context52["catch"](5);
  22627. p = !0, l = {
  22628. result: new ne(_context52.t0)
  22629. };
  22630. case 14:
  22631. _ref50 = l.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  22632. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  22633. _context52.next = 39;
  22634. break;
  22635. }
  22636. _e27 = m;
  22637. if (!(p && o)) {
  22638. _context52.next = 24;
  22639. break;
  22640. }
  22641. _context52.next = 20;
  22642. return o({
  22643. objectName: t,
  22644. methodName: c,
  22645. params: u,
  22646. errSubject: f,
  22647. errCode: g,
  22648. errMsg: m
  22649. });
  22650. case 20:
  22651. _context52.t1 = _context52.sent.errMsg;
  22652. if (_context52.t1) {
  22653. _context52.next = 23;
  22654. break;
  22655. }
  22656. _context52.t1 = m;
  22657. case 23:
  22658. _e27 = _context52.t1;
  22659. case 24:
  22660. if (!a) {
  22661. _context52.next = 37;
  22662. break;
  22663. }
  22664. if (!("toast" === i.type)) {
  22665. _context52.next = 29;
  22666. break;
  22667. }
  22668. uni.showToast({
  22669. title: _e27,
  22670. icon: "none"
  22671. });
  22672. _context52.next = 37;
  22673. break;
  22674. case 29:
  22675. if (!("modal" !== i.type)) {
  22676. _context52.next = 31;
  22677. break;
  22678. }
  22679. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  22680. case 31:
  22681. _context52.next = 33;
  22682. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  22683. var _ref52,
  22684. e,
  22685. t,
  22686. n,
  22687. s,
  22688. r,
  22689. _args2 = arguments;
  22690. return _regenerator.default.wrap(function _callee51$(_context51) {
  22691. while (1) {
  22692. switch (_context51.prev = _context51.next) {
  22693. case 0:
  22694. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  22695. return _context51.abrupt("return", new Promise(function (i, o) {
  22696. uni.showModal({
  22697. title: e,
  22698. content: t,
  22699. showCancel: n,
  22700. cancelText: s,
  22701. confirmText: r,
  22702. success: function success(e) {
  22703. i(e);
  22704. },
  22705. fail: function fail() {
  22706. i({
  22707. confirm: !1,
  22708. cancel: !0
  22709. });
  22710. }
  22711. });
  22712. }));
  22713. case 2:
  22714. case "end":
  22715. return _context51.stop();
  22716. }
  22717. }
  22718. }, _callee51);
  22719. }))({
  22720. title: "提示",
  22721. content: _e27,
  22722. showCancel: i.retry,
  22723. cancelText: "取消",
  22724. confirmText: i.retry ? "重试" : "确定"
  22725. });
  22726. case 33:
  22727. _yield = _context52.sent;
  22728. _t18 = _yield.confirm;
  22729. if (!(i.retry && _t18)) {
  22730. _context52.next = 37;
  22731. break;
  22732. }
  22733. return _context52.abrupt("return", s.apply(void 0, u));
  22734. case 37:
  22735. _n14 = new ne({
  22736. subject: f,
  22737. code: g,
  22738. message: m,
  22739. requestId: l.requestId
  22740. });
  22741. throw _n14.detail = l.result, Q(B, {
  22742. type: H,
  22743. content: _n14
  22744. }), _n14;
  22745. case 39:
  22746. return _context52.abrupt("return", (Q(B, {
  22747. type: H,
  22748. content: l.result
  22749. }), l.result));
  22750. case 40:
  22751. case "end":
  22752. return _context52.stop();
  22753. }
  22754. }
  22755. }, _callee52, null, [[5, 11]]);
  22756. }));
  22757. function s() {
  22758. return _s14.apply(this, arguments);
  22759. }
  22760. return s;
  22761. }(),
  22762. interceptorName: "callObject",
  22763. getCallbackArgs: function getCallbackArgs() {
  22764. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  22765. e = _ref53.params;
  22766. return {
  22767. objectName: t,
  22768. methodName: c,
  22769. params: e
  22770. };
  22771. }
  22772. });
  22773. }
  22774. });
  22775. };
  22776. }
  22777. function ks(e) {
  22778. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  22779. }
  22780. function Cs() {
  22781. return _Cs.apply(this, arguments);
  22782. }
  22783. function _Cs() {
  22784. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  22785. var _ref65,
  22786. e,
  22787. _ref65$callLoginByWei,
  22788. t,
  22789. n,
  22790. s,
  22791. r,
  22792. _args7 = arguments;
  22793. return _regenerator.default.wrap(function _callee55$(_context55) {
  22794. while (1) {
  22795. switch (_context55.prev = _context55.next) {
  22796. case 0:
  22797. _ref65 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref65.openid, _ref65$callLoginByWei = _ref65.callLoginByWeixin, t = _ref65$callLoginByWei === void 0 ? !1 : _ref65$callLoginByWei;
  22798. n = ks(this);
  22799. if (!("mp-weixin" !== P)) {
  22800. _context55.next = 4;
  22801. break;
  22802. }
  22803. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(P, "`"));
  22804. case 4:
  22805. if (!(e && t)) {
  22806. _context55.next = 6;
  22807. break;
  22808. }
  22809. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  22810. case 6:
  22811. if (!e) {
  22812. _context55.next = 8;
  22813. break;
  22814. }
  22815. return _context55.abrupt("return", (n.mpWeixinOpenid = e, {}));
  22816. case 8:
  22817. _context55.next = 10;
  22818. return new Promise(function (e, t) {
  22819. uni.login({
  22820. success: function success(t) {
  22821. e(t.code);
  22822. },
  22823. fail: function fail(e) {
  22824. t(new Error(e.errMsg));
  22825. }
  22826. });
  22827. });
  22828. case 10:
  22829. s = _context55.sent;
  22830. r = this.importObject("uni-id-co", {
  22831. customUI: !0
  22832. });
  22833. _context55.next = 14;
  22834. return r.secureNetworkHandshakeByWeixin({
  22835. code: s,
  22836. callLoginByWeixin: t
  22837. });
  22838. case 14:
  22839. n.mpWeixinCode = s;
  22840. return _context55.abrupt("return", {
  22841. code: s
  22842. });
  22843. case 16:
  22844. case "end":
  22845. return _context55.stop();
  22846. }
  22847. }
  22848. }, _callee55, this);
  22849. }));
  22850. return _Cs.apply(this, arguments);
  22851. }
  22852. function Ts(_x37) {
  22853. return _Ts.apply(this, arguments);
  22854. }
  22855. function _Ts() {
  22856. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e) {
  22857. var t;
  22858. return _regenerator.default.wrap(function _callee56$(_context56) {
  22859. while (1) {
  22860. switch (_context56.prev = _context56.next) {
  22861. case 0:
  22862. t = ks(this);
  22863. return _context56.abrupt("return", (t.initPromise || (t.initPromise = Cs.call(this, e)), t.initPromise));
  22864. case 2:
  22865. case "end":
  22866. return _context56.stop();
  22867. }
  22868. }
  22869. }, _callee56, this);
  22870. }));
  22871. return _Ts.apply(this, arguments);
  22872. }
  22873. function Ps(e) {
  22874. return function () {
  22875. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  22876. t = _ref54.openid,
  22877. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  22878. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  22879. return Ts.call(e, {
  22880. openid: t,
  22881. callLoginByWeixin: n
  22882. });
  22883. };
  22884. }
  22885. function As(e) {
  22886. var t = {
  22887. getSystemInfo: uni.getSystemInfo,
  22888. getPushClientId: uni.getPushClientId
  22889. };
  22890. return function (n) {
  22891. return new Promise(function (s, r) {
  22892. t[e](_objectSpread(_objectSpread({}, n), {}, {
  22893. success: function success(e) {
  22894. s(e);
  22895. },
  22896. fail: function fail(e) {
  22897. r(e);
  22898. }
  22899. }));
  22900. });
  22901. };
  22902. }
  22903. var Es = /*#__PURE__*/function (_ref55) {
  22904. (0, _inherits2.default)(Es, _ref55);
  22905. var _super12 = _createSuper(Es);
  22906. function Es() {
  22907. var _this22;
  22908. (0, _classCallCheck2.default)(this, Es);
  22909. _this22 = _super12.call(this), _this22._uniPushMessageCallback = _this22._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this22)), _this22._currentMessageId = -1, _this22._payloadQueue = [];
  22910. return _this22;
  22911. }
  22912. (0, _createClass2.default)(Es, [{
  22913. key: "init",
  22914. value: function init() {
  22915. var _this23 = this;
  22916. return Promise.all([As("getSystemInfo")(), As("getPushClientId")()]).then(function () {
  22917. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  22918. _ref57 = (0, _slicedToArray2.default)(_ref56, 2),
  22919. _ref57$ = _ref57[0];
  22920. _ref57$ = _ref57$ === void 0 ? {} : _ref57$;
  22921. var e = _ref57$.appId,
  22922. _ref57$2 = _ref57[1];
  22923. _ref57$2 = _ref57$2 === void 0 ? {} : _ref57$2;
  22924. var t = _ref57$2.cid;
  22925. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  22926. if (!t) throw new Error("Invalid push client id");
  22927. _this23._appId = e, _this23._pushClientId = t, _this23._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this23.emit("open"), _this23._initMessageListener();
  22928. }, function (e) {
  22929. throw _this23.emit("error", e), _this23.close(), e;
  22930. });
  22931. }
  22932. }, {
  22933. key: "open",
  22934. value: function () {
  22935. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  22936. return _regenerator.default.wrap(function _callee53$(_context53) {
  22937. while (1) {
  22938. switch (_context53.prev = _context53.next) {
  22939. case 0:
  22940. return _context53.abrupt("return", this.init());
  22941. case 1:
  22942. case "end":
  22943. return _context53.stop();
  22944. }
  22945. }
  22946. }, _callee53, this);
  22947. }));
  22948. function open() {
  22949. return _open.apply(this, arguments);
  22950. }
  22951. return open;
  22952. }()
  22953. }, {
  22954. key: "_isUniCloudSSE",
  22955. value: function _isUniCloudSSE(e) {
  22956. if ("receive" !== e.type) return !1;
  22957. var t = e && e.data && e.data.payload;
  22958. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  22959. }
  22960. }, {
  22961. key: "_receivePushMessage",
  22962. value: function _receivePushMessage(e) {
  22963. if (!this._isUniCloudSSE(e)) return;
  22964. var t = e && e.data && e.data.payload,
  22965. n = t.action,
  22966. s = t.messageId,
  22967. r = t.message;
  22968. this._payloadQueue.push({
  22969. action: n,
  22970. messageId: s,
  22971. message: r
  22972. }), this._consumMessage();
  22973. }
  22974. }, {
  22975. key: "_consumMessage",
  22976. value: function _consumMessage() {
  22977. var _this24 = this;
  22978. for (;;) {
  22979. var _e28 = this._payloadQueue.find(function (e) {
  22980. return e.messageId === _this24._currentMessageId + 1;
  22981. });
  22982. if (!_e28) break;
  22983. this._currentMessageId++, this._parseMessagePayload(_e28);
  22984. }
  22985. }
  22986. }, {
  22987. key: "_parseMessagePayload",
  22988. value: function _parseMessagePayload(e) {
  22989. var t = e.action,
  22990. n = e.messageId,
  22991. s = e.message;
  22992. "end" === t ? this._end({
  22993. messageId: n,
  22994. message: s
  22995. }) : "message" === t && this._appendMessage({
  22996. messageId: n,
  22997. message: s
  22998. });
  22999. }
  23000. }, {
  23001. key: "_appendMessage",
  23002. value: function _appendMessage() {
  23003. var _ref58 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  23004. e = _ref58.messageId,
  23005. t = _ref58.message;
  23006. this.emit("message", t);
  23007. }
  23008. }, {
  23009. key: "_end",
  23010. value: function _end() {
  23011. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  23012. e = _ref59.messageId,
  23013. t = _ref59.message;
  23014. this.emit("end", t), this.close();
  23015. }
  23016. }, {
  23017. key: "_initMessageListener",
  23018. value: function _initMessageListener() {
  23019. uni.onPushMessage(this._uniPushMessageCallback);
  23020. }
  23021. }, {
  23022. key: "_destroy",
  23023. value: function _destroy() {
  23024. uni.offPushMessage(this._uniPushMessageCallback);
  23025. }
  23026. }, {
  23027. key: "toJSON",
  23028. value: function toJSON() {
  23029. return {
  23030. appId: this._appId,
  23031. pushClientId: this._pushClientId,
  23032. seqId: this._seqId
  23033. };
  23034. }
  23035. }, {
  23036. key: "close",
  23037. value: function close() {
  23038. this._destroy(), this.emit("close");
  23039. }
  23040. }]);
  23041. return Es;
  23042. }( /*#__PURE__*/function () {
  23043. function _class6() {
  23044. (0, _classCallCheck2.default)(this, _class6);
  23045. this._callback = {};
  23046. }
  23047. (0, _createClass2.default)(_class6, [{
  23048. key: "addListener",
  23049. value: function addListener(e, t) {
  23050. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  23051. }
  23052. }, {
  23053. key: "on",
  23054. value: function on(e, t) {
  23055. return this.addListener(e, t);
  23056. }
  23057. }, {
  23058. key: "removeListener",
  23059. value: function removeListener(e, t) {
  23060. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  23061. var n = this._callback[e];
  23062. if (!n) return;
  23063. var s = function (e, t) {
  23064. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  23065. if (e[_n15] === t) return _n15;
  23066. }
  23067. return -1;
  23068. }(n, t);
  23069. n.splice(s, 1);
  23070. }
  23071. }, {
  23072. key: "off",
  23073. value: function off(e, t) {
  23074. return this.removeListener(e, t);
  23075. }
  23076. }, {
  23077. key: "removeAllListener",
  23078. value: function removeAllListener(e) {
  23079. delete this._callback[e];
  23080. }
  23081. }, {
  23082. key: "emit",
  23083. value: function emit(e) {
  23084. var n = this._callback[e];
  23085. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  23086. t[_key4 - 1] = arguments[_key4];
  23087. }
  23088. if (n) for (var _e29 = 0; _e29 < n.length; _e29++) {
  23089. n[_e29].apply(n, t);
  23090. }
  23091. }
  23092. }]);
  23093. return _class6;
  23094. }());
  23095. function Os(_x38, _x39) {
  23096. return _Os.apply(this, arguments);
  23097. }
  23098. function _Os() {
  23099. _Os = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  23100. var n, _e33, s;
  23101. return _regenerator.default.wrap(function _callee57$(_context57) {
  23102. while (1) {
  23103. switch (_context57.prev = _context57.next) {
  23104. case 0:
  23105. n = "http://".concat(e, ":").concat(t, "/system/ping");
  23106. _context57.prev = 1;
  23107. _context57.next = 4;
  23108. return s = {
  23109. url: n,
  23110. timeout: 500
  23111. }, new Promise(function (e, t) {
  23112. se.request(_objectSpread(_objectSpread({}, s), {}, {
  23113. success: function success(t) {
  23114. e(t);
  23115. },
  23116. fail: function fail(e) {
  23117. t(e);
  23118. }
  23119. }));
  23120. });
  23121. case 4:
  23122. _e33 = _context57.sent;
  23123. return _context57.abrupt("return", !(!_e33.data || 0 !== _e33.data.code));
  23124. case 8:
  23125. _context57.prev = 8;
  23126. _context57.t0 = _context57["catch"](1);
  23127. return _context57.abrupt("return", !1);
  23128. case 11:
  23129. case "end":
  23130. return _context57.stop();
  23131. }
  23132. }
  23133. }, _callee57, null, [[1, 8]]);
  23134. }));
  23135. return _Os.apply(this, arguments);
  23136. }
  23137. function xs(_x40) {
  23138. return _xs.apply(this, arguments);
  23139. }
  23140. function _xs() {
  23141. _xs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  23142. var _ce2, _e34, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  23143. return _regenerator.default.wrap(function _callee59$(_context59) {
  23144. while (1) {
  23145. switch (_context59.prev = _context59.next) {
  23146. case 0:
  23147. if (b) {
  23148. _context59.next = 2;
  23149. break;
  23150. }
  23151. return _context59.abrupt("return", Promise.resolve());
  23152. case 2:
  23153. if ("app" === P) {
  23154. _ce2 = ce(), _e34 = _ce2.osName, _t20 = _ce2.osVersion;
  23155. "ios" === _e34 && function (e) {
  23156. if (!e || "string" != typeof e) return 0;
  23157. var t = e.match(/^(\d+)./);
  23158. return t && t[1] ? parseInt(t[1]) : 0;
  23159. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  23160. }
  23161. t = e.__dev__;
  23162. if (t.debugInfo) {
  23163. _context59.next = 6;
  23164. break;
  23165. }
  23166. return _context59.abrupt("return");
  23167. case 6:
  23168. _t$debugInfo = t.debugInfo;
  23169. n = _t$debugInfo.address;
  23170. s = _t$debugInfo.servePort;
  23171. _context59.next = 11;
  23172. return function () {
  23173. var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e, t) {
  23174. var n, _s15, _r8;
  23175. return _regenerator.default.wrap(function _callee58$(_context58) {
  23176. while (1) {
  23177. switch (_context58.prev = _context58.next) {
  23178. case 0:
  23179. _s15 = 0;
  23180. case 1:
  23181. if (!(_s15 < e.length)) {
  23182. _context58.next = 11;
  23183. break;
  23184. }
  23185. _r8 = e[_s15];
  23186. _context58.next = 5;
  23187. return Os(_r8, t);
  23188. case 5:
  23189. if (!_context58.sent) {
  23190. _context58.next = 8;
  23191. break;
  23192. }
  23193. n = _r8;
  23194. return _context58.abrupt("break", 11);
  23195. case 8:
  23196. _s15++;
  23197. _context58.next = 1;
  23198. break;
  23199. case 11:
  23200. return _context58.abrupt("return", {
  23201. address: n,
  23202. port: t
  23203. });
  23204. case 12:
  23205. case "end":
  23206. return _context58.stop();
  23207. }
  23208. }
  23209. }, _callee58);
  23210. }));
  23211. return function (_x41, _x42) {
  23212. return _ref66.apply(this, arguments);
  23213. };
  23214. }()(n, s);
  23215. case 11:
  23216. _yield2 = _context59.sent;
  23217. r = _yield2.address;
  23218. if (!r) {
  23219. _context59.next = 15;
  23220. break;
  23221. }
  23222. return _context59.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  23223. case 15:
  23224. i = console["app" === P ? "error" : "warn"];
  23225. o = "";
  23226. 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)) {
  23227. _context59.next = 19;
  23228. break;
  23229. }
  23230. throw new Error(o);
  23231. case 19:
  23232. i(o);
  23233. case 20:
  23234. case "end":
  23235. return _context59.stop();
  23236. }
  23237. }
  23238. }, _callee59);
  23239. }));
  23240. return _xs.apply(this, arguments);
  23241. }
  23242. function Rs(e) {
  23243. e._initPromiseHub || (e._initPromiseHub = new I({
  23244. createPromise: function createPromise() {
  23245. var t = Promise.resolve();
  23246. var n;
  23247. n = 1, t = new Promise(function (e) {
  23248. setTimeout(function () {
  23249. e();
  23250. }, n);
  23251. });
  23252. var s = e.auth();
  23253. return t.then(function () {
  23254. return s.getLoginState();
  23255. }).then(function (e) {
  23256. return e ? Promise.resolve() : s.signInAnonymously();
  23257. });
  23258. }
  23259. }));
  23260. }
  23261. var Us = {
  23262. tcb: It,
  23263. tencent: It,
  23264. aliyun: ge,
  23265. private: bt
  23266. };
  23267. var Ls = new ( /*#__PURE__*/function () {
  23268. function _class7() {
  23269. (0, _classCallCheck2.default)(this, _class7);
  23270. }
  23271. (0, _createClass2.default)(_class7, [{
  23272. key: "init",
  23273. value: function init(e) {
  23274. var t = {};
  23275. var n = Us[e.provider];
  23276. if (!n) throw new Error("未提供正确的provider参数");
  23277. t = n.init(e), b && function (e) {
  23278. if (!b) return;
  23279. var t = {};
  23280. e.__dev__ = t, t.debugLog = b && ("web" === P && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === P);
  23281. var n = A;
  23282. n && !n.code && (t.debugInfo = n);
  23283. var s = new I({
  23284. createPromise: function createPromise() {
  23285. return xs(e);
  23286. }
  23287. });
  23288. t.initLocalNetwork = function () {
  23289. return s.exec();
  23290. };
  23291. }(t), Rs(t), xn(t), function (e) {
  23292. var t = e.uploadFile;
  23293. e.uploadFile = function (e) {
  23294. return t.call(this, e);
  23295. };
  23296. }(t), function (e) {
  23297. e.database = function (t) {
  23298. if (t && Object.keys(t).length > 0) return e.init(t).database();
  23299. if (this._database) return this._database;
  23300. var n = Bn($n, {
  23301. uniClient: e
  23302. });
  23303. return this._database = n, n;
  23304. }, e.databaseForJQL = function (t) {
  23305. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  23306. if (this._databaseForJQL) return this._databaseForJQL;
  23307. var n = Bn($n, {
  23308. uniClient: e,
  23309. isJQL: !0
  23310. });
  23311. return this._databaseForJQL = n, n;
  23312. };
  23313. }(t), function (e) {
  23314. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  23315. get mixinDatacom() {
  23316. return Ss(e);
  23317. }
  23318. }), e.SSEChannel = Es, e.initSecureNetworkByWeixin = Ps(e), e.importObject = bs(e);
  23319. }(t);
  23320. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  23321. if (!t[e]) return;
  23322. var n = t[e];
  23323. t[e] = function () {
  23324. return n.apply(t, Array.from(arguments));
  23325. }, t[e] = function (e, t) {
  23326. return function (n) {
  23327. var _this25 = this;
  23328. var s = !1;
  23329. if ("callFunction" === t) {
  23330. var _e30 = n && n.type || u;
  23331. s = _e30 !== u;
  23332. }
  23333. var r = "callFunction" === t && !s,
  23334. i = this._initPromiseHub.exec();
  23335. n = n || {};
  23336. var _te2 = te(n),
  23337. o = _te2.success,
  23338. a = _te2.fail,
  23339. c = _te2.complete,
  23340. h = i.then(function () {
  23341. return s ? Promise.resolve() : q(M(t, "invoke"), n);
  23342. }).then(function () {
  23343. return e.call(_this25, n);
  23344. }).then(function (e) {
  23345. return s ? Promise.resolve(e) : q(M(t, "success"), e).then(function () {
  23346. return q(M(t, "complete"), e);
  23347. }).then(function () {
  23348. return r && Q(B, {
  23349. type: J,
  23350. content: e
  23351. }), Promise.resolve(e);
  23352. });
  23353. }, function (e) {
  23354. return s ? Promise.reject(e) : q(M(t, "fail"), e).then(function () {
  23355. return q(M(t, "complete"), e);
  23356. }).then(function () {
  23357. return Q(B, {
  23358. type: J,
  23359. content: e
  23360. }), Promise.reject(e);
  23361. });
  23362. });
  23363. if (!(o || a || c)) return h;
  23364. h.then(function (e) {
  23365. o && o(e), c && c(e), r && Q(B, {
  23366. type: J,
  23367. content: e
  23368. });
  23369. }, function (e) {
  23370. a && a(e), c && c(e), r && Q(B, {
  23371. type: J,
  23372. content: e
  23373. });
  23374. });
  23375. };
  23376. }(t[e], e).bind(t);
  23377. }), t.init = this.init, t;
  23378. }
  23379. }]);
  23380. return _class7;
  23381. }())();
  23382. (function () {
  23383. var e = E;
  23384. var t = {};
  23385. if (e && 1 === e.length) t = e[0], Ls = Ls.init(t), Ls._isDefault = !0;else {
  23386. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  23387. var _n16;
  23388. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  23389. Ls[e] = function () {
  23390. return console.error(_n16), Promise.reject(new ne({
  23391. code: "SYS_ERR",
  23392. message: _n16
  23393. }));
  23394. };
  23395. });
  23396. }
  23397. Object.assign(Ls, {
  23398. get mixinDatacom() {
  23399. return Ss(Ls);
  23400. }
  23401. }), fs(Ls), Ls.addInterceptor = D, Ls.removeInterceptor = F, Ls.interceptObject = K, b && "web" === P && (window.uniCloud = Ls);
  23402. })();
  23403. var Ns = Ls;
  23404. exports.default = Ns;
  23405. /* 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"]))
  23406. /***/ }),
  23407. /***/ 427:
  23408. /*!****************************************************************!*\
  23409. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  23410. \****************************************************************/
  23411. /*! no static exports found */
  23412. /***/ (function(module, exports, __webpack_require__) {
  23413. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 403);
  23414. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  23415. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 428);
  23416. var construct = __webpack_require__(/*! ./construct.js */ 15);
  23417. function _wrapNativeSuper(Class) {
  23418. var _cache = typeof Map === "function" ? new Map() : undefined;
  23419. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  23420. if (Class === null || !isNativeFunction(Class)) return Class;
  23421. if (typeof Class !== "function") {
  23422. throw new TypeError("Super expression must either be null or a function");
  23423. }
  23424. if (typeof _cache !== "undefined") {
  23425. if (_cache.has(Class)) return _cache.get(Class);
  23426. _cache.set(Class, Wrapper);
  23427. }
  23428. function Wrapper() {
  23429. return construct(Class, arguments, getPrototypeOf(this).constructor);
  23430. }
  23431. Wrapper.prototype = Object.create(Class.prototype, {
  23432. constructor: {
  23433. value: Wrapper,
  23434. enumerable: false,
  23435. writable: true,
  23436. configurable: true
  23437. }
  23438. });
  23439. return setPrototypeOf(Wrapper, Class);
  23440. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23441. return _wrapNativeSuper(Class);
  23442. }
  23443. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23444. /***/ }),
  23445. /***/ 428:
  23446. /*!*****************************************************************!*\
  23447. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  23448. \*****************************************************************/
  23449. /*! no static exports found */
  23450. /***/ (function(module, exports) {
  23451. function _isNativeFunction(fn) {
  23452. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  23453. }
  23454. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23455. /***/ }),
  23456. /***/ 429:
  23457. /*!**************************************************************************!*\
  23458. !*** D:/project/material_applet/pages.json?{"type":"origin-pages-json"} ***!
  23459. \**************************************************************************/
  23460. /*! no static exports found */
  23461. /***/ (function(module, exports, __webpack_require__) {
  23462. "use strict";
  23463. Object.defineProperty(exports, "__esModule", {
  23464. value: true
  23465. });
  23466. exports.default = void 0;
  23467. var _default = {
  23468. "pages": [{
  23469. "path": "pages/index/index",
  23470. "style": {
  23471. "navigationBarTitleText": "系统页"
  23472. }
  23473. }, {
  23474. "path": "pages/login/index",
  23475. "style": {
  23476. "navigationBarTitleText": "登录"
  23477. }
  23478. }, {
  23479. "path": "pages/register/index",
  23480. "style": {
  23481. "navigationBarTitleText": "注册"
  23482. }
  23483. }, {
  23484. "path": "pages/home/index",
  23485. "style": {
  23486. "navigationBarTitleText": "首页",
  23487. "enablePullDownRefresh": true
  23488. }
  23489. }, {
  23490. "path": "pages/good/index",
  23491. "style": {
  23492. "navigationBarTitleText": "所有商品",
  23493. "enablePullDownRefresh": true
  23494. }
  23495. }, {
  23496. "path": "pages/market/index",
  23497. "style": {
  23498. "navigationBarTitleText": "购物车"
  23499. }
  23500. }, {
  23501. "path": "pages/my/index",
  23502. "style": {
  23503. "navigationBarTitleText": "我的"
  23504. }
  23505. }],
  23506. "subPackages": [{
  23507. "root": "pagesMy",
  23508. "pages": [{
  23509. "path": "order/index",
  23510. "style": {
  23511. "navigationBarTitleText": "订单",
  23512. "enablePullDownRefresh": true
  23513. }
  23514. }, {
  23515. "path": "order/order",
  23516. "style": {
  23517. "navigationBarTitleText": "订单管理",
  23518. "enablePullDownRefresh": true
  23519. }
  23520. }, {
  23521. "path": "order/detail",
  23522. "style": {
  23523. "navigationBarTitleText": "订单详情"
  23524. }
  23525. }, {
  23526. "path": "repair/index",
  23527. "style": {
  23528. "navigationBarTitleText": "维修",
  23529. "enablePullDownRefresh": true
  23530. }
  23531. }, {
  23532. "path": "repair/detail",
  23533. "style": {
  23534. "navigationBarTitleText": "维修详情"
  23535. }
  23536. }, {
  23537. "path": "account/index",
  23538. "style": {
  23539. "navigationBarTitleText": "账号设置",
  23540. "enablePullDownRefresh": true
  23541. }
  23542. }, {
  23543. "path": "account/info",
  23544. "style": {
  23545. "navigationBarTitleText": "账号详情"
  23546. }
  23547. }, {
  23548. "path": "account/update",
  23549. "style": {
  23550. "navigationBarTitleText": "修改密码"
  23551. }
  23552. }, {
  23553. "path": "user/index",
  23554. "style": {
  23555. "navigationBarTitleText": "用户管理",
  23556. "enablePullDownRefresh": true
  23557. }
  23558. }, {
  23559. "path": "buyExamine/index",
  23560. "style": {
  23561. "navigationBarTitleText": "采购审批",
  23562. "enablePullDownRefresh": true
  23563. }
  23564. }, {
  23565. "path": "collectionExamin/index",
  23566. "style": {
  23567. "navigationBarTitleText": "回款审批",
  23568. "enablePullDownRefresh": true
  23569. }
  23570. }, {
  23571. "path": "maintenance/index",
  23572. "style": {
  23573. "navigationBarTitleText": "维修记录",
  23574. "enablePullDownRefresh": true
  23575. }
  23576. }, {
  23577. "path": "record/index",
  23578. "style": {
  23579. "navigationBarTitleText": "回款记录",
  23580. "enablePullDownRefresh": true
  23581. }
  23582. }, {
  23583. "path": "goods/index",
  23584. "style": {
  23585. "navigationBarTitleText": "商品管理",
  23586. "enablePullDownRefresh": true
  23587. }
  23588. }, {
  23589. "path": "goods/add",
  23590. "style": {
  23591. "navigationBarTitleText": "新增商品"
  23592. }
  23593. }, {
  23594. "path": "spec/index",
  23595. "style": {
  23596. "navigationBarTitleText": "商品规格",
  23597. "enablePullDownRefresh": true
  23598. }
  23599. }, {
  23600. "path": "spec/add",
  23601. "style": {
  23602. "navigationBarTitleText": "新增规格"
  23603. }
  23604. }]
  23605. }, {
  23606. "root": "pagesGoods",
  23607. "pages": [{
  23608. "path": "index/index",
  23609. "style": {
  23610. "navigationBarTitleText": "商品详情"
  23611. }
  23612. }, {
  23613. "path": "sort/index",
  23614. "style": {
  23615. "navigationBarTitleText": "商品分类",
  23616. "enablePullDownRefresh": true
  23617. }
  23618. }, {
  23619. "path": "shop/index",
  23620. "style": {
  23621. "navigationBarTitleText": "店铺",
  23622. "enablePullDownRefresh": true
  23623. }
  23624. }]
  23625. }],
  23626. "globalStyle": {
  23627. "pageOrientation": "portrait",
  23628. "navigationBarTitleText": "耗材小程序",
  23629. "navigationBarTextStyle": "white",
  23630. "navigationBarBackgroundColor": "#007AFF",
  23631. "backgroundColor": "#F8F8F8",
  23632. "backgroundColorTop": "#F4F5F6",
  23633. "backgroundColorBottom": "#F4F5F6"
  23634. },
  23635. "tabBar": {
  23636. "color": "#7A7E83",
  23637. "selectedColor": "#007AFF",
  23638. "borderStyle": "black",
  23639. "backgroundColor": "#F8F8F8",
  23640. "list": [{
  23641. "pagePath": "pages/home/index",
  23642. "iconPath": "static/home.png",
  23643. "selectedIconPath": "static/homeHL.png",
  23644. "text": "首页"
  23645. }, {
  23646. "pagePath": "pages/good/index",
  23647. "iconPath": "static/good.png",
  23648. "selectedIconPath": "static/goodHL.png",
  23649. "text": "全部商品"
  23650. }, {
  23651. "pagePath": "pages/market/index",
  23652. "iconPath": "static/shop.png",
  23653. "selectedIconPath": "static/shopHL.png",
  23654. "text": "购物车"
  23655. }, {
  23656. "pagePath": "pages/my/index",
  23657. "iconPath": "static/my.png",
  23658. "selectedIconPath": "static/myHL.png",
  23659. "text": "我的"
  23660. }]
  23661. },
  23662. "condition": {
  23663. "current": 0,
  23664. "list": [{
  23665. "name": "系统首页",
  23666. "path": "pages/index/index",
  23667. "query": ""
  23668. }]
  23669. }
  23670. };
  23671. exports.default = _default;
  23672. /***/ }),
  23673. /***/ 430:
  23674. /*!*************************************************************!*\
  23675. !*** D:/project/material_applet/pages.json?{"type":"stat"} ***!
  23676. \*************************************************************/
  23677. /*! no static exports found */
  23678. /***/ (function(module, exports, __webpack_require__) {
  23679. "use strict";
  23680. Object.defineProperty(exports, "__esModule", {
  23681. value: true
  23682. });
  23683. exports.default = void 0;
  23684. var _default = {
  23685. "appid": "__UNI__617FB52"
  23686. };
  23687. exports.default = _default;
  23688. /***/ }),
  23689. /***/ 487:
  23690. /*!***************************************************************************************************!*\
  23691. !*** D:/project/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js ***!
  23692. \***************************************************************************************************/
  23693. /*! no static exports found */
  23694. /***/ (function(module, exports, __webpack_require__) {
  23695. "use strict";
  23696. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  23697. Object.defineProperty(exports, "__esModule", {
  23698. value: true
  23699. });
  23700. exports.default = void 0;
  23701. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 488));
  23702. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 489));
  23703. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 490));
  23704. var _default = {
  23705. en: _en.default,
  23706. 'zh-Hans': _zhHans.default,
  23707. 'zh-Hant': _zhHant.default
  23708. };
  23709. exports.default = _default;
  23710. /***/ }),
  23711. /***/ 488:
  23712. /*!**************************************************************************************************!*\
  23713. !*** D:/project/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json ***!
  23714. \**************************************************************************************************/
  23715. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  23716. /***/ (function(module) {
  23717. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"shop\",\"uni-goods-nav.options.cart\":\"cart\",\"uni-goods-nav.buttonGroup.addToCart\":\"add to cart\",\"uni-goods-nav.buttonGroup.buyNow\":\"buy now\"}");
  23718. /***/ }),
  23719. /***/ 489:
  23720. /*!*******************************************************************************************************!*\
  23721. !*** D:/project/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json ***!
  23722. \*******************************************************************************************************/
  23723. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  23724. /***/ (function(module) {
  23725. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店铺\",\"uni-goods-nav.options.cart\":\"购物车\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入购物车\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即购买\"}");
  23726. /***/ }),
  23727. /***/ 490:
  23728. /*!*******************************************************************************************************!*\
  23729. !*** D:/project/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json ***!
  23730. \*******************************************************************************************************/
  23731. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  23732. /***/ (function(module) {
  23733. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店鋪\",\"uni-goods-nav.options.cart\":\"購物車\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入購物車\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即購買\"}");
  23734. /***/ }),
  23735. /***/ 5:
  23736. /*!**************************************************************!*\
  23737. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  23738. \**************************************************************/
  23739. /*! no static exports found */
  23740. /***/ (function(module, exports, __webpack_require__) {
  23741. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  23742. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  23743. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  23744. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  23745. function _slicedToArray(arr, i) {
  23746. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  23747. }
  23748. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23749. /***/ }),
  23750. /***/ 505:
  23751. /*!**************************************************************************************!*\
  23752. !*** D:/project/material_applet/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  23753. \**************************************************************************************/
  23754. /*! no static exports found */
  23755. /***/ (function(module, exports, __webpack_require__) {
  23756. "use strict";
  23757. Object.defineProperty(exports, "__esModule", {
  23758. value: true
  23759. });
  23760. exports.default = void 0;
  23761. var _default = {
  23762. "id": "2852637",
  23763. "name": "uniui图标库",
  23764. "font_family": "uniicons",
  23765. "css_prefix_text": "uniui-",
  23766. "description": "",
  23767. "glyphs": [{
  23768. "icon_id": "25027049",
  23769. "name": "yanse",
  23770. "font_class": "color",
  23771. "unicode": "e6cf",
  23772. "unicode_decimal": 59087
  23773. }, {
  23774. "icon_id": "25027048",
  23775. "name": "wallet",
  23776. "font_class": "wallet",
  23777. "unicode": "e6b1",
  23778. "unicode_decimal": 59057
  23779. }, {
  23780. "icon_id": "25015720",
  23781. "name": "settings-filled",
  23782. "font_class": "settings-filled",
  23783. "unicode": "e6ce",
  23784. "unicode_decimal": 59086
  23785. }, {
  23786. "icon_id": "25015434",
  23787. "name": "shimingrenzheng-filled",
  23788. "font_class": "auth-filled",
  23789. "unicode": "e6cc",
  23790. "unicode_decimal": 59084
  23791. }, {
  23792. "icon_id": "24934246",
  23793. "name": "shop-filled",
  23794. "font_class": "shop-filled",
  23795. "unicode": "e6cd",
  23796. "unicode_decimal": 59085
  23797. }, {
  23798. "icon_id": "24934159",
  23799. "name": "staff-filled-01",
  23800. "font_class": "staff-filled",
  23801. "unicode": "e6cb",
  23802. "unicode_decimal": 59083
  23803. }, {
  23804. "icon_id": "24932461",
  23805. "name": "VIP-filled",
  23806. "font_class": "vip-filled",
  23807. "unicode": "e6c6",
  23808. "unicode_decimal": 59078
  23809. }, {
  23810. "icon_id": "24932462",
  23811. "name": "plus_circle_fill",
  23812. "font_class": "plus-filled",
  23813. "unicode": "e6c7",
  23814. "unicode_decimal": 59079
  23815. }, {
  23816. "icon_id": "24932463",
  23817. "name": "folder_add-filled",
  23818. "font_class": "folder-add-filled",
  23819. "unicode": "e6c8",
  23820. "unicode_decimal": 59080
  23821. }, {
  23822. "icon_id": "24932464",
  23823. "name": "yanse-filled",
  23824. "font_class": "color-filled",
  23825. "unicode": "e6c9",
  23826. "unicode_decimal": 59081
  23827. }, {
  23828. "icon_id": "24932465",
  23829. "name": "tune-filled",
  23830. "font_class": "tune-filled",
  23831. "unicode": "e6ca",
  23832. "unicode_decimal": 59082
  23833. }, {
  23834. "icon_id": "24932455",
  23835. "name": "a-rilidaka-filled",
  23836. "font_class": "calendar-filled",
  23837. "unicode": "e6c0",
  23838. "unicode_decimal": 59072
  23839. }, {
  23840. "icon_id": "24932456",
  23841. "name": "notification-filled",
  23842. "font_class": "notification-filled",
  23843. "unicode": "e6c1",
  23844. "unicode_decimal": 59073
  23845. }, {
  23846. "icon_id": "24932457",
  23847. "name": "wallet-filled",
  23848. "font_class": "wallet-filled",
  23849. "unicode": "e6c2",
  23850. "unicode_decimal": 59074
  23851. }, {
  23852. "icon_id": "24932458",
  23853. "name": "paihangbang-filled",
  23854. "font_class": "medal-filled",
  23855. "unicode": "e6c3",
  23856. "unicode_decimal": 59075
  23857. }, {
  23858. "icon_id": "24932459",
  23859. "name": "gift-filled",
  23860. "font_class": "gift-filled",
  23861. "unicode": "e6c4",
  23862. "unicode_decimal": 59076
  23863. }, {
  23864. "icon_id": "24932460",
  23865. "name": "fire-filled",
  23866. "font_class": "fire-filled",
  23867. "unicode": "e6c5",
  23868. "unicode_decimal": 59077
  23869. }, {
  23870. "icon_id": "24928001",
  23871. "name": "refreshempty",
  23872. "font_class": "refreshempty",
  23873. "unicode": "e6bf",
  23874. "unicode_decimal": 59071
  23875. }, {
  23876. "icon_id": "24926853",
  23877. "name": "location-ellipse",
  23878. "font_class": "location-filled",
  23879. "unicode": "e6af",
  23880. "unicode_decimal": 59055
  23881. }, {
  23882. "icon_id": "24926735",
  23883. "name": "person-filled",
  23884. "font_class": "person-filled",
  23885. "unicode": "e69d",
  23886. "unicode_decimal": 59037
  23887. }, {
  23888. "icon_id": "24926703",
  23889. "name": "personadd-filled",
  23890. "font_class": "personadd-filled",
  23891. "unicode": "e698",
  23892. "unicode_decimal": 59032
  23893. }, {
  23894. "icon_id": "24923351",
  23895. "name": "back",
  23896. "font_class": "back",
  23897. "unicode": "e6b9",
  23898. "unicode_decimal": 59065
  23899. }, {
  23900. "icon_id": "24923352",
  23901. "name": "forward",
  23902. "font_class": "forward",
  23903. "unicode": "e6ba",
  23904. "unicode_decimal": 59066
  23905. }, {
  23906. "icon_id": "24923353",
  23907. "name": "arrowthinright",
  23908. "font_class": "arrow-right",
  23909. "unicode": "e6bb",
  23910. "unicode_decimal": 59067
  23911. }, {
  23912. "icon_id": "24923353",
  23913. "name": "arrowthinright",
  23914. "font_class": "arrowthinright",
  23915. "unicode": "e6bb",
  23916. "unicode_decimal": 59067
  23917. }, {
  23918. "icon_id": "24923354",
  23919. "name": "arrowthinleft",
  23920. "font_class": "arrow-left",
  23921. "unicode": "e6bc",
  23922. "unicode_decimal": 59068
  23923. }, {
  23924. "icon_id": "24923354",
  23925. "name": "arrowthinleft",
  23926. "font_class": "arrowthinleft",
  23927. "unicode": "e6bc",
  23928. "unicode_decimal": 59068
  23929. }, {
  23930. "icon_id": "24923355",
  23931. "name": "arrowthinup",
  23932. "font_class": "arrow-up",
  23933. "unicode": "e6bd",
  23934. "unicode_decimal": 59069
  23935. }, {
  23936. "icon_id": "24923355",
  23937. "name": "arrowthinup",
  23938. "font_class": "arrowthinup",
  23939. "unicode": "e6bd",
  23940. "unicode_decimal": 59069
  23941. }, {
  23942. "icon_id": "24923356",
  23943. "name": "arrowthindown",
  23944. "font_class": "arrow-down",
  23945. "unicode": "e6be",
  23946. "unicode_decimal": 59070
  23947. }, {
  23948. "icon_id": "24923356",
  23949. "name": "arrowthindown",
  23950. "font_class": "arrowthindown",
  23951. "unicode": "e6be",
  23952. "unicode_decimal": 59070
  23953. }, {
  23954. "icon_id": "24923349",
  23955. "name": "arrowdown",
  23956. "font_class": "bottom",
  23957. "unicode": "e6b8",
  23958. "unicode_decimal": 59064
  23959. }, {
  23960. "icon_id": "24923349",
  23961. "name": "arrowdown",
  23962. "font_class": "arrowdown",
  23963. "unicode": "e6b8",
  23964. "unicode_decimal": 59064
  23965. }, {
  23966. "icon_id": "24923346",
  23967. "name": "arrowright",
  23968. "font_class": "right",
  23969. "unicode": "e6b5",
  23970. "unicode_decimal": 59061
  23971. }, {
  23972. "icon_id": "24923346",
  23973. "name": "arrowright",
  23974. "font_class": "arrowright",
  23975. "unicode": "e6b5",
  23976. "unicode_decimal": 59061
  23977. }, {
  23978. "icon_id": "24923347",
  23979. "name": "arrowup",
  23980. "font_class": "top",
  23981. "unicode": "e6b6",
  23982. "unicode_decimal": 59062
  23983. }, {
  23984. "icon_id": "24923347",
  23985. "name": "arrowup",
  23986. "font_class": "arrowup",
  23987. "unicode": "e6b6",
  23988. "unicode_decimal": 59062
  23989. }, {
  23990. "icon_id": "24923348",
  23991. "name": "arrowleft",
  23992. "font_class": "left",
  23993. "unicode": "e6b7",
  23994. "unicode_decimal": 59063
  23995. }, {
  23996. "icon_id": "24923348",
  23997. "name": "arrowleft",
  23998. "font_class": "arrowleft",
  23999. "unicode": "e6b7",
  24000. "unicode_decimal": 59063
  24001. }, {
  24002. "icon_id": "24923334",
  24003. "name": "eye",
  24004. "font_class": "eye",
  24005. "unicode": "e651",
  24006. "unicode_decimal": 58961
  24007. }, {
  24008. "icon_id": "24923335",
  24009. "name": "eye-filled",
  24010. "font_class": "eye-filled",
  24011. "unicode": "e66a",
  24012. "unicode_decimal": 58986
  24013. }, {
  24014. "icon_id": "24923336",
  24015. "name": "eye-slash",
  24016. "font_class": "eye-slash",
  24017. "unicode": "e6b3",
  24018. "unicode_decimal": 59059
  24019. }, {
  24020. "icon_id": "24923337",
  24021. "name": "eye-slash-filled",
  24022. "font_class": "eye-slash-filled",
  24023. "unicode": "e6b4",
  24024. "unicode_decimal": 59060
  24025. }, {
  24026. "icon_id": "24923305",
  24027. "name": "info-filled",
  24028. "font_class": "info-filled",
  24029. "unicode": "e649",
  24030. "unicode_decimal": 58953
  24031. }, {
  24032. "icon_id": "24923299",
  24033. "name": "reload-01",
  24034. "font_class": "reload",
  24035. "unicode": "e6b2",
  24036. "unicode_decimal": 59058
  24037. }, {
  24038. "icon_id": "24923195",
  24039. "name": "mic_slash_fill",
  24040. "font_class": "micoff-filled",
  24041. "unicode": "e6b0",
  24042. "unicode_decimal": 59056
  24043. }, {
  24044. "icon_id": "24923165",
  24045. "name": "map-pin-ellipse",
  24046. "font_class": "map-pin-ellipse",
  24047. "unicode": "e6ac",
  24048. "unicode_decimal": 59052
  24049. }, {
  24050. "icon_id": "24923166",
  24051. "name": "map-pin",
  24052. "font_class": "map-pin",
  24053. "unicode": "e6ad",
  24054. "unicode_decimal": 59053
  24055. }, {
  24056. "icon_id": "24923167",
  24057. "name": "location",
  24058. "font_class": "location",
  24059. "unicode": "e6ae",
  24060. "unicode_decimal": 59054
  24061. }, {
  24062. "icon_id": "24923064",
  24063. "name": "starhalf",
  24064. "font_class": "starhalf",
  24065. "unicode": "e683",
  24066. "unicode_decimal": 59011
  24067. }, {
  24068. "icon_id": "24923065",
  24069. "name": "star",
  24070. "font_class": "star",
  24071. "unicode": "e688",
  24072. "unicode_decimal": 59016
  24073. }, {
  24074. "icon_id": "24923066",
  24075. "name": "star-filled",
  24076. "font_class": "star-filled",
  24077. "unicode": "e68f",
  24078. "unicode_decimal": 59023
  24079. }, {
  24080. "icon_id": "24899646",
  24081. "name": "a-rilidaka",
  24082. "font_class": "calendar",
  24083. "unicode": "e6a0",
  24084. "unicode_decimal": 59040
  24085. }, {
  24086. "icon_id": "24899647",
  24087. "name": "fire",
  24088. "font_class": "fire",
  24089. "unicode": "e6a1",
  24090. "unicode_decimal": 59041
  24091. }, {
  24092. "icon_id": "24899648",
  24093. "name": "paihangbang",
  24094. "font_class": "medal",
  24095. "unicode": "e6a2",
  24096. "unicode_decimal": 59042
  24097. }, {
  24098. "icon_id": "24899649",
  24099. "name": "font",
  24100. "font_class": "font",
  24101. "unicode": "e6a3",
  24102. "unicode_decimal": 59043
  24103. }, {
  24104. "icon_id": "24899650",
  24105. "name": "gift",
  24106. "font_class": "gift",
  24107. "unicode": "e6a4",
  24108. "unicode_decimal": 59044
  24109. }, {
  24110. "icon_id": "24899651",
  24111. "name": "link",
  24112. "font_class": "link",
  24113. "unicode": "e6a5",
  24114. "unicode_decimal": 59045
  24115. }, {
  24116. "icon_id": "24899652",
  24117. "name": "notification",
  24118. "font_class": "notification",
  24119. "unicode": "e6a6",
  24120. "unicode_decimal": 59046
  24121. }, {
  24122. "icon_id": "24899653",
  24123. "name": "staff",
  24124. "font_class": "staff",
  24125. "unicode": "e6a7",
  24126. "unicode_decimal": 59047
  24127. }, {
  24128. "icon_id": "24899654",
  24129. "name": "VIP",
  24130. "font_class": "vip",
  24131. "unicode": "e6a8",
  24132. "unicode_decimal": 59048
  24133. }, {
  24134. "icon_id": "24899655",
  24135. "name": "folder_add",
  24136. "font_class": "folder-add",
  24137. "unicode": "e6a9",
  24138. "unicode_decimal": 59049
  24139. }, {
  24140. "icon_id": "24899656",
  24141. "name": "tune",
  24142. "font_class": "tune",
  24143. "unicode": "e6aa",
  24144. "unicode_decimal": 59050
  24145. }, {
  24146. "icon_id": "24899657",
  24147. "name": "shimingrenzheng",
  24148. "font_class": "auth",
  24149. "unicode": "e6ab",
  24150. "unicode_decimal": 59051
  24151. }, {
  24152. "icon_id": "24899565",
  24153. "name": "person",
  24154. "font_class": "person",
  24155. "unicode": "e699",
  24156. "unicode_decimal": 59033
  24157. }, {
  24158. "icon_id": "24899566",
  24159. "name": "email-filled",
  24160. "font_class": "email-filled",
  24161. "unicode": "e69a",
  24162. "unicode_decimal": 59034
  24163. }, {
  24164. "icon_id": "24899567",
  24165. "name": "phone-filled",
  24166. "font_class": "phone-filled",
  24167. "unicode": "e69b",
  24168. "unicode_decimal": 59035
  24169. }, {
  24170. "icon_id": "24899568",
  24171. "name": "phone",
  24172. "font_class": "phone",
  24173. "unicode": "e69c",
  24174. "unicode_decimal": 59036
  24175. }, {
  24176. "icon_id": "24899570",
  24177. "name": "email",
  24178. "font_class": "email",
  24179. "unicode": "e69e",
  24180. "unicode_decimal": 59038
  24181. }, {
  24182. "icon_id": "24899571",
  24183. "name": "personadd",
  24184. "font_class": "personadd",
  24185. "unicode": "e69f",
  24186. "unicode_decimal": 59039
  24187. }, {
  24188. "icon_id": "24899558",
  24189. "name": "chatboxes-filled",
  24190. "font_class": "chatboxes-filled",
  24191. "unicode": "e692",
  24192. "unicode_decimal": 59026
  24193. }, {
  24194. "icon_id": "24899559",
  24195. "name": "contact",
  24196. "font_class": "contact",
  24197. "unicode": "e693",
  24198. "unicode_decimal": 59027
  24199. }, {
  24200. "icon_id": "24899560",
  24201. "name": "chatbubble-filled",
  24202. "font_class": "chatbubble-filled",
  24203. "unicode": "e694",
  24204. "unicode_decimal": 59028
  24205. }, {
  24206. "icon_id": "24899561",
  24207. "name": "contact-filled",
  24208. "font_class": "contact-filled",
  24209. "unicode": "e695",
  24210. "unicode_decimal": 59029
  24211. }, {
  24212. "icon_id": "24899562",
  24213. "name": "chatboxes",
  24214. "font_class": "chatboxes",
  24215. "unicode": "e696",
  24216. "unicode_decimal": 59030
  24217. }, {
  24218. "icon_id": "24899563",
  24219. "name": "chatbubble",
  24220. "font_class": "chatbubble",
  24221. "unicode": "e697",
  24222. "unicode_decimal": 59031
  24223. }, {
  24224. "icon_id": "24881290",
  24225. "name": "upload-filled",
  24226. "font_class": "upload-filled",
  24227. "unicode": "e68e",
  24228. "unicode_decimal": 59022
  24229. }, {
  24230. "icon_id": "24881292",
  24231. "name": "upload",
  24232. "font_class": "upload",
  24233. "unicode": "e690",
  24234. "unicode_decimal": 59024
  24235. }, {
  24236. "icon_id": "24881293",
  24237. "name": "weixin",
  24238. "font_class": "weixin",
  24239. "unicode": "e691",
  24240. "unicode_decimal": 59025
  24241. }, {
  24242. "icon_id": "24881274",
  24243. "name": "compose",
  24244. "font_class": "compose",
  24245. "unicode": "e67f",
  24246. "unicode_decimal": 59007
  24247. }, {
  24248. "icon_id": "24881275",
  24249. "name": "qq",
  24250. "font_class": "qq",
  24251. "unicode": "e680",
  24252. "unicode_decimal": 59008
  24253. }, {
  24254. "icon_id": "24881276",
  24255. "name": "download-filled",
  24256. "font_class": "download-filled",
  24257. "unicode": "e681",
  24258. "unicode_decimal": 59009
  24259. }, {
  24260. "icon_id": "24881277",
  24261. "name": "pengyouquan",
  24262. "font_class": "pyq",
  24263. "unicode": "e682",
  24264. "unicode_decimal": 59010
  24265. }, {
  24266. "icon_id": "24881279",
  24267. "name": "sound",
  24268. "font_class": "sound",
  24269. "unicode": "e684",
  24270. "unicode_decimal": 59012
  24271. }, {
  24272. "icon_id": "24881280",
  24273. "name": "trash-filled",
  24274. "font_class": "trash-filled",
  24275. "unicode": "e685",
  24276. "unicode_decimal": 59013
  24277. }, {
  24278. "icon_id": "24881281",
  24279. "name": "sound-filled",
  24280. "font_class": "sound-filled",
  24281. "unicode": "e686",
  24282. "unicode_decimal": 59014
  24283. }, {
  24284. "icon_id": "24881282",
  24285. "name": "trash",
  24286. "font_class": "trash",
  24287. "unicode": "e687",
  24288. "unicode_decimal": 59015
  24289. }, {
  24290. "icon_id": "24881284",
  24291. "name": "videocam-filled",
  24292. "font_class": "videocam-filled",
  24293. "unicode": "e689",
  24294. "unicode_decimal": 59017
  24295. }, {
  24296. "icon_id": "24881285",
  24297. "name": "spinner-cycle",
  24298. "font_class": "spinner-cycle",
  24299. "unicode": "e68a",
  24300. "unicode_decimal": 59018
  24301. }, {
  24302. "icon_id": "24881286",
  24303. "name": "weibo",
  24304. "font_class": "weibo",
  24305. "unicode": "e68b",
  24306. "unicode_decimal": 59019
  24307. }, {
  24308. "icon_id": "24881288",
  24309. "name": "videocam",
  24310. "font_class": "videocam",
  24311. "unicode": "e68c",
  24312. "unicode_decimal": 59020
  24313. }, {
  24314. "icon_id": "24881289",
  24315. "name": "download",
  24316. "font_class": "download",
  24317. "unicode": "e68d",
  24318. "unicode_decimal": 59021
  24319. }, {
  24320. "icon_id": "24879601",
  24321. "name": "help",
  24322. "font_class": "help",
  24323. "unicode": "e679",
  24324. "unicode_decimal": 59001
  24325. }, {
  24326. "icon_id": "24879602",
  24327. "name": "navigate-filled",
  24328. "font_class": "navigate-filled",
  24329. "unicode": "e67a",
  24330. "unicode_decimal": 59002
  24331. }, {
  24332. "icon_id": "24879603",
  24333. "name": "plusempty",
  24334. "font_class": "plusempty",
  24335. "unicode": "e67b",
  24336. "unicode_decimal": 59003
  24337. }, {
  24338. "icon_id": "24879604",
  24339. "name": "smallcircle",
  24340. "font_class": "smallcircle",
  24341. "unicode": "e67c",
  24342. "unicode_decimal": 59004
  24343. }, {
  24344. "icon_id": "24879605",
  24345. "name": "minus-filled",
  24346. "font_class": "minus-filled",
  24347. "unicode": "e67d",
  24348. "unicode_decimal": 59005
  24349. }, {
  24350. "icon_id": "24879606",
  24351. "name": "micoff",
  24352. "font_class": "micoff",
  24353. "unicode": "e67e",
  24354. "unicode_decimal": 59006
  24355. }, {
  24356. "icon_id": "24879588",
  24357. "name": "closeempty",
  24358. "font_class": "closeempty",
  24359. "unicode": "e66c",
  24360. "unicode_decimal": 58988
  24361. }, {
  24362. "icon_id": "24879589",
  24363. "name": "clear",
  24364. "font_class": "clear",
  24365. "unicode": "e66d",
  24366. "unicode_decimal": 58989
  24367. }, {
  24368. "icon_id": "24879590",
  24369. "name": "navigate",
  24370. "font_class": "navigate",
  24371. "unicode": "e66e",
  24372. "unicode_decimal": 58990
  24373. }, {
  24374. "icon_id": "24879591",
  24375. "name": "minus",
  24376. "font_class": "minus",
  24377. "unicode": "e66f",
  24378. "unicode_decimal": 58991
  24379. }, {
  24380. "icon_id": "24879592",
  24381. "name": "image",
  24382. "font_class": "image",
  24383. "unicode": "e670",
  24384. "unicode_decimal": 58992
  24385. }, {
  24386. "icon_id": "24879593",
  24387. "name": "mic",
  24388. "font_class": "mic",
  24389. "unicode": "e671",
  24390. "unicode_decimal": 58993
  24391. }, {
  24392. "icon_id": "24879594",
  24393. "name": "paperplane",
  24394. "font_class": "paperplane",
  24395. "unicode": "e672",
  24396. "unicode_decimal": 58994
  24397. }, {
  24398. "icon_id": "24879595",
  24399. "name": "close",
  24400. "font_class": "close",
  24401. "unicode": "e673",
  24402. "unicode_decimal": 58995
  24403. }, {
  24404. "icon_id": "24879596",
  24405. "name": "help-filled",
  24406. "font_class": "help-filled",
  24407. "unicode": "e674",
  24408. "unicode_decimal": 58996
  24409. }, {
  24410. "icon_id": "24879597",
  24411. "name": "plus-filled",
  24412. "font_class": "paperplane-filled",
  24413. "unicode": "e675",
  24414. "unicode_decimal": 58997
  24415. }, {
  24416. "icon_id": "24879598",
  24417. "name": "plus",
  24418. "font_class": "plus",
  24419. "unicode": "e676",
  24420. "unicode_decimal": 58998
  24421. }, {
  24422. "icon_id": "24879599",
  24423. "name": "mic-filled",
  24424. "font_class": "mic-filled",
  24425. "unicode": "e677",
  24426. "unicode_decimal": 58999
  24427. }, {
  24428. "icon_id": "24879600",
  24429. "name": "image-filled",
  24430. "font_class": "image-filled",
  24431. "unicode": "e678",
  24432. "unicode_decimal": 59000
  24433. }, {
  24434. "icon_id": "24855900",
  24435. "name": "locked-filled",
  24436. "font_class": "locked-filled",
  24437. "unicode": "e668",
  24438. "unicode_decimal": 58984
  24439. }, {
  24440. "icon_id": "24855901",
  24441. "name": "info",
  24442. "font_class": "info",
  24443. "unicode": "e669",
  24444. "unicode_decimal": 58985
  24445. }, {
  24446. "icon_id": "24855903",
  24447. "name": "locked",
  24448. "font_class": "locked",
  24449. "unicode": "e66b",
  24450. "unicode_decimal": 58987
  24451. }, {
  24452. "icon_id": "24855884",
  24453. "name": "camera-filled",
  24454. "font_class": "camera-filled",
  24455. "unicode": "e658",
  24456. "unicode_decimal": 58968
  24457. }, {
  24458. "icon_id": "24855885",
  24459. "name": "chat-filled",
  24460. "font_class": "chat-filled",
  24461. "unicode": "e659",
  24462. "unicode_decimal": 58969
  24463. }, {
  24464. "icon_id": "24855886",
  24465. "name": "camera",
  24466. "font_class": "camera",
  24467. "unicode": "e65a",
  24468. "unicode_decimal": 58970
  24469. }, {
  24470. "icon_id": "24855887",
  24471. "name": "circle",
  24472. "font_class": "circle",
  24473. "unicode": "e65b",
  24474. "unicode_decimal": 58971
  24475. }, {
  24476. "icon_id": "24855888",
  24477. "name": "checkmarkempty",
  24478. "font_class": "checkmarkempty",
  24479. "unicode": "e65c",
  24480. "unicode_decimal": 58972
  24481. }, {
  24482. "icon_id": "24855889",
  24483. "name": "chat",
  24484. "font_class": "chat",
  24485. "unicode": "e65d",
  24486. "unicode_decimal": 58973
  24487. }, {
  24488. "icon_id": "24855890",
  24489. "name": "circle-filled",
  24490. "font_class": "circle-filled",
  24491. "unicode": "e65e",
  24492. "unicode_decimal": 58974
  24493. }, {
  24494. "icon_id": "24855891",
  24495. "name": "flag",
  24496. "font_class": "flag",
  24497. "unicode": "e65f",
  24498. "unicode_decimal": 58975
  24499. }, {
  24500. "icon_id": "24855892",
  24501. "name": "flag-filled",
  24502. "font_class": "flag-filled",
  24503. "unicode": "e660",
  24504. "unicode_decimal": 58976
  24505. }, {
  24506. "icon_id": "24855893",
  24507. "name": "gear-filled",
  24508. "font_class": "gear-filled",
  24509. "unicode": "e661",
  24510. "unicode_decimal": 58977
  24511. }, {
  24512. "icon_id": "24855894",
  24513. "name": "home",
  24514. "font_class": "home",
  24515. "unicode": "e662",
  24516. "unicode_decimal": 58978
  24517. }, {
  24518. "icon_id": "24855895",
  24519. "name": "home-filled",
  24520. "font_class": "home-filled",
  24521. "unicode": "e663",
  24522. "unicode_decimal": 58979
  24523. }, {
  24524. "icon_id": "24855896",
  24525. "name": "gear",
  24526. "font_class": "gear",
  24527. "unicode": "e664",
  24528. "unicode_decimal": 58980
  24529. }, {
  24530. "icon_id": "24855897",
  24531. "name": "smallcircle-filled",
  24532. "font_class": "smallcircle-filled",
  24533. "unicode": "e665",
  24534. "unicode_decimal": 58981
  24535. }, {
  24536. "icon_id": "24855898",
  24537. "name": "map-filled",
  24538. "font_class": "map-filled",
  24539. "unicode": "e666",
  24540. "unicode_decimal": 58982
  24541. }, {
  24542. "icon_id": "24855899",
  24543. "name": "map",
  24544. "font_class": "map",
  24545. "unicode": "e667",
  24546. "unicode_decimal": 58983
  24547. }, {
  24548. "icon_id": "24855825",
  24549. "name": "refresh-filled",
  24550. "font_class": "refresh-filled",
  24551. "unicode": "e656",
  24552. "unicode_decimal": 58966
  24553. }, {
  24554. "icon_id": "24855826",
  24555. "name": "refresh",
  24556. "font_class": "refresh",
  24557. "unicode": "e657",
  24558. "unicode_decimal": 58967
  24559. }, {
  24560. "icon_id": "24855808",
  24561. "name": "cloud-upload",
  24562. "font_class": "cloud-upload",
  24563. "unicode": "e645",
  24564. "unicode_decimal": 58949
  24565. }, {
  24566. "icon_id": "24855809",
  24567. "name": "cloud-download-filled",
  24568. "font_class": "cloud-download-filled",
  24569. "unicode": "e646",
  24570. "unicode_decimal": 58950
  24571. }, {
  24572. "icon_id": "24855810",
  24573. "name": "cloud-download",
  24574. "font_class": "cloud-download",
  24575. "unicode": "e647",
  24576. "unicode_decimal": 58951
  24577. }, {
  24578. "icon_id": "24855811",
  24579. "name": "cloud-upload-filled",
  24580. "font_class": "cloud-upload-filled",
  24581. "unicode": "e648",
  24582. "unicode_decimal": 58952
  24583. }, {
  24584. "icon_id": "24855813",
  24585. "name": "redo",
  24586. "font_class": "redo",
  24587. "unicode": "e64a",
  24588. "unicode_decimal": 58954
  24589. }, {
  24590. "icon_id": "24855814",
  24591. "name": "images-filled",
  24592. "font_class": "images-filled",
  24593. "unicode": "e64b",
  24594. "unicode_decimal": 58955
  24595. }, {
  24596. "icon_id": "24855815",
  24597. "name": "undo-filled",
  24598. "font_class": "undo-filled",
  24599. "unicode": "e64c",
  24600. "unicode_decimal": 58956
  24601. }, {
  24602. "icon_id": "24855816",
  24603. "name": "more",
  24604. "font_class": "more",
  24605. "unicode": "e64d",
  24606. "unicode_decimal": 58957
  24607. }, {
  24608. "icon_id": "24855817",
  24609. "name": "more-filled",
  24610. "font_class": "more-filled",
  24611. "unicode": "e64e",
  24612. "unicode_decimal": 58958
  24613. }, {
  24614. "icon_id": "24855818",
  24615. "name": "undo",
  24616. "font_class": "undo",
  24617. "unicode": "e64f",
  24618. "unicode_decimal": 58959
  24619. }, {
  24620. "icon_id": "24855819",
  24621. "name": "images",
  24622. "font_class": "images",
  24623. "unicode": "e650",
  24624. "unicode_decimal": 58960
  24625. }, {
  24626. "icon_id": "24855821",
  24627. "name": "paperclip",
  24628. "font_class": "paperclip",
  24629. "unicode": "e652",
  24630. "unicode_decimal": 58962
  24631. }, {
  24632. "icon_id": "24855822",
  24633. "name": "settings",
  24634. "font_class": "settings",
  24635. "unicode": "e653",
  24636. "unicode_decimal": 58963
  24637. }, {
  24638. "icon_id": "24855823",
  24639. "name": "search",
  24640. "font_class": "search",
  24641. "unicode": "e654",
  24642. "unicode_decimal": 58964
  24643. }, {
  24644. "icon_id": "24855824",
  24645. "name": "redo-filled",
  24646. "font_class": "redo-filled",
  24647. "unicode": "e655",
  24648. "unicode_decimal": 58965
  24649. }, {
  24650. "icon_id": "24841702",
  24651. "name": "list",
  24652. "font_class": "list",
  24653. "unicode": "e644",
  24654. "unicode_decimal": 58948
  24655. }, {
  24656. "icon_id": "24841489",
  24657. "name": "mail-open-filled",
  24658. "font_class": "mail-open-filled",
  24659. "unicode": "e63a",
  24660. "unicode_decimal": 58938
  24661. }, {
  24662. "icon_id": "24841491",
  24663. "name": "hand-thumbsdown-filled",
  24664. "font_class": "hand-down-filled",
  24665. "unicode": "e63c",
  24666. "unicode_decimal": 58940
  24667. }, {
  24668. "icon_id": "24841492",
  24669. "name": "hand-thumbsdown",
  24670. "font_class": "hand-down",
  24671. "unicode": "e63d",
  24672. "unicode_decimal": 58941
  24673. }, {
  24674. "icon_id": "24841493",
  24675. "name": "hand-thumbsup-filled",
  24676. "font_class": "hand-up-filled",
  24677. "unicode": "e63e",
  24678. "unicode_decimal": 58942
  24679. }, {
  24680. "icon_id": "24841494",
  24681. "name": "hand-thumbsup",
  24682. "font_class": "hand-up",
  24683. "unicode": "e63f",
  24684. "unicode_decimal": 58943
  24685. }, {
  24686. "icon_id": "24841496",
  24687. "name": "heart-filled",
  24688. "font_class": "heart-filled",
  24689. "unicode": "e641",
  24690. "unicode_decimal": 58945
  24691. }, {
  24692. "icon_id": "24841498",
  24693. "name": "mail-open",
  24694. "font_class": "mail-open",
  24695. "unicode": "e643",
  24696. "unicode_decimal": 58947
  24697. }, {
  24698. "icon_id": "24841488",
  24699. "name": "heart",
  24700. "font_class": "heart",
  24701. "unicode": "e639",
  24702. "unicode_decimal": 58937
  24703. }, {
  24704. "icon_id": "24839963",
  24705. "name": "loop",
  24706. "font_class": "loop",
  24707. "unicode": "e633",
  24708. "unicode_decimal": 58931
  24709. }, {
  24710. "icon_id": "24839866",
  24711. "name": "pulldown",
  24712. "font_class": "pulldown",
  24713. "unicode": "e632",
  24714. "unicode_decimal": 58930
  24715. }, {
  24716. "icon_id": "24813798",
  24717. "name": "scan",
  24718. "font_class": "scan",
  24719. "unicode": "e62a",
  24720. "unicode_decimal": 58922
  24721. }, {
  24722. "icon_id": "24813786",
  24723. "name": "bars",
  24724. "font_class": "bars",
  24725. "unicode": "e627",
  24726. "unicode_decimal": 58919
  24727. }, {
  24728. "icon_id": "24813788",
  24729. "name": "cart-filled",
  24730. "font_class": "cart-filled",
  24731. "unicode": "e629",
  24732. "unicode_decimal": 58921
  24733. }, {
  24734. "icon_id": "24813790",
  24735. "name": "checkbox",
  24736. "font_class": "checkbox",
  24737. "unicode": "e62b",
  24738. "unicode_decimal": 58923
  24739. }, {
  24740. "icon_id": "24813791",
  24741. "name": "checkbox-filled",
  24742. "font_class": "checkbox-filled",
  24743. "unicode": "e62c",
  24744. "unicode_decimal": 58924
  24745. }, {
  24746. "icon_id": "24813794",
  24747. "name": "shop",
  24748. "font_class": "shop",
  24749. "unicode": "e62f",
  24750. "unicode_decimal": 58927
  24751. }, {
  24752. "icon_id": "24813795",
  24753. "name": "headphones",
  24754. "font_class": "headphones",
  24755. "unicode": "e630",
  24756. "unicode_decimal": 58928
  24757. }, {
  24758. "icon_id": "24813796",
  24759. "name": "cart",
  24760. "font_class": "cart",
  24761. "unicode": "e631",
  24762. "unicode_decimal": 58929
  24763. }]
  24764. };
  24765. exports.default = _default;
  24766. /***/ }),
  24767. /***/ 513:
  24768. /*!***************************************************************************************************!*\
  24769. !*** D:/project/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  24770. \***************************************************************************************************/
  24771. /*! no static exports found */
  24772. /***/ (function(module, exports, __webpack_require__) {
  24773. "use strict";
  24774. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  24775. Object.defineProperty(exports, "__esModule", {
  24776. value: true
  24777. });
  24778. exports.default = void 0;
  24779. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 514));
  24780. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 515));
  24781. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 516));
  24782. var _default = {
  24783. en: _en.default,
  24784. 'zh-Hans': _zhHans.default,
  24785. 'zh-Hant': _zhHant.default
  24786. };
  24787. exports.default = _default;
  24788. /***/ }),
  24789. /***/ 514:
  24790. /*!**************************************************************************************************!*\
  24791. !*** D:/project/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  24792. \**************************************************************************************************/
  24793. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  24794. /***/ (function(module) {
  24795. 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\"}");
  24796. /***/ }),
  24797. /***/ 515:
  24798. /*!*******************************************************************************************************!*\
  24799. !*** D:/project/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  24800. \*******************************************************************************************************/
  24801. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  24802. /***/ (function(module) {
  24803. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  24804. /***/ }),
  24805. /***/ 516:
  24806. /*!*******************************************************************************************************!*\
  24807. !*** D:/project/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  24808. \*******************************************************************************************************/
  24809. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  24810. /***/ (function(module) {
  24811. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  24812. /***/ }),
  24813. /***/ 524:
  24814. /*!**********************************************************************************************************!*\
  24815. !*** D:/project/material_applet/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  24816. \**********************************************************************************************************/
  24817. /*! no static exports found */
  24818. /***/ (function(module, exports, __webpack_require__) {
  24819. "use strict";
  24820. /* WEBPACK VAR INJECTION */(function(uni) {
  24821. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  24822. Object.defineProperty(exports, "__esModule", {
  24823. value: true
  24824. });
  24825. exports.createAnimation = createAnimation;
  24826. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  24827. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  24828. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  24829. 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; }
  24830. 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; }
  24831. // const defaultOption = {
  24832. // duration: 300,
  24833. // timingFunction: 'linear',
  24834. // delay: 0,
  24835. // transformOrigin: '50% 50% 0'
  24836. // }
  24837. var MPAnimation = /*#__PURE__*/function () {
  24838. function MPAnimation(options, _this) {
  24839. (0, _classCallCheck2.default)(this, MPAnimation);
  24840. this.options = options;
  24841. // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
  24842. this.animation = uni.createAnimation(_objectSpread({}, options));
  24843. this.currentStepAnimates = {};
  24844. this.next = 0;
  24845. this.$ = _this;
  24846. }
  24847. (0, _createClass2.default)(MPAnimation, [{
  24848. key: "_nvuePushAnimates",
  24849. value: function _nvuePushAnimates(type, args) {
  24850. var aniObj = this.currentStepAnimates[this.next];
  24851. var styles = {};
  24852. if (!aniObj) {
  24853. styles = {
  24854. styles: {},
  24855. config: {}
  24856. };
  24857. } else {
  24858. styles = aniObj;
  24859. }
  24860. if (animateTypes1.includes(type)) {
  24861. if (!styles.styles.transform) {
  24862. styles.styles.transform = '';
  24863. }
  24864. var unit = '';
  24865. if (type === 'rotate') {
  24866. unit = 'deg';
  24867. }
  24868. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  24869. } else {
  24870. styles.styles[type] = "".concat(args);
  24871. }
  24872. this.currentStepAnimates[this.next] = styles;
  24873. }
  24874. }, {
  24875. key: "_animateRun",
  24876. value: function _animateRun() {
  24877. var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  24878. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  24879. var ref = this.$.$refs['ani'].ref;
  24880. if (!ref) return;
  24881. return new Promise(function (resolve, reject) {
  24882. nvueAnimation.transition(ref, _objectSpread({
  24883. styles: styles
  24884. }, config), function (res) {
  24885. resolve();
  24886. });
  24887. });
  24888. }
  24889. }, {
  24890. key: "_nvueNextAnimate",
  24891. value: function _nvueNextAnimate(animates) {
  24892. var _this2 = this;
  24893. var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  24894. var fn = arguments.length > 2 ? arguments[2] : undefined;
  24895. var obj = animates[step];
  24896. if (obj) {
  24897. var styles = obj.styles,
  24898. config = obj.config;
  24899. this._animateRun(styles, config).then(function () {
  24900. step += 1;
  24901. _this2._nvueNextAnimate(animates, step, fn);
  24902. });
  24903. } else {
  24904. this.currentStepAnimates = {};
  24905. typeof fn === 'function' && fn();
  24906. this.isEnd = true;
  24907. }
  24908. }
  24909. }, {
  24910. key: "step",
  24911. value: function step() {
  24912. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  24913. this.animation.step(config);
  24914. return this;
  24915. }
  24916. }, {
  24917. key: "run",
  24918. value: function run(fn) {
  24919. this.$.animationData = this.animation.export();
  24920. this.$.timer = setTimeout(function () {
  24921. typeof fn === 'function' && fn();
  24922. }, this.$.durationTime);
  24923. }
  24924. }]);
  24925. return MPAnimation;
  24926. }();
  24927. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];
  24928. var animateTypes2 = ['opacity', 'backgroundColor'];
  24929. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  24930. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  24931. MPAnimation.prototype[type] = function () {
  24932. var _this$animation;
  24933. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  24934. return this;
  24935. };
  24936. });
  24937. function createAnimation(option, _this) {
  24938. if (!_this) return;
  24939. clearTimeout(_this.timer);
  24940. return new MPAnimation(option, _this);
  24941. }
  24942. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  24943. /***/ }),
  24944. /***/ 6:
  24945. /*!***************************************************************!*\
  24946. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  24947. \***************************************************************/
  24948. /*! no static exports found */
  24949. /***/ (function(module, exports) {
  24950. function _arrayWithHoles(arr) {
  24951. if (Array.isArray(arr)) return arr;
  24952. }
  24953. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  24954. /***/ }),
  24955. /***/ 7:
  24956. /*!*********************************************************************!*\
  24957. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  24958. \*********************************************************************/
  24959. /*! no static exports found */
  24960. /***/ (function(module, exports) {
  24961. function _iterableToArrayLimit(arr, i) {
  24962. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  24963. if (null != _i) {
  24964. var _s,
  24965. _e,
  24966. _x,
  24967. _r,
  24968. _arr = [],
  24969. _n = !0,
  24970. _d = !1;
  24971. try {
  24972. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  24973. if (Object(_i) !== _i) return;
  24974. _n = !1;
  24975. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  24976. ;
  24977. }
  24978. } catch (err) {
  24979. _d = !0, _e = err;
  24980. } finally {
  24981. try {
  24982. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  24983. } finally {
  24984. if (_d) throw _e;
  24985. }
  24986. }
  24987. return _arr;
  24988. }
  24989. }
  24990. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  24991. /***/ }),
  24992. /***/ 8:
  24993. /*!***************************************************************************!*\
  24994. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  24995. \***************************************************************************/
  24996. /*! no static exports found */
  24997. /***/ (function(module, exports, __webpack_require__) {
  24998. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  24999. function _unsupportedIterableToArray(o, minLen) {
  25000. if (!o) return;
  25001. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  25002. var n = Object.prototype.toString.call(o).slice(8, -1);
  25003. if (n === "Object" && o.constructor) n = o.constructor.name;
  25004. if (n === "Map" || n === "Set") return Array.from(o);
  25005. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  25006. }
  25007. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  25008. /***/ }),
  25009. /***/ 9:
  25010. /*!*****************************************************************!*\
  25011. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  25012. \*****************************************************************/
  25013. /*! no static exports found */
  25014. /***/ (function(module, exports) {
  25015. function _arrayLikeToArray(arr, len) {
  25016. if (len == null || len > arr.length) len = arr.length;
  25017. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  25018. arr2[i] = arr[i];
  25019. }
  25020. return arr2;
  25021. }
  25022. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  25023. /***/ })
  25024. }]);
  25025. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map