vendor.js 472 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}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);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}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;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|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/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__1C40FB4",
  643. appName: "mdapp",
  644. appVersion: "1.0.0",
  645. appVersionCode: "100",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.4.18",
  648. uniRuntimeVersion: "3.4.18",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__1C40FB4",
  736. appName: "mdapp",
  737. appVersion: "1.0.0",
  738. appVersionCode: "100",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. // import navigateTo from 'uni-helpers/navigate-to'
  765. var protocols = {
  766. redirectTo: redirectTo,
  767. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  768. previewImage: previewImage,
  769. getSystemInfo: getSystemInfo,
  770. getSystemInfoSync: getSystemInfo,
  771. showActionSheet: showActionSheet,
  772. getAppBaseInfo: getAppBaseInfo,
  773. getDeviceInfo: getDeviceInfo,
  774. getWindowInfo: getWindowInfo };
  775. var todos = [
  776. 'vibrate',
  777. 'preloadPage',
  778. 'unPreloadPage',
  779. 'loadSubPackage'];
  780. var canIUses = [];
  781. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  782. function processCallback(methodName, method, returnValue) {
  783. return function (res) {
  784. return method(processReturnValue(methodName, res, returnValue));
  785. };
  786. }
  787. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  788. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  789. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  790. if (isFn(argsOption)) {
  791. argsOption = argsOption(fromArgs, toArgs) || {};
  792. }
  793. for (var key in fromArgs) {
  794. if (hasOwn(argsOption, key)) {
  795. var keyOption = argsOption[key];
  796. if (isFn(keyOption)) {
  797. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  798. }
  799. if (!keyOption) {// 不支持的参数
  800. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  801. } else if (isStr(keyOption)) {// 重写参数 key
  802. toArgs[keyOption] = fromArgs[key];
  803. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  804. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  805. }
  806. } else if (CALLBACKS.indexOf(key) !== -1) {
  807. if (isFn(fromArgs[key])) {
  808. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  809. }
  810. } else {
  811. if (!keepFromArgs) {
  812. toArgs[key] = fromArgs[key];
  813. }
  814. }
  815. }
  816. return toArgs;
  817. } else if (isFn(fromArgs)) {
  818. fromArgs = processCallback(methodName, fromArgs, returnValue);
  819. }
  820. return fromArgs;
  821. }
  822. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  823. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  824. res = protocols.returnValue(methodName, res);
  825. }
  826. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  827. }
  828. function wrapper(methodName, method) {
  829. if (hasOwn(protocols, methodName)) {
  830. var protocol = protocols[methodName];
  831. if (!protocol) {// 暂不支持的 api
  832. return function () {
  833. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  834. };
  835. }
  836. return function (arg1, arg2) {// 目前 api 最多两个参数
  837. var options = protocol;
  838. if (isFn(protocol)) {
  839. options = protocol(arg1);
  840. }
  841. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  842. var args = [arg1];
  843. if (typeof arg2 !== 'undefined') {
  844. args.push(arg2);
  845. }
  846. if (isFn(options.name)) {
  847. methodName = options.name(arg1);
  848. } else if (isStr(options.name)) {
  849. methodName = options.name;
  850. }
  851. var returnValue = wx[methodName].apply(wx, args);
  852. if (isSyncApi(methodName)) {// 同步 api
  853. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  854. }
  855. return returnValue;
  856. };
  857. }
  858. return method;
  859. }
  860. var todoApis = Object.create(null);
  861. var TODOS = [
  862. 'onTabBarMidButtonTap',
  863. 'subscribePush',
  864. 'unsubscribePush',
  865. 'onPush',
  866. 'offPush',
  867. 'share'];
  868. function createTodoApi(name) {
  869. return function todoApi(_ref)
  870. {var fail = _ref.fail,complete = _ref.complete;
  871. var res = {
  872. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  873. isFn(fail) && fail(res);
  874. isFn(complete) && complete(res);
  875. };
  876. }
  877. TODOS.forEach(function (name) {
  878. todoApis[name] = createTodoApi(name);
  879. });
  880. var providers = {
  881. oauth: ['weixin'],
  882. share: ['weixin'],
  883. payment: ['wxpay'],
  884. push: ['weixin'] };
  885. function getProvider(_ref2)
  886. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  887. var res = false;
  888. if (providers[service]) {
  889. res = {
  890. errMsg: 'getProvider:ok',
  891. service: service,
  892. provider: providers[service] };
  893. isFn(success) && success(res);
  894. } else {
  895. res = {
  896. errMsg: 'getProvider:fail service not found' };
  897. isFn(fail) && fail(res);
  898. }
  899. isFn(complete) && complete(res);
  900. }
  901. var extraApi = /*#__PURE__*/Object.freeze({
  902. __proto__: null,
  903. getProvider: getProvider });
  904. var getEmitter = function () {
  905. var Emitter;
  906. return function getUniEmitter() {
  907. if (!Emitter) {
  908. Emitter = new _vue.default();
  909. }
  910. return Emitter;
  911. };
  912. }();
  913. function apply(ctx, method, args) {
  914. return ctx[method].apply(ctx, args);
  915. }
  916. function $on() {
  917. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  918. }
  919. function $off() {
  920. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  921. }
  922. function $once() {
  923. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  924. }
  925. function $emit() {
  926. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  927. }
  928. var eventApi = /*#__PURE__*/Object.freeze({
  929. __proto__: null,
  930. $on: $on,
  931. $off: $off,
  932. $once: $once,
  933. $emit: $emit });
  934. /**
  935. * 框架内 try-catch
  936. */
  937. /**
  938. * 开发者 try-catch
  939. */
  940. function tryCatch(fn) {
  941. return function () {
  942. try {
  943. return fn.apply(fn, arguments);
  944. } catch (e) {
  945. // TODO
  946. console.error(e);
  947. }
  948. };
  949. }
  950. function getApiCallbacks(params) {
  951. var apiCallbacks = {};
  952. for (var name in params) {
  953. var param = params[name];
  954. if (isFn(param)) {
  955. apiCallbacks[name] = tryCatch(param);
  956. delete params[name];
  957. }
  958. }
  959. return apiCallbacks;
  960. }
  961. var cid;
  962. var cidErrMsg;
  963. function normalizePushMessage(message) {
  964. try {
  965. return JSON.parse(message);
  966. } catch (e) {}
  967. return message;
  968. }
  969. function invokePushCallback(
  970. args)
  971. {
  972. if (args.type === 'clientId') {
  973. cid = args.cid;
  974. cidErrMsg = args.errMsg;
  975. invokeGetPushCidCallbacks(cid, args.errMsg);
  976. } else if (args.type === 'pushMsg') {
  977. onPushMessageCallbacks.forEach(function (callback) {
  978. callback({
  979. type: 'receive',
  980. data: normalizePushMessage(args.message) });
  981. });
  982. } else if (args.type === 'click') {
  983. onPushMessageCallbacks.forEach(function (callback) {
  984. callback({
  985. type: 'click',
  986. data: normalizePushMessage(args.message) });
  987. });
  988. }
  989. }
  990. var getPushCidCallbacks = [];
  991. function invokeGetPushCidCallbacks(cid, errMsg) {
  992. getPushCidCallbacks.forEach(function (callback) {
  993. callback(cid, errMsg);
  994. });
  995. getPushCidCallbacks.length = 0;
  996. }
  997. function getPushClientid(args) {
  998. if (!isPlainObject(args)) {
  999. args = {};
  1000. }var _getApiCallbacks =
  1001. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1002. var hasSuccess = isFn(success);
  1003. var hasFail = isFn(fail);
  1004. var hasComplete = isFn(complete);
  1005. getPushCidCallbacks.push(function (cid, errMsg) {
  1006. var res;
  1007. if (cid) {
  1008. res = {
  1009. errMsg: 'getPushClientid:ok',
  1010. cid: cid };
  1011. hasSuccess && success(res);
  1012. } else {
  1013. res = {
  1014. errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') };
  1015. hasFail && fail(res);
  1016. }
  1017. hasComplete && complete(res);
  1018. });
  1019. if (typeof cid !== 'undefined') {
  1020. Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);});
  1021. }
  1022. }
  1023. var onPushMessageCallbacks = [];
  1024. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1025. var onPushMessage = function onPushMessage(fn) {
  1026. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1027. onPushMessageCallbacks.push(fn);
  1028. }
  1029. };
  1030. var offPushMessage = function offPushMessage(fn) {
  1031. if (!fn) {
  1032. onPushMessageCallbacks.length = 0;
  1033. } else {
  1034. var index = onPushMessageCallbacks.indexOf(fn);
  1035. if (index > -1) {
  1036. onPushMessageCallbacks.splice(index, 1);
  1037. }
  1038. }
  1039. };
  1040. var api = /*#__PURE__*/Object.freeze({
  1041. __proto__: null,
  1042. getPushClientid: getPushClientid,
  1043. onPushMessage: onPushMessage,
  1044. offPushMessage: offPushMessage,
  1045. invokePushCallback: invokePushCallback });
  1046. var MPPage = Page;
  1047. var MPComponent = Component;
  1048. var customizeRE = /:/g;
  1049. var customize = cached(function (str) {
  1050. return camelize(str.replace(customizeRE, '-'));
  1051. });
  1052. function initTriggerEvent(mpInstance) {
  1053. var oldTriggerEvent = mpInstance.triggerEvent;
  1054. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1055. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1056. };
  1057. try {
  1058. // 京东小程序 triggerEvent 为只读
  1059. mpInstance.triggerEvent = newTriggerEvent;
  1060. } catch (error) {
  1061. mpInstance._triggerEvent = newTriggerEvent;
  1062. }
  1063. }
  1064. function initHook(name, options, isComponent) {
  1065. var oldHook = options[name];
  1066. if (!oldHook) {
  1067. options[name] = function () {
  1068. initTriggerEvent(this);
  1069. };
  1070. } else {
  1071. options[name] = function () {
  1072. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1073. return oldHook.apply(this, args);
  1074. };
  1075. }
  1076. }
  1077. if (!MPPage.__$wrappered) {
  1078. MPPage.__$wrappered = true;
  1079. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1080. initHook('onLoad', options);
  1081. return MPPage(options);
  1082. };
  1083. Page.after = MPPage.after;
  1084. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1085. initHook('created', options);
  1086. return MPComponent(options);
  1087. };
  1088. }
  1089. var PAGE_EVENT_HOOKS = [
  1090. 'onPullDownRefresh',
  1091. 'onReachBottom',
  1092. 'onAddToFavorites',
  1093. 'onShareTimeline',
  1094. 'onShareAppMessage',
  1095. 'onPageScroll',
  1096. 'onResize',
  1097. 'onTabItemTap'];
  1098. function initMocks(vm, mocks) {
  1099. var mpInstance = vm.$mp[vm.mpType];
  1100. mocks.forEach(function (mock) {
  1101. if (hasOwn(mpInstance, mock)) {
  1102. vm[mock] = mpInstance[mock];
  1103. }
  1104. });
  1105. }
  1106. function hasHook(hook, vueOptions) {
  1107. if (!vueOptions) {
  1108. return true;
  1109. }
  1110. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1111. return true;
  1112. }
  1113. vueOptions = vueOptions.default || vueOptions;
  1114. if (isFn(vueOptions)) {
  1115. if (isFn(vueOptions.extendOptions[hook])) {
  1116. return true;
  1117. }
  1118. if (vueOptions.super &&
  1119. vueOptions.super.options &&
  1120. Array.isArray(vueOptions.super.options[hook])) {
  1121. return true;
  1122. }
  1123. return false;
  1124. }
  1125. if (isFn(vueOptions[hook])) {
  1126. return true;
  1127. }
  1128. var mixins = vueOptions.mixins;
  1129. if (Array.isArray(mixins)) {
  1130. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1131. }
  1132. }
  1133. function initHooks(mpOptions, hooks, vueOptions) {
  1134. hooks.forEach(function (hook) {
  1135. if (hasHook(hook, vueOptions)) {
  1136. mpOptions[hook] = function (args) {
  1137. return this.$vm && this.$vm.__call_hook(hook, args);
  1138. };
  1139. }
  1140. });
  1141. }
  1142. function initVueComponent(Vue, vueOptions) {
  1143. vueOptions = vueOptions.default || vueOptions;
  1144. var VueComponent;
  1145. if (isFn(vueOptions)) {
  1146. VueComponent = vueOptions;
  1147. } else {
  1148. VueComponent = Vue.extend(vueOptions);
  1149. }
  1150. vueOptions = VueComponent.options;
  1151. return [VueComponent, vueOptions];
  1152. }
  1153. function initSlots(vm, vueSlots) {
  1154. if (Array.isArray(vueSlots) && vueSlots.length) {
  1155. var $slots = Object.create(null);
  1156. vueSlots.forEach(function (slotName) {
  1157. $slots[slotName] = true;
  1158. });
  1159. vm.$scopedSlots = vm.$slots = $slots;
  1160. }
  1161. }
  1162. function initVueIds(vueIds, mpInstance) {
  1163. vueIds = (vueIds || '').split(',');
  1164. var len = vueIds.length;
  1165. if (len === 1) {
  1166. mpInstance._$vueId = vueIds[0];
  1167. } else if (len === 2) {
  1168. mpInstance._$vueId = vueIds[0];
  1169. mpInstance._$vuePid = vueIds[1];
  1170. }
  1171. }
  1172. function initData(vueOptions, context) {
  1173. var data = vueOptions.data || {};
  1174. var methods = vueOptions.methods || {};
  1175. if (typeof data === 'function') {
  1176. try {
  1177. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1178. } catch (e) {
  1179. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1180. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1181. }
  1182. }
  1183. } else {
  1184. try {
  1185. // 对 data 格式化
  1186. data = JSON.parse(JSON.stringify(data));
  1187. } catch (e) {}
  1188. }
  1189. if (!isPlainObject(data)) {
  1190. data = {};
  1191. }
  1192. Object.keys(methods).forEach(function (methodName) {
  1193. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1194. data[methodName] = methods[methodName];
  1195. }
  1196. });
  1197. return data;
  1198. }
  1199. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1200. function createObserver(name) {
  1201. return function observer(newVal, oldVal) {
  1202. if (this.$vm) {
  1203. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1204. }
  1205. };
  1206. }
  1207. function initBehaviors(vueOptions, initBehavior) {
  1208. var vueBehaviors = vueOptions.behaviors;
  1209. var vueExtends = vueOptions.extends;
  1210. var vueMixins = vueOptions.mixins;
  1211. var vueProps = vueOptions.props;
  1212. if (!vueProps) {
  1213. vueOptions.props = vueProps = [];
  1214. }
  1215. var behaviors = [];
  1216. if (Array.isArray(vueBehaviors)) {
  1217. vueBehaviors.forEach(function (behavior) {
  1218. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1219. if (behavior === 'uni://form-field') {
  1220. if (Array.isArray(vueProps)) {
  1221. vueProps.push('name');
  1222. vueProps.push('value');
  1223. } else {
  1224. vueProps.name = {
  1225. type: String,
  1226. default: '' };
  1227. vueProps.value = {
  1228. type: [String, Number, Boolean, Array, Object, Date],
  1229. default: '' };
  1230. }
  1231. }
  1232. });
  1233. }
  1234. if (isPlainObject(vueExtends) && vueExtends.props) {
  1235. behaviors.push(
  1236. initBehavior({
  1237. properties: initProperties(vueExtends.props, true) }));
  1238. }
  1239. if (Array.isArray(vueMixins)) {
  1240. vueMixins.forEach(function (vueMixin) {
  1241. if (isPlainObject(vueMixin) && vueMixin.props) {
  1242. behaviors.push(
  1243. initBehavior({
  1244. properties: initProperties(vueMixin.props, true) }));
  1245. }
  1246. });
  1247. }
  1248. return behaviors;
  1249. }
  1250. function parsePropType(key, type, defaultValue, file) {
  1251. // [String]=>String
  1252. if (Array.isArray(type) && type.length === 1) {
  1253. return type[0];
  1254. }
  1255. return type;
  1256. }
  1257. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1258. var properties = {};
  1259. if (!isBehavior) {
  1260. properties.vueId = {
  1261. type: String,
  1262. value: '' };
  1263. // 用于字节跳动小程序模拟抽象节点
  1264. properties.generic = {
  1265. type: Object,
  1266. value: null };
  1267. // scopedSlotsCompiler auto
  1268. properties.scopedSlotsCompiler = {
  1269. type: String,
  1270. value: '' };
  1271. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1272. type: null,
  1273. value: [],
  1274. observer: function observer(newVal, oldVal) {
  1275. var $slots = Object.create(null);
  1276. newVal.forEach(function (slotName) {
  1277. $slots[slotName] = true;
  1278. });
  1279. this.setData({
  1280. $slots: $slots });
  1281. } };
  1282. }
  1283. if (Array.isArray(props)) {// ['title']
  1284. props.forEach(function (key) {
  1285. properties[key] = {
  1286. type: null,
  1287. observer: createObserver(key) };
  1288. });
  1289. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1290. Object.keys(props).forEach(function (key) {
  1291. var opts = props[key];
  1292. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1293. var value = opts.default;
  1294. if (isFn(value)) {
  1295. value = value();
  1296. }
  1297. opts.type = parsePropType(key, opts.type);
  1298. properties[key] = {
  1299. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1300. value: value,
  1301. observer: createObserver(key) };
  1302. } else {// content:String
  1303. var type = parsePropType(key, opts);
  1304. properties[key] = {
  1305. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1306. observer: createObserver(key) };
  1307. }
  1308. });
  1309. }
  1310. return properties;
  1311. }
  1312. function wrapper$1(event) {
  1313. // TODO 又得兼容 mpvue 的 mp 对象
  1314. try {
  1315. event.mp = JSON.parse(JSON.stringify(event));
  1316. } catch (e) {}
  1317. event.stopPropagation = noop;
  1318. event.preventDefault = noop;
  1319. event.target = event.target || {};
  1320. if (!hasOwn(event, 'detail')) {
  1321. event.detail = {};
  1322. }
  1323. if (hasOwn(event, 'markerId')) {
  1324. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1325. event.detail.markerId = event.markerId;
  1326. }
  1327. if (isPlainObject(event.detail)) {
  1328. event.target = Object.assign({}, event.target, event.detail);
  1329. }
  1330. return event;
  1331. }
  1332. function getExtraValue(vm, dataPathsArray) {
  1333. var context = vm;
  1334. dataPathsArray.forEach(function (dataPathArray) {
  1335. var dataPath = dataPathArray[0];
  1336. var value = dataPathArray[2];
  1337. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1338. var propPath = dataPathArray[1];
  1339. var valuePath = dataPathArray[3];
  1340. var vFor;
  1341. if (Number.isInteger(dataPath)) {
  1342. vFor = dataPath;
  1343. } else if (!dataPath) {
  1344. vFor = context;
  1345. } else if (typeof dataPath === 'string' && dataPath) {
  1346. if (dataPath.indexOf('#s#') === 0) {
  1347. vFor = dataPath.substr(3);
  1348. } else {
  1349. vFor = vm.__get_value(dataPath, context);
  1350. }
  1351. }
  1352. if (Number.isInteger(vFor)) {
  1353. context = value;
  1354. } else if (!propPath) {
  1355. context = vFor[value];
  1356. } else {
  1357. if (Array.isArray(vFor)) {
  1358. context = vFor.find(function (vForItem) {
  1359. return vm.__get_value(propPath, vForItem) === value;
  1360. });
  1361. } else if (isPlainObject(vFor)) {
  1362. context = Object.keys(vFor).find(function (vForKey) {
  1363. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1364. });
  1365. } else {
  1366. console.error('v-for 暂不支持循环数据:', vFor);
  1367. }
  1368. }
  1369. if (valuePath) {
  1370. context = vm.__get_value(valuePath, context);
  1371. }
  1372. }
  1373. });
  1374. return context;
  1375. }
  1376. function processEventExtra(vm, extra, event) {
  1377. var extraObj = {};
  1378. if (Array.isArray(extra) && extra.length) {
  1379. /**
  1380. *[
  1381. * ['data.items', 'data.id', item.data.id],
  1382. * ['metas', 'id', meta.id]
  1383. *],
  1384. *[
  1385. * ['data.items', 'data.id', item.data.id],
  1386. * ['metas', 'id', meta.id]
  1387. *],
  1388. *'test'
  1389. */
  1390. extra.forEach(function (dataPath, index) {
  1391. if (typeof dataPath === 'string') {
  1392. if (!dataPath) {// model,prop.sync
  1393. extraObj['$' + index] = vm;
  1394. } else {
  1395. if (dataPath === '$event') {// $event
  1396. extraObj['$' + index] = event;
  1397. } else if (dataPath === 'arguments') {
  1398. if (event.detail && event.detail.__args__) {
  1399. extraObj['$' + index] = event.detail.__args__;
  1400. } else {
  1401. extraObj['$' + index] = [event];
  1402. }
  1403. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1404. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1405. } else {
  1406. extraObj['$' + index] = vm.__get_value(dataPath);
  1407. }
  1408. }
  1409. } else {
  1410. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1411. }
  1412. });
  1413. }
  1414. return extraObj;
  1415. }
  1416. function getObjByArray(arr) {
  1417. var obj = {};
  1418. for (var i = 1; i < arr.length; i++) {
  1419. var element = arr[i];
  1420. obj[element[0]] = element[1];
  1421. }
  1422. return obj;
  1423. }
  1424. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1425. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1426. if (isCustom) {// 自定义事件
  1427. isCustomMPEvent = event.currentTarget &&
  1428. event.currentTarget.dataset &&
  1429. event.currentTarget.dataset.comType === 'wx';
  1430. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1431. if (isCustomMPEvent) {
  1432. return [event];
  1433. }
  1434. return event.detail.__args__ || event.detail;
  1435. }
  1436. }
  1437. var extraObj = processEventExtra(vm, extra, event);
  1438. var ret = [];
  1439. args.forEach(function (arg) {
  1440. if (arg === '$event') {
  1441. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1442. ret.push(event.target.value);
  1443. } else {
  1444. if (isCustom && !isCustomMPEvent) {
  1445. ret.push(event.detail.__args__[0]);
  1446. } else {// wxcomponent 组件或内置组件
  1447. ret.push(event);
  1448. }
  1449. }
  1450. } else {
  1451. if (Array.isArray(arg) && arg[0] === 'o') {
  1452. ret.push(getObjByArray(arg));
  1453. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1454. ret.push(extraObj[arg]);
  1455. } else {
  1456. ret.push(arg);
  1457. }
  1458. }
  1459. });
  1460. return ret;
  1461. }
  1462. var ONCE = '~';
  1463. var CUSTOM = '^';
  1464. function isMatchEventType(eventType, optType) {
  1465. return eventType === optType ||
  1466. optType === 'regionchange' && (
  1467. eventType === 'begin' ||
  1468. eventType === 'end');
  1469. }
  1470. function getContextVm(vm) {
  1471. var $parent = vm.$parent;
  1472. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1473. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1474. $parent = $parent.$parent;
  1475. }
  1476. return $parent && $parent.$parent;
  1477. }
  1478. function handleEvent(event) {var _this2 = this;
  1479. event = wrapper$1(event);
  1480. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1481. var dataset = (event.currentTarget || event.target).dataset;
  1482. if (!dataset) {
  1483. return console.warn('事件信息不存在');
  1484. }
  1485. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1486. if (!eventOpts) {
  1487. return console.warn('事件信息不存在');
  1488. }
  1489. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1490. var eventType = event.type;
  1491. var ret = [];
  1492. eventOpts.forEach(function (eventOpt) {
  1493. var type = eventOpt[0];
  1494. var eventsArray = eventOpt[1];
  1495. var isCustom = type.charAt(0) === CUSTOM;
  1496. type = isCustom ? type.slice(1) : type;
  1497. var isOnce = type.charAt(0) === ONCE;
  1498. type = isOnce ? type.slice(1) : type;
  1499. if (eventsArray && isMatchEventType(eventType, type)) {
  1500. eventsArray.forEach(function (eventArray) {
  1501. var methodName = eventArray[0];
  1502. if (methodName) {
  1503. var handlerCtx = _this2.$vm;
  1504. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1505. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1506. }
  1507. if (methodName === '$emit') {
  1508. handlerCtx.$emit.apply(handlerCtx,
  1509. processEventArgs(
  1510. _this2.$vm,
  1511. event,
  1512. eventArray[1],
  1513. eventArray[2],
  1514. isCustom,
  1515. methodName));
  1516. return;
  1517. }
  1518. var handler = handlerCtx[methodName];
  1519. if (!isFn(handler)) {
  1520. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1521. }
  1522. if (isOnce) {
  1523. if (handler.once) {
  1524. return;
  1525. }
  1526. handler.once = true;
  1527. }
  1528. var params = processEventArgs(
  1529. _this2.$vm,
  1530. event,
  1531. eventArray[1],
  1532. eventArray[2],
  1533. isCustom,
  1534. methodName);
  1535. params = Array.isArray(params) ? params : [];
  1536. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1537. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1538. // eslint-disable-next-line no-sparse-arrays
  1539. params = params.concat([,,,,,,,,,, event]);
  1540. }
  1541. ret.push(handler.apply(handlerCtx, params));
  1542. }
  1543. });
  1544. }
  1545. });
  1546. if (
  1547. eventType === 'input' &&
  1548. ret.length === 1 &&
  1549. typeof ret[0] !== 'undefined')
  1550. {
  1551. return ret[0];
  1552. }
  1553. }
  1554. var eventChannels = {};
  1555. var eventChannelStack = [];
  1556. function getEventChannel(id) {
  1557. if (id) {
  1558. var eventChannel = eventChannels[id];
  1559. delete eventChannels[id];
  1560. return eventChannel;
  1561. }
  1562. return eventChannelStack.shift();
  1563. }
  1564. var hooks = [
  1565. 'onShow',
  1566. 'onHide',
  1567. 'onError',
  1568. 'onPageNotFound',
  1569. 'onThemeChange',
  1570. 'onUnhandledRejection'];
  1571. function initEventChannel() {
  1572. _vue.default.prototype.getOpenerEventChannel = function () {
  1573. // 微信小程序使用自身getOpenerEventChannel
  1574. {
  1575. return this.$scope.getOpenerEventChannel();
  1576. }
  1577. };
  1578. var callHook = _vue.default.prototype.__call_hook;
  1579. _vue.default.prototype.__call_hook = function (hook, args) {
  1580. if (hook === 'onLoad' && args && args.__id__) {
  1581. this.__eventChannel__ = getEventChannel(args.__id__);
  1582. delete args.__id__;
  1583. }
  1584. return callHook.call(this, hook, args);
  1585. };
  1586. }
  1587. function initScopedSlotsParams() {
  1588. var center = {};
  1589. var parents = {};
  1590. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1591. var has = center[vueId];
  1592. if (!has) {
  1593. parents[vueId] = this;
  1594. this.$on('hook:destroyed', function () {
  1595. delete parents[vueId];
  1596. });
  1597. }
  1598. return has;
  1599. };
  1600. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1601. var data = center[vueId];
  1602. if (data) {
  1603. var object = data[name] || {};
  1604. return key ? object[key] : object;
  1605. } else {
  1606. parents[vueId] = this;
  1607. this.$on('hook:destroyed', function () {
  1608. delete parents[vueId];
  1609. });
  1610. }
  1611. };
  1612. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1613. var vueIds = this.$options.propsData.vueId;
  1614. if (vueIds) {
  1615. var vueId = vueIds.split(',')[0];
  1616. var object = center[vueId] = center[vueId] || {};
  1617. object[name] = value;
  1618. if (parents[vueId]) {
  1619. parents[vueId].$forceUpdate();
  1620. }
  1621. }
  1622. };
  1623. _vue.default.mixin({
  1624. destroyed: function destroyed() {
  1625. var propsData = this.$options.propsData;
  1626. var vueId = propsData && propsData.vueId;
  1627. if (vueId) {
  1628. delete center[vueId];
  1629. delete parents[vueId];
  1630. }
  1631. } });
  1632. }
  1633. function parseBaseApp(vm, _ref3)
  1634. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1635. initEventChannel();
  1636. {
  1637. initScopedSlotsParams();
  1638. }
  1639. if (vm.$options.store) {
  1640. _vue.default.prototype.$store = vm.$options.store;
  1641. }
  1642. uniIdMixin(_vue.default);
  1643. _vue.default.prototype.mpHost = "mp-weixin";
  1644. _vue.default.mixin({
  1645. beforeCreate: function beforeCreate() {
  1646. if (!this.$options.mpType) {
  1647. return;
  1648. }
  1649. this.mpType = this.$options.mpType;
  1650. this.$mp = _defineProperty({
  1651. data: {} },
  1652. this.mpType, this.$options.mpInstance);
  1653. this.$scope = this.$options.mpInstance;
  1654. delete this.$options.mpType;
  1655. delete this.$options.mpInstance;
  1656. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1657. var app = getApp();
  1658. if (app.$vm && app.$vm.$i18n) {
  1659. this._i18n = app.$vm.$i18n;
  1660. }
  1661. }
  1662. if (this.mpType !== 'app') {
  1663. initRefs(this);
  1664. initMocks(this, mocks);
  1665. }
  1666. } });
  1667. var appOptions = {
  1668. onLaunch: function onLaunch(args) {
  1669. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1670. return;
  1671. }
  1672. {
  1673. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1674. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1675. }
  1676. }
  1677. this.$vm = vm;
  1678. this.$vm.$mp = {
  1679. app: this };
  1680. this.$vm.$scope = this;
  1681. // vm 上也挂载 globalData
  1682. this.$vm.globalData = this.globalData;
  1683. this.$vm._isMounted = true;
  1684. this.$vm.__call_hook('mounted', args);
  1685. this.$vm.__call_hook('onLaunch', args);
  1686. } };
  1687. // 兼容旧版本 globalData
  1688. appOptions.globalData = vm.$options.globalData || {};
  1689. // 将 methods 中的方法挂在 getApp() 中
  1690. var methods = vm.$options.methods;
  1691. if (methods) {
  1692. Object.keys(methods).forEach(function (name) {
  1693. appOptions[name] = methods[name];
  1694. });
  1695. }
  1696. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1697. initHooks(appOptions, hooks);
  1698. return appOptions;
  1699. }
  1700. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1701. function findVmByVueId(vm, vuePid) {
  1702. var $children = vm.$children;
  1703. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1704. for (var i = $children.length - 1; i >= 0; i--) {
  1705. var childVm = $children[i];
  1706. if (childVm.$scope._$vueId === vuePid) {
  1707. return childVm;
  1708. }
  1709. }
  1710. // 反向递归查找
  1711. var parentVm;
  1712. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1713. parentVm = findVmByVueId($children[_i], vuePid);
  1714. if (parentVm) {
  1715. return parentVm;
  1716. }
  1717. }
  1718. }
  1719. function initBehavior(options) {
  1720. return Behavior(options);
  1721. }
  1722. function isPage() {
  1723. return !!this.route;
  1724. }
  1725. function initRelation(detail) {
  1726. this.triggerEvent('__l', detail);
  1727. }
  1728. function selectAllComponents(mpInstance, selector, $refs) {
  1729. var components = mpInstance.selectAllComponents(selector);
  1730. components.forEach(function (component) {
  1731. var ref = component.dataset.ref;
  1732. $refs[ref] = component.$vm || component;
  1733. {
  1734. if (component.dataset.vueGeneric === 'scoped') {
  1735. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1736. selectAllComponents(scopedComponent, selector, $refs);
  1737. });
  1738. }
  1739. }
  1740. });
  1741. }
  1742. function initRefs(vm) {
  1743. var mpInstance = vm.$scope;
  1744. Object.defineProperty(vm, '$refs', {
  1745. get: function get() {
  1746. var $refs = {};
  1747. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1748. // TODO 暂不考虑 for 中的 scoped
  1749. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1750. forComponents.forEach(function (component) {
  1751. var ref = component.dataset.ref;
  1752. if (!$refs[ref]) {
  1753. $refs[ref] = [];
  1754. }
  1755. $refs[ref].push(component.$vm || component);
  1756. });
  1757. return $refs;
  1758. } });
  1759. }
  1760. function handleLink(event) {var _ref4 =
  1761. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1762. var parentVm;
  1763. if (vuePid) {
  1764. parentVm = findVmByVueId(this.$vm, vuePid);
  1765. }
  1766. if (!parentVm) {
  1767. parentVm = this.$vm;
  1768. }
  1769. vueOptions.parent = parentVm;
  1770. }
  1771. function parseApp(vm) {
  1772. return parseBaseApp(vm, {
  1773. mocks: mocks,
  1774. initRefs: initRefs });
  1775. }
  1776. function createApp(vm) {
  1777. App(parseApp(vm));
  1778. return vm;
  1779. }
  1780. var encodeReserveRE = /[!'()*]/g;
  1781. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1782. var commaRE = /%2C/g;
  1783. // fixed encodeURIComponent which is more conformant to RFC3986:
  1784. // - escapes [!'()*]
  1785. // - preserve commas
  1786. var encode = function encode(str) {return encodeURIComponent(str).
  1787. replace(encodeReserveRE, encodeReserveReplacer).
  1788. replace(commaRE, ',');};
  1789. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1790. var res = obj ? Object.keys(obj).map(function (key) {
  1791. var val = obj[key];
  1792. if (val === undefined) {
  1793. return '';
  1794. }
  1795. if (val === null) {
  1796. return encodeStr(key);
  1797. }
  1798. if (Array.isArray(val)) {
  1799. var result = [];
  1800. val.forEach(function (val2) {
  1801. if (val2 === undefined) {
  1802. return;
  1803. }
  1804. if (val2 === null) {
  1805. result.push(encodeStr(key));
  1806. } else {
  1807. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1808. }
  1809. });
  1810. return result.join('&');
  1811. }
  1812. return encodeStr(key) + '=' + encodeStr(val);
  1813. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1814. return res ? "?".concat(res) : '';
  1815. }
  1816. function parseBaseComponent(vueComponentOptions)
  1817. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1818. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1819. var options = _objectSpread({
  1820. multipleSlots: true,
  1821. addGlobalClass: true },
  1822. vueOptions.options || {});
  1823. {
  1824. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1825. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1826. Object.assign(options, vueOptions['mp-weixin'].options);
  1827. }
  1828. }
  1829. var componentOptions = {
  1830. options: options,
  1831. data: initData(vueOptions, _vue.default.prototype),
  1832. behaviors: initBehaviors(vueOptions, initBehavior),
  1833. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1834. lifetimes: {
  1835. attached: function attached() {
  1836. var properties = this.properties;
  1837. var options = {
  1838. mpType: isPage.call(this) ? 'page' : 'component',
  1839. mpInstance: this,
  1840. propsData: properties };
  1841. initVueIds(properties.vueId, this);
  1842. // 处理父子关系
  1843. initRelation.call(this, {
  1844. vuePid: this._$vuePid,
  1845. vueOptions: options });
  1846. // 初始化 vue 实例
  1847. this.$vm = new VueComponent(options);
  1848. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1849. initSlots(this.$vm, properties.vueSlots);
  1850. // 触发首次 setData
  1851. this.$vm.$mount();
  1852. },
  1853. ready: function ready() {
  1854. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1855. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1856. if (this.$vm) {
  1857. this.$vm._isMounted = true;
  1858. this.$vm.__call_hook('mounted');
  1859. this.$vm.__call_hook('onReady');
  1860. }
  1861. },
  1862. detached: function detached() {
  1863. this.$vm && this.$vm.$destroy();
  1864. } },
  1865. pageLifetimes: {
  1866. show: function show(args) {
  1867. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1868. },
  1869. hide: function hide() {
  1870. this.$vm && this.$vm.__call_hook('onPageHide');
  1871. },
  1872. resize: function resize(size) {
  1873. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1874. } },
  1875. methods: {
  1876. __l: handleLink,
  1877. __e: handleEvent } };
  1878. // externalClasses
  1879. if (vueOptions.externalClasses) {
  1880. componentOptions.externalClasses = vueOptions.externalClasses;
  1881. }
  1882. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1883. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1884. componentOptions.methods[callMethod] = function (args) {
  1885. return this.$vm[callMethod](args);
  1886. };
  1887. });
  1888. }
  1889. if (isPage) {
  1890. return componentOptions;
  1891. }
  1892. return [componentOptions, VueComponent];
  1893. }
  1894. function parseComponent(vueComponentOptions) {
  1895. return parseBaseComponent(vueComponentOptions, {
  1896. isPage: isPage,
  1897. initRelation: initRelation });
  1898. }
  1899. var hooks$1 = [
  1900. 'onShow',
  1901. 'onHide',
  1902. 'onUnload'];
  1903. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1904. function parseBasePage(vuePageOptions, _ref6)
  1905. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1906. var pageOptions = parseComponent(vuePageOptions);
  1907. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1908. pageOptions.methods.onLoad = function (query) {
  1909. this.options = query;
  1910. var copyQuery = Object.assign({}, query);
  1911. delete copyQuery.__id__;
  1912. this.$page = {
  1913. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1914. this.$vm.$mp.query = query; // 兼容 mpvue
  1915. this.$vm.__call_hook('onLoad', query);
  1916. };
  1917. return pageOptions;
  1918. }
  1919. function parsePage(vuePageOptions) {
  1920. return parseBasePage(vuePageOptions, {
  1921. isPage: isPage,
  1922. initRelation: initRelation });
  1923. }
  1924. function createPage(vuePageOptions) {
  1925. {
  1926. return Component(parsePage(vuePageOptions));
  1927. }
  1928. }
  1929. function createComponent(vueOptions) {
  1930. {
  1931. return Component(parseComponent(vueOptions));
  1932. }
  1933. }
  1934. function createSubpackageApp(vm) {
  1935. var appOptions = parseApp(vm);
  1936. var app = getApp({
  1937. allowDefault: true });
  1938. vm.$scope = app;
  1939. var globalData = app.globalData;
  1940. if (globalData) {
  1941. Object.keys(appOptions.globalData).forEach(function (name) {
  1942. if (!hasOwn(globalData, name)) {
  1943. globalData[name] = appOptions.globalData[name];
  1944. }
  1945. });
  1946. }
  1947. Object.keys(appOptions).forEach(function (name) {
  1948. if (!hasOwn(app, name)) {
  1949. app[name] = appOptions[name];
  1950. }
  1951. });
  1952. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1953. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1954. vm.__call_hook('onShow', args);
  1955. });
  1956. }
  1957. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1958. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1959. vm.__call_hook('onHide', args);
  1960. });
  1961. }
  1962. if (isFn(appOptions.onLaunch)) {
  1963. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1964. vm.__call_hook('onLaunch', args);
  1965. }
  1966. return vm;
  1967. }
  1968. function createPlugin(vm) {
  1969. var appOptions = parseApp(vm);
  1970. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1971. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1972. vm.__call_hook('onShow', args);
  1973. });
  1974. }
  1975. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1976. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1977. vm.__call_hook('onHide', args);
  1978. });
  1979. }
  1980. if (isFn(appOptions.onLaunch)) {
  1981. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1982. vm.__call_hook('onLaunch', args);
  1983. }
  1984. return vm;
  1985. }
  1986. todos.forEach(function (todoApi) {
  1987. protocols[todoApi] = false;
  1988. });
  1989. canIUses.forEach(function (canIUseApi) {
  1990. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1991. canIUseApi;
  1992. if (!wx.canIUse(apiName)) {
  1993. protocols[canIUseApi] = false;
  1994. }
  1995. });
  1996. var uni = {};
  1997. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1998. uni = new Proxy({}, {
  1999. get: function get(target, name) {
  2000. if (hasOwn(target, name)) {
  2001. return target[name];
  2002. }
  2003. if (baseApi[name]) {
  2004. return baseApi[name];
  2005. }
  2006. if (api[name]) {
  2007. return promisify(name, api[name]);
  2008. }
  2009. {
  2010. if (extraApi[name]) {
  2011. return promisify(name, extraApi[name]);
  2012. }
  2013. if (todoApis[name]) {
  2014. return promisify(name, todoApis[name]);
  2015. }
  2016. }
  2017. if (eventApi[name]) {
  2018. return eventApi[name];
  2019. }
  2020. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2021. return;
  2022. }
  2023. return promisify(name, wrapper(name, wx[name]));
  2024. },
  2025. set: function set(target, name, value) {
  2026. target[name] = value;
  2027. return true;
  2028. } });
  2029. } else {
  2030. Object.keys(baseApi).forEach(function (name) {
  2031. uni[name] = baseApi[name];
  2032. });
  2033. {
  2034. Object.keys(todoApis).forEach(function (name) {
  2035. uni[name] = promisify(name, todoApis[name]);
  2036. });
  2037. Object.keys(extraApi).forEach(function (name) {
  2038. uni[name] = promisify(name, todoApis[name]);
  2039. });
  2040. }
  2041. Object.keys(eventApi).forEach(function (name) {
  2042. uni[name] = eventApi[name];
  2043. });
  2044. Object.keys(api).forEach(function (name) {
  2045. uni[name] = promisify(name, api[name]);
  2046. });
  2047. Object.keys(wx).forEach(function (name) {
  2048. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2049. uni[name] = promisify(name, wrapper(name, wx[name]));
  2050. }
  2051. });
  2052. }
  2053. wx.createApp = createApp;
  2054. wx.createPage = createPage;
  2055. wx.createComponent = createComponent;
  2056. wx.createSubpackageApp = createSubpackageApp;
  2057. wx.createPlugin = createPlugin;
  2058. var uni$1 = uni;var _default =
  2059. uni$1;exports.default = _default;
  2060. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2061. /***/ }),
  2062. /***/ 11:
  2063. /*!**********************************************************************************************************!*\
  2064. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2065. \**********************************************************************************************************/
  2066. /*! exports provided: default */
  2067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2068. "use strict";
  2069. __webpack_require__.r(__webpack_exports__);
  2070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2071. /* globals __VUE_SSR_CONTEXT__ */
  2072. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2073. // This module is a runtime utility for cleaner component module output and will
  2074. // be included in the final webpack user bundle.
  2075. function normalizeComponent (
  2076. scriptExports,
  2077. render,
  2078. staticRenderFns,
  2079. functionalTemplate,
  2080. injectStyles,
  2081. scopeId,
  2082. moduleIdentifier, /* server only */
  2083. shadowMode, /* vue-cli only */
  2084. components, // fixed by xxxxxx auto components
  2085. renderjs // fixed by xxxxxx renderjs
  2086. ) {
  2087. // Vue.extend constructor export interop
  2088. var options = typeof scriptExports === 'function'
  2089. ? scriptExports.options
  2090. : scriptExports
  2091. // fixed by xxxxxx auto components
  2092. if (components) {
  2093. if (!options.components) {
  2094. options.components = {}
  2095. }
  2096. var hasOwn = Object.prototype.hasOwnProperty
  2097. for (var name in components) {
  2098. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2099. options.components[name] = components[name]
  2100. }
  2101. }
  2102. }
  2103. // fixed by xxxxxx renderjs
  2104. if (renderjs) {
  2105. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2106. this[renderjs.__module] = this
  2107. });
  2108. (options.mixins || (options.mixins = [])).push(renderjs)
  2109. }
  2110. // render functions
  2111. if (render) {
  2112. options.render = render
  2113. options.staticRenderFns = staticRenderFns
  2114. options._compiled = true
  2115. }
  2116. // functional template
  2117. if (functionalTemplate) {
  2118. options.functional = true
  2119. }
  2120. // scopedId
  2121. if (scopeId) {
  2122. options._scopeId = 'data-v-' + scopeId
  2123. }
  2124. var hook
  2125. if (moduleIdentifier) { // server build
  2126. hook = function (context) {
  2127. // 2.3 injection
  2128. context =
  2129. context || // cached call
  2130. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2131. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2132. // 2.2 with runInNewContext: true
  2133. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2134. context = __VUE_SSR_CONTEXT__
  2135. }
  2136. // inject component styles
  2137. if (injectStyles) {
  2138. injectStyles.call(this, context)
  2139. }
  2140. // register component module identifier for async chunk inferrence
  2141. if (context && context._registeredComponents) {
  2142. context._registeredComponents.add(moduleIdentifier)
  2143. }
  2144. }
  2145. // used by ssr in case component is cached and beforeCreate
  2146. // never gets called
  2147. options._ssrRegister = hook
  2148. } else if (injectStyles) {
  2149. hook = shadowMode
  2150. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2151. : injectStyles
  2152. }
  2153. if (hook) {
  2154. if (options.functional) {
  2155. // for template-only hot-reload because in that case the render fn doesn't
  2156. // go through the normalizer
  2157. options._injectStyles = hook
  2158. // register for functioal component in vue file
  2159. var originalRender = options.render
  2160. options.render = function renderWithStyleInjection (h, context) {
  2161. hook.call(context)
  2162. return originalRender(h, context)
  2163. }
  2164. } else {
  2165. // inject component registration as beforeCreate hook
  2166. var existing = options.beforeCreate
  2167. options.beforeCreate = existing
  2168. ? [].concat(existing, hook)
  2169. : [hook]
  2170. }
  2171. }
  2172. return {
  2173. exports: scriptExports,
  2174. options: options
  2175. }
  2176. }
  2177. /***/ }),
  2178. /***/ 12:
  2179. /*!*******************************************************!*\
  2180. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/index.js ***!
  2181. \*******************************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2186. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  2187. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  2188. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  2189. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  2190. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  2191. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  2192. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  2193. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  2194. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  2195. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  2196. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  2197. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  2198. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  2199. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  2200. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  2201. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  2202. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  2203. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  2204. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  2205. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  2206. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  2207. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  2208. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  2209. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  2210. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  2211. // 引入关于是否mixin集成小程序分享的配置
  2212. // import wxshare from './libs/mixin/mpShare.js'
  2213. // 全局挂载引入http相关请求拦截插件
  2214. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  2215. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  2216. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  2217. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  2218. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  2219. // let vuexStore = {};
  2220. // try {
  2221. // vuexStore = require("@/store/$u.mixin.js");
  2222. // } catch (e) {
  2223. // //TODO handle the exception
  2224. // }
  2225. // post类型对象参数转为get类型url参数
  2226. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  2227. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  2228. post: _request.default.post,
  2229. put: _request.default.put,
  2230. 'delete': _request.default.delete,
  2231. hexToRgb: _colorGradient.default.hexToRgb,
  2232. rgbToHex: _colorGradient.default.rgbToHex,
  2233. test: _test.default,
  2234. random: _random.default,
  2235. deepClone: _deepClone.default,
  2236. deepMerge: _deepMerge.default,
  2237. getParent: _getParent.default,
  2238. $parent: _$parent.default,
  2239. addUnit: _addUnit.default,
  2240. trim: _trim.default,
  2241. type: ['primary', 'success', 'error', 'warning', 'info'],
  2242. http: _request.default,
  2243. toast: _toast.default,
  2244. config: _config.default, // uView配置信息相关,比如版本号
  2245. zIndex: _zIndex.default,
  2246. debounce: _debounce.default,
  2247. throttle: _throttle.default };
  2248. // $u挂载到uni对象上
  2249. uni.$u = $u;
  2250. var install = function install(Vue) {
  2251. Vue.mixin(_mixin.default);
  2252. if (Vue.prototype.openShare) {
  2253. Vue.mixin(mpShare);
  2254. }
  2255. // Vue.mixin(vuexStore);
  2256. // 时间格式化,同时两个名称,date和timeFormat
  2257. Vue.filter('timeFormat', function (timestamp, format) {
  2258. return (0, _timeFormat.default)(timestamp, format);
  2259. });
  2260. Vue.filter('date', function (timestamp, format) {
  2261. return (0, _timeFormat.default)(timestamp, format);
  2262. });
  2263. // 将多久以前的方法,注入到全局过滤器
  2264. Vue.filter('timeFrom', function (timestamp, format) {
  2265. return (0, _timeFrom.default)(timestamp, format);
  2266. });
  2267. Vue.prototype.$u = $u;
  2268. };var _default =
  2269. {
  2270. install: install };exports.default = _default;
  2271. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2272. /***/ }),
  2273. /***/ 13:
  2274. /*!******************************************************************!*\
  2275. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  2276. \******************************************************************/
  2277. /*! no static exports found */
  2278. /***/ (function(module, exports, __webpack_require__) {
  2279. "use strict";
  2280. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2281. data: function data() {
  2282. return {};
  2283. },
  2284. onLoad: function onLoad() {
  2285. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  2286. this.$u.getRect = this.$uGetRect;
  2287. },
  2288. methods: {
  2289. // 查询节点信息
  2290. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  2291. // 解决办法为在组件根部再套一个没有任何作用的view元素
  2292. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  2293. return new Promise(function (resolve) {
  2294. uni.createSelectorQuery().
  2295. in(_this)[all ? 'selectAll' : 'select'](selector).
  2296. boundingClientRect(function (rect) {
  2297. if (all && Array.isArray(rect) && rect.length) {
  2298. resolve(rect);
  2299. }
  2300. if (!all && rect) {
  2301. resolve(rect);
  2302. }
  2303. }).
  2304. exec();
  2305. });
  2306. },
  2307. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  2308. // 避免在created中去定义parent变量
  2309. if (!this.parent) this.parent = false;
  2310. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  2311. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  2312. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  2313. this.parent = this.$u.$parent.call(this, parentName);
  2314. if (this.parent) {
  2315. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  2316. Object.keys(this.parentData).map(function (key) {
  2317. _this2.parentData[key] = _this2.parent[key];
  2318. });
  2319. }
  2320. },
  2321. // 阻止事件冒泡
  2322. preventEvent: function preventEvent(e) {
  2323. e && e.stopPropagation && e.stopPropagation();
  2324. } },
  2325. onReachBottom: function onReachBottom() {
  2326. uni.$emit('uOnReachBottom');
  2327. },
  2328. beforeDestroy: function beforeDestroy() {var _this3 = this;
  2329. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  2330. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  2331. if (this.parent && uni.$u.test.array(this.parent.children)) {
  2332. // 组件销毁时,移除父组件中的children数组中对应的实例
  2333. var childrenList = this.parent.children;
  2334. childrenList.map(function (child, index) {
  2335. // 如果相等,则移除
  2336. if (child === _this3) {
  2337. childrenList.splice(index, 1);
  2338. }
  2339. });
  2340. }
  2341. } };exports.default = _default;
  2342. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2343. /***/ }),
  2344. /***/ 14:
  2345. /*!********************************************************************!*\
  2346. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  2347. \********************************************************************/
  2348. /*! no static exports found */
  2349. /***/ (function(module, exports, __webpack_require__) {
  2350. "use strict";
  2351. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  2352. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  2353. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  2354. // 设置全局默认配置
  2355. value: function setConfig(customConfig) {
  2356. // 深度合并对象,否则会造成对象深层属性丢失
  2357. this.config = (0, _deepMerge.default)(this.config, customConfig);
  2358. }
  2359. // 主要请求部分
  2360. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2361. // 检查请求拦截
  2362. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  2363. var tmpConfig = {};
  2364. var interceptorRequest = this.interceptor.request(options);
  2365. if (interceptorRequest === false) {
  2366. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  2367. return new Promise(function () {});
  2368. }
  2369. this.options = interceptorRequest;
  2370. }
  2371. options.dataType = options.dataType || this.config.dataType;
  2372. options.responseType = options.responseType || this.config.responseType;
  2373. options.url = options.url || '';
  2374. options.params = options.params || {};
  2375. options.header = Object.assign({}, this.config.header, options.header);
  2376. options.method = options.method || this.config.method;
  2377. return new Promise(function (resolve, reject) {
  2378. options.complete = function (response) {
  2379. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  2380. uni.hideLoading();
  2381. // 清除定时器,如果请求回来了,就无需loading
  2382. clearTimeout(_this.config.timer);
  2383. _this.config.timer = null;
  2384. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  2385. if (_this.config.originalData) {
  2386. // 判断是否存在拦截器
  2387. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2388. var resInterceptors = _this.interceptor.response(response);
  2389. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  2390. if (resInterceptors !== false) {
  2391. resolve(resInterceptors);
  2392. } else {
  2393. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  2394. reject(response);
  2395. }
  2396. } else {
  2397. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  2398. resolve(response);
  2399. }
  2400. } else {
  2401. if (response.statusCode == 200) {
  2402. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2403. var _resInterceptors = _this.interceptor.response(response.data);
  2404. if (_resInterceptors !== false) {
  2405. resolve(_resInterceptors);
  2406. } else {
  2407. reject(response.data);
  2408. }
  2409. } else {
  2410. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  2411. resolve(response.data);
  2412. }
  2413. } else {
  2414. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  2415. // if(response.errMsg) {
  2416. // uni.showModal({
  2417. // title: response.errMsg
  2418. // });
  2419. // }
  2420. reject(response);
  2421. }
  2422. }
  2423. };
  2424. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  2425. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  2426. options.url : '/' + options.url);
  2427. // 是否显示loading
  2428. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  2429. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  2430. if (_this.config.showLoading && !_this.config.timer) {
  2431. _this.config.timer = setTimeout(function () {
  2432. uni.showLoading({
  2433. title: _this.config.loadingText,
  2434. mask: _this.config.loadingMask });
  2435. _this.config.timer = null;
  2436. }, _this.config.loadingTime);
  2437. }
  2438. uni.request(options);
  2439. });
  2440. // .catch(res => {
  2441. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  2442. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  2443. // return new Promise(()=>{});
  2444. // })
  2445. } }]);
  2446. function Request() {var _this2 = this;_classCallCheck(this, Request);
  2447. this.config = {
  2448. baseUrl: '', // 请求的根域名
  2449. // 默认的请求头
  2450. header: {},
  2451. method: 'POST',
  2452. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  2453. dataType: 'json',
  2454. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  2455. responseType: 'text',
  2456. showLoading: true, // 是否显示请求中的loading
  2457. loadingText: '请求中...',
  2458. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  2459. timer: null, // 定时器
  2460. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  2461. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  2462. };
  2463. // 拦截器
  2464. this.interceptor = {
  2465. // 请求前的拦截
  2466. request: null,
  2467. // 请求后的拦截
  2468. response: null };
  2469. // get请求
  2470. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2471. return _this2.request({
  2472. method: 'GET',
  2473. url: url,
  2474. header: header,
  2475. data: data });
  2476. };
  2477. // post请求
  2478. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2479. return _this2.request({
  2480. url: url,
  2481. method: 'POST',
  2482. header: header,
  2483. data: data });
  2484. };
  2485. // put请求,不支持支付宝小程序(HX2.6.15)
  2486. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2487. return _this2.request({
  2488. url: url,
  2489. method: 'PUT',
  2490. header: header,
  2491. data: data });
  2492. };
  2493. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  2494. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2495. return _this2.request({
  2496. url: url,
  2497. method: 'DELETE',
  2498. header: header,
  2499. data: data });
  2500. };
  2501. }return Request;}();var _default =
  2502. new Request();exports.default = _default;
  2503. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2504. /***/ }),
  2505. /***/ 15:
  2506. /*!*************************************************************************!*\
  2507. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  2508. \*************************************************************************/
  2509. /*! no static exports found */
  2510. /***/ (function(module, exports, __webpack_require__) {
  2511. "use strict";
  2512. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2513. // JS对象深度合并
  2514. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2515. target = (0, _deepClone.default)(target);
  2516. if (typeof target !== 'object' || typeof source !== 'object') return false;
  2517. for (var prop in source) {
  2518. if (!source.hasOwnProperty(prop)) continue;
  2519. if (prop in target) {
  2520. if (typeof target[prop] !== 'object') {
  2521. target[prop] = source[prop];
  2522. } else {
  2523. if (typeof source[prop] !== 'object') {
  2524. target[prop] = source[prop];
  2525. } else {
  2526. if (target[prop].concat && source[prop].concat) {
  2527. target[prop] = target[prop].concat(source[prop]);
  2528. } else {
  2529. target[prop] = deepMerge(target[prop], source[prop]);
  2530. }
  2531. }
  2532. }
  2533. } else {
  2534. target[prop] = source[prop];
  2535. }
  2536. }
  2537. return target;
  2538. }var _default =
  2539. deepMerge;exports.default = _default;
  2540. /***/ }),
  2541. /***/ 16:
  2542. /*!*************************************************************************!*\
  2543. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  2544. \*************************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. "use strict";
  2548. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  2549. function isArray(arr) {
  2550. return Object.prototype.toString.call(arr) === '[object Array]';
  2551. }
  2552. // 深度克隆
  2553. function deepClone(obj) {
  2554. // 对常见的“非”值,直接返回原来值
  2555. if ([null, undefined, NaN, false].includes(obj)) return obj;
  2556. if (typeof obj !== "object" && typeof obj !== 'function') {
  2557. //原始类型直接返回
  2558. return obj;
  2559. }
  2560. var o = isArray(obj) ? [] : {};
  2561. for (var i in obj) {
  2562. if (obj.hasOwnProperty(i)) {
  2563. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  2564. }
  2565. }
  2566. return o;
  2567. }var _default =
  2568. deepClone;exports.default = _default;
  2569. /***/ }),
  2570. /***/ 17:
  2571. /*!********************************************************************!*\
  2572. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  2573. \********************************************************************/
  2574. /*! no static exports found */
  2575. /***/ (function(module, exports, __webpack_require__) {
  2576. "use strict";
  2577. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2578. * 验证电子邮箱格式
  2579. */
  2580. function email(value) {
  2581. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  2582. }
  2583. /**
  2584. * 验证手机格式
  2585. */
  2586. function mobile(value) {
  2587. return /^1[23456789]\d{9}$/.test(value);
  2588. }
  2589. /**
  2590. * 验证URL格式
  2591. */
  2592. function url(value) {
  2593. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  2594. }
  2595. /**
  2596. * 验证日期格式
  2597. */
  2598. function date(value) {
  2599. return !/Invalid|NaN/.test(new Date(value).toString());
  2600. }
  2601. /**
  2602. * 验证ISO类型的日期格式
  2603. */
  2604. function dateISO(value) {
  2605. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  2606. }
  2607. /**
  2608. * 验证十进制数字
  2609. */
  2610. function number(value) {
  2611. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  2612. }
  2613. /**
  2614. * 验证整数
  2615. */
  2616. function digits(value) {
  2617. return /^\d+$/.test(value);
  2618. }
  2619. /**
  2620. * 验证身份证号码
  2621. */
  2622. function idCard(value) {
  2623. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  2624. value);
  2625. }
  2626. /**
  2627. * 是否车牌号
  2628. */
  2629. function carNo(value) {
  2630. // 新能源车牌
  2631. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  2632. // 旧车牌
  2633. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  2634. if (value.length === 7) {
  2635. return creg.test(value);
  2636. } else if (value.length === 8) {
  2637. return xreg.test(value);
  2638. } else {
  2639. return false;
  2640. }
  2641. }
  2642. /**
  2643. * 金额,只允许2位小数
  2644. */
  2645. function amount(value) {
  2646. //金额,只允许保留两位小数
  2647. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  2648. }
  2649. /**
  2650. * 中文
  2651. */
  2652. function chinese(value) {
  2653. var reg = /^[\u4e00-\u9fa5]+$/gi;
  2654. return reg.test(value);
  2655. }
  2656. /**
  2657. * 只能输入字母
  2658. */
  2659. function letter(value) {
  2660. return /^[a-zA-Z]*$/.test(value);
  2661. }
  2662. /**
  2663. * 只能是字母或者数字
  2664. */
  2665. function enOrNum(value) {
  2666. //英文或者数字
  2667. var reg = /^[0-9a-zA-Z]*$/g;
  2668. return reg.test(value);
  2669. }
  2670. /**
  2671. * 验证是否包含某个值
  2672. */
  2673. function contains(value, param) {
  2674. return value.indexOf(param) >= 0;
  2675. }
  2676. /**
  2677. * 验证一个值范围[min, max]
  2678. */
  2679. function range(value, param) {
  2680. return value >= param[0] && value <= param[1];
  2681. }
  2682. /**
  2683. * 验证一个长度范围[min, max]
  2684. */
  2685. function rangeLength(value, param) {
  2686. return value.length >= param[0] && value.length <= param[1];
  2687. }
  2688. /**
  2689. * 是否固定电话
  2690. */
  2691. function landline(value) {
  2692. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  2693. return reg.test(value);
  2694. }
  2695. /**
  2696. * 判断是否为空
  2697. */
  2698. function empty(value) {
  2699. switch (typeof value) {
  2700. case 'undefined':
  2701. return true;
  2702. case 'string':
  2703. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  2704. break;
  2705. case 'boolean':
  2706. if (!value) return true;
  2707. break;
  2708. case 'number':
  2709. if (0 === value || isNaN(value)) return true;
  2710. break;
  2711. case 'object':
  2712. if (null === value || value.length === 0) return true;
  2713. for (var i in value) {
  2714. return false;
  2715. }
  2716. return true;}
  2717. return false;
  2718. }
  2719. /**
  2720. * 是否json字符串
  2721. */
  2722. function jsonString(value) {
  2723. if (typeof value == 'string') {
  2724. try {
  2725. var obj = JSON.parse(value);
  2726. if (typeof obj == 'object' && obj) {
  2727. return true;
  2728. } else {
  2729. return false;
  2730. }
  2731. } catch (e) {
  2732. return false;
  2733. }
  2734. }
  2735. return false;
  2736. }
  2737. /**
  2738. * 是否数组
  2739. */
  2740. function array(value) {
  2741. if (typeof Array.isArray === "function") {
  2742. return Array.isArray(value);
  2743. } else {
  2744. return Object.prototype.toString.call(value) === "[object Array]";
  2745. }
  2746. }
  2747. /**
  2748. * 是否对象
  2749. */
  2750. function object(value) {
  2751. return Object.prototype.toString.call(value) === '[object Object]';
  2752. }
  2753. /**
  2754. * 是否短信验证码
  2755. */
  2756. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  2757. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  2758. }var _default =
  2759. {
  2760. email: email,
  2761. mobile: mobile,
  2762. url: url,
  2763. date: date,
  2764. dateISO: dateISO,
  2765. number: number,
  2766. digits: digits,
  2767. idCard: idCard,
  2768. carNo: carNo,
  2769. amount: amount,
  2770. chinese: chinese,
  2771. letter: letter,
  2772. enOrNum: enOrNum,
  2773. contains: contains,
  2774. range: range,
  2775. rangeLength: rangeLength,
  2776. empty: empty,
  2777. isEmpty: empty,
  2778. jsonString: jsonString,
  2779. landline: landline,
  2780. object: object,
  2781. array: array,
  2782. code: code };exports.default = _default;
  2783. /***/ }),
  2784. /***/ 175:
  2785. /*!**************************************************************************************!*\
  2786. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  2787. \**************************************************************************************/
  2788. /*! no static exports found */
  2789. /***/ (function(module, exports, __webpack_require__) {
  2790. "use strict";
  2791. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2792. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 176));
  2793. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 177));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  2794. * html 解析器
  2795. * @tutorial https://github.com/jin-yufeng/Parser
  2796. * @version 20201029
  2797. * @author JinYufeng
  2798. * @listens MIT
  2799. */var blankChar = _config.default.blankChar;var windowWidth = uni.getSystemInfoSync().windowWidth;var emoji;function MpHtmlParser(data) {var _this = this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2800. this.attrs = {};
  2801. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  2802. this.data = data;
  2803. this.domain = options.domain;
  2804. this.DOM = [];
  2805. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  2806. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  2807. this.options = options;
  2808. this.state = this.Text;
  2809. this.STACK = [];
  2810. // 工具函数
  2811. this.bubble = function () {
  2812. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  2813. if (_config.default.richOnlyTags[item.name]) return false;
  2814. item.c = 1;
  2815. }
  2816. return true;
  2817. };
  2818. this.decode = function (val, amp) {
  2819. var i = -1,
  2820. j,en;
  2821. while (1) {
  2822. if ((i = val.indexOf('&', i + 1)) == -1) break;
  2823. if ((j = val.indexOf(';', i + 2)) == -1) break;
  2824. if (val[i + 1] == '#') {
  2825. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  2826. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  2827. } else {
  2828. en = val.substring(i + 1, j);
  2829. if (_config.default.entities[en] || en == amp)
  2830. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  2831. }
  2832. }
  2833. return val;
  2834. };
  2835. this.getUrl = function (url) {
  2836. if (url[0] == '/') {
  2837. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  2838. if (_this.domain) url = _this.domain + url;
  2839. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  2840. url = _this.domain + '/' + url;
  2841. return url;
  2842. };
  2843. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  2844. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  2845. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  2846. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  2847. }
  2848. MpHtmlParser.prototype.parse = function () {
  2849. if (emoji) this.data = emoji.parseEmoji(this.data);
  2850. for (var c; c = this.data[this.i]; this.i++) {
  2851. this.state(c);}
  2852. if (this.state == this.Text) this.setText();
  2853. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  2854. return this.DOM;
  2855. };
  2856. // 设置属性
  2857. MpHtmlParser.prototype.setAttr = function () {
  2858. var name = this.attrName.toLowerCase(),
  2859. val = this.attrVal;
  2860. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  2861. if (val) {
  2862. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  2863. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  2864. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  2865. }
  2866. this.attrVal = '';
  2867. while (blankChar[this.data[this.i]]) {this.i++;}
  2868. if (this.isClose()) this.setNode();else
  2869. {
  2870. this.start = this.i;
  2871. this.state = this.AttrName;
  2872. }
  2873. };
  2874. // 设置文本节点
  2875. MpHtmlParser.prototype.setText = function () {
  2876. var back,text = this.section();
  2877. if (!text) return;
  2878. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  2879. if (back) {
  2880. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  2881. var j = this.start + text.length;
  2882. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  2883. return;
  2884. }
  2885. if (!this.pre) {
  2886. // 合并空白符
  2887. var flag,tmp = [];
  2888. for (var i = text.length, c; c = text[--i];) {
  2889. if (!blankChar[c]) {
  2890. tmp.unshift(c);
  2891. if (!flag) flag = 1;
  2892. } else {
  2893. if (tmp[0] != ' ') tmp.unshift(' ');
  2894. if (c == '\n' && flag == void 0) flag = 0;
  2895. }}
  2896. if (flag == 0) return;
  2897. text = tmp.join('');
  2898. }
  2899. this.siblings().push({
  2900. type: 'text',
  2901. text: this.decode(text) });
  2902. };
  2903. // 设置元素节点
  2904. MpHtmlParser.prototype.setNode = function () {
  2905. var node = {
  2906. name: this.tagName.toLowerCase(),
  2907. attrs: this.attrs },
  2908. close = _config.default.selfClosingTags[node.name];
  2909. if (this.options.nodes.length) node.type = 'node';
  2910. this.attrs = {};
  2911. if (!_config.default.ignoreTags[node.name]) {
  2912. // 处理属性
  2913. var attrs = node.attrs,
  2914. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  2915. styleObj = {};
  2916. if (attrs.id) {
  2917. if (this.options.compress & 1) attrs.id = void 0;else
  2918. if (this.options.useAnchor) this.bubble();
  2919. }
  2920. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  2921. switch (node.name) {
  2922. case 'a':
  2923. case 'ad':
  2924. this.bubble();
  2925. break;
  2926. case 'font':
  2927. if (attrs.color) {
  2928. styleObj['color'] = attrs.color;
  2929. attrs.color = void 0;
  2930. }
  2931. if (attrs.face) {
  2932. styleObj['font-family'] = attrs.face;
  2933. attrs.face = void 0;
  2934. }
  2935. if (attrs.size) {
  2936. var size = parseInt(attrs.size);
  2937. if (size < 1) size = 1;else
  2938. if (size > 7) size = 7;
  2939. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  2940. styleObj['font-size'] = map[size - 1];
  2941. attrs.size = void 0;
  2942. }
  2943. break;
  2944. case 'embed':
  2945. var src = node.attrs.src || '',
  2946. type = node.attrs.type || '';
  2947. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  2948. node.name = 'video';else
  2949. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  2950. '.aac'))
  2951. node.name = 'audio';else
  2952. break;
  2953. if (node.attrs.autostart)
  2954. node.attrs.autoplay = 'T';
  2955. node.attrs.controls = 'T';
  2956. case 'video':
  2957. case 'audio':
  2958. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  2959. this["".concat(node.name, "Num")]++;
  2960. if (node.name == 'video') {
  2961. if (this.videoNum > 3)
  2962. node.lazyLoad = 1;
  2963. if (attrs.width) {
  2964. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  2965. attrs.width = void 0;
  2966. }
  2967. if (attrs.height) {
  2968. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  2969. attrs.height = void 0;
  2970. }
  2971. }
  2972. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  2973. attrs.source = [];
  2974. if (attrs.src) {
  2975. attrs.source.push(attrs.src);
  2976. attrs.src = void 0;
  2977. }
  2978. this.bubble();
  2979. break;
  2980. case 'td':
  2981. case 'th':
  2982. if (attrs.colspan || attrs.rowspan)
  2983. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  2984. if (item.name == 'table') {
  2985. item.flag = 1;
  2986. break;
  2987. }}}
  2988. if (attrs.align) {
  2989. if (node.name == 'table') {
  2990. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  2991. styleObj['float'] = attrs.align;
  2992. } else styleObj['text-align'] = attrs.align;
  2993. attrs.align = void 0;
  2994. }
  2995. // 压缩 style
  2996. var styles = style.split(';');
  2997. style = '';
  2998. for (var i = 0, len = styles.length; i < len; i++) {
  2999. var info = styles[i].split(':');
  3000. if (info.length < 2) continue;
  3001. var _key = info[0].trim().toLowerCase(),
  3002. _value = info.slice(1).join(':').trim();
  3003. if (_value[0] == '-' || _value.includes('safe'))
  3004. style += ";".concat(_key, ":").concat(_value);else
  3005. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  3006. styleObj[_key] = _value;
  3007. }
  3008. if (node.name == 'img') {
  3009. if (attrs.src && !attrs.ignore) {
  3010. if (this.bubble())
  3011. attrs.i = (this.imgNum++).toString();else
  3012. attrs.ignore = 'T';
  3013. }
  3014. if (attrs.ignore) {
  3015. style += ';-webkit-touch-callout:none';
  3016. styleObj['max-width'] = '100%';
  3017. }
  3018. var width;
  3019. if (styleObj.width) width = styleObj.width;else
  3020. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  3021. if (width) {
  3022. styleObj.width = width;
  3023. attrs.width = '100%';
  3024. if (parseInt(width) > windowWidth) {
  3025. styleObj.height = '';
  3026. if (attrs.height) attrs.height = void 0;
  3027. }
  3028. }
  3029. if (styleObj.height) {
  3030. attrs.height = styleObj.height;
  3031. styleObj.height = '';
  3032. } else if (attrs.height && !attrs.height.includes('%'))
  3033. attrs.height = parseFloat(attrs.height) + 'px';
  3034. }
  3035. for (var key in styleObj) {
  3036. var value = styleObj[key];
  3037. if (!value) continue;
  3038. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  3039. // 填充链接
  3040. if (value.includes('url')) {
  3041. var j = value.indexOf('(');
  3042. if (j++ != -1) {
  3043. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  3044. value = value.substr(0, j) + this.getUrl(value.substr(j));
  3045. }
  3046. }
  3047. // 转换 rpx
  3048. else if (value.includes('rpx'))
  3049. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  3050. if (key == 'white-space' && value.includes('pre') && !close)
  3051. this.pre = node.pre = true;
  3052. style += ";".concat(key, ":").concat(value);
  3053. }
  3054. style = style.substr(1);
  3055. if (style) attrs.style = style;
  3056. if (!close) {
  3057. node.children = [];
  3058. if (node.name == 'pre' && _config.default.highlight) {
  3059. this.remove(node);
  3060. this.pre = node.pre = true;
  3061. }
  3062. this.siblings().push(node);
  3063. this.STACK.push(node);
  3064. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  3065. this.siblings().push(node);
  3066. } else {
  3067. if (!close) this.remove(node);else
  3068. if (node.name == 'source') {
  3069. var parent = this.parent();
  3070. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  3071. parent.attrs.source.push(node.attrs.src);
  3072. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  3073. }
  3074. if (this.data[this.i] == '/') this.i++;
  3075. this.start = this.i + 1;
  3076. this.state = this.Text;
  3077. };
  3078. // 移除标签
  3079. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  3080. var name = node.name,
  3081. j = this.i;
  3082. // 处理 svg
  3083. var handleSvg = function handleSvg() {
  3084. var src = _this2.data.substring(j, _this2.i + 1);
  3085. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  3086. for (var key in node.attrs) {
  3087. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  3088. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  3089. }
  3090. src = '<svg' + src;
  3091. var parent = _this2.parent();
  3092. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  3093. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  3094. _this2.siblings().push({
  3095. name: 'img',
  3096. attrs: {
  3097. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  3098. style: node.attrs.style,
  3099. ignore: 'T' } });
  3100. };
  3101. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  3102. while (1) {
  3103. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  3104. if (name == 'pre' || name == 'svg') this.i = j;else
  3105. this.i = this.data.length;
  3106. return;
  3107. }
  3108. this.start = this.i += 2;
  3109. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  3110. if (this.section().toLowerCase() == name) {
  3111. // 代码块高亮
  3112. if (name == 'pre') {
  3113. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  3114. substr(this.i - 5);
  3115. return this.i = j;
  3116. } else if (name == 'style')
  3117. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  3118. if (name == 'title')
  3119. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  3120. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  3121. if (name == 'svg') handleSvg();
  3122. return;
  3123. }
  3124. }
  3125. };
  3126. // 节点出栈处理
  3127. MpHtmlParser.prototype.popNode = function (node) {
  3128. // 空白符处理
  3129. if (node.pre) {
  3130. node.pre = this.pre = void 0;
  3131. for (var i = this.STACK.length; i--;) {
  3132. if (this.STACK[i].pre)
  3133. this.pre = true;}
  3134. }
  3135. var siblings = this.siblings(),
  3136. len = siblings.length,
  3137. childs = node.children;
  3138. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  3139. return siblings.pop();
  3140. var attrs = node.attrs;
  3141. // 替换一些标签名
  3142. if (_config.default.blockTags[node.name]) node.name = 'div';else
  3143. if (!_config.default.trustTags[node.name]) node.name = 'span';
  3144. // 处理列表
  3145. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  3146. if ((node.attrs.style || '').includes('list-style:none')) {
  3147. for (var _i = 0, child; child = childs[_i++];) {
  3148. if (child.name == 'li')
  3149. child.name = 'div';}
  3150. } else if (node.name == 'ul') {
  3151. var floor = 1;
  3152. for (var _i2 = this.STACK.length; _i2--;) {
  3153. if (this.STACK[_i2].name == 'ul') floor++;}
  3154. if (floor != 1)
  3155. for (var _i3 = childs.length; _i3--;) {
  3156. childs[_i3].floor = floor;}
  3157. } else {
  3158. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  3159. if (_child.name == 'li') {
  3160. _child.type = 'ol';
  3161. _child.num = function (num, type) {
  3162. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  3163. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  3164. if (type == 'i' || type == 'I') {
  3165. num = (num - 1) % 99 + 1;
  3166. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  3167. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  3168. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  3169. if (type == 'i') return res.toLowerCase();
  3170. return res;
  3171. }
  3172. return num;
  3173. }(num++, attrs.type) + '.';
  3174. }}
  3175. }
  3176. }
  3177. // 处理表格
  3178. if (node.name == 'table') {
  3179. var padding = parseFloat(attrs.cellpadding),
  3180. spacing = parseFloat(attrs.cellspacing),
  3181. border = parseFloat(attrs.border);
  3182. if (node.c) {
  3183. if (isNaN(padding)) padding = 2;
  3184. if (isNaN(spacing)) spacing = 2;
  3185. }
  3186. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  3187. if (node.flag && node.c) {
  3188. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  3189. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  3190. var row = 1,
  3191. col = 1,
  3192. colNum,
  3193. trs = [],
  3194. children = [],
  3195. map = {};
  3196. (function f(ns) {
  3197. for (var i = 0; i < ns.length; i++) {
  3198. if (ns[i].name == 'tr') trs.push(ns[i]);else
  3199. f(ns[i].children || []);
  3200. }
  3201. })(node.children);
  3202. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  3203. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  3204. if (td.name == 'td' || td.name == 'th') {
  3205. while (map[row + '.' + col]) {col++;}
  3206. var cell = {
  3207. name: 'div',
  3208. c: 1,
  3209. attrs: {
  3210. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  3211. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  3212. children: td.children };
  3213. if (td.attrs.colspan) {
  3214. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  3215. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  3216. col += parseInt(td.attrs.colspan) - 1;
  3217. }
  3218. if (td.attrs.rowspan) {
  3219. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  3220. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  3221. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  3222. }
  3223. children.push(cell);
  3224. col++;
  3225. }
  3226. }
  3227. if (!colNum) {
  3228. colNum = col - 1;
  3229. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  3230. }
  3231. col = 1;
  3232. row++;
  3233. }
  3234. node.children = children;
  3235. } else {
  3236. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  3237. if (border || padding)
  3238. (function f(ns) {
  3239. for (var i = 0, n; n = ns[i]; i++) {
  3240. if (n.name == 'th' || n.name == 'td') {
  3241. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  3242. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  3243. } else f(n.children || []);
  3244. }
  3245. })(childs);
  3246. }
  3247. if (this.options.autoscroll) {
  3248. var table = Object.assign({}, node);
  3249. node.name = 'div';
  3250. node.attrs = {
  3251. style: 'overflow:scroll' };
  3252. node.children = [table];
  3253. }
  3254. }
  3255. this.CssHandler.pop && this.CssHandler.pop(node);
  3256. // 自动压缩
  3257. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  3258. siblings[len - 1] = childs[0];
  3259. };
  3260. // 状态机
  3261. MpHtmlParser.prototype.Text = function (c) {
  3262. if (c == '<') {
  3263. var next = this.data[this.i + 1],
  3264. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3265. if (isLetter(next)) {
  3266. this.setText();
  3267. this.start = this.i + 1;
  3268. this.state = this.TagName;
  3269. } else if (next == '/') {
  3270. this.setText();
  3271. if (isLetter(this.data[++this.i + 1])) {
  3272. this.start = this.i + 1;
  3273. this.state = this.EndTag;
  3274. } else this.Comment();
  3275. } else if (next == '!' || next == '?') {
  3276. this.setText();
  3277. this.Comment();
  3278. }
  3279. }
  3280. };
  3281. MpHtmlParser.prototype.Comment = function () {
  3282. var key;
  3283. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  3284. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  3285. key = '>';
  3286. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  3287. this.i += key.length - 1;
  3288. this.start = this.i + 1;
  3289. this.state = this.Text;
  3290. };
  3291. MpHtmlParser.prototype.TagName = function (c) {
  3292. if (blankChar[c]) {
  3293. this.tagName = this.section();
  3294. while (blankChar[this.data[this.i]]) {this.i++;}
  3295. if (this.isClose()) this.setNode();else
  3296. {
  3297. this.start = this.i;
  3298. this.state = this.AttrName;
  3299. }
  3300. } else if (this.isClose()) {
  3301. this.tagName = this.section();
  3302. this.setNode();
  3303. }
  3304. };
  3305. MpHtmlParser.prototype.AttrName = function (c) {
  3306. if (c == '=' || blankChar[c] || this.isClose()) {
  3307. this.attrName = this.section();
  3308. if (blankChar[c])
  3309. while (blankChar[this.data[++this.i]]) {;}
  3310. if (this.data[this.i] == '=') {
  3311. while (blankChar[this.data[++this.i]]) {;}
  3312. this.start = this.i--;
  3313. this.state = this.AttrValue;
  3314. } else this.setAttr();
  3315. }
  3316. };
  3317. MpHtmlParser.prototype.AttrValue = function (c) {
  3318. if (c == '"' || c == "'") {
  3319. this.start++;
  3320. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  3321. this.attrVal = this.section();
  3322. this.i++;
  3323. } else {
  3324. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  3325. this.attrVal = this.section();
  3326. }
  3327. this.setAttr();
  3328. };
  3329. MpHtmlParser.prototype.EndTag = function (c) {
  3330. if (blankChar[c] || c == '>' || c == '/') {
  3331. var name = this.section().toLowerCase();
  3332. for (var i = this.STACK.length; i--;) {
  3333. if (this.STACK[i].name == name) break;}
  3334. if (i != -1) {
  3335. var node;
  3336. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  3337. this.popNode(node);
  3338. } else if (name == 'p' || name == 'br')
  3339. this.siblings().push({
  3340. name: name,
  3341. attrs: {} });
  3342. this.i = this.data.indexOf('>', this.i);
  3343. this.start = this.i + 1;
  3344. if (this.i == -1) this.i = this.data.length;else
  3345. this.state = this.Text;
  3346. }
  3347. };var _default =
  3348. MpHtmlParser;exports.default = _default;
  3349. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3350. /***/ }),
  3351. /***/ 176:
  3352. /*!********************************************************************************!*\
  3353. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  3354. \********************************************************************************/
  3355. /*! no static exports found */
  3356. /***/ (function(module, exports, __webpack_require__) {
  3357. "use strict";
  3358. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  3359. var cfg = {
  3360. // 出错占位图
  3361. errorImg: null,
  3362. // 过滤器函数
  3363. filter: null,
  3364. // 代码高亮函数
  3365. highlight: null,
  3366. // 文本处理函数
  3367. onText: null,
  3368. // 实体编码列表
  3369. entities: {
  3370. quot: '"',
  3371. apos: "'",
  3372. semi: ';',
  3373. nbsp: '\xA0',
  3374. ensp: "\u2002",
  3375. emsp: "\u2003",
  3376. ndash: '–',
  3377. mdash: '—',
  3378. middot: '·',
  3379. lsquo: '‘',
  3380. rsquo: '’',
  3381. ldquo: '“',
  3382. rdquo: '”',
  3383. bull: '•',
  3384. hellip: '…' },
  3385. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  3386. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  3387. // 块级标签,将被转为 div
  3388. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  3389. // 将被移除的标签
  3390. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  3391. // 只能被 rich-text 显示的标签
  3392. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  3393. // 自闭合的标签
  3394. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  3395. // 信任的标签
  3396. trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
  3397. // 默认的标签样式
  3398. userAgentStyles: {
  3399. address: 'font-style:italic',
  3400. big: 'display:inline;font-size:1.2em',
  3401. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  3402. caption: 'display:table-caption;text-align:center',
  3403. center: 'text-align:center',
  3404. cite: 'font-style:italic',
  3405. dd: 'margin-left:40px',
  3406. mark: 'background-color:yellow',
  3407. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  3408. s: 'text-decoration:line-through',
  3409. small: 'display:inline;font-size:0.8em',
  3410. u: 'text-decoration:underline' } };
  3411. function makeMap(str) {
  3412. var map = Object.create(null),
  3413. list = str.split(',');
  3414. for (var i = list.length; i--;) {
  3415. map[list[i]] = true;}
  3416. return map;
  3417. }
  3418. if (wx.canIUse('editor')) {
  3419. cfg.blockTags.pre = void 0;
  3420. cfg.ignoreTags.rp = true;
  3421. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  3422. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  3423. }var _default =
  3424. cfg;exports.default = _default;
  3425. /***/ }),
  3426. /***/ 177:
  3427. /*!************************************************************************************!*\
  3428. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  3429. \************************************************************************************/
  3430. /*! no static exports found */
  3431. /***/ (function(module, exports, __webpack_require__) {
  3432. "use strict";
  3433. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 176));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3434. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3435. function CssHandler(tagStyle) {
  3436. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  3437. for (var item in tagStyle) {
  3438. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  3439. this.styles = styles;
  3440. }
  3441. CssHandler.prototype.getStyle = function (data) {
  3442. this.styles = new parser(data, this.styles).parse();
  3443. };
  3444. CssHandler.prototype.match = function (name, attrs) {
  3445. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  3446. if (attrs.class) {
  3447. var items = attrs.class.split(' ');
  3448. for (var i = 0, item; item = items[i]; i++) {
  3449. if (tmp = this.styles['.' + item])
  3450. matched += tmp + ';';}
  3451. }
  3452. if (tmp = this.styles['#' + attrs.id])
  3453. matched += tmp + ';';
  3454. return matched;
  3455. };var _default =
  3456. CssHandler;exports.default = _default;
  3457. function parser(data, init) {
  3458. this.data = data;
  3459. this.floor = 0;
  3460. this.i = 0;
  3461. this.list = [];
  3462. this.res = init;
  3463. this.state = this.Space;
  3464. }
  3465. parser.prototype.parse = function () {
  3466. for (var c; c = this.data[this.i]; this.i++) {
  3467. this.state(c);}
  3468. return this.res;
  3469. };
  3470. parser.prototype.section = function () {
  3471. return this.data.substring(this.start, this.i);
  3472. };
  3473. // 状态机
  3474. parser.prototype.Space = function (c) {
  3475. if (c == '.' || c == '#' || isLetter(c)) {
  3476. this.start = this.i;
  3477. this.state = this.Name;
  3478. } else if (c == '/' && this.data[this.i + 1] == '*')
  3479. this.Comment();else
  3480. if (!_config.default.blankChar[c] && c != ';')
  3481. this.state = this.Ignore;
  3482. };
  3483. parser.prototype.Comment = function () {
  3484. this.i = this.data.indexOf('*/', this.i) + 1;
  3485. if (!this.i) this.i = this.data.length;
  3486. this.state = this.Space;
  3487. };
  3488. parser.prototype.Ignore = function (c) {
  3489. if (c == '{') this.floor++;else
  3490. if (c == '}' && ! --this.floor) {
  3491. this.list = [];
  3492. this.state = this.Space;
  3493. }
  3494. };
  3495. parser.prototype.Name = function (c) {
  3496. if (_config.default.blankChar[c]) {
  3497. this.list.push(this.section());
  3498. this.state = this.NameSpace;
  3499. } else if (c == '{') {
  3500. this.list.push(this.section());
  3501. this.Content();
  3502. } else if (c == ',') {
  3503. this.list.push(this.section());
  3504. this.Comma();
  3505. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  3506. this.state = this.Ignore;
  3507. };
  3508. parser.prototype.NameSpace = function (c) {
  3509. if (c == '{') this.Content();else
  3510. if (c == ',') this.Comma();else
  3511. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  3512. };
  3513. parser.prototype.Comma = function () {
  3514. while (_config.default.blankChar[this.data[++this.i]]) {;}
  3515. if (this.data[this.i] == '{') this.Content();else
  3516. {
  3517. this.start = this.i--;
  3518. this.state = this.Name;
  3519. }
  3520. };
  3521. parser.prototype.Content = function () {
  3522. this.start = ++this.i;
  3523. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  3524. var content = this.section();
  3525. for (var i = 0, item; item = this.list[i++];) {
  3526. if (this.res[item]) this.res[item] += ';' + content;else
  3527. this.res[item] = content;}
  3528. this.list = [];
  3529. this.state = this.Space;
  3530. };
  3531. /***/ }),
  3532. /***/ 18:
  3533. /*!***************************************************************************!*\
  3534. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  3535. \***************************************************************************/
  3536. /*! no static exports found */
  3537. /***/ (function(module, exports, __webpack_require__) {
  3538. "use strict";
  3539. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3540. * 对象转url参数
  3541. * @param {*} data,对象
  3542. * @param {*} isPrefix,是否自动加上"?"
  3543. */
  3544. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  3545. var prefix = isPrefix ? '?' : '';
  3546. var _result = [];
  3547. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  3548. key) {
  3549. var value = data[key];
  3550. // 去掉为空的参数
  3551. if (['', undefined, null].indexOf(value) >= 0) {
  3552. return "continue";
  3553. }
  3554. // 如果值为数组,另行处理
  3555. if (value.constructor === Array) {
  3556. // e.g. {ids: [1, 2, 3]}
  3557. switch (arrayFormat) {
  3558. case 'indices':
  3559. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  3560. for (var i = 0; i < value.length; i++) {
  3561. _result.push(key + '[' + i + ']=' + value[i]);
  3562. }
  3563. break;
  3564. case 'brackets':
  3565. // 结果: ids[]=1&ids[]=2&ids[]=3
  3566. value.forEach(function (_value) {
  3567. _result.push(key + '[]=' + _value);
  3568. });
  3569. break;
  3570. case 'repeat':
  3571. // 结果: ids=1&ids=2&ids=3
  3572. value.forEach(function (_value) {
  3573. _result.push(key + '=' + _value);
  3574. });
  3575. break;
  3576. case 'comma':
  3577. // 结果: ids=1,2,3
  3578. var commaStr = "";
  3579. value.forEach(function (_value) {
  3580. commaStr += (commaStr ? "," : "") + _value;
  3581. });
  3582. _result.push(key + '=' + commaStr);
  3583. break;
  3584. default:
  3585. value.forEach(function (_value) {
  3586. _result.push(key + '[]=' + _value);
  3587. });}
  3588. } else {
  3589. _result.push(key + '=' + value);
  3590. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  3591. }
  3592. return _result.length ? prefix + _result.join('&') : '';
  3593. }var _default =
  3594. queryParams;exports.default = _default;
  3595. /***/ }),
  3596. /***/ 19:
  3597. /*!*********************************************************************!*\
  3598. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  3599. \*********************************************************************/
  3600. /*! no static exports found */
  3601. /***/ (function(module, exports, __webpack_require__) {
  3602. "use strict";
  3603. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  3604. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  3605. * 并且带有路由拦截功能
  3606. */var
  3607. Router = /*#__PURE__*/function () {
  3608. function Router() {_classCallCheck(this, Router);
  3609. // 原始属性定义
  3610. this.config = {
  3611. type: 'navigateTo',
  3612. url: '',
  3613. delta: 1, // navigateBack页面后退时,回退的层数
  3614. params: {}, // 传递的参数
  3615. animationType: 'pop-in', // 窗口动画,只在APP有效
  3616. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  3617. intercept: false // 是否需要拦截
  3618. };
  3619. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  3620. // 这里在构造函数中进行this绑定
  3621. this.route = this.route.bind(this);
  3622. }
  3623. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  3624. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  3625. return url[0] === '/' ? url : "/".concat(url);
  3626. }
  3627. // 整合路由参数
  3628. }, { key: "mixinParam", value: function mixinParam(url, params) {
  3629. url = url && this.addRootPath(url);
  3630. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  3631. // 如果有url中有get参数,转换后无需带上"?"
  3632. var query = '';
  3633. if (/.*\/.*\?.*=.*/.test(url)) {
  3634. // object对象转为get类型的参数
  3635. query = uni.$u.queryParams(params, false);
  3636. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  3637. return url += "&" + query;
  3638. } else {
  3639. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  3640. query = uni.$u.queryParams(params);
  3641. return url += query;
  3642. }
  3643. }
  3644. // 对外的方法名称
  3645. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  3646. // 合并用户的配置和内部的默认配置
  3647. mergeConfig = {};
  3648. if (typeof options === 'string') {
  3649. // 如果options为字符串,则为route(url, params)的形式
  3650. mergeConfig.url = this.mixinParam(options, params);
  3651. mergeConfig.type = 'navigateTo';
  3652. } else {
  3653. mergeConfig = uni.$u.deepClone(options, this.config);
  3654. // 否则正常使用mergeConfig中的url和params进行拼接
  3655. mergeConfig.url = this.mixinParam(options.url, options.params);
  3656. }
  3657. if (params.intercept) {
  3658. this.config.intercept = params.intercept;
  3659. }
  3660. // params参数也带给拦截器
  3661. mergeConfig.params = params;
  3662. // 合并内外部参数
  3663. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  3664. // 判断用户是否定义了拦截器
  3665. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  3666. new Promise(function (resolve, reject) {
  3667. uni.$u.routeIntercept(mergeConfig, resolve);
  3668. }));case 10:isNext = _context.sent;
  3669. // 如果isNext为true,则执行路由跳转
  3670. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  3671. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  3672. // 执行路由跳转
  3673. }, { key: "openPage", value: function openPage(config) {
  3674. // 解构参数
  3675. var
  3676. url =
  3677. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  3678. if (config.type == 'navigateTo' || config.type == 'to') {
  3679. uni.navigateTo({
  3680. url: url,
  3681. animationType: animationType,
  3682. animationDuration: animationDuration });
  3683. }
  3684. if (config.type == 'redirectTo' || config.type == 'redirect') {
  3685. uni.redirectTo({
  3686. url: url });
  3687. }
  3688. if (config.type == 'switchTab' || config.type == 'tab') {
  3689. uni.switchTab({
  3690. url: url });
  3691. }
  3692. if (config.type == 'reLaunch' || config.type == 'launch') {
  3693. uni.reLaunch({
  3694. url: url });
  3695. }
  3696. if (config.type == 'navigateBack' || config.type == 'back') {
  3697. uni.navigateBack({
  3698. delta: delta });
  3699. }
  3700. } }]);return Router;}();var _default =
  3701. new Router().route;exports.default = _default;
  3702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3703. /***/ }),
  3704. /***/ 2:
  3705. /*!***********************************!*\
  3706. !*** (webpack)/buildin/global.js ***!
  3707. \***********************************/
  3708. /*! no static exports found */
  3709. /***/ (function(module, exports) {
  3710. var g;
  3711. // This works in non-strict mode
  3712. g = (function() {
  3713. return this;
  3714. })();
  3715. try {
  3716. // This works if eval is allowed (see CSP)
  3717. g = g || new Function("return this")();
  3718. } catch (e) {
  3719. // This works if the window reference is available
  3720. if (typeof window === "object") g = window;
  3721. }
  3722. // g can still be undefined, but nothing to do about it...
  3723. // We return undefined, instead of nothing here, so it's
  3724. // easier to handle this case. if(!global) { ...}
  3725. module.exports = g;
  3726. /***/ }),
  3727. /***/ 20:
  3728. /*!**********************************************************!*\
  3729. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  3730. \**********************************************************/
  3731. /*! no static exports found */
  3732. /***/ (function(module, exports, __webpack_require__) {
  3733. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  3734. /***/ }),
  3735. /***/ 206:
  3736. /*!*******************************************************************!*\
  3737. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  3738. \*******************************************************************/
  3739. /*! no static exports found */
  3740. /***/ (function(module, exports, __webpack_require__) {
  3741. "use strict";
  3742. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3743. * 递归使用 call 方式this指向
  3744. * @param componentName // 需要找的组件的名称
  3745. * @param eventName // 事件名称
  3746. * @param params // 需要传递的参数
  3747. */
  3748. function _broadcast(componentName, eventName, params) {
  3749. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  3750. var $children;
  3751. $children = this.$children;
  3752. $children.map(function (child) {
  3753. if (componentName === child.$options.name) {
  3754. child.$emit.apply(child, [eventName].concat(params));
  3755. } else {
  3756. _broadcast.apply(child, [componentName, eventName].concat(params));
  3757. }
  3758. });
  3759. }var _default =
  3760. {
  3761. methods: {
  3762. /**
  3763. * 派发 (向上查找) (一个)
  3764. * @param componentName // 需要找的组件的名称
  3765. * @param eventName // 事件名称
  3766. * @param params // 需要传递的参数
  3767. */
  3768. dispatch: function dispatch(componentName, eventName, params) {
  3769. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  3770. var name = parent.$options.name; // 获取当前组件实例的name
  3771. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  3772. // 循环出当前名称的一样的组件实例
  3773. while (parent && (!name || name !== componentName)) {
  3774. parent = parent.$parent;
  3775. if (parent) {
  3776. name = parent.$options.name;
  3777. }
  3778. }
  3779. // 有节点表示当前找到了name一样的实例
  3780. if (parent) {
  3781. parent.$emit.apply(parent, [eventName].concat(params));
  3782. }
  3783. },
  3784. /**
  3785. * 广播 (向下查找) (广播多个)
  3786. * @param componentName // 需要找的组件的名称
  3787. * @param eventName // 事件名称
  3788. * @param params // 需要传递的参数
  3789. */
  3790. broadcast: function broadcast(componentName, eventName, params) {
  3791. _broadcast.call(this, componentName, eventName, params);
  3792. } } };exports.default = _default;
  3793. /***/ }),
  3794. /***/ 207:
  3795. /*!***************************************************************************!*\
  3796. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  3797. \***************************************************************************/
  3798. /*! no static exports found */
  3799. /***/ (function(module, exports, __webpack_require__) {
  3800. "use strict";
  3801. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  3802. _extends = Object.assign || function (target) {
  3803. for (var i = 1; i < arguments.length; i++) {
  3804. var source = arguments[i];
  3805. for (var key in source) {
  3806. if (Object.prototype.hasOwnProperty.call(source, key)) {
  3807. target[key] = source[key];
  3808. }
  3809. }
  3810. }
  3811. return target;
  3812. };
  3813. return _extends.apply(this, arguments);
  3814. }
  3815. /* eslint no-console:0 */
  3816. var formatRegExp = /%[sdj%]/g;
  3817. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  3818. if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  3819. 'undefined' && typeof document !== 'undefined') {
  3820. warning = function warning(type, errors) {
  3821. if (typeof console !== 'undefined' && console.warn) {
  3822. if (errors.every(function (e) {
  3823. return typeof e === 'string';
  3824. })) {
  3825. console.warn(type, errors);
  3826. }
  3827. }
  3828. };
  3829. }
  3830. function convertFieldsError(errors) {
  3831. if (!errors || !errors.length) return null;
  3832. var fields = {};
  3833. errors.forEach(function (error) {
  3834. var field = error.field;
  3835. fields[field] = fields[field] || [];
  3836. fields[field].push(error);
  3837. });
  3838. return fields;
  3839. }
  3840. function format() {
  3841. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  3842. args[_key] = arguments[_key];
  3843. }
  3844. var i = 1;
  3845. var f = args[0];
  3846. var len = args.length;
  3847. if (typeof f === 'function') {
  3848. return f.apply(null, args.slice(1));
  3849. }
  3850. if (typeof f === 'string') {
  3851. var str = String(f).replace(formatRegExp, function (x) {
  3852. if (x === '%%') {
  3853. return '%';
  3854. }
  3855. if (i >= len) {
  3856. return x;
  3857. }
  3858. switch (x) {
  3859. case '%s':
  3860. return String(args[i++]);
  3861. case '%d':
  3862. return Number(args[i++]);
  3863. case '%j':
  3864. try {
  3865. return JSON.stringify(args[i++]);
  3866. } catch (_) {
  3867. return '[Circular]';
  3868. }
  3869. break;
  3870. default:
  3871. return x;}
  3872. });
  3873. for (var arg = args[i]; i < len; arg = args[++i]) {
  3874. str += " " + arg;
  3875. }
  3876. return str;
  3877. }
  3878. return f;
  3879. }
  3880. function isNativeStringType(type) {
  3881. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  3882. }
  3883. function isEmptyValue(value, type) {
  3884. if (value === undefined || value === null) {
  3885. return true;
  3886. }
  3887. if (type === 'array' && Array.isArray(value) && !value.length) {
  3888. return true;
  3889. }
  3890. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  3891. return true;
  3892. }
  3893. return false;
  3894. }
  3895. function asyncParallelArray(arr, func, callback) {
  3896. var results = [];
  3897. var total = 0;
  3898. var arrLength = arr.length;
  3899. function count(errors) {
  3900. results.push.apply(results, errors);
  3901. total++;
  3902. if (total === arrLength) {
  3903. callback(results);
  3904. }
  3905. }
  3906. arr.forEach(function (a) {
  3907. func(a, count);
  3908. });
  3909. }
  3910. function asyncSerialArray(arr, func, callback) {
  3911. var index = 0;
  3912. var arrLength = arr.length;
  3913. function next(errors) {
  3914. if (errors && errors.length) {
  3915. callback(errors);
  3916. return;
  3917. }
  3918. var original = index;
  3919. index = index + 1;
  3920. if (original < arrLength) {
  3921. func(arr[original], next);
  3922. } else {
  3923. callback([]);
  3924. }
  3925. }
  3926. next([]);
  3927. }
  3928. function flattenObjArr(objArr) {
  3929. var ret = [];
  3930. Object.keys(objArr).forEach(function (k) {
  3931. ret.push.apply(ret, objArr[k]);
  3932. });
  3933. return ret;
  3934. }
  3935. function asyncMap(objArr, option, func, callback) {
  3936. if (option.first) {
  3937. var _pending = new Promise(function (resolve, reject) {
  3938. var next = function next(errors) {
  3939. callback(errors);
  3940. return errors.length ? reject({
  3941. errors: errors,
  3942. fields: convertFieldsError(errors) }) :
  3943. resolve();
  3944. };
  3945. var flattenArr = flattenObjArr(objArr);
  3946. asyncSerialArray(flattenArr, func, next);
  3947. });
  3948. _pending["catch"](function (e) {
  3949. return e;
  3950. });
  3951. return _pending;
  3952. }
  3953. var firstFields = option.firstFields || [];
  3954. if (firstFields === true) {
  3955. firstFields = Object.keys(objArr);
  3956. }
  3957. var objArrKeys = Object.keys(objArr);
  3958. var objArrLength = objArrKeys.length;
  3959. var total = 0;
  3960. var results = [];
  3961. var pending = new Promise(function (resolve, reject) {
  3962. var next = function next(errors) {
  3963. results.push.apply(results, errors);
  3964. total++;
  3965. if (total === objArrLength) {
  3966. callback(results);
  3967. return results.length ? reject({
  3968. errors: results,
  3969. fields: convertFieldsError(results) }) :
  3970. resolve();
  3971. }
  3972. };
  3973. if (!objArrKeys.length) {
  3974. callback(results);
  3975. resolve();
  3976. }
  3977. objArrKeys.forEach(function (key) {
  3978. var arr = objArr[key];
  3979. if (firstFields.indexOf(key) !== -1) {
  3980. asyncSerialArray(arr, func, next);
  3981. } else {
  3982. asyncParallelArray(arr, func, next);
  3983. }
  3984. });
  3985. });
  3986. pending["catch"](function (e) {
  3987. return e;
  3988. });
  3989. return pending;
  3990. }
  3991. function complementError(rule) {
  3992. return function (oe) {
  3993. if (oe && oe.message) {
  3994. oe.field = oe.field || rule.fullField;
  3995. return oe;
  3996. }
  3997. return {
  3998. message: typeof oe === 'function' ? oe() : oe,
  3999. field: oe.field || rule.fullField };
  4000. };
  4001. }
  4002. function deepMerge(target, source) {
  4003. if (source) {
  4004. for (var s in source) {
  4005. if (source.hasOwnProperty(s)) {
  4006. var value = source[s];
  4007. if (typeof value === 'object' && typeof target[s] === 'object') {
  4008. target[s] = _extends({}, target[s], {}, value);
  4009. } else {
  4010. target[s] = value;
  4011. }
  4012. }
  4013. }
  4014. }
  4015. return target;
  4016. }
  4017. /**
  4018. * Rule for validating required fields.
  4019. *
  4020. * @param rule The validation rule.
  4021. * @param value The value of the field on the source object.
  4022. * @param source The source object being validated.
  4023. * @param errors An array of errors that this rule may add
  4024. * validation errors to.
  4025. * @param options The validation options.
  4026. * @param options.messages The validation messages.
  4027. */
  4028. function required(rule, value, source, errors, options, type) {
  4029. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  4030. errors.push(format(options.messages.required, rule.fullField));
  4031. }
  4032. }
  4033. /**
  4034. * Rule for validating whitespace.
  4035. *
  4036. * @param rule The validation rule.
  4037. * @param value The value of the field on the source object.
  4038. * @param source The source object being validated.
  4039. * @param errors An array of errors that this rule may add
  4040. * validation errors to.
  4041. * @param options The validation options.
  4042. * @param options.messages The validation messages.
  4043. */
  4044. function whitespace(rule, value, source, errors, options) {
  4045. if (/^\s+$/.test(value) || value === '') {
  4046. errors.push(format(options.messages.whitespace, rule.fullField));
  4047. }
  4048. }
  4049. /* eslint max-len:0 */
  4050. var pattern = {
  4051. // http://emailregex.com/
  4052. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  4053. url: new RegExp(
  4054. "^(?!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]*)?$",
  4055. 'i'),
  4056. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  4057. var types = {
  4058. integer: function integer(value) {
  4059. return types.number(value) && parseInt(value, 10) === value;
  4060. },
  4061. "float": function float(value) {
  4062. return types.number(value) && !types.integer(value);
  4063. },
  4064. array: function array(value) {
  4065. return Array.isArray(value);
  4066. },
  4067. regexp: function regexp(value) {
  4068. if (value instanceof RegExp) {
  4069. return true;
  4070. }
  4071. try {
  4072. return !!new RegExp(value);
  4073. } catch (e) {
  4074. return false;
  4075. }
  4076. },
  4077. date: function date(value) {
  4078. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  4079. 'function';
  4080. },
  4081. number: function number(value) {
  4082. if (isNaN(value)) {
  4083. return false;
  4084. }
  4085. // 修改源码,将字符串数值先转为数值
  4086. return typeof +value === 'number';
  4087. },
  4088. object: function object(value) {
  4089. return typeof value === 'object' && !types.array(value);
  4090. },
  4091. method: function method(value) {
  4092. return typeof value === 'function';
  4093. },
  4094. email: function email(value) {
  4095. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  4096. },
  4097. url: function url(value) {
  4098. return typeof value === 'string' && !!value.match(pattern.url);
  4099. },
  4100. hex: function hex(value) {
  4101. return typeof value === 'string' && !!value.match(pattern.hex);
  4102. } };
  4103. /**
  4104. * Rule for validating the type of a value.
  4105. *
  4106. * @param rule The validation rule.
  4107. * @param value The value of the field on the source object.
  4108. * @param source The source object being validated.
  4109. * @param errors An array of errors that this rule may add
  4110. * validation errors to.
  4111. * @param options The validation options.
  4112. * @param options.messages The validation messages.
  4113. */
  4114. function type(rule, value, source, errors, options) {
  4115. if (rule.required && value === undefined) {
  4116. required(rule, value, source, errors, options);
  4117. return;
  4118. }
  4119. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  4120. var ruleType = rule.type;
  4121. if (custom.indexOf(ruleType) > -1) {
  4122. if (!types[ruleType](value)) {
  4123. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4124. } // straight typeof check
  4125. } else if (ruleType && typeof value !== rule.type) {
  4126. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4127. }
  4128. }
  4129. /**
  4130. * Rule for validating minimum and maximum allowed values.
  4131. *
  4132. * @param rule The validation rule.
  4133. * @param value The value of the field on the source object.
  4134. * @param source The source object being validated.
  4135. * @param errors An array of errors that this rule may add
  4136. * validation errors to.
  4137. * @param options The validation options.
  4138. * @param options.messages The validation messages.
  4139. */
  4140. function range(rule, value, source, errors, options) {
  4141. var len = typeof rule.len === 'number';
  4142. var min = typeof rule.min === 'number';
  4143. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  4144. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  4145. var val = value;
  4146. var key = null;
  4147. var num = typeof value === 'number';
  4148. var str = typeof value === 'string';
  4149. var arr = Array.isArray(value);
  4150. if (num) {
  4151. key = 'number';
  4152. } else if (str) {
  4153. key = 'string';
  4154. } else if (arr) {
  4155. key = 'array';
  4156. } // if the value is not of a supported type for range validation
  4157. // the validation rule rule should use the
  4158. // type property to also test for a particular type
  4159. if (!key) {
  4160. return false;
  4161. }
  4162. if (arr) {
  4163. val = value.length;
  4164. }
  4165. if (str) {
  4166. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  4167. val = value.replace(spRegexp, '_').length;
  4168. }
  4169. if (len) {
  4170. if (val !== rule.len) {
  4171. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  4172. }
  4173. } else if (min && !max && val < rule.min) {
  4174. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  4175. } else if (max && !min && val > rule.max) {
  4176. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  4177. } else if (min && max && (val < rule.min || val > rule.max)) {
  4178. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  4179. }
  4180. }
  4181. var ENUM = 'enum';
  4182. /**
  4183. * Rule for validating a value exists in an enumerable list.
  4184. *
  4185. * @param rule The validation rule.
  4186. * @param value The value of the field on the source object.
  4187. * @param source The source object being validated.
  4188. * @param errors An array of errors that this rule may add
  4189. * validation errors to.
  4190. * @param options The validation options.
  4191. * @param options.messages The validation messages.
  4192. */
  4193. function enumerable(rule, value, source, errors, options) {
  4194. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  4195. if (rule[ENUM].indexOf(value) === -1) {
  4196. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  4197. }
  4198. }
  4199. /**
  4200. * Rule for validating a regular expression pattern.
  4201. *
  4202. * @param rule The validation rule.
  4203. * @param value The value of the field on the source object.
  4204. * @param source The source object being validated.
  4205. * @param errors An array of errors that this rule may add
  4206. * validation errors to.
  4207. * @param options The validation options.
  4208. * @param options.messages The validation messages.
  4209. */
  4210. function pattern$1(rule, value, source, errors, options) {
  4211. if (rule.pattern) {
  4212. if (rule.pattern instanceof RegExp) {
  4213. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  4214. // flag is accidentally set to `true`, which in a validation scenario
  4215. // is not necessary and the result might be misleading
  4216. rule.pattern.lastIndex = 0;
  4217. if (!rule.pattern.test(value)) {
  4218. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4219. }
  4220. } else if (typeof rule.pattern === 'string') {
  4221. var _pattern = new RegExp(rule.pattern);
  4222. if (!_pattern.test(value)) {
  4223. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4224. }
  4225. }
  4226. }
  4227. }
  4228. var rules = {
  4229. required: required,
  4230. whitespace: whitespace,
  4231. type: type,
  4232. range: range,
  4233. "enum": enumerable,
  4234. pattern: pattern$1 };
  4235. /**
  4236. * Performs validation for string types.
  4237. *
  4238. * @param rule The validation rule.
  4239. * @param value The value of the field on the source object.
  4240. * @param callback The callback function.
  4241. * @param source The source object being validated.
  4242. * @param options The validation options.
  4243. * @param options.messages The validation messages.
  4244. */
  4245. function string(rule, value, callback, source, options) {
  4246. var errors = [];
  4247. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4248. if (validate) {
  4249. if (isEmptyValue(value, 'string') && !rule.required) {
  4250. return callback();
  4251. }
  4252. rules.required(rule, value, source, errors, options, 'string');
  4253. if (!isEmptyValue(value, 'string')) {
  4254. rules.type(rule, value, source, errors, options);
  4255. rules.range(rule, value, source, errors, options);
  4256. rules.pattern(rule, value, source, errors, options);
  4257. if (rule.whitespace === true) {
  4258. rules.whitespace(rule, value, source, errors, options);
  4259. }
  4260. }
  4261. }
  4262. callback(errors);
  4263. }
  4264. /**
  4265. * Validates a function.
  4266. *
  4267. * @param rule The validation rule.
  4268. * @param value The value of the field on the source object.
  4269. * @param callback The callback function.
  4270. * @param source The source object being validated.
  4271. * @param options The validation options.
  4272. * @param options.messages The validation messages.
  4273. */
  4274. function method(rule, value, callback, source, options) {
  4275. var errors = [];
  4276. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4277. if (validate) {
  4278. if (isEmptyValue(value) && !rule.required) {
  4279. return callback();
  4280. }
  4281. rules.required(rule, value, source, errors, options);
  4282. if (value !== undefined) {
  4283. rules.type(rule, value, source, errors, options);
  4284. }
  4285. }
  4286. callback(errors);
  4287. }
  4288. /**
  4289. * Validates a number.
  4290. *
  4291. * @param rule The validation rule.
  4292. * @param value The value of the field on the source object.
  4293. * @param callback The callback function.
  4294. * @param source The source object being validated.
  4295. * @param options The validation options.
  4296. * @param options.messages The validation messages.
  4297. */
  4298. function number(rule, value, callback, source, options) {
  4299. var errors = [];
  4300. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4301. if (validate) {
  4302. if (value === '') {
  4303. value = undefined;
  4304. }
  4305. if (isEmptyValue(value) && !rule.required) {
  4306. return callback();
  4307. }
  4308. rules.required(rule, value, source, errors, options);
  4309. if (value !== undefined) {
  4310. rules.type(rule, value, source, errors, options);
  4311. rules.range(rule, value, source, errors, options);
  4312. }
  4313. }
  4314. callback(errors);
  4315. }
  4316. /**
  4317. * Validates a boolean.
  4318. *
  4319. * @param rule The validation rule.
  4320. * @param value The value of the field on the source object.
  4321. * @param callback The callback function.
  4322. * @param source The source object being validated.
  4323. * @param options The validation options.
  4324. * @param options.messages The validation messages.
  4325. */
  4326. function _boolean(rule, value, callback, source, options) {
  4327. var errors = [];
  4328. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4329. if (validate) {
  4330. if (isEmptyValue(value) && !rule.required) {
  4331. return callback();
  4332. }
  4333. rules.required(rule, value, source, errors, options);
  4334. if (value !== undefined) {
  4335. rules.type(rule, value, source, errors, options);
  4336. }
  4337. }
  4338. callback(errors);
  4339. }
  4340. /**
  4341. * Validates the regular expression type.
  4342. *
  4343. * @param rule The validation rule.
  4344. * @param value The value of the field on the source object.
  4345. * @param callback The callback function.
  4346. * @param source The source object being validated.
  4347. * @param options The validation options.
  4348. * @param options.messages The validation messages.
  4349. */
  4350. function regexp(rule, value, callback, source, options) {
  4351. var errors = [];
  4352. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4353. if (validate) {
  4354. if (isEmptyValue(value) && !rule.required) {
  4355. return callback();
  4356. }
  4357. rules.required(rule, value, source, errors, options);
  4358. if (!isEmptyValue(value)) {
  4359. rules.type(rule, value, source, errors, options);
  4360. }
  4361. }
  4362. callback(errors);
  4363. }
  4364. /**
  4365. * Validates a number is an integer.
  4366. *
  4367. * @param rule The validation rule.
  4368. * @param value The value of the field on the source object.
  4369. * @param callback The callback function.
  4370. * @param source The source object being validated.
  4371. * @param options The validation options.
  4372. * @param options.messages The validation messages.
  4373. */
  4374. function integer(rule, value, callback, source, options) {
  4375. var errors = [];
  4376. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4377. if (validate) {
  4378. if (isEmptyValue(value) && !rule.required) {
  4379. return callback();
  4380. }
  4381. rules.required(rule, value, source, errors, options);
  4382. if (value !== undefined) {
  4383. rules.type(rule, value, source, errors, options);
  4384. rules.range(rule, value, source, errors, options);
  4385. }
  4386. }
  4387. callback(errors);
  4388. }
  4389. /**
  4390. * Validates a number is a floating point number.
  4391. *
  4392. * @param rule The validation rule.
  4393. * @param value The value of the field on the source object.
  4394. * @param callback The callback function.
  4395. * @param source The source object being validated.
  4396. * @param options The validation options.
  4397. * @param options.messages The validation messages.
  4398. */
  4399. function floatFn(rule, value, callback, source, options) {
  4400. var errors = [];
  4401. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4402. if (validate) {
  4403. if (isEmptyValue(value) && !rule.required) {
  4404. return callback();
  4405. }
  4406. rules.required(rule, value, source, errors, options);
  4407. if (value !== undefined) {
  4408. rules.type(rule, value, source, errors, options);
  4409. rules.range(rule, value, source, errors, options);
  4410. }
  4411. }
  4412. callback(errors);
  4413. }
  4414. /**
  4415. * Validates an array.
  4416. *
  4417. * @param rule The validation rule.
  4418. * @param value The value of the field on the source object.
  4419. * @param callback The callback function.
  4420. * @param source The source object being validated.
  4421. * @param options The validation options.
  4422. * @param options.messages The validation messages.
  4423. */
  4424. function array(rule, value, callback, source, options) {
  4425. var errors = [];
  4426. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4427. if (validate) {
  4428. if (isEmptyValue(value, 'array') && !rule.required) {
  4429. return callback();
  4430. }
  4431. rules.required(rule, value, source, errors, options, 'array');
  4432. if (!isEmptyValue(value, 'array')) {
  4433. rules.type(rule, value, source, errors, options);
  4434. rules.range(rule, value, source, errors, options);
  4435. }
  4436. }
  4437. callback(errors);
  4438. }
  4439. /**
  4440. * Validates an object.
  4441. *
  4442. * @param rule The validation rule.
  4443. * @param value The value of the field on the source object.
  4444. * @param callback The callback function.
  4445. * @param source The source object being validated.
  4446. * @param options The validation options.
  4447. * @param options.messages The validation messages.
  4448. */
  4449. function object(rule, value, callback, source, options) {
  4450. var errors = [];
  4451. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4452. if (validate) {
  4453. if (isEmptyValue(value) && !rule.required) {
  4454. return callback();
  4455. }
  4456. rules.required(rule, value, source, errors, options);
  4457. if (value !== undefined) {
  4458. rules.type(rule, value, source, errors, options);
  4459. }
  4460. }
  4461. callback(errors);
  4462. }
  4463. var ENUM$1 = 'enum';
  4464. /**
  4465. * Validates an enumerable list.
  4466. *
  4467. * @param rule The validation rule.
  4468. * @param value The value of the field on the source object.
  4469. * @param callback The callback function.
  4470. * @param source The source object being validated.
  4471. * @param options The validation options.
  4472. * @param options.messages The validation messages.
  4473. */
  4474. function enumerable$1(rule, value, callback, source, options) {
  4475. var errors = [];
  4476. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4477. if (validate) {
  4478. if (isEmptyValue(value) && !rule.required) {
  4479. return callback();
  4480. }
  4481. rules.required(rule, value, source, errors, options);
  4482. if (value !== undefined) {
  4483. rules[ENUM$1](rule, value, source, errors, options);
  4484. }
  4485. }
  4486. callback(errors);
  4487. }
  4488. /**
  4489. * Validates a regular expression pattern.
  4490. *
  4491. * Performs validation when a rule only contains
  4492. * a pattern property but is not declared as a string type.
  4493. *
  4494. * @param rule The validation rule.
  4495. * @param value The value of the field on the source object.
  4496. * @param callback The callback function.
  4497. * @param source The source object being validated.
  4498. * @param options The validation options.
  4499. * @param options.messages The validation messages.
  4500. */
  4501. function pattern$2(rule, value, callback, source, options) {
  4502. var errors = [];
  4503. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4504. if (validate) {
  4505. if (isEmptyValue(value, 'string') && !rule.required) {
  4506. return callback();
  4507. }
  4508. rules.required(rule, value, source, errors, options);
  4509. if (!isEmptyValue(value, 'string')) {
  4510. rules.pattern(rule, value, source, errors, options);
  4511. }
  4512. }
  4513. callback(errors);
  4514. }
  4515. function date(rule, value, callback, source, options) {
  4516. var errors = [];
  4517. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4518. if (validate) {
  4519. if (isEmptyValue(value) && !rule.required) {
  4520. return callback();
  4521. }
  4522. rules.required(rule, value, source, errors, options);
  4523. if (!isEmptyValue(value)) {
  4524. var dateObject;
  4525. if (typeof value === 'number') {
  4526. dateObject = new Date(value);
  4527. } else {
  4528. dateObject = value;
  4529. }
  4530. rules.type(rule, dateObject, source, errors, options);
  4531. if (dateObject) {
  4532. rules.range(rule, dateObject.getTime(), source, errors, options);
  4533. }
  4534. }
  4535. }
  4536. callback(errors);
  4537. }
  4538. function required$1(rule, value, callback, source, options) {
  4539. var errors = [];
  4540. var type = Array.isArray(value) ? 'array' : typeof value;
  4541. rules.required(rule, value, source, errors, options, type);
  4542. callback(errors);
  4543. }
  4544. function type$1(rule, value, callback, source, options) {
  4545. var ruleType = rule.type;
  4546. var errors = [];
  4547. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4548. if (validate) {
  4549. if (isEmptyValue(value, ruleType) && !rule.required) {
  4550. return callback();
  4551. }
  4552. rules.required(rule, value, source, errors, options, ruleType);
  4553. if (!isEmptyValue(value, ruleType)) {
  4554. rules.type(rule, value, source, errors, options);
  4555. }
  4556. }
  4557. callback(errors);
  4558. }
  4559. /**
  4560. * Performs validation for any type.
  4561. *
  4562. * @param rule The validation rule.
  4563. * @param value The value of the field on the source object.
  4564. * @param callback The callback function.
  4565. * @param source The source object being validated.
  4566. * @param options The validation options.
  4567. * @param options.messages The validation messages.
  4568. */
  4569. function any(rule, value, callback, source, options) {
  4570. var errors = [];
  4571. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4572. if (validate) {
  4573. if (isEmptyValue(value) && !rule.required) {
  4574. return callback();
  4575. }
  4576. rules.required(rule, value, source, errors, options);
  4577. }
  4578. callback(errors);
  4579. }
  4580. var validators = {
  4581. string: string,
  4582. method: method,
  4583. number: number,
  4584. "boolean": _boolean,
  4585. regexp: regexp,
  4586. integer: integer,
  4587. "float": floatFn,
  4588. array: array,
  4589. object: object,
  4590. "enum": enumerable$1,
  4591. pattern: pattern$2,
  4592. date: date,
  4593. url: type$1,
  4594. hex: type$1,
  4595. email: type$1,
  4596. required: required$1,
  4597. any: any };
  4598. function newMessages() {
  4599. return {
  4600. "default": 'Validation error on field %s',
  4601. required: '%s is required',
  4602. "enum": '%s must be one of %s',
  4603. whitespace: '%s cannot be empty',
  4604. date: {
  4605. format: '%s date %s is invalid for format %s',
  4606. parse: '%s date could not be parsed, %s is invalid ',
  4607. invalid: '%s date %s is invalid' },
  4608. types: {
  4609. string: '%s is not a %s',
  4610. method: '%s is not a %s (function)',
  4611. array: '%s is not an %s',
  4612. object: '%s is not an %s',
  4613. number: '%s is not a %s',
  4614. date: '%s is not a %s',
  4615. "boolean": '%s is not a %s',
  4616. integer: '%s is not an %s',
  4617. "float": '%s is not a %s',
  4618. regexp: '%s is not a valid %s',
  4619. email: '%s is not a valid %s',
  4620. url: '%s is not a valid %s',
  4621. hex: '%s is not a valid %s' },
  4622. string: {
  4623. len: '%s must be exactly %s characters',
  4624. min: '%s must be at least %s characters',
  4625. max: '%s cannot be longer than %s characters',
  4626. range: '%s must be between %s and %s characters' },
  4627. number: {
  4628. len: '%s must equal %s',
  4629. min: '%s cannot be less than %s',
  4630. max: '%s cannot be greater than %s',
  4631. range: '%s must be between %s and %s' },
  4632. array: {
  4633. len: '%s must be exactly %s in length',
  4634. min: '%s cannot be less than %s in length',
  4635. max: '%s cannot be greater than %s in length',
  4636. range: '%s must be between %s and %s in length' },
  4637. pattern: {
  4638. mismatch: '%s value %s does not match pattern %s' },
  4639. clone: function clone() {
  4640. var cloned = JSON.parse(JSON.stringify(this));
  4641. cloned.clone = this.clone;
  4642. return cloned;
  4643. } };
  4644. }
  4645. var messages = newMessages();
  4646. /**
  4647. * Encapsulates a validation schema.
  4648. *
  4649. * @param descriptor An object declaring validation rules
  4650. * for this schema.
  4651. */
  4652. function Schema(descriptor) {
  4653. this.rules = null;
  4654. this._messages = messages;
  4655. this.define(descriptor);
  4656. }
  4657. Schema.prototype = {
  4658. messages: function messages(_messages) {
  4659. if (_messages) {
  4660. this._messages = deepMerge(newMessages(), _messages);
  4661. }
  4662. return this._messages;
  4663. },
  4664. define: function define(rules) {
  4665. if (!rules) {
  4666. throw new Error('Cannot configure a schema with no rules');
  4667. }
  4668. if (typeof rules !== 'object' || Array.isArray(rules)) {
  4669. throw new Error('Rules must be an object');
  4670. }
  4671. this.rules = {};
  4672. var z;
  4673. var item;
  4674. for (z in rules) {
  4675. if (rules.hasOwnProperty(z)) {
  4676. item = rules[z];
  4677. this.rules[z] = Array.isArray(item) ? item : [item];
  4678. }
  4679. }
  4680. },
  4681. validate: function validate(source_, o, oc) {
  4682. var _this = this;
  4683. if (o === void 0) {
  4684. o = {};
  4685. }
  4686. if (oc === void 0) {
  4687. oc = function oc() {};
  4688. }
  4689. var source = source_;
  4690. var options = o;
  4691. var callback = oc;
  4692. if (typeof options === 'function') {
  4693. callback = options;
  4694. options = {};
  4695. }
  4696. if (!this.rules || Object.keys(this.rules).length === 0) {
  4697. if (callback) {
  4698. callback();
  4699. }
  4700. return Promise.resolve();
  4701. }
  4702. function complete(results) {
  4703. var i;
  4704. var errors = [];
  4705. var fields = {};
  4706. function add(e) {
  4707. if (Array.isArray(e)) {
  4708. var _errors;
  4709. errors = (_errors = errors).concat.apply(_errors, e);
  4710. } else {
  4711. errors.push(e);
  4712. }
  4713. }
  4714. for (i = 0; i < results.length; i++) {
  4715. add(results[i]);
  4716. }
  4717. if (!errors.length) {
  4718. errors = null;
  4719. fields = null;
  4720. } else {
  4721. fields = convertFieldsError(errors);
  4722. }
  4723. callback(errors, fields);
  4724. }
  4725. if (options.messages) {
  4726. var messages$1 = this.messages();
  4727. if (messages$1 === messages) {
  4728. messages$1 = newMessages();
  4729. }
  4730. deepMerge(messages$1, options.messages);
  4731. options.messages = messages$1;
  4732. } else {
  4733. options.messages = this.messages();
  4734. }
  4735. var arr;
  4736. var value;
  4737. var series = {};
  4738. var keys = options.keys || Object.keys(this.rules);
  4739. keys.forEach(function (z) {
  4740. arr = _this.rules[z];
  4741. value = source[z];
  4742. arr.forEach(function (r) {
  4743. var rule = r;
  4744. if (typeof rule.transform === 'function') {
  4745. if (source === source_) {
  4746. source = _extends({}, source);
  4747. }
  4748. value = source[z] = rule.transform(value);
  4749. }
  4750. if (typeof rule === 'function') {
  4751. rule = {
  4752. validator: rule };
  4753. } else {
  4754. rule = _extends({}, rule);
  4755. }
  4756. rule.validator = _this.getValidationMethod(rule);
  4757. rule.field = z;
  4758. rule.fullField = rule.fullField || z;
  4759. rule.type = _this.getType(rule);
  4760. if (!rule.validator) {
  4761. return;
  4762. }
  4763. series[z] = series[z] || [];
  4764. series[z].push({
  4765. rule: rule,
  4766. value: value,
  4767. source: source,
  4768. field: z });
  4769. });
  4770. });
  4771. var errorFields = {};
  4772. return asyncMap(series, options, function (data, doIt) {
  4773. var rule = data.rule;
  4774. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  4775. 'object');
  4776. deep = deep && (rule.required || !rule.required && data.value);
  4777. rule.field = data.field;
  4778. function addFullfield(key, schema) {
  4779. return _extends({}, schema, {
  4780. fullField: rule.fullField + "." + key });
  4781. }
  4782. function cb(e) {
  4783. if (e === void 0) {
  4784. e = [];
  4785. }
  4786. var errors = e;
  4787. if (!Array.isArray(errors)) {
  4788. errors = [errors];
  4789. }
  4790. if (!options.suppressWarning && errors.length) {
  4791. Schema.warning('async-validator:', errors);
  4792. }
  4793. if (errors.length && rule.message) {
  4794. errors = [].concat(rule.message);
  4795. }
  4796. errors = errors.map(complementError(rule));
  4797. if (options.first && errors.length) {
  4798. errorFields[rule.field] = 1;
  4799. return doIt(errors);
  4800. }
  4801. if (!deep) {
  4802. doIt(errors);
  4803. } else {
  4804. // if rule is required but the target object
  4805. // does not exist fail at the rule level and don't
  4806. // go deeper
  4807. if (rule.required && !data.value) {
  4808. if (rule.message) {
  4809. errors = [].concat(rule.message).map(complementError(rule));
  4810. } else if (options.error) {
  4811. errors = [options.error(rule, format(options.messages.required, rule.field))];
  4812. } else {
  4813. errors = [];
  4814. }
  4815. return doIt(errors);
  4816. }
  4817. var fieldsSchema = {};
  4818. if (rule.defaultField) {
  4819. for (var k in data.value) {
  4820. if (data.value.hasOwnProperty(k)) {
  4821. fieldsSchema[k] = rule.defaultField;
  4822. }
  4823. }
  4824. }
  4825. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  4826. for (var f in fieldsSchema) {
  4827. if (fieldsSchema.hasOwnProperty(f)) {
  4828. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  4829. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  4830. }
  4831. }
  4832. var schema = new Schema(fieldsSchema);
  4833. schema.messages(options.messages);
  4834. if (data.rule.options) {
  4835. data.rule.options.messages = options.messages;
  4836. data.rule.options.error = options.error;
  4837. }
  4838. schema.validate(data.value, data.rule.options || options, function (errs) {
  4839. var finalErrors = [];
  4840. if (errors && errors.length) {
  4841. finalErrors.push.apply(finalErrors, errors);
  4842. }
  4843. if (errs && errs.length) {
  4844. finalErrors.push.apply(finalErrors, errs);
  4845. }
  4846. doIt(finalErrors.length ? finalErrors : null);
  4847. });
  4848. }
  4849. }
  4850. var res;
  4851. if (rule.asyncValidator) {
  4852. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  4853. } else if (rule.validator) {
  4854. res = rule.validator(rule, data.value, cb, data.source, options);
  4855. if (res === true) {
  4856. cb();
  4857. } else if (res === false) {
  4858. cb(rule.message || rule.field + " fails");
  4859. } else if (res instanceof Array) {
  4860. cb(res);
  4861. } else if (res instanceof Error) {
  4862. cb(res.message);
  4863. }
  4864. }
  4865. if (res && res.then) {
  4866. res.then(function () {
  4867. return cb();
  4868. }, function (e) {
  4869. return cb(e);
  4870. });
  4871. }
  4872. }, function (results) {
  4873. complete(results);
  4874. });
  4875. },
  4876. getType: function getType(rule) {
  4877. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  4878. rule.type = 'pattern';
  4879. }
  4880. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  4881. throw new Error(format('Unknown rule type %s', rule.type));
  4882. }
  4883. return rule.type || 'string';
  4884. },
  4885. getValidationMethod: function getValidationMethod(rule) {
  4886. if (typeof rule.validator === 'function') {
  4887. return rule.validator;
  4888. }
  4889. var keys = Object.keys(rule);
  4890. var messageIndex = keys.indexOf('message');
  4891. if (messageIndex !== -1) {
  4892. keys.splice(messageIndex, 1);
  4893. }
  4894. if (keys.length === 1 && keys[0] === 'required') {
  4895. return validators.required;
  4896. }
  4897. return validators[this.getType(rule)] || false;
  4898. } };
  4899. Schema.register = function register(type, validator) {
  4900. if (typeof validator !== 'function') {
  4901. throw new Error('Cannot register a validator by type, validator is not a function');
  4902. }
  4903. validators[type] = validator;
  4904. };
  4905. Schema.warning = warning;
  4906. Schema.messages = messages;var _default =
  4907. Schema;exports.default = _default;
  4908. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 208)))
  4909. /***/ }),
  4910. /***/ 208:
  4911. /*!********************************************************!*\
  4912. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  4913. \********************************************************/
  4914. /*! no static exports found */
  4915. /***/ (function(module, exports, __webpack_require__) {
  4916. exports.nextTick = function nextTick(fn) {
  4917. var args = Array.prototype.slice.call(arguments);
  4918. args.shift();
  4919. setTimeout(function () {
  4920. fn.apply(null, args);
  4921. }, 0);
  4922. };
  4923. exports.platform = exports.arch =
  4924. exports.execPath = exports.title = 'browser';
  4925. exports.pid = 1;
  4926. exports.browser = true;
  4927. exports.env = {};
  4928. exports.argv = [];
  4929. exports.binding = function (name) {
  4930. throw new Error('No such module. (Possibly not yet loaded)')
  4931. };
  4932. (function () {
  4933. var cwd = '/';
  4934. var path;
  4935. exports.cwd = function () { return cwd };
  4936. exports.chdir = function (dir) {
  4937. if (!path) path = __webpack_require__(/*! path */ 209);
  4938. cwd = path.resolve(dir, cwd);
  4939. };
  4940. })();
  4941. exports.exit = exports.kill =
  4942. exports.umask = exports.dlopen =
  4943. exports.uptime = exports.memoryUsage =
  4944. exports.uvCounters = function() {};
  4945. exports.features = {};
  4946. /***/ }),
  4947. /***/ 209:
  4948. /*!***********************************************!*\
  4949. !*** ./node_modules/path-browserify/index.js ***!
  4950. \***********************************************/
  4951. /*! no static exports found */
  4952. /***/ (function(module, exports, __webpack_require__) {
  4953. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  4954. // backported and transplited with Babel, with backwards-compat fixes
  4955. // Copyright Joyent, Inc. and other Node contributors.
  4956. //
  4957. // Permission is hereby granted, free of charge, to any person obtaining a
  4958. // copy of this software and associated documentation files (the
  4959. // "Software"), to deal in the Software without restriction, including
  4960. // without limitation the rights to use, copy, modify, merge, publish,
  4961. // distribute, sublicense, and/or sell copies of the Software, and to permit
  4962. // persons to whom the Software is furnished to do so, subject to the
  4963. // following conditions:
  4964. //
  4965. // The above copyright notice and this permission notice shall be included
  4966. // in all copies or substantial portions of the Software.
  4967. //
  4968. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4969. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4970. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  4971. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  4972. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  4973. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  4974. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  4975. // resolves . and .. elements in a path array with directory names there
  4976. // must be no slashes, empty elements, or device names (c:\) in the array
  4977. // (so also no leading and trailing slashes - it does not distinguish
  4978. // relative and absolute paths)
  4979. function normalizeArray(parts, allowAboveRoot) {
  4980. // if the path tries to go above the root, `up` ends up > 0
  4981. var up = 0;
  4982. for (var i = parts.length - 1; i >= 0; i--) {
  4983. var last = parts[i];
  4984. if (last === '.') {
  4985. parts.splice(i, 1);
  4986. } else if (last === '..') {
  4987. parts.splice(i, 1);
  4988. up++;
  4989. } else if (up) {
  4990. parts.splice(i, 1);
  4991. up--;
  4992. }
  4993. }
  4994. // if the path is allowed to go above the root, restore leading ..s
  4995. if (allowAboveRoot) {
  4996. for (; up--; up) {
  4997. parts.unshift('..');
  4998. }
  4999. }
  5000. return parts;
  5001. }
  5002. // path.resolve([from ...], to)
  5003. // posix version
  5004. exports.resolve = function() {
  5005. var resolvedPath = '',
  5006. resolvedAbsolute = false;
  5007. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  5008. var path = (i >= 0) ? arguments[i] : process.cwd();
  5009. // Skip empty and invalid entries
  5010. if (typeof path !== 'string') {
  5011. throw new TypeError('Arguments to path.resolve must be strings');
  5012. } else if (!path) {
  5013. continue;
  5014. }
  5015. resolvedPath = path + '/' + resolvedPath;
  5016. resolvedAbsolute = path.charAt(0) === '/';
  5017. }
  5018. // At this point the path should be resolved to a full absolute path, but
  5019. // handle relative paths to be safe (might happen when process.cwd() fails)
  5020. // Normalize the path
  5021. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  5022. return !!p;
  5023. }), !resolvedAbsolute).join('/');
  5024. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  5025. };
  5026. // path.normalize(path)
  5027. // posix version
  5028. exports.normalize = function(path) {
  5029. var isAbsolute = exports.isAbsolute(path),
  5030. trailingSlash = substr(path, -1) === '/';
  5031. // Normalize the path
  5032. path = normalizeArray(filter(path.split('/'), function(p) {
  5033. return !!p;
  5034. }), !isAbsolute).join('/');
  5035. if (!path && !isAbsolute) {
  5036. path = '.';
  5037. }
  5038. if (path && trailingSlash) {
  5039. path += '/';
  5040. }
  5041. return (isAbsolute ? '/' : '') + path;
  5042. };
  5043. // posix version
  5044. exports.isAbsolute = function(path) {
  5045. return path.charAt(0) === '/';
  5046. };
  5047. // posix version
  5048. exports.join = function() {
  5049. var paths = Array.prototype.slice.call(arguments, 0);
  5050. return exports.normalize(filter(paths, function(p, index) {
  5051. if (typeof p !== 'string') {
  5052. throw new TypeError('Arguments to path.join must be strings');
  5053. }
  5054. return p;
  5055. }).join('/'));
  5056. };
  5057. // path.relative(from, to)
  5058. // posix version
  5059. exports.relative = function(from, to) {
  5060. from = exports.resolve(from).substr(1);
  5061. to = exports.resolve(to).substr(1);
  5062. function trim(arr) {
  5063. var start = 0;
  5064. for (; start < arr.length; start++) {
  5065. if (arr[start] !== '') break;
  5066. }
  5067. var end = arr.length - 1;
  5068. for (; end >= 0; end--) {
  5069. if (arr[end] !== '') break;
  5070. }
  5071. if (start > end) return [];
  5072. return arr.slice(start, end - start + 1);
  5073. }
  5074. var fromParts = trim(from.split('/'));
  5075. var toParts = trim(to.split('/'));
  5076. var length = Math.min(fromParts.length, toParts.length);
  5077. var samePartsLength = length;
  5078. for (var i = 0; i < length; i++) {
  5079. if (fromParts[i] !== toParts[i]) {
  5080. samePartsLength = i;
  5081. break;
  5082. }
  5083. }
  5084. var outputParts = [];
  5085. for (var i = samePartsLength; i < fromParts.length; i++) {
  5086. outputParts.push('..');
  5087. }
  5088. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  5089. return outputParts.join('/');
  5090. };
  5091. exports.sep = '/';
  5092. exports.delimiter = ':';
  5093. exports.dirname = function (path) {
  5094. if (typeof path !== 'string') path = path + '';
  5095. if (path.length === 0) return '.';
  5096. var code = path.charCodeAt(0);
  5097. var hasRoot = code === 47 /*/*/;
  5098. var end = -1;
  5099. var matchedSlash = true;
  5100. for (var i = path.length - 1; i >= 1; --i) {
  5101. code = path.charCodeAt(i);
  5102. if (code === 47 /*/*/) {
  5103. if (!matchedSlash) {
  5104. end = i;
  5105. break;
  5106. }
  5107. } else {
  5108. // We saw the first non-path separator
  5109. matchedSlash = false;
  5110. }
  5111. }
  5112. if (end === -1) return hasRoot ? '/' : '.';
  5113. if (hasRoot && end === 1) {
  5114. // return '//';
  5115. // Backwards-compat fix:
  5116. return '/';
  5117. }
  5118. return path.slice(0, end);
  5119. };
  5120. function basename(path) {
  5121. if (typeof path !== 'string') path = path + '';
  5122. var start = 0;
  5123. var end = -1;
  5124. var matchedSlash = true;
  5125. var i;
  5126. for (i = path.length - 1; i >= 0; --i) {
  5127. if (path.charCodeAt(i) === 47 /*/*/) {
  5128. // If we reached a path separator that was not part of a set of path
  5129. // separators at the end of the string, stop now
  5130. if (!matchedSlash) {
  5131. start = i + 1;
  5132. break;
  5133. }
  5134. } else if (end === -1) {
  5135. // We saw the first non-path separator, mark this as the end of our
  5136. // path component
  5137. matchedSlash = false;
  5138. end = i + 1;
  5139. }
  5140. }
  5141. if (end === -1) return '';
  5142. return path.slice(start, end);
  5143. }
  5144. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  5145. // in new Node.js versions, so only basename() above is backported here
  5146. exports.basename = function (path, ext) {
  5147. var f = basename(path);
  5148. if (ext && f.substr(-1 * ext.length) === ext) {
  5149. f = f.substr(0, f.length - ext.length);
  5150. }
  5151. return f;
  5152. };
  5153. exports.extname = function (path) {
  5154. if (typeof path !== 'string') path = path + '';
  5155. var startDot = -1;
  5156. var startPart = 0;
  5157. var end = -1;
  5158. var matchedSlash = true;
  5159. // Track the state of characters (if any) we see before our first dot and
  5160. // after any path separator we find
  5161. var preDotState = 0;
  5162. for (var i = path.length - 1; i >= 0; --i) {
  5163. var code = path.charCodeAt(i);
  5164. if (code === 47 /*/*/) {
  5165. // If we reached a path separator that was not part of a set of path
  5166. // separators at the end of the string, stop now
  5167. if (!matchedSlash) {
  5168. startPart = i + 1;
  5169. break;
  5170. }
  5171. continue;
  5172. }
  5173. if (end === -1) {
  5174. // We saw the first non-path separator, mark this as the end of our
  5175. // extension
  5176. matchedSlash = false;
  5177. end = i + 1;
  5178. }
  5179. if (code === 46 /*.*/) {
  5180. // If this is our first dot, mark it as the start of our extension
  5181. if (startDot === -1)
  5182. startDot = i;
  5183. else if (preDotState !== 1)
  5184. preDotState = 1;
  5185. } else if (startDot !== -1) {
  5186. // We saw a non-dot and non-path separator before our dot, so we should
  5187. // have a good chance at having a non-empty extension
  5188. preDotState = -1;
  5189. }
  5190. }
  5191. if (startDot === -1 || end === -1 ||
  5192. // We saw a non-dot character immediately before the dot
  5193. preDotState === 0 ||
  5194. // The (right-most) trimmed path component is exactly '..'
  5195. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  5196. return '';
  5197. }
  5198. return path.slice(startDot, end);
  5199. };
  5200. function filter (xs, f) {
  5201. if (xs.filter) return xs.filter(f);
  5202. var res = [];
  5203. for (var i = 0; i < xs.length; i++) {
  5204. if (f(xs[i], i, xs)) res.push(xs[i]);
  5205. }
  5206. return res;
  5207. }
  5208. // String.prototype.substr - negative index don't work in IE8
  5209. var substr = 'ab'.substr(-1) === 'b'
  5210. ? function (str, start, len) { return str.substr(start, len) }
  5211. : function (str, start, len) {
  5212. if (start < 0) start = str.length + start;
  5213. return str.substr(start, len);
  5214. }
  5215. ;
  5216. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 208)))
  5217. /***/ }),
  5218. /***/ 21:
  5219. /*!************************************************************!*\
  5220. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  5221. \************************************************************/
  5222. /*! no static exports found */
  5223. /***/ (function(module, exports, __webpack_require__) {
  5224. /**
  5225. * Copyright (c) 2014-present, Facebook, Inc.
  5226. *
  5227. * This source code is licensed under the MIT license found in the
  5228. * LICENSE file in the root directory of this source tree.
  5229. */
  5230. // This method of obtaining a reference to the global object needs to be
  5231. // kept identical to the way it is obtained in runtime.js
  5232. var g = (function() {
  5233. return this || (typeof self === "object" && self);
  5234. })() || Function("return this")();
  5235. // Use `getOwnPropertyNames` because not all browsers support calling
  5236. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  5237. var hadRuntime = g.regeneratorRuntime &&
  5238. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  5239. // Save the old regeneratorRuntime in case it needs to be restored later.
  5240. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  5241. // Force reevalutation of runtime.js.
  5242. g.regeneratorRuntime = undefined;
  5243. module.exports = __webpack_require__(/*! ./runtime */ 22);
  5244. if (hadRuntime) {
  5245. // Restore the original runtime.
  5246. g.regeneratorRuntime = oldRuntime;
  5247. } else {
  5248. // Remove the global property added by runtime.js.
  5249. try {
  5250. delete g.regeneratorRuntime;
  5251. } catch(e) {
  5252. g.regeneratorRuntime = undefined;
  5253. }
  5254. }
  5255. /***/ }),
  5256. /***/ 22:
  5257. /*!*****************************************************!*\
  5258. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  5259. \*****************************************************/
  5260. /*! no static exports found */
  5261. /***/ (function(module, exports) {
  5262. /**
  5263. * Copyright (c) 2014-present, Facebook, Inc.
  5264. *
  5265. * This source code is licensed under the MIT license found in the
  5266. * LICENSE file in the root directory of this source tree.
  5267. */
  5268. !(function(global) {
  5269. "use strict";
  5270. var Op = Object.prototype;
  5271. var hasOwn = Op.hasOwnProperty;
  5272. var undefined; // More compressible than void 0.
  5273. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  5274. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  5275. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  5276. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  5277. var inModule = typeof module === "object";
  5278. var runtime = global.regeneratorRuntime;
  5279. if (runtime) {
  5280. if (inModule) {
  5281. // If regeneratorRuntime is defined globally and we're in a module,
  5282. // make the exports object identical to regeneratorRuntime.
  5283. module.exports = runtime;
  5284. }
  5285. // Don't bother evaluating the rest of this file if the runtime was
  5286. // already defined globally.
  5287. return;
  5288. }
  5289. // Define the runtime globally (as expected by generated code) as either
  5290. // module.exports (if we're in a module) or a new, empty object.
  5291. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  5292. function wrap(innerFn, outerFn, self, tryLocsList) {
  5293. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  5294. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  5295. var generator = Object.create(protoGenerator.prototype);
  5296. var context = new Context(tryLocsList || []);
  5297. // The ._invoke method unifies the implementations of the .next,
  5298. // .throw, and .return methods.
  5299. generator._invoke = makeInvokeMethod(innerFn, self, context);
  5300. return generator;
  5301. }
  5302. runtime.wrap = wrap;
  5303. // Try/catch helper to minimize deoptimizations. Returns a completion
  5304. // record like context.tryEntries[i].completion. This interface could
  5305. // have been (and was previously) designed to take a closure to be
  5306. // invoked without arguments, but in all the cases we care about we
  5307. // already have an existing method we want to call, so there's no need
  5308. // to create a new function object. We can even get away with assuming
  5309. // the method takes exactly one argument, since that happens to be true
  5310. // in every case, so we don't have to touch the arguments object. The
  5311. // only additional allocation required is the completion record, which
  5312. // has a stable shape and so hopefully should be cheap to allocate.
  5313. function tryCatch(fn, obj, arg) {
  5314. try {
  5315. return { type: "normal", arg: fn.call(obj, arg) };
  5316. } catch (err) {
  5317. return { type: "throw", arg: err };
  5318. }
  5319. }
  5320. var GenStateSuspendedStart = "suspendedStart";
  5321. var GenStateSuspendedYield = "suspendedYield";
  5322. var GenStateExecuting = "executing";
  5323. var GenStateCompleted = "completed";
  5324. // Returning this object from the innerFn has the same effect as
  5325. // breaking out of the dispatch switch statement.
  5326. var ContinueSentinel = {};
  5327. // Dummy constructor functions that we use as the .constructor and
  5328. // .constructor.prototype properties for functions that return Generator
  5329. // objects. For full spec compliance, you may wish to configure your
  5330. // minifier not to mangle the names of these two functions.
  5331. function Generator() {}
  5332. function GeneratorFunction() {}
  5333. function GeneratorFunctionPrototype() {}
  5334. // This is a polyfill for %IteratorPrototype% for environments that
  5335. // don't natively support it.
  5336. var IteratorPrototype = {};
  5337. IteratorPrototype[iteratorSymbol] = function () {
  5338. return this;
  5339. };
  5340. var getProto = Object.getPrototypeOf;
  5341. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  5342. if (NativeIteratorPrototype &&
  5343. NativeIteratorPrototype !== Op &&
  5344. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  5345. // This environment has a native %IteratorPrototype%; use it instead
  5346. // of the polyfill.
  5347. IteratorPrototype = NativeIteratorPrototype;
  5348. }
  5349. var Gp = GeneratorFunctionPrototype.prototype =
  5350. Generator.prototype = Object.create(IteratorPrototype);
  5351. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  5352. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  5353. GeneratorFunctionPrototype[toStringTagSymbol] =
  5354. GeneratorFunction.displayName = "GeneratorFunction";
  5355. // Helper for defining the .next, .throw, and .return methods of the
  5356. // Iterator interface in terms of a single ._invoke method.
  5357. function defineIteratorMethods(prototype) {
  5358. ["next", "throw", "return"].forEach(function(method) {
  5359. prototype[method] = function(arg) {
  5360. return this._invoke(method, arg);
  5361. };
  5362. });
  5363. }
  5364. runtime.isGeneratorFunction = function(genFun) {
  5365. var ctor = typeof genFun === "function" && genFun.constructor;
  5366. return ctor
  5367. ? ctor === GeneratorFunction ||
  5368. // For the native GeneratorFunction constructor, the best we can
  5369. // do is to check its .name property.
  5370. (ctor.displayName || ctor.name) === "GeneratorFunction"
  5371. : false;
  5372. };
  5373. runtime.mark = function(genFun) {
  5374. if (Object.setPrototypeOf) {
  5375. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  5376. } else {
  5377. genFun.__proto__ = GeneratorFunctionPrototype;
  5378. if (!(toStringTagSymbol in genFun)) {
  5379. genFun[toStringTagSymbol] = "GeneratorFunction";
  5380. }
  5381. }
  5382. genFun.prototype = Object.create(Gp);
  5383. return genFun;
  5384. };
  5385. // Within the body of any async function, `await x` is transformed to
  5386. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  5387. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  5388. // meant to be awaited.
  5389. runtime.awrap = function(arg) {
  5390. return { __await: arg };
  5391. };
  5392. function AsyncIterator(generator) {
  5393. function invoke(method, arg, resolve, reject) {
  5394. var record = tryCatch(generator[method], generator, arg);
  5395. if (record.type === "throw") {
  5396. reject(record.arg);
  5397. } else {
  5398. var result = record.arg;
  5399. var value = result.value;
  5400. if (value &&
  5401. typeof value === "object" &&
  5402. hasOwn.call(value, "__await")) {
  5403. return Promise.resolve(value.__await).then(function(value) {
  5404. invoke("next", value, resolve, reject);
  5405. }, function(err) {
  5406. invoke("throw", err, resolve, reject);
  5407. });
  5408. }
  5409. return Promise.resolve(value).then(function(unwrapped) {
  5410. // When a yielded Promise is resolved, its final value becomes
  5411. // the .value of the Promise<{value,done}> result for the
  5412. // current iteration.
  5413. result.value = unwrapped;
  5414. resolve(result);
  5415. }, function(error) {
  5416. // If a rejected Promise was yielded, throw the rejection back
  5417. // into the async generator function so it can be handled there.
  5418. return invoke("throw", error, resolve, reject);
  5419. });
  5420. }
  5421. }
  5422. var previousPromise;
  5423. function enqueue(method, arg) {
  5424. function callInvokeWithMethodAndArg() {
  5425. return new Promise(function(resolve, reject) {
  5426. invoke(method, arg, resolve, reject);
  5427. });
  5428. }
  5429. return previousPromise =
  5430. // If enqueue has been called before, then we want to wait until
  5431. // all previous Promises have been resolved before calling invoke,
  5432. // so that results are always delivered in the correct order. If
  5433. // enqueue has not been called before, then it is important to
  5434. // call invoke immediately, without waiting on a callback to fire,
  5435. // so that the async generator function has the opportunity to do
  5436. // any necessary setup in a predictable way. This predictability
  5437. // is why the Promise constructor synchronously invokes its
  5438. // executor callback, and why async functions synchronously
  5439. // execute code before the first await. Since we implement simple
  5440. // async functions in terms of async generators, it is especially
  5441. // important to get this right, even though it requires care.
  5442. previousPromise ? previousPromise.then(
  5443. callInvokeWithMethodAndArg,
  5444. // Avoid propagating failures to Promises returned by later
  5445. // invocations of the iterator.
  5446. callInvokeWithMethodAndArg
  5447. ) : callInvokeWithMethodAndArg();
  5448. }
  5449. // Define the unified helper method that is used to implement .next,
  5450. // .throw, and .return (see defineIteratorMethods).
  5451. this._invoke = enqueue;
  5452. }
  5453. defineIteratorMethods(AsyncIterator.prototype);
  5454. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  5455. return this;
  5456. };
  5457. runtime.AsyncIterator = AsyncIterator;
  5458. // Note that simple async functions are implemented on top of
  5459. // AsyncIterator objects; they just return a Promise for the value of
  5460. // the final result produced by the iterator.
  5461. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  5462. var iter = new AsyncIterator(
  5463. wrap(innerFn, outerFn, self, tryLocsList)
  5464. );
  5465. return runtime.isGeneratorFunction(outerFn)
  5466. ? iter // If outerFn is a generator, return the full iterator.
  5467. : iter.next().then(function(result) {
  5468. return result.done ? result.value : iter.next();
  5469. });
  5470. };
  5471. function makeInvokeMethod(innerFn, self, context) {
  5472. var state = GenStateSuspendedStart;
  5473. return function invoke(method, arg) {
  5474. if (state === GenStateExecuting) {
  5475. throw new Error("Generator is already running");
  5476. }
  5477. if (state === GenStateCompleted) {
  5478. if (method === "throw") {
  5479. throw arg;
  5480. }
  5481. // Be forgiving, per 25.3.3.3.3 of the spec:
  5482. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  5483. return doneResult();
  5484. }
  5485. context.method = method;
  5486. context.arg = arg;
  5487. while (true) {
  5488. var delegate = context.delegate;
  5489. if (delegate) {
  5490. var delegateResult = maybeInvokeDelegate(delegate, context);
  5491. if (delegateResult) {
  5492. if (delegateResult === ContinueSentinel) continue;
  5493. return delegateResult;
  5494. }
  5495. }
  5496. if (context.method === "next") {
  5497. // Setting context._sent for legacy support of Babel's
  5498. // function.sent implementation.
  5499. context.sent = context._sent = context.arg;
  5500. } else if (context.method === "throw") {
  5501. if (state === GenStateSuspendedStart) {
  5502. state = GenStateCompleted;
  5503. throw context.arg;
  5504. }
  5505. context.dispatchException(context.arg);
  5506. } else if (context.method === "return") {
  5507. context.abrupt("return", context.arg);
  5508. }
  5509. state = GenStateExecuting;
  5510. var record = tryCatch(innerFn, self, context);
  5511. if (record.type === "normal") {
  5512. // If an exception is thrown from innerFn, we leave state ===
  5513. // GenStateExecuting and loop back for another invocation.
  5514. state = context.done
  5515. ? GenStateCompleted
  5516. : GenStateSuspendedYield;
  5517. if (record.arg === ContinueSentinel) {
  5518. continue;
  5519. }
  5520. return {
  5521. value: record.arg,
  5522. done: context.done
  5523. };
  5524. } else if (record.type === "throw") {
  5525. state = GenStateCompleted;
  5526. // Dispatch the exception by looping back around to the
  5527. // context.dispatchException(context.arg) call above.
  5528. context.method = "throw";
  5529. context.arg = record.arg;
  5530. }
  5531. }
  5532. };
  5533. }
  5534. // Call delegate.iterator[context.method](context.arg) and handle the
  5535. // result, either by returning a { value, done } result from the
  5536. // delegate iterator, or by modifying context.method and context.arg,
  5537. // setting context.delegate to null, and returning the ContinueSentinel.
  5538. function maybeInvokeDelegate(delegate, context) {
  5539. var method = delegate.iterator[context.method];
  5540. if (method === undefined) {
  5541. // A .throw or .return when the delegate iterator has no .throw
  5542. // method always terminates the yield* loop.
  5543. context.delegate = null;
  5544. if (context.method === "throw") {
  5545. if (delegate.iterator.return) {
  5546. // If the delegate iterator has a return method, give it a
  5547. // chance to clean up.
  5548. context.method = "return";
  5549. context.arg = undefined;
  5550. maybeInvokeDelegate(delegate, context);
  5551. if (context.method === "throw") {
  5552. // If maybeInvokeDelegate(context) changed context.method from
  5553. // "return" to "throw", let that override the TypeError below.
  5554. return ContinueSentinel;
  5555. }
  5556. }
  5557. context.method = "throw";
  5558. context.arg = new TypeError(
  5559. "The iterator does not provide a 'throw' method");
  5560. }
  5561. return ContinueSentinel;
  5562. }
  5563. var record = tryCatch(method, delegate.iterator, context.arg);
  5564. if (record.type === "throw") {
  5565. context.method = "throw";
  5566. context.arg = record.arg;
  5567. context.delegate = null;
  5568. return ContinueSentinel;
  5569. }
  5570. var info = record.arg;
  5571. if (! info) {
  5572. context.method = "throw";
  5573. context.arg = new TypeError("iterator result is not an object");
  5574. context.delegate = null;
  5575. return ContinueSentinel;
  5576. }
  5577. if (info.done) {
  5578. // Assign the result of the finished delegate to the temporary
  5579. // variable specified by delegate.resultName (see delegateYield).
  5580. context[delegate.resultName] = info.value;
  5581. // Resume execution at the desired location (see delegateYield).
  5582. context.next = delegate.nextLoc;
  5583. // If context.method was "throw" but the delegate handled the
  5584. // exception, let the outer generator proceed normally. If
  5585. // context.method was "next", forget context.arg since it has been
  5586. // "consumed" by the delegate iterator. If context.method was
  5587. // "return", allow the original .return call to continue in the
  5588. // outer generator.
  5589. if (context.method !== "return") {
  5590. context.method = "next";
  5591. context.arg = undefined;
  5592. }
  5593. } else {
  5594. // Re-yield the result returned by the delegate method.
  5595. return info;
  5596. }
  5597. // The delegate iterator is finished, so forget it and continue with
  5598. // the outer generator.
  5599. context.delegate = null;
  5600. return ContinueSentinel;
  5601. }
  5602. // Define Generator.prototype.{next,throw,return} in terms of the
  5603. // unified ._invoke helper method.
  5604. defineIteratorMethods(Gp);
  5605. Gp[toStringTagSymbol] = "Generator";
  5606. // A Generator should always return itself as the iterator object when the
  5607. // @@iterator function is called on it. Some browsers' implementations of the
  5608. // iterator prototype chain incorrectly implement this, causing the Generator
  5609. // object to not be returned from this call. This ensures that doesn't happen.
  5610. // See https://github.com/facebook/regenerator/issues/274 for more details.
  5611. Gp[iteratorSymbol] = function() {
  5612. return this;
  5613. };
  5614. Gp.toString = function() {
  5615. return "[object Generator]";
  5616. };
  5617. function pushTryEntry(locs) {
  5618. var entry = { tryLoc: locs[0] };
  5619. if (1 in locs) {
  5620. entry.catchLoc = locs[1];
  5621. }
  5622. if (2 in locs) {
  5623. entry.finallyLoc = locs[2];
  5624. entry.afterLoc = locs[3];
  5625. }
  5626. this.tryEntries.push(entry);
  5627. }
  5628. function resetTryEntry(entry) {
  5629. var record = entry.completion || {};
  5630. record.type = "normal";
  5631. delete record.arg;
  5632. entry.completion = record;
  5633. }
  5634. function Context(tryLocsList) {
  5635. // The root entry object (effectively a try statement without a catch
  5636. // or a finally block) gives us a place to store values thrown from
  5637. // locations where there is no enclosing try statement.
  5638. this.tryEntries = [{ tryLoc: "root" }];
  5639. tryLocsList.forEach(pushTryEntry, this);
  5640. this.reset(true);
  5641. }
  5642. runtime.keys = function(object) {
  5643. var keys = [];
  5644. for (var key in object) {
  5645. keys.push(key);
  5646. }
  5647. keys.reverse();
  5648. // Rather than returning an object with a next method, we keep
  5649. // things simple and return the next function itself.
  5650. return function next() {
  5651. while (keys.length) {
  5652. var key = keys.pop();
  5653. if (key in object) {
  5654. next.value = key;
  5655. next.done = false;
  5656. return next;
  5657. }
  5658. }
  5659. // To avoid creating an additional object, we just hang the .value
  5660. // and .done properties off the next function object itself. This
  5661. // also ensures that the minifier will not anonymize the function.
  5662. next.done = true;
  5663. return next;
  5664. };
  5665. };
  5666. function values(iterable) {
  5667. if (iterable) {
  5668. var iteratorMethod = iterable[iteratorSymbol];
  5669. if (iteratorMethod) {
  5670. return iteratorMethod.call(iterable);
  5671. }
  5672. if (typeof iterable.next === "function") {
  5673. return iterable;
  5674. }
  5675. if (!isNaN(iterable.length)) {
  5676. var i = -1, next = function next() {
  5677. while (++i < iterable.length) {
  5678. if (hasOwn.call(iterable, i)) {
  5679. next.value = iterable[i];
  5680. next.done = false;
  5681. return next;
  5682. }
  5683. }
  5684. next.value = undefined;
  5685. next.done = true;
  5686. return next;
  5687. };
  5688. return next.next = next;
  5689. }
  5690. }
  5691. // Return an iterator with no values.
  5692. return { next: doneResult };
  5693. }
  5694. runtime.values = values;
  5695. function doneResult() {
  5696. return { value: undefined, done: true };
  5697. }
  5698. Context.prototype = {
  5699. constructor: Context,
  5700. reset: function(skipTempReset) {
  5701. this.prev = 0;
  5702. this.next = 0;
  5703. // Resetting context._sent for legacy support of Babel's
  5704. // function.sent implementation.
  5705. this.sent = this._sent = undefined;
  5706. this.done = false;
  5707. this.delegate = null;
  5708. this.method = "next";
  5709. this.arg = undefined;
  5710. this.tryEntries.forEach(resetTryEntry);
  5711. if (!skipTempReset) {
  5712. for (var name in this) {
  5713. // Not sure about the optimal order of these conditions:
  5714. if (name.charAt(0) === "t" &&
  5715. hasOwn.call(this, name) &&
  5716. !isNaN(+name.slice(1))) {
  5717. this[name] = undefined;
  5718. }
  5719. }
  5720. }
  5721. },
  5722. stop: function() {
  5723. this.done = true;
  5724. var rootEntry = this.tryEntries[0];
  5725. var rootRecord = rootEntry.completion;
  5726. if (rootRecord.type === "throw") {
  5727. throw rootRecord.arg;
  5728. }
  5729. return this.rval;
  5730. },
  5731. dispatchException: function(exception) {
  5732. if (this.done) {
  5733. throw exception;
  5734. }
  5735. var context = this;
  5736. function handle(loc, caught) {
  5737. record.type = "throw";
  5738. record.arg = exception;
  5739. context.next = loc;
  5740. if (caught) {
  5741. // If the dispatched exception was caught by a catch block,
  5742. // then let that catch block handle the exception normally.
  5743. context.method = "next";
  5744. context.arg = undefined;
  5745. }
  5746. return !! caught;
  5747. }
  5748. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5749. var entry = this.tryEntries[i];
  5750. var record = entry.completion;
  5751. if (entry.tryLoc === "root") {
  5752. // Exception thrown outside of any try block that could handle
  5753. // it, so set the completion value of the entire function to
  5754. // throw the exception.
  5755. return handle("end");
  5756. }
  5757. if (entry.tryLoc <= this.prev) {
  5758. var hasCatch = hasOwn.call(entry, "catchLoc");
  5759. var hasFinally = hasOwn.call(entry, "finallyLoc");
  5760. if (hasCatch && hasFinally) {
  5761. if (this.prev < entry.catchLoc) {
  5762. return handle(entry.catchLoc, true);
  5763. } else if (this.prev < entry.finallyLoc) {
  5764. return handle(entry.finallyLoc);
  5765. }
  5766. } else if (hasCatch) {
  5767. if (this.prev < entry.catchLoc) {
  5768. return handle(entry.catchLoc, true);
  5769. }
  5770. } else if (hasFinally) {
  5771. if (this.prev < entry.finallyLoc) {
  5772. return handle(entry.finallyLoc);
  5773. }
  5774. } else {
  5775. throw new Error("try statement without catch or finally");
  5776. }
  5777. }
  5778. }
  5779. },
  5780. abrupt: function(type, arg) {
  5781. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5782. var entry = this.tryEntries[i];
  5783. if (entry.tryLoc <= this.prev &&
  5784. hasOwn.call(entry, "finallyLoc") &&
  5785. this.prev < entry.finallyLoc) {
  5786. var finallyEntry = entry;
  5787. break;
  5788. }
  5789. }
  5790. if (finallyEntry &&
  5791. (type === "break" ||
  5792. type === "continue") &&
  5793. finallyEntry.tryLoc <= arg &&
  5794. arg <= finallyEntry.finallyLoc) {
  5795. // Ignore the finally entry if control is not jumping to a
  5796. // location outside the try/catch block.
  5797. finallyEntry = null;
  5798. }
  5799. var record = finallyEntry ? finallyEntry.completion : {};
  5800. record.type = type;
  5801. record.arg = arg;
  5802. if (finallyEntry) {
  5803. this.method = "next";
  5804. this.next = finallyEntry.finallyLoc;
  5805. return ContinueSentinel;
  5806. }
  5807. return this.complete(record);
  5808. },
  5809. complete: function(record, afterLoc) {
  5810. if (record.type === "throw") {
  5811. throw record.arg;
  5812. }
  5813. if (record.type === "break" ||
  5814. record.type === "continue") {
  5815. this.next = record.arg;
  5816. } else if (record.type === "return") {
  5817. this.rval = this.arg = record.arg;
  5818. this.method = "return";
  5819. this.next = "end";
  5820. } else if (record.type === "normal" && afterLoc) {
  5821. this.next = afterLoc;
  5822. }
  5823. return ContinueSentinel;
  5824. },
  5825. finish: function(finallyLoc) {
  5826. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5827. var entry = this.tryEntries[i];
  5828. if (entry.finallyLoc === finallyLoc) {
  5829. this.complete(entry.completion, entry.afterLoc);
  5830. resetTryEntry(entry);
  5831. return ContinueSentinel;
  5832. }
  5833. }
  5834. },
  5835. "catch": function(tryLoc) {
  5836. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5837. var entry = this.tryEntries[i];
  5838. if (entry.tryLoc === tryLoc) {
  5839. var record = entry.completion;
  5840. if (record.type === "throw") {
  5841. var thrown = record.arg;
  5842. resetTryEntry(entry);
  5843. }
  5844. return thrown;
  5845. }
  5846. }
  5847. // The context.catch method must only be called with a location
  5848. // argument that corresponds to a known catch block.
  5849. throw new Error("illegal catch attempt");
  5850. },
  5851. delegateYield: function(iterable, resultName, nextLoc) {
  5852. this.delegate = {
  5853. iterator: values(iterable),
  5854. resultName: resultName,
  5855. nextLoc: nextLoc
  5856. };
  5857. if (this.method === "next") {
  5858. // Deliberately forget the last sent value so that we don't
  5859. // accidentally pass it on to the delegate.
  5860. this.arg = undefined;
  5861. }
  5862. return ContinueSentinel;
  5863. }
  5864. };
  5865. })(
  5866. // In sloppy mode, unbound `this` refers to the global object, fallback to
  5867. // Function constructor if we're in global strict mode. That is sadly a form
  5868. // of indirect eval which violates Content Security Policy.
  5869. (function() {
  5870. return this || (typeof self === "object" && self);
  5871. })() || Function("return this")()
  5872. );
  5873. /***/ }),
  5874. /***/ 23:
  5875. /*!**************************************************************************!*\
  5876. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  5877. \**************************************************************************/
  5878. /*! no static exports found */
  5879. /***/ (function(module, exports, __webpack_require__) {
  5880. "use strict";
  5881. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  5882. // 所以这里做一个兼容polyfill的兼容处理
  5883. if (!String.prototype.padStart) {
  5884. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  5885. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  5886. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  5887. 'fillString must be String');
  5888. var str = this;
  5889. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  5890. if (str.length >= maxLength) return String(str);
  5891. var fillLength = maxLength - str.length,
  5892. times = Math.ceil(fillLength / fillString.length);
  5893. while (times >>= 1) {
  5894. fillString += fillString;
  5895. if (times === 1) {
  5896. fillString += fillString;
  5897. }
  5898. }
  5899. return fillString.slice(0, fillLength) + str;
  5900. };
  5901. }
  5902. // 其他更多是格式化有如下:
  5903. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  5904. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  5905. // 如果为null,则格式化当前时间
  5906. if (!dateTime) dateTime = Number(new Date());
  5907. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5908. if (dateTime.toString().length == 10) dateTime *= 1000;
  5909. var date = new Date(dateTime);
  5910. var ret;
  5911. var opt = {
  5912. "y+": date.getFullYear().toString(), // 年
  5913. "m+": (date.getMonth() + 1).toString(), // 月
  5914. "d+": date.getDate().toString(), // 日
  5915. "h+": date.getHours().toString(), // 时
  5916. "M+": date.getMinutes().toString(), // 分
  5917. "s+": date.getSeconds().toString() // 秒
  5918. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  5919. };
  5920. for (var k in opt) {
  5921. ret = new RegExp("(" + k + ")").exec(fmt);
  5922. if (ret) {
  5923. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  5924. };
  5925. };
  5926. return fmt;
  5927. }var _default =
  5928. timeFormat;exports.default = _default;
  5929. /***/ }),
  5930. /***/ 24:
  5931. /*!************************************************************************!*\
  5932. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  5933. \************************************************************************/
  5934. /*! no static exports found */
  5935. /***/ (function(module, exports, __webpack_require__) {
  5936. "use strict";
  5937. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  5938. /**
  5939. * 时间戳转为多久之前
  5940. * @param String timestamp 时间戳
  5941. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  5942. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  5943. */
  5944. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  5945. // 如果为null,则格式化当前时间
  5946. if (!dateTime) dateTime = Number(new Date());
  5947. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5948. if (dateTime.toString().length == 10) dateTime *= 1000;
  5949. var timestamp = +new Date(Number(dateTime));
  5950. var timer = (Number(new Date()) - timestamp) / 1000;
  5951. // 如果小于5分钟,则返回"刚刚",其他以此类推
  5952. var tips = '';
  5953. switch (true) {
  5954. case timer < 300:
  5955. tips = '刚刚';
  5956. break;
  5957. case timer >= 300 && timer < 3600:
  5958. tips = parseInt(timer / 60) + '分钟前';
  5959. break;
  5960. case timer >= 3600 && timer < 86400:
  5961. tips = parseInt(timer / 3600) + '小时前';
  5962. break;
  5963. case timer >= 86400 && timer < 2592000:
  5964. tips = parseInt(timer / 86400) + '天前';
  5965. break;
  5966. default:
  5967. // 如果format为false,则无论什么时间戳,都显示xx之前
  5968. if (format === false) {
  5969. if (timer >= 2592000 && timer < 365 * 86400) {
  5970. tips = parseInt(timer / (86400 * 30)) + '个月前';
  5971. } else {
  5972. tips = parseInt(timer / (86400 * 365)) + '年前';
  5973. }
  5974. } else {
  5975. tips = (0, _timeFormat.default)(timestamp, format);
  5976. }}
  5977. return tips;
  5978. }var _default =
  5979. timeFrom;exports.default = _default;
  5980. /***/ }),
  5981. /***/ 25:
  5982. /*!*****************************************************************************!*\
  5983. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  5984. \*****************************************************************************/
  5985. /*! no static exports found */
  5986. /***/ (function(module, exports, __webpack_require__) {
  5987. "use strict";
  5988. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5989. * 求两个颜色之间的渐变值
  5990. * @param {string} startColor 开始的颜色
  5991. * @param {string} endColor 结束的颜色
  5992. * @param {number} step 颜色等分的份额
  5993. * */
  5994. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  5995. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  5996. var startR = startRGB[0];
  5997. var startG = startRGB[1];
  5998. var startB = startRGB[2];
  5999. var endRGB = hexToRgb(endColor, false);
  6000. var endR = endRGB[0];
  6001. var endG = endRGB[1];
  6002. var endB = endRGB[2];
  6003. var sR = (endR - startR) / step; //总差值
  6004. var sG = (endG - startG) / step;
  6005. var sB = (endB - startB) / step;
  6006. var colorArr = [];
  6007. for (var i = 0; i < step; i++) {
  6008. //计算每一步的hex值
  6009. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  6010. i + startB) + ')');
  6011. colorArr.push(hex);
  6012. }
  6013. return colorArr;
  6014. }
  6015. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  6016. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  6017. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6018. sColor = sColor.toLowerCase();
  6019. if (sColor && reg.test(sColor)) {
  6020. if (sColor.length === 4) {
  6021. var sColorNew = "#";
  6022. for (var i = 1; i < 4; i += 1) {
  6023. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6024. }
  6025. sColor = sColorNew;
  6026. }
  6027. //处理六位的颜色值
  6028. var sColorChange = [];
  6029. for (var _i = 1; _i < 7; _i += 2) {
  6030. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  6031. }
  6032. if (!str) {
  6033. return sColorChange;
  6034. } else {
  6035. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  6036. }
  6037. } else if (/^(rgb|RGB)/.test(sColor)) {
  6038. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6039. return arr.map(function (val) {return Number(val);});
  6040. } else {
  6041. return sColor;
  6042. }
  6043. };
  6044. // 将rgb表示方式转换为hex表示方式
  6045. function rgbToHex(rgb) {
  6046. var _this = rgb;
  6047. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6048. if (/^(rgb|RGB)/.test(_this)) {
  6049. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6050. var strHex = "#";
  6051. for (var i = 0; i < aColor.length; i++) {
  6052. var hex = Number(aColor[i]).toString(16);
  6053. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  6054. if (hex === "0") {
  6055. hex += hex;
  6056. }
  6057. strHex += hex;
  6058. }
  6059. if (strHex.length !== 7) {
  6060. strHex = _this;
  6061. }
  6062. return strHex;
  6063. } else if (reg.test(_this)) {
  6064. var aNum = _this.replace(/#/, "").split("");
  6065. if (aNum.length === 6) {
  6066. return _this;
  6067. } else if (aNum.length === 3) {
  6068. var numHex = "#";
  6069. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  6070. numHex += aNum[_i2] + aNum[_i2];
  6071. }
  6072. return numHex;
  6073. }
  6074. } else {
  6075. return _this;
  6076. }
  6077. }
  6078. /**
  6079. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  6080. * sHex为传入的十六进制的色值
  6081. * alpha为rgba的透明度
  6082. */
  6083. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  6084. color = rgbToHex(color);
  6085. // 十六进制颜色值的正则表达式
  6086. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6087. /* 16进制颜色转为RGB格式 */
  6088. var sColor = color.toLowerCase();
  6089. if (sColor && reg.test(sColor)) {
  6090. if (sColor.length === 4) {
  6091. var sColorNew = '#';
  6092. for (var i = 1; i < 4; i += 1) {
  6093. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6094. }
  6095. sColor = sColorNew;
  6096. }
  6097. // 处理六位的颜色值
  6098. var sColorChange = [];
  6099. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  6100. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  6101. }
  6102. // return sColorChange.join(',')
  6103. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  6104. } else
  6105. {
  6106. return sColor;
  6107. }
  6108. }var _default =
  6109. {
  6110. colorGradient: colorGradient,
  6111. hexToRgb: hexToRgb,
  6112. rgbToHex: rgbToHex,
  6113. colorToRgba: colorToRgba };exports.default = _default;
  6114. /***/ }),
  6115. /***/ 26:
  6116. /*!********************************************************************!*\
  6117. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  6118. \********************************************************************/
  6119. /*! no static exports found */
  6120. /***/ (function(module, exports, __webpack_require__) {
  6121. "use strict";
  6122. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6123. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  6124. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  6125. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  6126. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  6127. * v-for的时候,推荐使用后端返回的id而不是循环的index
  6128. * @param {Number} len uuid的长度
  6129. * @param {Boolean} firstU 将返回的首字母置为"u"
  6130. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  6131. */
  6132. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  6133. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  6134. var uuid = [];
  6135. radix = radix || chars.length;
  6136. if (len) {
  6137. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  6138. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  6139. } else {
  6140. var r;
  6141. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  6142. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  6143. uuid[14] = '4';
  6144. for (var _i = 0; _i < 36; _i++) {
  6145. if (!uuid[_i]) {
  6146. r = 0 | Math.random() * 16;
  6147. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  6148. }
  6149. }
  6150. }
  6151. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  6152. if (firstU) {
  6153. uuid.shift();
  6154. return 'u' + uuid.join('');
  6155. } else {
  6156. return uuid.join('');
  6157. }
  6158. }var _default =
  6159. guid;exports.default = _default;
  6160. /***/ }),
  6161. /***/ 27:
  6162. /*!*********************************************************************!*\
  6163. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  6164. \*********************************************************************/
  6165. /*! no static exports found */
  6166. /***/ (function(module, exports, __webpack_require__) {
  6167. "use strict";
  6168. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  6169. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  6170. var color = {
  6171. primary: "#2979ff",
  6172. primaryDark: "#2b85e4",
  6173. primaryDisabled: "#a0cfff",
  6174. primaryLight: "#ecf5ff",
  6175. bgColor: "#f3f4f6",
  6176. info: "#909399",
  6177. infoDark: "#82848a",
  6178. infoDisabled: "#c8c9cc",
  6179. infoLight: "#f4f4f5",
  6180. warning: "#ff9900",
  6181. warningDark: "#f29100",
  6182. warningDisabled: "#fcbd71",
  6183. warningLight: "#fdf6ec",
  6184. error: "#fa3534",
  6185. errorDark: "#dd6161",
  6186. errorDisabled: "#fab6b6",
  6187. errorLight: "#fef0f0",
  6188. success: "#19be6b",
  6189. successDark: "#18b566",
  6190. successDisabled: "#71d5a1",
  6191. successLight: "#dbf1e1",
  6192. mainColor: "#303133",
  6193. contentColor: "#606266",
  6194. tipsColor: "#909399",
  6195. lightColor: "#c0c4cc",
  6196. borderColor: "#e4e7ed" };var _default =
  6197. color;exports.default = _default;
  6198. /***/ }),
  6199. /***/ 28:
  6200. /*!*************************************************************************!*\
  6201. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  6202. \*************************************************************************/
  6203. /*! no static exports found */
  6204. /***/ (function(module, exports, __webpack_require__) {
  6205. "use strict";
  6206. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6207. * 根据主题type值,获取对应的图标
  6208. * @param String type 主题名称,primary|info|error|warning|success
  6209. * @param String fill 是否使用fill填充实体的图标
  6210. */
  6211. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  6212. // 如果非预置值,默认为success
  6213. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  6214. var iconName = '';
  6215. // 目前(2019-12-12),info和primary使用同一个图标
  6216. switch (type) {
  6217. case 'primary':
  6218. iconName = 'info-circle';
  6219. break;
  6220. case 'info':
  6221. iconName = 'info-circle';
  6222. break;
  6223. case 'error':
  6224. iconName = 'close-circle';
  6225. break;
  6226. case 'warning':
  6227. iconName = 'error-circle';
  6228. break;
  6229. case 'success':
  6230. iconName = 'checkmark-circle';
  6231. break;
  6232. default:
  6233. iconName = 'checkmark-circle';}
  6234. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  6235. if (fill) iconName += '-fill';
  6236. return iconName;
  6237. }var _default =
  6238. type2icon;exports.default = _default;
  6239. /***/ }),
  6240. /***/ 29:
  6241. /*!***************************************************************************!*\
  6242. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  6243. \***************************************************************************/
  6244. /*! no static exports found */
  6245. /***/ (function(module, exports, __webpack_require__) {
  6246. "use strict";
  6247. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  6248. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  6249. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  6250. return array.sort(function () {return Math.random() - 0.5;});
  6251. }var _default =
  6252. randomArray;exports.default = _default;
  6253. /***/ }),
  6254. /***/ 3:
  6255. /*!*************************************************************!*\
  6256. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  6257. \*************************************************************/
  6258. /*! no static exports found */
  6259. /***/ (function(module, exports, __webpack_require__) {
  6260. "use strict";
  6261. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}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);}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;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  6262. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  6263. var defaultDelimiters = ['{', '}'];var
  6264. BaseFormatter = /*#__PURE__*/function () {
  6265. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  6266. this._caches = Object.create(null);
  6267. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  6268. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  6269. if (!values) {
  6270. return [message];
  6271. }
  6272. var tokens = this._caches[message];
  6273. if (!tokens) {
  6274. tokens = parse(message, delimiters);
  6275. this._caches[message] = tokens;
  6276. }
  6277. return compile(tokens, values);
  6278. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  6279. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  6280. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  6281. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  6282. var tokens = [];
  6283. var position = 0;
  6284. var text = '';
  6285. while (position < format.length) {
  6286. var char = format[position++];
  6287. if (char === startDelimiter) {
  6288. if (text) {
  6289. tokens.push({ type: 'text', value: text });
  6290. }
  6291. text = '';
  6292. var sub = '';
  6293. char = format[position++];
  6294. while (char !== undefined && char !== endDelimiter) {
  6295. sub += char;
  6296. char = format[position++];
  6297. }
  6298. var isClosed = char === endDelimiter;
  6299. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  6300. 'list' :
  6301. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  6302. 'named' :
  6303. 'unknown';
  6304. tokens.push({ value: sub, type: type });
  6305. }
  6306. // else if (char === '%') {
  6307. // // when found rails i18n syntax, skip text capture
  6308. // if (format[position] !== '{') {
  6309. // text += char
  6310. // }
  6311. // }
  6312. else {
  6313. text += char;
  6314. }
  6315. }
  6316. text && tokens.push({ type: 'text', value: text });
  6317. return tokens;
  6318. }
  6319. function compile(tokens, values) {
  6320. var compiled = [];
  6321. var index = 0;
  6322. var mode = isArray(values) ?
  6323. 'list' :
  6324. isObject(values) ?
  6325. 'named' :
  6326. 'unknown';
  6327. if (mode === 'unknown') {
  6328. return compiled;
  6329. }
  6330. while (index < tokens.length) {
  6331. var token = tokens[index];
  6332. switch (token.type) {
  6333. case 'text':
  6334. compiled.push(token.value);
  6335. break;
  6336. case 'list':
  6337. compiled.push(values[parseInt(token.value, 10)]);
  6338. break;
  6339. case 'named':
  6340. if (mode === 'named') {
  6341. compiled.push(values[token.value]);
  6342. } else
  6343. {
  6344. if (true) {
  6345. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  6346. }
  6347. }
  6348. break;
  6349. case 'unknown':
  6350. if (true) {
  6351. console.warn("Detect 'unknown' type of token!");
  6352. }
  6353. break;}
  6354. index++;
  6355. }
  6356. return compiled;
  6357. }
  6358. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  6359. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  6360. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  6361. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  6362. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  6363. var hasOwnProperty = Object.prototype.hasOwnProperty;
  6364. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  6365. var defaultFormatter = new BaseFormatter();
  6366. function include(str, parts) {
  6367. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  6368. }
  6369. function startsWith(str, parts) {
  6370. return parts.find(function (part) {return str.indexOf(part) === 0;});
  6371. }
  6372. function normalizeLocale(locale, messages) {
  6373. if (!locale) {
  6374. return;
  6375. }
  6376. locale = locale.trim().replace(/_/g, '-');
  6377. if (messages && messages[locale]) {
  6378. return locale;
  6379. }
  6380. locale = locale.toLowerCase();
  6381. if (locale.indexOf('zh') === 0) {
  6382. if (locale.indexOf('-hans') > -1) {
  6383. return LOCALE_ZH_HANS;
  6384. }
  6385. if (locale.indexOf('-hant') > -1) {
  6386. return LOCALE_ZH_HANT;
  6387. }
  6388. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  6389. return LOCALE_ZH_HANT;
  6390. }
  6391. return LOCALE_ZH_HANS;
  6392. }
  6393. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  6394. if (lang) {
  6395. return lang;
  6396. }
  6397. }var
  6398. I18n = /*#__PURE__*/function () {
  6399. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  6400. this.locale = LOCALE_EN;
  6401. this.fallbackLocale = LOCALE_EN;
  6402. this.message = {};
  6403. this.messages = {};
  6404. this.watchers = [];
  6405. if (fallbackLocale) {
  6406. this.fallbackLocale = fallbackLocale;
  6407. }
  6408. this.formater = formater || defaultFormatter;
  6409. this.messages = messages || {};
  6410. this.setLocale(locale || LOCALE_EN);
  6411. if (watcher) {
  6412. this.watchLocale(watcher);
  6413. }
  6414. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  6415. locale) {var _this = this;
  6416. var oldLocale = this.locale;
  6417. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  6418. if (!this.messages[this.locale]) {
  6419. // 可能初始化时不存在
  6420. this.messages[this.locale] = {};
  6421. }
  6422. this.message = this.messages[this.locale];
  6423. // 仅发生变化时,通知
  6424. if (oldLocale !== this.locale) {
  6425. this.watchers.forEach(function (watcher) {
  6426. watcher(_this.locale, oldLocale);
  6427. });
  6428. }
  6429. } }, { key: "getLocale", value: function getLocale()
  6430. {
  6431. return this.locale;
  6432. } }, { key: "watchLocale", value: function watchLocale(
  6433. fn) {var _this2 = this;
  6434. var index = this.watchers.push(fn) - 1;
  6435. return function () {
  6436. _this2.watchers.splice(index, 1);
  6437. };
  6438. } }, { key: "add", value: function add(
  6439. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6440. var curMessages = this.messages[locale];
  6441. if (curMessages) {
  6442. if (override) {
  6443. Object.assign(curMessages, message);
  6444. } else
  6445. {
  6446. Object.keys(message).forEach(function (key) {
  6447. if (!hasOwn(curMessages, key)) {
  6448. curMessages[key] = message[key];
  6449. }
  6450. });
  6451. }
  6452. } else
  6453. {
  6454. this.messages[locale] = message;
  6455. }
  6456. } }, { key: "f", value: function f(
  6457. message, values, delimiters) {
  6458. return this.formater.interpolate(message, values, delimiters).join('');
  6459. } }, { key: "t", value: function t(
  6460. key, locale, values) {
  6461. var message = this.message;
  6462. if (typeof locale === 'string') {
  6463. locale = normalizeLocale(locale, this.messages);
  6464. locale && (message = this.messages[locale]);
  6465. } else
  6466. {
  6467. values = locale;
  6468. }
  6469. if (!hasOwn(message, key)) {
  6470. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  6471. return key;
  6472. }
  6473. return this.formater.interpolate(message[key], values).join('');
  6474. } }]);return I18n;}();exports.I18n = I18n;
  6475. function watchAppLocale(appVm, i18n) {
  6476. // 需要保证 watch 的触发在组件渲染之前
  6477. if (appVm.$watchLocale) {
  6478. // vue2
  6479. appVm.$watchLocale(function (newLocale) {
  6480. i18n.setLocale(newLocale);
  6481. });
  6482. } else
  6483. {
  6484. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  6485. i18n.setLocale(newLocale);
  6486. });
  6487. }
  6488. }
  6489. function getDefaultLocale() {
  6490. if (typeof uni !== 'undefined' && uni.getLocale) {
  6491. return uni.getLocale();
  6492. }
  6493. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  6494. if (typeof global !== 'undefined' && global.getLocale) {
  6495. return global.getLocale();
  6496. }
  6497. return LOCALE_EN;
  6498. }
  6499. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  6500. // 兼容旧版本入参
  6501. if (typeof locale !== 'string') {var _ref4 =
  6502. [
  6503. messages,
  6504. locale];locale = _ref4[0];messages = _ref4[1];
  6505. }
  6506. if (typeof locale !== 'string') {
  6507. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  6508. locale = getDefaultLocale();
  6509. }
  6510. if (typeof fallbackLocale !== 'string') {
  6511. fallbackLocale =
  6512. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  6513. LOCALE_EN;
  6514. }
  6515. var i18n = new I18n({
  6516. locale: locale,
  6517. fallbackLocale: fallbackLocale,
  6518. messages: messages,
  6519. watcher: watcher });
  6520. var _t = function t(key, values) {
  6521. if (typeof getApp !== 'function') {
  6522. // app view
  6523. /* eslint-disable no-func-assign */
  6524. _t = function t(key, values) {
  6525. return i18n.t(key, values);
  6526. };
  6527. } else
  6528. {
  6529. var isWatchedAppLocale = false;
  6530. _t = function t(key, values) {
  6531. var appVm = getApp().$vm;
  6532. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  6533. // options: {
  6534. // type: Array,
  6535. // default () {
  6536. // return [{
  6537. // icon: 'shop',
  6538. // text: t("uni-goods-nav.options.shop"),
  6539. // }, {
  6540. // icon: 'cart',
  6541. // text: t("uni-goods-nav.options.cart")
  6542. // }]
  6543. // }
  6544. // },
  6545. if (appVm) {
  6546. // 触发响应式
  6547. appVm.$locale;
  6548. if (!isWatchedAppLocale) {
  6549. isWatchedAppLocale = true;
  6550. watchAppLocale(appVm, i18n);
  6551. }
  6552. }
  6553. return i18n.t(key, values);
  6554. };
  6555. }
  6556. return _t(key, values);
  6557. };
  6558. return {
  6559. i18n: i18n,
  6560. f: function f(message, values, delimiters) {
  6561. return i18n.f(message, values, delimiters);
  6562. },
  6563. t: function t(key, values) {
  6564. return _t(key, values);
  6565. },
  6566. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6567. return i18n.add(locale, message, override);
  6568. },
  6569. watch: function watch(fn) {
  6570. return i18n.watchLocale(fn);
  6571. },
  6572. getLocale: function getLocale() {
  6573. return i18n.getLocale();
  6574. },
  6575. setLocale: function setLocale(newLocale) {
  6576. return i18n.setLocale(newLocale);
  6577. } };
  6578. }
  6579. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  6580. var formater;
  6581. function hasI18nJson(jsonObj, delimiters) {
  6582. if (!formater) {
  6583. formater = new BaseFormatter();
  6584. }
  6585. return walkJsonObj(jsonObj, function (jsonObj, key) {
  6586. var value = jsonObj[key];
  6587. if (isString(value)) {
  6588. if (isI18nStr(value, delimiters)) {
  6589. return true;
  6590. }
  6591. } else
  6592. {
  6593. return hasI18nJson(value, delimiters);
  6594. }
  6595. });
  6596. }
  6597. function parseI18nJson(jsonObj, values, delimiters) {
  6598. if (!formater) {
  6599. formater = new BaseFormatter();
  6600. }
  6601. walkJsonObj(jsonObj, function (jsonObj, key) {
  6602. var value = jsonObj[key];
  6603. if (isString(value)) {
  6604. if (isI18nStr(value, delimiters)) {
  6605. jsonObj[key] = compileStr(value, values, delimiters);
  6606. }
  6607. } else
  6608. {
  6609. parseI18nJson(value, values, delimiters);
  6610. }
  6611. });
  6612. return jsonObj;
  6613. }
  6614. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  6615. if (!isI18nStr(jsonStr, delimiters)) {
  6616. return jsonStr;
  6617. }
  6618. if (!formater) {
  6619. formater = new BaseFormatter();
  6620. }
  6621. var localeValues = [];
  6622. Object.keys(locales).forEach(function (name) {
  6623. if (name !== locale) {
  6624. localeValues.push({
  6625. locale: name,
  6626. values: locales[name] });
  6627. }
  6628. });
  6629. localeValues.unshift({ locale: locale, values: locales[locale] });
  6630. try {
  6631. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  6632. }
  6633. catch (e) {}
  6634. return jsonStr;
  6635. }
  6636. function isI18nStr(value, delimiters) {
  6637. return value.indexOf(delimiters[0]) > -1;
  6638. }
  6639. function compileStr(value, values, delimiters) {
  6640. return formater.interpolate(value, values, delimiters).join('');
  6641. }
  6642. function compileValue(jsonObj, key, localeValues, delimiters) {
  6643. var value = jsonObj[key];
  6644. if (isString(value)) {
  6645. // 存在国际化
  6646. if (isI18nStr(value, delimiters)) {
  6647. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  6648. if (localeValues.length > 1) {
  6649. // 格式化国际化语言
  6650. var valueLocales = jsonObj[key + 'Locales'] = {};
  6651. localeValues.forEach(function (localValue) {
  6652. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  6653. });
  6654. }
  6655. }
  6656. } else
  6657. {
  6658. compileJsonObj(value, localeValues, delimiters);
  6659. }
  6660. }
  6661. function compileJsonObj(jsonObj, localeValues, delimiters) {
  6662. walkJsonObj(jsonObj, function (jsonObj, key) {
  6663. compileValue(jsonObj, key, localeValues, delimiters);
  6664. });
  6665. return jsonObj;
  6666. }
  6667. function walkJsonObj(jsonObj, walk) {
  6668. if (isArray(jsonObj)) {
  6669. for (var i = 0; i < jsonObj.length; i++) {
  6670. if (walk(jsonObj, i)) {
  6671. return true;
  6672. }
  6673. }
  6674. } else
  6675. if (isObject(jsonObj)) {
  6676. for (var key in jsonObj) {
  6677. if (walk(jsonObj, key)) {
  6678. return true;
  6679. }
  6680. }
  6681. }
  6682. return false;
  6683. }
  6684. function resolveLocale(locales) {
  6685. return function (locale) {
  6686. if (!locale) {
  6687. return locale;
  6688. }
  6689. locale = normalizeLocale(locale) || locale;
  6690. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  6691. };
  6692. }
  6693. function resolveLocaleChain(locale) {
  6694. var chain = [];
  6695. var tokens = locale.split('-');
  6696. while (tokens.length) {
  6697. chain.push(tokens.join('-'));
  6698. tokens.pop();
  6699. }
  6700. return chain;
  6701. }
  6702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  6703. /***/ }),
  6704. /***/ 30:
  6705. /*!***********************************************************************!*\
  6706. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  6707. \***********************************************************************/
  6708. /*! no static exports found */
  6709. /***/ (function(module, exports, __webpack_require__) {
  6710. "use strict";
  6711. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6712. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  6713. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  6714. value = String(value);
  6715. // 用uView内置验证规则中的number判断是否为数值
  6716. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  6717. }
  6718. /***/ }),
  6719. /***/ 31:
  6720. /*!**********************************************************************!*\
  6721. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  6722. \**********************************************************************/
  6723. /*! no static exports found */
  6724. /***/ (function(module, exports, __webpack_require__) {
  6725. "use strict";
  6726. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  6727. if (min >= 0 && max > 0 && max >= min) {
  6728. var gab = max - min + 1;
  6729. return Math.floor(Math.random() * gab + min);
  6730. } else {
  6731. return 0;
  6732. }
  6733. }var _default =
  6734. random;exports.default = _default;
  6735. /***/ }),
  6736. /***/ 32:
  6737. /*!********************************************************************!*\
  6738. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  6739. \********************************************************************/
  6740. /*! no static exports found */
  6741. /***/ (function(module, exports, __webpack_require__) {
  6742. "use strict";
  6743. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  6744. if (pos == 'both') {
  6745. return str.replace(/^\s+|\s+$/g, "");
  6746. } else if (pos == "left") {
  6747. return str.replace(/^\s*/, '');
  6748. } else if (pos == 'right') {
  6749. return str.replace(/(\s*$)/g, "");
  6750. } else if (pos == 'all') {
  6751. return str.replace(/\s+/g, "");
  6752. } else {
  6753. return str;
  6754. }
  6755. }var _default =
  6756. trim;exports.default = _default;
  6757. /***/ }),
  6758. /***/ 33:
  6759. /*!*********************************************************************!*\
  6760. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  6761. \*********************************************************************/
  6762. /*! no static exports found */
  6763. /***/ (function(module, exports, __webpack_require__) {
  6764. "use strict";
  6765. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  6766. uni.showToast({
  6767. title: title,
  6768. icon: 'none',
  6769. duration: duration });
  6770. }var _default =
  6771. toast;exports.default = _default;
  6772. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6773. /***/ }),
  6774. /***/ 34:
  6775. /*!*************************************************************************!*\
  6776. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  6777. \*************************************************************************/
  6778. /*! no static exports found */
  6779. /***/ (function(module, exports, __webpack_require__) {
  6780. "use strict";
  6781. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6782. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6783. function getParent(name, keys) {
  6784. var parent = this.$parent;
  6785. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6786. while (parent) {
  6787. // 父组件
  6788. if (parent.$options.name !== name) {
  6789. // 如果组件的name不相等,继续上一级寻找
  6790. parent = parent.$parent;
  6791. } else {var _ret = function () {
  6792. var data = {};
  6793. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  6794. if (Array.isArray(keys)) {
  6795. keys.map(function (val) {
  6796. data[val] = parent[val] ? parent[val] : '';
  6797. });
  6798. } else {
  6799. // 历遍传过来的对象参数
  6800. for (var i in keys) {
  6801. // 如果子组件有此值则用,无此值则用父组件的值
  6802. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  6803. if (Array.isArray(keys[i])) {
  6804. if (keys[i].length) {
  6805. data[i] = keys[i];
  6806. } else {
  6807. data[i] = parent[i];
  6808. }
  6809. } else if (keys[i].constructor === Object) {
  6810. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  6811. if (Object.keys(keys[i]).length) {
  6812. data[i] = keys[i];
  6813. } else {
  6814. data[i] = parent[i];
  6815. }
  6816. } else {
  6817. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  6818. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  6819. }
  6820. }
  6821. }
  6822. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  6823. }
  6824. }
  6825. return {};
  6826. }
  6827. /***/ }),
  6828. /***/ 35:
  6829. /*!***********************************************************************!*\
  6830. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  6831. \***********************************************************************/
  6832. /*! no static exports found */
  6833. /***/ (function(module, exports, __webpack_require__) {
  6834. "use strict";
  6835. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6836. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6837. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  6838. // 值(默认为undefined),就是查找最顶层的$parent
  6839. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6840. var parent = this.$parent;
  6841. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6842. while (parent) {
  6843. // 父组件
  6844. if (parent.$options && parent.$options.name !== name) {
  6845. // 如果组件的name不相等,继续上一级寻找
  6846. parent = parent.$parent;
  6847. } else {
  6848. return parent;
  6849. }
  6850. }
  6851. return false;
  6852. }
  6853. /***/ }),
  6854. /***/ 36:
  6855. /*!*******************************************************************!*\
  6856. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  6857. \*******************************************************************/
  6858. /*! no static exports found */
  6859. /***/ (function(module, exports, __webpack_require__) {
  6860. "use strict";
  6861. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  6862. return uni.getSystemInfoSync().platform;
  6863. };
  6864. function sys() {
  6865. return uni.getSystemInfoSync();
  6866. }
  6867. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6868. /***/ }),
  6869. /***/ 37:
  6870. /*!************************************************************************!*\
  6871. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  6872. \************************************************************************/
  6873. /*! no static exports found */
  6874. /***/ (function(module, exports, __webpack_require__) {
  6875. "use strict";
  6876. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  6877. /**
  6878. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  6879. *
  6880. * @param {Function} func 要执行的回调函数
  6881. * @param {Number} wait 延时的时间
  6882. * @param {Boolean} immediate 是否立即执行
  6883. * @return null
  6884. */
  6885. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  6886. // 清除定时器
  6887. if (timeout !== null) clearTimeout(timeout);
  6888. // 立即执行,此类情况一般用不到
  6889. if (immediate) {
  6890. var callNow = !timeout;
  6891. timeout = setTimeout(function () {
  6892. timeout = null;
  6893. }, wait);
  6894. if (callNow) typeof func === 'function' && func();
  6895. } else {
  6896. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  6897. timeout = setTimeout(function () {
  6898. typeof func === 'function' && func();
  6899. }, wait);
  6900. }
  6901. }var _default =
  6902. debounce;exports.default = _default;
  6903. /***/ }),
  6904. /***/ 38:
  6905. /*!************************************************************************!*\
  6906. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  6907. \************************************************************************/
  6908. /*! no static exports found */
  6909. /***/ (function(module, exports, __webpack_require__) {
  6910. "use strict";
  6911. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  6912. var flagArr = [];
  6913. /**
  6914. * 节流函数
  6915. * 节流原理:在一定时间内,只能触发一次
  6916. * @param {Function} fn 要执行的回调函数
  6917. * @param {Number} time 延时的时间
  6918. * @param {Boolean} isImmediate 是否立即执行
  6919. * @param {String} timeoutName 定时器ID
  6920. * @return null
  6921. */
  6922. function throttle(fn) {var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  6923. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  6924. if (isImmediate) {
  6925. if (!flagArr[timeoutName]) {
  6926. flagArr[timeoutName] = true;
  6927. // 如果是立即执行,则在time毫秒内开始时执行
  6928. if (typeof fn === 'function') fn();
  6929. timeoutArr[timeoutName] = setTimeout(function () {
  6930. flagArr[timeoutName] = false;
  6931. }, time);
  6932. }
  6933. } else {
  6934. if (!flagArr[timeoutName]) {
  6935. flagArr[timeoutName] = true;
  6936. // 如果是非立即执行,则在time毫秒内的结束处执行
  6937. timeoutArr[timeoutName] = setTimeout(function () {
  6938. flagArr[timeoutName] = false;
  6939. if (typeof fn === 'function') fn();
  6940. }, time);
  6941. }
  6942. }
  6943. };var _default =
  6944. throttle;exports.default = _default;
  6945. /***/ }),
  6946. /***/ 39:
  6947. /*!********************************************************************!*\
  6948. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  6949. \********************************************************************/
  6950. /*! no static exports found */
  6951. /***/ (function(module, exports, __webpack_require__) {
  6952. "use strict";
  6953. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  6954. var version = '1.10.1';var _default =
  6955. {
  6956. v: version,
  6957. version: version,
  6958. // 主题名称
  6959. type: [
  6960. 'primary',
  6961. 'success',
  6962. 'info',
  6963. 'error',
  6964. 'warning'] };exports.default = _default;
  6965. /***/ }),
  6966. /***/ 4:
  6967. /*!******************************************************************************************!*\
  6968. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  6969. \******************************************************************************************/
  6970. /*! exports provided: default */
  6971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6972. "use strict";
  6973. __webpack_require__.r(__webpack_exports__);
  6974. /* WEBPACK VAR INJECTION */(function(global) {/*!
  6975. * Vue.js v2.6.11
  6976. * (c) 2014-2022 Evan You
  6977. * Released under the MIT License.
  6978. */
  6979. /* */
  6980. var emptyObject = Object.freeze({});
  6981. // These helpers produce better VM code in JS engines due to their
  6982. // explicitness and function inlining.
  6983. function isUndef (v) {
  6984. return v === undefined || v === null
  6985. }
  6986. function isDef (v) {
  6987. return v !== undefined && v !== null
  6988. }
  6989. function isTrue (v) {
  6990. return v === true
  6991. }
  6992. function isFalse (v) {
  6993. return v === false
  6994. }
  6995. /**
  6996. * Check if value is primitive.
  6997. */
  6998. function isPrimitive (value) {
  6999. return (
  7000. typeof value === 'string' ||
  7001. typeof value === 'number' ||
  7002. // $flow-disable-line
  7003. typeof value === 'symbol' ||
  7004. typeof value === 'boolean'
  7005. )
  7006. }
  7007. /**
  7008. * Quick object check - this is primarily used to tell
  7009. * Objects from primitive values when we know the value
  7010. * is a JSON-compliant type.
  7011. */
  7012. function isObject (obj) {
  7013. return obj !== null && typeof obj === 'object'
  7014. }
  7015. /**
  7016. * Get the raw type string of a value, e.g., [object Object].
  7017. */
  7018. var _toString = Object.prototype.toString;
  7019. function toRawType (value) {
  7020. return _toString.call(value).slice(8, -1)
  7021. }
  7022. /**
  7023. * Strict object type check. Only returns true
  7024. * for plain JavaScript objects.
  7025. */
  7026. function isPlainObject (obj) {
  7027. return _toString.call(obj) === '[object Object]'
  7028. }
  7029. function isRegExp (v) {
  7030. return _toString.call(v) === '[object RegExp]'
  7031. }
  7032. /**
  7033. * Check if val is a valid array index.
  7034. */
  7035. function isValidArrayIndex (val) {
  7036. var n = parseFloat(String(val));
  7037. return n >= 0 && Math.floor(n) === n && isFinite(val)
  7038. }
  7039. function isPromise (val) {
  7040. return (
  7041. isDef(val) &&
  7042. typeof val.then === 'function' &&
  7043. typeof val.catch === 'function'
  7044. )
  7045. }
  7046. /**
  7047. * Convert a value to a string that is actually rendered.
  7048. */
  7049. function toString (val) {
  7050. return val == null
  7051. ? ''
  7052. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  7053. ? JSON.stringify(val, null, 2)
  7054. : String(val)
  7055. }
  7056. /**
  7057. * Convert an input value to a number for persistence.
  7058. * If the conversion fails, return original string.
  7059. */
  7060. function toNumber (val) {
  7061. var n = parseFloat(val);
  7062. return isNaN(n) ? val : n
  7063. }
  7064. /**
  7065. * Make a map and return a function for checking if a key
  7066. * is in that map.
  7067. */
  7068. function makeMap (
  7069. str,
  7070. expectsLowerCase
  7071. ) {
  7072. var map = Object.create(null);
  7073. var list = str.split(',');
  7074. for (var i = 0; i < list.length; i++) {
  7075. map[list[i]] = true;
  7076. }
  7077. return expectsLowerCase
  7078. ? function (val) { return map[val.toLowerCase()]; }
  7079. : function (val) { return map[val]; }
  7080. }
  7081. /**
  7082. * Check if a tag is a built-in tag.
  7083. */
  7084. var isBuiltInTag = makeMap('slot,component', true);
  7085. /**
  7086. * Check if an attribute is a reserved attribute.
  7087. */
  7088. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  7089. /**
  7090. * Remove an item from an array.
  7091. */
  7092. function remove (arr, item) {
  7093. if (arr.length) {
  7094. var index = arr.indexOf(item);
  7095. if (index > -1) {
  7096. return arr.splice(index, 1)
  7097. }
  7098. }
  7099. }
  7100. /**
  7101. * Check whether an object has the property.
  7102. */
  7103. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7104. function hasOwn (obj, key) {
  7105. return hasOwnProperty.call(obj, key)
  7106. }
  7107. /**
  7108. * Create a cached version of a pure function.
  7109. */
  7110. function cached (fn) {
  7111. var cache = Object.create(null);
  7112. return (function cachedFn (str) {
  7113. var hit = cache[str];
  7114. return hit || (cache[str] = fn(str))
  7115. })
  7116. }
  7117. /**
  7118. * Camelize a hyphen-delimited string.
  7119. */
  7120. var camelizeRE = /-(\w)/g;
  7121. var camelize = cached(function (str) {
  7122. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  7123. });
  7124. /**
  7125. * Capitalize a string.
  7126. */
  7127. var capitalize = cached(function (str) {
  7128. return str.charAt(0).toUpperCase() + str.slice(1)
  7129. });
  7130. /**
  7131. * Hyphenate a camelCase string.
  7132. */
  7133. var hyphenateRE = /\B([A-Z])/g;
  7134. var hyphenate = cached(function (str) {
  7135. return str.replace(hyphenateRE, '-$1').toLowerCase()
  7136. });
  7137. /**
  7138. * Simple bind polyfill for environments that do not support it,
  7139. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  7140. * since native bind is now performant enough in most browsers.
  7141. * But removing it would mean breaking code that was able to run in
  7142. * PhantomJS 1.x, so this must be kept for backward compatibility.
  7143. */
  7144. /* istanbul ignore next */
  7145. function polyfillBind (fn, ctx) {
  7146. function boundFn (a) {
  7147. var l = arguments.length;
  7148. return l
  7149. ? l > 1
  7150. ? fn.apply(ctx, arguments)
  7151. : fn.call(ctx, a)
  7152. : fn.call(ctx)
  7153. }
  7154. boundFn._length = fn.length;
  7155. return boundFn
  7156. }
  7157. function nativeBind (fn, ctx) {
  7158. return fn.bind(ctx)
  7159. }
  7160. var bind = Function.prototype.bind
  7161. ? nativeBind
  7162. : polyfillBind;
  7163. /**
  7164. * Convert an Array-like object to a real Array.
  7165. */
  7166. function toArray (list, start) {
  7167. start = start || 0;
  7168. var i = list.length - start;
  7169. var ret = new Array(i);
  7170. while (i--) {
  7171. ret[i] = list[i + start];
  7172. }
  7173. return ret
  7174. }
  7175. /**
  7176. * Mix properties into target object.
  7177. */
  7178. function extend (to, _from) {
  7179. for (var key in _from) {
  7180. to[key] = _from[key];
  7181. }
  7182. return to
  7183. }
  7184. /**
  7185. * Merge an Array of Objects into a single Object.
  7186. */
  7187. function toObject (arr) {
  7188. var res = {};
  7189. for (var i = 0; i < arr.length; i++) {
  7190. if (arr[i]) {
  7191. extend(res, arr[i]);
  7192. }
  7193. }
  7194. return res
  7195. }
  7196. /* eslint-disable no-unused-vars */
  7197. /**
  7198. * Perform no operation.
  7199. * Stubbing args to make Flow happy without leaving useless transpiled code
  7200. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  7201. */
  7202. function noop (a, b, c) {}
  7203. /**
  7204. * Always return false.
  7205. */
  7206. var no = function (a, b, c) { return false; };
  7207. /* eslint-enable no-unused-vars */
  7208. /**
  7209. * Return the same value.
  7210. */
  7211. var identity = function (_) { return _; };
  7212. /**
  7213. * Check if two values are loosely equal - that is,
  7214. * if they are plain objects, do they have the same shape?
  7215. */
  7216. function looseEqual (a, b) {
  7217. if (a === b) { return true }
  7218. var isObjectA = isObject(a);
  7219. var isObjectB = isObject(b);
  7220. if (isObjectA && isObjectB) {
  7221. try {
  7222. var isArrayA = Array.isArray(a);
  7223. var isArrayB = Array.isArray(b);
  7224. if (isArrayA && isArrayB) {
  7225. return a.length === b.length && a.every(function (e, i) {
  7226. return looseEqual(e, b[i])
  7227. })
  7228. } else if (a instanceof Date && b instanceof Date) {
  7229. return a.getTime() === b.getTime()
  7230. } else if (!isArrayA && !isArrayB) {
  7231. var keysA = Object.keys(a);
  7232. var keysB = Object.keys(b);
  7233. return keysA.length === keysB.length && keysA.every(function (key) {
  7234. return looseEqual(a[key], b[key])
  7235. })
  7236. } else {
  7237. /* istanbul ignore next */
  7238. return false
  7239. }
  7240. } catch (e) {
  7241. /* istanbul ignore next */
  7242. return false
  7243. }
  7244. } else if (!isObjectA && !isObjectB) {
  7245. return String(a) === String(b)
  7246. } else {
  7247. return false
  7248. }
  7249. }
  7250. /**
  7251. * Return the first index at which a loosely equal value can be
  7252. * found in the array (if value is a plain object, the array must
  7253. * contain an object of the same shape), or -1 if it is not present.
  7254. */
  7255. function looseIndexOf (arr, val) {
  7256. for (var i = 0; i < arr.length; i++) {
  7257. if (looseEqual(arr[i], val)) { return i }
  7258. }
  7259. return -1
  7260. }
  7261. /**
  7262. * Ensure a function is called only once.
  7263. */
  7264. function once (fn) {
  7265. var called = false;
  7266. return function () {
  7267. if (!called) {
  7268. called = true;
  7269. fn.apply(this, arguments);
  7270. }
  7271. }
  7272. }
  7273. var ASSET_TYPES = [
  7274. 'component',
  7275. 'directive',
  7276. 'filter'
  7277. ];
  7278. var LIFECYCLE_HOOKS = [
  7279. 'beforeCreate',
  7280. 'created',
  7281. 'beforeMount',
  7282. 'mounted',
  7283. 'beforeUpdate',
  7284. 'updated',
  7285. 'beforeDestroy',
  7286. 'destroyed',
  7287. 'activated',
  7288. 'deactivated',
  7289. 'errorCaptured',
  7290. 'serverPrefetch'
  7291. ];
  7292. /* */
  7293. var config = ({
  7294. /**
  7295. * Option merge strategies (used in core/util/options)
  7296. */
  7297. // $flow-disable-line
  7298. optionMergeStrategies: Object.create(null),
  7299. /**
  7300. * Whether to suppress warnings.
  7301. */
  7302. silent: false,
  7303. /**
  7304. * Show production mode tip message on boot?
  7305. */
  7306. productionTip: "development" !== 'production',
  7307. /**
  7308. * Whether to enable devtools
  7309. */
  7310. devtools: "development" !== 'production',
  7311. /**
  7312. * Whether to record perf
  7313. */
  7314. performance: false,
  7315. /**
  7316. * Error handler for watcher errors
  7317. */
  7318. errorHandler: null,
  7319. /**
  7320. * Warn handler for watcher warns
  7321. */
  7322. warnHandler: null,
  7323. /**
  7324. * Ignore certain custom elements
  7325. */
  7326. ignoredElements: [],
  7327. /**
  7328. * Custom user key aliases for v-on
  7329. */
  7330. // $flow-disable-line
  7331. keyCodes: Object.create(null),
  7332. /**
  7333. * Check if a tag is reserved so that it cannot be registered as a
  7334. * component. This is platform-dependent and may be overwritten.
  7335. */
  7336. isReservedTag: no,
  7337. /**
  7338. * Check if an attribute is reserved so that it cannot be used as a component
  7339. * prop. This is platform-dependent and may be overwritten.
  7340. */
  7341. isReservedAttr: no,
  7342. /**
  7343. * Check if a tag is an unknown element.
  7344. * Platform-dependent.
  7345. */
  7346. isUnknownElement: no,
  7347. /**
  7348. * Get the namespace of an element
  7349. */
  7350. getTagNamespace: noop,
  7351. /**
  7352. * Parse the real tag name for the specific platform.
  7353. */
  7354. parsePlatformTagName: identity,
  7355. /**
  7356. * Check if an attribute must be bound using property, e.g. value
  7357. * Platform-dependent.
  7358. */
  7359. mustUseProp: no,
  7360. /**
  7361. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  7362. * This will significantly reduce performance if set to false.
  7363. */
  7364. async: true,
  7365. /**
  7366. * Exposed for legacy reasons
  7367. */
  7368. _lifecycleHooks: LIFECYCLE_HOOKS
  7369. });
  7370. /* */
  7371. /**
  7372. * unicode letters used for parsing html tags, component names and property paths.
  7373. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  7374. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  7375. */
  7376. 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/;
  7377. /**
  7378. * Check if a string starts with $ or _
  7379. */
  7380. function isReserved (str) {
  7381. var c = (str + '').charCodeAt(0);
  7382. return c === 0x24 || c === 0x5F
  7383. }
  7384. /**
  7385. * Define a property.
  7386. */
  7387. function def (obj, key, val, enumerable) {
  7388. Object.defineProperty(obj, key, {
  7389. value: val,
  7390. enumerable: !!enumerable,
  7391. writable: true,
  7392. configurable: true
  7393. });
  7394. }
  7395. /**
  7396. * Parse simple path.
  7397. */
  7398. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  7399. function parsePath (path) {
  7400. if (bailRE.test(path)) {
  7401. return
  7402. }
  7403. var segments = path.split('.');
  7404. return function (obj) {
  7405. for (var i = 0; i < segments.length; i++) {
  7406. if (!obj) { return }
  7407. obj = obj[segments[i]];
  7408. }
  7409. return obj
  7410. }
  7411. }
  7412. /* */
  7413. // can we use __proto__?
  7414. var hasProto = '__proto__' in {};
  7415. // Browser environment sniffing
  7416. var inBrowser = typeof window !== 'undefined';
  7417. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  7418. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  7419. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  7420. var isIE = UA && /msie|trident/.test(UA);
  7421. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  7422. var isEdge = UA && UA.indexOf('edge/') > 0;
  7423. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  7424. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  7425. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  7426. var isPhantomJS = UA && /phantomjs/.test(UA);
  7427. var isFF = UA && UA.match(/firefox\/(\d+)/);
  7428. // Firefox has a "watch" function on Object.prototype...
  7429. var nativeWatch = ({}).watch;
  7430. if (inBrowser) {
  7431. try {
  7432. var opts = {};
  7433. Object.defineProperty(opts, 'passive', ({
  7434. get: function get () {
  7435. }
  7436. })); // https://github.com/facebook/flow/issues/285
  7437. window.addEventListener('test-passive', null, opts);
  7438. } catch (e) {}
  7439. }
  7440. // this needs to be lazy-evaled because vue may be required before
  7441. // vue-server-renderer can set VUE_ENV
  7442. var _isServer;
  7443. var isServerRendering = function () {
  7444. if (_isServer === undefined) {
  7445. /* istanbul ignore if */
  7446. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  7447. // detect presence of vue-server-renderer and avoid
  7448. // Webpack shimming the process
  7449. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  7450. } else {
  7451. _isServer = false;
  7452. }
  7453. }
  7454. return _isServer
  7455. };
  7456. // detect devtools
  7457. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  7458. /* istanbul ignore next */
  7459. function isNative (Ctor) {
  7460. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  7461. }
  7462. var hasSymbol =
  7463. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  7464. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  7465. var _Set;
  7466. /* istanbul ignore if */ // $flow-disable-line
  7467. if (typeof Set !== 'undefined' && isNative(Set)) {
  7468. // use native Set when available.
  7469. _Set = Set;
  7470. } else {
  7471. // a non-standard Set polyfill that only works with primitive keys.
  7472. _Set = /*@__PURE__*/(function () {
  7473. function Set () {
  7474. this.set = Object.create(null);
  7475. }
  7476. Set.prototype.has = function has (key) {
  7477. return this.set[key] === true
  7478. };
  7479. Set.prototype.add = function add (key) {
  7480. this.set[key] = true;
  7481. };
  7482. Set.prototype.clear = function clear () {
  7483. this.set = Object.create(null);
  7484. };
  7485. return Set;
  7486. }());
  7487. }
  7488. /* */
  7489. var warn = noop;
  7490. var tip = noop;
  7491. var generateComponentTrace = (noop); // work around flow check
  7492. var formatComponentName = (noop);
  7493. if (true) {
  7494. var hasConsole = typeof console !== 'undefined';
  7495. var classifyRE = /(?:^|[-_])(\w)/g;
  7496. var classify = function (str) { return str
  7497. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  7498. .replace(/[-_]/g, ''); };
  7499. warn = function (msg, vm) {
  7500. var trace = vm ? generateComponentTrace(vm) : '';
  7501. if (config.warnHandler) {
  7502. config.warnHandler.call(null, msg, vm, trace);
  7503. } else if (hasConsole && (!config.silent)) {
  7504. console.error(("[Vue warn]: " + msg + trace));
  7505. }
  7506. };
  7507. tip = function (msg, vm) {
  7508. if (hasConsole && (!config.silent)) {
  7509. console.warn("[Vue tip]: " + msg + (
  7510. vm ? generateComponentTrace(vm) : ''
  7511. ));
  7512. }
  7513. };
  7514. formatComponentName = function (vm, includeFile) {
  7515. if (vm.$root === vm) {
  7516. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  7517. return ('') + vm.$options.__file
  7518. }
  7519. return '<Root>'
  7520. }
  7521. var options = typeof vm === 'function' && vm.cid != null
  7522. ? vm.options
  7523. : vm._isVue
  7524. ? vm.$options || vm.constructor.options
  7525. : vm;
  7526. var name = options.name || options._componentTag;
  7527. var file = options.__file;
  7528. if (!name && file) {
  7529. var match = file.match(/([^/\\]+)\.vue$/);
  7530. name = match && match[1];
  7531. }
  7532. return (
  7533. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  7534. (file && includeFile !== false ? (" at " + file) : '')
  7535. )
  7536. };
  7537. var repeat = function (str, n) {
  7538. var res = '';
  7539. while (n) {
  7540. if (n % 2 === 1) { res += str; }
  7541. if (n > 1) { str += str; }
  7542. n >>= 1;
  7543. }
  7544. return res
  7545. };
  7546. generateComponentTrace = function (vm) {
  7547. if (vm._isVue && vm.$parent) {
  7548. var tree = [];
  7549. var currentRecursiveSequence = 0;
  7550. while (vm && vm.$options.name !== 'PageBody') {
  7551. if (tree.length > 0) {
  7552. var last = tree[tree.length - 1];
  7553. if (last.constructor === vm.constructor) {
  7554. currentRecursiveSequence++;
  7555. vm = vm.$parent;
  7556. continue
  7557. } else if (currentRecursiveSequence > 0) {
  7558. tree[tree.length - 1] = [last, currentRecursiveSequence];
  7559. currentRecursiveSequence = 0;
  7560. }
  7561. }
  7562. !vm.$options.isReserved && tree.push(vm);
  7563. vm = vm.$parent;
  7564. }
  7565. return '\n\nfound in\n\n' + tree
  7566. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  7567. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  7568. : formatComponentName(vm))); })
  7569. .join('\n')
  7570. } else {
  7571. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  7572. }
  7573. };
  7574. }
  7575. /* */
  7576. var uid = 0;
  7577. /**
  7578. * A dep is an observable that can have multiple
  7579. * directives subscribing to it.
  7580. */
  7581. var Dep = function Dep () {
  7582. this.id = uid++;
  7583. this.subs = [];
  7584. };
  7585. Dep.prototype.addSub = function addSub (sub) {
  7586. this.subs.push(sub);
  7587. };
  7588. Dep.prototype.removeSub = function removeSub (sub) {
  7589. remove(this.subs, sub);
  7590. };
  7591. Dep.prototype.depend = function depend () {
  7592. if (Dep.SharedObject.target) {
  7593. Dep.SharedObject.target.addDep(this);
  7594. }
  7595. };
  7596. Dep.prototype.notify = function notify () {
  7597. // stabilize the subscriber list first
  7598. var subs = this.subs.slice();
  7599. if ( true && !config.async) {
  7600. // subs aren't sorted in scheduler if not running async
  7601. // we need to sort them now to make sure they fire in correct
  7602. // order
  7603. subs.sort(function (a, b) { return a.id - b.id; });
  7604. }
  7605. for (var i = 0, l = subs.length; i < l; i++) {
  7606. subs[i].update();
  7607. }
  7608. };
  7609. // The current target watcher being evaluated.
  7610. // This is globally unique because only one watcher
  7611. // can be evaluated at a time.
  7612. // fixed by xxxxxx (nvue shared vuex)
  7613. /* eslint-disable no-undef */
  7614. Dep.SharedObject = {};
  7615. Dep.SharedObject.target = null;
  7616. Dep.SharedObject.targetStack = [];
  7617. function pushTarget (target) {
  7618. Dep.SharedObject.targetStack.push(target);
  7619. Dep.SharedObject.target = target;
  7620. Dep.target = target;
  7621. }
  7622. function popTarget () {
  7623. Dep.SharedObject.targetStack.pop();
  7624. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  7625. Dep.target = Dep.SharedObject.target;
  7626. }
  7627. /* */
  7628. var VNode = function VNode (
  7629. tag,
  7630. data,
  7631. children,
  7632. text,
  7633. elm,
  7634. context,
  7635. componentOptions,
  7636. asyncFactory
  7637. ) {
  7638. this.tag = tag;
  7639. this.data = data;
  7640. this.children = children;
  7641. this.text = text;
  7642. this.elm = elm;
  7643. this.ns = undefined;
  7644. this.context = context;
  7645. this.fnContext = undefined;
  7646. this.fnOptions = undefined;
  7647. this.fnScopeId = undefined;
  7648. this.key = data && data.key;
  7649. this.componentOptions = componentOptions;
  7650. this.componentInstance = undefined;
  7651. this.parent = undefined;
  7652. this.raw = false;
  7653. this.isStatic = false;
  7654. this.isRootInsert = true;
  7655. this.isComment = false;
  7656. this.isCloned = false;
  7657. this.isOnce = false;
  7658. this.asyncFactory = asyncFactory;
  7659. this.asyncMeta = undefined;
  7660. this.isAsyncPlaceholder = false;
  7661. };
  7662. var prototypeAccessors = { child: { configurable: true } };
  7663. // DEPRECATED: alias for componentInstance for backwards compat.
  7664. /* istanbul ignore next */
  7665. prototypeAccessors.child.get = function () {
  7666. return this.componentInstance
  7667. };
  7668. Object.defineProperties( VNode.prototype, prototypeAccessors );
  7669. var createEmptyVNode = function (text) {
  7670. if ( text === void 0 ) text = '';
  7671. var node = new VNode();
  7672. node.text = text;
  7673. node.isComment = true;
  7674. return node
  7675. };
  7676. function createTextVNode (val) {
  7677. return new VNode(undefined, undefined, undefined, String(val))
  7678. }
  7679. // optimized shallow clone
  7680. // used for static nodes and slot nodes because they may be reused across
  7681. // multiple renders, cloning them avoids errors when DOM manipulations rely
  7682. // on their elm reference.
  7683. function cloneVNode (vnode) {
  7684. var cloned = new VNode(
  7685. vnode.tag,
  7686. vnode.data,
  7687. // #7975
  7688. // clone children array to avoid mutating original in case of cloning
  7689. // a child.
  7690. vnode.children && vnode.children.slice(),
  7691. vnode.text,
  7692. vnode.elm,
  7693. vnode.context,
  7694. vnode.componentOptions,
  7695. vnode.asyncFactory
  7696. );
  7697. cloned.ns = vnode.ns;
  7698. cloned.isStatic = vnode.isStatic;
  7699. cloned.key = vnode.key;
  7700. cloned.isComment = vnode.isComment;
  7701. cloned.fnContext = vnode.fnContext;
  7702. cloned.fnOptions = vnode.fnOptions;
  7703. cloned.fnScopeId = vnode.fnScopeId;
  7704. cloned.asyncMeta = vnode.asyncMeta;
  7705. cloned.isCloned = true;
  7706. return cloned
  7707. }
  7708. /*
  7709. * not type checking this file because flow doesn't play well with
  7710. * dynamically accessing methods on Array prototype
  7711. */
  7712. var arrayProto = Array.prototype;
  7713. var arrayMethods = Object.create(arrayProto);
  7714. var methodsToPatch = [
  7715. 'push',
  7716. 'pop',
  7717. 'shift',
  7718. 'unshift',
  7719. 'splice',
  7720. 'sort',
  7721. 'reverse'
  7722. ];
  7723. /**
  7724. * Intercept mutating methods and emit events
  7725. */
  7726. methodsToPatch.forEach(function (method) {
  7727. // cache original method
  7728. var original = arrayProto[method];
  7729. def(arrayMethods, method, function mutator () {
  7730. var args = [], len = arguments.length;
  7731. while ( len-- ) args[ len ] = arguments[ len ];
  7732. var result = original.apply(this, args);
  7733. var ob = this.__ob__;
  7734. var inserted;
  7735. switch (method) {
  7736. case 'push':
  7737. case 'unshift':
  7738. inserted = args;
  7739. break
  7740. case 'splice':
  7741. inserted = args.slice(2);
  7742. break
  7743. }
  7744. if (inserted) { ob.observeArray(inserted); }
  7745. // notify change
  7746. ob.dep.notify();
  7747. return result
  7748. });
  7749. });
  7750. /* */
  7751. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  7752. /**
  7753. * In some cases we may want to disable observation inside a component's
  7754. * update computation.
  7755. */
  7756. var shouldObserve = true;
  7757. function toggleObserving (value) {
  7758. shouldObserve = value;
  7759. }
  7760. /**
  7761. * Observer class that is attached to each observed
  7762. * object. Once attached, the observer converts the target
  7763. * object's property keys into getter/setters that
  7764. * collect dependencies and dispatch updates.
  7765. */
  7766. var Observer = function Observer (value) {
  7767. this.value = value;
  7768. this.dep = new Dep();
  7769. this.vmCount = 0;
  7770. def(value, '__ob__', this);
  7771. if (Array.isArray(value)) {
  7772. if (hasProto) {
  7773. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  7774. if(value.push !== value.__proto__.push){
  7775. copyAugment(value, arrayMethods, arrayKeys);
  7776. } else {
  7777. protoAugment(value, arrayMethods);
  7778. }
  7779. }
  7780. } else {
  7781. copyAugment(value, arrayMethods, arrayKeys);
  7782. }
  7783. this.observeArray(value);
  7784. } else {
  7785. this.walk(value);
  7786. }
  7787. };
  7788. /**
  7789. * Walk through all properties and convert them into
  7790. * getter/setters. This method should only be called when
  7791. * value type is Object.
  7792. */
  7793. Observer.prototype.walk = function walk (obj) {
  7794. var keys = Object.keys(obj);
  7795. for (var i = 0; i < keys.length; i++) {
  7796. defineReactive$$1(obj, keys[i]);
  7797. }
  7798. };
  7799. /**
  7800. * Observe a list of Array items.
  7801. */
  7802. Observer.prototype.observeArray = function observeArray (items) {
  7803. for (var i = 0, l = items.length; i < l; i++) {
  7804. observe(items[i]);
  7805. }
  7806. };
  7807. // helpers
  7808. /**
  7809. * Augment a target Object or Array by intercepting
  7810. * the prototype chain using __proto__
  7811. */
  7812. function protoAugment (target, src) {
  7813. /* eslint-disable no-proto */
  7814. target.__proto__ = src;
  7815. /* eslint-enable no-proto */
  7816. }
  7817. /**
  7818. * Augment a target Object or Array by defining
  7819. * hidden properties.
  7820. */
  7821. /* istanbul ignore next */
  7822. function copyAugment (target, src, keys) {
  7823. for (var i = 0, l = keys.length; i < l; i++) {
  7824. var key = keys[i];
  7825. def(target, key, src[key]);
  7826. }
  7827. }
  7828. /**
  7829. * Attempt to create an observer instance for a value,
  7830. * returns the new observer if successfully observed,
  7831. * or the existing observer if the value already has one.
  7832. */
  7833. function observe (value, asRootData) {
  7834. if (!isObject(value) || value instanceof VNode) {
  7835. return
  7836. }
  7837. var ob;
  7838. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  7839. ob = value.__ob__;
  7840. } else if (
  7841. shouldObserve &&
  7842. !isServerRendering() &&
  7843. (Array.isArray(value) || isPlainObject(value)) &&
  7844. Object.isExtensible(value) &&
  7845. !value._isVue
  7846. ) {
  7847. ob = new Observer(value);
  7848. }
  7849. if (asRootData && ob) {
  7850. ob.vmCount++;
  7851. }
  7852. return ob
  7853. }
  7854. /**
  7855. * Define a reactive property on an Object.
  7856. */
  7857. function defineReactive$$1 (
  7858. obj,
  7859. key,
  7860. val,
  7861. customSetter,
  7862. shallow
  7863. ) {
  7864. var dep = new Dep();
  7865. var property = Object.getOwnPropertyDescriptor(obj, key);
  7866. if (property && property.configurable === false) {
  7867. return
  7868. }
  7869. // cater for pre-defined getter/setters
  7870. var getter = property && property.get;
  7871. var setter = property && property.set;
  7872. if ((!getter || setter) && arguments.length === 2) {
  7873. val = obj[key];
  7874. }
  7875. var childOb = !shallow && observe(val);
  7876. Object.defineProperty(obj, key, {
  7877. enumerable: true,
  7878. configurable: true,
  7879. get: function reactiveGetter () {
  7880. var value = getter ? getter.call(obj) : val;
  7881. if (Dep.SharedObject.target) { // fixed by xxxxxx
  7882. dep.depend();
  7883. if (childOb) {
  7884. childOb.dep.depend();
  7885. if (Array.isArray(value)) {
  7886. dependArray(value);
  7887. }
  7888. }
  7889. }
  7890. return value
  7891. },
  7892. set: function reactiveSetter (newVal) {
  7893. var value = getter ? getter.call(obj) : val;
  7894. /* eslint-disable no-self-compare */
  7895. if (newVal === value || (newVal !== newVal && value !== value)) {
  7896. return
  7897. }
  7898. /* eslint-enable no-self-compare */
  7899. if ( true && customSetter) {
  7900. customSetter();
  7901. }
  7902. // #7981: for accessor properties without setter
  7903. if (getter && !setter) { return }
  7904. if (setter) {
  7905. setter.call(obj, newVal);
  7906. } else {
  7907. val = newVal;
  7908. }
  7909. childOb = !shallow && observe(newVal);
  7910. dep.notify();
  7911. }
  7912. });
  7913. }
  7914. /**
  7915. * Set a property on an object. Adds the new property and
  7916. * triggers change notification if the property doesn't
  7917. * already exist.
  7918. */
  7919. function set (target, key, val) {
  7920. if ( true &&
  7921. (isUndef(target) || isPrimitive(target))
  7922. ) {
  7923. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  7924. }
  7925. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7926. target.length = Math.max(target.length, key);
  7927. target.splice(key, 1, val);
  7928. return val
  7929. }
  7930. if (key in target && !(key in Object.prototype)) {
  7931. target[key] = val;
  7932. return val
  7933. }
  7934. var ob = (target).__ob__;
  7935. if (target._isVue || (ob && ob.vmCount)) {
  7936. true && warn(
  7937. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  7938. 'at runtime - declare it upfront in the data option.'
  7939. );
  7940. return val
  7941. }
  7942. if (!ob) {
  7943. target[key] = val;
  7944. return val
  7945. }
  7946. defineReactive$$1(ob.value, key, val);
  7947. ob.dep.notify();
  7948. return val
  7949. }
  7950. /**
  7951. * Delete a property and trigger change if necessary.
  7952. */
  7953. function del (target, key) {
  7954. if ( true &&
  7955. (isUndef(target) || isPrimitive(target))
  7956. ) {
  7957. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  7958. }
  7959. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7960. target.splice(key, 1);
  7961. return
  7962. }
  7963. var ob = (target).__ob__;
  7964. if (target._isVue || (ob && ob.vmCount)) {
  7965. true && warn(
  7966. 'Avoid deleting properties on a Vue instance or its root $data ' +
  7967. '- just set it to null.'
  7968. );
  7969. return
  7970. }
  7971. if (!hasOwn(target, key)) {
  7972. return
  7973. }
  7974. delete target[key];
  7975. if (!ob) {
  7976. return
  7977. }
  7978. ob.dep.notify();
  7979. }
  7980. /**
  7981. * Collect dependencies on array elements when the array is touched, since
  7982. * we cannot intercept array element access like property getters.
  7983. */
  7984. function dependArray (value) {
  7985. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  7986. e = value[i];
  7987. e && e.__ob__ && e.__ob__.dep.depend();
  7988. if (Array.isArray(e)) {
  7989. dependArray(e);
  7990. }
  7991. }
  7992. }
  7993. /* */
  7994. /**
  7995. * Option overwriting strategies are functions that handle
  7996. * how to merge a parent option value and a child option
  7997. * value into the final value.
  7998. */
  7999. var strats = config.optionMergeStrategies;
  8000. /**
  8001. * Options with restrictions
  8002. */
  8003. if (true) {
  8004. strats.el = strats.propsData = function (parent, child, vm, key) {
  8005. if (!vm) {
  8006. warn(
  8007. "option \"" + key + "\" can only be used during instance " +
  8008. 'creation with the `new` keyword.'
  8009. );
  8010. }
  8011. return defaultStrat(parent, child)
  8012. };
  8013. }
  8014. /**
  8015. * Helper that recursively merges two data objects together.
  8016. */
  8017. function mergeData (to, from) {
  8018. if (!from) { return to }
  8019. var key, toVal, fromVal;
  8020. var keys = hasSymbol
  8021. ? Reflect.ownKeys(from)
  8022. : Object.keys(from);
  8023. for (var i = 0; i < keys.length; i++) {
  8024. key = keys[i];
  8025. // in case the object is already observed...
  8026. if (key === '__ob__') { continue }
  8027. toVal = to[key];
  8028. fromVal = from[key];
  8029. if (!hasOwn(to, key)) {
  8030. set(to, key, fromVal);
  8031. } else if (
  8032. toVal !== fromVal &&
  8033. isPlainObject(toVal) &&
  8034. isPlainObject(fromVal)
  8035. ) {
  8036. mergeData(toVal, fromVal);
  8037. }
  8038. }
  8039. return to
  8040. }
  8041. /**
  8042. * Data
  8043. */
  8044. function mergeDataOrFn (
  8045. parentVal,
  8046. childVal,
  8047. vm
  8048. ) {
  8049. if (!vm) {
  8050. // in a Vue.extend merge, both should be functions
  8051. if (!childVal) {
  8052. return parentVal
  8053. }
  8054. if (!parentVal) {
  8055. return childVal
  8056. }
  8057. // when parentVal & childVal are both present,
  8058. // we need to return a function that returns the
  8059. // merged result of both functions... no need to
  8060. // check if parentVal is a function here because
  8061. // it has to be a function to pass previous merges.
  8062. return function mergedDataFn () {
  8063. return mergeData(
  8064. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  8065. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  8066. )
  8067. }
  8068. } else {
  8069. return function mergedInstanceDataFn () {
  8070. // instance merge
  8071. var instanceData = typeof childVal === 'function'
  8072. ? childVal.call(vm, vm)
  8073. : childVal;
  8074. var defaultData = typeof parentVal === 'function'
  8075. ? parentVal.call(vm, vm)
  8076. : parentVal;
  8077. if (instanceData) {
  8078. return mergeData(instanceData, defaultData)
  8079. } else {
  8080. return defaultData
  8081. }
  8082. }
  8083. }
  8084. }
  8085. strats.data = function (
  8086. parentVal,
  8087. childVal,
  8088. vm
  8089. ) {
  8090. if (!vm) {
  8091. if (childVal && typeof childVal !== 'function') {
  8092. true && warn(
  8093. 'The "data" option should be a function ' +
  8094. 'that returns a per-instance value in component ' +
  8095. 'definitions.',
  8096. vm
  8097. );
  8098. return parentVal
  8099. }
  8100. return mergeDataOrFn(parentVal, childVal)
  8101. }
  8102. return mergeDataOrFn(parentVal, childVal, vm)
  8103. };
  8104. /**
  8105. * Hooks and props are merged as arrays.
  8106. */
  8107. function mergeHook (
  8108. parentVal,
  8109. childVal
  8110. ) {
  8111. var res = childVal
  8112. ? parentVal
  8113. ? parentVal.concat(childVal)
  8114. : Array.isArray(childVal)
  8115. ? childVal
  8116. : [childVal]
  8117. : parentVal;
  8118. return res
  8119. ? dedupeHooks(res)
  8120. : res
  8121. }
  8122. function dedupeHooks (hooks) {
  8123. var res = [];
  8124. for (var i = 0; i < hooks.length; i++) {
  8125. if (res.indexOf(hooks[i]) === -1) {
  8126. res.push(hooks[i]);
  8127. }
  8128. }
  8129. return res
  8130. }
  8131. LIFECYCLE_HOOKS.forEach(function (hook) {
  8132. strats[hook] = mergeHook;
  8133. });
  8134. /**
  8135. * Assets
  8136. *
  8137. * When a vm is present (instance creation), we need to do
  8138. * a three-way merge between constructor options, instance
  8139. * options and parent options.
  8140. */
  8141. function mergeAssets (
  8142. parentVal,
  8143. childVal,
  8144. vm,
  8145. key
  8146. ) {
  8147. var res = Object.create(parentVal || null);
  8148. if (childVal) {
  8149. true && assertObjectType(key, childVal, vm);
  8150. return extend(res, childVal)
  8151. } else {
  8152. return res
  8153. }
  8154. }
  8155. ASSET_TYPES.forEach(function (type) {
  8156. strats[type + 's'] = mergeAssets;
  8157. });
  8158. /**
  8159. * Watchers.
  8160. *
  8161. * Watchers hashes should not overwrite one
  8162. * another, so we merge them as arrays.
  8163. */
  8164. strats.watch = function (
  8165. parentVal,
  8166. childVal,
  8167. vm,
  8168. key
  8169. ) {
  8170. // work around Firefox's Object.prototype.watch...
  8171. if (parentVal === nativeWatch) { parentVal = undefined; }
  8172. if (childVal === nativeWatch) { childVal = undefined; }
  8173. /* istanbul ignore if */
  8174. if (!childVal) { return Object.create(parentVal || null) }
  8175. if (true) {
  8176. assertObjectType(key, childVal, vm);
  8177. }
  8178. if (!parentVal) { return childVal }
  8179. var ret = {};
  8180. extend(ret, parentVal);
  8181. for (var key$1 in childVal) {
  8182. var parent = ret[key$1];
  8183. var child = childVal[key$1];
  8184. if (parent && !Array.isArray(parent)) {
  8185. parent = [parent];
  8186. }
  8187. ret[key$1] = parent
  8188. ? parent.concat(child)
  8189. : Array.isArray(child) ? child : [child];
  8190. }
  8191. return ret
  8192. };
  8193. /**
  8194. * Other object hashes.
  8195. */
  8196. strats.props =
  8197. strats.methods =
  8198. strats.inject =
  8199. strats.computed = function (
  8200. parentVal,
  8201. childVal,
  8202. vm,
  8203. key
  8204. ) {
  8205. if (childVal && "development" !== 'production') {
  8206. assertObjectType(key, childVal, vm);
  8207. }
  8208. if (!parentVal) { return childVal }
  8209. var ret = Object.create(null);
  8210. extend(ret, parentVal);
  8211. if (childVal) { extend(ret, childVal); }
  8212. return ret
  8213. };
  8214. strats.provide = mergeDataOrFn;
  8215. /**
  8216. * Default strategy.
  8217. */
  8218. var defaultStrat = function (parentVal, childVal) {
  8219. return childVal === undefined
  8220. ? parentVal
  8221. : childVal
  8222. };
  8223. /**
  8224. * Validate component names
  8225. */
  8226. function checkComponents (options) {
  8227. for (var key in options.components) {
  8228. validateComponentName(key);
  8229. }
  8230. }
  8231. function validateComponentName (name) {
  8232. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  8233. warn(
  8234. 'Invalid component name: "' + name + '". Component names ' +
  8235. 'should conform to valid custom element name in html5 specification.'
  8236. );
  8237. }
  8238. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  8239. warn(
  8240. 'Do not use built-in or reserved HTML elements as component ' +
  8241. 'id: ' + name
  8242. );
  8243. }
  8244. }
  8245. /**
  8246. * Ensure all props option syntax are normalized into the
  8247. * Object-based format.
  8248. */
  8249. function normalizeProps (options, vm) {
  8250. var props = options.props;
  8251. if (!props) { return }
  8252. var res = {};
  8253. var i, val, name;
  8254. if (Array.isArray(props)) {
  8255. i = props.length;
  8256. while (i--) {
  8257. val = props[i];
  8258. if (typeof val === 'string') {
  8259. name = camelize(val);
  8260. res[name] = { type: null };
  8261. } else if (true) {
  8262. warn('props must be strings when using array syntax.');
  8263. }
  8264. }
  8265. } else if (isPlainObject(props)) {
  8266. for (var key in props) {
  8267. val = props[key];
  8268. name = camelize(key);
  8269. res[name] = isPlainObject(val)
  8270. ? val
  8271. : { type: val };
  8272. }
  8273. } else if (true) {
  8274. warn(
  8275. "Invalid value for option \"props\": expected an Array or an Object, " +
  8276. "but got " + (toRawType(props)) + ".",
  8277. vm
  8278. );
  8279. }
  8280. options.props = res;
  8281. }
  8282. /**
  8283. * Normalize all injections into Object-based format
  8284. */
  8285. function normalizeInject (options, vm) {
  8286. var inject = options.inject;
  8287. if (!inject) { return }
  8288. var normalized = options.inject = {};
  8289. if (Array.isArray(inject)) {
  8290. for (var i = 0; i < inject.length; i++) {
  8291. normalized[inject[i]] = { from: inject[i] };
  8292. }
  8293. } else if (isPlainObject(inject)) {
  8294. for (var key in inject) {
  8295. var val = inject[key];
  8296. normalized[key] = isPlainObject(val)
  8297. ? extend({ from: key }, val)
  8298. : { from: val };
  8299. }
  8300. } else if (true) {
  8301. warn(
  8302. "Invalid value for option \"inject\": expected an Array or an Object, " +
  8303. "but got " + (toRawType(inject)) + ".",
  8304. vm
  8305. );
  8306. }
  8307. }
  8308. /**
  8309. * Normalize raw function directives into object format.
  8310. */
  8311. function normalizeDirectives (options) {
  8312. var dirs = options.directives;
  8313. if (dirs) {
  8314. for (var key in dirs) {
  8315. var def$$1 = dirs[key];
  8316. if (typeof def$$1 === 'function') {
  8317. dirs[key] = { bind: def$$1, update: def$$1 };
  8318. }
  8319. }
  8320. }
  8321. }
  8322. function assertObjectType (name, value, vm) {
  8323. if (!isPlainObject(value)) {
  8324. warn(
  8325. "Invalid value for option \"" + name + "\": expected an Object, " +
  8326. "but got " + (toRawType(value)) + ".",
  8327. vm
  8328. );
  8329. }
  8330. }
  8331. /**
  8332. * Merge two option objects into a new one.
  8333. * Core utility used in both instantiation and inheritance.
  8334. */
  8335. function mergeOptions (
  8336. parent,
  8337. child,
  8338. vm
  8339. ) {
  8340. if (true) {
  8341. checkComponents(child);
  8342. }
  8343. if (typeof child === 'function') {
  8344. child = child.options;
  8345. }
  8346. normalizeProps(child, vm);
  8347. normalizeInject(child, vm);
  8348. normalizeDirectives(child);
  8349. // Apply extends and mixins on the child options,
  8350. // but only if it is a raw options object that isn't
  8351. // the result of another mergeOptions call.
  8352. // Only merged options has the _base property.
  8353. if (!child._base) {
  8354. if (child.extends) {
  8355. parent = mergeOptions(parent, child.extends, vm);
  8356. }
  8357. if (child.mixins) {
  8358. for (var i = 0, l = child.mixins.length; i < l; i++) {
  8359. parent = mergeOptions(parent, child.mixins[i], vm);
  8360. }
  8361. }
  8362. }
  8363. var options = {};
  8364. var key;
  8365. for (key in parent) {
  8366. mergeField(key);
  8367. }
  8368. for (key in child) {
  8369. if (!hasOwn(parent, key)) {
  8370. mergeField(key);
  8371. }
  8372. }
  8373. function mergeField (key) {
  8374. var strat = strats[key] || defaultStrat;
  8375. options[key] = strat(parent[key], child[key], vm, key);
  8376. }
  8377. return options
  8378. }
  8379. /**
  8380. * Resolve an asset.
  8381. * This function is used because child instances need access
  8382. * to assets defined in its ancestor chain.
  8383. */
  8384. function resolveAsset (
  8385. options,
  8386. type,
  8387. id,
  8388. warnMissing
  8389. ) {
  8390. /* istanbul ignore if */
  8391. if (typeof id !== 'string') {
  8392. return
  8393. }
  8394. var assets = options[type];
  8395. // check local registration variations first
  8396. if (hasOwn(assets, id)) { return assets[id] }
  8397. var camelizedId = camelize(id);
  8398. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  8399. var PascalCaseId = capitalize(camelizedId);
  8400. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  8401. // fallback to prototype chain
  8402. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  8403. if ( true && warnMissing && !res) {
  8404. warn(
  8405. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  8406. options
  8407. );
  8408. }
  8409. return res
  8410. }
  8411. /* */
  8412. function validateProp (
  8413. key,
  8414. propOptions,
  8415. propsData,
  8416. vm
  8417. ) {
  8418. var prop = propOptions[key];
  8419. var absent = !hasOwn(propsData, key);
  8420. var value = propsData[key];
  8421. // boolean casting
  8422. var booleanIndex = getTypeIndex(Boolean, prop.type);
  8423. if (booleanIndex > -1) {
  8424. if (absent && !hasOwn(prop, 'default')) {
  8425. value = false;
  8426. } else if (value === '' || value === hyphenate(key)) {
  8427. // only cast empty string / same name to boolean if
  8428. // boolean has higher priority
  8429. var stringIndex = getTypeIndex(String, prop.type);
  8430. if (stringIndex < 0 || booleanIndex < stringIndex) {
  8431. value = true;
  8432. }
  8433. }
  8434. }
  8435. // check default value
  8436. if (value === undefined) {
  8437. value = getPropDefaultValue(vm, prop, key);
  8438. // since the default value is a fresh copy,
  8439. // make sure to observe it.
  8440. var prevShouldObserve = shouldObserve;
  8441. toggleObserving(true);
  8442. observe(value);
  8443. toggleObserving(prevShouldObserve);
  8444. }
  8445. if (
  8446. true
  8447. ) {
  8448. assertProp(prop, key, value, vm, absent);
  8449. }
  8450. return value
  8451. }
  8452. /**
  8453. * Get the default value of a prop.
  8454. */
  8455. function getPropDefaultValue (vm, prop, key) {
  8456. // no default, return undefined
  8457. if (!hasOwn(prop, 'default')) {
  8458. return undefined
  8459. }
  8460. var def = prop.default;
  8461. // warn against non-factory defaults for Object & Array
  8462. if ( true && isObject(def)) {
  8463. warn(
  8464. 'Invalid default value for prop "' + key + '": ' +
  8465. 'Props with type Object/Array must use a factory function ' +
  8466. 'to return the default value.',
  8467. vm
  8468. );
  8469. }
  8470. // the raw prop value was also undefined from previous render,
  8471. // return previous default value to avoid unnecessary watcher trigger
  8472. if (vm && vm.$options.propsData &&
  8473. vm.$options.propsData[key] === undefined &&
  8474. vm._props[key] !== undefined
  8475. ) {
  8476. return vm._props[key]
  8477. }
  8478. // call factory function for non-Function types
  8479. // a value is Function if its prototype is function even across different execution context
  8480. return typeof def === 'function' && getType(prop.type) !== 'Function'
  8481. ? def.call(vm)
  8482. : def
  8483. }
  8484. /**
  8485. * Assert whether a prop is valid.
  8486. */
  8487. function assertProp (
  8488. prop,
  8489. name,
  8490. value,
  8491. vm,
  8492. absent
  8493. ) {
  8494. if (prop.required && absent) {
  8495. warn(
  8496. 'Missing required prop: "' + name + '"',
  8497. vm
  8498. );
  8499. return
  8500. }
  8501. if (value == null && !prop.required) {
  8502. return
  8503. }
  8504. var type = prop.type;
  8505. var valid = !type || type === true;
  8506. var expectedTypes = [];
  8507. if (type) {
  8508. if (!Array.isArray(type)) {
  8509. type = [type];
  8510. }
  8511. for (var i = 0; i < type.length && !valid; i++) {
  8512. var assertedType = assertType(value, type[i]);
  8513. expectedTypes.push(assertedType.expectedType || '');
  8514. valid = assertedType.valid;
  8515. }
  8516. }
  8517. if (!valid) {
  8518. warn(
  8519. getInvalidTypeMessage(name, value, expectedTypes),
  8520. vm
  8521. );
  8522. return
  8523. }
  8524. var validator = prop.validator;
  8525. if (validator) {
  8526. if (!validator(value)) {
  8527. warn(
  8528. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  8529. vm
  8530. );
  8531. }
  8532. }
  8533. }
  8534. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  8535. function assertType (value, type) {
  8536. var valid;
  8537. var expectedType = getType(type);
  8538. if (simpleCheckRE.test(expectedType)) {
  8539. var t = typeof value;
  8540. valid = t === expectedType.toLowerCase();
  8541. // for primitive wrapper objects
  8542. if (!valid && t === 'object') {
  8543. valid = value instanceof type;
  8544. }
  8545. } else if (expectedType === 'Object') {
  8546. valid = isPlainObject(value);
  8547. } else if (expectedType === 'Array') {
  8548. valid = Array.isArray(value);
  8549. } else {
  8550. valid = value instanceof type;
  8551. }
  8552. return {
  8553. valid: valid,
  8554. expectedType: expectedType
  8555. }
  8556. }
  8557. /**
  8558. * Use function string name to check built-in types,
  8559. * because a simple equality check will fail when running
  8560. * across different vms / iframes.
  8561. */
  8562. function getType (fn) {
  8563. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  8564. return match ? match[1] : ''
  8565. }
  8566. function isSameType (a, b) {
  8567. return getType(a) === getType(b)
  8568. }
  8569. function getTypeIndex (type, expectedTypes) {
  8570. if (!Array.isArray(expectedTypes)) {
  8571. return isSameType(expectedTypes, type) ? 0 : -1
  8572. }
  8573. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  8574. if (isSameType(expectedTypes[i], type)) {
  8575. return i
  8576. }
  8577. }
  8578. return -1
  8579. }
  8580. function getInvalidTypeMessage (name, value, expectedTypes) {
  8581. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  8582. " Expected " + (expectedTypes.map(capitalize).join(', '));
  8583. var expectedType = expectedTypes[0];
  8584. var receivedType = toRawType(value);
  8585. var expectedValue = styleValue(value, expectedType);
  8586. var receivedValue = styleValue(value, receivedType);
  8587. // check if we need to specify expected value
  8588. if (expectedTypes.length === 1 &&
  8589. isExplicable(expectedType) &&
  8590. !isBoolean(expectedType, receivedType)) {
  8591. message += " with value " + expectedValue;
  8592. }
  8593. message += ", got " + receivedType + " ";
  8594. // check if we need to specify received value
  8595. if (isExplicable(receivedType)) {
  8596. message += "with value " + receivedValue + ".";
  8597. }
  8598. return message
  8599. }
  8600. function styleValue (value, type) {
  8601. if (type === 'String') {
  8602. return ("\"" + value + "\"")
  8603. } else if (type === 'Number') {
  8604. return ("" + (Number(value)))
  8605. } else {
  8606. return ("" + value)
  8607. }
  8608. }
  8609. function isExplicable (value) {
  8610. var explicitTypes = ['string', 'number', 'boolean'];
  8611. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  8612. }
  8613. function isBoolean () {
  8614. var args = [], len = arguments.length;
  8615. while ( len-- ) args[ len ] = arguments[ len ];
  8616. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  8617. }
  8618. /* */
  8619. function handleError (err, vm, info) {
  8620. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  8621. // See: https://github.com/vuejs/vuex/issues/1505
  8622. pushTarget();
  8623. try {
  8624. if (vm) {
  8625. var cur = vm;
  8626. while ((cur = cur.$parent)) {
  8627. var hooks = cur.$options.errorCaptured;
  8628. if (hooks) {
  8629. for (var i = 0; i < hooks.length; i++) {
  8630. try {
  8631. var capture = hooks[i].call(cur, err, vm, info) === false;
  8632. if (capture) { return }
  8633. } catch (e) {
  8634. globalHandleError(e, cur, 'errorCaptured hook');
  8635. }
  8636. }
  8637. }
  8638. }
  8639. }
  8640. globalHandleError(err, vm, info);
  8641. } finally {
  8642. popTarget();
  8643. }
  8644. }
  8645. function invokeWithErrorHandling (
  8646. handler,
  8647. context,
  8648. args,
  8649. vm,
  8650. info
  8651. ) {
  8652. var res;
  8653. try {
  8654. res = args ? handler.apply(context, args) : handler.call(context);
  8655. if (res && !res._isVue && isPromise(res) && !res._handled) {
  8656. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  8657. // issue #9511
  8658. // avoid catch triggering multiple times when nested calls
  8659. res._handled = true;
  8660. }
  8661. } catch (e) {
  8662. handleError(e, vm, info);
  8663. }
  8664. return res
  8665. }
  8666. function globalHandleError (err, vm, info) {
  8667. if (config.errorHandler) {
  8668. try {
  8669. return config.errorHandler.call(null, err, vm, info)
  8670. } catch (e) {
  8671. // if the user intentionally throws the original error in the handler,
  8672. // do not log it twice
  8673. if (e !== err) {
  8674. logError(e, null, 'config.errorHandler');
  8675. }
  8676. }
  8677. }
  8678. logError(err, vm, info);
  8679. }
  8680. function logError (err, vm, info) {
  8681. if (true) {
  8682. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8683. }
  8684. /* istanbul ignore else */
  8685. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  8686. console.error(err);
  8687. } else {
  8688. throw err
  8689. }
  8690. }
  8691. /* */
  8692. var callbacks = [];
  8693. var pending = false;
  8694. function flushCallbacks () {
  8695. pending = false;
  8696. var copies = callbacks.slice(0);
  8697. callbacks.length = 0;
  8698. for (var i = 0; i < copies.length; i++) {
  8699. copies[i]();
  8700. }
  8701. }
  8702. // Here we have async deferring wrappers using microtasks.
  8703. // In 2.5 we used (macro) tasks (in combination with microtasks).
  8704. // However, it has subtle problems when state is changed right before repaint
  8705. // (e.g. #6813, out-in transitions).
  8706. // Also, using (macro) tasks in event handler would cause some weird behaviors
  8707. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  8708. // So we now use microtasks everywhere, again.
  8709. // A major drawback of this tradeoff is that there are some scenarios
  8710. // where microtasks have too high a priority and fire in between supposedly
  8711. // sequential events (e.g. #4521, #6690, which have workarounds)
  8712. // or even between bubbling of the same event (#6566).
  8713. var timerFunc;
  8714. // The nextTick behavior leverages the microtask queue, which can be accessed
  8715. // via either native Promise.then or MutationObserver.
  8716. // MutationObserver has wider support, however it is seriously bugged in
  8717. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  8718. // completely stops working after triggering a few times... so, if native
  8719. // Promise is available, we will use it:
  8720. /* istanbul ignore next, $flow-disable-line */
  8721. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  8722. var p = Promise.resolve();
  8723. timerFunc = function () {
  8724. p.then(flushCallbacks);
  8725. // In problematic UIWebViews, Promise.then doesn't completely break, but
  8726. // it can get stuck in a weird state where callbacks are pushed into the
  8727. // microtask queue but the queue isn't being flushed, until the browser
  8728. // needs to do some other work, e.g. handle a timer. Therefore we can
  8729. // "force" the microtask queue to be flushed by adding an empty timer.
  8730. if (isIOS) { setTimeout(noop); }
  8731. };
  8732. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  8733. isNative(MutationObserver) ||
  8734. // PhantomJS and iOS 7.x
  8735. MutationObserver.toString() === '[object MutationObserverConstructor]'
  8736. )) {
  8737. // Use MutationObserver where native Promise is not available,
  8738. // e.g. PhantomJS, iOS7, Android 4.4
  8739. // (#6466 MutationObserver is unreliable in IE11)
  8740. var counter = 1;
  8741. var observer = new MutationObserver(flushCallbacks);
  8742. var textNode = document.createTextNode(String(counter));
  8743. observer.observe(textNode, {
  8744. characterData: true
  8745. });
  8746. timerFunc = function () {
  8747. counter = (counter + 1) % 2;
  8748. textNode.data = String(counter);
  8749. };
  8750. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  8751. // Fallback to setImmediate.
  8752. // Technically it leverages the (macro) task queue,
  8753. // but it is still a better choice than setTimeout.
  8754. timerFunc = function () {
  8755. setImmediate(flushCallbacks);
  8756. };
  8757. } else {
  8758. // Fallback to setTimeout.
  8759. timerFunc = function () {
  8760. setTimeout(flushCallbacks, 0);
  8761. };
  8762. }
  8763. function nextTick (cb, ctx) {
  8764. var _resolve;
  8765. callbacks.push(function () {
  8766. if (cb) {
  8767. try {
  8768. cb.call(ctx);
  8769. } catch (e) {
  8770. handleError(e, ctx, 'nextTick');
  8771. }
  8772. } else if (_resolve) {
  8773. _resolve(ctx);
  8774. }
  8775. });
  8776. if (!pending) {
  8777. pending = true;
  8778. timerFunc();
  8779. }
  8780. // $flow-disable-line
  8781. if (!cb && typeof Promise !== 'undefined') {
  8782. return new Promise(function (resolve) {
  8783. _resolve = resolve;
  8784. })
  8785. }
  8786. }
  8787. /* */
  8788. /* not type checking this file because flow doesn't play well with Proxy */
  8789. var initProxy;
  8790. if (true) {
  8791. var allowedGlobals = makeMap(
  8792. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  8793. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  8794. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  8795. 'require' // for Webpack/Browserify
  8796. );
  8797. var warnNonPresent = function (target, key) {
  8798. warn(
  8799. "Property or method \"" + key + "\" is not defined on the instance but " +
  8800. 'referenced during render. Make sure that this property is reactive, ' +
  8801. 'either in the data option, or for class-based components, by ' +
  8802. 'initializing the property. ' +
  8803. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  8804. target
  8805. );
  8806. };
  8807. var warnReservedPrefix = function (target, key) {
  8808. warn(
  8809. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  8810. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  8811. 'prevent conflicts with Vue internals. ' +
  8812. 'See: https://vuejs.org/v2/api/#data',
  8813. target
  8814. );
  8815. };
  8816. var hasProxy =
  8817. typeof Proxy !== 'undefined' && isNative(Proxy);
  8818. if (hasProxy) {
  8819. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  8820. config.keyCodes = new Proxy(config.keyCodes, {
  8821. set: function set (target, key, value) {
  8822. if (isBuiltInModifier(key)) {
  8823. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  8824. return false
  8825. } else {
  8826. target[key] = value;
  8827. return true
  8828. }
  8829. }
  8830. });
  8831. }
  8832. var hasHandler = {
  8833. has: function has (target, key) {
  8834. var has = key in target;
  8835. var isAllowed = allowedGlobals(key) ||
  8836. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  8837. if (!has && !isAllowed) {
  8838. if (key in target.$data) { warnReservedPrefix(target, key); }
  8839. else { warnNonPresent(target, key); }
  8840. }
  8841. return has || !isAllowed
  8842. }
  8843. };
  8844. var getHandler = {
  8845. get: function get (target, key) {
  8846. if (typeof key === 'string' && !(key in target)) {
  8847. if (key in target.$data) { warnReservedPrefix(target, key); }
  8848. else { warnNonPresent(target, key); }
  8849. }
  8850. return target[key]
  8851. }
  8852. };
  8853. initProxy = function initProxy (vm) {
  8854. if (hasProxy) {
  8855. // determine which proxy handler to use
  8856. var options = vm.$options;
  8857. var handlers = options.render && options.render._withStripped
  8858. ? getHandler
  8859. : hasHandler;
  8860. vm._renderProxy = new Proxy(vm, handlers);
  8861. } else {
  8862. vm._renderProxy = vm;
  8863. }
  8864. };
  8865. }
  8866. /* */
  8867. var seenObjects = new _Set();
  8868. /**
  8869. * Recursively traverse an object to evoke all converted
  8870. * getters, so that every nested property inside the object
  8871. * is collected as a "deep" dependency.
  8872. */
  8873. function traverse (val) {
  8874. _traverse(val, seenObjects);
  8875. seenObjects.clear();
  8876. }
  8877. function _traverse (val, seen) {
  8878. var i, keys;
  8879. var isA = Array.isArray(val);
  8880. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  8881. return
  8882. }
  8883. if (val.__ob__) {
  8884. var depId = val.__ob__.dep.id;
  8885. if (seen.has(depId)) {
  8886. return
  8887. }
  8888. seen.add(depId);
  8889. }
  8890. if (isA) {
  8891. i = val.length;
  8892. while (i--) { _traverse(val[i], seen); }
  8893. } else {
  8894. keys = Object.keys(val);
  8895. i = keys.length;
  8896. while (i--) { _traverse(val[keys[i]], seen); }
  8897. }
  8898. }
  8899. var mark;
  8900. var measure;
  8901. if (true) {
  8902. var perf = inBrowser && window.performance;
  8903. /* istanbul ignore if */
  8904. if (
  8905. perf &&
  8906. perf.mark &&
  8907. perf.measure &&
  8908. perf.clearMarks &&
  8909. perf.clearMeasures
  8910. ) {
  8911. mark = function (tag) { return perf.mark(tag); };
  8912. measure = function (name, startTag, endTag) {
  8913. perf.measure(name, startTag, endTag);
  8914. perf.clearMarks(startTag);
  8915. perf.clearMarks(endTag);
  8916. // perf.clearMeasures(name)
  8917. };
  8918. }
  8919. }
  8920. /* */
  8921. var normalizeEvent = cached(function (name) {
  8922. var passive = name.charAt(0) === '&';
  8923. name = passive ? name.slice(1) : name;
  8924. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  8925. name = once$$1 ? name.slice(1) : name;
  8926. var capture = name.charAt(0) === '!';
  8927. name = capture ? name.slice(1) : name;
  8928. return {
  8929. name: name,
  8930. once: once$$1,
  8931. capture: capture,
  8932. passive: passive
  8933. }
  8934. });
  8935. function createFnInvoker (fns, vm) {
  8936. function invoker () {
  8937. var arguments$1 = arguments;
  8938. var fns = invoker.fns;
  8939. if (Array.isArray(fns)) {
  8940. var cloned = fns.slice();
  8941. for (var i = 0; i < cloned.length; i++) {
  8942. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  8943. }
  8944. } else {
  8945. // return handler return value for single handlers
  8946. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  8947. }
  8948. }
  8949. invoker.fns = fns;
  8950. return invoker
  8951. }
  8952. function updateListeners (
  8953. on,
  8954. oldOn,
  8955. add,
  8956. remove$$1,
  8957. createOnceHandler,
  8958. vm
  8959. ) {
  8960. var name, def$$1, cur, old, event;
  8961. for (name in on) {
  8962. def$$1 = cur = on[name];
  8963. old = oldOn[name];
  8964. event = normalizeEvent(name);
  8965. if (isUndef(cur)) {
  8966. true && warn(
  8967. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  8968. vm
  8969. );
  8970. } else if (isUndef(old)) {
  8971. if (isUndef(cur.fns)) {
  8972. cur = on[name] = createFnInvoker(cur, vm);
  8973. }
  8974. if (isTrue(event.once)) {
  8975. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  8976. }
  8977. add(event.name, cur, event.capture, event.passive, event.params);
  8978. } else if (cur !== old) {
  8979. old.fns = cur;
  8980. on[name] = old;
  8981. }
  8982. }
  8983. for (name in oldOn) {
  8984. if (isUndef(on[name])) {
  8985. event = normalizeEvent(name);
  8986. remove$$1(event.name, oldOn[name], event.capture);
  8987. }
  8988. }
  8989. }
  8990. /* */
  8991. /* */
  8992. // fixed by xxxxxx (mp properties)
  8993. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  8994. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  8995. if (isUndef(propOptions)) {
  8996. return res
  8997. }
  8998. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  8999. var attrs = data.attrs;
  9000. var props = data.props;
  9001. if (isDef(attrs) || isDef(props)) {
  9002. for (var key in propOptions) {
  9003. var altKey = hyphenate(key);
  9004. var result = checkProp(res, props, key, altKey, true) ||
  9005. checkProp(res, attrs, key, altKey, false);
  9006. // externalClass
  9007. if (
  9008. result &&
  9009. res[key] &&
  9010. externalClasses.indexOf(altKey) !== -1 &&
  9011. context[camelize(res[key])]
  9012. ) {
  9013. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  9014. res[key] = context[camelize(res[key])];
  9015. }
  9016. }
  9017. }
  9018. return res
  9019. }
  9020. function extractPropsFromVNodeData (
  9021. data,
  9022. Ctor,
  9023. tag,
  9024. context// fixed by xxxxxx
  9025. ) {
  9026. // we are only extracting raw values here.
  9027. // validation and default values are handled in the child
  9028. // component itself.
  9029. var propOptions = Ctor.options.props;
  9030. if (isUndef(propOptions)) {
  9031. // fixed by xxxxxx
  9032. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  9033. }
  9034. var res = {};
  9035. var attrs = data.attrs;
  9036. var props = data.props;
  9037. if (isDef(attrs) || isDef(props)) {
  9038. for (var key in propOptions) {
  9039. var altKey = hyphenate(key);
  9040. if (true) {
  9041. var keyInLowerCase = key.toLowerCase();
  9042. if (
  9043. key !== keyInLowerCase &&
  9044. attrs && hasOwn(attrs, keyInLowerCase)
  9045. ) {
  9046. tip(
  9047. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  9048. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  9049. " \"" + key + "\". " +
  9050. "Note that HTML attributes are case-insensitive and camelCased " +
  9051. "props need to use their kebab-case equivalents when using in-DOM " +
  9052. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  9053. );
  9054. }
  9055. }
  9056. checkProp(res, props, key, altKey, true) ||
  9057. checkProp(res, attrs, key, altKey, false);
  9058. }
  9059. }
  9060. // fixed by xxxxxx
  9061. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  9062. }
  9063. function checkProp (
  9064. res,
  9065. hash,
  9066. key,
  9067. altKey,
  9068. preserve
  9069. ) {
  9070. if (isDef(hash)) {
  9071. if (hasOwn(hash, key)) {
  9072. res[key] = hash[key];
  9073. if (!preserve) {
  9074. delete hash[key];
  9075. }
  9076. return true
  9077. } else if (hasOwn(hash, altKey)) {
  9078. res[key] = hash[altKey];
  9079. if (!preserve) {
  9080. delete hash[altKey];
  9081. }
  9082. return true
  9083. }
  9084. }
  9085. return false
  9086. }
  9087. /* */
  9088. // The template compiler attempts to minimize the need for normalization by
  9089. // statically analyzing the template at compile time.
  9090. //
  9091. // For plain HTML markup, normalization can be completely skipped because the
  9092. // generated render function is guaranteed to return Array<VNode>. There are
  9093. // two cases where extra normalization is needed:
  9094. // 1. When the children contains components - because a functional component
  9095. // may return an Array instead of a single root. In this case, just a simple
  9096. // normalization is needed - if any child is an Array, we flatten the whole
  9097. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  9098. // because functional components already normalize their own children.
  9099. function simpleNormalizeChildren (children) {
  9100. for (var i = 0; i < children.length; i++) {
  9101. if (Array.isArray(children[i])) {
  9102. return Array.prototype.concat.apply([], children)
  9103. }
  9104. }
  9105. return children
  9106. }
  9107. // 2. When the children contains constructs that always generated nested Arrays,
  9108. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  9109. // with hand-written render functions / JSX. In such cases a full normalization
  9110. // is needed to cater to all possible types of children values.
  9111. function normalizeChildren (children) {
  9112. return isPrimitive(children)
  9113. ? [createTextVNode(children)]
  9114. : Array.isArray(children)
  9115. ? normalizeArrayChildren(children)
  9116. : undefined
  9117. }
  9118. function isTextNode (node) {
  9119. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  9120. }
  9121. function normalizeArrayChildren (children, nestedIndex) {
  9122. var res = [];
  9123. var i, c, lastIndex, last;
  9124. for (i = 0; i < children.length; i++) {
  9125. c = children[i];
  9126. if (isUndef(c) || typeof c === 'boolean') { continue }
  9127. lastIndex = res.length - 1;
  9128. last = res[lastIndex];
  9129. // nested
  9130. if (Array.isArray(c)) {
  9131. if (c.length > 0) {
  9132. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  9133. // merge adjacent text nodes
  9134. if (isTextNode(c[0]) && isTextNode(last)) {
  9135. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  9136. c.shift();
  9137. }
  9138. res.push.apply(res, c);
  9139. }
  9140. } else if (isPrimitive(c)) {
  9141. if (isTextNode(last)) {
  9142. // merge adjacent text nodes
  9143. // this is necessary for SSR hydration because text nodes are
  9144. // essentially merged when rendered to HTML strings
  9145. res[lastIndex] = createTextVNode(last.text + c);
  9146. } else if (c !== '') {
  9147. // convert primitive to vnode
  9148. res.push(createTextVNode(c));
  9149. }
  9150. } else {
  9151. if (isTextNode(c) && isTextNode(last)) {
  9152. // merge adjacent text nodes
  9153. res[lastIndex] = createTextVNode(last.text + c.text);
  9154. } else {
  9155. // default key for nested array children (likely generated by v-for)
  9156. if (isTrue(children._isVList) &&
  9157. isDef(c.tag) &&
  9158. isUndef(c.key) &&
  9159. isDef(nestedIndex)) {
  9160. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  9161. }
  9162. res.push(c);
  9163. }
  9164. }
  9165. }
  9166. return res
  9167. }
  9168. /* */
  9169. function initProvide (vm) {
  9170. var provide = vm.$options.provide;
  9171. if (provide) {
  9172. vm._provided = typeof provide === 'function'
  9173. ? provide.call(vm)
  9174. : provide;
  9175. }
  9176. }
  9177. function initInjections (vm) {
  9178. var result = resolveInject(vm.$options.inject, vm);
  9179. if (result) {
  9180. toggleObserving(false);
  9181. Object.keys(result).forEach(function (key) {
  9182. /* istanbul ignore else */
  9183. if (true) {
  9184. defineReactive$$1(vm, key, result[key], function () {
  9185. warn(
  9186. "Avoid mutating an injected value directly since the changes will be " +
  9187. "overwritten whenever the provided component re-renders. " +
  9188. "injection being mutated: \"" + key + "\"",
  9189. vm
  9190. );
  9191. });
  9192. } else {}
  9193. });
  9194. toggleObserving(true);
  9195. }
  9196. }
  9197. function resolveInject (inject, vm) {
  9198. if (inject) {
  9199. // inject is :any because flow is not smart enough to figure out cached
  9200. var result = Object.create(null);
  9201. var keys = hasSymbol
  9202. ? Reflect.ownKeys(inject)
  9203. : Object.keys(inject);
  9204. for (var i = 0; i < keys.length; i++) {
  9205. var key = keys[i];
  9206. // #6574 in case the inject object is observed...
  9207. if (key === '__ob__') { continue }
  9208. var provideKey = inject[key].from;
  9209. var source = vm;
  9210. while (source) {
  9211. if (source._provided && hasOwn(source._provided, provideKey)) {
  9212. result[key] = source._provided[provideKey];
  9213. break
  9214. }
  9215. source = source.$parent;
  9216. }
  9217. if (!source) {
  9218. if ('default' in inject[key]) {
  9219. var provideDefault = inject[key].default;
  9220. result[key] = typeof provideDefault === 'function'
  9221. ? provideDefault.call(vm)
  9222. : provideDefault;
  9223. } else if (true) {
  9224. warn(("Injection \"" + key + "\" not found"), vm);
  9225. }
  9226. }
  9227. }
  9228. return result
  9229. }
  9230. }
  9231. /* */
  9232. /**
  9233. * Runtime helper for resolving raw children VNodes into a slot object.
  9234. */
  9235. function resolveSlots (
  9236. children,
  9237. context
  9238. ) {
  9239. if (!children || !children.length) {
  9240. return {}
  9241. }
  9242. var slots = {};
  9243. for (var i = 0, l = children.length; i < l; i++) {
  9244. var child = children[i];
  9245. var data = child.data;
  9246. // remove slot attribute if the node is resolved as a Vue slot node
  9247. if (data && data.attrs && data.attrs.slot) {
  9248. delete data.attrs.slot;
  9249. }
  9250. // named slots should only be respected if the vnode was rendered in the
  9251. // same context.
  9252. if ((child.context === context || child.fnContext === context) &&
  9253. data && data.slot != null
  9254. ) {
  9255. var name = data.slot;
  9256. var slot = (slots[name] || (slots[name] = []));
  9257. if (child.tag === 'template') {
  9258. slot.push.apply(slot, child.children || []);
  9259. } else {
  9260. slot.push(child);
  9261. }
  9262. } else {
  9263. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  9264. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  9265. (slots['page'] || (slots['page'] = [])).push(child);
  9266. }else{
  9267. (slots.default || (slots.default = [])).push(child);
  9268. }
  9269. }
  9270. }
  9271. // ignore slots that contains only whitespace
  9272. for (var name$1 in slots) {
  9273. if (slots[name$1].every(isWhitespace)) {
  9274. delete slots[name$1];
  9275. }
  9276. }
  9277. return slots
  9278. }
  9279. function isWhitespace (node) {
  9280. return (node.isComment && !node.asyncFactory) || node.text === ' '
  9281. }
  9282. /* */
  9283. function normalizeScopedSlots (
  9284. slots,
  9285. normalSlots,
  9286. prevSlots
  9287. ) {
  9288. var res;
  9289. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  9290. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  9291. var key = slots && slots.$key;
  9292. if (!slots) {
  9293. res = {};
  9294. } else if (slots._normalized) {
  9295. // fast path 1: child component re-render only, parent did not change
  9296. return slots._normalized
  9297. } else if (
  9298. isStable &&
  9299. prevSlots &&
  9300. prevSlots !== emptyObject &&
  9301. key === prevSlots.$key &&
  9302. !hasNormalSlots &&
  9303. !prevSlots.$hasNormal
  9304. ) {
  9305. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  9306. // only need to normalize once
  9307. return prevSlots
  9308. } else {
  9309. res = {};
  9310. for (var key$1 in slots) {
  9311. if (slots[key$1] && key$1[0] !== '$') {
  9312. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  9313. }
  9314. }
  9315. }
  9316. // expose normal slots on scopedSlots
  9317. for (var key$2 in normalSlots) {
  9318. if (!(key$2 in res)) {
  9319. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  9320. }
  9321. }
  9322. // avoriaz seems to mock a non-extensible $scopedSlots object
  9323. // and when that is passed down this would cause an error
  9324. if (slots && Object.isExtensible(slots)) {
  9325. (slots)._normalized = res;
  9326. }
  9327. def(res, '$stable', isStable);
  9328. def(res, '$key', key);
  9329. def(res, '$hasNormal', hasNormalSlots);
  9330. return res
  9331. }
  9332. function normalizeScopedSlot(normalSlots, key, fn) {
  9333. var normalized = function () {
  9334. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  9335. res = res && typeof res === 'object' && !Array.isArray(res)
  9336. ? [res] // single vnode
  9337. : normalizeChildren(res);
  9338. return res && (
  9339. res.length === 0 ||
  9340. (res.length === 1 && res[0].isComment) // #9658
  9341. ) ? undefined
  9342. : res
  9343. };
  9344. // this is a slot using the new v-slot syntax without scope. although it is
  9345. // compiled as a scoped slot, render fn users would expect it to be present
  9346. // on this.$slots because the usage is semantically a normal slot.
  9347. if (fn.proxy) {
  9348. Object.defineProperty(normalSlots, key, {
  9349. get: normalized,
  9350. enumerable: true,
  9351. configurable: true
  9352. });
  9353. }
  9354. return normalized
  9355. }
  9356. function proxyNormalSlot(slots, key) {
  9357. return function () { return slots[key]; }
  9358. }
  9359. /* */
  9360. /**
  9361. * Runtime helper for rendering v-for lists.
  9362. */
  9363. function renderList (
  9364. val,
  9365. render
  9366. ) {
  9367. var ret, i, l, keys, key;
  9368. if (Array.isArray(val) || typeof val === 'string') {
  9369. ret = new Array(val.length);
  9370. for (i = 0, l = val.length; i < l; i++) {
  9371. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  9372. }
  9373. } else if (typeof val === 'number') {
  9374. ret = new Array(val);
  9375. for (i = 0; i < val; i++) {
  9376. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  9377. }
  9378. } else if (isObject(val)) {
  9379. if (hasSymbol && val[Symbol.iterator]) {
  9380. ret = [];
  9381. var iterator = val[Symbol.iterator]();
  9382. var result = iterator.next();
  9383. while (!result.done) {
  9384. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  9385. result = iterator.next();
  9386. }
  9387. } else {
  9388. keys = Object.keys(val);
  9389. ret = new Array(keys.length);
  9390. for (i = 0, l = keys.length; i < l; i++) {
  9391. key = keys[i];
  9392. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  9393. }
  9394. }
  9395. }
  9396. if (!isDef(ret)) {
  9397. ret = [];
  9398. }
  9399. (ret)._isVList = true;
  9400. return ret
  9401. }
  9402. /* */
  9403. /**
  9404. * Runtime helper for rendering <slot>
  9405. */
  9406. function renderSlot (
  9407. name,
  9408. fallback,
  9409. props,
  9410. bindObject
  9411. ) {
  9412. var scopedSlotFn = this.$scopedSlots[name];
  9413. var nodes;
  9414. if (scopedSlotFn) { // scoped slot
  9415. props = props || {};
  9416. if (bindObject) {
  9417. if ( true && !isObject(bindObject)) {
  9418. warn(
  9419. 'slot v-bind without argument expects an Object',
  9420. this
  9421. );
  9422. }
  9423. props = extend(extend({}, bindObject), props);
  9424. }
  9425. // fixed by xxxxxx app-plus scopedSlot
  9426. nodes = scopedSlotFn(props, this, props._i) || fallback;
  9427. } else {
  9428. nodes = this.$slots[name] || fallback;
  9429. }
  9430. var target = props && props.slot;
  9431. if (target) {
  9432. return this.$createElement('template', { slot: target }, nodes)
  9433. } else {
  9434. return nodes
  9435. }
  9436. }
  9437. /* */
  9438. /**
  9439. * Runtime helper for resolving filters
  9440. */
  9441. function resolveFilter (id) {
  9442. return resolveAsset(this.$options, 'filters', id, true) || identity
  9443. }
  9444. /* */
  9445. function isKeyNotMatch (expect, actual) {
  9446. if (Array.isArray(expect)) {
  9447. return expect.indexOf(actual) === -1
  9448. } else {
  9449. return expect !== actual
  9450. }
  9451. }
  9452. /**
  9453. * Runtime helper for checking keyCodes from config.
  9454. * exposed as Vue.prototype._k
  9455. * passing in eventKeyName as last argument separately for backwards compat
  9456. */
  9457. function checkKeyCodes (
  9458. eventKeyCode,
  9459. key,
  9460. builtInKeyCode,
  9461. eventKeyName,
  9462. builtInKeyName
  9463. ) {
  9464. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  9465. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  9466. return isKeyNotMatch(builtInKeyName, eventKeyName)
  9467. } else if (mappedKeyCode) {
  9468. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  9469. } else if (eventKeyName) {
  9470. return hyphenate(eventKeyName) !== key
  9471. }
  9472. }
  9473. /* */
  9474. /**
  9475. * Runtime helper for merging v-bind="object" into a VNode's data.
  9476. */
  9477. function bindObjectProps (
  9478. data,
  9479. tag,
  9480. value,
  9481. asProp,
  9482. isSync
  9483. ) {
  9484. if (value) {
  9485. if (!isObject(value)) {
  9486. true && warn(
  9487. 'v-bind without argument expects an Object or Array value',
  9488. this
  9489. );
  9490. } else {
  9491. if (Array.isArray(value)) {
  9492. value = toObject(value);
  9493. }
  9494. var hash;
  9495. var loop = function ( key ) {
  9496. if (
  9497. key === 'class' ||
  9498. key === 'style' ||
  9499. isReservedAttribute(key)
  9500. ) {
  9501. hash = data;
  9502. } else {
  9503. var type = data.attrs && data.attrs.type;
  9504. hash = asProp || config.mustUseProp(tag, type, key)
  9505. ? data.domProps || (data.domProps = {})
  9506. : data.attrs || (data.attrs = {});
  9507. }
  9508. var camelizedKey = camelize(key);
  9509. var hyphenatedKey = hyphenate(key);
  9510. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  9511. hash[key] = value[key];
  9512. if (isSync) {
  9513. var on = data.on || (data.on = {});
  9514. on[("update:" + key)] = function ($event) {
  9515. value[key] = $event;
  9516. };
  9517. }
  9518. }
  9519. };
  9520. for (var key in value) loop( key );
  9521. }
  9522. }
  9523. return data
  9524. }
  9525. /* */
  9526. /**
  9527. * Runtime helper for rendering static trees.
  9528. */
  9529. function renderStatic (
  9530. index,
  9531. isInFor
  9532. ) {
  9533. var cached = this._staticTrees || (this._staticTrees = []);
  9534. var tree = cached[index];
  9535. // if has already-rendered static tree and not inside v-for,
  9536. // we can reuse the same tree.
  9537. if (tree && !isInFor) {
  9538. return tree
  9539. }
  9540. // otherwise, render a fresh tree.
  9541. tree = cached[index] = this.$options.staticRenderFns[index].call(
  9542. this._renderProxy,
  9543. null,
  9544. this // for render fns generated for functional component templates
  9545. );
  9546. markStatic(tree, ("__static__" + index), false);
  9547. return tree
  9548. }
  9549. /**
  9550. * Runtime helper for v-once.
  9551. * Effectively it means marking the node as static with a unique key.
  9552. */
  9553. function markOnce (
  9554. tree,
  9555. index,
  9556. key
  9557. ) {
  9558. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  9559. return tree
  9560. }
  9561. function markStatic (
  9562. tree,
  9563. key,
  9564. isOnce
  9565. ) {
  9566. if (Array.isArray(tree)) {
  9567. for (var i = 0; i < tree.length; i++) {
  9568. if (tree[i] && typeof tree[i] !== 'string') {
  9569. markStaticNode(tree[i], (key + "_" + i), isOnce);
  9570. }
  9571. }
  9572. } else {
  9573. markStaticNode(tree, key, isOnce);
  9574. }
  9575. }
  9576. function markStaticNode (node, key, isOnce) {
  9577. node.isStatic = true;
  9578. node.key = key;
  9579. node.isOnce = isOnce;
  9580. }
  9581. /* */
  9582. function bindObjectListeners (data, value) {
  9583. if (value) {
  9584. if (!isPlainObject(value)) {
  9585. true && warn(
  9586. 'v-on without argument expects an Object value',
  9587. this
  9588. );
  9589. } else {
  9590. var on = data.on = data.on ? extend({}, data.on) : {};
  9591. for (var key in value) {
  9592. var existing = on[key];
  9593. var ours = value[key];
  9594. on[key] = existing ? [].concat(existing, ours) : ours;
  9595. }
  9596. }
  9597. }
  9598. return data
  9599. }
  9600. /* */
  9601. function resolveScopedSlots (
  9602. fns, // see flow/vnode
  9603. res,
  9604. // the following are added in 2.6
  9605. hasDynamicKeys,
  9606. contentHashKey
  9607. ) {
  9608. res = res || { $stable: !hasDynamicKeys };
  9609. for (var i = 0; i < fns.length; i++) {
  9610. var slot = fns[i];
  9611. if (Array.isArray(slot)) {
  9612. resolveScopedSlots(slot, res, hasDynamicKeys);
  9613. } else if (slot) {
  9614. // marker for reverse proxying v-slot without scope on this.$slots
  9615. if (slot.proxy) {
  9616. slot.fn.proxy = true;
  9617. }
  9618. res[slot.key] = slot.fn;
  9619. }
  9620. }
  9621. if (contentHashKey) {
  9622. (res).$key = contentHashKey;
  9623. }
  9624. return res
  9625. }
  9626. /* */
  9627. function bindDynamicKeys (baseObj, values) {
  9628. for (var i = 0; i < values.length; i += 2) {
  9629. var key = values[i];
  9630. if (typeof key === 'string' && key) {
  9631. baseObj[values[i]] = values[i + 1];
  9632. } else if ( true && key !== '' && key !== null) {
  9633. // null is a special value for explicitly removing a binding
  9634. warn(
  9635. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  9636. this
  9637. );
  9638. }
  9639. }
  9640. return baseObj
  9641. }
  9642. // helper to dynamically append modifier runtime markers to event names.
  9643. // ensure only append when value is already string, otherwise it will be cast
  9644. // to string and cause the type check to miss.
  9645. function prependModifier (value, symbol) {
  9646. return typeof value === 'string' ? symbol + value : value
  9647. }
  9648. /* */
  9649. function installRenderHelpers (target) {
  9650. target._o = markOnce;
  9651. target._n = toNumber;
  9652. target._s = toString;
  9653. target._l = renderList;
  9654. target._t = renderSlot;
  9655. target._q = looseEqual;
  9656. target._i = looseIndexOf;
  9657. target._m = renderStatic;
  9658. target._f = resolveFilter;
  9659. target._k = checkKeyCodes;
  9660. target._b = bindObjectProps;
  9661. target._v = createTextVNode;
  9662. target._e = createEmptyVNode;
  9663. target._u = resolveScopedSlots;
  9664. target._g = bindObjectListeners;
  9665. target._d = bindDynamicKeys;
  9666. target._p = prependModifier;
  9667. }
  9668. /* */
  9669. function FunctionalRenderContext (
  9670. data,
  9671. props,
  9672. children,
  9673. parent,
  9674. Ctor
  9675. ) {
  9676. var this$1 = this;
  9677. var options = Ctor.options;
  9678. // ensure the createElement function in functional components
  9679. // gets a unique context - this is necessary for correct named slot check
  9680. var contextVm;
  9681. if (hasOwn(parent, '_uid')) {
  9682. contextVm = Object.create(parent);
  9683. // $flow-disable-line
  9684. contextVm._original = parent;
  9685. } else {
  9686. // the context vm passed in is a functional context as well.
  9687. // in this case we want to make sure we are able to get a hold to the
  9688. // real context instance.
  9689. contextVm = parent;
  9690. // $flow-disable-line
  9691. parent = parent._original;
  9692. }
  9693. var isCompiled = isTrue(options._compiled);
  9694. var needNormalization = !isCompiled;
  9695. this.data = data;
  9696. this.props = props;
  9697. this.children = children;
  9698. this.parent = parent;
  9699. this.listeners = data.on || emptyObject;
  9700. this.injections = resolveInject(options.inject, parent);
  9701. this.slots = function () {
  9702. if (!this$1.$slots) {
  9703. normalizeScopedSlots(
  9704. data.scopedSlots,
  9705. this$1.$slots = resolveSlots(children, parent)
  9706. );
  9707. }
  9708. return this$1.$slots
  9709. };
  9710. Object.defineProperty(this, 'scopedSlots', ({
  9711. enumerable: true,
  9712. get: function get () {
  9713. return normalizeScopedSlots(data.scopedSlots, this.slots())
  9714. }
  9715. }));
  9716. // support for compiled functional template
  9717. if (isCompiled) {
  9718. // exposing $options for renderStatic()
  9719. this.$options = options;
  9720. // pre-resolve slots for renderSlot()
  9721. this.$slots = this.slots();
  9722. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  9723. }
  9724. if (options._scopeId) {
  9725. this._c = function (a, b, c, d) {
  9726. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  9727. if (vnode && !Array.isArray(vnode)) {
  9728. vnode.fnScopeId = options._scopeId;
  9729. vnode.fnContext = parent;
  9730. }
  9731. return vnode
  9732. };
  9733. } else {
  9734. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  9735. }
  9736. }
  9737. installRenderHelpers(FunctionalRenderContext.prototype);
  9738. function createFunctionalComponent (
  9739. Ctor,
  9740. propsData,
  9741. data,
  9742. contextVm,
  9743. children
  9744. ) {
  9745. var options = Ctor.options;
  9746. var props = {};
  9747. var propOptions = options.props;
  9748. if (isDef(propOptions)) {
  9749. for (var key in propOptions) {
  9750. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  9751. }
  9752. } else {
  9753. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  9754. if (isDef(data.props)) { mergeProps(props, data.props); }
  9755. }
  9756. var renderContext = new FunctionalRenderContext(
  9757. data,
  9758. props,
  9759. children,
  9760. contextVm,
  9761. Ctor
  9762. );
  9763. var vnode = options.render.call(null, renderContext._c, renderContext);
  9764. if (vnode instanceof VNode) {
  9765. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  9766. } else if (Array.isArray(vnode)) {
  9767. var vnodes = normalizeChildren(vnode) || [];
  9768. var res = new Array(vnodes.length);
  9769. for (var i = 0; i < vnodes.length; i++) {
  9770. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  9771. }
  9772. return res
  9773. }
  9774. }
  9775. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  9776. // #7817 clone node before setting fnContext, otherwise if the node is reused
  9777. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  9778. // that should not be matched to match.
  9779. var clone = cloneVNode(vnode);
  9780. clone.fnContext = contextVm;
  9781. clone.fnOptions = options;
  9782. if (true) {
  9783. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  9784. }
  9785. if (data.slot) {
  9786. (clone.data || (clone.data = {})).slot = data.slot;
  9787. }
  9788. return clone
  9789. }
  9790. function mergeProps (to, from) {
  9791. for (var key in from) {
  9792. to[camelize(key)] = from[key];
  9793. }
  9794. }
  9795. /* */
  9796. /* */
  9797. /* */
  9798. /* */
  9799. // inline hooks to be invoked on component VNodes during patch
  9800. var componentVNodeHooks = {
  9801. init: function init (vnode, hydrating) {
  9802. if (
  9803. vnode.componentInstance &&
  9804. !vnode.componentInstance._isDestroyed &&
  9805. vnode.data.keepAlive
  9806. ) {
  9807. // kept-alive components, treat as a patch
  9808. var mountedNode = vnode; // work around flow
  9809. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  9810. } else {
  9811. var child = vnode.componentInstance = createComponentInstanceForVnode(
  9812. vnode,
  9813. activeInstance
  9814. );
  9815. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  9816. }
  9817. },
  9818. prepatch: function prepatch (oldVnode, vnode) {
  9819. var options = vnode.componentOptions;
  9820. var child = vnode.componentInstance = oldVnode.componentInstance;
  9821. updateChildComponent(
  9822. child,
  9823. options.propsData, // updated props
  9824. options.listeners, // updated listeners
  9825. vnode, // new parent vnode
  9826. options.children // new children
  9827. );
  9828. },
  9829. insert: function insert (vnode) {
  9830. var context = vnode.context;
  9831. var componentInstance = vnode.componentInstance;
  9832. if (!componentInstance._isMounted) {
  9833. callHook(componentInstance, 'onServiceCreated');
  9834. callHook(componentInstance, 'onServiceAttached');
  9835. componentInstance._isMounted = true;
  9836. callHook(componentInstance, 'mounted');
  9837. }
  9838. if (vnode.data.keepAlive) {
  9839. if (context._isMounted) {
  9840. // vue-router#1212
  9841. // During updates, a kept-alive component's child components may
  9842. // change, so directly walking the tree here may call activated hooks
  9843. // on incorrect children. Instead we push them into a queue which will
  9844. // be processed after the whole patch process ended.
  9845. queueActivatedComponent(componentInstance);
  9846. } else {
  9847. activateChildComponent(componentInstance, true /* direct */);
  9848. }
  9849. }
  9850. },
  9851. destroy: function destroy (vnode) {
  9852. var componentInstance = vnode.componentInstance;
  9853. if (!componentInstance._isDestroyed) {
  9854. if (!vnode.data.keepAlive) {
  9855. componentInstance.$destroy();
  9856. } else {
  9857. deactivateChildComponent(componentInstance, true /* direct */);
  9858. }
  9859. }
  9860. }
  9861. };
  9862. var hooksToMerge = Object.keys(componentVNodeHooks);
  9863. function createComponent (
  9864. Ctor,
  9865. data,
  9866. context,
  9867. children,
  9868. tag
  9869. ) {
  9870. if (isUndef(Ctor)) {
  9871. return
  9872. }
  9873. var baseCtor = context.$options._base;
  9874. // plain options object: turn it into a constructor
  9875. if (isObject(Ctor)) {
  9876. Ctor = baseCtor.extend(Ctor);
  9877. }
  9878. // if at this stage it's not a constructor or an async component factory,
  9879. // reject.
  9880. if (typeof Ctor !== 'function') {
  9881. if (true) {
  9882. warn(("Invalid Component definition: " + (String(Ctor))), context);
  9883. }
  9884. return
  9885. }
  9886. // async component
  9887. var asyncFactory;
  9888. if (isUndef(Ctor.cid)) {
  9889. asyncFactory = Ctor;
  9890. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  9891. if (Ctor === undefined) {
  9892. // return a placeholder node for async component, which is rendered
  9893. // as a comment node but preserves all the raw information for the node.
  9894. // the information will be used for async server-rendering and hydration.
  9895. return createAsyncPlaceholder(
  9896. asyncFactory,
  9897. data,
  9898. context,
  9899. children,
  9900. tag
  9901. )
  9902. }
  9903. }
  9904. data = data || {};
  9905. // resolve constructor options in case global mixins are applied after
  9906. // component constructor creation
  9907. resolveConstructorOptions(Ctor);
  9908. // transform component v-model data into props & events
  9909. if (isDef(data.model)) {
  9910. transformModel(Ctor.options, data);
  9911. }
  9912. // extract props
  9913. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  9914. // functional component
  9915. if (isTrue(Ctor.options.functional)) {
  9916. return createFunctionalComponent(Ctor, propsData, data, context, children)
  9917. }
  9918. // extract listeners, since these needs to be treated as
  9919. // child component listeners instead of DOM listeners
  9920. var listeners = data.on;
  9921. // replace with listeners with .native modifier
  9922. // so it gets processed during parent component patch.
  9923. data.on = data.nativeOn;
  9924. if (isTrue(Ctor.options.abstract)) {
  9925. // abstract components do not keep anything
  9926. // other than props & listeners & slot
  9927. // work around flow
  9928. var slot = data.slot;
  9929. data = {};
  9930. if (slot) {
  9931. data.slot = slot;
  9932. }
  9933. }
  9934. // install component management hooks onto the placeholder node
  9935. installComponentHooks(data);
  9936. // return a placeholder vnode
  9937. var name = Ctor.options.name || tag;
  9938. var vnode = new VNode(
  9939. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  9940. data, undefined, undefined, undefined, context,
  9941. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  9942. asyncFactory
  9943. );
  9944. return vnode
  9945. }
  9946. function createComponentInstanceForVnode (
  9947. vnode, // we know it's MountedComponentVNode but flow doesn't
  9948. parent // activeInstance in lifecycle state
  9949. ) {
  9950. var options = {
  9951. _isComponent: true,
  9952. _parentVnode: vnode,
  9953. parent: parent
  9954. };
  9955. // check inline-template render functions
  9956. var inlineTemplate = vnode.data.inlineTemplate;
  9957. if (isDef(inlineTemplate)) {
  9958. options.render = inlineTemplate.render;
  9959. options.staticRenderFns = inlineTemplate.staticRenderFns;
  9960. }
  9961. return new vnode.componentOptions.Ctor(options)
  9962. }
  9963. function installComponentHooks (data) {
  9964. var hooks = data.hook || (data.hook = {});
  9965. for (var i = 0; i < hooksToMerge.length; i++) {
  9966. var key = hooksToMerge[i];
  9967. var existing = hooks[key];
  9968. var toMerge = componentVNodeHooks[key];
  9969. if (existing !== toMerge && !(existing && existing._merged)) {
  9970. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  9971. }
  9972. }
  9973. }
  9974. function mergeHook$1 (f1, f2) {
  9975. var merged = function (a, b) {
  9976. // flow complains about extra args which is why we use any
  9977. f1(a, b);
  9978. f2(a, b);
  9979. };
  9980. merged._merged = true;
  9981. return merged
  9982. }
  9983. // transform component v-model info (value and callback) into
  9984. // prop and event handler respectively.
  9985. function transformModel (options, data) {
  9986. var prop = (options.model && options.model.prop) || 'value';
  9987. var event = (options.model && options.model.event) || 'input'
  9988. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  9989. var on = data.on || (data.on = {});
  9990. var existing = on[event];
  9991. var callback = data.model.callback;
  9992. if (isDef(existing)) {
  9993. if (
  9994. Array.isArray(existing)
  9995. ? existing.indexOf(callback) === -1
  9996. : existing !== callback
  9997. ) {
  9998. on[event] = [callback].concat(existing);
  9999. }
  10000. } else {
  10001. on[event] = callback;
  10002. }
  10003. }
  10004. /* */
  10005. var SIMPLE_NORMALIZE = 1;
  10006. var ALWAYS_NORMALIZE = 2;
  10007. // wrapper function for providing a more flexible interface
  10008. // without getting yelled at by flow
  10009. function createElement (
  10010. context,
  10011. tag,
  10012. data,
  10013. children,
  10014. normalizationType,
  10015. alwaysNormalize
  10016. ) {
  10017. if (Array.isArray(data) || isPrimitive(data)) {
  10018. normalizationType = children;
  10019. children = data;
  10020. data = undefined;
  10021. }
  10022. if (isTrue(alwaysNormalize)) {
  10023. normalizationType = ALWAYS_NORMALIZE;
  10024. }
  10025. return _createElement(context, tag, data, children, normalizationType)
  10026. }
  10027. function _createElement (
  10028. context,
  10029. tag,
  10030. data,
  10031. children,
  10032. normalizationType
  10033. ) {
  10034. if (isDef(data) && isDef((data).__ob__)) {
  10035. true && warn(
  10036. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  10037. 'Always create fresh vnode data objects in each render!',
  10038. context
  10039. );
  10040. return createEmptyVNode()
  10041. }
  10042. // object syntax in v-bind
  10043. if (isDef(data) && isDef(data.is)) {
  10044. tag = data.is;
  10045. }
  10046. if (!tag) {
  10047. // in case of component :is set to falsy value
  10048. return createEmptyVNode()
  10049. }
  10050. // warn against non-primitive key
  10051. if ( true &&
  10052. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  10053. ) {
  10054. {
  10055. warn(
  10056. 'Avoid using non-primitive value as key, ' +
  10057. 'use string/number value instead.',
  10058. context
  10059. );
  10060. }
  10061. }
  10062. // support single function children as default scoped slot
  10063. if (Array.isArray(children) &&
  10064. typeof children[0] === 'function'
  10065. ) {
  10066. data = data || {};
  10067. data.scopedSlots = { default: children[0] };
  10068. children.length = 0;
  10069. }
  10070. if (normalizationType === ALWAYS_NORMALIZE) {
  10071. children = normalizeChildren(children);
  10072. } else if (normalizationType === SIMPLE_NORMALIZE) {
  10073. children = simpleNormalizeChildren(children);
  10074. }
  10075. var vnode, ns;
  10076. if (typeof tag === 'string') {
  10077. var Ctor;
  10078. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  10079. if (config.isReservedTag(tag)) {
  10080. // platform built-in elements
  10081. if ( true && isDef(data) && isDef(data.nativeOn)) {
  10082. warn(
  10083. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  10084. context
  10085. );
  10086. }
  10087. vnode = new VNode(
  10088. config.parsePlatformTagName(tag), data, children,
  10089. undefined, undefined, context
  10090. );
  10091. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  10092. // component
  10093. vnode = createComponent(Ctor, data, context, children, tag);
  10094. } else {
  10095. // unknown or unlisted namespaced elements
  10096. // check at runtime because it may get assigned a namespace when its
  10097. // parent normalizes children
  10098. vnode = new VNode(
  10099. tag, data, children,
  10100. undefined, undefined, context
  10101. );
  10102. }
  10103. } else {
  10104. // direct component options / constructor
  10105. vnode = createComponent(tag, data, context, children);
  10106. }
  10107. if (Array.isArray(vnode)) {
  10108. return vnode
  10109. } else if (isDef(vnode)) {
  10110. if (isDef(ns)) { applyNS(vnode, ns); }
  10111. if (isDef(data)) { registerDeepBindings(data); }
  10112. return vnode
  10113. } else {
  10114. return createEmptyVNode()
  10115. }
  10116. }
  10117. function applyNS (vnode, ns, force) {
  10118. vnode.ns = ns;
  10119. if (vnode.tag === 'foreignObject') {
  10120. // use default namespace inside foreignObject
  10121. ns = undefined;
  10122. force = true;
  10123. }
  10124. if (isDef(vnode.children)) {
  10125. for (var i = 0, l = vnode.children.length; i < l; i++) {
  10126. var child = vnode.children[i];
  10127. if (isDef(child.tag) && (
  10128. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  10129. applyNS(child, ns, force);
  10130. }
  10131. }
  10132. }
  10133. }
  10134. // ref #5318
  10135. // necessary to ensure parent re-render when deep bindings like :style and
  10136. // :class are used on slot nodes
  10137. function registerDeepBindings (data) {
  10138. if (isObject(data.style)) {
  10139. traverse(data.style);
  10140. }
  10141. if (isObject(data.class)) {
  10142. traverse(data.class);
  10143. }
  10144. }
  10145. /* */
  10146. function initRender (vm) {
  10147. vm._vnode = null; // the root of the child tree
  10148. vm._staticTrees = null; // v-once cached trees
  10149. var options = vm.$options;
  10150. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  10151. var renderContext = parentVnode && parentVnode.context;
  10152. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  10153. vm.$scopedSlots = emptyObject;
  10154. // bind the createElement fn to this instance
  10155. // so that we get proper render context inside it.
  10156. // args order: tag, data, children, normalizationType, alwaysNormalize
  10157. // internal version is used by render functions compiled from templates
  10158. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  10159. // normalization is always applied for the public version, used in
  10160. // user-written render functions.
  10161. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  10162. // $attrs & $listeners are exposed for easier HOC creation.
  10163. // they need to be reactive so that HOCs using them are always updated
  10164. var parentData = parentVnode && parentVnode.data;
  10165. /* istanbul ignore else */
  10166. if (true) {
  10167. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  10168. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  10169. }, true);
  10170. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  10171. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  10172. }, true);
  10173. } else {}
  10174. }
  10175. var currentRenderingInstance = null;
  10176. function renderMixin (Vue) {
  10177. // install runtime convenience helpers
  10178. installRenderHelpers(Vue.prototype);
  10179. Vue.prototype.$nextTick = function (fn) {
  10180. return nextTick(fn, this)
  10181. };
  10182. Vue.prototype._render = function () {
  10183. var vm = this;
  10184. var ref = vm.$options;
  10185. var render = ref.render;
  10186. var _parentVnode = ref._parentVnode;
  10187. if (_parentVnode) {
  10188. vm.$scopedSlots = normalizeScopedSlots(
  10189. _parentVnode.data.scopedSlots,
  10190. vm.$slots,
  10191. vm.$scopedSlots
  10192. );
  10193. }
  10194. // set parent vnode. this allows render functions to have access
  10195. // to the data on the placeholder node.
  10196. vm.$vnode = _parentVnode;
  10197. // render self
  10198. var vnode;
  10199. try {
  10200. // There's no need to maintain a stack because all render fns are called
  10201. // separately from one another. Nested component's render fns are called
  10202. // when parent component is patched.
  10203. currentRenderingInstance = vm;
  10204. vnode = render.call(vm._renderProxy, vm.$createElement);
  10205. } catch (e) {
  10206. handleError(e, vm, "render");
  10207. // return error render result,
  10208. // or previous vnode to prevent render error causing blank component
  10209. /* istanbul ignore else */
  10210. if ( true && vm.$options.renderError) {
  10211. try {
  10212. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  10213. } catch (e) {
  10214. handleError(e, vm, "renderError");
  10215. vnode = vm._vnode;
  10216. }
  10217. } else {
  10218. vnode = vm._vnode;
  10219. }
  10220. } finally {
  10221. currentRenderingInstance = null;
  10222. }
  10223. // if the returned array contains only a single node, allow it
  10224. if (Array.isArray(vnode) && vnode.length === 1) {
  10225. vnode = vnode[0];
  10226. }
  10227. // return empty vnode in case the render function errored out
  10228. if (!(vnode instanceof VNode)) {
  10229. if ( true && Array.isArray(vnode)) {
  10230. warn(
  10231. 'Multiple root nodes returned from render function. Render function ' +
  10232. 'should return a single root node.',
  10233. vm
  10234. );
  10235. }
  10236. vnode = createEmptyVNode();
  10237. }
  10238. // set parent
  10239. vnode.parent = _parentVnode;
  10240. return vnode
  10241. };
  10242. }
  10243. /* */
  10244. function ensureCtor (comp, base) {
  10245. if (
  10246. comp.__esModule ||
  10247. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  10248. ) {
  10249. comp = comp.default;
  10250. }
  10251. return isObject(comp)
  10252. ? base.extend(comp)
  10253. : comp
  10254. }
  10255. function createAsyncPlaceholder (
  10256. factory,
  10257. data,
  10258. context,
  10259. children,
  10260. tag
  10261. ) {
  10262. var node = createEmptyVNode();
  10263. node.asyncFactory = factory;
  10264. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  10265. return node
  10266. }
  10267. function resolveAsyncComponent (
  10268. factory,
  10269. baseCtor
  10270. ) {
  10271. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  10272. return factory.errorComp
  10273. }
  10274. if (isDef(factory.resolved)) {
  10275. return factory.resolved
  10276. }
  10277. var owner = currentRenderingInstance;
  10278. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  10279. // already pending
  10280. factory.owners.push(owner);
  10281. }
  10282. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  10283. return factory.loadingComp
  10284. }
  10285. if (owner && !isDef(factory.owners)) {
  10286. var owners = factory.owners = [owner];
  10287. var sync = true;
  10288. var timerLoading = null;
  10289. var timerTimeout = null
  10290. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  10291. var forceRender = function (renderCompleted) {
  10292. for (var i = 0, l = owners.length; i < l; i++) {
  10293. (owners[i]).$forceUpdate();
  10294. }
  10295. if (renderCompleted) {
  10296. owners.length = 0;
  10297. if (timerLoading !== null) {
  10298. clearTimeout(timerLoading);
  10299. timerLoading = null;
  10300. }
  10301. if (timerTimeout !== null) {
  10302. clearTimeout(timerTimeout);
  10303. timerTimeout = null;
  10304. }
  10305. }
  10306. };
  10307. var resolve = once(function (res) {
  10308. // cache resolved
  10309. factory.resolved = ensureCtor(res, baseCtor);
  10310. // invoke callbacks only if this is not a synchronous resolve
  10311. // (async resolves are shimmed as synchronous during SSR)
  10312. if (!sync) {
  10313. forceRender(true);
  10314. } else {
  10315. owners.length = 0;
  10316. }
  10317. });
  10318. var reject = once(function (reason) {
  10319. true && warn(
  10320. "Failed to resolve async component: " + (String(factory)) +
  10321. (reason ? ("\nReason: " + reason) : '')
  10322. );
  10323. if (isDef(factory.errorComp)) {
  10324. factory.error = true;
  10325. forceRender(true);
  10326. }
  10327. });
  10328. var res = factory(resolve, reject);
  10329. if (isObject(res)) {
  10330. if (isPromise(res)) {
  10331. // () => Promise
  10332. if (isUndef(factory.resolved)) {
  10333. res.then(resolve, reject);
  10334. }
  10335. } else if (isPromise(res.component)) {
  10336. res.component.then(resolve, reject);
  10337. if (isDef(res.error)) {
  10338. factory.errorComp = ensureCtor(res.error, baseCtor);
  10339. }
  10340. if (isDef(res.loading)) {
  10341. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  10342. if (res.delay === 0) {
  10343. factory.loading = true;
  10344. } else {
  10345. timerLoading = setTimeout(function () {
  10346. timerLoading = null;
  10347. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  10348. factory.loading = true;
  10349. forceRender(false);
  10350. }
  10351. }, res.delay || 200);
  10352. }
  10353. }
  10354. if (isDef(res.timeout)) {
  10355. timerTimeout = setTimeout(function () {
  10356. timerTimeout = null;
  10357. if (isUndef(factory.resolved)) {
  10358. reject(
  10359. true
  10360. ? ("timeout (" + (res.timeout) + "ms)")
  10361. : undefined
  10362. );
  10363. }
  10364. }, res.timeout);
  10365. }
  10366. }
  10367. }
  10368. sync = false;
  10369. // return in case resolved synchronously
  10370. return factory.loading
  10371. ? factory.loadingComp
  10372. : factory.resolved
  10373. }
  10374. }
  10375. /* */
  10376. function isAsyncPlaceholder (node) {
  10377. return node.isComment && node.asyncFactory
  10378. }
  10379. /* */
  10380. function getFirstComponentChild (children) {
  10381. if (Array.isArray(children)) {
  10382. for (var i = 0; i < children.length; i++) {
  10383. var c = children[i];
  10384. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  10385. return c
  10386. }
  10387. }
  10388. }
  10389. }
  10390. /* */
  10391. /* */
  10392. function initEvents (vm) {
  10393. vm._events = Object.create(null);
  10394. vm._hasHookEvent = false;
  10395. // init parent attached events
  10396. var listeners = vm.$options._parentListeners;
  10397. if (listeners) {
  10398. updateComponentListeners(vm, listeners);
  10399. }
  10400. }
  10401. var target;
  10402. function add (event, fn) {
  10403. target.$on(event, fn);
  10404. }
  10405. function remove$1 (event, fn) {
  10406. target.$off(event, fn);
  10407. }
  10408. function createOnceHandler (event, fn) {
  10409. var _target = target;
  10410. return function onceHandler () {
  10411. var res = fn.apply(null, arguments);
  10412. if (res !== null) {
  10413. _target.$off(event, onceHandler);
  10414. }
  10415. }
  10416. }
  10417. function updateComponentListeners (
  10418. vm,
  10419. listeners,
  10420. oldListeners
  10421. ) {
  10422. target = vm;
  10423. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  10424. target = undefined;
  10425. }
  10426. function eventsMixin (Vue) {
  10427. var hookRE = /^hook:/;
  10428. Vue.prototype.$on = function (event, fn) {
  10429. var vm = this;
  10430. if (Array.isArray(event)) {
  10431. for (var i = 0, l = event.length; i < l; i++) {
  10432. vm.$on(event[i], fn);
  10433. }
  10434. } else {
  10435. (vm._events[event] || (vm._events[event] = [])).push(fn);
  10436. // optimize hook:event cost by using a boolean flag marked at registration
  10437. // instead of a hash lookup
  10438. if (hookRE.test(event)) {
  10439. vm._hasHookEvent = true;
  10440. }
  10441. }
  10442. return vm
  10443. };
  10444. Vue.prototype.$once = function (event, fn) {
  10445. var vm = this;
  10446. function on () {
  10447. vm.$off(event, on);
  10448. fn.apply(vm, arguments);
  10449. }
  10450. on.fn = fn;
  10451. vm.$on(event, on);
  10452. return vm
  10453. };
  10454. Vue.prototype.$off = function (event, fn) {
  10455. var vm = this;
  10456. // all
  10457. if (!arguments.length) {
  10458. vm._events = Object.create(null);
  10459. return vm
  10460. }
  10461. // array of events
  10462. if (Array.isArray(event)) {
  10463. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  10464. vm.$off(event[i$1], fn);
  10465. }
  10466. return vm
  10467. }
  10468. // specific event
  10469. var cbs = vm._events[event];
  10470. if (!cbs) {
  10471. return vm
  10472. }
  10473. if (!fn) {
  10474. vm._events[event] = null;
  10475. return vm
  10476. }
  10477. // specific handler
  10478. var cb;
  10479. var i = cbs.length;
  10480. while (i--) {
  10481. cb = cbs[i];
  10482. if (cb === fn || cb.fn === fn) {
  10483. cbs.splice(i, 1);
  10484. break
  10485. }
  10486. }
  10487. return vm
  10488. };
  10489. Vue.prototype.$emit = function (event) {
  10490. var vm = this;
  10491. if (true) {
  10492. var lowerCaseEvent = event.toLowerCase();
  10493. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  10494. tip(
  10495. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  10496. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  10497. "Note that HTML attributes are case-insensitive and you cannot use " +
  10498. "v-on to listen to camelCase events when using in-DOM templates. " +
  10499. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  10500. );
  10501. }
  10502. }
  10503. var cbs = vm._events[event];
  10504. if (cbs) {
  10505. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  10506. var args = toArray(arguments, 1);
  10507. var info = "event handler for \"" + event + "\"";
  10508. for (var i = 0, l = cbs.length; i < l; i++) {
  10509. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  10510. }
  10511. }
  10512. return vm
  10513. };
  10514. }
  10515. /* */
  10516. var activeInstance = null;
  10517. var isUpdatingChildComponent = false;
  10518. function setActiveInstance(vm) {
  10519. var prevActiveInstance = activeInstance;
  10520. activeInstance = vm;
  10521. return function () {
  10522. activeInstance = prevActiveInstance;
  10523. }
  10524. }
  10525. function initLifecycle (vm) {
  10526. var options = vm.$options;
  10527. // locate first non-abstract parent
  10528. var parent = options.parent;
  10529. if (parent && !options.abstract) {
  10530. while (parent.$options.abstract && parent.$parent) {
  10531. parent = parent.$parent;
  10532. }
  10533. parent.$children.push(vm);
  10534. }
  10535. vm.$parent = parent;
  10536. vm.$root = parent ? parent.$root : vm;
  10537. vm.$children = [];
  10538. vm.$refs = {};
  10539. vm._watcher = null;
  10540. vm._inactive = null;
  10541. vm._directInactive = false;
  10542. vm._isMounted = false;
  10543. vm._isDestroyed = false;
  10544. vm._isBeingDestroyed = false;
  10545. }
  10546. function lifecycleMixin (Vue) {
  10547. Vue.prototype._update = function (vnode, hydrating) {
  10548. var vm = this;
  10549. var prevEl = vm.$el;
  10550. var prevVnode = vm._vnode;
  10551. var restoreActiveInstance = setActiveInstance(vm);
  10552. vm._vnode = vnode;
  10553. // Vue.prototype.__patch__ is injected in entry points
  10554. // based on the rendering backend used.
  10555. if (!prevVnode) {
  10556. // initial render
  10557. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  10558. } else {
  10559. // updates
  10560. vm.$el = vm.__patch__(prevVnode, vnode);
  10561. }
  10562. restoreActiveInstance();
  10563. // update __vue__ reference
  10564. if (prevEl) {
  10565. prevEl.__vue__ = null;
  10566. }
  10567. if (vm.$el) {
  10568. vm.$el.__vue__ = vm;
  10569. }
  10570. // if parent is an HOC, update its $el as well
  10571. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  10572. vm.$parent.$el = vm.$el;
  10573. }
  10574. // updated hook is called by the scheduler to ensure that children are
  10575. // updated in a parent's updated hook.
  10576. };
  10577. Vue.prototype.$forceUpdate = function () {
  10578. var vm = this;
  10579. if (vm._watcher) {
  10580. vm._watcher.update();
  10581. }
  10582. };
  10583. Vue.prototype.$destroy = function () {
  10584. var vm = this;
  10585. if (vm._isBeingDestroyed) {
  10586. return
  10587. }
  10588. callHook(vm, 'beforeDestroy');
  10589. vm._isBeingDestroyed = true;
  10590. // remove self from parent
  10591. var parent = vm.$parent;
  10592. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  10593. remove(parent.$children, vm);
  10594. }
  10595. // teardown watchers
  10596. if (vm._watcher) {
  10597. vm._watcher.teardown();
  10598. }
  10599. var i = vm._watchers.length;
  10600. while (i--) {
  10601. vm._watchers[i].teardown();
  10602. }
  10603. // remove reference from data ob
  10604. // frozen object may not have observer.
  10605. if (vm._data.__ob__) {
  10606. vm._data.__ob__.vmCount--;
  10607. }
  10608. // call the last hook...
  10609. vm._isDestroyed = true;
  10610. // invoke destroy hooks on current rendered tree
  10611. vm.__patch__(vm._vnode, null);
  10612. // fire destroyed hook
  10613. callHook(vm, 'destroyed');
  10614. // turn off all instance listeners.
  10615. vm.$off();
  10616. // remove __vue__ reference
  10617. if (vm.$el) {
  10618. vm.$el.__vue__ = null;
  10619. }
  10620. // release circular reference (#6759)
  10621. if (vm.$vnode) {
  10622. vm.$vnode.parent = null;
  10623. }
  10624. };
  10625. }
  10626. function updateChildComponent (
  10627. vm,
  10628. propsData,
  10629. listeners,
  10630. parentVnode,
  10631. renderChildren
  10632. ) {
  10633. if (true) {
  10634. isUpdatingChildComponent = true;
  10635. }
  10636. // determine whether component has slot children
  10637. // we need to do this before overwriting $options._renderChildren.
  10638. // check if there are dynamic scopedSlots (hand-written or compiled but with
  10639. // dynamic slot names). Static scoped slots compiled from template has the
  10640. // "$stable" marker.
  10641. var newScopedSlots = parentVnode.data.scopedSlots;
  10642. var oldScopedSlots = vm.$scopedSlots;
  10643. var hasDynamicScopedSlot = !!(
  10644. (newScopedSlots && !newScopedSlots.$stable) ||
  10645. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  10646. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  10647. );
  10648. // Any static slot children from the parent may have changed during parent's
  10649. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  10650. // update is necessary to ensure correctness.
  10651. var needsForceUpdate = !!(
  10652. renderChildren || // has new static slots
  10653. vm.$options._renderChildren || // has old static slots
  10654. hasDynamicScopedSlot
  10655. );
  10656. vm.$options._parentVnode = parentVnode;
  10657. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  10658. if (vm._vnode) { // update child tree's parent
  10659. vm._vnode.parent = parentVnode;
  10660. }
  10661. vm.$options._renderChildren = renderChildren;
  10662. // update $attrs and $listeners hash
  10663. // these are also reactive so they may trigger child update if the child
  10664. // used them during render
  10665. vm.$attrs = parentVnode.data.attrs || emptyObject;
  10666. vm.$listeners = listeners || emptyObject;
  10667. // update props
  10668. if (propsData && vm.$options.props) {
  10669. toggleObserving(false);
  10670. var props = vm._props;
  10671. var propKeys = vm.$options._propKeys || [];
  10672. for (var i = 0; i < propKeys.length; i++) {
  10673. var key = propKeys[i];
  10674. var propOptions = vm.$options.props; // wtf flow?
  10675. props[key] = validateProp(key, propOptions, propsData, vm);
  10676. }
  10677. toggleObserving(true);
  10678. // keep a copy of raw propsData
  10679. vm.$options.propsData = propsData;
  10680. }
  10681. // fixed by xxxxxx update properties(mp runtime)
  10682. vm._$updateProperties && vm._$updateProperties(vm);
  10683. // update listeners
  10684. listeners = listeners || emptyObject;
  10685. var oldListeners = vm.$options._parentListeners;
  10686. vm.$options._parentListeners = listeners;
  10687. updateComponentListeners(vm, listeners, oldListeners);
  10688. // resolve slots + force update if has children
  10689. if (needsForceUpdate) {
  10690. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  10691. vm.$forceUpdate();
  10692. }
  10693. if (true) {
  10694. isUpdatingChildComponent = false;
  10695. }
  10696. }
  10697. function isInInactiveTree (vm) {
  10698. while (vm && (vm = vm.$parent)) {
  10699. if (vm._inactive) { return true }
  10700. }
  10701. return false
  10702. }
  10703. function activateChildComponent (vm, direct) {
  10704. if (direct) {
  10705. vm._directInactive = false;
  10706. if (isInInactiveTree(vm)) {
  10707. return
  10708. }
  10709. } else if (vm._directInactive) {
  10710. return
  10711. }
  10712. if (vm._inactive || vm._inactive === null) {
  10713. vm._inactive = false;
  10714. for (var i = 0; i < vm.$children.length; i++) {
  10715. activateChildComponent(vm.$children[i]);
  10716. }
  10717. callHook(vm, 'activated');
  10718. }
  10719. }
  10720. function deactivateChildComponent (vm, direct) {
  10721. if (direct) {
  10722. vm._directInactive = true;
  10723. if (isInInactiveTree(vm)) {
  10724. return
  10725. }
  10726. }
  10727. if (!vm._inactive) {
  10728. vm._inactive = true;
  10729. for (var i = 0; i < vm.$children.length; i++) {
  10730. deactivateChildComponent(vm.$children[i]);
  10731. }
  10732. callHook(vm, 'deactivated');
  10733. }
  10734. }
  10735. function callHook (vm, hook) {
  10736. // #7573 disable dep collection when invoking lifecycle hooks
  10737. pushTarget();
  10738. var handlers = vm.$options[hook];
  10739. var info = hook + " hook";
  10740. if (handlers) {
  10741. for (var i = 0, j = handlers.length; i < j; i++) {
  10742. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  10743. }
  10744. }
  10745. if (vm._hasHookEvent) {
  10746. vm.$emit('hook:' + hook);
  10747. }
  10748. popTarget();
  10749. }
  10750. /* */
  10751. var MAX_UPDATE_COUNT = 100;
  10752. var queue = [];
  10753. var activatedChildren = [];
  10754. var has = {};
  10755. var circular = {};
  10756. var waiting = false;
  10757. var flushing = false;
  10758. var index = 0;
  10759. /**
  10760. * Reset the scheduler's state.
  10761. */
  10762. function resetSchedulerState () {
  10763. index = queue.length = activatedChildren.length = 0;
  10764. has = {};
  10765. if (true) {
  10766. circular = {};
  10767. }
  10768. waiting = flushing = false;
  10769. }
  10770. // Async edge case #6566 requires saving the timestamp when event listeners are
  10771. // attached. However, calling performance.now() has a perf overhead especially
  10772. // if the page has thousands of event listeners. Instead, we take a timestamp
  10773. // every time the scheduler flushes and use that for all event listeners
  10774. // attached during that flush.
  10775. var currentFlushTimestamp = 0;
  10776. // Async edge case fix requires storing an event listener's attach timestamp.
  10777. var getNow = Date.now;
  10778. // Determine what event timestamp the browser is using. Annoyingly, the
  10779. // timestamp can either be hi-res (relative to page load) or low-res
  10780. // (relative to UNIX epoch), so in order to compare time we have to use the
  10781. // same timestamp type when saving the flush timestamp.
  10782. // All IE versions use low-res event timestamps, and have problematic clock
  10783. // implementations (#9632)
  10784. if (inBrowser && !isIE) {
  10785. var performance = window.performance;
  10786. if (
  10787. performance &&
  10788. typeof performance.now === 'function' &&
  10789. getNow() > document.createEvent('Event').timeStamp
  10790. ) {
  10791. // if the event timestamp, although evaluated AFTER the Date.now(), is
  10792. // smaller than it, it means the event is using a hi-res timestamp,
  10793. // and we need to use the hi-res version for event listener timestamps as
  10794. // well.
  10795. getNow = function () { return performance.now(); };
  10796. }
  10797. }
  10798. /**
  10799. * Flush both queues and run the watchers.
  10800. */
  10801. function flushSchedulerQueue () {
  10802. currentFlushTimestamp = getNow();
  10803. flushing = true;
  10804. var watcher, id;
  10805. // Sort queue before flush.
  10806. // This ensures that:
  10807. // 1. Components are updated from parent to child. (because parent is always
  10808. // created before the child)
  10809. // 2. A component's user watchers are run before its render watcher (because
  10810. // user watchers are created before the render watcher)
  10811. // 3. If a component is destroyed during a parent component's watcher run,
  10812. // its watchers can be skipped.
  10813. queue.sort(function (a, b) { return a.id - b.id; });
  10814. // do not cache length because more watchers might be pushed
  10815. // as we run existing watchers
  10816. for (index = 0; index < queue.length; index++) {
  10817. watcher = queue[index];
  10818. if (watcher.before) {
  10819. watcher.before();
  10820. }
  10821. id = watcher.id;
  10822. has[id] = null;
  10823. watcher.run();
  10824. // in dev build, check and stop circular updates.
  10825. if ( true && has[id] != null) {
  10826. circular[id] = (circular[id] || 0) + 1;
  10827. if (circular[id] > MAX_UPDATE_COUNT) {
  10828. warn(
  10829. 'You may have an infinite update loop ' + (
  10830. watcher.user
  10831. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  10832. : "in a component render function."
  10833. ),
  10834. watcher.vm
  10835. );
  10836. break
  10837. }
  10838. }
  10839. }
  10840. // keep copies of post queues before resetting state
  10841. var activatedQueue = activatedChildren.slice();
  10842. var updatedQueue = queue.slice();
  10843. resetSchedulerState();
  10844. // call component updated and activated hooks
  10845. callActivatedHooks(activatedQueue);
  10846. callUpdatedHooks(updatedQueue);
  10847. // devtool hook
  10848. /* istanbul ignore if */
  10849. if (devtools && config.devtools) {
  10850. devtools.emit('flush');
  10851. }
  10852. }
  10853. function callUpdatedHooks (queue) {
  10854. var i = queue.length;
  10855. while (i--) {
  10856. var watcher = queue[i];
  10857. var vm = watcher.vm;
  10858. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  10859. callHook(vm, 'updated');
  10860. }
  10861. }
  10862. }
  10863. /**
  10864. * Queue a kept-alive component that was activated during patch.
  10865. * The queue will be processed after the entire tree has been patched.
  10866. */
  10867. function queueActivatedComponent (vm) {
  10868. // setting _inactive to false here so that a render function can
  10869. // rely on checking whether it's in an inactive tree (e.g. router-view)
  10870. vm._inactive = false;
  10871. activatedChildren.push(vm);
  10872. }
  10873. function callActivatedHooks (queue) {
  10874. for (var i = 0; i < queue.length; i++) {
  10875. queue[i]._inactive = true;
  10876. activateChildComponent(queue[i], true /* true */);
  10877. }
  10878. }
  10879. /**
  10880. * Push a watcher into the watcher queue.
  10881. * Jobs with duplicate IDs will be skipped unless it's
  10882. * pushed when the queue is being flushed.
  10883. */
  10884. function queueWatcher (watcher) {
  10885. var id = watcher.id;
  10886. if (has[id] == null) {
  10887. has[id] = true;
  10888. if (!flushing) {
  10889. queue.push(watcher);
  10890. } else {
  10891. // if already flushing, splice the watcher based on its id
  10892. // if already past its id, it will be run next immediately.
  10893. var i = queue.length - 1;
  10894. while (i > index && queue[i].id > watcher.id) {
  10895. i--;
  10896. }
  10897. queue.splice(i + 1, 0, watcher);
  10898. }
  10899. // queue the flush
  10900. if (!waiting) {
  10901. waiting = true;
  10902. if ( true && !config.async) {
  10903. flushSchedulerQueue();
  10904. return
  10905. }
  10906. nextTick(flushSchedulerQueue);
  10907. }
  10908. }
  10909. }
  10910. /* */
  10911. var uid$2 = 0;
  10912. /**
  10913. * A watcher parses an expression, collects dependencies,
  10914. * and fires callback when the expression value changes.
  10915. * This is used for both the $watch() api and directives.
  10916. */
  10917. var Watcher = function Watcher (
  10918. vm,
  10919. expOrFn,
  10920. cb,
  10921. options,
  10922. isRenderWatcher
  10923. ) {
  10924. this.vm = vm;
  10925. if (isRenderWatcher) {
  10926. vm._watcher = this;
  10927. }
  10928. vm._watchers.push(this);
  10929. // options
  10930. if (options) {
  10931. this.deep = !!options.deep;
  10932. this.user = !!options.user;
  10933. this.lazy = !!options.lazy;
  10934. this.sync = !!options.sync;
  10935. this.before = options.before;
  10936. } else {
  10937. this.deep = this.user = this.lazy = this.sync = false;
  10938. }
  10939. this.cb = cb;
  10940. this.id = ++uid$2; // uid for batching
  10941. this.active = true;
  10942. this.dirty = this.lazy; // for lazy watchers
  10943. this.deps = [];
  10944. this.newDeps = [];
  10945. this.depIds = new _Set();
  10946. this.newDepIds = new _Set();
  10947. this.expression = true
  10948. ? expOrFn.toString()
  10949. : undefined;
  10950. // parse expression for getter
  10951. if (typeof expOrFn === 'function') {
  10952. this.getter = expOrFn;
  10953. } else {
  10954. this.getter = parsePath(expOrFn);
  10955. if (!this.getter) {
  10956. this.getter = noop;
  10957. true && warn(
  10958. "Failed watching path: \"" + expOrFn + "\" " +
  10959. 'Watcher only accepts simple dot-delimited paths. ' +
  10960. 'For full control, use a function instead.',
  10961. vm
  10962. );
  10963. }
  10964. }
  10965. this.value = this.lazy
  10966. ? undefined
  10967. : this.get();
  10968. };
  10969. /**
  10970. * Evaluate the getter, and re-collect dependencies.
  10971. */
  10972. Watcher.prototype.get = function get () {
  10973. pushTarget(this);
  10974. var value;
  10975. var vm = this.vm;
  10976. try {
  10977. value = this.getter.call(vm, vm);
  10978. } catch (e) {
  10979. if (this.user) {
  10980. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  10981. } else {
  10982. throw e
  10983. }
  10984. } finally {
  10985. // "touch" every property so they are all tracked as
  10986. // dependencies for deep watching
  10987. if (this.deep) {
  10988. traverse(value);
  10989. }
  10990. popTarget();
  10991. this.cleanupDeps();
  10992. }
  10993. return value
  10994. };
  10995. /**
  10996. * Add a dependency to this directive.
  10997. */
  10998. Watcher.prototype.addDep = function addDep (dep) {
  10999. var id = dep.id;
  11000. if (!this.newDepIds.has(id)) {
  11001. this.newDepIds.add(id);
  11002. this.newDeps.push(dep);
  11003. if (!this.depIds.has(id)) {
  11004. dep.addSub(this);
  11005. }
  11006. }
  11007. };
  11008. /**
  11009. * Clean up for dependency collection.
  11010. */
  11011. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  11012. var i = this.deps.length;
  11013. while (i--) {
  11014. var dep = this.deps[i];
  11015. if (!this.newDepIds.has(dep.id)) {
  11016. dep.removeSub(this);
  11017. }
  11018. }
  11019. var tmp = this.depIds;
  11020. this.depIds = this.newDepIds;
  11021. this.newDepIds = tmp;
  11022. this.newDepIds.clear();
  11023. tmp = this.deps;
  11024. this.deps = this.newDeps;
  11025. this.newDeps = tmp;
  11026. this.newDeps.length = 0;
  11027. };
  11028. /**
  11029. * Subscriber interface.
  11030. * Will be called when a dependency changes.
  11031. */
  11032. Watcher.prototype.update = function update () {
  11033. /* istanbul ignore else */
  11034. if (this.lazy) {
  11035. this.dirty = true;
  11036. } else if (this.sync) {
  11037. this.run();
  11038. } else {
  11039. queueWatcher(this);
  11040. }
  11041. };
  11042. /**
  11043. * Scheduler job interface.
  11044. * Will be called by the scheduler.
  11045. */
  11046. Watcher.prototype.run = function run () {
  11047. if (this.active) {
  11048. var value = this.get();
  11049. if (
  11050. value !== this.value ||
  11051. // Deep watchers and watchers on Object/Arrays should fire even
  11052. // when the value is the same, because the value may
  11053. // have mutated.
  11054. isObject(value) ||
  11055. this.deep
  11056. ) {
  11057. // set new value
  11058. var oldValue = this.value;
  11059. this.value = value;
  11060. if (this.user) {
  11061. try {
  11062. this.cb.call(this.vm, value, oldValue);
  11063. } catch (e) {
  11064. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  11065. }
  11066. } else {
  11067. this.cb.call(this.vm, value, oldValue);
  11068. }
  11069. }
  11070. }
  11071. };
  11072. /**
  11073. * Evaluate the value of the watcher.
  11074. * This only gets called for lazy watchers.
  11075. */
  11076. Watcher.prototype.evaluate = function evaluate () {
  11077. this.value = this.get();
  11078. this.dirty = false;
  11079. };
  11080. /**
  11081. * Depend on all deps collected by this watcher.
  11082. */
  11083. Watcher.prototype.depend = function depend () {
  11084. var i = this.deps.length;
  11085. while (i--) {
  11086. this.deps[i].depend();
  11087. }
  11088. };
  11089. /**
  11090. * Remove self from all dependencies' subscriber list.
  11091. */
  11092. Watcher.prototype.teardown = function teardown () {
  11093. if (this.active) {
  11094. // remove self from vm's watcher list
  11095. // this is a somewhat expensive operation so we skip it
  11096. // if the vm is being destroyed.
  11097. if (!this.vm._isBeingDestroyed) {
  11098. remove(this.vm._watchers, this);
  11099. }
  11100. var i = this.deps.length;
  11101. while (i--) {
  11102. this.deps[i].removeSub(this);
  11103. }
  11104. this.active = false;
  11105. }
  11106. };
  11107. /* */
  11108. var sharedPropertyDefinition = {
  11109. enumerable: true,
  11110. configurable: true,
  11111. get: noop,
  11112. set: noop
  11113. };
  11114. function proxy (target, sourceKey, key) {
  11115. sharedPropertyDefinition.get = function proxyGetter () {
  11116. return this[sourceKey][key]
  11117. };
  11118. sharedPropertyDefinition.set = function proxySetter (val) {
  11119. this[sourceKey][key] = val;
  11120. };
  11121. Object.defineProperty(target, key, sharedPropertyDefinition);
  11122. }
  11123. function initState (vm) {
  11124. vm._watchers = [];
  11125. var opts = vm.$options;
  11126. if (opts.props) { initProps(vm, opts.props); }
  11127. if (opts.methods) { initMethods(vm, opts.methods); }
  11128. if (opts.data) {
  11129. initData(vm);
  11130. } else {
  11131. observe(vm._data = {}, true /* asRootData */);
  11132. }
  11133. if (opts.computed) { initComputed(vm, opts.computed); }
  11134. if (opts.watch && opts.watch !== nativeWatch) {
  11135. initWatch(vm, opts.watch);
  11136. }
  11137. }
  11138. function initProps (vm, propsOptions) {
  11139. var propsData = vm.$options.propsData || {};
  11140. var props = vm._props = {};
  11141. // cache prop keys so that future props updates can iterate using Array
  11142. // instead of dynamic object key enumeration.
  11143. var keys = vm.$options._propKeys = [];
  11144. var isRoot = !vm.$parent;
  11145. // root instance props should be converted
  11146. if (!isRoot) {
  11147. toggleObserving(false);
  11148. }
  11149. var loop = function ( key ) {
  11150. keys.push(key);
  11151. var value = validateProp(key, propsOptions, propsData, vm);
  11152. /* istanbul ignore else */
  11153. if (true) {
  11154. var hyphenatedKey = hyphenate(key);
  11155. if (isReservedAttribute(hyphenatedKey) ||
  11156. config.isReservedAttr(hyphenatedKey)) {
  11157. warn(
  11158. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  11159. vm
  11160. );
  11161. }
  11162. defineReactive$$1(props, key, value, function () {
  11163. if (!isRoot && !isUpdatingChildComponent) {
  11164. {
  11165. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  11166. return
  11167. }
  11168. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  11169. if(
  11170. key === 'value' &&
  11171. Array.isArray(vm.$options.behaviors) &&
  11172. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  11173. ){
  11174. return
  11175. }
  11176. if(vm._getFormData){
  11177. return
  11178. }
  11179. var $parent = vm.$parent;
  11180. while($parent){
  11181. if($parent.__next_tick_pending){
  11182. return
  11183. }
  11184. $parent = $parent.$parent;
  11185. }
  11186. }
  11187. warn(
  11188. "Avoid mutating a prop directly since the value will be " +
  11189. "overwritten whenever the parent component re-renders. " +
  11190. "Instead, use a data or computed property based on the prop's " +
  11191. "value. Prop being mutated: \"" + key + "\"",
  11192. vm
  11193. );
  11194. }
  11195. });
  11196. } else {}
  11197. // static props are already proxied on the component's prototype
  11198. // during Vue.extend(). We only need to proxy props defined at
  11199. // instantiation here.
  11200. if (!(key in vm)) {
  11201. proxy(vm, "_props", key);
  11202. }
  11203. };
  11204. for (var key in propsOptions) loop( key );
  11205. toggleObserving(true);
  11206. }
  11207. function initData (vm) {
  11208. var data = vm.$options.data;
  11209. data = vm._data = typeof data === 'function'
  11210. ? getData(data, vm)
  11211. : data || {};
  11212. if (!isPlainObject(data)) {
  11213. data = {};
  11214. true && warn(
  11215. 'data functions should return an object:\n' +
  11216. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  11217. vm
  11218. );
  11219. }
  11220. // proxy data on instance
  11221. var keys = Object.keys(data);
  11222. var props = vm.$options.props;
  11223. var methods = vm.$options.methods;
  11224. var i = keys.length;
  11225. while (i--) {
  11226. var key = keys[i];
  11227. if (true) {
  11228. if (methods && hasOwn(methods, key)) {
  11229. warn(
  11230. ("Method \"" + key + "\" has already been defined as a data property."),
  11231. vm
  11232. );
  11233. }
  11234. }
  11235. if (props && hasOwn(props, key)) {
  11236. true && warn(
  11237. "The data property \"" + key + "\" is already declared as a prop. " +
  11238. "Use prop default value instead.",
  11239. vm
  11240. );
  11241. } else if (!isReserved(key)) {
  11242. proxy(vm, "_data", key);
  11243. }
  11244. }
  11245. // observe data
  11246. observe(data, true /* asRootData */);
  11247. }
  11248. function getData (data, vm) {
  11249. // #7573 disable dep collection when invoking data getters
  11250. pushTarget();
  11251. try {
  11252. return data.call(vm, vm)
  11253. } catch (e) {
  11254. handleError(e, vm, "data()");
  11255. return {}
  11256. } finally {
  11257. popTarget();
  11258. }
  11259. }
  11260. var computedWatcherOptions = { lazy: true };
  11261. function initComputed (vm, computed) {
  11262. // $flow-disable-line
  11263. var watchers = vm._computedWatchers = Object.create(null);
  11264. // computed properties are just getters during SSR
  11265. var isSSR = isServerRendering();
  11266. for (var key in computed) {
  11267. var userDef = computed[key];
  11268. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  11269. if ( true && getter == null) {
  11270. warn(
  11271. ("Getter is missing for computed property \"" + key + "\"."),
  11272. vm
  11273. );
  11274. }
  11275. if (!isSSR) {
  11276. // create internal watcher for the computed property.
  11277. watchers[key] = new Watcher(
  11278. vm,
  11279. getter || noop,
  11280. noop,
  11281. computedWatcherOptions
  11282. );
  11283. }
  11284. // component-defined computed properties are already defined on the
  11285. // component prototype. We only need to define computed properties defined
  11286. // at instantiation here.
  11287. if (!(key in vm)) {
  11288. defineComputed(vm, key, userDef);
  11289. } else if (true) {
  11290. if (key in vm.$data) {
  11291. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  11292. } else if (vm.$options.props && key in vm.$options.props) {
  11293. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  11294. }
  11295. }
  11296. }
  11297. }
  11298. function defineComputed (
  11299. target,
  11300. key,
  11301. userDef
  11302. ) {
  11303. var shouldCache = !isServerRendering();
  11304. if (typeof userDef === 'function') {
  11305. sharedPropertyDefinition.get = shouldCache
  11306. ? createComputedGetter(key)
  11307. : createGetterInvoker(userDef);
  11308. sharedPropertyDefinition.set = noop;
  11309. } else {
  11310. sharedPropertyDefinition.get = userDef.get
  11311. ? shouldCache && userDef.cache !== false
  11312. ? createComputedGetter(key)
  11313. : createGetterInvoker(userDef.get)
  11314. : noop;
  11315. sharedPropertyDefinition.set = userDef.set || noop;
  11316. }
  11317. if ( true &&
  11318. sharedPropertyDefinition.set === noop) {
  11319. sharedPropertyDefinition.set = function () {
  11320. warn(
  11321. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  11322. this
  11323. );
  11324. };
  11325. }
  11326. Object.defineProperty(target, key, sharedPropertyDefinition);
  11327. }
  11328. function createComputedGetter (key) {
  11329. return function computedGetter () {
  11330. var watcher = this._computedWatchers && this._computedWatchers[key];
  11331. if (watcher) {
  11332. if (watcher.dirty) {
  11333. watcher.evaluate();
  11334. }
  11335. if (Dep.SharedObject.target) {// fixed by xxxxxx
  11336. watcher.depend();
  11337. }
  11338. return watcher.value
  11339. }
  11340. }
  11341. }
  11342. function createGetterInvoker(fn) {
  11343. return function computedGetter () {
  11344. return fn.call(this, this)
  11345. }
  11346. }
  11347. function initMethods (vm, methods) {
  11348. var props = vm.$options.props;
  11349. for (var key in methods) {
  11350. if (true) {
  11351. if (typeof methods[key] !== 'function') {
  11352. warn(
  11353. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  11354. "Did you reference the function correctly?",
  11355. vm
  11356. );
  11357. }
  11358. if (props && hasOwn(props, key)) {
  11359. warn(
  11360. ("Method \"" + key + "\" has already been defined as a prop."),
  11361. vm
  11362. );
  11363. }
  11364. if ((key in vm) && isReserved(key)) {
  11365. warn(
  11366. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  11367. "Avoid defining component methods that start with _ or $."
  11368. );
  11369. }
  11370. }
  11371. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  11372. }
  11373. }
  11374. function initWatch (vm, watch) {
  11375. for (var key in watch) {
  11376. var handler = watch[key];
  11377. if (Array.isArray(handler)) {
  11378. for (var i = 0; i < handler.length; i++) {
  11379. createWatcher(vm, key, handler[i]);
  11380. }
  11381. } else {
  11382. createWatcher(vm, key, handler);
  11383. }
  11384. }
  11385. }
  11386. function createWatcher (
  11387. vm,
  11388. expOrFn,
  11389. handler,
  11390. options
  11391. ) {
  11392. if (isPlainObject(handler)) {
  11393. options = handler;
  11394. handler = handler.handler;
  11395. }
  11396. if (typeof handler === 'string') {
  11397. handler = vm[handler];
  11398. }
  11399. return vm.$watch(expOrFn, handler, options)
  11400. }
  11401. function stateMixin (Vue) {
  11402. // flow somehow has problems with directly declared definition object
  11403. // when using Object.defineProperty, so we have to procedurally build up
  11404. // the object here.
  11405. var dataDef = {};
  11406. dataDef.get = function () { return this._data };
  11407. var propsDef = {};
  11408. propsDef.get = function () { return this._props };
  11409. if (true) {
  11410. dataDef.set = function () {
  11411. warn(
  11412. 'Avoid replacing instance root $data. ' +
  11413. 'Use nested data properties instead.',
  11414. this
  11415. );
  11416. };
  11417. propsDef.set = function () {
  11418. warn("$props is readonly.", this);
  11419. };
  11420. }
  11421. Object.defineProperty(Vue.prototype, '$data', dataDef);
  11422. Object.defineProperty(Vue.prototype, '$props', propsDef);
  11423. Vue.prototype.$set = set;
  11424. Vue.prototype.$delete = del;
  11425. Vue.prototype.$watch = function (
  11426. expOrFn,
  11427. cb,
  11428. options
  11429. ) {
  11430. var vm = this;
  11431. if (isPlainObject(cb)) {
  11432. return createWatcher(vm, expOrFn, cb, options)
  11433. }
  11434. options = options || {};
  11435. options.user = true;
  11436. var watcher = new Watcher(vm, expOrFn, cb, options);
  11437. if (options.immediate) {
  11438. try {
  11439. cb.call(vm, watcher.value);
  11440. } catch (error) {
  11441. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  11442. }
  11443. }
  11444. return function unwatchFn () {
  11445. watcher.teardown();
  11446. }
  11447. };
  11448. }
  11449. /* */
  11450. var uid$3 = 0;
  11451. function initMixin (Vue) {
  11452. Vue.prototype._init = function (options) {
  11453. var vm = this;
  11454. // a uid
  11455. vm._uid = uid$3++;
  11456. var startTag, endTag;
  11457. /* istanbul ignore if */
  11458. if ( true && config.performance && mark) {
  11459. startTag = "vue-perf-start:" + (vm._uid);
  11460. endTag = "vue-perf-end:" + (vm._uid);
  11461. mark(startTag);
  11462. }
  11463. // a flag to avoid this being observed
  11464. vm._isVue = true;
  11465. // merge options
  11466. if (options && options._isComponent) {
  11467. // optimize internal component instantiation
  11468. // since dynamic options merging is pretty slow, and none of the
  11469. // internal component options needs special treatment.
  11470. initInternalComponent(vm, options);
  11471. } else {
  11472. vm.$options = mergeOptions(
  11473. resolveConstructorOptions(vm.constructor),
  11474. options || {},
  11475. vm
  11476. );
  11477. }
  11478. /* istanbul ignore else */
  11479. if (true) {
  11480. initProxy(vm);
  11481. } else {}
  11482. // expose real self
  11483. vm._self = vm;
  11484. initLifecycle(vm);
  11485. initEvents(vm);
  11486. initRender(vm);
  11487. callHook(vm, 'beforeCreate');
  11488. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  11489. initState(vm);
  11490. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  11491. !vm._$fallback && callHook(vm, 'created');
  11492. /* istanbul ignore if */
  11493. if ( true && config.performance && mark) {
  11494. vm._name = formatComponentName(vm, false);
  11495. mark(endTag);
  11496. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  11497. }
  11498. if (vm.$options.el) {
  11499. vm.$mount(vm.$options.el);
  11500. }
  11501. };
  11502. }
  11503. function initInternalComponent (vm, options) {
  11504. var opts = vm.$options = Object.create(vm.constructor.options);
  11505. // doing this because it's faster than dynamic enumeration.
  11506. var parentVnode = options._parentVnode;
  11507. opts.parent = options.parent;
  11508. opts._parentVnode = parentVnode;
  11509. var vnodeComponentOptions = parentVnode.componentOptions;
  11510. opts.propsData = vnodeComponentOptions.propsData;
  11511. opts._parentListeners = vnodeComponentOptions.listeners;
  11512. opts._renderChildren = vnodeComponentOptions.children;
  11513. opts._componentTag = vnodeComponentOptions.tag;
  11514. if (options.render) {
  11515. opts.render = options.render;
  11516. opts.staticRenderFns = options.staticRenderFns;
  11517. }
  11518. }
  11519. function resolveConstructorOptions (Ctor) {
  11520. var options = Ctor.options;
  11521. if (Ctor.super) {
  11522. var superOptions = resolveConstructorOptions(Ctor.super);
  11523. var cachedSuperOptions = Ctor.superOptions;
  11524. if (superOptions !== cachedSuperOptions) {
  11525. // super option changed,
  11526. // need to resolve new options.
  11527. Ctor.superOptions = superOptions;
  11528. // check if there are any late-modified/attached options (#4976)
  11529. var modifiedOptions = resolveModifiedOptions(Ctor);
  11530. // update base extend options
  11531. if (modifiedOptions) {
  11532. extend(Ctor.extendOptions, modifiedOptions);
  11533. }
  11534. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  11535. if (options.name) {
  11536. options.components[options.name] = Ctor;
  11537. }
  11538. }
  11539. }
  11540. return options
  11541. }
  11542. function resolveModifiedOptions (Ctor) {
  11543. var modified;
  11544. var latest = Ctor.options;
  11545. var sealed = Ctor.sealedOptions;
  11546. for (var key in latest) {
  11547. if (latest[key] !== sealed[key]) {
  11548. if (!modified) { modified = {}; }
  11549. modified[key] = latest[key];
  11550. }
  11551. }
  11552. return modified
  11553. }
  11554. function Vue (options) {
  11555. if ( true &&
  11556. !(this instanceof Vue)
  11557. ) {
  11558. warn('Vue is a constructor and should be called with the `new` keyword');
  11559. }
  11560. this._init(options);
  11561. }
  11562. initMixin(Vue);
  11563. stateMixin(Vue);
  11564. eventsMixin(Vue);
  11565. lifecycleMixin(Vue);
  11566. renderMixin(Vue);
  11567. /* */
  11568. function initUse (Vue) {
  11569. Vue.use = function (plugin) {
  11570. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  11571. if (installedPlugins.indexOf(plugin) > -1) {
  11572. return this
  11573. }
  11574. // additional parameters
  11575. var args = toArray(arguments, 1);
  11576. args.unshift(this);
  11577. if (typeof plugin.install === 'function') {
  11578. plugin.install.apply(plugin, args);
  11579. } else if (typeof plugin === 'function') {
  11580. plugin.apply(null, args);
  11581. }
  11582. installedPlugins.push(plugin);
  11583. return this
  11584. };
  11585. }
  11586. /* */
  11587. function initMixin$1 (Vue) {
  11588. Vue.mixin = function (mixin) {
  11589. this.options = mergeOptions(this.options, mixin);
  11590. return this
  11591. };
  11592. }
  11593. /* */
  11594. function initExtend (Vue) {
  11595. /**
  11596. * Each instance constructor, including Vue, has a unique
  11597. * cid. This enables us to create wrapped "child
  11598. * constructors" for prototypal inheritance and cache them.
  11599. */
  11600. Vue.cid = 0;
  11601. var cid = 1;
  11602. /**
  11603. * Class inheritance
  11604. */
  11605. Vue.extend = function (extendOptions) {
  11606. extendOptions = extendOptions || {};
  11607. var Super = this;
  11608. var SuperId = Super.cid;
  11609. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  11610. if (cachedCtors[SuperId]) {
  11611. return cachedCtors[SuperId]
  11612. }
  11613. var name = extendOptions.name || Super.options.name;
  11614. if ( true && name) {
  11615. validateComponentName(name);
  11616. }
  11617. var Sub = function VueComponent (options) {
  11618. this._init(options);
  11619. };
  11620. Sub.prototype = Object.create(Super.prototype);
  11621. Sub.prototype.constructor = Sub;
  11622. Sub.cid = cid++;
  11623. Sub.options = mergeOptions(
  11624. Super.options,
  11625. extendOptions
  11626. );
  11627. Sub['super'] = Super;
  11628. // For props and computed properties, we define the proxy getters on
  11629. // the Vue instances at extension time, on the extended prototype. This
  11630. // avoids Object.defineProperty calls for each instance created.
  11631. if (Sub.options.props) {
  11632. initProps$1(Sub);
  11633. }
  11634. if (Sub.options.computed) {
  11635. initComputed$1(Sub);
  11636. }
  11637. // allow further extension/mixin/plugin usage
  11638. Sub.extend = Super.extend;
  11639. Sub.mixin = Super.mixin;
  11640. Sub.use = Super.use;
  11641. // create asset registers, so extended classes
  11642. // can have their private assets too.
  11643. ASSET_TYPES.forEach(function (type) {
  11644. Sub[type] = Super[type];
  11645. });
  11646. // enable recursive self-lookup
  11647. if (name) {
  11648. Sub.options.components[name] = Sub;
  11649. }
  11650. // keep a reference to the super options at extension time.
  11651. // later at instantiation we can check if Super's options have
  11652. // been updated.
  11653. Sub.superOptions = Super.options;
  11654. Sub.extendOptions = extendOptions;
  11655. Sub.sealedOptions = extend({}, Sub.options);
  11656. // cache constructor
  11657. cachedCtors[SuperId] = Sub;
  11658. return Sub
  11659. };
  11660. }
  11661. function initProps$1 (Comp) {
  11662. var props = Comp.options.props;
  11663. for (var key in props) {
  11664. proxy(Comp.prototype, "_props", key);
  11665. }
  11666. }
  11667. function initComputed$1 (Comp) {
  11668. var computed = Comp.options.computed;
  11669. for (var key in computed) {
  11670. defineComputed(Comp.prototype, key, computed[key]);
  11671. }
  11672. }
  11673. /* */
  11674. function initAssetRegisters (Vue) {
  11675. /**
  11676. * Create asset registration methods.
  11677. */
  11678. ASSET_TYPES.forEach(function (type) {
  11679. Vue[type] = function (
  11680. id,
  11681. definition
  11682. ) {
  11683. if (!definition) {
  11684. return this.options[type + 's'][id]
  11685. } else {
  11686. /* istanbul ignore if */
  11687. if ( true && type === 'component') {
  11688. validateComponentName(id);
  11689. }
  11690. if (type === 'component' && isPlainObject(definition)) {
  11691. definition.name = definition.name || id;
  11692. definition = this.options._base.extend(definition);
  11693. }
  11694. if (type === 'directive' && typeof definition === 'function') {
  11695. definition = { bind: definition, update: definition };
  11696. }
  11697. this.options[type + 's'][id] = definition;
  11698. return definition
  11699. }
  11700. };
  11701. });
  11702. }
  11703. /* */
  11704. function getComponentName (opts) {
  11705. return opts && (opts.Ctor.options.name || opts.tag)
  11706. }
  11707. function matches (pattern, name) {
  11708. if (Array.isArray(pattern)) {
  11709. return pattern.indexOf(name) > -1
  11710. } else if (typeof pattern === 'string') {
  11711. return pattern.split(',').indexOf(name) > -1
  11712. } else if (isRegExp(pattern)) {
  11713. return pattern.test(name)
  11714. }
  11715. /* istanbul ignore next */
  11716. return false
  11717. }
  11718. function pruneCache (keepAliveInstance, filter) {
  11719. var cache = keepAliveInstance.cache;
  11720. var keys = keepAliveInstance.keys;
  11721. var _vnode = keepAliveInstance._vnode;
  11722. for (var key in cache) {
  11723. var cachedNode = cache[key];
  11724. if (cachedNode) {
  11725. var name = getComponentName(cachedNode.componentOptions);
  11726. if (name && !filter(name)) {
  11727. pruneCacheEntry(cache, key, keys, _vnode);
  11728. }
  11729. }
  11730. }
  11731. }
  11732. function pruneCacheEntry (
  11733. cache,
  11734. key,
  11735. keys,
  11736. current
  11737. ) {
  11738. var cached$$1 = cache[key];
  11739. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  11740. cached$$1.componentInstance.$destroy();
  11741. }
  11742. cache[key] = null;
  11743. remove(keys, key);
  11744. }
  11745. var patternTypes = [String, RegExp, Array];
  11746. var KeepAlive = {
  11747. name: 'keep-alive',
  11748. abstract: true,
  11749. props: {
  11750. include: patternTypes,
  11751. exclude: patternTypes,
  11752. max: [String, Number]
  11753. },
  11754. created: function created () {
  11755. this.cache = Object.create(null);
  11756. this.keys = [];
  11757. },
  11758. destroyed: function destroyed () {
  11759. for (var key in this.cache) {
  11760. pruneCacheEntry(this.cache, key, this.keys);
  11761. }
  11762. },
  11763. mounted: function mounted () {
  11764. var this$1 = this;
  11765. this.$watch('include', function (val) {
  11766. pruneCache(this$1, function (name) { return matches(val, name); });
  11767. });
  11768. this.$watch('exclude', function (val) {
  11769. pruneCache(this$1, function (name) { return !matches(val, name); });
  11770. });
  11771. },
  11772. render: function render () {
  11773. var slot = this.$slots.default;
  11774. var vnode = getFirstComponentChild(slot);
  11775. var componentOptions = vnode && vnode.componentOptions;
  11776. if (componentOptions) {
  11777. // check pattern
  11778. var name = getComponentName(componentOptions);
  11779. var ref = this;
  11780. var include = ref.include;
  11781. var exclude = ref.exclude;
  11782. if (
  11783. // not included
  11784. (include && (!name || !matches(include, name))) ||
  11785. // excluded
  11786. (exclude && name && matches(exclude, name))
  11787. ) {
  11788. return vnode
  11789. }
  11790. var ref$1 = this;
  11791. var cache = ref$1.cache;
  11792. var keys = ref$1.keys;
  11793. var key = vnode.key == null
  11794. // same constructor may get registered as different local components
  11795. // so cid alone is not enough (#3269)
  11796. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  11797. : vnode.key;
  11798. if (cache[key]) {
  11799. vnode.componentInstance = cache[key].componentInstance;
  11800. // make current key freshest
  11801. remove(keys, key);
  11802. keys.push(key);
  11803. } else {
  11804. cache[key] = vnode;
  11805. keys.push(key);
  11806. // prune oldest entry
  11807. if (this.max && keys.length > parseInt(this.max)) {
  11808. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  11809. }
  11810. }
  11811. vnode.data.keepAlive = true;
  11812. }
  11813. return vnode || (slot && slot[0])
  11814. }
  11815. };
  11816. var builtInComponents = {
  11817. KeepAlive: KeepAlive
  11818. };
  11819. /* */
  11820. function initGlobalAPI (Vue) {
  11821. // config
  11822. var configDef = {};
  11823. configDef.get = function () { return config; };
  11824. if (true) {
  11825. configDef.set = function () {
  11826. warn(
  11827. 'Do not replace the Vue.config object, set individual fields instead.'
  11828. );
  11829. };
  11830. }
  11831. Object.defineProperty(Vue, 'config', configDef);
  11832. // exposed util methods.
  11833. // NOTE: these are not considered part of the public API - avoid relying on
  11834. // them unless you are aware of the risk.
  11835. Vue.util = {
  11836. warn: warn,
  11837. extend: extend,
  11838. mergeOptions: mergeOptions,
  11839. defineReactive: defineReactive$$1
  11840. };
  11841. Vue.set = set;
  11842. Vue.delete = del;
  11843. Vue.nextTick = nextTick;
  11844. // 2.6 explicit observable API
  11845. Vue.observable = function (obj) {
  11846. observe(obj);
  11847. return obj
  11848. };
  11849. Vue.options = Object.create(null);
  11850. ASSET_TYPES.forEach(function (type) {
  11851. Vue.options[type + 's'] = Object.create(null);
  11852. });
  11853. // this is used to identify the "base" constructor to extend all plain-object
  11854. // components with in Weex's multi-instance scenarios.
  11855. Vue.options._base = Vue;
  11856. extend(Vue.options.components, builtInComponents);
  11857. initUse(Vue);
  11858. initMixin$1(Vue);
  11859. initExtend(Vue);
  11860. initAssetRegisters(Vue);
  11861. }
  11862. initGlobalAPI(Vue);
  11863. Object.defineProperty(Vue.prototype, '$isServer', {
  11864. get: isServerRendering
  11865. });
  11866. Object.defineProperty(Vue.prototype, '$ssrContext', {
  11867. get: function get () {
  11868. /* istanbul ignore next */
  11869. return this.$vnode && this.$vnode.ssrContext
  11870. }
  11871. });
  11872. // expose FunctionalRenderContext for ssr runtime helper installation
  11873. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  11874. value: FunctionalRenderContext
  11875. });
  11876. Vue.version = '2.6.11';
  11877. /**
  11878. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  11879. */
  11880. var ARRAYTYPE = '[object Array]';
  11881. var OBJECTTYPE = '[object Object]';
  11882. // const FUNCTIONTYPE = '[object Function]'
  11883. function diff(current, pre) {
  11884. var result = {};
  11885. syncKeys(current, pre);
  11886. _diff(current, pre, '', result);
  11887. return result
  11888. }
  11889. function syncKeys(current, pre) {
  11890. if (current === pre) { return }
  11891. var rootCurrentType = type(current);
  11892. var rootPreType = type(pre);
  11893. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  11894. if(Object.keys(current).length >= Object.keys(pre).length){
  11895. for (var key in pre) {
  11896. var currentValue = current[key];
  11897. if (currentValue === undefined) {
  11898. current[key] = null;
  11899. } else {
  11900. syncKeys(currentValue, pre[key]);
  11901. }
  11902. }
  11903. }
  11904. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  11905. if (current.length >= pre.length) {
  11906. pre.forEach(function (item, index) {
  11907. syncKeys(current[index], item);
  11908. });
  11909. }
  11910. }
  11911. }
  11912. function _diff(current, pre, path, result) {
  11913. if (current === pre) { return }
  11914. var rootCurrentType = type(current);
  11915. var rootPreType = type(pre);
  11916. if (rootCurrentType == OBJECTTYPE) {
  11917. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  11918. setResult(result, path, current);
  11919. } else {
  11920. var loop = function ( key ) {
  11921. var currentValue = current[key];
  11922. var preValue = pre[key];
  11923. var currentType = type(currentValue);
  11924. var preType = type(preValue);
  11925. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  11926. if (currentValue !== pre[key]) {
  11927. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11928. }
  11929. } else if (currentType == ARRAYTYPE) {
  11930. if (preType != ARRAYTYPE) {
  11931. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11932. } else {
  11933. if (currentValue.length < preValue.length) {
  11934. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11935. } else {
  11936. currentValue.forEach(function (item, index) {
  11937. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  11938. });
  11939. }
  11940. }
  11941. } else if (currentType == OBJECTTYPE) {
  11942. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  11943. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11944. } else {
  11945. for (var subKey in currentValue) {
  11946. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  11947. }
  11948. }
  11949. }
  11950. };
  11951. for (var key in current) loop( key );
  11952. }
  11953. } else if (rootCurrentType == ARRAYTYPE) {
  11954. if (rootPreType != ARRAYTYPE) {
  11955. setResult(result, path, current);
  11956. } else {
  11957. if (current.length < pre.length) {
  11958. setResult(result, path, current);
  11959. } else {
  11960. current.forEach(function (item, index) {
  11961. _diff(item, pre[index], path + '[' + index + ']', result);
  11962. });
  11963. }
  11964. }
  11965. } else {
  11966. setResult(result, path, current);
  11967. }
  11968. }
  11969. function setResult(result, k, v) {
  11970. // if (type(v) != FUNCTIONTYPE) {
  11971. result[k] = v;
  11972. // }
  11973. }
  11974. function type(obj) {
  11975. return Object.prototype.toString.call(obj)
  11976. }
  11977. /* */
  11978. function flushCallbacks$1(vm) {
  11979. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  11980. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  11981. var mpInstance = vm.$scope;
  11982. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  11983. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  11984. }
  11985. var copies = vm.__next_tick_callbacks.slice(0);
  11986. vm.__next_tick_callbacks.length = 0;
  11987. for (var i = 0; i < copies.length; i++) {
  11988. copies[i]();
  11989. }
  11990. }
  11991. }
  11992. function hasRenderWatcher(vm) {
  11993. return queue.find(function (watcher) { return vm._watcher === watcher; })
  11994. }
  11995. function nextTick$1(vm, cb) {
  11996. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  11997. //2.nextTick 之前存在 render watcher
  11998. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  11999. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  12000. var mpInstance = vm.$scope;
  12001. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  12002. ']:nextVueTick');
  12003. }
  12004. return nextTick(cb, vm)
  12005. }else{
  12006. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  12007. var mpInstance$1 = vm.$scope;
  12008. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  12009. ']:nextMPTick');
  12010. }
  12011. }
  12012. var _resolve;
  12013. if (!vm.__next_tick_callbacks) {
  12014. vm.__next_tick_callbacks = [];
  12015. }
  12016. vm.__next_tick_callbacks.push(function () {
  12017. if (cb) {
  12018. try {
  12019. cb.call(vm);
  12020. } catch (e) {
  12021. handleError(e, vm, 'nextTick');
  12022. }
  12023. } else if (_resolve) {
  12024. _resolve(vm);
  12025. }
  12026. });
  12027. // $flow-disable-line
  12028. if (!cb && typeof Promise !== 'undefined') {
  12029. return new Promise(function (resolve) {
  12030. _resolve = resolve;
  12031. })
  12032. }
  12033. }
  12034. /* */
  12035. function cloneWithData(vm) {
  12036. // 确保当前 vm 所有数据被同步
  12037. var ret = Object.create(null);
  12038. var dataKeys = [].concat(
  12039. Object.keys(vm._data || {}),
  12040. Object.keys(vm._computedWatchers || {}));
  12041. dataKeys.reduce(function(ret, key) {
  12042. ret[key] = vm[key];
  12043. return ret
  12044. }, ret);
  12045. // vue-composition-api
  12046. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  12047. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  12048. if (rawBindings) {
  12049. Object.keys(rawBindings).forEach(function (key) {
  12050. ret[key] = vm[key];
  12051. });
  12052. }
  12053. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  12054. Object.assign(ret, vm.$mp.data || {});
  12055. if (
  12056. Array.isArray(vm.$options.behaviors) &&
  12057. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12058. ) { //form-field
  12059. ret['name'] = vm.name;
  12060. ret['value'] = vm.value;
  12061. }
  12062. return JSON.parse(JSON.stringify(ret))
  12063. }
  12064. var patch = function(oldVnode, vnode) {
  12065. var this$1 = this;
  12066. if (vnode === null) { //destroy
  12067. return
  12068. }
  12069. if (this.mpType === 'page' || this.mpType === 'component') {
  12070. var mpInstance = this.$scope;
  12071. var data = Object.create(null);
  12072. try {
  12073. data = cloneWithData(this);
  12074. } catch (err) {
  12075. console.error(err);
  12076. }
  12077. data.__webviewId__ = mpInstance.data.__webviewId__;
  12078. var mpData = Object.create(null);
  12079. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  12080. mpData[key] = mpInstance.data[key];
  12081. });
  12082. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  12083. if (Object.keys(diffData).length) {
  12084. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  12085. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  12086. ']差量更新',
  12087. JSON.stringify(diffData));
  12088. }
  12089. this.__next_tick_pending = true;
  12090. mpInstance.setData(diffData, function () {
  12091. this$1.__next_tick_pending = false;
  12092. flushCallbacks$1(this$1);
  12093. });
  12094. } else {
  12095. flushCallbacks$1(this);
  12096. }
  12097. }
  12098. };
  12099. /* */
  12100. function createEmptyRender() {
  12101. }
  12102. function mountComponent$1(
  12103. vm,
  12104. el,
  12105. hydrating
  12106. ) {
  12107. if (!vm.mpType) {//main.js 中的 new Vue
  12108. return vm
  12109. }
  12110. if (vm.mpType === 'app') {
  12111. vm.$options.render = createEmptyRender;
  12112. }
  12113. if (!vm.$options.render) {
  12114. vm.$options.render = createEmptyRender;
  12115. if (true) {
  12116. /* istanbul ignore if */
  12117. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  12118. vm.$options.el || el) {
  12119. warn(
  12120. 'You are using the runtime-only build of Vue where the template ' +
  12121. 'compiler is not available. Either pre-compile the templates into ' +
  12122. 'render functions, or use the compiler-included build.',
  12123. vm
  12124. );
  12125. } else {
  12126. warn(
  12127. 'Failed to mount component: template or render function not defined.',
  12128. vm
  12129. );
  12130. }
  12131. }
  12132. }
  12133. !vm._$fallback && callHook(vm, 'beforeMount');
  12134. var updateComponent = function () {
  12135. vm._update(vm._render(), hydrating);
  12136. };
  12137. // we set this to vm._watcher inside the watcher's constructor
  12138. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  12139. // component's mounted hook), which relies on vm._watcher being already defined
  12140. new Watcher(vm, updateComponent, noop, {
  12141. before: function before() {
  12142. if (vm._isMounted && !vm._isDestroyed) {
  12143. callHook(vm, 'beforeUpdate');
  12144. }
  12145. }
  12146. }, true /* isRenderWatcher */);
  12147. hydrating = false;
  12148. return vm
  12149. }
  12150. /* */
  12151. function renderClass (
  12152. staticClass,
  12153. dynamicClass
  12154. ) {
  12155. if (isDef(staticClass) || isDef(dynamicClass)) {
  12156. return concat(staticClass, stringifyClass(dynamicClass))
  12157. }
  12158. /* istanbul ignore next */
  12159. return ''
  12160. }
  12161. function concat (a, b) {
  12162. return a ? b ? (a + ' ' + b) : a : (b || '')
  12163. }
  12164. function stringifyClass (value) {
  12165. if (Array.isArray(value)) {
  12166. return stringifyArray(value)
  12167. }
  12168. if (isObject(value)) {
  12169. return stringifyObject(value)
  12170. }
  12171. if (typeof value === 'string') {
  12172. return value
  12173. }
  12174. /* istanbul ignore next */
  12175. return ''
  12176. }
  12177. function stringifyArray (value) {
  12178. var res = '';
  12179. var stringified;
  12180. for (var i = 0, l = value.length; i < l; i++) {
  12181. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  12182. if (res) { res += ' '; }
  12183. res += stringified;
  12184. }
  12185. }
  12186. return res
  12187. }
  12188. function stringifyObject (value) {
  12189. var res = '';
  12190. for (var key in value) {
  12191. if (value[key]) {
  12192. if (res) { res += ' '; }
  12193. res += key;
  12194. }
  12195. }
  12196. return res
  12197. }
  12198. /* */
  12199. var parseStyleText = cached(function (cssText) {
  12200. var res = {};
  12201. var listDelimiter = /;(?![^(]*\))/g;
  12202. var propertyDelimiter = /:(.+)/;
  12203. cssText.split(listDelimiter).forEach(function (item) {
  12204. if (item) {
  12205. var tmp = item.split(propertyDelimiter);
  12206. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  12207. }
  12208. });
  12209. return res
  12210. });
  12211. // normalize possible array / string values into Object
  12212. function normalizeStyleBinding (bindingStyle) {
  12213. if (Array.isArray(bindingStyle)) {
  12214. return toObject(bindingStyle)
  12215. }
  12216. if (typeof bindingStyle === 'string') {
  12217. return parseStyleText(bindingStyle)
  12218. }
  12219. return bindingStyle
  12220. }
  12221. /* */
  12222. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  12223. function getTarget(obj, path) {
  12224. var parts = path.split('.');
  12225. var key = parts[0];
  12226. if (key.indexOf('__$n') === 0) { //number index
  12227. key = parseInt(key.replace('__$n', ''));
  12228. }
  12229. if (parts.length === 1) {
  12230. return obj[key]
  12231. }
  12232. return getTarget(obj[key], parts.slice(1).join('.'))
  12233. }
  12234. function internalMixin(Vue) {
  12235. Vue.config.errorHandler = function(err, vm, info) {
  12236. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  12237. console.error(err);
  12238. /* eslint-disable no-undef */
  12239. var app = typeof getApp === 'function' && getApp();
  12240. if (app && app.onError) {
  12241. app.onError(err);
  12242. }
  12243. };
  12244. var oldEmit = Vue.prototype.$emit;
  12245. Vue.prototype.$emit = function(event) {
  12246. if (this.$scope && event) {
  12247. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  12248. __args__: toArray(arguments, 1)
  12249. });
  12250. }
  12251. return oldEmit.apply(this, arguments)
  12252. };
  12253. Vue.prototype.$nextTick = function(fn) {
  12254. return nextTick$1(this, fn)
  12255. };
  12256. MP_METHODS.forEach(function (method) {
  12257. Vue.prototype[method] = function(args) {
  12258. if (this.$scope && this.$scope[method]) {
  12259. return this.$scope[method](args)
  12260. }
  12261. // mp-alipay
  12262. if (typeof my === 'undefined') {
  12263. return
  12264. }
  12265. if (method === 'createSelectorQuery') {
  12266. /* eslint-disable no-undef */
  12267. return my.createSelectorQuery(args)
  12268. } else if (method === 'createIntersectionObserver') {
  12269. /* eslint-disable no-undef */
  12270. return my.createIntersectionObserver(args)
  12271. }
  12272. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  12273. };
  12274. });
  12275. Vue.prototype.__init_provide = initProvide;
  12276. Vue.prototype.__init_injections = initInjections;
  12277. Vue.prototype.__call_hook = function(hook, args) {
  12278. var vm = this;
  12279. // #7573 disable dep collection when invoking lifecycle hooks
  12280. pushTarget();
  12281. var handlers = vm.$options[hook];
  12282. var info = hook + " hook";
  12283. var ret;
  12284. if (handlers) {
  12285. for (var i = 0, j = handlers.length; i < j; i++) {
  12286. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  12287. }
  12288. }
  12289. if (vm._hasHookEvent) {
  12290. vm.$emit('hook:' + hook, args);
  12291. }
  12292. popTarget();
  12293. return ret
  12294. };
  12295. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  12296. if (Array.isArray(modifiers)) {
  12297. if (modifiers.indexOf('trim') !== -1) {
  12298. value = value.trim();
  12299. }
  12300. if (modifiers.indexOf('number') !== -1) {
  12301. value = this._n(value);
  12302. }
  12303. }
  12304. if (!target) {
  12305. target = this;
  12306. }
  12307. // 解决动态属性添加
  12308. Vue.set(target, key, value);
  12309. };
  12310. Vue.prototype.__set_sync = function(target, key, value) {
  12311. if (!target) {
  12312. target = this;
  12313. }
  12314. // 解决动态属性添加
  12315. Vue.set(target, key, value);
  12316. };
  12317. Vue.prototype.__get_orig = function(item) {
  12318. if (isPlainObject(item)) {
  12319. return item['$orig'] || item
  12320. }
  12321. return item
  12322. };
  12323. Vue.prototype.__get_value = function(dataPath, target) {
  12324. return getTarget(target || this, dataPath)
  12325. };
  12326. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  12327. return renderClass(staticClass, dynamicClass)
  12328. };
  12329. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  12330. if (!dynamicStyle && !staticStyle) {
  12331. return ''
  12332. }
  12333. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  12334. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  12335. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  12336. };
  12337. Vue.prototype.__map = function(val, iteratee) {
  12338. //TODO 暂不考虑 string
  12339. var ret, i, l, keys, key;
  12340. if (Array.isArray(val)) {
  12341. ret = new Array(val.length);
  12342. for (i = 0, l = val.length; i < l; i++) {
  12343. ret[i] = iteratee(val[i], i);
  12344. }
  12345. return ret
  12346. } else if (isObject(val)) {
  12347. keys = Object.keys(val);
  12348. ret = Object.create(null);
  12349. for (i = 0, l = keys.length; i < l; i++) {
  12350. key = keys[i];
  12351. ret[key] = iteratee(val[key], key, i);
  12352. }
  12353. return ret
  12354. } else if (typeof val === 'number') {
  12355. ret = new Array(val);
  12356. for (i = 0, l = val; i < l; i++) {
  12357. // 第一个参数暂时仍和小程序一致
  12358. ret[i] = iteratee(i, i);
  12359. }
  12360. return ret
  12361. }
  12362. return []
  12363. };
  12364. }
  12365. /* */
  12366. var LIFECYCLE_HOOKS$1 = [
  12367. //App
  12368. 'onLaunch',
  12369. 'onShow',
  12370. 'onHide',
  12371. 'onUniNViewMessage',
  12372. 'onPageNotFound',
  12373. 'onThemeChange',
  12374. 'onError',
  12375. 'onUnhandledRejection',
  12376. //Page
  12377. 'onInit',
  12378. 'onLoad',
  12379. // 'onShow',
  12380. 'onReady',
  12381. // 'onHide',
  12382. 'onUnload',
  12383. 'onPullDownRefresh',
  12384. 'onReachBottom',
  12385. 'onTabItemTap',
  12386. 'onAddToFavorites',
  12387. 'onShareTimeline',
  12388. 'onShareAppMessage',
  12389. 'onResize',
  12390. 'onPageScroll',
  12391. 'onNavigationBarButtonTap',
  12392. 'onBackPress',
  12393. 'onNavigationBarSearchInputChanged',
  12394. 'onNavigationBarSearchInputConfirmed',
  12395. 'onNavigationBarSearchInputClicked',
  12396. //Component
  12397. // 'onReady', // 兼容旧版本,应该移除该事件
  12398. 'onPageShow',
  12399. 'onPageHide',
  12400. 'onPageResize'
  12401. ];
  12402. function lifecycleMixin$1(Vue) {
  12403. //fixed vue-class-component
  12404. var oldExtend = Vue.extend;
  12405. Vue.extend = function(extendOptions) {
  12406. extendOptions = extendOptions || {};
  12407. var methods = extendOptions.methods;
  12408. if (methods) {
  12409. Object.keys(methods).forEach(function (methodName) {
  12410. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  12411. extendOptions[methodName] = methods[methodName];
  12412. delete methods[methodName];
  12413. }
  12414. });
  12415. }
  12416. return oldExtend.call(this, extendOptions)
  12417. };
  12418. var strategies = Vue.config.optionMergeStrategies;
  12419. var mergeHook = strategies.created;
  12420. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  12421. strategies[hook] = mergeHook;
  12422. });
  12423. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  12424. }
  12425. /* */
  12426. // install platform patch function
  12427. Vue.prototype.__patch__ = patch;
  12428. // public mount method
  12429. Vue.prototype.$mount = function(
  12430. el ,
  12431. hydrating
  12432. ) {
  12433. return mountComponent$1(this, el, hydrating)
  12434. };
  12435. lifecycleMixin$1(Vue);
  12436. internalMixin(Vue);
  12437. /* */
  12438. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  12439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  12440. /***/ }),
  12441. /***/ 40:
  12442. /*!********************************************************************!*\
  12443. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  12444. \********************************************************************/
  12445. /*! no static exports found */
  12446. /***/ (function(module, exports, __webpack_require__) {
  12447. "use strict";
  12448. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  12449. /**
  12450. * actionsheet: 999
  12451. * modal: 999
  12452. * navigate: 998
  12453. * tabbar: 998
  12454. * toast: 999
  12455. */var _default =
  12456. {
  12457. toast: 10090,
  12458. noNetwork: 10080,
  12459. // popup包含popup,actionsheet,keyboard,picker的值
  12460. popup: 10075,
  12461. mask: 10070,
  12462. navbar: 980,
  12463. topTips: 975,
  12464. sticky: 970,
  12465. indexListSticky: 965 };exports.default = _default;
  12466. /***/ }),
  12467. /***/ 41:
  12468. /*!***********************************!*\
  12469. !*** E:/fp/md/mdapp/api/index.js ***!
  12470. \***********************************/
  12471. /*! no static exports found */
  12472. /***/ (function(module, exports, __webpack_require__) {
  12473. "use strict";
  12474. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  12475. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));
  12476. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 46));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  12477. {
  12478. base: _base.default,
  12479. estate: _estate.default,
  12480. cust: _cust.default };exports.default = _default;
  12481. /***/ }),
  12482. /***/ 42:
  12483. /*!**********************************!*\
  12484. !*** E:/fp/md/mdapp/api/base.js ***!
  12485. \**********************************/
  12486. /*! no static exports found */
  12487. /***/ (function(module, exports, __webpack_require__) {
  12488. "use strict";
  12489. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12490. {
  12491. apilogin: function apilogin(params) {// 登录
  12492. return (0, _http.request)('api/login', params, 'loading');
  12493. },
  12494. apiregister: function apiregister(params) {// 注册
  12495. return (0, _http.request)('api/register', params, 'loading');
  12496. },
  12497. apisendsms: function apisendsms(params) {// 发送短信
  12498. return (0, _http.request)('api/send/sms', params, 'loading');
  12499. },
  12500. apicaptcha: function apicaptcha(params) {// 验证码图片
  12501. return (0, _http.request)('api/captcha', params, 'loading');
  12502. },
  12503. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  12504. return (0, _http.request)('api/check/captcha', params);
  12505. },
  12506. apiwxlogin: function apiwxlogin(params) {// 微信登录
  12507. return (0, _http.request)('api/wx/login', params, 'loading');
  12508. },
  12509. apiwxautologin: function apiwxautologin(params) {// 微信登录 自动
  12510. return (0, _http.request)('api/wx/autologin', params, 'loading');
  12511. } };exports.default = _default;
  12512. /***/ }),
  12513. /***/ 43:
  12514. /*!************************************!*\
  12515. !*** E:/fp/md/mdapp/utils/http.js ***!
  12516. \************************************/
  12517. /*! no static exports found */
  12518. /***/ (function(module, exports, __webpack_require__) {
  12519. "use strict";
  12520. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request;var _utils = __webpack_require__(/*! @utils */ 44);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  12521. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  12522. return new Promise(function (resolve, reject) {
  12523. if (options.loadingStr === 'loading') {
  12524. uni.showLoading({
  12525. mask: true,
  12526. title: '加载中..' });
  12527. }
  12528. var token = uni.getStorageSync('MD_token') || '';
  12529. var header = {
  12530. 'Content-Type': 'application/json',
  12531. 'token': token
  12532. // 'Content-Type': 'application/x-www-form-urlencoded'
  12533. };
  12534. var params = _objectSpread({}, options.data);
  12535. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  12536. for (var key in options.data) {
  12537. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  12538. params[key] = '';
  12539. }
  12540. }
  12541. var url = uni.baseUrl + options.url;
  12542. // let url = options.url
  12543. if (options.queryData) {
  12544. var qStr = '';
  12545. for (var k in options.queryData) {
  12546. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  12547. }
  12548. qStr = qStr.substr(0, qStr.length - 1);
  12549. url += "?".concat(qStr);
  12550. }
  12551. uni.request({
  12552. url: url,
  12553. data: _objectSpread({},
  12554. params),
  12555. header: header,
  12556. method: options.method || 'POST',
  12557. complete: function complete(res) {
  12558. if (options.loadingStr === 'loading') {
  12559. uni.hideLoading();
  12560. }
  12561. },
  12562. success: function success(res) {var
  12563. cData = res.data;
  12564. var code = cData.errno;
  12565. switch (code) {
  12566. case 0:
  12567. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  12568. break;
  12569. case 401:
  12570. case 404:
  12571. case 405:
  12572. uni.removeStorageSync('MD_userInfo');
  12573. uni.removeStorageSync('MD_token');
  12574. // 差一个补是否绑定微信
  12575. if (uni.getStorageSync('APP_token')) {
  12576. uni.login({
  12577. success: function success(res) {
  12578. if (res.code) {
  12579. uni.api.base.apiwxautologin({ code: res.code }).then(function (cData) {
  12580. if (cData.token === 'error') {
  12581. uni.removeStorageSync('APP_token');
  12582. } else {
  12583. uni.setStorageSync('APP_userInfo', cData);
  12584. uni.setStorageSync('APP_token', cData.token);
  12585. }
  12586. });
  12587. }
  12588. } });
  12589. } else {
  12590. uni.showToast({
  12591. title: "\u8BF7\u5148\u767B\u5F55~",
  12592. icon: 'none' });
  12593. }
  12594. uni.navigateTo({
  12595. url: '/pages/user/login/login' });
  12596. break;
  12597. default:
  12598. uni.showModal({
  12599. title: '提示',
  12600. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  12601. return reject(cData);}
  12602. // resolve()
  12603. },
  12604. fail: function fail(err) {
  12605. console.log(err);
  12606. reject(err);
  12607. } });
  12608. });
  12609. };
  12610. // export default Http
  12611. function request(url, data, loadingStr, queryData) {
  12612. return Http({
  12613. url: url,
  12614. data: data,
  12615. loadingStr: loadingStr,
  12616. queryData: queryData });
  12617. }
  12618. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12619. /***/ }),
  12620. /***/ 44:
  12621. /*!*************************************!*\
  12622. !*** E:/fp/md/mdapp/utils/index.js ***!
  12623. \*************************************/
  12624. /*! no static exports found */
  12625. /***/ (function(module, exports, __webpack_require__) {
  12626. "use strict";
  12627. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  12628. * @param {string} str
  12629. * @returns {string}
  12630. */
  12631. function strTrim(str) {
  12632. return str.replace(/(^\s*)|(\s*$)/g, '');
  12633. }
  12634. /**
  12635. * @param {Number} num
  12636. * @returns {string}
  12637. */
  12638. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  12639. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  12640. var arr = numArr[0].split('').reverse();
  12641. var res = [];
  12642. for (var i = 0; i < arr.length; i++) {
  12643. if (i % 3 === 0 && i !== 0) {
  12644. res.push(',');
  12645. }
  12646. res.push(arr[i]);
  12647. }
  12648. res.reverse();
  12649. if (numArr[1]) {
  12650. res = res.join('').concat('.' + numArr[1]);
  12651. } else {
  12652. res = res.join('');
  12653. }
  12654. // let res = num.toString().replace(/\d+/, function(n){
  12655. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  12656. // return $1 + ","
  12657. // })
  12658. // })
  12659. // toLocaleString()
  12660. return res;
  12661. }
  12662. /**
  12663. * @param {Array} arr
  12664. * @returns {Object}
  12665. */
  12666. function arrToObj(arr) {
  12667. var obj = {};
  12668. if (Object.prototype.toString.call(arr) === '[object Array]') {
  12669. if (arr.length > 0) {
  12670. arr.forEach(function (item) {
  12671. obj[item.val] = item.key;
  12672. });
  12673. }
  12674. }
  12675. return obj;
  12676. }
  12677. /**
  12678. * @param {any} val
  12679. * @returns {Boolean}
  12680. */
  12681. function noEmpty(val) {
  12682. if (val === null || val === undefined || val === '') {
  12683. return false;
  12684. } else {
  12685. return true;
  12686. }
  12687. }
  12688. /**
  12689. * @param {Number} date
  12690. * @param {Boolean} onlyDate
  12691. * @returns {String}
  12692. * function time(time = +new Date()) {
  12693. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  12694. return date.toJSON().substr(0, 19).replace('T', ' ');
  12695. }
  12696. */
  12697. function comGetTime() {var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12698. var year = date.getFullYear();
  12699. var month = date.getMonth() + 1;
  12700. month = month > 9 ? month : '0' + month;
  12701. var day = date.getDate();
  12702. day = day > 9 ? day : '0' + day;
  12703. var hour = date.getHours();
  12704. hour = hour > 9 ? hour : '0' + hour;
  12705. var minute = date.getMinutes();
  12706. minute = minute > 9 ? minute : '0' + minute;
  12707. var second = date.getSeconds();
  12708. second = second > 9 ? second : '0' + second;
  12709. var milli = date.getMilliseconds();
  12710. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  12711. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  12712. }
  12713. /***/ }),
  12714. /***/ 45:
  12715. /*!************************************!*\
  12716. !*** E:/fp/md/mdapp/api/estate.js ***!
  12717. \************************************/
  12718. /*! no static exports found */
  12719. /***/ (function(module, exports, __webpack_require__) {
  12720. "use strict";
  12721. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12722. {
  12723. apiestatelist: function apiestatelist(params) {// 楼盘列表
  12724. return (0, _http.request)('api/estate/list', params, 'loading');
  12725. },
  12726. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  12727. return (0, _http.request)('api/report/add', params, 'loading');
  12728. },
  12729. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  12730. return (0, _http.request)('api/report/list', params, 'loading');
  12731. },
  12732. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  12733. return (0, _http.request)('api/report/detail', params, 'loading');
  12734. },
  12735. apireportsite: function apireportsite(params) {// 案场 - 报备详情
  12736. return (0, _http.request)('api/report/site', params, 'loading');
  12737. },
  12738. apireportconfirm: function apireportconfirm(params) {// 报备 - 报备确认
  12739. return (0, _http.request)('api/report/confirm', params, 'loading');
  12740. },
  12741. apireportcount: function apireportcount(params) {// 报备 - 报备统计
  12742. return (0, _http.request)('api/report/count', params, 'loading');
  12743. } };exports.default = _default;
  12744. /***/ }),
  12745. /***/ 46:
  12746. /*!**********************************!*\
  12747. !*** E:/fp/md/mdapp/api/cust.js ***!
  12748. \**********************************/
  12749. /*! no static exports found */
  12750. /***/ (function(module, exports, __webpack_require__) {
  12751. "use strict";
  12752. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12753. {
  12754. apicustomerlist: function apicustomerlist(params) {// 客户 列表
  12755. return (0, _http.request)('api/customer/list', params);
  12756. },
  12757. apicustomeradd: function apicustomeradd(params) {// 客户 添加
  12758. return (0, _http.request)('api/customer/add', params, 'loading');
  12759. },
  12760. apicustomeredit: function apicustomeredit(params) {// 客户 编辑
  12761. return (0, _http.request)('api/customer/edit', params, 'loading');
  12762. },
  12763. apicustomerdel: function apicustomerdel(params) {// 客户 删除
  12764. return (0, _http.request)('api/customer/del', params, 'loading');
  12765. },
  12766. apicustomerdetail: function apicustomerdetail(params) {// 客户 详情
  12767. return (0, _http.request)('api/customer/detail', params, 'loading');
  12768. } };exports.default = _default;
  12769. /***/ }),
  12770. /***/ 47:
  12771. /*!************************************!*\
  12772. !*** E:/fp/md/mdapp/utils/tool.js ***!
  12773. \************************************/
  12774. /*! no static exports found */
  12775. /***/ (function(module, exports, __webpack_require__) {
  12776. "use strict";
  12777. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getRandomNum = exports.confirmMsgFn = exports.msgBase = void 0;var getRandomNum = function getRandomNum(len, radix) {
  12778. // getRandomNum(24, 16)
  12779. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  12780. var uuid = [];
  12781. radix = radix || chars.length;
  12782. if (len) {
  12783. // Compact form
  12784. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  12785. } else {
  12786. // rfc4122, version 4 form
  12787. var r;
  12788. // rfc4122 requires these characters
  12789. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  12790. uuid[14] = '4';
  12791. // Fill in random data.  At i==19 set the high bits of clock sequence as
  12792. // per rfc4122, sec. 4.1.5
  12793. for (var _i = 0; _i < 36; _i++) {
  12794. if (!uuid[_i]) {
  12795. r = 0 | Math.random() * 16;
  12796. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  12797. }
  12798. }
  12799. }
  12800. return uuid.join('') + new Date().getTime();
  12801. };exports.getRandomNum = getRandomNum;
  12802. var msgBase = function msgBase(msgText, bc) {
  12803. uni.showToast({
  12804. title: msgText,
  12805. icon: 'none',
  12806. duration: 2000 }).
  12807. then(function () {
  12808. if (bc) bc();
  12809. });
  12810. };exports.msgBase = msgBase;
  12811. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  12812. uni.showModal({
  12813. title: title,
  12814. content: msgText,
  12815. success: function success(res) {
  12816. if (res.confirm) {
  12817. if (successBc) successBc();
  12818. } else if (res.cancel) {
  12819. if (errorBc) errorBc();
  12820. }
  12821. } });
  12822. };exports.confirmMsgFn = confirmMsgFn;
  12823. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12824. /***/ }),
  12825. /***/ 5:
  12826. /*!*********************************!*\
  12827. !*** E:/fp/md/mdapp/pages.json ***!
  12828. \*********************************/
  12829. /*! no static exports found */
  12830. /***/ (function(module, exports) {
  12831. /***/ }),
  12832. /***/ 94:
  12833. /*!**************************************!*\
  12834. !*** E:/fp/md/mdapp/utils/qrcode.js ***!
  12835. \**************************************/
  12836. /*! no static exports found */
  12837. /***/ (function(module, exports, __webpack_require__) {
  12838. "use strict";
  12839. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  12840. * qrcode-wx-miniprogram
  12841. */
  12842. var QRMode = {
  12843. MODE_NUMBER: 1 << 0,
  12844. MODE_ALPHA_NUM: 1 << 1,
  12845. MODE_8BIT_BYTE: 1 << 2,
  12846. MODE_KANJI: 1 << 3 },
  12847. QRErrorCorrectLevel = {
  12848. L: 1,
  12849. M: 0,
  12850. Q: 3,
  12851. H: 2 },
  12852. QRMaskPattern = {
  12853. PATTERN000: 0,
  12854. PATTERN001: 1,
  12855. PATTERN010: 2,
  12856. PATTERN011: 3,
  12857. PATTERN100: 4,
  12858. PATTERN101: 5,
  12859. PATTERN110: 6,
  12860. PATTERN111: 7 },
  12861. QRUtil = {
  12862. PATTERN_POSITION_TABLE: [
  12863. [],
  12864. [6, 18],
  12865. [6, 22],
  12866. [6, 26],
  12867. [6, 30],
  12868. [6, 34],
  12869. [6, 22, 38],
  12870. [6, 24, 42],
  12871. [6, 26, 46],
  12872. [6, 28, 50],
  12873. [6, 30, 54],
  12874. [6, 32, 58],
  12875. [6, 34, 62],
  12876. [6, 26, 46, 66],
  12877. [6, 26, 48, 70],
  12878. [6, 26, 50, 74],
  12879. [6, 30, 54, 78],
  12880. [6, 30, 56, 82],
  12881. [6, 30, 58, 86],
  12882. [6, 34, 62, 90],
  12883. [6, 28, 50, 72, 94],
  12884. [6, 26, 50, 74, 98],
  12885. [6, 30, 54, 78, 102],
  12886. [6, 28, 54, 80, 106],
  12887. [6, 32, 58, 84, 110],
  12888. [6, 30, 58, 86, 114],
  12889. [6, 34, 62, 90, 118],
  12890. [6, 26, 50, 74, 98, 122],
  12891. [6, 30, 54, 78, 102, 126],
  12892. [6, 26, 52, 78, 104, 130],
  12893. [6, 30, 56, 82, 108, 134],
  12894. [6, 34, 60, 86, 112, 138],
  12895. [6, 30, 58, 86, 114, 142],
  12896. [6, 34, 62, 90, 118, 146],
  12897. [6, 30, 54, 78, 102, 126, 150],
  12898. [6, 24, 50, 76, 102, 128, 154],
  12899. [6, 28, 54, 80, 106, 132, 158],
  12900. [6, 32, 58, 84, 110, 136, 162],
  12901. [6, 26, 54, 82, 110, 138, 166],
  12902. [6, 30, 58, 86, 114, 142, 170]],
  12903. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  12904. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  12905. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  12906. getBCHTypeInfo: function getBCHTypeInfo(data) {
  12907. var d = data << 10;
  12908. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  12909. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  12910. }
  12911. return (data << 10 | d) ^ QRUtil.G15_MASK;
  12912. },
  12913. getBCHTypeNumber: function getBCHTypeNumber(data) {
  12914. var d = data << 12;
  12915. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  12916. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  12917. }
  12918. return data << 12 | d;
  12919. },
  12920. getBCHDigit: function getBCHDigit(data) {
  12921. var digit = 0;
  12922. while (data != 0) {
  12923. digit++;
  12924. data >>>= 1;
  12925. }
  12926. return digit;
  12927. },
  12928. getPatternPosition: function getPatternPosition(typeNumber) {
  12929. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  12930. },
  12931. getMask: function getMask(maskPattern, i, j) {
  12932. switch (maskPattern) {
  12933. case QRMaskPattern.PATTERN000:
  12934. return (i + j) % 2 == 0;
  12935. case QRMaskPattern.PATTERN001:
  12936. return i % 2 == 0;
  12937. case QRMaskPattern.PATTERN010:
  12938. return j % 3 == 0;
  12939. case QRMaskPattern.PATTERN011:
  12940. return (i + j) % 3 == 0;
  12941. case QRMaskPattern.PATTERN100:
  12942. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  12943. case QRMaskPattern.PATTERN101:
  12944. return i * j % 2 + i * j % 3 == 0;
  12945. case QRMaskPattern.PATTERN110:
  12946. return (i * j % 2 + i * j % 3) % 2 == 0;
  12947. case QRMaskPattern.PATTERN111:
  12948. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  12949. default:
  12950. //throw new Error("bad maskPattern:" + maskPattern);
  12951. throwError("bad maskPattern:" + maskPattern);}
  12952. },
  12953. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  12954. var a = new QRPolynomial([1], 0);
  12955. for (var i = 0; i < errorCorrectLength; i++) {
  12956. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  12957. }
  12958. return a;
  12959. },
  12960. getLengthInBits: function getLengthInBits(mode, type) {
  12961. if (1 <= type && type < 10) {
  12962. switch (mode) {
  12963. case QRMode.MODE_NUMBER:
  12964. return 10;
  12965. case QRMode.MODE_ALPHA_NUM:
  12966. return 9;
  12967. case QRMode.MODE_8BIT_BYTE:
  12968. return 8;
  12969. case QRMode.MODE_KANJI:
  12970. return 8;
  12971. default:
  12972. //throw new Error("mode:" + mode);
  12973. throwError("mode:" + mode);}
  12974. } else if (type < 27) {
  12975. switch (mode) {
  12976. case QRMode.MODE_NUMBER:
  12977. return 12;
  12978. case QRMode.MODE_ALPHA_NUM:
  12979. return 11;
  12980. case QRMode.MODE_8BIT_BYTE:
  12981. return 16;
  12982. case QRMode.MODE_KANJI:
  12983. return 10;
  12984. default:
  12985. //throw new Error("mode:" + mode);
  12986. throwError("mode:" + mode);}
  12987. } else if (type < 41) {
  12988. switch (mode) {
  12989. case QRMode.MODE_NUMBER:
  12990. return 14;
  12991. case QRMode.MODE_ALPHA_NUM:
  12992. return 13;
  12993. case QRMode.MODE_8BIT_BYTE:
  12994. return 16;
  12995. case QRMode.MODE_KANJI:
  12996. return 12;
  12997. default:
  12998. //throw new Error("mode:" + mode);
  12999. throwError("mode:" + mode);}
  13000. } else {
  13001. //throw new Error("type:" + type);
  13002. throwError("type:" + type);
  13003. }
  13004. },
  13005. getLostPoint: function getLostPoint(qrCode) {
  13006. var moduleCount = qrCode.getModuleCount();
  13007. var lostPoint = 0;
  13008. for (var row = 0; row < moduleCount; row++) {
  13009. for (var col = 0; col < moduleCount; col++) {
  13010. var sameCount = 0;
  13011. var dark = qrCode.isDark(row, col);
  13012. for (var r = -1; r <= 1; r++) {
  13013. if (row + r < 0 || moduleCount <= row + r) {
  13014. continue;
  13015. }
  13016. for (var c = -1; c <= 1; c++) {
  13017. if (col + c < 0 || moduleCount <= col + c) {
  13018. continue;
  13019. }
  13020. if (r == 0 && c == 0) {
  13021. continue;
  13022. }
  13023. if (dark == qrCode.isDark(row + r, col + c)) {
  13024. sameCount++;
  13025. }
  13026. }
  13027. }
  13028. if (sameCount > 5) {
  13029. lostPoint += 3 + sameCount - 5;
  13030. }
  13031. }
  13032. }
  13033. for (var row = 0; row < moduleCount - 1; row++) {
  13034. for (var col = 0; col < moduleCount - 1; col++) {
  13035. var count = 0;
  13036. if (qrCode.isDark(row, col)) count++;
  13037. if (qrCode.isDark(row + 1, col)) count++;
  13038. if (qrCode.isDark(row, col + 1)) count++;
  13039. if (qrCode.isDark(row + 1, col + 1)) count++;
  13040. if (count == 0 || count == 4) {
  13041. lostPoint += 3;
  13042. }
  13043. }
  13044. }
  13045. for (var row = 0; row < moduleCount; row++) {
  13046. for (var col = 0; col < moduleCount - 6; col++) {
  13047. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) &&
  13048. qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col +
  13049. 5) && qrCode.isDark(row, col + 6)) {
  13050. lostPoint += 40;
  13051. }
  13052. }
  13053. }
  13054. for (var col = 0; col < moduleCount; col++) {
  13055. for (var row = 0; row < moduleCount - 6; row++) {
  13056. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) &&
  13057. qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5,
  13058. col) && qrCode.isDark(row + 6, col)) {
  13059. lostPoint += 40;
  13060. }
  13061. }
  13062. }
  13063. var darkCount = 0;
  13064. for (var col = 0; col < moduleCount; col++) {
  13065. for (var row = 0; row < moduleCount; row++) {
  13066. if (qrCode.isDark(row, col)) {
  13067. darkCount++;
  13068. }
  13069. }
  13070. }
  13071. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  13072. lostPoint += ratio * 10;
  13073. return lostPoint;
  13074. } },
  13075. QRMath = {
  13076. glog: function glog(n) {
  13077. if (n < 1) {
  13078. //throw new Error("glog(" + n + ")");
  13079. throwError("glog(" + n + ")");
  13080. }
  13081. return QRMath.LOG_TABLE[n];
  13082. },
  13083. gexp: function gexp(n) {
  13084. while (n < 0) {
  13085. n += 255;
  13086. }
  13087. while (n >= 256) {
  13088. n -= 255;
  13089. }
  13090. return QRMath.EXP_TABLE[n];
  13091. },
  13092. EXP_TABLE: new Array(256),
  13093. LOG_TABLE: new Array(256) };
  13094. for (var i = 0; i < 8; i++) {
  13095. QRMath.EXP_TABLE[i] = 1 << i;
  13096. }
  13097. for (var _i = 8; _i < 256; _i++) {
  13098. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.
  13099. EXP_TABLE[_i - 8];
  13100. }
  13101. for (var _i2 = 0; _i2 < 255; _i2++) {
  13102. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  13103. }
  13104. /*
  13105. * class QR8bitByte
  13106. * */var
  13107. QR8bitByte = /*#__PURE__*/function () {
  13108. function QR8bitByte(data) {_classCallCheck(this, QR8bitByte);
  13109. this.mode = QRMode.MODE_8BIT_BYTE;
  13110. this.data = data;
  13111. this.parsedData = [];
  13112. // Added to support UTF-8 Characters
  13113. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  13114. var byteArray = [],
  13115. code = this.data.charCodeAt(_i3);
  13116. if (code > 0x10000) {
  13117. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  13118. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  13119. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  13120. byteArray[3] = 0x80 | code & 0x3F;
  13121. } else if (code > 0x800) {
  13122. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  13123. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  13124. byteArray[2] = 0x80 | code & 0x3F;
  13125. } else if (code > 0x80) {
  13126. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  13127. byteArray[1] = 0x80 | code & 0x3F;
  13128. } else {
  13129. byteArray[0] = code;
  13130. }
  13131. this.parsedData.push(byteArray);
  13132. }
  13133. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  13134. if (this.parsedData.length !== this.data.length) {
  13135. this.parsedData.unshift(191);
  13136. this.parsedData.unshift(187);
  13137. this.parsedData.unshift(239);
  13138. }
  13139. }_createClass(QR8bitByte, [{ key: "getLength", value: function getLength(
  13140. buffer) {
  13141. return this.parsedData.length;
  13142. } }, { key: "write", value: function write(
  13143. buffer) {
  13144. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  13145. buffer.put(this.parsedData[_i4], 8);
  13146. }
  13147. } }]);return QR8bitByte;}();
  13148. /*
  13149. * class QRCodeModel
  13150. * */var
  13151. QRCodeModel = /*#__PURE__*/function () {
  13152. function QRCodeModel(typeNumber, errorCorrectLevel) {_classCallCheck(this, QRCodeModel);
  13153. this.typeNumber = typeNumber;
  13154. this.errorCorrectLevel = errorCorrectLevel;
  13155. this.modules = null;
  13156. this.moduleCount = 0;
  13157. this.dataCache = null;
  13158. this.dataList = [];
  13159. }_createClass(QRCodeModel, [{ key: "addData", value: function addData(
  13160. data) {
  13161. var newData = new QR8bitByte(data);
  13162. this.dataList.push(newData);
  13163. this.dataCache = null;
  13164. } }, { key: "isDark", value: function isDark(
  13165. row, col) {
  13166. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  13167. //throw new Error(row + ',' + col);
  13168. throwError(row + ',' + col);
  13169. }
  13170. return this.modules[row][col];
  13171. } }, { key: "getModuleCount", value: function getModuleCount()
  13172. {
  13173. return this.moduleCount;
  13174. } }, { key: "make", value: function make()
  13175. {
  13176. this.makeImpl(false, this.getBestMaskPattern());
  13177. } }, { key: "makeImpl", value: function makeImpl(
  13178. test, maskPattern) {
  13179. this.moduleCount = this.typeNumber * 4 + 17;
  13180. this.modules = new Array(this.moduleCount);
  13181. for (var row = 0; row < this.moduleCount; row++) {
  13182. this.modules[row] = new Array(this.moduleCount);
  13183. for (var col = 0; col < this.moduleCount; col++) {
  13184. this.modules[row][col] = null;
  13185. }
  13186. }
  13187. this.setupPositionProbePattern(0, 0);
  13188. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  13189. this.setupPositionProbePattern(0, this.moduleCount - 7);
  13190. this.setupPositionAdjustPattern();
  13191. this.setupTimingPattern();
  13192. this.setupTypeInfo(test, maskPattern);
  13193. if (this.typeNumber >= 7) {
  13194. this.setupTypeNumber(test);
  13195. }
  13196. if (this.dataCache == null) {
  13197. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  13198. }
  13199. this.mapData(this.dataCache, maskPattern);
  13200. } }, { key: "setupPositionProbePattern", value: function setupPositionProbePattern(
  13201. row, col) {
  13202. for (var r = -1; r <= 7; r++) {
  13203. if (row + r <= -1 || this.moduleCount <= row + r) {
  13204. continue;
  13205. }
  13206. for (var c = -1; c <= 7; c++) {
  13207. if (col + c <= -1 || this.moduleCount <= col + c) {
  13208. continue;
  13209. }
  13210. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) ||
  13211. 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  13212. }
  13213. }
  13214. } }, { key: "getBestMaskPattern", value: function getBestMaskPattern()
  13215. {
  13216. var minLostPoint = 0,
  13217. pattern = 0;
  13218. for (var _i5 = 0; _i5 < 8; _i5++) {
  13219. this.makeImpl(true, _i5);
  13220. var lostPoint = QRUtil.getLostPoint(this);
  13221. if (_i5 == 0 || minLostPoint > lostPoint) {
  13222. minLostPoint = lostPoint;
  13223. pattern = _i5;
  13224. }
  13225. }
  13226. return pattern;
  13227. } }, { key: "setupTimingPattern", value: function setupTimingPattern()
  13228. {
  13229. for (var r = 8; r < this.moduleCount - 8; r++) {
  13230. if (this.modules[r][6] != null) {
  13231. continue;
  13232. }
  13233. this.modules[r][6] = r % 2 == 0;
  13234. }
  13235. for (var c = 8; c < this.moduleCount - 8; c++) {
  13236. if (this.modules[6][c] != null) {
  13237. continue;
  13238. }
  13239. this.modules[6][c] = c % 2 == 0;
  13240. }
  13241. } }, { key: "setupPositionAdjustPattern", value: function setupPositionAdjustPattern()
  13242. {
  13243. var pos = QRUtil.getPatternPosition(this.typeNumber);
  13244. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  13245. for (var j = 0; j < pos.length; j++) {
  13246. var row = pos[_i6],
  13247. col = pos[j];
  13248. if (this.modules[row][col] != null) {
  13249. continue;
  13250. }
  13251. for (var r = -2; r <= 2; r++) {
  13252. for (var c = -2; c <= 2; c++) {
  13253. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c ==
  13254. 0;
  13255. }
  13256. }
  13257. }
  13258. }
  13259. } }, { key: "setupTypeNumber", value: function setupTypeNumber(
  13260. test) {
  13261. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  13262. for (var _i7 = 0; _i7 < 18; _i7++) {
  13263. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  13264. }
  13265. for (var _i8 = 0; _i8 < 18; _i8++) {
  13266. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  13267. }
  13268. } }, { key: "setupTypeInfo", value: function setupTypeInfo(
  13269. test, maskPattern) {
  13270. var data = this.errorCorrectLevel << 3 | maskPattern,
  13271. bits = QRUtil.getBCHTypeInfo(data);
  13272. for (var _i9 = 0; _i9 < 15; _i9++) {
  13273. var mod = !test && (bits >> _i9 & 1) == 1;
  13274. if (_i9 < 6) {
  13275. this.modules[_i9][8] = mod;
  13276. } else if (_i9 < 8) {
  13277. this.modules[_i9 + 1][8] = mod;
  13278. } else {
  13279. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  13280. }
  13281. }
  13282. for (var _i10 = 0; _i10 < 15; _i10++) {
  13283. var _mod = !test && (bits >> _i10 & 1) == 1;
  13284. if (_i10 < 8) {
  13285. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  13286. } else if (_i10 < 9) {
  13287. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  13288. } else {
  13289. this.modules[8][15 - _i10 - 1] = _mod;
  13290. }
  13291. }
  13292. this.modules[this.moduleCount - 8][8] = !test;
  13293. } }, { key: "mapData", value: function mapData(
  13294. data, maskPattern) {
  13295. var inc = -1,
  13296. row = this.moduleCount - 1,
  13297. bitIndex = 7,
  13298. byteIndex = 0;
  13299. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  13300. if (col == 6) col--;
  13301. while (true) {
  13302. for (var c = 0; c < 2; c++) {
  13303. if (this.modules[row][col - c] == null) {
  13304. var dark = false;
  13305. if (byteIndex < data.length) {
  13306. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  13307. }
  13308. var mask = QRUtil.getMask(maskPattern, row, col - c);
  13309. if (mask) {
  13310. dark = !dark;
  13311. }
  13312. this.modules[row][col - c] = dark;
  13313. bitIndex--;
  13314. if (bitIndex == -1) {
  13315. byteIndex++;
  13316. bitIndex = 7;
  13317. }
  13318. }
  13319. }
  13320. row += inc;
  13321. if (row < 0 || this.moduleCount <= row) {
  13322. row -= inc;
  13323. inc = -inc;
  13324. break;
  13325. }
  13326. }
  13327. }
  13328. } }]);return QRCodeModel;}();
  13329. QRCodeModel.PAD0 = 0xEC;
  13330. QRCodeModel.PAD1 = 0x11;
  13331. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  13332. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  13333. buffer = new QRBitBuffer();
  13334. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  13335. var data = dataList[_i11];
  13336. buffer.put(data.mode, 4);
  13337. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  13338. data.write(buffer);
  13339. }
  13340. var totalDataCount = 0;
  13341. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  13342. totalDataCount += rsBlocks[_i12].dataCount;
  13343. }
  13344. if (buffer.getLengthInBits() > totalDataCount * 8) {
  13345. /*
  13346. throw new Error("code length overflow. (" +
  13347. buffer.getLengthInBits() +
  13348. ">" +
  13349. totalDataCount * 8 +
  13350. ")");
  13351. */
  13352. throwError("code length overflow. (" +
  13353. buffer.getLengthInBits() +
  13354. ">" +
  13355. totalDataCount * 8 +
  13356. ")");
  13357. }
  13358. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  13359. buffer.put(0, 4);
  13360. }
  13361. while (buffer.getLengthInBits() % 8 != 0) {
  13362. buffer.putBit(false);
  13363. }
  13364. while (true) {
  13365. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13366. break;
  13367. }
  13368. buffer.put(QRCodeModel.PAD0, 8);
  13369. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13370. break;
  13371. }
  13372. buffer.put(QRCodeModel.PAD1, 8);
  13373. }
  13374. return QRCodeModel.createBytes(buffer, rsBlocks);
  13375. };
  13376. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  13377. var offset = 0,
  13378. maxDcCount = 0,
  13379. maxEcCount = 0,
  13380. dcData = new Array(rsBlocks.length),
  13381. ecData = new Array(rsBlocks.length);
  13382. for (var r = 0; r < rsBlocks.length; r++) {
  13383. var dcCount = rsBlocks[r].dataCount,
  13384. ecCount = rsBlocks[r].totalCount - dcCount;
  13385. maxDcCount = Math.max(maxDcCount, dcCount);
  13386. maxEcCount = Math.max(maxEcCount, ecCount);
  13387. dcData[r] = new Array(dcCount);
  13388. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  13389. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  13390. }
  13391. offset += dcCount;
  13392. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  13393. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  13394. modPoly = rawPoly.mod(rsPoly);
  13395. ecData[r] = new Array(rsPoly.getLength() - 1);
  13396. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  13397. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  13398. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  13399. }
  13400. }
  13401. var totalCodeCount = 0;
  13402. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  13403. totalCodeCount += rsBlocks[_i15].totalCount;
  13404. }
  13405. var data = new Array(totalCodeCount),
  13406. index = 0;
  13407. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  13408. for (var _r = 0; _r < rsBlocks.length; _r++) {
  13409. if (_i16 < dcData[_r].length) {
  13410. data[index++] = dcData[_r][_i16];
  13411. }
  13412. }
  13413. }
  13414. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  13415. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  13416. if (_i17 < ecData[_r2].length) {
  13417. data[index++] = ecData[_r2][_i17];
  13418. }
  13419. }
  13420. }
  13421. return data;
  13422. };
  13423. /*
  13424. * class QRPolynomial
  13425. * */var
  13426. QRPolynomial = /*#__PURE__*/function () {
  13427. function QRPolynomial(num, shift) {_classCallCheck(this, QRPolynomial);
  13428. if (num.length == undefined) {
  13429. //throw new Error(num.length + '/' + shift);
  13430. throwError(num.length + '/' + shift);
  13431. }
  13432. var offset = 0;
  13433. while (offset < num.length && num[offset] == 0) {
  13434. offset++;
  13435. }
  13436. this.num = new Array(num.length - offset + shift);
  13437. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  13438. this.num[_i18] = num[_i18 + offset];
  13439. }
  13440. }_createClass(QRPolynomial, [{ key: "get", value: function get(
  13441. index) {
  13442. return this.num[index];
  13443. } }, { key: "getLength", value: function getLength()
  13444. {
  13445. return this.num.length;
  13446. } }, { key: "multiply", value: function multiply(
  13447. e) {
  13448. var num = new Array(this.getLength() + e.getLength() - 1);
  13449. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  13450. for (var j = 0; j < e.getLength(); j++) {
  13451. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  13452. }
  13453. }
  13454. return new QRPolynomial(num, 0);
  13455. } }, { key: "mod", value: function mod(
  13456. e) {
  13457. if (this.getLength() - e.getLength() < 0) {
  13458. return this;
  13459. }
  13460. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  13461. num = new Array(this.getLength());
  13462. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  13463. num[_i20] = this.get(_i20);
  13464. }
  13465. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  13466. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  13467. }
  13468. return new QRPolynomial(num, 0).mod(e);
  13469. } }]);return QRPolynomial;}();
  13470. /*
  13471. * class QRRSBlock
  13472. * */var
  13473. QRRSBlock =
  13474. function QRRSBlock(totalCount, dataCount) {_classCallCheck(this, QRRSBlock);
  13475. this.totalCount = totalCount;
  13476. this.dataCount = dataCount;
  13477. };
  13478. QRRSBlock.RS_BLOCK_TABLE = [
  13479. [1, 26, 19],
  13480. [1, 26, 16],
  13481. [1, 26, 13],
  13482. [1, 26, 9],
  13483. [1, 44, 34],
  13484. [1, 44, 28],
  13485. [1, 44, 22],
  13486. [1, 44, 16],
  13487. [1, 70, 55],
  13488. [1, 70, 44],
  13489. [2, 35, 17],
  13490. [2, 35, 13],
  13491. [1, 100, 80],
  13492. [2, 50, 32],
  13493. [2, 50, 24],
  13494. [4, 25, 9],
  13495. [1, 134, 108],
  13496. [2, 67, 43],
  13497. [2, 33, 15, 2, 34, 16],
  13498. [2, 33, 11, 2, 34, 12],
  13499. [2, 86, 68],
  13500. [4, 43, 27],
  13501. [4, 43, 19],
  13502. [4, 43, 15],
  13503. [2, 98, 78],
  13504. [4, 49, 31],
  13505. [2, 32, 14, 4, 33, 15],
  13506. [4, 39, 13, 1, 40, 14],
  13507. [2, 121, 97],
  13508. [2, 60, 38, 2, 61, 39],
  13509. [4, 40, 18, 2, 41, 19],
  13510. [4, 40, 14, 2, 41, 15],
  13511. [2, 146, 116],
  13512. [3, 58, 36, 2, 59, 37],
  13513. [4, 36, 16, 4, 37, 17],
  13514. [4, 36, 12, 4, 37, 13],
  13515. [2, 86, 68, 2, 87, 69],
  13516. [4, 69, 43, 1, 70, 44],
  13517. [6, 43, 19, 2, 44, 20],
  13518. [6, 43, 15, 2, 44, 16],
  13519. [4, 101, 81],
  13520. [1, 80, 50, 4, 81, 51],
  13521. [4, 50, 22, 4, 51, 23],
  13522. [3, 36, 12, 8, 37, 13],
  13523. [2, 116, 92, 2, 117, 93],
  13524. [6, 58, 36, 2, 59, 37],
  13525. [4, 46, 20, 6, 47, 21],
  13526. [7, 42, 14, 4, 43, 15],
  13527. [4, 133, 107],
  13528. [8, 59, 37, 1, 60, 38],
  13529. [8, 44, 20, 4, 45, 21],
  13530. [12, 33, 11, 4, 34, 12],
  13531. [3, 145, 115, 1, 146, 116],
  13532. [4, 64, 40, 5, 65, 41],
  13533. [11, 36, 16, 5, 37, 17],
  13534. [11, 36, 12, 5, 37, 13],
  13535. [5, 109, 87, 1, 110, 88],
  13536. [5, 65, 41, 5, 66, 42],
  13537. [5, 54, 24, 7, 55, 25],
  13538. [11, 36, 12],
  13539. [5, 122, 98, 1, 123, 99],
  13540. [7, 73, 45, 3, 74, 46],
  13541. [15, 43, 19, 2, 44, 20],
  13542. [3, 45, 15, 13, 46, 16],
  13543. [1, 135, 107, 5, 136, 108],
  13544. [10, 74, 46, 1, 75, 47],
  13545. [1, 50, 22, 15, 51, 23],
  13546. [2, 42, 14, 17, 43, 15],
  13547. [5, 150, 120, 1, 151, 121],
  13548. [9, 69, 43, 4, 70, 44],
  13549. [17, 50, 22, 1, 51, 23],
  13550. [2, 42, 14, 19, 43, 15],
  13551. [3, 141, 113, 4, 142, 114],
  13552. [3, 70, 44, 11, 71, 45],
  13553. [17, 47, 21, 4, 48, 22],
  13554. [9, 39, 13, 16, 40, 14],
  13555. [3, 135, 107, 5, 136, 108],
  13556. [3, 67, 41, 13, 68, 42],
  13557. [15, 54, 24, 5, 55, 25],
  13558. [15, 43, 15, 10, 44, 16],
  13559. [4, 144, 116, 4, 145, 117],
  13560. [17, 68, 42],
  13561. [17, 50, 22, 6, 51, 23],
  13562. [19, 46, 16, 6, 47, 17],
  13563. [2, 139, 111, 7, 140, 112],
  13564. [17, 74, 46],
  13565. [7, 54, 24, 16, 55, 25],
  13566. [34, 37, 13],
  13567. [4, 151, 121, 5, 152, 122],
  13568. [4, 75, 47, 14, 76, 48],
  13569. [11, 54, 24, 14, 55, 25],
  13570. [16, 45, 15, 14, 46, 16],
  13571. [6, 147, 117, 4, 148, 118],
  13572. [6, 73, 45, 14, 74, 46],
  13573. [11, 54, 24, 16, 55, 25],
  13574. [30, 46, 16, 2, 47, 17],
  13575. [8, 132, 106, 4, 133, 107],
  13576. [8, 75, 47, 13, 76, 48],
  13577. [7, 54, 24, 22, 55, 25],
  13578. [22, 45, 15, 13, 46, 16],
  13579. [10, 142, 114, 2, 143, 115],
  13580. [19, 74, 46, 4, 75, 47],
  13581. [28, 50, 22, 6, 51, 23],
  13582. [33, 46, 16, 4, 47, 17],
  13583. [8, 152, 122, 4, 153, 123],
  13584. [22, 73, 45, 3, 74, 46],
  13585. [8, 53, 23, 26, 54, 24],
  13586. [12, 45, 15, 28, 46, 16],
  13587. [3, 147, 117, 10, 148, 118],
  13588. [3, 73, 45, 23, 74, 46],
  13589. [4, 54, 24, 31, 55, 25],
  13590. [11, 45, 15, 31, 46, 16],
  13591. [7, 146, 116, 7, 147, 117],
  13592. [21, 73, 45, 7, 74, 46],
  13593. [1, 53, 23, 37, 54, 24],
  13594. [19, 45, 15, 26, 46, 16],
  13595. [5, 145, 115, 10, 146, 116],
  13596. [19, 75, 47, 10, 76, 48],
  13597. [15, 54, 24, 25, 55, 25],
  13598. [23, 45, 15, 25, 46, 16],
  13599. [13, 145, 115, 3, 146, 116],
  13600. [2, 74, 46, 29, 75, 47],
  13601. [42, 54, 24, 1, 55, 25],
  13602. [23, 45, 15, 28, 46, 16],
  13603. [17, 145, 115],
  13604. [10, 74, 46, 23, 75, 47],
  13605. [10, 54, 24, 35, 55, 25],
  13606. [19, 45, 15, 35, 46, 16],
  13607. [17, 145, 115, 1, 146, 116],
  13608. [14, 74, 46, 21, 75, 47],
  13609. [29, 54, 24, 19, 55, 25],
  13610. [11, 45, 15, 46, 46, 16],
  13611. [13, 145, 115, 6, 146, 116],
  13612. [14, 74, 46, 23, 75, 47],
  13613. [44, 54, 24, 7, 55, 25],
  13614. [59, 46, 16, 1, 47, 17],
  13615. [12, 151, 121, 7, 152, 122],
  13616. [12, 75, 47, 26, 76, 48],
  13617. [39, 54, 24, 14, 55, 25],
  13618. [22, 45, 15, 41, 46, 16],
  13619. [6, 151, 121, 14, 152, 122],
  13620. [6, 75, 47, 34, 76, 48],
  13621. [46, 54, 24, 10, 55, 25],
  13622. [2, 45, 15, 64, 46, 16],
  13623. [17, 152, 122, 4, 153, 123],
  13624. [29, 74, 46, 14, 75, 47],
  13625. [49, 54, 24, 10, 55, 25],
  13626. [24, 45, 15, 46, 46, 16],
  13627. [4, 152, 122, 18, 153, 123],
  13628. [13, 74, 46, 32, 75, 47],
  13629. [48, 54, 24, 14, 55, 25],
  13630. [42, 45, 15, 32, 46, 16],
  13631. [20, 147, 117, 4, 148, 118],
  13632. [40, 75, 47, 7, 76, 48],
  13633. [43, 54, 24, 22, 55, 25],
  13634. [10, 45, 15, 67, 46, 16],
  13635. [19, 148, 118, 6, 149, 119],
  13636. [18, 75, 47, 31, 76, 48],
  13637. [34, 54, 24, 34, 55, 25],
  13638. [20, 45, 15, 61, 46, 16]];
  13639. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  13640. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  13641. if (!rsBlock) {
  13642. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13643. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13644. }
  13645. var length = rsBlock.length / 3,
  13646. list = [];
  13647. for (var _i22 = 0; _i22 < length; _i22++) {
  13648. var count = rsBlock[_i22 * 3],
  13649. totalCount = rsBlock[_i22 * 3 + 1],
  13650. dataCount = rsBlock[_i22 * 3 + 2];
  13651. for (var j = 0; j < count; j++) {
  13652. list.push(new QRRSBlock(totalCount, dataCount));
  13653. }
  13654. }
  13655. return list;
  13656. };
  13657. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  13658. switch (errorCorrectLevel) {
  13659. case QRErrorCorrectLevel.L:
  13660. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  13661. case QRErrorCorrectLevel.M:
  13662. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  13663. case QRErrorCorrectLevel.Q:
  13664. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  13665. case QRErrorCorrectLevel.H:
  13666. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  13667. default:
  13668. return undefined;}
  13669. };
  13670. /*
  13671. * class QRBitBuffer
  13672. * */var
  13673. QRBitBuffer = /*#__PURE__*/function () {
  13674. function QRBitBuffer() {_classCallCheck(this, QRBitBuffer);
  13675. this.buffer = [];
  13676. this.length = 0;
  13677. }_createClass(QRBitBuffer, [{ key: "get", value: function get(
  13678. index) {
  13679. var bufIndex = Math.floor(index / 8);
  13680. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  13681. } }, { key: "put", value: function put(
  13682. num, length) {
  13683. for (var _i23 = 0; _i23 < length; _i23++) {
  13684. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  13685. }
  13686. } }, { key: "getLengthInBits", value: function getLengthInBits()
  13687. {
  13688. return this.length;
  13689. } }, { key: "putBit", value: function putBit(
  13690. bit) {
  13691. var bufIndex = Math.floor(this.length / 8);
  13692. if (this.buffer.length <= bufIndex) {
  13693. this.buffer.push(0);
  13694. }
  13695. if (bit) {
  13696. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  13697. }
  13698. this.length++;
  13699. } }]);return QRBitBuffer;}();
  13700. /*
  13701. * Class Drawing
  13702. * */var
  13703. Drawing = /*#__PURE__*/function () {
  13704. function Drawing(el, opts) {_classCallCheck(this, Drawing);
  13705. this._opts = opts;
  13706. this._el = el;
  13707. this._ctx = uni.createCanvasContext(el);
  13708. }_createClass(Drawing, [{ key: "draw", value: function draw(
  13709. QRCode) {
  13710. var ctx = this._ctx,
  13711. opts = this._opts;
  13712. var ctxPosFix = opts.width / 20;
  13713. //console.log(opts.width)
  13714. var count = QRCode.getModuleCount(),
  13715. width = (opts.width - 2 * ctxPosFix) / count,
  13716. height = (opts.height - 2 * ctxPosFix) / count,
  13717. roundedWidth = Math.round(width),
  13718. roundedHeight = Math.round(height);
  13719. this.clear();
  13720. ctx.setFillStyle('#fff');
  13721. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  13722. for (var row = 0; row < count; row++) {
  13723. for (var col = 0; col < count; col++) {
  13724. var isDark = QRCode.isDark(row, col),
  13725. left = col * width + ctxPosFix,
  13726. top = row * height + ctxPosFix;
  13727. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  13728. ctx.setLineWidth(1);
  13729. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  13730. ctx.fillRect(left, top, width, height);
  13731. ctx.strokeRect(
  13732. Math.floor(left) + 0.5,
  13733. Math.floor(top) + 0.5,
  13734. roundedWidth,
  13735. roundedHeight);
  13736. ctx.strokeRect(
  13737. Math.ceil(left) - 0.5,
  13738. Math.ceil(top) - 0.5,
  13739. roundedWidth,
  13740. roundedHeight);
  13741. }
  13742. }
  13743. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  13744. ctx.draw();
  13745. this._bIsPainted = true;
  13746. if (this._opts.successTips && drawingOptsSuccessTips) {
  13747. uni.hideLoading();
  13748. uni.showToast({
  13749. title: '生成成功',
  13750. icon: 'success',
  13751. duration: 1000 });
  13752. }
  13753. drawingOptsSuccessTips = true;
  13754. } }, { key: "clear", value: function clear()
  13755. {
  13756. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  13757. }
  13758. /** anlib **/
  13759. /**
  13760. * 二维码上添加图片
  13761. */ }, { key: "drawImg", value: function drawImg(
  13762. src, width, ctx) {
  13763. // logo相对二维码的比例
  13764. var scale = 5;
  13765. // logo相对二维码的大小
  13766. var imgSize = width / scale;
  13767. // 偏移位置起始点
  13768. var imgPos = width / scale * 2;
  13769. // 二维码边框尺寸,这里设置为原宽度的80分之一
  13770. var imgPosFix = width / 80;
  13771. //console.log('width', width);
  13772. //console.log('imgSize', imgSize);
  13773. //console.log('imgPos', imgPos);
  13774. //console.log('imgPosFix', imgPosFix);
  13775. //console.log('src', src);
  13776. ctx.setFillStyle('#fff');
  13777. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  13778. ctx.beginPath();
  13779. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  13780. ctx.stroke();
  13781. ctx.closePath();
  13782. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  13783. ctx.beginPath();
  13784. } }]);return Drawing;}();
  13785. /*
  13786. * Class QRCode
  13787. * */
  13788. var QRCode = function () {
  13789. /**
  13790. * Get the type by string length
  13791. * @author anlib
  13792. * @private
  13793. * @param {String} text
  13794. * @param {Number} correctLevel
  13795. * @return {Number} type
  13796. */
  13797. function getTypeNumber(text, correctLevel) {
  13798. var type = 1,
  13799. length = getUTF8Length(text),
  13800. QRCodeLimitLength = [
  13801. [17, 14, 11, 7],
  13802. [32, 26, 20, 14],
  13803. [53, 42, 32, 24],
  13804. [78, 62, 46, 34],
  13805. [106, 84, 60, 44],
  13806. [134, 106, 74, 58],
  13807. [154, 122, 86, 64],
  13808. [192, 152, 108, 84],
  13809. [230, 180, 130, 98],
  13810. [271, 213, 151, 119],
  13811. [321, 251, 177, 137],
  13812. [367, 287, 203, 155],
  13813. [425, 331, 241, 177],
  13814. [458, 362, 258, 194],
  13815. [520, 412, 292, 220],
  13816. [586, 450, 322, 250],
  13817. [644, 504, 364, 280],
  13818. [718, 560, 394, 310],
  13819. [792, 624, 442, 338],
  13820. [858, 666, 482, 382],
  13821. [929, 711, 509, 403],
  13822. [1003, 779, 565, 439],
  13823. [1091, 857, 611, 461],
  13824. [1171, 911, 661, 511],
  13825. [1273, 997, 715, 535],
  13826. [1367, 1059, 751, 593],
  13827. [1465, 1125, 805, 625],
  13828. [1528, 1190, 868, 658],
  13829. [1628, 1264, 908, 698],
  13830. [1732, 1370, 982, 742],
  13831. [1840, 1452, 1030, 790],
  13832. [1952, 1538, 1112, 842],
  13833. [2068, 1628, 1168, 898],
  13834. [2188, 1722, 1228, 958],
  13835. [2303, 1809, 1283, 983],
  13836. [2431, 1911, 1351, 1051],
  13837. [2563, 1989, 1423, 1093],
  13838. [2699, 2099, 1499, 1139],
  13839. [2809, 2213, 1579, 1219],
  13840. [2953, 2331, 1663, 1273]];
  13841. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  13842. var limit = 0;
  13843. switch (correctLevel) {
  13844. case QRErrorCorrectLevel.L:
  13845. limit = QRCodeLimitLength[_i24][0];
  13846. break;
  13847. case QRErrorCorrectLevel.M:
  13848. limit = QRCodeLimitLength[_i24][1];
  13849. break;
  13850. case QRErrorCorrectLevel.Q:
  13851. limit = QRCodeLimitLength[_i24][2];
  13852. break;
  13853. case QRErrorCorrectLevel.H:
  13854. limit = QRCodeLimitLength[_i24][3];
  13855. break;}
  13856. if (length <= limit) {
  13857. break;
  13858. } else {
  13859. type++;
  13860. }
  13861. }
  13862. if (type > QRCodeLimitLength.length) {
  13863. // throw new Error('Too long data'); //supfire
  13864. throwError('Too long data');
  13865. }
  13866. return type;
  13867. }
  13868. function getUTF8Length(text) {
  13869. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  13870. return replacedText.length + (replacedText.length != text ? 3 : 0);
  13871. }var
  13872. Fn = /*#__PURE__*/function () {
  13873. function Fn(el, opts) {_classCallCheck(this, Fn);
  13874. this._opts = {
  13875. width: 300,
  13876. height: 300,
  13877. typeNumber: 4,
  13878. colorDark: '#000000',
  13879. colorLight: '#ffffff',
  13880. correctLevel: Fn.correctLevel.H,
  13881. logo: false,
  13882. successTips: false };
  13883. if (typeof opts === 'string') {
  13884. opts = {
  13885. text: opts };
  13886. }
  13887. // Overwrites options 简单拷贝
  13888. if (opts) {
  13889. for (var _i25 in opts) {
  13890. if (opts.hasOwnProperty(_i25)) {
  13891. this._opts[_i25] = opts[_i25];
  13892. }
  13893. }
  13894. }
  13895. this._el = el;
  13896. this._QRCode = null;
  13897. this._drawing = new Drawing(this._el, this._opts);
  13898. if (this._opts.text) {
  13899. this.makeCode(this._opts.text);
  13900. }
  13901. }_createClass(Fn, [{ key: "makeCode", value: function makeCode(
  13902. text) {
  13903. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.
  13904. correctLevel);
  13905. this._QRCode.addData(text);
  13906. this._QRCode.make();
  13907. this._drawing.draw(this._QRCode);
  13908. } }, { key: "clear", value: function clear()
  13909. {
  13910. this._drawing.clear();
  13911. } }]);return Fn;}();
  13912. Fn.correctLevel = QRErrorCorrectLevel;
  13913. return Fn;
  13914. }();
  13915. /** anlib **/
  13916. var drawingOptsSuccessTips = true;
  13917. /**
  13918. * 抛出错误
  13919. */
  13920. function throwError(str) {
  13921. uni.hideLoading();
  13922. uni.showToast({
  13923. title: '有字符暂不支持',
  13924. icon: 'none',
  13925. duration: 2000 });
  13926. drawingOptsSuccessTips = false;
  13927. //throw new Error(str);
  13928. }var _default =
  13929. QRCode;exports.default = _default;
  13930. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13931. /***/ })
  13932. }]);
  13933. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map