vendor.js 476 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963
  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: "房票科技",
  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: "房票科技",
  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":"房票科技","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. /***/ 103:
  2063. /*!**************************************!*\
  2064. !*** E:/fp/md/mdapp/utils/qrcode.js ***!
  2065. \**************************************/
  2066. /*! no static exports found */
  2067. /***/ (function(module, exports, __webpack_require__) {
  2068. "use strict";
  2069. /* 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;} /**
  2070. * qrcode-wx-miniprogram
  2071. */
  2072. var QRMode = {
  2073. MODE_NUMBER: 1 << 0,
  2074. MODE_ALPHA_NUM: 1 << 1,
  2075. MODE_8BIT_BYTE: 1 << 2,
  2076. MODE_KANJI: 1 << 3 },
  2077. QRErrorCorrectLevel = {
  2078. L: 1,
  2079. M: 0,
  2080. Q: 3,
  2081. H: 2 },
  2082. QRMaskPattern = {
  2083. PATTERN000: 0,
  2084. PATTERN001: 1,
  2085. PATTERN010: 2,
  2086. PATTERN011: 3,
  2087. PATTERN100: 4,
  2088. PATTERN101: 5,
  2089. PATTERN110: 6,
  2090. PATTERN111: 7 },
  2091. QRUtil = {
  2092. PATTERN_POSITION_TABLE: [
  2093. [],
  2094. [6, 18],
  2095. [6, 22],
  2096. [6, 26],
  2097. [6, 30],
  2098. [6, 34],
  2099. [6, 22, 38],
  2100. [6, 24, 42],
  2101. [6, 26, 46],
  2102. [6, 28, 50],
  2103. [6, 30, 54],
  2104. [6, 32, 58],
  2105. [6, 34, 62],
  2106. [6, 26, 46, 66],
  2107. [6, 26, 48, 70],
  2108. [6, 26, 50, 74],
  2109. [6, 30, 54, 78],
  2110. [6, 30, 56, 82],
  2111. [6, 30, 58, 86],
  2112. [6, 34, 62, 90],
  2113. [6, 28, 50, 72, 94],
  2114. [6, 26, 50, 74, 98],
  2115. [6, 30, 54, 78, 102],
  2116. [6, 28, 54, 80, 106],
  2117. [6, 32, 58, 84, 110],
  2118. [6, 30, 58, 86, 114],
  2119. [6, 34, 62, 90, 118],
  2120. [6, 26, 50, 74, 98, 122],
  2121. [6, 30, 54, 78, 102, 126],
  2122. [6, 26, 52, 78, 104, 130],
  2123. [6, 30, 56, 82, 108, 134],
  2124. [6, 34, 60, 86, 112, 138],
  2125. [6, 30, 58, 86, 114, 142],
  2126. [6, 34, 62, 90, 118, 146],
  2127. [6, 30, 54, 78, 102, 126, 150],
  2128. [6, 24, 50, 76, 102, 128, 154],
  2129. [6, 28, 54, 80, 106, 132, 158],
  2130. [6, 32, 58, 84, 110, 136, 162],
  2131. [6, 26, 54, 82, 110, 138, 166],
  2132. [6, 30, 58, 86, 114, 142, 170]],
  2133. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  2134. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  2135. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  2136. getBCHTypeInfo: function getBCHTypeInfo(data) {
  2137. var d = data << 10;
  2138. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  2139. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  2140. }
  2141. return (data << 10 | d) ^ QRUtil.G15_MASK;
  2142. },
  2143. getBCHTypeNumber: function getBCHTypeNumber(data) {
  2144. var d = data << 12;
  2145. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  2146. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  2147. }
  2148. return data << 12 | d;
  2149. },
  2150. getBCHDigit: function getBCHDigit(data) {
  2151. var digit = 0;
  2152. while (data != 0) {
  2153. digit++;
  2154. data >>>= 1;
  2155. }
  2156. return digit;
  2157. },
  2158. getPatternPosition: function getPatternPosition(typeNumber) {
  2159. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  2160. },
  2161. getMask: function getMask(maskPattern, i, j) {
  2162. switch (maskPattern) {
  2163. case QRMaskPattern.PATTERN000:
  2164. return (i + j) % 2 == 0;
  2165. case QRMaskPattern.PATTERN001:
  2166. return i % 2 == 0;
  2167. case QRMaskPattern.PATTERN010:
  2168. return j % 3 == 0;
  2169. case QRMaskPattern.PATTERN011:
  2170. return (i + j) % 3 == 0;
  2171. case QRMaskPattern.PATTERN100:
  2172. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  2173. case QRMaskPattern.PATTERN101:
  2174. return i * j % 2 + i * j % 3 == 0;
  2175. case QRMaskPattern.PATTERN110:
  2176. return (i * j % 2 + i * j % 3) % 2 == 0;
  2177. case QRMaskPattern.PATTERN111:
  2178. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  2179. default:
  2180. //throw new Error("bad maskPattern:" + maskPattern);
  2181. throwError("bad maskPattern:" + maskPattern);}
  2182. },
  2183. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  2184. var a = new QRPolynomial([1], 0);
  2185. for (var i = 0; i < errorCorrectLength; i++) {
  2186. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  2187. }
  2188. return a;
  2189. },
  2190. getLengthInBits: function getLengthInBits(mode, type) {
  2191. if (1 <= type && type < 10) {
  2192. switch (mode) {
  2193. case QRMode.MODE_NUMBER:
  2194. return 10;
  2195. case QRMode.MODE_ALPHA_NUM:
  2196. return 9;
  2197. case QRMode.MODE_8BIT_BYTE:
  2198. return 8;
  2199. case QRMode.MODE_KANJI:
  2200. return 8;
  2201. default:
  2202. //throw new Error("mode:" + mode);
  2203. throwError("mode:" + mode);}
  2204. } else if (type < 27) {
  2205. switch (mode) {
  2206. case QRMode.MODE_NUMBER:
  2207. return 12;
  2208. case QRMode.MODE_ALPHA_NUM:
  2209. return 11;
  2210. case QRMode.MODE_8BIT_BYTE:
  2211. return 16;
  2212. case QRMode.MODE_KANJI:
  2213. return 10;
  2214. default:
  2215. //throw new Error("mode:" + mode);
  2216. throwError("mode:" + mode);}
  2217. } else if (type < 41) {
  2218. switch (mode) {
  2219. case QRMode.MODE_NUMBER:
  2220. return 14;
  2221. case QRMode.MODE_ALPHA_NUM:
  2222. return 13;
  2223. case QRMode.MODE_8BIT_BYTE:
  2224. return 16;
  2225. case QRMode.MODE_KANJI:
  2226. return 12;
  2227. default:
  2228. //throw new Error("mode:" + mode);
  2229. throwError("mode:" + mode);}
  2230. } else {
  2231. //throw new Error("type:" + type);
  2232. throwError("type:" + type);
  2233. }
  2234. },
  2235. getLostPoint: function getLostPoint(qrCode) {
  2236. var moduleCount = qrCode.getModuleCount();
  2237. var lostPoint = 0;
  2238. for (var row = 0; row < moduleCount; row++) {
  2239. for (var col = 0; col < moduleCount; col++) {
  2240. var sameCount = 0;
  2241. var dark = qrCode.isDark(row, col);
  2242. for (var r = -1; r <= 1; r++) {
  2243. if (row + r < 0 || moduleCount <= row + r) {
  2244. continue;
  2245. }
  2246. for (var c = -1; c <= 1; c++) {
  2247. if (col + c < 0 || moduleCount <= col + c) {
  2248. continue;
  2249. }
  2250. if (r == 0 && c == 0) {
  2251. continue;
  2252. }
  2253. if (dark == qrCode.isDark(row + r, col + c)) {
  2254. sameCount++;
  2255. }
  2256. }
  2257. }
  2258. if (sameCount > 5) {
  2259. lostPoint += 3 + sameCount - 5;
  2260. }
  2261. }
  2262. }
  2263. for (var row = 0; row < moduleCount - 1; row++) {
  2264. for (var col = 0; col < moduleCount - 1; col++) {
  2265. var count = 0;
  2266. if (qrCode.isDark(row, col)) count++;
  2267. if (qrCode.isDark(row + 1, col)) count++;
  2268. if (qrCode.isDark(row, col + 1)) count++;
  2269. if (qrCode.isDark(row + 1, col + 1)) count++;
  2270. if (count == 0 || count == 4) {
  2271. lostPoint += 3;
  2272. }
  2273. }
  2274. }
  2275. for (var row = 0; row < moduleCount; row++) {
  2276. for (var col = 0; col < moduleCount - 6; col++) {
  2277. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) &&
  2278. qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col +
  2279. 5) && qrCode.isDark(row, col + 6)) {
  2280. lostPoint += 40;
  2281. }
  2282. }
  2283. }
  2284. for (var col = 0; col < moduleCount; col++) {
  2285. for (var row = 0; row < moduleCount - 6; row++) {
  2286. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) &&
  2287. qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5,
  2288. col) && qrCode.isDark(row + 6, col)) {
  2289. lostPoint += 40;
  2290. }
  2291. }
  2292. }
  2293. var darkCount = 0;
  2294. for (var col = 0; col < moduleCount; col++) {
  2295. for (var row = 0; row < moduleCount; row++) {
  2296. if (qrCode.isDark(row, col)) {
  2297. darkCount++;
  2298. }
  2299. }
  2300. }
  2301. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  2302. lostPoint += ratio * 10;
  2303. return lostPoint;
  2304. } },
  2305. QRMath = {
  2306. glog: function glog(n) {
  2307. if (n < 1) {
  2308. //throw new Error("glog(" + n + ")");
  2309. throwError("glog(" + n + ")");
  2310. }
  2311. return QRMath.LOG_TABLE[n];
  2312. },
  2313. gexp: function gexp(n) {
  2314. while (n < 0) {
  2315. n += 255;
  2316. }
  2317. while (n >= 256) {
  2318. n -= 255;
  2319. }
  2320. return QRMath.EXP_TABLE[n];
  2321. },
  2322. EXP_TABLE: new Array(256),
  2323. LOG_TABLE: new Array(256) };
  2324. for (var i = 0; i < 8; i++) {
  2325. QRMath.EXP_TABLE[i] = 1 << i;
  2326. }
  2327. for (var _i = 8; _i < 256; _i++) {
  2328. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.
  2329. EXP_TABLE[_i - 8];
  2330. }
  2331. for (var _i2 = 0; _i2 < 255; _i2++) {
  2332. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  2333. }
  2334. /*
  2335. * class QR8bitByte
  2336. * */var
  2337. QR8bitByte = /*#__PURE__*/function () {
  2338. function QR8bitByte(data) {_classCallCheck(this, QR8bitByte);
  2339. this.mode = QRMode.MODE_8BIT_BYTE;
  2340. this.data = data;
  2341. this.parsedData = [];
  2342. // Added to support UTF-8 Characters
  2343. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  2344. var byteArray = [],
  2345. code = this.data.charCodeAt(_i3);
  2346. if (code > 0x10000) {
  2347. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  2348. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  2349. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  2350. byteArray[3] = 0x80 | code & 0x3F;
  2351. } else if (code > 0x800) {
  2352. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  2353. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  2354. byteArray[2] = 0x80 | code & 0x3F;
  2355. } else if (code > 0x80) {
  2356. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  2357. byteArray[1] = 0x80 | code & 0x3F;
  2358. } else {
  2359. byteArray[0] = code;
  2360. }
  2361. this.parsedData.push(byteArray);
  2362. }
  2363. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  2364. if (this.parsedData.length !== this.data.length) {
  2365. this.parsedData.unshift(191);
  2366. this.parsedData.unshift(187);
  2367. this.parsedData.unshift(239);
  2368. }
  2369. }_createClass(QR8bitByte, [{ key: "getLength", value: function getLength(
  2370. buffer) {
  2371. return this.parsedData.length;
  2372. } }, { key: "write", value: function write(
  2373. buffer) {
  2374. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  2375. buffer.put(this.parsedData[_i4], 8);
  2376. }
  2377. } }]);return QR8bitByte;}();
  2378. /*
  2379. * class QRCodeModel
  2380. * */var
  2381. QRCodeModel = /*#__PURE__*/function () {
  2382. function QRCodeModel(typeNumber, errorCorrectLevel) {_classCallCheck(this, QRCodeModel);
  2383. this.typeNumber = typeNumber;
  2384. this.errorCorrectLevel = errorCorrectLevel;
  2385. this.modules = null;
  2386. this.moduleCount = 0;
  2387. this.dataCache = null;
  2388. this.dataList = [];
  2389. }_createClass(QRCodeModel, [{ key: "addData", value: function addData(
  2390. data) {
  2391. var newData = new QR8bitByte(data);
  2392. this.dataList.push(newData);
  2393. this.dataCache = null;
  2394. } }, { key: "isDark", value: function isDark(
  2395. row, col) {
  2396. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  2397. //throw new Error(row + ',' + col);
  2398. throwError(row + ',' + col);
  2399. }
  2400. return this.modules[row][col];
  2401. } }, { key: "getModuleCount", value: function getModuleCount()
  2402. {
  2403. return this.moduleCount;
  2404. } }, { key: "make", value: function make()
  2405. {
  2406. this.makeImpl(false, this.getBestMaskPattern());
  2407. } }, { key: "makeImpl", value: function makeImpl(
  2408. test, maskPattern) {
  2409. this.moduleCount = this.typeNumber * 4 + 17;
  2410. this.modules = new Array(this.moduleCount);
  2411. for (var row = 0; row < this.moduleCount; row++) {
  2412. this.modules[row] = new Array(this.moduleCount);
  2413. for (var col = 0; col < this.moduleCount; col++) {
  2414. this.modules[row][col] = null;
  2415. }
  2416. }
  2417. this.setupPositionProbePattern(0, 0);
  2418. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  2419. this.setupPositionProbePattern(0, this.moduleCount - 7);
  2420. this.setupPositionAdjustPattern();
  2421. this.setupTimingPattern();
  2422. this.setupTypeInfo(test, maskPattern);
  2423. if (this.typeNumber >= 7) {
  2424. this.setupTypeNumber(test);
  2425. }
  2426. if (this.dataCache == null) {
  2427. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  2428. }
  2429. this.mapData(this.dataCache, maskPattern);
  2430. } }, { key: "setupPositionProbePattern", value: function setupPositionProbePattern(
  2431. row, col) {
  2432. for (var r = -1; r <= 7; r++) {
  2433. if (row + r <= -1 || this.moduleCount <= row + r) {
  2434. continue;
  2435. }
  2436. for (var c = -1; c <= 7; c++) {
  2437. if (col + c <= -1 || this.moduleCount <= col + c) {
  2438. continue;
  2439. }
  2440. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) ||
  2441. 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  2442. }
  2443. }
  2444. } }, { key: "getBestMaskPattern", value: function getBestMaskPattern()
  2445. {
  2446. var minLostPoint = 0,
  2447. pattern = 0;
  2448. for (var _i5 = 0; _i5 < 8; _i5++) {
  2449. this.makeImpl(true, _i5);
  2450. var lostPoint = QRUtil.getLostPoint(this);
  2451. if (_i5 == 0 || minLostPoint > lostPoint) {
  2452. minLostPoint = lostPoint;
  2453. pattern = _i5;
  2454. }
  2455. }
  2456. return pattern;
  2457. } }, { key: "setupTimingPattern", value: function setupTimingPattern()
  2458. {
  2459. for (var r = 8; r < this.moduleCount - 8; r++) {
  2460. if (this.modules[r][6] != null) {
  2461. continue;
  2462. }
  2463. this.modules[r][6] = r % 2 == 0;
  2464. }
  2465. for (var c = 8; c < this.moduleCount - 8; c++) {
  2466. if (this.modules[6][c] != null) {
  2467. continue;
  2468. }
  2469. this.modules[6][c] = c % 2 == 0;
  2470. }
  2471. } }, { key: "setupPositionAdjustPattern", value: function setupPositionAdjustPattern()
  2472. {
  2473. var pos = QRUtil.getPatternPosition(this.typeNumber);
  2474. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  2475. for (var j = 0; j < pos.length; j++) {
  2476. var row = pos[_i6],
  2477. col = pos[j];
  2478. if (this.modules[row][col] != null) {
  2479. continue;
  2480. }
  2481. for (var r = -2; r <= 2; r++) {
  2482. for (var c = -2; c <= 2; c++) {
  2483. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c ==
  2484. 0;
  2485. }
  2486. }
  2487. }
  2488. }
  2489. } }, { key: "setupTypeNumber", value: function setupTypeNumber(
  2490. test) {
  2491. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  2492. for (var _i7 = 0; _i7 < 18; _i7++) {
  2493. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  2494. }
  2495. for (var _i8 = 0; _i8 < 18; _i8++) {
  2496. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  2497. }
  2498. } }, { key: "setupTypeInfo", value: function setupTypeInfo(
  2499. test, maskPattern) {
  2500. var data = this.errorCorrectLevel << 3 | maskPattern,
  2501. bits = QRUtil.getBCHTypeInfo(data);
  2502. for (var _i9 = 0; _i9 < 15; _i9++) {
  2503. var mod = !test && (bits >> _i9 & 1) == 1;
  2504. if (_i9 < 6) {
  2505. this.modules[_i9][8] = mod;
  2506. } else if (_i9 < 8) {
  2507. this.modules[_i9 + 1][8] = mod;
  2508. } else {
  2509. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  2510. }
  2511. }
  2512. for (var _i10 = 0; _i10 < 15; _i10++) {
  2513. var _mod = !test && (bits >> _i10 & 1) == 1;
  2514. if (_i10 < 8) {
  2515. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  2516. } else if (_i10 < 9) {
  2517. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  2518. } else {
  2519. this.modules[8][15 - _i10 - 1] = _mod;
  2520. }
  2521. }
  2522. this.modules[this.moduleCount - 8][8] = !test;
  2523. } }, { key: "mapData", value: function mapData(
  2524. data, maskPattern) {
  2525. var inc = -1,
  2526. row = this.moduleCount - 1,
  2527. bitIndex = 7,
  2528. byteIndex = 0;
  2529. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  2530. if (col == 6) col--;
  2531. while (true) {
  2532. for (var c = 0; c < 2; c++) {
  2533. if (this.modules[row][col - c] == null) {
  2534. var dark = false;
  2535. if (byteIndex < data.length) {
  2536. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2537. }
  2538. var mask = QRUtil.getMask(maskPattern, row, col - c);
  2539. if (mask) {
  2540. dark = !dark;
  2541. }
  2542. this.modules[row][col - c] = dark;
  2543. bitIndex--;
  2544. if (bitIndex == -1) {
  2545. byteIndex++;
  2546. bitIndex = 7;
  2547. }
  2548. }
  2549. }
  2550. row += inc;
  2551. if (row < 0 || this.moduleCount <= row) {
  2552. row -= inc;
  2553. inc = -inc;
  2554. break;
  2555. }
  2556. }
  2557. }
  2558. } }]);return QRCodeModel;}();
  2559. QRCodeModel.PAD0 = 0xEC;
  2560. QRCodeModel.PAD1 = 0x11;
  2561. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  2562. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  2563. buffer = new QRBitBuffer();
  2564. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  2565. var data = dataList[_i11];
  2566. buffer.put(data.mode, 4);
  2567. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  2568. data.write(buffer);
  2569. }
  2570. var totalDataCount = 0;
  2571. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  2572. totalDataCount += rsBlocks[_i12].dataCount;
  2573. }
  2574. if (buffer.getLengthInBits() > totalDataCount * 8) {
  2575. /*
  2576. throw new Error("code length overflow. (" +
  2577. buffer.getLengthInBits() +
  2578. ">" +
  2579. totalDataCount * 8 +
  2580. ")");
  2581. */
  2582. throwError("code length overflow. (" +
  2583. buffer.getLengthInBits() +
  2584. ">" +
  2585. totalDataCount * 8 +
  2586. ")");
  2587. }
  2588. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  2589. buffer.put(0, 4);
  2590. }
  2591. while (buffer.getLengthInBits() % 8 != 0) {
  2592. buffer.putBit(false);
  2593. }
  2594. while (true) {
  2595. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2596. break;
  2597. }
  2598. buffer.put(QRCodeModel.PAD0, 8);
  2599. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2600. break;
  2601. }
  2602. buffer.put(QRCodeModel.PAD1, 8);
  2603. }
  2604. return QRCodeModel.createBytes(buffer, rsBlocks);
  2605. };
  2606. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  2607. var offset = 0,
  2608. maxDcCount = 0,
  2609. maxEcCount = 0,
  2610. dcData = new Array(rsBlocks.length),
  2611. ecData = new Array(rsBlocks.length);
  2612. for (var r = 0; r < rsBlocks.length; r++) {
  2613. var dcCount = rsBlocks[r].dataCount,
  2614. ecCount = rsBlocks[r].totalCount - dcCount;
  2615. maxDcCount = Math.max(maxDcCount, dcCount);
  2616. maxEcCount = Math.max(maxEcCount, ecCount);
  2617. dcData[r] = new Array(dcCount);
  2618. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  2619. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  2620. }
  2621. offset += dcCount;
  2622. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  2623. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  2624. modPoly = rawPoly.mod(rsPoly);
  2625. ecData[r] = new Array(rsPoly.getLength() - 1);
  2626. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  2627. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  2628. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  2629. }
  2630. }
  2631. var totalCodeCount = 0;
  2632. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  2633. totalCodeCount += rsBlocks[_i15].totalCount;
  2634. }
  2635. var data = new Array(totalCodeCount),
  2636. index = 0;
  2637. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  2638. for (var _r = 0; _r < rsBlocks.length; _r++) {
  2639. if (_i16 < dcData[_r].length) {
  2640. data[index++] = dcData[_r][_i16];
  2641. }
  2642. }
  2643. }
  2644. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  2645. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  2646. if (_i17 < ecData[_r2].length) {
  2647. data[index++] = ecData[_r2][_i17];
  2648. }
  2649. }
  2650. }
  2651. return data;
  2652. };
  2653. /*
  2654. * class QRPolynomial
  2655. * */var
  2656. QRPolynomial = /*#__PURE__*/function () {
  2657. function QRPolynomial(num, shift) {_classCallCheck(this, QRPolynomial);
  2658. if (num.length == undefined) {
  2659. //throw new Error(num.length + '/' + shift);
  2660. throwError(num.length + '/' + shift);
  2661. }
  2662. var offset = 0;
  2663. while (offset < num.length && num[offset] == 0) {
  2664. offset++;
  2665. }
  2666. this.num = new Array(num.length - offset + shift);
  2667. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  2668. this.num[_i18] = num[_i18 + offset];
  2669. }
  2670. }_createClass(QRPolynomial, [{ key: "get", value: function get(
  2671. index) {
  2672. return this.num[index];
  2673. } }, { key: "getLength", value: function getLength()
  2674. {
  2675. return this.num.length;
  2676. } }, { key: "multiply", value: function multiply(
  2677. e) {
  2678. var num = new Array(this.getLength() + e.getLength() - 1);
  2679. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  2680. for (var j = 0; j < e.getLength(); j++) {
  2681. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  2682. }
  2683. }
  2684. return new QRPolynomial(num, 0);
  2685. } }, { key: "mod", value: function mod(
  2686. e) {
  2687. if (this.getLength() - e.getLength() < 0) {
  2688. return this;
  2689. }
  2690. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  2691. num = new Array(this.getLength());
  2692. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  2693. num[_i20] = this.get(_i20);
  2694. }
  2695. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  2696. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  2697. }
  2698. return new QRPolynomial(num, 0).mod(e);
  2699. } }]);return QRPolynomial;}();
  2700. /*
  2701. * class QRRSBlock
  2702. * */var
  2703. QRRSBlock =
  2704. function QRRSBlock(totalCount, dataCount) {_classCallCheck(this, QRRSBlock);
  2705. this.totalCount = totalCount;
  2706. this.dataCount = dataCount;
  2707. };
  2708. QRRSBlock.RS_BLOCK_TABLE = [
  2709. [1, 26, 19],
  2710. [1, 26, 16],
  2711. [1, 26, 13],
  2712. [1, 26, 9],
  2713. [1, 44, 34],
  2714. [1, 44, 28],
  2715. [1, 44, 22],
  2716. [1, 44, 16],
  2717. [1, 70, 55],
  2718. [1, 70, 44],
  2719. [2, 35, 17],
  2720. [2, 35, 13],
  2721. [1, 100, 80],
  2722. [2, 50, 32],
  2723. [2, 50, 24],
  2724. [4, 25, 9],
  2725. [1, 134, 108],
  2726. [2, 67, 43],
  2727. [2, 33, 15, 2, 34, 16],
  2728. [2, 33, 11, 2, 34, 12],
  2729. [2, 86, 68],
  2730. [4, 43, 27],
  2731. [4, 43, 19],
  2732. [4, 43, 15],
  2733. [2, 98, 78],
  2734. [4, 49, 31],
  2735. [2, 32, 14, 4, 33, 15],
  2736. [4, 39, 13, 1, 40, 14],
  2737. [2, 121, 97],
  2738. [2, 60, 38, 2, 61, 39],
  2739. [4, 40, 18, 2, 41, 19],
  2740. [4, 40, 14, 2, 41, 15],
  2741. [2, 146, 116],
  2742. [3, 58, 36, 2, 59, 37],
  2743. [4, 36, 16, 4, 37, 17],
  2744. [4, 36, 12, 4, 37, 13],
  2745. [2, 86, 68, 2, 87, 69],
  2746. [4, 69, 43, 1, 70, 44],
  2747. [6, 43, 19, 2, 44, 20],
  2748. [6, 43, 15, 2, 44, 16],
  2749. [4, 101, 81],
  2750. [1, 80, 50, 4, 81, 51],
  2751. [4, 50, 22, 4, 51, 23],
  2752. [3, 36, 12, 8, 37, 13],
  2753. [2, 116, 92, 2, 117, 93],
  2754. [6, 58, 36, 2, 59, 37],
  2755. [4, 46, 20, 6, 47, 21],
  2756. [7, 42, 14, 4, 43, 15],
  2757. [4, 133, 107],
  2758. [8, 59, 37, 1, 60, 38],
  2759. [8, 44, 20, 4, 45, 21],
  2760. [12, 33, 11, 4, 34, 12],
  2761. [3, 145, 115, 1, 146, 116],
  2762. [4, 64, 40, 5, 65, 41],
  2763. [11, 36, 16, 5, 37, 17],
  2764. [11, 36, 12, 5, 37, 13],
  2765. [5, 109, 87, 1, 110, 88],
  2766. [5, 65, 41, 5, 66, 42],
  2767. [5, 54, 24, 7, 55, 25],
  2768. [11, 36, 12],
  2769. [5, 122, 98, 1, 123, 99],
  2770. [7, 73, 45, 3, 74, 46],
  2771. [15, 43, 19, 2, 44, 20],
  2772. [3, 45, 15, 13, 46, 16],
  2773. [1, 135, 107, 5, 136, 108],
  2774. [10, 74, 46, 1, 75, 47],
  2775. [1, 50, 22, 15, 51, 23],
  2776. [2, 42, 14, 17, 43, 15],
  2777. [5, 150, 120, 1, 151, 121],
  2778. [9, 69, 43, 4, 70, 44],
  2779. [17, 50, 22, 1, 51, 23],
  2780. [2, 42, 14, 19, 43, 15],
  2781. [3, 141, 113, 4, 142, 114],
  2782. [3, 70, 44, 11, 71, 45],
  2783. [17, 47, 21, 4, 48, 22],
  2784. [9, 39, 13, 16, 40, 14],
  2785. [3, 135, 107, 5, 136, 108],
  2786. [3, 67, 41, 13, 68, 42],
  2787. [15, 54, 24, 5, 55, 25],
  2788. [15, 43, 15, 10, 44, 16],
  2789. [4, 144, 116, 4, 145, 117],
  2790. [17, 68, 42],
  2791. [17, 50, 22, 6, 51, 23],
  2792. [19, 46, 16, 6, 47, 17],
  2793. [2, 139, 111, 7, 140, 112],
  2794. [17, 74, 46],
  2795. [7, 54, 24, 16, 55, 25],
  2796. [34, 37, 13],
  2797. [4, 151, 121, 5, 152, 122],
  2798. [4, 75, 47, 14, 76, 48],
  2799. [11, 54, 24, 14, 55, 25],
  2800. [16, 45, 15, 14, 46, 16],
  2801. [6, 147, 117, 4, 148, 118],
  2802. [6, 73, 45, 14, 74, 46],
  2803. [11, 54, 24, 16, 55, 25],
  2804. [30, 46, 16, 2, 47, 17],
  2805. [8, 132, 106, 4, 133, 107],
  2806. [8, 75, 47, 13, 76, 48],
  2807. [7, 54, 24, 22, 55, 25],
  2808. [22, 45, 15, 13, 46, 16],
  2809. [10, 142, 114, 2, 143, 115],
  2810. [19, 74, 46, 4, 75, 47],
  2811. [28, 50, 22, 6, 51, 23],
  2812. [33, 46, 16, 4, 47, 17],
  2813. [8, 152, 122, 4, 153, 123],
  2814. [22, 73, 45, 3, 74, 46],
  2815. [8, 53, 23, 26, 54, 24],
  2816. [12, 45, 15, 28, 46, 16],
  2817. [3, 147, 117, 10, 148, 118],
  2818. [3, 73, 45, 23, 74, 46],
  2819. [4, 54, 24, 31, 55, 25],
  2820. [11, 45, 15, 31, 46, 16],
  2821. [7, 146, 116, 7, 147, 117],
  2822. [21, 73, 45, 7, 74, 46],
  2823. [1, 53, 23, 37, 54, 24],
  2824. [19, 45, 15, 26, 46, 16],
  2825. [5, 145, 115, 10, 146, 116],
  2826. [19, 75, 47, 10, 76, 48],
  2827. [15, 54, 24, 25, 55, 25],
  2828. [23, 45, 15, 25, 46, 16],
  2829. [13, 145, 115, 3, 146, 116],
  2830. [2, 74, 46, 29, 75, 47],
  2831. [42, 54, 24, 1, 55, 25],
  2832. [23, 45, 15, 28, 46, 16],
  2833. [17, 145, 115],
  2834. [10, 74, 46, 23, 75, 47],
  2835. [10, 54, 24, 35, 55, 25],
  2836. [19, 45, 15, 35, 46, 16],
  2837. [17, 145, 115, 1, 146, 116],
  2838. [14, 74, 46, 21, 75, 47],
  2839. [29, 54, 24, 19, 55, 25],
  2840. [11, 45, 15, 46, 46, 16],
  2841. [13, 145, 115, 6, 146, 116],
  2842. [14, 74, 46, 23, 75, 47],
  2843. [44, 54, 24, 7, 55, 25],
  2844. [59, 46, 16, 1, 47, 17],
  2845. [12, 151, 121, 7, 152, 122],
  2846. [12, 75, 47, 26, 76, 48],
  2847. [39, 54, 24, 14, 55, 25],
  2848. [22, 45, 15, 41, 46, 16],
  2849. [6, 151, 121, 14, 152, 122],
  2850. [6, 75, 47, 34, 76, 48],
  2851. [46, 54, 24, 10, 55, 25],
  2852. [2, 45, 15, 64, 46, 16],
  2853. [17, 152, 122, 4, 153, 123],
  2854. [29, 74, 46, 14, 75, 47],
  2855. [49, 54, 24, 10, 55, 25],
  2856. [24, 45, 15, 46, 46, 16],
  2857. [4, 152, 122, 18, 153, 123],
  2858. [13, 74, 46, 32, 75, 47],
  2859. [48, 54, 24, 14, 55, 25],
  2860. [42, 45, 15, 32, 46, 16],
  2861. [20, 147, 117, 4, 148, 118],
  2862. [40, 75, 47, 7, 76, 48],
  2863. [43, 54, 24, 22, 55, 25],
  2864. [10, 45, 15, 67, 46, 16],
  2865. [19, 148, 118, 6, 149, 119],
  2866. [18, 75, 47, 31, 76, 48],
  2867. [34, 54, 24, 34, 55, 25],
  2868. [20, 45, 15, 61, 46, 16]];
  2869. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  2870. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  2871. if (!rsBlock) {
  2872. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  2873. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  2874. }
  2875. var length = rsBlock.length / 3,
  2876. list = [];
  2877. for (var _i22 = 0; _i22 < length; _i22++) {
  2878. var count = rsBlock[_i22 * 3],
  2879. totalCount = rsBlock[_i22 * 3 + 1],
  2880. dataCount = rsBlock[_i22 * 3 + 2];
  2881. for (var j = 0; j < count; j++) {
  2882. list.push(new QRRSBlock(totalCount, dataCount));
  2883. }
  2884. }
  2885. return list;
  2886. };
  2887. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  2888. switch (errorCorrectLevel) {
  2889. case QRErrorCorrectLevel.L:
  2890. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  2891. case QRErrorCorrectLevel.M:
  2892. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  2893. case QRErrorCorrectLevel.Q:
  2894. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  2895. case QRErrorCorrectLevel.H:
  2896. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  2897. default:
  2898. return undefined;}
  2899. };
  2900. /*
  2901. * class QRBitBuffer
  2902. * */var
  2903. QRBitBuffer = /*#__PURE__*/function () {
  2904. function QRBitBuffer() {_classCallCheck(this, QRBitBuffer);
  2905. this.buffer = [];
  2906. this.length = 0;
  2907. }_createClass(QRBitBuffer, [{ key: "get", value: function get(
  2908. index) {
  2909. var bufIndex = Math.floor(index / 8);
  2910. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  2911. } }, { key: "put", value: function put(
  2912. num, length) {
  2913. for (var _i23 = 0; _i23 < length; _i23++) {
  2914. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  2915. }
  2916. } }, { key: "getLengthInBits", value: function getLengthInBits()
  2917. {
  2918. return this.length;
  2919. } }, { key: "putBit", value: function putBit(
  2920. bit) {
  2921. var bufIndex = Math.floor(this.length / 8);
  2922. if (this.buffer.length <= bufIndex) {
  2923. this.buffer.push(0);
  2924. }
  2925. if (bit) {
  2926. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  2927. }
  2928. this.length++;
  2929. } }]);return QRBitBuffer;}();
  2930. /*
  2931. * Class Drawing
  2932. * */var
  2933. Drawing = /*#__PURE__*/function () {
  2934. function Drawing(el, opts) {_classCallCheck(this, Drawing);
  2935. this._opts = opts;
  2936. this._el = el;
  2937. this._ctx = uni.createCanvasContext(el);
  2938. }_createClass(Drawing, [{ key: "draw", value: function draw(
  2939. QRCode) {
  2940. var ctx = this._ctx,
  2941. opts = this._opts;
  2942. var ctxPosFix = opts.width / 20;
  2943. //console.log(opts.width)
  2944. var count = QRCode.getModuleCount(),
  2945. width = (opts.width - 2 * ctxPosFix) / count,
  2946. height = (opts.height - 2 * ctxPosFix) / count,
  2947. roundedWidth = Math.round(width),
  2948. roundedHeight = Math.round(height);
  2949. this.clear();
  2950. ctx.setFillStyle('#fff');
  2951. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  2952. for (var row = 0; row < count; row++) {
  2953. for (var col = 0; col < count; col++) {
  2954. var isDark = QRCode.isDark(row, col),
  2955. left = col * width + ctxPosFix,
  2956. top = row * height + ctxPosFix;
  2957. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  2958. ctx.setLineWidth(1);
  2959. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  2960. ctx.fillRect(left, top, width, height);
  2961. ctx.strokeRect(
  2962. Math.floor(left) + 0.5,
  2963. Math.floor(top) + 0.5,
  2964. roundedWidth,
  2965. roundedHeight);
  2966. ctx.strokeRect(
  2967. Math.ceil(left) - 0.5,
  2968. Math.ceil(top) - 0.5,
  2969. roundedWidth,
  2970. roundedHeight);
  2971. }
  2972. }
  2973. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  2974. ctx.draw();
  2975. this._bIsPainted = true;
  2976. if (this._opts.successTips && drawingOptsSuccessTips) {
  2977. uni.hideLoading();
  2978. uni.showToast({
  2979. title: '生成成功',
  2980. icon: 'success',
  2981. duration: 1000 });
  2982. }
  2983. drawingOptsSuccessTips = true;
  2984. } }, { key: "clear", value: function clear()
  2985. {
  2986. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  2987. }
  2988. /** anlib **/
  2989. /**
  2990. * 二维码上添加图片
  2991. */ }, { key: "drawImg", value: function drawImg(
  2992. src, width, ctx) {
  2993. // logo相对二维码的比例
  2994. var scale = 5;
  2995. // logo相对二维码的大小
  2996. var imgSize = width / scale;
  2997. // 偏移位置起始点
  2998. var imgPos = width / scale * 2;
  2999. // 二维码边框尺寸,这里设置为原宽度的80分之一
  3000. var imgPosFix = width / 80;
  3001. //console.log('width', width);
  3002. //console.log('imgSize', imgSize);
  3003. //console.log('imgPos', imgPos);
  3004. //console.log('imgPosFix', imgPosFix);
  3005. //console.log('src', src);
  3006. ctx.setFillStyle('#fff');
  3007. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  3008. ctx.beginPath();
  3009. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  3010. ctx.stroke();
  3011. ctx.closePath();
  3012. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  3013. ctx.beginPath();
  3014. } }]);return Drawing;}();
  3015. /*
  3016. * Class QRCode
  3017. * */
  3018. var QRCode = function () {
  3019. /**
  3020. * Get the type by string length
  3021. * @author anlib
  3022. * @private
  3023. * @param {String} text
  3024. * @param {Number} correctLevel
  3025. * @return {Number} type
  3026. */
  3027. function getTypeNumber(text, correctLevel) {
  3028. var type = 1,
  3029. length = getUTF8Length(text),
  3030. QRCodeLimitLength = [
  3031. [17, 14, 11, 7],
  3032. [32, 26, 20, 14],
  3033. [53, 42, 32, 24],
  3034. [78, 62, 46, 34],
  3035. [106, 84, 60, 44],
  3036. [134, 106, 74, 58],
  3037. [154, 122, 86, 64],
  3038. [192, 152, 108, 84],
  3039. [230, 180, 130, 98],
  3040. [271, 213, 151, 119],
  3041. [321, 251, 177, 137],
  3042. [367, 287, 203, 155],
  3043. [425, 331, 241, 177],
  3044. [458, 362, 258, 194],
  3045. [520, 412, 292, 220],
  3046. [586, 450, 322, 250],
  3047. [644, 504, 364, 280],
  3048. [718, 560, 394, 310],
  3049. [792, 624, 442, 338],
  3050. [858, 666, 482, 382],
  3051. [929, 711, 509, 403],
  3052. [1003, 779, 565, 439],
  3053. [1091, 857, 611, 461],
  3054. [1171, 911, 661, 511],
  3055. [1273, 997, 715, 535],
  3056. [1367, 1059, 751, 593],
  3057. [1465, 1125, 805, 625],
  3058. [1528, 1190, 868, 658],
  3059. [1628, 1264, 908, 698],
  3060. [1732, 1370, 982, 742],
  3061. [1840, 1452, 1030, 790],
  3062. [1952, 1538, 1112, 842],
  3063. [2068, 1628, 1168, 898],
  3064. [2188, 1722, 1228, 958],
  3065. [2303, 1809, 1283, 983],
  3066. [2431, 1911, 1351, 1051],
  3067. [2563, 1989, 1423, 1093],
  3068. [2699, 2099, 1499, 1139],
  3069. [2809, 2213, 1579, 1219],
  3070. [2953, 2331, 1663, 1273]];
  3071. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  3072. var limit = 0;
  3073. switch (correctLevel) {
  3074. case QRErrorCorrectLevel.L:
  3075. limit = QRCodeLimitLength[_i24][0];
  3076. break;
  3077. case QRErrorCorrectLevel.M:
  3078. limit = QRCodeLimitLength[_i24][1];
  3079. break;
  3080. case QRErrorCorrectLevel.Q:
  3081. limit = QRCodeLimitLength[_i24][2];
  3082. break;
  3083. case QRErrorCorrectLevel.H:
  3084. limit = QRCodeLimitLength[_i24][3];
  3085. break;}
  3086. if (length <= limit) {
  3087. break;
  3088. } else {
  3089. type++;
  3090. }
  3091. }
  3092. if (type > QRCodeLimitLength.length) {
  3093. // throw new Error('Too long data'); //supfire
  3094. throwError('Too long data');
  3095. }
  3096. return type;
  3097. }
  3098. function getUTF8Length(text) {
  3099. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  3100. return replacedText.length + (replacedText.length != text ? 3 : 0);
  3101. }var
  3102. Fn = /*#__PURE__*/function () {
  3103. function Fn(el, opts) {_classCallCheck(this, Fn);
  3104. this._opts = {
  3105. width: 300,
  3106. height: 300,
  3107. typeNumber: 4,
  3108. colorDark: '#000000',
  3109. colorLight: '#ffffff',
  3110. correctLevel: Fn.correctLevel.H,
  3111. logo: false,
  3112. successTips: false };
  3113. if (typeof opts === 'string') {
  3114. opts = {
  3115. text: opts };
  3116. }
  3117. // Overwrites options 简单拷贝
  3118. if (opts) {
  3119. for (var _i25 in opts) {
  3120. if (opts.hasOwnProperty(_i25)) {
  3121. this._opts[_i25] = opts[_i25];
  3122. }
  3123. }
  3124. }
  3125. this._el = el;
  3126. this._QRCode = null;
  3127. this._drawing = new Drawing(this._el, this._opts);
  3128. if (this._opts.text) {
  3129. this.makeCode(this._opts.text);
  3130. }
  3131. }_createClass(Fn, [{ key: "makeCode", value: function makeCode(
  3132. text) {
  3133. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.
  3134. correctLevel);
  3135. this._QRCode.addData(text);
  3136. this._QRCode.make();
  3137. this._drawing.draw(this._QRCode);
  3138. } }, { key: "clear", value: function clear()
  3139. {
  3140. this._drawing.clear();
  3141. } }]);return Fn;}();
  3142. Fn.correctLevel = QRErrorCorrectLevel;
  3143. return Fn;
  3144. }();
  3145. /** anlib **/
  3146. var drawingOptsSuccessTips = true;
  3147. /**
  3148. * 抛出错误
  3149. */
  3150. function throwError(str) {
  3151. uni.hideLoading();
  3152. uni.showToast({
  3153. title: '有字符暂不支持',
  3154. icon: 'none',
  3155. duration: 2000 });
  3156. drawingOptsSuccessTips = false;
  3157. //throw new Error(str);
  3158. }var _default =
  3159. QRCode;exports.default = _default;
  3160. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3161. /***/ }),
  3162. /***/ 11:
  3163. /*!**********************************************************************************************************!*\
  3164. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  3165. \**********************************************************************************************************/
  3166. /*! exports provided: default */
  3167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3168. "use strict";
  3169. __webpack_require__.r(__webpack_exports__);
  3170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  3171. /* globals __VUE_SSR_CONTEXT__ */
  3172. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  3173. // This module is a runtime utility for cleaner component module output and will
  3174. // be included in the final webpack user bundle.
  3175. function normalizeComponent (
  3176. scriptExports,
  3177. render,
  3178. staticRenderFns,
  3179. functionalTemplate,
  3180. injectStyles,
  3181. scopeId,
  3182. moduleIdentifier, /* server only */
  3183. shadowMode, /* vue-cli only */
  3184. components, // fixed by xxxxxx auto components
  3185. renderjs // fixed by xxxxxx renderjs
  3186. ) {
  3187. // Vue.extend constructor export interop
  3188. var options = typeof scriptExports === 'function'
  3189. ? scriptExports.options
  3190. : scriptExports
  3191. // fixed by xxxxxx auto components
  3192. if (components) {
  3193. if (!options.components) {
  3194. options.components = {}
  3195. }
  3196. var hasOwn = Object.prototype.hasOwnProperty
  3197. for (var name in components) {
  3198. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  3199. options.components[name] = components[name]
  3200. }
  3201. }
  3202. }
  3203. // fixed by xxxxxx renderjs
  3204. if (renderjs) {
  3205. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  3206. this[renderjs.__module] = this
  3207. });
  3208. (options.mixins || (options.mixins = [])).push(renderjs)
  3209. }
  3210. // render functions
  3211. if (render) {
  3212. options.render = render
  3213. options.staticRenderFns = staticRenderFns
  3214. options._compiled = true
  3215. }
  3216. // functional template
  3217. if (functionalTemplate) {
  3218. options.functional = true
  3219. }
  3220. // scopedId
  3221. if (scopeId) {
  3222. options._scopeId = 'data-v-' + scopeId
  3223. }
  3224. var hook
  3225. if (moduleIdentifier) { // server build
  3226. hook = function (context) {
  3227. // 2.3 injection
  3228. context =
  3229. context || // cached call
  3230. (this.$vnode && this.$vnode.ssrContext) || // stateful
  3231. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  3232. // 2.2 with runInNewContext: true
  3233. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  3234. context = __VUE_SSR_CONTEXT__
  3235. }
  3236. // inject component styles
  3237. if (injectStyles) {
  3238. injectStyles.call(this, context)
  3239. }
  3240. // register component module identifier for async chunk inferrence
  3241. if (context && context._registeredComponents) {
  3242. context._registeredComponents.add(moduleIdentifier)
  3243. }
  3244. }
  3245. // used by ssr in case component is cached and beforeCreate
  3246. // never gets called
  3247. options._ssrRegister = hook
  3248. } else if (injectStyles) {
  3249. hook = shadowMode
  3250. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  3251. : injectStyles
  3252. }
  3253. if (hook) {
  3254. if (options.functional) {
  3255. // for template-only hot-reload because in that case the render fn doesn't
  3256. // go through the normalizer
  3257. options._injectStyles = hook
  3258. // register for functioal component in vue file
  3259. var originalRender = options.render
  3260. options.render = function renderWithStyleInjection (h, context) {
  3261. hook.call(context)
  3262. return originalRender(h, context)
  3263. }
  3264. } else {
  3265. // inject component registration as beforeCreate hook
  3266. var existing = options.beforeCreate
  3267. options.beforeCreate = existing
  3268. ? [].concat(existing, hook)
  3269. : [hook]
  3270. }
  3271. }
  3272. return {
  3273. exports: scriptExports,
  3274. options: options
  3275. }
  3276. }
  3277. /***/ }),
  3278. /***/ 12:
  3279. /*!*******************************************************!*\
  3280. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/index.js ***!
  3281. \*******************************************************/
  3282. /*! no static exports found */
  3283. /***/ (function(module, exports, __webpack_require__) {
  3284. "use strict";
  3285. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  3286. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  3287. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  3288. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  3289. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  3290. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  3291. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  3292. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  3293. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  3294. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  3295. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  3296. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  3297. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  3298. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  3299. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  3300. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  3301. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  3302. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  3303. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  3304. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  3305. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  3306. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  3307. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  3308. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  3309. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  3310. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  3311. // 引入关于是否mixin集成小程序分享的配置
  3312. // import wxshare from './libs/mixin/mpShare.js'
  3313. // 全局挂载引入http相关请求拦截插件
  3314. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  3315. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  3316. // 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
  3317. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  3318. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  3319. // let vuexStore = {};
  3320. // try {
  3321. // vuexStore = require("@/store/$u.mixin.js");
  3322. // } catch (e) {
  3323. // //TODO handle the exception
  3324. // }
  3325. // post类型对象参数转为get类型url参数
  3326. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  3327. 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,
  3328. post: _request.default.post,
  3329. put: _request.default.put,
  3330. 'delete': _request.default.delete,
  3331. hexToRgb: _colorGradient.default.hexToRgb,
  3332. rgbToHex: _colorGradient.default.rgbToHex,
  3333. test: _test.default,
  3334. random: _random.default,
  3335. deepClone: _deepClone.default,
  3336. deepMerge: _deepMerge.default,
  3337. getParent: _getParent.default,
  3338. $parent: _$parent.default,
  3339. addUnit: _addUnit.default,
  3340. trim: _trim.default,
  3341. type: ['primary', 'success', 'error', 'warning', 'info'],
  3342. http: _request.default,
  3343. toast: _toast.default,
  3344. config: _config.default, // uView配置信息相关,比如版本号
  3345. zIndex: _zIndex.default,
  3346. debounce: _debounce.default,
  3347. throttle: _throttle.default };
  3348. // $u挂载到uni对象上
  3349. uni.$u = $u;
  3350. var install = function install(Vue) {
  3351. Vue.mixin(_mixin.default);
  3352. if (Vue.prototype.openShare) {
  3353. Vue.mixin(mpShare);
  3354. }
  3355. // Vue.mixin(vuexStore);
  3356. // 时间格式化,同时两个名称,date和timeFormat
  3357. Vue.filter('timeFormat', function (timestamp, format) {
  3358. return (0, _timeFormat.default)(timestamp, format);
  3359. });
  3360. Vue.filter('date', function (timestamp, format) {
  3361. return (0, _timeFormat.default)(timestamp, format);
  3362. });
  3363. // 将多久以前的方法,注入到全局过滤器
  3364. Vue.filter('timeFrom', function (timestamp, format) {
  3365. return (0, _timeFrom.default)(timestamp, format);
  3366. });
  3367. Vue.prototype.$u = $u;
  3368. };var _default =
  3369. {
  3370. install: install };exports.default = _default;
  3371. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3372. /***/ }),
  3373. /***/ 13:
  3374. /*!******************************************************************!*\
  3375. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  3376. \******************************************************************/
  3377. /*! no static exports found */
  3378. /***/ (function(module, exports, __webpack_require__) {
  3379. "use strict";
  3380. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3381. data: function data() {
  3382. return {};
  3383. },
  3384. onLoad: function onLoad() {
  3385. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  3386. this.$u.getRect = this.$uGetRect;
  3387. },
  3388. methods: {
  3389. // 查询节点信息
  3390. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  3391. // 解决办法为在组件根部再套一个没有任何作用的view元素
  3392. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  3393. return new Promise(function (resolve) {
  3394. uni.createSelectorQuery().
  3395. in(_this)[all ? 'selectAll' : 'select'](selector).
  3396. boundingClientRect(function (rect) {
  3397. if (all && Array.isArray(rect) && rect.length) {
  3398. resolve(rect);
  3399. }
  3400. if (!all && rect) {
  3401. resolve(rect);
  3402. }
  3403. }).
  3404. exec();
  3405. });
  3406. },
  3407. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  3408. // 避免在created中去定义parent变量
  3409. if (!this.parent) this.parent = false;
  3410. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  3411. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  3412. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  3413. this.parent = this.$u.$parent.call(this, parentName);
  3414. if (this.parent) {
  3415. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  3416. Object.keys(this.parentData).map(function (key) {
  3417. _this2.parentData[key] = _this2.parent[key];
  3418. });
  3419. }
  3420. },
  3421. // 阻止事件冒泡
  3422. preventEvent: function preventEvent(e) {
  3423. e && e.stopPropagation && e.stopPropagation();
  3424. } },
  3425. onReachBottom: function onReachBottom() {
  3426. uni.$emit('uOnReachBottom');
  3427. },
  3428. beforeDestroy: function beforeDestroy() {var _this3 = this;
  3429. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  3430. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  3431. if (this.parent && uni.$u.test.array(this.parent.children)) {
  3432. // 组件销毁时,移除父组件中的children数组中对应的实例
  3433. var childrenList = this.parent.children;
  3434. childrenList.map(function (child, index) {
  3435. // 如果相等,则移除
  3436. if (child === _this3) {
  3437. childrenList.splice(index, 1);
  3438. }
  3439. });
  3440. }
  3441. } };exports.default = _default;
  3442. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3443. /***/ }),
  3444. /***/ 14:
  3445. /*!********************************************************************!*\
  3446. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  3447. \********************************************************************/
  3448. /*! no static exports found */
  3449. /***/ (function(module, exports, __webpack_require__) {
  3450. "use strict";
  3451. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  3452. 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
  3453. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  3454. // 设置全局默认配置
  3455. value: function setConfig(customConfig) {
  3456. // 深度合并对象,否则会造成对象深层属性丢失
  3457. this.config = (0, _deepMerge.default)(this.config, customConfig);
  3458. }
  3459. // 主要请求部分
  3460. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3461. // 检查请求拦截
  3462. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  3463. var tmpConfig = {};
  3464. var interceptorRequest = this.interceptor.request(options);
  3465. if (interceptorRequest === false) {
  3466. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  3467. return new Promise(function () {});
  3468. }
  3469. this.options = interceptorRequest;
  3470. }
  3471. options.dataType = options.dataType || this.config.dataType;
  3472. options.responseType = options.responseType || this.config.responseType;
  3473. options.url = options.url || '';
  3474. options.params = options.params || {};
  3475. options.header = Object.assign({}, this.config.header, options.header);
  3476. options.method = options.method || this.config.method;
  3477. return new Promise(function (resolve, reject) {
  3478. options.complete = function (response) {
  3479. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  3480. uni.hideLoading();
  3481. // 清除定时器,如果请求回来了,就无需loading
  3482. clearTimeout(_this.config.timer);
  3483. _this.config.timer = null;
  3484. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  3485. if (_this.config.originalData) {
  3486. // 判断是否存在拦截器
  3487. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  3488. var resInterceptors = _this.interceptor.response(response);
  3489. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  3490. if (resInterceptors !== false) {
  3491. resolve(resInterceptors);
  3492. } else {
  3493. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  3494. reject(response);
  3495. }
  3496. } else {
  3497. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  3498. resolve(response);
  3499. }
  3500. } else {
  3501. if (response.statusCode == 200) {
  3502. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  3503. var _resInterceptors = _this.interceptor.response(response.data);
  3504. if (_resInterceptors !== false) {
  3505. resolve(_resInterceptors);
  3506. } else {
  3507. reject(response.data);
  3508. }
  3509. } else {
  3510. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  3511. resolve(response.data);
  3512. }
  3513. } else {
  3514. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  3515. // if(response.errMsg) {
  3516. // uni.showModal({
  3517. // title: response.errMsg
  3518. // });
  3519. // }
  3520. reject(response);
  3521. }
  3522. }
  3523. };
  3524. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  3525. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  3526. options.url : '/' + options.url);
  3527. // 是否显示loading
  3528. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  3529. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  3530. if (_this.config.showLoading && !_this.config.timer) {
  3531. _this.config.timer = setTimeout(function () {
  3532. uni.showLoading({
  3533. title: _this.config.loadingText,
  3534. mask: _this.config.loadingMask });
  3535. _this.config.timer = null;
  3536. }, _this.config.loadingTime);
  3537. }
  3538. uni.request(options);
  3539. });
  3540. // .catch(res => {
  3541. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  3542. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  3543. // return new Promise(()=>{});
  3544. // })
  3545. } }]);
  3546. function Request() {var _this2 = this;_classCallCheck(this, Request);
  3547. this.config = {
  3548. baseUrl: '', // 请求的根域名
  3549. // 默认的请求头
  3550. header: {},
  3551. method: 'POST',
  3552. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  3553. dataType: 'json',
  3554. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  3555. responseType: 'text',
  3556. showLoading: true, // 是否显示请求中的loading
  3557. loadingText: '请求中...',
  3558. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  3559. timer: null, // 定时器
  3560. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  3561. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  3562. };
  3563. // 拦截器
  3564. this.interceptor = {
  3565. // 请求前的拦截
  3566. request: null,
  3567. // 请求后的拦截
  3568. response: null };
  3569. // get请求
  3570. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3571. return _this2.request({
  3572. method: 'GET',
  3573. url: url,
  3574. header: header,
  3575. data: data });
  3576. };
  3577. // post请求
  3578. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3579. return _this2.request({
  3580. url: url,
  3581. method: 'POST',
  3582. header: header,
  3583. data: data });
  3584. };
  3585. // put请求,不支持支付宝小程序(HX2.6.15)
  3586. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3587. return _this2.request({
  3588. url: url,
  3589. method: 'PUT',
  3590. header: header,
  3591. data: data });
  3592. };
  3593. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  3594. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3595. return _this2.request({
  3596. url: url,
  3597. method: 'DELETE',
  3598. header: header,
  3599. data: data });
  3600. };
  3601. }return Request;}();var _default =
  3602. new Request();exports.default = _default;
  3603. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3604. /***/ }),
  3605. /***/ 15:
  3606. /*!*************************************************************************!*\
  3607. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  3608. \*************************************************************************/
  3609. /*! no static exports found */
  3610. /***/ (function(module, exports, __webpack_require__) {
  3611. "use strict";
  3612. 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 };}
  3613. // JS对象深度合并
  3614. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3615. target = (0, _deepClone.default)(target);
  3616. if (typeof target !== 'object' || typeof source !== 'object') return false;
  3617. for (var prop in source) {
  3618. if (!source.hasOwnProperty(prop)) continue;
  3619. if (prop in target) {
  3620. if (typeof target[prop] !== 'object') {
  3621. target[prop] = source[prop];
  3622. } else {
  3623. if (typeof source[prop] !== 'object') {
  3624. target[prop] = source[prop];
  3625. } else {
  3626. if (target[prop].concat && source[prop].concat) {
  3627. target[prop] = target[prop].concat(source[prop]);
  3628. } else {
  3629. target[prop] = deepMerge(target[prop], source[prop]);
  3630. }
  3631. }
  3632. }
  3633. } else {
  3634. target[prop] = source[prop];
  3635. }
  3636. }
  3637. return target;
  3638. }var _default =
  3639. deepMerge;exports.default = _default;
  3640. /***/ }),
  3641. /***/ 16:
  3642. /*!*************************************************************************!*\
  3643. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  3644. \*************************************************************************/
  3645. /*! no static exports found */
  3646. /***/ (function(module, exports, __webpack_require__) {
  3647. "use strict";
  3648. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  3649. function isArray(arr) {
  3650. return Object.prototype.toString.call(arr) === '[object Array]';
  3651. }
  3652. // 深度克隆
  3653. function deepClone(obj) {
  3654. // 对常见的“非”值,直接返回原来值
  3655. if ([null, undefined, NaN, false].includes(obj)) return obj;
  3656. if (typeof obj !== "object" && typeof obj !== 'function') {
  3657. //原始类型直接返回
  3658. return obj;
  3659. }
  3660. var o = isArray(obj) ? [] : {};
  3661. for (var i in obj) {
  3662. if (obj.hasOwnProperty(i)) {
  3663. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  3664. }
  3665. }
  3666. return o;
  3667. }var _default =
  3668. deepClone;exports.default = _default;
  3669. /***/ }),
  3670. /***/ 17:
  3671. /*!********************************************************************!*\
  3672. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  3673. \********************************************************************/
  3674. /*! no static exports found */
  3675. /***/ (function(module, exports, __webpack_require__) {
  3676. "use strict";
  3677. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3678. * 验证电子邮箱格式
  3679. */
  3680. function email(value) {
  3681. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  3682. }
  3683. /**
  3684. * 验证手机格式
  3685. */
  3686. function mobile(value) {
  3687. return /^1[23456789]\d{9}$/.test(value);
  3688. }
  3689. /**
  3690. * 验证URL格式
  3691. */
  3692. function url(value) {
  3693. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  3694. }
  3695. /**
  3696. * 验证日期格式
  3697. */
  3698. function date(value) {
  3699. return !/Invalid|NaN/.test(new Date(value).toString());
  3700. }
  3701. /**
  3702. * 验证ISO类型的日期格式
  3703. */
  3704. function dateISO(value) {
  3705. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  3706. }
  3707. /**
  3708. * 验证十进制数字
  3709. */
  3710. function number(value) {
  3711. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  3712. }
  3713. /**
  3714. * 验证整数
  3715. */
  3716. function digits(value) {
  3717. return /^\d+$/.test(value);
  3718. }
  3719. /**
  3720. * 验证身份证号码
  3721. */
  3722. function idCard(value) {
  3723. 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(
  3724. value);
  3725. }
  3726. /**
  3727. * 是否车牌号
  3728. */
  3729. function carNo(value) {
  3730. // 新能源车牌
  3731. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  3732. // 旧车牌
  3733. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  3734. if (value.length === 7) {
  3735. return creg.test(value);
  3736. } else if (value.length === 8) {
  3737. return xreg.test(value);
  3738. } else {
  3739. return false;
  3740. }
  3741. }
  3742. /**
  3743. * 金额,只允许2位小数
  3744. */
  3745. function amount(value) {
  3746. //金额,只允许保留两位小数
  3747. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  3748. }
  3749. /**
  3750. * 中文
  3751. */
  3752. function chinese(value) {
  3753. var reg = /^[\u4e00-\u9fa5]+$/gi;
  3754. return reg.test(value);
  3755. }
  3756. /**
  3757. * 只能输入字母
  3758. */
  3759. function letter(value) {
  3760. return /^[a-zA-Z]*$/.test(value);
  3761. }
  3762. /**
  3763. * 只能是字母或者数字
  3764. */
  3765. function enOrNum(value) {
  3766. //英文或者数字
  3767. var reg = /^[0-9a-zA-Z]*$/g;
  3768. return reg.test(value);
  3769. }
  3770. /**
  3771. * 验证是否包含某个值
  3772. */
  3773. function contains(value, param) {
  3774. return value.indexOf(param) >= 0;
  3775. }
  3776. /**
  3777. * 验证一个值范围[min, max]
  3778. */
  3779. function range(value, param) {
  3780. return value >= param[0] && value <= param[1];
  3781. }
  3782. /**
  3783. * 验证一个长度范围[min, max]
  3784. */
  3785. function rangeLength(value, param) {
  3786. return value.length >= param[0] && value.length <= param[1];
  3787. }
  3788. /**
  3789. * 是否固定电话
  3790. */
  3791. function landline(value) {
  3792. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  3793. return reg.test(value);
  3794. }
  3795. /**
  3796. * 判断是否为空
  3797. */
  3798. function empty(value) {
  3799. switch (typeof value) {
  3800. case 'undefined':
  3801. return true;
  3802. case 'string':
  3803. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  3804. break;
  3805. case 'boolean':
  3806. if (!value) return true;
  3807. break;
  3808. case 'number':
  3809. if (0 === value || isNaN(value)) return true;
  3810. break;
  3811. case 'object':
  3812. if (null === value || value.length === 0) return true;
  3813. for (var i in value) {
  3814. return false;
  3815. }
  3816. return true;}
  3817. return false;
  3818. }
  3819. /**
  3820. * 是否json字符串
  3821. */
  3822. function jsonString(value) {
  3823. if (typeof value == 'string') {
  3824. try {
  3825. var obj = JSON.parse(value);
  3826. if (typeof obj == 'object' && obj) {
  3827. return true;
  3828. } else {
  3829. return false;
  3830. }
  3831. } catch (e) {
  3832. return false;
  3833. }
  3834. }
  3835. return false;
  3836. }
  3837. /**
  3838. * 是否数组
  3839. */
  3840. function array(value) {
  3841. if (typeof Array.isArray === "function") {
  3842. return Array.isArray(value);
  3843. } else {
  3844. return Object.prototype.toString.call(value) === "[object Array]";
  3845. }
  3846. }
  3847. /**
  3848. * 是否对象
  3849. */
  3850. function object(value) {
  3851. return Object.prototype.toString.call(value) === '[object Object]';
  3852. }
  3853. /**
  3854. * 是否短信验证码
  3855. */
  3856. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  3857. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  3858. }var _default =
  3859. {
  3860. email: email,
  3861. mobile: mobile,
  3862. url: url,
  3863. date: date,
  3864. dateISO: dateISO,
  3865. number: number,
  3866. digits: digits,
  3867. idCard: idCard,
  3868. carNo: carNo,
  3869. amount: amount,
  3870. chinese: chinese,
  3871. letter: letter,
  3872. enOrNum: enOrNum,
  3873. contains: contains,
  3874. range: range,
  3875. rangeLength: rangeLength,
  3876. empty: empty,
  3877. isEmpty: empty,
  3878. jsonString: jsonString,
  3879. landline: landline,
  3880. object: object,
  3881. array: array,
  3882. code: code };exports.default = _default;
  3883. /***/ }),
  3884. /***/ 18:
  3885. /*!***************************************************************************!*\
  3886. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  3887. \***************************************************************************/
  3888. /*! no static exports found */
  3889. /***/ (function(module, exports, __webpack_require__) {
  3890. "use strict";
  3891. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3892. * 对象转url参数
  3893. * @param {*} data,对象
  3894. * @param {*} isPrefix,是否自动加上"?"
  3895. */
  3896. 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';
  3897. var prefix = isPrefix ? '?' : '';
  3898. var _result = [];
  3899. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  3900. key) {
  3901. var value = data[key];
  3902. // 去掉为空的参数
  3903. if (['', undefined, null].indexOf(value) >= 0) {
  3904. return "continue";
  3905. }
  3906. // 如果值为数组,另行处理
  3907. if (value.constructor === Array) {
  3908. // e.g. {ids: [1, 2, 3]}
  3909. switch (arrayFormat) {
  3910. case 'indices':
  3911. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  3912. for (var i = 0; i < value.length; i++) {
  3913. _result.push(key + '[' + i + ']=' + value[i]);
  3914. }
  3915. break;
  3916. case 'brackets':
  3917. // 结果: ids[]=1&ids[]=2&ids[]=3
  3918. value.forEach(function (_value) {
  3919. _result.push(key + '[]=' + _value);
  3920. });
  3921. break;
  3922. case 'repeat':
  3923. // 结果: ids=1&ids=2&ids=3
  3924. value.forEach(function (_value) {
  3925. _result.push(key + '=' + _value);
  3926. });
  3927. break;
  3928. case 'comma':
  3929. // 结果: ids=1,2,3
  3930. var commaStr = "";
  3931. value.forEach(function (_value) {
  3932. commaStr += (commaStr ? "," : "") + _value;
  3933. });
  3934. _result.push(key + '=' + commaStr);
  3935. break;
  3936. default:
  3937. value.forEach(function (_value) {
  3938. _result.push(key + '[]=' + _value);
  3939. });}
  3940. } else {
  3941. _result.push(key + '=' + value);
  3942. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  3943. }
  3944. return _result.length ? prefix + _result.join('&') : '';
  3945. }var _default =
  3946. queryParams;exports.default = _default;
  3947. /***/ }),
  3948. /***/ 19:
  3949. /*!*********************************************************************!*\
  3950. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  3951. \*********************************************************************/
  3952. /*! no static exports found */
  3953. /***/ (function(module, exports, __webpack_require__) {
  3954. "use strict";
  3955. /* 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;} /**
  3956. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  3957. * 并且带有路由拦截功能
  3958. */var
  3959. Router = /*#__PURE__*/function () {
  3960. function Router() {_classCallCheck(this, Router);
  3961. // 原始属性定义
  3962. this.config = {
  3963. type: 'navigateTo',
  3964. url: '',
  3965. delta: 1, // navigateBack页面后退时,回退的层数
  3966. params: {}, // 传递的参数
  3967. animationType: 'pop-in', // 窗口动画,只在APP有效
  3968. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  3969. intercept: false // 是否需要拦截
  3970. };
  3971. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  3972. // 这里在构造函数中进行this绑定
  3973. this.route = this.route.bind(this);
  3974. }
  3975. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  3976. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  3977. return url[0] === '/' ? url : "/".concat(url);
  3978. }
  3979. // 整合路由参数
  3980. }, { key: "mixinParam", value: function mixinParam(url, params) {
  3981. url = url && this.addRootPath(url);
  3982. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  3983. // 如果有url中有get参数,转换后无需带上"?"
  3984. var query = '';
  3985. if (/.*\/.*\?.*=.*/.test(url)) {
  3986. // object对象转为get类型的参数
  3987. query = uni.$u.queryParams(params, false);
  3988. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  3989. return url += "&" + query;
  3990. } else {
  3991. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  3992. query = uni.$u.queryParams(params);
  3993. return url += query;
  3994. }
  3995. }
  3996. // 对外的方法名称
  3997. }, { 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] : {};
  3998. // 合并用户的配置和内部的默认配置
  3999. mergeConfig = {};
  4000. if (typeof options === 'string') {
  4001. // 如果options为字符串,则为route(url, params)的形式
  4002. mergeConfig.url = this.mixinParam(options, params);
  4003. mergeConfig.type = 'navigateTo';
  4004. } else {
  4005. mergeConfig = uni.$u.deepClone(options, this.config);
  4006. // 否则正常使用mergeConfig中的url和params进行拼接
  4007. mergeConfig.url = this.mixinParam(options.url, options.params);
  4008. }
  4009. if (params.intercept) {
  4010. this.config.intercept = params.intercept;
  4011. }
  4012. // params参数也带给拦截器
  4013. mergeConfig.params = params;
  4014. // 合并内外部参数
  4015. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  4016. // 判断用户是否定义了拦截器
  4017. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  4018. new Promise(function (resolve, reject) {
  4019. uni.$u.routeIntercept(mergeConfig, resolve);
  4020. }));case 10:isNext = _context.sent;
  4021. // 如果isNext为true,则执行路由跳转
  4022. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  4023. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  4024. // 执行路由跳转
  4025. }, { key: "openPage", value: function openPage(config) {
  4026. // 解构参数
  4027. var
  4028. url =
  4029. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  4030. if (config.type == 'navigateTo' || config.type == 'to') {
  4031. uni.navigateTo({
  4032. url: url,
  4033. animationType: animationType,
  4034. animationDuration: animationDuration });
  4035. }
  4036. if (config.type == 'redirectTo' || config.type == 'redirect') {
  4037. uni.redirectTo({
  4038. url: url });
  4039. }
  4040. if (config.type == 'switchTab' || config.type == 'tab') {
  4041. uni.switchTab({
  4042. url: url });
  4043. }
  4044. if (config.type == 'reLaunch' || config.type == 'launch') {
  4045. uni.reLaunch({
  4046. url: url });
  4047. }
  4048. if (config.type == 'navigateBack' || config.type == 'back') {
  4049. uni.navigateBack({
  4050. delta: delta });
  4051. }
  4052. } }]);return Router;}();var _default =
  4053. new Router().route;exports.default = _default;
  4054. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4055. /***/ }),
  4056. /***/ 2:
  4057. /*!***********************************!*\
  4058. !*** (webpack)/buildin/global.js ***!
  4059. \***********************************/
  4060. /*! no static exports found */
  4061. /***/ (function(module, exports) {
  4062. var g;
  4063. // This works in non-strict mode
  4064. g = (function() {
  4065. return this;
  4066. })();
  4067. try {
  4068. // This works if eval is allowed (see CSP)
  4069. g = g || new Function("return this")();
  4070. } catch (e) {
  4071. // This works if the window reference is available
  4072. if (typeof window === "object") g = window;
  4073. }
  4074. // g can still be undefined, but nothing to do about it...
  4075. // We return undefined, instead of nothing here, so it's
  4076. // easier to handle this case. if(!global) { ...}
  4077. module.exports = g;
  4078. /***/ }),
  4079. /***/ 20:
  4080. /*!**********************************************************!*\
  4081. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  4082. \**********************************************************/
  4083. /*! no static exports found */
  4084. /***/ (function(module, exports, __webpack_require__) {
  4085. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  4086. /***/ }),
  4087. /***/ 21:
  4088. /*!************************************************************!*\
  4089. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  4090. \************************************************************/
  4091. /*! no static exports found */
  4092. /***/ (function(module, exports, __webpack_require__) {
  4093. /**
  4094. * Copyright (c) 2014-present, Facebook, Inc.
  4095. *
  4096. * This source code is licensed under the MIT license found in the
  4097. * LICENSE file in the root directory of this source tree.
  4098. */
  4099. // This method of obtaining a reference to the global object needs to be
  4100. // kept identical to the way it is obtained in runtime.js
  4101. var g = (function() {
  4102. return this || (typeof self === "object" && self);
  4103. })() || Function("return this")();
  4104. // Use `getOwnPropertyNames` because not all browsers support calling
  4105. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  4106. var hadRuntime = g.regeneratorRuntime &&
  4107. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  4108. // Save the old regeneratorRuntime in case it needs to be restored later.
  4109. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  4110. // Force reevalutation of runtime.js.
  4111. g.regeneratorRuntime = undefined;
  4112. module.exports = __webpack_require__(/*! ./runtime */ 22);
  4113. if (hadRuntime) {
  4114. // Restore the original runtime.
  4115. g.regeneratorRuntime = oldRuntime;
  4116. } else {
  4117. // Remove the global property added by runtime.js.
  4118. try {
  4119. delete g.regeneratorRuntime;
  4120. } catch(e) {
  4121. g.regeneratorRuntime = undefined;
  4122. }
  4123. }
  4124. /***/ }),
  4125. /***/ 22:
  4126. /*!*****************************************************!*\
  4127. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  4128. \*****************************************************/
  4129. /*! no static exports found */
  4130. /***/ (function(module, exports) {
  4131. /**
  4132. * Copyright (c) 2014-present, Facebook, Inc.
  4133. *
  4134. * This source code is licensed under the MIT license found in the
  4135. * LICENSE file in the root directory of this source tree.
  4136. */
  4137. !(function(global) {
  4138. "use strict";
  4139. var Op = Object.prototype;
  4140. var hasOwn = Op.hasOwnProperty;
  4141. var undefined; // More compressible than void 0.
  4142. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  4143. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  4144. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  4145. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  4146. var inModule = typeof module === "object";
  4147. var runtime = global.regeneratorRuntime;
  4148. if (runtime) {
  4149. if (inModule) {
  4150. // If regeneratorRuntime is defined globally and we're in a module,
  4151. // make the exports object identical to regeneratorRuntime.
  4152. module.exports = runtime;
  4153. }
  4154. // Don't bother evaluating the rest of this file if the runtime was
  4155. // already defined globally.
  4156. return;
  4157. }
  4158. // Define the runtime globally (as expected by generated code) as either
  4159. // module.exports (if we're in a module) or a new, empty object.
  4160. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  4161. function wrap(innerFn, outerFn, self, tryLocsList) {
  4162. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  4163. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  4164. var generator = Object.create(protoGenerator.prototype);
  4165. var context = new Context(tryLocsList || []);
  4166. // The ._invoke method unifies the implementations of the .next,
  4167. // .throw, and .return methods.
  4168. generator._invoke = makeInvokeMethod(innerFn, self, context);
  4169. return generator;
  4170. }
  4171. runtime.wrap = wrap;
  4172. // Try/catch helper to minimize deoptimizations. Returns a completion
  4173. // record like context.tryEntries[i].completion. This interface could
  4174. // have been (and was previously) designed to take a closure to be
  4175. // invoked without arguments, but in all the cases we care about we
  4176. // already have an existing method we want to call, so there's no need
  4177. // to create a new function object. We can even get away with assuming
  4178. // the method takes exactly one argument, since that happens to be true
  4179. // in every case, so we don't have to touch the arguments object. The
  4180. // only additional allocation required is the completion record, which
  4181. // has a stable shape and so hopefully should be cheap to allocate.
  4182. function tryCatch(fn, obj, arg) {
  4183. try {
  4184. return { type: "normal", arg: fn.call(obj, arg) };
  4185. } catch (err) {
  4186. return { type: "throw", arg: err };
  4187. }
  4188. }
  4189. var GenStateSuspendedStart = "suspendedStart";
  4190. var GenStateSuspendedYield = "suspendedYield";
  4191. var GenStateExecuting = "executing";
  4192. var GenStateCompleted = "completed";
  4193. // Returning this object from the innerFn has the same effect as
  4194. // breaking out of the dispatch switch statement.
  4195. var ContinueSentinel = {};
  4196. // Dummy constructor functions that we use as the .constructor and
  4197. // .constructor.prototype properties for functions that return Generator
  4198. // objects. For full spec compliance, you may wish to configure your
  4199. // minifier not to mangle the names of these two functions.
  4200. function Generator() {}
  4201. function GeneratorFunction() {}
  4202. function GeneratorFunctionPrototype() {}
  4203. // This is a polyfill for %IteratorPrototype% for environments that
  4204. // don't natively support it.
  4205. var IteratorPrototype = {};
  4206. IteratorPrototype[iteratorSymbol] = function () {
  4207. return this;
  4208. };
  4209. var getProto = Object.getPrototypeOf;
  4210. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  4211. if (NativeIteratorPrototype &&
  4212. NativeIteratorPrototype !== Op &&
  4213. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  4214. // This environment has a native %IteratorPrototype%; use it instead
  4215. // of the polyfill.
  4216. IteratorPrototype = NativeIteratorPrototype;
  4217. }
  4218. var Gp = GeneratorFunctionPrototype.prototype =
  4219. Generator.prototype = Object.create(IteratorPrototype);
  4220. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  4221. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  4222. GeneratorFunctionPrototype[toStringTagSymbol] =
  4223. GeneratorFunction.displayName = "GeneratorFunction";
  4224. // Helper for defining the .next, .throw, and .return methods of the
  4225. // Iterator interface in terms of a single ._invoke method.
  4226. function defineIteratorMethods(prototype) {
  4227. ["next", "throw", "return"].forEach(function(method) {
  4228. prototype[method] = function(arg) {
  4229. return this._invoke(method, arg);
  4230. };
  4231. });
  4232. }
  4233. runtime.isGeneratorFunction = function(genFun) {
  4234. var ctor = typeof genFun === "function" && genFun.constructor;
  4235. return ctor
  4236. ? ctor === GeneratorFunction ||
  4237. // For the native GeneratorFunction constructor, the best we can
  4238. // do is to check its .name property.
  4239. (ctor.displayName || ctor.name) === "GeneratorFunction"
  4240. : false;
  4241. };
  4242. runtime.mark = function(genFun) {
  4243. if (Object.setPrototypeOf) {
  4244. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  4245. } else {
  4246. genFun.__proto__ = GeneratorFunctionPrototype;
  4247. if (!(toStringTagSymbol in genFun)) {
  4248. genFun[toStringTagSymbol] = "GeneratorFunction";
  4249. }
  4250. }
  4251. genFun.prototype = Object.create(Gp);
  4252. return genFun;
  4253. };
  4254. // Within the body of any async function, `await x` is transformed to
  4255. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  4256. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  4257. // meant to be awaited.
  4258. runtime.awrap = function(arg) {
  4259. return { __await: arg };
  4260. };
  4261. function AsyncIterator(generator) {
  4262. function invoke(method, arg, resolve, reject) {
  4263. var record = tryCatch(generator[method], generator, arg);
  4264. if (record.type === "throw") {
  4265. reject(record.arg);
  4266. } else {
  4267. var result = record.arg;
  4268. var value = result.value;
  4269. if (value &&
  4270. typeof value === "object" &&
  4271. hasOwn.call(value, "__await")) {
  4272. return Promise.resolve(value.__await).then(function(value) {
  4273. invoke("next", value, resolve, reject);
  4274. }, function(err) {
  4275. invoke("throw", err, resolve, reject);
  4276. });
  4277. }
  4278. return Promise.resolve(value).then(function(unwrapped) {
  4279. // When a yielded Promise is resolved, its final value becomes
  4280. // the .value of the Promise<{value,done}> result for the
  4281. // current iteration.
  4282. result.value = unwrapped;
  4283. resolve(result);
  4284. }, function(error) {
  4285. // If a rejected Promise was yielded, throw the rejection back
  4286. // into the async generator function so it can be handled there.
  4287. return invoke("throw", error, resolve, reject);
  4288. });
  4289. }
  4290. }
  4291. var previousPromise;
  4292. function enqueue(method, arg) {
  4293. function callInvokeWithMethodAndArg() {
  4294. return new Promise(function(resolve, reject) {
  4295. invoke(method, arg, resolve, reject);
  4296. });
  4297. }
  4298. return previousPromise =
  4299. // If enqueue has been called before, then we want to wait until
  4300. // all previous Promises have been resolved before calling invoke,
  4301. // so that results are always delivered in the correct order. If
  4302. // enqueue has not been called before, then it is important to
  4303. // call invoke immediately, without waiting on a callback to fire,
  4304. // so that the async generator function has the opportunity to do
  4305. // any necessary setup in a predictable way. This predictability
  4306. // is why the Promise constructor synchronously invokes its
  4307. // executor callback, and why async functions synchronously
  4308. // execute code before the first await. Since we implement simple
  4309. // async functions in terms of async generators, it is especially
  4310. // important to get this right, even though it requires care.
  4311. previousPromise ? previousPromise.then(
  4312. callInvokeWithMethodAndArg,
  4313. // Avoid propagating failures to Promises returned by later
  4314. // invocations of the iterator.
  4315. callInvokeWithMethodAndArg
  4316. ) : callInvokeWithMethodAndArg();
  4317. }
  4318. // Define the unified helper method that is used to implement .next,
  4319. // .throw, and .return (see defineIteratorMethods).
  4320. this._invoke = enqueue;
  4321. }
  4322. defineIteratorMethods(AsyncIterator.prototype);
  4323. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  4324. return this;
  4325. };
  4326. runtime.AsyncIterator = AsyncIterator;
  4327. // Note that simple async functions are implemented on top of
  4328. // AsyncIterator objects; they just return a Promise for the value of
  4329. // the final result produced by the iterator.
  4330. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  4331. var iter = new AsyncIterator(
  4332. wrap(innerFn, outerFn, self, tryLocsList)
  4333. );
  4334. return runtime.isGeneratorFunction(outerFn)
  4335. ? iter // If outerFn is a generator, return the full iterator.
  4336. : iter.next().then(function(result) {
  4337. return result.done ? result.value : iter.next();
  4338. });
  4339. };
  4340. function makeInvokeMethod(innerFn, self, context) {
  4341. var state = GenStateSuspendedStart;
  4342. return function invoke(method, arg) {
  4343. if (state === GenStateExecuting) {
  4344. throw new Error("Generator is already running");
  4345. }
  4346. if (state === GenStateCompleted) {
  4347. if (method === "throw") {
  4348. throw arg;
  4349. }
  4350. // Be forgiving, per 25.3.3.3.3 of the spec:
  4351. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  4352. return doneResult();
  4353. }
  4354. context.method = method;
  4355. context.arg = arg;
  4356. while (true) {
  4357. var delegate = context.delegate;
  4358. if (delegate) {
  4359. var delegateResult = maybeInvokeDelegate(delegate, context);
  4360. if (delegateResult) {
  4361. if (delegateResult === ContinueSentinel) continue;
  4362. return delegateResult;
  4363. }
  4364. }
  4365. if (context.method === "next") {
  4366. // Setting context._sent for legacy support of Babel's
  4367. // function.sent implementation.
  4368. context.sent = context._sent = context.arg;
  4369. } else if (context.method === "throw") {
  4370. if (state === GenStateSuspendedStart) {
  4371. state = GenStateCompleted;
  4372. throw context.arg;
  4373. }
  4374. context.dispatchException(context.arg);
  4375. } else if (context.method === "return") {
  4376. context.abrupt("return", context.arg);
  4377. }
  4378. state = GenStateExecuting;
  4379. var record = tryCatch(innerFn, self, context);
  4380. if (record.type === "normal") {
  4381. // If an exception is thrown from innerFn, we leave state ===
  4382. // GenStateExecuting and loop back for another invocation.
  4383. state = context.done
  4384. ? GenStateCompleted
  4385. : GenStateSuspendedYield;
  4386. if (record.arg === ContinueSentinel) {
  4387. continue;
  4388. }
  4389. return {
  4390. value: record.arg,
  4391. done: context.done
  4392. };
  4393. } else if (record.type === "throw") {
  4394. state = GenStateCompleted;
  4395. // Dispatch the exception by looping back around to the
  4396. // context.dispatchException(context.arg) call above.
  4397. context.method = "throw";
  4398. context.arg = record.arg;
  4399. }
  4400. }
  4401. };
  4402. }
  4403. // Call delegate.iterator[context.method](context.arg) and handle the
  4404. // result, either by returning a { value, done } result from the
  4405. // delegate iterator, or by modifying context.method and context.arg,
  4406. // setting context.delegate to null, and returning the ContinueSentinel.
  4407. function maybeInvokeDelegate(delegate, context) {
  4408. var method = delegate.iterator[context.method];
  4409. if (method === undefined) {
  4410. // A .throw or .return when the delegate iterator has no .throw
  4411. // method always terminates the yield* loop.
  4412. context.delegate = null;
  4413. if (context.method === "throw") {
  4414. if (delegate.iterator.return) {
  4415. // If the delegate iterator has a return method, give it a
  4416. // chance to clean up.
  4417. context.method = "return";
  4418. context.arg = undefined;
  4419. maybeInvokeDelegate(delegate, context);
  4420. if (context.method === "throw") {
  4421. // If maybeInvokeDelegate(context) changed context.method from
  4422. // "return" to "throw", let that override the TypeError below.
  4423. return ContinueSentinel;
  4424. }
  4425. }
  4426. context.method = "throw";
  4427. context.arg = new TypeError(
  4428. "The iterator does not provide a 'throw' method");
  4429. }
  4430. return ContinueSentinel;
  4431. }
  4432. var record = tryCatch(method, delegate.iterator, context.arg);
  4433. if (record.type === "throw") {
  4434. context.method = "throw";
  4435. context.arg = record.arg;
  4436. context.delegate = null;
  4437. return ContinueSentinel;
  4438. }
  4439. var info = record.arg;
  4440. if (! info) {
  4441. context.method = "throw";
  4442. context.arg = new TypeError("iterator result is not an object");
  4443. context.delegate = null;
  4444. return ContinueSentinel;
  4445. }
  4446. if (info.done) {
  4447. // Assign the result of the finished delegate to the temporary
  4448. // variable specified by delegate.resultName (see delegateYield).
  4449. context[delegate.resultName] = info.value;
  4450. // Resume execution at the desired location (see delegateYield).
  4451. context.next = delegate.nextLoc;
  4452. // If context.method was "throw" but the delegate handled the
  4453. // exception, let the outer generator proceed normally. If
  4454. // context.method was "next", forget context.arg since it has been
  4455. // "consumed" by the delegate iterator. If context.method was
  4456. // "return", allow the original .return call to continue in the
  4457. // outer generator.
  4458. if (context.method !== "return") {
  4459. context.method = "next";
  4460. context.arg = undefined;
  4461. }
  4462. } else {
  4463. // Re-yield the result returned by the delegate method.
  4464. return info;
  4465. }
  4466. // The delegate iterator is finished, so forget it and continue with
  4467. // the outer generator.
  4468. context.delegate = null;
  4469. return ContinueSentinel;
  4470. }
  4471. // Define Generator.prototype.{next,throw,return} in terms of the
  4472. // unified ._invoke helper method.
  4473. defineIteratorMethods(Gp);
  4474. Gp[toStringTagSymbol] = "Generator";
  4475. // A Generator should always return itself as the iterator object when the
  4476. // @@iterator function is called on it. Some browsers' implementations of the
  4477. // iterator prototype chain incorrectly implement this, causing the Generator
  4478. // object to not be returned from this call. This ensures that doesn't happen.
  4479. // See https://github.com/facebook/regenerator/issues/274 for more details.
  4480. Gp[iteratorSymbol] = function() {
  4481. return this;
  4482. };
  4483. Gp.toString = function() {
  4484. return "[object Generator]";
  4485. };
  4486. function pushTryEntry(locs) {
  4487. var entry = { tryLoc: locs[0] };
  4488. if (1 in locs) {
  4489. entry.catchLoc = locs[1];
  4490. }
  4491. if (2 in locs) {
  4492. entry.finallyLoc = locs[2];
  4493. entry.afterLoc = locs[3];
  4494. }
  4495. this.tryEntries.push(entry);
  4496. }
  4497. function resetTryEntry(entry) {
  4498. var record = entry.completion || {};
  4499. record.type = "normal";
  4500. delete record.arg;
  4501. entry.completion = record;
  4502. }
  4503. function Context(tryLocsList) {
  4504. // The root entry object (effectively a try statement without a catch
  4505. // or a finally block) gives us a place to store values thrown from
  4506. // locations where there is no enclosing try statement.
  4507. this.tryEntries = [{ tryLoc: "root" }];
  4508. tryLocsList.forEach(pushTryEntry, this);
  4509. this.reset(true);
  4510. }
  4511. runtime.keys = function(object) {
  4512. var keys = [];
  4513. for (var key in object) {
  4514. keys.push(key);
  4515. }
  4516. keys.reverse();
  4517. // Rather than returning an object with a next method, we keep
  4518. // things simple and return the next function itself.
  4519. return function next() {
  4520. while (keys.length) {
  4521. var key = keys.pop();
  4522. if (key in object) {
  4523. next.value = key;
  4524. next.done = false;
  4525. return next;
  4526. }
  4527. }
  4528. // To avoid creating an additional object, we just hang the .value
  4529. // and .done properties off the next function object itself. This
  4530. // also ensures that the minifier will not anonymize the function.
  4531. next.done = true;
  4532. return next;
  4533. };
  4534. };
  4535. function values(iterable) {
  4536. if (iterable) {
  4537. var iteratorMethod = iterable[iteratorSymbol];
  4538. if (iteratorMethod) {
  4539. return iteratorMethod.call(iterable);
  4540. }
  4541. if (typeof iterable.next === "function") {
  4542. return iterable;
  4543. }
  4544. if (!isNaN(iterable.length)) {
  4545. var i = -1, next = function next() {
  4546. while (++i < iterable.length) {
  4547. if (hasOwn.call(iterable, i)) {
  4548. next.value = iterable[i];
  4549. next.done = false;
  4550. return next;
  4551. }
  4552. }
  4553. next.value = undefined;
  4554. next.done = true;
  4555. return next;
  4556. };
  4557. return next.next = next;
  4558. }
  4559. }
  4560. // Return an iterator with no values.
  4561. return { next: doneResult };
  4562. }
  4563. runtime.values = values;
  4564. function doneResult() {
  4565. return { value: undefined, done: true };
  4566. }
  4567. Context.prototype = {
  4568. constructor: Context,
  4569. reset: function(skipTempReset) {
  4570. this.prev = 0;
  4571. this.next = 0;
  4572. // Resetting context._sent for legacy support of Babel's
  4573. // function.sent implementation.
  4574. this.sent = this._sent = undefined;
  4575. this.done = false;
  4576. this.delegate = null;
  4577. this.method = "next";
  4578. this.arg = undefined;
  4579. this.tryEntries.forEach(resetTryEntry);
  4580. if (!skipTempReset) {
  4581. for (var name in this) {
  4582. // Not sure about the optimal order of these conditions:
  4583. if (name.charAt(0) === "t" &&
  4584. hasOwn.call(this, name) &&
  4585. !isNaN(+name.slice(1))) {
  4586. this[name] = undefined;
  4587. }
  4588. }
  4589. }
  4590. },
  4591. stop: function() {
  4592. this.done = true;
  4593. var rootEntry = this.tryEntries[0];
  4594. var rootRecord = rootEntry.completion;
  4595. if (rootRecord.type === "throw") {
  4596. throw rootRecord.arg;
  4597. }
  4598. return this.rval;
  4599. },
  4600. dispatchException: function(exception) {
  4601. if (this.done) {
  4602. throw exception;
  4603. }
  4604. var context = this;
  4605. function handle(loc, caught) {
  4606. record.type = "throw";
  4607. record.arg = exception;
  4608. context.next = loc;
  4609. if (caught) {
  4610. // If the dispatched exception was caught by a catch block,
  4611. // then let that catch block handle the exception normally.
  4612. context.method = "next";
  4613. context.arg = undefined;
  4614. }
  4615. return !! caught;
  4616. }
  4617. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4618. var entry = this.tryEntries[i];
  4619. var record = entry.completion;
  4620. if (entry.tryLoc === "root") {
  4621. // Exception thrown outside of any try block that could handle
  4622. // it, so set the completion value of the entire function to
  4623. // throw the exception.
  4624. return handle("end");
  4625. }
  4626. if (entry.tryLoc <= this.prev) {
  4627. var hasCatch = hasOwn.call(entry, "catchLoc");
  4628. var hasFinally = hasOwn.call(entry, "finallyLoc");
  4629. if (hasCatch && hasFinally) {
  4630. if (this.prev < entry.catchLoc) {
  4631. return handle(entry.catchLoc, true);
  4632. } else if (this.prev < entry.finallyLoc) {
  4633. return handle(entry.finallyLoc);
  4634. }
  4635. } else if (hasCatch) {
  4636. if (this.prev < entry.catchLoc) {
  4637. return handle(entry.catchLoc, true);
  4638. }
  4639. } else if (hasFinally) {
  4640. if (this.prev < entry.finallyLoc) {
  4641. return handle(entry.finallyLoc);
  4642. }
  4643. } else {
  4644. throw new Error("try statement without catch or finally");
  4645. }
  4646. }
  4647. }
  4648. },
  4649. abrupt: function(type, arg) {
  4650. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4651. var entry = this.tryEntries[i];
  4652. if (entry.tryLoc <= this.prev &&
  4653. hasOwn.call(entry, "finallyLoc") &&
  4654. this.prev < entry.finallyLoc) {
  4655. var finallyEntry = entry;
  4656. break;
  4657. }
  4658. }
  4659. if (finallyEntry &&
  4660. (type === "break" ||
  4661. type === "continue") &&
  4662. finallyEntry.tryLoc <= arg &&
  4663. arg <= finallyEntry.finallyLoc) {
  4664. // Ignore the finally entry if control is not jumping to a
  4665. // location outside the try/catch block.
  4666. finallyEntry = null;
  4667. }
  4668. var record = finallyEntry ? finallyEntry.completion : {};
  4669. record.type = type;
  4670. record.arg = arg;
  4671. if (finallyEntry) {
  4672. this.method = "next";
  4673. this.next = finallyEntry.finallyLoc;
  4674. return ContinueSentinel;
  4675. }
  4676. return this.complete(record);
  4677. },
  4678. complete: function(record, afterLoc) {
  4679. if (record.type === "throw") {
  4680. throw record.arg;
  4681. }
  4682. if (record.type === "break" ||
  4683. record.type === "continue") {
  4684. this.next = record.arg;
  4685. } else if (record.type === "return") {
  4686. this.rval = this.arg = record.arg;
  4687. this.method = "return";
  4688. this.next = "end";
  4689. } else if (record.type === "normal" && afterLoc) {
  4690. this.next = afterLoc;
  4691. }
  4692. return ContinueSentinel;
  4693. },
  4694. finish: function(finallyLoc) {
  4695. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4696. var entry = this.tryEntries[i];
  4697. if (entry.finallyLoc === finallyLoc) {
  4698. this.complete(entry.completion, entry.afterLoc);
  4699. resetTryEntry(entry);
  4700. return ContinueSentinel;
  4701. }
  4702. }
  4703. },
  4704. "catch": function(tryLoc) {
  4705. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4706. var entry = this.tryEntries[i];
  4707. if (entry.tryLoc === tryLoc) {
  4708. var record = entry.completion;
  4709. if (record.type === "throw") {
  4710. var thrown = record.arg;
  4711. resetTryEntry(entry);
  4712. }
  4713. return thrown;
  4714. }
  4715. }
  4716. // The context.catch method must only be called with a location
  4717. // argument that corresponds to a known catch block.
  4718. throw new Error("illegal catch attempt");
  4719. },
  4720. delegateYield: function(iterable, resultName, nextLoc) {
  4721. this.delegate = {
  4722. iterator: values(iterable),
  4723. resultName: resultName,
  4724. nextLoc: nextLoc
  4725. };
  4726. if (this.method === "next") {
  4727. // Deliberately forget the last sent value so that we don't
  4728. // accidentally pass it on to the delegate.
  4729. this.arg = undefined;
  4730. }
  4731. return ContinueSentinel;
  4732. }
  4733. };
  4734. })(
  4735. // In sloppy mode, unbound `this` refers to the global object, fallback to
  4736. // Function constructor if we're in global strict mode. That is sadly a form
  4737. // of indirect eval which violates Content Security Policy.
  4738. (function() {
  4739. return this || (typeof self === "object" && self);
  4740. })() || Function("return this")()
  4741. );
  4742. /***/ }),
  4743. /***/ 229:
  4744. /*!**************************************************************************************!*\
  4745. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  4746. \**************************************************************************************/
  4747. /*! no static exports found */
  4748. /***/ (function(module, exports, __webpack_require__) {
  4749. "use strict";
  4750. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  4751. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 230));
  4752. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 231));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  4753. * html 解析器
  4754. * @tutorial https://github.com/jin-yufeng/Parser
  4755. * @version 20201029
  4756. * @author JinYufeng
  4757. * @listens MIT
  4758. */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] : {};
  4759. this.attrs = {};
  4760. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  4761. this.data = data;
  4762. this.domain = options.domain;
  4763. this.DOM = [];
  4764. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  4765. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  4766. this.options = options;
  4767. this.state = this.Text;
  4768. this.STACK = [];
  4769. // 工具函数
  4770. this.bubble = function () {
  4771. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  4772. if (_config.default.richOnlyTags[item.name]) return false;
  4773. item.c = 1;
  4774. }
  4775. return true;
  4776. };
  4777. this.decode = function (val, amp) {
  4778. var i = -1,
  4779. j,en;
  4780. while (1) {
  4781. if ((i = val.indexOf('&', i + 1)) == -1) break;
  4782. if ((j = val.indexOf(';', i + 2)) == -1) break;
  4783. if (val[i + 1] == '#') {
  4784. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  4785. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  4786. } else {
  4787. en = val.substring(i + 1, j);
  4788. if (_config.default.entities[en] || en == amp)
  4789. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  4790. }
  4791. }
  4792. return val;
  4793. };
  4794. this.getUrl = function (url) {
  4795. if (url[0] == '/') {
  4796. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  4797. if (_this.domain) url = _this.domain + url;
  4798. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  4799. url = _this.domain + '/' + url;
  4800. return url;
  4801. };
  4802. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  4803. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  4804. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  4805. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  4806. }
  4807. MpHtmlParser.prototype.parse = function () {
  4808. if (emoji) this.data = emoji.parseEmoji(this.data);
  4809. for (var c; c = this.data[this.i]; this.i++) {
  4810. this.state(c);}
  4811. if (this.state == this.Text) this.setText();
  4812. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  4813. return this.DOM;
  4814. };
  4815. // 设置属性
  4816. MpHtmlParser.prototype.setAttr = function () {
  4817. var name = this.attrName.toLowerCase(),
  4818. val = this.attrVal;
  4819. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  4820. if (val) {
  4821. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  4822. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  4823. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  4824. }
  4825. this.attrVal = '';
  4826. while (blankChar[this.data[this.i]]) {this.i++;}
  4827. if (this.isClose()) this.setNode();else
  4828. {
  4829. this.start = this.i;
  4830. this.state = this.AttrName;
  4831. }
  4832. };
  4833. // 设置文本节点
  4834. MpHtmlParser.prototype.setText = function () {
  4835. var back,text = this.section();
  4836. if (!text) return;
  4837. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  4838. if (back) {
  4839. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  4840. var j = this.start + text.length;
  4841. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  4842. return;
  4843. }
  4844. if (!this.pre) {
  4845. // 合并空白符
  4846. var flag,tmp = [];
  4847. for (var i = text.length, c; c = text[--i];) {
  4848. if (!blankChar[c]) {
  4849. tmp.unshift(c);
  4850. if (!flag) flag = 1;
  4851. } else {
  4852. if (tmp[0] != ' ') tmp.unshift(' ');
  4853. if (c == '\n' && flag == void 0) flag = 0;
  4854. }}
  4855. if (flag == 0) return;
  4856. text = tmp.join('');
  4857. }
  4858. this.siblings().push({
  4859. type: 'text',
  4860. text: this.decode(text) });
  4861. };
  4862. // 设置元素节点
  4863. MpHtmlParser.prototype.setNode = function () {
  4864. var node = {
  4865. name: this.tagName.toLowerCase(),
  4866. attrs: this.attrs },
  4867. close = _config.default.selfClosingTags[node.name];
  4868. if (this.options.nodes.length) node.type = 'node';
  4869. this.attrs = {};
  4870. if (!_config.default.ignoreTags[node.name]) {
  4871. // 处理属性
  4872. var attrs = node.attrs,
  4873. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  4874. styleObj = {};
  4875. if (attrs.id) {
  4876. if (this.options.compress & 1) attrs.id = void 0;else
  4877. if (this.options.useAnchor) this.bubble();
  4878. }
  4879. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  4880. switch (node.name) {
  4881. case 'a':
  4882. case 'ad':
  4883. this.bubble();
  4884. break;
  4885. case 'font':
  4886. if (attrs.color) {
  4887. styleObj['color'] = attrs.color;
  4888. attrs.color = void 0;
  4889. }
  4890. if (attrs.face) {
  4891. styleObj['font-family'] = attrs.face;
  4892. attrs.face = void 0;
  4893. }
  4894. if (attrs.size) {
  4895. var size = parseInt(attrs.size);
  4896. if (size < 1) size = 1;else
  4897. if (size > 7) size = 7;
  4898. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  4899. styleObj['font-size'] = map[size - 1];
  4900. attrs.size = void 0;
  4901. }
  4902. break;
  4903. case 'embed':
  4904. var src = node.attrs.src || '',
  4905. type = node.attrs.type || '';
  4906. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  4907. node.name = 'video';else
  4908. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  4909. '.aac'))
  4910. node.name = 'audio';else
  4911. break;
  4912. if (node.attrs.autostart)
  4913. node.attrs.autoplay = 'T';
  4914. node.attrs.controls = 'T';
  4915. case 'video':
  4916. case 'audio':
  4917. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  4918. this["".concat(node.name, "Num")]++;
  4919. if (node.name == 'video') {
  4920. if (this.videoNum > 3)
  4921. node.lazyLoad = 1;
  4922. if (attrs.width) {
  4923. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  4924. attrs.width = void 0;
  4925. }
  4926. if (attrs.height) {
  4927. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  4928. attrs.height = void 0;
  4929. }
  4930. }
  4931. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  4932. attrs.source = [];
  4933. if (attrs.src) {
  4934. attrs.source.push(attrs.src);
  4935. attrs.src = void 0;
  4936. }
  4937. this.bubble();
  4938. break;
  4939. case 'td':
  4940. case 'th':
  4941. if (attrs.colspan || attrs.rowspan)
  4942. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  4943. if (item.name == 'table') {
  4944. item.flag = 1;
  4945. break;
  4946. }}}
  4947. if (attrs.align) {
  4948. if (node.name == 'table') {
  4949. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  4950. styleObj['float'] = attrs.align;
  4951. } else styleObj['text-align'] = attrs.align;
  4952. attrs.align = void 0;
  4953. }
  4954. // 压缩 style
  4955. var styles = style.split(';');
  4956. style = '';
  4957. for (var i = 0, len = styles.length; i < len; i++) {
  4958. var info = styles[i].split(':');
  4959. if (info.length < 2) continue;
  4960. var _key = info[0].trim().toLowerCase(),
  4961. _value = info.slice(1).join(':').trim();
  4962. if (_value[0] == '-' || _value.includes('safe'))
  4963. style += ";".concat(_key, ":").concat(_value);else
  4964. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  4965. styleObj[_key] = _value;
  4966. }
  4967. if (node.name == 'img') {
  4968. if (attrs.src && !attrs.ignore) {
  4969. if (this.bubble())
  4970. attrs.i = (this.imgNum++).toString();else
  4971. attrs.ignore = 'T';
  4972. }
  4973. if (attrs.ignore) {
  4974. style += ';-webkit-touch-callout:none';
  4975. styleObj['max-width'] = '100%';
  4976. }
  4977. var width;
  4978. if (styleObj.width) width = styleObj.width;else
  4979. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  4980. if (width) {
  4981. styleObj.width = width;
  4982. attrs.width = '100%';
  4983. if (parseInt(width) > windowWidth) {
  4984. styleObj.height = '';
  4985. if (attrs.height) attrs.height = void 0;
  4986. }
  4987. }
  4988. if (styleObj.height) {
  4989. attrs.height = styleObj.height;
  4990. styleObj.height = '';
  4991. } else if (attrs.height && !attrs.height.includes('%'))
  4992. attrs.height = parseFloat(attrs.height) + 'px';
  4993. }
  4994. for (var key in styleObj) {
  4995. var value = styleObj[key];
  4996. if (!value) continue;
  4997. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  4998. // 填充链接
  4999. if (value.includes('url')) {
  5000. var j = value.indexOf('(');
  5001. if (j++ != -1) {
  5002. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  5003. value = value.substr(0, j) + this.getUrl(value.substr(j));
  5004. }
  5005. }
  5006. // 转换 rpx
  5007. else if (value.includes('rpx'))
  5008. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  5009. if (key == 'white-space' && value.includes('pre') && !close)
  5010. this.pre = node.pre = true;
  5011. style += ";".concat(key, ":").concat(value);
  5012. }
  5013. style = style.substr(1);
  5014. if (style) attrs.style = style;
  5015. if (!close) {
  5016. node.children = [];
  5017. if (node.name == 'pre' && _config.default.highlight) {
  5018. this.remove(node);
  5019. this.pre = node.pre = true;
  5020. }
  5021. this.siblings().push(node);
  5022. this.STACK.push(node);
  5023. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  5024. this.siblings().push(node);
  5025. } else {
  5026. if (!close) this.remove(node);else
  5027. if (node.name == 'source') {
  5028. var parent = this.parent();
  5029. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  5030. parent.attrs.source.push(node.attrs.src);
  5031. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  5032. }
  5033. if (this.data[this.i] == '/') this.i++;
  5034. this.start = this.i + 1;
  5035. this.state = this.Text;
  5036. };
  5037. // 移除标签
  5038. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  5039. var name = node.name,
  5040. j = this.i;
  5041. // 处理 svg
  5042. var handleSvg = function handleSvg() {
  5043. var src = _this2.data.substring(j, _this2.i + 1);
  5044. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  5045. for (var key in node.attrs) {
  5046. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  5047. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  5048. }
  5049. src = '<svg' + src;
  5050. var parent = _this2.parent();
  5051. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  5052. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  5053. _this2.siblings().push({
  5054. name: 'img',
  5055. attrs: {
  5056. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  5057. style: node.attrs.style,
  5058. ignore: 'T' } });
  5059. };
  5060. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  5061. while (1) {
  5062. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  5063. if (name == 'pre' || name == 'svg') this.i = j;else
  5064. this.i = this.data.length;
  5065. return;
  5066. }
  5067. this.start = this.i += 2;
  5068. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  5069. if (this.section().toLowerCase() == name) {
  5070. // 代码块高亮
  5071. if (name == 'pre') {
  5072. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  5073. substr(this.i - 5);
  5074. return this.i = j;
  5075. } else if (name == 'style')
  5076. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  5077. if (name == 'title')
  5078. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  5079. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  5080. if (name == 'svg') handleSvg();
  5081. return;
  5082. }
  5083. }
  5084. };
  5085. // 节点出栈处理
  5086. MpHtmlParser.prototype.popNode = function (node) {
  5087. // 空白符处理
  5088. if (node.pre) {
  5089. node.pre = this.pre = void 0;
  5090. for (var i = this.STACK.length; i--;) {
  5091. if (this.STACK[i].pre)
  5092. this.pre = true;}
  5093. }
  5094. var siblings = this.siblings(),
  5095. len = siblings.length,
  5096. childs = node.children;
  5097. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  5098. return siblings.pop();
  5099. var attrs = node.attrs;
  5100. // 替换一些标签名
  5101. if (_config.default.blockTags[node.name]) node.name = 'div';else
  5102. if (!_config.default.trustTags[node.name]) node.name = 'span';
  5103. // 处理列表
  5104. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  5105. if ((node.attrs.style || '').includes('list-style:none')) {
  5106. for (var _i = 0, child; child = childs[_i++];) {
  5107. if (child.name == 'li')
  5108. child.name = 'div';}
  5109. } else if (node.name == 'ul') {
  5110. var floor = 1;
  5111. for (var _i2 = this.STACK.length; _i2--;) {
  5112. if (this.STACK[_i2].name == 'ul') floor++;}
  5113. if (floor != 1)
  5114. for (var _i3 = childs.length; _i3--;) {
  5115. childs[_i3].floor = floor;}
  5116. } else {
  5117. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  5118. if (_child.name == 'li') {
  5119. _child.type = 'ol';
  5120. _child.num = function (num, type) {
  5121. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  5122. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  5123. if (type == 'i' || type == 'I') {
  5124. num = (num - 1) % 99 + 1;
  5125. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  5126. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  5127. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  5128. if (type == 'i') return res.toLowerCase();
  5129. return res;
  5130. }
  5131. return num;
  5132. }(num++, attrs.type) + '.';
  5133. }}
  5134. }
  5135. }
  5136. // 处理表格
  5137. if (node.name == 'table') {
  5138. var padding = parseFloat(attrs.cellpadding),
  5139. spacing = parseFloat(attrs.cellspacing),
  5140. border = parseFloat(attrs.border);
  5141. if (node.c) {
  5142. if (isNaN(padding)) padding = 2;
  5143. if (isNaN(spacing)) spacing = 2;
  5144. }
  5145. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  5146. if (node.flag && node.c) {
  5147. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  5148. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  5149. var row = 1,
  5150. col = 1,
  5151. colNum,
  5152. trs = [],
  5153. children = [],
  5154. map = {};
  5155. (function f(ns) {
  5156. for (var i = 0; i < ns.length; i++) {
  5157. if (ns[i].name == 'tr') trs.push(ns[i]);else
  5158. f(ns[i].children || []);
  5159. }
  5160. })(node.children);
  5161. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  5162. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  5163. if (td.name == 'td' || td.name == 'th') {
  5164. while (map[row + '.' + col]) {col++;}
  5165. var cell = {
  5166. name: 'div',
  5167. c: 1,
  5168. attrs: {
  5169. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  5170. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  5171. children: td.children };
  5172. if (td.attrs.colspan) {
  5173. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  5174. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  5175. col += parseInt(td.attrs.colspan) - 1;
  5176. }
  5177. if (td.attrs.rowspan) {
  5178. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  5179. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  5180. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  5181. }
  5182. children.push(cell);
  5183. col++;
  5184. }
  5185. }
  5186. if (!colNum) {
  5187. colNum = col - 1;
  5188. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  5189. }
  5190. col = 1;
  5191. row++;
  5192. }
  5193. node.children = children;
  5194. } else {
  5195. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  5196. if (border || padding)
  5197. (function f(ns) {
  5198. for (var i = 0, n; n = ns[i]; i++) {
  5199. if (n.name == 'th' || n.name == 'td') {
  5200. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  5201. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  5202. } else f(n.children || []);
  5203. }
  5204. })(childs);
  5205. }
  5206. if (this.options.autoscroll) {
  5207. var table = Object.assign({}, node);
  5208. node.name = 'div';
  5209. node.attrs = {
  5210. style: 'overflow:scroll' };
  5211. node.children = [table];
  5212. }
  5213. }
  5214. this.CssHandler.pop && this.CssHandler.pop(node);
  5215. // 自动压缩
  5216. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  5217. siblings[len - 1] = childs[0];
  5218. };
  5219. // 状态机
  5220. MpHtmlParser.prototype.Text = function (c) {
  5221. if (c == '<') {
  5222. var next = this.data[this.i + 1],
  5223. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  5224. if (isLetter(next)) {
  5225. this.setText();
  5226. this.start = this.i + 1;
  5227. this.state = this.TagName;
  5228. } else if (next == '/') {
  5229. this.setText();
  5230. if (isLetter(this.data[++this.i + 1])) {
  5231. this.start = this.i + 1;
  5232. this.state = this.EndTag;
  5233. } else this.Comment();
  5234. } else if (next == '!' || next == '?') {
  5235. this.setText();
  5236. this.Comment();
  5237. }
  5238. }
  5239. };
  5240. MpHtmlParser.prototype.Comment = function () {
  5241. var key;
  5242. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  5243. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  5244. key = '>';
  5245. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  5246. this.i += key.length - 1;
  5247. this.start = this.i + 1;
  5248. this.state = this.Text;
  5249. };
  5250. MpHtmlParser.prototype.TagName = function (c) {
  5251. if (blankChar[c]) {
  5252. this.tagName = this.section();
  5253. while (blankChar[this.data[this.i]]) {this.i++;}
  5254. if (this.isClose()) this.setNode();else
  5255. {
  5256. this.start = this.i;
  5257. this.state = this.AttrName;
  5258. }
  5259. } else if (this.isClose()) {
  5260. this.tagName = this.section();
  5261. this.setNode();
  5262. }
  5263. };
  5264. MpHtmlParser.prototype.AttrName = function (c) {
  5265. if (c == '=' || blankChar[c] || this.isClose()) {
  5266. this.attrName = this.section();
  5267. if (blankChar[c])
  5268. while (blankChar[this.data[++this.i]]) {;}
  5269. if (this.data[this.i] == '=') {
  5270. while (blankChar[this.data[++this.i]]) {;}
  5271. this.start = this.i--;
  5272. this.state = this.AttrValue;
  5273. } else this.setAttr();
  5274. }
  5275. };
  5276. MpHtmlParser.prototype.AttrValue = function (c) {
  5277. if (c == '"' || c == "'") {
  5278. this.start++;
  5279. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  5280. this.attrVal = this.section();
  5281. this.i++;
  5282. } else {
  5283. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  5284. this.attrVal = this.section();
  5285. }
  5286. this.setAttr();
  5287. };
  5288. MpHtmlParser.prototype.EndTag = function (c) {
  5289. if (blankChar[c] || c == '>' || c == '/') {
  5290. var name = this.section().toLowerCase();
  5291. for (var i = this.STACK.length; i--;) {
  5292. if (this.STACK[i].name == name) break;}
  5293. if (i != -1) {
  5294. var node;
  5295. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  5296. this.popNode(node);
  5297. } else if (name == 'p' || name == 'br')
  5298. this.siblings().push({
  5299. name: name,
  5300. attrs: {} });
  5301. this.i = this.data.indexOf('>', this.i);
  5302. this.start = this.i + 1;
  5303. if (this.i == -1) this.i = this.data.length;else
  5304. this.state = this.Text;
  5305. }
  5306. };var _default =
  5307. MpHtmlParser;exports.default = _default;
  5308. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  5309. /***/ }),
  5310. /***/ 23:
  5311. /*!**************************************************************************!*\
  5312. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  5313. \**************************************************************************/
  5314. /*! no static exports found */
  5315. /***/ (function(module, exports, __webpack_require__) {
  5316. "use strict";
  5317. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  5318. // 所以这里做一个兼容polyfill的兼容处理
  5319. if (!String.prototype.padStart) {
  5320. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  5321. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  5322. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  5323. 'fillString must be String');
  5324. var str = this;
  5325. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  5326. if (str.length >= maxLength) return String(str);
  5327. var fillLength = maxLength - str.length,
  5328. times = Math.ceil(fillLength / fillString.length);
  5329. while (times >>= 1) {
  5330. fillString += fillString;
  5331. if (times === 1) {
  5332. fillString += fillString;
  5333. }
  5334. }
  5335. return fillString.slice(0, fillLength) + str;
  5336. };
  5337. }
  5338. // 其他更多是格式化有如下:
  5339. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  5340. 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';
  5341. // 如果为null,则格式化当前时间
  5342. if (!dateTime) dateTime = Number(new Date());
  5343. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5344. if (dateTime.toString().length == 10) dateTime *= 1000;
  5345. var date = new Date(dateTime);
  5346. var ret;
  5347. var opt = {
  5348. "y+": date.getFullYear().toString(), // 年
  5349. "m+": (date.getMonth() + 1).toString(), // 月
  5350. "d+": date.getDate().toString(), // 日
  5351. "h+": date.getHours().toString(), // 时
  5352. "M+": date.getMinutes().toString(), // 分
  5353. "s+": date.getSeconds().toString() // 秒
  5354. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  5355. };
  5356. for (var k in opt) {
  5357. ret = new RegExp("(" + k + ")").exec(fmt);
  5358. if (ret) {
  5359. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  5360. };
  5361. };
  5362. return fmt;
  5363. }var _default =
  5364. timeFormat;exports.default = _default;
  5365. /***/ }),
  5366. /***/ 230:
  5367. /*!********************************************************************************!*\
  5368. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  5369. \********************************************************************************/
  5370. /*! no static exports found */
  5371. /***/ (function(module, exports, __webpack_require__) {
  5372. "use strict";
  5373. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  5374. var cfg = {
  5375. // 出错占位图
  5376. errorImg: null,
  5377. // 过滤器函数
  5378. filter: null,
  5379. // 代码高亮函数
  5380. highlight: null,
  5381. // 文本处理函数
  5382. onText: null,
  5383. // 实体编码列表
  5384. entities: {
  5385. quot: '"',
  5386. apos: "'",
  5387. semi: ';',
  5388. nbsp: '\xA0',
  5389. ensp: "\u2002",
  5390. emsp: "\u2003",
  5391. ndash: '–',
  5392. mdash: '—',
  5393. middot: '·',
  5394. lsquo: '‘',
  5395. rsquo: '’',
  5396. ldquo: '“',
  5397. rdquo: '”',
  5398. bull: '•',
  5399. hellip: '…' },
  5400. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  5401. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  5402. // 块级标签,将被转为 div
  5403. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  5404. // 将被移除的标签
  5405. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  5406. // 只能被 rich-text 显示的标签
  5407. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  5408. // 自闭合的标签
  5409. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  5410. // 信任的标签
  5411. 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'),
  5412. // 默认的标签样式
  5413. userAgentStyles: {
  5414. address: 'font-style:italic',
  5415. big: 'display:inline;font-size:1.2em',
  5416. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  5417. caption: 'display:table-caption;text-align:center',
  5418. center: 'text-align:center',
  5419. cite: 'font-style:italic',
  5420. dd: 'margin-left:40px',
  5421. mark: 'background-color:yellow',
  5422. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  5423. s: 'text-decoration:line-through',
  5424. small: 'display:inline;font-size:0.8em',
  5425. u: 'text-decoration:underline' } };
  5426. function makeMap(str) {
  5427. var map = Object.create(null),
  5428. list = str.split(',');
  5429. for (var i = list.length; i--;) {
  5430. map[list[i]] = true;}
  5431. return map;
  5432. }
  5433. if (wx.canIUse('editor')) {
  5434. cfg.blockTags.pre = void 0;
  5435. cfg.ignoreTags.rp = true;
  5436. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  5437. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  5438. }var _default =
  5439. cfg;exports.default = _default;
  5440. /***/ }),
  5441. /***/ 231:
  5442. /*!************************************************************************************!*\
  5443. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  5444. \************************************************************************************/
  5445. /*! no static exports found */
  5446. /***/ (function(module, exports, __webpack_require__) {
  5447. "use strict";
  5448. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 230));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  5449. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  5450. function CssHandler(tagStyle) {
  5451. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  5452. for (var item in tagStyle) {
  5453. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  5454. this.styles = styles;
  5455. }
  5456. CssHandler.prototype.getStyle = function (data) {
  5457. this.styles = new parser(data, this.styles).parse();
  5458. };
  5459. CssHandler.prototype.match = function (name, attrs) {
  5460. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  5461. if (attrs.class) {
  5462. var items = attrs.class.split(' ');
  5463. for (var i = 0, item; item = items[i]; i++) {
  5464. if (tmp = this.styles['.' + item])
  5465. matched += tmp + ';';}
  5466. }
  5467. if (tmp = this.styles['#' + attrs.id])
  5468. matched += tmp + ';';
  5469. return matched;
  5470. };var _default =
  5471. CssHandler;exports.default = _default;
  5472. function parser(data, init) {
  5473. this.data = data;
  5474. this.floor = 0;
  5475. this.i = 0;
  5476. this.list = [];
  5477. this.res = init;
  5478. this.state = this.Space;
  5479. }
  5480. parser.prototype.parse = function () {
  5481. for (var c; c = this.data[this.i]; this.i++) {
  5482. this.state(c);}
  5483. return this.res;
  5484. };
  5485. parser.prototype.section = function () {
  5486. return this.data.substring(this.start, this.i);
  5487. };
  5488. // 状态机
  5489. parser.prototype.Space = function (c) {
  5490. if (c == '.' || c == '#' || isLetter(c)) {
  5491. this.start = this.i;
  5492. this.state = this.Name;
  5493. } else if (c == '/' && this.data[this.i + 1] == '*')
  5494. this.Comment();else
  5495. if (!_config.default.blankChar[c] && c != ';')
  5496. this.state = this.Ignore;
  5497. };
  5498. parser.prototype.Comment = function () {
  5499. this.i = this.data.indexOf('*/', this.i) + 1;
  5500. if (!this.i) this.i = this.data.length;
  5501. this.state = this.Space;
  5502. };
  5503. parser.prototype.Ignore = function (c) {
  5504. if (c == '{') this.floor++;else
  5505. if (c == '}' && ! --this.floor) {
  5506. this.list = [];
  5507. this.state = this.Space;
  5508. }
  5509. };
  5510. parser.prototype.Name = function (c) {
  5511. if (_config.default.blankChar[c]) {
  5512. this.list.push(this.section());
  5513. this.state = this.NameSpace;
  5514. } else if (c == '{') {
  5515. this.list.push(this.section());
  5516. this.Content();
  5517. } else if (c == ',') {
  5518. this.list.push(this.section());
  5519. this.Comma();
  5520. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  5521. this.state = this.Ignore;
  5522. };
  5523. parser.prototype.NameSpace = function (c) {
  5524. if (c == '{') this.Content();else
  5525. if (c == ',') this.Comma();else
  5526. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  5527. };
  5528. parser.prototype.Comma = function () {
  5529. while (_config.default.blankChar[this.data[++this.i]]) {;}
  5530. if (this.data[this.i] == '{') this.Content();else
  5531. {
  5532. this.start = this.i--;
  5533. this.state = this.Name;
  5534. }
  5535. };
  5536. parser.prototype.Content = function () {
  5537. this.start = ++this.i;
  5538. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  5539. var content = this.section();
  5540. for (var i = 0, item; item = this.list[i++];) {
  5541. if (this.res[item]) this.res[item] += ';' + content;else
  5542. this.res[item] = content;}
  5543. this.list = [];
  5544. this.state = this.Space;
  5545. };
  5546. /***/ }),
  5547. /***/ 24:
  5548. /*!************************************************************************!*\
  5549. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  5550. \************************************************************************/
  5551. /*! no static exports found */
  5552. /***/ (function(module, exports, __webpack_require__) {
  5553. "use strict";
  5554. 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 };}
  5555. /**
  5556. * 时间戳转为多久之前
  5557. * @param String timestamp 时间戳
  5558. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  5559. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  5560. */
  5561. 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';
  5562. // 如果为null,则格式化当前时间
  5563. if (!dateTime) dateTime = Number(new Date());
  5564. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5565. if (dateTime.toString().length == 10) dateTime *= 1000;
  5566. var timestamp = +new Date(Number(dateTime));
  5567. var timer = (Number(new Date()) - timestamp) / 1000;
  5568. // 如果小于5分钟,则返回"刚刚",其他以此类推
  5569. var tips = '';
  5570. switch (true) {
  5571. case timer < 300:
  5572. tips = '刚刚';
  5573. break;
  5574. case timer >= 300 && timer < 3600:
  5575. tips = parseInt(timer / 60) + '分钟前';
  5576. break;
  5577. case timer >= 3600 && timer < 86400:
  5578. tips = parseInt(timer / 3600) + '小时前';
  5579. break;
  5580. case timer >= 86400 && timer < 2592000:
  5581. tips = parseInt(timer / 86400) + '天前';
  5582. break;
  5583. default:
  5584. // 如果format为false,则无论什么时间戳,都显示xx之前
  5585. if (format === false) {
  5586. if (timer >= 2592000 && timer < 365 * 86400) {
  5587. tips = parseInt(timer / (86400 * 30)) + '个月前';
  5588. } else {
  5589. tips = parseInt(timer / (86400 * 365)) + '年前';
  5590. }
  5591. } else {
  5592. tips = (0, _timeFormat.default)(timestamp, format);
  5593. }}
  5594. return tips;
  5595. }var _default =
  5596. timeFrom;exports.default = _default;
  5597. /***/ }),
  5598. /***/ 25:
  5599. /*!*****************************************************************************!*\
  5600. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  5601. \*****************************************************************************/
  5602. /*! no static exports found */
  5603. /***/ (function(module, exports, __webpack_require__) {
  5604. "use strict";
  5605. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5606. * 求两个颜色之间的渐变值
  5607. * @param {string} startColor 开始的颜色
  5608. * @param {string} endColor 结束的颜色
  5609. * @param {number} step 颜色等分的份额
  5610. * */
  5611. 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;
  5612. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  5613. var startR = startRGB[0];
  5614. var startG = startRGB[1];
  5615. var startB = startRGB[2];
  5616. var endRGB = hexToRgb(endColor, false);
  5617. var endR = endRGB[0];
  5618. var endG = endRGB[1];
  5619. var endB = endRGB[2];
  5620. var sR = (endR - startR) / step; //总差值
  5621. var sG = (endG - startG) / step;
  5622. var sB = (endB - startB) / step;
  5623. var colorArr = [];
  5624. for (var i = 0; i < step; i++) {
  5625. //计算每一步的hex值
  5626. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  5627. i + startB) + ')');
  5628. colorArr.push(hex);
  5629. }
  5630. return colorArr;
  5631. }
  5632. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  5633. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5634. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  5635. sColor = sColor.toLowerCase();
  5636. if (sColor && reg.test(sColor)) {
  5637. if (sColor.length === 4) {
  5638. var sColorNew = "#";
  5639. for (var i = 1; i < 4; i += 1) {
  5640. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  5641. }
  5642. sColor = sColorNew;
  5643. }
  5644. //处理六位的颜色值
  5645. var sColorChange = [];
  5646. for (var _i = 1; _i < 7; _i += 2) {
  5647. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  5648. }
  5649. if (!str) {
  5650. return sColorChange;
  5651. } else {
  5652. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  5653. }
  5654. } else if (/^(rgb|RGB)/.test(sColor)) {
  5655. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  5656. return arr.map(function (val) {return Number(val);});
  5657. } else {
  5658. return sColor;
  5659. }
  5660. };
  5661. // 将rgb表示方式转换为hex表示方式
  5662. function rgbToHex(rgb) {
  5663. var _this = rgb;
  5664. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  5665. if (/^(rgb|RGB)/.test(_this)) {
  5666. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  5667. var strHex = "#";
  5668. for (var i = 0; i < aColor.length; i++) {
  5669. var hex = Number(aColor[i]).toString(16);
  5670. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  5671. if (hex === "0") {
  5672. hex += hex;
  5673. }
  5674. strHex += hex;
  5675. }
  5676. if (strHex.length !== 7) {
  5677. strHex = _this;
  5678. }
  5679. return strHex;
  5680. } else if (reg.test(_this)) {
  5681. var aNum = _this.replace(/#/, "").split("");
  5682. if (aNum.length === 6) {
  5683. return _this;
  5684. } else if (aNum.length === 3) {
  5685. var numHex = "#";
  5686. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  5687. numHex += aNum[_i2] + aNum[_i2];
  5688. }
  5689. return numHex;
  5690. }
  5691. } else {
  5692. return _this;
  5693. }
  5694. }
  5695. /**
  5696. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  5697. * sHex为传入的十六进制的色值
  5698. * alpha为rgba的透明度
  5699. */
  5700. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  5701. color = rgbToHex(color);
  5702. // 十六进制颜色值的正则表达式
  5703. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  5704. /* 16进制颜色转为RGB格式 */
  5705. var sColor = color.toLowerCase();
  5706. if (sColor && reg.test(sColor)) {
  5707. if (sColor.length === 4) {
  5708. var sColorNew = '#';
  5709. for (var i = 1; i < 4; i += 1) {
  5710. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  5711. }
  5712. sColor = sColorNew;
  5713. }
  5714. // 处理六位的颜色值
  5715. var sColorChange = [];
  5716. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  5717. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  5718. }
  5719. // return sColorChange.join(',')
  5720. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  5721. } else
  5722. {
  5723. return sColor;
  5724. }
  5725. }var _default =
  5726. {
  5727. colorGradient: colorGradient,
  5728. hexToRgb: hexToRgb,
  5729. rgbToHex: rgbToHex,
  5730. colorToRgba: colorToRgba };exports.default = _default;
  5731. /***/ }),
  5732. /***/ 26:
  5733. /*!********************************************************************!*\
  5734. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  5735. \********************************************************************/
  5736. /*! no static exports found */
  5737. /***/ (function(module, exports, __webpack_require__) {
  5738. "use strict";
  5739. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5740. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  5741. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  5742. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  5743. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  5744. * v-for的时候,推荐使用后端返回的id而不是循环的index
  5745. * @param {Number} len uuid的长度
  5746. * @param {Boolean} firstU 将返回的首字母置为"u"
  5747. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  5748. */
  5749. 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;
  5750. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  5751. var uuid = [];
  5752. radix = radix || chars.length;
  5753. if (len) {
  5754. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  5755. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  5756. } else {
  5757. var r;
  5758. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  5759. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  5760. uuid[14] = '4';
  5761. for (var _i = 0; _i < 36; _i++) {
  5762. if (!uuid[_i]) {
  5763. r = 0 | Math.random() * 16;
  5764. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  5765. }
  5766. }
  5767. }
  5768. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  5769. if (firstU) {
  5770. uuid.shift();
  5771. return 'u' + uuid.join('');
  5772. } else {
  5773. return uuid.join('');
  5774. }
  5775. }var _default =
  5776. guid;exports.default = _default;
  5777. /***/ }),
  5778. /***/ 267:
  5779. /*!*******************************************************************!*\
  5780. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  5781. \*******************************************************************/
  5782. /*! no static exports found */
  5783. /***/ (function(module, exports, __webpack_require__) {
  5784. "use strict";
  5785. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5786. * 递归使用 call 方式this指向
  5787. * @param componentName // 需要找的组件的名称
  5788. * @param eventName // 事件名称
  5789. * @param params // 需要传递的参数
  5790. */
  5791. function _broadcast(componentName, eventName, params) {
  5792. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  5793. var $children;
  5794. $children = this.$children;
  5795. $children.map(function (child) {
  5796. if (componentName === child.$options.name) {
  5797. child.$emit.apply(child, [eventName].concat(params));
  5798. } else {
  5799. _broadcast.apply(child, [componentName, eventName].concat(params));
  5800. }
  5801. });
  5802. }var _default =
  5803. {
  5804. methods: {
  5805. /**
  5806. * 派发 (向上查找) (一个)
  5807. * @param componentName // 需要找的组件的名称
  5808. * @param eventName // 事件名称
  5809. * @param params // 需要传递的参数
  5810. */
  5811. dispatch: function dispatch(componentName, eventName, params) {
  5812. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  5813. var name = parent.$options.name; // 获取当前组件实例的name
  5814. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  5815. // 循环出当前名称的一样的组件实例
  5816. while (parent && (!name || name !== componentName)) {
  5817. parent = parent.$parent;
  5818. if (parent) {
  5819. name = parent.$options.name;
  5820. }
  5821. }
  5822. // 有节点表示当前找到了name一样的实例
  5823. if (parent) {
  5824. parent.$emit.apply(parent, [eventName].concat(params));
  5825. }
  5826. },
  5827. /**
  5828. * 广播 (向下查找) (广播多个)
  5829. * @param componentName // 需要找的组件的名称
  5830. * @param eventName // 事件名称
  5831. * @param params // 需要传递的参数
  5832. */
  5833. broadcast: function broadcast(componentName, eventName, params) {
  5834. _broadcast.call(this, componentName, eventName, params);
  5835. } } };exports.default = _default;
  5836. /***/ }),
  5837. /***/ 268:
  5838. /*!***************************************************************************!*\
  5839. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  5840. \***************************************************************************/
  5841. /*! no static exports found */
  5842. /***/ (function(module, exports, __webpack_require__) {
  5843. "use strict";
  5844. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  5845. _extends = Object.assign || function (target) {
  5846. for (var i = 1; i < arguments.length; i++) {
  5847. var source = arguments[i];
  5848. for (var key in source) {
  5849. if (Object.prototype.hasOwnProperty.call(source, key)) {
  5850. target[key] = source[key];
  5851. }
  5852. }
  5853. }
  5854. return target;
  5855. };
  5856. return _extends.apply(this, arguments);
  5857. }
  5858. /* eslint no-console:0 */
  5859. var formatRegExp = /%[sdj%]/g;
  5860. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  5861. if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  5862. 'undefined' && typeof document !== 'undefined') {
  5863. warning = function warning(type, errors) {
  5864. if (typeof console !== 'undefined' && console.warn) {
  5865. if (errors.every(function (e) {
  5866. return typeof e === 'string';
  5867. })) {
  5868. console.warn(type, errors);
  5869. }
  5870. }
  5871. };
  5872. }
  5873. function convertFieldsError(errors) {
  5874. if (!errors || !errors.length) return null;
  5875. var fields = {};
  5876. errors.forEach(function (error) {
  5877. var field = error.field;
  5878. fields[field] = fields[field] || [];
  5879. fields[field].push(error);
  5880. });
  5881. return fields;
  5882. }
  5883. function format() {
  5884. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  5885. args[_key] = arguments[_key];
  5886. }
  5887. var i = 1;
  5888. var f = args[0];
  5889. var len = args.length;
  5890. if (typeof f === 'function') {
  5891. return f.apply(null, args.slice(1));
  5892. }
  5893. if (typeof f === 'string') {
  5894. var str = String(f).replace(formatRegExp, function (x) {
  5895. if (x === '%%') {
  5896. return '%';
  5897. }
  5898. if (i >= len) {
  5899. return x;
  5900. }
  5901. switch (x) {
  5902. case '%s':
  5903. return String(args[i++]);
  5904. case '%d':
  5905. return Number(args[i++]);
  5906. case '%j':
  5907. try {
  5908. return JSON.stringify(args[i++]);
  5909. } catch (_) {
  5910. return '[Circular]';
  5911. }
  5912. break;
  5913. default:
  5914. return x;}
  5915. });
  5916. for (var arg = args[i]; i < len; arg = args[++i]) {
  5917. str += " " + arg;
  5918. }
  5919. return str;
  5920. }
  5921. return f;
  5922. }
  5923. function isNativeStringType(type) {
  5924. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  5925. }
  5926. function isEmptyValue(value, type) {
  5927. if (value === undefined || value === null) {
  5928. return true;
  5929. }
  5930. if (type === 'array' && Array.isArray(value) && !value.length) {
  5931. return true;
  5932. }
  5933. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  5934. return true;
  5935. }
  5936. return false;
  5937. }
  5938. function asyncParallelArray(arr, func, callback) {
  5939. var results = [];
  5940. var total = 0;
  5941. var arrLength = arr.length;
  5942. function count(errors) {
  5943. results.push.apply(results, errors);
  5944. total++;
  5945. if (total === arrLength) {
  5946. callback(results);
  5947. }
  5948. }
  5949. arr.forEach(function (a) {
  5950. func(a, count);
  5951. });
  5952. }
  5953. function asyncSerialArray(arr, func, callback) {
  5954. var index = 0;
  5955. var arrLength = arr.length;
  5956. function next(errors) {
  5957. if (errors && errors.length) {
  5958. callback(errors);
  5959. return;
  5960. }
  5961. var original = index;
  5962. index = index + 1;
  5963. if (original < arrLength) {
  5964. func(arr[original], next);
  5965. } else {
  5966. callback([]);
  5967. }
  5968. }
  5969. next([]);
  5970. }
  5971. function flattenObjArr(objArr) {
  5972. var ret = [];
  5973. Object.keys(objArr).forEach(function (k) {
  5974. ret.push.apply(ret, objArr[k]);
  5975. });
  5976. return ret;
  5977. }
  5978. function asyncMap(objArr, option, func, callback) {
  5979. if (option.first) {
  5980. var _pending = new Promise(function (resolve, reject) {
  5981. var next = function next(errors) {
  5982. callback(errors);
  5983. return errors.length ? reject({
  5984. errors: errors,
  5985. fields: convertFieldsError(errors) }) :
  5986. resolve();
  5987. };
  5988. var flattenArr = flattenObjArr(objArr);
  5989. asyncSerialArray(flattenArr, func, next);
  5990. });
  5991. _pending["catch"](function (e) {
  5992. return e;
  5993. });
  5994. return _pending;
  5995. }
  5996. var firstFields = option.firstFields || [];
  5997. if (firstFields === true) {
  5998. firstFields = Object.keys(objArr);
  5999. }
  6000. var objArrKeys = Object.keys(objArr);
  6001. var objArrLength = objArrKeys.length;
  6002. var total = 0;
  6003. var results = [];
  6004. var pending = new Promise(function (resolve, reject) {
  6005. var next = function next(errors) {
  6006. results.push.apply(results, errors);
  6007. total++;
  6008. if (total === objArrLength) {
  6009. callback(results);
  6010. return results.length ? reject({
  6011. errors: results,
  6012. fields: convertFieldsError(results) }) :
  6013. resolve();
  6014. }
  6015. };
  6016. if (!objArrKeys.length) {
  6017. callback(results);
  6018. resolve();
  6019. }
  6020. objArrKeys.forEach(function (key) {
  6021. var arr = objArr[key];
  6022. if (firstFields.indexOf(key) !== -1) {
  6023. asyncSerialArray(arr, func, next);
  6024. } else {
  6025. asyncParallelArray(arr, func, next);
  6026. }
  6027. });
  6028. });
  6029. pending["catch"](function (e) {
  6030. return e;
  6031. });
  6032. return pending;
  6033. }
  6034. function complementError(rule) {
  6035. return function (oe) {
  6036. if (oe && oe.message) {
  6037. oe.field = oe.field || rule.fullField;
  6038. return oe;
  6039. }
  6040. return {
  6041. message: typeof oe === 'function' ? oe() : oe,
  6042. field: oe.field || rule.fullField };
  6043. };
  6044. }
  6045. function deepMerge(target, source) {
  6046. if (source) {
  6047. for (var s in source) {
  6048. if (source.hasOwnProperty(s)) {
  6049. var value = source[s];
  6050. if (typeof value === 'object' && typeof target[s] === 'object') {
  6051. target[s] = _extends({}, target[s], {}, value);
  6052. } else {
  6053. target[s] = value;
  6054. }
  6055. }
  6056. }
  6057. }
  6058. return target;
  6059. }
  6060. /**
  6061. * Rule for validating required fields.
  6062. *
  6063. * @param rule The validation rule.
  6064. * @param value The value of the field on the source object.
  6065. * @param source The source object being validated.
  6066. * @param errors An array of errors that this rule may add
  6067. * validation errors to.
  6068. * @param options The validation options.
  6069. * @param options.messages The validation messages.
  6070. */
  6071. function required(rule, value, source, errors, options, type) {
  6072. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  6073. errors.push(format(options.messages.required, rule.fullField));
  6074. }
  6075. }
  6076. /**
  6077. * Rule for validating whitespace.
  6078. *
  6079. * @param rule The validation rule.
  6080. * @param value The value of the field on the source object.
  6081. * @param source The source object being validated.
  6082. * @param errors An array of errors that this rule may add
  6083. * validation errors to.
  6084. * @param options The validation options.
  6085. * @param options.messages The validation messages.
  6086. */
  6087. function whitespace(rule, value, source, errors, options) {
  6088. if (/^\s+$/.test(value) || value === '') {
  6089. errors.push(format(options.messages.whitespace, rule.fullField));
  6090. }
  6091. }
  6092. /* eslint max-len:0 */
  6093. var pattern = {
  6094. // http://emailregex.com/
  6095. 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,}))$/,
  6096. url: new RegExp(
  6097. "^(?!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]*)?$",
  6098. 'i'),
  6099. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  6100. var types = {
  6101. integer: function integer(value) {
  6102. return types.number(value) && parseInt(value, 10) === value;
  6103. },
  6104. "float": function float(value) {
  6105. return types.number(value) && !types.integer(value);
  6106. },
  6107. array: function array(value) {
  6108. return Array.isArray(value);
  6109. },
  6110. regexp: function regexp(value) {
  6111. if (value instanceof RegExp) {
  6112. return true;
  6113. }
  6114. try {
  6115. return !!new RegExp(value);
  6116. } catch (e) {
  6117. return false;
  6118. }
  6119. },
  6120. date: function date(value) {
  6121. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  6122. 'function';
  6123. },
  6124. number: function number(value) {
  6125. if (isNaN(value)) {
  6126. return false;
  6127. }
  6128. // 修改源码,将字符串数值先转为数值
  6129. return typeof +value === 'number';
  6130. },
  6131. object: function object(value) {
  6132. return typeof value === 'object' && !types.array(value);
  6133. },
  6134. method: function method(value) {
  6135. return typeof value === 'function';
  6136. },
  6137. email: function email(value) {
  6138. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  6139. },
  6140. url: function url(value) {
  6141. return typeof value === 'string' && !!value.match(pattern.url);
  6142. },
  6143. hex: function hex(value) {
  6144. return typeof value === 'string' && !!value.match(pattern.hex);
  6145. } };
  6146. /**
  6147. * Rule for validating the type of a value.
  6148. *
  6149. * @param rule The validation rule.
  6150. * @param value The value of the field on the source object.
  6151. * @param source The source object being validated.
  6152. * @param errors An array of errors that this rule may add
  6153. * validation errors to.
  6154. * @param options The validation options.
  6155. * @param options.messages The validation messages.
  6156. */
  6157. function type(rule, value, source, errors, options) {
  6158. if (rule.required && value === undefined) {
  6159. required(rule, value, source, errors, options);
  6160. return;
  6161. }
  6162. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  6163. var ruleType = rule.type;
  6164. if (custom.indexOf(ruleType) > -1) {
  6165. if (!types[ruleType](value)) {
  6166. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  6167. } // straight typeof check
  6168. } else if (ruleType && typeof value !== rule.type) {
  6169. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  6170. }
  6171. }
  6172. /**
  6173. * Rule for validating minimum and maximum allowed values.
  6174. *
  6175. * @param rule The validation rule.
  6176. * @param value The value of the field on the source object.
  6177. * @param source The source object being validated.
  6178. * @param errors An array of errors that this rule may add
  6179. * validation errors to.
  6180. * @param options The validation options.
  6181. * @param options.messages The validation messages.
  6182. */
  6183. function range(rule, value, source, errors, options) {
  6184. var len = typeof rule.len === 'number';
  6185. var min = typeof rule.min === 'number';
  6186. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  6187. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  6188. var val = value;
  6189. var key = null;
  6190. var num = typeof value === 'number';
  6191. var str = typeof value === 'string';
  6192. var arr = Array.isArray(value);
  6193. if (num) {
  6194. key = 'number';
  6195. } else if (str) {
  6196. key = 'string';
  6197. } else if (arr) {
  6198. key = 'array';
  6199. } // if the value is not of a supported type for range validation
  6200. // the validation rule rule should use the
  6201. // type property to also test for a particular type
  6202. if (!key) {
  6203. return false;
  6204. }
  6205. if (arr) {
  6206. val = value.length;
  6207. }
  6208. if (str) {
  6209. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  6210. val = value.replace(spRegexp, '_').length;
  6211. }
  6212. if (len) {
  6213. if (val !== rule.len) {
  6214. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  6215. }
  6216. } else if (min && !max && val < rule.min) {
  6217. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  6218. } else if (max && !min && val > rule.max) {
  6219. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  6220. } else if (min && max && (val < rule.min || val > rule.max)) {
  6221. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  6222. }
  6223. }
  6224. var ENUM = 'enum';
  6225. /**
  6226. * Rule for validating a value exists in an enumerable list.
  6227. *
  6228. * @param rule The validation rule.
  6229. * @param value The value of the field on the source object.
  6230. * @param source The source object being validated.
  6231. * @param errors An array of errors that this rule may add
  6232. * validation errors to.
  6233. * @param options The validation options.
  6234. * @param options.messages The validation messages.
  6235. */
  6236. function enumerable(rule, value, source, errors, options) {
  6237. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  6238. if (rule[ENUM].indexOf(value) === -1) {
  6239. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  6240. }
  6241. }
  6242. /**
  6243. * Rule for validating a regular expression pattern.
  6244. *
  6245. * @param rule The validation rule.
  6246. * @param value The value of the field on the source object.
  6247. * @param source The source object being validated.
  6248. * @param errors An array of errors that this rule may add
  6249. * validation errors to.
  6250. * @param options The validation options.
  6251. * @param options.messages The validation messages.
  6252. */
  6253. function pattern$1(rule, value, source, errors, options) {
  6254. if (rule.pattern) {
  6255. if (rule.pattern instanceof RegExp) {
  6256. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  6257. // flag is accidentally set to `true`, which in a validation scenario
  6258. // is not necessary and the result might be misleading
  6259. rule.pattern.lastIndex = 0;
  6260. if (!rule.pattern.test(value)) {
  6261. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  6262. }
  6263. } else if (typeof rule.pattern === 'string') {
  6264. var _pattern = new RegExp(rule.pattern);
  6265. if (!_pattern.test(value)) {
  6266. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  6267. }
  6268. }
  6269. }
  6270. }
  6271. var rules = {
  6272. required: required,
  6273. whitespace: whitespace,
  6274. type: type,
  6275. range: range,
  6276. "enum": enumerable,
  6277. pattern: pattern$1 };
  6278. /**
  6279. * Performs validation for string types.
  6280. *
  6281. * @param rule The validation rule.
  6282. * @param value The value of the field on the source object.
  6283. * @param callback The callback function.
  6284. * @param source The source object being validated.
  6285. * @param options The validation options.
  6286. * @param options.messages The validation messages.
  6287. */
  6288. function string(rule, value, callback, source, options) {
  6289. var errors = [];
  6290. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6291. if (validate) {
  6292. if (isEmptyValue(value, 'string') && !rule.required) {
  6293. return callback();
  6294. }
  6295. rules.required(rule, value, source, errors, options, 'string');
  6296. if (!isEmptyValue(value, 'string')) {
  6297. rules.type(rule, value, source, errors, options);
  6298. rules.range(rule, value, source, errors, options);
  6299. rules.pattern(rule, value, source, errors, options);
  6300. if (rule.whitespace === true) {
  6301. rules.whitespace(rule, value, source, errors, options);
  6302. }
  6303. }
  6304. }
  6305. callback(errors);
  6306. }
  6307. /**
  6308. * Validates a function.
  6309. *
  6310. * @param rule The validation rule.
  6311. * @param value The value of the field on the source object.
  6312. * @param callback The callback function.
  6313. * @param source The source object being validated.
  6314. * @param options The validation options.
  6315. * @param options.messages The validation messages.
  6316. */
  6317. function method(rule, value, callback, source, options) {
  6318. var errors = [];
  6319. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6320. if (validate) {
  6321. if (isEmptyValue(value) && !rule.required) {
  6322. return callback();
  6323. }
  6324. rules.required(rule, value, source, errors, options);
  6325. if (value !== undefined) {
  6326. rules.type(rule, value, source, errors, options);
  6327. }
  6328. }
  6329. callback(errors);
  6330. }
  6331. /**
  6332. * Validates a number.
  6333. *
  6334. * @param rule The validation rule.
  6335. * @param value The value of the field on the source object.
  6336. * @param callback The callback function.
  6337. * @param source The source object being validated.
  6338. * @param options The validation options.
  6339. * @param options.messages The validation messages.
  6340. */
  6341. function number(rule, value, callback, source, options) {
  6342. var errors = [];
  6343. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6344. if (validate) {
  6345. if (value === '') {
  6346. value = undefined;
  6347. }
  6348. if (isEmptyValue(value) && !rule.required) {
  6349. return callback();
  6350. }
  6351. rules.required(rule, value, source, errors, options);
  6352. if (value !== undefined) {
  6353. rules.type(rule, value, source, errors, options);
  6354. rules.range(rule, value, source, errors, options);
  6355. }
  6356. }
  6357. callback(errors);
  6358. }
  6359. /**
  6360. * Validates a boolean.
  6361. *
  6362. * @param rule The validation rule.
  6363. * @param value The value of the field on the source object.
  6364. * @param callback The callback function.
  6365. * @param source The source object being validated.
  6366. * @param options The validation options.
  6367. * @param options.messages The validation messages.
  6368. */
  6369. function _boolean(rule, value, callback, source, options) {
  6370. var errors = [];
  6371. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6372. if (validate) {
  6373. if (isEmptyValue(value) && !rule.required) {
  6374. return callback();
  6375. }
  6376. rules.required(rule, value, source, errors, options);
  6377. if (value !== undefined) {
  6378. rules.type(rule, value, source, errors, options);
  6379. }
  6380. }
  6381. callback(errors);
  6382. }
  6383. /**
  6384. * Validates the regular expression type.
  6385. *
  6386. * @param rule The validation rule.
  6387. * @param value The value of the field on the source object.
  6388. * @param callback The callback function.
  6389. * @param source The source object being validated.
  6390. * @param options The validation options.
  6391. * @param options.messages The validation messages.
  6392. */
  6393. function regexp(rule, value, callback, source, options) {
  6394. var errors = [];
  6395. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6396. if (validate) {
  6397. if (isEmptyValue(value) && !rule.required) {
  6398. return callback();
  6399. }
  6400. rules.required(rule, value, source, errors, options);
  6401. if (!isEmptyValue(value)) {
  6402. rules.type(rule, value, source, errors, options);
  6403. }
  6404. }
  6405. callback(errors);
  6406. }
  6407. /**
  6408. * Validates a number is an integer.
  6409. *
  6410. * @param rule The validation rule.
  6411. * @param value The value of the field on the source object.
  6412. * @param callback The callback function.
  6413. * @param source The source object being validated.
  6414. * @param options The validation options.
  6415. * @param options.messages The validation messages.
  6416. */
  6417. function integer(rule, value, callback, source, options) {
  6418. var errors = [];
  6419. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6420. if (validate) {
  6421. if (isEmptyValue(value) && !rule.required) {
  6422. return callback();
  6423. }
  6424. rules.required(rule, value, source, errors, options);
  6425. if (value !== undefined) {
  6426. rules.type(rule, value, source, errors, options);
  6427. rules.range(rule, value, source, errors, options);
  6428. }
  6429. }
  6430. callback(errors);
  6431. }
  6432. /**
  6433. * Validates a number is a floating point number.
  6434. *
  6435. * @param rule The validation rule.
  6436. * @param value The value of the field on the source object.
  6437. * @param callback The callback function.
  6438. * @param source The source object being validated.
  6439. * @param options The validation options.
  6440. * @param options.messages The validation messages.
  6441. */
  6442. function floatFn(rule, value, callback, source, options) {
  6443. var errors = [];
  6444. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6445. if (validate) {
  6446. if (isEmptyValue(value) && !rule.required) {
  6447. return callback();
  6448. }
  6449. rules.required(rule, value, source, errors, options);
  6450. if (value !== undefined) {
  6451. rules.type(rule, value, source, errors, options);
  6452. rules.range(rule, value, source, errors, options);
  6453. }
  6454. }
  6455. callback(errors);
  6456. }
  6457. /**
  6458. * Validates an array.
  6459. *
  6460. * @param rule The validation rule.
  6461. * @param value The value of the field on the source object.
  6462. * @param callback The callback function.
  6463. * @param source The source object being validated.
  6464. * @param options The validation options.
  6465. * @param options.messages The validation messages.
  6466. */
  6467. function array(rule, value, callback, source, options) {
  6468. var errors = [];
  6469. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6470. if (validate) {
  6471. if (isEmptyValue(value, 'array') && !rule.required) {
  6472. return callback();
  6473. }
  6474. rules.required(rule, value, source, errors, options, 'array');
  6475. if (!isEmptyValue(value, 'array')) {
  6476. rules.type(rule, value, source, errors, options);
  6477. rules.range(rule, value, source, errors, options);
  6478. }
  6479. }
  6480. callback(errors);
  6481. }
  6482. /**
  6483. * Validates an object.
  6484. *
  6485. * @param rule The validation rule.
  6486. * @param value The value of the field on the source object.
  6487. * @param callback The callback function.
  6488. * @param source The source object being validated.
  6489. * @param options The validation options.
  6490. * @param options.messages The validation messages.
  6491. */
  6492. function object(rule, value, callback, source, options) {
  6493. var errors = [];
  6494. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6495. if (validate) {
  6496. if (isEmptyValue(value) && !rule.required) {
  6497. return callback();
  6498. }
  6499. rules.required(rule, value, source, errors, options);
  6500. if (value !== undefined) {
  6501. rules.type(rule, value, source, errors, options);
  6502. }
  6503. }
  6504. callback(errors);
  6505. }
  6506. var ENUM$1 = 'enum';
  6507. /**
  6508. * Validates an enumerable list.
  6509. *
  6510. * @param rule The validation rule.
  6511. * @param value The value of the field on the source object.
  6512. * @param callback The callback function.
  6513. * @param source The source object being validated.
  6514. * @param options The validation options.
  6515. * @param options.messages The validation messages.
  6516. */
  6517. function enumerable$1(rule, value, callback, source, options) {
  6518. var errors = [];
  6519. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6520. if (validate) {
  6521. if (isEmptyValue(value) && !rule.required) {
  6522. return callback();
  6523. }
  6524. rules.required(rule, value, source, errors, options);
  6525. if (value !== undefined) {
  6526. rules[ENUM$1](rule, value, source, errors, options);
  6527. }
  6528. }
  6529. callback(errors);
  6530. }
  6531. /**
  6532. * Validates a regular expression pattern.
  6533. *
  6534. * Performs validation when a rule only contains
  6535. * a pattern property but is not declared as a string type.
  6536. *
  6537. * @param rule The validation rule.
  6538. * @param value The value of the field on the source object.
  6539. * @param callback The callback function.
  6540. * @param source The source object being validated.
  6541. * @param options The validation options.
  6542. * @param options.messages The validation messages.
  6543. */
  6544. function pattern$2(rule, value, callback, source, options) {
  6545. var errors = [];
  6546. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6547. if (validate) {
  6548. if (isEmptyValue(value, 'string') && !rule.required) {
  6549. return callback();
  6550. }
  6551. rules.required(rule, value, source, errors, options);
  6552. if (!isEmptyValue(value, 'string')) {
  6553. rules.pattern(rule, value, source, errors, options);
  6554. }
  6555. }
  6556. callback(errors);
  6557. }
  6558. function date(rule, value, callback, source, options) {
  6559. var errors = [];
  6560. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6561. if (validate) {
  6562. if (isEmptyValue(value) && !rule.required) {
  6563. return callback();
  6564. }
  6565. rules.required(rule, value, source, errors, options);
  6566. if (!isEmptyValue(value)) {
  6567. var dateObject;
  6568. if (typeof value === 'number') {
  6569. dateObject = new Date(value);
  6570. } else {
  6571. dateObject = value;
  6572. }
  6573. rules.type(rule, dateObject, source, errors, options);
  6574. if (dateObject) {
  6575. rules.range(rule, dateObject.getTime(), source, errors, options);
  6576. }
  6577. }
  6578. }
  6579. callback(errors);
  6580. }
  6581. function required$1(rule, value, callback, source, options) {
  6582. var errors = [];
  6583. var type = Array.isArray(value) ? 'array' : typeof value;
  6584. rules.required(rule, value, source, errors, options, type);
  6585. callback(errors);
  6586. }
  6587. function type$1(rule, value, callback, source, options) {
  6588. var ruleType = rule.type;
  6589. var errors = [];
  6590. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6591. if (validate) {
  6592. if (isEmptyValue(value, ruleType) && !rule.required) {
  6593. return callback();
  6594. }
  6595. rules.required(rule, value, source, errors, options, ruleType);
  6596. if (!isEmptyValue(value, ruleType)) {
  6597. rules.type(rule, value, source, errors, options);
  6598. }
  6599. }
  6600. callback(errors);
  6601. }
  6602. /**
  6603. * Performs validation for any type.
  6604. *
  6605. * @param rule The validation rule.
  6606. * @param value The value of the field on the source object.
  6607. * @param callback The callback function.
  6608. * @param source The source object being validated.
  6609. * @param options The validation options.
  6610. * @param options.messages The validation messages.
  6611. */
  6612. function any(rule, value, callback, source, options) {
  6613. var errors = [];
  6614. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  6615. if (validate) {
  6616. if (isEmptyValue(value) && !rule.required) {
  6617. return callback();
  6618. }
  6619. rules.required(rule, value, source, errors, options);
  6620. }
  6621. callback(errors);
  6622. }
  6623. var validators = {
  6624. string: string,
  6625. method: method,
  6626. number: number,
  6627. "boolean": _boolean,
  6628. regexp: regexp,
  6629. integer: integer,
  6630. "float": floatFn,
  6631. array: array,
  6632. object: object,
  6633. "enum": enumerable$1,
  6634. pattern: pattern$2,
  6635. date: date,
  6636. url: type$1,
  6637. hex: type$1,
  6638. email: type$1,
  6639. required: required$1,
  6640. any: any };
  6641. function newMessages() {
  6642. return {
  6643. "default": 'Validation error on field %s',
  6644. required: '%s is required',
  6645. "enum": '%s must be one of %s',
  6646. whitespace: '%s cannot be empty',
  6647. date: {
  6648. format: '%s date %s is invalid for format %s',
  6649. parse: '%s date could not be parsed, %s is invalid ',
  6650. invalid: '%s date %s is invalid' },
  6651. types: {
  6652. string: '%s is not a %s',
  6653. method: '%s is not a %s (function)',
  6654. array: '%s is not an %s',
  6655. object: '%s is not an %s',
  6656. number: '%s is not a %s',
  6657. date: '%s is not a %s',
  6658. "boolean": '%s is not a %s',
  6659. integer: '%s is not an %s',
  6660. "float": '%s is not a %s',
  6661. regexp: '%s is not a valid %s',
  6662. email: '%s is not a valid %s',
  6663. url: '%s is not a valid %s',
  6664. hex: '%s is not a valid %s' },
  6665. string: {
  6666. len: '%s must be exactly %s characters',
  6667. min: '%s must be at least %s characters',
  6668. max: '%s cannot be longer than %s characters',
  6669. range: '%s must be between %s and %s characters' },
  6670. number: {
  6671. len: '%s must equal %s',
  6672. min: '%s cannot be less than %s',
  6673. max: '%s cannot be greater than %s',
  6674. range: '%s must be between %s and %s' },
  6675. array: {
  6676. len: '%s must be exactly %s in length',
  6677. min: '%s cannot be less than %s in length',
  6678. max: '%s cannot be greater than %s in length',
  6679. range: '%s must be between %s and %s in length' },
  6680. pattern: {
  6681. mismatch: '%s value %s does not match pattern %s' },
  6682. clone: function clone() {
  6683. var cloned = JSON.parse(JSON.stringify(this));
  6684. cloned.clone = this.clone;
  6685. return cloned;
  6686. } };
  6687. }
  6688. var messages = newMessages();
  6689. /**
  6690. * Encapsulates a validation schema.
  6691. *
  6692. * @param descriptor An object declaring validation rules
  6693. * for this schema.
  6694. */
  6695. function Schema(descriptor) {
  6696. this.rules = null;
  6697. this._messages = messages;
  6698. this.define(descriptor);
  6699. }
  6700. Schema.prototype = {
  6701. messages: function messages(_messages) {
  6702. if (_messages) {
  6703. this._messages = deepMerge(newMessages(), _messages);
  6704. }
  6705. return this._messages;
  6706. },
  6707. define: function define(rules) {
  6708. if (!rules) {
  6709. throw new Error('Cannot configure a schema with no rules');
  6710. }
  6711. if (typeof rules !== 'object' || Array.isArray(rules)) {
  6712. throw new Error('Rules must be an object');
  6713. }
  6714. this.rules = {};
  6715. var z;
  6716. var item;
  6717. for (z in rules) {
  6718. if (rules.hasOwnProperty(z)) {
  6719. item = rules[z];
  6720. this.rules[z] = Array.isArray(item) ? item : [item];
  6721. }
  6722. }
  6723. },
  6724. validate: function validate(source_, o, oc) {
  6725. var _this = this;
  6726. if (o === void 0) {
  6727. o = {};
  6728. }
  6729. if (oc === void 0) {
  6730. oc = function oc() {};
  6731. }
  6732. var source = source_;
  6733. var options = o;
  6734. var callback = oc;
  6735. if (typeof options === 'function') {
  6736. callback = options;
  6737. options = {};
  6738. }
  6739. if (!this.rules || Object.keys(this.rules).length === 0) {
  6740. if (callback) {
  6741. callback();
  6742. }
  6743. return Promise.resolve();
  6744. }
  6745. function complete(results) {
  6746. var i;
  6747. var errors = [];
  6748. var fields = {};
  6749. function add(e) {
  6750. if (Array.isArray(e)) {
  6751. var _errors;
  6752. errors = (_errors = errors).concat.apply(_errors, e);
  6753. } else {
  6754. errors.push(e);
  6755. }
  6756. }
  6757. for (i = 0; i < results.length; i++) {
  6758. add(results[i]);
  6759. }
  6760. if (!errors.length) {
  6761. errors = null;
  6762. fields = null;
  6763. } else {
  6764. fields = convertFieldsError(errors);
  6765. }
  6766. callback(errors, fields);
  6767. }
  6768. if (options.messages) {
  6769. var messages$1 = this.messages();
  6770. if (messages$1 === messages) {
  6771. messages$1 = newMessages();
  6772. }
  6773. deepMerge(messages$1, options.messages);
  6774. options.messages = messages$1;
  6775. } else {
  6776. options.messages = this.messages();
  6777. }
  6778. var arr;
  6779. var value;
  6780. var series = {};
  6781. var keys = options.keys || Object.keys(this.rules);
  6782. keys.forEach(function (z) {
  6783. arr = _this.rules[z];
  6784. value = source[z];
  6785. arr.forEach(function (r) {
  6786. var rule = r;
  6787. if (typeof rule.transform === 'function') {
  6788. if (source === source_) {
  6789. source = _extends({}, source);
  6790. }
  6791. value = source[z] = rule.transform(value);
  6792. }
  6793. if (typeof rule === 'function') {
  6794. rule = {
  6795. validator: rule };
  6796. } else {
  6797. rule = _extends({}, rule);
  6798. }
  6799. rule.validator = _this.getValidationMethod(rule);
  6800. rule.field = z;
  6801. rule.fullField = rule.fullField || z;
  6802. rule.type = _this.getType(rule);
  6803. if (!rule.validator) {
  6804. return;
  6805. }
  6806. series[z] = series[z] || [];
  6807. series[z].push({
  6808. rule: rule,
  6809. value: value,
  6810. source: source,
  6811. field: z });
  6812. });
  6813. });
  6814. var errorFields = {};
  6815. return asyncMap(series, options, function (data, doIt) {
  6816. var rule = data.rule;
  6817. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  6818. 'object');
  6819. deep = deep && (rule.required || !rule.required && data.value);
  6820. rule.field = data.field;
  6821. function addFullfield(key, schema) {
  6822. return _extends({}, schema, {
  6823. fullField: rule.fullField + "." + key });
  6824. }
  6825. function cb(e) {
  6826. if (e === void 0) {
  6827. e = [];
  6828. }
  6829. var errors = e;
  6830. if (!Array.isArray(errors)) {
  6831. errors = [errors];
  6832. }
  6833. if (!options.suppressWarning && errors.length) {
  6834. Schema.warning('async-validator:', errors);
  6835. }
  6836. if (errors.length && rule.message) {
  6837. errors = [].concat(rule.message);
  6838. }
  6839. errors = errors.map(complementError(rule));
  6840. if (options.first && errors.length) {
  6841. errorFields[rule.field] = 1;
  6842. return doIt(errors);
  6843. }
  6844. if (!deep) {
  6845. doIt(errors);
  6846. } else {
  6847. // if rule is required but the target object
  6848. // does not exist fail at the rule level and don't
  6849. // go deeper
  6850. if (rule.required && !data.value) {
  6851. if (rule.message) {
  6852. errors = [].concat(rule.message).map(complementError(rule));
  6853. } else if (options.error) {
  6854. errors = [options.error(rule, format(options.messages.required, rule.field))];
  6855. } else {
  6856. errors = [];
  6857. }
  6858. return doIt(errors);
  6859. }
  6860. var fieldsSchema = {};
  6861. if (rule.defaultField) {
  6862. for (var k in data.value) {
  6863. if (data.value.hasOwnProperty(k)) {
  6864. fieldsSchema[k] = rule.defaultField;
  6865. }
  6866. }
  6867. }
  6868. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  6869. for (var f in fieldsSchema) {
  6870. if (fieldsSchema.hasOwnProperty(f)) {
  6871. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  6872. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  6873. }
  6874. }
  6875. var schema = new Schema(fieldsSchema);
  6876. schema.messages(options.messages);
  6877. if (data.rule.options) {
  6878. data.rule.options.messages = options.messages;
  6879. data.rule.options.error = options.error;
  6880. }
  6881. schema.validate(data.value, data.rule.options || options, function (errs) {
  6882. var finalErrors = [];
  6883. if (errors && errors.length) {
  6884. finalErrors.push.apply(finalErrors, errors);
  6885. }
  6886. if (errs && errs.length) {
  6887. finalErrors.push.apply(finalErrors, errs);
  6888. }
  6889. doIt(finalErrors.length ? finalErrors : null);
  6890. });
  6891. }
  6892. }
  6893. var res;
  6894. if (rule.asyncValidator) {
  6895. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  6896. } else if (rule.validator) {
  6897. res = rule.validator(rule, data.value, cb, data.source, options);
  6898. if (res === true) {
  6899. cb();
  6900. } else if (res === false) {
  6901. cb(rule.message || rule.field + " fails");
  6902. } else if (res instanceof Array) {
  6903. cb(res);
  6904. } else if (res instanceof Error) {
  6905. cb(res.message);
  6906. }
  6907. }
  6908. if (res && res.then) {
  6909. res.then(function () {
  6910. return cb();
  6911. }, function (e) {
  6912. return cb(e);
  6913. });
  6914. }
  6915. }, function (results) {
  6916. complete(results);
  6917. });
  6918. },
  6919. getType: function getType(rule) {
  6920. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  6921. rule.type = 'pattern';
  6922. }
  6923. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  6924. throw new Error(format('Unknown rule type %s', rule.type));
  6925. }
  6926. return rule.type || 'string';
  6927. },
  6928. getValidationMethod: function getValidationMethod(rule) {
  6929. if (typeof rule.validator === 'function') {
  6930. return rule.validator;
  6931. }
  6932. var keys = Object.keys(rule);
  6933. var messageIndex = keys.indexOf('message');
  6934. if (messageIndex !== -1) {
  6935. keys.splice(messageIndex, 1);
  6936. }
  6937. if (keys.length === 1 && keys[0] === 'required') {
  6938. return validators.required;
  6939. }
  6940. return validators[this.getType(rule)] || false;
  6941. } };
  6942. Schema.register = function register(type, validator) {
  6943. if (typeof validator !== 'function') {
  6944. throw new Error('Cannot register a validator by type, validator is not a function');
  6945. }
  6946. validators[type] = validator;
  6947. };
  6948. Schema.warning = warning;
  6949. Schema.messages = messages;var _default =
  6950. Schema;exports.default = _default;
  6951. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 269)))
  6952. /***/ }),
  6953. /***/ 269:
  6954. /*!********************************************************!*\
  6955. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  6956. \********************************************************/
  6957. /*! no static exports found */
  6958. /***/ (function(module, exports, __webpack_require__) {
  6959. exports.nextTick = function nextTick(fn) {
  6960. var args = Array.prototype.slice.call(arguments);
  6961. args.shift();
  6962. setTimeout(function () {
  6963. fn.apply(null, args);
  6964. }, 0);
  6965. };
  6966. exports.platform = exports.arch =
  6967. exports.execPath = exports.title = 'browser';
  6968. exports.pid = 1;
  6969. exports.browser = true;
  6970. exports.env = {};
  6971. exports.argv = [];
  6972. exports.binding = function (name) {
  6973. throw new Error('No such module. (Possibly not yet loaded)')
  6974. };
  6975. (function () {
  6976. var cwd = '/';
  6977. var path;
  6978. exports.cwd = function () { return cwd };
  6979. exports.chdir = function (dir) {
  6980. if (!path) path = __webpack_require__(/*! path */ 270);
  6981. cwd = path.resolve(dir, cwd);
  6982. };
  6983. })();
  6984. exports.exit = exports.kill =
  6985. exports.umask = exports.dlopen =
  6986. exports.uptime = exports.memoryUsage =
  6987. exports.uvCounters = function() {};
  6988. exports.features = {};
  6989. /***/ }),
  6990. /***/ 27:
  6991. /*!*********************************************************************!*\
  6992. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  6993. \*********************************************************************/
  6994. /*! no static exports found */
  6995. /***/ (function(module, exports, __webpack_require__) {
  6996. "use strict";
  6997. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  6998. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  6999. var color = {
  7000. primary: "#2979ff",
  7001. primaryDark: "#2b85e4",
  7002. primaryDisabled: "#a0cfff",
  7003. primaryLight: "#ecf5ff",
  7004. bgColor: "#f3f4f6",
  7005. info: "#909399",
  7006. infoDark: "#82848a",
  7007. infoDisabled: "#c8c9cc",
  7008. infoLight: "#f4f4f5",
  7009. warning: "#ff9900",
  7010. warningDark: "#f29100",
  7011. warningDisabled: "#fcbd71",
  7012. warningLight: "#fdf6ec",
  7013. error: "#fa3534",
  7014. errorDark: "#dd6161",
  7015. errorDisabled: "#fab6b6",
  7016. errorLight: "#fef0f0",
  7017. success: "#19be6b",
  7018. successDark: "#18b566",
  7019. successDisabled: "#71d5a1",
  7020. successLight: "#dbf1e1",
  7021. mainColor: "#303133",
  7022. contentColor: "#606266",
  7023. tipsColor: "#909399",
  7024. lightColor: "#c0c4cc",
  7025. borderColor: "#e4e7ed" };var _default =
  7026. color;exports.default = _default;
  7027. /***/ }),
  7028. /***/ 270:
  7029. /*!***********************************************!*\
  7030. !*** ./node_modules/path-browserify/index.js ***!
  7031. \***********************************************/
  7032. /*! no static exports found */
  7033. /***/ (function(module, exports, __webpack_require__) {
  7034. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  7035. // backported and transplited with Babel, with backwards-compat fixes
  7036. // Copyright Joyent, Inc. and other Node contributors.
  7037. //
  7038. // Permission is hereby granted, free of charge, to any person obtaining a
  7039. // copy of this software and associated documentation files (the
  7040. // "Software"), to deal in the Software without restriction, including
  7041. // without limitation the rights to use, copy, modify, merge, publish,
  7042. // distribute, sublicense, and/or sell copies of the Software, and to permit
  7043. // persons to whom the Software is furnished to do so, subject to the
  7044. // following conditions:
  7045. //
  7046. // The above copyright notice and this permission notice shall be included
  7047. // in all copies or substantial portions of the Software.
  7048. //
  7049. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  7050. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  7051. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  7052. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  7053. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  7054. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  7055. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  7056. // resolves . and .. elements in a path array with directory names there
  7057. // must be no slashes, empty elements, or device names (c:\) in the array
  7058. // (so also no leading and trailing slashes - it does not distinguish
  7059. // relative and absolute paths)
  7060. function normalizeArray(parts, allowAboveRoot) {
  7061. // if the path tries to go above the root, `up` ends up > 0
  7062. var up = 0;
  7063. for (var i = parts.length - 1; i >= 0; i--) {
  7064. var last = parts[i];
  7065. if (last === '.') {
  7066. parts.splice(i, 1);
  7067. } else if (last === '..') {
  7068. parts.splice(i, 1);
  7069. up++;
  7070. } else if (up) {
  7071. parts.splice(i, 1);
  7072. up--;
  7073. }
  7074. }
  7075. // if the path is allowed to go above the root, restore leading ..s
  7076. if (allowAboveRoot) {
  7077. for (; up--; up) {
  7078. parts.unshift('..');
  7079. }
  7080. }
  7081. return parts;
  7082. }
  7083. // path.resolve([from ...], to)
  7084. // posix version
  7085. exports.resolve = function() {
  7086. var resolvedPath = '',
  7087. resolvedAbsolute = false;
  7088. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  7089. var path = (i >= 0) ? arguments[i] : process.cwd();
  7090. // Skip empty and invalid entries
  7091. if (typeof path !== 'string') {
  7092. throw new TypeError('Arguments to path.resolve must be strings');
  7093. } else if (!path) {
  7094. continue;
  7095. }
  7096. resolvedPath = path + '/' + resolvedPath;
  7097. resolvedAbsolute = path.charAt(0) === '/';
  7098. }
  7099. // At this point the path should be resolved to a full absolute path, but
  7100. // handle relative paths to be safe (might happen when process.cwd() fails)
  7101. // Normalize the path
  7102. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  7103. return !!p;
  7104. }), !resolvedAbsolute).join('/');
  7105. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  7106. };
  7107. // path.normalize(path)
  7108. // posix version
  7109. exports.normalize = function(path) {
  7110. var isAbsolute = exports.isAbsolute(path),
  7111. trailingSlash = substr(path, -1) === '/';
  7112. // Normalize the path
  7113. path = normalizeArray(filter(path.split('/'), function(p) {
  7114. return !!p;
  7115. }), !isAbsolute).join('/');
  7116. if (!path && !isAbsolute) {
  7117. path = '.';
  7118. }
  7119. if (path && trailingSlash) {
  7120. path += '/';
  7121. }
  7122. return (isAbsolute ? '/' : '') + path;
  7123. };
  7124. // posix version
  7125. exports.isAbsolute = function(path) {
  7126. return path.charAt(0) === '/';
  7127. };
  7128. // posix version
  7129. exports.join = function() {
  7130. var paths = Array.prototype.slice.call(arguments, 0);
  7131. return exports.normalize(filter(paths, function(p, index) {
  7132. if (typeof p !== 'string') {
  7133. throw new TypeError('Arguments to path.join must be strings');
  7134. }
  7135. return p;
  7136. }).join('/'));
  7137. };
  7138. // path.relative(from, to)
  7139. // posix version
  7140. exports.relative = function(from, to) {
  7141. from = exports.resolve(from).substr(1);
  7142. to = exports.resolve(to).substr(1);
  7143. function trim(arr) {
  7144. var start = 0;
  7145. for (; start < arr.length; start++) {
  7146. if (arr[start] !== '') break;
  7147. }
  7148. var end = arr.length - 1;
  7149. for (; end >= 0; end--) {
  7150. if (arr[end] !== '') break;
  7151. }
  7152. if (start > end) return [];
  7153. return arr.slice(start, end - start + 1);
  7154. }
  7155. var fromParts = trim(from.split('/'));
  7156. var toParts = trim(to.split('/'));
  7157. var length = Math.min(fromParts.length, toParts.length);
  7158. var samePartsLength = length;
  7159. for (var i = 0; i < length; i++) {
  7160. if (fromParts[i] !== toParts[i]) {
  7161. samePartsLength = i;
  7162. break;
  7163. }
  7164. }
  7165. var outputParts = [];
  7166. for (var i = samePartsLength; i < fromParts.length; i++) {
  7167. outputParts.push('..');
  7168. }
  7169. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  7170. return outputParts.join('/');
  7171. };
  7172. exports.sep = '/';
  7173. exports.delimiter = ':';
  7174. exports.dirname = function (path) {
  7175. if (typeof path !== 'string') path = path + '';
  7176. if (path.length === 0) return '.';
  7177. var code = path.charCodeAt(0);
  7178. var hasRoot = code === 47 /*/*/;
  7179. var end = -1;
  7180. var matchedSlash = true;
  7181. for (var i = path.length - 1; i >= 1; --i) {
  7182. code = path.charCodeAt(i);
  7183. if (code === 47 /*/*/) {
  7184. if (!matchedSlash) {
  7185. end = i;
  7186. break;
  7187. }
  7188. } else {
  7189. // We saw the first non-path separator
  7190. matchedSlash = false;
  7191. }
  7192. }
  7193. if (end === -1) return hasRoot ? '/' : '.';
  7194. if (hasRoot && end === 1) {
  7195. // return '//';
  7196. // Backwards-compat fix:
  7197. return '/';
  7198. }
  7199. return path.slice(0, end);
  7200. };
  7201. function basename(path) {
  7202. if (typeof path !== 'string') path = path + '';
  7203. var start = 0;
  7204. var end = -1;
  7205. var matchedSlash = true;
  7206. var i;
  7207. for (i = path.length - 1; i >= 0; --i) {
  7208. if (path.charCodeAt(i) === 47 /*/*/) {
  7209. // If we reached a path separator that was not part of a set of path
  7210. // separators at the end of the string, stop now
  7211. if (!matchedSlash) {
  7212. start = i + 1;
  7213. break;
  7214. }
  7215. } else if (end === -1) {
  7216. // We saw the first non-path separator, mark this as the end of our
  7217. // path component
  7218. matchedSlash = false;
  7219. end = i + 1;
  7220. }
  7221. }
  7222. if (end === -1) return '';
  7223. return path.slice(start, end);
  7224. }
  7225. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  7226. // in new Node.js versions, so only basename() above is backported here
  7227. exports.basename = function (path, ext) {
  7228. var f = basename(path);
  7229. if (ext && f.substr(-1 * ext.length) === ext) {
  7230. f = f.substr(0, f.length - ext.length);
  7231. }
  7232. return f;
  7233. };
  7234. exports.extname = function (path) {
  7235. if (typeof path !== 'string') path = path + '';
  7236. var startDot = -1;
  7237. var startPart = 0;
  7238. var end = -1;
  7239. var matchedSlash = true;
  7240. // Track the state of characters (if any) we see before our first dot and
  7241. // after any path separator we find
  7242. var preDotState = 0;
  7243. for (var i = path.length - 1; i >= 0; --i) {
  7244. var code = path.charCodeAt(i);
  7245. if (code === 47 /*/*/) {
  7246. // If we reached a path separator that was not part of a set of path
  7247. // separators at the end of the string, stop now
  7248. if (!matchedSlash) {
  7249. startPart = i + 1;
  7250. break;
  7251. }
  7252. continue;
  7253. }
  7254. if (end === -1) {
  7255. // We saw the first non-path separator, mark this as the end of our
  7256. // extension
  7257. matchedSlash = false;
  7258. end = i + 1;
  7259. }
  7260. if (code === 46 /*.*/) {
  7261. // If this is our first dot, mark it as the start of our extension
  7262. if (startDot === -1)
  7263. startDot = i;
  7264. else if (preDotState !== 1)
  7265. preDotState = 1;
  7266. } else if (startDot !== -1) {
  7267. // We saw a non-dot and non-path separator before our dot, so we should
  7268. // have a good chance at having a non-empty extension
  7269. preDotState = -1;
  7270. }
  7271. }
  7272. if (startDot === -1 || end === -1 ||
  7273. // We saw a non-dot character immediately before the dot
  7274. preDotState === 0 ||
  7275. // The (right-most) trimmed path component is exactly '..'
  7276. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  7277. return '';
  7278. }
  7279. return path.slice(startDot, end);
  7280. };
  7281. function filter (xs, f) {
  7282. if (xs.filter) return xs.filter(f);
  7283. var res = [];
  7284. for (var i = 0; i < xs.length; i++) {
  7285. if (f(xs[i], i, xs)) res.push(xs[i]);
  7286. }
  7287. return res;
  7288. }
  7289. // String.prototype.substr - negative index don't work in IE8
  7290. var substr = 'ab'.substr(-1) === 'b'
  7291. ? function (str, start, len) { return str.substr(start, len) }
  7292. : function (str, start, len) {
  7293. if (start < 0) start = str.length + start;
  7294. return str.substr(start, len);
  7295. }
  7296. ;
  7297. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 269)))
  7298. /***/ }),
  7299. /***/ 28:
  7300. /*!*************************************************************************!*\
  7301. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  7302. \*************************************************************************/
  7303. /*! no static exports found */
  7304. /***/ (function(module, exports, __webpack_require__) {
  7305. "use strict";
  7306. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  7307. * 根据主题type值,获取对应的图标
  7308. * @param String type 主题名称,primary|info|error|warning|success
  7309. * @param String fill 是否使用fill填充实体的图标
  7310. */
  7311. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  7312. // 如果非预置值,默认为success
  7313. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  7314. var iconName = '';
  7315. // 目前(2019-12-12),info和primary使用同一个图标
  7316. switch (type) {
  7317. case 'primary':
  7318. iconName = 'info-circle';
  7319. break;
  7320. case 'info':
  7321. iconName = 'info-circle';
  7322. break;
  7323. case 'error':
  7324. iconName = 'close-circle';
  7325. break;
  7326. case 'warning':
  7327. iconName = 'error-circle';
  7328. break;
  7329. case 'success':
  7330. iconName = 'checkmark-circle';
  7331. break;
  7332. default:
  7333. iconName = 'checkmark-circle';}
  7334. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  7335. if (fill) iconName += '-fill';
  7336. return iconName;
  7337. }var _default =
  7338. type2icon;exports.default = _default;
  7339. /***/ }),
  7340. /***/ 29:
  7341. /*!***************************************************************************!*\
  7342. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  7343. \***************************************************************************/
  7344. /*! no static exports found */
  7345. /***/ (function(module, exports, __webpack_require__) {
  7346. "use strict";
  7347. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  7348. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7349. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  7350. return array.sort(function () {return Math.random() - 0.5;});
  7351. }var _default =
  7352. randomArray;exports.default = _default;
  7353. /***/ }),
  7354. /***/ 3:
  7355. /*!*************************************************************!*\
  7356. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7357. \*************************************************************/
  7358. /*! no static exports found */
  7359. /***/ (function(module, exports, __webpack_require__) {
  7360. "use strict";
  7361. /* 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;
  7362. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7363. var defaultDelimiters = ['{', '}'];var
  7364. BaseFormatter = /*#__PURE__*/function () {
  7365. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7366. this._caches = Object.create(null);
  7367. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7368. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7369. if (!values) {
  7370. return [message];
  7371. }
  7372. var tokens = this._caches[message];
  7373. if (!tokens) {
  7374. tokens = parse(message, delimiters);
  7375. this._caches[message] = tokens;
  7376. }
  7377. return compile(tokens, values);
  7378. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7379. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7380. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7381. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7382. var tokens = [];
  7383. var position = 0;
  7384. var text = '';
  7385. while (position < format.length) {
  7386. var char = format[position++];
  7387. if (char === startDelimiter) {
  7388. if (text) {
  7389. tokens.push({ type: 'text', value: text });
  7390. }
  7391. text = '';
  7392. var sub = '';
  7393. char = format[position++];
  7394. while (char !== undefined && char !== endDelimiter) {
  7395. sub += char;
  7396. char = format[position++];
  7397. }
  7398. var isClosed = char === endDelimiter;
  7399. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7400. 'list' :
  7401. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7402. 'named' :
  7403. 'unknown';
  7404. tokens.push({ value: sub, type: type });
  7405. }
  7406. // else if (char === '%') {
  7407. // // when found rails i18n syntax, skip text capture
  7408. // if (format[position] !== '{') {
  7409. // text += char
  7410. // }
  7411. // }
  7412. else {
  7413. text += char;
  7414. }
  7415. }
  7416. text && tokens.push({ type: 'text', value: text });
  7417. return tokens;
  7418. }
  7419. function compile(tokens, values) {
  7420. var compiled = [];
  7421. var index = 0;
  7422. var mode = isArray(values) ?
  7423. 'list' :
  7424. isObject(values) ?
  7425. 'named' :
  7426. 'unknown';
  7427. if (mode === 'unknown') {
  7428. return compiled;
  7429. }
  7430. while (index < tokens.length) {
  7431. var token = tokens[index];
  7432. switch (token.type) {
  7433. case 'text':
  7434. compiled.push(token.value);
  7435. break;
  7436. case 'list':
  7437. compiled.push(values[parseInt(token.value, 10)]);
  7438. break;
  7439. case 'named':
  7440. if (mode === 'named') {
  7441. compiled.push(values[token.value]);
  7442. } else
  7443. {
  7444. if (true) {
  7445. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7446. }
  7447. }
  7448. break;
  7449. case 'unknown':
  7450. if (true) {
  7451. console.warn("Detect 'unknown' type of token!");
  7452. }
  7453. break;}
  7454. index++;
  7455. }
  7456. return compiled;
  7457. }
  7458. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7459. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7460. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7461. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7462. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7463. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7464. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7465. var defaultFormatter = new BaseFormatter();
  7466. function include(str, parts) {
  7467. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7468. }
  7469. function startsWith(str, parts) {
  7470. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7471. }
  7472. function normalizeLocale(locale, messages) {
  7473. if (!locale) {
  7474. return;
  7475. }
  7476. locale = locale.trim().replace(/_/g, '-');
  7477. if (messages && messages[locale]) {
  7478. return locale;
  7479. }
  7480. locale = locale.toLowerCase();
  7481. if (locale.indexOf('zh') === 0) {
  7482. if (locale.indexOf('-hans') > -1) {
  7483. return LOCALE_ZH_HANS;
  7484. }
  7485. if (locale.indexOf('-hant') > -1) {
  7486. return LOCALE_ZH_HANT;
  7487. }
  7488. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7489. return LOCALE_ZH_HANT;
  7490. }
  7491. return LOCALE_ZH_HANS;
  7492. }
  7493. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7494. if (lang) {
  7495. return lang;
  7496. }
  7497. }var
  7498. I18n = /*#__PURE__*/function () {
  7499. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7500. this.locale = LOCALE_EN;
  7501. this.fallbackLocale = LOCALE_EN;
  7502. this.message = {};
  7503. this.messages = {};
  7504. this.watchers = [];
  7505. if (fallbackLocale) {
  7506. this.fallbackLocale = fallbackLocale;
  7507. }
  7508. this.formater = formater || defaultFormatter;
  7509. this.messages = messages || {};
  7510. this.setLocale(locale || LOCALE_EN);
  7511. if (watcher) {
  7512. this.watchLocale(watcher);
  7513. }
  7514. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7515. locale) {var _this = this;
  7516. var oldLocale = this.locale;
  7517. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7518. if (!this.messages[this.locale]) {
  7519. // 可能初始化时不存在
  7520. this.messages[this.locale] = {};
  7521. }
  7522. this.message = this.messages[this.locale];
  7523. // 仅发生变化时,通知
  7524. if (oldLocale !== this.locale) {
  7525. this.watchers.forEach(function (watcher) {
  7526. watcher(_this.locale, oldLocale);
  7527. });
  7528. }
  7529. } }, { key: "getLocale", value: function getLocale()
  7530. {
  7531. return this.locale;
  7532. } }, { key: "watchLocale", value: function watchLocale(
  7533. fn) {var _this2 = this;
  7534. var index = this.watchers.push(fn) - 1;
  7535. return function () {
  7536. _this2.watchers.splice(index, 1);
  7537. };
  7538. } }, { key: "add", value: function add(
  7539. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7540. var curMessages = this.messages[locale];
  7541. if (curMessages) {
  7542. if (override) {
  7543. Object.assign(curMessages, message);
  7544. } else
  7545. {
  7546. Object.keys(message).forEach(function (key) {
  7547. if (!hasOwn(curMessages, key)) {
  7548. curMessages[key] = message[key];
  7549. }
  7550. });
  7551. }
  7552. } else
  7553. {
  7554. this.messages[locale] = message;
  7555. }
  7556. } }, { key: "f", value: function f(
  7557. message, values, delimiters) {
  7558. return this.formater.interpolate(message, values, delimiters).join('');
  7559. } }, { key: "t", value: function t(
  7560. key, locale, values) {
  7561. var message = this.message;
  7562. if (typeof locale === 'string') {
  7563. locale = normalizeLocale(locale, this.messages);
  7564. locale && (message = this.messages[locale]);
  7565. } else
  7566. {
  7567. values = locale;
  7568. }
  7569. if (!hasOwn(message, key)) {
  7570. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7571. return key;
  7572. }
  7573. return this.formater.interpolate(message[key], values).join('');
  7574. } }]);return I18n;}();exports.I18n = I18n;
  7575. function watchAppLocale(appVm, i18n) {
  7576. // 需要保证 watch 的触发在组件渲染之前
  7577. if (appVm.$watchLocale) {
  7578. // vue2
  7579. appVm.$watchLocale(function (newLocale) {
  7580. i18n.setLocale(newLocale);
  7581. });
  7582. } else
  7583. {
  7584. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7585. i18n.setLocale(newLocale);
  7586. });
  7587. }
  7588. }
  7589. function getDefaultLocale() {
  7590. if (typeof uni !== 'undefined' && uni.getLocale) {
  7591. return uni.getLocale();
  7592. }
  7593. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  7594. if (typeof global !== 'undefined' && global.getLocale) {
  7595. return global.getLocale();
  7596. }
  7597. return LOCALE_EN;
  7598. }
  7599. 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;
  7600. // 兼容旧版本入参
  7601. if (typeof locale !== 'string') {var _ref4 =
  7602. [
  7603. messages,
  7604. locale];locale = _ref4[0];messages = _ref4[1];
  7605. }
  7606. if (typeof locale !== 'string') {
  7607. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  7608. locale = getDefaultLocale();
  7609. }
  7610. if (typeof fallbackLocale !== 'string') {
  7611. fallbackLocale =
  7612. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7613. LOCALE_EN;
  7614. }
  7615. var i18n = new I18n({
  7616. locale: locale,
  7617. fallbackLocale: fallbackLocale,
  7618. messages: messages,
  7619. watcher: watcher });
  7620. var _t = function t(key, values) {
  7621. if (typeof getApp !== 'function') {
  7622. // app view
  7623. /* eslint-disable no-func-assign */
  7624. _t = function t(key, values) {
  7625. return i18n.t(key, values);
  7626. };
  7627. } else
  7628. {
  7629. var isWatchedAppLocale = false;
  7630. _t = function t(key, values) {
  7631. var appVm = getApp().$vm;
  7632. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  7633. // options: {
  7634. // type: Array,
  7635. // default () {
  7636. // return [{
  7637. // icon: 'shop',
  7638. // text: t("uni-goods-nav.options.shop"),
  7639. // }, {
  7640. // icon: 'cart',
  7641. // text: t("uni-goods-nav.options.cart")
  7642. // }]
  7643. // }
  7644. // },
  7645. if (appVm) {
  7646. // 触发响应式
  7647. appVm.$locale;
  7648. if (!isWatchedAppLocale) {
  7649. isWatchedAppLocale = true;
  7650. watchAppLocale(appVm, i18n);
  7651. }
  7652. }
  7653. return i18n.t(key, values);
  7654. };
  7655. }
  7656. return _t(key, values);
  7657. };
  7658. return {
  7659. i18n: i18n,
  7660. f: function f(message, values, delimiters) {
  7661. return i18n.f(message, values, delimiters);
  7662. },
  7663. t: function t(key, values) {
  7664. return _t(key, values);
  7665. },
  7666. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7667. return i18n.add(locale, message, override);
  7668. },
  7669. watch: function watch(fn) {
  7670. return i18n.watchLocale(fn);
  7671. },
  7672. getLocale: function getLocale() {
  7673. return i18n.getLocale();
  7674. },
  7675. setLocale: function setLocale(newLocale) {
  7676. return i18n.setLocale(newLocale);
  7677. } };
  7678. }
  7679. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7680. var formater;
  7681. function hasI18nJson(jsonObj, delimiters) {
  7682. if (!formater) {
  7683. formater = new BaseFormatter();
  7684. }
  7685. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7686. var value = jsonObj[key];
  7687. if (isString(value)) {
  7688. if (isI18nStr(value, delimiters)) {
  7689. return true;
  7690. }
  7691. } else
  7692. {
  7693. return hasI18nJson(value, delimiters);
  7694. }
  7695. });
  7696. }
  7697. function parseI18nJson(jsonObj, values, delimiters) {
  7698. if (!formater) {
  7699. formater = new BaseFormatter();
  7700. }
  7701. walkJsonObj(jsonObj, function (jsonObj, key) {
  7702. var value = jsonObj[key];
  7703. if (isString(value)) {
  7704. if (isI18nStr(value, delimiters)) {
  7705. jsonObj[key] = compileStr(value, values, delimiters);
  7706. }
  7707. } else
  7708. {
  7709. parseI18nJson(value, values, delimiters);
  7710. }
  7711. });
  7712. return jsonObj;
  7713. }
  7714. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7715. if (!isI18nStr(jsonStr, delimiters)) {
  7716. return jsonStr;
  7717. }
  7718. if (!formater) {
  7719. formater = new BaseFormatter();
  7720. }
  7721. var localeValues = [];
  7722. Object.keys(locales).forEach(function (name) {
  7723. if (name !== locale) {
  7724. localeValues.push({
  7725. locale: name,
  7726. values: locales[name] });
  7727. }
  7728. });
  7729. localeValues.unshift({ locale: locale, values: locales[locale] });
  7730. try {
  7731. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7732. }
  7733. catch (e) {}
  7734. return jsonStr;
  7735. }
  7736. function isI18nStr(value, delimiters) {
  7737. return value.indexOf(delimiters[0]) > -1;
  7738. }
  7739. function compileStr(value, values, delimiters) {
  7740. return formater.interpolate(value, values, delimiters).join('');
  7741. }
  7742. function compileValue(jsonObj, key, localeValues, delimiters) {
  7743. var value = jsonObj[key];
  7744. if (isString(value)) {
  7745. // 存在国际化
  7746. if (isI18nStr(value, delimiters)) {
  7747. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7748. if (localeValues.length > 1) {
  7749. // 格式化国际化语言
  7750. var valueLocales = jsonObj[key + 'Locales'] = {};
  7751. localeValues.forEach(function (localValue) {
  7752. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7753. });
  7754. }
  7755. }
  7756. } else
  7757. {
  7758. compileJsonObj(value, localeValues, delimiters);
  7759. }
  7760. }
  7761. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7762. walkJsonObj(jsonObj, function (jsonObj, key) {
  7763. compileValue(jsonObj, key, localeValues, delimiters);
  7764. });
  7765. return jsonObj;
  7766. }
  7767. function walkJsonObj(jsonObj, walk) {
  7768. if (isArray(jsonObj)) {
  7769. for (var i = 0; i < jsonObj.length; i++) {
  7770. if (walk(jsonObj, i)) {
  7771. return true;
  7772. }
  7773. }
  7774. } else
  7775. if (isObject(jsonObj)) {
  7776. for (var key in jsonObj) {
  7777. if (walk(jsonObj, key)) {
  7778. return true;
  7779. }
  7780. }
  7781. }
  7782. return false;
  7783. }
  7784. function resolveLocale(locales) {
  7785. return function (locale) {
  7786. if (!locale) {
  7787. return locale;
  7788. }
  7789. locale = normalizeLocale(locale) || locale;
  7790. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  7791. };
  7792. }
  7793. function resolveLocaleChain(locale) {
  7794. var chain = [];
  7795. var tokens = locale.split('-');
  7796. while (tokens.length) {
  7797. chain.push(tokens.join('-'));
  7798. tokens.pop();
  7799. }
  7800. return chain;
  7801. }
  7802. /* 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)))
  7803. /***/ }),
  7804. /***/ 30:
  7805. /*!***********************************************************************!*\
  7806. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  7807. \***********************************************************************/
  7808. /*! no static exports found */
  7809. /***/ (function(module, exports, __webpack_require__) {
  7810. "use strict";
  7811. 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 };}
  7812. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  7813. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  7814. value = String(value);
  7815. // 用uView内置验证规则中的number判断是否为数值
  7816. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  7817. }
  7818. /***/ }),
  7819. /***/ 31:
  7820. /*!**********************************************************************!*\
  7821. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  7822. \**********************************************************************/
  7823. /*! no static exports found */
  7824. /***/ (function(module, exports, __webpack_require__) {
  7825. "use strict";
  7826. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  7827. if (min >= 0 && max > 0 && max >= min) {
  7828. var gab = max - min + 1;
  7829. return Math.floor(Math.random() * gab + min);
  7830. } else {
  7831. return 0;
  7832. }
  7833. }var _default =
  7834. random;exports.default = _default;
  7835. /***/ }),
  7836. /***/ 32:
  7837. /*!********************************************************************!*\
  7838. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  7839. \********************************************************************/
  7840. /*! no static exports found */
  7841. /***/ (function(module, exports, __webpack_require__) {
  7842. "use strict";
  7843. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  7844. if (pos == 'both') {
  7845. return str.replace(/^\s+|\s+$/g, "");
  7846. } else if (pos == "left") {
  7847. return str.replace(/^\s*/, '');
  7848. } else if (pos == 'right') {
  7849. return str.replace(/(\s*$)/g, "");
  7850. } else if (pos == 'all') {
  7851. return str.replace(/\s+/g, "");
  7852. } else {
  7853. return str;
  7854. }
  7855. }var _default =
  7856. trim;exports.default = _default;
  7857. /***/ }),
  7858. /***/ 33:
  7859. /*!*********************************************************************!*\
  7860. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  7861. \*********************************************************************/
  7862. /*! no static exports found */
  7863. /***/ (function(module, exports, __webpack_require__) {
  7864. "use strict";
  7865. /* 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;
  7866. uni.showToast({
  7867. title: title,
  7868. icon: 'none',
  7869. duration: duration });
  7870. }var _default =
  7871. toast;exports.default = _default;
  7872. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7873. /***/ }),
  7874. /***/ 34:
  7875. /*!*************************************************************************!*\
  7876. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  7877. \*************************************************************************/
  7878. /*! no static exports found */
  7879. /***/ (function(module, exports, __webpack_require__) {
  7880. "use strict";
  7881. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  7882. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  7883. function getParent(name, keys) {
  7884. var parent = this.$parent;
  7885. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  7886. while (parent) {
  7887. // 父组件
  7888. if (parent.$options.name !== name) {
  7889. // 如果组件的name不相等,继续上一级寻找
  7890. parent = parent.$parent;
  7891. } else {var _ret = function () {
  7892. var data = {};
  7893. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  7894. if (Array.isArray(keys)) {
  7895. keys.map(function (val) {
  7896. data[val] = parent[val] ? parent[val] : '';
  7897. });
  7898. } else {
  7899. // 历遍传过来的对象参数
  7900. for (var i in keys) {
  7901. // 如果子组件有此值则用,无此值则用父组件的值
  7902. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  7903. if (Array.isArray(keys[i])) {
  7904. if (keys[i].length) {
  7905. data[i] = keys[i];
  7906. } else {
  7907. data[i] = parent[i];
  7908. }
  7909. } else if (keys[i].constructor === Object) {
  7910. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  7911. if (Object.keys(keys[i]).length) {
  7912. data[i] = keys[i];
  7913. } else {
  7914. data[i] = parent[i];
  7915. }
  7916. } else {
  7917. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  7918. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  7919. }
  7920. }
  7921. }
  7922. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  7923. }
  7924. }
  7925. return {};
  7926. }
  7927. /***/ }),
  7928. /***/ 35:
  7929. /*!***********************************************************************!*\
  7930. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  7931. \***********************************************************************/
  7932. /*! no static exports found */
  7933. /***/ (function(module, exports, __webpack_require__) {
  7934. "use strict";
  7935. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  7936. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  7937. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  7938. // 值(默认为undefined),就是查找最顶层的$parent
  7939. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7940. var parent = this.$parent;
  7941. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  7942. while (parent) {
  7943. // 父组件
  7944. if (parent.$options && parent.$options.name !== name) {
  7945. // 如果组件的name不相等,继续上一级寻找
  7946. parent = parent.$parent;
  7947. } else {
  7948. return parent;
  7949. }
  7950. }
  7951. return false;
  7952. }
  7953. /***/ }),
  7954. /***/ 36:
  7955. /*!*******************************************************************!*\
  7956. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  7957. \*******************************************************************/
  7958. /*! no static exports found */
  7959. /***/ (function(module, exports, __webpack_require__) {
  7960. "use strict";
  7961. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  7962. return uni.getSystemInfoSync().platform;
  7963. };
  7964. function sys() {
  7965. return uni.getSystemInfoSync();
  7966. }
  7967. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7968. /***/ }),
  7969. /***/ 37:
  7970. /*!************************************************************************!*\
  7971. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  7972. \************************************************************************/
  7973. /*! no static exports found */
  7974. /***/ (function(module, exports, __webpack_require__) {
  7975. "use strict";
  7976. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  7977. /**
  7978. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  7979. *
  7980. * @param {Function} func 要执行的回调函数
  7981. * @param {Number} wait 延时的时间
  7982. * @param {Boolean} immediate 是否立即执行
  7983. * @return null
  7984. */
  7985. 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;
  7986. // 清除定时器
  7987. if (timeout !== null) clearTimeout(timeout);
  7988. // 立即执行,此类情况一般用不到
  7989. if (immediate) {
  7990. var callNow = !timeout;
  7991. timeout = setTimeout(function () {
  7992. timeout = null;
  7993. }, wait);
  7994. if (callNow) typeof func === 'function' && func();
  7995. } else {
  7996. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  7997. timeout = setTimeout(function () {
  7998. typeof func === 'function' && func();
  7999. }, wait);
  8000. }
  8001. }var _default =
  8002. debounce;exports.default = _default;
  8003. /***/ }),
  8004. /***/ 38:
  8005. /*!************************************************************************!*\
  8006. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  8007. \************************************************************************/
  8008. /*! no static exports found */
  8009. /***/ (function(module, exports, __webpack_require__) {
  8010. "use strict";
  8011. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  8012. var flagArr = [];
  8013. /**
  8014. * 节流函数
  8015. * 节流原理:在一定时间内,只能触发一次
  8016. * @param {Function} fn 要执行的回调函数
  8017. * @param {Number} time 延时的时间
  8018. * @param {Boolean} isImmediate 是否立即执行
  8019. * @param {String} timeoutName 定时器ID
  8020. * @return null
  8021. */
  8022. 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";
  8023. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  8024. if (isImmediate) {
  8025. if (!flagArr[timeoutName]) {
  8026. flagArr[timeoutName] = true;
  8027. // 如果是立即执行,则在time毫秒内开始时执行
  8028. if (typeof fn === 'function') fn();
  8029. timeoutArr[timeoutName] = setTimeout(function () {
  8030. flagArr[timeoutName] = false;
  8031. }, time);
  8032. }
  8033. } else {
  8034. if (!flagArr[timeoutName]) {
  8035. flagArr[timeoutName] = true;
  8036. // 如果是非立即执行,则在time毫秒内的结束处执行
  8037. timeoutArr[timeoutName] = setTimeout(function () {
  8038. flagArr[timeoutName] = false;
  8039. if (typeof fn === 'function') fn();
  8040. }, time);
  8041. }
  8042. }
  8043. };var _default =
  8044. throttle;exports.default = _default;
  8045. /***/ }),
  8046. /***/ 39:
  8047. /*!********************************************************************!*\
  8048. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  8049. \********************************************************************/
  8050. /*! no static exports found */
  8051. /***/ (function(module, exports, __webpack_require__) {
  8052. "use strict";
  8053. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  8054. var version = '1.10.1';var _default =
  8055. {
  8056. v: version,
  8057. version: version,
  8058. // 主题名称
  8059. type: [
  8060. 'primary',
  8061. 'success',
  8062. 'info',
  8063. 'error',
  8064. 'warning'] };exports.default = _default;
  8065. /***/ }),
  8066. /***/ 4:
  8067. /*!******************************************************************************************!*\
  8068. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  8069. \******************************************************************************************/
  8070. /*! exports provided: default */
  8071. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8072. "use strict";
  8073. __webpack_require__.r(__webpack_exports__);
  8074. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8075. * Vue.js v2.6.11
  8076. * (c) 2014-2022 Evan You
  8077. * Released under the MIT License.
  8078. */
  8079. /* */
  8080. var emptyObject = Object.freeze({});
  8081. // These helpers produce better VM code in JS engines due to their
  8082. // explicitness and function inlining.
  8083. function isUndef (v) {
  8084. return v === undefined || v === null
  8085. }
  8086. function isDef (v) {
  8087. return v !== undefined && v !== null
  8088. }
  8089. function isTrue (v) {
  8090. return v === true
  8091. }
  8092. function isFalse (v) {
  8093. return v === false
  8094. }
  8095. /**
  8096. * Check if value is primitive.
  8097. */
  8098. function isPrimitive (value) {
  8099. return (
  8100. typeof value === 'string' ||
  8101. typeof value === 'number' ||
  8102. // $flow-disable-line
  8103. typeof value === 'symbol' ||
  8104. typeof value === 'boolean'
  8105. )
  8106. }
  8107. /**
  8108. * Quick object check - this is primarily used to tell
  8109. * Objects from primitive values when we know the value
  8110. * is a JSON-compliant type.
  8111. */
  8112. function isObject (obj) {
  8113. return obj !== null && typeof obj === 'object'
  8114. }
  8115. /**
  8116. * Get the raw type string of a value, e.g., [object Object].
  8117. */
  8118. var _toString = Object.prototype.toString;
  8119. function toRawType (value) {
  8120. return _toString.call(value).slice(8, -1)
  8121. }
  8122. /**
  8123. * Strict object type check. Only returns true
  8124. * for plain JavaScript objects.
  8125. */
  8126. function isPlainObject (obj) {
  8127. return _toString.call(obj) === '[object Object]'
  8128. }
  8129. function isRegExp (v) {
  8130. return _toString.call(v) === '[object RegExp]'
  8131. }
  8132. /**
  8133. * Check if val is a valid array index.
  8134. */
  8135. function isValidArrayIndex (val) {
  8136. var n = parseFloat(String(val));
  8137. return n >= 0 && Math.floor(n) === n && isFinite(val)
  8138. }
  8139. function isPromise (val) {
  8140. return (
  8141. isDef(val) &&
  8142. typeof val.then === 'function' &&
  8143. typeof val.catch === 'function'
  8144. )
  8145. }
  8146. /**
  8147. * Convert a value to a string that is actually rendered.
  8148. */
  8149. function toString (val) {
  8150. return val == null
  8151. ? ''
  8152. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  8153. ? JSON.stringify(val, null, 2)
  8154. : String(val)
  8155. }
  8156. /**
  8157. * Convert an input value to a number for persistence.
  8158. * If the conversion fails, return original string.
  8159. */
  8160. function toNumber (val) {
  8161. var n = parseFloat(val);
  8162. return isNaN(n) ? val : n
  8163. }
  8164. /**
  8165. * Make a map and return a function for checking if a key
  8166. * is in that map.
  8167. */
  8168. function makeMap (
  8169. str,
  8170. expectsLowerCase
  8171. ) {
  8172. var map = Object.create(null);
  8173. var list = str.split(',');
  8174. for (var i = 0; i < list.length; i++) {
  8175. map[list[i]] = true;
  8176. }
  8177. return expectsLowerCase
  8178. ? function (val) { return map[val.toLowerCase()]; }
  8179. : function (val) { return map[val]; }
  8180. }
  8181. /**
  8182. * Check if a tag is a built-in tag.
  8183. */
  8184. var isBuiltInTag = makeMap('slot,component', true);
  8185. /**
  8186. * Check if an attribute is a reserved attribute.
  8187. */
  8188. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  8189. /**
  8190. * Remove an item from an array.
  8191. */
  8192. function remove (arr, item) {
  8193. if (arr.length) {
  8194. var index = arr.indexOf(item);
  8195. if (index > -1) {
  8196. return arr.splice(index, 1)
  8197. }
  8198. }
  8199. }
  8200. /**
  8201. * Check whether an object has the property.
  8202. */
  8203. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8204. function hasOwn (obj, key) {
  8205. return hasOwnProperty.call(obj, key)
  8206. }
  8207. /**
  8208. * Create a cached version of a pure function.
  8209. */
  8210. function cached (fn) {
  8211. var cache = Object.create(null);
  8212. return (function cachedFn (str) {
  8213. var hit = cache[str];
  8214. return hit || (cache[str] = fn(str))
  8215. })
  8216. }
  8217. /**
  8218. * Camelize a hyphen-delimited string.
  8219. */
  8220. var camelizeRE = /-(\w)/g;
  8221. var camelize = cached(function (str) {
  8222. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  8223. });
  8224. /**
  8225. * Capitalize a string.
  8226. */
  8227. var capitalize = cached(function (str) {
  8228. return str.charAt(0).toUpperCase() + str.slice(1)
  8229. });
  8230. /**
  8231. * Hyphenate a camelCase string.
  8232. */
  8233. var hyphenateRE = /\B([A-Z])/g;
  8234. var hyphenate = cached(function (str) {
  8235. return str.replace(hyphenateRE, '-$1').toLowerCase()
  8236. });
  8237. /**
  8238. * Simple bind polyfill for environments that do not support it,
  8239. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  8240. * since native bind is now performant enough in most browsers.
  8241. * But removing it would mean breaking code that was able to run in
  8242. * PhantomJS 1.x, so this must be kept for backward compatibility.
  8243. */
  8244. /* istanbul ignore next */
  8245. function polyfillBind (fn, ctx) {
  8246. function boundFn (a) {
  8247. var l = arguments.length;
  8248. return l
  8249. ? l > 1
  8250. ? fn.apply(ctx, arguments)
  8251. : fn.call(ctx, a)
  8252. : fn.call(ctx)
  8253. }
  8254. boundFn._length = fn.length;
  8255. return boundFn
  8256. }
  8257. function nativeBind (fn, ctx) {
  8258. return fn.bind(ctx)
  8259. }
  8260. var bind = Function.prototype.bind
  8261. ? nativeBind
  8262. : polyfillBind;
  8263. /**
  8264. * Convert an Array-like object to a real Array.
  8265. */
  8266. function toArray (list, start) {
  8267. start = start || 0;
  8268. var i = list.length - start;
  8269. var ret = new Array(i);
  8270. while (i--) {
  8271. ret[i] = list[i + start];
  8272. }
  8273. return ret
  8274. }
  8275. /**
  8276. * Mix properties into target object.
  8277. */
  8278. function extend (to, _from) {
  8279. for (var key in _from) {
  8280. to[key] = _from[key];
  8281. }
  8282. return to
  8283. }
  8284. /**
  8285. * Merge an Array of Objects into a single Object.
  8286. */
  8287. function toObject (arr) {
  8288. var res = {};
  8289. for (var i = 0; i < arr.length; i++) {
  8290. if (arr[i]) {
  8291. extend(res, arr[i]);
  8292. }
  8293. }
  8294. return res
  8295. }
  8296. /* eslint-disable no-unused-vars */
  8297. /**
  8298. * Perform no operation.
  8299. * Stubbing args to make Flow happy without leaving useless transpiled code
  8300. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  8301. */
  8302. function noop (a, b, c) {}
  8303. /**
  8304. * Always return false.
  8305. */
  8306. var no = function (a, b, c) { return false; };
  8307. /* eslint-enable no-unused-vars */
  8308. /**
  8309. * Return the same value.
  8310. */
  8311. var identity = function (_) { return _; };
  8312. /**
  8313. * Check if two values are loosely equal - that is,
  8314. * if they are plain objects, do they have the same shape?
  8315. */
  8316. function looseEqual (a, b) {
  8317. if (a === b) { return true }
  8318. var isObjectA = isObject(a);
  8319. var isObjectB = isObject(b);
  8320. if (isObjectA && isObjectB) {
  8321. try {
  8322. var isArrayA = Array.isArray(a);
  8323. var isArrayB = Array.isArray(b);
  8324. if (isArrayA && isArrayB) {
  8325. return a.length === b.length && a.every(function (e, i) {
  8326. return looseEqual(e, b[i])
  8327. })
  8328. } else if (a instanceof Date && b instanceof Date) {
  8329. return a.getTime() === b.getTime()
  8330. } else if (!isArrayA && !isArrayB) {
  8331. var keysA = Object.keys(a);
  8332. var keysB = Object.keys(b);
  8333. return keysA.length === keysB.length && keysA.every(function (key) {
  8334. return looseEqual(a[key], b[key])
  8335. })
  8336. } else {
  8337. /* istanbul ignore next */
  8338. return false
  8339. }
  8340. } catch (e) {
  8341. /* istanbul ignore next */
  8342. return false
  8343. }
  8344. } else if (!isObjectA && !isObjectB) {
  8345. return String(a) === String(b)
  8346. } else {
  8347. return false
  8348. }
  8349. }
  8350. /**
  8351. * Return the first index at which a loosely equal value can be
  8352. * found in the array (if value is a plain object, the array must
  8353. * contain an object of the same shape), or -1 if it is not present.
  8354. */
  8355. function looseIndexOf (arr, val) {
  8356. for (var i = 0; i < arr.length; i++) {
  8357. if (looseEqual(arr[i], val)) { return i }
  8358. }
  8359. return -1
  8360. }
  8361. /**
  8362. * Ensure a function is called only once.
  8363. */
  8364. function once (fn) {
  8365. var called = false;
  8366. return function () {
  8367. if (!called) {
  8368. called = true;
  8369. fn.apply(this, arguments);
  8370. }
  8371. }
  8372. }
  8373. var ASSET_TYPES = [
  8374. 'component',
  8375. 'directive',
  8376. 'filter'
  8377. ];
  8378. var LIFECYCLE_HOOKS = [
  8379. 'beforeCreate',
  8380. 'created',
  8381. 'beforeMount',
  8382. 'mounted',
  8383. 'beforeUpdate',
  8384. 'updated',
  8385. 'beforeDestroy',
  8386. 'destroyed',
  8387. 'activated',
  8388. 'deactivated',
  8389. 'errorCaptured',
  8390. 'serverPrefetch'
  8391. ];
  8392. /* */
  8393. var config = ({
  8394. /**
  8395. * Option merge strategies (used in core/util/options)
  8396. */
  8397. // $flow-disable-line
  8398. optionMergeStrategies: Object.create(null),
  8399. /**
  8400. * Whether to suppress warnings.
  8401. */
  8402. silent: false,
  8403. /**
  8404. * Show production mode tip message on boot?
  8405. */
  8406. productionTip: "development" !== 'production',
  8407. /**
  8408. * Whether to enable devtools
  8409. */
  8410. devtools: "development" !== 'production',
  8411. /**
  8412. * Whether to record perf
  8413. */
  8414. performance: false,
  8415. /**
  8416. * Error handler for watcher errors
  8417. */
  8418. errorHandler: null,
  8419. /**
  8420. * Warn handler for watcher warns
  8421. */
  8422. warnHandler: null,
  8423. /**
  8424. * Ignore certain custom elements
  8425. */
  8426. ignoredElements: [],
  8427. /**
  8428. * Custom user key aliases for v-on
  8429. */
  8430. // $flow-disable-line
  8431. keyCodes: Object.create(null),
  8432. /**
  8433. * Check if a tag is reserved so that it cannot be registered as a
  8434. * component. This is platform-dependent and may be overwritten.
  8435. */
  8436. isReservedTag: no,
  8437. /**
  8438. * Check if an attribute is reserved so that it cannot be used as a component
  8439. * prop. This is platform-dependent and may be overwritten.
  8440. */
  8441. isReservedAttr: no,
  8442. /**
  8443. * Check if a tag is an unknown element.
  8444. * Platform-dependent.
  8445. */
  8446. isUnknownElement: no,
  8447. /**
  8448. * Get the namespace of an element
  8449. */
  8450. getTagNamespace: noop,
  8451. /**
  8452. * Parse the real tag name for the specific platform.
  8453. */
  8454. parsePlatformTagName: identity,
  8455. /**
  8456. * Check if an attribute must be bound using property, e.g. value
  8457. * Platform-dependent.
  8458. */
  8459. mustUseProp: no,
  8460. /**
  8461. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  8462. * This will significantly reduce performance if set to false.
  8463. */
  8464. async: true,
  8465. /**
  8466. * Exposed for legacy reasons
  8467. */
  8468. _lifecycleHooks: LIFECYCLE_HOOKS
  8469. });
  8470. /* */
  8471. /**
  8472. * unicode letters used for parsing html tags, component names and property paths.
  8473. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  8474. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  8475. */
  8476. 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/;
  8477. /**
  8478. * Check if a string starts with $ or _
  8479. */
  8480. function isReserved (str) {
  8481. var c = (str + '').charCodeAt(0);
  8482. return c === 0x24 || c === 0x5F
  8483. }
  8484. /**
  8485. * Define a property.
  8486. */
  8487. function def (obj, key, val, enumerable) {
  8488. Object.defineProperty(obj, key, {
  8489. value: val,
  8490. enumerable: !!enumerable,
  8491. writable: true,
  8492. configurable: true
  8493. });
  8494. }
  8495. /**
  8496. * Parse simple path.
  8497. */
  8498. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  8499. function parsePath (path) {
  8500. if (bailRE.test(path)) {
  8501. return
  8502. }
  8503. var segments = path.split('.');
  8504. return function (obj) {
  8505. for (var i = 0; i < segments.length; i++) {
  8506. if (!obj) { return }
  8507. obj = obj[segments[i]];
  8508. }
  8509. return obj
  8510. }
  8511. }
  8512. /* */
  8513. // can we use __proto__?
  8514. var hasProto = '__proto__' in {};
  8515. // Browser environment sniffing
  8516. var inBrowser = typeof window !== 'undefined';
  8517. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  8518. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  8519. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  8520. var isIE = UA && /msie|trident/.test(UA);
  8521. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  8522. var isEdge = UA && UA.indexOf('edge/') > 0;
  8523. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  8524. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  8525. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  8526. var isPhantomJS = UA && /phantomjs/.test(UA);
  8527. var isFF = UA && UA.match(/firefox\/(\d+)/);
  8528. // Firefox has a "watch" function on Object.prototype...
  8529. var nativeWatch = ({}).watch;
  8530. if (inBrowser) {
  8531. try {
  8532. var opts = {};
  8533. Object.defineProperty(opts, 'passive', ({
  8534. get: function get () {
  8535. }
  8536. })); // https://github.com/facebook/flow/issues/285
  8537. window.addEventListener('test-passive', null, opts);
  8538. } catch (e) {}
  8539. }
  8540. // this needs to be lazy-evaled because vue may be required before
  8541. // vue-server-renderer can set VUE_ENV
  8542. var _isServer;
  8543. var isServerRendering = function () {
  8544. if (_isServer === undefined) {
  8545. /* istanbul ignore if */
  8546. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  8547. // detect presence of vue-server-renderer and avoid
  8548. // Webpack shimming the process
  8549. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  8550. } else {
  8551. _isServer = false;
  8552. }
  8553. }
  8554. return _isServer
  8555. };
  8556. // detect devtools
  8557. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8558. /* istanbul ignore next */
  8559. function isNative (Ctor) {
  8560. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  8561. }
  8562. var hasSymbol =
  8563. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  8564. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  8565. var _Set;
  8566. /* istanbul ignore if */ // $flow-disable-line
  8567. if (typeof Set !== 'undefined' && isNative(Set)) {
  8568. // use native Set when available.
  8569. _Set = Set;
  8570. } else {
  8571. // a non-standard Set polyfill that only works with primitive keys.
  8572. _Set = /*@__PURE__*/(function () {
  8573. function Set () {
  8574. this.set = Object.create(null);
  8575. }
  8576. Set.prototype.has = function has (key) {
  8577. return this.set[key] === true
  8578. };
  8579. Set.prototype.add = function add (key) {
  8580. this.set[key] = true;
  8581. };
  8582. Set.prototype.clear = function clear () {
  8583. this.set = Object.create(null);
  8584. };
  8585. return Set;
  8586. }());
  8587. }
  8588. /* */
  8589. var warn = noop;
  8590. var tip = noop;
  8591. var generateComponentTrace = (noop); // work around flow check
  8592. var formatComponentName = (noop);
  8593. if (true) {
  8594. var hasConsole = typeof console !== 'undefined';
  8595. var classifyRE = /(?:^|[-_])(\w)/g;
  8596. var classify = function (str) { return str
  8597. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  8598. .replace(/[-_]/g, ''); };
  8599. warn = function (msg, vm) {
  8600. var trace = vm ? generateComponentTrace(vm) : '';
  8601. if (config.warnHandler) {
  8602. config.warnHandler.call(null, msg, vm, trace);
  8603. } else if (hasConsole && (!config.silent)) {
  8604. console.error(("[Vue warn]: " + msg + trace));
  8605. }
  8606. };
  8607. tip = function (msg, vm) {
  8608. if (hasConsole && (!config.silent)) {
  8609. console.warn("[Vue tip]: " + msg + (
  8610. vm ? generateComponentTrace(vm) : ''
  8611. ));
  8612. }
  8613. };
  8614. formatComponentName = function (vm, includeFile) {
  8615. if (vm.$root === vm) {
  8616. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  8617. return ('') + vm.$options.__file
  8618. }
  8619. return '<Root>'
  8620. }
  8621. var options = typeof vm === 'function' && vm.cid != null
  8622. ? vm.options
  8623. : vm._isVue
  8624. ? vm.$options || vm.constructor.options
  8625. : vm;
  8626. var name = options.name || options._componentTag;
  8627. var file = options.__file;
  8628. if (!name && file) {
  8629. var match = file.match(/([^/\\]+)\.vue$/);
  8630. name = match && match[1];
  8631. }
  8632. return (
  8633. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  8634. (file && includeFile !== false ? (" at " + file) : '')
  8635. )
  8636. };
  8637. var repeat = function (str, n) {
  8638. var res = '';
  8639. while (n) {
  8640. if (n % 2 === 1) { res += str; }
  8641. if (n > 1) { str += str; }
  8642. n >>= 1;
  8643. }
  8644. return res
  8645. };
  8646. generateComponentTrace = function (vm) {
  8647. if (vm._isVue && vm.$parent) {
  8648. var tree = [];
  8649. var currentRecursiveSequence = 0;
  8650. while (vm && vm.$options.name !== 'PageBody') {
  8651. if (tree.length > 0) {
  8652. var last = tree[tree.length - 1];
  8653. if (last.constructor === vm.constructor) {
  8654. currentRecursiveSequence++;
  8655. vm = vm.$parent;
  8656. continue
  8657. } else if (currentRecursiveSequence > 0) {
  8658. tree[tree.length - 1] = [last, currentRecursiveSequence];
  8659. currentRecursiveSequence = 0;
  8660. }
  8661. }
  8662. !vm.$options.isReserved && tree.push(vm);
  8663. vm = vm.$parent;
  8664. }
  8665. return '\n\nfound in\n\n' + tree
  8666. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  8667. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  8668. : formatComponentName(vm))); })
  8669. .join('\n')
  8670. } else {
  8671. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  8672. }
  8673. };
  8674. }
  8675. /* */
  8676. var uid = 0;
  8677. /**
  8678. * A dep is an observable that can have multiple
  8679. * directives subscribing to it.
  8680. */
  8681. var Dep = function Dep () {
  8682. this.id = uid++;
  8683. this.subs = [];
  8684. };
  8685. Dep.prototype.addSub = function addSub (sub) {
  8686. this.subs.push(sub);
  8687. };
  8688. Dep.prototype.removeSub = function removeSub (sub) {
  8689. remove(this.subs, sub);
  8690. };
  8691. Dep.prototype.depend = function depend () {
  8692. if (Dep.SharedObject.target) {
  8693. Dep.SharedObject.target.addDep(this);
  8694. }
  8695. };
  8696. Dep.prototype.notify = function notify () {
  8697. // stabilize the subscriber list first
  8698. var subs = this.subs.slice();
  8699. if ( true && !config.async) {
  8700. // subs aren't sorted in scheduler if not running async
  8701. // we need to sort them now to make sure they fire in correct
  8702. // order
  8703. subs.sort(function (a, b) { return a.id - b.id; });
  8704. }
  8705. for (var i = 0, l = subs.length; i < l; i++) {
  8706. subs[i].update();
  8707. }
  8708. };
  8709. // The current target watcher being evaluated.
  8710. // This is globally unique because only one watcher
  8711. // can be evaluated at a time.
  8712. // fixed by xxxxxx (nvue shared vuex)
  8713. /* eslint-disable no-undef */
  8714. Dep.SharedObject = {};
  8715. Dep.SharedObject.target = null;
  8716. Dep.SharedObject.targetStack = [];
  8717. function pushTarget (target) {
  8718. Dep.SharedObject.targetStack.push(target);
  8719. Dep.SharedObject.target = target;
  8720. Dep.target = target;
  8721. }
  8722. function popTarget () {
  8723. Dep.SharedObject.targetStack.pop();
  8724. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  8725. Dep.target = Dep.SharedObject.target;
  8726. }
  8727. /* */
  8728. var VNode = function VNode (
  8729. tag,
  8730. data,
  8731. children,
  8732. text,
  8733. elm,
  8734. context,
  8735. componentOptions,
  8736. asyncFactory
  8737. ) {
  8738. this.tag = tag;
  8739. this.data = data;
  8740. this.children = children;
  8741. this.text = text;
  8742. this.elm = elm;
  8743. this.ns = undefined;
  8744. this.context = context;
  8745. this.fnContext = undefined;
  8746. this.fnOptions = undefined;
  8747. this.fnScopeId = undefined;
  8748. this.key = data && data.key;
  8749. this.componentOptions = componentOptions;
  8750. this.componentInstance = undefined;
  8751. this.parent = undefined;
  8752. this.raw = false;
  8753. this.isStatic = false;
  8754. this.isRootInsert = true;
  8755. this.isComment = false;
  8756. this.isCloned = false;
  8757. this.isOnce = false;
  8758. this.asyncFactory = asyncFactory;
  8759. this.asyncMeta = undefined;
  8760. this.isAsyncPlaceholder = false;
  8761. };
  8762. var prototypeAccessors = { child: { configurable: true } };
  8763. // DEPRECATED: alias for componentInstance for backwards compat.
  8764. /* istanbul ignore next */
  8765. prototypeAccessors.child.get = function () {
  8766. return this.componentInstance
  8767. };
  8768. Object.defineProperties( VNode.prototype, prototypeAccessors );
  8769. var createEmptyVNode = function (text) {
  8770. if ( text === void 0 ) text = '';
  8771. var node = new VNode();
  8772. node.text = text;
  8773. node.isComment = true;
  8774. return node
  8775. };
  8776. function createTextVNode (val) {
  8777. return new VNode(undefined, undefined, undefined, String(val))
  8778. }
  8779. // optimized shallow clone
  8780. // used for static nodes and slot nodes because they may be reused across
  8781. // multiple renders, cloning them avoids errors when DOM manipulations rely
  8782. // on their elm reference.
  8783. function cloneVNode (vnode) {
  8784. var cloned = new VNode(
  8785. vnode.tag,
  8786. vnode.data,
  8787. // #7975
  8788. // clone children array to avoid mutating original in case of cloning
  8789. // a child.
  8790. vnode.children && vnode.children.slice(),
  8791. vnode.text,
  8792. vnode.elm,
  8793. vnode.context,
  8794. vnode.componentOptions,
  8795. vnode.asyncFactory
  8796. );
  8797. cloned.ns = vnode.ns;
  8798. cloned.isStatic = vnode.isStatic;
  8799. cloned.key = vnode.key;
  8800. cloned.isComment = vnode.isComment;
  8801. cloned.fnContext = vnode.fnContext;
  8802. cloned.fnOptions = vnode.fnOptions;
  8803. cloned.fnScopeId = vnode.fnScopeId;
  8804. cloned.asyncMeta = vnode.asyncMeta;
  8805. cloned.isCloned = true;
  8806. return cloned
  8807. }
  8808. /*
  8809. * not type checking this file because flow doesn't play well with
  8810. * dynamically accessing methods on Array prototype
  8811. */
  8812. var arrayProto = Array.prototype;
  8813. var arrayMethods = Object.create(arrayProto);
  8814. var methodsToPatch = [
  8815. 'push',
  8816. 'pop',
  8817. 'shift',
  8818. 'unshift',
  8819. 'splice',
  8820. 'sort',
  8821. 'reverse'
  8822. ];
  8823. /**
  8824. * Intercept mutating methods and emit events
  8825. */
  8826. methodsToPatch.forEach(function (method) {
  8827. // cache original method
  8828. var original = arrayProto[method];
  8829. def(arrayMethods, method, function mutator () {
  8830. var args = [], len = arguments.length;
  8831. while ( len-- ) args[ len ] = arguments[ len ];
  8832. var result = original.apply(this, args);
  8833. var ob = this.__ob__;
  8834. var inserted;
  8835. switch (method) {
  8836. case 'push':
  8837. case 'unshift':
  8838. inserted = args;
  8839. break
  8840. case 'splice':
  8841. inserted = args.slice(2);
  8842. break
  8843. }
  8844. if (inserted) { ob.observeArray(inserted); }
  8845. // notify change
  8846. ob.dep.notify();
  8847. return result
  8848. });
  8849. });
  8850. /* */
  8851. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  8852. /**
  8853. * In some cases we may want to disable observation inside a component's
  8854. * update computation.
  8855. */
  8856. var shouldObserve = true;
  8857. function toggleObserving (value) {
  8858. shouldObserve = value;
  8859. }
  8860. /**
  8861. * Observer class that is attached to each observed
  8862. * object. Once attached, the observer converts the target
  8863. * object's property keys into getter/setters that
  8864. * collect dependencies and dispatch updates.
  8865. */
  8866. var Observer = function Observer (value) {
  8867. this.value = value;
  8868. this.dep = new Dep();
  8869. this.vmCount = 0;
  8870. def(value, '__ob__', this);
  8871. if (Array.isArray(value)) {
  8872. if (hasProto) {
  8873. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  8874. if(value.push !== value.__proto__.push){
  8875. copyAugment(value, arrayMethods, arrayKeys);
  8876. } else {
  8877. protoAugment(value, arrayMethods);
  8878. }
  8879. }
  8880. } else {
  8881. copyAugment(value, arrayMethods, arrayKeys);
  8882. }
  8883. this.observeArray(value);
  8884. } else {
  8885. this.walk(value);
  8886. }
  8887. };
  8888. /**
  8889. * Walk through all properties and convert them into
  8890. * getter/setters. This method should only be called when
  8891. * value type is Object.
  8892. */
  8893. Observer.prototype.walk = function walk (obj) {
  8894. var keys = Object.keys(obj);
  8895. for (var i = 0; i < keys.length; i++) {
  8896. defineReactive$$1(obj, keys[i]);
  8897. }
  8898. };
  8899. /**
  8900. * Observe a list of Array items.
  8901. */
  8902. Observer.prototype.observeArray = function observeArray (items) {
  8903. for (var i = 0, l = items.length; i < l; i++) {
  8904. observe(items[i]);
  8905. }
  8906. };
  8907. // helpers
  8908. /**
  8909. * Augment a target Object or Array by intercepting
  8910. * the prototype chain using __proto__
  8911. */
  8912. function protoAugment (target, src) {
  8913. /* eslint-disable no-proto */
  8914. target.__proto__ = src;
  8915. /* eslint-enable no-proto */
  8916. }
  8917. /**
  8918. * Augment a target Object or Array by defining
  8919. * hidden properties.
  8920. */
  8921. /* istanbul ignore next */
  8922. function copyAugment (target, src, keys) {
  8923. for (var i = 0, l = keys.length; i < l; i++) {
  8924. var key = keys[i];
  8925. def(target, key, src[key]);
  8926. }
  8927. }
  8928. /**
  8929. * Attempt to create an observer instance for a value,
  8930. * returns the new observer if successfully observed,
  8931. * or the existing observer if the value already has one.
  8932. */
  8933. function observe (value, asRootData) {
  8934. if (!isObject(value) || value instanceof VNode) {
  8935. return
  8936. }
  8937. var ob;
  8938. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  8939. ob = value.__ob__;
  8940. } else if (
  8941. shouldObserve &&
  8942. !isServerRendering() &&
  8943. (Array.isArray(value) || isPlainObject(value)) &&
  8944. Object.isExtensible(value) &&
  8945. !value._isVue
  8946. ) {
  8947. ob = new Observer(value);
  8948. }
  8949. if (asRootData && ob) {
  8950. ob.vmCount++;
  8951. }
  8952. return ob
  8953. }
  8954. /**
  8955. * Define a reactive property on an Object.
  8956. */
  8957. function defineReactive$$1 (
  8958. obj,
  8959. key,
  8960. val,
  8961. customSetter,
  8962. shallow
  8963. ) {
  8964. var dep = new Dep();
  8965. var property = Object.getOwnPropertyDescriptor(obj, key);
  8966. if (property && property.configurable === false) {
  8967. return
  8968. }
  8969. // cater for pre-defined getter/setters
  8970. var getter = property && property.get;
  8971. var setter = property && property.set;
  8972. if ((!getter || setter) && arguments.length === 2) {
  8973. val = obj[key];
  8974. }
  8975. var childOb = !shallow && observe(val);
  8976. Object.defineProperty(obj, key, {
  8977. enumerable: true,
  8978. configurable: true,
  8979. get: function reactiveGetter () {
  8980. var value = getter ? getter.call(obj) : val;
  8981. if (Dep.SharedObject.target) { // fixed by xxxxxx
  8982. dep.depend();
  8983. if (childOb) {
  8984. childOb.dep.depend();
  8985. if (Array.isArray(value)) {
  8986. dependArray(value);
  8987. }
  8988. }
  8989. }
  8990. return value
  8991. },
  8992. set: function reactiveSetter (newVal) {
  8993. var value = getter ? getter.call(obj) : val;
  8994. /* eslint-disable no-self-compare */
  8995. if (newVal === value || (newVal !== newVal && value !== value)) {
  8996. return
  8997. }
  8998. /* eslint-enable no-self-compare */
  8999. if ( true && customSetter) {
  9000. customSetter();
  9001. }
  9002. // #7981: for accessor properties without setter
  9003. if (getter && !setter) { return }
  9004. if (setter) {
  9005. setter.call(obj, newVal);
  9006. } else {
  9007. val = newVal;
  9008. }
  9009. childOb = !shallow && observe(newVal);
  9010. dep.notify();
  9011. }
  9012. });
  9013. }
  9014. /**
  9015. * Set a property on an object. Adds the new property and
  9016. * triggers change notification if the property doesn't
  9017. * already exist.
  9018. */
  9019. function set (target, key, val) {
  9020. if ( true &&
  9021. (isUndef(target) || isPrimitive(target))
  9022. ) {
  9023. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  9024. }
  9025. if (Array.isArray(target) && isValidArrayIndex(key)) {
  9026. target.length = Math.max(target.length, key);
  9027. target.splice(key, 1, val);
  9028. return val
  9029. }
  9030. if (key in target && !(key in Object.prototype)) {
  9031. target[key] = val;
  9032. return val
  9033. }
  9034. var ob = (target).__ob__;
  9035. if (target._isVue || (ob && ob.vmCount)) {
  9036. true && warn(
  9037. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  9038. 'at runtime - declare it upfront in the data option.'
  9039. );
  9040. return val
  9041. }
  9042. if (!ob) {
  9043. target[key] = val;
  9044. return val
  9045. }
  9046. defineReactive$$1(ob.value, key, val);
  9047. ob.dep.notify();
  9048. return val
  9049. }
  9050. /**
  9051. * Delete a property and trigger change if necessary.
  9052. */
  9053. function del (target, key) {
  9054. if ( true &&
  9055. (isUndef(target) || isPrimitive(target))
  9056. ) {
  9057. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  9058. }
  9059. if (Array.isArray(target) && isValidArrayIndex(key)) {
  9060. target.splice(key, 1);
  9061. return
  9062. }
  9063. var ob = (target).__ob__;
  9064. if (target._isVue || (ob && ob.vmCount)) {
  9065. true && warn(
  9066. 'Avoid deleting properties on a Vue instance or its root $data ' +
  9067. '- just set it to null.'
  9068. );
  9069. return
  9070. }
  9071. if (!hasOwn(target, key)) {
  9072. return
  9073. }
  9074. delete target[key];
  9075. if (!ob) {
  9076. return
  9077. }
  9078. ob.dep.notify();
  9079. }
  9080. /**
  9081. * Collect dependencies on array elements when the array is touched, since
  9082. * we cannot intercept array element access like property getters.
  9083. */
  9084. function dependArray (value) {
  9085. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  9086. e = value[i];
  9087. e && e.__ob__ && e.__ob__.dep.depend();
  9088. if (Array.isArray(e)) {
  9089. dependArray(e);
  9090. }
  9091. }
  9092. }
  9093. /* */
  9094. /**
  9095. * Option overwriting strategies are functions that handle
  9096. * how to merge a parent option value and a child option
  9097. * value into the final value.
  9098. */
  9099. var strats = config.optionMergeStrategies;
  9100. /**
  9101. * Options with restrictions
  9102. */
  9103. if (true) {
  9104. strats.el = strats.propsData = function (parent, child, vm, key) {
  9105. if (!vm) {
  9106. warn(
  9107. "option \"" + key + "\" can only be used during instance " +
  9108. 'creation with the `new` keyword.'
  9109. );
  9110. }
  9111. return defaultStrat(parent, child)
  9112. };
  9113. }
  9114. /**
  9115. * Helper that recursively merges two data objects together.
  9116. */
  9117. function mergeData (to, from) {
  9118. if (!from) { return to }
  9119. var key, toVal, fromVal;
  9120. var keys = hasSymbol
  9121. ? Reflect.ownKeys(from)
  9122. : Object.keys(from);
  9123. for (var i = 0; i < keys.length; i++) {
  9124. key = keys[i];
  9125. // in case the object is already observed...
  9126. if (key === '__ob__') { continue }
  9127. toVal = to[key];
  9128. fromVal = from[key];
  9129. if (!hasOwn(to, key)) {
  9130. set(to, key, fromVal);
  9131. } else if (
  9132. toVal !== fromVal &&
  9133. isPlainObject(toVal) &&
  9134. isPlainObject(fromVal)
  9135. ) {
  9136. mergeData(toVal, fromVal);
  9137. }
  9138. }
  9139. return to
  9140. }
  9141. /**
  9142. * Data
  9143. */
  9144. function mergeDataOrFn (
  9145. parentVal,
  9146. childVal,
  9147. vm
  9148. ) {
  9149. if (!vm) {
  9150. // in a Vue.extend merge, both should be functions
  9151. if (!childVal) {
  9152. return parentVal
  9153. }
  9154. if (!parentVal) {
  9155. return childVal
  9156. }
  9157. // when parentVal & childVal are both present,
  9158. // we need to return a function that returns the
  9159. // merged result of both functions... no need to
  9160. // check if parentVal is a function here because
  9161. // it has to be a function to pass previous merges.
  9162. return function mergedDataFn () {
  9163. return mergeData(
  9164. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  9165. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  9166. )
  9167. }
  9168. } else {
  9169. return function mergedInstanceDataFn () {
  9170. // instance merge
  9171. var instanceData = typeof childVal === 'function'
  9172. ? childVal.call(vm, vm)
  9173. : childVal;
  9174. var defaultData = typeof parentVal === 'function'
  9175. ? parentVal.call(vm, vm)
  9176. : parentVal;
  9177. if (instanceData) {
  9178. return mergeData(instanceData, defaultData)
  9179. } else {
  9180. return defaultData
  9181. }
  9182. }
  9183. }
  9184. }
  9185. strats.data = function (
  9186. parentVal,
  9187. childVal,
  9188. vm
  9189. ) {
  9190. if (!vm) {
  9191. if (childVal && typeof childVal !== 'function') {
  9192. true && warn(
  9193. 'The "data" option should be a function ' +
  9194. 'that returns a per-instance value in component ' +
  9195. 'definitions.',
  9196. vm
  9197. );
  9198. return parentVal
  9199. }
  9200. return mergeDataOrFn(parentVal, childVal)
  9201. }
  9202. return mergeDataOrFn(parentVal, childVal, vm)
  9203. };
  9204. /**
  9205. * Hooks and props are merged as arrays.
  9206. */
  9207. function mergeHook (
  9208. parentVal,
  9209. childVal
  9210. ) {
  9211. var res = childVal
  9212. ? parentVal
  9213. ? parentVal.concat(childVal)
  9214. : Array.isArray(childVal)
  9215. ? childVal
  9216. : [childVal]
  9217. : parentVal;
  9218. return res
  9219. ? dedupeHooks(res)
  9220. : res
  9221. }
  9222. function dedupeHooks (hooks) {
  9223. var res = [];
  9224. for (var i = 0; i < hooks.length; i++) {
  9225. if (res.indexOf(hooks[i]) === -1) {
  9226. res.push(hooks[i]);
  9227. }
  9228. }
  9229. return res
  9230. }
  9231. LIFECYCLE_HOOKS.forEach(function (hook) {
  9232. strats[hook] = mergeHook;
  9233. });
  9234. /**
  9235. * Assets
  9236. *
  9237. * When a vm is present (instance creation), we need to do
  9238. * a three-way merge between constructor options, instance
  9239. * options and parent options.
  9240. */
  9241. function mergeAssets (
  9242. parentVal,
  9243. childVal,
  9244. vm,
  9245. key
  9246. ) {
  9247. var res = Object.create(parentVal || null);
  9248. if (childVal) {
  9249. true && assertObjectType(key, childVal, vm);
  9250. return extend(res, childVal)
  9251. } else {
  9252. return res
  9253. }
  9254. }
  9255. ASSET_TYPES.forEach(function (type) {
  9256. strats[type + 's'] = mergeAssets;
  9257. });
  9258. /**
  9259. * Watchers.
  9260. *
  9261. * Watchers hashes should not overwrite one
  9262. * another, so we merge them as arrays.
  9263. */
  9264. strats.watch = function (
  9265. parentVal,
  9266. childVal,
  9267. vm,
  9268. key
  9269. ) {
  9270. // work around Firefox's Object.prototype.watch...
  9271. if (parentVal === nativeWatch) { parentVal = undefined; }
  9272. if (childVal === nativeWatch) { childVal = undefined; }
  9273. /* istanbul ignore if */
  9274. if (!childVal) { return Object.create(parentVal || null) }
  9275. if (true) {
  9276. assertObjectType(key, childVal, vm);
  9277. }
  9278. if (!parentVal) { return childVal }
  9279. var ret = {};
  9280. extend(ret, parentVal);
  9281. for (var key$1 in childVal) {
  9282. var parent = ret[key$1];
  9283. var child = childVal[key$1];
  9284. if (parent && !Array.isArray(parent)) {
  9285. parent = [parent];
  9286. }
  9287. ret[key$1] = parent
  9288. ? parent.concat(child)
  9289. : Array.isArray(child) ? child : [child];
  9290. }
  9291. return ret
  9292. };
  9293. /**
  9294. * Other object hashes.
  9295. */
  9296. strats.props =
  9297. strats.methods =
  9298. strats.inject =
  9299. strats.computed = function (
  9300. parentVal,
  9301. childVal,
  9302. vm,
  9303. key
  9304. ) {
  9305. if (childVal && "development" !== 'production') {
  9306. assertObjectType(key, childVal, vm);
  9307. }
  9308. if (!parentVal) { return childVal }
  9309. var ret = Object.create(null);
  9310. extend(ret, parentVal);
  9311. if (childVal) { extend(ret, childVal); }
  9312. return ret
  9313. };
  9314. strats.provide = mergeDataOrFn;
  9315. /**
  9316. * Default strategy.
  9317. */
  9318. var defaultStrat = function (parentVal, childVal) {
  9319. return childVal === undefined
  9320. ? parentVal
  9321. : childVal
  9322. };
  9323. /**
  9324. * Validate component names
  9325. */
  9326. function checkComponents (options) {
  9327. for (var key in options.components) {
  9328. validateComponentName(key);
  9329. }
  9330. }
  9331. function validateComponentName (name) {
  9332. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  9333. warn(
  9334. 'Invalid component name: "' + name + '". Component names ' +
  9335. 'should conform to valid custom element name in html5 specification.'
  9336. );
  9337. }
  9338. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  9339. warn(
  9340. 'Do not use built-in or reserved HTML elements as component ' +
  9341. 'id: ' + name
  9342. );
  9343. }
  9344. }
  9345. /**
  9346. * Ensure all props option syntax are normalized into the
  9347. * Object-based format.
  9348. */
  9349. function normalizeProps (options, vm) {
  9350. var props = options.props;
  9351. if (!props) { return }
  9352. var res = {};
  9353. var i, val, name;
  9354. if (Array.isArray(props)) {
  9355. i = props.length;
  9356. while (i--) {
  9357. val = props[i];
  9358. if (typeof val === 'string') {
  9359. name = camelize(val);
  9360. res[name] = { type: null };
  9361. } else if (true) {
  9362. warn('props must be strings when using array syntax.');
  9363. }
  9364. }
  9365. } else if (isPlainObject(props)) {
  9366. for (var key in props) {
  9367. val = props[key];
  9368. name = camelize(key);
  9369. res[name] = isPlainObject(val)
  9370. ? val
  9371. : { type: val };
  9372. }
  9373. } else if (true) {
  9374. warn(
  9375. "Invalid value for option \"props\": expected an Array or an Object, " +
  9376. "but got " + (toRawType(props)) + ".",
  9377. vm
  9378. );
  9379. }
  9380. options.props = res;
  9381. }
  9382. /**
  9383. * Normalize all injections into Object-based format
  9384. */
  9385. function normalizeInject (options, vm) {
  9386. var inject = options.inject;
  9387. if (!inject) { return }
  9388. var normalized = options.inject = {};
  9389. if (Array.isArray(inject)) {
  9390. for (var i = 0; i < inject.length; i++) {
  9391. normalized[inject[i]] = { from: inject[i] };
  9392. }
  9393. } else if (isPlainObject(inject)) {
  9394. for (var key in inject) {
  9395. var val = inject[key];
  9396. normalized[key] = isPlainObject(val)
  9397. ? extend({ from: key }, val)
  9398. : { from: val };
  9399. }
  9400. } else if (true) {
  9401. warn(
  9402. "Invalid value for option \"inject\": expected an Array or an Object, " +
  9403. "but got " + (toRawType(inject)) + ".",
  9404. vm
  9405. );
  9406. }
  9407. }
  9408. /**
  9409. * Normalize raw function directives into object format.
  9410. */
  9411. function normalizeDirectives (options) {
  9412. var dirs = options.directives;
  9413. if (dirs) {
  9414. for (var key in dirs) {
  9415. var def$$1 = dirs[key];
  9416. if (typeof def$$1 === 'function') {
  9417. dirs[key] = { bind: def$$1, update: def$$1 };
  9418. }
  9419. }
  9420. }
  9421. }
  9422. function assertObjectType (name, value, vm) {
  9423. if (!isPlainObject(value)) {
  9424. warn(
  9425. "Invalid value for option \"" + name + "\": expected an Object, " +
  9426. "but got " + (toRawType(value)) + ".",
  9427. vm
  9428. );
  9429. }
  9430. }
  9431. /**
  9432. * Merge two option objects into a new one.
  9433. * Core utility used in both instantiation and inheritance.
  9434. */
  9435. function mergeOptions (
  9436. parent,
  9437. child,
  9438. vm
  9439. ) {
  9440. if (true) {
  9441. checkComponents(child);
  9442. }
  9443. if (typeof child === 'function') {
  9444. child = child.options;
  9445. }
  9446. normalizeProps(child, vm);
  9447. normalizeInject(child, vm);
  9448. normalizeDirectives(child);
  9449. // Apply extends and mixins on the child options,
  9450. // but only if it is a raw options object that isn't
  9451. // the result of another mergeOptions call.
  9452. // Only merged options has the _base property.
  9453. if (!child._base) {
  9454. if (child.extends) {
  9455. parent = mergeOptions(parent, child.extends, vm);
  9456. }
  9457. if (child.mixins) {
  9458. for (var i = 0, l = child.mixins.length; i < l; i++) {
  9459. parent = mergeOptions(parent, child.mixins[i], vm);
  9460. }
  9461. }
  9462. }
  9463. var options = {};
  9464. var key;
  9465. for (key in parent) {
  9466. mergeField(key);
  9467. }
  9468. for (key in child) {
  9469. if (!hasOwn(parent, key)) {
  9470. mergeField(key);
  9471. }
  9472. }
  9473. function mergeField (key) {
  9474. var strat = strats[key] || defaultStrat;
  9475. options[key] = strat(parent[key], child[key], vm, key);
  9476. }
  9477. return options
  9478. }
  9479. /**
  9480. * Resolve an asset.
  9481. * This function is used because child instances need access
  9482. * to assets defined in its ancestor chain.
  9483. */
  9484. function resolveAsset (
  9485. options,
  9486. type,
  9487. id,
  9488. warnMissing
  9489. ) {
  9490. /* istanbul ignore if */
  9491. if (typeof id !== 'string') {
  9492. return
  9493. }
  9494. var assets = options[type];
  9495. // check local registration variations first
  9496. if (hasOwn(assets, id)) { return assets[id] }
  9497. var camelizedId = camelize(id);
  9498. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  9499. var PascalCaseId = capitalize(camelizedId);
  9500. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  9501. // fallback to prototype chain
  9502. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  9503. if ( true && warnMissing && !res) {
  9504. warn(
  9505. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  9506. options
  9507. );
  9508. }
  9509. return res
  9510. }
  9511. /* */
  9512. function validateProp (
  9513. key,
  9514. propOptions,
  9515. propsData,
  9516. vm
  9517. ) {
  9518. var prop = propOptions[key];
  9519. var absent = !hasOwn(propsData, key);
  9520. var value = propsData[key];
  9521. // boolean casting
  9522. var booleanIndex = getTypeIndex(Boolean, prop.type);
  9523. if (booleanIndex > -1) {
  9524. if (absent && !hasOwn(prop, 'default')) {
  9525. value = false;
  9526. } else if (value === '' || value === hyphenate(key)) {
  9527. // only cast empty string / same name to boolean if
  9528. // boolean has higher priority
  9529. var stringIndex = getTypeIndex(String, prop.type);
  9530. if (stringIndex < 0 || booleanIndex < stringIndex) {
  9531. value = true;
  9532. }
  9533. }
  9534. }
  9535. // check default value
  9536. if (value === undefined) {
  9537. value = getPropDefaultValue(vm, prop, key);
  9538. // since the default value is a fresh copy,
  9539. // make sure to observe it.
  9540. var prevShouldObserve = shouldObserve;
  9541. toggleObserving(true);
  9542. observe(value);
  9543. toggleObserving(prevShouldObserve);
  9544. }
  9545. if (
  9546. true
  9547. ) {
  9548. assertProp(prop, key, value, vm, absent);
  9549. }
  9550. return value
  9551. }
  9552. /**
  9553. * Get the default value of a prop.
  9554. */
  9555. function getPropDefaultValue (vm, prop, key) {
  9556. // no default, return undefined
  9557. if (!hasOwn(prop, 'default')) {
  9558. return undefined
  9559. }
  9560. var def = prop.default;
  9561. // warn against non-factory defaults for Object & Array
  9562. if ( true && isObject(def)) {
  9563. warn(
  9564. 'Invalid default value for prop "' + key + '": ' +
  9565. 'Props with type Object/Array must use a factory function ' +
  9566. 'to return the default value.',
  9567. vm
  9568. );
  9569. }
  9570. // the raw prop value was also undefined from previous render,
  9571. // return previous default value to avoid unnecessary watcher trigger
  9572. if (vm && vm.$options.propsData &&
  9573. vm.$options.propsData[key] === undefined &&
  9574. vm._props[key] !== undefined
  9575. ) {
  9576. return vm._props[key]
  9577. }
  9578. // call factory function for non-Function types
  9579. // a value is Function if its prototype is function even across different execution context
  9580. return typeof def === 'function' && getType(prop.type) !== 'Function'
  9581. ? def.call(vm)
  9582. : def
  9583. }
  9584. /**
  9585. * Assert whether a prop is valid.
  9586. */
  9587. function assertProp (
  9588. prop,
  9589. name,
  9590. value,
  9591. vm,
  9592. absent
  9593. ) {
  9594. if (prop.required && absent) {
  9595. warn(
  9596. 'Missing required prop: "' + name + '"',
  9597. vm
  9598. );
  9599. return
  9600. }
  9601. if (value == null && !prop.required) {
  9602. return
  9603. }
  9604. var type = prop.type;
  9605. var valid = !type || type === true;
  9606. var expectedTypes = [];
  9607. if (type) {
  9608. if (!Array.isArray(type)) {
  9609. type = [type];
  9610. }
  9611. for (var i = 0; i < type.length && !valid; i++) {
  9612. var assertedType = assertType(value, type[i]);
  9613. expectedTypes.push(assertedType.expectedType || '');
  9614. valid = assertedType.valid;
  9615. }
  9616. }
  9617. if (!valid) {
  9618. warn(
  9619. getInvalidTypeMessage(name, value, expectedTypes),
  9620. vm
  9621. );
  9622. return
  9623. }
  9624. var validator = prop.validator;
  9625. if (validator) {
  9626. if (!validator(value)) {
  9627. warn(
  9628. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  9629. vm
  9630. );
  9631. }
  9632. }
  9633. }
  9634. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  9635. function assertType (value, type) {
  9636. var valid;
  9637. var expectedType = getType(type);
  9638. if (simpleCheckRE.test(expectedType)) {
  9639. var t = typeof value;
  9640. valid = t === expectedType.toLowerCase();
  9641. // for primitive wrapper objects
  9642. if (!valid && t === 'object') {
  9643. valid = value instanceof type;
  9644. }
  9645. } else if (expectedType === 'Object') {
  9646. valid = isPlainObject(value);
  9647. } else if (expectedType === 'Array') {
  9648. valid = Array.isArray(value);
  9649. } else {
  9650. valid = value instanceof type;
  9651. }
  9652. return {
  9653. valid: valid,
  9654. expectedType: expectedType
  9655. }
  9656. }
  9657. /**
  9658. * Use function string name to check built-in types,
  9659. * because a simple equality check will fail when running
  9660. * across different vms / iframes.
  9661. */
  9662. function getType (fn) {
  9663. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  9664. return match ? match[1] : ''
  9665. }
  9666. function isSameType (a, b) {
  9667. return getType(a) === getType(b)
  9668. }
  9669. function getTypeIndex (type, expectedTypes) {
  9670. if (!Array.isArray(expectedTypes)) {
  9671. return isSameType(expectedTypes, type) ? 0 : -1
  9672. }
  9673. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  9674. if (isSameType(expectedTypes[i], type)) {
  9675. return i
  9676. }
  9677. }
  9678. return -1
  9679. }
  9680. function getInvalidTypeMessage (name, value, expectedTypes) {
  9681. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  9682. " Expected " + (expectedTypes.map(capitalize).join(', '));
  9683. var expectedType = expectedTypes[0];
  9684. var receivedType = toRawType(value);
  9685. var expectedValue = styleValue(value, expectedType);
  9686. var receivedValue = styleValue(value, receivedType);
  9687. // check if we need to specify expected value
  9688. if (expectedTypes.length === 1 &&
  9689. isExplicable(expectedType) &&
  9690. !isBoolean(expectedType, receivedType)) {
  9691. message += " with value " + expectedValue;
  9692. }
  9693. message += ", got " + receivedType + " ";
  9694. // check if we need to specify received value
  9695. if (isExplicable(receivedType)) {
  9696. message += "with value " + receivedValue + ".";
  9697. }
  9698. return message
  9699. }
  9700. function styleValue (value, type) {
  9701. if (type === 'String') {
  9702. return ("\"" + value + "\"")
  9703. } else if (type === 'Number') {
  9704. return ("" + (Number(value)))
  9705. } else {
  9706. return ("" + value)
  9707. }
  9708. }
  9709. function isExplicable (value) {
  9710. var explicitTypes = ['string', 'number', 'boolean'];
  9711. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  9712. }
  9713. function isBoolean () {
  9714. var args = [], len = arguments.length;
  9715. while ( len-- ) args[ len ] = arguments[ len ];
  9716. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  9717. }
  9718. /* */
  9719. function handleError (err, vm, info) {
  9720. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  9721. // See: https://github.com/vuejs/vuex/issues/1505
  9722. pushTarget();
  9723. try {
  9724. if (vm) {
  9725. var cur = vm;
  9726. while ((cur = cur.$parent)) {
  9727. var hooks = cur.$options.errorCaptured;
  9728. if (hooks) {
  9729. for (var i = 0; i < hooks.length; i++) {
  9730. try {
  9731. var capture = hooks[i].call(cur, err, vm, info) === false;
  9732. if (capture) { return }
  9733. } catch (e) {
  9734. globalHandleError(e, cur, 'errorCaptured hook');
  9735. }
  9736. }
  9737. }
  9738. }
  9739. }
  9740. globalHandleError(err, vm, info);
  9741. } finally {
  9742. popTarget();
  9743. }
  9744. }
  9745. function invokeWithErrorHandling (
  9746. handler,
  9747. context,
  9748. args,
  9749. vm,
  9750. info
  9751. ) {
  9752. var res;
  9753. try {
  9754. res = args ? handler.apply(context, args) : handler.call(context);
  9755. if (res && !res._isVue && isPromise(res) && !res._handled) {
  9756. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  9757. // issue #9511
  9758. // avoid catch triggering multiple times when nested calls
  9759. res._handled = true;
  9760. }
  9761. } catch (e) {
  9762. handleError(e, vm, info);
  9763. }
  9764. return res
  9765. }
  9766. function globalHandleError (err, vm, info) {
  9767. if (config.errorHandler) {
  9768. try {
  9769. return config.errorHandler.call(null, err, vm, info)
  9770. } catch (e) {
  9771. // if the user intentionally throws the original error in the handler,
  9772. // do not log it twice
  9773. if (e !== err) {
  9774. logError(e, null, 'config.errorHandler');
  9775. }
  9776. }
  9777. }
  9778. logError(err, vm, info);
  9779. }
  9780. function logError (err, vm, info) {
  9781. if (true) {
  9782. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9783. }
  9784. /* istanbul ignore else */
  9785. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  9786. console.error(err);
  9787. } else {
  9788. throw err
  9789. }
  9790. }
  9791. /* */
  9792. var callbacks = [];
  9793. var pending = false;
  9794. function flushCallbacks () {
  9795. pending = false;
  9796. var copies = callbacks.slice(0);
  9797. callbacks.length = 0;
  9798. for (var i = 0; i < copies.length; i++) {
  9799. copies[i]();
  9800. }
  9801. }
  9802. // Here we have async deferring wrappers using microtasks.
  9803. // In 2.5 we used (macro) tasks (in combination with microtasks).
  9804. // However, it has subtle problems when state is changed right before repaint
  9805. // (e.g. #6813, out-in transitions).
  9806. // Also, using (macro) tasks in event handler would cause some weird behaviors
  9807. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  9808. // So we now use microtasks everywhere, again.
  9809. // A major drawback of this tradeoff is that there are some scenarios
  9810. // where microtasks have too high a priority and fire in between supposedly
  9811. // sequential events (e.g. #4521, #6690, which have workarounds)
  9812. // or even between bubbling of the same event (#6566).
  9813. var timerFunc;
  9814. // The nextTick behavior leverages the microtask queue, which can be accessed
  9815. // via either native Promise.then or MutationObserver.
  9816. // MutationObserver has wider support, however it is seriously bugged in
  9817. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  9818. // completely stops working after triggering a few times... so, if native
  9819. // Promise is available, we will use it:
  9820. /* istanbul ignore next, $flow-disable-line */
  9821. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  9822. var p = Promise.resolve();
  9823. timerFunc = function () {
  9824. p.then(flushCallbacks);
  9825. // In problematic UIWebViews, Promise.then doesn't completely break, but
  9826. // it can get stuck in a weird state where callbacks are pushed into the
  9827. // microtask queue but the queue isn't being flushed, until the browser
  9828. // needs to do some other work, e.g. handle a timer. Therefore we can
  9829. // "force" the microtask queue to be flushed by adding an empty timer.
  9830. if (isIOS) { setTimeout(noop); }
  9831. };
  9832. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  9833. isNative(MutationObserver) ||
  9834. // PhantomJS and iOS 7.x
  9835. MutationObserver.toString() === '[object MutationObserverConstructor]'
  9836. )) {
  9837. // Use MutationObserver where native Promise is not available,
  9838. // e.g. PhantomJS, iOS7, Android 4.4
  9839. // (#6466 MutationObserver is unreliable in IE11)
  9840. var counter = 1;
  9841. var observer = new MutationObserver(flushCallbacks);
  9842. var textNode = document.createTextNode(String(counter));
  9843. observer.observe(textNode, {
  9844. characterData: true
  9845. });
  9846. timerFunc = function () {
  9847. counter = (counter + 1) % 2;
  9848. textNode.data = String(counter);
  9849. };
  9850. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  9851. // Fallback to setImmediate.
  9852. // Technically it leverages the (macro) task queue,
  9853. // but it is still a better choice than setTimeout.
  9854. timerFunc = function () {
  9855. setImmediate(flushCallbacks);
  9856. };
  9857. } else {
  9858. // Fallback to setTimeout.
  9859. timerFunc = function () {
  9860. setTimeout(flushCallbacks, 0);
  9861. };
  9862. }
  9863. function nextTick (cb, ctx) {
  9864. var _resolve;
  9865. callbacks.push(function () {
  9866. if (cb) {
  9867. try {
  9868. cb.call(ctx);
  9869. } catch (e) {
  9870. handleError(e, ctx, 'nextTick');
  9871. }
  9872. } else if (_resolve) {
  9873. _resolve(ctx);
  9874. }
  9875. });
  9876. if (!pending) {
  9877. pending = true;
  9878. timerFunc();
  9879. }
  9880. // $flow-disable-line
  9881. if (!cb && typeof Promise !== 'undefined') {
  9882. return new Promise(function (resolve) {
  9883. _resolve = resolve;
  9884. })
  9885. }
  9886. }
  9887. /* */
  9888. /* not type checking this file because flow doesn't play well with Proxy */
  9889. var initProxy;
  9890. if (true) {
  9891. var allowedGlobals = makeMap(
  9892. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  9893. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  9894. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  9895. 'require' // for Webpack/Browserify
  9896. );
  9897. var warnNonPresent = function (target, key) {
  9898. warn(
  9899. "Property or method \"" + key + "\" is not defined on the instance but " +
  9900. 'referenced during render. Make sure that this property is reactive, ' +
  9901. 'either in the data option, or for class-based components, by ' +
  9902. 'initializing the property. ' +
  9903. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  9904. target
  9905. );
  9906. };
  9907. var warnReservedPrefix = function (target, key) {
  9908. warn(
  9909. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  9910. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  9911. 'prevent conflicts with Vue internals. ' +
  9912. 'See: https://vuejs.org/v2/api/#data',
  9913. target
  9914. );
  9915. };
  9916. var hasProxy =
  9917. typeof Proxy !== 'undefined' && isNative(Proxy);
  9918. if (hasProxy) {
  9919. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  9920. config.keyCodes = new Proxy(config.keyCodes, {
  9921. set: function set (target, key, value) {
  9922. if (isBuiltInModifier(key)) {
  9923. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  9924. return false
  9925. } else {
  9926. target[key] = value;
  9927. return true
  9928. }
  9929. }
  9930. });
  9931. }
  9932. var hasHandler = {
  9933. has: function has (target, key) {
  9934. var has = key in target;
  9935. var isAllowed = allowedGlobals(key) ||
  9936. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  9937. if (!has && !isAllowed) {
  9938. if (key in target.$data) { warnReservedPrefix(target, key); }
  9939. else { warnNonPresent(target, key); }
  9940. }
  9941. return has || !isAllowed
  9942. }
  9943. };
  9944. var getHandler = {
  9945. get: function get (target, key) {
  9946. if (typeof key === 'string' && !(key in target)) {
  9947. if (key in target.$data) { warnReservedPrefix(target, key); }
  9948. else { warnNonPresent(target, key); }
  9949. }
  9950. return target[key]
  9951. }
  9952. };
  9953. initProxy = function initProxy (vm) {
  9954. if (hasProxy) {
  9955. // determine which proxy handler to use
  9956. var options = vm.$options;
  9957. var handlers = options.render && options.render._withStripped
  9958. ? getHandler
  9959. : hasHandler;
  9960. vm._renderProxy = new Proxy(vm, handlers);
  9961. } else {
  9962. vm._renderProxy = vm;
  9963. }
  9964. };
  9965. }
  9966. /* */
  9967. var seenObjects = new _Set();
  9968. /**
  9969. * Recursively traverse an object to evoke all converted
  9970. * getters, so that every nested property inside the object
  9971. * is collected as a "deep" dependency.
  9972. */
  9973. function traverse (val) {
  9974. _traverse(val, seenObjects);
  9975. seenObjects.clear();
  9976. }
  9977. function _traverse (val, seen) {
  9978. var i, keys;
  9979. var isA = Array.isArray(val);
  9980. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  9981. return
  9982. }
  9983. if (val.__ob__) {
  9984. var depId = val.__ob__.dep.id;
  9985. if (seen.has(depId)) {
  9986. return
  9987. }
  9988. seen.add(depId);
  9989. }
  9990. if (isA) {
  9991. i = val.length;
  9992. while (i--) { _traverse(val[i], seen); }
  9993. } else {
  9994. keys = Object.keys(val);
  9995. i = keys.length;
  9996. while (i--) { _traverse(val[keys[i]], seen); }
  9997. }
  9998. }
  9999. var mark;
  10000. var measure;
  10001. if (true) {
  10002. var perf = inBrowser && window.performance;
  10003. /* istanbul ignore if */
  10004. if (
  10005. perf &&
  10006. perf.mark &&
  10007. perf.measure &&
  10008. perf.clearMarks &&
  10009. perf.clearMeasures
  10010. ) {
  10011. mark = function (tag) { return perf.mark(tag); };
  10012. measure = function (name, startTag, endTag) {
  10013. perf.measure(name, startTag, endTag);
  10014. perf.clearMarks(startTag);
  10015. perf.clearMarks(endTag);
  10016. // perf.clearMeasures(name)
  10017. };
  10018. }
  10019. }
  10020. /* */
  10021. var normalizeEvent = cached(function (name) {
  10022. var passive = name.charAt(0) === '&';
  10023. name = passive ? name.slice(1) : name;
  10024. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  10025. name = once$$1 ? name.slice(1) : name;
  10026. var capture = name.charAt(0) === '!';
  10027. name = capture ? name.slice(1) : name;
  10028. return {
  10029. name: name,
  10030. once: once$$1,
  10031. capture: capture,
  10032. passive: passive
  10033. }
  10034. });
  10035. function createFnInvoker (fns, vm) {
  10036. function invoker () {
  10037. var arguments$1 = arguments;
  10038. var fns = invoker.fns;
  10039. if (Array.isArray(fns)) {
  10040. var cloned = fns.slice();
  10041. for (var i = 0; i < cloned.length; i++) {
  10042. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  10043. }
  10044. } else {
  10045. // return handler return value for single handlers
  10046. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  10047. }
  10048. }
  10049. invoker.fns = fns;
  10050. return invoker
  10051. }
  10052. function updateListeners (
  10053. on,
  10054. oldOn,
  10055. add,
  10056. remove$$1,
  10057. createOnceHandler,
  10058. vm
  10059. ) {
  10060. var name, def$$1, cur, old, event;
  10061. for (name in on) {
  10062. def$$1 = cur = on[name];
  10063. old = oldOn[name];
  10064. event = normalizeEvent(name);
  10065. if (isUndef(cur)) {
  10066. true && warn(
  10067. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  10068. vm
  10069. );
  10070. } else if (isUndef(old)) {
  10071. if (isUndef(cur.fns)) {
  10072. cur = on[name] = createFnInvoker(cur, vm);
  10073. }
  10074. if (isTrue(event.once)) {
  10075. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  10076. }
  10077. add(event.name, cur, event.capture, event.passive, event.params);
  10078. } else if (cur !== old) {
  10079. old.fns = cur;
  10080. on[name] = old;
  10081. }
  10082. }
  10083. for (name in oldOn) {
  10084. if (isUndef(on[name])) {
  10085. event = normalizeEvent(name);
  10086. remove$$1(event.name, oldOn[name], event.capture);
  10087. }
  10088. }
  10089. }
  10090. /* */
  10091. /* */
  10092. // fixed by xxxxxx (mp properties)
  10093. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  10094. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  10095. if (isUndef(propOptions)) {
  10096. return res
  10097. }
  10098. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  10099. var attrs = data.attrs;
  10100. var props = data.props;
  10101. if (isDef(attrs) || isDef(props)) {
  10102. for (var key in propOptions) {
  10103. var altKey = hyphenate(key);
  10104. var result = checkProp(res, props, key, altKey, true) ||
  10105. checkProp(res, attrs, key, altKey, false);
  10106. // externalClass
  10107. if (
  10108. result &&
  10109. res[key] &&
  10110. externalClasses.indexOf(altKey) !== -1 &&
  10111. context[camelize(res[key])]
  10112. ) {
  10113. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  10114. res[key] = context[camelize(res[key])];
  10115. }
  10116. }
  10117. }
  10118. return res
  10119. }
  10120. function extractPropsFromVNodeData (
  10121. data,
  10122. Ctor,
  10123. tag,
  10124. context// fixed by xxxxxx
  10125. ) {
  10126. // we are only extracting raw values here.
  10127. // validation and default values are handled in the child
  10128. // component itself.
  10129. var propOptions = Ctor.options.props;
  10130. if (isUndef(propOptions)) {
  10131. // fixed by xxxxxx
  10132. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  10133. }
  10134. var res = {};
  10135. var attrs = data.attrs;
  10136. var props = data.props;
  10137. if (isDef(attrs) || isDef(props)) {
  10138. for (var key in propOptions) {
  10139. var altKey = hyphenate(key);
  10140. if (true) {
  10141. var keyInLowerCase = key.toLowerCase();
  10142. if (
  10143. key !== keyInLowerCase &&
  10144. attrs && hasOwn(attrs, keyInLowerCase)
  10145. ) {
  10146. tip(
  10147. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  10148. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  10149. " \"" + key + "\". " +
  10150. "Note that HTML attributes are case-insensitive and camelCased " +
  10151. "props need to use their kebab-case equivalents when using in-DOM " +
  10152. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  10153. );
  10154. }
  10155. }
  10156. checkProp(res, props, key, altKey, true) ||
  10157. checkProp(res, attrs, key, altKey, false);
  10158. }
  10159. }
  10160. // fixed by xxxxxx
  10161. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  10162. }
  10163. function checkProp (
  10164. res,
  10165. hash,
  10166. key,
  10167. altKey,
  10168. preserve
  10169. ) {
  10170. if (isDef(hash)) {
  10171. if (hasOwn(hash, key)) {
  10172. res[key] = hash[key];
  10173. if (!preserve) {
  10174. delete hash[key];
  10175. }
  10176. return true
  10177. } else if (hasOwn(hash, altKey)) {
  10178. res[key] = hash[altKey];
  10179. if (!preserve) {
  10180. delete hash[altKey];
  10181. }
  10182. return true
  10183. }
  10184. }
  10185. return false
  10186. }
  10187. /* */
  10188. // The template compiler attempts to minimize the need for normalization by
  10189. // statically analyzing the template at compile time.
  10190. //
  10191. // For plain HTML markup, normalization can be completely skipped because the
  10192. // generated render function is guaranteed to return Array<VNode>. There are
  10193. // two cases where extra normalization is needed:
  10194. // 1. When the children contains components - because a functional component
  10195. // may return an Array instead of a single root. In this case, just a simple
  10196. // normalization is needed - if any child is an Array, we flatten the whole
  10197. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  10198. // because functional components already normalize their own children.
  10199. function simpleNormalizeChildren (children) {
  10200. for (var i = 0; i < children.length; i++) {
  10201. if (Array.isArray(children[i])) {
  10202. return Array.prototype.concat.apply([], children)
  10203. }
  10204. }
  10205. return children
  10206. }
  10207. // 2. When the children contains constructs that always generated nested Arrays,
  10208. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  10209. // with hand-written render functions / JSX. In such cases a full normalization
  10210. // is needed to cater to all possible types of children values.
  10211. function normalizeChildren (children) {
  10212. return isPrimitive(children)
  10213. ? [createTextVNode(children)]
  10214. : Array.isArray(children)
  10215. ? normalizeArrayChildren(children)
  10216. : undefined
  10217. }
  10218. function isTextNode (node) {
  10219. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  10220. }
  10221. function normalizeArrayChildren (children, nestedIndex) {
  10222. var res = [];
  10223. var i, c, lastIndex, last;
  10224. for (i = 0; i < children.length; i++) {
  10225. c = children[i];
  10226. if (isUndef(c) || typeof c === 'boolean') { continue }
  10227. lastIndex = res.length - 1;
  10228. last = res[lastIndex];
  10229. // nested
  10230. if (Array.isArray(c)) {
  10231. if (c.length > 0) {
  10232. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  10233. // merge adjacent text nodes
  10234. if (isTextNode(c[0]) && isTextNode(last)) {
  10235. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  10236. c.shift();
  10237. }
  10238. res.push.apply(res, c);
  10239. }
  10240. } else if (isPrimitive(c)) {
  10241. if (isTextNode(last)) {
  10242. // merge adjacent text nodes
  10243. // this is necessary for SSR hydration because text nodes are
  10244. // essentially merged when rendered to HTML strings
  10245. res[lastIndex] = createTextVNode(last.text + c);
  10246. } else if (c !== '') {
  10247. // convert primitive to vnode
  10248. res.push(createTextVNode(c));
  10249. }
  10250. } else {
  10251. if (isTextNode(c) && isTextNode(last)) {
  10252. // merge adjacent text nodes
  10253. res[lastIndex] = createTextVNode(last.text + c.text);
  10254. } else {
  10255. // default key for nested array children (likely generated by v-for)
  10256. if (isTrue(children._isVList) &&
  10257. isDef(c.tag) &&
  10258. isUndef(c.key) &&
  10259. isDef(nestedIndex)) {
  10260. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  10261. }
  10262. res.push(c);
  10263. }
  10264. }
  10265. }
  10266. return res
  10267. }
  10268. /* */
  10269. function initProvide (vm) {
  10270. var provide = vm.$options.provide;
  10271. if (provide) {
  10272. vm._provided = typeof provide === 'function'
  10273. ? provide.call(vm)
  10274. : provide;
  10275. }
  10276. }
  10277. function initInjections (vm) {
  10278. var result = resolveInject(vm.$options.inject, vm);
  10279. if (result) {
  10280. toggleObserving(false);
  10281. Object.keys(result).forEach(function (key) {
  10282. /* istanbul ignore else */
  10283. if (true) {
  10284. defineReactive$$1(vm, key, result[key], function () {
  10285. warn(
  10286. "Avoid mutating an injected value directly since the changes will be " +
  10287. "overwritten whenever the provided component re-renders. " +
  10288. "injection being mutated: \"" + key + "\"",
  10289. vm
  10290. );
  10291. });
  10292. } else {}
  10293. });
  10294. toggleObserving(true);
  10295. }
  10296. }
  10297. function resolveInject (inject, vm) {
  10298. if (inject) {
  10299. // inject is :any because flow is not smart enough to figure out cached
  10300. var result = Object.create(null);
  10301. var keys = hasSymbol
  10302. ? Reflect.ownKeys(inject)
  10303. : Object.keys(inject);
  10304. for (var i = 0; i < keys.length; i++) {
  10305. var key = keys[i];
  10306. // #6574 in case the inject object is observed...
  10307. if (key === '__ob__') { continue }
  10308. var provideKey = inject[key].from;
  10309. var source = vm;
  10310. while (source) {
  10311. if (source._provided && hasOwn(source._provided, provideKey)) {
  10312. result[key] = source._provided[provideKey];
  10313. break
  10314. }
  10315. source = source.$parent;
  10316. }
  10317. if (!source) {
  10318. if ('default' in inject[key]) {
  10319. var provideDefault = inject[key].default;
  10320. result[key] = typeof provideDefault === 'function'
  10321. ? provideDefault.call(vm)
  10322. : provideDefault;
  10323. } else if (true) {
  10324. warn(("Injection \"" + key + "\" not found"), vm);
  10325. }
  10326. }
  10327. }
  10328. return result
  10329. }
  10330. }
  10331. /* */
  10332. /**
  10333. * Runtime helper for resolving raw children VNodes into a slot object.
  10334. */
  10335. function resolveSlots (
  10336. children,
  10337. context
  10338. ) {
  10339. if (!children || !children.length) {
  10340. return {}
  10341. }
  10342. var slots = {};
  10343. for (var i = 0, l = children.length; i < l; i++) {
  10344. var child = children[i];
  10345. var data = child.data;
  10346. // remove slot attribute if the node is resolved as a Vue slot node
  10347. if (data && data.attrs && data.attrs.slot) {
  10348. delete data.attrs.slot;
  10349. }
  10350. // named slots should only be respected if the vnode was rendered in the
  10351. // same context.
  10352. if ((child.context === context || child.fnContext === context) &&
  10353. data && data.slot != null
  10354. ) {
  10355. var name = data.slot;
  10356. var slot = (slots[name] || (slots[name] = []));
  10357. if (child.tag === 'template') {
  10358. slot.push.apply(slot, child.children || []);
  10359. } else {
  10360. slot.push(child);
  10361. }
  10362. } else {
  10363. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  10364. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  10365. (slots['page'] || (slots['page'] = [])).push(child);
  10366. }else{
  10367. (slots.default || (slots.default = [])).push(child);
  10368. }
  10369. }
  10370. }
  10371. // ignore slots that contains only whitespace
  10372. for (var name$1 in slots) {
  10373. if (slots[name$1].every(isWhitespace)) {
  10374. delete slots[name$1];
  10375. }
  10376. }
  10377. return slots
  10378. }
  10379. function isWhitespace (node) {
  10380. return (node.isComment && !node.asyncFactory) || node.text === ' '
  10381. }
  10382. /* */
  10383. function normalizeScopedSlots (
  10384. slots,
  10385. normalSlots,
  10386. prevSlots
  10387. ) {
  10388. var res;
  10389. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  10390. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  10391. var key = slots && slots.$key;
  10392. if (!slots) {
  10393. res = {};
  10394. } else if (slots._normalized) {
  10395. // fast path 1: child component re-render only, parent did not change
  10396. return slots._normalized
  10397. } else if (
  10398. isStable &&
  10399. prevSlots &&
  10400. prevSlots !== emptyObject &&
  10401. key === prevSlots.$key &&
  10402. !hasNormalSlots &&
  10403. !prevSlots.$hasNormal
  10404. ) {
  10405. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  10406. // only need to normalize once
  10407. return prevSlots
  10408. } else {
  10409. res = {};
  10410. for (var key$1 in slots) {
  10411. if (slots[key$1] && key$1[0] !== '$') {
  10412. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  10413. }
  10414. }
  10415. }
  10416. // expose normal slots on scopedSlots
  10417. for (var key$2 in normalSlots) {
  10418. if (!(key$2 in res)) {
  10419. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  10420. }
  10421. }
  10422. // avoriaz seems to mock a non-extensible $scopedSlots object
  10423. // and when that is passed down this would cause an error
  10424. if (slots && Object.isExtensible(slots)) {
  10425. (slots)._normalized = res;
  10426. }
  10427. def(res, '$stable', isStable);
  10428. def(res, '$key', key);
  10429. def(res, '$hasNormal', hasNormalSlots);
  10430. return res
  10431. }
  10432. function normalizeScopedSlot(normalSlots, key, fn) {
  10433. var normalized = function () {
  10434. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  10435. res = res && typeof res === 'object' && !Array.isArray(res)
  10436. ? [res] // single vnode
  10437. : normalizeChildren(res);
  10438. return res && (
  10439. res.length === 0 ||
  10440. (res.length === 1 && res[0].isComment) // #9658
  10441. ) ? undefined
  10442. : res
  10443. };
  10444. // this is a slot using the new v-slot syntax without scope. although it is
  10445. // compiled as a scoped slot, render fn users would expect it to be present
  10446. // on this.$slots because the usage is semantically a normal slot.
  10447. if (fn.proxy) {
  10448. Object.defineProperty(normalSlots, key, {
  10449. get: normalized,
  10450. enumerable: true,
  10451. configurable: true
  10452. });
  10453. }
  10454. return normalized
  10455. }
  10456. function proxyNormalSlot(slots, key) {
  10457. return function () { return slots[key]; }
  10458. }
  10459. /* */
  10460. /**
  10461. * Runtime helper for rendering v-for lists.
  10462. */
  10463. function renderList (
  10464. val,
  10465. render
  10466. ) {
  10467. var ret, i, l, keys, key;
  10468. if (Array.isArray(val) || typeof val === 'string') {
  10469. ret = new Array(val.length);
  10470. for (i = 0, l = val.length; i < l; i++) {
  10471. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  10472. }
  10473. } else if (typeof val === 'number') {
  10474. ret = new Array(val);
  10475. for (i = 0; i < val; i++) {
  10476. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  10477. }
  10478. } else if (isObject(val)) {
  10479. if (hasSymbol && val[Symbol.iterator]) {
  10480. ret = [];
  10481. var iterator = val[Symbol.iterator]();
  10482. var result = iterator.next();
  10483. while (!result.done) {
  10484. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  10485. result = iterator.next();
  10486. }
  10487. } else {
  10488. keys = Object.keys(val);
  10489. ret = new Array(keys.length);
  10490. for (i = 0, l = keys.length; i < l; i++) {
  10491. key = keys[i];
  10492. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  10493. }
  10494. }
  10495. }
  10496. if (!isDef(ret)) {
  10497. ret = [];
  10498. }
  10499. (ret)._isVList = true;
  10500. return ret
  10501. }
  10502. /* */
  10503. /**
  10504. * Runtime helper for rendering <slot>
  10505. */
  10506. function renderSlot (
  10507. name,
  10508. fallback,
  10509. props,
  10510. bindObject
  10511. ) {
  10512. var scopedSlotFn = this.$scopedSlots[name];
  10513. var nodes;
  10514. if (scopedSlotFn) { // scoped slot
  10515. props = props || {};
  10516. if (bindObject) {
  10517. if ( true && !isObject(bindObject)) {
  10518. warn(
  10519. 'slot v-bind without argument expects an Object',
  10520. this
  10521. );
  10522. }
  10523. props = extend(extend({}, bindObject), props);
  10524. }
  10525. // fixed by xxxxxx app-plus scopedSlot
  10526. nodes = scopedSlotFn(props, this, props._i) || fallback;
  10527. } else {
  10528. nodes = this.$slots[name] || fallback;
  10529. }
  10530. var target = props && props.slot;
  10531. if (target) {
  10532. return this.$createElement('template', { slot: target }, nodes)
  10533. } else {
  10534. return nodes
  10535. }
  10536. }
  10537. /* */
  10538. /**
  10539. * Runtime helper for resolving filters
  10540. */
  10541. function resolveFilter (id) {
  10542. return resolveAsset(this.$options, 'filters', id, true) || identity
  10543. }
  10544. /* */
  10545. function isKeyNotMatch (expect, actual) {
  10546. if (Array.isArray(expect)) {
  10547. return expect.indexOf(actual) === -1
  10548. } else {
  10549. return expect !== actual
  10550. }
  10551. }
  10552. /**
  10553. * Runtime helper for checking keyCodes from config.
  10554. * exposed as Vue.prototype._k
  10555. * passing in eventKeyName as last argument separately for backwards compat
  10556. */
  10557. function checkKeyCodes (
  10558. eventKeyCode,
  10559. key,
  10560. builtInKeyCode,
  10561. eventKeyName,
  10562. builtInKeyName
  10563. ) {
  10564. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  10565. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  10566. return isKeyNotMatch(builtInKeyName, eventKeyName)
  10567. } else if (mappedKeyCode) {
  10568. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  10569. } else if (eventKeyName) {
  10570. return hyphenate(eventKeyName) !== key
  10571. }
  10572. }
  10573. /* */
  10574. /**
  10575. * Runtime helper for merging v-bind="object" into a VNode's data.
  10576. */
  10577. function bindObjectProps (
  10578. data,
  10579. tag,
  10580. value,
  10581. asProp,
  10582. isSync
  10583. ) {
  10584. if (value) {
  10585. if (!isObject(value)) {
  10586. true && warn(
  10587. 'v-bind without argument expects an Object or Array value',
  10588. this
  10589. );
  10590. } else {
  10591. if (Array.isArray(value)) {
  10592. value = toObject(value);
  10593. }
  10594. var hash;
  10595. var loop = function ( key ) {
  10596. if (
  10597. key === 'class' ||
  10598. key === 'style' ||
  10599. isReservedAttribute(key)
  10600. ) {
  10601. hash = data;
  10602. } else {
  10603. var type = data.attrs && data.attrs.type;
  10604. hash = asProp || config.mustUseProp(tag, type, key)
  10605. ? data.domProps || (data.domProps = {})
  10606. : data.attrs || (data.attrs = {});
  10607. }
  10608. var camelizedKey = camelize(key);
  10609. var hyphenatedKey = hyphenate(key);
  10610. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  10611. hash[key] = value[key];
  10612. if (isSync) {
  10613. var on = data.on || (data.on = {});
  10614. on[("update:" + key)] = function ($event) {
  10615. value[key] = $event;
  10616. };
  10617. }
  10618. }
  10619. };
  10620. for (var key in value) loop( key );
  10621. }
  10622. }
  10623. return data
  10624. }
  10625. /* */
  10626. /**
  10627. * Runtime helper for rendering static trees.
  10628. */
  10629. function renderStatic (
  10630. index,
  10631. isInFor
  10632. ) {
  10633. var cached = this._staticTrees || (this._staticTrees = []);
  10634. var tree = cached[index];
  10635. // if has already-rendered static tree and not inside v-for,
  10636. // we can reuse the same tree.
  10637. if (tree && !isInFor) {
  10638. return tree
  10639. }
  10640. // otherwise, render a fresh tree.
  10641. tree = cached[index] = this.$options.staticRenderFns[index].call(
  10642. this._renderProxy,
  10643. null,
  10644. this // for render fns generated for functional component templates
  10645. );
  10646. markStatic(tree, ("__static__" + index), false);
  10647. return tree
  10648. }
  10649. /**
  10650. * Runtime helper for v-once.
  10651. * Effectively it means marking the node as static with a unique key.
  10652. */
  10653. function markOnce (
  10654. tree,
  10655. index,
  10656. key
  10657. ) {
  10658. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  10659. return tree
  10660. }
  10661. function markStatic (
  10662. tree,
  10663. key,
  10664. isOnce
  10665. ) {
  10666. if (Array.isArray(tree)) {
  10667. for (var i = 0; i < tree.length; i++) {
  10668. if (tree[i] && typeof tree[i] !== 'string') {
  10669. markStaticNode(tree[i], (key + "_" + i), isOnce);
  10670. }
  10671. }
  10672. } else {
  10673. markStaticNode(tree, key, isOnce);
  10674. }
  10675. }
  10676. function markStaticNode (node, key, isOnce) {
  10677. node.isStatic = true;
  10678. node.key = key;
  10679. node.isOnce = isOnce;
  10680. }
  10681. /* */
  10682. function bindObjectListeners (data, value) {
  10683. if (value) {
  10684. if (!isPlainObject(value)) {
  10685. true && warn(
  10686. 'v-on without argument expects an Object value',
  10687. this
  10688. );
  10689. } else {
  10690. var on = data.on = data.on ? extend({}, data.on) : {};
  10691. for (var key in value) {
  10692. var existing = on[key];
  10693. var ours = value[key];
  10694. on[key] = existing ? [].concat(existing, ours) : ours;
  10695. }
  10696. }
  10697. }
  10698. return data
  10699. }
  10700. /* */
  10701. function resolveScopedSlots (
  10702. fns, // see flow/vnode
  10703. res,
  10704. // the following are added in 2.6
  10705. hasDynamicKeys,
  10706. contentHashKey
  10707. ) {
  10708. res = res || { $stable: !hasDynamicKeys };
  10709. for (var i = 0; i < fns.length; i++) {
  10710. var slot = fns[i];
  10711. if (Array.isArray(slot)) {
  10712. resolveScopedSlots(slot, res, hasDynamicKeys);
  10713. } else if (slot) {
  10714. // marker for reverse proxying v-slot without scope on this.$slots
  10715. if (slot.proxy) {
  10716. slot.fn.proxy = true;
  10717. }
  10718. res[slot.key] = slot.fn;
  10719. }
  10720. }
  10721. if (contentHashKey) {
  10722. (res).$key = contentHashKey;
  10723. }
  10724. return res
  10725. }
  10726. /* */
  10727. function bindDynamicKeys (baseObj, values) {
  10728. for (var i = 0; i < values.length; i += 2) {
  10729. var key = values[i];
  10730. if (typeof key === 'string' && key) {
  10731. baseObj[values[i]] = values[i + 1];
  10732. } else if ( true && key !== '' && key !== null) {
  10733. // null is a special value for explicitly removing a binding
  10734. warn(
  10735. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  10736. this
  10737. );
  10738. }
  10739. }
  10740. return baseObj
  10741. }
  10742. // helper to dynamically append modifier runtime markers to event names.
  10743. // ensure only append when value is already string, otherwise it will be cast
  10744. // to string and cause the type check to miss.
  10745. function prependModifier (value, symbol) {
  10746. return typeof value === 'string' ? symbol + value : value
  10747. }
  10748. /* */
  10749. function installRenderHelpers (target) {
  10750. target._o = markOnce;
  10751. target._n = toNumber;
  10752. target._s = toString;
  10753. target._l = renderList;
  10754. target._t = renderSlot;
  10755. target._q = looseEqual;
  10756. target._i = looseIndexOf;
  10757. target._m = renderStatic;
  10758. target._f = resolveFilter;
  10759. target._k = checkKeyCodes;
  10760. target._b = bindObjectProps;
  10761. target._v = createTextVNode;
  10762. target._e = createEmptyVNode;
  10763. target._u = resolveScopedSlots;
  10764. target._g = bindObjectListeners;
  10765. target._d = bindDynamicKeys;
  10766. target._p = prependModifier;
  10767. }
  10768. /* */
  10769. function FunctionalRenderContext (
  10770. data,
  10771. props,
  10772. children,
  10773. parent,
  10774. Ctor
  10775. ) {
  10776. var this$1 = this;
  10777. var options = Ctor.options;
  10778. // ensure the createElement function in functional components
  10779. // gets a unique context - this is necessary for correct named slot check
  10780. var contextVm;
  10781. if (hasOwn(parent, '_uid')) {
  10782. contextVm = Object.create(parent);
  10783. // $flow-disable-line
  10784. contextVm._original = parent;
  10785. } else {
  10786. // the context vm passed in is a functional context as well.
  10787. // in this case we want to make sure we are able to get a hold to the
  10788. // real context instance.
  10789. contextVm = parent;
  10790. // $flow-disable-line
  10791. parent = parent._original;
  10792. }
  10793. var isCompiled = isTrue(options._compiled);
  10794. var needNormalization = !isCompiled;
  10795. this.data = data;
  10796. this.props = props;
  10797. this.children = children;
  10798. this.parent = parent;
  10799. this.listeners = data.on || emptyObject;
  10800. this.injections = resolveInject(options.inject, parent);
  10801. this.slots = function () {
  10802. if (!this$1.$slots) {
  10803. normalizeScopedSlots(
  10804. data.scopedSlots,
  10805. this$1.$slots = resolveSlots(children, parent)
  10806. );
  10807. }
  10808. return this$1.$slots
  10809. };
  10810. Object.defineProperty(this, 'scopedSlots', ({
  10811. enumerable: true,
  10812. get: function get () {
  10813. return normalizeScopedSlots(data.scopedSlots, this.slots())
  10814. }
  10815. }));
  10816. // support for compiled functional template
  10817. if (isCompiled) {
  10818. // exposing $options for renderStatic()
  10819. this.$options = options;
  10820. // pre-resolve slots for renderSlot()
  10821. this.$slots = this.slots();
  10822. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  10823. }
  10824. if (options._scopeId) {
  10825. this._c = function (a, b, c, d) {
  10826. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  10827. if (vnode && !Array.isArray(vnode)) {
  10828. vnode.fnScopeId = options._scopeId;
  10829. vnode.fnContext = parent;
  10830. }
  10831. return vnode
  10832. };
  10833. } else {
  10834. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  10835. }
  10836. }
  10837. installRenderHelpers(FunctionalRenderContext.prototype);
  10838. function createFunctionalComponent (
  10839. Ctor,
  10840. propsData,
  10841. data,
  10842. contextVm,
  10843. children
  10844. ) {
  10845. var options = Ctor.options;
  10846. var props = {};
  10847. var propOptions = options.props;
  10848. if (isDef(propOptions)) {
  10849. for (var key in propOptions) {
  10850. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  10851. }
  10852. } else {
  10853. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  10854. if (isDef(data.props)) { mergeProps(props, data.props); }
  10855. }
  10856. var renderContext = new FunctionalRenderContext(
  10857. data,
  10858. props,
  10859. children,
  10860. contextVm,
  10861. Ctor
  10862. );
  10863. var vnode = options.render.call(null, renderContext._c, renderContext);
  10864. if (vnode instanceof VNode) {
  10865. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  10866. } else if (Array.isArray(vnode)) {
  10867. var vnodes = normalizeChildren(vnode) || [];
  10868. var res = new Array(vnodes.length);
  10869. for (var i = 0; i < vnodes.length; i++) {
  10870. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  10871. }
  10872. return res
  10873. }
  10874. }
  10875. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  10876. // #7817 clone node before setting fnContext, otherwise if the node is reused
  10877. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  10878. // that should not be matched to match.
  10879. var clone = cloneVNode(vnode);
  10880. clone.fnContext = contextVm;
  10881. clone.fnOptions = options;
  10882. if (true) {
  10883. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  10884. }
  10885. if (data.slot) {
  10886. (clone.data || (clone.data = {})).slot = data.slot;
  10887. }
  10888. return clone
  10889. }
  10890. function mergeProps (to, from) {
  10891. for (var key in from) {
  10892. to[camelize(key)] = from[key];
  10893. }
  10894. }
  10895. /* */
  10896. /* */
  10897. /* */
  10898. /* */
  10899. // inline hooks to be invoked on component VNodes during patch
  10900. var componentVNodeHooks = {
  10901. init: function init (vnode, hydrating) {
  10902. if (
  10903. vnode.componentInstance &&
  10904. !vnode.componentInstance._isDestroyed &&
  10905. vnode.data.keepAlive
  10906. ) {
  10907. // kept-alive components, treat as a patch
  10908. var mountedNode = vnode; // work around flow
  10909. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  10910. } else {
  10911. var child = vnode.componentInstance = createComponentInstanceForVnode(
  10912. vnode,
  10913. activeInstance
  10914. );
  10915. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  10916. }
  10917. },
  10918. prepatch: function prepatch (oldVnode, vnode) {
  10919. var options = vnode.componentOptions;
  10920. var child = vnode.componentInstance = oldVnode.componentInstance;
  10921. updateChildComponent(
  10922. child,
  10923. options.propsData, // updated props
  10924. options.listeners, // updated listeners
  10925. vnode, // new parent vnode
  10926. options.children // new children
  10927. );
  10928. },
  10929. insert: function insert (vnode) {
  10930. var context = vnode.context;
  10931. var componentInstance = vnode.componentInstance;
  10932. if (!componentInstance._isMounted) {
  10933. callHook(componentInstance, 'onServiceCreated');
  10934. callHook(componentInstance, 'onServiceAttached');
  10935. componentInstance._isMounted = true;
  10936. callHook(componentInstance, 'mounted');
  10937. }
  10938. if (vnode.data.keepAlive) {
  10939. if (context._isMounted) {
  10940. // vue-router#1212
  10941. // During updates, a kept-alive component's child components may
  10942. // change, so directly walking the tree here may call activated hooks
  10943. // on incorrect children. Instead we push them into a queue which will
  10944. // be processed after the whole patch process ended.
  10945. queueActivatedComponent(componentInstance);
  10946. } else {
  10947. activateChildComponent(componentInstance, true /* direct */);
  10948. }
  10949. }
  10950. },
  10951. destroy: function destroy (vnode) {
  10952. var componentInstance = vnode.componentInstance;
  10953. if (!componentInstance._isDestroyed) {
  10954. if (!vnode.data.keepAlive) {
  10955. componentInstance.$destroy();
  10956. } else {
  10957. deactivateChildComponent(componentInstance, true /* direct */);
  10958. }
  10959. }
  10960. }
  10961. };
  10962. var hooksToMerge = Object.keys(componentVNodeHooks);
  10963. function createComponent (
  10964. Ctor,
  10965. data,
  10966. context,
  10967. children,
  10968. tag
  10969. ) {
  10970. if (isUndef(Ctor)) {
  10971. return
  10972. }
  10973. var baseCtor = context.$options._base;
  10974. // plain options object: turn it into a constructor
  10975. if (isObject(Ctor)) {
  10976. Ctor = baseCtor.extend(Ctor);
  10977. }
  10978. // if at this stage it's not a constructor or an async component factory,
  10979. // reject.
  10980. if (typeof Ctor !== 'function') {
  10981. if (true) {
  10982. warn(("Invalid Component definition: " + (String(Ctor))), context);
  10983. }
  10984. return
  10985. }
  10986. // async component
  10987. var asyncFactory;
  10988. if (isUndef(Ctor.cid)) {
  10989. asyncFactory = Ctor;
  10990. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  10991. if (Ctor === undefined) {
  10992. // return a placeholder node for async component, which is rendered
  10993. // as a comment node but preserves all the raw information for the node.
  10994. // the information will be used for async server-rendering and hydration.
  10995. return createAsyncPlaceholder(
  10996. asyncFactory,
  10997. data,
  10998. context,
  10999. children,
  11000. tag
  11001. )
  11002. }
  11003. }
  11004. data = data || {};
  11005. // resolve constructor options in case global mixins are applied after
  11006. // component constructor creation
  11007. resolveConstructorOptions(Ctor);
  11008. // transform component v-model data into props & events
  11009. if (isDef(data.model)) {
  11010. transformModel(Ctor.options, data);
  11011. }
  11012. // extract props
  11013. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  11014. // functional component
  11015. if (isTrue(Ctor.options.functional)) {
  11016. return createFunctionalComponent(Ctor, propsData, data, context, children)
  11017. }
  11018. // extract listeners, since these needs to be treated as
  11019. // child component listeners instead of DOM listeners
  11020. var listeners = data.on;
  11021. // replace with listeners with .native modifier
  11022. // so it gets processed during parent component patch.
  11023. data.on = data.nativeOn;
  11024. if (isTrue(Ctor.options.abstract)) {
  11025. // abstract components do not keep anything
  11026. // other than props & listeners & slot
  11027. // work around flow
  11028. var slot = data.slot;
  11029. data = {};
  11030. if (slot) {
  11031. data.slot = slot;
  11032. }
  11033. }
  11034. // install component management hooks onto the placeholder node
  11035. installComponentHooks(data);
  11036. // return a placeholder vnode
  11037. var name = Ctor.options.name || tag;
  11038. var vnode = new VNode(
  11039. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  11040. data, undefined, undefined, undefined, context,
  11041. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  11042. asyncFactory
  11043. );
  11044. return vnode
  11045. }
  11046. function createComponentInstanceForVnode (
  11047. vnode, // we know it's MountedComponentVNode but flow doesn't
  11048. parent // activeInstance in lifecycle state
  11049. ) {
  11050. var options = {
  11051. _isComponent: true,
  11052. _parentVnode: vnode,
  11053. parent: parent
  11054. };
  11055. // check inline-template render functions
  11056. var inlineTemplate = vnode.data.inlineTemplate;
  11057. if (isDef(inlineTemplate)) {
  11058. options.render = inlineTemplate.render;
  11059. options.staticRenderFns = inlineTemplate.staticRenderFns;
  11060. }
  11061. return new vnode.componentOptions.Ctor(options)
  11062. }
  11063. function installComponentHooks (data) {
  11064. var hooks = data.hook || (data.hook = {});
  11065. for (var i = 0; i < hooksToMerge.length; i++) {
  11066. var key = hooksToMerge[i];
  11067. var existing = hooks[key];
  11068. var toMerge = componentVNodeHooks[key];
  11069. if (existing !== toMerge && !(existing && existing._merged)) {
  11070. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  11071. }
  11072. }
  11073. }
  11074. function mergeHook$1 (f1, f2) {
  11075. var merged = function (a, b) {
  11076. // flow complains about extra args which is why we use any
  11077. f1(a, b);
  11078. f2(a, b);
  11079. };
  11080. merged._merged = true;
  11081. return merged
  11082. }
  11083. // transform component v-model info (value and callback) into
  11084. // prop and event handler respectively.
  11085. function transformModel (options, data) {
  11086. var prop = (options.model && options.model.prop) || 'value';
  11087. var event = (options.model && options.model.event) || 'input'
  11088. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  11089. var on = data.on || (data.on = {});
  11090. var existing = on[event];
  11091. var callback = data.model.callback;
  11092. if (isDef(existing)) {
  11093. if (
  11094. Array.isArray(existing)
  11095. ? existing.indexOf(callback) === -1
  11096. : existing !== callback
  11097. ) {
  11098. on[event] = [callback].concat(existing);
  11099. }
  11100. } else {
  11101. on[event] = callback;
  11102. }
  11103. }
  11104. /* */
  11105. var SIMPLE_NORMALIZE = 1;
  11106. var ALWAYS_NORMALIZE = 2;
  11107. // wrapper function for providing a more flexible interface
  11108. // without getting yelled at by flow
  11109. function createElement (
  11110. context,
  11111. tag,
  11112. data,
  11113. children,
  11114. normalizationType,
  11115. alwaysNormalize
  11116. ) {
  11117. if (Array.isArray(data) || isPrimitive(data)) {
  11118. normalizationType = children;
  11119. children = data;
  11120. data = undefined;
  11121. }
  11122. if (isTrue(alwaysNormalize)) {
  11123. normalizationType = ALWAYS_NORMALIZE;
  11124. }
  11125. return _createElement(context, tag, data, children, normalizationType)
  11126. }
  11127. function _createElement (
  11128. context,
  11129. tag,
  11130. data,
  11131. children,
  11132. normalizationType
  11133. ) {
  11134. if (isDef(data) && isDef((data).__ob__)) {
  11135. true && warn(
  11136. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  11137. 'Always create fresh vnode data objects in each render!',
  11138. context
  11139. );
  11140. return createEmptyVNode()
  11141. }
  11142. // object syntax in v-bind
  11143. if (isDef(data) && isDef(data.is)) {
  11144. tag = data.is;
  11145. }
  11146. if (!tag) {
  11147. // in case of component :is set to falsy value
  11148. return createEmptyVNode()
  11149. }
  11150. // warn against non-primitive key
  11151. if ( true &&
  11152. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  11153. ) {
  11154. {
  11155. warn(
  11156. 'Avoid using non-primitive value as key, ' +
  11157. 'use string/number value instead.',
  11158. context
  11159. );
  11160. }
  11161. }
  11162. // support single function children as default scoped slot
  11163. if (Array.isArray(children) &&
  11164. typeof children[0] === 'function'
  11165. ) {
  11166. data = data || {};
  11167. data.scopedSlots = { default: children[0] };
  11168. children.length = 0;
  11169. }
  11170. if (normalizationType === ALWAYS_NORMALIZE) {
  11171. children = normalizeChildren(children);
  11172. } else if (normalizationType === SIMPLE_NORMALIZE) {
  11173. children = simpleNormalizeChildren(children);
  11174. }
  11175. var vnode, ns;
  11176. if (typeof tag === 'string') {
  11177. var Ctor;
  11178. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  11179. if (config.isReservedTag(tag)) {
  11180. // platform built-in elements
  11181. if ( true && isDef(data) && isDef(data.nativeOn)) {
  11182. warn(
  11183. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  11184. context
  11185. );
  11186. }
  11187. vnode = new VNode(
  11188. config.parsePlatformTagName(tag), data, children,
  11189. undefined, undefined, context
  11190. );
  11191. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  11192. // component
  11193. vnode = createComponent(Ctor, data, context, children, tag);
  11194. } else {
  11195. // unknown or unlisted namespaced elements
  11196. // check at runtime because it may get assigned a namespace when its
  11197. // parent normalizes children
  11198. vnode = new VNode(
  11199. tag, data, children,
  11200. undefined, undefined, context
  11201. );
  11202. }
  11203. } else {
  11204. // direct component options / constructor
  11205. vnode = createComponent(tag, data, context, children);
  11206. }
  11207. if (Array.isArray(vnode)) {
  11208. return vnode
  11209. } else if (isDef(vnode)) {
  11210. if (isDef(ns)) { applyNS(vnode, ns); }
  11211. if (isDef(data)) { registerDeepBindings(data); }
  11212. return vnode
  11213. } else {
  11214. return createEmptyVNode()
  11215. }
  11216. }
  11217. function applyNS (vnode, ns, force) {
  11218. vnode.ns = ns;
  11219. if (vnode.tag === 'foreignObject') {
  11220. // use default namespace inside foreignObject
  11221. ns = undefined;
  11222. force = true;
  11223. }
  11224. if (isDef(vnode.children)) {
  11225. for (var i = 0, l = vnode.children.length; i < l; i++) {
  11226. var child = vnode.children[i];
  11227. if (isDef(child.tag) && (
  11228. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  11229. applyNS(child, ns, force);
  11230. }
  11231. }
  11232. }
  11233. }
  11234. // ref #5318
  11235. // necessary to ensure parent re-render when deep bindings like :style and
  11236. // :class are used on slot nodes
  11237. function registerDeepBindings (data) {
  11238. if (isObject(data.style)) {
  11239. traverse(data.style);
  11240. }
  11241. if (isObject(data.class)) {
  11242. traverse(data.class);
  11243. }
  11244. }
  11245. /* */
  11246. function initRender (vm) {
  11247. vm._vnode = null; // the root of the child tree
  11248. vm._staticTrees = null; // v-once cached trees
  11249. var options = vm.$options;
  11250. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  11251. var renderContext = parentVnode && parentVnode.context;
  11252. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  11253. vm.$scopedSlots = emptyObject;
  11254. // bind the createElement fn to this instance
  11255. // so that we get proper render context inside it.
  11256. // args order: tag, data, children, normalizationType, alwaysNormalize
  11257. // internal version is used by render functions compiled from templates
  11258. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  11259. // normalization is always applied for the public version, used in
  11260. // user-written render functions.
  11261. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  11262. // $attrs & $listeners are exposed for easier HOC creation.
  11263. // they need to be reactive so that HOCs using them are always updated
  11264. var parentData = parentVnode && parentVnode.data;
  11265. /* istanbul ignore else */
  11266. if (true) {
  11267. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  11268. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  11269. }, true);
  11270. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  11271. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  11272. }, true);
  11273. } else {}
  11274. }
  11275. var currentRenderingInstance = null;
  11276. function renderMixin (Vue) {
  11277. // install runtime convenience helpers
  11278. installRenderHelpers(Vue.prototype);
  11279. Vue.prototype.$nextTick = function (fn) {
  11280. return nextTick(fn, this)
  11281. };
  11282. Vue.prototype._render = function () {
  11283. var vm = this;
  11284. var ref = vm.$options;
  11285. var render = ref.render;
  11286. var _parentVnode = ref._parentVnode;
  11287. if (_parentVnode) {
  11288. vm.$scopedSlots = normalizeScopedSlots(
  11289. _parentVnode.data.scopedSlots,
  11290. vm.$slots,
  11291. vm.$scopedSlots
  11292. );
  11293. }
  11294. // set parent vnode. this allows render functions to have access
  11295. // to the data on the placeholder node.
  11296. vm.$vnode = _parentVnode;
  11297. // render self
  11298. var vnode;
  11299. try {
  11300. // There's no need to maintain a stack because all render fns are called
  11301. // separately from one another. Nested component's render fns are called
  11302. // when parent component is patched.
  11303. currentRenderingInstance = vm;
  11304. vnode = render.call(vm._renderProxy, vm.$createElement);
  11305. } catch (e) {
  11306. handleError(e, vm, "render");
  11307. // return error render result,
  11308. // or previous vnode to prevent render error causing blank component
  11309. /* istanbul ignore else */
  11310. if ( true && vm.$options.renderError) {
  11311. try {
  11312. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  11313. } catch (e) {
  11314. handleError(e, vm, "renderError");
  11315. vnode = vm._vnode;
  11316. }
  11317. } else {
  11318. vnode = vm._vnode;
  11319. }
  11320. } finally {
  11321. currentRenderingInstance = null;
  11322. }
  11323. // if the returned array contains only a single node, allow it
  11324. if (Array.isArray(vnode) && vnode.length === 1) {
  11325. vnode = vnode[0];
  11326. }
  11327. // return empty vnode in case the render function errored out
  11328. if (!(vnode instanceof VNode)) {
  11329. if ( true && Array.isArray(vnode)) {
  11330. warn(
  11331. 'Multiple root nodes returned from render function. Render function ' +
  11332. 'should return a single root node.',
  11333. vm
  11334. );
  11335. }
  11336. vnode = createEmptyVNode();
  11337. }
  11338. // set parent
  11339. vnode.parent = _parentVnode;
  11340. return vnode
  11341. };
  11342. }
  11343. /* */
  11344. function ensureCtor (comp, base) {
  11345. if (
  11346. comp.__esModule ||
  11347. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  11348. ) {
  11349. comp = comp.default;
  11350. }
  11351. return isObject(comp)
  11352. ? base.extend(comp)
  11353. : comp
  11354. }
  11355. function createAsyncPlaceholder (
  11356. factory,
  11357. data,
  11358. context,
  11359. children,
  11360. tag
  11361. ) {
  11362. var node = createEmptyVNode();
  11363. node.asyncFactory = factory;
  11364. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  11365. return node
  11366. }
  11367. function resolveAsyncComponent (
  11368. factory,
  11369. baseCtor
  11370. ) {
  11371. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  11372. return factory.errorComp
  11373. }
  11374. if (isDef(factory.resolved)) {
  11375. return factory.resolved
  11376. }
  11377. var owner = currentRenderingInstance;
  11378. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  11379. // already pending
  11380. factory.owners.push(owner);
  11381. }
  11382. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  11383. return factory.loadingComp
  11384. }
  11385. if (owner && !isDef(factory.owners)) {
  11386. var owners = factory.owners = [owner];
  11387. var sync = true;
  11388. var timerLoading = null;
  11389. var timerTimeout = null
  11390. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  11391. var forceRender = function (renderCompleted) {
  11392. for (var i = 0, l = owners.length; i < l; i++) {
  11393. (owners[i]).$forceUpdate();
  11394. }
  11395. if (renderCompleted) {
  11396. owners.length = 0;
  11397. if (timerLoading !== null) {
  11398. clearTimeout(timerLoading);
  11399. timerLoading = null;
  11400. }
  11401. if (timerTimeout !== null) {
  11402. clearTimeout(timerTimeout);
  11403. timerTimeout = null;
  11404. }
  11405. }
  11406. };
  11407. var resolve = once(function (res) {
  11408. // cache resolved
  11409. factory.resolved = ensureCtor(res, baseCtor);
  11410. // invoke callbacks only if this is not a synchronous resolve
  11411. // (async resolves are shimmed as synchronous during SSR)
  11412. if (!sync) {
  11413. forceRender(true);
  11414. } else {
  11415. owners.length = 0;
  11416. }
  11417. });
  11418. var reject = once(function (reason) {
  11419. true && warn(
  11420. "Failed to resolve async component: " + (String(factory)) +
  11421. (reason ? ("\nReason: " + reason) : '')
  11422. );
  11423. if (isDef(factory.errorComp)) {
  11424. factory.error = true;
  11425. forceRender(true);
  11426. }
  11427. });
  11428. var res = factory(resolve, reject);
  11429. if (isObject(res)) {
  11430. if (isPromise(res)) {
  11431. // () => Promise
  11432. if (isUndef(factory.resolved)) {
  11433. res.then(resolve, reject);
  11434. }
  11435. } else if (isPromise(res.component)) {
  11436. res.component.then(resolve, reject);
  11437. if (isDef(res.error)) {
  11438. factory.errorComp = ensureCtor(res.error, baseCtor);
  11439. }
  11440. if (isDef(res.loading)) {
  11441. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  11442. if (res.delay === 0) {
  11443. factory.loading = true;
  11444. } else {
  11445. timerLoading = setTimeout(function () {
  11446. timerLoading = null;
  11447. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  11448. factory.loading = true;
  11449. forceRender(false);
  11450. }
  11451. }, res.delay || 200);
  11452. }
  11453. }
  11454. if (isDef(res.timeout)) {
  11455. timerTimeout = setTimeout(function () {
  11456. timerTimeout = null;
  11457. if (isUndef(factory.resolved)) {
  11458. reject(
  11459. true
  11460. ? ("timeout (" + (res.timeout) + "ms)")
  11461. : undefined
  11462. );
  11463. }
  11464. }, res.timeout);
  11465. }
  11466. }
  11467. }
  11468. sync = false;
  11469. // return in case resolved synchronously
  11470. return factory.loading
  11471. ? factory.loadingComp
  11472. : factory.resolved
  11473. }
  11474. }
  11475. /* */
  11476. function isAsyncPlaceholder (node) {
  11477. return node.isComment && node.asyncFactory
  11478. }
  11479. /* */
  11480. function getFirstComponentChild (children) {
  11481. if (Array.isArray(children)) {
  11482. for (var i = 0; i < children.length; i++) {
  11483. var c = children[i];
  11484. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  11485. return c
  11486. }
  11487. }
  11488. }
  11489. }
  11490. /* */
  11491. /* */
  11492. function initEvents (vm) {
  11493. vm._events = Object.create(null);
  11494. vm._hasHookEvent = false;
  11495. // init parent attached events
  11496. var listeners = vm.$options._parentListeners;
  11497. if (listeners) {
  11498. updateComponentListeners(vm, listeners);
  11499. }
  11500. }
  11501. var target;
  11502. function add (event, fn) {
  11503. target.$on(event, fn);
  11504. }
  11505. function remove$1 (event, fn) {
  11506. target.$off(event, fn);
  11507. }
  11508. function createOnceHandler (event, fn) {
  11509. var _target = target;
  11510. return function onceHandler () {
  11511. var res = fn.apply(null, arguments);
  11512. if (res !== null) {
  11513. _target.$off(event, onceHandler);
  11514. }
  11515. }
  11516. }
  11517. function updateComponentListeners (
  11518. vm,
  11519. listeners,
  11520. oldListeners
  11521. ) {
  11522. target = vm;
  11523. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  11524. target = undefined;
  11525. }
  11526. function eventsMixin (Vue) {
  11527. var hookRE = /^hook:/;
  11528. Vue.prototype.$on = function (event, fn) {
  11529. var vm = this;
  11530. if (Array.isArray(event)) {
  11531. for (var i = 0, l = event.length; i < l; i++) {
  11532. vm.$on(event[i], fn);
  11533. }
  11534. } else {
  11535. (vm._events[event] || (vm._events[event] = [])).push(fn);
  11536. // optimize hook:event cost by using a boolean flag marked at registration
  11537. // instead of a hash lookup
  11538. if (hookRE.test(event)) {
  11539. vm._hasHookEvent = true;
  11540. }
  11541. }
  11542. return vm
  11543. };
  11544. Vue.prototype.$once = function (event, fn) {
  11545. var vm = this;
  11546. function on () {
  11547. vm.$off(event, on);
  11548. fn.apply(vm, arguments);
  11549. }
  11550. on.fn = fn;
  11551. vm.$on(event, on);
  11552. return vm
  11553. };
  11554. Vue.prototype.$off = function (event, fn) {
  11555. var vm = this;
  11556. // all
  11557. if (!arguments.length) {
  11558. vm._events = Object.create(null);
  11559. return vm
  11560. }
  11561. // array of events
  11562. if (Array.isArray(event)) {
  11563. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  11564. vm.$off(event[i$1], fn);
  11565. }
  11566. return vm
  11567. }
  11568. // specific event
  11569. var cbs = vm._events[event];
  11570. if (!cbs) {
  11571. return vm
  11572. }
  11573. if (!fn) {
  11574. vm._events[event] = null;
  11575. return vm
  11576. }
  11577. // specific handler
  11578. var cb;
  11579. var i = cbs.length;
  11580. while (i--) {
  11581. cb = cbs[i];
  11582. if (cb === fn || cb.fn === fn) {
  11583. cbs.splice(i, 1);
  11584. break
  11585. }
  11586. }
  11587. return vm
  11588. };
  11589. Vue.prototype.$emit = function (event) {
  11590. var vm = this;
  11591. if (true) {
  11592. var lowerCaseEvent = event.toLowerCase();
  11593. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  11594. tip(
  11595. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  11596. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  11597. "Note that HTML attributes are case-insensitive and you cannot use " +
  11598. "v-on to listen to camelCase events when using in-DOM templates. " +
  11599. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  11600. );
  11601. }
  11602. }
  11603. var cbs = vm._events[event];
  11604. if (cbs) {
  11605. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  11606. var args = toArray(arguments, 1);
  11607. var info = "event handler for \"" + event + "\"";
  11608. for (var i = 0, l = cbs.length; i < l; i++) {
  11609. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  11610. }
  11611. }
  11612. return vm
  11613. };
  11614. }
  11615. /* */
  11616. var activeInstance = null;
  11617. var isUpdatingChildComponent = false;
  11618. function setActiveInstance(vm) {
  11619. var prevActiveInstance = activeInstance;
  11620. activeInstance = vm;
  11621. return function () {
  11622. activeInstance = prevActiveInstance;
  11623. }
  11624. }
  11625. function initLifecycle (vm) {
  11626. var options = vm.$options;
  11627. // locate first non-abstract parent
  11628. var parent = options.parent;
  11629. if (parent && !options.abstract) {
  11630. while (parent.$options.abstract && parent.$parent) {
  11631. parent = parent.$parent;
  11632. }
  11633. parent.$children.push(vm);
  11634. }
  11635. vm.$parent = parent;
  11636. vm.$root = parent ? parent.$root : vm;
  11637. vm.$children = [];
  11638. vm.$refs = {};
  11639. vm._watcher = null;
  11640. vm._inactive = null;
  11641. vm._directInactive = false;
  11642. vm._isMounted = false;
  11643. vm._isDestroyed = false;
  11644. vm._isBeingDestroyed = false;
  11645. }
  11646. function lifecycleMixin (Vue) {
  11647. Vue.prototype._update = function (vnode, hydrating) {
  11648. var vm = this;
  11649. var prevEl = vm.$el;
  11650. var prevVnode = vm._vnode;
  11651. var restoreActiveInstance = setActiveInstance(vm);
  11652. vm._vnode = vnode;
  11653. // Vue.prototype.__patch__ is injected in entry points
  11654. // based on the rendering backend used.
  11655. if (!prevVnode) {
  11656. // initial render
  11657. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  11658. } else {
  11659. // updates
  11660. vm.$el = vm.__patch__(prevVnode, vnode);
  11661. }
  11662. restoreActiveInstance();
  11663. // update __vue__ reference
  11664. if (prevEl) {
  11665. prevEl.__vue__ = null;
  11666. }
  11667. if (vm.$el) {
  11668. vm.$el.__vue__ = vm;
  11669. }
  11670. // if parent is an HOC, update its $el as well
  11671. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  11672. vm.$parent.$el = vm.$el;
  11673. }
  11674. // updated hook is called by the scheduler to ensure that children are
  11675. // updated in a parent's updated hook.
  11676. };
  11677. Vue.prototype.$forceUpdate = function () {
  11678. var vm = this;
  11679. if (vm._watcher) {
  11680. vm._watcher.update();
  11681. }
  11682. };
  11683. Vue.prototype.$destroy = function () {
  11684. var vm = this;
  11685. if (vm._isBeingDestroyed) {
  11686. return
  11687. }
  11688. callHook(vm, 'beforeDestroy');
  11689. vm._isBeingDestroyed = true;
  11690. // remove self from parent
  11691. var parent = vm.$parent;
  11692. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  11693. remove(parent.$children, vm);
  11694. }
  11695. // teardown watchers
  11696. if (vm._watcher) {
  11697. vm._watcher.teardown();
  11698. }
  11699. var i = vm._watchers.length;
  11700. while (i--) {
  11701. vm._watchers[i].teardown();
  11702. }
  11703. // remove reference from data ob
  11704. // frozen object may not have observer.
  11705. if (vm._data.__ob__) {
  11706. vm._data.__ob__.vmCount--;
  11707. }
  11708. // call the last hook...
  11709. vm._isDestroyed = true;
  11710. // invoke destroy hooks on current rendered tree
  11711. vm.__patch__(vm._vnode, null);
  11712. // fire destroyed hook
  11713. callHook(vm, 'destroyed');
  11714. // turn off all instance listeners.
  11715. vm.$off();
  11716. // remove __vue__ reference
  11717. if (vm.$el) {
  11718. vm.$el.__vue__ = null;
  11719. }
  11720. // release circular reference (#6759)
  11721. if (vm.$vnode) {
  11722. vm.$vnode.parent = null;
  11723. }
  11724. };
  11725. }
  11726. function updateChildComponent (
  11727. vm,
  11728. propsData,
  11729. listeners,
  11730. parentVnode,
  11731. renderChildren
  11732. ) {
  11733. if (true) {
  11734. isUpdatingChildComponent = true;
  11735. }
  11736. // determine whether component has slot children
  11737. // we need to do this before overwriting $options._renderChildren.
  11738. // check if there are dynamic scopedSlots (hand-written or compiled but with
  11739. // dynamic slot names). Static scoped slots compiled from template has the
  11740. // "$stable" marker.
  11741. var newScopedSlots = parentVnode.data.scopedSlots;
  11742. var oldScopedSlots = vm.$scopedSlots;
  11743. var hasDynamicScopedSlot = !!(
  11744. (newScopedSlots && !newScopedSlots.$stable) ||
  11745. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  11746. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  11747. );
  11748. // Any static slot children from the parent may have changed during parent's
  11749. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  11750. // update is necessary to ensure correctness.
  11751. var needsForceUpdate = !!(
  11752. renderChildren || // has new static slots
  11753. vm.$options._renderChildren || // has old static slots
  11754. hasDynamicScopedSlot
  11755. );
  11756. vm.$options._parentVnode = parentVnode;
  11757. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  11758. if (vm._vnode) { // update child tree's parent
  11759. vm._vnode.parent = parentVnode;
  11760. }
  11761. vm.$options._renderChildren = renderChildren;
  11762. // update $attrs and $listeners hash
  11763. // these are also reactive so they may trigger child update if the child
  11764. // used them during render
  11765. vm.$attrs = parentVnode.data.attrs || emptyObject;
  11766. vm.$listeners = listeners || emptyObject;
  11767. // update props
  11768. if (propsData && vm.$options.props) {
  11769. toggleObserving(false);
  11770. var props = vm._props;
  11771. var propKeys = vm.$options._propKeys || [];
  11772. for (var i = 0; i < propKeys.length; i++) {
  11773. var key = propKeys[i];
  11774. var propOptions = vm.$options.props; // wtf flow?
  11775. props[key] = validateProp(key, propOptions, propsData, vm);
  11776. }
  11777. toggleObserving(true);
  11778. // keep a copy of raw propsData
  11779. vm.$options.propsData = propsData;
  11780. }
  11781. // fixed by xxxxxx update properties(mp runtime)
  11782. vm._$updateProperties && vm._$updateProperties(vm);
  11783. // update listeners
  11784. listeners = listeners || emptyObject;
  11785. var oldListeners = vm.$options._parentListeners;
  11786. vm.$options._parentListeners = listeners;
  11787. updateComponentListeners(vm, listeners, oldListeners);
  11788. // resolve slots + force update if has children
  11789. if (needsForceUpdate) {
  11790. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  11791. vm.$forceUpdate();
  11792. }
  11793. if (true) {
  11794. isUpdatingChildComponent = false;
  11795. }
  11796. }
  11797. function isInInactiveTree (vm) {
  11798. while (vm && (vm = vm.$parent)) {
  11799. if (vm._inactive) { return true }
  11800. }
  11801. return false
  11802. }
  11803. function activateChildComponent (vm, direct) {
  11804. if (direct) {
  11805. vm._directInactive = false;
  11806. if (isInInactiveTree(vm)) {
  11807. return
  11808. }
  11809. } else if (vm._directInactive) {
  11810. return
  11811. }
  11812. if (vm._inactive || vm._inactive === null) {
  11813. vm._inactive = false;
  11814. for (var i = 0; i < vm.$children.length; i++) {
  11815. activateChildComponent(vm.$children[i]);
  11816. }
  11817. callHook(vm, 'activated');
  11818. }
  11819. }
  11820. function deactivateChildComponent (vm, direct) {
  11821. if (direct) {
  11822. vm._directInactive = true;
  11823. if (isInInactiveTree(vm)) {
  11824. return
  11825. }
  11826. }
  11827. if (!vm._inactive) {
  11828. vm._inactive = true;
  11829. for (var i = 0; i < vm.$children.length; i++) {
  11830. deactivateChildComponent(vm.$children[i]);
  11831. }
  11832. callHook(vm, 'deactivated');
  11833. }
  11834. }
  11835. function callHook (vm, hook) {
  11836. // #7573 disable dep collection when invoking lifecycle hooks
  11837. pushTarget();
  11838. var handlers = vm.$options[hook];
  11839. var info = hook + " hook";
  11840. if (handlers) {
  11841. for (var i = 0, j = handlers.length; i < j; i++) {
  11842. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  11843. }
  11844. }
  11845. if (vm._hasHookEvent) {
  11846. vm.$emit('hook:' + hook);
  11847. }
  11848. popTarget();
  11849. }
  11850. /* */
  11851. var MAX_UPDATE_COUNT = 100;
  11852. var queue = [];
  11853. var activatedChildren = [];
  11854. var has = {};
  11855. var circular = {};
  11856. var waiting = false;
  11857. var flushing = false;
  11858. var index = 0;
  11859. /**
  11860. * Reset the scheduler's state.
  11861. */
  11862. function resetSchedulerState () {
  11863. index = queue.length = activatedChildren.length = 0;
  11864. has = {};
  11865. if (true) {
  11866. circular = {};
  11867. }
  11868. waiting = flushing = false;
  11869. }
  11870. // Async edge case #6566 requires saving the timestamp when event listeners are
  11871. // attached. However, calling performance.now() has a perf overhead especially
  11872. // if the page has thousands of event listeners. Instead, we take a timestamp
  11873. // every time the scheduler flushes and use that for all event listeners
  11874. // attached during that flush.
  11875. var currentFlushTimestamp = 0;
  11876. // Async edge case fix requires storing an event listener's attach timestamp.
  11877. var getNow = Date.now;
  11878. // Determine what event timestamp the browser is using. Annoyingly, the
  11879. // timestamp can either be hi-res (relative to page load) or low-res
  11880. // (relative to UNIX epoch), so in order to compare time we have to use the
  11881. // same timestamp type when saving the flush timestamp.
  11882. // All IE versions use low-res event timestamps, and have problematic clock
  11883. // implementations (#9632)
  11884. if (inBrowser && !isIE) {
  11885. var performance = window.performance;
  11886. if (
  11887. performance &&
  11888. typeof performance.now === 'function' &&
  11889. getNow() > document.createEvent('Event').timeStamp
  11890. ) {
  11891. // if the event timestamp, although evaluated AFTER the Date.now(), is
  11892. // smaller than it, it means the event is using a hi-res timestamp,
  11893. // and we need to use the hi-res version for event listener timestamps as
  11894. // well.
  11895. getNow = function () { return performance.now(); };
  11896. }
  11897. }
  11898. /**
  11899. * Flush both queues and run the watchers.
  11900. */
  11901. function flushSchedulerQueue () {
  11902. currentFlushTimestamp = getNow();
  11903. flushing = true;
  11904. var watcher, id;
  11905. // Sort queue before flush.
  11906. // This ensures that:
  11907. // 1. Components are updated from parent to child. (because parent is always
  11908. // created before the child)
  11909. // 2. A component's user watchers are run before its render watcher (because
  11910. // user watchers are created before the render watcher)
  11911. // 3. If a component is destroyed during a parent component's watcher run,
  11912. // its watchers can be skipped.
  11913. queue.sort(function (a, b) { return a.id - b.id; });
  11914. // do not cache length because more watchers might be pushed
  11915. // as we run existing watchers
  11916. for (index = 0; index < queue.length; index++) {
  11917. watcher = queue[index];
  11918. if (watcher.before) {
  11919. watcher.before();
  11920. }
  11921. id = watcher.id;
  11922. has[id] = null;
  11923. watcher.run();
  11924. // in dev build, check and stop circular updates.
  11925. if ( true && has[id] != null) {
  11926. circular[id] = (circular[id] || 0) + 1;
  11927. if (circular[id] > MAX_UPDATE_COUNT) {
  11928. warn(
  11929. 'You may have an infinite update loop ' + (
  11930. watcher.user
  11931. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  11932. : "in a component render function."
  11933. ),
  11934. watcher.vm
  11935. );
  11936. break
  11937. }
  11938. }
  11939. }
  11940. // keep copies of post queues before resetting state
  11941. var activatedQueue = activatedChildren.slice();
  11942. var updatedQueue = queue.slice();
  11943. resetSchedulerState();
  11944. // call component updated and activated hooks
  11945. callActivatedHooks(activatedQueue);
  11946. callUpdatedHooks(updatedQueue);
  11947. // devtool hook
  11948. /* istanbul ignore if */
  11949. if (devtools && config.devtools) {
  11950. devtools.emit('flush');
  11951. }
  11952. }
  11953. function callUpdatedHooks (queue) {
  11954. var i = queue.length;
  11955. while (i--) {
  11956. var watcher = queue[i];
  11957. var vm = watcher.vm;
  11958. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  11959. callHook(vm, 'updated');
  11960. }
  11961. }
  11962. }
  11963. /**
  11964. * Queue a kept-alive component that was activated during patch.
  11965. * The queue will be processed after the entire tree has been patched.
  11966. */
  11967. function queueActivatedComponent (vm) {
  11968. // setting _inactive to false here so that a render function can
  11969. // rely on checking whether it's in an inactive tree (e.g. router-view)
  11970. vm._inactive = false;
  11971. activatedChildren.push(vm);
  11972. }
  11973. function callActivatedHooks (queue) {
  11974. for (var i = 0; i < queue.length; i++) {
  11975. queue[i]._inactive = true;
  11976. activateChildComponent(queue[i], true /* true */);
  11977. }
  11978. }
  11979. /**
  11980. * Push a watcher into the watcher queue.
  11981. * Jobs with duplicate IDs will be skipped unless it's
  11982. * pushed when the queue is being flushed.
  11983. */
  11984. function queueWatcher (watcher) {
  11985. var id = watcher.id;
  11986. if (has[id] == null) {
  11987. has[id] = true;
  11988. if (!flushing) {
  11989. queue.push(watcher);
  11990. } else {
  11991. // if already flushing, splice the watcher based on its id
  11992. // if already past its id, it will be run next immediately.
  11993. var i = queue.length - 1;
  11994. while (i > index && queue[i].id > watcher.id) {
  11995. i--;
  11996. }
  11997. queue.splice(i + 1, 0, watcher);
  11998. }
  11999. // queue the flush
  12000. if (!waiting) {
  12001. waiting = true;
  12002. if ( true && !config.async) {
  12003. flushSchedulerQueue();
  12004. return
  12005. }
  12006. nextTick(flushSchedulerQueue);
  12007. }
  12008. }
  12009. }
  12010. /* */
  12011. var uid$2 = 0;
  12012. /**
  12013. * A watcher parses an expression, collects dependencies,
  12014. * and fires callback when the expression value changes.
  12015. * This is used for both the $watch() api and directives.
  12016. */
  12017. var Watcher = function Watcher (
  12018. vm,
  12019. expOrFn,
  12020. cb,
  12021. options,
  12022. isRenderWatcher
  12023. ) {
  12024. this.vm = vm;
  12025. if (isRenderWatcher) {
  12026. vm._watcher = this;
  12027. }
  12028. vm._watchers.push(this);
  12029. // options
  12030. if (options) {
  12031. this.deep = !!options.deep;
  12032. this.user = !!options.user;
  12033. this.lazy = !!options.lazy;
  12034. this.sync = !!options.sync;
  12035. this.before = options.before;
  12036. } else {
  12037. this.deep = this.user = this.lazy = this.sync = false;
  12038. }
  12039. this.cb = cb;
  12040. this.id = ++uid$2; // uid for batching
  12041. this.active = true;
  12042. this.dirty = this.lazy; // for lazy watchers
  12043. this.deps = [];
  12044. this.newDeps = [];
  12045. this.depIds = new _Set();
  12046. this.newDepIds = new _Set();
  12047. this.expression = true
  12048. ? expOrFn.toString()
  12049. : undefined;
  12050. // parse expression for getter
  12051. if (typeof expOrFn === 'function') {
  12052. this.getter = expOrFn;
  12053. } else {
  12054. this.getter = parsePath(expOrFn);
  12055. if (!this.getter) {
  12056. this.getter = noop;
  12057. true && warn(
  12058. "Failed watching path: \"" + expOrFn + "\" " +
  12059. 'Watcher only accepts simple dot-delimited paths. ' +
  12060. 'For full control, use a function instead.',
  12061. vm
  12062. );
  12063. }
  12064. }
  12065. this.value = this.lazy
  12066. ? undefined
  12067. : this.get();
  12068. };
  12069. /**
  12070. * Evaluate the getter, and re-collect dependencies.
  12071. */
  12072. Watcher.prototype.get = function get () {
  12073. pushTarget(this);
  12074. var value;
  12075. var vm = this.vm;
  12076. try {
  12077. value = this.getter.call(vm, vm);
  12078. } catch (e) {
  12079. if (this.user) {
  12080. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  12081. } else {
  12082. throw e
  12083. }
  12084. } finally {
  12085. // "touch" every property so they are all tracked as
  12086. // dependencies for deep watching
  12087. if (this.deep) {
  12088. traverse(value);
  12089. }
  12090. popTarget();
  12091. this.cleanupDeps();
  12092. }
  12093. return value
  12094. };
  12095. /**
  12096. * Add a dependency to this directive.
  12097. */
  12098. Watcher.prototype.addDep = function addDep (dep) {
  12099. var id = dep.id;
  12100. if (!this.newDepIds.has(id)) {
  12101. this.newDepIds.add(id);
  12102. this.newDeps.push(dep);
  12103. if (!this.depIds.has(id)) {
  12104. dep.addSub(this);
  12105. }
  12106. }
  12107. };
  12108. /**
  12109. * Clean up for dependency collection.
  12110. */
  12111. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  12112. var i = this.deps.length;
  12113. while (i--) {
  12114. var dep = this.deps[i];
  12115. if (!this.newDepIds.has(dep.id)) {
  12116. dep.removeSub(this);
  12117. }
  12118. }
  12119. var tmp = this.depIds;
  12120. this.depIds = this.newDepIds;
  12121. this.newDepIds = tmp;
  12122. this.newDepIds.clear();
  12123. tmp = this.deps;
  12124. this.deps = this.newDeps;
  12125. this.newDeps = tmp;
  12126. this.newDeps.length = 0;
  12127. };
  12128. /**
  12129. * Subscriber interface.
  12130. * Will be called when a dependency changes.
  12131. */
  12132. Watcher.prototype.update = function update () {
  12133. /* istanbul ignore else */
  12134. if (this.lazy) {
  12135. this.dirty = true;
  12136. } else if (this.sync) {
  12137. this.run();
  12138. } else {
  12139. queueWatcher(this);
  12140. }
  12141. };
  12142. /**
  12143. * Scheduler job interface.
  12144. * Will be called by the scheduler.
  12145. */
  12146. Watcher.prototype.run = function run () {
  12147. if (this.active) {
  12148. var value = this.get();
  12149. if (
  12150. value !== this.value ||
  12151. // Deep watchers and watchers on Object/Arrays should fire even
  12152. // when the value is the same, because the value may
  12153. // have mutated.
  12154. isObject(value) ||
  12155. this.deep
  12156. ) {
  12157. // set new value
  12158. var oldValue = this.value;
  12159. this.value = value;
  12160. if (this.user) {
  12161. try {
  12162. this.cb.call(this.vm, value, oldValue);
  12163. } catch (e) {
  12164. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  12165. }
  12166. } else {
  12167. this.cb.call(this.vm, value, oldValue);
  12168. }
  12169. }
  12170. }
  12171. };
  12172. /**
  12173. * Evaluate the value of the watcher.
  12174. * This only gets called for lazy watchers.
  12175. */
  12176. Watcher.prototype.evaluate = function evaluate () {
  12177. this.value = this.get();
  12178. this.dirty = false;
  12179. };
  12180. /**
  12181. * Depend on all deps collected by this watcher.
  12182. */
  12183. Watcher.prototype.depend = function depend () {
  12184. var i = this.deps.length;
  12185. while (i--) {
  12186. this.deps[i].depend();
  12187. }
  12188. };
  12189. /**
  12190. * Remove self from all dependencies' subscriber list.
  12191. */
  12192. Watcher.prototype.teardown = function teardown () {
  12193. if (this.active) {
  12194. // remove self from vm's watcher list
  12195. // this is a somewhat expensive operation so we skip it
  12196. // if the vm is being destroyed.
  12197. if (!this.vm._isBeingDestroyed) {
  12198. remove(this.vm._watchers, this);
  12199. }
  12200. var i = this.deps.length;
  12201. while (i--) {
  12202. this.deps[i].removeSub(this);
  12203. }
  12204. this.active = false;
  12205. }
  12206. };
  12207. /* */
  12208. var sharedPropertyDefinition = {
  12209. enumerable: true,
  12210. configurable: true,
  12211. get: noop,
  12212. set: noop
  12213. };
  12214. function proxy (target, sourceKey, key) {
  12215. sharedPropertyDefinition.get = function proxyGetter () {
  12216. return this[sourceKey][key]
  12217. };
  12218. sharedPropertyDefinition.set = function proxySetter (val) {
  12219. this[sourceKey][key] = val;
  12220. };
  12221. Object.defineProperty(target, key, sharedPropertyDefinition);
  12222. }
  12223. function initState (vm) {
  12224. vm._watchers = [];
  12225. var opts = vm.$options;
  12226. if (opts.props) { initProps(vm, opts.props); }
  12227. if (opts.methods) { initMethods(vm, opts.methods); }
  12228. if (opts.data) {
  12229. initData(vm);
  12230. } else {
  12231. observe(vm._data = {}, true /* asRootData */);
  12232. }
  12233. if (opts.computed) { initComputed(vm, opts.computed); }
  12234. if (opts.watch && opts.watch !== nativeWatch) {
  12235. initWatch(vm, opts.watch);
  12236. }
  12237. }
  12238. function initProps (vm, propsOptions) {
  12239. var propsData = vm.$options.propsData || {};
  12240. var props = vm._props = {};
  12241. // cache prop keys so that future props updates can iterate using Array
  12242. // instead of dynamic object key enumeration.
  12243. var keys = vm.$options._propKeys = [];
  12244. var isRoot = !vm.$parent;
  12245. // root instance props should be converted
  12246. if (!isRoot) {
  12247. toggleObserving(false);
  12248. }
  12249. var loop = function ( key ) {
  12250. keys.push(key);
  12251. var value = validateProp(key, propsOptions, propsData, vm);
  12252. /* istanbul ignore else */
  12253. if (true) {
  12254. var hyphenatedKey = hyphenate(key);
  12255. if (isReservedAttribute(hyphenatedKey) ||
  12256. config.isReservedAttr(hyphenatedKey)) {
  12257. warn(
  12258. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  12259. vm
  12260. );
  12261. }
  12262. defineReactive$$1(props, key, value, function () {
  12263. if (!isRoot && !isUpdatingChildComponent) {
  12264. {
  12265. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  12266. return
  12267. }
  12268. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  12269. if(
  12270. key === 'value' &&
  12271. Array.isArray(vm.$options.behaviors) &&
  12272. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12273. ){
  12274. return
  12275. }
  12276. if(vm._getFormData){
  12277. return
  12278. }
  12279. var $parent = vm.$parent;
  12280. while($parent){
  12281. if($parent.__next_tick_pending){
  12282. return
  12283. }
  12284. $parent = $parent.$parent;
  12285. }
  12286. }
  12287. warn(
  12288. "Avoid mutating a prop directly since the value will be " +
  12289. "overwritten whenever the parent component re-renders. " +
  12290. "Instead, use a data or computed property based on the prop's " +
  12291. "value. Prop being mutated: \"" + key + "\"",
  12292. vm
  12293. );
  12294. }
  12295. });
  12296. } else {}
  12297. // static props are already proxied on the component's prototype
  12298. // during Vue.extend(). We only need to proxy props defined at
  12299. // instantiation here.
  12300. if (!(key in vm)) {
  12301. proxy(vm, "_props", key);
  12302. }
  12303. };
  12304. for (var key in propsOptions) loop( key );
  12305. toggleObserving(true);
  12306. }
  12307. function initData (vm) {
  12308. var data = vm.$options.data;
  12309. data = vm._data = typeof data === 'function'
  12310. ? getData(data, vm)
  12311. : data || {};
  12312. if (!isPlainObject(data)) {
  12313. data = {};
  12314. true && warn(
  12315. 'data functions should return an object:\n' +
  12316. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  12317. vm
  12318. );
  12319. }
  12320. // proxy data on instance
  12321. var keys = Object.keys(data);
  12322. var props = vm.$options.props;
  12323. var methods = vm.$options.methods;
  12324. var i = keys.length;
  12325. while (i--) {
  12326. var key = keys[i];
  12327. if (true) {
  12328. if (methods && hasOwn(methods, key)) {
  12329. warn(
  12330. ("Method \"" + key + "\" has already been defined as a data property."),
  12331. vm
  12332. );
  12333. }
  12334. }
  12335. if (props && hasOwn(props, key)) {
  12336. true && warn(
  12337. "The data property \"" + key + "\" is already declared as a prop. " +
  12338. "Use prop default value instead.",
  12339. vm
  12340. );
  12341. } else if (!isReserved(key)) {
  12342. proxy(vm, "_data", key);
  12343. }
  12344. }
  12345. // observe data
  12346. observe(data, true /* asRootData */);
  12347. }
  12348. function getData (data, vm) {
  12349. // #7573 disable dep collection when invoking data getters
  12350. pushTarget();
  12351. try {
  12352. return data.call(vm, vm)
  12353. } catch (e) {
  12354. handleError(e, vm, "data()");
  12355. return {}
  12356. } finally {
  12357. popTarget();
  12358. }
  12359. }
  12360. var computedWatcherOptions = { lazy: true };
  12361. function initComputed (vm, computed) {
  12362. // $flow-disable-line
  12363. var watchers = vm._computedWatchers = Object.create(null);
  12364. // computed properties are just getters during SSR
  12365. var isSSR = isServerRendering();
  12366. for (var key in computed) {
  12367. var userDef = computed[key];
  12368. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  12369. if ( true && getter == null) {
  12370. warn(
  12371. ("Getter is missing for computed property \"" + key + "\"."),
  12372. vm
  12373. );
  12374. }
  12375. if (!isSSR) {
  12376. // create internal watcher for the computed property.
  12377. watchers[key] = new Watcher(
  12378. vm,
  12379. getter || noop,
  12380. noop,
  12381. computedWatcherOptions
  12382. );
  12383. }
  12384. // component-defined computed properties are already defined on the
  12385. // component prototype. We only need to define computed properties defined
  12386. // at instantiation here.
  12387. if (!(key in vm)) {
  12388. defineComputed(vm, key, userDef);
  12389. } else if (true) {
  12390. if (key in vm.$data) {
  12391. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  12392. } else if (vm.$options.props && key in vm.$options.props) {
  12393. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  12394. }
  12395. }
  12396. }
  12397. }
  12398. function defineComputed (
  12399. target,
  12400. key,
  12401. userDef
  12402. ) {
  12403. var shouldCache = !isServerRendering();
  12404. if (typeof userDef === 'function') {
  12405. sharedPropertyDefinition.get = shouldCache
  12406. ? createComputedGetter(key)
  12407. : createGetterInvoker(userDef);
  12408. sharedPropertyDefinition.set = noop;
  12409. } else {
  12410. sharedPropertyDefinition.get = userDef.get
  12411. ? shouldCache && userDef.cache !== false
  12412. ? createComputedGetter(key)
  12413. : createGetterInvoker(userDef.get)
  12414. : noop;
  12415. sharedPropertyDefinition.set = userDef.set || noop;
  12416. }
  12417. if ( true &&
  12418. sharedPropertyDefinition.set === noop) {
  12419. sharedPropertyDefinition.set = function () {
  12420. warn(
  12421. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  12422. this
  12423. );
  12424. };
  12425. }
  12426. Object.defineProperty(target, key, sharedPropertyDefinition);
  12427. }
  12428. function createComputedGetter (key) {
  12429. return function computedGetter () {
  12430. var watcher = this._computedWatchers && this._computedWatchers[key];
  12431. if (watcher) {
  12432. if (watcher.dirty) {
  12433. watcher.evaluate();
  12434. }
  12435. if (Dep.SharedObject.target) {// fixed by xxxxxx
  12436. watcher.depend();
  12437. }
  12438. return watcher.value
  12439. }
  12440. }
  12441. }
  12442. function createGetterInvoker(fn) {
  12443. return function computedGetter () {
  12444. return fn.call(this, this)
  12445. }
  12446. }
  12447. function initMethods (vm, methods) {
  12448. var props = vm.$options.props;
  12449. for (var key in methods) {
  12450. if (true) {
  12451. if (typeof methods[key] !== 'function') {
  12452. warn(
  12453. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  12454. "Did you reference the function correctly?",
  12455. vm
  12456. );
  12457. }
  12458. if (props && hasOwn(props, key)) {
  12459. warn(
  12460. ("Method \"" + key + "\" has already been defined as a prop."),
  12461. vm
  12462. );
  12463. }
  12464. if ((key in vm) && isReserved(key)) {
  12465. warn(
  12466. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  12467. "Avoid defining component methods that start with _ or $."
  12468. );
  12469. }
  12470. }
  12471. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  12472. }
  12473. }
  12474. function initWatch (vm, watch) {
  12475. for (var key in watch) {
  12476. var handler = watch[key];
  12477. if (Array.isArray(handler)) {
  12478. for (var i = 0; i < handler.length; i++) {
  12479. createWatcher(vm, key, handler[i]);
  12480. }
  12481. } else {
  12482. createWatcher(vm, key, handler);
  12483. }
  12484. }
  12485. }
  12486. function createWatcher (
  12487. vm,
  12488. expOrFn,
  12489. handler,
  12490. options
  12491. ) {
  12492. if (isPlainObject(handler)) {
  12493. options = handler;
  12494. handler = handler.handler;
  12495. }
  12496. if (typeof handler === 'string') {
  12497. handler = vm[handler];
  12498. }
  12499. return vm.$watch(expOrFn, handler, options)
  12500. }
  12501. function stateMixin (Vue) {
  12502. // flow somehow has problems with directly declared definition object
  12503. // when using Object.defineProperty, so we have to procedurally build up
  12504. // the object here.
  12505. var dataDef = {};
  12506. dataDef.get = function () { return this._data };
  12507. var propsDef = {};
  12508. propsDef.get = function () { return this._props };
  12509. if (true) {
  12510. dataDef.set = function () {
  12511. warn(
  12512. 'Avoid replacing instance root $data. ' +
  12513. 'Use nested data properties instead.',
  12514. this
  12515. );
  12516. };
  12517. propsDef.set = function () {
  12518. warn("$props is readonly.", this);
  12519. };
  12520. }
  12521. Object.defineProperty(Vue.prototype, '$data', dataDef);
  12522. Object.defineProperty(Vue.prototype, '$props', propsDef);
  12523. Vue.prototype.$set = set;
  12524. Vue.prototype.$delete = del;
  12525. Vue.prototype.$watch = function (
  12526. expOrFn,
  12527. cb,
  12528. options
  12529. ) {
  12530. var vm = this;
  12531. if (isPlainObject(cb)) {
  12532. return createWatcher(vm, expOrFn, cb, options)
  12533. }
  12534. options = options || {};
  12535. options.user = true;
  12536. var watcher = new Watcher(vm, expOrFn, cb, options);
  12537. if (options.immediate) {
  12538. try {
  12539. cb.call(vm, watcher.value);
  12540. } catch (error) {
  12541. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  12542. }
  12543. }
  12544. return function unwatchFn () {
  12545. watcher.teardown();
  12546. }
  12547. };
  12548. }
  12549. /* */
  12550. var uid$3 = 0;
  12551. function initMixin (Vue) {
  12552. Vue.prototype._init = function (options) {
  12553. var vm = this;
  12554. // a uid
  12555. vm._uid = uid$3++;
  12556. var startTag, endTag;
  12557. /* istanbul ignore if */
  12558. if ( true && config.performance && mark) {
  12559. startTag = "vue-perf-start:" + (vm._uid);
  12560. endTag = "vue-perf-end:" + (vm._uid);
  12561. mark(startTag);
  12562. }
  12563. // a flag to avoid this being observed
  12564. vm._isVue = true;
  12565. // merge options
  12566. if (options && options._isComponent) {
  12567. // optimize internal component instantiation
  12568. // since dynamic options merging is pretty slow, and none of the
  12569. // internal component options needs special treatment.
  12570. initInternalComponent(vm, options);
  12571. } else {
  12572. vm.$options = mergeOptions(
  12573. resolveConstructorOptions(vm.constructor),
  12574. options || {},
  12575. vm
  12576. );
  12577. }
  12578. /* istanbul ignore else */
  12579. if (true) {
  12580. initProxy(vm);
  12581. } else {}
  12582. // expose real self
  12583. vm._self = vm;
  12584. initLifecycle(vm);
  12585. initEvents(vm);
  12586. initRender(vm);
  12587. callHook(vm, 'beforeCreate');
  12588. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  12589. initState(vm);
  12590. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  12591. !vm._$fallback && callHook(vm, 'created');
  12592. /* istanbul ignore if */
  12593. if ( true && config.performance && mark) {
  12594. vm._name = formatComponentName(vm, false);
  12595. mark(endTag);
  12596. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  12597. }
  12598. if (vm.$options.el) {
  12599. vm.$mount(vm.$options.el);
  12600. }
  12601. };
  12602. }
  12603. function initInternalComponent (vm, options) {
  12604. var opts = vm.$options = Object.create(vm.constructor.options);
  12605. // doing this because it's faster than dynamic enumeration.
  12606. var parentVnode = options._parentVnode;
  12607. opts.parent = options.parent;
  12608. opts._parentVnode = parentVnode;
  12609. var vnodeComponentOptions = parentVnode.componentOptions;
  12610. opts.propsData = vnodeComponentOptions.propsData;
  12611. opts._parentListeners = vnodeComponentOptions.listeners;
  12612. opts._renderChildren = vnodeComponentOptions.children;
  12613. opts._componentTag = vnodeComponentOptions.tag;
  12614. if (options.render) {
  12615. opts.render = options.render;
  12616. opts.staticRenderFns = options.staticRenderFns;
  12617. }
  12618. }
  12619. function resolveConstructorOptions (Ctor) {
  12620. var options = Ctor.options;
  12621. if (Ctor.super) {
  12622. var superOptions = resolveConstructorOptions(Ctor.super);
  12623. var cachedSuperOptions = Ctor.superOptions;
  12624. if (superOptions !== cachedSuperOptions) {
  12625. // super option changed,
  12626. // need to resolve new options.
  12627. Ctor.superOptions = superOptions;
  12628. // check if there are any late-modified/attached options (#4976)
  12629. var modifiedOptions = resolveModifiedOptions(Ctor);
  12630. // update base extend options
  12631. if (modifiedOptions) {
  12632. extend(Ctor.extendOptions, modifiedOptions);
  12633. }
  12634. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  12635. if (options.name) {
  12636. options.components[options.name] = Ctor;
  12637. }
  12638. }
  12639. }
  12640. return options
  12641. }
  12642. function resolveModifiedOptions (Ctor) {
  12643. var modified;
  12644. var latest = Ctor.options;
  12645. var sealed = Ctor.sealedOptions;
  12646. for (var key in latest) {
  12647. if (latest[key] !== sealed[key]) {
  12648. if (!modified) { modified = {}; }
  12649. modified[key] = latest[key];
  12650. }
  12651. }
  12652. return modified
  12653. }
  12654. function Vue (options) {
  12655. if ( true &&
  12656. !(this instanceof Vue)
  12657. ) {
  12658. warn('Vue is a constructor and should be called with the `new` keyword');
  12659. }
  12660. this._init(options);
  12661. }
  12662. initMixin(Vue);
  12663. stateMixin(Vue);
  12664. eventsMixin(Vue);
  12665. lifecycleMixin(Vue);
  12666. renderMixin(Vue);
  12667. /* */
  12668. function initUse (Vue) {
  12669. Vue.use = function (plugin) {
  12670. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  12671. if (installedPlugins.indexOf(plugin) > -1) {
  12672. return this
  12673. }
  12674. // additional parameters
  12675. var args = toArray(arguments, 1);
  12676. args.unshift(this);
  12677. if (typeof plugin.install === 'function') {
  12678. plugin.install.apply(plugin, args);
  12679. } else if (typeof plugin === 'function') {
  12680. plugin.apply(null, args);
  12681. }
  12682. installedPlugins.push(plugin);
  12683. return this
  12684. };
  12685. }
  12686. /* */
  12687. function initMixin$1 (Vue) {
  12688. Vue.mixin = function (mixin) {
  12689. this.options = mergeOptions(this.options, mixin);
  12690. return this
  12691. };
  12692. }
  12693. /* */
  12694. function initExtend (Vue) {
  12695. /**
  12696. * Each instance constructor, including Vue, has a unique
  12697. * cid. This enables us to create wrapped "child
  12698. * constructors" for prototypal inheritance and cache them.
  12699. */
  12700. Vue.cid = 0;
  12701. var cid = 1;
  12702. /**
  12703. * Class inheritance
  12704. */
  12705. Vue.extend = function (extendOptions) {
  12706. extendOptions = extendOptions || {};
  12707. var Super = this;
  12708. var SuperId = Super.cid;
  12709. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  12710. if (cachedCtors[SuperId]) {
  12711. return cachedCtors[SuperId]
  12712. }
  12713. var name = extendOptions.name || Super.options.name;
  12714. if ( true && name) {
  12715. validateComponentName(name);
  12716. }
  12717. var Sub = function VueComponent (options) {
  12718. this._init(options);
  12719. };
  12720. Sub.prototype = Object.create(Super.prototype);
  12721. Sub.prototype.constructor = Sub;
  12722. Sub.cid = cid++;
  12723. Sub.options = mergeOptions(
  12724. Super.options,
  12725. extendOptions
  12726. );
  12727. Sub['super'] = Super;
  12728. // For props and computed properties, we define the proxy getters on
  12729. // the Vue instances at extension time, on the extended prototype. This
  12730. // avoids Object.defineProperty calls for each instance created.
  12731. if (Sub.options.props) {
  12732. initProps$1(Sub);
  12733. }
  12734. if (Sub.options.computed) {
  12735. initComputed$1(Sub);
  12736. }
  12737. // allow further extension/mixin/plugin usage
  12738. Sub.extend = Super.extend;
  12739. Sub.mixin = Super.mixin;
  12740. Sub.use = Super.use;
  12741. // create asset registers, so extended classes
  12742. // can have their private assets too.
  12743. ASSET_TYPES.forEach(function (type) {
  12744. Sub[type] = Super[type];
  12745. });
  12746. // enable recursive self-lookup
  12747. if (name) {
  12748. Sub.options.components[name] = Sub;
  12749. }
  12750. // keep a reference to the super options at extension time.
  12751. // later at instantiation we can check if Super's options have
  12752. // been updated.
  12753. Sub.superOptions = Super.options;
  12754. Sub.extendOptions = extendOptions;
  12755. Sub.sealedOptions = extend({}, Sub.options);
  12756. // cache constructor
  12757. cachedCtors[SuperId] = Sub;
  12758. return Sub
  12759. };
  12760. }
  12761. function initProps$1 (Comp) {
  12762. var props = Comp.options.props;
  12763. for (var key in props) {
  12764. proxy(Comp.prototype, "_props", key);
  12765. }
  12766. }
  12767. function initComputed$1 (Comp) {
  12768. var computed = Comp.options.computed;
  12769. for (var key in computed) {
  12770. defineComputed(Comp.prototype, key, computed[key]);
  12771. }
  12772. }
  12773. /* */
  12774. function initAssetRegisters (Vue) {
  12775. /**
  12776. * Create asset registration methods.
  12777. */
  12778. ASSET_TYPES.forEach(function (type) {
  12779. Vue[type] = function (
  12780. id,
  12781. definition
  12782. ) {
  12783. if (!definition) {
  12784. return this.options[type + 's'][id]
  12785. } else {
  12786. /* istanbul ignore if */
  12787. if ( true && type === 'component') {
  12788. validateComponentName(id);
  12789. }
  12790. if (type === 'component' && isPlainObject(definition)) {
  12791. definition.name = definition.name || id;
  12792. definition = this.options._base.extend(definition);
  12793. }
  12794. if (type === 'directive' && typeof definition === 'function') {
  12795. definition = { bind: definition, update: definition };
  12796. }
  12797. this.options[type + 's'][id] = definition;
  12798. return definition
  12799. }
  12800. };
  12801. });
  12802. }
  12803. /* */
  12804. function getComponentName (opts) {
  12805. return opts && (opts.Ctor.options.name || opts.tag)
  12806. }
  12807. function matches (pattern, name) {
  12808. if (Array.isArray(pattern)) {
  12809. return pattern.indexOf(name) > -1
  12810. } else if (typeof pattern === 'string') {
  12811. return pattern.split(',').indexOf(name) > -1
  12812. } else if (isRegExp(pattern)) {
  12813. return pattern.test(name)
  12814. }
  12815. /* istanbul ignore next */
  12816. return false
  12817. }
  12818. function pruneCache (keepAliveInstance, filter) {
  12819. var cache = keepAliveInstance.cache;
  12820. var keys = keepAliveInstance.keys;
  12821. var _vnode = keepAliveInstance._vnode;
  12822. for (var key in cache) {
  12823. var cachedNode = cache[key];
  12824. if (cachedNode) {
  12825. var name = getComponentName(cachedNode.componentOptions);
  12826. if (name && !filter(name)) {
  12827. pruneCacheEntry(cache, key, keys, _vnode);
  12828. }
  12829. }
  12830. }
  12831. }
  12832. function pruneCacheEntry (
  12833. cache,
  12834. key,
  12835. keys,
  12836. current
  12837. ) {
  12838. var cached$$1 = cache[key];
  12839. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  12840. cached$$1.componentInstance.$destroy();
  12841. }
  12842. cache[key] = null;
  12843. remove(keys, key);
  12844. }
  12845. var patternTypes = [String, RegExp, Array];
  12846. var KeepAlive = {
  12847. name: 'keep-alive',
  12848. abstract: true,
  12849. props: {
  12850. include: patternTypes,
  12851. exclude: patternTypes,
  12852. max: [String, Number]
  12853. },
  12854. created: function created () {
  12855. this.cache = Object.create(null);
  12856. this.keys = [];
  12857. },
  12858. destroyed: function destroyed () {
  12859. for (var key in this.cache) {
  12860. pruneCacheEntry(this.cache, key, this.keys);
  12861. }
  12862. },
  12863. mounted: function mounted () {
  12864. var this$1 = this;
  12865. this.$watch('include', function (val) {
  12866. pruneCache(this$1, function (name) { return matches(val, name); });
  12867. });
  12868. this.$watch('exclude', function (val) {
  12869. pruneCache(this$1, function (name) { return !matches(val, name); });
  12870. });
  12871. },
  12872. render: function render () {
  12873. var slot = this.$slots.default;
  12874. var vnode = getFirstComponentChild(slot);
  12875. var componentOptions = vnode && vnode.componentOptions;
  12876. if (componentOptions) {
  12877. // check pattern
  12878. var name = getComponentName(componentOptions);
  12879. var ref = this;
  12880. var include = ref.include;
  12881. var exclude = ref.exclude;
  12882. if (
  12883. // not included
  12884. (include && (!name || !matches(include, name))) ||
  12885. // excluded
  12886. (exclude && name && matches(exclude, name))
  12887. ) {
  12888. return vnode
  12889. }
  12890. var ref$1 = this;
  12891. var cache = ref$1.cache;
  12892. var keys = ref$1.keys;
  12893. var key = vnode.key == null
  12894. // same constructor may get registered as different local components
  12895. // so cid alone is not enough (#3269)
  12896. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  12897. : vnode.key;
  12898. if (cache[key]) {
  12899. vnode.componentInstance = cache[key].componentInstance;
  12900. // make current key freshest
  12901. remove(keys, key);
  12902. keys.push(key);
  12903. } else {
  12904. cache[key] = vnode;
  12905. keys.push(key);
  12906. // prune oldest entry
  12907. if (this.max && keys.length > parseInt(this.max)) {
  12908. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  12909. }
  12910. }
  12911. vnode.data.keepAlive = true;
  12912. }
  12913. return vnode || (slot && slot[0])
  12914. }
  12915. };
  12916. var builtInComponents = {
  12917. KeepAlive: KeepAlive
  12918. };
  12919. /* */
  12920. function initGlobalAPI (Vue) {
  12921. // config
  12922. var configDef = {};
  12923. configDef.get = function () { return config; };
  12924. if (true) {
  12925. configDef.set = function () {
  12926. warn(
  12927. 'Do not replace the Vue.config object, set individual fields instead.'
  12928. );
  12929. };
  12930. }
  12931. Object.defineProperty(Vue, 'config', configDef);
  12932. // exposed util methods.
  12933. // NOTE: these are not considered part of the public API - avoid relying on
  12934. // them unless you are aware of the risk.
  12935. Vue.util = {
  12936. warn: warn,
  12937. extend: extend,
  12938. mergeOptions: mergeOptions,
  12939. defineReactive: defineReactive$$1
  12940. };
  12941. Vue.set = set;
  12942. Vue.delete = del;
  12943. Vue.nextTick = nextTick;
  12944. // 2.6 explicit observable API
  12945. Vue.observable = function (obj) {
  12946. observe(obj);
  12947. return obj
  12948. };
  12949. Vue.options = Object.create(null);
  12950. ASSET_TYPES.forEach(function (type) {
  12951. Vue.options[type + 's'] = Object.create(null);
  12952. });
  12953. // this is used to identify the "base" constructor to extend all plain-object
  12954. // components with in Weex's multi-instance scenarios.
  12955. Vue.options._base = Vue;
  12956. extend(Vue.options.components, builtInComponents);
  12957. initUse(Vue);
  12958. initMixin$1(Vue);
  12959. initExtend(Vue);
  12960. initAssetRegisters(Vue);
  12961. }
  12962. initGlobalAPI(Vue);
  12963. Object.defineProperty(Vue.prototype, '$isServer', {
  12964. get: isServerRendering
  12965. });
  12966. Object.defineProperty(Vue.prototype, '$ssrContext', {
  12967. get: function get () {
  12968. /* istanbul ignore next */
  12969. return this.$vnode && this.$vnode.ssrContext
  12970. }
  12971. });
  12972. // expose FunctionalRenderContext for ssr runtime helper installation
  12973. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  12974. value: FunctionalRenderContext
  12975. });
  12976. Vue.version = '2.6.11';
  12977. /**
  12978. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  12979. */
  12980. var ARRAYTYPE = '[object Array]';
  12981. var OBJECTTYPE = '[object Object]';
  12982. // const FUNCTIONTYPE = '[object Function]'
  12983. function diff(current, pre) {
  12984. var result = {};
  12985. syncKeys(current, pre);
  12986. _diff(current, pre, '', result);
  12987. return result
  12988. }
  12989. function syncKeys(current, pre) {
  12990. if (current === pre) { return }
  12991. var rootCurrentType = type(current);
  12992. var rootPreType = type(pre);
  12993. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  12994. if(Object.keys(current).length >= Object.keys(pre).length){
  12995. for (var key in pre) {
  12996. var currentValue = current[key];
  12997. if (currentValue === undefined) {
  12998. current[key] = null;
  12999. } else {
  13000. syncKeys(currentValue, pre[key]);
  13001. }
  13002. }
  13003. }
  13004. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  13005. if (current.length >= pre.length) {
  13006. pre.forEach(function (item, index) {
  13007. syncKeys(current[index], item);
  13008. });
  13009. }
  13010. }
  13011. }
  13012. function _diff(current, pre, path, result) {
  13013. if (current === pre) { return }
  13014. var rootCurrentType = type(current);
  13015. var rootPreType = type(pre);
  13016. if (rootCurrentType == OBJECTTYPE) {
  13017. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  13018. setResult(result, path, current);
  13019. } else {
  13020. var loop = function ( key ) {
  13021. var currentValue = current[key];
  13022. var preValue = pre[key];
  13023. var currentType = type(currentValue);
  13024. var preType = type(preValue);
  13025. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  13026. if (currentValue !== pre[key]) {
  13027. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13028. }
  13029. } else if (currentType == ARRAYTYPE) {
  13030. if (preType != ARRAYTYPE) {
  13031. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13032. } else {
  13033. if (currentValue.length < preValue.length) {
  13034. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13035. } else {
  13036. currentValue.forEach(function (item, index) {
  13037. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  13038. });
  13039. }
  13040. }
  13041. } else if (currentType == OBJECTTYPE) {
  13042. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  13043. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13044. } else {
  13045. for (var subKey in currentValue) {
  13046. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  13047. }
  13048. }
  13049. }
  13050. };
  13051. for (var key in current) loop( key );
  13052. }
  13053. } else if (rootCurrentType == ARRAYTYPE) {
  13054. if (rootPreType != ARRAYTYPE) {
  13055. setResult(result, path, current);
  13056. } else {
  13057. if (current.length < pre.length) {
  13058. setResult(result, path, current);
  13059. } else {
  13060. current.forEach(function (item, index) {
  13061. _diff(item, pre[index], path + '[' + index + ']', result);
  13062. });
  13063. }
  13064. }
  13065. } else {
  13066. setResult(result, path, current);
  13067. }
  13068. }
  13069. function setResult(result, k, v) {
  13070. // if (type(v) != FUNCTIONTYPE) {
  13071. result[k] = v;
  13072. // }
  13073. }
  13074. function type(obj) {
  13075. return Object.prototype.toString.call(obj)
  13076. }
  13077. /* */
  13078. function flushCallbacks$1(vm) {
  13079. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  13080. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  13081. var mpInstance = vm.$scope;
  13082. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  13083. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  13084. }
  13085. var copies = vm.__next_tick_callbacks.slice(0);
  13086. vm.__next_tick_callbacks.length = 0;
  13087. for (var i = 0; i < copies.length; i++) {
  13088. copies[i]();
  13089. }
  13090. }
  13091. }
  13092. function hasRenderWatcher(vm) {
  13093. return queue.find(function (watcher) { return vm._watcher === watcher; })
  13094. }
  13095. function nextTick$1(vm, cb) {
  13096. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  13097. //2.nextTick 之前存在 render watcher
  13098. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  13099. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  13100. var mpInstance = vm.$scope;
  13101. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  13102. ']:nextVueTick');
  13103. }
  13104. return nextTick(cb, vm)
  13105. }else{
  13106. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  13107. var mpInstance$1 = vm.$scope;
  13108. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  13109. ']:nextMPTick');
  13110. }
  13111. }
  13112. var _resolve;
  13113. if (!vm.__next_tick_callbacks) {
  13114. vm.__next_tick_callbacks = [];
  13115. }
  13116. vm.__next_tick_callbacks.push(function () {
  13117. if (cb) {
  13118. try {
  13119. cb.call(vm);
  13120. } catch (e) {
  13121. handleError(e, vm, 'nextTick');
  13122. }
  13123. } else if (_resolve) {
  13124. _resolve(vm);
  13125. }
  13126. });
  13127. // $flow-disable-line
  13128. if (!cb && typeof Promise !== 'undefined') {
  13129. return new Promise(function (resolve) {
  13130. _resolve = resolve;
  13131. })
  13132. }
  13133. }
  13134. /* */
  13135. function cloneWithData(vm) {
  13136. // 确保当前 vm 所有数据被同步
  13137. var ret = Object.create(null);
  13138. var dataKeys = [].concat(
  13139. Object.keys(vm._data || {}),
  13140. Object.keys(vm._computedWatchers || {}));
  13141. dataKeys.reduce(function(ret, key) {
  13142. ret[key] = vm[key];
  13143. return ret
  13144. }, ret);
  13145. // vue-composition-api
  13146. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  13147. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  13148. if (rawBindings) {
  13149. Object.keys(rawBindings).forEach(function (key) {
  13150. ret[key] = vm[key];
  13151. });
  13152. }
  13153. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  13154. Object.assign(ret, vm.$mp.data || {});
  13155. if (
  13156. Array.isArray(vm.$options.behaviors) &&
  13157. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  13158. ) { //form-field
  13159. ret['name'] = vm.name;
  13160. ret['value'] = vm.value;
  13161. }
  13162. return JSON.parse(JSON.stringify(ret))
  13163. }
  13164. var patch = function(oldVnode, vnode) {
  13165. var this$1 = this;
  13166. if (vnode === null) { //destroy
  13167. return
  13168. }
  13169. if (this.mpType === 'page' || this.mpType === 'component') {
  13170. var mpInstance = this.$scope;
  13171. var data = Object.create(null);
  13172. try {
  13173. data = cloneWithData(this);
  13174. } catch (err) {
  13175. console.error(err);
  13176. }
  13177. data.__webviewId__ = mpInstance.data.__webviewId__;
  13178. var mpData = Object.create(null);
  13179. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  13180. mpData[key] = mpInstance.data[key];
  13181. });
  13182. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  13183. if (Object.keys(diffData).length) {
  13184. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  13185. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  13186. ']差量更新',
  13187. JSON.stringify(diffData));
  13188. }
  13189. this.__next_tick_pending = true;
  13190. mpInstance.setData(diffData, function () {
  13191. this$1.__next_tick_pending = false;
  13192. flushCallbacks$1(this$1);
  13193. });
  13194. } else {
  13195. flushCallbacks$1(this);
  13196. }
  13197. }
  13198. };
  13199. /* */
  13200. function createEmptyRender() {
  13201. }
  13202. function mountComponent$1(
  13203. vm,
  13204. el,
  13205. hydrating
  13206. ) {
  13207. if (!vm.mpType) {//main.js 中的 new Vue
  13208. return vm
  13209. }
  13210. if (vm.mpType === 'app') {
  13211. vm.$options.render = createEmptyRender;
  13212. }
  13213. if (!vm.$options.render) {
  13214. vm.$options.render = createEmptyRender;
  13215. if (true) {
  13216. /* istanbul ignore if */
  13217. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  13218. vm.$options.el || el) {
  13219. warn(
  13220. 'You are using the runtime-only build of Vue where the template ' +
  13221. 'compiler is not available. Either pre-compile the templates into ' +
  13222. 'render functions, or use the compiler-included build.',
  13223. vm
  13224. );
  13225. } else {
  13226. warn(
  13227. 'Failed to mount component: template or render function not defined.',
  13228. vm
  13229. );
  13230. }
  13231. }
  13232. }
  13233. !vm._$fallback && callHook(vm, 'beforeMount');
  13234. var updateComponent = function () {
  13235. vm._update(vm._render(), hydrating);
  13236. };
  13237. // we set this to vm._watcher inside the watcher's constructor
  13238. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  13239. // component's mounted hook), which relies on vm._watcher being already defined
  13240. new Watcher(vm, updateComponent, noop, {
  13241. before: function before() {
  13242. if (vm._isMounted && !vm._isDestroyed) {
  13243. callHook(vm, 'beforeUpdate');
  13244. }
  13245. }
  13246. }, true /* isRenderWatcher */);
  13247. hydrating = false;
  13248. return vm
  13249. }
  13250. /* */
  13251. function renderClass (
  13252. staticClass,
  13253. dynamicClass
  13254. ) {
  13255. if (isDef(staticClass) || isDef(dynamicClass)) {
  13256. return concat(staticClass, stringifyClass(dynamicClass))
  13257. }
  13258. /* istanbul ignore next */
  13259. return ''
  13260. }
  13261. function concat (a, b) {
  13262. return a ? b ? (a + ' ' + b) : a : (b || '')
  13263. }
  13264. function stringifyClass (value) {
  13265. if (Array.isArray(value)) {
  13266. return stringifyArray(value)
  13267. }
  13268. if (isObject(value)) {
  13269. return stringifyObject(value)
  13270. }
  13271. if (typeof value === 'string') {
  13272. return value
  13273. }
  13274. /* istanbul ignore next */
  13275. return ''
  13276. }
  13277. function stringifyArray (value) {
  13278. var res = '';
  13279. var stringified;
  13280. for (var i = 0, l = value.length; i < l; i++) {
  13281. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  13282. if (res) { res += ' '; }
  13283. res += stringified;
  13284. }
  13285. }
  13286. return res
  13287. }
  13288. function stringifyObject (value) {
  13289. var res = '';
  13290. for (var key in value) {
  13291. if (value[key]) {
  13292. if (res) { res += ' '; }
  13293. res += key;
  13294. }
  13295. }
  13296. return res
  13297. }
  13298. /* */
  13299. var parseStyleText = cached(function (cssText) {
  13300. var res = {};
  13301. var listDelimiter = /;(?![^(]*\))/g;
  13302. var propertyDelimiter = /:(.+)/;
  13303. cssText.split(listDelimiter).forEach(function (item) {
  13304. if (item) {
  13305. var tmp = item.split(propertyDelimiter);
  13306. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  13307. }
  13308. });
  13309. return res
  13310. });
  13311. // normalize possible array / string values into Object
  13312. function normalizeStyleBinding (bindingStyle) {
  13313. if (Array.isArray(bindingStyle)) {
  13314. return toObject(bindingStyle)
  13315. }
  13316. if (typeof bindingStyle === 'string') {
  13317. return parseStyleText(bindingStyle)
  13318. }
  13319. return bindingStyle
  13320. }
  13321. /* */
  13322. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  13323. function getTarget(obj, path) {
  13324. var parts = path.split('.');
  13325. var key = parts[0];
  13326. if (key.indexOf('__$n') === 0) { //number index
  13327. key = parseInt(key.replace('__$n', ''));
  13328. }
  13329. if (parts.length === 1) {
  13330. return obj[key]
  13331. }
  13332. return getTarget(obj[key], parts.slice(1).join('.'))
  13333. }
  13334. function internalMixin(Vue) {
  13335. Vue.config.errorHandler = function(err, vm, info) {
  13336. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  13337. console.error(err);
  13338. /* eslint-disable no-undef */
  13339. var app = typeof getApp === 'function' && getApp();
  13340. if (app && app.onError) {
  13341. app.onError(err);
  13342. }
  13343. };
  13344. var oldEmit = Vue.prototype.$emit;
  13345. Vue.prototype.$emit = function(event) {
  13346. if (this.$scope && event) {
  13347. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  13348. __args__: toArray(arguments, 1)
  13349. });
  13350. }
  13351. return oldEmit.apply(this, arguments)
  13352. };
  13353. Vue.prototype.$nextTick = function(fn) {
  13354. return nextTick$1(this, fn)
  13355. };
  13356. MP_METHODS.forEach(function (method) {
  13357. Vue.prototype[method] = function(args) {
  13358. if (this.$scope && this.$scope[method]) {
  13359. return this.$scope[method](args)
  13360. }
  13361. // mp-alipay
  13362. if (typeof my === 'undefined') {
  13363. return
  13364. }
  13365. if (method === 'createSelectorQuery') {
  13366. /* eslint-disable no-undef */
  13367. return my.createSelectorQuery(args)
  13368. } else if (method === 'createIntersectionObserver') {
  13369. /* eslint-disable no-undef */
  13370. return my.createIntersectionObserver(args)
  13371. }
  13372. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  13373. };
  13374. });
  13375. Vue.prototype.__init_provide = initProvide;
  13376. Vue.prototype.__init_injections = initInjections;
  13377. Vue.prototype.__call_hook = function(hook, args) {
  13378. var vm = this;
  13379. // #7573 disable dep collection when invoking lifecycle hooks
  13380. pushTarget();
  13381. var handlers = vm.$options[hook];
  13382. var info = hook + " hook";
  13383. var ret;
  13384. if (handlers) {
  13385. for (var i = 0, j = handlers.length; i < j; i++) {
  13386. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  13387. }
  13388. }
  13389. if (vm._hasHookEvent) {
  13390. vm.$emit('hook:' + hook, args);
  13391. }
  13392. popTarget();
  13393. return ret
  13394. };
  13395. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  13396. if (Array.isArray(modifiers)) {
  13397. if (modifiers.indexOf('trim') !== -1) {
  13398. value = value.trim();
  13399. }
  13400. if (modifiers.indexOf('number') !== -1) {
  13401. value = this._n(value);
  13402. }
  13403. }
  13404. if (!target) {
  13405. target = this;
  13406. }
  13407. // 解决动态属性添加
  13408. Vue.set(target, key, value);
  13409. };
  13410. Vue.prototype.__set_sync = function(target, key, value) {
  13411. if (!target) {
  13412. target = this;
  13413. }
  13414. // 解决动态属性添加
  13415. Vue.set(target, key, value);
  13416. };
  13417. Vue.prototype.__get_orig = function(item) {
  13418. if (isPlainObject(item)) {
  13419. return item['$orig'] || item
  13420. }
  13421. return item
  13422. };
  13423. Vue.prototype.__get_value = function(dataPath, target) {
  13424. return getTarget(target || this, dataPath)
  13425. };
  13426. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  13427. return renderClass(staticClass, dynamicClass)
  13428. };
  13429. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  13430. if (!dynamicStyle && !staticStyle) {
  13431. return ''
  13432. }
  13433. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  13434. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  13435. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  13436. };
  13437. Vue.prototype.__map = function(val, iteratee) {
  13438. //TODO 暂不考虑 string
  13439. var ret, i, l, keys, key;
  13440. if (Array.isArray(val)) {
  13441. ret = new Array(val.length);
  13442. for (i = 0, l = val.length; i < l; i++) {
  13443. ret[i] = iteratee(val[i], i);
  13444. }
  13445. return ret
  13446. } else if (isObject(val)) {
  13447. keys = Object.keys(val);
  13448. ret = Object.create(null);
  13449. for (i = 0, l = keys.length; i < l; i++) {
  13450. key = keys[i];
  13451. ret[key] = iteratee(val[key], key, i);
  13452. }
  13453. return ret
  13454. } else if (typeof val === 'number') {
  13455. ret = new Array(val);
  13456. for (i = 0, l = val; i < l; i++) {
  13457. // 第一个参数暂时仍和小程序一致
  13458. ret[i] = iteratee(i, i);
  13459. }
  13460. return ret
  13461. }
  13462. return []
  13463. };
  13464. }
  13465. /* */
  13466. var LIFECYCLE_HOOKS$1 = [
  13467. //App
  13468. 'onLaunch',
  13469. 'onShow',
  13470. 'onHide',
  13471. 'onUniNViewMessage',
  13472. 'onPageNotFound',
  13473. 'onThemeChange',
  13474. 'onError',
  13475. 'onUnhandledRejection',
  13476. //Page
  13477. 'onInit',
  13478. 'onLoad',
  13479. // 'onShow',
  13480. 'onReady',
  13481. // 'onHide',
  13482. 'onUnload',
  13483. 'onPullDownRefresh',
  13484. 'onReachBottom',
  13485. 'onTabItemTap',
  13486. 'onAddToFavorites',
  13487. 'onShareTimeline',
  13488. 'onShareAppMessage',
  13489. 'onResize',
  13490. 'onPageScroll',
  13491. 'onNavigationBarButtonTap',
  13492. 'onBackPress',
  13493. 'onNavigationBarSearchInputChanged',
  13494. 'onNavigationBarSearchInputConfirmed',
  13495. 'onNavigationBarSearchInputClicked',
  13496. //Component
  13497. // 'onReady', // 兼容旧版本,应该移除该事件
  13498. 'onPageShow',
  13499. 'onPageHide',
  13500. 'onPageResize'
  13501. ];
  13502. function lifecycleMixin$1(Vue) {
  13503. //fixed vue-class-component
  13504. var oldExtend = Vue.extend;
  13505. Vue.extend = function(extendOptions) {
  13506. extendOptions = extendOptions || {};
  13507. var methods = extendOptions.methods;
  13508. if (methods) {
  13509. Object.keys(methods).forEach(function (methodName) {
  13510. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  13511. extendOptions[methodName] = methods[methodName];
  13512. delete methods[methodName];
  13513. }
  13514. });
  13515. }
  13516. return oldExtend.call(this, extendOptions)
  13517. };
  13518. var strategies = Vue.config.optionMergeStrategies;
  13519. var mergeHook = strategies.created;
  13520. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  13521. strategies[hook] = mergeHook;
  13522. });
  13523. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  13524. }
  13525. /* */
  13526. // install platform patch function
  13527. Vue.prototype.__patch__ = patch;
  13528. // public mount method
  13529. Vue.prototype.$mount = function(
  13530. el ,
  13531. hydrating
  13532. ) {
  13533. return mountComponent$1(this, el, hydrating)
  13534. };
  13535. lifecycleMixin$1(Vue);
  13536. internalMixin(Vue);
  13537. /* */
  13538. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  13539. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  13540. /***/ }),
  13541. /***/ 40:
  13542. /*!********************************************************************!*\
  13543. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  13544. \********************************************************************/
  13545. /*! no static exports found */
  13546. /***/ (function(module, exports, __webpack_require__) {
  13547. "use strict";
  13548. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  13549. /**
  13550. * actionsheet: 999
  13551. * modal: 999
  13552. * navigate: 998
  13553. * tabbar: 998
  13554. * toast: 999
  13555. */var _default =
  13556. {
  13557. toast: 10090,
  13558. noNetwork: 10080,
  13559. // popup包含popup,actionsheet,keyboard,picker的值
  13560. popup: 10075,
  13561. mask: 10070,
  13562. navbar: 980,
  13563. topTips: 975,
  13564. sticky: 970,
  13565. indexListSticky: 965 };exports.default = _default;
  13566. /***/ }),
  13567. /***/ 41:
  13568. /*!***********************************!*\
  13569. !*** E:/fp/md/mdapp/api/index.js ***!
  13570. \***********************************/
  13571. /*! no static exports found */
  13572. /***/ (function(module, exports, __webpack_require__) {
  13573. "use strict";
  13574. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  13575. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));
  13576. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 46));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  13577. {
  13578. base: _base.default,
  13579. estate: _estate.default,
  13580. cust: _cust.default };exports.default = _default;
  13581. /***/ }),
  13582. /***/ 42:
  13583. /*!**********************************!*\
  13584. !*** E:/fp/md/mdapp/api/base.js ***!
  13585. \**********************************/
  13586. /*! no static exports found */
  13587. /***/ (function(module, exports, __webpack_require__) {
  13588. "use strict";
  13589. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13590. {
  13591. apilogin: function apilogin(params) {// 登录
  13592. return (0, _http.request)('api/login', params, 'loading');
  13593. },
  13594. apiregister: function apiregister(params) {// 注册
  13595. return (0, _http.request)('api/register', params, 'loading');
  13596. },
  13597. apisendsms: function apisendsms(params) {// 发送短信
  13598. return (0, _http.request)('api/send/sms', params, 'loading');
  13599. },
  13600. apicaptcha: function apicaptcha(params) {// 验证码图片
  13601. return (0, _http.request)('api/captcha', params, 'loading');
  13602. },
  13603. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  13604. return (0, _http.request)('api/check/captcha', params);
  13605. },
  13606. apiwxlogin: function apiwxlogin(params) {// 微信登录
  13607. return (0, _http.request)('api/wx/login', params, 'loading');
  13608. },
  13609. apiwxautologin: function apiwxautologin(params) {// 微信登录 自动
  13610. return (0, _http.request)('api/wx/autologin', params, 'loading');
  13611. },
  13612. apiuserinfo: function apiuserinfo(params) {// 用户信息
  13613. return (0, _http.request)('api/user/info', params, 'loading');
  13614. },
  13615. apiuseredit: function apiuseredit(params) {// 用户编辑
  13616. return (0, _http.request)('api/user/edit', params, 'loading');
  13617. },
  13618. apiuserbindwechat: function apiuserbindwechat(params) {// 绑定微信
  13619. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  13620. },
  13621. apiuserauthadd: function apiuserauthadd(params) {// 用户认证 - 提交认证
  13622. return (0, _http.request)('api/user/auth/add', params, 'loading');
  13623. },
  13624. apiuserauthinfo: function apiuserauthinfo(params) {// 用户认证 - 认证详情
  13625. return (0, _http.request)('api/user/auth/info', params, 'loading');
  13626. },
  13627. apiuploadcloudpiv: function apiuploadcloudpiv(params) {// 图片上传云接口
  13628. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  13629. },
  13630. apidicttree: function apidicttree(params) {// 字典
  13631. return (0, _http.request)('api/dict/tree', params, 'loading');
  13632. } };exports.default = _default;
  13633. /***/ }),
  13634. /***/ 43:
  13635. /*!************************************!*\
  13636. !*** E:/fp/md/mdapp/utils/http.js ***!
  13637. \************************************/
  13638. /*! no static exports found */
  13639. /***/ (function(module, exports, __webpack_require__) {
  13640. "use strict";
  13641. /* 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;}
  13642. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  13643. return new Promise(function (resolve, reject) {
  13644. if (options.loadingStr === 'loading') {
  13645. uni.showLoading({
  13646. mask: true,
  13647. title: '加载中..' });
  13648. }
  13649. var token = uni.getStorageSync('MD_token') || '';
  13650. var header = {
  13651. 'Content-Type': 'application/json',
  13652. 'token': token
  13653. // 'Content-Type': 'application/x-www-form-urlencoded'
  13654. };
  13655. var params = _objectSpread({}, options.data);
  13656. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  13657. for (var key in options.data) {
  13658. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  13659. params[key] = '';
  13660. }
  13661. }
  13662. var url = uni.baseUrl + options.url;
  13663. // let url = options.url
  13664. if (options.queryData) {
  13665. var qStr = '';
  13666. for (var k in options.queryData) {
  13667. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  13668. }
  13669. qStr = qStr.substr(0, qStr.length - 1);
  13670. url += "?".concat(qStr);
  13671. }
  13672. uni.request({
  13673. url: url,
  13674. data: _objectSpread({},
  13675. params),
  13676. header: header,
  13677. method: options.method || 'POST',
  13678. complete: function complete(res) {
  13679. if (options.loadingStr === 'loading') {
  13680. uni.hideLoading();
  13681. }
  13682. },
  13683. success: function success(res) {var
  13684. cData = res.data;
  13685. var code = cData.errno;
  13686. switch (code) {
  13687. case 0:
  13688. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  13689. break;
  13690. case 401:
  13691. case 404:
  13692. case 405:
  13693. uni.removeStorageSync('MD_userInfo');
  13694. var u2 = uni.getStorageSync('MD_userInfo2');
  13695. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  13696. uni.login({
  13697. success: function success(res) {
  13698. if (res.code) {
  13699. uni.api.base.apiwxautologin({ code: res.code }).then(function (cData) {
  13700. if (cData.token === 'error') {
  13701. uni.removeStorageSync('MD_token');
  13702. } else {
  13703. uni.setStorageSync('MD_userInfo', cData);
  13704. uni.setStorageSync('MD_token', cData.token);
  13705. uni.api.base.apidicttree().then(function (res) {
  13706. var cObj = res || {};
  13707. var newDict = {};
  13708. for (var _k in cObj) {
  13709. var cArr = cObj[_k].map(function (item) {
  13710. return _objectSpread(_objectSpread({},
  13711. item), {}, {
  13712. key: item.dict_label,
  13713. val: item.dict_value });
  13714. });
  13715. newDict[_k] = cArr;
  13716. }
  13717. uni.setStorageSync('MD_dict', newDict);
  13718. });
  13719. uni.api.base.apiuserinfo().then(function (res2) {
  13720. uni.setStorageSync('MD_userInfo2', res2);
  13721. uni.reLaunch({
  13722. url: '/pages/index/index' });
  13723. });
  13724. }
  13725. });
  13726. }
  13727. } });
  13728. } else {
  13729. uni.showToast({
  13730. title: "\u8BF7\u5148\u767B\u5F55~",
  13731. icon: 'none' });
  13732. uni.navigateTo({
  13733. url: '/pages/user/login/login' });
  13734. }
  13735. break;
  13736. default:
  13737. uni.showModal({
  13738. title: '提示',
  13739. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  13740. return reject(cData);}
  13741. // resolve()
  13742. },
  13743. fail: function fail(err) {
  13744. console.log(err);
  13745. reject(err);
  13746. } });
  13747. });
  13748. };
  13749. // export default Http
  13750. function request(url, data, loadingStr, queryData) {
  13751. return Http({
  13752. url: url,
  13753. data: data,
  13754. loadingStr: loadingStr,
  13755. queryData: queryData });
  13756. }
  13757. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13758. /***/ }),
  13759. /***/ 44:
  13760. /*!*************************************!*\
  13761. !*** E:/fp/md/mdapp/utils/index.js ***!
  13762. \*************************************/
  13763. /*! no static exports found */
  13764. /***/ (function(module, exports, __webpack_require__) {
  13765. "use strict";
  13766. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  13767. * @param {string} str
  13768. * @returns {string}
  13769. */
  13770. function strTrim(str) {
  13771. return str.replace(/(^\s*)|(\s*$)/g, '');
  13772. }
  13773. /**
  13774. * @param {Number} num
  13775. * @returns {string}
  13776. */
  13777. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  13778. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  13779. var arr = numArr[0].split('').reverse();
  13780. var res = [];
  13781. for (var i = 0; i < arr.length; i++) {
  13782. if (i % 3 === 0 && i !== 0) {
  13783. res.push(',');
  13784. }
  13785. res.push(arr[i]);
  13786. }
  13787. res.reverse();
  13788. if (numArr[1]) {
  13789. res = res.join('').concat('.' + numArr[1]);
  13790. } else {
  13791. res = res.join('');
  13792. }
  13793. // let res = num.toString().replace(/\d+/, function(n){
  13794. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  13795. // return $1 + ","
  13796. // })
  13797. // })
  13798. // toLocaleString()
  13799. return res;
  13800. }
  13801. /**
  13802. * @param {Array} arr
  13803. * @returns {Object}
  13804. */
  13805. function arrToObj(arr) {
  13806. var obj = {};
  13807. if (Object.prototype.toString.call(arr) === '[object Array]') {
  13808. if (arr.length > 0) {
  13809. arr.forEach(function (item) {
  13810. obj[item.val] = item.key;
  13811. });
  13812. }
  13813. }
  13814. return obj;
  13815. }
  13816. /**
  13817. * @param {any} val
  13818. * @returns {Boolean}
  13819. */
  13820. function noEmpty(val) {
  13821. if (val === null || val === undefined || val === '') {
  13822. return false;
  13823. } else {
  13824. return true;
  13825. }
  13826. }
  13827. /**
  13828. * @param {Number} date
  13829. * @param {Boolean} onlyDate
  13830. * @returns {String}
  13831. * function time(time = +new Date()) {
  13832. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  13833. return date.toJSON().substr(0, 19).replace('T', ' ');
  13834. }
  13835. */
  13836. 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;
  13837. var year = date.getFullYear();
  13838. var month = date.getMonth() + 1;
  13839. month = month > 9 ? month : '0' + month;
  13840. var day = date.getDate();
  13841. day = day > 9 ? day : '0' + day;
  13842. var hour = date.getHours();
  13843. hour = hour > 9 ? hour : '0' + hour;
  13844. var minute = date.getMinutes();
  13845. minute = minute > 9 ? minute : '0' + minute;
  13846. var second = date.getSeconds();
  13847. second = second > 9 ? second : '0' + second;
  13848. var milli = date.getMilliseconds();
  13849. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  13850. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  13851. }
  13852. /***/ }),
  13853. /***/ 45:
  13854. /*!************************************!*\
  13855. !*** E:/fp/md/mdapp/api/estate.js ***!
  13856. \************************************/
  13857. /*! no static exports found */
  13858. /***/ (function(module, exports, __webpack_require__) {
  13859. "use strict";
  13860. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13861. {
  13862. apiestatelist: function apiestatelist(params) {// 楼盘列表
  13863. return (0, _http.request)('api/estate/list', params, 'loading');
  13864. },
  13865. apiestatecontentdetail: function apiestatecontentdetail(params) {// 楼盘 介绍详情
  13866. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  13867. },
  13868. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  13869. return (0, _http.request)('api/report/add', params, 'loading');
  13870. },
  13871. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  13872. return (0, _http.request)('api/report/list', params, 'loading');
  13873. },
  13874. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  13875. return (0, _http.request)('api/report/detail', params, 'loading');
  13876. },
  13877. apireportsite: function apireportsite(params) {// 案场 - 报备详情
  13878. return (0, _http.request)('api/report/site', params, 'loading');
  13879. },
  13880. apireportconfirm: function apireportconfirm(params) {// 报备 - 报备确认
  13881. return (0, _http.request)('api/report/confirm', params, 'loading');
  13882. },
  13883. apireportcount: function apireportcount(params) {// 报备 - 报备统计
  13884. return (0, _http.request)('api/report/count', params, 'loading');
  13885. },
  13886. apiestateinfodetail: function apiestateinfodetail(params) {// 楼盘一页纸
  13887. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  13888. } };exports.default = _default;
  13889. /***/ }),
  13890. /***/ 46:
  13891. /*!**********************************!*\
  13892. !*** E:/fp/md/mdapp/api/cust.js ***!
  13893. \**********************************/
  13894. /*! no static exports found */
  13895. /***/ (function(module, exports, __webpack_require__) {
  13896. "use strict";
  13897. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13898. {
  13899. apicustomerlist: function apicustomerlist(params) {// 客户 列表
  13900. return (0, _http.request)('api/customer/list', params);
  13901. },
  13902. apicustomeradd: function apicustomeradd(params) {// 客户 添加
  13903. return (0, _http.request)('api/customer/add', params, 'loading');
  13904. },
  13905. apicustomeredit: function apicustomeredit(params) {// 客户 编辑
  13906. return (0, _http.request)('api/customer/edit', params, 'loading');
  13907. },
  13908. apicustomerdel: function apicustomerdel(params) {// 客户 删除
  13909. return (0, _http.request)('api/customer/del', params, 'loading');
  13910. },
  13911. apicustomerdetail: function apicustomerdetail(params) {// 客户 详情
  13912. return (0, _http.request)('api/customer/detail', params, 'loading');
  13913. },
  13914. apireportvisitchange: function apireportvisitchange(params) {// 到访材料添加
  13915. return (0, _http.request)('api/report/visit/change', params, 'loading');
  13916. },
  13917. apireportvisitdetail: function apireportvisitdetail(params) {// 到访材料详情
  13918. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  13919. },
  13920. apireportvisit: function apireportvisit(params) {// 报备到访
  13921. return (0, _http.request)('api/report/visit', params, 'loading');
  13922. } };exports.default = _default;
  13923. /***/ }),
  13924. /***/ 47:
  13925. /*!************************************!*\
  13926. !*** E:/fp/md/mdapp/utils/tool.js ***!
  13927. \************************************/
  13928. /*! no static exports found */
  13929. /***/ (function(module, exports, __webpack_require__) {
  13930. "use strict";
  13931. /* 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) {
  13932. // getRandomNum(24, 16)
  13933. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  13934. var uuid = [];
  13935. radix = radix || chars.length;
  13936. if (len) {
  13937. // Compact form
  13938. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  13939. } else {
  13940. // rfc4122, version 4 form
  13941. var r;
  13942. // rfc4122 requires these characters
  13943. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  13944. uuid[14] = '4';
  13945. // Fill in random data.  At i==19 set the high bits of clock sequence as
  13946. // per rfc4122, sec. 4.1.5
  13947. for (var _i = 0; _i < 36; _i++) {
  13948. if (!uuid[_i]) {
  13949. r = 0 | Math.random() * 16;
  13950. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  13951. }
  13952. }
  13953. }
  13954. return uuid.join('') + new Date().getTime();
  13955. };exports.getRandomNum = getRandomNum;
  13956. var msgBase = function msgBase(msgText, bc) {
  13957. uni.showToast({
  13958. title: msgText,
  13959. icon: 'none',
  13960. duration: 2000 }).
  13961. then(function () {
  13962. if (bc) bc();
  13963. });
  13964. };exports.msgBase = msgBase;
  13965. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  13966. uni.showModal({
  13967. title: title,
  13968. content: msgText,
  13969. success: function success(res) {
  13970. if (res.confirm) {
  13971. if (successBc) successBc();
  13972. } else if (res.cancel) {
  13973. if (errorBc) errorBc();
  13974. }
  13975. } });
  13976. };exports.confirmMsgFn = confirmMsgFn;
  13977. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13978. /***/ }),
  13979. /***/ 5:
  13980. /*!*********************************!*\
  13981. !*** E:/fp/md/mdapp/pages.json ***!
  13982. \*********************************/
  13983. /*! no static exports found */
  13984. /***/ (function(module, exports) {
  13985. /***/ }),
  13986. /***/ 94:
  13987. /*!*************************************************!*\
  13988. !*** E:/fp/md/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  13989. \*************************************************/
  13990. /*! no static exports found */
  13991. /***/ (function(module, exports, __webpack_require__) {
  13992. "use strict";
  13993. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = uniCopy;function uniCopy(_ref) {var content = _ref.content,_success = _ref.success,error = _ref.error;
  13994. if (!content) return error('复制的内容不能为空 !');
  13995. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  13996. /**
  13997. * 小程序端 和 app端的复制逻辑
  13998. */
  13999. uni.setClipboardData({
  14000. data: content,
  14001. success: function success() {
  14002. _success("复制成功~");
  14003. console.log('success');
  14004. },
  14005. fail: function fail() {
  14006. _success("复制失败~");
  14007. } });
  14008. /**
  14009. * H5端的复制逻辑
  14010. */
  14011. }
  14012. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  14013. /***/ })
  14014. }]);
  14015. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map