vendor.js 483 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036
  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({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1180. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1181. }
  1182. }
  1183. } else {
  1184. try {
  1185. // 对 data 格式化
  1186. data = JSON.parse(JSON.stringify(data));
  1187. } catch (e) {}
  1188. }
  1189. if (!isPlainObject(data)) {
  1190. data = {};
  1191. }
  1192. Object.keys(methods).forEach(function (methodName) {
  1193. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1194. data[methodName] = methods[methodName];
  1195. }
  1196. });
  1197. return data;
  1198. }
  1199. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1200. function createObserver(name) {
  1201. return function observer(newVal, oldVal) {
  1202. if (this.$vm) {
  1203. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1204. }
  1205. };
  1206. }
  1207. function initBehaviors(vueOptions, initBehavior) {
  1208. var vueBehaviors = vueOptions.behaviors;
  1209. var vueExtends = vueOptions.extends;
  1210. var vueMixins = vueOptions.mixins;
  1211. var vueProps = vueOptions.props;
  1212. if (!vueProps) {
  1213. vueOptions.props = vueProps = [];
  1214. }
  1215. var behaviors = [];
  1216. if (Array.isArray(vueBehaviors)) {
  1217. vueBehaviors.forEach(function (behavior) {
  1218. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1219. if (behavior === 'uni://form-field') {
  1220. if (Array.isArray(vueProps)) {
  1221. vueProps.push('name');
  1222. vueProps.push('value');
  1223. } else {
  1224. vueProps.name = {
  1225. type: String,
  1226. default: '' };
  1227. vueProps.value = {
  1228. type: [String, Number, Boolean, Array, Object, Date],
  1229. default: '' };
  1230. }
  1231. }
  1232. });
  1233. }
  1234. if (isPlainObject(vueExtends) && vueExtends.props) {
  1235. behaviors.push(
  1236. initBehavior({
  1237. properties: initProperties(vueExtends.props, true) }));
  1238. }
  1239. if (Array.isArray(vueMixins)) {
  1240. vueMixins.forEach(function (vueMixin) {
  1241. if (isPlainObject(vueMixin) && vueMixin.props) {
  1242. behaviors.push(
  1243. initBehavior({
  1244. properties: initProperties(vueMixin.props, true) }));
  1245. }
  1246. });
  1247. }
  1248. return behaviors;
  1249. }
  1250. function parsePropType(key, type, defaultValue, file) {
  1251. // [String]=>String
  1252. if (Array.isArray(type) && type.length === 1) {
  1253. return type[0];
  1254. }
  1255. return type;
  1256. }
  1257. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1258. var properties = {};
  1259. if (!isBehavior) {
  1260. properties.vueId = {
  1261. type: String,
  1262. value: '' };
  1263. // 用于字节跳动小程序模拟抽象节点
  1264. properties.generic = {
  1265. type: Object,
  1266. value: null };
  1267. // scopedSlotsCompiler auto
  1268. properties.scopedSlotsCompiler = {
  1269. type: String,
  1270. value: '' };
  1271. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1272. type: null,
  1273. value: [],
  1274. observer: function observer(newVal, oldVal) {
  1275. var $slots = Object.create(null);
  1276. newVal.forEach(function (slotName) {
  1277. $slots[slotName] = true;
  1278. });
  1279. this.setData({
  1280. $slots: $slots });
  1281. } };
  1282. }
  1283. if (Array.isArray(props)) {// ['title']
  1284. props.forEach(function (key) {
  1285. properties[key] = {
  1286. type: null,
  1287. observer: createObserver(key) };
  1288. });
  1289. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1290. Object.keys(props).forEach(function (key) {
  1291. var opts = props[key];
  1292. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1293. var value = opts.default;
  1294. if (isFn(value)) {
  1295. value = value();
  1296. }
  1297. opts.type = parsePropType(key, opts.type);
  1298. properties[key] = {
  1299. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1300. value: value,
  1301. observer: createObserver(key) };
  1302. } else {// content:String
  1303. var type = parsePropType(key, opts);
  1304. properties[key] = {
  1305. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1306. observer: createObserver(key) };
  1307. }
  1308. });
  1309. }
  1310. return properties;
  1311. }
  1312. function wrapper$1(event) {
  1313. // TODO 又得兼容 mpvue 的 mp 对象
  1314. try {
  1315. event.mp = JSON.parse(JSON.stringify(event));
  1316. } catch (e) {}
  1317. event.stopPropagation = noop;
  1318. event.preventDefault = noop;
  1319. event.target = event.target || {};
  1320. if (!hasOwn(event, 'detail')) {
  1321. event.detail = {};
  1322. }
  1323. if (hasOwn(event, 'markerId')) {
  1324. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1325. event.detail.markerId = event.markerId;
  1326. }
  1327. if (isPlainObject(event.detail)) {
  1328. event.target = Object.assign({}, event.target, event.detail);
  1329. }
  1330. return event;
  1331. }
  1332. function getExtraValue(vm, dataPathsArray) {
  1333. var context = vm;
  1334. dataPathsArray.forEach(function (dataPathArray) {
  1335. var dataPath = dataPathArray[0];
  1336. var value = dataPathArray[2];
  1337. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1338. var propPath = dataPathArray[1];
  1339. var valuePath = dataPathArray[3];
  1340. var vFor;
  1341. if (Number.isInteger(dataPath)) {
  1342. vFor = dataPath;
  1343. } else if (!dataPath) {
  1344. vFor = context;
  1345. } else if (typeof dataPath === 'string' && dataPath) {
  1346. if (dataPath.indexOf('#s#') === 0) {
  1347. vFor = dataPath.substr(3);
  1348. } else {
  1349. vFor = vm.__get_value(dataPath, context);
  1350. }
  1351. }
  1352. if (Number.isInteger(vFor)) {
  1353. context = value;
  1354. } else if (!propPath) {
  1355. context = vFor[value];
  1356. } else {
  1357. if (Array.isArray(vFor)) {
  1358. context = vFor.find(function (vForItem) {
  1359. return vm.__get_value(propPath, vForItem) === value;
  1360. });
  1361. } else if (isPlainObject(vFor)) {
  1362. context = Object.keys(vFor).find(function (vForKey) {
  1363. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1364. });
  1365. } else {
  1366. console.error('v-for 暂不支持循环数据:', vFor);
  1367. }
  1368. }
  1369. if (valuePath) {
  1370. context = vm.__get_value(valuePath, context);
  1371. }
  1372. }
  1373. });
  1374. return context;
  1375. }
  1376. function processEventExtra(vm, extra, event) {
  1377. var extraObj = {};
  1378. if (Array.isArray(extra) && extra.length) {
  1379. /**
  1380. *[
  1381. * ['data.items', 'data.id', item.data.id],
  1382. * ['metas', 'id', meta.id]
  1383. *],
  1384. *[
  1385. * ['data.items', 'data.id', item.data.id],
  1386. * ['metas', 'id', meta.id]
  1387. *],
  1388. *'test'
  1389. */
  1390. extra.forEach(function (dataPath, index) {
  1391. if (typeof dataPath === 'string') {
  1392. if (!dataPath) {// model,prop.sync
  1393. extraObj['$' + index] = vm;
  1394. } else {
  1395. if (dataPath === '$event') {// $event
  1396. extraObj['$' + index] = event;
  1397. } else if (dataPath === 'arguments') {
  1398. if (event.detail && event.detail.__args__) {
  1399. extraObj['$' + index] = event.detail.__args__;
  1400. } else {
  1401. extraObj['$' + index] = [event];
  1402. }
  1403. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1404. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1405. } else {
  1406. extraObj['$' + index] = vm.__get_value(dataPath);
  1407. }
  1408. }
  1409. } else {
  1410. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1411. }
  1412. });
  1413. }
  1414. return extraObj;
  1415. }
  1416. function getObjByArray(arr) {
  1417. var obj = {};
  1418. for (var i = 1; i < arr.length; i++) {
  1419. var element = arr[i];
  1420. obj[element[0]] = element[1];
  1421. }
  1422. return obj;
  1423. }
  1424. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1425. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1426. if (isCustom) {// 自定义事件
  1427. isCustomMPEvent = event.currentTarget &&
  1428. event.currentTarget.dataset &&
  1429. event.currentTarget.dataset.comType === 'wx';
  1430. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1431. if (isCustomMPEvent) {
  1432. return [event];
  1433. }
  1434. return event.detail.__args__ || event.detail;
  1435. }
  1436. }
  1437. var extraObj = processEventExtra(vm, extra, event);
  1438. var ret = [];
  1439. args.forEach(function (arg) {
  1440. if (arg === '$event') {
  1441. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1442. ret.push(event.target.value);
  1443. } else {
  1444. if (isCustom && !isCustomMPEvent) {
  1445. ret.push(event.detail.__args__[0]);
  1446. } else {// wxcomponent 组件或内置组件
  1447. ret.push(event);
  1448. }
  1449. }
  1450. } else {
  1451. if (Array.isArray(arg) && arg[0] === 'o') {
  1452. ret.push(getObjByArray(arg));
  1453. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1454. ret.push(extraObj[arg]);
  1455. } else {
  1456. ret.push(arg);
  1457. }
  1458. }
  1459. });
  1460. return ret;
  1461. }
  1462. var ONCE = '~';
  1463. var CUSTOM = '^';
  1464. function isMatchEventType(eventType, optType) {
  1465. return eventType === optType ||
  1466. optType === 'regionchange' && (
  1467. eventType === 'begin' ||
  1468. eventType === 'end');
  1469. }
  1470. function getContextVm(vm) {
  1471. var $parent = vm.$parent;
  1472. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1473. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1474. $parent = $parent.$parent;
  1475. }
  1476. return $parent && $parent.$parent;
  1477. }
  1478. function handleEvent(event) {var _this2 = this;
  1479. event = wrapper$1(event);
  1480. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1481. var dataset = (event.currentTarget || event.target).dataset;
  1482. if (!dataset) {
  1483. return console.warn('事件信息不存在');
  1484. }
  1485. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1486. if (!eventOpts) {
  1487. return console.warn('事件信息不存在');
  1488. }
  1489. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1490. var eventType = event.type;
  1491. var ret = [];
  1492. eventOpts.forEach(function (eventOpt) {
  1493. var type = eventOpt[0];
  1494. var eventsArray = eventOpt[1];
  1495. var isCustom = type.charAt(0) === CUSTOM;
  1496. type = isCustom ? type.slice(1) : type;
  1497. var isOnce = type.charAt(0) === ONCE;
  1498. type = isOnce ? type.slice(1) : type;
  1499. if (eventsArray && isMatchEventType(eventType, type)) {
  1500. eventsArray.forEach(function (eventArray) {
  1501. var methodName = eventArray[0];
  1502. if (methodName) {
  1503. var handlerCtx = _this2.$vm;
  1504. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1505. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1506. }
  1507. if (methodName === '$emit') {
  1508. handlerCtx.$emit.apply(handlerCtx,
  1509. processEventArgs(
  1510. _this2.$vm,
  1511. event,
  1512. eventArray[1],
  1513. eventArray[2],
  1514. isCustom,
  1515. methodName));
  1516. return;
  1517. }
  1518. var handler = handlerCtx[methodName];
  1519. if (!isFn(handler)) {
  1520. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1521. }
  1522. if (isOnce) {
  1523. if (handler.once) {
  1524. return;
  1525. }
  1526. handler.once = true;
  1527. }
  1528. var params = processEventArgs(
  1529. _this2.$vm,
  1530. event,
  1531. eventArray[1],
  1532. eventArray[2],
  1533. isCustom,
  1534. methodName);
  1535. params = Array.isArray(params) ? params : [];
  1536. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1537. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1538. // eslint-disable-next-line no-sparse-arrays
  1539. params = params.concat([,,,,,,,,,, event]);
  1540. }
  1541. ret.push(handler.apply(handlerCtx, params));
  1542. }
  1543. });
  1544. }
  1545. });
  1546. if (
  1547. eventType === 'input' &&
  1548. ret.length === 1 &&
  1549. typeof ret[0] !== 'undefined')
  1550. {
  1551. return ret[0];
  1552. }
  1553. }
  1554. var eventChannels = {};
  1555. var eventChannelStack = [];
  1556. function getEventChannel(id) {
  1557. if (id) {
  1558. var eventChannel = eventChannels[id];
  1559. delete eventChannels[id];
  1560. return eventChannel;
  1561. }
  1562. return eventChannelStack.shift();
  1563. }
  1564. var hooks = [
  1565. 'onShow',
  1566. 'onHide',
  1567. 'onError',
  1568. 'onPageNotFound',
  1569. 'onThemeChange',
  1570. 'onUnhandledRejection'];
  1571. function initEventChannel() {
  1572. _vue.default.prototype.getOpenerEventChannel = function () {
  1573. // 微信小程序使用自身getOpenerEventChannel
  1574. {
  1575. return this.$scope.getOpenerEventChannel();
  1576. }
  1577. };
  1578. var callHook = _vue.default.prototype.__call_hook;
  1579. _vue.default.prototype.__call_hook = function (hook, args) {
  1580. if (hook === 'onLoad' && args && args.__id__) {
  1581. this.__eventChannel__ = getEventChannel(args.__id__);
  1582. delete args.__id__;
  1583. }
  1584. return callHook.call(this, hook, args);
  1585. };
  1586. }
  1587. function initScopedSlotsParams() {
  1588. var center = {};
  1589. var parents = {};
  1590. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1591. var has = center[vueId];
  1592. if (!has) {
  1593. parents[vueId] = this;
  1594. this.$on('hook:destroyed', function () {
  1595. delete parents[vueId];
  1596. });
  1597. }
  1598. return has;
  1599. };
  1600. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1601. var data = center[vueId];
  1602. if (data) {
  1603. var object = data[name] || {};
  1604. return key ? object[key] : object;
  1605. } else {
  1606. parents[vueId] = this;
  1607. this.$on('hook:destroyed', function () {
  1608. delete parents[vueId];
  1609. });
  1610. }
  1611. };
  1612. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1613. var vueIds = this.$options.propsData.vueId;
  1614. if (vueIds) {
  1615. var vueId = vueIds.split(',')[0];
  1616. var object = center[vueId] = center[vueId] || {};
  1617. object[name] = value;
  1618. if (parents[vueId]) {
  1619. parents[vueId].$forceUpdate();
  1620. }
  1621. }
  1622. };
  1623. _vue.default.mixin({
  1624. destroyed: function destroyed() {
  1625. var propsData = this.$options.propsData;
  1626. var vueId = propsData && propsData.vueId;
  1627. if (vueId) {
  1628. delete center[vueId];
  1629. delete parents[vueId];
  1630. }
  1631. } });
  1632. }
  1633. function parseBaseApp(vm, _ref3)
  1634. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1635. initEventChannel();
  1636. {
  1637. initScopedSlotsParams();
  1638. }
  1639. if (vm.$options.store) {
  1640. _vue.default.prototype.$store = vm.$options.store;
  1641. }
  1642. uniIdMixin(_vue.default);
  1643. _vue.default.prototype.mpHost = "mp-weixin";
  1644. _vue.default.mixin({
  1645. beforeCreate: function beforeCreate() {
  1646. if (!this.$options.mpType) {
  1647. return;
  1648. }
  1649. this.mpType = this.$options.mpType;
  1650. this.$mp = _defineProperty({
  1651. data: {} },
  1652. this.mpType, this.$options.mpInstance);
  1653. this.$scope = this.$options.mpInstance;
  1654. delete this.$options.mpType;
  1655. delete this.$options.mpInstance;
  1656. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1657. var app = getApp();
  1658. if (app.$vm && app.$vm.$i18n) {
  1659. this._i18n = app.$vm.$i18n;
  1660. }
  1661. }
  1662. if (this.mpType !== 'app') {
  1663. initRefs(this);
  1664. initMocks(this, mocks);
  1665. }
  1666. } });
  1667. var appOptions = {
  1668. onLaunch: function onLaunch(args) {
  1669. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1670. return;
  1671. }
  1672. {
  1673. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1674. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1675. }
  1676. }
  1677. this.$vm = vm;
  1678. this.$vm.$mp = {
  1679. app: this };
  1680. this.$vm.$scope = this;
  1681. // vm 上也挂载 globalData
  1682. this.$vm.globalData = this.globalData;
  1683. this.$vm._isMounted = true;
  1684. this.$vm.__call_hook('mounted', args);
  1685. this.$vm.__call_hook('onLaunch', args);
  1686. } };
  1687. // 兼容旧版本 globalData
  1688. appOptions.globalData = vm.$options.globalData || {};
  1689. // 将 methods 中的方法挂在 getApp() 中
  1690. var methods = vm.$options.methods;
  1691. if (methods) {
  1692. Object.keys(methods).forEach(function (name) {
  1693. appOptions[name] = methods[name];
  1694. });
  1695. }
  1696. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1697. initHooks(appOptions, hooks);
  1698. return appOptions;
  1699. }
  1700. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1701. function findVmByVueId(vm, vuePid) {
  1702. var $children = vm.$children;
  1703. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1704. for (var i = $children.length - 1; i >= 0; i--) {
  1705. var childVm = $children[i];
  1706. if (childVm.$scope._$vueId === vuePid) {
  1707. return childVm;
  1708. }
  1709. }
  1710. // 反向递归查找
  1711. var parentVm;
  1712. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1713. parentVm = findVmByVueId($children[_i], vuePid);
  1714. if (parentVm) {
  1715. return parentVm;
  1716. }
  1717. }
  1718. }
  1719. function initBehavior(options) {
  1720. return Behavior(options);
  1721. }
  1722. function isPage() {
  1723. return !!this.route;
  1724. }
  1725. function initRelation(detail) {
  1726. this.triggerEvent('__l', detail);
  1727. }
  1728. function selectAllComponents(mpInstance, selector, $refs) {
  1729. var components = mpInstance.selectAllComponents(selector);
  1730. components.forEach(function (component) {
  1731. var ref = component.dataset.ref;
  1732. $refs[ref] = component.$vm || component;
  1733. {
  1734. if (component.dataset.vueGeneric === 'scoped') {
  1735. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1736. selectAllComponents(scopedComponent, selector, $refs);
  1737. });
  1738. }
  1739. }
  1740. });
  1741. }
  1742. function initRefs(vm) {
  1743. var mpInstance = vm.$scope;
  1744. Object.defineProperty(vm, '$refs', {
  1745. get: function get() {
  1746. var $refs = {};
  1747. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1748. // TODO 暂不考虑 for 中的 scoped
  1749. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1750. forComponents.forEach(function (component) {
  1751. var ref = component.dataset.ref;
  1752. if (!$refs[ref]) {
  1753. $refs[ref] = [];
  1754. }
  1755. $refs[ref].push(component.$vm || component);
  1756. });
  1757. return $refs;
  1758. } });
  1759. }
  1760. function handleLink(event) {var _ref4 =
  1761. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1762. var parentVm;
  1763. if (vuePid) {
  1764. parentVm = findVmByVueId(this.$vm, vuePid);
  1765. }
  1766. if (!parentVm) {
  1767. parentVm = this.$vm;
  1768. }
  1769. vueOptions.parent = parentVm;
  1770. }
  1771. function parseApp(vm) {
  1772. return parseBaseApp(vm, {
  1773. mocks: mocks,
  1774. initRefs: initRefs });
  1775. }
  1776. function createApp(vm) {
  1777. App(parseApp(vm));
  1778. return vm;
  1779. }
  1780. var encodeReserveRE = /[!'()*]/g;
  1781. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1782. var commaRE = /%2C/g;
  1783. // fixed encodeURIComponent which is more conformant to RFC3986:
  1784. // - escapes [!'()*]
  1785. // - preserve commas
  1786. var encode = function encode(str) {return encodeURIComponent(str).
  1787. replace(encodeReserveRE, encodeReserveReplacer).
  1788. replace(commaRE, ',');};
  1789. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1790. var res = obj ? Object.keys(obj).map(function (key) {
  1791. var val = obj[key];
  1792. if (val === undefined) {
  1793. return '';
  1794. }
  1795. if (val === null) {
  1796. return encodeStr(key);
  1797. }
  1798. if (Array.isArray(val)) {
  1799. var result = [];
  1800. val.forEach(function (val2) {
  1801. if (val2 === undefined) {
  1802. return;
  1803. }
  1804. if (val2 === null) {
  1805. result.push(encodeStr(key));
  1806. } else {
  1807. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1808. }
  1809. });
  1810. return result.join('&');
  1811. }
  1812. return encodeStr(key) + '=' + encodeStr(val);
  1813. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1814. return res ? "?".concat(res) : '';
  1815. }
  1816. function parseBaseComponent(vueComponentOptions)
  1817. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1818. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1819. var options = _objectSpread({
  1820. multipleSlots: true,
  1821. addGlobalClass: true },
  1822. vueOptions.options || {});
  1823. {
  1824. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1825. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1826. Object.assign(options, vueOptions['mp-weixin'].options);
  1827. }
  1828. }
  1829. var componentOptions = {
  1830. options: options,
  1831. data: initData(vueOptions, _vue.default.prototype),
  1832. behaviors: initBehaviors(vueOptions, initBehavior),
  1833. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1834. lifetimes: {
  1835. attached: function attached() {
  1836. var properties = this.properties;
  1837. var options = {
  1838. mpType: isPage.call(this) ? 'page' : 'component',
  1839. mpInstance: this,
  1840. propsData: properties };
  1841. initVueIds(properties.vueId, this);
  1842. // 处理父子关系
  1843. initRelation.call(this, {
  1844. vuePid: this._$vuePid,
  1845. vueOptions: options });
  1846. // 初始化 vue 实例
  1847. this.$vm = new VueComponent(options);
  1848. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1849. initSlots(this.$vm, properties.vueSlots);
  1850. // 触发首次 setData
  1851. this.$vm.$mount();
  1852. },
  1853. ready: function ready() {
  1854. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1855. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1856. if (this.$vm) {
  1857. this.$vm._isMounted = true;
  1858. this.$vm.__call_hook('mounted');
  1859. this.$vm.__call_hook('onReady');
  1860. }
  1861. },
  1862. detached: function detached() {
  1863. this.$vm && this.$vm.$destroy();
  1864. } },
  1865. pageLifetimes: {
  1866. show: function show(args) {
  1867. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1868. },
  1869. hide: function hide() {
  1870. this.$vm && this.$vm.__call_hook('onPageHide');
  1871. },
  1872. resize: function resize(size) {
  1873. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1874. } },
  1875. methods: {
  1876. __l: handleLink,
  1877. __e: handleEvent } };
  1878. // externalClasses
  1879. if (vueOptions.externalClasses) {
  1880. componentOptions.externalClasses = vueOptions.externalClasses;
  1881. }
  1882. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1883. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1884. componentOptions.methods[callMethod] = function (args) {
  1885. return this.$vm[callMethod](args);
  1886. };
  1887. });
  1888. }
  1889. if (isPage) {
  1890. return componentOptions;
  1891. }
  1892. return [componentOptions, VueComponent];
  1893. }
  1894. function parseComponent(vueComponentOptions) {
  1895. return parseBaseComponent(vueComponentOptions, {
  1896. isPage: isPage,
  1897. initRelation: initRelation });
  1898. }
  1899. var hooks$1 = [
  1900. 'onShow',
  1901. 'onHide',
  1902. 'onUnload'];
  1903. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1904. function parseBasePage(vuePageOptions, _ref6)
  1905. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1906. var pageOptions = parseComponent(vuePageOptions);
  1907. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1908. pageOptions.methods.onLoad = function (query) {
  1909. this.options = query;
  1910. var copyQuery = Object.assign({}, query);
  1911. delete copyQuery.__id__;
  1912. this.$page = {
  1913. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1914. this.$vm.$mp.query = query; // 兼容 mpvue
  1915. this.$vm.__call_hook('onLoad', query);
  1916. };
  1917. return pageOptions;
  1918. }
  1919. function parsePage(vuePageOptions) {
  1920. return parseBasePage(vuePageOptions, {
  1921. isPage: isPage,
  1922. initRelation: initRelation });
  1923. }
  1924. function createPage(vuePageOptions) {
  1925. {
  1926. return Component(parsePage(vuePageOptions));
  1927. }
  1928. }
  1929. function createComponent(vueOptions) {
  1930. {
  1931. return Component(parseComponent(vueOptions));
  1932. }
  1933. }
  1934. function createSubpackageApp(vm) {
  1935. var appOptions = parseApp(vm);
  1936. var app = getApp({
  1937. allowDefault: true });
  1938. vm.$scope = app;
  1939. var globalData = app.globalData;
  1940. if (globalData) {
  1941. Object.keys(appOptions.globalData).forEach(function (name) {
  1942. if (!hasOwn(globalData, name)) {
  1943. globalData[name] = appOptions.globalData[name];
  1944. }
  1945. });
  1946. }
  1947. Object.keys(appOptions).forEach(function (name) {
  1948. if (!hasOwn(app, name)) {
  1949. app[name] = appOptions[name];
  1950. }
  1951. });
  1952. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1953. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1954. vm.__call_hook('onShow', args);
  1955. });
  1956. }
  1957. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1958. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1959. vm.__call_hook('onHide', args);
  1960. });
  1961. }
  1962. if (isFn(appOptions.onLaunch)) {
  1963. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1964. vm.__call_hook('onLaunch', args);
  1965. }
  1966. return vm;
  1967. }
  1968. function createPlugin(vm) {
  1969. var appOptions = parseApp(vm);
  1970. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1971. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1972. vm.__call_hook('onShow', args);
  1973. });
  1974. }
  1975. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1976. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1977. vm.__call_hook('onHide', args);
  1978. });
  1979. }
  1980. if (isFn(appOptions.onLaunch)) {
  1981. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1982. vm.__call_hook('onLaunch', args);
  1983. }
  1984. return vm;
  1985. }
  1986. todos.forEach(function (todoApi) {
  1987. protocols[todoApi] = false;
  1988. });
  1989. canIUses.forEach(function (canIUseApi) {
  1990. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1991. canIUseApi;
  1992. if (!wx.canIUse(apiName)) {
  1993. protocols[canIUseApi] = false;
  1994. }
  1995. });
  1996. var uni = {};
  1997. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1998. uni = new Proxy({}, {
  1999. get: function get(target, name) {
  2000. if (hasOwn(target, name)) {
  2001. return target[name];
  2002. }
  2003. if (baseApi[name]) {
  2004. return baseApi[name];
  2005. }
  2006. if (api[name]) {
  2007. return promisify(name, api[name]);
  2008. }
  2009. {
  2010. if (extraApi[name]) {
  2011. return promisify(name, extraApi[name]);
  2012. }
  2013. if (todoApis[name]) {
  2014. return promisify(name, todoApis[name]);
  2015. }
  2016. }
  2017. if (eventApi[name]) {
  2018. return eventApi[name];
  2019. }
  2020. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2021. return;
  2022. }
  2023. return promisify(name, wrapper(name, wx[name]));
  2024. },
  2025. set: function set(target, name, value) {
  2026. target[name] = value;
  2027. return true;
  2028. } });
  2029. } else {
  2030. Object.keys(baseApi).forEach(function (name) {
  2031. uni[name] = baseApi[name];
  2032. });
  2033. {
  2034. Object.keys(todoApis).forEach(function (name) {
  2035. uni[name] = promisify(name, todoApis[name]);
  2036. });
  2037. Object.keys(extraApi).forEach(function (name) {
  2038. uni[name] = promisify(name, todoApis[name]);
  2039. });
  2040. }
  2041. Object.keys(eventApi).forEach(function (name) {
  2042. uni[name] = eventApi[name];
  2043. });
  2044. Object.keys(api).forEach(function (name) {
  2045. uni[name] = promisify(name, api[name]);
  2046. });
  2047. Object.keys(wx).forEach(function (name) {
  2048. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2049. uni[name] = promisify(name, wrapper(name, wx[name]));
  2050. }
  2051. });
  2052. }
  2053. wx.createApp = createApp;
  2054. wx.createPage = createPage;
  2055. wx.createComponent = createComponent;
  2056. wx.createSubpackageApp = createSubpackageApp;
  2057. wx.createPlugin = createPlugin;
  2058. var uni$1 = uni;var _default =
  2059. uni$1;exports.default = _default;
  2060. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2061. /***/ }),
  2062. /***/ 11:
  2063. /*!**********************************************************************************************************!*\
  2064. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2065. \**********************************************************************************************************/
  2066. /*! exports provided: default */
  2067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2068. "use strict";
  2069. __webpack_require__.r(__webpack_exports__);
  2070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2071. /* globals __VUE_SSR_CONTEXT__ */
  2072. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2073. // This module is a runtime utility for cleaner component module output and will
  2074. // be included in the final webpack user bundle.
  2075. function normalizeComponent (
  2076. scriptExports,
  2077. render,
  2078. staticRenderFns,
  2079. functionalTemplate,
  2080. injectStyles,
  2081. scopeId,
  2082. moduleIdentifier, /* server only */
  2083. shadowMode, /* vue-cli only */
  2084. components, // fixed by xxxxxx auto components
  2085. renderjs // fixed by xxxxxx renderjs
  2086. ) {
  2087. // Vue.extend constructor export interop
  2088. var options = typeof scriptExports === 'function'
  2089. ? scriptExports.options
  2090. : scriptExports
  2091. // fixed by xxxxxx auto components
  2092. if (components) {
  2093. if (!options.components) {
  2094. options.components = {}
  2095. }
  2096. var hasOwn = Object.prototype.hasOwnProperty
  2097. for (var name in components) {
  2098. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2099. options.components[name] = components[name]
  2100. }
  2101. }
  2102. }
  2103. // fixed by xxxxxx renderjs
  2104. if (renderjs) {
  2105. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2106. this[renderjs.__module] = this
  2107. });
  2108. (options.mixins || (options.mixins = [])).push(renderjs)
  2109. }
  2110. // render functions
  2111. if (render) {
  2112. options.render = render
  2113. options.staticRenderFns = staticRenderFns
  2114. options._compiled = true
  2115. }
  2116. // functional template
  2117. if (functionalTemplate) {
  2118. options.functional = true
  2119. }
  2120. // scopedId
  2121. if (scopeId) {
  2122. options._scopeId = 'data-v-' + scopeId
  2123. }
  2124. var hook
  2125. if (moduleIdentifier) { // server build
  2126. hook = function (context) {
  2127. // 2.3 injection
  2128. context =
  2129. context || // cached call
  2130. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2131. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2132. // 2.2 with runInNewContext: true
  2133. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2134. context = __VUE_SSR_CONTEXT__
  2135. }
  2136. // inject component styles
  2137. if (injectStyles) {
  2138. injectStyles.call(this, context)
  2139. }
  2140. // register component module identifier for async chunk inferrence
  2141. if (context && context._registeredComponents) {
  2142. context._registeredComponents.add(moduleIdentifier)
  2143. }
  2144. }
  2145. // used by ssr in case component is cached and beforeCreate
  2146. // never gets called
  2147. options._ssrRegister = hook
  2148. } else if (injectStyles) {
  2149. hook = shadowMode
  2150. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2151. : injectStyles
  2152. }
  2153. if (hook) {
  2154. if (options.functional) {
  2155. // for template-only hot-reload because in that case the render fn doesn't
  2156. // go through the normalizer
  2157. options._injectStyles = hook
  2158. // register for functioal component in vue file
  2159. var originalRender = options.render
  2160. options.render = function renderWithStyleInjection (h, context) {
  2161. hook.call(context)
  2162. return originalRender(h, context)
  2163. }
  2164. } else {
  2165. // inject component registration as beforeCreate hook
  2166. var existing = options.beforeCreate
  2167. options.beforeCreate = existing
  2168. ? [].concat(existing, hook)
  2169. : [hook]
  2170. }
  2171. }
  2172. return {
  2173. exports: scriptExports,
  2174. options: options
  2175. }
  2176. }
  2177. /***/ }),
  2178. /***/ 119:
  2179. /*!**************************************!*\
  2180. !*** E:/fp/md/mdapp/utils/qrcode.js ***!
  2181. \**************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;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;} /**
  2186. * qrcode-wx-miniprogram
  2187. */
  2188. var QRMode = {
  2189. MODE_NUMBER: 1 << 0,
  2190. MODE_ALPHA_NUM: 1 << 1,
  2191. MODE_8BIT_BYTE: 1 << 2,
  2192. MODE_KANJI: 1 << 3 },
  2193. QRErrorCorrectLevel = {
  2194. L: 1,
  2195. M: 0,
  2196. Q: 3,
  2197. H: 2 },
  2198. QRMaskPattern = {
  2199. PATTERN000: 0,
  2200. PATTERN001: 1,
  2201. PATTERN010: 2,
  2202. PATTERN011: 3,
  2203. PATTERN100: 4,
  2204. PATTERN101: 5,
  2205. PATTERN110: 6,
  2206. PATTERN111: 7 },
  2207. QRUtil = {
  2208. PATTERN_POSITION_TABLE: [
  2209. [],
  2210. [6, 18],
  2211. [6, 22],
  2212. [6, 26],
  2213. [6, 30],
  2214. [6, 34],
  2215. [6, 22, 38],
  2216. [6, 24, 42],
  2217. [6, 26, 46],
  2218. [6, 28, 50],
  2219. [6, 30, 54],
  2220. [6, 32, 58],
  2221. [6, 34, 62],
  2222. [6, 26, 46, 66],
  2223. [6, 26, 48, 70],
  2224. [6, 26, 50, 74],
  2225. [6, 30, 54, 78],
  2226. [6, 30, 56, 82],
  2227. [6, 30, 58, 86],
  2228. [6, 34, 62, 90],
  2229. [6, 28, 50, 72, 94],
  2230. [6, 26, 50, 74, 98],
  2231. [6, 30, 54, 78, 102],
  2232. [6, 28, 54, 80, 106],
  2233. [6, 32, 58, 84, 110],
  2234. [6, 30, 58, 86, 114],
  2235. [6, 34, 62, 90, 118],
  2236. [6, 26, 50, 74, 98, 122],
  2237. [6, 30, 54, 78, 102, 126],
  2238. [6, 26, 52, 78, 104, 130],
  2239. [6, 30, 56, 82, 108, 134],
  2240. [6, 34, 60, 86, 112, 138],
  2241. [6, 30, 58, 86, 114, 142],
  2242. [6, 34, 62, 90, 118, 146],
  2243. [6, 30, 54, 78, 102, 126, 150],
  2244. [6, 24, 50, 76, 102, 128, 154],
  2245. [6, 28, 54, 80, 106, 132, 158],
  2246. [6, 32, 58, 84, 110, 136, 162],
  2247. [6, 26, 54, 82, 110, 138, 166],
  2248. [6, 30, 58, 86, 114, 142, 170]],
  2249. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  2250. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  2251. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  2252. getBCHTypeInfo: function getBCHTypeInfo(data) {
  2253. var d = data << 10;
  2254. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  2255. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  2256. }
  2257. return (data << 10 | d) ^ QRUtil.G15_MASK;
  2258. },
  2259. getBCHTypeNumber: function getBCHTypeNumber(data) {
  2260. var d = data << 12;
  2261. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  2262. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  2263. }
  2264. return data << 12 | d;
  2265. },
  2266. getBCHDigit: function getBCHDigit(data) {
  2267. var digit = 0;
  2268. while (data != 0) {
  2269. digit++;
  2270. data >>>= 1;
  2271. }
  2272. return digit;
  2273. },
  2274. getPatternPosition: function getPatternPosition(typeNumber) {
  2275. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  2276. },
  2277. getMask: function getMask(maskPattern, i, j) {
  2278. switch (maskPattern) {
  2279. case QRMaskPattern.PATTERN000:
  2280. return (i + j) % 2 == 0;
  2281. case QRMaskPattern.PATTERN001:
  2282. return i % 2 == 0;
  2283. case QRMaskPattern.PATTERN010:
  2284. return j % 3 == 0;
  2285. case QRMaskPattern.PATTERN011:
  2286. return (i + j) % 3 == 0;
  2287. case QRMaskPattern.PATTERN100:
  2288. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  2289. case QRMaskPattern.PATTERN101:
  2290. return i * j % 2 + i * j % 3 == 0;
  2291. case QRMaskPattern.PATTERN110:
  2292. return (i * j % 2 + i * j % 3) % 2 == 0;
  2293. case QRMaskPattern.PATTERN111:
  2294. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  2295. default:
  2296. //throw new Error("bad maskPattern:" + maskPattern);
  2297. throwError("bad maskPattern:" + maskPattern);}
  2298. },
  2299. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  2300. var a = new QRPolynomial([1], 0);
  2301. for (var i = 0; i < errorCorrectLength; i++) {
  2302. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  2303. }
  2304. return a;
  2305. },
  2306. getLengthInBits: function getLengthInBits(mode, type) {
  2307. if (1 <= type && type < 10) {
  2308. switch (mode) {
  2309. case QRMode.MODE_NUMBER:
  2310. return 10;
  2311. case QRMode.MODE_ALPHA_NUM:
  2312. return 9;
  2313. case QRMode.MODE_8BIT_BYTE:
  2314. return 8;
  2315. case QRMode.MODE_KANJI:
  2316. return 8;
  2317. default:
  2318. //throw new Error("mode:" + mode);
  2319. throwError("mode:" + mode);}
  2320. } else if (type < 27) {
  2321. switch (mode) {
  2322. case QRMode.MODE_NUMBER:
  2323. return 12;
  2324. case QRMode.MODE_ALPHA_NUM:
  2325. return 11;
  2326. case QRMode.MODE_8BIT_BYTE:
  2327. return 16;
  2328. case QRMode.MODE_KANJI:
  2329. return 10;
  2330. default:
  2331. //throw new Error("mode:" + mode);
  2332. throwError("mode:" + mode);}
  2333. } else if (type < 41) {
  2334. switch (mode) {
  2335. case QRMode.MODE_NUMBER:
  2336. return 14;
  2337. case QRMode.MODE_ALPHA_NUM:
  2338. return 13;
  2339. case QRMode.MODE_8BIT_BYTE:
  2340. return 16;
  2341. case QRMode.MODE_KANJI:
  2342. return 12;
  2343. default:
  2344. //throw new Error("mode:" + mode);
  2345. throwError("mode:" + mode);}
  2346. } else {
  2347. //throw new Error("type:" + type);
  2348. throwError("type:" + type);
  2349. }
  2350. },
  2351. getLostPoint: function getLostPoint(qrCode) {
  2352. var moduleCount = qrCode.getModuleCount();
  2353. var lostPoint = 0;
  2354. for (var row = 0; row < moduleCount; row++) {
  2355. for (var col = 0; col < moduleCount; col++) {
  2356. var sameCount = 0;
  2357. var dark = qrCode.isDark(row, col);
  2358. for (var r = -1; r <= 1; r++) {
  2359. if (row + r < 0 || moduleCount <= row + r) {
  2360. continue;
  2361. }
  2362. for (var c = -1; c <= 1; c++) {
  2363. if (col + c < 0 || moduleCount <= col + c) {
  2364. continue;
  2365. }
  2366. if (r == 0 && c == 0) {
  2367. continue;
  2368. }
  2369. if (dark == qrCode.isDark(row + r, col + c)) {
  2370. sameCount++;
  2371. }
  2372. }
  2373. }
  2374. if (sameCount > 5) {
  2375. lostPoint += 3 + sameCount - 5;
  2376. }
  2377. }
  2378. }
  2379. for (var row = 0; row < moduleCount - 1; row++) {
  2380. for (var col = 0; col < moduleCount - 1; col++) {
  2381. var count = 0;
  2382. if (qrCode.isDark(row, col)) count++;
  2383. if (qrCode.isDark(row + 1, col)) count++;
  2384. if (qrCode.isDark(row, col + 1)) count++;
  2385. if (qrCode.isDark(row + 1, col + 1)) count++;
  2386. if (count == 0 || count == 4) {
  2387. lostPoint += 3;
  2388. }
  2389. }
  2390. }
  2391. for (var row = 0; row < moduleCount; row++) {
  2392. for (var col = 0; col < moduleCount - 6; col++) {
  2393. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) &&
  2394. qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col +
  2395. 5) && qrCode.isDark(row, col + 6)) {
  2396. lostPoint += 40;
  2397. }
  2398. }
  2399. }
  2400. for (var col = 0; col < moduleCount; col++) {
  2401. for (var row = 0; row < moduleCount - 6; row++) {
  2402. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) &&
  2403. qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5,
  2404. col) && qrCode.isDark(row + 6, col)) {
  2405. lostPoint += 40;
  2406. }
  2407. }
  2408. }
  2409. var darkCount = 0;
  2410. for (var col = 0; col < moduleCount; col++) {
  2411. for (var row = 0; row < moduleCount; row++) {
  2412. if (qrCode.isDark(row, col)) {
  2413. darkCount++;
  2414. }
  2415. }
  2416. }
  2417. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  2418. lostPoint += ratio * 10;
  2419. return lostPoint;
  2420. } },
  2421. QRMath = {
  2422. glog: function glog(n) {
  2423. if (n < 1) {
  2424. //throw new Error("glog(" + n + ")");
  2425. throwError("glog(" + n + ")");
  2426. }
  2427. return QRMath.LOG_TABLE[n];
  2428. },
  2429. gexp: function gexp(n) {
  2430. while (n < 0) {
  2431. n += 255;
  2432. }
  2433. while (n >= 256) {
  2434. n -= 255;
  2435. }
  2436. return QRMath.EXP_TABLE[n];
  2437. },
  2438. EXP_TABLE: new Array(256),
  2439. LOG_TABLE: new Array(256) };
  2440. for (var i = 0; i < 8; i++) {
  2441. QRMath.EXP_TABLE[i] = 1 << i;
  2442. }
  2443. for (var _i = 8; _i < 256; _i++) {
  2444. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.
  2445. EXP_TABLE[_i - 8];
  2446. }
  2447. for (var _i2 = 0; _i2 < 255; _i2++) {
  2448. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  2449. }
  2450. /*
  2451. * class QR8bitByte
  2452. * */var
  2453. QR8bitByte = /*#__PURE__*/function () {
  2454. function QR8bitByte(data) {_classCallCheck(this, QR8bitByte);
  2455. this.mode = QRMode.MODE_8BIT_BYTE;
  2456. this.data = data;
  2457. this.parsedData = [];
  2458. // Added to support UTF-8 Characters
  2459. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  2460. var byteArray = [],
  2461. code = this.data.charCodeAt(_i3);
  2462. if (code > 0x10000) {
  2463. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  2464. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  2465. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  2466. byteArray[3] = 0x80 | code & 0x3F;
  2467. } else if (code > 0x800) {
  2468. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  2469. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  2470. byteArray[2] = 0x80 | code & 0x3F;
  2471. } else if (code > 0x80) {
  2472. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  2473. byteArray[1] = 0x80 | code & 0x3F;
  2474. } else {
  2475. byteArray[0] = code;
  2476. }
  2477. this.parsedData.push(byteArray);
  2478. }
  2479. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  2480. if (this.parsedData.length !== this.data.length) {
  2481. this.parsedData.unshift(191);
  2482. this.parsedData.unshift(187);
  2483. this.parsedData.unshift(239);
  2484. }
  2485. }_createClass(QR8bitByte, [{ key: "getLength", value: function getLength(
  2486. buffer) {
  2487. return this.parsedData.length;
  2488. } }, { key: "write", value: function write(
  2489. buffer) {
  2490. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  2491. buffer.put(this.parsedData[_i4], 8);
  2492. }
  2493. } }]);return QR8bitByte;}();
  2494. /*
  2495. * class QRCodeModel
  2496. * */var
  2497. QRCodeModel = /*#__PURE__*/function () {
  2498. function QRCodeModel(typeNumber, errorCorrectLevel) {_classCallCheck(this, QRCodeModel);
  2499. this.typeNumber = typeNumber;
  2500. this.errorCorrectLevel = errorCorrectLevel;
  2501. this.modules = null;
  2502. this.moduleCount = 0;
  2503. this.dataCache = null;
  2504. this.dataList = [];
  2505. }_createClass(QRCodeModel, [{ key: "addData", value: function addData(
  2506. data) {
  2507. var newData = new QR8bitByte(data);
  2508. this.dataList.push(newData);
  2509. this.dataCache = null;
  2510. } }, { key: "isDark", value: function isDark(
  2511. row, col) {
  2512. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  2513. //throw new Error(row + ',' + col);
  2514. throwError(row + ',' + col);
  2515. }
  2516. return this.modules[row][col];
  2517. } }, { key: "getModuleCount", value: function getModuleCount()
  2518. {
  2519. return this.moduleCount;
  2520. } }, { key: "make", value: function make()
  2521. {
  2522. this.makeImpl(false, this.getBestMaskPattern());
  2523. } }, { key: "makeImpl", value: function makeImpl(
  2524. test, maskPattern) {
  2525. this.moduleCount = this.typeNumber * 4 + 17;
  2526. this.modules = new Array(this.moduleCount);
  2527. for (var row = 0; row < this.moduleCount; row++) {
  2528. this.modules[row] = new Array(this.moduleCount);
  2529. for (var col = 0; col < this.moduleCount; col++) {
  2530. this.modules[row][col] = null;
  2531. }
  2532. }
  2533. this.setupPositionProbePattern(0, 0);
  2534. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  2535. this.setupPositionProbePattern(0, this.moduleCount - 7);
  2536. this.setupPositionAdjustPattern();
  2537. this.setupTimingPattern();
  2538. this.setupTypeInfo(test, maskPattern);
  2539. if (this.typeNumber >= 7) {
  2540. this.setupTypeNumber(test);
  2541. }
  2542. if (this.dataCache == null) {
  2543. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  2544. }
  2545. this.mapData(this.dataCache, maskPattern);
  2546. } }, { key: "setupPositionProbePattern", value: function setupPositionProbePattern(
  2547. row, col) {
  2548. for (var r = -1; r <= 7; r++) {
  2549. if (row + r <= -1 || this.moduleCount <= row + r) {
  2550. continue;
  2551. }
  2552. for (var c = -1; c <= 7; c++) {
  2553. if (col + c <= -1 || this.moduleCount <= col + c) {
  2554. continue;
  2555. }
  2556. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) ||
  2557. 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  2558. }
  2559. }
  2560. } }, { key: "getBestMaskPattern", value: function getBestMaskPattern()
  2561. {
  2562. var minLostPoint = 0,
  2563. pattern = 0;
  2564. for (var _i5 = 0; _i5 < 8; _i5++) {
  2565. this.makeImpl(true, _i5);
  2566. var lostPoint = QRUtil.getLostPoint(this);
  2567. if (_i5 == 0 || minLostPoint > lostPoint) {
  2568. minLostPoint = lostPoint;
  2569. pattern = _i5;
  2570. }
  2571. }
  2572. return pattern;
  2573. } }, { key: "setupTimingPattern", value: function setupTimingPattern()
  2574. {
  2575. for (var r = 8; r < this.moduleCount - 8; r++) {
  2576. if (this.modules[r][6] != null) {
  2577. continue;
  2578. }
  2579. this.modules[r][6] = r % 2 == 0;
  2580. }
  2581. for (var c = 8; c < this.moduleCount - 8; c++) {
  2582. if (this.modules[6][c] != null) {
  2583. continue;
  2584. }
  2585. this.modules[6][c] = c % 2 == 0;
  2586. }
  2587. } }, { key: "setupPositionAdjustPattern", value: function setupPositionAdjustPattern()
  2588. {
  2589. var pos = QRUtil.getPatternPosition(this.typeNumber);
  2590. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  2591. for (var j = 0; j < pos.length; j++) {
  2592. var row = pos[_i6],
  2593. col = pos[j];
  2594. if (this.modules[row][col] != null) {
  2595. continue;
  2596. }
  2597. for (var r = -2; r <= 2; r++) {
  2598. for (var c = -2; c <= 2; c++) {
  2599. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c ==
  2600. 0;
  2601. }
  2602. }
  2603. }
  2604. }
  2605. } }, { key: "setupTypeNumber", value: function setupTypeNumber(
  2606. test) {
  2607. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  2608. for (var _i7 = 0; _i7 < 18; _i7++) {
  2609. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  2610. }
  2611. for (var _i8 = 0; _i8 < 18; _i8++) {
  2612. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  2613. }
  2614. } }, { key: "setupTypeInfo", value: function setupTypeInfo(
  2615. test, maskPattern) {
  2616. var data = this.errorCorrectLevel << 3 | maskPattern,
  2617. bits = QRUtil.getBCHTypeInfo(data);
  2618. for (var _i9 = 0; _i9 < 15; _i9++) {
  2619. var mod = !test && (bits >> _i9 & 1) == 1;
  2620. if (_i9 < 6) {
  2621. this.modules[_i9][8] = mod;
  2622. } else if (_i9 < 8) {
  2623. this.modules[_i9 + 1][8] = mod;
  2624. } else {
  2625. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  2626. }
  2627. }
  2628. for (var _i10 = 0; _i10 < 15; _i10++) {
  2629. var _mod = !test && (bits >> _i10 & 1) == 1;
  2630. if (_i10 < 8) {
  2631. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  2632. } else if (_i10 < 9) {
  2633. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  2634. } else {
  2635. this.modules[8][15 - _i10 - 1] = _mod;
  2636. }
  2637. }
  2638. this.modules[this.moduleCount - 8][8] = !test;
  2639. } }, { key: "mapData", value: function mapData(
  2640. data, maskPattern) {
  2641. var inc = -1,
  2642. row = this.moduleCount - 1,
  2643. bitIndex = 7,
  2644. byteIndex = 0;
  2645. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  2646. if (col == 6) col--;
  2647. while (true) {
  2648. for (var c = 0; c < 2; c++) {
  2649. if (this.modules[row][col - c] == null) {
  2650. var dark = false;
  2651. if (byteIndex < data.length) {
  2652. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2653. }
  2654. var mask = QRUtil.getMask(maskPattern, row, col - c);
  2655. if (mask) {
  2656. dark = !dark;
  2657. }
  2658. this.modules[row][col - c] = dark;
  2659. bitIndex--;
  2660. if (bitIndex == -1) {
  2661. byteIndex++;
  2662. bitIndex = 7;
  2663. }
  2664. }
  2665. }
  2666. row += inc;
  2667. if (row < 0 || this.moduleCount <= row) {
  2668. row -= inc;
  2669. inc = -inc;
  2670. break;
  2671. }
  2672. }
  2673. }
  2674. } }]);return QRCodeModel;}();
  2675. QRCodeModel.PAD0 = 0xEC;
  2676. QRCodeModel.PAD1 = 0x11;
  2677. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  2678. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  2679. buffer = new QRBitBuffer();
  2680. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  2681. var data = dataList[_i11];
  2682. buffer.put(data.mode, 4);
  2683. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  2684. data.write(buffer);
  2685. }
  2686. var totalDataCount = 0;
  2687. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  2688. totalDataCount += rsBlocks[_i12].dataCount;
  2689. }
  2690. if (buffer.getLengthInBits() > totalDataCount * 8) {
  2691. /*
  2692. throw new Error("code length overflow. (" +
  2693. buffer.getLengthInBits() +
  2694. ">" +
  2695. totalDataCount * 8 +
  2696. ")");
  2697. */
  2698. throwError("code length overflow. (" +
  2699. buffer.getLengthInBits() +
  2700. ">" +
  2701. totalDataCount * 8 +
  2702. ")");
  2703. }
  2704. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  2705. buffer.put(0, 4);
  2706. }
  2707. while (buffer.getLengthInBits() % 8 != 0) {
  2708. buffer.putBit(false);
  2709. }
  2710. while (true) {
  2711. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2712. break;
  2713. }
  2714. buffer.put(QRCodeModel.PAD0, 8);
  2715. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  2716. break;
  2717. }
  2718. buffer.put(QRCodeModel.PAD1, 8);
  2719. }
  2720. return QRCodeModel.createBytes(buffer, rsBlocks);
  2721. };
  2722. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  2723. var offset = 0,
  2724. maxDcCount = 0,
  2725. maxEcCount = 0,
  2726. dcData = new Array(rsBlocks.length),
  2727. ecData = new Array(rsBlocks.length);
  2728. for (var r = 0; r < rsBlocks.length; r++) {
  2729. var dcCount = rsBlocks[r].dataCount,
  2730. ecCount = rsBlocks[r].totalCount - dcCount;
  2731. maxDcCount = Math.max(maxDcCount, dcCount);
  2732. maxEcCount = Math.max(maxEcCount, ecCount);
  2733. dcData[r] = new Array(dcCount);
  2734. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  2735. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  2736. }
  2737. offset += dcCount;
  2738. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  2739. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  2740. modPoly = rawPoly.mod(rsPoly);
  2741. ecData[r] = new Array(rsPoly.getLength() - 1);
  2742. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  2743. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  2744. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  2745. }
  2746. }
  2747. var totalCodeCount = 0;
  2748. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  2749. totalCodeCount += rsBlocks[_i15].totalCount;
  2750. }
  2751. var data = new Array(totalCodeCount),
  2752. index = 0;
  2753. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  2754. for (var _r = 0; _r < rsBlocks.length; _r++) {
  2755. if (_i16 < dcData[_r].length) {
  2756. data[index++] = dcData[_r][_i16];
  2757. }
  2758. }
  2759. }
  2760. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  2761. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  2762. if (_i17 < ecData[_r2].length) {
  2763. data[index++] = ecData[_r2][_i17];
  2764. }
  2765. }
  2766. }
  2767. return data;
  2768. };
  2769. /*
  2770. * class QRPolynomial
  2771. * */var
  2772. QRPolynomial = /*#__PURE__*/function () {
  2773. function QRPolynomial(num, shift) {_classCallCheck(this, QRPolynomial);
  2774. if (num.length == undefined) {
  2775. //throw new Error(num.length + '/' + shift);
  2776. throwError(num.length + '/' + shift);
  2777. }
  2778. var offset = 0;
  2779. while (offset < num.length && num[offset] == 0) {
  2780. offset++;
  2781. }
  2782. this.num = new Array(num.length - offset + shift);
  2783. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  2784. this.num[_i18] = num[_i18 + offset];
  2785. }
  2786. }_createClass(QRPolynomial, [{ key: "get", value: function get(
  2787. index) {
  2788. return this.num[index];
  2789. } }, { key: "getLength", value: function getLength()
  2790. {
  2791. return this.num.length;
  2792. } }, { key: "multiply", value: function multiply(
  2793. e) {
  2794. var num = new Array(this.getLength() + e.getLength() - 1);
  2795. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  2796. for (var j = 0; j < e.getLength(); j++) {
  2797. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  2798. }
  2799. }
  2800. return new QRPolynomial(num, 0);
  2801. } }, { key: "mod", value: function mod(
  2802. e) {
  2803. if (this.getLength() - e.getLength() < 0) {
  2804. return this;
  2805. }
  2806. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  2807. num = new Array(this.getLength());
  2808. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  2809. num[_i20] = this.get(_i20);
  2810. }
  2811. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  2812. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  2813. }
  2814. return new QRPolynomial(num, 0).mod(e);
  2815. } }]);return QRPolynomial;}();
  2816. /*
  2817. * class QRRSBlock
  2818. * */var
  2819. QRRSBlock =
  2820. function QRRSBlock(totalCount, dataCount) {_classCallCheck(this, QRRSBlock);
  2821. this.totalCount = totalCount;
  2822. this.dataCount = dataCount;
  2823. };
  2824. QRRSBlock.RS_BLOCK_TABLE = [
  2825. [1, 26, 19],
  2826. [1, 26, 16],
  2827. [1, 26, 13],
  2828. [1, 26, 9],
  2829. [1, 44, 34],
  2830. [1, 44, 28],
  2831. [1, 44, 22],
  2832. [1, 44, 16],
  2833. [1, 70, 55],
  2834. [1, 70, 44],
  2835. [2, 35, 17],
  2836. [2, 35, 13],
  2837. [1, 100, 80],
  2838. [2, 50, 32],
  2839. [2, 50, 24],
  2840. [4, 25, 9],
  2841. [1, 134, 108],
  2842. [2, 67, 43],
  2843. [2, 33, 15, 2, 34, 16],
  2844. [2, 33, 11, 2, 34, 12],
  2845. [2, 86, 68],
  2846. [4, 43, 27],
  2847. [4, 43, 19],
  2848. [4, 43, 15],
  2849. [2, 98, 78],
  2850. [4, 49, 31],
  2851. [2, 32, 14, 4, 33, 15],
  2852. [4, 39, 13, 1, 40, 14],
  2853. [2, 121, 97],
  2854. [2, 60, 38, 2, 61, 39],
  2855. [4, 40, 18, 2, 41, 19],
  2856. [4, 40, 14, 2, 41, 15],
  2857. [2, 146, 116],
  2858. [3, 58, 36, 2, 59, 37],
  2859. [4, 36, 16, 4, 37, 17],
  2860. [4, 36, 12, 4, 37, 13],
  2861. [2, 86, 68, 2, 87, 69],
  2862. [4, 69, 43, 1, 70, 44],
  2863. [6, 43, 19, 2, 44, 20],
  2864. [6, 43, 15, 2, 44, 16],
  2865. [4, 101, 81],
  2866. [1, 80, 50, 4, 81, 51],
  2867. [4, 50, 22, 4, 51, 23],
  2868. [3, 36, 12, 8, 37, 13],
  2869. [2, 116, 92, 2, 117, 93],
  2870. [6, 58, 36, 2, 59, 37],
  2871. [4, 46, 20, 6, 47, 21],
  2872. [7, 42, 14, 4, 43, 15],
  2873. [4, 133, 107],
  2874. [8, 59, 37, 1, 60, 38],
  2875. [8, 44, 20, 4, 45, 21],
  2876. [12, 33, 11, 4, 34, 12],
  2877. [3, 145, 115, 1, 146, 116],
  2878. [4, 64, 40, 5, 65, 41],
  2879. [11, 36, 16, 5, 37, 17],
  2880. [11, 36, 12, 5, 37, 13],
  2881. [5, 109, 87, 1, 110, 88],
  2882. [5, 65, 41, 5, 66, 42],
  2883. [5, 54, 24, 7, 55, 25],
  2884. [11, 36, 12],
  2885. [5, 122, 98, 1, 123, 99],
  2886. [7, 73, 45, 3, 74, 46],
  2887. [15, 43, 19, 2, 44, 20],
  2888. [3, 45, 15, 13, 46, 16],
  2889. [1, 135, 107, 5, 136, 108],
  2890. [10, 74, 46, 1, 75, 47],
  2891. [1, 50, 22, 15, 51, 23],
  2892. [2, 42, 14, 17, 43, 15],
  2893. [5, 150, 120, 1, 151, 121],
  2894. [9, 69, 43, 4, 70, 44],
  2895. [17, 50, 22, 1, 51, 23],
  2896. [2, 42, 14, 19, 43, 15],
  2897. [3, 141, 113, 4, 142, 114],
  2898. [3, 70, 44, 11, 71, 45],
  2899. [17, 47, 21, 4, 48, 22],
  2900. [9, 39, 13, 16, 40, 14],
  2901. [3, 135, 107, 5, 136, 108],
  2902. [3, 67, 41, 13, 68, 42],
  2903. [15, 54, 24, 5, 55, 25],
  2904. [15, 43, 15, 10, 44, 16],
  2905. [4, 144, 116, 4, 145, 117],
  2906. [17, 68, 42],
  2907. [17, 50, 22, 6, 51, 23],
  2908. [19, 46, 16, 6, 47, 17],
  2909. [2, 139, 111, 7, 140, 112],
  2910. [17, 74, 46],
  2911. [7, 54, 24, 16, 55, 25],
  2912. [34, 37, 13],
  2913. [4, 151, 121, 5, 152, 122],
  2914. [4, 75, 47, 14, 76, 48],
  2915. [11, 54, 24, 14, 55, 25],
  2916. [16, 45, 15, 14, 46, 16],
  2917. [6, 147, 117, 4, 148, 118],
  2918. [6, 73, 45, 14, 74, 46],
  2919. [11, 54, 24, 16, 55, 25],
  2920. [30, 46, 16, 2, 47, 17],
  2921. [8, 132, 106, 4, 133, 107],
  2922. [8, 75, 47, 13, 76, 48],
  2923. [7, 54, 24, 22, 55, 25],
  2924. [22, 45, 15, 13, 46, 16],
  2925. [10, 142, 114, 2, 143, 115],
  2926. [19, 74, 46, 4, 75, 47],
  2927. [28, 50, 22, 6, 51, 23],
  2928. [33, 46, 16, 4, 47, 17],
  2929. [8, 152, 122, 4, 153, 123],
  2930. [22, 73, 45, 3, 74, 46],
  2931. [8, 53, 23, 26, 54, 24],
  2932. [12, 45, 15, 28, 46, 16],
  2933. [3, 147, 117, 10, 148, 118],
  2934. [3, 73, 45, 23, 74, 46],
  2935. [4, 54, 24, 31, 55, 25],
  2936. [11, 45, 15, 31, 46, 16],
  2937. [7, 146, 116, 7, 147, 117],
  2938. [21, 73, 45, 7, 74, 46],
  2939. [1, 53, 23, 37, 54, 24],
  2940. [19, 45, 15, 26, 46, 16],
  2941. [5, 145, 115, 10, 146, 116],
  2942. [19, 75, 47, 10, 76, 48],
  2943. [15, 54, 24, 25, 55, 25],
  2944. [23, 45, 15, 25, 46, 16],
  2945. [13, 145, 115, 3, 146, 116],
  2946. [2, 74, 46, 29, 75, 47],
  2947. [42, 54, 24, 1, 55, 25],
  2948. [23, 45, 15, 28, 46, 16],
  2949. [17, 145, 115],
  2950. [10, 74, 46, 23, 75, 47],
  2951. [10, 54, 24, 35, 55, 25],
  2952. [19, 45, 15, 35, 46, 16],
  2953. [17, 145, 115, 1, 146, 116],
  2954. [14, 74, 46, 21, 75, 47],
  2955. [29, 54, 24, 19, 55, 25],
  2956. [11, 45, 15, 46, 46, 16],
  2957. [13, 145, 115, 6, 146, 116],
  2958. [14, 74, 46, 23, 75, 47],
  2959. [44, 54, 24, 7, 55, 25],
  2960. [59, 46, 16, 1, 47, 17],
  2961. [12, 151, 121, 7, 152, 122],
  2962. [12, 75, 47, 26, 76, 48],
  2963. [39, 54, 24, 14, 55, 25],
  2964. [22, 45, 15, 41, 46, 16],
  2965. [6, 151, 121, 14, 152, 122],
  2966. [6, 75, 47, 34, 76, 48],
  2967. [46, 54, 24, 10, 55, 25],
  2968. [2, 45, 15, 64, 46, 16],
  2969. [17, 152, 122, 4, 153, 123],
  2970. [29, 74, 46, 14, 75, 47],
  2971. [49, 54, 24, 10, 55, 25],
  2972. [24, 45, 15, 46, 46, 16],
  2973. [4, 152, 122, 18, 153, 123],
  2974. [13, 74, 46, 32, 75, 47],
  2975. [48, 54, 24, 14, 55, 25],
  2976. [42, 45, 15, 32, 46, 16],
  2977. [20, 147, 117, 4, 148, 118],
  2978. [40, 75, 47, 7, 76, 48],
  2979. [43, 54, 24, 22, 55, 25],
  2980. [10, 45, 15, 67, 46, 16],
  2981. [19, 148, 118, 6, 149, 119],
  2982. [18, 75, 47, 31, 76, 48],
  2983. [34, 54, 24, 34, 55, 25],
  2984. [20, 45, 15, 61, 46, 16]];
  2985. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  2986. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  2987. if (!rsBlock) {
  2988. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  2989. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  2990. }
  2991. var length = rsBlock.length / 3,
  2992. list = [];
  2993. for (var _i22 = 0; _i22 < length; _i22++) {
  2994. var count = rsBlock[_i22 * 3],
  2995. totalCount = rsBlock[_i22 * 3 + 1],
  2996. dataCount = rsBlock[_i22 * 3 + 2];
  2997. for (var j = 0; j < count; j++) {
  2998. list.push(new QRRSBlock(totalCount, dataCount));
  2999. }
  3000. }
  3001. return list;
  3002. };
  3003. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  3004. switch (errorCorrectLevel) {
  3005. case QRErrorCorrectLevel.L:
  3006. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  3007. case QRErrorCorrectLevel.M:
  3008. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  3009. case QRErrorCorrectLevel.Q:
  3010. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  3011. case QRErrorCorrectLevel.H:
  3012. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  3013. default:
  3014. return undefined;}
  3015. };
  3016. /*
  3017. * class QRBitBuffer
  3018. * */var
  3019. QRBitBuffer = /*#__PURE__*/function () {
  3020. function QRBitBuffer() {_classCallCheck(this, QRBitBuffer);
  3021. this.buffer = [];
  3022. this.length = 0;
  3023. }_createClass(QRBitBuffer, [{ key: "get", value: function get(
  3024. index) {
  3025. var bufIndex = Math.floor(index / 8);
  3026. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  3027. } }, { key: "put", value: function put(
  3028. num, length) {
  3029. for (var _i23 = 0; _i23 < length; _i23++) {
  3030. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  3031. }
  3032. } }, { key: "getLengthInBits", value: function getLengthInBits()
  3033. {
  3034. return this.length;
  3035. } }, { key: "putBit", value: function putBit(
  3036. bit) {
  3037. var bufIndex = Math.floor(this.length / 8);
  3038. if (this.buffer.length <= bufIndex) {
  3039. this.buffer.push(0);
  3040. }
  3041. if (bit) {
  3042. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  3043. }
  3044. this.length++;
  3045. } }]);return QRBitBuffer;}();
  3046. /*
  3047. * Class Drawing
  3048. * */var
  3049. Drawing = /*#__PURE__*/function () {
  3050. function Drawing(el, opts) {_classCallCheck(this, Drawing);
  3051. this._opts = opts;
  3052. this._el = el;
  3053. this._ctx = uni.createCanvasContext(el);
  3054. }_createClass(Drawing, [{ key: "draw", value: function draw(
  3055. QRCode) {
  3056. var ctx = this._ctx,
  3057. opts = this._opts;
  3058. var ctxPosFix = opts.width / 20;
  3059. //console.log(opts.width)
  3060. var count = QRCode.getModuleCount(),
  3061. width = (opts.width - 2 * ctxPosFix) / count,
  3062. height = (opts.height - 2 * ctxPosFix) / count,
  3063. roundedWidth = Math.round(width),
  3064. roundedHeight = Math.round(height);
  3065. this.clear();
  3066. ctx.setFillStyle('#fff');
  3067. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  3068. for (var row = 0; row < count; row++) {
  3069. for (var col = 0; col < count; col++) {
  3070. var isDark = QRCode.isDark(row, col),
  3071. left = col * width + ctxPosFix,
  3072. top = row * height + ctxPosFix;
  3073. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  3074. ctx.setLineWidth(1);
  3075. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  3076. ctx.fillRect(left, top, width, height);
  3077. ctx.strokeRect(
  3078. Math.floor(left) + 0.5,
  3079. Math.floor(top) + 0.5,
  3080. roundedWidth,
  3081. roundedHeight);
  3082. ctx.strokeRect(
  3083. Math.ceil(left) - 0.5,
  3084. Math.ceil(top) - 0.5,
  3085. roundedWidth,
  3086. roundedHeight);
  3087. }
  3088. }
  3089. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  3090. ctx.draw();
  3091. this._bIsPainted = true;
  3092. if (this._opts.successTips && drawingOptsSuccessTips) {
  3093. uni.hideLoading();
  3094. uni.showToast({
  3095. title: '生成成功',
  3096. icon: 'success',
  3097. duration: 1000 });
  3098. }
  3099. drawingOptsSuccessTips = true;
  3100. } }, { key: "clear", value: function clear()
  3101. {
  3102. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  3103. }
  3104. /** anlib **/
  3105. /**
  3106. * 二维码上添加图片
  3107. */ }, { key: "drawImg", value: function drawImg(
  3108. src, width, ctx) {
  3109. // logo相对二维码的比例
  3110. var scale = 5;
  3111. // logo相对二维码的大小
  3112. var imgSize = width / scale;
  3113. // 偏移位置起始点
  3114. var imgPos = width / scale * 2;
  3115. // 二维码边框尺寸,这里设置为原宽度的80分之一
  3116. var imgPosFix = width / 80;
  3117. //console.log('width', width);
  3118. //console.log('imgSize', imgSize);
  3119. //console.log('imgPos', imgPos);
  3120. //console.log('imgPosFix', imgPosFix);
  3121. //console.log('src', src);
  3122. ctx.setFillStyle('#fff');
  3123. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  3124. ctx.beginPath();
  3125. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  3126. ctx.stroke();
  3127. ctx.closePath();
  3128. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  3129. ctx.beginPath();
  3130. } }]);return Drawing;}();
  3131. /*
  3132. * Class QRCode
  3133. * */
  3134. var QRCode = function () {
  3135. /**
  3136. * Get the type by string length
  3137. * @author anlib
  3138. * @private
  3139. * @param {String} text
  3140. * @param {Number} correctLevel
  3141. * @return {Number} type
  3142. */
  3143. function getTypeNumber(text, correctLevel) {
  3144. var type = 1,
  3145. length = getUTF8Length(text),
  3146. QRCodeLimitLength = [
  3147. [17, 14, 11, 7],
  3148. [32, 26, 20, 14],
  3149. [53, 42, 32, 24],
  3150. [78, 62, 46, 34],
  3151. [106, 84, 60, 44],
  3152. [134, 106, 74, 58],
  3153. [154, 122, 86, 64],
  3154. [192, 152, 108, 84],
  3155. [230, 180, 130, 98],
  3156. [271, 213, 151, 119],
  3157. [321, 251, 177, 137],
  3158. [367, 287, 203, 155],
  3159. [425, 331, 241, 177],
  3160. [458, 362, 258, 194],
  3161. [520, 412, 292, 220],
  3162. [586, 450, 322, 250],
  3163. [644, 504, 364, 280],
  3164. [718, 560, 394, 310],
  3165. [792, 624, 442, 338],
  3166. [858, 666, 482, 382],
  3167. [929, 711, 509, 403],
  3168. [1003, 779, 565, 439],
  3169. [1091, 857, 611, 461],
  3170. [1171, 911, 661, 511],
  3171. [1273, 997, 715, 535],
  3172. [1367, 1059, 751, 593],
  3173. [1465, 1125, 805, 625],
  3174. [1528, 1190, 868, 658],
  3175. [1628, 1264, 908, 698],
  3176. [1732, 1370, 982, 742],
  3177. [1840, 1452, 1030, 790],
  3178. [1952, 1538, 1112, 842],
  3179. [2068, 1628, 1168, 898],
  3180. [2188, 1722, 1228, 958],
  3181. [2303, 1809, 1283, 983],
  3182. [2431, 1911, 1351, 1051],
  3183. [2563, 1989, 1423, 1093],
  3184. [2699, 2099, 1499, 1139],
  3185. [2809, 2213, 1579, 1219],
  3186. [2953, 2331, 1663, 1273]];
  3187. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  3188. var limit = 0;
  3189. switch (correctLevel) {
  3190. case QRErrorCorrectLevel.L:
  3191. limit = QRCodeLimitLength[_i24][0];
  3192. break;
  3193. case QRErrorCorrectLevel.M:
  3194. limit = QRCodeLimitLength[_i24][1];
  3195. break;
  3196. case QRErrorCorrectLevel.Q:
  3197. limit = QRCodeLimitLength[_i24][2];
  3198. break;
  3199. case QRErrorCorrectLevel.H:
  3200. limit = QRCodeLimitLength[_i24][3];
  3201. break;}
  3202. if (length <= limit) {
  3203. break;
  3204. } else {
  3205. type++;
  3206. }
  3207. }
  3208. if (type > QRCodeLimitLength.length) {
  3209. // throw new Error('Too long data'); //supfire
  3210. throwError('Too long data');
  3211. }
  3212. return type;
  3213. }
  3214. function getUTF8Length(text) {
  3215. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  3216. return replacedText.length + (replacedText.length != text ? 3 : 0);
  3217. }var
  3218. Fn = /*#__PURE__*/function () {
  3219. function Fn(el, opts) {_classCallCheck(this, Fn);
  3220. this._opts = {
  3221. width: 300,
  3222. height: 300,
  3223. typeNumber: 4,
  3224. colorDark: '#000000',
  3225. colorLight: '#ffffff',
  3226. correctLevel: Fn.correctLevel.H,
  3227. logo: false,
  3228. successTips: false };
  3229. if (typeof opts === 'string') {
  3230. opts = {
  3231. text: opts };
  3232. }
  3233. // Overwrites options 简单拷贝
  3234. if (opts) {
  3235. for (var _i25 in opts) {
  3236. if (opts.hasOwnProperty(_i25)) {
  3237. this._opts[_i25] = opts[_i25];
  3238. }
  3239. }
  3240. }
  3241. this._el = el;
  3242. this._QRCode = null;
  3243. this._drawing = new Drawing(this._el, this._opts);
  3244. if (this._opts.text) {
  3245. this.makeCode(this._opts.text);
  3246. }
  3247. }_createClass(Fn, [{ key: "makeCode", value: function makeCode(
  3248. text) {
  3249. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.
  3250. correctLevel);
  3251. this._QRCode.addData(text);
  3252. this._QRCode.make();
  3253. this._drawing.draw(this._QRCode);
  3254. } }, { key: "clear", value: function clear()
  3255. {
  3256. this._drawing.clear();
  3257. } }]);return Fn;}();
  3258. Fn.correctLevel = QRErrorCorrectLevel;
  3259. return Fn;
  3260. }();
  3261. /** anlib **/
  3262. var drawingOptsSuccessTips = true;
  3263. /**
  3264. * 抛出错误
  3265. */
  3266. function throwError(str) {
  3267. uni.hideLoading();
  3268. uni.showToast({
  3269. title: '有字符暂不支持',
  3270. icon: 'none',
  3271. duration: 2000 });
  3272. drawingOptsSuccessTips = false;
  3273. //throw new Error(str);
  3274. }var _default =
  3275. QRCode;exports.default = _default;
  3276. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  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. /***/ 226:
  4744. /*!***************************************************!*\
  4745. !*** E:/fp/md/mdapp/pages/estate/img/i_house.png ***!
  4746. \***************************************************/
  4747. /*! no static exports found */
  4748. /***/ (function(module, exports) {
  4749. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADqklEQVR4Xu1b71XbMBDXWQOUDQoTNH4+8xWYoGUDmKCwQTsBMEHTCcoGha9EfqYTlE7QZID4+o7KeY5t2VaebJxE/kZ8Pt39dLp/OkDs+QN7rr/wAHgL2HME/BHYcwOwc4JPT0+TIAhOAOCgb+CIaJ5l2ePx8fFzn2t1PgKz2ewGAK76FKaONxHdxnF83de6nQBIkuSKiG76EqKNLwBcR1F020a3yftOACilUiHEZJMFHH3zjIihI15rbLoCQH0sbsMTETvJasOTaTsxVUp5AJqQBYDHLMu+5DRBEEyafAYRfRVCPOT02rl+bFpjzBawkFIehmE4LyqglGKn9blGqe+IeFH+XSn1IoR4bwJhtADw7kdRdFoWfDabnQLAz/LvvPtxHK+sJX+fJMkDEZ14AAwIjNYChBAviHhUltuUO+ycBWjFrxDxLgchTdPD5XLJ5n9Ys6Gc4p4VU9wkSS6I6FtLCJsi4qVtmGuj35ow2KaIjir3xY3o8M325AFdlNE0VpaySxawwoiIzuI4XuUZjTlMF2THkAl2kTOnMTnaOh47aQGm3KRvABYA8ExE3Cz50GHHfgHAnIg4UhgzwA58KiSDAwAAl1EUTUthkM9gnWKcOk/CMOTU9/VRSn0SQvzYRNnaXTVkp31ZwB9ErMR714mQDTiDWsBQtYAHwAKBQS1ACDGXUh45KId/G1JnC9X/kw4NAK/Jpewtt7L5DynlKRFVSt5CnGbaey3sAQBwf4AdoZPnLQBwIrgrJh6AgcOgq41zxsdbgLeA+j5lX5kg810IIaZ5FAiCgKOAscGp2+jFtjhHAWf1wOBHQOcBq9xe5/cc5iq9/jrh0jQ9WC6X/P07F45gUABMi5kKnE2bojbAjAIA1/cCowVACFF7c2vq9O6cBfDOZFkWlic5lFLcFq/cGDFgUsqzYu2gJ0+Y3snkyaBHQJsm1wDFURbuD9TdCeSWzA6v6DR59sCk/ILrjOJlqq4huHbg6FFxnG8BgM0RtaJt6vCami47BUDTnaDJ0XoAdikV9hbQMBvkj4BhCMP7AO8Dhi+HrWK7DfGbO0Fdqv61EdolbV2pnfM3VZzOfIBWnmeEK2NtLpVs4fUgpTwv3zvoMRy+TzSN8J4j4mvrvelZXY/rgoSVrStg2vhsw3u+iZ6WJ89XACilajs426CZpYxrluEByNHjIyCl5CsrYzPTEumxkb82bhFx7Z8+Oo3IjE0Tl/J4AFyiuY28vAVs4665lHnvLeAf8XaCXwWtufUAAAAASUVORK5CYII="
  4750. /***/ }),
  4751. /***/ 227:
  4752. /*!*************************************************!*\
  4753. !*** E:/fp/md/mdapp/pages/estate/img/i_pos.png ***!
  4754. \*************************************************/
  4755. /*! no static exports found */
  4756. /***/ (function(module, exports) {
  4757. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHDklEQVR4Xs1bfYhVRRQ/565uGSomWX8kFQlhmq28ObOsq0mitiFhYiSVUFFa4T+aEIaE2hdKkUYQfWBlJaWpRQlZoSmEtrt37t21WrOMRJCiDJfUlF323ROjd2Vddt+dmTvv7Q68v+45v3POb2bOfJx5CBVoR48evby9vf1GZta/cQAwPv31tn4EAL4MgmB/oVA4UQHXAMtpJI7jWUmS3AMA+jfGxhYz7waA/Yi4hYgO2+jayHonoKWlZVSxWFyUBl1n40w/skUA2MrMW6WUX3jAuwTCKwFKqXkAsBoAJvt2VOMhYlgsFlfV1tZ+5QvfCwG615MkWc3My3w5loGzkojW+rCVmwClVAEA3ilXr5cIcjszr5BS/p6HiFwExHE8PUmSDwHgujxO5NBtC4JgQaFQOOSK4UxAGIZzgiDYzMxXuhr3pJeLBCcCdLJj5u2IWOUpiLwwziRYE5Auc3sHYM5nkdQybNiw6RMnTjyTJdjzuzUBURRtqGC2t4lFy64lopU2SlYEpOv8ZzYGKi2LiNOFEN+Z2rUiIIqikJnJFHwg5BBxlxBijqltYwLCMHwQEd83BS4htw0AtgVB0NbZ2Xlcy1VXV49NkmQiANyb/vKaeZiIjHw1JkAppRPf7Tk8WwcAHxHRj6UwmpqaplRVVT2Zhwhm3imlnGviqxEBURTNZ+YdJoD9yCwgIt3zxi0MwzWIqM8VTi0IgsmFQuFglrIRAUqpnQBwVxaYr+C7ccIwnI2I3zjafZ6IVmXpZhLAzFVxHJ9w3PFZ93xvh5VS+tDzdFYgvb8j4iEhhM4rJVsmAXEcT0mS5EAWUO/vzLxBSrncVq+3fBzHY5Ik+R4A9E2SVWPmOVLKXaWUMglQSi0FgFetLAOcHjp06ISamprzWT5vU0otAYDXHXAyN0aZBERRpA88Cy2N7yOiGZY6/Yq3trZe29XV5ULmB0T0UK4REIbhAUScYhMMMz8rpVxjo5MlG0XRQWa+NUuu53dm3iOlnJWLAKWUXrdvsTS8SEqpL0m8NaXUJw57g8NEdHNeAo7ZXngg4p1CiK+9RQ8AYRiuR0S9QTJuzHxaSjkyFwFRFJ20XQKZeYaUcp+xpwaCjqfQf4io5HV8ZhIMw7DL9uKjHAQopfQpVN8627T9RDQt1whQSv0EAJkbil7Jx3sSVEr9ZrsXQMR3hRCP5iVgIwCUBOnDQBsRWSXOUk4qpXQp7Webrtey6a3xS3kJeAIA3rA1joiPCyHettXrS951OxwEwd2FQqFkNSkzBzQ3N9frYqVDIBER5b48SesOeit+ma0PzDxeSvlLrhGwd+/e4cOHDz+GiKNtHdAXH0S0wEHvoorLRqxbmYgyOzhTQIMppTYDgO12+LwfeXaFOe8EPiaiB7LINyIgiqKFzKxJcGqIuAkRXzat4Ohhz8xPIeJ9TgYvED9PSvl5lr4RAW1tbaPPnj17xHEadPtwSh+Ri8Xip3V1dT/0k+wmAYDuNb3js57zPTD/6+zsHFNfX3/OCwF5p0EfTuxj5uOIqE94IxFxbHrQuSHLYZPviPieEOIRI1kTIS2TdxqY2vEhx8z3Sym3mGAZTQEN5GkamPiUSwYR/+jo6JhUX19/0gTImAANFobhm3qDYwI8UDK2q44VAU1NTTVVVVXNupYxUAGWsqt7X1euiOhPU/+sCEiTob4f1PeEg67Z9r4OwJqA1tbWm7q6ukKdvQcTAy6970RAmgvWIeKKwUSAS+87E6CU0m+C9Ci4ejCQ4Nr7zgSkoyBX7c4nca69n4uANCHqut1sn8HYYjGzKhaLM+vq6k7Z6uYmoLGxsW7IkCF7AOAKF+OedBqIyLWAar8K9HY6juPlSZK84ikYW5jVRPScrVJPeetlsC9jURTtYOb5eRyx1WXmXVJK46cw/eF7ISCO4wlJknwLANfYBuIo387MM6WULY76F9W8EKDRoihazMxeLkENglpCRNYXtX3heiMgXRU2AUDJaqxBcFkimRXfLADvOaAbUCl1FQDot/zCxglTWWZura6ubqipqfnbVCdLzusISKfCbcysSfC9NOoSXYMQQucab807ASkJjzHzW968vAC0lIhe84yZfx/Qn0NhGG5ARF//INlIRIt9B6/xyjICeuQEPRUacjreSERWL1Rs7JWVgCiK9OuMXcx8vY1TPWTPdHR0jJs6daq3pNfbj7ISoI01NzfPD4LA6ZVpkiRza2tr9SPNsrWyE5AmxWW6KGITBSK+KIR4xkbHRbYiBKQkrGdmozc+iLhbCFGRY3bFCEhJ0H9103+jLdUy3/W49HR/OhUlQJfaR4wYoe8PaksEMYqI/vUZZCmsihKgHUmfu+gH0Jc8eGLmv4IguEMI0WfhtFyEVJyA7kB0rREAZjHzKET89dy5cy9MmzbtdLkC7Q/3fxMowF8w/lVXAAAAAElFTkSuQmCC"
  4758. /***/ }),
  4759. /***/ 23:
  4760. /*!**************************************************************************!*\
  4761. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  4762. \**************************************************************************/
  4763. /*! no static exports found */
  4764. /***/ (function(module, exports, __webpack_require__) {
  4765. "use strict";
  4766. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  4767. // 所以这里做一个兼容polyfill的兼容处理
  4768. if (!String.prototype.padStart) {
  4769. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  4770. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  4771. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  4772. 'fillString must be String');
  4773. var str = this;
  4774. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  4775. if (str.length >= maxLength) return String(str);
  4776. var fillLength = maxLength - str.length,
  4777. times = Math.ceil(fillLength / fillString.length);
  4778. while (times >>= 1) {
  4779. fillString += fillString;
  4780. if (times === 1) {
  4781. fillString += fillString;
  4782. }
  4783. }
  4784. return fillString.slice(0, fillLength) + str;
  4785. };
  4786. }
  4787. // 其他更多是格式化有如下:
  4788. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  4789. 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';
  4790. // 如果为null,则格式化当前时间
  4791. if (!dateTime) dateTime = Number(new Date());
  4792. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  4793. if (dateTime.toString().length == 10) dateTime *= 1000;
  4794. var date = new Date(dateTime);
  4795. var ret;
  4796. var opt = {
  4797. "y+": date.getFullYear().toString(), // 年
  4798. "m+": (date.getMonth() + 1).toString(), // 月
  4799. "d+": date.getDate().toString(), // 日
  4800. "h+": date.getHours().toString(), // 时
  4801. "M+": date.getMinutes().toString(), // 分
  4802. "s+": date.getSeconds().toString() // 秒
  4803. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  4804. };
  4805. for (var k in opt) {
  4806. ret = new RegExp("(" + k + ")").exec(fmt);
  4807. if (ret) {
  4808. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  4809. };
  4810. };
  4811. return fmt;
  4812. }var _default =
  4813. timeFormat;exports.default = _default;
  4814. /***/ }),
  4815. /***/ 24:
  4816. /*!************************************************************************!*\
  4817. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  4818. \************************************************************************/
  4819. /*! no static exports found */
  4820. /***/ (function(module, exports, __webpack_require__) {
  4821. "use strict";
  4822. 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 };}
  4823. /**
  4824. * 时间戳转为多久之前
  4825. * @param String timestamp 时间戳
  4826. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  4827. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  4828. */
  4829. 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';
  4830. // 如果为null,则格式化当前时间
  4831. if (!dateTime) dateTime = Number(new Date());
  4832. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  4833. if (dateTime.toString().length == 10) dateTime *= 1000;
  4834. var timestamp = +new Date(Number(dateTime));
  4835. var timer = (Number(new Date()) - timestamp) / 1000;
  4836. // 如果小于5分钟,则返回"刚刚",其他以此类推
  4837. var tips = '';
  4838. switch (true) {
  4839. case timer < 300:
  4840. tips = '刚刚';
  4841. break;
  4842. case timer >= 300 && timer < 3600:
  4843. tips = parseInt(timer / 60) + '分钟前';
  4844. break;
  4845. case timer >= 3600 && timer < 86400:
  4846. tips = parseInt(timer / 3600) + '小时前';
  4847. break;
  4848. case timer >= 86400 && timer < 2592000:
  4849. tips = parseInt(timer / 86400) + '天前';
  4850. break;
  4851. default:
  4852. // 如果format为false,则无论什么时间戳,都显示xx之前
  4853. if (format === false) {
  4854. if (timer >= 2592000 && timer < 365 * 86400) {
  4855. tips = parseInt(timer / (86400 * 30)) + '个月前';
  4856. } else {
  4857. tips = parseInt(timer / (86400 * 365)) + '年前';
  4858. }
  4859. } else {
  4860. tips = (0, _timeFormat.default)(timestamp, format);
  4861. }}
  4862. return tips;
  4863. }var _default =
  4864. timeFrom;exports.default = _default;
  4865. /***/ }),
  4866. /***/ 25:
  4867. /*!*****************************************************************************!*\
  4868. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  4869. \*****************************************************************************/
  4870. /*! no static exports found */
  4871. /***/ (function(module, exports, __webpack_require__) {
  4872. "use strict";
  4873. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  4874. * 求两个颜色之间的渐变值
  4875. * @param {string} startColor 开始的颜色
  4876. * @param {string} endColor 结束的颜色
  4877. * @param {number} step 颜色等分的份额
  4878. * */
  4879. 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;
  4880. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  4881. var startR = startRGB[0];
  4882. var startG = startRGB[1];
  4883. var startB = startRGB[2];
  4884. var endRGB = hexToRgb(endColor, false);
  4885. var endR = endRGB[0];
  4886. var endG = endRGB[1];
  4887. var endB = endRGB[2];
  4888. var sR = (endR - startR) / step; //总差值
  4889. var sG = (endG - startG) / step;
  4890. var sB = (endB - startB) / step;
  4891. var colorArr = [];
  4892. for (var i = 0; i < step; i++) {
  4893. //计算每一步的hex值
  4894. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  4895. i + startB) + ')');
  4896. colorArr.push(hex);
  4897. }
  4898. return colorArr;
  4899. }
  4900. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  4901. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  4902. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  4903. sColor = sColor.toLowerCase();
  4904. if (sColor && reg.test(sColor)) {
  4905. if (sColor.length === 4) {
  4906. var sColorNew = "#";
  4907. for (var i = 1; i < 4; i += 1) {
  4908. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  4909. }
  4910. sColor = sColorNew;
  4911. }
  4912. //处理六位的颜色值
  4913. var sColorChange = [];
  4914. for (var _i = 1; _i < 7; _i += 2) {
  4915. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  4916. }
  4917. if (!str) {
  4918. return sColorChange;
  4919. } else {
  4920. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  4921. }
  4922. } else if (/^(rgb|RGB)/.test(sColor)) {
  4923. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  4924. return arr.map(function (val) {return Number(val);});
  4925. } else {
  4926. return sColor;
  4927. }
  4928. };
  4929. // 将rgb表示方式转换为hex表示方式
  4930. function rgbToHex(rgb) {
  4931. var _this = rgb;
  4932. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  4933. if (/^(rgb|RGB)/.test(_this)) {
  4934. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  4935. var strHex = "#";
  4936. for (var i = 0; i < aColor.length; i++) {
  4937. var hex = Number(aColor[i]).toString(16);
  4938. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  4939. if (hex === "0") {
  4940. hex += hex;
  4941. }
  4942. strHex += hex;
  4943. }
  4944. if (strHex.length !== 7) {
  4945. strHex = _this;
  4946. }
  4947. return strHex;
  4948. } else if (reg.test(_this)) {
  4949. var aNum = _this.replace(/#/, "").split("");
  4950. if (aNum.length === 6) {
  4951. return _this;
  4952. } else if (aNum.length === 3) {
  4953. var numHex = "#";
  4954. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  4955. numHex += aNum[_i2] + aNum[_i2];
  4956. }
  4957. return numHex;
  4958. }
  4959. } else {
  4960. return _this;
  4961. }
  4962. }
  4963. /**
  4964. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  4965. * sHex为传入的十六进制的色值
  4966. * alpha为rgba的透明度
  4967. */
  4968. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  4969. color = rgbToHex(color);
  4970. // 十六进制颜色值的正则表达式
  4971. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  4972. /* 16进制颜色转为RGB格式 */
  4973. var sColor = color.toLowerCase();
  4974. if (sColor && reg.test(sColor)) {
  4975. if (sColor.length === 4) {
  4976. var sColorNew = '#';
  4977. for (var i = 1; i < 4; i += 1) {
  4978. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  4979. }
  4980. sColor = sColorNew;
  4981. }
  4982. // 处理六位的颜色值
  4983. var sColorChange = [];
  4984. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  4985. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  4986. }
  4987. // return sColorChange.join(',')
  4988. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  4989. } else
  4990. {
  4991. return sColor;
  4992. }
  4993. }var _default =
  4994. {
  4995. colorGradient: colorGradient,
  4996. hexToRgb: hexToRgb,
  4997. rgbToHex: rgbToHex,
  4998. colorToRgba: colorToRgba };exports.default = _default;
  4999. /***/ }),
  5000. /***/ 26:
  5001. /*!********************************************************************!*\
  5002. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  5003. \********************************************************************/
  5004. /*! no static exports found */
  5005. /***/ (function(module, exports, __webpack_require__) {
  5006. "use strict";
  5007. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5008. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  5009. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  5010. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  5011. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  5012. * v-for的时候,推荐使用后端返回的id而不是循环的index
  5013. * @param {Number} len uuid的长度
  5014. * @param {Boolean} firstU 将返回的首字母置为"u"
  5015. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  5016. */
  5017. 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;
  5018. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  5019. var uuid = [];
  5020. radix = radix || chars.length;
  5021. if (len) {
  5022. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  5023. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  5024. } else {
  5025. var r;
  5026. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  5027. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  5028. uuid[14] = '4';
  5029. for (var _i = 0; _i < 36; _i++) {
  5030. if (!uuid[_i]) {
  5031. r = 0 | Math.random() * 16;
  5032. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  5033. }
  5034. }
  5035. }
  5036. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  5037. if (firstU) {
  5038. uuid.shift();
  5039. return 'u' + uuid.join('');
  5040. } else {
  5041. return uuid.join('');
  5042. }
  5043. }var _default =
  5044. guid;exports.default = _default;
  5045. /***/ }),
  5046. /***/ 27:
  5047. /*!*********************************************************************!*\
  5048. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  5049. \*********************************************************************/
  5050. /*! no static exports found */
  5051. /***/ (function(module, exports, __webpack_require__) {
  5052. "use strict";
  5053. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  5054. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  5055. var color = {
  5056. primary: "#2979ff",
  5057. primaryDark: "#2b85e4",
  5058. primaryDisabled: "#a0cfff",
  5059. primaryLight: "#ecf5ff",
  5060. bgColor: "#f3f4f6",
  5061. info: "#909399",
  5062. infoDark: "#82848a",
  5063. infoDisabled: "#c8c9cc",
  5064. infoLight: "#f4f4f5",
  5065. warning: "#ff9900",
  5066. warningDark: "#f29100",
  5067. warningDisabled: "#fcbd71",
  5068. warningLight: "#fdf6ec",
  5069. error: "#fa3534",
  5070. errorDark: "#dd6161",
  5071. errorDisabled: "#fab6b6",
  5072. errorLight: "#fef0f0",
  5073. success: "#19be6b",
  5074. successDark: "#18b566",
  5075. successDisabled: "#71d5a1",
  5076. successLight: "#dbf1e1",
  5077. mainColor: "#303133",
  5078. contentColor: "#606266",
  5079. tipsColor: "#909399",
  5080. lightColor: "#c0c4cc",
  5081. borderColor: "#e4e7ed" };var _default =
  5082. color;exports.default = _default;
  5083. /***/ }),
  5084. /***/ 28:
  5085. /*!*************************************************************************!*\
  5086. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  5087. \*************************************************************************/
  5088. /*! no static exports found */
  5089. /***/ (function(module, exports, __webpack_require__) {
  5090. "use strict";
  5091. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5092. * 根据主题type值,获取对应的图标
  5093. * @param String type 主题名称,primary|info|error|warning|success
  5094. * @param String fill 是否使用fill填充实体的图标
  5095. */
  5096. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5097. // 如果非预置值,默认为success
  5098. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  5099. var iconName = '';
  5100. // 目前(2019-12-12),info和primary使用同一个图标
  5101. switch (type) {
  5102. case 'primary':
  5103. iconName = 'info-circle';
  5104. break;
  5105. case 'info':
  5106. iconName = 'info-circle';
  5107. break;
  5108. case 'error':
  5109. iconName = 'close-circle';
  5110. break;
  5111. case 'warning':
  5112. iconName = 'error-circle';
  5113. break;
  5114. case 'success':
  5115. iconName = 'checkmark-circle';
  5116. break;
  5117. default:
  5118. iconName = 'checkmark-circle';}
  5119. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  5120. if (fill) iconName += '-fill';
  5121. return iconName;
  5122. }var _default =
  5123. type2icon;exports.default = _default;
  5124. /***/ }),
  5125. /***/ 29:
  5126. /*!***************************************************************************!*\
  5127. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  5128. \***************************************************************************/
  5129. /*! no static exports found */
  5130. /***/ (function(module, exports, __webpack_require__) {
  5131. "use strict";
  5132. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  5133. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  5134. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  5135. return array.sort(function () {return Math.random() - 0.5;});
  5136. }var _default =
  5137. randomArray;exports.default = _default;
  5138. /***/ }),
  5139. /***/ 3:
  5140. /*!*************************************************************!*\
  5141. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  5142. \*************************************************************/
  5143. /*! no static exports found */
  5144. /***/ (function(module, exports, __webpack_require__) {
  5145. "use strict";
  5146. /* 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;
  5147. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  5148. var defaultDelimiters = ['{', '}'];var
  5149. BaseFormatter = /*#__PURE__*/function () {
  5150. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  5151. this._caches = Object.create(null);
  5152. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  5153. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  5154. if (!values) {
  5155. return [message];
  5156. }
  5157. var tokens = this._caches[message];
  5158. if (!tokens) {
  5159. tokens = parse(message, delimiters);
  5160. this._caches[message] = tokens;
  5161. }
  5162. return compile(tokens, values);
  5163. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  5164. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  5165. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  5166. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  5167. var tokens = [];
  5168. var position = 0;
  5169. var text = '';
  5170. while (position < format.length) {
  5171. var char = format[position++];
  5172. if (char === startDelimiter) {
  5173. if (text) {
  5174. tokens.push({ type: 'text', value: text });
  5175. }
  5176. text = '';
  5177. var sub = '';
  5178. char = format[position++];
  5179. while (char !== undefined && char !== endDelimiter) {
  5180. sub += char;
  5181. char = format[position++];
  5182. }
  5183. var isClosed = char === endDelimiter;
  5184. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  5185. 'list' :
  5186. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  5187. 'named' :
  5188. 'unknown';
  5189. tokens.push({ value: sub, type: type });
  5190. }
  5191. // else if (char === '%') {
  5192. // // when found rails i18n syntax, skip text capture
  5193. // if (format[position] !== '{') {
  5194. // text += char
  5195. // }
  5196. // }
  5197. else {
  5198. text += char;
  5199. }
  5200. }
  5201. text && tokens.push({ type: 'text', value: text });
  5202. return tokens;
  5203. }
  5204. function compile(tokens, values) {
  5205. var compiled = [];
  5206. var index = 0;
  5207. var mode = isArray(values) ?
  5208. 'list' :
  5209. isObject(values) ?
  5210. 'named' :
  5211. 'unknown';
  5212. if (mode === 'unknown') {
  5213. return compiled;
  5214. }
  5215. while (index < tokens.length) {
  5216. var token = tokens[index];
  5217. switch (token.type) {
  5218. case 'text':
  5219. compiled.push(token.value);
  5220. break;
  5221. case 'list':
  5222. compiled.push(values[parseInt(token.value, 10)]);
  5223. break;
  5224. case 'named':
  5225. if (mode === 'named') {
  5226. compiled.push(values[token.value]);
  5227. } else
  5228. {
  5229. if (true) {
  5230. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  5231. }
  5232. }
  5233. break;
  5234. case 'unknown':
  5235. if (true) {
  5236. console.warn("Detect 'unknown' type of token!");
  5237. }
  5238. break;}
  5239. index++;
  5240. }
  5241. return compiled;
  5242. }
  5243. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  5244. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  5245. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  5246. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  5247. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  5248. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5249. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  5250. var defaultFormatter = new BaseFormatter();
  5251. function include(str, parts) {
  5252. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  5253. }
  5254. function startsWith(str, parts) {
  5255. return parts.find(function (part) {return str.indexOf(part) === 0;});
  5256. }
  5257. function normalizeLocale(locale, messages) {
  5258. if (!locale) {
  5259. return;
  5260. }
  5261. locale = locale.trim().replace(/_/g, '-');
  5262. if (messages && messages[locale]) {
  5263. return locale;
  5264. }
  5265. locale = locale.toLowerCase();
  5266. if (locale.indexOf('zh') === 0) {
  5267. if (locale.indexOf('-hans') > -1) {
  5268. return LOCALE_ZH_HANS;
  5269. }
  5270. if (locale.indexOf('-hant') > -1) {
  5271. return LOCALE_ZH_HANT;
  5272. }
  5273. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  5274. return LOCALE_ZH_HANT;
  5275. }
  5276. return LOCALE_ZH_HANS;
  5277. }
  5278. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  5279. if (lang) {
  5280. return lang;
  5281. }
  5282. }var
  5283. I18n = /*#__PURE__*/function () {
  5284. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  5285. this.locale = LOCALE_EN;
  5286. this.fallbackLocale = LOCALE_EN;
  5287. this.message = {};
  5288. this.messages = {};
  5289. this.watchers = [];
  5290. if (fallbackLocale) {
  5291. this.fallbackLocale = fallbackLocale;
  5292. }
  5293. this.formater = formater || defaultFormatter;
  5294. this.messages = messages || {};
  5295. this.setLocale(locale || LOCALE_EN);
  5296. if (watcher) {
  5297. this.watchLocale(watcher);
  5298. }
  5299. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  5300. locale) {var _this = this;
  5301. var oldLocale = this.locale;
  5302. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  5303. if (!this.messages[this.locale]) {
  5304. // 可能初始化时不存在
  5305. this.messages[this.locale] = {};
  5306. }
  5307. this.message = this.messages[this.locale];
  5308. // 仅发生变化时,通知
  5309. if (oldLocale !== this.locale) {
  5310. this.watchers.forEach(function (watcher) {
  5311. watcher(_this.locale, oldLocale);
  5312. });
  5313. }
  5314. } }, { key: "getLocale", value: function getLocale()
  5315. {
  5316. return this.locale;
  5317. } }, { key: "watchLocale", value: function watchLocale(
  5318. fn) {var _this2 = this;
  5319. var index = this.watchers.push(fn) - 1;
  5320. return function () {
  5321. _this2.watchers.splice(index, 1);
  5322. };
  5323. } }, { key: "add", value: function add(
  5324. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  5325. var curMessages = this.messages[locale];
  5326. if (curMessages) {
  5327. if (override) {
  5328. Object.assign(curMessages, message);
  5329. } else
  5330. {
  5331. Object.keys(message).forEach(function (key) {
  5332. if (!hasOwn(curMessages, key)) {
  5333. curMessages[key] = message[key];
  5334. }
  5335. });
  5336. }
  5337. } else
  5338. {
  5339. this.messages[locale] = message;
  5340. }
  5341. } }, { key: "f", value: function f(
  5342. message, values, delimiters) {
  5343. return this.formater.interpolate(message, values, delimiters).join('');
  5344. } }, { key: "t", value: function t(
  5345. key, locale, values) {
  5346. var message = this.message;
  5347. if (typeof locale === 'string') {
  5348. locale = normalizeLocale(locale, this.messages);
  5349. locale && (message = this.messages[locale]);
  5350. } else
  5351. {
  5352. values = locale;
  5353. }
  5354. if (!hasOwn(message, key)) {
  5355. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  5356. return key;
  5357. }
  5358. return this.formater.interpolate(message[key], values).join('');
  5359. } }]);return I18n;}();exports.I18n = I18n;
  5360. function watchAppLocale(appVm, i18n) {
  5361. // 需要保证 watch 的触发在组件渲染之前
  5362. if (appVm.$watchLocale) {
  5363. // vue2
  5364. appVm.$watchLocale(function (newLocale) {
  5365. i18n.setLocale(newLocale);
  5366. });
  5367. } else
  5368. {
  5369. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  5370. i18n.setLocale(newLocale);
  5371. });
  5372. }
  5373. }
  5374. function getDefaultLocale() {
  5375. if (typeof uni !== 'undefined' && uni.getLocale) {
  5376. return uni.getLocale();
  5377. }
  5378. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  5379. if (typeof global !== 'undefined' && global.getLocale) {
  5380. return global.getLocale();
  5381. }
  5382. return LOCALE_EN;
  5383. }
  5384. 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;
  5385. // 兼容旧版本入参
  5386. if (typeof locale !== 'string') {var _ref4 =
  5387. [
  5388. messages,
  5389. locale];locale = _ref4[0];messages = _ref4[1];
  5390. }
  5391. if (typeof locale !== 'string') {
  5392. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  5393. locale = getDefaultLocale();
  5394. }
  5395. if (typeof fallbackLocale !== 'string') {
  5396. fallbackLocale =
  5397. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  5398. LOCALE_EN;
  5399. }
  5400. var i18n = new I18n({
  5401. locale: locale,
  5402. fallbackLocale: fallbackLocale,
  5403. messages: messages,
  5404. watcher: watcher });
  5405. var _t = function t(key, values) {
  5406. if (typeof getApp !== 'function') {
  5407. // app view
  5408. /* eslint-disable no-func-assign */
  5409. _t = function t(key, values) {
  5410. return i18n.t(key, values);
  5411. };
  5412. } else
  5413. {
  5414. var isWatchedAppLocale = false;
  5415. _t = function t(key, values) {
  5416. var appVm = getApp().$vm;
  5417. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  5418. // options: {
  5419. // type: Array,
  5420. // default () {
  5421. // return [{
  5422. // icon: 'shop',
  5423. // text: t("uni-goods-nav.options.shop"),
  5424. // }, {
  5425. // icon: 'cart',
  5426. // text: t("uni-goods-nav.options.cart")
  5427. // }]
  5428. // }
  5429. // },
  5430. if (appVm) {
  5431. // 触发响应式
  5432. appVm.$locale;
  5433. if (!isWatchedAppLocale) {
  5434. isWatchedAppLocale = true;
  5435. watchAppLocale(appVm, i18n);
  5436. }
  5437. }
  5438. return i18n.t(key, values);
  5439. };
  5440. }
  5441. return _t(key, values);
  5442. };
  5443. return {
  5444. i18n: i18n,
  5445. f: function f(message, values, delimiters) {
  5446. return i18n.f(message, values, delimiters);
  5447. },
  5448. t: function t(key, values) {
  5449. return _t(key, values);
  5450. },
  5451. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  5452. return i18n.add(locale, message, override);
  5453. },
  5454. watch: function watch(fn) {
  5455. return i18n.watchLocale(fn);
  5456. },
  5457. getLocale: function getLocale() {
  5458. return i18n.getLocale();
  5459. },
  5460. setLocale: function setLocale(newLocale) {
  5461. return i18n.setLocale(newLocale);
  5462. } };
  5463. }
  5464. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  5465. var formater;
  5466. function hasI18nJson(jsonObj, delimiters) {
  5467. if (!formater) {
  5468. formater = new BaseFormatter();
  5469. }
  5470. return walkJsonObj(jsonObj, function (jsonObj, key) {
  5471. var value = jsonObj[key];
  5472. if (isString(value)) {
  5473. if (isI18nStr(value, delimiters)) {
  5474. return true;
  5475. }
  5476. } else
  5477. {
  5478. return hasI18nJson(value, delimiters);
  5479. }
  5480. });
  5481. }
  5482. function parseI18nJson(jsonObj, values, delimiters) {
  5483. if (!formater) {
  5484. formater = new BaseFormatter();
  5485. }
  5486. walkJsonObj(jsonObj, function (jsonObj, key) {
  5487. var value = jsonObj[key];
  5488. if (isString(value)) {
  5489. if (isI18nStr(value, delimiters)) {
  5490. jsonObj[key] = compileStr(value, values, delimiters);
  5491. }
  5492. } else
  5493. {
  5494. parseI18nJson(value, values, delimiters);
  5495. }
  5496. });
  5497. return jsonObj;
  5498. }
  5499. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  5500. if (!isI18nStr(jsonStr, delimiters)) {
  5501. return jsonStr;
  5502. }
  5503. if (!formater) {
  5504. formater = new BaseFormatter();
  5505. }
  5506. var localeValues = [];
  5507. Object.keys(locales).forEach(function (name) {
  5508. if (name !== locale) {
  5509. localeValues.push({
  5510. locale: name,
  5511. values: locales[name] });
  5512. }
  5513. });
  5514. localeValues.unshift({ locale: locale, values: locales[locale] });
  5515. try {
  5516. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  5517. }
  5518. catch (e) {}
  5519. return jsonStr;
  5520. }
  5521. function isI18nStr(value, delimiters) {
  5522. return value.indexOf(delimiters[0]) > -1;
  5523. }
  5524. function compileStr(value, values, delimiters) {
  5525. return formater.interpolate(value, values, delimiters).join('');
  5526. }
  5527. function compileValue(jsonObj, key, localeValues, delimiters) {
  5528. var value = jsonObj[key];
  5529. if (isString(value)) {
  5530. // 存在国际化
  5531. if (isI18nStr(value, delimiters)) {
  5532. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  5533. if (localeValues.length > 1) {
  5534. // 格式化国际化语言
  5535. var valueLocales = jsonObj[key + 'Locales'] = {};
  5536. localeValues.forEach(function (localValue) {
  5537. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  5538. });
  5539. }
  5540. }
  5541. } else
  5542. {
  5543. compileJsonObj(value, localeValues, delimiters);
  5544. }
  5545. }
  5546. function compileJsonObj(jsonObj, localeValues, delimiters) {
  5547. walkJsonObj(jsonObj, function (jsonObj, key) {
  5548. compileValue(jsonObj, key, localeValues, delimiters);
  5549. });
  5550. return jsonObj;
  5551. }
  5552. function walkJsonObj(jsonObj, walk) {
  5553. if (isArray(jsonObj)) {
  5554. for (var i = 0; i < jsonObj.length; i++) {
  5555. if (walk(jsonObj, i)) {
  5556. return true;
  5557. }
  5558. }
  5559. } else
  5560. if (isObject(jsonObj)) {
  5561. for (var key in jsonObj) {
  5562. if (walk(jsonObj, key)) {
  5563. return true;
  5564. }
  5565. }
  5566. }
  5567. return false;
  5568. }
  5569. function resolveLocale(locales) {
  5570. return function (locale) {
  5571. if (!locale) {
  5572. return locale;
  5573. }
  5574. locale = normalizeLocale(locale) || locale;
  5575. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  5576. };
  5577. }
  5578. function resolveLocaleChain(locale) {
  5579. var chain = [];
  5580. var tokens = locale.split('-');
  5581. while (tokens.length) {
  5582. chain.push(tokens.join('-'));
  5583. tokens.pop();
  5584. }
  5585. return chain;
  5586. }
  5587. /* 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)))
  5588. /***/ }),
  5589. /***/ 30:
  5590. /*!***********************************************************************!*\
  5591. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  5592. \***********************************************************************/
  5593. /*! no static exports found */
  5594. /***/ (function(module, exports, __webpack_require__) {
  5595. "use strict";
  5596. 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 };}
  5597. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  5598. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  5599. value = String(value);
  5600. // 用uView内置验证规则中的number判断是否为数值
  5601. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  5602. }
  5603. /***/ }),
  5604. /***/ 31:
  5605. /*!**********************************************************************!*\
  5606. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  5607. \**********************************************************************/
  5608. /*! no static exports found */
  5609. /***/ (function(module, exports, __webpack_require__) {
  5610. "use strict";
  5611. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  5612. if (min >= 0 && max > 0 && max >= min) {
  5613. var gab = max - min + 1;
  5614. return Math.floor(Math.random() * gab + min);
  5615. } else {
  5616. return 0;
  5617. }
  5618. }var _default =
  5619. random;exports.default = _default;
  5620. /***/ }),
  5621. /***/ 315:
  5622. /*!**************************************************************************************!*\
  5623. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  5624. \**************************************************************************************/
  5625. /*! no static exports found */
  5626. /***/ (function(module, exports, __webpack_require__) {
  5627. "use strict";
  5628. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  5629. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 316));
  5630. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 317));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  5631. * html 解析器
  5632. * @tutorial https://github.com/jin-yufeng/Parser
  5633. * @version 20201029
  5634. * @author JinYufeng
  5635. * @listens MIT
  5636. */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] : {};
  5637. this.attrs = {};
  5638. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  5639. this.data = data;
  5640. this.domain = options.domain;
  5641. this.DOM = [];
  5642. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  5643. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  5644. this.options = options;
  5645. this.state = this.Text;
  5646. this.STACK = [];
  5647. // 工具函数
  5648. this.bubble = function () {
  5649. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  5650. if (_config.default.richOnlyTags[item.name]) return false;
  5651. item.c = 1;
  5652. }
  5653. return true;
  5654. };
  5655. this.decode = function (val, amp) {
  5656. var i = -1,
  5657. j,en;
  5658. while (1) {
  5659. if ((i = val.indexOf('&', i + 1)) == -1) break;
  5660. if ((j = val.indexOf(';', i + 2)) == -1) break;
  5661. if (val[i + 1] == '#') {
  5662. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  5663. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  5664. } else {
  5665. en = val.substring(i + 1, j);
  5666. if (_config.default.entities[en] || en == amp)
  5667. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  5668. }
  5669. }
  5670. return val;
  5671. };
  5672. this.getUrl = function (url) {
  5673. if (url[0] == '/') {
  5674. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  5675. if (_this.domain) url = _this.domain + url;
  5676. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  5677. url = _this.domain + '/' + url;
  5678. return url;
  5679. };
  5680. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  5681. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  5682. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  5683. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  5684. }
  5685. MpHtmlParser.prototype.parse = function () {
  5686. if (emoji) this.data = emoji.parseEmoji(this.data);
  5687. for (var c; c = this.data[this.i]; this.i++) {
  5688. this.state(c);}
  5689. if (this.state == this.Text) this.setText();
  5690. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  5691. return this.DOM;
  5692. };
  5693. // 设置属性
  5694. MpHtmlParser.prototype.setAttr = function () {
  5695. var name = this.attrName.toLowerCase(),
  5696. val = this.attrVal;
  5697. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  5698. if (val) {
  5699. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  5700. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  5701. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  5702. }
  5703. this.attrVal = '';
  5704. while (blankChar[this.data[this.i]]) {this.i++;}
  5705. if (this.isClose()) this.setNode();else
  5706. {
  5707. this.start = this.i;
  5708. this.state = this.AttrName;
  5709. }
  5710. };
  5711. // 设置文本节点
  5712. MpHtmlParser.prototype.setText = function () {
  5713. var back,text = this.section();
  5714. if (!text) return;
  5715. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  5716. if (back) {
  5717. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  5718. var j = this.start + text.length;
  5719. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  5720. return;
  5721. }
  5722. if (!this.pre) {
  5723. // 合并空白符
  5724. var flag,tmp = [];
  5725. for (var i = text.length, c; c = text[--i];) {
  5726. if (!blankChar[c]) {
  5727. tmp.unshift(c);
  5728. if (!flag) flag = 1;
  5729. } else {
  5730. if (tmp[0] != ' ') tmp.unshift(' ');
  5731. if (c == '\n' && flag == void 0) flag = 0;
  5732. }}
  5733. if (flag == 0) return;
  5734. text = tmp.join('');
  5735. }
  5736. this.siblings().push({
  5737. type: 'text',
  5738. text: this.decode(text) });
  5739. };
  5740. // 设置元素节点
  5741. MpHtmlParser.prototype.setNode = function () {
  5742. var node = {
  5743. name: this.tagName.toLowerCase(),
  5744. attrs: this.attrs },
  5745. close = _config.default.selfClosingTags[node.name];
  5746. if (this.options.nodes.length) node.type = 'node';
  5747. this.attrs = {};
  5748. if (!_config.default.ignoreTags[node.name]) {
  5749. // 处理属性
  5750. var attrs = node.attrs,
  5751. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  5752. styleObj = {};
  5753. if (attrs.id) {
  5754. if (this.options.compress & 1) attrs.id = void 0;else
  5755. if (this.options.useAnchor) this.bubble();
  5756. }
  5757. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  5758. switch (node.name) {
  5759. case 'a':
  5760. case 'ad':
  5761. this.bubble();
  5762. break;
  5763. case 'font':
  5764. if (attrs.color) {
  5765. styleObj['color'] = attrs.color;
  5766. attrs.color = void 0;
  5767. }
  5768. if (attrs.face) {
  5769. styleObj['font-family'] = attrs.face;
  5770. attrs.face = void 0;
  5771. }
  5772. if (attrs.size) {
  5773. var size = parseInt(attrs.size);
  5774. if (size < 1) size = 1;else
  5775. if (size > 7) size = 7;
  5776. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  5777. styleObj['font-size'] = map[size - 1];
  5778. attrs.size = void 0;
  5779. }
  5780. break;
  5781. case 'embed':
  5782. var src = node.attrs.src || '',
  5783. type = node.attrs.type || '';
  5784. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  5785. node.name = 'video';else
  5786. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  5787. '.aac'))
  5788. node.name = 'audio';else
  5789. break;
  5790. if (node.attrs.autostart)
  5791. node.attrs.autoplay = 'T';
  5792. node.attrs.controls = 'T';
  5793. case 'video':
  5794. case 'audio':
  5795. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  5796. this["".concat(node.name, "Num")]++;
  5797. if (node.name == 'video') {
  5798. if (this.videoNum > 3)
  5799. node.lazyLoad = 1;
  5800. if (attrs.width) {
  5801. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  5802. attrs.width = void 0;
  5803. }
  5804. if (attrs.height) {
  5805. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  5806. attrs.height = void 0;
  5807. }
  5808. }
  5809. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  5810. attrs.source = [];
  5811. if (attrs.src) {
  5812. attrs.source.push(attrs.src);
  5813. attrs.src = void 0;
  5814. }
  5815. this.bubble();
  5816. break;
  5817. case 'td':
  5818. case 'th':
  5819. if (attrs.colspan || attrs.rowspan)
  5820. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  5821. if (item.name == 'table') {
  5822. item.flag = 1;
  5823. break;
  5824. }}}
  5825. if (attrs.align) {
  5826. if (node.name == 'table') {
  5827. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  5828. styleObj['float'] = attrs.align;
  5829. } else styleObj['text-align'] = attrs.align;
  5830. attrs.align = void 0;
  5831. }
  5832. // 压缩 style
  5833. var styles = style.split(';');
  5834. style = '';
  5835. for (var i = 0, len = styles.length; i < len; i++) {
  5836. var info = styles[i].split(':');
  5837. if (info.length < 2) continue;
  5838. var _key = info[0].trim().toLowerCase(),
  5839. _value = info.slice(1).join(':').trim();
  5840. if (_value[0] == '-' || _value.includes('safe'))
  5841. style += ";".concat(_key, ":").concat(_value);else
  5842. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  5843. styleObj[_key] = _value;
  5844. }
  5845. if (node.name == 'img') {
  5846. if (attrs.src && !attrs.ignore) {
  5847. if (this.bubble())
  5848. attrs.i = (this.imgNum++).toString();else
  5849. attrs.ignore = 'T';
  5850. }
  5851. if (attrs.ignore) {
  5852. style += ';-webkit-touch-callout:none';
  5853. styleObj['max-width'] = '100%';
  5854. }
  5855. var width;
  5856. if (styleObj.width) width = styleObj.width;else
  5857. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  5858. if (width) {
  5859. styleObj.width = width;
  5860. attrs.width = '100%';
  5861. if (parseInt(width) > windowWidth) {
  5862. styleObj.height = '';
  5863. if (attrs.height) attrs.height = void 0;
  5864. }
  5865. }
  5866. if (styleObj.height) {
  5867. attrs.height = styleObj.height;
  5868. styleObj.height = '';
  5869. } else if (attrs.height && !attrs.height.includes('%'))
  5870. attrs.height = parseFloat(attrs.height) + 'px';
  5871. }
  5872. for (var key in styleObj) {
  5873. var value = styleObj[key];
  5874. if (!value) continue;
  5875. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  5876. // 填充链接
  5877. if (value.includes('url')) {
  5878. var j = value.indexOf('(');
  5879. if (j++ != -1) {
  5880. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  5881. value = value.substr(0, j) + this.getUrl(value.substr(j));
  5882. }
  5883. }
  5884. // 转换 rpx
  5885. else if (value.includes('rpx'))
  5886. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  5887. if (key == 'white-space' && value.includes('pre') && !close)
  5888. this.pre = node.pre = true;
  5889. style += ";".concat(key, ":").concat(value);
  5890. }
  5891. style = style.substr(1);
  5892. if (style) attrs.style = style;
  5893. if (!close) {
  5894. node.children = [];
  5895. if (node.name == 'pre' && _config.default.highlight) {
  5896. this.remove(node);
  5897. this.pre = node.pre = true;
  5898. }
  5899. this.siblings().push(node);
  5900. this.STACK.push(node);
  5901. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  5902. this.siblings().push(node);
  5903. } else {
  5904. if (!close) this.remove(node);else
  5905. if (node.name == 'source') {
  5906. var parent = this.parent();
  5907. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  5908. parent.attrs.source.push(node.attrs.src);
  5909. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  5910. }
  5911. if (this.data[this.i] == '/') this.i++;
  5912. this.start = this.i + 1;
  5913. this.state = this.Text;
  5914. };
  5915. // 移除标签
  5916. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  5917. var name = node.name,
  5918. j = this.i;
  5919. // 处理 svg
  5920. var handleSvg = function handleSvg() {
  5921. var src = _this2.data.substring(j, _this2.i + 1);
  5922. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  5923. for (var key in node.attrs) {
  5924. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  5925. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  5926. }
  5927. src = '<svg' + src;
  5928. var parent = _this2.parent();
  5929. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  5930. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  5931. _this2.siblings().push({
  5932. name: 'img',
  5933. attrs: {
  5934. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  5935. style: node.attrs.style,
  5936. ignore: 'T' } });
  5937. };
  5938. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  5939. while (1) {
  5940. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  5941. if (name == 'pre' || name == 'svg') this.i = j;else
  5942. this.i = this.data.length;
  5943. return;
  5944. }
  5945. this.start = this.i += 2;
  5946. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  5947. if (this.section().toLowerCase() == name) {
  5948. // 代码块高亮
  5949. if (name == 'pre') {
  5950. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  5951. substr(this.i - 5);
  5952. return this.i = j;
  5953. } else if (name == 'style')
  5954. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  5955. if (name == 'title')
  5956. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  5957. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  5958. if (name == 'svg') handleSvg();
  5959. return;
  5960. }
  5961. }
  5962. };
  5963. // 节点出栈处理
  5964. MpHtmlParser.prototype.popNode = function (node) {
  5965. // 空白符处理
  5966. if (node.pre) {
  5967. node.pre = this.pre = void 0;
  5968. for (var i = this.STACK.length; i--;) {
  5969. if (this.STACK[i].pre)
  5970. this.pre = true;}
  5971. }
  5972. var siblings = this.siblings(),
  5973. len = siblings.length,
  5974. childs = node.children;
  5975. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  5976. return siblings.pop();
  5977. var attrs = node.attrs;
  5978. // 替换一些标签名
  5979. if (_config.default.blockTags[node.name]) node.name = 'div';else
  5980. if (!_config.default.trustTags[node.name]) node.name = 'span';
  5981. // 处理列表
  5982. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  5983. if ((node.attrs.style || '').includes('list-style:none')) {
  5984. for (var _i = 0, child; child = childs[_i++];) {
  5985. if (child.name == 'li')
  5986. child.name = 'div';}
  5987. } else if (node.name == 'ul') {
  5988. var floor = 1;
  5989. for (var _i2 = this.STACK.length; _i2--;) {
  5990. if (this.STACK[_i2].name == 'ul') floor++;}
  5991. if (floor != 1)
  5992. for (var _i3 = childs.length; _i3--;) {
  5993. childs[_i3].floor = floor;}
  5994. } else {
  5995. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  5996. if (_child.name == 'li') {
  5997. _child.type = 'ol';
  5998. _child.num = function (num, type) {
  5999. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  6000. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  6001. if (type == 'i' || type == 'I') {
  6002. num = (num - 1) % 99 + 1;
  6003. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  6004. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  6005. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  6006. if (type == 'i') return res.toLowerCase();
  6007. return res;
  6008. }
  6009. return num;
  6010. }(num++, attrs.type) + '.';
  6011. }}
  6012. }
  6013. }
  6014. // 处理表格
  6015. if (node.name == 'table') {
  6016. var padding = parseFloat(attrs.cellpadding),
  6017. spacing = parseFloat(attrs.cellspacing),
  6018. border = parseFloat(attrs.border);
  6019. if (node.c) {
  6020. if (isNaN(padding)) padding = 2;
  6021. if (isNaN(spacing)) spacing = 2;
  6022. }
  6023. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  6024. if (node.flag && node.c) {
  6025. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  6026. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  6027. var row = 1,
  6028. col = 1,
  6029. colNum,
  6030. trs = [],
  6031. children = [],
  6032. map = {};
  6033. (function f(ns) {
  6034. for (var i = 0; i < ns.length; i++) {
  6035. if (ns[i].name == 'tr') trs.push(ns[i]);else
  6036. f(ns[i].children || []);
  6037. }
  6038. })(node.children);
  6039. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  6040. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  6041. if (td.name == 'td' || td.name == 'th') {
  6042. while (map[row + '.' + col]) {col++;}
  6043. var cell = {
  6044. name: 'div',
  6045. c: 1,
  6046. attrs: {
  6047. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  6048. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  6049. children: td.children };
  6050. if (td.attrs.colspan) {
  6051. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  6052. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  6053. col += parseInt(td.attrs.colspan) - 1;
  6054. }
  6055. if (td.attrs.rowspan) {
  6056. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  6057. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  6058. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  6059. }
  6060. children.push(cell);
  6061. col++;
  6062. }
  6063. }
  6064. if (!colNum) {
  6065. colNum = col - 1;
  6066. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  6067. }
  6068. col = 1;
  6069. row++;
  6070. }
  6071. node.children = children;
  6072. } else {
  6073. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  6074. if (border || padding)
  6075. (function f(ns) {
  6076. for (var i = 0, n; n = ns[i]; i++) {
  6077. if (n.name == 'th' || n.name == 'td') {
  6078. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  6079. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  6080. } else f(n.children || []);
  6081. }
  6082. })(childs);
  6083. }
  6084. if (this.options.autoscroll) {
  6085. var table = Object.assign({}, node);
  6086. node.name = 'div';
  6087. node.attrs = {
  6088. style: 'overflow:scroll' };
  6089. node.children = [table];
  6090. }
  6091. }
  6092. this.CssHandler.pop && this.CssHandler.pop(node);
  6093. // 自动压缩
  6094. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  6095. siblings[len - 1] = childs[0];
  6096. };
  6097. // 状态机
  6098. MpHtmlParser.prototype.Text = function (c) {
  6099. if (c == '<') {
  6100. var next = this.data[this.i + 1],
  6101. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  6102. if (isLetter(next)) {
  6103. this.setText();
  6104. this.start = this.i + 1;
  6105. this.state = this.TagName;
  6106. } else if (next == '/') {
  6107. this.setText();
  6108. if (isLetter(this.data[++this.i + 1])) {
  6109. this.start = this.i + 1;
  6110. this.state = this.EndTag;
  6111. } else this.Comment();
  6112. } else if (next == '!' || next == '?') {
  6113. this.setText();
  6114. this.Comment();
  6115. }
  6116. }
  6117. };
  6118. MpHtmlParser.prototype.Comment = function () {
  6119. var key;
  6120. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  6121. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  6122. key = '>';
  6123. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  6124. this.i += key.length - 1;
  6125. this.start = this.i + 1;
  6126. this.state = this.Text;
  6127. };
  6128. MpHtmlParser.prototype.TagName = function (c) {
  6129. if (blankChar[c]) {
  6130. this.tagName = this.section();
  6131. while (blankChar[this.data[this.i]]) {this.i++;}
  6132. if (this.isClose()) this.setNode();else
  6133. {
  6134. this.start = this.i;
  6135. this.state = this.AttrName;
  6136. }
  6137. } else if (this.isClose()) {
  6138. this.tagName = this.section();
  6139. this.setNode();
  6140. }
  6141. };
  6142. MpHtmlParser.prototype.AttrName = function (c) {
  6143. if (c == '=' || blankChar[c] || this.isClose()) {
  6144. this.attrName = this.section();
  6145. if (blankChar[c])
  6146. while (blankChar[this.data[++this.i]]) {;}
  6147. if (this.data[this.i] == '=') {
  6148. while (blankChar[this.data[++this.i]]) {;}
  6149. this.start = this.i--;
  6150. this.state = this.AttrValue;
  6151. } else this.setAttr();
  6152. }
  6153. };
  6154. MpHtmlParser.prototype.AttrValue = function (c) {
  6155. if (c == '"' || c == "'") {
  6156. this.start++;
  6157. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  6158. this.attrVal = this.section();
  6159. this.i++;
  6160. } else {
  6161. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  6162. this.attrVal = this.section();
  6163. }
  6164. this.setAttr();
  6165. };
  6166. MpHtmlParser.prototype.EndTag = function (c) {
  6167. if (blankChar[c] || c == '>' || c == '/') {
  6168. var name = this.section().toLowerCase();
  6169. for (var i = this.STACK.length; i--;) {
  6170. if (this.STACK[i].name == name) break;}
  6171. if (i != -1) {
  6172. var node;
  6173. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  6174. this.popNode(node);
  6175. } else if (name == 'p' || name == 'br')
  6176. this.siblings().push({
  6177. name: name,
  6178. attrs: {} });
  6179. this.i = this.data.indexOf('>', this.i);
  6180. this.start = this.i + 1;
  6181. if (this.i == -1) this.i = this.data.length;else
  6182. this.state = this.Text;
  6183. }
  6184. };var _default =
  6185. MpHtmlParser;exports.default = _default;
  6186. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6187. /***/ }),
  6188. /***/ 316:
  6189. /*!********************************************************************************!*\
  6190. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  6191. \********************************************************************************/
  6192. /*! no static exports found */
  6193. /***/ (function(module, exports, __webpack_require__) {
  6194. "use strict";
  6195. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  6196. var cfg = {
  6197. // 出错占位图
  6198. errorImg: null,
  6199. // 过滤器函数
  6200. filter: null,
  6201. // 代码高亮函数
  6202. highlight: null,
  6203. // 文本处理函数
  6204. onText: null,
  6205. // 实体编码列表
  6206. entities: {
  6207. quot: '"',
  6208. apos: "'",
  6209. semi: ';',
  6210. nbsp: '\xA0',
  6211. ensp: "\u2002",
  6212. emsp: "\u2003",
  6213. ndash: '–',
  6214. mdash: '—',
  6215. middot: '·',
  6216. lsquo: '‘',
  6217. rsquo: '’',
  6218. ldquo: '“',
  6219. rdquo: '”',
  6220. bull: '•',
  6221. hellip: '…' },
  6222. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  6223. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  6224. // 块级标签,将被转为 div
  6225. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  6226. // 将被移除的标签
  6227. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  6228. // 只能被 rich-text 显示的标签
  6229. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  6230. // 自闭合的标签
  6231. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  6232. // 信任的标签
  6233. 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'),
  6234. // 默认的标签样式
  6235. userAgentStyles: {
  6236. address: 'font-style:italic',
  6237. big: 'display:inline;font-size:1.2em',
  6238. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  6239. caption: 'display:table-caption;text-align:center',
  6240. center: 'text-align:center',
  6241. cite: 'font-style:italic',
  6242. dd: 'margin-left:40px',
  6243. mark: 'background-color:yellow',
  6244. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  6245. s: 'text-decoration:line-through',
  6246. small: 'display:inline;font-size:0.8em',
  6247. u: 'text-decoration:underline' } };
  6248. function makeMap(str) {
  6249. var map = Object.create(null),
  6250. list = str.split(',');
  6251. for (var i = list.length; i--;) {
  6252. map[list[i]] = true;}
  6253. return map;
  6254. }
  6255. if (wx.canIUse('editor')) {
  6256. cfg.blockTags.pre = void 0;
  6257. cfg.ignoreTags.rp = true;
  6258. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  6259. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  6260. }var _default =
  6261. cfg;exports.default = _default;
  6262. /***/ }),
  6263. /***/ 317:
  6264. /*!************************************************************************************!*\
  6265. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  6266. \************************************************************************************/
  6267. /*! no static exports found */
  6268. /***/ (function(module, exports, __webpack_require__) {
  6269. "use strict";
  6270. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 316));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6271. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  6272. function CssHandler(tagStyle) {
  6273. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  6274. for (var item in tagStyle) {
  6275. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  6276. this.styles = styles;
  6277. }
  6278. CssHandler.prototype.getStyle = function (data) {
  6279. this.styles = new parser(data, this.styles).parse();
  6280. };
  6281. CssHandler.prototype.match = function (name, attrs) {
  6282. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  6283. if (attrs.class) {
  6284. var items = attrs.class.split(' ');
  6285. for (var i = 0, item; item = items[i]; i++) {
  6286. if (tmp = this.styles['.' + item])
  6287. matched += tmp + ';';}
  6288. }
  6289. if (tmp = this.styles['#' + attrs.id])
  6290. matched += tmp + ';';
  6291. return matched;
  6292. };var _default =
  6293. CssHandler;exports.default = _default;
  6294. function parser(data, init) {
  6295. this.data = data;
  6296. this.floor = 0;
  6297. this.i = 0;
  6298. this.list = [];
  6299. this.res = init;
  6300. this.state = this.Space;
  6301. }
  6302. parser.prototype.parse = function () {
  6303. for (var c; c = this.data[this.i]; this.i++) {
  6304. this.state(c);}
  6305. return this.res;
  6306. };
  6307. parser.prototype.section = function () {
  6308. return this.data.substring(this.start, this.i);
  6309. };
  6310. // 状态机
  6311. parser.prototype.Space = function (c) {
  6312. if (c == '.' || c == '#' || isLetter(c)) {
  6313. this.start = this.i;
  6314. this.state = this.Name;
  6315. } else if (c == '/' && this.data[this.i + 1] == '*')
  6316. this.Comment();else
  6317. if (!_config.default.blankChar[c] && c != ';')
  6318. this.state = this.Ignore;
  6319. };
  6320. parser.prototype.Comment = function () {
  6321. this.i = this.data.indexOf('*/', this.i) + 1;
  6322. if (!this.i) this.i = this.data.length;
  6323. this.state = this.Space;
  6324. };
  6325. parser.prototype.Ignore = function (c) {
  6326. if (c == '{') this.floor++;else
  6327. if (c == '}' && ! --this.floor) {
  6328. this.list = [];
  6329. this.state = this.Space;
  6330. }
  6331. };
  6332. parser.prototype.Name = function (c) {
  6333. if (_config.default.blankChar[c]) {
  6334. this.list.push(this.section());
  6335. this.state = this.NameSpace;
  6336. } else if (c == '{') {
  6337. this.list.push(this.section());
  6338. this.Content();
  6339. } else if (c == ',') {
  6340. this.list.push(this.section());
  6341. this.Comma();
  6342. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  6343. this.state = this.Ignore;
  6344. };
  6345. parser.prototype.NameSpace = function (c) {
  6346. if (c == '{') this.Content();else
  6347. if (c == ',') this.Comma();else
  6348. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  6349. };
  6350. parser.prototype.Comma = function () {
  6351. while (_config.default.blankChar[this.data[++this.i]]) {;}
  6352. if (this.data[this.i] == '{') this.Content();else
  6353. {
  6354. this.start = this.i--;
  6355. this.state = this.Name;
  6356. }
  6357. };
  6358. parser.prototype.Content = function () {
  6359. this.start = ++this.i;
  6360. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  6361. var content = this.section();
  6362. for (var i = 0, item; item = this.list[i++];) {
  6363. if (this.res[item]) this.res[item] += ';' + content;else
  6364. this.res[item] = content;}
  6365. this.list = [];
  6366. this.state = this.Space;
  6367. };
  6368. /***/ }),
  6369. /***/ 32:
  6370. /*!********************************************************************!*\
  6371. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  6372. \********************************************************************/
  6373. /*! no static exports found */
  6374. /***/ (function(module, exports, __webpack_require__) {
  6375. "use strict";
  6376. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  6377. if (pos == 'both') {
  6378. return str.replace(/^\s+|\s+$/g, "");
  6379. } else if (pos == "left") {
  6380. return str.replace(/^\s*/, '');
  6381. } else if (pos == 'right') {
  6382. return str.replace(/(\s*$)/g, "");
  6383. } else if (pos == 'all') {
  6384. return str.replace(/\s+/g, "");
  6385. } else {
  6386. return str;
  6387. }
  6388. }var _default =
  6389. trim;exports.default = _default;
  6390. /***/ }),
  6391. /***/ 33:
  6392. /*!*********************************************************************!*\
  6393. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  6394. \*********************************************************************/
  6395. /*! no static exports found */
  6396. /***/ (function(module, exports, __webpack_require__) {
  6397. "use strict";
  6398. /* 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;
  6399. uni.showToast({
  6400. title: title,
  6401. icon: 'none',
  6402. duration: duration });
  6403. }var _default =
  6404. toast;exports.default = _default;
  6405. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6406. /***/ }),
  6407. /***/ 34:
  6408. /*!*************************************************************************!*\
  6409. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  6410. \*************************************************************************/
  6411. /*! no static exports found */
  6412. /***/ (function(module, exports, __webpack_require__) {
  6413. "use strict";
  6414. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6415. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6416. function getParent(name, keys) {
  6417. var parent = this.$parent;
  6418. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6419. while (parent) {
  6420. // 父组件
  6421. if (parent.$options.name !== name) {
  6422. // 如果组件的name不相等,继续上一级寻找
  6423. parent = parent.$parent;
  6424. } else {var _ret = function () {
  6425. var data = {};
  6426. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  6427. if (Array.isArray(keys)) {
  6428. keys.map(function (val) {
  6429. data[val] = parent[val] ? parent[val] : '';
  6430. });
  6431. } else {
  6432. // 历遍传过来的对象参数
  6433. for (var i in keys) {
  6434. // 如果子组件有此值则用,无此值则用父组件的值
  6435. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  6436. if (Array.isArray(keys[i])) {
  6437. if (keys[i].length) {
  6438. data[i] = keys[i];
  6439. } else {
  6440. data[i] = parent[i];
  6441. }
  6442. } else if (keys[i].constructor === Object) {
  6443. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  6444. if (Object.keys(keys[i]).length) {
  6445. data[i] = keys[i];
  6446. } else {
  6447. data[i] = parent[i];
  6448. }
  6449. } else {
  6450. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  6451. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  6452. }
  6453. }
  6454. }
  6455. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  6456. }
  6457. }
  6458. return {};
  6459. }
  6460. /***/ }),
  6461. /***/ 35:
  6462. /*!***********************************************************************!*\
  6463. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  6464. \***********************************************************************/
  6465. /*! no static exports found */
  6466. /***/ (function(module, exports, __webpack_require__) {
  6467. "use strict";
  6468. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6469. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6470. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  6471. // 值(默认为undefined),就是查找最顶层的$parent
  6472. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6473. var parent = this.$parent;
  6474. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6475. while (parent) {
  6476. // 父组件
  6477. if (parent.$options && parent.$options.name !== name) {
  6478. // 如果组件的name不相等,继续上一级寻找
  6479. parent = parent.$parent;
  6480. } else {
  6481. return parent;
  6482. }
  6483. }
  6484. return false;
  6485. }
  6486. /***/ }),
  6487. /***/ 353:
  6488. /*!*******************************************************************!*\
  6489. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  6490. \*******************************************************************/
  6491. /*! no static exports found */
  6492. /***/ (function(module, exports, __webpack_require__) {
  6493. "use strict";
  6494. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6495. * 递归使用 call 方式this指向
  6496. * @param componentName // 需要找的组件的名称
  6497. * @param eventName // 事件名称
  6498. * @param params // 需要传递的参数
  6499. */
  6500. function _broadcast(componentName, eventName, params) {
  6501. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  6502. var $children;
  6503. $children = this.$children;
  6504. $children.map(function (child) {
  6505. if (componentName === child.$options.name) {
  6506. child.$emit.apply(child, [eventName].concat(params));
  6507. } else {
  6508. _broadcast.apply(child, [componentName, eventName].concat(params));
  6509. }
  6510. });
  6511. }var _default =
  6512. {
  6513. methods: {
  6514. /**
  6515. * 派发 (向上查找) (一个)
  6516. * @param componentName // 需要找的组件的名称
  6517. * @param eventName // 事件名称
  6518. * @param params // 需要传递的参数
  6519. */
  6520. dispatch: function dispatch(componentName, eventName, params) {
  6521. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  6522. var name = parent.$options.name; // 获取当前组件实例的name
  6523. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  6524. // 循环出当前名称的一样的组件实例
  6525. while (parent && (!name || name !== componentName)) {
  6526. parent = parent.$parent;
  6527. if (parent) {
  6528. name = parent.$options.name;
  6529. }
  6530. }
  6531. // 有节点表示当前找到了name一样的实例
  6532. if (parent) {
  6533. parent.$emit.apply(parent, [eventName].concat(params));
  6534. }
  6535. },
  6536. /**
  6537. * 广播 (向下查找) (广播多个)
  6538. * @param componentName // 需要找的组件的名称
  6539. * @param eventName // 事件名称
  6540. * @param params // 需要传递的参数
  6541. */
  6542. broadcast: function broadcast(componentName, eventName, params) {
  6543. _broadcast.call(this, componentName, eventName, params);
  6544. } } };exports.default = _default;
  6545. /***/ }),
  6546. /***/ 354:
  6547. /*!***************************************************************************!*\
  6548. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  6549. \***************************************************************************/
  6550. /*! no static exports found */
  6551. /***/ (function(module, exports, __webpack_require__) {
  6552. "use strict";
  6553. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  6554. _extends = Object.assign || function (target) {
  6555. for (var i = 1; i < arguments.length; i++) {
  6556. var source = arguments[i];
  6557. for (var key in source) {
  6558. if (Object.prototype.hasOwnProperty.call(source, key)) {
  6559. target[key] = source[key];
  6560. }
  6561. }
  6562. }
  6563. return target;
  6564. };
  6565. return _extends.apply(this, arguments);
  6566. }
  6567. /* eslint no-console:0 */
  6568. var formatRegExp = /%[sdj%]/g;
  6569. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  6570. if (typeof process !== 'undefined' && Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  6571. 'undefined' && typeof document !== 'undefined') {
  6572. warning = function warning(type, errors) {
  6573. if (typeof console !== 'undefined' && console.warn) {
  6574. if (errors.every(function (e) {
  6575. return typeof e === 'string';
  6576. })) {
  6577. console.warn(type, errors);
  6578. }
  6579. }
  6580. };
  6581. }
  6582. function convertFieldsError(errors) {
  6583. if (!errors || !errors.length) return null;
  6584. var fields = {};
  6585. errors.forEach(function (error) {
  6586. var field = error.field;
  6587. fields[field] = fields[field] || [];
  6588. fields[field].push(error);
  6589. });
  6590. return fields;
  6591. }
  6592. function format() {
  6593. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  6594. args[_key] = arguments[_key];
  6595. }
  6596. var i = 1;
  6597. var f = args[0];
  6598. var len = args.length;
  6599. if (typeof f === 'function') {
  6600. return f.apply(null, args.slice(1));
  6601. }
  6602. if (typeof f === 'string') {
  6603. var str = String(f).replace(formatRegExp, function (x) {
  6604. if (x === '%%') {
  6605. return '%';
  6606. }
  6607. if (i >= len) {
  6608. return x;
  6609. }
  6610. switch (x) {
  6611. case '%s':
  6612. return String(args[i++]);
  6613. case '%d':
  6614. return Number(args[i++]);
  6615. case '%j':
  6616. try {
  6617. return JSON.stringify(args[i++]);
  6618. } catch (_) {
  6619. return '[Circular]';
  6620. }
  6621. break;
  6622. default:
  6623. return x;}
  6624. });
  6625. for (var arg = args[i]; i < len; arg = args[++i]) {
  6626. str += " " + arg;
  6627. }
  6628. return str;
  6629. }
  6630. return f;
  6631. }
  6632. function isNativeStringType(type) {
  6633. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  6634. }
  6635. function isEmptyValue(value, type) {
  6636. if (value === undefined || value === null) {
  6637. return true;
  6638. }
  6639. if (type === 'array' && Array.isArray(value) && !value.length) {
  6640. return true;
  6641. }
  6642. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  6643. return true;
  6644. }
  6645. return false;
  6646. }
  6647. function asyncParallelArray(arr, func, callback) {
  6648. var results = [];
  6649. var total = 0;
  6650. var arrLength = arr.length;
  6651. function count(errors) {
  6652. results.push.apply(results, errors);
  6653. total++;
  6654. if (total === arrLength) {
  6655. callback(results);
  6656. }
  6657. }
  6658. arr.forEach(function (a) {
  6659. func(a, count);
  6660. });
  6661. }
  6662. function asyncSerialArray(arr, func, callback) {
  6663. var index = 0;
  6664. var arrLength = arr.length;
  6665. function next(errors) {
  6666. if (errors && errors.length) {
  6667. callback(errors);
  6668. return;
  6669. }
  6670. var original = index;
  6671. index = index + 1;
  6672. if (original < arrLength) {
  6673. func(arr[original], next);
  6674. } else {
  6675. callback([]);
  6676. }
  6677. }
  6678. next([]);
  6679. }
  6680. function flattenObjArr(objArr) {
  6681. var ret = [];
  6682. Object.keys(objArr).forEach(function (k) {
  6683. ret.push.apply(ret, objArr[k]);
  6684. });
  6685. return ret;
  6686. }
  6687. function asyncMap(objArr, option, func, callback) {
  6688. if (option.first) {
  6689. var _pending = new Promise(function (resolve, reject) {
  6690. var next = function next(errors) {
  6691. callback(errors);
  6692. return errors.length ? reject({
  6693. errors: errors,
  6694. fields: convertFieldsError(errors) }) :
  6695. resolve();
  6696. };
  6697. var flattenArr = flattenObjArr(objArr);
  6698. asyncSerialArray(flattenArr, func, next);
  6699. });
  6700. _pending["catch"](function (e) {
  6701. return e;
  6702. });
  6703. return _pending;
  6704. }
  6705. var firstFields = option.firstFields || [];
  6706. if (firstFields === true) {
  6707. firstFields = Object.keys(objArr);
  6708. }
  6709. var objArrKeys = Object.keys(objArr);
  6710. var objArrLength = objArrKeys.length;
  6711. var total = 0;
  6712. var results = [];
  6713. var pending = new Promise(function (resolve, reject) {
  6714. var next = function next(errors) {
  6715. results.push.apply(results, errors);
  6716. total++;
  6717. if (total === objArrLength) {
  6718. callback(results);
  6719. return results.length ? reject({
  6720. errors: results,
  6721. fields: convertFieldsError(results) }) :
  6722. resolve();
  6723. }
  6724. };
  6725. if (!objArrKeys.length) {
  6726. callback(results);
  6727. resolve();
  6728. }
  6729. objArrKeys.forEach(function (key) {
  6730. var arr = objArr[key];
  6731. if (firstFields.indexOf(key) !== -1) {
  6732. asyncSerialArray(arr, func, next);
  6733. } else {
  6734. asyncParallelArray(arr, func, next);
  6735. }
  6736. });
  6737. });
  6738. pending["catch"](function (e) {
  6739. return e;
  6740. });
  6741. return pending;
  6742. }
  6743. function complementError(rule) {
  6744. return function (oe) {
  6745. if (oe && oe.message) {
  6746. oe.field = oe.field || rule.fullField;
  6747. return oe;
  6748. }
  6749. return {
  6750. message: typeof oe === 'function' ? oe() : oe,
  6751. field: oe.field || rule.fullField };
  6752. };
  6753. }
  6754. function deepMerge(target, source) {
  6755. if (source) {
  6756. for (var s in source) {
  6757. if (source.hasOwnProperty(s)) {
  6758. var value = source[s];
  6759. if (typeof value === 'object' && typeof target[s] === 'object') {
  6760. target[s] = _extends({}, target[s], {}, value);
  6761. } else {
  6762. target[s] = value;
  6763. }
  6764. }
  6765. }
  6766. }
  6767. return target;
  6768. }
  6769. /**
  6770. * Rule for validating required fields.
  6771. *
  6772. * @param rule The validation rule.
  6773. * @param value The value of the field on the source object.
  6774. * @param source The source object being validated.
  6775. * @param errors An array of errors that this rule may add
  6776. * validation errors to.
  6777. * @param options The validation options.
  6778. * @param options.messages The validation messages.
  6779. */
  6780. function required(rule, value, source, errors, options, type) {
  6781. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  6782. errors.push(format(options.messages.required, rule.fullField));
  6783. }
  6784. }
  6785. /**
  6786. * Rule for validating whitespace.
  6787. *
  6788. * @param rule The validation rule.
  6789. * @param value The value of the field on the source object.
  6790. * @param source The source object being validated.
  6791. * @param errors An array of errors that this rule may add
  6792. * validation errors to.
  6793. * @param options The validation options.
  6794. * @param options.messages The validation messages.
  6795. */
  6796. function whitespace(rule, value, source, errors, options) {
  6797. if (/^\s+$/.test(value) || value === '') {
  6798. errors.push(format(options.messages.whitespace, rule.fullField));
  6799. }
  6800. }
  6801. /* eslint max-len:0 */
  6802. var pattern = {
  6803. // http://emailregex.com/
  6804. 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,}))$/,
  6805. url: new RegExp(
  6806. "^(?!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]*)?$",
  6807. 'i'),
  6808. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  6809. var types = {
  6810. integer: function integer(value) {
  6811. return types.number(value) && parseInt(value, 10) === value;
  6812. },
  6813. "float": function float(value) {
  6814. return types.number(value) && !types.integer(value);
  6815. },
  6816. array: function array(value) {
  6817. return Array.isArray(value);
  6818. },
  6819. regexp: function regexp(value) {
  6820. if (value instanceof RegExp) {
  6821. return true;
  6822. }
  6823. try {
  6824. return !!new RegExp(value);
  6825. } catch (e) {
  6826. return false;
  6827. }
  6828. },
  6829. date: function date(value) {
  6830. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  6831. 'function';
  6832. },
  6833. number: function number(value) {
  6834. if (isNaN(value)) {
  6835. return false;
  6836. }
  6837. // 修改源码,将字符串数值先转为数值
  6838. return typeof +value === 'number';
  6839. },
  6840. object: function object(value) {
  6841. return typeof value === 'object' && !types.array(value);
  6842. },
  6843. method: function method(value) {
  6844. return typeof value === 'function';
  6845. },
  6846. email: function email(value) {
  6847. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  6848. },
  6849. url: function url(value) {
  6850. return typeof value === 'string' && !!value.match(pattern.url);
  6851. },
  6852. hex: function hex(value) {
  6853. return typeof value === 'string' && !!value.match(pattern.hex);
  6854. } };
  6855. /**
  6856. * Rule for validating the type of a value.
  6857. *
  6858. * @param rule The validation rule.
  6859. * @param value The value of the field on the source object.
  6860. * @param source The source object being validated.
  6861. * @param errors An array of errors that this rule may add
  6862. * validation errors to.
  6863. * @param options The validation options.
  6864. * @param options.messages The validation messages.
  6865. */
  6866. function type(rule, value, source, errors, options) {
  6867. if (rule.required && value === undefined) {
  6868. required(rule, value, source, errors, options);
  6869. return;
  6870. }
  6871. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  6872. var ruleType = rule.type;
  6873. if (custom.indexOf(ruleType) > -1) {
  6874. if (!types[ruleType](value)) {
  6875. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  6876. } // straight typeof check
  6877. } else if (ruleType && typeof value !== rule.type) {
  6878. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  6879. }
  6880. }
  6881. /**
  6882. * Rule for validating minimum and maximum allowed values.
  6883. *
  6884. * @param rule The validation rule.
  6885. * @param value The value of the field on the source object.
  6886. * @param source The source object being validated.
  6887. * @param errors An array of errors that this rule may add
  6888. * validation errors to.
  6889. * @param options The validation options.
  6890. * @param options.messages The validation messages.
  6891. */
  6892. function range(rule, value, source, errors, options) {
  6893. var len = typeof rule.len === 'number';
  6894. var min = typeof rule.min === 'number';
  6895. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  6896. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  6897. var val = value;
  6898. var key = null;
  6899. var num = typeof value === 'number';
  6900. var str = typeof value === 'string';
  6901. var arr = Array.isArray(value);
  6902. if (num) {
  6903. key = 'number';
  6904. } else if (str) {
  6905. key = 'string';
  6906. } else if (arr) {
  6907. key = 'array';
  6908. } // if the value is not of a supported type for range validation
  6909. // the validation rule rule should use the
  6910. // type property to also test for a particular type
  6911. if (!key) {
  6912. return false;
  6913. }
  6914. if (arr) {
  6915. val = value.length;
  6916. }
  6917. if (str) {
  6918. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  6919. val = value.replace(spRegexp, '_').length;
  6920. }
  6921. if (len) {
  6922. if (val !== rule.len) {
  6923. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  6924. }
  6925. } else if (min && !max && val < rule.min) {
  6926. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  6927. } else if (max && !min && val > rule.max) {
  6928. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  6929. } else if (min && max && (val < rule.min || val > rule.max)) {
  6930. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  6931. }
  6932. }
  6933. var ENUM = 'enum';
  6934. /**
  6935. * Rule for validating a value exists in an enumerable list.
  6936. *
  6937. * @param rule The validation rule.
  6938. * @param value The value of the field on the source object.
  6939. * @param source The source object being validated.
  6940. * @param errors An array of errors that this rule may add
  6941. * validation errors to.
  6942. * @param options The validation options.
  6943. * @param options.messages The validation messages.
  6944. */
  6945. function enumerable(rule, value, source, errors, options) {
  6946. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  6947. if (rule[ENUM].indexOf(value) === -1) {
  6948. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  6949. }
  6950. }
  6951. /**
  6952. * Rule for validating a regular expression pattern.
  6953. *
  6954. * @param rule The validation rule.
  6955. * @param value The value of the field on the source object.
  6956. * @param source The source object being validated.
  6957. * @param errors An array of errors that this rule may add
  6958. * validation errors to.
  6959. * @param options The validation options.
  6960. * @param options.messages The validation messages.
  6961. */
  6962. function pattern$1(rule, value, source, errors, options) {
  6963. if (rule.pattern) {
  6964. if (rule.pattern instanceof RegExp) {
  6965. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  6966. // flag is accidentally set to `true`, which in a validation scenario
  6967. // is not necessary and the result might be misleading
  6968. rule.pattern.lastIndex = 0;
  6969. if (!rule.pattern.test(value)) {
  6970. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  6971. }
  6972. } else if (typeof rule.pattern === 'string') {
  6973. var _pattern = new RegExp(rule.pattern);
  6974. if (!_pattern.test(value)) {
  6975. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  6976. }
  6977. }
  6978. }
  6979. }
  6980. var rules = {
  6981. required: required,
  6982. whitespace: whitespace,
  6983. type: type,
  6984. range: range,
  6985. "enum": enumerable,
  6986. pattern: pattern$1 };
  6987. /**
  6988. * Performs validation for string types.
  6989. *
  6990. * @param rule The validation rule.
  6991. * @param value The value of the field on the source object.
  6992. * @param callback The callback function.
  6993. * @param source The source object being validated.
  6994. * @param options The validation options.
  6995. * @param options.messages The validation messages.
  6996. */
  6997. function string(rule, value, callback, source, options) {
  6998. var errors = [];
  6999. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7000. if (validate) {
  7001. if (isEmptyValue(value, 'string') && !rule.required) {
  7002. return callback();
  7003. }
  7004. rules.required(rule, value, source, errors, options, 'string');
  7005. if (!isEmptyValue(value, 'string')) {
  7006. rules.type(rule, value, source, errors, options);
  7007. rules.range(rule, value, source, errors, options);
  7008. rules.pattern(rule, value, source, errors, options);
  7009. if (rule.whitespace === true) {
  7010. rules.whitespace(rule, value, source, errors, options);
  7011. }
  7012. }
  7013. }
  7014. callback(errors);
  7015. }
  7016. /**
  7017. * Validates a function.
  7018. *
  7019. * @param rule The validation rule.
  7020. * @param value The value of the field on the source object.
  7021. * @param callback The callback function.
  7022. * @param source The source object being validated.
  7023. * @param options The validation options.
  7024. * @param options.messages The validation messages.
  7025. */
  7026. function method(rule, value, callback, source, options) {
  7027. var errors = [];
  7028. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7029. if (validate) {
  7030. if (isEmptyValue(value) && !rule.required) {
  7031. return callback();
  7032. }
  7033. rules.required(rule, value, source, errors, options);
  7034. if (value !== undefined) {
  7035. rules.type(rule, value, source, errors, options);
  7036. }
  7037. }
  7038. callback(errors);
  7039. }
  7040. /**
  7041. * Validates a number.
  7042. *
  7043. * @param rule The validation rule.
  7044. * @param value The value of the field on the source object.
  7045. * @param callback The callback function.
  7046. * @param source The source object being validated.
  7047. * @param options The validation options.
  7048. * @param options.messages The validation messages.
  7049. */
  7050. function number(rule, value, callback, source, options) {
  7051. var errors = [];
  7052. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7053. if (validate) {
  7054. if (value === '') {
  7055. value = undefined;
  7056. }
  7057. if (isEmptyValue(value) && !rule.required) {
  7058. return callback();
  7059. }
  7060. rules.required(rule, value, source, errors, options);
  7061. if (value !== undefined) {
  7062. rules.type(rule, value, source, errors, options);
  7063. rules.range(rule, value, source, errors, options);
  7064. }
  7065. }
  7066. callback(errors);
  7067. }
  7068. /**
  7069. * Validates a boolean.
  7070. *
  7071. * @param rule The validation rule.
  7072. * @param value The value of the field on the source object.
  7073. * @param callback The callback function.
  7074. * @param source The source object being validated.
  7075. * @param options The validation options.
  7076. * @param options.messages The validation messages.
  7077. */
  7078. function _boolean(rule, value, callback, source, options) {
  7079. var errors = [];
  7080. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7081. if (validate) {
  7082. if (isEmptyValue(value) && !rule.required) {
  7083. return callback();
  7084. }
  7085. rules.required(rule, value, source, errors, options);
  7086. if (value !== undefined) {
  7087. rules.type(rule, value, source, errors, options);
  7088. }
  7089. }
  7090. callback(errors);
  7091. }
  7092. /**
  7093. * Validates the regular expression type.
  7094. *
  7095. * @param rule The validation rule.
  7096. * @param value The value of the field on the source object.
  7097. * @param callback The callback function.
  7098. * @param source The source object being validated.
  7099. * @param options The validation options.
  7100. * @param options.messages The validation messages.
  7101. */
  7102. function regexp(rule, value, callback, source, options) {
  7103. var errors = [];
  7104. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7105. if (validate) {
  7106. if (isEmptyValue(value) && !rule.required) {
  7107. return callback();
  7108. }
  7109. rules.required(rule, value, source, errors, options);
  7110. if (!isEmptyValue(value)) {
  7111. rules.type(rule, value, source, errors, options);
  7112. }
  7113. }
  7114. callback(errors);
  7115. }
  7116. /**
  7117. * Validates a number is an integer.
  7118. *
  7119. * @param rule The validation rule.
  7120. * @param value The value of the field on the source object.
  7121. * @param callback The callback function.
  7122. * @param source The source object being validated.
  7123. * @param options The validation options.
  7124. * @param options.messages The validation messages.
  7125. */
  7126. function integer(rule, value, callback, source, options) {
  7127. var errors = [];
  7128. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7129. if (validate) {
  7130. if (isEmptyValue(value) && !rule.required) {
  7131. return callback();
  7132. }
  7133. rules.required(rule, value, source, errors, options);
  7134. if (value !== undefined) {
  7135. rules.type(rule, value, source, errors, options);
  7136. rules.range(rule, value, source, errors, options);
  7137. }
  7138. }
  7139. callback(errors);
  7140. }
  7141. /**
  7142. * Validates a number is a floating point number.
  7143. *
  7144. * @param rule The validation rule.
  7145. * @param value The value of the field on the source object.
  7146. * @param callback The callback function.
  7147. * @param source The source object being validated.
  7148. * @param options The validation options.
  7149. * @param options.messages The validation messages.
  7150. */
  7151. function floatFn(rule, value, callback, source, options) {
  7152. var errors = [];
  7153. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7154. if (validate) {
  7155. if (isEmptyValue(value) && !rule.required) {
  7156. return callback();
  7157. }
  7158. rules.required(rule, value, source, errors, options);
  7159. if (value !== undefined) {
  7160. rules.type(rule, value, source, errors, options);
  7161. rules.range(rule, value, source, errors, options);
  7162. }
  7163. }
  7164. callback(errors);
  7165. }
  7166. /**
  7167. * Validates an array.
  7168. *
  7169. * @param rule The validation rule.
  7170. * @param value The value of the field on the source object.
  7171. * @param callback The callback function.
  7172. * @param source The source object being validated.
  7173. * @param options The validation options.
  7174. * @param options.messages The validation messages.
  7175. */
  7176. function array(rule, value, callback, source, options) {
  7177. var errors = [];
  7178. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7179. if (validate) {
  7180. if (isEmptyValue(value, 'array') && !rule.required) {
  7181. return callback();
  7182. }
  7183. rules.required(rule, value, source, errors, options, 'array');
  7184. if (!isEmptyValue(value, 'array')) {
  7185. rules.type(rule, value, source, errors, options);
  7186. rules.range(rule, value, source, errors, options);
  7187. }
  7188. }
  7189. callback(errors);
  7190. }
  7191. /**
  7192. * Validates an object.
  7193. *
  7194. * @param rule The validation rule.
  7195. * @param value The value of the field on the source object.
  7196. * @param callback The callback function.
  7197. * @param source The source object being validated.
  7198. * @param options The validation options.
  7199. * @param options.messages The validation messages.
  7200. */
  7201. function object(rule, value, callback, source, options) {
  7202. var errors = [];
  7203. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7204. if (validate) {
  7205. if (isEmptyValue(value) && !rule.required) {
  7206. return callback();
  7207. }
  7208. rules.required(rule, value, source, errors, options);
  7209. if (value !== undefined) {
  7210. rules.type(rule, value, source, errors, options);
  7211. }
  7212. }
  7213. callback(errors);
  7214. }
  7215. var ENUM$1 = 'enum';
  7216. /**
  7217. * Validates an enumerable list.
  7218. *
  7219. * @param rule The validation rule.
  7220. * @param value The value of the field on the source object.
  7221. * @param callback The callback function.
  7222. * @param source The source object being validated.
  7223. * @param options The validation options.
  7224. * @param options.messages The validation messages.
  7225. */
  7226. function enumerable$1(rule, value, callback, source, options) {
  7227. var errors = [];
  7228. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7229. if (validate) {
  7230. if (isEmptyValue(value) && !rule.required) {
  7231. return callback();
  7232. }
  7233. rules.required(rule, value, source, errors, options);
  7234. if (value !== undefined) {
  7235. rules[ENUM$1](rule, value, source, errors, options);
  7236. }
  7237. }
  7238. callback(errors);
  7239. }
  7240. /**
  7241. * Validates a regular expression pattern.
  7242. *
  7243. * Performs validation when a rule only contains
  7244. * a pattern property but is not declared as a string type.
  7245. *
  7246. * @param rule The validation rule.
  7247. * @param value The value of the field on the source object.
  7248. * @param callback The callback function.
  7249. * @param source The source object being validated.
  7250. * @param options The validation options.
  7251. * @param options.messages The validation messages.
  7252. */
  7253. function pattern$2(rule, value, callback, source, options) {
  7254. var errors = [];
  7255. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7256. if (validate) {
  7257. if (isEmptyValue(value, 'string') && !rule.required) {
  7258. return callback();
  7259. }
  7260. rules.required(rule, value, source, errors, options);
  7261. if (!isEmptyValue(value, 'string')) {
  7262. rules.pattern(rule, value, source, errors, options);
  7263. }
  7264. }
  7265. callback(errors);
  7266. }
  7267. function date(rule, value, callback, source, options) {
  7268. var errors = [];
  7269. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7270. if (validate) {
  7271. if (isEmptyValue(value) && !rule.required) {
  7272. return callback();
  7273. }
  7274. rules.required(rule, value, source, errors, options);
  7275. if (!isEmptyValue(value)) {
  7276. var dateObject;
  7277. if (typeof value === 'number') {
  7278. dateObject = new Date(value);
  7279. } else {
  7280. dateObject = value;
  7281. }
  7282. rules.type(rule, dateObject, source, errors, options);
  7283. if (dateObject) {
  7284. rules.range(rule, dateObject.getTime(), source, errors, options);
  7285. }
  7286. }
  7287. }
  7288. callback(errors);
  7289. }
  7290. function required$1(rule, value, callback, source, options) {
  7291. var errors = [];
  7292. var type = Array.isArray(value) ? 'array' : typeof value;
  7293. rules.required(rule, value, source, errors, options, type);
  7294. callback(errors);
  7295. }
  7296. function type$1(rule, value, callback, source, options) {
  7297. var ruleType = rule.type;
  7298. var errors = [];
  7299. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7300. if (validate) {
  7301. if (isEmptyValue(value, ruleType) && !rule.required) {
  7302. return callback();
  7303. }
  7304. rules.required(rule, value, source, errors, options, ruleType);
  7305. if (!isEmptyValue(value, ruleType)) {
  7306. rules.type(rule, value, source, errors, options);
  7307. }
  7308. }
  7309. callback(errors);
  7310. }
  7311. /**
  7312. * Performs validation for any type.
  7313. *
  7314. * @param rule The validation rule.
  7315. * @param value The value of the field on the source object.
  7316. * @param callback The callback function.
  7317. * @param source The source object being validated.
  7318. * @param options The validation options.
  7319. * @param options.messages The validation messages.
  7320. */
  7321. function any(rule, value, callback, source, options) {
  7322. var errors = [];
  7323. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  7324. if (validate) {
  7325. if (isEmptyValue(value) && !rule.required) {
  7326. return callback();
  7327. }
  7328. rules.required(rule, value, source, errors, options);
  7329. }
  7330. callback(errors);
  7331. }
  7332. var validators = {
  7333. string: string,
  7334. method: method,
  7335. number: number,
  7336. "boolean": _boolean,
  7337. regexp: regexp,
  7338. integer: integer,
  7339. "float": floatFn,
  7340. array: array,
  7341. object: object,
  7342. "enum": enumerable$1,
  7343. pattern: pattern$2,
  7344. date: date,
  7345. url: type$1,
  7346. hex: type$1,
  7347. email: type$1,
  7348. required: required$1,
  7349. any: any };
  7350. function newMessages() {
  7351. return {
  7352. "default": 'Validation error on field %s',
  7353. required: '%s is required',
  7354. "enum": '%s must be one of %s',
  7355. whitespace: '%s cannot be empty',
  7356. date: {
  7357. format: '%s date %s is invalid for format %s',
  7358. parse: '%s date could not be parsed, %s is invalid ',
  7359. invalid: '%s date %s is invalid' },
  7360. types: {
  7361. string: '%s is not a %s',
  7362. method: '%s is not a %s (function)',
  7363. array: '%s is not an %s',
  7364. object: '%s is not an %s',
  7365. number: '%s is not a %s',
  7366. date: '%s is not a %s',
  7367. "boolean": '%s is not a %s',
  7368. integer: '%s is not an %s',
  7369. "float": '%s is not a %s',
  7370. regexp: '%s is not a valid %s',
  7371. email: '%s is not a valid %s',
  7372. url: '%s is not a valid %s',
  7373. hex: '%s is not a valid %s' },
  7374. string: {
  7375. len: '%s must be exactly %s characters',
  7376. min: '%s must be at least %s characters',
  7377. max: '%s cannot be longer than %s characters',
  7378. range: '%s must be between %s and %s characters' },
  7379. number: {
  7380. len: '%s must equal %s',
  7381. min: '%s cannot be less than %s',
  7382. max: '%s cannot be greater than %s',
  7383. range: '%s must be between %s and %s' },
  7384. array: {
  7385. len: '%s must be exactly %s in length',
  7386. min: '%s cannot be less than %s in length',
  7387. max: '%s cannot be greater than %s in length',
  7388. range: '%s must be between %s and %s in length' },
  7389. pattern: {
  7390. mismatch: '%s value %s does not match pattern %s' },
  7391. clone: function clone() {
  7392. var cloned = JSON.parse(JSON.stringify(this));
  7393. cloned.clone = this.clone;
  7394. return cloned;
  7395. } };
  7396. }
  7397. var messages = newMessages();
  7398. /**
  7399. * Encapsulates a validation schema.
  7400. *
  7401. * @param descriptor An object declaring validation rules
  7402. * for this schema.
  7403. */
  7404. function Schema(descriptor) {
  7405. this.rules = null;
  7406. this._messages = messages;
  7407. this.define(descriptor);
  7408. }
  7409. Schema.prototype = {
  7410. messages: function messages(_messages) {
  7411. if (_messages) {
  7412. this._messages = deepMerge(newMessages(), _messages);
  7413. }
  7414. return this._messages;
  7415. },
  7416. define: function define(rules) {
  7417. if (!rules) {
  7418. throw new Error('Cannot configure a schema with no rules');
  7419. }
  7420. if (typeof rules !== 'object' || Array.isArray(rules)) {
  7421. throw new Error('Rules must be an object');
  7422. }
  7423. this.rules = {};
  7424. var z;
  7425. var item;
  7426. for (z in rules) {
  7427. if (rules.hasOwnProperty(z)) {
  7428. item = rules[z];
  7429. this.rules[z] = Array.isArray(item) ? item : [item];
  7430. }
  7431. }
  7432. },
  7433. validate: function validate(source_, o, oc) {
  7434. var _this = this;
  7435. if (o === void 0) {
  7436. o = {};
  7437. }
  7438. if (oc === void 0) {
  7439. oc = function oc() {};
  7440. }
  7441. var source = source_;
  7442. var options = o;
  7443. var callback = oc;
  7444. if (typeof options === 'function') {
  7445. callback = options;
  7446. options = {};
  7447. }
  7448. if (!this.rules || Object.keys(this.rules).length === 0) {
  7449. if (callback) {
  7450. callback();
  7451. }
  7452. return Promise.resolve();
  7453. }
  7454. function complete(results) {
  7455. var i;
  7456. var errors = [];
  7457. var fields = {};
  7458. function add(e) {
  7459. if (Array.isArray(e)) {
  7460. var _errors;
  7461. errors = (_errors = errors).concat.apply(_errors, e);
  7462. } else {
  7463. errors.push(e);
  7464. }
  7465. }
  7466. for (i = 0; i < results.length; i++) {
  7467. add(results[i]);
  7468. }
  7469. if (!errors.length) {
  7470. errors = null;
  7471. fields = null;
  7472. } else {
  7473. fields = convertFieldsError(errors);
  7474. }
  7475. callback(errors, fields);
  7476. }
  7477. if (options.messages) {
  7478. var messages$1 = this.messages();
  7479. if (messages$1 === messages) {
  7480. messages$1 = newMessages();
  7481. }
  7482. deepMerge(messages$1, options.messages);
  7483. options.messages = messages$1;
  7484. } else {
  7485. options.messages = this.messages();
  7486. }
  7487. var arr;
  7488. var value;
  7489. var series = {};
  7490. var keys = options.keys || Object.keys(this.rules);
  7491. keys.forEach(function (z) {
  7492. arr = _this.rules[z];
  7493. value = source[z];
  7494. arr.forEach(function (r) {
  7495. var rule = r;
  7496. if (typeof rule.transform === 'function') {
  7497. if (source === source_) {
  7498. source = _extends({}, source);
  7499. }
  7500. value = source[z] = rule.transform(value);
  7501. }
  7502. if (typeof rule === 'function') {
  7503. rule = {
  7504. validator: rule };
  7505. } else {
  7506. rule = _extends({}, rule);
  7507. }
  7508. rule.validator = _this.getValidationMethod(rule);
  7509. rule.field = z;
  7510. rule.fullField = rule.fullField || z;
  7511. rule.type = _this.getType(rule);
  7512. if (!rule.validator) {
  7513. return;
  7514. }
  7515. series[z] = series[z] || [];
  7516. series[z].push({
  7517. rule: rule,
  7518. value: value,
  7519. source: source,
  7520. field: z });
  7521. });
  7522. });
  7523. var errorFields = {};
  7524. return asyncMap(series, options, function (data, doIt) {
  7525. var rule = data.rule;
  7526. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  7527. 'object');
  7528. deep = deep && (rule.required || !rule.required && data.value);
  7529. rule.field = data.field;
  7530. function addFullfield(key, schema) {
  7531. return _extends({}, schema, {
  7532. fullField: rule.fullField + "." + key });
  7533. }
  7534. function cb(e) {
  7535. if (e === void 0) {
  7536. e = [];
  7537. }
  7538. var errors = e;
  7539. if (!Array.isArray(errors)) {
  7540. errors = [errors];
  7541. }
  7542. if (!options.suppressWarning && errors.length) {
  7543. Schema.warning('async-validator:', errors);
  7544. }
  7545. if (errors.length && rule.message) {
  7546. errors = [].concat(rule.message);
  7547. }
  7548. errors = errors.map(complementError(rule));
  7549. if (options.first && errors.length) {
  7550. errorFields[rule.field] = 1;
  7551. return doIt(errors);
  7552. }
  7553. if (!deep) {
  7554. doIt(errors);
  7555. } else {
  7556. // if rule is required but the target object
  7557. // does not exist fail at the rule level and don't
  7558. // go deeper
  7559. if (rule.required && !data.value) {
  7560. if (rule.message) {
  7561. errors = [].concat(rule.message).map(complementError(rule));
  7562. } else if (options.error) {
  7563. errors = [options.error(rule, format(options.messages.required, rule.field))];
  7564. } else {
  7565. errors = [];
  7566. }
  7567. return doIt(errors);
  7568. }
  7569. var fieldsSchema = {};
  7570. if (rule.defaultField) {
  7571. for (var k in data.value) {
  7572. if (data.value.hasOwnProperty(k)) {
  7573. fieldsSchema[k] = rule.defaultField;
  7574. }
  7575. }
  7576. }
  7577. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  7578. for (var f in fieldsSchema) {
  7579. if (fieldsSchema.hasOwnProperty(f)) {
  7580. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  7581. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  7582. }
  7583. }
  7584. var schema = new Schema(fieldsSchema);
  7585. schema.messages(options.messages);
  7586. if (data.rule.options) {
  7587. data.rule.options.messages = options.messages;
  7588. data.rule.options.error = options.error;
  7589. }
  7590. schema.validate(data.value, data.rule.options || options, function (errs) {
  7591. var finalErrors = [];
  7592. if (errors && errors.length) {
  7593. finalErrors.push.apply(finalErrors, errors);
  7594. }
  7595. if (errs && errs.length) {
  7596. finalErrors.push.apply(finalErrors, errs);
  7597. }
  7598. doIt(finalErrors.length ? finalErrors : null);
  7599. });
  7600. }
  7601. }
  7602. var res;
  7603. if (rule.asyncValidator) {
  7604. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  7605. } else if (rule.validator) {
  7606. res = rule.validator(rule, data.value, cb, data.source, options);
  7607. if (res === true) {
  7608. cb();
  7609. } else if (res === false) {
  7610. cb(rule.message || rule.field + " fails");
  7611. } else if (res instanceof Array) {
  7612. cb(res);
  7613. } else if (res instanceof Error) {
  7614. cb(res.message);
  7615. }
  7616. }
  7617. if (res && res.then) {
  7618. res.then(function () {
  7619. return cb();
  7620. }, function (e) {
  7621. return cb(e);
  7622. });
  7623. }
  7624. }, function (results) {
  7625. complete(results);
  7626. });
  7627. },
  7628. getType: function getType(rule) {
  7629. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  7630. rule.type = 'pattern';
  7631. }
  7632. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  7633. throw new Error(format('Unknown rule type %s', rule.type));
  7634. }
  7635. return rule.type || 'string';
  7636. },
  7637. getValidationMethod: function getValidationMethod(rule) {
  7638. if (typeof rule.validator === 'function') {
  7639. return rule.validator;
  7640. }
  7641. var keys = Object.keys(rule);
  7642. var messageIndex = keys.indexOf('message');
  7643. if (messageIndex !== -1) {
  7644. keys.splice(messageIndex, 1);
  7645. }
  7646. if (keys.length === 1 && keys[0] === 'required') {
  7647. return validators.required;
  7648. }
  7649. return validators[this.getType(rule)] || false;
  7650. } };
  7651. Schema.register = function register(type, validator) {
  7652. if (typeof validator !== 'function') {
  7653. throw new Error('Cannot register a validator by type, validator is not a function');
  7654. }
  7655. validators[type] = validator;
  7656. };
  7657. Schema.warning = warning;
  7658. Schema.messages = messages;var _default =
  7659. Schema;exports.default = _default;
  7660. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 355)))
  7661. /***/ }),
  7662. /***/ 355:
  7663. /*!********************************************************!*\
  7664. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  7665. \********************************************************/
  7666. /*! no static exports found */
  7667. /***/ (function(module, exports, __webpack_require__) {
  7668. exports.nextTick = function nextTick(fn) {
  7669. var args = Array.prototype.slice.call(arguments);
  7670. args.shift();
  7671. setTimeout(function () {
  7672. fn.apply(null, args);
  7673. }, 0);
  7674. };
  7675. exports.platform = exports.arch =
  7676. exports.execPath = exports.title = 'browser';
  7677. exports.pid = 1;
  7678. exports.browser = true;
  7679. exports.env = {};
  7680. exports.argv = [];
  7681. exports.binding = function (name) {
  7682. throw new Error('No such module. (Possibly not yet loaded)')
  7683. };
  7684. (function () {
  7685. var cwd = '/';
  7686. var path;
  7687. exports.cwd = function () { return cwd };
  7688. exports.chdir = function (dir) {
  7689. if (!path) path = __webpack_require__(/*! path */ 356);
  7690. cwd = path.resolve(dir, cwd);
  7691. };
  7692. })();
  7693. exports.exit = exports.kill =
  7694. exports.umask = exports.dlopen =
  7695. exports.uptime = exports.memoryUsage =
  7696. exports.uvCounters = function() {};
  7697. exports.features = {};
  7698. /***/ }),
  7699. /***/ 356:
  7700. /*!***********************************************!*\
  7701. !*** ./node_modules/path-browserify/index.js ***!
  7702. \***********************************************/
  7703. /*! no static exports found */
  7704. /***/ (function(module, exports, __webpack_require__) {
  7705. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  7706. // backported and transplited with Babel, with backwards-compat fixes
  7707. // Copyright Joyent, Inc. and other Node contributors.
  7708. //
  7709. // Permission is hereby granted, free of charge, to any person obtaining a
  7710. // copy of this software and associated documentation files (the
  7711. // "Software"), to deal in the Software without restriction, including
  7712. // without limitation the rights to use, copy, modify, merge, publish,
  7713. // distribute, sublicense, and/or sell copies of the Software, and to permit
  7714. // persons to whom the Software is furnished to do so, subject to the
  7715. // following conditions:
  7716. //
  7717. // The above copyright notice and this permission notice shall be included
  7718. // in all copies or substantial portions of the Software.
  7719. //
  7720. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  7721. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  7722. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  7723. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  7724. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  7725. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  7726. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  7727. // resolves . and .. elements in a path array with directory names there
  7728. // must be no slashes, empty elements, or device names (c:\) in the array
  7729. // (so also no leading and trailing slashes - it does not distinguish
  7730. // relative and absolute paths)
  7731. function normalizeArray(parts, allowAboveRoot) {
  7732. // if the path tries to go above the root, `up` ends up > 0
  7733. var up = 0;
  7734. for (var i = parts.length - 1; i >= 0; i--) {
  7735. var last = parts[i];
  7736. if (last === '.') {
  7737. parts.splice(i, 1);
  7738. } else if (last === '..') {
  7739. parts.splice(i, 1);
  7740. up++;
  7741. } else if (up) {
  7742. parts.splice(i, 1);
  7743. up--;
  7744. }
  7745. }
  7746. // if the path is allowed to go above the root, restore leading ..s
  7747. if (allowAboveRoot) {
  7748. for (; up--; up) {
  7749. parts.unshift('..');
  7750. }
  7751. }
  7752. return parts;
  7753. }
  7754. // path.resolve([from ...], to)
  7755. // posix version
  7756. exports.resolve = function() {
  7757. var resolvedPath = '',
  7758. resolvedAbsolute = false;
  7759. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  7760. var path = (i >= 0) ? arguments[i] : process.cwd();
  7761. // Skip empty and invalid entries
  7762. if (typeof path !== 'string') {
  7763. throw new TypeError('Arguments to path.resolve must be strings');
  7764. } else if (!path) {
  7765. continue;
  7766. }
  7767. resolvedPath = path + '/' + resolvedPath;
  7768. resolvedAbsolute = path.charAt(0) === '/';
  7769. }
  7770. // At this point the path should be resolved to a full absolute path, but
  7771. // handle relative paths to be safe (might happen when process.cwd() fails)
  7772. // Normalize the path
  7773. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  7774. return !!p;
  7775. }), !resolvedAbsolute).join('/');
  7776. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  7777. };
  7778. // path.normalize(path)
  7779. // posix version
  7780. exports.normalize = function(path) {
  7781. var isAbsolute = exports.isAbsolute(path),
  7782. trailingSlash = substr(path, -1) === '/';
  7783. // Normalize the path
  7784. path = normalizeArray(filter(path.split('/'), function(p) {
  7785. return !!p;
  7786. }), !isAbsolute).join('/');
  7787. if (!path && !isAbsolute) {
  7788. path = '.';
  7789. }
  7790. if (path && trailingSlash) {
  7791. path += '/';
  7792. }
  7793. return (isAbsolute ? '/' : '') + path;
  7794. };
  7795. // posix version
  7796. exports.isAbsolute = function(path) {
  7797. return path.charAt(0) === '/';
  7798. };
  7799. // posix version
  7800. exports.join = function() {
  7801. var paths = Array.prototype.slice.call(arguments, 0);
  7802. return exports.normalize(filter(paths, function(p, index) {
  7803. if (typeof p !== 'string') {
  7804. throw new TypeError('Arguments to path.join must be strings');
  7805. }
  7806. return p;
  7807. }).join('/'));
  7808. };
  7809. // path.relative(from, to)
  7810. // posix version
  7811. exports.relative = function(from, to) {
  7812. from = exports.resolve(from).substr(1);
  7813. to = exports.resolve(to).substr(1);
  7814. function trim(arr) {
  7815. var start = 0;
  7816. for (; start < arr.length; start++) {
  7817. if (arr[start] !== '') break;
  7818. }
  7819. var end = arr.length - 1;
  7820. for (; end >= 0; end--) {
  7821. if (arr[end] !== '') break;
  7822. }
  7823. if (start > end) return [];
  7824. return arr.slice(start, end - start + 1);
  7825. }
  7826. var fromParts = trim(from.split('/'));
  7827. var toParts = trim(to.split('/'));
  7828. var length = Math.min(fromParts.length, toParts.length);
  7829. var samePartsLength = length;
  7830. for (var i = 0; i < length; i++) {
  7831. if (fromParts[i] !== toParts[i]) {
  7832. samePartsLength = i;
  7833. break;
  7834. }
  7835. }
  7836. var outputParts = [];
  7837. for (var i = samePartsLength; i < fromParts.length; i++) {
  7838. outputParts.push('..');
  7839. }
  7840. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  7841. return outputParts.join('/');
  7842. };
  7843. exports.sep = '/';
  7844. exports.delimiter = ':';
  7845. exports.dirname = function (path) {
  7846. if (typeof path !== 'string') path = path + '';
  7847. if (path.length === 0) return '.';
  7848. var code = path.charCodeAt(0);
  7849. var hasRoot = code === 47 /*/*/;
  7850. var end = -1;
  7851. var matchedSlash = true;
  7852. for (var i = path.length - 1; i >= 1; --i) {
  7853. code = path.charCodeAt(i);
  7854. if (code === 47 /*/*/) {
  7855. if (!matchedSlash) {
  7856. end = i;
  7857. break;
  7858. }
  7859. } else {
  7860. // We saw the first non-path separator
  7861. matchedSlash = false;
  7862. }
  7863. }
  7864. if (end === -1) return hasRoot ? '/' : '.';
  7865. if (hasRoot && end === 1) {
  7866. // return '//';
  7867. // Backwards-compat fix:
  7868. return '/';
  7869. }
  7870. return path.slice(0, end);
  7871. };
  7872. function basename(path) {
  7873. if (typeof path !== 'string') path = path + '';
  7874. var start = 0;
  7875. var end = -1;
  7876. var matchedSlash = true;
  7877. var i;
  7878. for (i = path.length - 1; i >= 0; --i) {
  7879. if (path.charCodeAt(i) === 47 /*/*/) {
  7880. // If we reached a path separator that was not part of a set of path
  7881. // separators at the end of the string, stop now
  7882. if (!matchedSlash) {
  7883. start = i + 1;
  7884. break;
  7885. }
  7886. } else if (end === -1) {
  7887. // We saw the first non-path separator, mark this as the end of our
  7888. // path component
  7889. matchedSlash = false;
  7890. end = i + 1;
  7891. }
  7892. }
  7893. if (end === -1) return '';
  7894. return path.slice(start, end);
  7895. }
  7896. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  7897. // in new Node.js versions, so only basename() above is backported here
  7898. exports.basename = function (path, ext) {
  7899. var f = basename(path);
  7900. if (ext && f.substr(-1 * ext.length) === ext) {
  7901. f = f.substr(0, f.length - ext.length);
  7902. }
  7903. return f;
  7904. };
  7905. exports.extname = function (path) {
  7906. if (typeof path !== 'string') path = path + '';
  7907. var startDot = -1;
  7908. var startPart = 0;
  7909. var end = -1;
  7910. var matchedSlash = true;
  7911. // Track the state of characters (if any) we see before our first dot and
  7912. // after any path separator we find
  7913. var preDotState = 0;
  7914. for (var i = path.length - 1; i >= 0; --i) {
  7915. var code = path.charCodeAt(i);
  7916. if (code === 47 /*/*/) {
  7917. // If we reached a path separator that was not part of a set of path
  7918. // separators at the end of the string, stop now
  7919. if (!matchedSlash) {
  7920. startPart = i + 1;
  7921. break;
  7922. }
  7923. continue;
  7924. }
  7925. if (end === -1) {
  7926. // We saw the first non-path separator, mark this as the end of our
  7927. // extension
  7928. matchedSlash = false;
  7929. end = i + 1;
  7930. }
  7931. if (code === 46 /*.*/) {
  7932. // If this is our first dot, mark it as the start of our extension
  7933. if (startDot === -1)
  7934. startDot = i;
  7935. else if (preDotState !== 1)
  7936. preDotState = 1;
  7937. } else if (startDot !== -1) {
  7938. // We saw a non-dot and non-path separator before our dot, so we should
  7939. // have a good chance at having a non-empty extension
  7940. preDotState = -1;
  7941. }
  7942. }
  7943. if (startDot === -1 || end === -1 ||
  7944. // We saw a non-dot character immediately before the dot
  7945. preDotState === 0 ||
  7946. // The (right-most) trimmed path component is exactly '..'
  7947. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  7948. return '';
  7949. }
  7950. return path.slice(startDot, end);
  7951. };
  7952. function filter (xs, f) {
  7953. if (xs.filter) return xs.filter(f);
  7954. var res = [];
  7955. for (var i = 0; i < xs.length; i++) {
  7956. if (f(xs[i], i, xs)) res.push(xs[i]);
  7957. }
  7958. return res;
  7959. }
  7960. // String.prototype.substr - negative index don't work in IE8
  7961. var substr = 'ab'.substr(-1) === 'b'
  7962. ? function (str, start, len) { return str.substr(start, len) }
  7963. : function (str, start, len) {
  7964. if (start < 0) start = str.length + start;
  7965. return str.substr(start, len);
  7966. }
  7967. ;
  7968. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 355)))
  7969. /***/ }),
  7970. /***/ 36:
  7971. /*!*******************************************************************!*\
  7972. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  7973. \*******************************************************************/
  7974. /*! no static exports found */
  7975. /***/ (function(module, exports, __webpack_require__) {
  7976. "use strict";
  7977. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  7978. return uni.getSystemInfoSync().platform;
  7979. };
  7980. function sys() {
  7981. return uni.getSystemInfoSync();
  7982. }
  7983. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7984. /***/ }),
  7985. /***/ 37:
  7986. /*!************************************************************************!*\
  7987. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  7988. \************************************************************************/
  7989. /*! no static exports found */
  7990. /***/ (function(module, exports, __webpack_require__) {
  7991. "use strict";
  7992. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  7993. /**
  7994. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  7995. *
  7996. * @param {Function} func 要执行的回调函数
  7997. * @param {Number} wait 延时的时间
  7998. * @param {Boolean} immediate 是否立即执行
  7999. * @return null
  8000. */
  8001. 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;
  8002. // 清除定时器
  8003. if (timeout !== null) clearTimeout(timeout);
  8004. // 立即执行,此类情况一般用不到
  8005. if (immediate) {
  8006. var callNow = !timeout;
  8007. timeout = setTimeout(function () {
  8008. timeout = null;
  8009. }, wait);
  8010. if (callNow) typeof func === 'function' && func();
  8011. } else {
  8012. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  8013. timeout = setTimeout(function () {
  8014. typeof func === 'function' && func();
  8015. }, wait);
  8016. }
  8017. }var _default =
  8018. debounce;exports.default = _default;
  8019. /***/ }),
  8020. /***/ 38:
  8021. /*!************************************************************************!*\
  8022. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  8023. \************************************************************************/
  8024. /*! no static exports found */
  8025. /***/ (function(module, exports, __webpack_require__) {
  8026. "use strict";
  8027. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  8028. var flagArr = [];
  8029. /**
  8030. * 节流函数
  8031. * 节流原理:在一定时间内,只能触发一次
  8032. * @param {Function} fn 要执行的回调函数
  8033. * @param {Number} time 延时的时间
  8034. * @param {Boolean} isImmediate 是否立即执行
  8035. * @param {String} timeoutName 定时器ID
  8036. * @return null
  8037. */
  8038. 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";
  8039. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  8040. if (isImmediate) {
  8041. if (!flagArr[timeoutName]) {
  8042. flagArr[timeoutName] = true;
  8043. // 如果是立即执行,则在time毫秒内开始时执行
  8044. if (typeof fn === 'function') fn();
  8045. timeoutArr[timeoutName] = setTimeout(function () {
  8046. flagArr[timeoutName] = false;
  8047. }, time);
  8048. }
  8049. } else {
  8050. if (!flagArr[timeoutName]) {
  8051. flagArr[timeoutName] = true;
  8052. // 如果是非立即执行,则在time毫秒内的结束处执行
  8053. timeoutArr[timeoutName] = setTimeout(function () {
  8054. flagArr[timeoutName] = false;
  8055. if (typeof fn === 'function') fn();
  8056. }, time);
  8057. }
  8058. }
  8059. };var _default =
  8060. throttle;exports.default = _default;
  8061. /***/ }),
  8062. /***/ 39:
  8063. /*!********************************************************************!*\
  8064. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  8065. \********************************************************************/
  8066. /*! no static exports found */
  8067. /***/ (function(module, exports, __webpack_require__) {
  8068. "use strict";
  8069. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  8070. var version = '1.10.1';var _default =
  8071. {
  8072. v: version,
  8073. version: version,
  8074. // 主题名称
  8075. type: [
  8076. 'primary',
  8077. 'success',
  8078. 'info',
  8079. 'error',
  8080. 'warning'] };exports.default = _default;
  8081. /***/ }),
  8082. /***/ 4:
  8083. /*!******************************************************************************************!*\
  8084. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  8085. \******************************************************************************************/
  8086. /*! exports provided: default */
  8087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8088. "use strict";
  8089. __webpack_require__.r(__webpack_exports__);
  8090. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8091. * Vue.js v2.6.11
  8092. * (c) 2014-2022 Evan You
  8093. * Released under the MIT License.
  8094. */
  8095. /* */
  8096. var emptyObject = Object.freeze({});
  8097. // These helpers produce better VM code in JS engines due to their
  8098. // explicitness and function inlining.
  8099. function isUndef (v) {
  8100. return v === undefined || v === null
  8101. }
  8102. function isDef (v) {
  8103. return v !== undefined && v !== null
  8104. }
  8105. function isTrue (v) {
  8106. return v === true
  8107. }
  8108. function isFalse (v) {
  8109. return v === false
  8110. }
  8111. /**
  8112. * Check if value is primitive.
  8113. */
  8114. function isPrimitive (value) {
  8115. return (
  8116. typeof value === 'string' ||
  8117. typeof value === 'number' ||
  8118. // $flow-disable-line
  8119. typeof value === 'symbol' ||
  8120. typeof value === 'boolean'
  8121. )
  8122. }
  8123. /**
  8124. * Quick object check - this is primarily used to tell
  8125. * Objects from primitive values when we know the value
  8126. * is a JSON-compliant type.
  8127. */
  8128. function isObject (obj) {
  8129. return obj !== null && typeof obj === 'object'
  8130. }
  8131. /**
  8132. * Get the raw type string of a value, e.g., [object Object].
  8133. */
  8134. var _toString = Object.prototype.toString;
  8135. function toRawType (value) {
  8136. return _toString.call(value).slice(8, -1)
  8137. }
  8138. /**
  8139. * Strict object type check. Only returns true
  8140. * for plain JavaScript objects.
  8141. */
  8142. function isPlainObject (obj) {
  8143. return _toString.call(obj) === '[object Object]'
  8144. }
  8145. function isRegExp (v) {
  8146. return _toString.call(v) === '[object RegExp]'
  8147. }
  8148. /**
  8149. * Check if val is a valid array index.
  8150. */
  8151. function isValidArrayIndex (val) {
  8152. var n = parseFloat(String(val));
  8153. return n >= 0 && Math.floor(n) === n && isFinite(val)
  8154. }
  8155. function isPromise (val) {
  8156. return (
  8157. isDef(val) &&
  8158. typeof val.then === 'function' &&
  8159. typeof val.catch === 'function'
  8160. )
  8161. }
  8162. /**
  8163. * Convert a value to a string that is actually rendered.
  8164. */
  8165. function toString (val) {
  8166. return val == null
  8167. ? ''
  8168. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  8169. ? JSON.stringify(val, null, 2)
  8170. : String(val)
  8171. }
  8172. /**
  8173. * Convert an input value to a number for persistence.
  8174. * If the conversion fails, return original string.
  8175. */
  8176. function toNumber (val) {
  8177. var n = parseFloat(val);
  8178. return isNaN(n) ? val : n
  8179. }
  8180. /**
  8181. * Make a map and return a function for checking if a key
  8182. * is in that map.
  8183. */
  8184. function makeMap (
  8185. str,
  8186. expectsLowerCase
  8187. ) {
  8188. var map = Object.create(null);
  8189. var list = str.split(',');
  8190. for (var i = 0; i < list.length; i++) {
  8191. map[list[i]] = true;
  8192. }
  8193. return expectsLowerCase
  8194. ? function (val) { return map[val.toLowerCase()]; }
  8195. : function (val) { return map[val]; }
  8196. }
  8197. /**
  8198. * Check if a tag is a built-in tag.
  8199. */
  8200. var isBuiltInTag = makeMap('slot,component', true);
  8201. /**
  8202. * Check if an attribute is a reserved attribute.
  8203. */
  8204. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  8205. /**
  8206. * Remove an item from an array.
  8207. */
  8208. function remove (arr, item) {
  8209. if (arr.length) {
  8210. var index = arr.indexOf(item);
  8211. if (index > -1) {
  8212. return arr.splice(index, 1)
  8213. }
  8214. }
  8215. }
  8216. /**
  8217. * Check whether an object has the property.
  8218. */
  8219. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8220. function hasOwn (obj, key) {
  8221. return hasOwnProperty.call(obj, key)
  8222. }
  8223. /**
  8224. * Create a cached version of a pure function.
  8225. */
  8226. function cached (fn) {
  8227. var cache = Object.create(null);
  8228. return (function cachedFn (str) {
  8229. var hit = cache[str];
  8230. return hit || (cache[str] = fn(str))
  8231. })
  8232. }
  8233. /**
  8234. * Camelize a hyphen-delimited string.
  8235. */
  8236. var camelizeRE = /-(\w)/g;
  8237. var camelize = cached(function (str) {
  8238. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  8239. });
  8240. /**
  8241. * Capitalize a string.
  8242. */
  8243. var capitalize = cached(function (str) {
  8244. return str.charAt(0).toUpperCase() + str.slice(1)
  8245. });
  8246. /**
  8247. * Hyphenate a camelCase string.
  8248. */
  8249. var hyphenateRE = /\B([A-Z])/g;
  8250. var hyphenate = cached(function (str) {
  8251. return str.replace(hyphenateRE, '-$1').toLowerCase()
  8252. });
  8253. /**
  8254. * Simple bind polyfill for environments that do not support it,
  8255. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  8256. * since native bind is now performant enough in most browsers.
  8257. * But removing it would mean breaking code that was able to run in
  8258. * PhantomJS 1.x, so this must be kept for backward compatibility.
  8259. */
  8260. /* istanbul ignore next */
  8261. function polyfillBind (fn, ctx) {
  8262. function boundFn (a) {
  8263. var l = arguments.length;
  8264. return l
  8265. ? l > 1
  8266. ? fn.apply(ctx, arguments)
  8267. : fn.call(ctx, a)
  8268. : fn.call(ctx)
  8269. }
  8270. boundFn._length = fn.length;
  8271. return boundFn
  8272. }
  8273. function nativeBind (fn, ctx) {
  8274. return fn.bind(ctx)
  8275. }
  8276. var bind = Function.prototype.bind
  8277. ? nativeBind
  8278. : polyfillBind;
  8279. /**
  8280. * Convert an Array-like object to a real Array.
  8281. */
  8282. function toArray (list, start) {
  8283. start = start || 0;
  8284. var i = list.length - start;
  8285. var ret = new Array(i);
  8286. while (i--) {
  8287. ret[i] = list[i + start];
  8288. }
  8289. return ret
  8290. }
  8291. /**
  8292. * Mix properties into target object.
  8293. */
  8294. function extend (to, _from) {
  8295. for (var key in _from) {
  8296. to[key] = _from[key];
  8297. }
  8298. return to
  8299. }
  8300. /**
  8301. * Merge an Array of Objects into a single Object.
  8302. */
  8303. function toObject (arr) {
  8304. var res = {};
  8305. for (var i = 0; i < arr.length; i++) {
  8306. if (arr[i]) {
  8307. extend(res, arr[i]);
  8308. }
  8309. }
  8310. return res
  8311. }
  8312. /* eslint-disable no-unused-vars */
  8313. /**
  8314. * Perform no operation.
  8315. * Stubbing args to make Flow happy without leaving useless transpiled code
  8316. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  8317. */
  8318. function noop (a, b, c) {}
  8319. /**
  8320. * Always return false.
  8321. */
  8322. var no = function (a, b, c) { return false; };
  8323. /* eslint-enable no-unused-vars */
  8324. /**
  8325. * Return the same value.
  8326. */
  8327. var identity = function (_) { return _; };
  8328. /**
  8329. * Check if two values are loosely equal - that is,
  8330. * if they are plain objects, do they have the same shape?
  8331. */
  8332. function looseEqual (a, b) {
  8333. if (a === b) { return true }
  8334. var isObjectA = isObject(a);
  8335. var isObjectB = isObject(b);
  8336. if (isObjectA && isObjectB) {
  8337. try {
  8338. var isArrayA = Array.isArray(a);
  8339. var isArrayB = Array.isArray(b);
  8340. if (isArrayA && isArrayB) {
  8341. return a.length === b.length && a.every(function (e, i) {
  8342. return looseEqual(e, b[i])
  8343. })
  8344. } else if (a instanceof Date && b instanceof Date) {
  8345. return a.getTime() === b.getTime()
  8346. } else if (!isArrayA && !isArrayB) {
  8347. var keysA = Object.keys(a);
  8348. var keysB = Object.keys(b);
  8349. return keysA.length === keysB.length && keysA.every(function (key) {
  8350. return looseEqual(a[key], b[key])
  8351. })
  8352. } else {
  8353. /* istanbul ignore next */
  8354. return false
  8355. }
  8356. } catch (e) {
  8357. /* istanbul ignore next */
  8358. return false
  8359. }
  8360. } else if (!isObjectA && !isObjectB) {
  8361. return String(a) === String(b)
  8362. } else {
  8363. return false
  8364. }
  8365. }
  8366. /**
  8367. * Return the first index at which a loosely equal value can be
  8368. * found in the array (if value is a plain object, the array must
  8369. * contain an object of the same shape), or -1 if it is not present.
  8370. */
  8371. function looseIndexOf (arr, val) {
  8372. for (var i = 0; i < arr.length; i++) {
  8373. if (looseEqual(arr[i], val)) { return i }
  8374. }
  8375. return -1
  8376. }
  8377. /**
  8378. * Ensure a function is called only once.
  8379. */
  8380. function once (fn) {
  8381. var called = false;
  8382. return function () {
  8383. if (!called) {
  8384. called = true;
  8385. fn.apply(this, arguments);
  8386. }
  8387. }
  8388. }
  8389. var ASSET_TYPES = [
  8390. 'component',
  8391. 'directive',
  8392. 'filter'
  8393. ];
  8394. var LIFECYCLE_HOOKS = [
  8395. 'beforeCreate',
  8396. 'created',
  8397. 'beforeMount',
  8398. 'mounted',
  8399. 'beforeUpdate',
  8400. 'updated',
  8401. 'beforeDestroy',
  8402. 'destroyed',
  8403. 'activated',
  8404. 'deactivated',
  8405. 'errorCaptured',
  8406. 'serverPrefetch'
  8407. ];
  8408. /* */
  8409. var config = ({
  8410. /**
  8411. * Option merge strategies (used in core/util/options)
  8412. */
  8413. // $flow-disable-line
  8414. optionMergeStrategies: Object.create(null),
  8415. /**
  8416. * Whether to suppress warnings.
  8417. */
  8418. silent: false,
  8419. /**
  8420. * Show production mode tip message on boot?
  8421. */
  8422. productionTip: "development" !== 'production',
  8423. /**
  8424. * Whether to enable devtools
  8425. */
  8426. devtools: "development" !== 'production',
  8427. /**
  8428. * Whether to record perf
  8429. */
  8430. performance: false,
  8431. /**
  8432. * Error handler for watcher errors
  8433. */
  8434. errorHandler: null,
  8435. /**
  8436. * Warn handler for watcher warns
  8437. */
  8438. warnHandler: null,
  8439. /**
  8440. * Ignore certain custom elements
  8441. */
  8442. ignoredElements: [],
  8443. /**
  8444. * Custom user key aliases for v-on
  8445. */
  8446. // $flow-disable-line
  8447. keyCodes: Object.create(null),
  8448. /**
  8449. * Check if a tag is reserved so that it cannot be registered as a
  8450. * component. This is platform-dependent and may be overwritten.
  8451. */
  8452. isReservedTag: no,
  8453. /**
  8454. * Check if an attribute is reserved so that it cannot be used as a component
  8455. * prop. This is platform-dependent and may be overwritten.
  8456. */
  8457. isReservedAttr: no,
  8458. /**
  8459. * Check if a tag is an unknown element.
  8460. * Platform-dependent.
  8461. */
  8462. isUnknownElement: no,
  8463. /**
  8464. * Get the namespace of an element
  8465. */
  8466. getTagNamespace: noop,
  8467. /**
  8468. * Parse the real tag name for the specific platform.
  8469. */
  8470. parsePlatformTagName: identity,
  8471. /**
  8472. * Check if an attribute must be bound using property, e.g. value
  8473. * Platform-dependent.
  8474. */
  8475. mustUseProp: no,
  8476. /**
  8477. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  8478. * This will significantly reduce performance if set to false.
  8479. */
  8480. async: true,
  8481. /**
  8482. * Exposed for legacy reasons
  8483. */
  8484. _lifecycleHooks: LIFECYCLE_HOOKS
  8485. });
  8486. /* */
  8487. /**
  8488. * unicode letters used for parsing html tags, component names and property paths.
  8489. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  8490. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  8491. */
  8492. 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/;
  8493. /**
  8494. * Check if a string starts with $ or _
  8495. */
  8496. function isReserved (str) {
  8497. var c = (str + '').charCodeAt(0);
  8498. return c === 0x24 || c === 0x5F
  8499. }
  8500. /**
  8501. * Define a property.
  8502. */
  8503. function def (obj, key, val, enumerable) {
  8504. Object.defineProperty(obj, key, {
  8505. value: val,
  8506. enumerable: !!enumerable,
  8507. writable: true,
  8508. configurable: true
  8509. });
  8510. }
  8511. /**
  8512. * Parse simple path.
  8513. */
  8514. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  8515. function parsePath (path) {
  8516. if (bailRE.test(path)) {
  8517. return
  8518. }
  8519. var segments = path.split('.');
  8520. return function (obj) {
  8521. for (var i = 0; i < segments.length; i++) {
  8522. if (!obj) { return }
  8523. obj = obj[segments[i]];
  8524. }
  8525. return obj
  8526. }
  8527. }
  8528. /* */
  8529. // can we use __proto__?
  8530. var hasProto = '__proto__' in {};
  8531. // Browser environment sniffing
  8532. var inBrowser = typeof window !== 'undefined';
  8533. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  8534. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  8535. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  8536. var isIE = UA && /msie|trident/.test(UA);
  8537. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  8538. var isEdge = UA && UA.indexOf('edge/') > 0;
  8539. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  8540. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  8541. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  8542. var isPhantomJS = UA && /phantomjs/.test(UA);
  8543. var isFF = UA && UA.match(/firefox\/(\d+)/);
  8544. // Firefox has a "watch" function on Object.prototype...
  8545. var nativeWatch = ({}).watch;
  8546. if (inBrowser) {
  8547. try {
  8548. var opts = {};
  8549. Object.defineProperty(opts, 'passive', ({
  8550. get: function get () {
  8551. }
  8552. })); // https://github.com/facebook/flow/issues/285
  8553. window.addEventListener('test-passive', null, opts);
  8554. } catch (e) {}
  8555. }
  8556. // this needs to be lazy-evaled because vue may be required before
  8557. // vue-server-renderer can set VUE_ENV
  8558. var _isServer;
  8559. var isServerRendering = function () {
  8560. if (_isServer === undefined) {
  8561. /* istanbul ignore if */
  8562. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  8563. // detect presence of vue-server-renderer and avoid
  8564. // Webpack shimming the process
  8565. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  8566. } else {
  8567. _isServer = false;
  8568. }
  8569. }
  8570. return _isServer
  8571. };
  8572. // detect devtools
  8573. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8574. /* istanbul ignore next */
  8575. function isNative (Ctor) {
  8576. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  8577. }
  8578. var hasSymbol =
  8579. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  8580. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  8581. var _Set;
  8582. /* istanbul ignore if */ // $flow-disable-line
  8583. if (typeof Set !== 'undefined' && isNative(Set)) {
  8584. // use native Set when available.
  8585. _Set = Set;
  8586. } else {
  8587. // a non-standard Set polyfill that only works with primitive keys.
  8588. _Set = /*@__PURE__*/(function () {
  8589. function Set () {
  8590. this.set = Object.create(null);
  8591. }
  8592. Set.prototype.has = function has (key) {
  8593. return this.set[key] === true
  8594. };
  8595. Set.prototype.add = function add (key) {
  8596. this.set[key] = true;
  8597. };
  8598. Set.prototype.clear = function clear () {
  8599. this.set = Object.create(null);
  8600. };
  8601. return Set;
  8602. }());
  8603. }
  8604. /* */
  8605. var warn = noop;
  8606. var tip = noop;
  8607. var generateComponentTrace = (noop); // work around flow check
  8608. var formatComponentName = (noop);
  8609. if (true) {
  8610. var hasConsole = typeof console !== 'undefined';
  8611. var classifyRE = /(?:^|[-_])(\w)/g;
  8612. var classify = function (str) { return str
  8613. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  8614. .replace(/[-_]/g, ''); };
  8615. warn = function (msg, vm) {
  8616. var trace = vm ? generateComponentTrace(vm) : '';
  8617. if (config.warnHandler) {
  8618. config.warnHandler.call(null, msg, vm, trace);
  8619. } else if (hasConsole && (!config.silent)) {
  8620. console.error(("[Vue warn]: " + msg + trace));
  8621. }
  8622. };
  8623. tip = function (msg, vm) {
  8624. if (hasConsole && (!config.silent)) {
  8625. console.warn("[Vue tip]: " + msg + (
  8626. vm ? generateComponentTrace(vm) : ''
  8627. ));
  8628. }
  8629. };
  8630. formatComponentName = function (vm, includeFile) {
  8631. if (vm.$root === vm) {
  8632. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  8633. return ('') + vm.$options.__file
  8634. }
  8635. return '<Root>'
  8636. }
  8637. var options = typeof vm === 'function' && vm.cid != null
  8638. ? vm.options
  8639. : vm._isVue
  8640. ? vm.$options || vm.constructor.options
  8641. : vm;
  8642. var name = options.name || options._componentTag;
  8643. var file = options.__file;
  8644. if (!name && file) {
  8645. var match = file.match(/([^/\\]+)\.vue$/);
  8646. name = match && match[1];
  8647. }
  8648. return (
  8649. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  8650. (file && includeFile !== false ? (" at " + file) : '')
  8651. )
  8652. };
  8653. var repeat = function (str, n) {
  8654. var res = '';
  8655. while (n) {
  8656. if (n % 2 === 1) { res += str; }
  8657. if (n > 1) { str += str; }
  8658. n >>= 1;
  8659. }
  8660. return res
  8661. };
  8662. generateComponentTrace = function (vm) {
  8663. if (vm._isVue && vm.$parent) {
  8664. var tree = [];
  8665. var currentRecursiveSequence = 0;
  8666. while (vm && vm.$options.name !== 'PageBody') {
  8667. if (tree.length > 0) {
  8668. var last = tree[tree.length - 1];
  8669. if (last.constructor === vm.constructor) {
  8670. currentRecursiveSequence++;
  8671. vm = vm.$parent;
  8672. continue
  8673. } else if (currentRecursiveSequence > 0) {
  8674. tree[tree.length - 1] = [last, currentRecursiveSequence];
  8675. currentRecursiveSequence = 0;
  8676. }
  8677. }
  8678. !vm.$options.isReserved && tree.push(vm);
  8679. vm = vm.$parent;
  8680. }
  8681. return '\n\nfound in\n\n' + tree
  8682. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  8683. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  8684. : formatComponentName(vm))); })
  8685. .join('\n')
  8686. } else {
  8687. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  8688. }
  8689. };
  8690. }
  8691. /* */
  8692. var uid = 0;
  8693. /**
  8694. * A dep is an observable that can have multiple
  8695. * directives subscribing to it.
  8696. */
  8697. var Dep = function Dep () {
  8698. this.id = uid++;
  8699. this.subs = [];
  8700. };
  8701. Dep.prototype.addSub = function addSub (sub) {
  8702. this.subs.push(sub);
  8703. };
  8704. Dep.prototype.removeSub = function removeSub (sub) {
  8705. remove(this.subs, sub);
  8706. };
  8707. Dep.prototype.depend = function depend () {
  8708. if (Dep.SharedObject.target) {
  8709. Dep.SharedObject.target.addDep(this);
  8710. }
  8711. };
  8712. Dep.prototype.notify = function notify () {
  8713. // stabilize the subscriber list first
  8714. var subs = this.subs.slice();
  8715. if ( true && !config.async) {
  8716. // subs aren't sorted in scheduler if not running async
  8717. // we need to sort them now to make sure they fire in correct
  8718. // order
  8719. subs.sort(function (a, b) { return a.id - b.id; });
  8720. }
  8721. for (var i = 0, l = subs.length; i < l; i++) {
  8722. subs[i].update();
  8723. }
  8724. };
  8725. // The current target watcher being evaluated.
  8726. // This is globally unique because only one watcher
  8727. // can be evaluated at a time.
  8728. // fixed by xxxxxx (nvue shared vuex)
  8729. /* eslint-disable no-undef */
  8730. Dep.SharedObject = {};
  8731. Dep.SharedObject.target = null;
  8732. Dep.SharedObject.targetStack = [];
  8733. function pushTarget (target) {
  8734. Dep.SharedObject.targetStack.push(target);
  8735. Dep.SharedObject.target = target;
  8736. Dep.target = target;
  8737. }
  8738. function popTarget () {
  8739. Dep.SharedObject.targetStack.pop();
  8740. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  8741. Dep.target = Dep.SharedObject.target;
  8742. }
  8743. /* */
  8744. var VNode = function VNode (
  8745. tag,
  8746. data,
  8747. children,
  8748. text,
  8749. elm,
  8750. context,
  8751. componentOptions,
  8752. asyncFactory
  8753. ) {
  8754. this.tag = tag;
  8755. this.data = data;
  8756. this.children = children;
  8757. this.text = text;
  8758. this.elm = elm;
  8759. this.ns = undefined;
  8760. this.context = context;
  8761. this.fnContext = undefined;
  8762. this.fnOptions = undefined;
  8763. this.fnScopeId = undefined;
  8764. this.key = data && data.key;
  8765. this.componentOptions = componentOptions;
  8766. this.componentInstance = undefined;
  8767. this.parent = undefined;
  8768. this.raw = false;
  8769. this.isStatic = false;
  8770. this.isRootInsert = true;
  8771. this.isComment = false;
  8772. this.isCloned = false;
  8773. this.isOnce = false;
  8774. this.asyncFactory = asyncFactory;
  8775. this.asyncMeta = undefined;
  8776. this.isAsyncPlaceholder = false;
  8777. };
  8778. var prototypeAccessors = { child: { configurable: true } };
  8779. // DEPRECATED: alias for componentInstance for backwards compat.
  8780. /* istanbul ignore next */
  8781. prototypeAccessors.child.get = function () {
  8782. return this.componentInstance
  8783. };
  8784. Object.defineProperties( VNode.prototype, prototypeAccessors );
  8785. var createEmptyVNode = function (text) {
  8786. if ( text === void 0 ) text = '';
  8787. var node = new VNode();
  8788. node.text = text;
  8789. node.isComment = true;
  8790. return node
  8791. };
  8792. function createTextVNode (val) {
  8793. return new VNode(undefined, undefined, undefined, String(val))
  8794. }
  8795. // optimized shallow clone
  8796. // used for static nodes and slot nodes because they may be reused across
  8797. // multiple renders, cloning them avoids errors when DOM manipulations rely
  8798. // on their elm reference.
  8799. function cloneVNode (vnode) {
  8800. var cloned = new VNode(
  8801. vnode.tag,
  8802. vnode.data,
  8803. // #7975
  8804. // clone children array to avoid mutating original in case of cloning
  8805. // a child.
  8806. vnode.children && vnode.children.slice(),
  8807. vnode.text,
  8808. vnode.elm,
  8809. vnode.context,
  8810. vnode.componentOptions,
  8811. vnode.asyncFactory
  8812. );
  8813. cloned.ns = vnode.ns;
  8814. cloned.isStatic = vnode.isStatic;
  8815. cloned.key = vnode.key;
  8816. cloned.isComment = vnode.isComment;
  8817. cloned.fnContext = vnode.fnContext;
  8818. cloned.fnOptions = vnode.fnOptions;
  8819. cloned.fnScopeId = vnode.fnScopeId;
  8820. cloned.asyncMeta = vnode.asyncMeta;
  8821. cloned.isCloned = true;
  8822. return cloned
  8823. }
  8824. /*
  8825. * not type checking this file because flow doesn't play well with
  8826. * dynamically accessing methods on Array prototype
  8827. */
  8828. var arrayProto = Array.prototype;
  8829. var arrayMethods = Object.create(arrayProto);
  8830. var methodsToPatch = [
  8831. 'push',
  8832. 'pop',
  8833. 'shift',
  8834. 'unshift',
  8835. 'splice',
  8836. 'sort',
  8837. 'reverse'
  8838. ];
  8839. /**
  8840. * Intercept mutating methods and emit events
  8841. */
  8842. methodsToPatch.forEach(function (method) {
  8843. // cache original method
  8844. var original = arrayProto[method];
  8845. def(arrayMethods, method, function mutator () {
  8846. var args = [], len = arguments.length;
  8847. while ( len-- ) args[ len ] = arguments[ len ];
  8848. var result = original.apply(this, args);
  8849. var ob = this.__ob__;
  8850. var inserted;
  8851. switch (method) {
  8852. case 'push':
  8853. case 'unshift':
  8854. inserted = args;
  8855. break
  8856. case 'splice':
  8857. inserted = args.slice(2);
  8858. break
  8859. }
  8860. if (inserted) { ob.observeArray(inserted); }
  8861. // notify change
  8862. ob.dep.notify();
  8863. return result
  8864. });
  8865. });
  8866. /* */
  8867. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  8868. /**
  8869. * In some cases we may want to disable observation inside a component's
  8870. * update computation.
  8871. */
  8872. var shouldObserve = true;
  8873. function toggleObserving (value) {
  8874. shouldObserve = value;
  8875. }
  8876. /**
  8877. * Observer class that is attached to each observed
  8878. * object. Once attached, the observer converts the target
  8879. * object's property keys into getter/setters that
  8880. * collect dependencies and dispatch updates.
  8881. */
  8882. var Observer = function Observer (value) {
  8883. this.value = value;
  8884. this.dep = new Dep();
  8885. this.vmCount = 0;
  8886. def(value, '__ob__', this);
  8887. if (Array.isArray(value)) {
  8888. if (hasProto) {
  8889. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  8890. if(value.push !== value.__proto__.push){
  8891. copyAugment(value, arrayMethods, arrayKeys);
  8892. } else {
  8893. protoAugment(value, arrayMethods);
  8894. }
  8895. }
  8896. } else {
  8897. copyAugment(value, arrayMethods, arrayKeys);
  8898. }
  8899. this.observeArray(value);
  8900. } else {
  8901. this.walk(value);
  8902. }
  8903. };
  8904. /**
  8905. * Walk through all properties and convert them into
  8906. * getter/setters. This method should only be called when
  8907. * value type is Object.
  8908. */
  8909. Observer.prototype.walk = function walk (obj) {
  8910. var keys = Object.keys(obj);
  8911. for (var i = 0; i < keys.length; i++) {
  8912. defineReactive$$1(obj, keys[i]);
  8913. }
  8914. };
  8915. /**
  8916. * Observe a list of Array items.
  8917. */
  8918. Observer.prototype.observeArray = function observeArray (items) {
  8919. for (var i = 0, l = items.length; i < l; i++) {
  8920. observe(items[i]);
  8921. }
  8922. };
  8923. // helpers
  8924. /**
  8925. * Augment a target Object or Array by intercepting
  8926. * the prototype chain using __proto__
  8927. */
  8928. function protoAugment (target, src) {
  8929. /* eslint-disable no-proto */
  8930. target.__proto__ = src;
  8931. /* eslint-enable no-proto */
  8932. }
  8933. /**
  8934. * Augment a target Object or Array by defining
  8935. * hidden properties.
  8936. */
  8937. /* istanbul ignore next */
  8938. function copyAugment (target, src, keys) {
  8939. for (var i = 0, l = keys.length; i < l; i++) {
  8940. var key = keys[i];
  8941. def(target, key, src[key]);
  8942. }
  8943. }
  8944. /**
  8945. * Attempt to create an observer instance for a value,
  8946. * returns the new observer if successfully observed,
  8947. * or the existing observer if the value already has one.
  8948. */
  8949. function observe (value, asRootData) {
  8950. if (!isObject(value) || value instanceof VNode) {
  8951. return
  8952. }
  8953. var ob;
  8954. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  8955. ob = value.__ob__;
  8956. } else if (
  8957. shouldObserve &&
  8958. !isServerRendering() &&
  8959. (Array.isArray(value) || isPlainObject(value)) &&
  8960. Object.isExtensible(value) &&
  8961. !value._isVue
  8962. ) {
  8963. ob = new Observer(value);
  8964. }
  8965. if (asRootData && ob) {
  8966. ob.vmCount++;
  8967. }
  8968. return ob
  8969. }
  8970. /**
  8971. * Define a reactive property on an Object.
  8972. */
  8973. function defineReactive$$1 (
  8974. obj,
  8975. key,
  8976. val,
  8977. customSetter,
  8978. shallow
  8979. ) {
  8980. var dep = new Dep();
  8981. var property = Object.getOwnPropertyDescriptor(obj, key);
  8982. if (property && property.configurable === false) {
  8983. return
  8984. }
  8985. // cater for pre-defined getter/setters
  8986. var getter = property && property.get;
  8987. var setter = property && property.set;
  8988. if ((!getter || setter) && arguments.length === 2) {
  8989. val = obj[key];
  8990. }
  8991. var childOb = !shallow && observe(val);
  8992. Object.defineProperty(obj, key, {
  8993. enumerable: true,
  8994. configurable: true,
  8995. get: function reactiveGetter () {
  8996. var value = getter ? getter.call(obj) : val;
  8997. if (Dep.SharedObject.target) { // fixed by xxxxxx
  8998. dep.depend();
  8999. if (childOb) {
  9000. childOb.dep.depend();
  9001. if (Array.isArray(value)) {
  9002. dependArray(value);
  9003. }
  9004. }
  9005. }
  9006. return value
  9007. },
  9008. set: function reactiveSetter (newVal) {
  9009. var value = getter ? getter.call(obj) : val;
  9010. /* eslint-disable no-self-compare */
  9011. if (newVal === value || (newVal !== newVal && value !== value)) {
  9012. return
  9013. }
  9014. /* eslint-enable no-self-compare */
  9015. if ( true && customSetter) {
  9016. customSetter();
  9017. }
  9018. // #7981: for accessor properties without setter
  9019. if (getter && !setter) { return }
  9020. if (setter) {
  9021. setter.call(obj, newVal);
  9022. } else {
  9023. val = newVal;
  9024. }
  9025. childOb = !shallow && observe(newVal);
  9026. dep.notify();
  9027. }
  9028. });
  9029. }
  9030. /**
  9031. * Set a property on an object. Adds the new property and
  9032. * triggers change notification if the property doesn't
  9033. * already exist.
  9034. */
  9035. function set (target, key, val) {
  9036. if ( true &&
  9037. (isUndef(target) || isPrimitive(target))
  9038. ) {
  9039. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  9040. }
  9041. if (Array.isArray(target) && isValidArrayIndex(key)) {
  9042. target.length = Math.max(target.length, key);
  9043. target.splice(key, 1, val);
  9044. return val
  9045. }
  9046. if (key in target && !(key in Object.prototype)) {
  9047. target[key] = val;
  9048. return val
  9049. }
  9050. var ob = (target).__ob__;
  9051. if (target._isVue || (ob && ob.vmCount)) {
  9052. true && warn(
  9053. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  9054. 'at runtime - declare it upfront in the data option.'
  9055. );
  9056. return val
  9057. }
  9058. if (!ob) {
  9059. target[key] = val;
  9060. return val
  9061. }
  9062. defineReactive$$1(ob.value, key, val);
  9063. ob.dep.notify();
  9064. return val
  9065. }
  9066. /**
  9067. * Delete a property and trigger change if necessary.
  9068. */
  9069. function del (target, key) {
  9070. if ( true &&
  9071. (isUndef(target) || isPrimitive(target))
  9072. ) {
  9073. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  9074. }
  9075. if (Array.isArray(target) && isValidArrayIndex(key)) {
  9076. target.splice(key, 1);
  9077. return
  9078. }
  9079. var ob = (target).__ob__;
  9080. if (target._isVue || (ob && ob.vmCount)) {
  9081. true && warn(
  9082. 'Avoid deleting properties on a Vue instance or its root $data ' +
  9083. '- just set it to null.'
  9084. );
  9085. return
  9086. }
  9087. if (!hasOwn(target, key)) {
  9088. return
  9089. }
  9090. delete target[key];
  9091. if (!ob) {
  9092. return
  9093. }
  9094. ob.dep.notify();
  9095. }
  9096. /**
  9097. * Collect dependencies on array elements when the array is touched, since
  9098. * we cannot intercept array element access like property getters.
  9099. */
  9100. function dependArray (value) {
  9101. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  9102. e = value[i];
  9103. e && e.__ob__ && e.__ob__.dep.depend();
  9104. if (Array.isArray(e)) {
  9105. dependArray(e);
  9106. }
  9107. }
  9108. }
  9109. /* */
  9110. /**
  9111. * Option overwriting strategies are functions that handle
  9112. * how to merge a parent option value and a child option
  9113. * value into the final value.
  9114. */
  9115. var strats = config.optionMergeStrategies;
  9116. /**
  9117. * Options with restrictions
  9118. */
  9119. if (true) {
  9120. strats.el = strats.propsData = function (parent, child, vm, key) {
  9121. if (!vm) {
  9122. warn(
  9123. "option \"" + key + "\" can only be used during instance " +
  9124. 'creation with the `new` keyword.'
  9125. );
  9126. }
  9127. return defaultStrat(parent, child)
  9128. };
  9129. }
  9130. /**
  9131. * Helper that recursively merges two data objects together.
  9132. */
  9133. function mergeData (to, from) {
  9134. if (!from) { return to }
  9135. var key, toVal, fromVal;
  9136. var keys = hasSymbol
  9137. ? Reflect.ownKeys(from)
  9138. : Object.keys(from);
  9139. for (var i = 0; i < keys.length; i++) {
  9140. key = keys[i];
  9141. // in case the object is already observed...
  9142. if (key === '__ob__') { continue }
  9143. toVal = to[key];
  9144. fromVal = from[key];
  9145. if (!hasOwn(to, key)) {
  9146. set(to, key, fromVal);
  9147. } else if (
  9148. toVal !== fromVal &&
  9149. isPlainObject(toVal) &&
  9150. isPlainObject(fromVal)
  9151. ) {
  9152. mergeData(toVal, fromVal);
  9153. }
  9154. }
  9155. return to
  9156. }
  9157. /**
  9158. * Data
  9159. */
  9160. function mergeDataOrFn (
  9161. parentVal,
  9162. childVal,
  9163. vm
  9164. ) {
  9165. if (!vm) {
  9166. // in a Vue.extend merge, both should be functions
  9167. if (!childVal) {
  9168. return parentVal
  9169. }
  9170. if (!parentVal) {
  9171. return childVal
  9172. }
  9173. // when parentVal & childVal are both present,
  9174. // we need to return a function that returns the
  9175. // merged result of both functions... no need to
  9176. // check if parentVal is a function here because
  9177. // it has to be a function to pass previous merges.
  9178. return function mergedDataFn () {
  9179. return mergeData(
  9180. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  9181. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  9182. )
  9183. }
  9184. } else {
  9185. return function mergedInstanceDataFn () {
  9186. // instance merge
  9187. var instanceData = typeof childVal === 'function'
  9188. ? childVal.call(vm, vm)
  9189. : childVal;
  9190. var defaultData = typeof parentVal === 'function'
  9191. ? parentVal.call(vm, vm)
  9192. : parentVal;
  9193. if (instanceData) {
  9194. return mergeData(instanceData, defaultData)
  9195. } else {
  9196. return defaultData
  9197. }
  9198. }
  9199. }
  9200. }
  9201. strats.data = function (
  9202. parentVal,
  9203. childVal,
  9204. vm
  9205. ) {
  9206. if (!vm) {
  9207. if (childVal && typeof childVal !== 'function') {
  9208. true && warn(
  9209. 'The "data" option should be a function ' +
  9210. 'that returns a per-instance value in component ' +
  9211. 'definitions.',
  9212. vm
  9213. );
  9214. return parentVal
  9215. }
  9216. return mergeDataOrFn(parentVal, childVal)
  9217. }
  9218. return mergeDataOrFn(parentVal, childVal, vm)
  9219. };
  9220. /**
  9221. * Hooks and props are merged as arrays.
  9222. */
  9223. function mergeHook (
  9224. parentVal,
  9225. childVal
  9226. ) {
  9227. var res = childVal
  9228. ? parentVal
  9229. ? parentVal.concat(childVal)
  9230. : Array.isArray(childVal)
  9231. ? childVal
  9232. : [childVal]
  9233. : parentVal;
  9234. return res
  9235. ? dedupeHooks(res)
  9236. : res
  9237. }
  9238. function dedupeHooks (hooks) {
  9239. var res = [];
  9240. for (var i = 0; i < hooks.length; i++) {
  9241. if (res.indexOf(hooks[i]) === -1) {
  9242. res.push(hooks[i]);
  9243. }
  9244. }
  9245. return res
  9246. }
  9247. LIFECYCLE_HOOKS.forEach(function (hook) {
  9248. strats[hook] = mergeHook;
  9249. });
  9250. /**
  9251. * Assets
  9252. *
  9253. * When a vm is present (instance creation), we need to do
  9254. * a three-way merge between constructor options, instance
  9255. * options and parent options.
  9256. */
  9257. function mergeAssets (
  9258. parentVal,
  9259. childVal,
  9260. vm,
  9261. key
  9262. ) {
  9263. var res = Object.create(parentVal || null);
  9264. if (childVal) {
  9265. true && assertObjectType(key, childVal, vm);
  9266. return extend(res, childVal)
  9267. } else {
  9268. return res
  9269. }
  9270. }
  9271. ASSET_TYPES.forEach(function (type) {
  9272. strats[type + 's'] = mergeAssets;
  9273. });
  9274. /**
  9275. * Watchers.
  9276. *
  9277. * Watchers hashes should not overwrite one
  9278. * another, so we merge them as arrays.
  9279. */
  9280. strats.watch = function (
  9281. parentVal,
  9282. childVal,
  9283. vm,
  9284. key
  9285. ) {
  9286. // work around Firefox's Object.prototype.watch...
  9287. if (parentVal === nativeWatch) { parentVal = undefined; }
  9288. if (childVal === nativeWatch) { childVal = undefined; }
  9289. /* istanbul ignore if */
  9290. if (!childVal) { return Object.create(parentVal || null) }
  9291. if (true) {
  9292. assertObjectType(key, childVal, vm);
  9293. }
  9294. if (!parentVal) { return childVal }
  9295. var ret = {};
  9296. extend(ret, parentVal);
  9297. for (var key$1 in childVal) {
  9298. var parent = ret[key$1];
  9299. var child = childVal[key$1];
  9300. if (parent && !Array.isArray(parent)) {
  9301. parent = [parent];
  9302. }
  9303. ret[key$1] = parent
  9304. ? parent.concat(child)
  9305. : Array.isArray(child) ? child : [child];
  9306. }
  9307. return ret
  9308. };
  9309. /**
  9310. * Other object hashes.
  9311. */
  9312. strats.props =
  9313. strats.methods =
  9314. strats.inject =
  9315. strats.computed = function (
  9316. parentVal,
  9317. childVal,
  9318. vm,
  9319. key
  9320. ) {
  9321. if (childVal && "development" !== 'production') {
  9322. assertObjectType(key, childVal, vm);
  9323. }
  9324. if (!parentVal) { return childVal }
  9325. var ret = Object.create(null);
  9326. extend(ret, parentVal);
  9327. if (childVal) { extend(ret, childVal); }
  9328. return ret
  9329. };
  9330. strats.provide = mergeDataOrFn;
  9331. /**
  9332. * Default strategy.
  9333. */
  9334. var defaultStrat = function (parentVal, childVal) {
  9335. return childVal === undefined
  9336. ? parentVal
  9337. : childVal
  9338. };
  9339. /**
  9340. * Validate component names
  9341. */
  9342. function checkComponents (options) {
  9343. for (var key in options.components) {
  9344. validateComponentName(key);
  9345. }
  9346. }
  9347. function validateComponentName (name) {
  9348. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  9349. warn(
  9350. 'Invalid component name: "' + name + '". Component names ' +
  9351. 'should conform to valid custom element name in html5 specification.'
  9352. );
  9353. }
  9354. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  9355. warn(
  9356. 'Do not use built-in or reserved HTML elements as component ' +
  9357. 'id: ' + name
  9358. );
  9359. }
  9360. }
  9361. /**
  9362. * Ensure all props option syntax are normalized into the
  9363. * Object-based format.
  9364. */
  9365. function normalizeProps (options, vm) {
  9366. var props = options.props;
  9367. if (!props) { return }
  9368. var res = {};
  9369. var i, val, name;
  9370. if (Array.isArray(props)) {
  9371. i = props.length;
  9372. while (i--) {
  9373. val = props[i];
  9374. if (typeof val === 'string') {
  9375. name = camelize(val);
  9376. res[name] = { type: null };
  9377. } else if (true) {
  9378. warn('props must be strings when using array syntax.');
  9379. }
  9380. }
  9381. } else if (isPlainObject(props)) {
  9382. for (var key in props) {
  9383. val = props[key];
  9384. name = camelize(key);
  9385. res[name] = isPlainObject(val)
  9386. ? val
  9387. : { type: val };
  9388. }
  9389. } else if (true) {
  9390. warn(
  9391. "Invalid value for option \"props\": expected an Array or an Object, " +
  9392. "but got " + (toRawType(props)) + ".",
  9393. vm
  9394. );
  9395. }
  9396. options.props = res;
  9397. }
  9398. /**
  9399. * Normalize all injections into Object-based format
  9400. */
  9401. function normalizeInject (options, vm) {
  9402. var inject = options.inject;
  9403. if (!inject) { return }
  9404. var normalized = options.inject = {};
  9405. if (Array.isArray(inject)) {
  9406. for (var i = 0; i < inject.length; i++) {
  9407. normalized[inject[i]] = { from: inject[i] };
  9408. }
  9409. } else if (isPlainObject(inject)) {
  9410. for (var key in inject) {
  9411. var val = inject[key];
  9412. normalized[key] = isPlainObject(val)
  9413. ? extend({ from: key }, val)
  9414. : { from: val };
  9415. }
  9416. } else if (true) {
  9417. warn(
  9418. "Invalid value for option \"inject\": expected an Array or an Object, " +
  9419. "but got " + (toRawType(inject)) + ".",
  9420. vm
  9421. );
  9422. }
  9423. }
  9424. /**
  9425. * Normalize raw function directives into object format.
  9426. */
  9427. function normalizeDirectives (options) {
  9428. var dirs = options.directives;
  9429. if (dirs) {
  9430. for (var key in dirs) {
  9431. var def$$1 = dirs[key];
  9432. if (typeof def$$1 === 'function') {
  9433. dirs[key] = { bind: def$$1, update: def$$1 };
  9434. }
  9435. }
  9436. }
  9437. }
  9438. function assertObjectType (name, value, vm) {
  9439. if (!isPlainObject(value)) {
  9440. warn(
  9441. "Invalid value for option \"" + name + "\": expected an Object, " +
  9442. "but got " + (toRawType(value)) + ".",
  9443. vm
  9444. );
  9445. }
  9446. }
  9447. /**
  9448. * Merge two option objects into a new one.
  9449. * Core utility used in both instantiation and inheritance.
  9450. */
  9451. function mergeOptions (
  9452. parent,
  9453. child,
  9454. vm
  9455. ) {
  9456. if (true) {
  9457. checkComponents(child);
  9458. }
  9459. if (typeof child === 'function') {
  9460. child = child.options;
  9461. }
  9462. normalizeProps(child, vm);
  9463. normalizeInject(child, vm);
  9464. normalizeDirectives(child);
  9465. // Apply extends and mixins on the child options,
  9466. // but only if it is a raw options object that isn't
  9467. // the result of another mergeOptions call.
  9468. // Only merged options has the _base property.
  9469. if (!child._base) {
  9470. if (child.extends) {
  9471. parent = mergeOptions(parent, child.extends, vm);
  9472. }
  9473. if (child.mixins) {
  9474. for (var i = 0, l = child.mixins.length; i < l; i++) {
  9475. parent = mergeOptions(parent, child.mixins[i], vm);
  9476. }
  9477. }
  9478. }
  9479. var options = {};
  9480. var key;
  9481. for (key in parent) {
  9482. mergeField(key);
  9483. }
  9484. for (key in child) {
  9485. if (!hasOwn(parent, key)) {
  9486. mergeField(key);
  9487. }
  9488. }
  9489. function mergeField (key) {
  9490. var strat = strats[key] || defaultStrat;
  9491. options[key] = strat(parent[key], child[key], vm, key);
  9492. }
  9493. return options
  9494. }
  9495. /**
  9496. * Resolve an asset.
  9497. * This function is used because child instances need access
  9498. * to assets defined in its ancestor chain.
  9499. */
  9500. function resolveAsset (
  9501. options,
  9502. type,
  9503. id,
  9504. warnMissing
  9505. ) {
  9506. /* istanbul ignore if */
  9507. if (typeof id !== 'string') {
  9508. return
  9509. }
  9510. var assets = options[type];
  9511. // check local registration variations first
  9512. if (hasOwn(assets, id)) { return assets[id] }
  9513. var camelizedId = camelize(id);
  9514. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  9515. var PascalCaseId = capitalize(camelizedId);
  9516. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  9517. // fallback to prototype chain
  9518. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  9519. if ( true && warnMissing && !res) {
  9520. warn(
  9521. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  9522. options
  9523. );
  9524. }
  9525. return res
  9526. }
  9527. /* */
  9528. function validateProp (
  9529. key,
  9530. propOptions,
  9531. propsData,
  9532. vm
  9533. ) {
  9534. var prop = propOptions[key];
  9535. var absent = !hasOwn(propsData, key);
  9536. var value = propsData[key];
  9537. // boolean casting
  9538. var booleanIndex = getTypeIndex(Boolean, prop.type);
  9539. if (booleanIndex > -1) {
  9540. if (absent && !hasOwn(prop, 'default')) {
  9541. value = false;
  9542. } else if (value === '' || value === hyphenate(key)) {
  9543. // only cast empty string / same name to boolean if
  9544. // boolean has higher priority
  9545. var stringIndex = getTypeIndex(String, prop.type);
  9546. if (stringIndex < 0 || booleanIndex < stringIndex) {
  9547. value = true;
  9548. }
  9549. }
  9550. }
  9551. // check default value
  9552. if (value === undefined) {
  9553. value = getPropDefaultValue(vm, prop, key);
  9554. // since the default value is a fresh copy,
  9555. // make sure to observe it.
  9556. var prevShouldObserve = shouldObserve;
  9557. toggleObserving(true);
  9558. observe(value);
  9559. toggleObserving(prevShouldObserve);
  9560. }
  9561. if (
  9562. true
  9563. ) {
  9564. assertProp(prop, key, value, vm, absent);
  9565. }
  9566. return value
  9567. }
  9568. /**
  9569. * Get the default value of a prop.
  9570. */
  9571. function getPropDefaultValue (vm, prop, key) {
  9572. // no default, return undefined
  9573. if (!hasOwn(prop, 'default')) {
  9574. return undefined
  9575. }
  9576. var def = prop.default;
  9577. // warn against non-factory defaults for Object & Array
  9578. if ( true && isObject(def)) {
  9579. warn(
  9580. 'Invalid default value for prop "' + key + '": ' +
  9581. 'Props with type Object/Array must use a factory function ' +
  9582. 'to return the default value.',
  9583. vm
  9584. );
  9585. }
  9586. // the raw prop value was also undefined from previous render,
  9587. // return previous default value to avoid unnecessary watcher trigger
  9588. if (vm && vm.$options.propsData &&
  9589. vm.$options.propsData[key] === undefined &&
  9590. vm._props[key] !== undefined
  9591. ) {
  9592. return vm._props[key]
  9593. }
  9594. // call factory function for non-Function types
  9595. // a value is Function if its prototype is function even across different execution context
  9596. return typeof def === 'function' && getType(prop.type) !== 'Function'
  9597. ? def.call(vm)
  9598. : def
  9599. }
  9600. /**
  9601. * Assert whether a prop is valid.
  9602. */
  9603. function assertProp (
  9604. prop,
  9605. name,
  9606. value,
  9607. vm,
  9608. absent
  9609. ) {
  9610. if (prop.required && absent) {
  9611. warn(
  9612. 'Missing required prop: "' + name + '"',
  9613. vm
  9614. );
  9615. return
  9616. }
  9617. if (value == null && !prop.required) {
  9618. return
  9619. }
  9620. var type = prop.type;
  9621. var valid = !type || type === true;
  9622. var expectedTypes = [];
  9623. if (type) {
  9624. if (!Array.isArray(type)) {
  9625. type = [type];
  9626. }
  9627. for (var i = 0; i < type.length && !valid; i++) {
  9628. var assertedType = assertType(value, type[i]);
  9629. expectedTypes.push(assertedType.expectedType || '');
  9630. valid = assertedType.valid;
  9631. }
  9632. }
  9633. if (!valid) {
  9634. warn(
  9635. getInvalidTypeMessage(name, value, expectedTypes),
  9636. vm
  9637. );
  9638. return
  9639. }
  9640. var validator = prop.validator;
  9641. if (validator) {
  9642. if (!validator(value)) {
  9643. warn(
  9644. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  9645. vm
  9646. );
  9647. }
  9648. }
  9649. }
  9650. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  9651. function assertType (value, type) {
  9652. var valid;
  9653. var expectedType = getType(type);
  9654. if (simpleCheckRE.test(expectedType)) {
  9655. var t = typeof value;
  9656. valid = t === expectedType.toLowerCase();
  9657. // for primitive wrapper objects
  9658. if (!valid && t === 'object') {
  9659. valid = value instanceof type;
  9660. }
  9661. } else if (expectedType === 'Object') {
  9662. valid = isPlainObject(value);
  9663. } else if (expectedType === 'Array') {
  9664. valid = Array.isArray(value);
  9665. } else {
  9666. valid = value instanceof type;
  9667. }
  9668. return {
  9669. valid: valid,
  9670. expectedType: expectedType
  9671. }
  9672. }
  9673. /**
  9674. * Use function string name to check built-in types,
  9675. * because a simple equality check will fail when running
  9676. * across different vms / iframes.
  9677. */
  9678. function getType (fn) {
  9679. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  9680. return match ? match[1] : ''
  9681. }
  9682. function isSameType (a, b) {
  9683. return getType(a) === getType(b)
  9684. }
  9685. function getTypeIndex (type, expectedTypes) {
  9686. if (!Array.isArray(expectedTypes)) {
  9687. return isSameType(expectedTypes, type) ? 0 : -1
  9688. }
  9689. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  9690. if (isSameType(expectedTypes[i], type)) {
  9691. return i
  9692. }
  9693. }
  9694. return -1
  9695. }
  9696. function getInvalidTypeMessage (name, value, expectedTypes) {
  9697. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  9698. " Expected " + (expectedTypes.map(capitalize).join(', '));
  9699. var expectedType = expectedTypes[0];
  9700. var receivedType = toRawType(value);
  9701. var expectedValue = styleValue(value, expectedType);
  9702. var receivedValue = styleValue(value, receivedType);
  9703. // check if we need to specify expected value
  9704. if (expectedTypes.length === 1 &&
  9705. isExplicable(expectedType) &&
  9706. !isBoolean(expectedType, receivedType)) {
  9707. message += " with value " + expectedValue;
  9708. }
  9709. message += ", got " + receivedType + " ";
  9710. // check if we need to specify received value
  9711. if (isExplicable(receivedType)) {
  9712. message += "with value " + receivedValue + ".";
  9713. }
  9714. return message
  9715. }
  9716. function styleValue (value, type) {
  9717. if (type === 'String') {
  9718. return ("\"" + value + "\"")
  9719. } else if (type === 'Number') {
  9720. return ("" + (Number(value)))
  9721. } else {
  9722. return ("" + value)
  9723. }
  9724. }
  9725. function isExplicable (value) {
  9726. var explicitTypes = ['string', 'number', 'boolean'];
  9727. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  9728. }
  9729. function isBoolean () {
  9730. var args = [], len = arguments.length;
  9731. while ( len-- ) args[ len ] = arguments[ len ];
  9732. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  9733. }
  9734. /* */
  9735. function handleError (err, vm, info) {
  9736. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  9737. // See: https://github.com/vuejs/vuex/issues/1505
  9738. pushTarget();
  9739. try {
  9740. if (vm) {
  9741. var cur = vm;
  9742. while ((cur = cur.$parent)) {
  9743. var hooks = cur.$options.errorCaptured;
  9744. if (hooks) {
  9745. for (var i = 0; i < hooks.length; i++) {
  9746. try {
  9747. var capture = hooks[i].call(cur, err, vm, info) === false;
  9748. if (capture) { return }
  9749. } catch (e) {
  9750. globalHandleError(e, cur, 'errorCaptured hook');
  9751. }
  9752. }
  9753. }
  9754. }
  9755. }
  9756. globalHandleError(err, vm, info);
  9757. } finally {
  9758. popTarget();
  9759. }
  9760. }
  9761. function invokeWithErrorHandling (
  9762. handler,
  9763. context,
  9764. args,
  9765. vm,
  9766. info
  9767. ) {
  9768. var res;
  9769. try {
  9770. res = args ? handler.apply(context, args) : handler.call(context);
  9771. if (res && !res._isVue && isPromise(res) && !res._handled) {
  9772. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  9773. // issue #9511
  9774. // avoid catch triggering multiple times when nested calls
  9775. res._handled = true;
  9776. }
  9777. } catch (e) {
  9778. handleError(e, vm, info);
  9779. }
  9780. return res
  9781. }
  9782. function globalHandleError (err, vm, info) {
  9783. if (config.errorHandler) {
  9784. try {
  9785. return config.errorHandler.call(null, err, vm, info)
  9786. } catch (e) {
  9787. // if the user intentionally throws the original error in the handler,
  9788. // do not log it twice
  9789. if (e !== err) {
  9790. logError(e, null, 'config.errorHandler');
  9791. }
  9792. }
  9793. }
  9794. logError(err, vm, info);
  9795. }
  9796. function logError (err, vm, info) {
  9797. if (true) {
  9798. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9799. }
  9800. /* istanbul ignore else */
  9801. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  9802. console.error(err);
  9803. } else {
  9804. throw err
  9805. }
  9806. }
  9807. /* */
  9808. var callbacks = [];
  9809. var pending = false;
  9810. function flushCallbacks () {
  9811. pending = false;
  9812. var copies = callbacks.slice(0);
  9813. callbacks.length = 0;
  9814. for (var i = 0; i < copies.length; i++) {
  9815. copies[i]();
  9816. }
  9817. }
  9818. // Here we have async deferring wrappers using microtasks.
  9819. // In 2.5 we used (macro) tasks (in combination with microtasks).
  9820. // However, it has subtle problems when state is changed right before repaint
  9821. // (e.g. #6813, out-in transitions).
  9822. // Also, using (macro) tasks in event handler would cause some weird behaviors
  9823. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  9824. // So we now use microtasks everywhere, again.
  9825. // A major drawback of this tradeoff is that there are some scenarios
  9826. // where microtasks have too high a priority and fire in between supposedly
  9827. // sequential events (e.g. #4521, #6690, which have workarounds)
  9828. // or even between bubbling of the same event (#6566).
  9829. var timerFunc;
  9830. // The nextTick behavior leverages the microtask queue, which can be accessed
  9831. // via either native Promise.then or MutationObserver.
  9832. // MutationObserver has wider support, however it is seriously bugged in
  9833. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  9834. // completely stops working after triggering a few times... so, if native
  9835. // Promise is available, we will use it:
  9836. /* istanbul ignore next, $flow-disable-line */
  9837. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  9838. var p = Promise.resolve();
  9839. timerFunc = function () {
  9840. p.then(flushCallbacks);
  9841. // In problematic UIWebViews, Promise.then doesn't completely break, but
  9842. // it can get stuck in a weird state where callbacks are pushed into the
  9843. // microtask queue but the queue isn't being flushed, until the browser
  9844. // needs to do some other work, e.g. handle a timer. Therefore we can
  9845. // "force" the microtask queue to be flushed by adding an empty timer.
  9846. if (isIOS) { setTimeout(noop); }
  9847. };
  9848. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  9849. isNative(MutationObserver) ||
  9850. // PhantomJS and iOS 7.x
  9851. MutationObserver.toString() === '[object MutationObserverConstructor]'
  9852. )) {
  9853. // Use MutationObserver where native Promise is not available,
  9854. // e.g. PhantomJS, iOS7, Android 4.4
  9855. // (#6466 MutationObserver is unreliable in IE11)
  9856. var counter = 1;
  9857. var observer = new MutationObserver(flushCallbacks);
  9858. var textNode = document.createTextNode(String(counter));
  9859. observer.observe(textNode, {
  9860. characterData: true
  9861. });
  9862. timerFunc = function () {
  9863. counter = (counter + 1) % 2;
  9864. textNode.data = String(counter);
  9865. };
  9866. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  9867. // Fallback to setImmediate.
  9868. // Technically it leverages the (macro) task queue,
  9869. // but it is still a better choice than setTimeout.
  9870. timerFunc = function () {
  9871. setImmediate(flushCallbacks);
  9872. };
  9873. } else {
  9874. // Fallback to setTimeout.
  9875. timerFunc = function () {
  9876. setTimeout(flushCallbacks, 0);
  9877. };
  9878. }
  9879. function nextTick (cb, ctx) {
  9880. var _resolve;
  9881. callbacks.push(function () {
  9882. if (cb) {
  9883. try {
  9884. cb.call(ctx);
  9885. } catch (e) {
  9886. handleError(e, ctx, 'nextTick');
  9887. }
  9888. } else if (_resolve) {
  9889. _resolve(ctx);
  9890. }
  9891. });
  9892. if (!pending) {
  9893. pending = true;
  9894. timerFunc();
  9895. }
  9896. // $flow-disable-line
  9897. if (!cb && typeof Promise !== 'undefined') {
  9898. return new Promise(function (resolve) {
  9899. _resolve = resolve;
  9900. })
  9901. }
  9902. }
  9903. /* */
  9904. /* not type checking this file because flow doesn't play well with Proxy */
  9905. var initProxy;
  9906. if (true) {
  9907. var allowedGlobals = makeMap(
  9908. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  9909. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  9910. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  9911. 'require' // for Webpack/Browserify
  9912. );
  9913. var warnNonPresent = function (target, key) {
  9914. warn(
  9915. "Property or method \"" + key + "\" is not defined on the instance but " +
  9916. 'referenced during render. Make sure that this property is reactive, ' +
  9917. 'either in the data option, or for class-based components, by ' +
  9918. 'initializing the property. ' +
  9919. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  9920. target
  9921. );
  9922. };
  9923. var warnReservedPrefix = function (target, key) {
  9924. warn(
  9925. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  9926. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  9927. 'prevent conflicts with Vue internals. ' +
  9928. 'See: https://vuejs.org/v2/api/#data',
  9929. target
  9930. );
  9931. };
  9932. var hasProxy =
  9933. typeof Proxy !== 'undefined' && isNative(Proxy);
  9934. if (hasProxy) {
  9935. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  9936. config.keyCodes = new Proxy(config.keyCodes, {
  9937. set: function set (target, key, value) {
  9938. if (isBuiltInModifier(key)) {
  9939. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  9940. return false
  9941. } else {
  9942. target[key] = value;
  9943. return true
  9944. }
  9945. }
  9946. });
  9947. }
  9948. var hasHandler = {
  9949. has: function has (target, key) {
  9950. var has = key in target;
  9951. var isAllowed = allowedGlobals(key) ||
  9952. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  9953. if (!has && !isAllowed) {
  9954. if (key in target.$data) { warnReservedPrefix(target, key); }
  9955. else { warnNonPresent(target, key); }
  9956. }
  9957. return has || !isAllowed
  9958. }
  9959. };
  9960. var getHandler = {
  9961. get: function get (target, key) {
  9962. if (typeof key === 'string' && !(key in target)) {
  9963. if (key in target.$data) { warnReservedPrefix(target, key); }
  9964. else { warnNonPresent(target, key); }
  9965. }
  9966. return target[key]
  9967. }
  9968. };
  9969. initProxy = function initProxy (vm) {
  9970. if (hasProxy) {
  9971. // determine which proxy handler to use
  9972. var options = vm.$options;
  9973. var handlers = options.render && options.render._withStripped
  9974. ? getHandler
  9975. : hasHandler;
  9976. vm._renderProxy = new Proxy(vm, handlers);
  9977. } else {
  9978. vm._renderProxy = vm;
  9979. }
  9980. };
  9981. }
  9982. /* */
  9983. var seenObjects = new _Set();
  9984. /**
  9985. * Recursively traverse an object to evoke all converted
  9986. * getters, so that every nested property inside the object
  9987. * is collected as a "deep" dependency.
  9988. */
  9989. function traverse (val) {
  9990. _traverse(val, seenObjects);
  9991. seenObjects.clear();
  9992. }
  9993. function _traverse (val, seen) {
  9994. var i, keys;
  9995. var isA = Array.isArray(val);
  9996. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  9997. return
  9998. }
  9999. if (val.__ob__) {
  10000. var depId = val.__ob__.dep.id;
  10001. if (seen.has(depId)) {
  10002. return
  10003. }
  10004. seen.add(depId);
  10005. }
  10006. if (isA) {
  10007. i = val.length;
  10008. while (i--) { _traverse(val[i], seen); }
  10009. } else {
  10010. keys = Object.keys(val);
  10011. i = keys.length;
  10012. while (i--) { _traverse(val[keys[i]], seen); }
  10013. }
  10014. }
  10015. var mark;
  10016. var measure;
  10017. if (true) {
  10018. var perf = inBrowser && window.performance;
  10019. /* istanbul ignore if */
  10020. if (
  10021. perf &&
  10022. perf.mark &&
  10023. perf.measure &&
  10024. perf.clearMarks &&
  10025. perf.clearMeasures
  10026. ) {
  10027. mark = function (tag) { return perf.mark(tag); };
  10028. measure = function (name, startTag, endTag) {
  10029. perf.measure(name, startTag, endTag);
  10030. perf.clearMarks(startTag);
  10031. perf.clearMarks(endTag);
  10032. // perf.clearMeasures(name)
  10033. };
  10034. }
  10035. }
  10036. /* */
  10037. var normalizeEvent = cached(function (name) {
  10038. var passive = name.charAt(0) === '&';
  10039. name = passive ? name.slice(1) : name;
  10040. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  10041. name = once$$1 ? name.slice(1) : name;
  10042. var capture = name.charAt(0) === '!';
  10043. name = capture ? name.slice(1) : name;
  10044. return {
  10045. name: name,
  10046. once: once$$1,
  10047. capture: capture,
  10048. passive: passive
  10049. }
  10050. });
  10051. function createFnInvoker (fns, vm) {
  10052. function invoker () {
  10053. var arguments$1 = arguments;
  10054. var fns = invoker.fns;
  10055. if (Array.isArray(fns)) {
  10056. var cloned = fns.slice();
  10057. for (var i = 0; i < cloned.length; i++) {
  10058. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  10059. }
  10060. } else {
  10061. // return handler return value for single handlers
  10062. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  10063. }
  10064. }
  10065. invoker.fns = fns;
  10066. return invoker
  10067. }
  10068. function updateListeners (
  10069. on,
  10070. oldOn,
  10071. add,
  10072. remove$$1,
  10073. createOnceHandler,
  10074. vm
  10075. ) {
  10076. var name, def$$1, cur, old, event;
  10077. for (name in on) {
  10078. def$$1 = cur = on[name];
  10079. old = oldOn[name];
  10080. event = normalizeEvent(name);
  10081. if (isUndef(cur)) {
  10082. true && warn(
  10083. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  10084. vm
  10085. );
  10086. } else if (isUndef(old)) {
  10087. if (isUndef(cur.fns)) {
  10088. cur = on[name] = createFnInvoker(cur, vm);
  10089. }
  10090. if (isTrue(event.once)) {
  10091. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  10092. }
  10093. add(event.name, cur, event.capture, event.passive, event.params);
  10094. } else if (cur !== old) {
  10095. old.fns = cur;
  10096. on[name] = old;
  10097. }
  10098. }
  10099. for (name in oldOn) {
  10100. if (isUndef(on[name])) {
  10101. event = normalizeEvent(name);
  10102. remove$$1(event.name, oldOn[name], event.capture);
  10103. }
  10104. }
  10105. }
  10106. /* */
  10107. /* */
  10108. // fixed by xxxxxx (mp properties)
  10109. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  10110. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  10111. if (isUndef(propOptions)) {
  10112. return res
  10113. }
  10114. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  10115. var attrs = data.attrs;
  10116. var props = data.props;
  10117. if (isDef(attrs) || isDef(props)) {
  10118. for (var key in propOptions) {
  10119. var altKey = hyphenate(key);
  10120. var result = checkProp(res, props, key, altKey, true) ||
  10121. checkProp(res, attrs, key, altKey, false);
  10122. // externalClass
  10123. if (
  10124. result &&
  10125. res[key] &&
  10126. externalClasses.indexOf(altKey) !== -1 &&
  10127. context[camelize(res[key])]
  10128. ) {
  10129. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  10130. res[key] = context[camelize(res[key])];
  10131. }
  10132. }
  10133. }
  10134. return res
  10135. }
  10136. function extractPropsFromVNodeData (
  10137. data,
  10138. Ctor,
  10139. tag,
  10140. context// fixed by xxxxxx
  10141. ) {
  10142. // we are only extracting raw values here.
  10143. // validation and default values are handled in the child
  10144. // component itself.
  10145. var propOptions = Ctor.options.props;
  10146. if (isUndef(propOptions)) {
  10147. // fixed by xxxxxx
  10148. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  10149. }
  10150. var res = {};
  10151. var attrs = data.attrs;
  10152. var props = data.props;
  10153. if (isDef(attrs) || isDef(props)) {
  10154. for (var key in propOptions) {
  10155. var altKey = hyphenate(key);
  10156. if (true) {
  10157. var keyInLowerCase = key.toLowerCase();
  10158. if (
  10159. key !== keyInLowerCase &&
  10160. attrs && hasOwn(attrs, keyInLowerCase)
  10161. ) {
  10162. tip(
  10163. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  10164. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  10165. " \"" + key + "\". " +
  10166. "Note that HTML attributes are case-insensitive and camelCased " +
  10167. "props need to use their kebab-case equivalents when using in-DOM " +
  10168. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  10169. );
  10170. }
  10171. }
  10172. checkProp(res, props, key, altKey, true) ||
  10173. checkProp(res, attrs, key, altKey, false);
  10174. }
  10175. }
  10176. // fixed by xxxxxx
  10177. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  10178. }
  10179. function checkProp (
  10180. res,
  10181. hash,
  10182. key,
  10183. altKey,
  10184. preserve
  10185. ) {
  10186. if (isDef(hash)) {
  10187. if (hasOwn(hash, key)) {
  10188. res[key] = hash[key];
  10189. if (!preserve) {
  10190. delete hash[key];
  10191. }
  10192. return true
  10193. } else if (hasOwn(hash, altKey)) {
  10194. res[key] = hash[altKey];
  10195. if (!preserve) {
  10196. delete hash[altKey];
  10197. }
  10198. return true
  10199. }
  10200. }
  10201. return false
  10202. }
  10203. /* */
  10204. // The template compiler attempts to minimize the need for normalization by
  10205. // statically analyzing the template at compile time.
  10206. //
  10207. // For plain HTML markup, normalization can be completely skipped because the
  10208. // generated render function is guaranteed to return Array<VNode>. There are
  10209. // two cases where extra normalization is needed:
  10210. // 1. When the children contains components - because a functional component
  10211. // may return an Array instead of a single root. In this case, just a simple
  10212. // normalization is needed - if any child is an Array, we flatten the whole
  10213. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  10214. // because functional components already normalize their own children.
  10215. function simpleNormalizeChildren (children) {
  10216. for (var i = 0; i < children.length; i++) {
  10217. if (Array.isArray(children[i])) {
  10218. return Array.prototype.concat.apply([], children)
  10219. }
  10220. }
  10221. return children
  10222. }
  10223. // 2. When the children contains constructs that always generated nested Arrays,
  10224. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  10225. // with hand-written render functions / JSX. In such cases a full normalization
  10226. // is needed to cater to all possible types of children values.
  10227. function normalizeChildren (children) {
  10228. return isPrimitive(children)
  10229. ? [createTextVNode(children)]
  10230. : Array.isArray(children)
  10231. ? normalizeArrayChildren(children)
  10232. : undefined
  10233. }
  10234. function isTextNode (node) {
  10235. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  10236. }
  10237. function normalizeArrayChildren (children, nestedIndex) {
  10238. var res = [];
  10239. var i, c, lastIndex, last;
  10240. for (i = 0; i < children.length; i++) {
  10241. c = children[i];
  10242. if (isUndef(c) || typeof c === 'boolean') { continue }
  10243. lastIndex = res.length - 1;
  10244. last = res[lastIndex];
  10245. // nested
  10246. if (Array.isArray(c)) {
  10247. if (c.length > 0) {
  10248. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  10249. // merge adjacent text nodes
  10250. if (isTextNode(c[0]) && isTextNode(last)) {
  10251. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  10252. c.shift();
  10253. }
  10254. res.push.apply(res, c);
  10255. }
  10256. } else if (isPrimitive(c)) {
  10257. if (isTextNode(last)) {
  10258. // merge adjacent text nodes
  10259. // this is necessary for SSR hydration because text nodes are
  10260. // essentially merged when rendered to HTML strings
  10261. res[lastIndex] = createTextVNode(last.text + c);
  10262. } else if (c !== '') {
  10263. // convert primitive to vnode
  10264. res.push(createTextVNode(c));
  10265. }
  10266. } else {
  10267. if (isTextNode(c) && isTextNode(last)) {
  10268. // merge adjacent text nodes
  10269. res[lastIndex] = createTextVNode(last.text + c.text);
  10270. } else {
  10271. // default key for nested array children (likely generated by v-for)
  10272. if (isTrue(children._isVList) &&
  10273. isDef(c.tag) &&
  10274. isUndef(c.key) &&
  10275. isDef(nestedIndex)) {
  10276. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  10277. }
  10278. res.push(c);
  10279. }
  10280. }
  10281. }
  10282. return res
  10283. }
  10284. /* */
  10285. function initProvide (vm) {
  10286. var provide = vm.$options.provide;
  10287. if (provide) {
  10288. vm._provided = typeof provide === 'function'
  10289. ? provide.call(vm)
  10290. : provide;
  10291. }
  10292. }
  10293. function initInjections (vm) {
  10294. var result = resolveInject(vm.$options.inject, vm);
  10295. if (result) {
  10296. toggleObserving(false);
  10297. Object.keys(result).forEach(function (key) {
  10298. /* istanbul ignore else */
  10299. if (true) {
  10300. defineReactive$$1(vm, key, result[key], function () {
  10301. warn(
  10302. "Avoid mutating an injected value directly since the changes will be " +
  10303. "overwritten whenever the provided component re-renders. " +
  10304. "injection being mutated: \"" + key + "\"",
  10305. vm
  10306. );
  10307. });
  10308. } else {}
  10309. });
  10310. toggleObserving(true);
  10311. }
  10312. }
  10313. function resolveInject (inject, vm) {
  10314. if (inject) {
  10315. // inject is :any because flow is not smart enough to figure out cached
  10316. var result = Object.create(null);
  10317. var keys = hasSymbol
  10318. ? Reflect.ownKeys(inject)
  10319. : Object.keys(inject);
  10320. for (var i = 0; i < keys.length; i++) {
  10321. var key = keys[i];
  10322. // #6574 in case the inject object is observed...
  10323. if (key === '__ob__') { continue }
  10324. var provideKey = inject[key].from;
  10325. var source = vm;
  10326. while (source) {
  10327. if (source._provided && hasOwn(source._provided, provideKey)) {
  10328. result[key] = source._provided[provideKey];
  10329. break
  10330. }
  10331. source = source.$parent;
  10332. }
  10333. if (!source) {
  10334. if ('default' in inject[key]) {
  10335. var provideDefault = inject[key].default;
  10336. result[key] = typeof provideDefault === 'function'
  10337. ? provideDefault.call(vm)
  10338. : provideDefault;
  10339. } else if (true) {
  10340. warn(("Injection \"" + key + "\" not found"), vm);
  10341. }
  10342. }
  10343. }
  10344. return result
  10345. }
  10346. }
  10347. /* */
  10348. /**
  10349. * Runtime helper for resolving raw children VNodes into a slot object.
  10350. */
  10351. function resolveSlots (
  10352. children,
  10353. context
  10354. ) {
  10355. if (!children || !children.length) {
  10356. return {}
  10357. }
  10358. var slots = {};
  10359. for (var i = 0, l = children.length; i < l; i++) {
  10360. var child = children[i];
  10361. var data = child.data;
  10362. // remove slot attribute if the node is resolved as a Vue slot node
  10363. if (data && data.attrs && data.attrs.slot) {
  10364. delete data.attrs.slot;
  10365. }
  10366. // named slots should only be respected if the vnode was rendered in the
  10367. // same context.
  10368. if ((child.context === context || child.fnContext === context) &&
  10369. data && data.slot != null
  10370. ) {
  10371. var name = data.slot;
  10372. var slot = (slots[name] || (slots[name] = []));
  10373. if (child.tag === 'template') {
  10374. slot.push.apply(slot, child.children || []);
  10375. } else {
  10376. slot.push(child);
  10377. }
  10378. } else {
  10379. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  10380. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  10381. (slots['page'] || (slots['page'] = [])).push(child);
  10382. }else{
  10383. (slots.default || (slots.default = [])).push(child);
  10384. }
  10385. }
  10386. }
  10387. // ignore slots that contains only whitespace
  10388. for (var name$1 in slots) {
  10389. if (slots[name$1].every(isWhitespace)) {
  10390. delete slots[name$1];
  10391. }
  10392. }
  10393. return slots
  10394. }
  10395. function isWhitespace (node) {
  10396. return (node.isComment && !node.asyncFactory) || node.text === ' '
  10397. }
  10398. /* */
  10399. function normalizeScopedSlots (
  10400. slots,
  10401. normalSlots,
  10402. prevSlots
  10403. ) {
  10404. var res;
  10405. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  10406. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  10407. var key = slots && slots.$key;
  10408. if (!slots) {
  10409. res = {};
  10410. } else if (slots._normalized) {
  10411. // fast path 1: child component re-render only, parent did not change
  10412. return slots._normalized
  10413. } else if (
  10414. isStable &&
  10415. prevSlots &&
  10416. prevSlots !== emptyObject &&
  10417. key === prevSlots.$key &&
  10418. !hasNormalSlots &&
  10419. !prevSlots.$hasNormal
  10420. ) {
  10421. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  10422. // only need to normalize once
  10423. return prevSlots
  10424. } else {
  10425. res = {};
  10426. for (var key$1 in slots) {
  10427. if (slots[key$1] && key$1[0] !== '$') {
  10428. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  10429. }
  10430. }
  10431. }
  10432. // expose normal slots on scopedSlots
  10433. for (var key$2 in normalSlots) {
  10434. if (!(key$2 in res)) {
  10435. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  10436. }
  10437. }
  10438. // avoriaz seems to mock a non-extensible $scopedSlots object
  10439. // and when that is passed down this would cause an error
  10440. if (slots && Object.isExtensible(slots)) {
  10441. (slots)._normalized = res;
  10442. }
  10443. def(res, '$stable', isStable);
  10444. def(res, '$key', key);
  10445. def(res, '$hasNormal', hasNormalSlots);
  10446. return res
  10447. }
  10448. function normalizeScopedSlot(normalSlots, key, fn) {
  10449. var normalized = function () {
  10450. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  10451. res = res && typeof res === 'object' && !Array.isArray(res)
  10452. ? [res] // single vnode
  10453. : normalizeChildren(res);
  10454. return res && (
  10455. res.length === 0 ||
  10456. (res.length === 1 && res[0].isComment) // #9658
  10457. ) ? undefined
  10458. : res
  10459. };
  10460. // this is a slot using the new v-slot syntax without scope. although it is
  10461. // compiled as a scoped slot, render fn users would expect it to be present
  10462. // on this.$slots because the usage is semantically a normal slot.
  10463. if (fn.proxy) {
  10464. Object.defineProperty(normalSlots, key, {
  10465. get: normalized,
  10466. enumerable: true,
  10467. configurable: true
  10468. });
  10469. }
  10470. return normalized
  10471. }
  10472. function proxyNormalSlot(slots, key) {
  10473. return function () { return slots[key]; }
  10474. }
  10475. /* */
  10476. /**
  10477. * Runtime helper for rendering v-for lists.
  10478. */
  10479. function renderList (
  10480. val,
  10481. render
  10482. ) {
  10483. var ret, i, l, keys, key;
  10484. if (Array.isArray(val) || typeof val === 'string') {
  10485. ret = new Array(val.length);
  10486. for (i = 0, l = val.length; i < l; i++) {
  10487. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  10488. }
  10489. } else if (typeof val === 'number') {
  10490. ret = new Array(val);
  10491. for (i = 0; i < val; i++) {
  10492. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  10493. }
  10494. } else if (isObject(val)) {
  10495. if (hasSymbol && val[Symbol.iterator]) {
  10496. ret = [];
  10497. var iterator = val[Symbol.iterator]();
  10498. var result = iterator.next();
  10499. while (!result.done) {
  10500. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  10501. result = iterator.next();
  10502. }
  10503. } else {
  10504. keys = Object.keys(val);
  10505. ret = new Array(keys.length);
  10506. for (i = 0, l = keys.length; i < l; i++) {
  10507. key = keys[i];
  10508. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  10509. }
  10510. }
  10511. }
  10512. if (!isDef(ret)) {
  10513. ret = [];
  10514. }
  10515. (ret)._isVList = true;
  10516. return ret
  10517. }
  10518. /* */
  10519. /**
  10520. * Runtime helper for rendering <slot>
  10521. */
  10522. function renderSlot (
  10523. name,
  10524. fallback,
  10525. props,
  10526. bindObject
  10527. ) {
  10528. var scopedSlotFn = this.$scopedSlots[name];
  10529. var nodes;
  10530. if (scopedSlotFn) { // scoped slot
  10531. props = props || {};
  10532. if (bindObject) {
  10533. if ( true && !isObject(bindObject)) {
  10534. warn(
  10535. 'slot v-bind without argument expects an Object',
  10536. this
  10537. );
  10538. }
  10539. props = extend(extend({}, bindObject), props);
  10540. }
  10541. // fixed by xxxxxx app-plus scopedSlot
  10542. nodes = scopedSlotFn(props, this, props._i) || fallback;
  10543. } else {
  10544. nodes = this.$slots[name] || fallback;
  10545. }
  10546. var target = props && props.slot;
  10547. if (target) {
  10548. return this.$createElement('template', { slot: target }, nodes)
  10549. } else {
  10550. return nodes
  10551. }
  10552. }
  10553. /* */
  10554. /**
  10555. * Runtime helper for resolving filters
  10556. */
  10557. function resolveFilter (id) {
  10558. return resolveAsset(this.$options, 'filters', id, true) || identity
  10559. }
  10560. /* */
  10561. function isKeyNotMatch (expect, actual) {
  10562. if (Array.isArray(expect)) {
  10563. return expect.indexOf(actual) === -1
  10564. } else {
  10565. return expect !== actual
  10566. }
  10567. }
  10568. /**
  10569. * Runtime helper for checking keyCodes from config.
  10570. * exposed as Vue.prototype._k
  10571. * passing in eventKeyName as last argument separately for backwards compat
  10572. */
  10573. function checkKeyCodes (
  10574. eventKeyCode,
  10575. key,
  10576. builtInKeyCode,
  10577. eventKeyName,
  10578. builtInKeyName
  10579. ) {
  10580. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  10581. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  10582. return isKeyNotMatch(builtInKeyName, eventKeyName)
  10583. } else if (mappedKeyCode) {
  10584. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  10585. } else if (eventKeyName) {
  10586. return hyphenate(eventKeyName) !== key
  10587. }
  10588. }
  10589. /* */
  10590. /**
  10591. * Runtime helper for merging v-bind="object" into a VNode's data.
  10592. */
  10593. function bindObjectProps (
  10594. data,
  10595. tag,
  10596. value,
  10597. asProp,
  10598. isSync
  10599. ) {
  10600. if (value) {
  10601. if (!isObject(value)) {
  10602. true && warn(
  10603. 'v-bind without argument expects an Object or Array value',
  10604. this
  10605. );
  10606. } else {
  10607. if (Array.isArray(value)) {
  10608. value = toObject(value);
  10609. }
  10610. var hash;
  10611. var loop = function ( key ) {
  10612. if (
  10613. key === 'class' ||
  10614. key === 'style' ||
  10615. isReservedAttribute(key)
  10616. ) {
  10617. hash = data;
  10618. } else {
  10619. var type = data.attrs && data.attrs.type;
  10620. hash = asProp || config.mustUseProp(tag, type, key)
  10621. ? data.domProps || (data.domProps = {})
  10622. : data.attrs || (data.attrs = {});
  10623. }
  10624. var camelizedKey = camelize(key);
  10625. var hyphenatedKey = hyphenate(key);
  10626. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  10627. hash[key] = value[key];
  10628. if (isSync) {
  10629. var on = data.on || (data.on = {});
  10630. on[("update:" + key)] = function ($event) {
  10631. value[key] = $event;
  10632. };
  10633. }
  10634. }
  10635. };
  10636. for (var key in value) loop( key );
  10637. }
  10638. }
  10639. return data
  10640. }
  10641. /* */
  10642. /**
  10643. * Runtime helper for rendering static trees.
  10644. */
  10645. function renderStatic (
  10646. index,
  10647. isInFor
  10648. ) {
  10649. var cached = this._staticTrees || (this._staticTrees = []);
  10650. var tree = cached[index];
  10651. // if has already-rendered static tree and not inside v-for,
  10652. // we can reuse the same tree.
  10653. if (tree && !isInFor) {
  10654. return tree
  10655. }
  10656. // otherwise, render a fresh tree.
  10657. tree = cached[index] = this.$options.staticRenderFns[index].call(
  10658. this._renderProxy,
  10659. null,
  10660. this // for render fns generated for functional component templates
  10661. );
  10662. markStatic(tree, ("__static__" + index), false);
  10663. return tree
  10664. }
  10665. /**
  10666. * Runtime helper for v-once.
  10667. * Effectively it means marking the node as static with a unique key.
  10668. */
  10669. function markOnce (
  10670. tree,
  10671. index,
  10672. key
  10673. ) {
  10674. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  10675. return tree
  10676. }
  10677. function markStatic (
  10678. tree,
  10679. key,
  10680. isOnce
  10681. ) {
  10682. if (Array.isArray(tree)) {
  10683. for (var i = 0; i < tree.length; i++) {
  10684. if (tree[i] && typeof tree[i] !== 'string') {
  10685. markStaticNode(tree[i], (key + "_" + i), isOnce);
  10686. }
  10687. }
  10688. } else {
  10689. markStaticNode(tree, key, isOnce);
  10690. }
  10691. }
  10692. function markStaticNode (node, key, isOnce) {
  10693. node.isStatic = true;
  10694. node.key = key;
  10695. node.isOnce = isOnce;
  10696. }
  10697. /* */
  10698. function bindObjectListeners (data, value) {
  10699. if (value) {
  10700. if (!isPlainObject(value)) {
  10701. true && warn(
  10702. 'v-on without argument expects an Object value',
  10703. this
  10704. );
  10705. } else {
  10706. var on = data.on = data.on ? extend({}, data.on) : {};
  10707. for (var key in value) {
  10708. var existing = on[key];
  10709. var ours = value[key];
  10710. on[key] = existing ? [].concat(existing, ours) : ours;
  10711. }
  10712. }
  10713. }
  10714. return data
  10715. }
  10716. /* */
  10717. function resolveScopedSlots (
  10718. fns, // see flow/vnode
  10719. res,
  10720. // the following are added in 2.6
  10721. hasDynamicKeys,
  10722. contentHashKey
  10723. ) {
  10724. res = res || { $stable: !hasDynamicKeys };
  10725. for (var i = 0; i < fns.length; i++) {
  10726. var slot = fns[i];
  10727. if (Array.isArray(slot)) {
  10728. resolveScopedSlots(slot, res, hasDynamicKeys);
  10729. } else if (slot) {
  10730. // marker for reverse proxying v-slot without scope on this.$slots
  10731. if (slot.proxy) {
  10732. slot.fn.proxy = true;
  10733. }
  10734. res[slot.key] = slot.fn;
  10735. }
  10736. }
  10737. if (contentHashKey) {
  10738. (res).$key = contentHashKey;
  10739. }
  10740. return res
  10741. }
  10742. /* */
  10743. function bindDynamicKeys (baseObj, values) {
  10744. for (var i = 0; i < values.length; i += 2) {
  10745. var key = values[i];
  10746. if (typeof key === 'string' && key) {
  10747. baseObj[values[i]] = values[i + 1];
  10748. } else if ( true && key !== '' && key !== null) {
  10749. // null is a special value for explicitly removing a binding
  10750. warn(
  10751. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  10752. this
  10753. );
  10754. }
  10755. }
  10756. return baseObj
  10757. }
  10758. // helper to dynamically append modifier runtime markers to event names.
  10759. // ensure only append when value is already string, otherwise it will be cast
  10760. // to string and cause the type check to miss.
  10761. function prependModifier (value, symbol) {
  10762. return typeof value === 'string' ? symbol + value : value
  10763. }
  10764. /* */
  10765. function installRenderHelpers (target) {
  10766. target._o = markOnce;
  10767. target._n = toNumber;
  10768. target._s = toString;
  10769. target._l = renderList;
  10770. target._t = renderSlot;
  10771. target._q = looseEqual;
  10772. target._i = looseIndexOf;
  10773. target._m = renderStatic;
  10774. target._f = resolveFilter;
  10775. target._k = checkKeyCodes;
  10776. target._b = bindObjectProps;
  10777. target._v = createTextVNode;
  10778. target._e = createEmptyVNode;
  10779. target._u = resolveScopedSlots;
  10780. target._g = bindObjectListeners;
  10781. target._d = bindDynamicKeys;
  10782. target._p = prependModifier;
  10783. }
  10784. /* */
  10785. function FunctionalRenderContext (
  10786. data,
  10787. props,
  10788. children,
  10789. parent,
  10790. Ctor
  10791. ) {
  10792. var this$1 = this;
  10793. var options = Ctor.options;
  10794. // ensure the createElement function in functional components
  10795. // gets a unique context - this is necessary for correct named slot check
  10796. var contextVm;
  10797. if (hasOwn(parent, '_uid')) {
  10798. contextVm = Object.create(parent);
  10799. // $flow-disable-line
  10800. contextVm._original = parent;
  10801. } else {
  10802. // the context vm passed in is a functional context as well.
  10803. // in this case we want to make sure we are able to get a hold to the
  10804. // real context instance.
  10805. contextVm = parent;
  10806. // $flow-disable-line
  10807. parent = parent._original;
  10808. }
  10809. var isCompiled = isTrue(options._compiled);
  10810. var needNormalization = !isCompiled;
  10811. this.data = data;
  10812. this.props = props;
  10813. this.children = children;
  10814. this.parent = parent;
  10815. this.listeners = data.on || emptyObject;
  10816. this.injections = resolveInject(options.inject, parent);
  10817. this.slots = function () {
  10818. if (!this$1.$slots) {
  10819. normalizeScopedSlots(
  10820. data.scopedSlots,
  10821. this$1.$slots = resolveSlots(children, parent)
  10822. );
  10823. }
  10824. return this$1.$slots
  10825. };
  10826. Object.defineProperty(this, 'scopedSlots', ({
  10827. enumerable: true,
  10828. get: function get () {
  10829. return normalizeScopedSlots(data.scopedSlots, this.slots())
  10830. }
  10831. }));
  10832. // support for compiled functional template
  10833. if (isCompiled) {
  10834. // exposing $options for renderStatic()
  10835. this.$options = options;
  10836. // pre-resolve slots for renderSlot()
  10837. this.$slots = this.slots();
  10838. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  10839. }
  10840. if (options._scopeId) {
  10841. this._c = function (a, b, c, d) {
  10842. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  10843. if (vnode && !Array.isArray(vnode)) {
  10844. vnode.fnScopeId = options._scopeId;
  10845. vnode.fnContext = parent;
  10846. }
  10847. return vnode
  10848. };
  10849. } else {
  10850. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  10851. }
  10852. }
  10853. installRenderHelpers(FunctionalRenderContext.prototype);
  10854. function createFunctionalComponent (
  10855. Ctor,
  10856. propsData,
  10857. data,
  10858. contextVm,
  10859. children
  10860. ) {
  10861. var options = Ctor.options;
  10862. var props = {};
  10863. var propOptions = options.props;
  10864. if (isDef(propOptions)) {
  10865. for (var key in propOptions) {
  10866. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  10867. }
  10868. } else {
  10869. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  10870. if (isDef(data.props)) { mergeProps(props, data.props); }
  10871. }
  10872. var renderContext = new FunctionalRenderContext(
  10873. data,
  10874. props,
  10875. children,
  10876. contextVm,
  10877. Ctor
  10878. );
  10879. var vnode = options.render.call(null, renderContext._c, renderContext);
  10880. if (vnode instanceof VNode) {
  10881. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  10882. } else if (Array.isArray(vnode)) {
  10883. var vnodes = normalizeChildren(vnode) || [];
  10884. var res = new Array(vnodes.length);
  10885. for (var i = 0; i < vnodes.length; i++) {
  10886. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  10887. }
  10888. return res
  10889. }
  10890. }
  10891. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  10892. // #7817 clone node before setting fnContext, otherwise if the node is reused
  10893. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  10894. // that should not be matched to match.
  10895. var clone = cloneVNode(vnode);
  10896. clone.fnContext = contextVm;
  10897. clone.fnOptions = options;
  10898. if (true) {
  10899. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  10900. }
  10901. if (data.slot) {
  10902. (clone.data || (clone.data = {})).slot = data.slot;
  10903. }
  10904. return clone
  10905. }
  10906. function mergeProps (to, from) {
  10907. for (var key in from) {
  10908. to[camelize(key)] = from[key];
  10909. }
  10910. }
  10911. /* */
  10912. /* */
  10913. /* */
  10914. /* */
  10915. // inline hooks to be invoked on component VNodes during patch
  10916. var componentVNodeHooks = {
  10917. init: function init (vnode, hydrating) {
  10918. if (
  10919. vnode.componentInstance &&
  10920. !vnode.componentInstance._isDestroyed &&
  10921. vnode.data.keepAlive
  10922. ) {
  10923. // kept-alive components, treat as a patch
  10924. var mountedNode = vnode; // work around flow
  10925. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  10926. } else {
  10927. var child = vnode.componentInstance = createComponentInstanceForVnode(
  10928. vnode,
  10929. activeInstance
  10930. );
  10931. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  10932. }
  10933. },
  10934. prepatch: function prepatch (oldVnode, vnode) {
  10935. var options = vnode.componentOptions;
  10936. var child = vnode.componentInstance = oldVnode.componentInstance;
  10937. updateChildComponent(
  10938. child,
  10939. options.propsData, // updated props
  10940. options.listeners, // updated listeners
  10941. vnode, // new parent vnode
  10942. options.children // new children
  10943. );
  10944. },
  10945. insert: function insert (vnode) {
  10946. var context = vnode.context;
  10947. var componentInstance = vnode.componentInstance;
  10948. if (!componentInstance._isMounted) {
  10949. callHook(componentInstance, 'onServiceCreated');
  10950. callHook(componentInstance, 'onServiceAttached');
  10951. componentInstance._isMounted = true;
  10952. callHook(componentInstance, 'mounted');
  10953. }
  10954. if (vnode.data.keepAlive) {
  10955. if (context._isMounted) {
  10956. // vue-router#1212
  10957. // During updates, a kept-alive component's child components may
  10958. // change, so directly walking the tree here may call activated hooks
  10959. // on incorrect children. Instead we push them into a queue which will
  10960. // be processed after the whole patch process ended.
  10961. queueActivatedComponent(componentInstance);
  10962. } else {
  10963. activateChildComponent(componentInstance, true /* direct */);
  10964. }
  10965. }
  10966. },
  10967. destroy: function destroy (vnode) {
  10968. var componentInstance = vnode.componentInstance;
  10969. if (!componentInstance._isDestroyed) {
  10970. if (!vnode.data.keepAlive) {
  10971. componentInstance.$destroy();
  10972. } else {
  10973. deactivateChildComponent(componentInstance, true /* direct */);
  10974. }
  10975. }
  10976. }
  10977. };
  10978. var hooksToMerge = Object.keys(componentVNodeHooks);
  10979. function createComponent (
  10980. Ctor,
  10981. data,
  10982. context,
  10983. children,
  10984. tag
  10985. ) {
  10986. if (isUndef(Ctor)) {
  10987. return
  10988. }
  10989. var baseCtor = context.$options._base;
  10990. // plain options object: turn it into a constructor
  10991. if (isObject(Ctor)) {
  10992. Ctor = baseCtor.extend(Ctor);
  10993. }
  10994. // if at this stage it's not a constructor or an async component factory,
  10995. // reject.
  10996. if (typeof Ctor !== 'function') {
  10997. if (true) {
  10998. warn(("Invalid Component definition: " + (String(Ctor))), context);
  10999. }
  11000. return
  11001. }
  11002. // async component
  11003. var asyncFactory;
  11004. if (isUndef(Ctor.cid)) {
  11005. asyncFactory = Ctor;
  11006. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  11007. if (Ctor === undefined) {
  11008. // return a placeholder node for async component, which is rendered
  11009. // as a comment node but preserves all the raw information for the node.
  11010. // the information will be used for async server-rendering and hydration.
  11011. return createAsyncPlaceholder(
  11012. asyncFactory,
  11013. data,
  11014. context,
  11015. children,
  11016. tag
  11017. )
  11018. }
  11019. }
  11020. data = data || {};
  11021. // resolve constructor options in case global mixins are applied after
  11022. // component constructor creation
  11023. resolveConstructorOptions(Ctor);
  11024. // transform component v-model data into props & events
  11025. if (isDef(data.model)) {
  11026. transformModel(Ctor.options, data);
  11027. }
  11028. // extract props
  11029. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  11030. // functional component
  11031. if (isTrue(Ctor.options.functional)) {
  11032. return createFunctionalComponent(Ctor, propsData, data, context, children)
  11033. }
  11034. // extract listeners, since these needs to be treated as
  11035. // child component listeners instead of DOM listeners
  11036. var listeners = data.on;
  11037. // replace with listeners with .native modifier
  11038. // so it gets processed during parent component patch.
  11039. data.on = data.nativeOn;
  11040. if (isTrue(Ctor.options.abstract)) {
  11041. // abstract components do not keep anything
  11042. // other than props & listeners & slot
  11043. // work around flow
  11044. var slot = data.slot;
  11045. data = {};
  11046. if (slot) {
  11047. data.slot = slot;
  11048. }
  11049. }
  11050. // install component management hooks onto the placeholder node
  11051. installComponentHooks(data);
  11052. // return a placeholder vnode
  11053. var name = Ctor.options.name || tag;
  11054. var vnode = new VNode(
  11055. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  11056. data, undefined, undefined, undefined, context,
  11057. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  11058. asyncFactory
  11059. );
  11060. return vnode
  11061. }
  11062. function createComponentInstanceForVnode (
  11063. vnode, // we know it's MountedComponentVNode but flow doesn't
  11064. parent // activeInstance in lifecycle state
  11065. ) {
  11066. var options = {
  11067. _isComponent: true,
  11068. _parentVnode: vnode,
  11069. parent: parent
  11070. };
  11071. // check inline-template render functions
  11072. var inlineTemplate = vnode.data.inlineTemplate;
  11073. if (isDef(inlineTemplate)) {
  11074. options.render = inlineTemplate.render;
  11075. options.staticRenderFns = inlineTemplate.staticRenderFns;
  11076. }
  11077. return new vnode.componentOptions.Ctor(options)
  11078. }
  11079. function installComponentHooks (data) {
  11080. var hooks = data.hook || (data.hook = {});
  11081. for (var i = 0; i < hooksToMerge.length; i++) {
  11082. var key = hooksToMerge[i];
  11083. var existing = hooks[key];
  11084. var toMerge = componentVNodeHooks[key];
  11085. if (existing !== toMerge && !(existing && existing._merged)) {
  11086. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  11087. }
  11088. }
  11089. }
  11090. function mergeHook$1 (f1, f2) {
  11091. var merged = function (a, b) {
  11092. // flow complains about extra args which is why we use any
  11093. f1(a, b);
  11094. f2(a, b);
  11095. };
  11096. merged._merged = true;
  11097. return merged
  11098. }
  11099. // transform component v-model info (value and callback) into
  11100. // prop and event handler respectively.
  11101. function transformModel (options, data) {
  11102. var prop = (options.model && options.model.prop) || 'value';
  11103. var event = (options.model && options.model.event) || 'input'
  11104. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  11105. var on = data.on || (data.on = {});
  11106. var existing = on[event];
  11107. var callback = data.model.callback;
  11108. if (isDef(existing)) {
  11109. if (
  11110. Array.isArray(existing)
  11111. ? existing.indexOf(callback) === -1
  11112. : existing !== callback
  11113. ) {
  11114. on[event] = [callback].concat(existing);
  11115. }
  11116. } else {
  11117. on[event] = callback;
  11118. }
  11119. }
  11120. /* */
  11121. var SIMPLE_NORMALIZE = 1;
  11122. var ALWAYS_NORMALIZE = 2;
  11123. // wrapper function for providing a more flexible interface
  11124. // without getting yelled at by flow
  11125. function createElement (
  11126. context,
  11127. tag,
  11128. data,
  11129. children,
  11130. normalizationType,
  11131. alwaysNormalize
  11132. ) {
  11133. if (Array.isArray(data) || isPrimitive(data)) {
  11134. normalizationType = children;
  11135. children = data;
  11136. data = undefined;
  11137. }
  11138. if (isTrue(alwaysNormalize)) {
  11139. normalizationType = ALWAYS_NORMALIZE;
  11140. }
  11141. return _createElement(context, tag, data, children, normalizationType)
  11142. }
  11143. function _createElement (
  11144. context,
  11145. tag,
  11146. data,
  11147. children,
  11148. normalizationType
  11149. ) {
  11150. if (isDef(data) && isDef((data).__ob__)) {
  11151. true && warn(
  11152. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  11153. 'Always create fresh vnode data objects in each render!',
  11154. context
  11155. );
  11156. return createEmptyVNode()
  11157. }
  11158. // object syntax in v-bind
  11159. if (isDef(data) && isDef(data.is)) {
  11160. tag = data.is;
  11161. }
  11162. if (!tag) {
  11163. // in case of component :is set to falsy value
  11164. return createEmptyVNode()
  11165. }
  11166. // warn against non-primitive key
  11167. if ( true &&
  11168. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  11169. ) {
  11170. {
  11171. warn(
  11172. 'Avoid using non-primitive value as key, ' +
  11173. 'use string/number value instead.',
  11174. context
  11175. );
  11176. }
  11177. }
  11178. // support single function children as default scoped slot
  11179. if (Array.isArray(children) &&
  11180. typeof children[0] === 'function'
  11181. ) {
  11182. data = data || {};
  11183. data.scopedSlots = { default: children[0] };
  11184. children.length = 0;
  11185. }
  11186. if (normalizationType === ALWAYS_NORMALIZE) {
  11187. children = normalizeChildren(children);
  11188. } else if (normalizationType === SIMPLE_NORMALIZE) {
  11189. children = simpleNormalizeChildren(children);
  11190. }
  11191. var vnode, ns;
  11192. if (typeof tag === 'string') {
  11193. var Ctor;
  11194. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  11195. if (config.isReservedTag(tag)) {
  11196. // platform built-in elements
  11197. if ( true && isDef(data) && isDef(data.nativeOn)) {
  11198. warn(
  11199. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  11200. context
  11201. );
  11202. }
  11203. vnode = new VNode(
  11204. config.parsePlatformTagName(tag), data, children,
  11205. undefined, undefined, context
  11206. );
  11207. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  11208. // component
  11209. vnode = createComponent(Ctor, data, context, children, tag);
  11210. } else {
  11211. // unknown or unlisted namespaced elements
  11212. // check at runtime because it may get assigned a namespace when its
  11213. // parent normalizes children
  11214. vnode = new VNode(
  11215. tag, data, children,
  11216. undefined, undefined, context
  11217. );
  11218. }
  11219. } else {
  11220. // direct component options / constructor
  11221. vnode = createComponent(tag, data, context, children);
  11222. }
  11223. if (Array.isArray(vnode)) {
  11224. return vnode
  11225. } else if (isDef(vnode)) {
  11226. if (isDef(ns)) { applyNS(vnode, ns); }
  11227. if (isDef(data)) { registerDeepBindings(data); }
  11228. return vnode
  11229. } else {
  11230. return createEmptyVNode()
  11231. }
  11232. }
  11233. function applyNS (vnode, ns, force) {
  11234. vnode.ns = ns;
  11235. if (vnode.tag === 'foreignObject') {
  11236. // use default namespace inside foreignObject
  11237. ns = undefined;
  11238. force = true;
  11239. }
  11240. if (isDef(vnode.children)) {
  11241. for (var i = 0, l = vnode.children.length; i < l; i++) {
  11242. var child = vnode.children[i];
  11243. if (isDef(child.tag) && (
  11244. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  11245. applyNS(child, ns, force);
  11246. }
  11247. }
  11248. }
  11249. }
  11250. // ref #5318
  11251. // necessary to ensure parent re-render when deep bindings like :style and
  11252. // :class are used on slot nodes
  11253. function registerDeepBindings (data) {
  11254. if (isObject(data.style)) {
  11255. traverse(data.style);
  11256. }
  11257. if (isObject(data.class)) {
  11258. traverse(data.class);
  11259. }
  11260. }
  11261. /* */
  11262. function initRender (vm) {
  11263. vm._vnode = null; // the root of the child tree
  11264. vm._staticTrees = null; // v-once cached trees
  11265. var options = vm.$options;
  11266. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  11267. var renderContext = parentVnode && parentVnode.context;
  11268. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  11269. vm.$scopedSlots = emptyObject;
  11270. // bind the createElement fn to this instance
  11271. // so that we get proper render context inside it.
  11272. // args order: tag, data, children, normalizationType, alwaysNormalize
  11273. // internal version is used by render functions compiled from templates
  11274. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  11275. // normalization is always applied for the public version, used in
  11276. // user-written render functions.
  11277. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  11278. // $attrs & $listeners are exposed for easier HOC creation.
  11279. // they need to be reactive so that HOCs using them are always updated
  11280. var parentData = parentVnode && parentVnode.data;
  11281. /* istanbul ignore else */
  11282. if (true) {
  11283. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  11284. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  11285. }, true);
  11286. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  11287. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  11288. }, true);
  11289. } else {}
  11290. }
  11291. var currentRenderingInstance = null;
  11292. function renderMixin (Vue) {
  11293. // install runtime convenience helpers
  11294. installRenderHelpers(Vue.prototype);
  11295. Vue.prototype.$nextTick = function (fn) {
  11296. return nextTick(fn, this)
  11297. };
  11298. Vue.prototype._render = function () {
  11299. var vm = this;
  11300. var ref = vm.$options;
  11301. var render = ref.render;
  11302. var _parentVnode = ref._parentVnode;
  11303. if (_parentVnode) {
  11304. vm.$scopedSlots = normalizeScopedSlots(
  11305. _parentVnode.data.scopedSlots,
  11306. vm.$slots,
  11307. vm.$scopedSlots
  11308. );
  11309. }
  11310. // set parent vnode. this allows render functions to have access
  11311. // to the data on the placeholder node.
  11312. vm.$vnode = _parentVnode;
  11313. // render self
  11314. var vnode;
  11315. try {
  11316. // There's no need to maintain a stack because all render fns are called
  11317. // separately from one another. Nested component's render fns are called
  11318. // when parent component is patched.
  11319. currentRenderingInstance = vm;
  11320. vnode = render.call(vm._renderProxy, vm.$createElement);
  11321. } catch (e) {
  11322. handleError(e, vm, "render");
  11323. // return error render result,
  11324. // or previous vnode to prevent render error causing blank component
  11325. /* istanbul ignore else */
  11326. if ( true && vm.$options.renderError) {
  11327. try {
  11328. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  11329. } catch (e) {
  11330. handleError(e, vm, "renderError");
  11331. vnode = vm._vnode;
  11332. }
  11333. } else {
  11334. vnode = vm._vnode;
  11335. }
  11336. } finally {
  11337. currentRenderingInstance = null;
  11338. }
  11339. // if the returned array contains only a single node, allow it
  11340. if (Array.isArray(vnode) && vnode.length === 1) {
  11341. vnode = vnode[0];
  11342. }
  11343. // return empty vnode in case the render function errored out
  11344. if (!(vnode instanceof VNode)) {
  11345. if ( true && Array.isArray(vnode)) {
  11346. warn(
  11347. 'Multiple root nodes returned from render function. Render function ' +
  11348. 'should return a single root node.',
  11349. vm
  11350. );
  11351. }
  11352. vnode = createEmptyVNode();
  11353. }
  11354. // set parent
  11355. vnode.parent = _parentVnode;
  11356. return vnode
  11357. };
  11358. }
  11359. /* */
  11360. function ensureCtor (comp, base) {
  11361. if (
  11362. comp.__esModule ||
  11363. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  11364. ) {
  11365. comp = comp.default;
  11366. }
  11367. return isObject(comp)
  11368. ? base.extend(comp)
  11369. : comp
  11370. }
  11371. function createAsyncPlaceholder (
  11372. factory,
  11373. data,
  11374. context,
  11375. children,
  11376. tag
  11377. ) {
  11378. var node = createEmptyVNode();
  11379. node.asyncFactory = factory;
  11380. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  11381. return node
  11382. }
  11383. function resolveAsyncComponent (
  11384. factory,
  11385. baseCtor
  11386. ) {
  11387. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  11388. return factory.errorComp
  11389. }
  11390. if (isDef(factory.resolved)) {
  11391. return factory.resolved
  11392. }
  11393. var owner = currentRenderingInstance;
  11394. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  11395. // already pending
  11396. factory.owners.push(owner);
  11397. }
  11398. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  11399. return factory.loadingComp
  11400. }
  11401. if (owner && !isDef(factory.owners)) {
  11402. var owners = factory.owners = [owner];
  11403. var sync = true;
  11404. var timerLoading = null;
  11405. var timerTimeout = null
  11406. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  11407. var forceRender = function (renderCompleted) {
  11408. for (var i = 0, l = owners.length; i < l; i++) {
  11409. (owners[i]).$forceUpdate();
  11410. }
  11411. if (renderCompleted) {
  11412. owners.length = 0;
  11413. if (timerLoading !== null) {
  11414. clearTimeout(timerLoading);
  11415. timerLoading = null;
  11416. }
  11417. if (timerTimeout !== null) {
  11418. clearTimeout(timerTimeout);
  11419. timerTimeout = null;
  11420. }
  11421. }
  11422. };
  11423. var resolve = once(function (res) {
  11424. // cache resolved
  11425. factory.resolved = ensureCtor(res, baseCtor);
  11426. // invoke callbacks only if this is not a synchronous resolve
  11427. // (async resolves are shimmed as synchronous during SSR)
  11428. if (!sync) {
  11429. forceRender(true);
  11430. } else {
  11431. owners.length = 0;
  11432. }
  11433. });
  11434. var reject = once(function (reason) {
  11435. true && warn(
  11436. "Failed to resolve async component: " + (String(factory)) +
  11437. (reason ? ("\nReason: " + reason) : '')
  11438. );
  11439. if (isDef(factory.errorComp)) {
  11440. factory.error = true;
  11441. forceRender(true);
  11442. }
  11443. });
  11444. var res = factory(resolve, reject);
  11445. if (isObject(res)) {
  11446. if (isPromise(res)) {
  11447. // () => Promise
  11448. if (isUndef(factory.resolved)) {
  11449. res.then(resolve, reject);
  11450. }
  11451. } else if (isPromise(res.component)) {
  11452. res.component.then(resolve, reject);
  11453. if (isDef(res.error)) {
  11454. factory.errorComp = ensureCtor(res.error, baseCtor);
  11455. }
  11456. if (isDef(res.loading)) {
  11457. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  11458. if (res.delay === 0) {
  11459. factory.loading = true;
  11460. } else {
  11461. timerLoading = setTimeout(function () {
  11462. timerLoading = null;
  11463. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  11464. factory.loading = true;
  11465. forceRender(false);
  11466. }
  11467. }, res.delay || 200);
  11468. }
  11469. }
  11470. if (isDef(res.timeout)) {
  11471. timerTimeout = setTimeout(function () {
  11472. timerTimeout = null;
  11473. if (isUndef(factory.resolved)) {
  11474. reject(
  11475. true
  11476. ? ("timeout (" + (res.timeout) + "ms)")
  11477. : undefined
  11478. );
  11479. }
  11480. }, res.timeout);
  11481. }
  11482. }
  11483. }
  11484. sync = false;
  11485. // return in case resolved synchronously
  11486. return factory.loading
  11487. ? factory.loadingComp
  11488. : factory.resolved
  11489. }
  11490. }
  11491. /* */
  11492. function isAsyncPlaceholder (node) {
  11493. return node.isComment && node.asyncFactory
  11494. }
  11495. /* */
  11496. function getFirstComponentChild (children) {
  11497. if (Array.isArray(children)) {
  11498. for (var i = 0; i < children.length; i++) {
  11499. var c = children[i];
  11500. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  11501. return c
  11502. }
  11503. }
  11504. }
  11505. }
  11506. /* */
  11507. /* */
  11508. function initEvents (vm) {
  11509. vm._events = Object.create(null);
  11510. vm._hasHookEvent = false;
  11511. // init parent attached events
  11512. var listeners = vm.$options._parentListeners;
  11513. if (listeners) {
  11514. updateComponentListeners(vm, listeners);
  11515. }
  11516. }
  11517. var target;
  11518. function add (event, fn) {
  11519. target.$on(event, fn);
  11520. }
  11521. function remove$1 (event, fn) {
  11522. target.$off(event, fn);
  11523. }
  11524. function createOnceHandler (event, fn) {
  11525. var _target = target;
  11526. return function onceHandler () {
  11527. var res = fn.apply(null, arguments);
  11528. if (res !== null) {
  11529. _target.$off(event, onceHandler);
  11530. }
  11531. }
  11532. }
  11533. function updateComponentListeners (
  11534. vm,
  11535. listeners,
  11536. oldListeners
  11537. ) {
  11538. target = vm;
  11539. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  11540. target = undefined;
  11541. }
  11542. function eventsMixin (Vue) {
  11543. var hookRE = /^hook:/;
  11544. Vue.prototype.$on = function (event, fn) {
  11545. var vm = this;
  11546. if (Array.isArray(event)) {
  11547. for (var i = 0, l = event.length; i < l; i++) {
  11548. vm.$on(event[i], fn);
  11549. }
  11550. } else {
  11551. (vm._events[event] || (vm._events[event] = [])).push(fn);
  11552. // optimize hook:event cost by using a boolean flag marked at registration
  11553. // instead of a hash lookup
  11554. if (hookRE.test(event)) {
  11555. vm._hasHookEvent = true;
  11556. }
  11557. }
  11558. return vm
  11559. };
  11560. Vue.prototype.$once = function (event, fn) {
  11561. var vm = this;
  11562. function on () {
  11563. vm.$off(event, on);
  11564. fn.apply(vm, arguments);
  11565. }
  11566. on.fn = fn;
  11567. vm.$on(event, on);
  11568. return vm
  11569. };
  11570. Vue.prototype.$off = function (event, fn) {
  11571. var vm = this;
  11572. // all
  11573. if (!arguments.length) {
  11574. vm._events = Object.create(null);
  11575. return vm
  11576. }
  11577. // array of events
  11578. if (Array.isArray(event)) {
  11579. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  11580. vm.$off(event[i$1], fn);
  11581. }
  11582. return vm
  11583. }
  11584. // specific event
  11585. var cbs = vm._events[event];
  11586. if (!cbs) {
  11587. return vm
  11588. }
  11589. if (!fn) {
  11590. vm._events[event] = null;
  11591. return vm
  11592. }
  11593. // specific handler
  11594. var cb;
  11595. var i = cbs.length;
  11596. while (i--) {
  11597. cb = cbs[i];
  11598. if (cb === fn || cb.fn === fn) {
  11599. cbs.splice(i, 1);
  11600. break
  11601. }
  11602. }
  11603. return vm
  11604. };
  11605. Vue.prototype.$emit = function (event) {
  11606. var vm = this;
  11607. if (true) {
  11608. var lowerCaseEvent = event.toLowerCase();
  11609. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  11610. tip(
  11611. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  11612. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  11613. "Note that HTML attributes are case-insensitive and you cannot use " +
  11614. "v-on to listen to camelCase events when using in-DOM templates. " +
  11615. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  11616. );
  11617. }
  11618. }
  11619. var cbs = vm._events[event];
  11620. if (cbs) {
  11621. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  11622. var args = toArray(arguments, 1);
  11623. var info = "event handler for \"" + event + "\"";
  11624. for (var i = 0, l = cbs.length; i < l; i++) {
  11625. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  11626. }
  11627. }
  11628. return vm
  11629. };
  11630. }
  11631. /* */
  11632. var activeInstance = null;
  11633. var isUpdatingChildComponent = false;
  11634. function setActiveInstance(vm) {
  11635. var prevActiveInstance = activeInstance;
  11636. activeInstance = vm;
  11637. return function () {
  11638. activeInstance = prevActiveInstance;
  11639. }
  11640. }
  11641. function initLifecycle (vm) {
  11642. var options = vm.$options;
  11643. // locate first non-abstract parent
  11644. var parent = options.parent;
  11645. if (parent && !options.abstract) {
  11646. while (parent.$options.abstract && parent.$parent) {
  11647. parent = parent.$parent;
  11648. }
  11649. parent.$children.push(vm);
  11650. }
  11651. vm.$parent = parent;
  11652. vm.$root = parent ? parent.$root : vm;
  11653. vm.$children = [];
  11654. vm.$refs = {};
  11655. vm._watcher = null;
  11656. vm._inactive = null;
  11657. vm._directInactive = false;
  11658. vm._isMounted = false;
  11659. vm._isDestroyed = false;
  11660. vm._isBeingDestroyed = false;
  11661. }
  11662. function lifecycleMixin (Vue) {
  11663. Vue.prototype._update = function (vnode, hydrating) {
  11664. var vm = this;
  11665. var prevEl = vm.$el;
  11666. var prevVnode = vm._vnode;
  11667. var restoreActiveInstance = setActiveInstance(vm);
  11668. vm._vnode = vnode;
  11669. // Vue.prototype.__patch__ is injected in entry points
  11670. // based on the rendering backend used.
  11671. if (!prevVnode) {
  11672. // initial render
  11673. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  11674. } else {
  11675. // updates
  11676. vm.$el = vm.__patch__(prevVnode, vnode);
  11677. }
  11678. restoreActiveInstance();
  11679. // update __vue__ reference
  11680. if (prevEl) {
  11681. prevEl.__vue__ = null;
  11682. }
  11683. if (vm.$el) {
  11684. vm.$el.__vue__ = vm;
  11685. }
  11686. // if parent is an HOC, update its $el as well
  11687. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  11688. vm.$parent.$el = vm.$el;
  11689. }
  11690. // updated hook is called by the scheduler to ensure that children are
  11691. // updated in a parent's updated hook.
  11692. };
  11693. Vue.prototype.$forceUpdate = function () {
  11694. var vm = this;
  11695. if (vm._watcher) {
  11696. vm._watcher.update();
  11697. }
  11698. };
  11699. Vue.prototype.$destroy = function () {
  11700. var vm = this;
  11701. if (vm._isBeingDestroyed) {
  11702. return
  11703. }
  11704. callHook(vm, 'beforeDestroy');
  11705. vm._isBeingDestroyed = true;
  11706. // remove self from parent
  11707. var parent = vm.$parent;
  11708. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  11709. remove(parent.$children, vm);
  11710. }
  11711. // teardown watchers
  11712. if (vm._watcher) {
  11713. vm._watcher.teardown();
  11714. }
  11715. var i = vm._watchers.length;
  11716. while (i--) {
  11717. vm._watchers[i].teardown();
  11718. }
  11719. // remove reference from data ob
  11720. // frozen object may not have observer.
  11721. if (vm._data.__ob__) {
  11722. vm._data.__ob__.vmCount--;
  11723. }
  11724. // call the last hook...
  11725. vm._isDestroyed = true;
  11726. // invoke destroy hooks on current rendered tree
  11727. vm.__patch__(vm._vnode, null);
  11728. // fire destroyed hook
  11729. callHook(vm, 'destroyed');
  11730. // turn off all instance listeners.
  11731. vm.$off();
  11732. // remove __vue__ reference
  11733. if (vm.$el) {
  11734. vm.$el.__vue__ = null;
  11735. }
  11736. // release circular reference (#6759)
  11737. if (vm.$vnode) {
  11738. vm.$vnode.parent = null;
  11739. }
  11740. };
  11741. }
  11742. function updateChildComponent (
  11743. vm,
  11744. propsData,
  11745. listeners,
  11746. parentVnode,
  11747. renderChildren
  11748. ) {
  11749. if (true) {
  11750. isUpdatingChildComponent = true;
  11751. }
  11752. // determine whether component has slot children
  11753. // we need to do this before overwriting $options._renderChildren.
  11754. // check if there are dynamic scopedSlots (hand-written or compiled but with
  11755. // dynamic slot names). Static scoped slots compiled from template has the
  11756. // "$stable" marker.
  11757. var newScopedSlots = parentVnode.data.scopedSlots;
  11758. var oldScopedSlots = vm.$scopedSlots;
  11759. var hasDynamicScopedSlot = !!(
  11760. (newScopedSlots && !newScopedSlots.$stable) ||
  11761. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  11762. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  11763. );
  11764. // Any static slot children from the parent may have changed during parent's
  11765. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  11766. // update is necessary to ensure correctness.
  11767. var needsForceUpdate = !!(
  11768. renderChildren || // has new static slots
  11769. vm.$options._renderChildren || // has old static slots
  11770. hasDynamicScopedSlot
  11771. );
  11772. vm.$options._parentVnode = parentVnode;
  11773. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  11774. if (vm._vnode) { // update child tree's parent
  11775. vm._vnode.parent = parentVnode;
  11776. }
  11777. vm.$options._renderChildren = renderChildren;
  11778. // update $attrs and $listeners hash
  11779. // these are also reactive so they may trigger child update if the child
  11780. // used them during render
  11781. vm.$attrs = parentVnode.data.attrs || emptyObject;
  11782. vm.$listeners = listeners || emptyObject;
  11783. // update props
  11784. if (propsData && vm.$options.props) {
  11785. toggleObserving(false);
  11786. var props = vm._props;
  11787. var propKeys = vm.$options._propKeys || [];
  11788. for (var i = 0; i < propKeys.length; i++) {
  11789. var key = propKeys[i];
  11790. var propOptions = vm.$options.props; // wtf flow?
  11791. props[key] = validateProp(key, propOptions, propsData, vm);
  11792. }
  11793. toggleObserving(true);
  11794. // keep a copy of raw propsData
  11795. vm.$options.propsData = propsData;
  11796. }
  11797. // fixed by xxxxxx update properties(mp runtime)
  11798. vm._$updateProperties && vm._$updateProperties(vm);
  11799. // update listeners
  11800. listeners = listeners || emptyObject;
  11801. var oldListeners = vm.$options._parentListeners;
  11802. vm.$options._parentListeners = listeners;
  11803. updateComponentListeners(vm, listeners, oldListeners);
  11804. // resolve slots + force update if has children
  11805. if (needsForceUpdate) {
  11806. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  11807. vm.$forceUpdate();
  11808. }
  11809. if (true) {
  11810. isUpdatingChildComponent = false;
  11811. }
  11812. }
  11813. function isInInactiveTree (vm) {
  11814. while (vm && (vm = vm.$parent)) {
  11815. if (vm._inactive) { return true }
  11816. }
  11817. return false
  11818. }
  11819. function activateChildComponent (vm, direct) {
  11820. if (direct) {
  11821. vm._directInactive = false;
  11822. if (isInInactiveTree(vm)) {
  11823. return
  11824. }
  11825. } else if (vm._directInactive) {
  11826. return
  11827. }
  11828. if (vm._inactive || vm._inactive === null) {
  11829. vm._inactive = false;
  11830. for (var i = 0; i < vm.$children.length; i++) {
  11831. activateChildComponent(vm.$children[i]);
  11832. }
  11833. callHook(vm, 'activated');
  11834. }
  11835. }
  11836. function deactivateChildComponent (vm, direct) {
  11837. if (direct) {
  11838. vm._directInactive = true;
  11839. if (isInInactiveTree(vm)) {
  11840. return
  11841. }
  11842. }
  11843. if (!vm._inactive) {
  11844. vm._inactive = true;
  11845. for (var i = 0; i < vm.$children.length; i++) {
  11846. deactivateChildComponent(vm.$children[i]);
  11847. }
  11848. callHook(vm, 'deactivated');
  11849. }
  11850. }
  11851. function callHook (vm, hook) {
  11852. // #7573 disable dep collection when invoking lifecycle hooks
  11853. pushTarget();
  11854. var handlers = vm.$options[hook];
  11855. var info = hook + " hook";
  11856. if (handlers) {
  11857. for (var i = 0, j = handlers.length; i < j; i++) {
  11858. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  11859. }
  11860. }
  11861. if (vm._hasHookEvent) {
  11862. vm.$emit('hook:' + hook);
  11863. }
  11864. popTarget();
  11865. }
  11866. /* */
  11867. var MAX_UPDATE_COUNT = 100;
  11868. var queue = [];
  11869. var activatedChildren = [];
  11870. var has = {};
  11871. var circular = {};
  11872. var waiting = false;
  11873. var flushing = false;
  11874. var index = 0;
  11875. /**
  11876. * Reset the scheduler's state.
  11877. */
  11878. function resetSchedulerState () {
  11879. index = queue.length = activatedChildren.length = 0;
  11880. has = {};
  11881. if (true) {
  11882. circular = {};
  11883. }
  11884. waiting = flushing = false;
  11885. }
  11886. // Async edge case #6566 requires saving the timestamp when event listeners are
  11887. // attached. However, calling performance.now() has a perf overhead especially
  11888. // if the page has thousands of event listeners. Instead, we take a timestamp
  11889. // every time the scheduler flushes and use that for all event listeners
  11890. // attached during that flush.
  11891. var currentFlushTimestamp = 0;
  11892. // Async edge case fix requires storing an event listener's attach timestamp.
  11893. var getNow = Date.now;
  11894. // Determine what event timestamp the browser is using. Annoyingly, the
  11895. // timestamp can either be hi-res (relative to page load) or low-res
  11896. // (relative to UNIX epoch), so in order to compare time we have to use the
  11897. // same timestamp type when saving the flush timestamp.
  11898. // All IE versions use low-res event timestamps, and have problematic clock
  11899. // implementations (#9632)
  11900. if (inBrowser && !isIE) {
  11901. var performance = window.performance;
  11902. if (
  11903. performance &&
  11904. typeof performance.now === 'function' &&
  11905. getNow() > document.createEvent('Event').timeStamp
  11906. ) {
  11907. // if the event timestamp, although evaluated AFTER the Date.now(), is
  11908. // smaller than it, it means the event is using a hi-res timestamp,
  11909. // and we need to use the hi-res version for event listener timestamps as
  11910. // well.
  11911. getNow = function () { return performance.now(); };
  11912. }
  11913. }
  11914. /**
  11915. * Flush both queues and run the watchers.
  11916. */
  11917. function flushSchedulerQueue () {
  11918. currentFlushTimestamp = getNow();
  11919. flushing = true;
  11920. var watcher, id;
  11921. // Sort queue before flush.
  11922. // This ensures that:
  11923. // 1. Components are updated from parent to child. (because parent is always
  11924. // created before the child)
  11925. // 2. A component's user watchers are run before its render watcher (because
  11926. // user watchers are created before the render watcher)
  11927. // 3. If a component is destroyed during a parent component's watcher run,
  11928. // its watchers can be skipped.
  11929. queue.sort(function (a, b) { return a.id - b.id; });
  11930. // do not cache length because more watchers might be pushed
  11931. // as we run existing watchers
  11932. for (index = 0; index < queue.length; index++) {
  11933. watcher = queue[index];
  11934. if (watcher.before) {
  11935. watcher.before();
  11936. }
  11937. id = watcher.id;
  11938. has[id] = null;
  11939. watcher.run();
  11940. // in dev build, check and stop circular updates.
  11941. if ( true && has[id] != null) {
  11942. circular[id] = (circular[id] || 0) + 1;
  11943. if (circular[id] > MAX_UPDATE_COUNT) {
  11944. warn(
  11945. 'You may have an infinite update loop ' + (
  11946. watcher.user
  11947. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  11948. : "in a component render function."
  11949. ),
  11950. watcher.vm
  11951. );
  11952. break
  11953. }
  11954. }
  11955. }
  11956. // keep copies of post queues before resetting state
  11957. var activatedQueue = activatedChildren.slice();
  11958. var updatedQueue = queue.slice();
  11959. resetSchedulerState();
  11960. // call component updated and activated hooks
  11961. callActivatedHooks(activatedQueue);
  11962. callUpdatedHooks(updatedQueue);
  11963. // devtool hook
  11964. /* istanbul ignore if */
  11965. if (devtools && config.devtools) {
  11966. devtools.emit('flush');
  11967. }
  11968. }
  11969. function callUpdatedHooks (queue) {
  11970. var i = queue.length;
  11971. while (i--) {
  11972. var watcher = queue[i];
  11973. var vm = watcher.vm;
  11974. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  11975. callHook(vm, 'updated');
  11976. }
  11977. }
  11978. }
  11979. /**
  11980. * Queue a kept-alive component that was activated during patch.
  11981. * The queue will be processed after the entire tree has been patched.
  11982. */
  11983. function queueActivatedComponent (vm) {
  11984. // setting _inactive to false here so that a render function can
  11985. // rely on checking whether it's in an inactive tree (e.g. router-view)
  11986. vm._inactive = false;
  11987. activatedChildren.push(vm);
  11988. }
  11989. function callActivatedHooks (queue) {
  11990. for (var i = 0; i < queue.length; i++) {
  11991. queue[i]._inactive = true;
  11992. activateChildComponent(queue[i], true /* true */);
  11993. }
  11994. }
  11995. /**
  11996. * Push a watcher into the watcher queue.
  11997. * Jobs with duplicate IDs will be skipped unless it's
  11998. * pushed when the queue is being flushed.
  11999. */
  12000. function queueWatcher (watcher) {
  12001. var id = watcher.id;
  12002. if (has[id] == null) {
  12003. has[id] = true;
  12004. if (!flushing) {
  12005. queue.push(watcher);
  12006. } else {
  12007. // if already flushing, splice the watcher based on its id
  12008. // if already past its id, it will be run next immediately.
  12009. var i = queue.length - 1;
  12010. while (i > index && queue[i].id > watcher.id) {
  12011. i--;
  12012. }
  12013. queue.splice(i + 1, 0, watcher);
  12014. }
  12015. // queue the flush
  12016. if (!waiting) {
  12017. waiting = true;
  12018. if ( true && !config.async) {
  12019. flushSchedulerQueue();
  12020. return
  12021. }
  12022. nextTick(flushSchedulerQueue);
  12023. }
  12024. }
  12025. }
  12026. /* */
  12027. var uid$2 = 0;
  12028. /**
  12029. * A watcher parses an expression, collects dependencies,
  12030. * and fires callback when the expression value changes.
  12031. * This is used for both the $watch() api and directives.
  12032. */
  12033. var Watcher = function Watcher (
  12034. vm,
  12035. expOrFn,
  12036. cb,
  12037. options,
  12038. isRenderWatcher
  12039. ) {
  12040. this.vm = vm;
  12041. if (isRenderWatcher) {
  12042. vm._watcher = this;
  12043. }
  12044. vm._watchers.push(this);
  12045. // options
  12046. if (options) {
  12047. this.deep = !!options.deep;
  12048. this.user = !!options.user;
  12049. this.lazy = !!options.lazy;
  12050. this.sync = !!options.sync;
  12051. this.before = options.before;
  12052. } else {
  12053. this.deep = this.user = this.lazy = this.sync = false;
  12054. }
  12055. this.cb = cb;
  12056. this.id = ++uid$2; // uid for batching
  12057. this.active = true;
  12058. this.dirty = this.lazy; // for lazy watchers
  12059. this.deps = [];
  12060. this.newDeps = [];
  12061. this.depIds = new _Set();
  12062. this.newDepIds = new _Set();
  12063. this.expression = true
  12064. ? expOrFn.toString()
  12065. : undefined;
  12066. // parse expression for getter
  12067. if (typeof expOrFn === 'function') {
  12068. this.getter = expOrFn;
  12069. } else {
  12070. this.getter = parsePath(expOrFn);
  12071. if (!this.getter) {
  12072. this.getter = noop;
  12073. true && warn(
  12074. "Failed watching path: \"" + expOrFn + "\" " +
  12075. 'Watcher only accepts simple dot-delimited paths. ' +
  12076. 'For full control, use a function instead.',
  12077. vm
  12078. );
  12079. }
  12080. }
  12081. this.value = this.lazy
  12082. ? undefined
  12083. : this.get();
  12084. };
  12085. /**
  12086. * Evaluate the getter, and re-collect dependencies.
  12087. */
  12088. Watcher.prototype.get = function get () {
  12089. pushTarget(this);
  12090. var value;
  12091. var vm = this.vm;
  12092. try {
  12093. value = this.getter.call(vm, vm);
  12094. } catch (e) {
  12095. if (this.user) {
  12096. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  12097. } else {
  12098. throw e
  12099. }
  12100. } finally {
  12101. // "touch" every property so they are all tracked as
  12102. // dependencies for deep watching
  12103. if (this.deep) {
  12104. traverse(value);
  12105. }
  12106. popTarget();
  12107. this.cleanupDeps();
  12108. }
  12109. return value
  12110. };
  12111. /**
  12112. * Add a dependency to this directive.
  12113. */
  12114. Watcher.prototype.addDep = function addDep (dep) {
  12115. var id = dep.id;
  12116. if (!this.newDepIds.has(id)) {
  12117. this.newDepIds.add(id);
  12118. this.newDeps.push(dep);
  12119. if (!this.depIds.has(id)) {
  12120. dep.addSub(this);
  12121. }
  12122. }
  12123. };
  12124. /**
  12125. * Clean up for dependency collection.
  12126. */
  12127. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  12128. var i = this.deps.length;
  12129. while (i--) {
  12130. var dep = this.deps[i];
  12131. if (!this.newDepIds.has(dep.id)) {
  12132. dep.removeSub(this);
  12133. }
  12134. }
  12135. var tmp = this.depIds;
  12136. this.depIds = this.newDepIds;
  12137. this.newDepIds = tmp;
  12138. this.newDepIds.clear();
  12139. tmp = this.deps;
  12140. this.deps = this.newDeps;
  12141. this.newDeps = tmp;
  12142. this.newDeps.length = 0;
  12143. };
  12144. /**
  12145. * Subscriber interface.
  12146. * Will be called when a dependency changes.
  12147. */
  12148. Watcher.prototype.update = function update () {
  12149. /* istanbul ignore else */
  12150. if (this.lazy) {
  12151. this.dirty = true;
  12152. } else if (this.sync) {
  12153. this.run();
  12154. } else {
  12155. queueWatcher(this);
  12156. }
  12157. };
  12158. /**
  12159. * Scheduler job interface.
  12160. * Will be called by the scheduler.
  12161. */
  12162. Watcher.prototype.run = function run () {
  12163. if (this.active) {
  12164. var value = this.get();
  12165. if (
  12166. value !== this.value ||
  12167. // Deep watchers and watchers on Object/Arrays should fire even
  12168. // when the value is the same, because the value may
  12169. // have mutated.
  12170. isObject(value) ||
  12171. this.deep
  12172. ) {
  12173. // set new value
  12174. var oldValue = this.value;
  12175. this.value = value;
  12176. if (this.user) {
  12177. try {
  12178. this.cb.call(this.vm, value, oldValue);
  12179. } catch (e) {
  12180. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  12181. }
  12182. } else {
  12183. this.cb.call(this.vm, value, oldValue);
  12184. }
  12185. }
  12186. }
  12187. };
  12188. /**
  12189. * Evaluate the value of the watcher.
  12190. * This only gets called for lazy watchers.
  12191. */
  12192. Watcher.prototype.evaluate = function evaluate () {
  12193. this.value = this.get();
  12194. this.dirty = false;
  12195. };
  12196. /**
  12197. * Depend on all deps collected by this watcher.
  12198. */
  12199. Watcher.prototype.depend = function depend () {
  12200. var i = this.deps.length;
  12201. while (i--) {
  12202. this.deps[i].depend();
  12203. }
  12204. };
  12205. /**
  12206. * Remove self from all dependencies' subscriber list.
  12207. */
  12208. Watcher.prototype.teardown = function teardown () {
  12209. if (this.active) {
  12210. // remove self from vm's watcher list
  12211. // this is a somewhat expensive operation so we skip it
  12212. // if the vm is being destroyed.
  12213. if (!this.vm._isBeingDestroyed) {
  12214. remove(this.vm._watchers, this);
  12215. }
  12216. var i = this.deps.length;
  12217. while (i--) {
  12218. this.deps[i].removeSub(this);
  12219. }
  12220. this.active = false;
  12221. }
  12222. };
  12223. /* */
  12224. var sharedPropertyDefinition = {
  12225. enumerable: true,
  12226. configurable: true,
  12227. get: noop,
  12228. set: noop
  12229. };
  12230. function proxy (target, sourceKey, key) {
  12231. sharedPropertyDefinition.get = function proxyGetter () {
  12232. return this[sourceKey][key]
  12233. };
  12234. sharedPropertyDefinition.set = function proxySetter (val) {
  12235. this[sourceKey][key] = val;
  12236. };
  12237. Object.defineProperty(target, key, sharedPropertyDefinition);
  12238. }
  12239. function initState (vm) {
  12240. vm._watchers = [];
  12241. var opts = vm.$options;
  12242. if (opts.props) { initProps(vm, opts.props); }
  12243. if (opts.methods) { initMethods(vm, opts.methods); }
  12244. if (opts.data) {
  12245. initData(vm);
  12246. } else {
  12247. observe(vm._data = {}, true /* asRootData */);
  12248. }
  12249. if (opts.computed) { initComputed(vm, opts.computed); }
  12250. if (opts.watch && opts.watch !== nativeWatch) {
  12251. initWatch(vm, opts.watch);
  12252. }
  12253. }
  12254. function initProps (vm, propsOptions) {
  12255. var propsData = vm.$options.propsData || {};
  12256. var props = vm._props = {};
  12257. // cache prop keys so that future props updates can iterate using Array
  12258. // instead of dynamic object key enumeration.
  12259. var keys = vm.$options._propKeys = [];
  12260. var isRoot = !vm.$parent;
  12261. // root instance props should be converted
  12262. if (!isRoot) {
  12263. toggleObserving(false);
  12264. }
  12265. var loop = function ( key ) {
  12266. keys.push(key);
  12267. var value = validateProp(key, propsOptions, propsData, vm);
  12268. /* istanbul ignore else */
  12269. if (true) {
  12270. var hyphenatedKey = hyphenate(key);
  12271. if (isReservedAttribute(hyphenatedKey) ||
  12272. config.isReservedAttr(hyphenatedKey)) {
  12273. warn(
  12274. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  12275. vm
  12276. );
  12277. }
  12278. defineReactive$$1(props, key, value, function () {
  12279. if (!isRoot && !isUpdatingChildComponent) {
  12280. {
  12281. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  12282. return
  12283. }
  12284. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  12285. if(
  12286. key === 'value' &&
  12287. Array.isArray(vm.$options.behaviors) &&
  12288. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12289. ){
  12290. return
  12291. }
  12292. if(vm._getFormData){
  12293. return
  12294. }
  12295. var $parent = vm.$parent;
  12296. while($parent){
  12297. if($parent.__next_tick_pending){
  12298. return
  12299. }
  12300. $parent = $parent.$parent;
  12301. }
  12302. }
  12303. warn(
  12304. "Avoid mutating a prop directly since the value will be " +
  12305. "overwritten whenever the parent component re-renders. " +
  12306. "Instead, use a data or computed property based on the prop's " +
  12307. "value. Prop being mutated: \"" + key + "\"",
  12308. vm
  12309. );
  12310. }
  12311. });
  12312. } else {}
  12313. // static props are already proxied on the component's prototype
  12314. // during Vue.extend(). We only need to proxy props defined at
  12315. // instantiation here.
  12316. if (!(key in vm)) {
  12317. proxy(vm, "_props", key);
  12318. }
  12319. };
  12320. for (var key in propsOptions) loop( key );
  12321. toggleObserving(true);
  12322. }
  12323. function initData (vm) {
  12324. var data = vm.$options.data;
  12325. data = vm._data = typeof data === 'function'
  12326. ? getData(data, vm)
  12327. : data || {};
  12328. if (!isPlainObject(data)) {
  12329. data = {};
  12330. true && warn(
  12331. 'data functions should return an object:\n' +
  12332. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  12333. vm
  12334. );
  12335. }
  12336. // proxy data on instance
  12337. var keys = Object.keys(data);
  12338. var props = vm.$options.props;
  12339. var methods = vm.$options.methods;
  12340. var i = keys.length;
  12341. while (i--) {
  12342. var key = keys[i];
  12343. if (true) {
  12344. if (methods && hasOwn(methods, key)) {
  12345. warn(
  12346. ("Method \"" + key + "\" has already been defined as a data property."),
  12347. vm
  12348. );
  12349. }
  12350. }
  12351. if (props && hasOwn(props, key)) {
  12352. true && warn(
  12353. "The data property \"" + key + "\" is already declared as a prop. " +
  12354. "Use prop default value instead.",
  12355. vm
  12356. );
  12357. } else if (!isReserved(key)) {
  12358. proxy(vm, "_data", key);
  12359. }
  12360. }
  12361. // observe data
  12362. observe(data, true /* asRootData */);
  12363. }
  12364. function getData (data, vm) {
  12365. // #7573 disable dep collection when invoking data getters
  12366. pushTarget();
  12367. try {
  12368. return data.call(vm, vm)
  12369. } catch (e) {
  12370. handleError(e, vm, "data()");
  12371. return {}
  12372. } finally {
  12373. popTarget();
  12374. }
  12375. }
  12376. var computedWatcherOptions = { lazy: true };
  12377. function initComputed (vm, computed) {
  12378. // $flow-disable-line
  12379. var watchers = vm._computedWatchers = Object.create(null);
  12380. // computed properties are just getters during SSR
  12381. var isSSR = isServerRendering();
  12382. for (var key in computed) {
  12383. var userDef = computed[key];
  12384. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  12385. if ( true && getter == null) {
  12386. warn(
  12387. ("Getter is missing for computed property \"" + key + "\"."),
  12388. vm
  12389. );
  12390. }
  12391. if (!isSSR) {
  12392. // create internal watcher for the computed property.
  12393. watchers[key] = new Watcher(
  12394. vm,
  12395. getter || noop,
  12396. noop,
  12397. computedWatcherOptions
  12398. );
  12399. }
  12400. // component-defined computed properties are already defined on the
  12401. // component prototype. We only need to define computed properties defined
  12402. // at instantiation here.
  12403. if (!(key in vm)) {
  12404. defineComputed(vm, key, userDef);
  12405. } else if (true) {
  12406. if (key in vm.$data) {
  12407. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  12408. } else if (vm.$options.props && key in vm.$options.props) {
  12409. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  12410. }
  12411. }
  12412. }
  12413. }
  12414. function defineComputed (
  12415. target,
  12416. key,
  12417. userDef
  12418. ) {
  12419. var shouldCache = !isServerRendering();
  12420. if (typeof userDef === 'function') {
  12421. sharedPropertyDefinition.get = shouldCache
  12422. ? createComputedGetter(key)
  12423. : createGetterInvoker(userDef);
  12424. sharedPropertyDefinition.set = noop;
  12425. } else {
  12426. sharedPropertyDefinition.get = userDef.get
  12427. ? shouldCache && userDef.cache !== false
  12428. ? createComputedGetter(key)
  12429. : createGetterInvoker(userDef.get)
  12430. : noop;
  12431. sharedPropertyDefinition.set = userDef.set || noop;
  12432. }
  12433. if ( true &&
  12434. sharedPropertyDefinition.set === noop) {
  12435. sharedPropertyDefinition.set = function () {
  12436. warn(
  12437. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  12438. this
  12439. );
  12440. };
  12441. }
  12442. Object.defineProperty(target, key, sharedPropertyDefinition);
  12443. }
  12444. function createComputedGetter (key) {
  12445. return function computedGetter () {
  12446. var watcher = this._computedWatchers && this._computedWatchers[key];
  12447. if (watcher) {
  12448. if (watcher.dirty) {
  12449. watcher.evaluate();
  12450. }
  12451. if (Dep.SharedObject.target) {// fixed by xxxxxx
  12452. watcher.depend();
  12453. }
  12454. return watcher.value
  12455. }
  12456. }
  12457. }
  12458. function createGetterInvoker(fn) {
  12459. return function computedGetter () {
  12460. return fn.call(this, this)
  12461. }
  12462. }
  12463. function initMethods (vm, methods) {
  12464. var props = vm.$options.props;
  12465. for (var key in methods) {
  12466. if (true) {
  12467. if (typeof methods[key] !== 'function') {
  12468. warn(
  12469. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  12470. "Did you reference the function correctly?",
  12471. vm
  12472. );
  12473. }
  12474. if (props && hasOwn(props, key)) {
  12475. warn(
  12476. ("Method \"" + key + "\" has already been defined as a prop."),
  12477. vm
  12478. );
  12479. }
  12480. if ((key in vm) && isReserved(key)) {
  12481. warn(
  12482. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  12483. "Avoid defining component methods that start with _ or $."
  12484. );
  12485. }
  12486. }
  12487. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  12488. }
  12489. }
  12490. function initWatch (vm, watch) {
  12491. for (var key in watch) {
  12492. var handler = watch[key];
  12493. if (Array.isArray(handler)) {
  12494. for (var i = 0; i < handler.length; i++) {
  12495. createWatcher(vm, key, handler[i]);
  12496. }
  12497. } else {
  12498. createWatcher(vm, key, handler);
  12499. }
  12500. }
  12501. }
  12502. function createWatcher (
  12503. vm,
  12504. expOrFn,
  12505. handler,
  12506. options
  12507. ) {
  12508. if (isPlainObject(handler)) {
  12509. options = handler;
  12510. handler = handler.handler;
  12511. }
  12512. if (typeof handler === 'string') {
  12513. handler = vm[handler];
  12514. }
  12515. return vm.$watch(expOrFn, handler, options)
  12516. }
  12517. function stateMixin (Vue) {
  12518. // flow somehow has problems with directly declared definition object
  12519. // when using Object.defineProperty, so we have to procedurally build up
  12520. // the object here.
  12521. var dataDef = {};
  12522. dataDef.get = function () { return this._data };
  12523. var propsDef = {};
  12524. propsDef.get = function () { return this._props };
  12525. if (true) {
  12526. dataDef.set = function () {
  12527. warn(
  12528. 'Avoid replacing instance root $data. ' +
  12529. 'Use nested data properties instead.',
  12530. this
  12531. );
  12532. };
  12533. propsDef.set = function () {
  12534. warn("$props is readonly.", this);
  12535. };
  12536. }
  12537. Object.defineProperty(Vue.prototype, '$data', dataDef);
  12538. Object.defineProperty(Vue.prototype, '$props', propsDef);
  12539. Vue.prototype.$set = set;
  12540. Vue.prototype.$delete = del;
  12541. Vue.prototype.$watch = function (
  12542. expOrFn,
  12543. cb,
  12544. options
  12545. ) {
  12546. var vm = this;
  12547. if (isPlainObject(cb)) {
  12548. return createWatcher(vm, expOrFn, cb, options)
  12549. }
  12550. options = options || {};
  12551. options.user = true;
  12552. var watcher = new Watcher(vm, expOrFn, cb, options);
  12553. if (options.immediate) {
  12554. try {
  12555. cb.call(vm, watcher.value);
  12556. } catch (error) {
  12557. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  12558. }
  12559. }
  12560. return function unwatchFn () {
  12561. watcher.teardown();
  12562. }
  12563. };
  12564. }
  12565. /* */
  12566. var uid$3 = 0;
  12567. function initMixin (Vue) {
  12568. Vue.prototype._init = function (options) {
  12569. var vm = this;
  12570. // a uid
  12571. vm._uid = uid$3++;
  12572. var startTag, endTag;
  12573. /* istanbul ignore if */
  12574. if ( true && config.performance && mark) {
  12575. startTag = "vue-perf-start:" + (vm._uid);
  12576. endTag = "vue-perf-end:" + (vm._uid);
  12577. mark(startTag);
  12578. }
  12579. // a flag to avoid this being observed
  12580. vm._isVue = true;
  12581. // merge options
  12582. if (options && options._isComponent) {
  12583. // optimize internal component instantiation
  12584. // since dynamic options merging is pretty slow, and none of the
  12585. // internal component options needs special treatment.
  12586. initInternalComponent(vm, options);
  12587. } else {
  12588. vm.$options = mergeOptions(
  12589. resolveConstructorOptions(vm.constructor),
  12590. options || {},
  12591. vm
  12592. );
  12593. }
  12594. /* istanbul ignore else */
  12595. if (true) {
  12596. initProxy(vm);
  12597. } else {}
  12598. // expose real self
  12599. vm._self = vm;
  12600. initLifecycle(vm);
  12601. initEvents(vm);
  12602. initRender(vm);
  12603. callHook(vm, 'beforeCreate');
  12604. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  12605. initState(vm);
  12606. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  12607. !vm._$fallback && callHook(vm, 'created');
  12608. /* istanbul ignore if */
  12609. if ( true && config.performance && mark) {
  12610. vm._name = formatComponentName(vm, false);
  12611. mark(endTag);
  12612. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  12613. }
  12614. if (vm.$options.el) {
  12615. vm.$mount(vm.$options.el);
  12616. }
  12617. };
  12618. }
  12619. function initInternalComponent (vm, options) {
  12620. var opts = vm.$options = Object.create(vm.constructor.options);
  12621. // doing this because it's faster than dynamic enumeration.
  12622. var parentVnode = options._parentVnode;
  12623. opts.parent = options.parent;
  12624. opts._parentVnode = parentVnode;
  12625. var vnodeComponentOptions = parentVnode.componentOptions;
  12626. opts.propsData = vnodeComponentOptions.propsData;
  12627. opts._parentListeners = vnodeComponentOptions.listeners;
  12628. opts._renderChildren = vnodeComponentOptions.children;
  12629. opts._componentTag = vnodeComponentOptions.tag;
  12630. if (options.render) {
  12631. opts.render = options.render;
  12632. opts.staticRenderFns = options.staticRenderFns;
  12633. }
  12634. }
  12635. function resolveConstructorOptions (Ctor) {
  12636. var options = Ctor.options;
  12637. if (Ctor.super) {
  12638. var superOptions = resolveConstructorOptions(Ctor.super);
  12639. var cachedSuperOptions = Ctor.superOptions;
  12640. if (superOptions !== cachedSuperOptions) {
  12641. // super option changed,
  12642. // need to resolve new options.
  12643. Ctor.superOptions = superOptions;
  12644. // check if there are any late-modified/attached options (#4976)
  12645. var modifiedOptions = resolveModifiedOptions(Ctor);
  12646. // update base extend options
  12647. if (modifiedOptions) {
  12648. extend(Ctor.extendOptions, modifiedOptions);
  12649. }
  12650. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  12651. if (options.name) {
  12652. options.components[options.name] = Ctor;
  12653. }
  12654. }
  12655. }
  12656. return options
  12657. }
  12658. function resolveModifiedOptions (Ctor) {
  12659. var modified;
  12660. var latest = Ctor.options;
  12661. var sealed = Ctor.sealedOptions;
  12662. for (var key in latest) {
  12663. if (latest[key] !== sealed[key]) {
  12664. if (!modified) { modified = {}; }
  12665. modified[key] = latest[key];
  12666. }
  12667. }
  12668. return modified
  12669. }
  12670. function Vue (options) {
  12671. if ( true &&
  12672. !(this instanceof Vue)
  12673. ) {
  12674. warn('Vue is a constructor and should be called with the `new` keyword');
  12675. }
  12676. this._init(options);
  12677. }
  12678. initMixin(Vue);
  12679. stateMixin(Vue);
  12680. eventsMixin(Vue);
  12681. lifecycleMixin(Vue);
  12682. renderMixin(Vue);
  12683. /* */
  12684. function initUse (Vue) {
  12685. Vue.use = function (plugin) {
  12686. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  12687. if (installedPlugins.indexOf(plugin) > -1) {
  12688. return this
  12689. }
  12690. // additional parameters
  12691. var args = toArray(arguments, 1);
  12692. args.unshift(this);
  12693. if (typeof plugin.install === 'function') {
  12694. plugin.install.apply(plugin, args);
  12695. } else if (typeof plugin === 'function') {
  12696. plugin.apply(null, args);
  12697. }
  12698. installedPlugins.push(plugin);
  12699. return this
  12700. };
  12701. }
  12702. /* */
  12703. function initMixin$1 (Vue) {
  12704. Vue.mixin = function (mixin) {
  12705. this.options = mergeOptions(this.options, mixin);
  12706. return this
  12707. };
  12708. }
  12709. /* */
  12710. function initExtend (Vue) {
  12711. /**
  12712. * Each instance constructor, including Vue, has a unique
  12713. * cid. This enables us to create wrapped "child
  12714. * constructors" for prototypal inheritance and cache them.
  12715. */
  12716. Vue.cid = 0;
  12717. var cid = 1;
  12718. /**
  12719. * Class inheritance
  12720. */
  12721. Vue.extend = function (extendOptions) {
  12722. extendOptions = extendOptions || {};
  12723. var Super = this;
  12724. var SuperId = Super.cid;
  12725. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  12726. if (cachedCtors[SuperId]) {
  12727. return cachedCtors[SuperId]
  12728. }
  12729. var name = extendOptions.name || Super.options.name;
  12730. if ( true && name) {
  12731. validateComponentName(name);
  12732. }
  12733. var Sub = function VueComponent (options) {
  12734. this._init(options);
  12735. };
  12736. Sub.prototype = Object.create(Super.prototype);
  12737. Sub.prototype.constructor = Sub;
  12738. Sub.cid = cid++;
  12739. Sub.options = mergeOptions(
  12740. Super.options,
  12741. extendOptions
  12742. );
  12743. Sub['super'] = Super;
  12744. // For props and computed properties, we define the proxy getters on
  12745. // the Vue instances at extension time, on the extended prototype. This
  12746. // avoids Object.defineProperty calls for each instance created.
  12747. if (Sub.options.props) {
  12748. initProps$1(Sub);
  12749. }
  12750. if (Sub.options.computed) {
  12751. initComputed$1(Sub);
  12752. }
  12753. // allow further extension/mixin/plugin usage
  12754. Sub.extend = Super.extend;
  12755. Sub.mixin = Super.mixin;
  12756. Sub.use = Super.use;
  12757. // create asset registers, so extended classes
  12758. // can have their private assets too.
  12759. ASSET_TYPES.forEach(function (type) {
  12760. Sub[type] = Super[type];
  12761. });
  12762. // enable recursive self-lookup
  12763. if (name) {
  12764. Sub.options.components[name] = Sub;
  12765. }
  12766. // keep a reference to the super options at extension time.
  12767. // later at instantiation we can check if Super's options have
  12768. // been updated.
  12769. Sub.superOptions = Super.options;
  12770. Sub.extendOptions = extendOptions;
  12771. Sub.sealedOptions = extend({}, Sub.options);
  12772. // cache constructor
  12773. cachedCtors[SuperId] = Sub;
  12774. return Sub
  12775. };
  12776. }
  12777. function initProps$1 (Comp) {
  12778. var props = Comp.options.props;
  12779. for (var key in props) {
  12780. proxy(Comp.prototype, "_props", key);
  12781. }
  12782. }
  12783. function initComputed$1 (Comp) {
  12784. var computed = Comp.options.computed;
  12785. for (var key in computed) {
  12786. defineComputed(Comp.prototype, key, computed[key]);
  12787. }
  12788. }
  12789. /* */
  12790. function initAssetRegisters (Vue) {
  12791. /**
  12792. * Create asset registration methods.
  12793. */
  12794. ASSET_TYPES.forEach(function (type) {
  12795. Vue[type] = function (
  12796. id,
  12797. definition
  12798. ) {
  12799. if (!definition) {
  12800. return this.options[type + 's'][id]
  12801. } else {
  12802. /* istanbul ignore if */
  12803. if ( true && type === 'component') {
  12804. validateComponentName(id);
  12805. }
  12806. if (type === 'component' && isPlainObject(definition)) {
  12807. definition.name = definition.name || id;
  12808. definition = this.options._base.extend(definition);
  12809. }
  12810. if (type === 'directive' && typeof definition === 'function') {
  12811. definition = { bind: definition, update: definition };
  12812. }
  12813. this.options[type + 's'][id] = definition;
  12814. return definition
  12815. }
  12816. };
  12817. });
  12818. }
  12819. /* */
  12820. function getComponentName (opts) {
  12821. return opts && (opts.Ctor.options.name || opts.tag)
  12822. }
  12823. function matches (pattern, name) {
  12824. if (Array.isArray(pattern)) {
  12825. return pattern.indexOf(name) > -1
  12826. } else if (typeof pattern === 'string') {
  12827. return pattern.split(',').indexOf(name) > -1
  12828. } else if (isRegExp(pattern)) {
  12829. return pattern.test(name)
  12830. }
  12831. /* istanbul ignore next */
  12832. return false
  12833. }
  12834. function pruneCache (keepAliveInstance, filter) {
  12835. var cache = keepAliveInstance.cache;
  12836. var keys = keepAliveInstance.keys;
  12837. var _vnode = keepAliveInstance._vnode;
  12838. for (var key in cache) {
  12839. var cachedNode = cache[key];
  12840. if (cachedNode) {
  12841. var name = getComponentName(cachedNode.componentOptions);
  12842. if (name && !filter(name)) {
  12843. pruneCacheEntry(cache, key, keys, _vnode);
  12844. }
  12845. }
  12846. }
  12847. }
  12848. function pruneCacheEntry (
  12849. cache,
  12850. key,
  12851. keys,
  12852. current
  12853. ) {
  12854. var cached$$1 = cache[key];
  12855. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  12856. cached$$1.componentInstance.$destroy();
  12857. }
  12858. cache[key] = null;
  12859. remove(keys, key);
  12860. }
  12861. var patternTypes = [String, RegExp, Array];
  12862. var KeepAlive = {
  12863. name: 'keep-alive',
  12864. abstract: true,
  12865. props: {
  12866. include: patternTypes,
  12867. exclude: patternTypes,
  12868. max: [String, Number]
  12869. },
  12870. created: function created () {
  12871. this.cache = Object.create(null);
  12872. this.keys = [];
  12873. },
  12874. destroyed: function destroyed () {
  12875. for (var key in this.cache) {
  12876. pruneCacheEntry(this.cache, key, this.keys);
  12877. }
  12878. },
  12879. mounted: function mounted () {
  12880. var this$1 = this;
  12881. this.$watch('include', function (val) {
  12882. pruneCache(this$1, function (name) { return matches(val, name); });
  12883. });
  12884. this.$watch('exclude', function (val) {
  12885. pruneCache(this$1, function (name) { return !matches(val, name); });
  12886. });
  12887. },
  12888. render: function render () {
  12889. var slot = this.$slots.default;
  12890. var vnode = getFirstComponentChild(slot);
  12891. var componentOptions = vnode && vnode.componentOptions;
  12892. if (componentOptions) {
  12893. // check pattern
  12894. var name = getComponentName(componentOptions);
  12895. var ref = this;
  12896. var include = ref.include;
  12897. var exclude = ref.exclude;
  12898. if (
  12899. // not included
  12900. (include && (!name || !matches(include, name))) ||
  12901. // excluded
  12902. (exclude && name && matches(exclude, name))
  12903. ) {
  12904. return vnode
  12905. }
  12906. var ref$1 = this;
  12907. var cache = ref$1.cache;
  12908. var keys = ref$1.keys;
  12909. var key = vnode.key == null
  12910. // same constructor may get registered as different local components
  12911. // so cid alone is not enough (#3269)
  12912. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  12913. : vnode.key;
  12914. if (cache[key]) {
  12915. vnode.componentInstance = cache[key].componentInstance;
  12916. // make current key freshest
  12917. remove(keys, key);
  12918. keys.push(key);
  12919. } else {
  12920. cache[key] = vnode;
  12921. keys.push(key);
  12922. // prune oldest entry
  12923. if (this.max && keys.length > parseInt(this.max)) {
  12924. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  12925. }
  12926. }
  12927. vnode.data.keepAlive = true;
  12928. }
  12929. return vnode || (slot && slot[0])
  12930. }
  12931. };
  12932. var builtInComponents = {
  12933. KeepAlive: KeepAlive
  12934. };
  12935. /* */
  12936. function initGlobalAPI (Vue) {
  12937. // config
  12938. var configDef = {};
  12939. configDef.get = function () { return config; };
  12940. if (true) {
  12941. configDef.set = function () {
  12942. warn(
  12943. 'Do not replace the Vue.config object, set individual fields instead.'
  12944. );
  12945. };
  12946. }
  12947. Object.defineProperty(Vue, 'config', configDef);
  12948. // exposed util methods.
  12949. // NOTE: these are not considered part of the public API - avoid relying on
  12950. // them unless you are aware of the risk.
  12951. Vue.util = {
  12952. warn: warn,
  12953. extend: extend,
  12954. mergeOptions: mergeOptions,
  12955. defineReactive: defineReactive$$1
  12956. };
  12957. Vue.set = set;
  12958. Vue.delete = del;
  12959. Vue.nextTick = nextTick;
  12960. // 2.6 explicit observable API
  12961. Vue.observable = function (obj) {
  12962. observe(obj);
  12963. return obj
  12964. };
  12965. Vue.options = Object.create(null);
  12966. ASSET_TYPES.forEach(function (type) {
  12967. Vue.options[type + 's'] = Object.create(null);
  12968. });
  12969. // this is used to identify the "base" constructor to extend all plain-object
  12970. // components with in Weex's multi-instance scenarios.
  12971. Vue.options._base = Vue;
  12972. extend(Vue.options.components, builtInComponents);
  12973. initUse(Vue);
  12974. initMixin$1(Vue);
  12975. initExtend(Vue);
  12976. initAssetRegisters(Vue);
  12977. }
  12978. initGlobalAPI(Vue);
  12979. Object.defineProperty(Vue.prototype, '$isServer', {
  12980. get: isServerRendering
  12981. });
  12982. Object.defineProperty(Vue.prototype, '$ssrContext', {
  12983. get: function get () {
  12984. /* istanbul ignore next */
  12985. return this.$vnode && this.$vnode.ssrContext
  12986. }
  12987. });
  12988. // expose FunctionalRenderContext for ssr runtime helper installation
  12989. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  12990. value: FunctionalRenderContext
  12991. });
  12992. Vue.version = '2.6.11';
  12993. /**
  12994. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  12995. */
  12996. var ARRAYTYPE = '[object Array]';
  12997. var OBJECTTYPE = '[object Object]';
  12998. // const FUNCTIONTYPE = '[object Function]'
  12999. function diff(current, pre) {
  13000. var result = {};
  13001. syncKeys(current, pre);
  13002. _diff(current, pre, '', result);
  13003. return result
  13004. }
  13005. function syncKeys(current, pre) {
  13006. if (current === pre) { return }
  13007. var rootCurrentType = type(current);
  13008. var rootPreType = type(pre);
  13009. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  13010. if(Object.keys(current).length >= Object.keys(pre).length){
  13011. for (var key in pre) {
  13012. var currentValue = current[key];
  13013. if (currentValue === undefined) {
  13014. current[key] = null;
  13015. } else {
  13016. syncKeys(currentValue, pre[key]);
  13017. }
  13018. }
  13019. }
  13020. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  13021. if (current.length >= pre.length) {
  13022. pre.forEach(function (item, index) {
  13023. syncKeys(current[index], item);
  13024. });
  13025. }
  13026. }
  13027. }
  13028. function _diff(current, pre, path, result) {
  13029. if (current === pre) { return }
  13030. var rootCurrentType = type(current);
  13031. var rootPreType = type(pre);
  13032. if (rootCurrentType == OBJECTTYPE) {
  13033. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  13034. setResult(result, path, current);
  13035. } else {
  13036. var loop = function ( key ) {
  13037. var currentValue = current[key];
  13038. var preValue = pre[key];
  13039. var currentType = type(currentValue);
  13040. var preType = type(preValue);
  13041. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  13042. if (currentValue !== pre[key]) {
  13043. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13044. }
  13045. } else if (currentType == ARRAYTYPE) {
  13046. if (preType != ARRAYTYPE) {
  13047. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13048. } else {
  13049. if (currentValue.length < preValue.length) {
  13050. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13051. } else {
  13052. currentValue.forEach(function (item, index) {
  13053. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  13054. });
  13055. }
  13056. }
  13057. } else if (currentType == OBJECTTYPE) {
  13058. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  13059. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  13060. } else {
  13061. for (var subKey in currentValue) {
  13062. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  13063. }
  13064. }
  13065. }
  13066. };
  13067. for (var key in current) loop( key );
  13068. }
  13069. } else if (rootCurrentType == ARRAYTYPE) {
  13070. if (rootPreType != ARRAYTYPE) {
  13071. setResult(result, path, current);
  13072. } else {
  13073. if (current.length < pre.length) {
  13074. setResult(result, path, current);
  13075. } else {
  13076. current.forEach(function (item, index) {
  13077. _diff(item, pre[index], path + '[' + index + ']', result);
  13078. });
  13079. }
  13080. }
  13081. } else {
  13082. setResult(result, path, current);
  13083. }
  13084. }
  13085. function setResult(result, k, v) {
  13086. // if (type(v) != FUNCTIONTYPE) {
  13087. result[k] = v;
  13088. // }
  13089. }
  13090. function type(obj) {
  13091. return Object.prototype.toString.call(obj)
  13092. }
  13093. /* */
  13094. function flushCallbacks$1(vm) {
  13095. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  13096. if (Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  13097. var mpInstance = vm.$scope;
  13098. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  13099. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  13100. }
  13101. var copies = vm.__next_tick_callbacks.slice(0);
  13102. vm.__next_tick_callbacks.length = 0;
  13103. for (var i = 0; i < copies.length; i++) {
  13104. copies[i]();
  13105. }
  13106. }
  13107. }
  13108. function hasRenderWatcher(vm) {
  13109. return queue.find(function (watcher) { return vm._watcher === watcher; })
  13110. }
  13111. function nextTick$1(vm, cb) {
  13112. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  13113. //2.nextTick 之前存在 render watcher
  13114. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  13115. if(Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  13116. var mpInstance = vm.$scope;
  13117. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  13118. ']:nextVueTick');
  13119. }
  13120. return nextTick(cb, vm)
  13121. }else{
  13122. if(Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  13123. var mpInstance$1 = vm.$scope;
  13124. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  13125. ']:nextMPTick');
  13126. }
  13127. }
  13128. var _resolve;
  13129. if (!vm.__next_tick_callbacks) {
  13130. vm.__next_tick_callbacks = [];
  13131. }
  13132. vm.__next_tick_callbacks.push(function () {
  13133. if (cb) {
  13134. try {
  13135. cb.call(vm);
  13136. } catch (e) {
  13137. handleError(e, vm, 'nextTick');
  13138. }
  13139. } else if (_resolve) {
  13140. _resolve(vm);
  13141. }
  13142. });
  13143. // $flow-disable-line
  13144. if (!cb && typeof Promise !== 'undefined') {
  13145. return new Promise(function (resolve) {
  13146. _resolve = resolve;
  13147. })
  13148. }
  13149. }
  13150. /* */
  13151. function cloneWithData(vm) {
  13152. // 确保当前 vm 所有数据被同步
  13153. var ret = Object.create(null);
  13154. var dataKeys = [].concat(
  13155. Object.keys(vm._data || {}),
  13156. Object.keys(vm._computedWatchers || {}));
  13157. dataKeys.reduce(function(ret, key) {
  13158. ret[key] = vm[key];
  13159. return ret
  13160. }, ret);
  13161. // vue-composition-api
  13162. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  13163. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  13164. if (rawBindings) {
  13165. Object.keys(rawBindings).forEach(function (key) {
  13166. ret[key] = vm[key];
  13167. });
  13168. }
  13169. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  13170. Object.assign(ret, vm.$mp.data || {});
  13171. if (
  13172. Array.isArray(vm.$options.behaviors) &&
  13173. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  13174. ) { //form-field
  13175. ret['name'] = vm.name;
  13176. ret['value'] = vm.value;
  13177. }
  13178. return JSON.parse(JSON.stringify(ret))
  13179. }
  13180. var patch = function(oldVnode, vnode) {
  13181. var this$1 = this;
  13182. if (vnode === null) { //destroy
  13183. return
  13184. }
  13185. if (this.mpType === 'page' || this.mpType === 'component') {
  13186. var mpInstance = this.$scope;
  13187. var data = Object.create(null);
  13188. try {
  13189. data = cloneWithData(this);
  13190. } catch (err) {
  13191. console.error(err);
  13192. }
  13193. data.__webviewId__ = mpInstance.data.__webviewId__;
  13194. var mpData = Object.create(null);
  13195. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  13196. mpData[key] = mpInstance.data[key];
  13197. });
  13198. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  13199. if (Object.keys(diffData).length) {
  13200. if (Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  13201. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  13202. ']差量更新',
  13203. JSON.stringify(diffData));
  13204. }
  13205. this.__next_tick_pending = true;
  13206. mpInstance.setData(diffData, function () {
  13207. this$1.__next_tick_pending = false;
  13208. flushCallbacks$1(this$1);
  13209. });
  13210. } else {
  13211. flushCallbacks$1(this);
  13212. }
  13213. }
  13214. };
  13215. /* */
  13216. function createEmptyRender() {
  13217. }
  13218. function mountComponent$1(
  13219. vm,
  13220. el,
  13221. hydrating
  13222. ) {
  13223. if (!vm.mpType) {//main.js 中的 new Vue
  13224. return vm
  13225. }
  13226. if (vm.mpType === 'app') {
  13227. vm.$options.render = createEmptyRender;
  13228. }
  13229. if (!vm.$options.render) {
  13230. vm.$options.render = createEmptyRender;
  13231. if (true) {
  13232. /* istanbul ignore if */
  13233. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  13234. vm.$options.el || el) {
  13235. warn(
  13236. 'You are using the runtime-only build of Vue where the template ' +
  13237. 'compiler is not available. Either pre-compile the templates into ' +
  13238. 'render functions, or use the compiler-included build.',
  13239. vm
  13240. );
  13241. } else {
  13242. warn(
  13243. 'Failed to mount component: template or render function not defined.',
  13244. vm
  13245. );
  13246. }
  13247. }
  13248. }
  13249. !vm._$fallback && callHook(vm, 'beforeMount');
  13250. var updateComponent = function () {
  13251. vm._update(vm._render(), hydrating);
  13252. };
  13253. // we set this to vm._watcher inside the watcher's constructor
  13254. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  13255. // component's mounted hook), which relies on vm._watcher being already defined
  13256. new Watcher(vm, updateComponent, noop, {
  13257. before: function before() {
  13258. if (vm._isMounted && !vm._isDestroyed) {
  13259. callHook(vm, 'beforeUpdate');
  13260. }
  13261. }
  13262. }, true /* isRenderWatcher */);
  13263. hydrating = false;
  13264. return vm
  13265. }
  13266. /* */
  13267. function renderClass (
  13268. staticClass,
  13269. dynamicClass
  13270. ) {
  13271. if (isDef(staticClass) || isDef(dynamicClass)) {
  13272. return concat(staticClass, stringifyClass(dynamicClass))
  13273. }
  13274. /* istanbul ignore next */
  13275. return ''
  13276. }
  13277. function concat (a, b) {
  13278. return a ? b ? (a + ' ' + b) : a : (b || '')
  13279. }
  13280. function stringifyClass (value) {
  13281. if (Array.isArray(value)) {
  13282. return stringifyArray(value)
  13283. }
  13284. if (isObject(value)) {
  13285. return stringifyObject(value)
  13286. }
  13287. if (typeof value === 'string') {
  13288. return value
  13289. }
  13290. /* istanbul ignore next */
  13291. return ''
  13292. }
  13293. function stringifyArray (value) {
  13294. var res = '';
  13295. var stringified;
  13296. for (var i = 0, l = value.length; i < l; i++) {
  13297. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  13298. if (res) { res += ' '; }
  13299. res += stringified;
  13300. }
  13301. }
  13302. return res
  13303. }
  13304. function stringifyObject (value) {
  13305. var res = '';
  13306. for (var key in value) {
  13307. if (value[key]) {
  13308. if (res) { res += ' '; }
  13309. res += key;
  13310. }
  13311. }
  13312. return res
  13313. }
  13314. /* */
  13315. var parseStyleText = cached(function (cssText) {
  13316. var res = {};
  13317. var listDelimiter = /;(?![^(]*\))/g;
  13318. var propertyDelimiter = /:(.+)/;
  13319. cssText.split(listDelimiter).forEach(function (item) {
  13320. if (item) {
  13321. var tmp = item.split(propertyDelimiter);
  13322. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  13323. }
  13324. });
  13325. return res
  13326. });
  13327. // normalize possible array / string values into Object
  13328. function normalizeStyleBinding (bindingStyle) {
  13329. if (Array.isArray(bindingStyle)) {
  13330. return toObject(bindingStyle)
  13331. }
  13332. if (typeof bindingStyle === 'string') {
  13333. return parseStyleText(bindingStyle)
  13334. }
  13335. return bindingStyle
  13336. }
  13337. /* */
  13338. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  13339. function getTarget(obj, path) {
  13340. var parts = path.split('.');
  13341. var key = parts[0];
  13342. if (key.indexOf('__$n') === 0) { //number index
  13343. key = parseInt(key.replace('__$n', ''));
  13344. }
  13345. if (parts.length === 1) {
  13346. return obj[key]
  13347. }
  13348. return getTarget(obj[key], parts.slice(1).join('.'))
  13349. }
  13350. function internalMixin(Vue) {
  13351. Vue.config.errorHandler = function(err, vm, info) {
  13352. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  13353. console.error(err);
  13354. /* eslint-disable no-undef */
  13355. var app = typeof getApp === 'function' && getApp();
  13356. if (app && app.onError) {
  13357. app.onError(err);
  13358. }
  13359. };
  13360. var oldEmit = Vue.prototype.$emit;
  13361. Vue.prototype.$emit = function(event) {
  13362. if (this.$scope && event) {
  13363. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  13364. __args__: toArray(arguments, 1)
  13365. });
  13366. }
  13367. return oldEmit.apply(this, arguments)
  13368. };
  13369. Vue.prototype.$nextTick = function(fn) {
  13370. return nextTick$1(this, fn)
  13371. };
  13372. MP_METHODS.forEach(function (method) {
  13373. Vue.prototype[method] = function(args) {
  13374. if (this.$scope && this.$scope[method]) {
  13375. return this.$scope[method](args)
  13376. }
  13377. // mp-alipay
  13378. if (typeof my === 'undefined') {
  13379. return
  13380. }
  13381. if (method === 'createSelectorQuery') {
  13382. /* eslint-disable no-undef */
  13383. return my.createSelectorQuery(args)
  13384. } else if (method === 'createIntersectionObserver') {
  13385. /* eslint-disable no-undef */
  13386. return my.createIntersectionObserver(args)
  13387. }
  13388. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  13389. };
  13390. });
  13391. Vue.prototype.__init_provide = initProvide;
  13392. Vue.prototype.__init_injections = initInjections;
  13393. Vue.prototype.__call_hook = function(hook, args) {
  13394. var vm = this;
  13395. // #7573 disable dep collection when invoking lifecycle hooks
  13396. pushTarget();
  13397. var handlers = vm.$options[hook];
  13398. var info = hook + " hook";
  13399. var ret;
  13400. if (handlers) {
  13401. for (var i = 0, j = handlers.length; i < j; i++) {
  13402. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  13403. }
  13404. }
  13405. if (vm._hasHookEvent) {
  13406. vm.$emit('hook:' + hook, args);
  13407. }
  13408. popTarget();
  13409. return ret
  13410. };
  13411. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  13412. if (Array.isArray(modifiers)) {
  13413. if (modifiers.indexOf('trim') !== -1) {
  13414. value = value.trim();
  13415. }
  13416. if (modifiers.indexOf('number') !== -1) {
  13417. value = this._n(value);
  13418. }
  13419. }
  13420. if (!target) {
  13421. target = this;
  13422. }
  13423. // 解决动态属性添加
  13424. Vue.set(target, key, value);
  13425. };
  13426. Vue.prototype.__set_sync = function(target, key, value) {
  13427. if (!target) {
  13428. target = this;
  13429. }
  13430. // 解决动态属性添加
  13431. Vue.set(target, key, value);
  13432. };
  13433. Vue.prototype.__get_orig = function(item) {
  13434. if (isPlainObject(item)) {
  13435. return item['$orig'] || item
  13436. }
  13437. return item
  13438. };
  13439. Vue.prototype.__get_value = function(dataPath, target) {
  13440. return getTarget(target || this, dataPath)
  13441. };
  13442. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  13443. return renderClass(staticClass, dynamicClass)
  13444. };
  13445. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  13446. if (!dynamicStyle && !staticStyle) {
  13447. return ''
  13448. }
  13449. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  13450. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  13451. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  13452. };
  13453. Vue.prototype.__map = function(val, iteratee) {
  13454. //TODO 暂不考虑 string
  13455. var ret, i, l, keys, key;
  13456. if (Array.isArray(val)) {
  13457. ret = new Array(val.length);
  13458. for (i = 0, l = val.length; i < l; i++) {
  13459. ret[i] = iteratee(val[i], i);
  13460. }
  13461. return ret
  13462. } else if (isObject(val)) {
  13463. keys = Object.keys(val);
  13464. ret = Object.create(null);
  13465. for (i = 0, l = keys.length; i < l; i++) {
  13466. key = keys[i];
  13467. ret[key] = iteratee(val[key], key, i);
  13468. }
  13469. return ret
  13470. } else if (typeof val === 'number') {
  13471. ret = new Array(val);
  13472. for (i = 0, l = val; i < l; i++) {
  13473. // 第一个参数暂时仍和小程序一致
  13474. ret[i] = iteratee(i, i);
  13475. }
  13476. return ret
  13477. }
  13478. return []
  13479. };
  13480. }
  13481. /* */
  13482. var LIFECYCLE_HOOKS$1 = [
  13483. //App
  13484. 'onLaunch',
  13485. 'onShow',
  13486. 'onHide',
  13487. 'onUniNViewMessage',
  13488. 'onPageNotFound',
  13489. 'onThemeChange',
  13490. 'onError',
  13491. 'onUnhandledRejection',
  13492. //Page
  13493. 'onInit',
  13494. 'onLoad',
  13495. // 'onShow',
  13496. 'onReady',
  13497. // 'onHide',
  13498. 'onUnload',
  13499. 'onPullDownRefresh',
  13500. 'onReachBottom',
  13501. 'onTabItemTap',
  13502. 'onAddToFavorites',
  13503. 'onShareTimeline',
  13504. 'onShareAppMessage',
  13505. 'onResize',
  13506. 'onPageScroll',
  13507. 'onNavigationBarButtonTap',
  13508. 'onBackPress',
  13509. 'onNavigationBarSearchInputChanged',
  13510. 'onNavigationBarSearchInputConfirmed',
  13511. 'onNavigationBarSearchInputClicked',
  13512. //Component
  13513. // 'onReady', // 兼容旧版本,应该移除该事件
  13514. 'onPageShow',
  13515. 'onPageHide',
  13516. 'onPageResize'
  13517. ];
  13518. function lifecycleMixin$1(Vue) {
  13519. //fixed vue-class-component
  13520. var oldExtend = Vue.extend;
  13521. Vue.extend = function(extendOptions) {
  13522. extendOptions = extendOptions || {};
  13523. var methods = extendOptions.methods;
  13524. if (methods) {
  13525. Object.keys(methods).forEach(function (methodName) {
  13526. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  13527. extendOptions[methodName] = methods[methodName];
  13528. delete methods[methodName];
  13529. }
  13530. });
  13531. }
  13532. return oldExtend.call(this, extendOptions)
  13533. };
  13534. var strategies = Vue.config.optionMergeStrategies;
  13535. var mergeHook = strategies.created;
  13536. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  13537. strategies[hook] = mergeHook;
  13538. });
  13539. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  13540. }
  13541. /* */
  13542. // install platform patch function
  13543. Vue.prototype.__patch__ = patch;
  13544. // public mount method
  13545. Vue.prototype.$mount = function(
  13546. el ,
  13547. hydrating
  13548. ) {
  13549. return mountComponent$1(this, el, hydrating)
  13550. };
  13551. lifecycleMixin$1(Vue);
  13552. internalMixin(Vue);
  13553. /* */
  13554. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  13555. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  13556. /***/ }),
  13557. /***/ 40:
  13558. /*!********************************************************************!*\
  13559. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  13560. \********************************************************************/
  13561. /*! no static exports found */
  13562. /***/ (function(module, exports, __webpack_require__) {
  13563. "use strict";
  13564. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  13565. /**
  13566. * actionsheet: 999
  13567. * modal: 999
  13568. * navigate: 998
  13569. * tabbar: 998
  13570. * toast: 999
  13571. */var _default =
  13572. {
  13573. toast: 10090,
  13574. noNetwork: 10080,
  13575. // popup包含popup,actionsheet,keyboard,picker的值
  13576. popup: 10075,
  13577. mask: 10070,
  13578. navbar: 980,
  13579. topTips: 975,
  13580. sticky: 970,
  13581. indexListSticky: 965 };exports.default = _default;
  13582. /***/ }),
  13583. /***/ 41:
  13584. /*!***********************************!*\
  13585. !*** E:/fp/md/mdapp/api/index.js ***!
  13586. \***********************************/
  13587. /*! no static exports found */
  13588. /***/ (function(module, exports, __webpack_require__) {
  13589. "use strict";
  13590. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  13591. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));
  13592. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 46));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  13593. {
  13594. base: _base.default,
  13595. estate: _estate.default,
  13596. cust: _cust.default };exports.default = _default;
  13597. /***/ }),
  13598. /***/ 42:
  13599. /*!**********************************!*\
  13600. !*** E:/fp/md/mdapp/api/base.js ***!
  13601. \**********************************/
  13602. /*! no static exports found */
  13603. /***/ (function(module, exports, __webpack_require__) {
  13604. "use strict";
  13605. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13606. {
  13607. apilogin: function apilogin(params) {// 登录
  13608. return (0, _http.request)('api/login', params, 'loading');
  13609. },
  13610. apiregister: function apiregister(params) {// 注册
  13611. return (0, _http.request)('api/register', params, 'loading');
  13612. },
  13613. apisendsms: function apisendsms(params) {// 发送短信
  13614. return (0, _http.request)('api/send/sms', params, 'loading');
  13615. },
  13616. apicaptcha: function apicaptcha(params) {// 验证码图片
  13617. return (0, _http.request)('api/captcha', params, 'loading');
  13618. },
  13619. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  13620. return (0, _http.request)('api/check/captcha', params);
  13621. },
  13622. apiwxlogin: function apiwxlogin(params) {// 微信登录
  13623. return (0, _http.request)('api/wx/login', params, 'loading');
  13624. },
  13625. apiwxautologin: function apiwxautologin(params) {// 微信登录 自动
  13626. return (0, _http.request)('api/wx/autologin', params, 'loading');
  13627. },
  13628. apiuserinfo: function apiuserinfo(params) {// 用户信息
  13629. return (0, _http.request)('api/user/info', params, 'loading');
  13630. },
  13631. apiuseredit: function apiuseredit(params) {// 用户编辑
  13632. return (0, _http.request)('api/user/edit', params, 'loading');
  13633. },
  13634. apiuserbindwechat: function apiuserbindwechat(params) {// 绑定微信
  13635. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  13636. },
  13637. apiuserauthadd: function apiuserauthadd(params) {// 用户认证 - 提交认证
  13638. return (0, _http.request)('api/user/auth/add', params, 'loading');
  13639. },
  13640. apiuserauthinfo: function apiuserauthinfo(params) {// 用户认证 - 认证详情
  13641. return (0, _http.request)('api/user/auth/info', params, 'loading');
  13642. },
  13643. apiuploadcloudpiv: function apiuploadcloudpiv(params) {// 图片上传云接口
  13644. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  13645. },
  13646. apidicttree: function apidicttree(params) {// 字典
  13647. return (0, _http.request)('api/dict/tree', params, 'loading');
  13648. },
  13649. apiuserauthlist: function apiuserauthlist(params) {// 认证列表
  13650. return (0, _http.request)('api/user/auth/list', params, 'loading');
  13651. },
  13652. apiuserauthedit: function apiuserauthedit(params) {// 认证 审核 中介
  13653. return (0, _http.request)('api/user/auth/edit', params, 'loading');
  13654. },
  13655. apideptauthedit: function apideptauthedit(params) {// 认证 审核 渠道
  13656. return (0, _http.request)('api/dept/auth/edit', params, 'loading');
  13657. },
  13658. apiuserreferreredit: function apiuserreferreredit(params) {// 修改推荐人
  13659. return (0, _http.request)('api/user/referrer/edit', params, 'loading');
  13660. },
  13661. apiusernoticeopen: function apiusernoticeopen(params) {// 公众号 推送 打开
  13662. return (0, _http.request)('api/user/notice/open', params, 'loading');
  13663. },
  13664. apiusernoticeclose: function apiusernoticeclose(params) {// 公众号 推送 关闭
  13665. return (0, _http.request)('api/user/notice/close', params, 'loading');
  13666. } };exports.default = _default;
  13667. /***/ }),
  13668. /***/ 43:
  13669. /*!************************************!*\
  13670. !*** E:/fp/md/mdapp/utils/http.js ***!
  13671. \************************************/
  13672. /*! no static exports found */
  13673. /***/ (function(module, exports, __webpack_require__) {
  13674. "use strict";
  13675. /* 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;}
  13676. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  13677. return new Promise(function (resolve, reject) {
  13678. if (options.loadingStr === 'loading') {
  13679. uni.showLoading({
  13680. mask: true,
  13681. title: '加载中..' });
  13682. }
  13683. var token = uni.getStorageSync('MD_token') || '';
  13684. var header = {
  13685. 'Content-Type': 'application/json',
  13686. 'token': token
  13687. // 'Content-Type': 'application/x-www-form-urlencoded'
  13688. };
  13689. var params = _objectSpread({}, options.data);
  13690. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  13691. for (var key in options.data) {
  13692. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  13693. params[key] = '';
  13694. }
  13695. }
  13696. var url = uni.baseUrl + options.url;
  13697. // let url = options.url
  13698. if (options.queryData) {
  13699. var qStr = '';
  13700. for (var k in options.queryData) {
  13701. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  13702. }
  13703. qStr = qStr.substr(0, qStr.length - 1);
  13704. url += "?".concat(qStr);
  13705. }
  13706. uni.request({
  13707. url: url,
  13708. data: _objectSpread({},
  13709. params),
  13710. header: header,
  13711. method: options.method || 'POST',
  13712. complete: function complete(res) {
  13713. if (options.loadingStr === 'loading') {
  13714. uni.hideLoading();
  13715. }
  13716. },
  13717. success: function success(res) {var
  13718. cData = res.data;
  13719. var code = cData.errno;
  13720. switch (code) {
  13721. case 0:
  13722. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  13723. break;
  13724. case 401:
  13725. case 404:
  13726. case 405:
  13727. uni.removeStorageSync('MD_userInfo');
  13728. var u2 = uni.getStorageSync('MD_userInfo2');
  13729. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  13730. uni.login({
  13731. success: function success(res) {
  13732. if (res.code) {
  13733. uni.api.base.apiwxautologin({ code: res.code }).then(function (cData) {
  13734. if (cData.token === 'error') {
  13735. uni.removeStorageSync('MD_token');
  13736. } else {
  13737. uni.setStorageSync('MD_userInfo', cData);
  13738. uni.setStorageSync('MD_token', cData.token);
  13739. uni.api.base.apidicttree().then(function (res) {
  13740. var cObj = res || {};
  13741. var newDict = {};
  13742. for (var _k in cObj) {
  13743. var cArr = cObj[_k].map(function (item) {
  13744. return _objectSpread(_objectSpread({},
  13745. item), {}, {
  13746. key: item.dict_label,
  13747. val: item.dict_value });
  13748. });
  13749. newDict[_k] = cArr;
  13750. }
  13751. uni.setStorageSync('MD_dict', newDict);
  13752. });
  13753. uni.api.base.apiuserinfo().then(function (res2) {
  13754. uni.setStorageSync('MD_userInfo2', res2);
  13755. uni.reLaunch({
  13756. url: '/pages/index/index' });
  13757. });
  13758. }
  13759. });
  13760. }
  13761. } });
  13762. } else {
  13763. uni.showToast({
  13764. title: "\u8BF7\u5148\u767B\u5F55~",
  13765. icon: 'none' });
  13766. uni.navigateTo({
  13767. url: '/pages/user/login/login' });
  13768. }
  13769. break;
  13770. default:
  13771. uni.showModal({
  13772. title: '提示',
  13773. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  13774. return reject(cData);}
  13775. // resolve()
  13776. },
  13777. fail: function fail(err) {
  13778. console.log(err);
  13779. reject(err);
  13780. } });
  13781. });
  13782. };
  13783. // export default Http
  13784. function request(url, data, loadingStr, queryData) {
  13785. return Http({
  13786. url: url,
  13787. data: data,
  13788. loadingStr: loadingStr,
  13789. queryData: queryData });
  13790. }
  13791. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13792. /***/ }),
  13793. /***/ 44:
  13794. /*!*************************************!*\
  13795. !*** E:/fp/md/mdapp/utils/index.js ***!
  13796. \*************************************/
  13797. /*! no static exports found */
  13798. /***/ (function(module, exports, __webpack_require__) {
  13799. "use strict";
  13800. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  13801. * @param {string} str
  13802. * @returns {string}
  13803. */
  13804. function strTrim(str) {
  13805. return str.replace(/(^\s*)|(\s*$)/g, '');
  13806. }
  13807. /**
  13808. * @param {Number} num
  13809. * @returns {string}
  13810. */
  13811. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  13812. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  13813. var arr = numArr[0].split('').reverse();
  13814. var res = [];
  13815. for (var i = 0; i < arr.length; i++) {
  13816. if (i % 3 === 0 && i !== 0) {
  13817. res.push(',');
  13818. }
  13819. res.push(arr[i]);
  13820. }
  13821. res.reverse();
  13822. if (numArr[1]) {
  13823. res = res.join('').concat('.' + numArr[1]);
  13824. } else {
  13825. res = res.join('');
  13826. }
  13827. // let res = num.toString().replace(/\d+/, function(n){
  13828. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  13829. // return $1 + ","
  13830. // })
  13831. // })
  13832. // toLocaleString()
  13833. return res;
  13834. }
  13835. /**
  13836. * @param {Array} arr
  13837. * @returns {Object}
  13838. */
  13839. function arrToObj(arr) {
  13840. var obj = {};
  13841. if (Object.prototype.toString.call(arr) === '[object Array]') {
  13842. if (arr.length > 0) {
  13843. arr.forEach(function (item) {
  13844. obj[item.val] = item.key;
  13845. });
  13846. }
  13847. }
  13848. return obj;
  13849. }
  13850. /**
  13851. * @param {any} val
  13852. * @returns {Boolean}
  13853. */
  13854. function noEmpty(val) {
  13855. if (val === null || val === undefined || val === '') {
  13856. return false;
  13857. } else {
  13858. return true;
  13859. }
  13860. }
  13861. /**
  13862. * @param {Number} date
  13863. * @param {Boolean} onlyDate
  13864. * @returns {String}
  13865. * function time(time = +new Date()) {
  13866. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  13867. return date.toJSON().substr(0, 19).replace('T', ' ');
  13868. }
  13869. */
  13870. 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;
  13871. var year = date.getFullYear();
  13872. var month = date.getMonth() + 1;
  13873. month = month > 9 ? month : '0' + month;
  13874. var day = date.getDate();
  13875. day = day > 9 ? day : '0' + day;
  13876. var hour = date.getHours();
  13877. hour = hour > 9 ? hour : '0' + hour;
  13878. var minute = date.getMinutes();
  13879. minute = minute > 9 ? minute : '0' + minute;
  13880. var second = date.getSeconds();
  13881. second = second > 9 ? second : '0' + second;
  13882. var milli = date.getMilliseconds();
  13883. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  13884. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  13885. }
  13886. /***/ }),
  13887. /***/ 45:
  13888. /*!************************************!*\
  13889. !*** E:/fp/md/mdapp/api/estate.js ***!
  13890. \************************************/
  13891. /*! no static exports found */
  13892. /***/ (function(module, exports, __webpack_require__) {
  13893. "use strict";
  13894. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13895. {
  13896. apiestatelist: function apiestatelist(params) {// 楼盘列表
  13897. return (0, _http.request)('api/estate/list', params, 'loading');
  13898. },
  13899. apiestatecontentdetail: function apiestatecontentdetail(params) {// 楼盘 介绍详情
  13900. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  13901. },
  13902. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  13903. return (0, _http.request)('api/report/add', params, 'loading');
  13904. },
  13905. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  13906. return (0, _http.request)('api/report/list', params, 'loading');
  13907. },
  13908. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  13909. return (0, _http.request)('api/report/detail', params, 'loading');
  13910. },
  13911. apireport2detail: function apireport2detail(params) {// 报备 - 报备详情2 普通的报备详情
  13912. return (0, _http.request)('api/report2/detail', params, 'loading');
  13913. },
  13914. apigoverndetail: function apigoverndetail(params) {// 报备 - 报备详情 /govern/detail
  13915. return (0, _http.request)('api/govern/detail', params, 'loading');
  13916. },
  13917. apireportsite: function apireportsite(params) {// 案场 - 报备详情
  13918. return (0, _http.request)('api/report/site', params, 'loading');
  13919. },
  13920. apireportconfirm: function apireportconfirm(params) {// 报备 - 报备确认
  13921. return (0, _http.request)('api/report/confirm', params, 'loading');
  13922. },
  13923. apireportcount: function apireportcount(params) {// 报备 - 报备统计
  13924. return (0, _http.request)('api/report/count', params, 'loading');
  13925. },
  13926. apireportgroupcount: function apireportgroupcount(params) {// 报备 - 报备分组统计
  13927. return (0, _http.request)('api/report/group/count', params, 'loading');
  13928. },
  13929. apiestateinfodetail: function apiestateinfodetail(params) {// 楼盘一页纸
  13930. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  13931. },
  13932. apiestatedetail: function apiestatedetail(params) {// 楼盘详情 copy plus
  13933. return (0, _http.request)('api/estate/detail', params, 'loading');
  13934. },
  13935. apigovernlist: function apigovernlist(params) {// 案场缺课列表
  13936. return (0, _http.request)('api/govern/list', params, 'loading');
  13937. },
  13938. apireportedit: function apireportedit(params) {// 报备修改 接口
  13939. return (0, _http.request)('api/report/edit', params, 'loading');
  13940. },
  13941. apireportsubscrlist: function apireportsubscrlist(params) {// 认购审核列表
  13942. return (0, _http.request)('api/report/subscr/list', params, 'loading');
  13943. },
  13944. apireportsubscrDeal: function apireportsubscrDeal(params) {// 已认购审核
  13945. return (0, _http.request)('api/report/subscr', params, 'loading');
  13946. },
  13947. apireportsignupDeal: function apireportsignupDeal(params) {// 已签约审核
  13948. return (0, _http.request)('api/report/signup', params, 'loading');
  13949. } };exports.default = _default;
  13950. /***/ }),
  13951. /***/ 46:
  13952. /*!**********************************!*\
  13953. !*** E:/fp/md/mdapp/api/cust.js ***!
  13954. \**********************************/
  13955. /*! no static exports found */
  13956. /***/ (function(module, exports, __webpack_require__) {
  13957. "use strict";
  13958. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  13959. {
  13960. apicustomerlist: function apicustomerlist(params) {// 客户 列表
  13961. return (0, _http.request)('api/customer/list', params);
  13962. },
  13963. apicustomeradd: function apicustomeradd(params) {// 客户 添加
  13964. return (0, _http.request)('api/customer/add', params, 'loading');
  13965. },
  13966. apicustomeredit: function apicustomeredit(params) {// 客户 编辑
  13967. return (0, _http.request)('api/customer/edit', params, 'loading');
  13968. },
  13969. apicustomerdel: function apicustomerdel(params) {// 客户 删除
  13970. return (0, _http.request)('api/customer/del', params, 'loading');
  13971. },
  13972. apicustomerdetail: function apicustomerdetail(params) {// 客户 详情
  13973. return (0, _http.request)('api/customer/detail', params, 'loading');
  13974. },
  13975. apireportvisitchange: function apireportvisitchange(params) {// 到访材料添加
  13976. return (0, _http.request)('api/report/visit/change', params, 'loading');
  13977. },
  13978. apireportvisitdetail: function apireportvisitdetail(params) {// 到访材料详情
  13979. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  13980. },
  13981. apireportvisit: function apireportvisit(params) {// 报备到访
  13982. return (0, _http.request)('api/report/visit', params, 'loading');
  13983. },
  13984. apireportverify: function apireportverify(params) {// 报备审核
  13985. return (0, _http.request)('api/report/verify', params, 'loading');
  13986. },
  13987. apideptuserlist: function apideptuserlist(params) {// 我的门店下级人员
  13988. return (0, _http.request)('api/dept/user/list', params, 'loading');
  13989. } };exports.default = _default;
  13990. /***/ }),
  13991. /***/ 47:
  13992. /*!************************************!*\
  13993. !*** E:/fp/md/mdapp/utils/tool.js ***!
  13994. \************************************/
  13995. /*! no static exports found */
  13996. /***/ (function(module, exports, __webpack_require__) {
  13997. "use strict";
  13998. /* 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) {
  13999. // getRandomNum(24, 16)
  14000. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  14001. var uuid = [];
  14002. radix = radix || chars.length;
  14003. if (len) {
  14004. // Compact form
  14005. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  14006. } else {
  14007. // rfc4122, version 4 form
  14008. var r;
  14009. // rfc4122 requires these characters
  14010. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  14011. uuid[14] = '4';
  14012. // Fill in random data.  At i==19 set the high bits of clock sequence as
  14013. // per rfc4122, sec. 4.1.5
  14014. for (var _i = 0; _i < 36; _i++) {
  14015. if (!uuid[_i]) {
  14016. r = 0 | Math.random() * 16;
  14017. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  14018. }
  14019. }
  14020. }
  14021. return uuid.join('') + new Date().getTime();
  14022. };exports.getRandomNum = getRandomNum;
  14023. var msgBase = function msgBase(msgText, bc) {
  14024. uni.showToast({
  14025. title: msgText,
  14026. icon: 'none',
  14027. duration: 2000 }).
  14028. then(function () {
  14029. if (bc) bc();
  14030. });
  14031. };exports.msgBase = msgBase;
  14032. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  14033. uni.showModal({
  14034. title: title,
  14035. content: msgText,
  14036. success: function success(res) {
  14037. if (res.confirm) {
  14038. if (successBc) successBc();
  14039. } else if (res.cancel) {
  14040. if (errorBc) errorBc();
  14041. }
  14042. } });
  14043. };exports.confirmMsgFn = confirmMsgFn;
  14044. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  14045. /***/ }),
  14046. /***/ 5:
  14047. /*!*********************************!*\
  14048. !*** E:/fp/md/mdapp/pages.json ***!
  14049. \*********************************/
  14050. /*! no static exports found */
  14051. /***/ (function(module, exports) {
  14052. /***/ }),
  14053. /***/ 94:
  14054. /*!*************************************************!*\
  14055. !*** E:/fp/md/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  14056. \*************************************************/
  14057. /*! no static exports found */
  14058. /***/ (function(module, exports, __webpack_require__) {
  14059. "use strict";
  14060. /* 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;
  14061. if (!content) return error('复制的内容不能为空 !');
  14062. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  14063. /**
  14064. * 小程序端 和 app端的复制逻辑
  14065. */
  14066. uni.setClipboardData({
  14067. data: content,
  14068. success: function success() {
  14069. _success("复制成功~");
  14070. console.log('success');
  14071. },
  14072. fail: function fail() {
  14073. _success("复制失败~");
  14074. } });
  14075. /**
  14076. * H5端的复制逻辑
  14077. */
  14078. }
  14079. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  14080. /***/ })
  14081. }]);
  14082. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map