1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184 |
- !function(e, t) {
- "object" == typeof exports && "undefined" != typeof module ? t(exports, require("vue")) : "function" == typeof define && define.amd ? define(["exports", "vue"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).vant = {}, e.Vue)
- }(this, (function(e, t) {
- "use strict";
- const o = e=>null != e
- , n = e=>"function" == typeof e
- , a = e=>null !== e && "object" == typeof e
- , r = e=>a(e) && n(e.then) && n(e.catch)
- , l = e=>"[object Date]" === Object.prototype.toString.call(e) && !Number.isNaN(e.getTime());
- function i(e) {
- return e = e.replace(/[^-|\d]/g, ""),
- /^((\+86)|(86))?(1)\d{10}$/.test(e) || /^0[0-9-]{10,13}$/.test(e)
- }
- const s = e=>"number" == typeof e || /^\d+(\.\d+)?$/.test(e);
- function c() {}
- const d = Object.assign
- , u = "undefined" != typeof window;
- function p(e, t) {
- const o = t.split(".");
- let n = e;
- return o.forEach((e=>{
- var t;
- n = a(n) && null != (t = n[e]) ? t : ""
- }
- )),
- n
- }
- function m(e, t, o) {
- return t.reduce(((t,n)=>(o && void 0 === e[n] || (t[n] = e[n]),
- t)), {})
- }
- const f = (e,t)=>JSON.stringify(e) === JSON.stringify(t)
- , v = e=>Array.isArray(e) ? e : [e]
- , h = null
- , g = [Number, String]
- , b = {
- type: Boolean,
- default: !0
- }
- , y = e=>({
- type: e,
- required: !0
- })
- , w = ()=>({
- type: Array,
- default: ()=>[]
- })
- , V = e=>({
- type: Number,
- default: e
- })
- , x = e=>({
- type: g,
- default: e
- })
- , N = e=>({
- type: String,
- default: e
- });
- var C = "undefined" != typeof window;
- function k(e) {
- return C ? requestAnimationFrame(e) : -1
- }
- function S(e) {
- C && cancelAnimationFrame(e)
- }
- function B(e) {
- k((()=>k(e)))
- }
- var T = (e,t)=>({
- top: 0,
- left: 0,
- right: e,
- bottom: t,
- width: e,
- height: t
- })
- , P = e=>{
- const o = t.unref(e);
- if (o === window) {
- const e = o.innerWidth
- , t = o.innerHeight;
- return T(e, t)
- }
- return (null == o ? void 0 : o.getBoundingClientRect) ? o.getBoundingClientRect() : T(0, 0)
- }
- ;
- function D(e) {
- const o = t.inject(e, null);
- if (o) {
- const e = t.getCurrentInstance()
- , {link: n, unlink: a, internalChildren: r} = o;
- n(e),
- t.onUnmounted((()=>a(e)));
- return {
- parent: o,
- index: t.computed((()=>r.indexOf(e)))
- }
- }
- return {
- parent: null,
- index: t.ref(-1)
- }
- }
- function O(e, o, n) {
- const a = function(e) {
- const o = []
- , n = e=>{
- Array.isArray(e) && e.forEach((e=>{
- var a;
- t.isVNode(e) && (o.push(e),
- (null == (a = e.component) ? void 0 : a.subTree) && (o.push(e.component.subTree),
- n(e.component.subTree.children)),
- e.children && n(e.children))
- }
- ))
- }
- ;
- return n(e),
- o
- }(e.subTree.children);
- n.sort(((e,t)=>a.indexOf(e.vnode) - a.indexOf(t.vnode)));
- const r = n.map((e=>e.proxy));
- o.sort(((e,t)=>r.indexOf(e) - r.indexOf(t)))
- }
- function I(e) {
- const o = t.reactive([])
- , n = t.reactive([])
- , a = t.getCurrentInstance();
- return {
- children: o,
- linkChildren: r=>{
- t.provide(e, Object.assign({
- link: e=>{
- e.proxy && (n.push(e),
- o.push(e.proxy),
- O(a, o, n))
- }
- ,
- unlink: e=>{
- const t = n.indexOf(e);
- o.splice(t, 1),
- n.splice(t, 1)
- }
- ,
- children: o,
- internalChildren: n
- }, r))
- }
- }
- }
- var A, z, E = 1e3, $ = 6e4, L = 36e5, M = 24 * L;
- function F(e) {
- let o, n, a, r;
- const l = t.ref(e.time)
- , i = t.computed((()=>{
- return {
- total: e = l.value,
- days: Math.floor(e / M),
- hours: Math.floor(e % M / L),
- minutes: Math.floor(e % L / $),
- seconds: Math.floor(e % $ / E),
- milliseconds: Math.floor(e % E)
- };
- var e
- }
- ))
- , s = ()=>{
- a = !1,
- S(o)
- }
- , c = ()=>Math.max(n - Date.now(), 0)
- , d = t=>{
- var o, n;
- l.value = t,
- null == (o = e.onChange) || o.call(e, i.value),
- 0 === t && (s(),
- null == (n = e.onFinish) || n.call(e))
- }
- , u = ()=>{
- o = k((()=>{
- a && (d(c()),
- l.value > 0 && u())
- }
- ))
- }
- , p = ()=>{
- o = k((()=>{
- if (a) {
- const o = c();
- e = o,
- t = l.value,
- (Math.floor(e / 1e3) !== Math.floor(t / 1e3) || 0 === o) && d(o),
- l.value > 0 && p()
- }
- var e, t
- }
- ))
- }
- , m = ()=>{
- C && (e.millisecond ? u() : p())
- }
- ;
- return t.onBeforeUnmount(s),
- t.onActivated((()=>{
- r && (a = !0,
- r = !1,
- m())
- }
- )),
- t.onDeactivated((()=>{
- a && (s(),
- r = !0)
- }
- )),
- {
- start: ()=>{
- a || (n = Date.now() + l.value,
- a = !0,
- m())
- }
- ,
- pause: s,
- reset: (t=e.time)=>{
- s(),
- l.value = t
- }
- ,
- current: i
- }
- }
- function R(e) {
- let o;
- t.onMounted((()=>{
- e(),
- t.nextTick((()=>{
- o = !0
- }
- ))
- }
- )),
- t.onActivated((()=>{
- o && e()
- }
- ))
- }
- function H(e, o, n={}) {
- if (!C)
- return;
- const {target: a=window, passive: r=!1, capture: l=!1} = n;
- let i;
- const s = n=>{
- const a = t.unref(n);
- a && !i && (a.addEventListener(e, o, {
- capture: l,
- passive: r
- }),
- i = !0)
- }
- , c = n=>{
- const a = t.unref(n);
- a && i && (a.removeEventListener(e, o, l),
- i = !1)
- }
- ;
- t.onUnmounted((()=>c(a))),
- t.onDeactivated((()=>c(a))),
- R((()=>s(a))),
- t.isRef(a) && t.watch(a, ((e,t)=>{
- c(t),
- s(e)
- }
- ))
- }
- function j(e, o, n={}) {
- if (!C)
- return;
- const {eventName: a="click"} = n;
- H(a, (n=>{
- (Array.isArray(e) ? e : [e]).every((e=>{
- const o = t.unref(e);
- return o && !o.contains(n.target)
- }
- )) && o(n)
- }
- ), {
- target: document
- })
- }
- var W, U = /scroll|auto|overlay/i, q = C ? window : void 0;
- function Y(e) {
- return "HTML" !== e.tagName && "BODY" !== e.tagName && 1 === e.nodeType
- }
- function G(e, t=q) {
- let o = e;
- for (; o && o !== t && Y(o); ) {
- const {overflowY: e} = window.getComputedStyle(o);
- if (U.test(e))
- return o;
- o = o.parentNode
- }
- return t
- }
- function X(e, o=q) {
- const n = t.ref();
- return t.onMounted((()=>{
- e.value && (n.value = G(e.value, o))
- }
- )),
- n
- }
- var Z = Symbol("van-field");
- function K(e) {
- const o = t.inject(Z, null);
- o && !o.customValue.value && (o.customValue.value = e,
- t.watch(e, (()=>{
- o.resetValidation(),
- o.validateWithTrigger("onChange")
- }
- )))
- }
- function _(e) {
- const t = "scrollTop"in e ? e.scrollTop : e.pageYOffset;
- return Math.max(t, 0)
- }
- function J(e, t) {
- "scrollTop"in e ? e.scrollTop = t : e.scrollTo(e.scrollX, t)
- }
- function Q() {
- return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0
- }
- function ee(e) {
- J(window, e),
- J(document.body, e)
- }
- function te(e, t) {
- if (e === window)
- return 0;
- const o = t ? _(t) : Q();
- return P(e).top + o
- }
- const oe = !!u && /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());
- function ne() {
- oe && ee(Q())
- }
- const ae = e=>e.stopPropagation();
- function re(e, t) {
- ("boolean" != typeof e.cancelable || e.cancelable) && e.preventDefault(),
- t && ae(e)
- }
- function le(e) {
- const o = t.unref(e);
- if (!o)
- return !1;
- const n = window.getComputedStyle(o)
- , a = "none" === n.display
- , r = null === o.offsetParent && "fixed" !== n.position;
- return a || r
- }
- const {width: ie, height: se} = function() {
- if (!A && (A = t.ref(0),
- z = t.ref(0),
- C)) {
- const e = ()=>{
- A.value = window.innerWidth,
- z.value = window.innerHeight
- }
- ;
- e(),
- window.addEventListener("resize", e, {
- passive: !0
- }),
- window.addEventListener("orientationchange", e, {
- passive: !0
- })
- }
- return {
- width: A,
- height: z
- }
- }();
- function ce(e) {
- if (o(e))
- return s(e) ? `${e}px` : String(e)
- }
- function de(e) {
- if (o(e)) {
- if (Array.isArray(e))
- return {
- width: ce(e[0]),
- height: ce(e[1])
- };
- const t = ce(e);
- return {
- width: t,
- height: t
- }
- }
- }
- function ue(e) {
- const t = {};
- return void 0 !== e && (t.zIndex = +e),
- t
- }
- let pe;
- function me(e) {
- return +(e = e.replace(/rem/g, "")) * function() {
- if (!pe) {
- const e = document.documentElement
- , t = e.style.fontSize || window.getComputedStyle(e).fontSize;
- pe = parseFloat(t)
- }
- return pe
- }()
- }
- function fe(e) {
- if ("number" == typeof e)
- return e;
- if (u) {
- if (e.includes("rem"))
- return me(e);
- if (e.includes("vw"))
- return function(e) {
- return +(e = e.replace(/vw/g, "")) * ie.value / 100
- }(e);
- if (e.includes("vh"))
- return function(e) {
- return +(e = e.replace(/vh/g, "")) * se.value / 100
- }(e)
- }
- return parseFloat(e)
- }
- const ve = /-(\w)/g
- , he = e=>e.replace(ve, ((e,t)=>t.toUpperCase()));
- function ge(e, t=2) {
- let o = e + "";
- for (; o.length < t; )
- o = "0" + o;
- return o
- }
- const be = (e,t,o)=>Math.min(Math.max(e, t), o);
- function ye(e, t, o) {
- const n = e.indexOf(t);
- return -1 === n ? e : "-" === t && 0 !== n ? e.slice(0, n) : e.slice(0, n + 1) + e.slice(n).replace(o, "")
- }
- function we(e, t=!0, o=!0) {
- e = t ? ye(e, ".", /\./g) : e.split(".")[0];
- const n = t ? /[^-0-9.]/g : /[^-0-9]/g;
- return (e = o ? ye(e, "-", /-/g) : e.replace(/-/, "")).replace(n, "")
- }
- function Ve(e, t) {
- const o = 10 ** 10;
- return Math.round((e + t) * o) / o
- }
- const {hasOwnProperty: xe} = Object.prototype;
- function Ne(e, t) {
- return Object.keys(t).forEach((n=>{
- !function(e, t, n) {
- const r = t[n];
- o(r) && (xe.call(e, n) && a(r) ? e[n] = Ne(Object(e[n]), r) : e[n] = r)
- }(e, t, n)
- }
- )),
- e
- }
- const Ce = t.ref("zh-CN")
- , ke = t.reactive({
- "zh-CN": {
- name: "姓名",
- tel: "电话",
- save: "保存",
- confirm: "确认",
- cancel: "取消",
- delete: "删除",
- loading: "加载中...",
- noCoupon: "暂无优惠券",
- nameEmpty: "请填写姓名",
- addContact: "添加联系人",
- telInvalid: "请填写正确的电话",
- vanCalendar: {
- end: "结束",
- start: "开始",
- title: "日期选择",
- weekdays: ["日", "一", "二", "三", "四", "五", "六"],
- monthTitle: (e,t)=>`${e}年${t}月`,
- rangePrompt: e=>`最多选择 ${e} 天`
- },
- vanCascader: {
- select: "请选择"
- },
- vanPagination: {
- prev: "上一页",
- next: "下一页"
- },
- vanPullRefresh: {
- pulling: "下拉即可刷新...",
- loosing: "释放即可刷新..."
- },
- vanSubmitBar: {
- label: "合计:"
- },
- vanCoupon: {
- unlimited: "无门槛",
- discount: e=>`${e}折`,
- condition: e=>`满${e}元可用`
- },
- vanCouponCell: {
- title: "优惠券",
- count: e=>`${e}张可用`
- },
- vanCouponList: {
- exchange: "兑换",
- close: "不使用",
- enable: "可用",
- disabled: "不可用",
- placeholder: "输入优惠码"
- },
- vanAddressEdit: {
- area: "地区",
- areaEmpty: "请选择地区",
- addressEmpty: "请填写详细地址",
- addressDetail: "详细地址",
- defaultAddress: "设为默认收货地址"
- },
- vanAddressList: {
- add: "新增地址"
- }
- }
- })
- , Se = {
- messages: ()=>ke[Ce.value],
- use(e, t) {
- Ce.value = e,
- this.add({
- [e]: t
- })
- },
- add(e={}) {
- Ne(ke, e)
- }
- };
- var Be = Se;
- function Te(e) {
- const t = he(e) + ".";
- return (e,...o)=>{
- const a = Be.messages()
- , r = p(a, t + e) || p(a, e);
- return n(r) ? r(...o) : r
- }
- }
- function Pe(e, t) {
- return t ? "string" == typeof t ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce(((t,o)=>t + Pe(e, o)), "") : Object.keys(t).reduce(((o,n)=>o + (t[n] ? Pe(e, n) : "")), "") : ""
- }
- function De(e) {
- return (t,o)=>(t && "string" != typeof t && (o = t,
- t = ""),
- `${t = t ? `${e}__${t}` : e}${Pe(t, o)}`)
- }
- function Oe(e) {
- const t = `van-${e}`;
- return [t, De(t), Te(t)]
- }
- const Ie = "van-hairline"
- , Ae = `${Ie}--top`
- , ze = `${Ie}--left`
- , Ee = `${Ie}--bottom`
- , $e = `${Ie}--surround`
- , Le = `${Ie}--top-bottom`
- , Me = `${Ie}-unset--top-bottom`
- , Fe = "van-haptics-feedback"
- , Re = Symbol("van-form");
- function He(e, {args: t=[], done: o, canceled: n}) {
- if (e) {
- const a = e.apply(null, t);
- r(a) ? a.then((e=>{
- e ? o() : n && n()
- }
- )).catch(c) : a ? o() : n && n()
- } else
- o()
- }
- function je(e) {
- return e.install = t=>{
- const {name: o} = e;
- o && (t.component(o, e),
- t.component(he(`-${o}`), e))
- }
- ,
- e
- }
- const We = Symbol();
- function Ue(e) {
- const o = t.inject(We, null);
- o && t.watch(o, (t=>{
- t && e()
- }
- ))
- }
- const qe = (e,o)=>{
- const n = t.ref()
- , a = ()=>{
- n.value = P(e).height
- }
- ;
- return t.onMounted((()=>{
- if (t.nextTick(a),
- o)
- for (let e = 1; e <= 3; e++)
- setTimeout(a, 100 * e)
- }
- )),
- Ue((()=>t.nextTick(a))),
- t.watch([ie, se], a),
- n
- }
- ;
- function Ye(e, o) {
- const n = qe(e, !0);
- return e=>t.createVNode("div", {
- class: o("placeholder"),
- style: {
- height: n.value ? `${n.value}px` : void 0
- }
- }, [e()])
- }
- const [Ge,Xe] = Oe("action-bar")
- , Ze = Symbol(Ge)
- , Ke = {
- placeholder: Boolean,
- safeAreaInsetBottom: b
- };
- const _e = je(t.defineComponent({
- name: Ge,
- props: Ke,
- setup(e, {slots: o}) {
- const n = t.ref()
- , a = Ye(n, Xe)
- , {linkChildren: r} = I(Ze);
- r();
- const l = ()=>{
- var a;
- return t.createVNode("div", {
- ref: n,
- class: [Xe(), {
- "van-safe-area-bottom": e.safeAreaInsetBottom
- }]
- }, [null == (a = o.default) ? void 0 : a.call(o)])
- }
- ;
- return ()=>e.placeholder ? a(l) : l()
- }
- }));
- function Je(e) {
- const o = t.getCurrentInstance();
- o && d(o.proxy, e)
- }
- const Qe = {
- to: [String, Object],
- url: String,
- replace: Boolean
- };
- function et({to: e, url: t, replace: o, $router: n}) {
- e && n ? n[o ? "replace" : "push"](e) : t && (o ? location.replace(t) : location.href = t)
- }
- function tt() {
- const e = t.getCurrentInstance().proxy;
- return ()=>et(e)
- }
- const [ot,nt] = Oe("badge")
- , at = {
- dot: Boolean,
- max: g,
- tag: N("div"),
- color: String,
- offset: Array,
- content: g,
- showZero: b,
- position: N("top-right")
- };
- const rt = je(t.defineComponent({
- name: ot,
- props: at,
- setup(e, {slots: n}) {
- const a = ()=>{
- if (n.content)
- return !0;
- const {content: t, showZero: a} = e;
- return o(t) && "" !== t && (a || 0 !== t && "0" !== t)
- }
- , r = ()=>{
- const {dot: t, max: r, content: l} = e;
- if (!t && a())
- return n.content ? n.content() : o(r) && s(l) && +l > r ? `${r}+` : l
- }
- , l = t.computed((()=>{
- const t = {
- background: e.color
- };
- if (e.offset) {
- const [o,a] = e.offset;
- n.default ? (t.top = ce(a),
- t.right = "number" == typeof o ? ce(-o) : o.startsWith("-") ? o.replace("-", "") : `-${o}`) : (t.marginTop = ce(a),
- t.marginLeft = ce(o))
- }
- return t
- }
- ))
- , i = ()=>{
- if (a() || e.dot)
- return t.createVNode("div", {
- class: nt([e.position, {
- dot: e.dot,
- fixed: !!n.default
- }]),
- style: l.value
- }, [r()])
- }
- ;
- return ()=>{
- if (n.default) {
- const {tag: o} = e;
- return t.createVNode(o, {
- class: nt("wrapper")
- }, {
- default: ()=>[n.default(), i()]
- })
- }
- return i()
- }
- }
- }));
- let lt = 2e3;
- const [it,st] = Oe("config-provider")
- , ct = Symbol(it)
- , dt = {
- tag: N("div"),
- theme: N("light"),
- zIndex: Number,
- themeVars: Object,
- themeVarsDark: Object,
- themeVarsLight: Object,
- iconPrefix: String
- };
- var ut = t.defineComponent({
- name: it,
- props: dt,
- setup(e, {slots: o}) {
- const n = t.computed((()=>function(e) {
- const t = {};
- return Object.keys(e).forEach((o=>{
- var n;
- t[`--van-${n = o,
- n.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "")}`] = e[o]
- }
- )),
- t
- }(d({}, e.themeVars, "dark" === e.theme ? e.themeVarsDark : e.themeVarsLight))));
- if (u) {
- const o = ()=>{
- document.documentElement.classList.add(`van-theme-${e.theme}`)
- }
- , n = (t=e.theme)=>{
- document.documentElement.classList.remove(`van-theme-${t}`)
- }
- ;
- t.watch((()=>e.theme), ((e,t)=>{
- t && n(t),
- o()
- }
- ), {
- immediate: !0
- }),
- t.onActivated(o),
- t.onDeactivated(n),
- t.onBeforeUnmount(n)
- }
- return t.provide(ct, e),
- t.watchEffect((()=>{
- var t;
- void 0 !== e.zIndex && (t = e.zIndex,
- lt = t)
- }
- )),
- ()=>t.createVNode(e.tag, {
- class: st(),
- style: n.value
- }, {
- default: ()=>{
- var e;
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- })
- }
- });
- const [pt,mt] = Oe("icon")
- , ft = {
- dot: Boolean,
- tag: N("i"),
- name: String,
- size: g,
- badge: g,
- color: String,
- badgeProps: Object,
- classPrefix: String
- };
- const vt = je(t.defineComponent({
- name: pt,
- props: ft,
- setup(e, {slots: o}) {
- const n = t.inject(ct, null)
- , a = t.computed((()=>e.classPrefix || (null == n ? void 0 : n.iconPrefix) || mt()));
- return ()=>{
- const {tag: n, dot: r, name: l, size: i, badge: s, color: c} = e
- , d = (e=>null == e ? void 0 : e.includes("/"))(l);
- return t.createVNode(rt, t.mergeProps({
- dot: r,
- tag: n,
- class: [a.value, d ? "" : `${a.value}-${l}`],
- style: {
- color: c,
- fontSize: ce(i)
- },
- content: s
- }, e.badgeProps), {
- default: ()=>{
- var e;
- return [null == (e = o.default) ? void 0 : e.call(o), d && t.createVNode("img", {
- class: mt("image"),
- src: l
- }, null)]
- }
- })
- }
- }
- }))
- , [ht,gt] = Oe("loading")
- , bt = Array(12).fill(null).map(((e,o)=>t.createVNode("i", {
- class: gt("line", String(o + 1))
- }, null)))
- , yt = t.createVNode("svg", {
- class: gt("circular"),
- viewBox: "25 25 50 50"
- }, [t.createVNode("circle", {
- cx: "50",
- cy: "50",
- r: "20",
- fill: "none"
- }, null)])
- , wt = {
- size: g,
- type: N("circular"),
- color: String,
- vertical: Boolean,
- textSize: g,
- textColor: String
- };
- const Vt = je(t.defineComponent({
- name: ht,
- props: wt,
- setup(e, {slots: o}) {
- const n = t.computed((()=>d({
- color: e.color
- }, de(e.size))))
- , a = ()=>{
- const a = "spinner" === e.type ? bt : yt;
- return t.createVNode("span", {
- class: gt("spinner", e.type),
- style: n.value
- }, [o.icon ? o.icon() : a])
- }
- , r = ()=>{
- var n;
- if (o.default)
- return t.createVNode("span", {
- class: gt("text"),
- style: {
- fontSize: ce(e.textSize),
- color: null != (n = e.textColor) ? n : e.color
- }
- }, [o.default()])
- }
- ;
- return ()=>{
- const {type: o, vertical: n} = e;
- return t.createVNode("div", {
- class: gt([o, {
- vertical: n
- }]),
- "aria-live": "polite",
- "aria-busy": !0
- }, [a(), r()])
- }
- }
- }))
- , [xt,Nt] = Oe("button")
- , Ct = d({}, Qe, {
- tag: N("button"),
- text: String,
- icon: String,
- type: N("default"),
- size: N("normal"),
- color: String,
- block: Boolean,
- plain: Boolean,
- round: Boolean,
- square: Boolean,
- loading: Boolean,
- hairline: Boolean,
- disabled: Boolean,
- iconPrefix: String,
- nativeType: N("button"),
- loadingSize: g,
- loadingText: String,
- loadingType: String,
- iconPosition: N("left")
- });
- const kt = je(t.defineComponent({
- name: xt,
- props: Ct,
- emits: ["click"],
- setup(e, {emit: o, slots: n}) {
- const a = tt()
- , r = ()=>e.loading ? n.loading ? n.loading() : t.createVNode(Vt, {
- size: e.loadingSize,
- type: e.loadingType,
- class: Nt("loading")
- }, null) : n.icon ? t.createVNode("div", {
- class: Nt("icon")
- }, [n.icon()]) : e.icon ? t.createVNode(vt, {
- name: e.icon,
- class: Nt("icon"),
- classPrefix: e.iconPrefix
- }, null) : void 0
- , l = ()=>{
- let o;
- if (o = e.loading ? e.loadingText : n.default ? n.default() : e.text,
- o)
- return t.createVNode("span", {
- class: Nt("text")
- }, [o])
- }
- , i = ()=>{
- const {color: t, plain: o} = e;
- if (t) {
- const e = {
- color: o ? t : "white"
- };
- return o || (e.background = t),
- t.includes("gradient") ? e.border = 0 : e.borderColor = t,
- e
- }
- }
- , s = t=>{
- e.loading ? re(t) : e.disabled || (o("click", t),
- a())
- }
- ;
- return ()=>{
- const {tag: o, type: n, size: a, block: c, round: d, plain: u, square: p, loading: m, disabled: f, hairline: v, nativeType: h, iconPosition: g} = e
- , b = [Nt([n, a, {
- plain: u,
- block: c,
- round: d,
- square: p,
- loading: m,
- disabled: f,
- hairline: v
- }]), {
- [$e]: v
- }];
- return t.createVNode(o, {
- type: h,
- class: b,
- style: i(),
- disabled: f,
- onClick: s
- }, {
- default: ()=>[t.createVNode("div", {
- class: Nt("content")
- }, ["left" === g && r(), l(), "right" === g && r()])]
- })
- }
- }
- }))
- , [St,Bt] = Oe("action-bar-button")
- , Tt = d({}, Qe, {
- type: String,
- text: String,
- icon: String,
- color: String,
- loading: Boolean,
- disabled: Boolean
- });
- const Pt = je(t.defineComponent({
- name: St,
- props: Tt,
- setup(e, {slots: o}) {
- const n = tt()
- , {parent: a, index: r} = D(Ze)
- , l = t.computed((()=>{
- if (a) {
- const e = a.children[r.value - 1];
- return !(e && "isButton"in e)
- }
- }
- ))
- , i = t.computed((()=>{
- if (a) {
- const e = a.children[r.value + 1];
- return !(e && "isButton"in e)
- }
- }
- ));
- return Je({
- isButton: !0
- }),
- ()=>{
- const {type: a, icon: r, text: s, color: c, loading: d, disabled: u} = e;
- return t.createVNode(kt, {
- class: Bt([a, {
- last: i.value,
- first: l.value
- }]),
- size: "large",
- type: a,
- icon: r,
- color: c,
- loading: d,
- disabled: u,
- onClick: n
- }, {
- default: ()=>[o.default ? o.default() : s]
- })
- }
- }
- }))
- , [Dt,Ot] = Oe("action-bar-icon")
- , It = d({}, Qe, {
- dot: Boolean,
- text: String,
- icon: String,
- color: String,
- badge: g,
- iconClass: h,
- badgeProps: Object,
- iconPrefix: String
- });
- const At = je(t.defineComponent({
- name: Dt,
- props: It,
- setup(e, {slots: o}) {
- const n = tt();
- D(Ze);
- const a = ()=>{
- const {dot: n, badge: a, icon: r, color: l, iconClass: i, badgeProps: s, iconPrefix: c} = e;
- return o.icon ? t.createVNode(rt, t.mergeProps({
- dot: n,
- class: Ot("icon"),
- content: a
- }, s), {
- default: o.icon
- }) : t.createVNode(vt, {
- tag: "div",
- dot: n,
- name: r,
- badge: a,
- color: l,
- class: [Ot("icon"), i],
- badgeProps: s,
- classPrefix: c
- }, null)
- }
- ;
- return ()=>t.createVNode("div", {
- role: "button",
- class: Ot(),
- tabindex: 0,
- onClick: n
- }, [a(), o.default ? o.default() : e.text])
- }
- }))
- , zt = {
- show: Boolean,
- zIndex: g,
- overlay: b,
- duration: g,
- teleport: [String, Object],
- lockScroll: b,
- lazyRender: b,
- beforeClose: Function,
- overlayStyle: Object,
- overlayClass: h,
- transitionAppear: Boolean,
- closeOnClickOverlay: b
- }
- , Et = Object.keys(zt);
- function $t() {
- const e = t.ref(0)
- , o = t.ref(0)
- , n = t.ref(0)
- , a = t.ref(0)
- , r = t.ref(0)
- , l = t.ref(0)
- , i = t.ref("")
- , s = ()=>{
- n.value = 0,
- a.value = 0,
- r.value = 0,
- l.value = 0,
- i.value = ""
- }
- ;
- return {
- move: t=>{
- const s = t.touches[0];
- n.value = (s.clientX < 0 ? 0 : s.clientX) - e.value,
- a.value = s.clientY - o.value,
- r.value = Math.abs(n.value),
- l.value = Math.abs(a.value);
- var c, d;
- (!i.value || r.value < 10 && l.value < 10) && (i.value = (c = r.value,
- d = l.value,
- c > d ? "horizontal" : d > c ? "vertical" : ""))
- }
- ,
- start: t=>{
- s(),
- e.value = t.touches[0].clientX,
- o.value = t.touches[0].clientY
- }
- ,
- reset: s,
- startX: e,
- startY: o,
- deltaX: n,
- deltaY: a,
- offsetX: r,
- offsetY: l,
- direction: i,
- isVertical: ()=>"vertical" === i.value,
- isHorizontal: ()=>"horizontal" === i.value
- }
- }
- let Lt = 0;
- const Mt = "van-overflow-hidden";
- function Ft(e) {
- const o = t.ref(!1);
- return t.watch(e, (e=>{
- e && (o.value = e)
- }
- ), {
- immediate: !0
- }),
- e=>()=>o.value ? e() : null
- }
- const [Rt,Ht] = Oe("overlay")
- , jt = {
- show: Boolean,
- zIndex: g,
- duration: g,
- className: h,
- lockScroll: b,
- lazyRender: b,
- customStyle: Object
- };
- const Wt = je(t.defineComponent({
- name: Rt,
- props: jt,
- setup(e, {slots: n}) {
- const a = t.ref()
- , r = Ft((()=>e.show || !e.lazyRender))((()=>{
- var r;
- const l = d(ue(e.zIndex), e.customStyle);
- return o(e.duration) && (l.animationDuration = `${e.duration}s`),
- t.withDirectives(t.createVNode("div", {
- ref: a,
- style: l,
- class: [Ht(), e.className]
- }, [null == (r = n.default) ? void 0 : r.call(n)]), [[t.vShow, e.show]])
- }
- ));
- return H("touchmove", (t=>{
- e.lockScroll && re(t, !0)
- }
- ), {
- target: a
- }),
- ()=>t.createVNode(t.Transition, {
- name: "van-fade",
- appear: !0
- }, {
- default: r
- })
- }
- }))
- , Ut = d({}, zt, {
- round: Boolean,
- position: N("center"),
- closeIcon: N("cross"),
- closeable: Boolean,
- transition: String,
- iconPrefix: String,
- closeOnPopstate: Boolean,
- closeIconPosition: N("top-right"),
- safeAreaInsetTop: Boolean,
- safeAreaInsetBottom: Boolean
- })
- , [qt,Yt] = Oe("popup");
- const Gt = je(t.defineComponent({
- name: qt,
- inheritAttrs: !1,
- props: Ut,
- emits: ["open", "close", "opened", "closed", "keydown", "update:show", "clickOverlay", "clickCloseIcon"],
- setup(e, {emit: n, attrs: a, slots: r}) {
- let l, i;
- const s = t.ref()
- , c = t.ref()
- , d = Ft((()=>e.show || !e.lazyRender))
- , u = t.computed((()=>{
- const t = {
- zIndex: s.value
- };
- if (o(e.duration)) {
- t["center" === e.position ? "animationDuration" : "transitionDuration"] = `${e.duration}s`
- }
- return t
- }
- ))
- , p = ()=>{
- l || (l = !0,
- s.value = void 0 !== e.zIndex ? +e.zIndex : ++lt,
- n("open"))
- }
- , m = ()=>{
- l && He(e.beforeClose, {
- done() {
- l = !1,
- n("close"),
- n("update:show", !1)
- }
- })
- }
- , f = t=>{
- n("clickOverlay", t),
- e.closeOnClickOverlay && m()
- }
- , v = ()=>{
- if (e.overlay)
- return t.createVNode(Wt, {
- show: e.show,
- class: e.overlayClass,
- zIndex: s.value,
- duration: e.duration,
- customStyle: e.overlayStyle,
- role: e.closeOnClickOverlay ? "button" : void 0,
- tabindex: e.closeOnClickOverlay ? 0 : void 0,
- onClick: f
- }, {
- default: r["overlay-content"]
- })
- }
- , h = e=>{
- n("clickCloseIcon", e),
- m()
- }
- , g = ()=>{
- if (e.closeable)
- return t.createVNode(vt, {
- role: "button",
- tabindex: 0,
- name: e.closeIcon,
- class: [Yt("close-icon", e.closeIconPosition), Fe],
- classPrefix: e.iconPrefix,
- onClick: h
- }, null)
- }
- , b = ()=>n("opened")
- , y = ()=>n("closed")
- , w = e=>n("keydown", e)
- , V = d((()=>{
- var o;
- const {round: n, position: l, safeAreaInsetTop: i, safeAreaInsetBottom: s} = e;
- return t.withDirectives(t.createVNode("div", t.mergeProps({
- ref: c,
- style: u.value,
- role: "dialog",
- tabindex: 0,
- class: [Yt({
- round: n,
- [l]: l
- }), {
- "van-safe-area-top": i,
- "van-safe-area-bottom": s
- }],
- onKeydown: w
- }, a), [null == (o = r.default) ? void 0 : o.call(r), g()]), [[t.vShow, e.show]])
- }
- ))
- , x = ()=>{
- const {position: o, transition: n, transitionAppear: a} = e
- , r = "center" === o ? "van-fade" : `van-popup-slide-${o}`;
- return t.createVNode(t.Transition, {
- name: n || r,
- appear: a,
- onAfterEnter: b,
- onAfterLeave: y
- }, {
- default: V
- })
- }
- ;
- return t.watch((()=>e.show), (e=>{
- e && !l && (p(),
- 0 === a.tabindex && t.nextTick((()=>{
- var e;
- null == (e = c.value) || e.focus()
- }
- ))),
- !e && l && (l = !1,
- n("close"))
- }
- )),
- Je({
- popupRef: c
- }),
- function(e, o) {
- const n = $t()
- , a = t=>{
- n.move(t);
- const o = n.deltaY.value > 0 ? "10" : "01"
- , a = G(t.target, e.value)
- , {scrollHeight: r, offsetHeight: l, scrollTop: i} = a;
- let s = "11";
- 0 === i ? s = l >= r ? "00" : "01" : i + l >= r && (s = "10"),
- "11" === s || !n.isVertical() || parseInt(s, 2) & parseInt(o, 2) || re(t, !0)
- }
- , r = ()=>{
- document.addEventListener("touchstart", n.start),
- document.addEventListener("touchmove", a, {
- passive: !1
- }),
- Lt || document.body.classList.add(Mt),
- Lt++
- }
- , l = ()=>{
- Lt && (document.removeEventListener("touchstart", n.start),
- document.removeEventListener("touchmove", a),
- Lt--,
- Lt || document.body.classList.remove(Mt))
- }
- , i = ()=>o() && l();
- R((()=>o() && r())),
- t.onDeactivated(i),
- t.onBeforeUnmount(i),
- t.watch(o, (e=>{
- e ? r() : l()
- }
- ))
- }(c, (()=>e.show && e.lockScroll)),
- H("popstate", (()=>{
- e.closeOnPopstate && (m(),
- i = !1)
- }
- )),
- t.onMounted((()=>{
- e.show && p()
- }
- )),
- t.onActivated((()=>{
- i && (n("update:show", !0),
- i = !1)
- }
- )),
- t.onDeactivated((()=>{
- e.show && e.teleport && (m(),
- i = !0)
- }
- )),
- t.provide(We, (()=>e.show)),
- ()=>e.teleport ? t.createVNode(t.Teleport, {
- to: e.teleport
- }, {
- default: ()=>[v(), x()]
- }) : t.createVNode(t.Fragment, null, [v(), x()])
- }
- }))
- , [Xt,Zt] = Oe("action-sheet")
- , Kt = d({}, zt, {
- title: String,
- round: b,
- actions: w(),
- closeIcon: N("cross"),
- closeable: b,
- cancelText: String,
- description: String,
- closeOnPopstate: b,
- closeOnClickAction: Boolean,
- safeAreaInsetBottom: b
- })
- , _t = [...Et, "round", "closeOnPopstate", "safeAreaInsetBottom"];
- const Jt = je(t.defineComponent({
- name: Xt,
- props: Kt,
- emits: ["select", "cancel", "update:show"],
- setup(e, {slots: o, emit: n}) {
- const a = e=>n("update:show", e)
- , r = ()=>{
- a(!1),
- n("cancel")
- }
- , l = ()=>{
- if (e.title)
- return t.createVNode("div", {
- class: Zt("header")
- }, [e.title, e.closeable && t.createVNode(vt, {
- name: e.closeIcon,
- class: [Zt("close"), Fe],
- onClick: r
- }, null)])
- }
- , i = ()=>{
- if (o.cancel || e.cancelText)
- return [t.createVNode("div", {
- class: Zt("gap")
- }, null), t.createVNode("button", {
- type: "button",
- class: Zt("cancel"),
- onClick: r
- }, [o.cancel ? o.cancel() : e.cancelText])]
- }
- , s = (e,n)=>e.loading ? t.createVNode(Vt, {
- class: Zt("loading-icon")
- }, null) : o.action ? o.action({
- action: e,
- index: n
- }) : [t.createVNode("span", {
- class: Zt("name")
- }, [e.name]), e.subname && t.createVNode("div", {
- class: Zt("subname")
- }, [e.subname])]
- , c = (o,r)=>{
- const {color: l, loading: i, callback: c, disabled: d, className: u} = o;
- return t.createVNode("button", {
- type: "button",
- style: {
- color: l
- },
- class: [Zt("item", {
- loading: i,
- disabled: d
- }), u],
- onClick: ()=>{
- d || i || (c && c(o),
- e.closeOnClickAction && a(!1),
- t.nextTick((()=>n("select", o, r))))
- }
- }, [s(o, r)])
- }
- , d = ()=>{
- if (e.description || o.description) {
- const n = o.description ? o.description() : e.description;
- return t.createVNode("div", {
- class: Zt("description")
- }, [n])
- }
- }
- ;
- return ()=>t.createVNode(Gt, t.mergeProps({
- class: Zt(),
- position: "bottom",
- "onUpdate:show": a
- }, m(e, _t)), {
- default: ()=>{
- var n;
- return [l(), d(), t.createVNode("div", {
- class: Zt("content")
- }, [e.actions.map(c), null == (n = o.default) ? void 0 : n.call(o)]), i()]
- }
- })
- }
- }))
- , [Qt,eo,to] = Oe("picker")
- , oo = e=>e.find((e=>!e.disabled)) || e[0];
- function no(e, t) {
- for (let o = t = be(t, 0, e.length); o < e.length; o++)
- if (!e[o].disabled)
- return o;
- for (let o = t - 1; o >= 0; o--)
- if (!e[o].disabled)
- return o;
- return 0
- }
- const ao = (e,t,o)=>void 0 !== t && !!e.find((e=>e[o.value] === t));
- function ro(e, t, o) {
- const n = e.findIndex((e=>e[o.value] === t));
- return e[no(e, n)]
- }
- const [lo,io] = Oe("picker-column")
- , so = Symbol(lo);
- var co = t.defineComponent({
- name: lo,
- props: {
- value: g,
- fields: y(Object),
- options: w(),
- readonly: Boolean,
- allowHtml: Boolean,
- optionHeight: y(Number),
- swipeDuration: y(g),
- visibleOptionNum: y(g)
- },
- emits: ["change", "clickOption"],
- setup(e, {emit: o, slots: n}) {
- let a, r, l, i, s;
- const c = t.ref()
- , d = t.ref()
- , u = t.ref(0)
- , p = t.ref(0)
- , m = $t()
- , f = ()=>e.options.length
- , v = ()=>e.optionHeight * (+e.visibleOptionNum - 1) / 2
- , h = t=>{
- const n = no(e.options, t)
- , r = -n * e.optionHeight
- , l = ()=>{
- const t = e.options[n][e.fields.value];
- t !== e.value && o("change", t)
- }
- ;
- a && r !== u.value ? s = l : l(),
- u.value = r
- }
- , g = ()=>e.readonly || !e.options.length
- , b = t=>be(Math.round(-t / e.optionHeight), 0, f() - 1)
- , y = ()=>{
- a = !1,
- p.value = 0,
- s && (s(),
- s = null)
- }
- , w = e=>{
- if (!g()) {
- if (m.start(e),
- a) {
- const e = function(e) {
- const {transform: t} = window.getComputedStyle(e)
- , o = t.slice(7, t.length - 1).split(", ")[5];
- return Number(o)
- }(d.value);
- u.value = Math.min(0, e - v())
- }
- p.value = 0,
- r = u.value,
- l = Date.now(),
- i = r,
- s = null
- }
- }
- , V = ()=>{
- if (g())
- return;
- const t = u.value - i
- , o = Date.now() - l;
- if (o < 300 && Math.abs(t) > 15)
- return void ((t,o)=>{
- const n = Math.abs(t / o);
- t = u.value + n / .003 * (t < 0 ? -1 : 1);
- const a = b(t);
- p.value = +e.swipeDuration,
- h(a)
- }
- )(t, o);
- const n = b(u.value);
- p.value = 200,
- h(n),
- setTimeout((()=>{
- a = !1
- }
- ), 0)
- }
- , x = ()=>{
- const r = {
- height: `${e.optionHeight}px`
- };
- return e.options.map(((l,i)=>{
- const c = l[e.fields.text]
- , {disabled: d} = l
- , u = l[e.fields.value]
- , m = {
- role: "button",
- style: r,
- tabindex: d ? -1 : 0,
- class: [io("item", {
- disabled: d,
- selected: u === e.value
- }), l.className],
- onClick: ()=>(t=>{
- a || g() || (s = null,
- p.value = 200,
- h(t),
- o("clickOption", e.options[t]))
- }
- )(i)
- }
- , f = {
- class: "van-ellipsis",
- [e.allowHtml ? "innerHTML" : "textContent"]: c
- };
- return t.createVNode("li", m, [n.option ? n.option(l) : t.createVNode("div", f, null)])
- }
- ))
- }
- ;
- return D(so),
- Je({
- stopMomentum: y
- }),
- t.watchEffect((()=>{
- const t = e.options.findIndex((t=>t[e.fields.value] === e.value))
- , o = -no(e.options, t) * e.optionHeight;
- u.value = o
- }
- )),
- H("touchmove", (t=>{
- if (g())
- return;
- m.move(t),
- m.isVertical() && (a = !0,
- re(t, !0)),
- u.value = be(r + m.deltaY.value, -f() * e.optionHeight, e.optionHeight);
- const o = Date.now();
- o - l > 300 && (l = o,
- i = u.value)
- }
- ), {
- target: c
- }),
- ()=>t.createVNode("div", {
- ref: c,
- class: io(),
- onTouchstartPassive: w,
- onTouchend: V,
- onTouchcancel: V
- }, [t.createVNode("ul", {
- ref: d,
- style: {
- transform: `translate3d(0, ${u.value + v()}px, 0)`,
- transitionDuration: `${p.value}ms`,
- transitionProperty: p.value ? "all" : "none"
- },
- class: io("wrapper"),
- onTransitionend: y
- }, [x()])])
- }
- });
- const [uo] = Oe("picker-toolbar")
- , po = {
- title: String,
- cancelButtonText: String,
- confirmButtonText: String
- }
- , mo = ["cancel", "confirm", "title", "toolbar"]
- , fo = Object.keys(po);
- var vo = t.defineComponent({
- name: uo,
- props: po,
- emits: ["confirm", "cancel"],
- setup(e, {emit: o, slots: n}) {
- const a = ()=>o("cancel")
- , r = ()=>o("confirm")
- , l = ()=>{
- const o = e.cancelButtonText || to("cancel");
- return t.createVNode("button", {
- type: "button",
- class: [eo("cancel"), Fe],
- onClick: a
- }, [n.cancel ? n.cancel() : o])
- }
- , i = ()=>{
- const o = e.confirmButtonText || to("confirm");
- return t.createVNode("button", {
- type: "button",
- class: [eo("confirm"), Fe],
- onClick: r
- }, [n.confirm ? n.confirm() : o])
- }
- ;
- return ()=>t.createVNode("div", {
- class: eo("toolbar")
- }, [n.toolbar ? n.toolbar() : [l(), n.title ? n.title() : e.title ? t.createVNode("div", {
- class: [eo("title"), "van-ellipsis"]
- }, [e.title]) : void 0, i()]])
- }
- });
- let ho = 0;
- function go() {
- const e = t.getCurrentInstance()
- , {name: o="unknown"} = (null == e ? void 0 : e.type) || {};
- return `${o}-${++ho}`
- }
- function bo() {
- const e = t.ref([])
- , o = [];
- t.onBeforeUpdate((()=>{
- e.value = []
- }
- ));
- return [e, t=>(o[t] || (o[t] = o=>{
- e.value[t] = o
- }
- ),
- o[t])]
- }
- const [yo,wo] = Oe("sticky")
- , Vo = {
- zIndex: g,
- position: N("top"),
- container: Object,
- offsetTop: x(0),
- offsetBottom: x(0)
- };
- const xo = je(t.defineComponent({
- name: yo,
- props: Vo,
- emits: ["scroll", "change"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = X(a)
- , l = t.reactive({
- fixed: !1,
- width: 0,
- height: 0,
- transform: 0
- })
- , i = t.computed((()=>fe("top" === e.position ? e.offsetTop : e.offsetBottom)))
- , s = t.computed((()=>{
- const {fixed: e, height: t, width: o} = l;
- if (e)
- return {
- width: `${o}px`,
- height: `${t}px`
- }
- }
- ))
- , c = t.computed((()=>{
- if (!l.fixed)
- return;
- const t = d(ue(e.zIndex), {
- width: `${l.width}px`,
- height: `${l.height}px`,
- [e.position]: `${i.value}px`
- });
- return l.transform && (t.transform = `translate3d(0, ${l.transform}px, 0)`),
- t
- }
- ))
- , p = ()=>{
- if (!a.value || le(a))
- return;
- const {container: t, position: n} = e
- , r = P(a)
- , s = _(window);
- if (l.width = r.width,
- l.height = r.height,
- "top" === n)
- if (t) {
- const e = P(t)
- , o = e.bottom - i.value - l.height;
- l.fixed = i.value > r.top && e.bottom > 0,
- l.transform = o < 0 ? o : 0
- } else
- l.fixed = i.value > r.top;
- else {
- const {clientHeight: e} = document.documentElement;
- if (t) {
- const o = P(t)
- , n = e - o.top - i.value - l.height;
- l.fixed = e - i.value < r.bottom && e > o.top,
- l.transform = n < 0 ? -n : 0
- } else
- l.fixed = e - i.value < r.bottom
- }
- (e=>{
- o("scroll", {
- scrollTop: e,
- isFixed: l.fixed
- })
- }
- )(s)
- }
- ;
- return t.watch((()=>l.fixed), (e=>o("change", e))),
- H("scroll", p, {
- target: r,
- passive: !0
- }),
- function(e, o) {
- if (!u || !window.IntersectionObserver)
- return;
- const n = new IntersectionObserver((e=>{
- o(e[0].intersectionRatio > 0)
- }
- ),{
- root: document.body
- })
- , a = ()=>{
- e.value && n.unobserve(e.value)
- }
- ;
- t.onDeactivated(a),
- t.onBeforeUnmount(a),
- R((()=>{
- e.value && n.observe(e.value)
- }
- ))
- }(a, p),
- ()=>{
- var e;
- return t.createVNode("div", {
- ref: a,
- style: s.value
- }, [t.createVNode("div", {
- class: wo({
- fixed: l.fixed
- }),
- style: c.value
- }, [null == (e = n.default) ? void 0 : e.call(n)])])
- }
- }
- }))
- , [No,Co] = Oe("tab");
- var ko = t.defineComponent({
- name: No,
- props: {
- id: String,
- dot: Boolean,
- type: String,
- color: String,
- title: String,
- badge: g,
- shrink: Boolean,
- isActive: Boolean,
- disabled: Boolean,
- controls: String,
- scrollable: Boolean,
- activeColor: String,
- inactiveColor: String,
- showZeroBadge: b
- },
- setup(e, {slots: n}) {
- const a = t.computed((()=>{
- const t = {}
- , {type: o, color: n, disabled: a, isActive: r, activeColor: l, inactiveColor: i} = e;
- n && "card" === o && (t.borderColor = n,
- a || (r ? t.backgroundColor = n : t.color = n));
- const s = r ? l : i;
- return s && (t.color = s),
- t
- }
- ))
- , r = ()=>{
- const a = t.createVNode("span", {
- class: Co("text", {
- ellipsis: !e.scrollable
- })
- }, [n.title ? n.title() : e.title]);
- return e.dot || o(e.badge) && "" !== e.badge ? t.createVNode(rt, {
- dot: e.dot,
- content: e.badge,
- showZero: e.showZeroBadge
- }, {
- default: ()=>[a]
- }) : a
- }
- ;
- return ()=>t.createVNode("div", {
- id: e.id,
- role: "tab",
- class: [Co([e.type, {
- grow: e.scrollable && !e.shrink,
- shrink: e.shrink,
- active: e.isActive,
- disabled: e.disabled
- }])],
- style: a.value,
- tabindex: e.disabled ? void 0 : e.isActive ? 0 : -1,
- "aria-selected": e.isActive,
- "aria-disabled": e.disabled || void 0,
- "aria-controls": e.controls
- }, [r()])
- }
- });
- const [So,Bo] = Oe("swipe")
- , To = {
- loop: b,
- width: g,
- height: g,
- vertical: Boolean,
- autoplay: x(0),
- duration: x(500),
- touchable: b,
- lazyRender: Boolean,
- initialSwipe: x(0),
- indicatorColor: String,
- showIndicators: b,
- stopPropagation: b
- }
- , Po = Symbol(So);
- const Do = je(t.defineComponent({
- name: So,
- props: To,
- emits: ["change"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = t.ref()
- , l = t.reactive({
- rect: null,
- width: 0,
- height: 0,
- offset: 0,
- active: 0,
- swiping: !1
- })
- , i = $t()
- , {children: s, linkChildren: c} = I(Po)
- , d = t.computed((()=>s.length))
- , u = t.computed((()=>l[e.vertical ? "height" : "width"]))
- , p = t.computed((()=>e.vertical ? i.deltaY.value : i.deltaX.value))
- , m = t.computed((()=>{
- if (l.rect) {
- return (e.vertical ? l.rect.height : l.rect.width) - u.value * d.value
- }
- return 0
- }
- ))
- , f = t.computed((()=>u.value ? Math.ceil(Math.abs(m.value) / u.value) : d.value))
- , v = t.computed((()=>d.value * u.value))
- , h = t.computed((()=>(l.active + d.value) % d.value))
- , g = t.computed((()=>{
- const t = e.vertical ? "vertical" : "horizontal";
- return i.direction.value === t
- }
- ))
- , b = t.computed((()=>{
- const t = {
- transitionDuration: `${l.swiping ? 0 : e.duration}ms`,
- transform: `translate${e.vertical ? "Y" : "X"}(${l.offset}px)`
- };
- if (u.value) {
- const o = e.vertical ? "height" : "width"
- , n = e.vertical ? "width" : "height";
- t[o] = `${v.value}px`,
- t[n] = e[n] ? `${e[n]}px` : ""
- }
- return t
- }
- ))
- , y = (t,o=0)=>{
- let n = t * u.value;
- e.loop || (n = Math.min(n, -m.value));
- let a = o - n;
- return e.loop || (a = be(a, m.value, 0)),
- a
- }
- , w = ({pace: t=0, offset: n=0, emitChange: a})=>{
- if (d.value <= 1)
- return;
- const {active: r} = l
- , i = (t=>{
- const {active: o} = l;
- return t ? e.loop ? be(o + t, -1, d.value) : be(o + t, 0, f.value) : o
- }
- )(t)
- , c = y(i, n);
- if (e.loop) {
- if (s[0] && c !== m.value) {
- const e = c < m.value;
- s[0].setOffset(e ? v.value : 0)
- }
- if (s[d.value - 1] && 0 !== c) {
- const e = c > 0;
- s[d.value - 1].setOffset(e ? -v.value : 0)
- }
- }
- l.active = i,
- l.offset = c,
- a && i !== r && o("change", h.value)
- }
- , V = ()=>{
- l.swiping = !0,
- l.active <= -1 ? w({
- pace: d.value
- }) : l.active >= d.value && w({
- pace: -d.value
- })
- }
- , x = ()=>{
- V(),
- i.reset(),
- B((()=>{
- l.swiping = !1,
- w({
- pace: 1,
- emitChange: !0
- })
- }
- ))
- }
- ;
- let N;
- const k = ()=>clearTimeout(N)
- , S = ()=>{
- k(),
- e.autoplay > 0 && d.value > 1 && (N = setTimeout((()=>{
- x(),
- S()
- }
- ), +e.autoplay))
- }
- , T = (o=+e.initialSwipe)=>{
- if (!a.value)
- return;
- const n = ()=>{
- var t, n;
- if (!le(a)) {
- const o = {
- width: a.value.offsetWidth,
- height: a.value.offsetHeight
- };
- l.rect = o,
- l.width = +(null != (t = e.width) ? t : o.width),
- l.height = +(null != (n = e.height) ? n : o.height)
- }
- d.value && (o = Math.min(d.value - 1, o)),
- l.active = o,
- l.swiping = !0,
- l.offset = y(o),
- s.forEach((e=>{
- e.setOffset(0)
- }
- )),
- S()
- }
- ;
- le(a) ? t.nextTick().then(n) : n()
- }
- , P = ()=>T(l.active);
- let D;
- const O = t=>{
- e.touchable && (i.start(t),
- D = Date.now(),
- k(),
- V())
- }
- , A = ()=>{
- if (!e.touchable || !l.swiping)
- return;
- const t = Date.now() - D
- , o = p.value / t;
- if ((Math.abs(o) > .25 || Math.abs(p.value) > u.value / 2) && g.value) {
- const t = e.vertical ? i.offsetY.value : i.offsetX.value;
- let o = 0;
- o = e.loop ? t > 0 ? p.value > 0 ? -1 : 1 : 0 : -Math[p.value > 0 ? "ceil" : "floor"](p.value / u.value),
- w({
- pace: o,
- emitChange: !0
- })
- } else
- p.value && w({
- pace: 0
- });
- l.swiping = !1,
- S()
- }
- , z = (o,n)=>{
- const a = n === h.value
- , r = a ? {
- backgroundColor: e.indicatorColor
- } : void 0;
- return t.createVNode("i", {
- style: r,
- class: Bo("indicator", {
- active: a
- })
- }, null)
- }
- ;
- return Je({
- prev: ()=>{
- V(),
- i.reset(),
- B((()=>{
- l.swiping = !1,
- w({
- pace: -1,
- emitChange: !0
- })
- }
- ))
- }
- ,
- next: x,
- state: l,
- resize: P,
- swipeTo: (t,o={})=>{
- V(),
- i.reset(),
- B((()=>{
- let n;
- n = e.loop && t === d.value ? 0 === l.active ? 0 : t : t % d.value,
- o.immediate ? B((()=>{
- l.swiping = !1
- }
- )) : l.swiping = !1,
- w({
- pace: n - l.active,
- emitChange: !0
- })
- }
- ))
- }
- }),
- c({
- size: u,
- props: e,
- count: d,
- activeIndicator: h
- }),
- t.watch((()=>e.initialSwipe), (e=>T(+e))),
- t.watch(d, (()=>T(l.active))),
- t.watch((()=>e.autoplay), S),
- t.watch([ie, se], P),
- t.watch(function() {
- if (!W && (W = t.ref("visible"),
- C)) {
- const e = ()=>{
- W.value = document.hidden ? "hidden" : "visible"
- }
- ;
- e(),
- window.addEventListener("visibilitychange", e)
- }
- return W
- }(), (e=>{
- "visible" === e ? S() : k()
- }
- )),
- t.onMounted(T),
- t.onActivated((()=>T(l.active))),
- Ue((()=>T(l.active))),
- t.onDeactivated(k),
- t.onBeforeUnmount(k),
- H("touchmove", (t=>{
- if (e.touchable && l.swiping && (i.move(t),
- g.value)) {
- !e.loop && (0 === l.active && p.value > 0 || l.active === d.value - 1 && p.value < 0) || (re(t, e.stopPropagation),
- w({
- offset: p.value
- }))
- }
- }
- ), {
- target: r
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- ref: a,
- class: Bo()
- }, [t.createVNode("div", {
- ref: r,
- style: b.value,
- class: Bo("track", {
- vertical: e.vertical
- }),
- onTouchstartPassive: O,
- onTouchend: A,
- onTouchcancel: A
- }, [null == (o = n.default) ? void 0 : o.call(n)]), n.indicator ? n.indicator({
- active: h.value,
- total: d.value
- }) : e.showIndicators && d.value > 1 ? t.createVNode("div", {
- class: Bo("indicators", {
- vertical: e.vertical
- })
- }, [Array(d.value).fill("").map(z)]) : void 0])
- }
- }
- }))
- , [Oo,Io] = Oe("tabs");
- var Ao = t.defineComponent({
- name: Oo,
- props: {
- count: y(Number),
- inited: Boolean,
- animated: Boolean,
- duration: y(g),
- swipeable: Boolean,
- lazyRender: Boolean,
- currentIndex: y(Number)
- },
- emits: ["change"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = e=>o("change", e)
- , l = ()=>{
- var o;
- const l = null == (o = n.default) ? void 0 : o.call(n);
- return e.animated || e.swipeable ? t.createVNode(Do, {
- ref: a,
- loop: !1,
- class: Io("track"),
- duration: 1e3 * +e.duration,
- touchable: e.swipeable,
- lazyRender: e.lazyRender,
- showIndicators: !1,
- onChange: r
- }, {
- default: ()=>[l]
- }) : l
- }
- , i = t=>{
- const o = a.value;
- o && o.state.active !== t && o.swipeTo(t, {
- immediate: !e.inited
- })
- }
- ;
- return t.watch((()=>e.currentIndex), i),
- t.onMounted((()=>{
- i(e.currentIndex)
- }
- )),
- Je({
- swipeRef: a
- }),
- ()=>t.createVNode("div", {
- class: Io("content", {
- animated: e.animated || e.swipeable
- })
- }, [l()])
- }
- });
- const [zo,Eo] = Oe("tabs")
- , $o = {
- type: N("line"),
- color: String,
- border: Boolean,
- sticky: Boolean,
- shrink: Boolean,
- active: x(0),
- duration: x(.3),
- animated: Boolean,
- ellipsis: b,
- swipeable: Boolean,
- scrollspy: Boolean,
- offsetTop: x(0),
- background: String,
- lazyRender: b,
- lineWidth: g,
- lineHeight: g,
- beforeChange: Function,
- swipeThreshold: x(5),
- titleActiveColor: String,
- titleInactiveColor: String
- }
- , Lo = Symbol(zo);
- var Mo = t.defineComponent({
- name: zo,
- props: $o,
- emits: ["change", "scroll", "rendered", "clickTab", "update:active"],
- setup(e, {emit: n, slots: a}) {
- let r, l, i;
- const s = t.ref()
- , c = t.ref()
- , d = t.ref()
- , u = t.ref()
- , p = go()
- , f = X(s)
- , [v,h] = bo()
- , {children: g, linkChildren: b} = I(Lo)
- , y = t.reactive({
- inited: !1,
- position: "",
- lineStyle: {},
- currentIndex: -1
- })
- , w = t.computed((()=>g.length > e.swipeThreshold || !e.ellipsis || e.shrink))
- , V = t.computed((()=>({
- borderColor: e.color,
- background: e.background
- })))
- , x = (e,t)=>{
- var o;
- return null != (o = e.name) ? o : t
- }
- , N = t.computed((()=>{
- const e = g[y.currentIndex];
- if (e)
- return x(e, y.currentIndex)
- }
- ))
- , C = t.computed((()=>fe(e.offsetTop)))
- , S = t.computed((()=>e.sticky ? C.value + r : 0))
- , B = t=>{
- const o = c.value
- , n = v.value;
- if (!(w.value && o && n && n[y.currentIndex]))
- return;
- const a = n[y.currentIndex].$el;
- !function(e, t, o) {
- let n = 0;
- const a = e.scrollLeft
- , r = 0 === o ? 1 : Math.round(1e3 * o / 16);
- !function o() {
- e.scrollLeft += (t - a) / r,
- ++n < r && k(o)
- }()
- }(o, a.offsetLeft - (o.offsetWidth - a.offsetWidth) / 2, t ? 0 : +e.duration)
- }
- , T = ()=>{
- const n = y.inited;
- t.nextTick((()=>{
- const t = v.value;
- if (!t || !t[y.currentIndex] || "line" !== e.type || le(s.value))
- return;
- const a = t[y.currentIndex].$el
- , {lineWidth: r, lineHeight: l} = e
- , i = a.offsetLeft + a.offsetWidth / 2
- , c = {
- width: ce(r),
- backgroundColor: e.color,
- transform: `translateX(${i}px) translateX(-50%)`
- };
- if (n && (c.transitionDuration = `${e.duration}s`),
- o(l)) {
- const e = ce(l);
- c.height = e,
- c.borderRadius = e
- }
- y.lineStyle = c
- }
- ))
- }
- , D = (t,a)=>{
- const r = (e=>{
- const t = e < y.currentIndex ? -1 : 1;
- for (; e >= 0 && e < g.length; ) {
- if (!g[e].disabled)
- return e;
- e += t
- }
- }
- )(t);
- if (!o(r))
- return;
- const l = g[r]
- , c = x(l, r)
- , d = null !== y.currentIndex;
- y.currentIndex !== r && (y.currentIndex = r,
- a || B(),
- T()),
- c !== e.active && (n("update:active", c),
- d && n("change", c, l.title)),
- i && !e.scrollspy && ee(Math.ceil(te(s.value) - C.value))
- }
- , O = (e,t)=>{
- const o = g.find(((t,o)=>x(t, o) === e))
- , n = o ? g.indexOf(o) : 0;
- D(n, t)
- }
- , A = (t=!1)=>{
- if (e.scrollspy) {
- const o = g[y.currentIndex].$el;
- if (o && f.value) {
- const n = te(o, f.value) - S.value;
- l = !0,
- function(e, t, o, n) {
- let a = _(e);
- const r = a < t
- , l = 0 === o ? 1 : Math.round(1e3 * o / 16)
- , i = (t - a) / l;
- !function o() {
- a += i,
- (r && a > t || !r && a < t) && (a = t),
- J(e, a),
- r && a < t || !r && a > t ? k(o) : n && k(n)
- }()
- }(f.value, n, t ? 0 : +e.duration, (()=>{
- l = !1
- }
- ))
- }
- }
- }
- , z = e=>{
- i = e.isFixed,
- n("scroll", e)
- }
- , E = ()=>g.map(((o,a)=>t.createVNode(ko, t.mergeProps({
- key: o.id,
- id: `${p}-${a}`,
- ref: h(a),
- type: e.type,
- color: e.color,
- style: o.titleStyle,
- class: o.titleClass,
- shrink: e.shrink,
- isActive: a === y.currentIndex,
- controls: o.id,
- scrollable: w.value,
- activeColor: e.titleActiveColor,
- inactiveColor: e.titleInactiveColor,
- onClick: t=>((t,o,a)=>{
- const {title: r, disabled: l} = g[o]
- , i = x(g[o], o);
- l || (He(e.beforeChange, {
- args: [i],
- done: ()=>{
- D(o),
- A()
- }
- }),
- et(t)),
- n("clickTab", {
- name: i,
- title: r,
- event: a,
- disabled: l
- })
- }
- )(o, a, t)
- }, m(o, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
- title: o.$slots.title
- })))
- , $ = ()=>{
- if ("line" === e.type && g.length)
- return t.createVNode("div", {
- class: Eo("line"),
- style: y.lineStyle
- }, null)
- }
- , L = ()=>{
- var o, n, r;
- const {type: l, border: i, sticky: s} = e
- , u = [t.createVNode("div", {
- ref: s ? void 0 : d,
- class: [Eo("wrap"), {
- [Le]: "line" === l && i
- }]
- }, [t.createVNode("div", {
- ref: c,
- role: "tablist",
- class: Eo("nav", [l, {
- shrink: e.shrink,
- complete: w.value
- }]),
- style: V.value,
- "aria-orientation": "horizontal"
- }, [null == (o = a["nav-left"]) ? void 0 : o.call(a), E(), $(), null == (n = a["nav-right"]) ? void 0 : n.call(a)])]), null == (r = a["nav-bottom"]) ? void 0 : r.call(a)];
- return s ? t.createVNode("div", {
- ref: d
- }, [u]) : u
- }
- ;
- t.watch([()=>e.color, ie], T),
- t.watch((()=>e.active), (e=>{
- e !== N.value && O(e)
- }
- )),
- t.watch((()=>g.length), (()=>{
- y.inited && (O(e.active),
- T(),
- t.nextTick((()=>{
- B(!0)
- }
- )))
- }
- ));
- return Je({
- resize: ()=>{
- T(),
- t.nextTick((()=>{
- var e, t;
- return null == (t = null == (e = u.value) ? void 0 : e.swipeRef.value) ? void 0 : t.resize()
- }
- ))
- }
- ,
- scrollTo: e=>{
- t.nextTick((()=>{
- O(e),
- A(!0)
- }
- ))
- }
- }),
- t.onActivated(T),
- Ue(T),
- R((()=>{
- O(e.active, !0),
- t.nextTick((()=>{
- y.inited = !0,
- d.value && (r = P(d.value).height),
- B(!0)
- }
- ))
- }
- )),
- H("scroll", (()=>{
- if (e.scrollspy && !l) {
- const e = (()=>{
- for (let e = 0; e < g.length; e++) {
- const {top: t} = P(g[e].$el);
- if (t > S.value)
- return 0 === e ? 0 : e - 1
- }
- return g.length - 1
- }
- )();
- D(e)
- }
- }
- ), {
- target: f,
- passive: !0
- }),
- b({
- id: p,
- props: e,
- setLine: T,
- onRendered: (e,t)=>n("rendered", e, t),
- currentName: N,
- scrollIntoView: B
- }),
- ()=>t.createVNode("div", {
- ref: s,
- class: Eo([e.type])
- }, [e.sticky ? t.createVNode(xo, {
- container: s.value,
- offsetTop: C.value,
- onScroll: z
- }, {
- default: ()=>[L()]
- }) : L(), t.createVNode(Ao, {
- ref: u,
- count: g.length,
- inited: y.inited,
- animated: e.animated,
- duration: e.duration,
- swipeable: e.swipeable,
- lazyRender: e.lazyRender,
- currentIndex: y.currentIndex,
- onChange: D
- }, {
- default: ()=>{
- var e;
- return [null == (e = a.default) ? void 0 : e.call(a)]
- }
- })])
- }
- });
- const Fo = Symbol()
- , [Ro,Ho] = Oe("swipe-item");
- const jo = je(t.defineComponent({
- name: Ro,
- setup(e, {slots: o}) {
- let n;
- const a = t.reactive({
- offset: 0,
- inited: !1,
- mounted: !1
- })
- , {parent: r, index: l} = D(Po);
- if (!r)
- return;
- const i = t.computed((()=>{
- const e = {}
- , {vertical: t} = r.props;
- return r.size.value && (e[t ? "height" : "width"] = `${r.size.value}px`),
- a.offset && (e.transform = `translate${t ? "Y" : "X"}(${a.offset}px)`),
- e
- }
- ))
- , s = t.computed((()=>{
- const {loop: e, lazyRender: t} = r.props;
- if (!t || n)
- return !0;
- if (!a.mounted)
- return !1;
- const o = r.activeIndicator.value
- , i = r.count.value - 1
- , s = 0 === o && e ? i : o - 1
- , c = o === i && e ? 0 : o + 1;
- return n = l.value === o || l.value === s || l.value === c,
- n
- }
- ));
- return t.onMounted((()=>{
- t.nextTick((()=>{
- a.mounted = !0
- }
- ))
- }
- )),
- Je({
- setOffset: e=>{
- a.offset = e
- }
- }),
- ()=>{
- var e;
- return t.createVNode("div", {
- class: Ho(),
- style: i.value
- }, [s.value ? null == (e = o.default) ? void 0 : e.call(o) : null])
- }
- }
- }))
- , [Wo,Uo] = Oe("tab")
- , qo = d({}, Qe, {
- dot: Boolean,
- name: g,
- badge: g,
- title: String,
- disabled: Boolean,
- titleClass: h,
- titleStyle: [String, Object],
- showZeroBadge: b
- });
- const Yo = je(t.defineComponent({
- name: Wo,
- props: qo,
- setup(e, {slots: o}) {
- const n = go()
- , a = t.ref(!1)
- , {parent: r, index: l} = D(Lo);
- if (!r)
- return;
- const i = ()=>{
- var t;
- return null != (t = e.name) ? t : l.value
- }
- , s = t.computed((()=>{
- const o = i() === r.currentName.value;
- return o && !a.value && (a.value = !0,
- r.props.lazyRender && t.nextTick((()=>{
- r.onRendered(i(), e.title)
- }
- ))),
- o
- }
- ))
- , c = t.ref(!s.value);
- return t.watch(s, (e=>{
- e ? c.value = !1 : B((()=>{
- c.value = !0
- }
- ))
- }
- )),
- t.watch((()=>e.title), (()=>{
- r.setLine(),
- r.scrollIntoView()
- }
- )),
- t.provide(Fo, s),
- ()=>{
- var e;
- const i = `${r.id}-${l.value}`
- , {animated: d, swipeable: u, scrollspy: p, lazyRender: m} = r.props;
- if (!o.default && !d)
- return;
- const f = p || s.value;
- if (d || u)
- return t.createVNode(jo, {
- id: n,
- role: "tabpanel",
- class: Uo("panel-wrapper", {
- inactive: c.value
- }),
- tabindex: s.value ? 0 : -1,
- "aria-hidden": !s.value,
- "aria-labelledby": i
- }, {
- default: ()=>{
- var e;
- return [t.createVNode("div", {
- class: Uo("panel")
- }, [null == (e = o.default) ? void 0 : e.call(o)])]
- }
- });
- const v = a.value || p || !m ? null == (e = o.default) ? void 0 : e.call(o) : null;
- return Je({
- id: n
- }),
- t.withDirectives(t.createVNode("div", {
- id: n,
- role: "tabpanel",
- class: Uo("panel"),
- tabindex: f ? 0 : -1,
- "aria-labelledby": i
- }, [v]), [[t.vShow, f]])
- }
- }
- }))
- , Go = je(Mo)
- , [Xo,Zo] = Oe("picker-group")
- , Ko = Symbol(Xo)
- , _o = d({
- tabs: w()
- }, po);
- var Jo = t.defineComponent({
- name: Xo,
- props: _o,
- emits: ["confirm", "cancel"],
- setup(e, {emit: o, slots: n}) {
- const {children: a, linkChildren: r} = I(Ko);
- r();
- const l = ()=>{
- o("confirm", a.map((e=>e.confirm())))
- }
- , i = ()=>o("cancel");
- return ()=>{
- var o;
- const a = null == (o = n.default) ? void 0 : o.call(n);
- return t.createVNode("div", {
- class: Zo()
- }, [t.createVNode(vo, t.mergeProps(e, {
- onConfirm: l,
- onCancel: i
- }), null), t.createVNode(Go, {
- shrink: !0,
- class: Zo("tabs"),
- animated: !0
- }, {
- default: ()=>[e.tabs.map(((e,o)=>t.createVNode(Yo, {
- title: e,
- titleClass: Zo("tab-title")
- }, {
- default: ()=>[null == a ? void 0 : a[o]]
- })))]
- })])
- }
- }
- });
- const Qo = d({
- loading: Boolean,
- readonly: Boolean,
- allowHtml: Boolean,
- optionHeight: x(44),
- showToolbar: b,
- swipeDuration: x(1e3),
- visibleOptionNum: x(6)
- }, po)
- , en = d({}, Qo, {
- columns: w(),
- modelValue: w(),
- toolbarPosition: N("top"),
- columnsFieldNames: Object
- });
- var tn = t.defineComponent({
- name: Qt,
- props: en,
- emits: ["confirm", "cancel", "change", "clickOption", "update:modelValue"],
- setup(e, {emit: n, slots: a}) {
- const r = t.ref()
- , l = t.ref(e.modelValue.slice(0))
- , {parent: i} = D(Ko)
- , {children: s, linkChildren: c} = I(so);
- c();
- const u = t.computed((()=>function(e) {
- return d({
- text: "text",
- value: "value",
- children: "children"
- }, e)
- }(e.columnsFieldNames)))
- , p = t.computed((()=>fe(e.optionHeight)))
- , v = t.computed((()=>function(e, t) {
- const o = e[0];
- if (o) {
- if (Array.isArray(o))
- return "multiple";
- if (t.children in o)
- return "cascade"
- }
- return "default"
- }(e.columns, u.value)))
- , h = t.computed((()=>{
- const {columns: t} = e;
- switch (v.value) {
- case "multiple":
- return t;
- case "cascade":
- return function(e, t, n) {
- const a = [];
- let r = {
- [t.children]: e
- }
- , l = 0;
- for (; r && r[t.children]; ) {
- const e = r[t.children]
- , i = n.value[l];
- r = o(i) ? ro(e, i, t) : void 0,
- !r && e.length && (r = ro(e, oo(e)[t.value], t)),
- l++,
- a.push(e)
- }
- return a
- }(t, u.value, l);
- default:
- return [t]
- }
- }
- ))
- , g = t.computed((()=>h.value.some((e=>e.length))))
- , b = t.computed((()=>h.value.map(((e,t)=>ro(e, l.value[t], u.value)))))
- , y = t.computed((()=>h.value.map(((e,t)=>e.findIndex((e=>e[u.value.value] === l.value[t]))))))
- , w = (e,t)=>{
- if (l.value[e] !== t) {
- const o = l.value.slice(0);
- o[e] = t,
- l.value = o
- }
- }
- , V = ()=>({
- selectedValues: l.value.slice(0),
- selectedOptions: b.value,
- selectedIndexes: y.value
- })
- , x = ()=>{
- s.forEach((e=>e.stopMomentum()));
- const e = V();
- return t.nextTick((()=>{
- n("confirm", e)
- }
- )),
- e
- }
- , N = ()=>n("cancel", V())
- , C = ()=>h.value.map(((o,r)=>t.createVNode(co, {
- value: l.value[r],
- fields: u.value,
- options: o,
- readonly: e.readonly,
- allowHtml: e.allowHtml,
- optionHeight: p.value,
- swipeDuration: e.swipeDuration,
- visibleOptionNum: e.visibleOptionNum,
- onChange: e=>((e,t)=>{
- w(t, e),
- "cascade" === v.value && l.value.forEach(((e,t)=>{
- const o = h.value[t];
- ao(o, e, u.value) || w(t, o.length ? o[0][u.value.value] : void 0)
- }
- )),
- n("change", d({
- columnIndex: t
- }, V()))
- }
- )(e, r),
- onClickOption: e=>((e,t)=>n("clickOption", d({
- columnIndex: t,
- currentOption: e
- }, V())))(e, r)
- }, {
- option: a.option
- })))
- , k = e=>{
- if (g.value) {
- const o = {
- height: `${p.value}px`
- }
- , n = {
- backgroundSize: `100% ${(e - p.value) / 2}px`
- };
- return [t.createVNode("div", {
- class: eo("mask"),
- style: n
- }, null), t.createVNode("div", {
- class: [Me, eo("frame")],
- style: o
- }, null)]
- }
- }
- , S = ()=>{
- const o = p.value * +e.visibleOptionNum
- , n = {
- height: `${o}px`
- };
- return t.createVNode("div", {
- ref: r,
- class: eo("columns"),
- style: n
- }, [C(), k(o)])
- }
- , B = ()=>{
- if (e.showToolbar && !i)
- return t.createVNode(vo, t.mergeProps(m(e, fo), {
- onConfirm: x,
- onCancel: N
- }), m(a, mo))
- }
- ;
- let T;
- t.watch(h, (e=>{
- e.forEach(((e,t)=>{
- e.length && !ao(e, l.value[t], u.value) && w(t, oo(e)[u.value.value])
- }
- ))
- }
- ), {
- immediate: !0
- }),
- t.watch((()=>e.modelValue), (e=>{
- f(e, l.value) || f(e, T) || (l.value = e.slice(0))
- }
- ), {
- deep: !0
- }),
- t.watch(l, (t=>{
- f(t, e.modelValue) || (T = t.slice(0),
- n("update:modelValue", T))
- }
- ), {
- immediate: !0
- }),
- H("touchmove", re, {
- target: r
- });
- return Je({
- confirm: x,
- getSelectedOptions: ()=>b.value
- }),
- ()=>{
- var o, n;
- return t.createVNode("div", {
- class: eo()
- }, ["top" === e.toolbarPosition ? B() : null, e.loading ? t.createVNode(Vt, {
- class: eo("loading")
- }, null) : null, null == (o = a["columns-top"]) ? void 0 : o.call(a), S(), null == (n = a["columns-bottom"]) ? void 0 : n.call(a), "bottom" === e.toolbarPosition ? B() : null])
- }
- }
- });
- const on = "000000"
- , nn = ["title", "cancel", "confirm", "toolbar", "columns-top", "columns-bottom"]
- , an = ["title", "loading", "readonly", "optionHeight", "swipeDuration", "visibleOptionNum", "cancelButtonText", "confirmButtonText"]
- , rn = (e="",t="000000",o)=>({
- text: e,
- value: t,
- children: o
- });
- function ln({areaList: e, columnsNum: t, columnsPlaceholder: o}) {
- const {city_list: n={}, county_list: a={}, province_list: r={}} = e
- , l = t > 1
- , i = t > 2
- , s = new Map;
- Object.keys(r).forEach((e=>{
- s.set(e.slice(0, 2), rn(r[e], e, (()=>{
- if (l)
- return o.length ? [rn(o[0], on, i ? [] : void 0)] : []
- }
- )()))
- }
- ));
- const c = new Map;
- if (l) {
- const e = ()=>{
- if (i)
- return o.length ? [rn(o[1])] : []
- }
- ;
- Object.keys(n).forEach((t=>{
- const o = rn(n[t], t, e());
- c.set(t.slice(0, 4), o);
- const a = s.get(t.slice(0, 2));
- a && a.children.push(o)
- }
- ))
- }
- i && Object.keys(a).forEach((e=>{
- const t = c.get(e.slice(0, 4));
- t && t.children.push(rn(a[e], e))
- }
- ));
- const d = Array.from(s.values());
- if (o.length) {
- const e = i ? [rn(o[2])] : void 0
- , t = l ? [rn(o[1], on, e)] : void 0;
- d.unshift(rn(o[0], on, t))
- }
- return d
- }
- const sn = je(tn)
- , [cn,dn] = Oe("area")
- , un = d({}, Qo, {
- modelValue: String,
- columnsNum: x(3),
- columnsPlaceholder: w(),
- areaList: {
- type: Object,
- default: ()=>({})
- }
- });
- const pn = je(t.defineComponent({
- name: cn,
- props: un,
- emits: ["change", "confirm", "cancel", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref([])
- , r = t.ref()
- , l = t.computed((()=>ln(e)))
- , i = (...e)=>o("change", ...e)
- , s = (...e)=>o("cancel", ...e)
- , c = (...e)=>o("confirm", ...e);
- return t.watch(a, (t=>{
- const n = t.length ? t[t.length - 1] : "";
- n && n !== e.modelValue && o("update:modelValue", n)
- }
- ), {
- deep: !0
- }),
- t.watch((()=>e.modelValue), (t=>{
- if (t) {
- t !== (a.value.length ? a.value[a.value.length - 1] : "") && (a.value = [`${t.slice(0, 2)}0000`, `${t.slice(0, 4)}00`, t].slice(0, +e.columnsNum))
- } else
- a.value = []
- }
- ), {
- immediate: !0
- }),
- Je({
- confirm: ()=>{
- var e;
- return null == (e = r.value) ? void 0 : e.confirm()
- }
- ,
- getSelectedOptions: ()=>{
- var e;
- return (null == (e = r.value) ? void 0 : e.getSelectedOptions()) || []
- }
- }),
- ()=>t.createVNode(sn, t.mergeProps({
- ref: r,
- modelValue: a.value,
- "onUpdate:modelValue": e=>a.value = e,
- class: dn(),
- columns: l.value,
- onChange: i,
- onCancel: s,
- onConfirm: c
- }, m(e, an)), m(n, nn))
- }
- }))
- , [mn,fn] = Oe("cell")
- , vn = {
- tag: N("div"),
- icon: String,
- size: String,
- title: g,
- value: g,
- label: g,
- center: Boolean,
- isLink: Boolean,
- border: b,
- required: Boolean,
- iconPrefix: String,
- valueClass: h,
- labelClass: h,
- titleClass: h,
- titleStyle: null,
- arrowDirection: String,
- clickable: {
- type: Boolean,
- default: null
- }
- }
- , hn = d({}, vn, Qe);
- const gn = je(t.defineComponent({
- name: mn,
- props: hn,
- setup(e, {slots: n}) {
- const a = tt()
- , r = ()=>{
- if (n.label || o(e.label))
- return t.createVNode("div", {
- class: [fn("label"), e.labelClass]
- }, [n.label ? n.label() : e.label])
- }
- , l = ()=>{
- var a;
- if (n.title || o(e.title)) {
- const o = null == (a = n.title) ? void 0 : a.call(n);
- if (Array.isArray(o) && 0 === o.length)
- return;
- return t.createVNode("div", {
- class: [fn("title"), e.titleClass],
- style: e.titleStyle
- }, [o || t.createVNode("span", null, [e.title]), r()])
- }
- }
- , i = ()=>{
- const a = n.value || n.default;
- if (a || o(e.value))
- return t.createVNode("div", {
- class: [fn("value"), e.valueClass]
- }, [a ? a() : t.createVNode("span", null, [e.value])])
- }
- , s = ()=>{
- if (n["right-icon"])
- return n["right-icon"]();
- if (e.isLink) {
- const o = e.arrowDirection && "right" !== e.arrowDirection ? `arrow-${e.arrowDirection}` : "arrow";
- return t.createVNode(vt, {
- name: o,
- class: fn("right-icon")
- }, null)
- }
- }
- ;
- return ()=>{
- var o;
- const {tag: r, size: c, center: d, border: u, isLink: p, required: m} = e
- , f = null != (o = e.clickable) ? o : p
- , v = {
- center: d,
- required: m,
- clickable: f,
- borderless: !u
- };
- return c && (v[c] = !!c),
- t.createVNode(r, {
- class: fn(v),
- role: f ? "button" : void 0,
- tabindex: f ? 0 : void 0,
- onClick: a
- }, {
- default: ()=>{
- var o;
- return [n.icon ? n.icon() : e.icon ? t.createVNode(vt, {
- name: e.icon,
- class: fn("left-icon"),
- classPrefix: e.iconPrefix
- }, null) : void 0, l(), i(), s(), null == (o = n.extra) ? void 0 : o.call(n)]
- }
- })
- }
- }
- }))
- , [bn,yn] = Oe("form")
- , wn = {
- colon: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- showError: Boolean,
- labelWidth: g,
- labelAlign: String,
- inputAlign: String,
- scrollToError: Boolean,
- validateFirst: Boolean,
- submitOnEnter: b,
- showErrorMessage: b,
- errorMessageAlign: String,
- validateTrigger: {
- type: [String, Array],
- default: "onBlur"
- }
- };
- const Vn = je(t.defineComponent({
- name: bn,
- props: wn,
- emits: ["submit", "failed"],
- setup(e, {emit: o, slots: n}) {
- const {children: a, linkChildren: r} = I(Re)
- , l = e=>e ? a.filter((t=>e.includes(t.name))) : a
- , i = t=>{
- return "string" == typeof t ? (e=>{
- const t = a.find((t=>t.name === e));
- return t ? new Promise(((e,o)=>{
- t.validate().then((t=>{
- t ? o(t) : e()
- }
- ))
- }
- )) : Promise.reject()
- }
- )(t) : e.validateFirst ? (o = t,
- new Promise(((e,t)=>{
- const n = [];
- l(o).reduce(((e,t)=>e.then((()=>{
- if (!n.length)
- return t.validate().then((e=>{
- e && n.push(e)
- }
- ))
- }
- ))), Promise.resolve()).then((()=>{
- n.length ? t(n) : e()
- }
- ))
- }
- ))) : (e=>new Promise(((t,o)=>{
- const n = l(e);
- Promise.all(n.map((e=>e.validate()))).then((e=>{
- (e = e.filter(Boolean)).length ? o(e) : t()
- }
- ))
- }
- )))(t);
- var o
- }
- , s = (e,t)=>{
- a.some((o=>o.name === e && (o.$el.scrollIntoView(t),
- !0)))
- }
- , c = ()=>a.reduce(((e,t)=>(e[t.name] = t.formValue.value,
- e)), {})
- , d = ()=>{
- const t = c();
- i().then((()=>o("submit", t))).catch((n=>{
- o("failed", {
- values: t,
- errors: n
- }),
- e.scrollToError && n[0].name && s(n[0].name)
- }
- ))
- }
- , u = e=>{
- re(e),
- d()
- }
- ;
- return r({
- props: e
- }),
- Je({
- submit: d,
- validate: i,
- getValues: c,
- scrollToField: s,
- resetValidation: e=>{
- "string" == typeof e && (e = [e]);
- l(e).forEach((e=>{
- e.resetValidation()
- }
- ))
- }
- ,
- getValidationStatus: ()=>a.reduce(((e,t)=>(e[t.name] = t.getValidationStatus(),
- e)), {})
- }),
- ()=>{
- var e;
- return t.createVNode("form", {
- class: yn(),
- onSubmit: u
- }, [null == (e = n.default) ? void 0 : e.call(n)])
- }
- }
- }));
- function xn(e) {
- return Array.isArray(e) ? !e.length : 0 !== e && !e
- }
- function Nn(e, t) {
- const {message: o} = t;
- return n(o) ? o(e, t) : o || ""
- }
- function Cn({target: e}) {
- e.composing = !0
- }
- function kn({target: e}) {
- e.composing && (e.composing = !1,
- e.dispatchEvent(new Event("input")))
- }
- function Sn(e) {
- return [...e].length
- }
- const [Bn,Tn] = Oe("field")
- , Pn = {
- id: String,
- name: String,
- leftIcon: String,
- rightIcon: String,
- autofocus: Boolean,
- clearable: Boolean,
- maxlength: g,
- formatter: Function,
- clearIcon: N("clear"),
- modelValue: x(""),
- inputAlign: String,
- placeholder: String,
- autocomplete: String,
- errorMessage: String,
- enterkeyhint: String,
- clearTrigger: N("focus"),
- formatTrigger: N("onChange"),
- error: {
- type: Boolean,
- default: null
- },
- disabled: {
- type: Boolean,
- default: null
- },
- readonly: {
- type: Boolean,
- default: null
- }
- }
- , Dn = d({}, vn, Pn, {
- rows: g,
- type: N("text"),
- rules: Array,
- autosize: [Boolean, Object],
- labelWidth: g,
- labelClass: h,
- labelAlign: String,
- showWordLimit: Boolean,
- errorMessageAlign: String,
- colon: {
- type: Boolean,
- default: null
- }
- });
- const On = je(t.defineComponent({
- name: Bn,
- props: Dn,
- emits: ["blur", "focus", "clear", "keypress", "clickInput", "endValidate", "startValidate", "clickLeftIcon", "clickRightIcon", "update:modelValue"],
- setup(e, {emit: n, slots: l}) {
- const i = go()
- , s = t.reactive({
- status: "unvalidated",
- focused: !1,
- validateMessage: ""
- })
- , c = t.ref()
- , d = t.ref()
- , u = t.ref()
- , {parent: p} = D(Re)
- , m = ()=>{
- var t;
- return String(null != (t = e.modelValue) ? t : "")
- }
- , f = t=>o(e[t]) ? e[t] : p && o(p.props[t]) ? p.props[t] : void 0
- , h = t.computed((()=>{
- const t = f("readonly");
- if (e.clearable && !t) {
- const t = "" !== m()
- , o = "always" === e.clearTrigger || "focus" === e.clearTrigger && s.focused;
- return t && o
- }
- return !1
- }
- ))
- , g = t.computed((()=>u.value && l.input ? u.value() : e.modelValue))
- , b = e=>e.reduce(((e,t)=>e.then((()=>{
- if ("failed" === s.status)
- return;
- let {value: e} = g;
- if (t.formatter && (e = t.formatter(e, t)),
- !function(e, t) {
- if (xn(e)) {
- if (t.required)
- return !1;
- if (!1 === t.validateEmpty)
- return !0
- }
- return !(t.pattern && !t.pattern.test(String(e)))
- }(e, t))
- return s.status = "failed",
- void (s.validateMessage = Nn(e, t));
- if (t.validator) {
- if (xn(e) && !1 === t.validateEmpty)
- return;
- return function(e, t) {
- return new Promise((o=>{
- const n = t.validator(e, t);
- r(n) ? n.then(o) : o(n)
- }
- ))
- }(e, t).then((o=>{
- o && "string" == typeof o ? (s.status = "failed",
- s.validateMessage = o) : !1 === o && (s.status = "failed",
- s.validateMessage = Nn(e, t))
- }
- ))
- }
- }
- ))), Promise.resolve())
- , y = ()=>{
- s.status = "unvalidated",
- s.validateMessage = ""
- }
- , w = ()=>n("endValidate", {
- status: s.status,
- message: s.validateMessage
- })
- , V = (t=e.rules)=>new Promise((o=>{
- y(),
- t ? (n("startValidate"),
- b(t).then((()=>{
- "failed" === s.status ? (o({
- name: e.name,
- message: s.validateMessage
- }),
- w()) : (s.status = "passed",
- o(),
- w())
- }
- ))) : o()
- }
- ))
- , x = t=>{
- if (p && e.rules) {
- const {validateTrigger: o} = p.props
- , n = v(o).includes(t)
- , a = e.rules.filter((e=>e.trigger ? v(e.trigger).includes(t) : n));
- a.length && V(a)
- }
- }
- , N = (t,a="onChange")=>{
- const r = t
- , l = (t = (t=>{
- const {maxlength: n} = e;
- if (o(n) && Sn(t) > n) {
- const e = m();
- return e && Sn(e) === +n ? e : function(e, t) {
- return [...e].slice(0, t).join("")
- }(t, +n)
- }
- return t
- }
- )(t)) !== r;
- if ("number" === e.type || "digit" === e.type) {
- const o = "number" === e.type;
- t = we(t, o, o)
- }
- if (e.formatter && a === e.formatTrigger && (t = e.formatter(t)),
- c.value && c.value.value !== t)
- if (s.focused && l) {
- const {selectionStart: e, selectionEnd: o} = c.value;
- c.value.value = t,
- c.value.setSelectionRange(e - 1, o - 1)
- } else
- c.value.value = t;
- t !== e.modelValue && n("update:modelValue", t)
- }
- , C = e=>{
- e.target.composing || N(e.target.value)
- }
- , k = ()=>{
- var e;
- return null == (e = c.value) ? void 0 : e.blur()
- }
- , S = ()=>{
- const t = c.value;
- "textarea" === e.type && e.autosize && t && function(e, t) {
- const o = Q();
- e.style.height = "auto";
- let n = e.scrollHeight;
- if (a(t)) {
- const {maxHeight: e, minHeight: o} = t;
- void 0 !== e && (n = Math.min(n, e)),
- void 0 !== o && (n = Math.max(n, o))
- }
- n && (e.style.height = `${n}px`,
- ee(o))
- }(t, e.autosize)
- }
- , B = e=>{
- s.focused = !0,
- n("focus", e),
- t.nextTick(S),
- f("readonly") && k()
- }
- , T = e=>{
- f("readonly") || (s.focused = !1,
- N(m(), "onBlur"),
- n("blur", e),
- x("onBlur"),
- t.nextTick(S),
- ne())
- }
- , P = e=>n("clickInput", e)
- , O = e=>n("clickLeftIcon", e)
- , I = e=>n("clickRightIcon", e)
- , A = t.computed((()=>"boolean" == typeof e.error ? e.error : !(!p || !p.props.showError || "failed" !== s.status) || void 0))
- , z = t.computed((()=>{
- const e = f("labelWidth");
- if (e)
- return {
- width: ce(e)
- }
- }
- ))
- , E = t=>{
- if (13 === t.keyCode) {
- p && p.props.submitOnEnter || "textarea" === e.type || re(t),
- "search" === e.type && k()
- }
- n("keypress", t)
- }
- , $ = ()=>e.id || `${i}-input`
- , L = ()=>{
- const o = Tn("control", [f("inputAlign"), {
- error: A.value,
- custom: !!l.input,
- "min-height": "textarea" === e.type && !e.autosize
- }]);
- if (l.input)
- return t.createVNode("div", {
- class: o,
- onClick: P
- }, [l.input()]);
- const n = {
- id: $(),
- ref: c,
- name: e.name,
- rows: void 0 !== e.rows ? +e.rows : void 0,
- class: o,
- disabled: f("disabled"),
- readonly: f("readonly"),
- autofocus: e.autofocus,
- placeholder: e.placeholder,
- autocomplete: e.autocomplete,
- enterkeyhint: e.enterkeyhint,
- "aria-labelledby": e.label ? `${i}-label` : void 0,
- onBlur: T,
- onFocus: B,
- onInput: C,
- onClick: P,
- onChange: kn,
- onKeypress: E,
- onCompositionend: kn,
- onCompositionstart: Cn
- };
- return "textarea" === e.type ? t.createVNode("textarea", n, null) : t.createVNode("input", t.mergeProps("number" === (a = e.type) ? {
- type: "text",
- inputmode: "decimal"
- } : "digit" === a ? {
- type: "tel",
- inputmode: "numeric"
- } : {
- type: a
- }, n), null);
- var a
- }
- , M = ()=>{
- const o = l["right-icon"];
- if (e.rightIcon || o)
- return t.createVNode("div", {
- class: Tn("right-icon"),
- onClick: I
- }, [o ? o() : t.createVNode(vt, {
- name: e.rightIcon,
- classPrefix: e.iconPrefix
- }, null)])
- }
- , F = ()=>{
- if (e.showWordLimit && e.maxlength) {
- const o = Sn(m());
- return t.createVNode("div", {
- class: Tn("word-limit")
- }, [t.createVNode("span", {
- class: Tn("word-num")
- }, [o]), t.createTextVNode("/"), e.maxlength])
- }
- }
- , R = ()=>{
- if (p && !1 === p.props.showErrorMessage)
- return;
- const o = e.errorMessage || s.validateMessage;
- if (o) {
- const e = l["error-message"]
- , n = f("errorMessageAlign");
- return t.createVNode("div", {
- class: Tn("error-message", n)
- }, [e ? e({
- message: o
- }) : o])
- }
- }
- , j = ()=>[t.createVNode("div", {
- class: Tn("body")
- }, [L(), h.value && t.createVNode(vt, {
- ref: d,
- name: e.clearIcon,
- class: Tn("clear")
- }, null), M(), l.button && t.createVNode("div", {
- class: Tn("button")
- }, [l.button()])]), F(), R()];
- return Je({
- blur: k,
- focus: ()=>{
- var e;
- return null == (e = c.value) ? void 0 : e.focus()
- }
- ,
- validate: V,
- formValue: g,
- resetValidation: y,
- getValidationStatus: ()=>s.status
- }),
- t.provide(Z, {
- customValue: u,
- resetValidation: y,
- validateWithTrigger: x
- }),
- t.watch((()=>e.modelValue), (()=>{
- N(m()),
- y(),
- x("onChange"),
- t.nextTick(S)
- }
- )),
- t.onMounted((()=>{
- N(m(), e.formatTrigger),
- t.nextTick(S)
- }
- )),
- H("touchstart", (e=>{
- re(e),
- n("update:modelValue", ""),
- n("clear", e)
- }
- ), {
- target: t.computed((()=>{
- var e;
- return null == (e = d.value) ? void 0 : e.$el
- }
- ))
- }),
- ()=>{
- const o = f("disabled")
- , n = f("labelAlign")
- , a = (()=>{
- const o = l["left-icon"];
- if (e.leftIcon || o)
- return t.createVNode("div", {
- class: Tn("left-icon"),
- onClick: O
- }, [o ? o() : t.createVNode(vt, {
- name: e.leftIcon,
- classPrefix: e.iconPrefix
- }, null)])
- }
- )();
- return t.createVNode(gn, {
- size: e.size,
- class: Tn({
- error: A.value,
- disabled: o,
- [`label-${n}`]: n
- }),
- center: e.center,
- border: e.border,
- isLink: e.isLink,
- clickable: e.clickable,
- titleStyle: z.value,
- valueClass: Tn("value"),
- titleClass: [Tn("label", [n, {
- required: e.required
- }]), e.labelClass],
- arrowDirection: e.arrowDirection
- }, {
- icon: a && "top" !== n ? ()=>a : null,
- title: ()=>{
- const o = (()=>{
- const o = f("colon") ? ":" : "";
- return l.label ? [l.label(), o] : e.label ? t.createVNode("label", {
- id: `${i}-label`,
- for: $()
- }, [e.label + o]) : void 0
- }
- )();
- return "top" === n ? [a, o].filter(Boolean) : o || []
- }
- ,
- value: j,
- extra: l.extra
- })
- }
- }
- }));
- let In = 0;
- const [An,zn] = Oe("toast")
- , En = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"]
- , $n = {
- icon: String,
- show: Boolean,
- type: N("text"),
- overlay: Boolean,
- message: g,
- iconSize: g,
- duration: V(2e3),
- position: N("middle"),
- teleport: [String, Object],
- wordBreak: String,
- className: h,
- iconPrefix: String,
- transition: N("van-fade"),
- loadingType: String,
- forbidClick: Boolean,
- overlayClass: h,
- overlayStyle: Object,
- closeOnClick: Boolean,
- closeOnClickOverlay: Boolean
- };
- var Ln = t.defineComponent({
- name: An,
- props: $n,
- emits: ["update:show"],
- setup(e, {emit: n, slots: a}) {
- let r, l = !1;
- const i = ()=>{
- const t = e.show && e.forbidClick;
- l !== t && (l = t,
- l ? (In || document.body.classList.add("van-toast--unclickable"),
- In++) : In && (In--,
- In || document.body.classList.remove("van-toast--unclickable")))
- }
- , s = e=>n("update:show", e)
- , c = ()=>{
- e.closeOnClick && s(!1)
- }
- , d = ()=>clearTimeout(r)
- , u = ()=>{
- const {icon: o, type: n, iconSize: a, iconPrefix: r, loadingType: l} = e;
- return o || "success" === n || "fail" === n ? t.createVNode(vt, {
- name: o || n,
- size: a,
- class: zn("icon"),
- classPrefix: r
- }, null) : "loading" === n ? t.createVNode(Vt, {
- class: zn("loading"),
- size: a,
- type: l
- }, null) : void 0
- }
- , p = ()=>{
- const {type: n, message: r} = e;
- return a.message ? t.createVNode("div", {
- class: zn("text")
- }, [a.message()]) : o(r) && "" !== r ? "html" === n ? t.createVNode("div", {
- key: 0,
- class: zn("text"),
- innerHTML: String(r)
- }, null) : t.createVNode("div", {
- class: zn("text")
- }, [r]) : void 0
- }
- ;
- return t.watch((()=>[e.show, e.forbidClick]), i),
- t.watch((()=>[e.show, e.type, e.message, e.duration]), (()=>{
- d(),
- e.show && e.duration > 0 && (r = setTimeout((()=>{
- s(!1)
- }
- ), e.duration))
- }
- )),
- t.onMounted(i),
- t.onUnmounted(i),
- ()=>t.createVNode(Gt, t.mergeProps({
- class: [zn([e.position, "normal" === e.wordBreak ? "break-normal" : e.wordBreak, {
- [e.type]: !e.icon
- }]), e.className],
- lockScroll: !1,
- onClick: c,
- onClosed: d,
- "onUpdate:show": s
- }, m(e, En)), {
- default: ()=>[u(), p()]
- })
- }
- });
- function Mn() {
- const e = t.reactive({
- show: !1
- })
- , o = t=>{
- e.show = t
- }
- , n = t=>{
- d(e, t, {
- transitionAppear: !0
- }),
- o(!0)
- }
- , a = ()=>o(!1);
- return Je({
- open: n,
- close: a,
- toggle: o
- }),
- {
- open: n,
- close: a,
- state: e,
- toggle: o
- }
- }
- function Fn(e) {
- const o = t.createApp(e)
- , n = document.createElement("div");
- return document.body.appendChild(n),
- {
- instance: o.mount(n),
- unmount() {
- o.unmount(),
- document.body.removeChild(n)
- }
- }
- }
- const Rn = {
- icon: "",
- type: "text",
- message: "",
- className: "",
- overlay: !1,
- onClose: void 0,
- onOpened: void 0,
- duration: 2e3,
- teleport: "body",
- iconSize: void 0,
- iconPrefix: void 0,
- position: "middle",
- transition: "van-fade",
- forbidClick: !1,
- loadingType: void 0,
- overlayClass: "",
- overlayStyle: void 0,
- closeOnClick: !1,
- closeOnClickOverlay: !1
- };
- let Hn = []
- , jn = !1
- , Wn = d({}, Rn);
- const Un = new Map;
- function qn(e) {
- return a(e) ? e : {
- message: e
- }
- }
- function Yn() {
- if (!Hn.length || jn) {
- const e = function() {
- const {instance: e, unmount: o} = Fn({
- setup() {
- const n = t.ref("")
- , {open: a, state: r, close: l, toggle: i} = Mn()
- , s = ()=>{
- jn && (Hn = Hn.filter((t=>t !== e)),
- o())
- }
- ;
- return t.watch(n, (e=>{
- r.message = e
- }
- )),
- t.getCurrentInstance().render = ()=>{
- const e = {
- onClosed: s,
- "onUpdate:show": i
- };
- return t.createVNode(Ln, t.mergeProps(r, e), null)
- }
- ,
- {
- open: a,
- close: l,
- message: n
- }
- }
- });
- return e
- }();
- Hn.push(e)
- }
- return Hn[Hn.length - 1]
- }
- function Gn(e={}) {
- if (!u)
- return {};
- const t = Yn()
- , o = qn(e);
- return t.open(d({}, Wn, Un.get(o.type || Wn.type), o)),
- t
- }
- const Xn = e=>t=>Gn(d({
- type: e
- }, qn(t)))
- , Zn = Xn("loading")
- , Kn = Xn("success")
- , _n = Xn("fail");
- const Jn = je(Ln)
- , [Qn,ea] = Oe("switch")
- , ta = {
- size: g,
- loading: Boolean,
- disabled: Boolean,
- modelValue: h,
- activeColor: String,
- inactiveColor: String,
- activeValue: {
- type: h,
- default: !0
- },
- inactiveValue: {
- type: h,
- default: !1
- }
- };
- const oa = je(t.defineComponent({
- name: Qn,
- props: ta,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = ()=>e.modelValue === e.activeValue
- , r = ()=>{
- if (!e.disabled && !e.loading) {
- const t = a() ? e.inactiveValue : e.activeValue;
- o("update:modelValue", t),
- o("change", t)
- }
- }
- , l = ()=>{
- if (e.loading) {
- const o = a() ? e.activeColor : e.inactiveColor;
- return t.createVNode(Vt, {
- class: ea("loading"),
- color: o
- }, null)
- }
- if (n.node)
- return n.node()
- }
- ;
- return K((()=>e.modelValue)),
- ()=>{
- var o;
- const {size: i, loading: s, disabled: c, activeColor: d, inactiveColor: u} = e
- , p = a()
- , m = {
- fontSize: ce(i),
- backgroundColor: p ? d : u
- };
- return t.createVNode("div", {
- role: "switch",
- class: ea({
- on: p,
- loading: s,
- disabled: c
- }),
- style: m,
- tabindex: c ? void 0 : 0,
- "aria-checked": p,
- onClick: r
- }, [t.createVNode("div", {
- class: ea("node")
- }, [l()]), null == (o = n.background) ? void 0 : o.call(n)])
- }
- }
- }))
- , [na,aa] = Oe("address-edit-detail")
- , ra = Oe("address-edit")[2];
- var la = t.defineComponent({
- name: na,
- props: {
- show: Boolean,
- rows: g,
- value: String,
- rules: Array,
- focused: Boolean,
- maxlength: g,
- searchResult: Array,
- showSearchResult: Boolean
- },
- emits: ["blur", "focus", "input", "selectSearch"],
- setup(e, {emit: o}) {
- const n = t.ref()
- , a = ()=>e.focused && e.searchResult && e.showSearchResult
- , r = ()=>{
- if (!a())
- return;
- const {searchResult: n} = e;
- return n.map((e=>t.createVNode(gn, {
- clickable: !0,
- key: (e.name || "") + (e.address || ""),
- icon: "location-o",
- title: e.name,
- label: e.address,
- class: aa("search-item"),
- border: !1,
- onClick: ()=>(e=>{
- o("selectSearch", e),
- o("input", `${e.address || ""} ${e.name || ""}`.trim())
- }
- )(e)
- }, null)))
- }
- , l = e=>o("blur", e)
- , i = e=>o("focus", e)
- , s = e=>o("input", e);
- return ()=>{
- if (e.show)
- return t.createVNode(t.Fragment, null, [t.createVNode(On, {
- autosize: !0,
- clearable: !0,
- ref: n,
- class: aa(),
- rows: e.rows,
- type: "textarea",
- rules: e.rules,
- label: ra("addressDetail"),
- border: !a(),
- maxlength: e.maxlength,
- modelValue: e.value,
- placeholder: ra("addressDetail"),
- onBlur: l,
- onFocus: i,
- "onUpdate:modelValue": s
- }, null), r()])
- }
- }
- });
- const [ia,sa,ca] = Oe("address-edit")
- , da = {
- name: "",
- tel: "",
- city: "",
- county: "",
- country: "",
- province: "",
- areaCode: "",
- isDefault: !1,
- addressDetail: ""
- }
- , ua = {
- areaList: Object,
- isSaving: Boolean,
- isDeleting: Boolean,
- validator: Function,
- showArea: b,
- showDetail: b,
- showDelete: Boolean,
- disableArea: Boolean,
- searchResult: Array,
- telMaxlength: g,
- showSetDefault: Boolean,
- saveButtonText: String,
- areaPlaceholder: String,
- deleteButtonText: String,
- showSearchResult: Boolean,
- detailRows: x(1),
- detailMaxlength: x(200),
- areaColumnsPlaceholder: w(),
- addressInfo: {
- type: Object,
- default: ()=>d({}, da)
- },
- telValidator: {
- type: Function,
- default: i
- }
- };
- const pa = je(t.defineComponent({
- name: ia,
- props: ua,
- emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
- setup(e, {emit: o, slots: n}) {
- const r = t.ref()
- , l = t.reactive({})
- , i = t.ref(!1)
- , s = t.ref(!1)
- , c = t.computed((()=>a(e.areaList) && Object.keys(e.areaList).length))
- , u = t.computed((()=>{
- const {province: e, city: t, county: o, areaCode: n} = l;
- if (n) {
- const n = [e, t, o];
- return e && e === t && n.splice(1, 1),
- n.filter(Boolean).join("/")
- }
- return ""
- }
- ))
- , p = t.computed((()=>{
- var t;
- return (null == (t = e.searchResult) ? void 0 : t.length) && s.value
- }
- ))
- , m = e=>{
- s.value = "addressDetail" === e,
- o("focus", e)
- }
- , f = t.computed((()=>{
- const {validator: t, telValidator: o} = e
- , n = (e,o)=>({
- validator: n=>{
- if (t) {
- const o = t(e, n);
- if (o)
- return o
- }
- return !!n || o
- }
- });
- return {
- name: [n("name", ca("nameEmpty"))],
- tel: [n("tel", ca("telInvalid")), {
- validator: o,
- message: ca("telInvalid")
- }],
- areaCode: [n("areaCode", ca("areaEmpty"))],
- addressDetail: [n("addressDetail", ca("addressEmpty"))]
- }
- }
- ))
- , v = ()=>o("save", l)
- , h = e=>{
- l.addressDetail = e,
- o("changeDetail", e)
- }
- , g = e=>{
- l.province = e[0].text,
- l.city = e[1].text,
- l.county = e[2].text
- }
- , b = ({selectedValues: e, selectedOptions: t})=>{
- e.some((e=>e === on)) ? Gn(ca("areaEmpty")) : (i.value = !1,
- g(t),
- o("changeArea", t))
- }
- , y = ()=>o("delete", l)
- , w = ()=>{
- setTimeout((()=>{
- s.value = !1
- }
- ))
- }
- , V = ()=>{
- if (e.showSetDefault) {
- const e = {
- "right-icon": ()=>t.createVNode(oa, {
- modelValue: l.isDefault,
- "onUpdate:modelValue": e=>l.isDefault = e,
- onChange: e=>o("changeDefault", e)
- }, null)
- };
- return t.withDirectives(t.createVNode(gn, {
- center: !0,
- title: ca("defaultAddress"),
- class: sa("default")
- }, e), [[t.vShow, !p.value]])
- }
- }
- ;
- return Je({
- setAreaCode: e=>{
- l.areaCode = e || ""
- }
- ,
- setAddressDetail: e=>{
- l.addressDetail = e
- }
- }),
- t.watch((()=>e.addressInfo), (e=>{
- d(l, da, e),
- t.nextTick((()=>{
- var e;
- const t = null == (e = r.value) ? void 0 : e.getSelectedOptions();
- t && t.every((e=>e && e.value !== on)) && g(t)
- }
- ))
- }
- ), {
- deep: !0,
- immediate: !0
- }),
- ()=>{
- const {disableArea: a} = e;
- return t.createVNode(Vn, {
- class: sa(),
- onSubmit: v
- }, {
- default: ()=>{
- var d;
- return [t.createVNode("div", {
- class: sa("fields")
- }, [t.createVNode(On, {
- modelValue: l.name,
- "onUpdate:modelValue": e=>l.name = e,
- clearable: !0,
- label: ca("name"),
- rules: f.value.name,
- placeholder: ca("name"),
- onFocus: ()=>m("name")
- }, null), t.createVNode(On, {
- modelValue: l.tel,
- "onUpdate:modelValue": e=>l.tel = e,
- clearable: !0,
- type: "tel",
- label: ca("tel"),
- rules: f.value.tel,
- maxlength: e.telMaxlength,
- placeholder: ca("tel"),
- onFocus: ()=>m("tel")
- }, null), t.withDirectives(t.createVNode(On, {
- readonly: !0,
- label: ca("area"),
- "is-link": !a,
- modelValue: u.value,
- rules: f.value.areaCode,
- placeholder: e.areaPlaceholder || ca("area"),
- onFocus: ()=>m("areaCode"),
- onClick: ()=>{
- o("clickArea"),
- i.value = !a
- }
- }, null), [[t.vShow, e.showArea]]), t.createVNode(la, {
- show: e.showDetail,
- rows: e.detailRows,
- rules: f.value.addressDetail,
- value: l.addressDetail,
- focused: s.value,
- maxlength: e.detailMaxlength,
- searchResult: e.searchResult,
- showSearchResult: e.showSearchResult,
- onBlur: w,
- onFocus: ()=>m("addressDetail"),
- onInput: h,
- onSelectSearch: e=>o("selectSearch", e)
- }, null), null == (d = n.default) ? void 0 : d.call(n)]), V(), t.withDirectives(t.createVNode("div", {
- class: sa("buttons")
- }, [t.createVNode(kt, {
- block: !0,
- round: !0,
- type: "primary",
- text: e.saveButtonText || ca("save"),
- class: sa("button"),
- loading: e.isSaving,
- nativeType: "submit"
- }, null), e.showDelete && t.createVNode(kt, {
- block: !0,
- round: !0,
- class: sa("button"),
- loading: e.isDeleting,
- text: e.deleteButtonText || ca("delete"),
- onClick: y
- }, null)]), [[t.vShow, !p.value]]), t.createVNode(Gt, {
- show: i.value,
- "onUpdate:show": e=>i.value = e,
- round: !0,
- teleport: "body",
- position: "bottom",
- lazyRender: !1
- }, {
- default: ()=>[t.createVNode(pn, {
- modelValue: l.areaCode,
- "onUpdate:modelValue": e=>l.areaCode = e,
- ref: r,
- loading: !c.value,
- areaList: e.areaList,
- columnsPlaceholder: e.areaColumnsPlaceholder,
- onConfirm: b,
- onCancel: ()=>{
- i.value = !1
- }
- }, null)]
- })]
- }
- })
- }
- }
- }))
- , [ma,fa] = Oe("radio-group")
- , va = {
- disabled: Boolean,
- iconSize: g,
- direction: String,
- modelValue: h,
- checkedColor: String
- }
- , ha = Symbol(ma);
- const ga = je(t.defineComponent({
- name: ma,
- props: va,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {linkChildren: a} = I(ha);
- return t.watch((()=>e.modelValue), (e=>o("change", e))),
- a({
- props: e,
- updateValue: e=>o("update:modelValue", e)
- }),
- K((()=>e.modelValue)),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: fa([e.direction]),
- role: "radiogroup"
- }, [null == (o = n.default) ? void 0 : o.call(n)])
- }
- }
- }))
- , [ba,ya] = Oe("tag")
- , wa = {
- size: String,
- mark: Boolean,
- show: b,
- type: N("default"),
- color: String,
- plain: Boolean,
- round: Boolean,
- textColor: String,
- closeable: Boolean
- };
- const Va = je(t.defineComponent({
- name: ba,
- props: wa,
- emits: ["close"],
- setup(e, {slots: o, emit: n}) {
- const a = e=>{
- e.stopPropagation(),
- n("close", e)
- }
- , r = ()=>{
- var n;
- const {type: r, mark: l, plain: i, round: s, size: c, closeable: d} = e
- , u = {
- mark: l,
- plain: i,
- round: s
- };
- c && (u[c] = c);
- const p = d && t.createVNode(vt, {
- name: "cross",
- class: [ya("close"), Fe],
- onClick: a
- }, null);
- return t.createVNode("span", {
- style: e.plain ? {
- color: e.textColor || e.color,
- borderColor: e.color
- } : {
- color: e.textColor,
- background: e.color
- },
- class: ya([u, r])
- }, [null == (n = o.default) ? void 0 : n.call(o), p])
- }
- ;
- return ()=>t.createVNode(t.Transition, {
- name: e.closeable ? "van-fade" : void 0
- }, {
- default: ()=>[e.show ? r() : null]
- })
- }
- }))
- , xa = {
- name: h,
- shape: N("round"),
- disabled: Boolean,
- iconSize: g,
- modelValue: h,
- checkedColor: String,
- labelPosition: String,
- labelDisabled: Boolean
- };
- var Na = t.defineComponent({
- props: d({}, xa, {
- bem: y(Function),
- role: String,
- parent: Object,
- checked: Boolean,
- bindGroup: b
- }),
- emits: ["click", "toggle"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = t=>{
- if (e.parent && e.bindGroup)
- return e.parent.props[t]
- }
- , l = t.computed((()=>r("disabled") || e.disabled))
- , i = t.computed((()=>r("direction")))
- , s = t.computed((()=>{
- const t = e.checkedColor || r("checkedColor");
- if (t && e.checked && !l.value)
- return {
- borderColor: t,
- backgroundColor: t
- }
- }
- ))
- , c = t=>{
- const {target: n} = t
- , r = a.value
- , i = r === n || (null == r ? void 0 : r.contains(n));
- l.value || !i && e.labelDisabled || o("toggle"),
- o("click", t)
- }
- , d = ()=>{
- const {bem: o, shape: i, checked: c} = e
- , d = e.iconSize || r("iconSize");
- return t.createVNode("div", {
- ref: a,
- class: o("icon", [i, {
- disabled: l.value,
- checked: c
- }]),
- style: {
- fontSize: ce(d)
- }
- }, [n.icon ? n.icon({
- checked: c,
- disabled: l.value
- }) : t.createVNode(vt, {
- name: "success",
- style: s.value
- }, null)])
- }
- , u = ()=>{
- if (n.default)
- return t.createVNode("span", {
- class: e.bem("label", [e.labelPosition, {
- disabled: l.value
- }])
- }, [n.default()])
- }
- ;
- return ()=>{
- const o = "left" === e.labelPosition ? [u(), d()] : [d(), u()];
- return t.createVNode("div", {
- role: e.role,
- class: e.bem([{
- disabled: l.value,
- "label-disabled": e.labelDisabled
- }, i.value]),
- tabindex: l.value ? void 0 : 0,
- "aria-checked": e.checked,
- onClick: c
- }, [o])
- }
- }
- });
- const Ca = xa
- , [ka,Sa] = Oe("radio");
- const Ba = je(t.defineComponent({
- name: ka,
- props: xa,
- emits: ["update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {parent: a} = D(ha)
- , r = ()=>{
- a ? a.updateValue(e.name) : o("update:modelValue", e.name)
- }
- ;
- return ()=>t.createVNode(Na, t.mergeProps({
- bem: Sa,
- role: "radio",
- parent: a,
- checked: (a ? a.props.modelValue : e.modelValue) === e.name,
- onToggle: r
- }, e), m(n, ["default", "icon"]))
- }
- }))
- , [Ta,Pa] = Oe("address-item");
- var Da = t.defineComponent({
- name: Ta,
- props: {
- address: y(Object),
- disabled: Boolean,
- switchable: Boolean,
- defaultTagText: String
- },
- emits: ["edit", "click", "select"],
- setup(e, {slots: o, emit: n}) {
- const a = ()=>{
- e.switchable && n("select"),
- n("click")
- }
- , r = ()=>t.createVNode(vt, {
- name: "edit",
- class: Pa("edit"),
- onClick: e=>{
- e.stopPropagation(),
- n("edit"),
- n("click")
- }
- }, null)
- , l = ()=>{
- const {address: n, disabled: a, switchable: r} = e
- , l = [t.createVNode("div", {
- class: Pa("name")
- }, [`${n.name} ${n.tel}`, o.tag ? o.tag(e.address) : e.address.isDefault && e.defaultTagText ? t.createVNode(Va, {
- type: "primary",
- round: !0,
- class: Pa("tag")
- }, {
- default: ()=>[e.defaultTagText]
- }) : void 0]), t.createVNode("div", {
- class: Pa("address")
- }, [n.address])];
- return r && !a ? t.createVNode(Ba, {
- name: n.id,
- iconSize: 18
- }, {
- default: ()=>[l]
- }) : l
- }
- ;
- return ()=>{
- var n;
- const {disabled: i} = e;
- return t.createVNode("div", {
- class: Pa({
- disabled: i
- }),
- onClick: a
- }, [t.createVNode(gn, {
- border: !1,
- titleClass: Pa("title")
- }, {
- title: l,
- "right-icon": r
- }), null == (n = o.bottom) ? void 0 : n.call(o, d({}, e.address, {
- disabled: i
- }))])
- }
- }
- });
- const [Oa,Ia,Aa] = Oe("address-list")
- , za = {
- list: w(),
- modelValue: g,
- switchable: b,
- disabledText: String,
- disabledList: w(),
- addButtonText: String,
- defaultTagText: String
- };
- const Ea = je(t.defineComponent({
- name: Oa,
- props: za,
- emits: ["add", "edit", "select", "clickItem", "editDisabled", "selectDisabled", "update:modelValue"],
- setup(e, {slots: o, emit: n}) {
- const a = (a,r)=>{
- if (a)
- return a.map(((a,l)=>((a,r,l)=>t.createVNode(Da, {
- key: a.id,
- address: a,
- disabled: l,
- switchable: e.switchable,
- defaultTagText: e.defaultTagText,
- onEdit: ()=>n(l ? "editDisabled" : "edit", a, r),
- onClick: ()=>n("clickItem", a, r),
- onSelect: ()=>{
- n(l ? "selectDisabled" : "select", a, r),
- l || n("update:modelValue", a.id)
- }
- }, {
- bottom: o["item-bottom"],
- tag: o.tag
- }))(a, l, r)))
- }
- ;
- return ()=>{
- var r, l;
- const i = a(e.list)
- , s = a(e.disabledList, !0)
- , c = e.disabledText && t.createVNode("div", {
- class: Ia("disabled-text")
- }, [e.disabledText]);
- return t.createVNode("div", {
- class: Ia()
- }, [null == (r = o.top) ? void 0 : r.call(o), t.createVNode(ga, {
- modelValue: e.modelValue
- }, {
- default: ()=>[i]
- }), c, s, null == (l = o.default) ? void 0 : l.call(o), t.createVNode("div", {
- class: [Ia("bottom"), "van-safe-area-bottom"]
- }, [t.createVNode(kt, {
- round: !0,
- block: !0,
- type: "primary",
- text: e.addButtonText || Aa("add"),
- class: Ia("add"),
- onClick: ()=>n("add")
- }, null)])])
- }
- }
- }))
- , $a = C && "IntersectionObserver"in window && "IntersectionObserverEntry"in window && "intersectionRatio"in window.IntersectionObserverEntry.prototype
- , La = "event"
- , Ma = "observer";
- function Fa(e, t) {
- if (!e.length)
- return;
- const o = e.indexOf(t);
- return o > -1 ? e.splice(o, 1) : void 0
- }
- function Ra(e, t) {
- if ("IMG" !== e.tagName || !e.getAttribute("data-srcset"))
- return;
- let o = e.getAttribute("data-srcset");
- const n = e.parentNode.offsetWidth * t;
- let a, r, l;
- o = o.trim().split(",");
- const i = o.map((e=>(e = e.trim(),
- a = e.lastIndexOf(" "),
- -1 === a ? (r = e,
- l = 999998) : (r = e.substr(0, a),
- l = parseInt(e.substr(a + 1, e.length - a - 2), 10)),
- [l, r])));
- i.sort(((e,t)=>{
- if (e[0] < t[0])
- return 1;
- if (e[0] > t[0])
- return -1;
- if (e[0] === t[0]) {
- if (-1 !== t[1].indexOf(".webp", t[1].length - 5))
- return 1;
- if (-1 !== e[1].indexOf(".webp", e[1].length - 5))
- return -1
- }
- return 0
- }
- ));
- let s, c = "";
- for (let d = 0; d < i.length; d++) {
- s = i[d],
- c = s[1];
- const e = i[d + 1];
- if (e && e[0] < n) {
- c = s[1];
- break
- }
- if (!e) {
- c = s[1];
- break
- }
- }
- return c
- }
- const Ha = (e=1)=>C && window.devicePixelRatio || e;
- function ja() {
- if (!C)
- return !1;
- let e = !0;
- try {
- const t = document.createElement("canvas");
- t.getContext && t.getContext("2d") && (e = 0 === t.toDataURL("image/webp").indexOf("data:image/webp"))
- } catch (t) {
- e = !1
- }
- return e
- }
- function Wa(e, t) {
- let o = null
- , n = 0;
- return function(...a) {
- if (o)
- return;
- const r = ()=>{
- n = Date.now(),
- o = !1,
- e.apply(this, a)
- }
- ;
- Date.now() - n >= t ? r() : o = setTimeout(r, t)
- }
- }
- function Ua(e, t, o) {
- e.addEventListener(t, o, {
- capture: !1,
- passive: !0
- })
- }
- function qa(e, t, o) {
- e.removeEventListener(t, o, !1)
- }
- const Ya = (e,t,o)=>{
- const n = new Image;
- if (!e || !e.src)
- return o(new Error("image src is required"));
- n.src = e.src,
- e.cors && (n.crossOrigin = e.cors),
- n.onload = ()=>t({
- naturalHeight: n.naturalHeight,
- naturalWidth: n.naturalWidth,
- src: n.src
- }),
- n.onerror = e=>o(e)
- }
- ;
- class Ga {
- constructor({max: e}) {
- this.options = {
- max: e || 100
- },
- this.caches = []
- }
- has(e) {
- return this.caches.indexOf(e) > -1
- }
- add(e) {
- this.has(e) || (this.caches.push(e),
- this.caches.length > this.options.max && this.free())
- }
- free() {
- this.caches.shift()
- }
- }
- const [Xa,Za] = Oe("back-top")
- , Ka = {
- right: g,
- bottom: g,
- target: [String, Object],
- offset: x(200),
- teleport: {
- type: [String, Object],
- default: "body"
- }
- };
- const _a = je(t.defineComponent({
- name: Xa,
- inheritAttrs: !1,
- props: Ka,
- emits: ["click"],
- setup(e, {emit: o, slots: n, attrs: a}) {
- const r = t.ref(!1)
- , l = t.ref()
- , i = t.ref()
- , s = t.computed((()=>({
- right: ce(e.right),
- bottom: ce(e.bottom)
- })))
- , c = e=>{
- var t;
- o("click", e),
- null == (t = i.value) || t.scrollTo({
- top: 0,
- behavior: "smooth"
- })
- }
- , d = ()=>{
- r.value = !!i.value && _(i.value) >= e.offset
- }
- , p = ()=>{
- u && t.nextTick((()=>{
- i.value = e.target ? (()=>{
- const {target: t} = e;
- if ("string" != typeof t)
- return t;
- {
- const e = document.querySelector(t);
- if (e)
- return e
- }
- }
- )() : G(l.value),
- d()
- }
- ))
- }
- ;
- return H("scroll", Wa(d, 100), {
- target: i
- }),
- t.onMounted(p),
- t.watch((()=>e.target), p),
- ()=>{
- const o = t.createVNode("div", t.mergeProps({
- ref: l,
- class: Za({
- active: r.value
- }),
- style: s.value,
- onClick: c
- }, a), [n.default ? n.default() : t.createVNode(vt, {
- name: "back-top",
- class: Za("icon")
- }, null)]);
- return e.teleport ? t.createVNode(t.Teleport, {
- to: e.teleport
- }, {
- default: ()=>[o]
- }) : o
- }
- }
- }))
- , [Ja,Qa,er] = Oe("calendar");
- function tr(e, t) {
- const o = e.getFullYear()
- , n = t.getFullYear();
- if (o === n) {
- const o = e.getMonth()
- , n = t.getMonth();
- return o === n ? 0 : o > n ? 1 : -1
- }
- return o > n ? 1 : -1
- }
- function or(e, t) {
- const o = tr(e, t);
- if (0 === o) {
- const o = e.getDate()
- , n = t.getDate();
- return o === n ? 0 : o > n ? 1 : -1
- }
- return o
- }
- const nr = e=>new Date(e)
- , ar = e=>Array.isArray(e) ? e.map(nr) : nr(e);
- function rr(e, t) {
- const o = nr(e);
- return o.setDate(o.getDate() + t),
- o
- }
- const lr = e=>rr(e, -1)
- , ir = e=>rr(e, 1)
- , sr = ()=>{
- const e = new Date;
- return e.setHours(0, 0, 0, 0),
- e
- }
- ;
- const cr = d({}, Qo, {
- modelValue: w(),
- filter: Function,
- formatter: {
- type: Function,
- default: (e,t)=>t
- }
- })
- , dr = Object.keys(Qo);
- const ur = (e,t)=>32 - new Date(e,t - 1,32).getDate()
- , pr = (e,t,o,n,a)=>{
- const r = function(e, t) {
- if (e < 0)
- return [];
- const o = Array(e);
- let n = -1;
- for (; ++n < e; )
- o[n] = t(n);
- return o
- }(t - e + 1, (t=>{
- const a = ge(e + t);
- return n(o, {
- text: a,
- value: a
- })
- }
- ));
- return a ? a(o, r) : r
- }
- , mr = (e,t)=>e.map(((e,o)=>{
- const n = t[o];
- if (n.length) {
- const t = +n[n.length - 1].value;
- if (+e > t)
- return String(t)
- }
- return e
- }
- ))
- , [fr] = Oe("calendar-day");
- var vr = t.defineComponent({
- name: fr,
- props: {
- item: y(Object),
- color: String,
- index: Number,
- offset: V(0),
- rowHeight: String
- },
- emits: ["click"],
- setup(e, {emit: o, slots: n}) {
- const a = t.computed((()=>{
- var t;
- const {item: o, index: n, color: a, offset: r, rowHeight: l} = e
- , i = {
- height: l
- };
- if ("placeholder" === o.type)
- return i.width = "100%",
- i;
- if (0 === n && (i.marginLeft = 100 * r / 7 + "%"),
- a)
- switch (o.type) {
- case "end":
- case "start":
- case "start-end":
- case "multiple-middle":
- case "multiple-selected":
- i.background = a;
- break;
- case "middle":
- i.color = a
- }
- return r + ((null == (t = o.date) ? void 0 : t.getDate()) || 1) > 28 && (i.marginBottom = 0),
- i
- }
- ))
- , r = ()=>{
- "disabled" !== e.item.type && o("click", e.item)
- }
- , l = ()=>{
- const {topInfo: o} = e.item;
- if (o || n["top-info"])
- return t.createVNode("div", {
- class: Qa("top-info")
- }, [n["top-info"] ? n["top-info"](e.item) : o])
- }
- , i = ()=>{
- const {bottomInfo: o} = e.item;
- if (o || n["bottom-info"])
- return t.createVNode("div", {
- class: Qa("bottom-info")
- }, [n["bottom-info"] ? n["bottom-info"](e.item) : o])
- }
- , s = ()=>{
- const {item: o, color: n, rowHeight: a} = e
- , {type: r, text: s} = o
- , c = [l(), s, i()];
- return "selected" === r ? t.createVNode("div", {
- class: Qa("selected-day"),
- style: {
- width: a,
- height: a,
- background: n
- }
- }, [c]) : c
- }
- ;
- return ()=>{
- const {type: o, className: n} = e.item;
- return "placeholder" === o ? t.createVNode("div", {
- class: Qa("day"),
- style: a.value
- }, null) : t.createVNode("div", {
- role: "gridcell",
- style: a.value,
- class: [Qa("day", o), n],
- tabindex: "disabled" === o ? void 0 : -1,
- onClick: r
- }, [s()])
- }
- }
- });
- const [hr] = Oe("calendar-month")
- , gr = {
- date: y(Date),
- type: String,
- color: String,
- minDate: y(Date),
- maxDate: y(Date),
- showMark: Boolean,
- rowHeight: g,
- formatter: Function,
- lazyRender: Boolean,
- currentDate: [Date, Array],
- allowSameDay: Boolean,
- showSubtitle: Boolean,
- showMonthTitle: Boolean,
- firstDayOfWeek: Number
- };
- var br = t.defineComponent({
- name: hr,
- props: gr,
- emits: ["click"],
- setup(e, {emit: o, slots: n}) {
- const [a,r] = function(e=!1) {
- const o = t.ref(e);
- return [o, (e=!o.value)=>{
- o.value = e
- }
- ]
- }()
- , l = t.ref()
- , i = t.ref()
- , s = qe(i)
- , c = t.computed((()=>{
- return t = e.date,
- er("monthTitle", t.getFullYear(), t.getMonth() + 1);
- var t
- }
- ))
- , d = t.computed((()=>ce(e.rowHeight)))
- , u = t.computed((()=>{
- const t = e.date.getDay();
- return e.firstDayOfWeek ? (t + 7 - e.firstDayOfWeek) % 7 : t
- }
- ))
- , p = t.computed((()=>ur(e.date.getFullYear(), e.date.getMonth() + 1)))
- , f = t.computed((()=>a.value || !e.lazyRender))
- , v = t=>{
- const {type: o, minDate: n, maxDate: a, currentDate: r} = e;
- if (or(t, n) < 0 || or(t, a) > 0)
- return "disabled";
- if (null === r)
- return "";
- if (Array.isArray(r)) {
- if ("multiple" === o)
- return (t=>{
- const o = t=>e.currentDate.some((e=>0 === or(e, t)));
- if (o(t)) {
- const e = lr(t)
- , n = ir(t)
- , a = o(e)
- , r = o(n);
- return a && r ? "multiple-middle" : a ? "end" : r ? "start" : "multiple-selected"
- }
- return ""
- }
- )(t);
- if ("range" === o)
- return (t=>{
- const [o,n] = e.currentDate;
- if (!o)
- return "";
- const a = or(t, o);
- if (!n)
- return 0 === a ? "start" : "";
- const r = or(t, n);
- return e.allowSameDay && 0 === a && 0 === r ? "start-end" : 0 === a ? "start" : 0 === r ? "end" : a > 0 && r < 0 ? "middle" : ""
- }
- )(t)
- } else if ("single" === o)
- return 0 === or(t, r) ? "selected" : "";
- return ""
- }
- , h = t=>{
- if ("range" === e.type) {
- if ("start" === t || "end" === t)
- return er(t);
- if ("start-end" === t)
- return `${er("start")}/${er("end")}`
- }
- }
- , g = ()=>{
- if (e.showMonthTitle)
- return t.createVNode("div", {
- class: Qa("month-title")
- }, [c.value])
- }
- , b = ()=>{
- if (e.showMark && f.value)
- return t.createVNode("div", {
- class: Qa("month-mark")
- }, [e.date.getMonth() + 1])
- }
- , y = t.computed((()=>{
- const e = Math.ceil((p.value + u.value) / 7);
- return Array(e).fill({
- type: "placeholder"
- })
- }
- ))
- , w = t.computed((()=>{
- const t = []
- , o = e.date.getFullYear()
- , n = e.date.getMonth();
- for (let a = 1; a <= p.value; a++) {
- const r = new Date(o,n,a)
- , l = v(r);
- let i = {
- date: r,
- type: l,
- text: a,
- bottomInfo: h(l)
- };
- e.formatter && (i = e.formatter(i)),
- t.push(i)
- }
- return t
- }
- ))
- , V = t.computed((()=>w.value.filter((e=>"disabled" === e.type))))
- , x = (a,r)=>t.createVNode(vr, {
- item: a,
- index: r,
- color: e.color,
- offset: u.value,
- rowHeight: d.value,
- onClick: e=>o("click", e)
- }, m(n, ["top-info", "bottom-info"]));
- return Je({
- getTitle: ()=>c.value,
- getHeight: ()=>s.value,
- setVisible: r,
- scrollToDate: (e,t)=>{
- if (l.value) {
- const o = P(l.value)
- , n = y.value.length
- , a = (Math.ceil((t.getDate() + u.value) / 7) - 1) * o.height / n;
- J(e, o.top + a + e.scrollTop - P(e).top)
- }
- }
- ,
- disabledDays: V
- }),
- ()=>t.createVNode("div", {
- class: Qa("month"),
- ref: i
- }, [g(), t.createVNode("div", {
- ref: l,
- role: "grid",
- class: Qa("days")
- }, [b(), (f.value ? w : y).value.map(x)])])
- }
- });
- const [yr] = Oe("calendar-header");
- var wr = t.defineComponent({
- name: yr,
- props: {
- date: Date,
- title: String,
- subtitle: String,
- showTitle: Boolean,
- showSubtitle: Boolean,
- firstDayOfWeek: Number
- },
- emits: ["clickSubtitle"],
- setup(e, {slots: o, emit: n}) {
- const a = ()=>{
- if (e.showTitle) {
- const n = e.title || er("title")
- , a = o.title ? o.title() : n;
- return t.createVNode("div", {
- class: Qa("header-title")
- }, [a])
- }
- }
- , r = e=>n("clickSubtitle", e)
- , l = ()=>{
- if (e.showSubtitle) {
- const n = o.subtitle ? o.subtitle({
- date: e.date,
- text: e.subtitle
- }) : e.subtitle;
- return t.createVNode("div", {
- class: Qa("header-subtitle"),
- onClick: r
- }, [n])
- }
- }
- , i = ()=>{
- const {firstDayOfWeek: o} = e
- , n = er("weekdays")
- , a = [...n.slice(o, 7), ...n.slice(0, o)];
- return t.createVNode("div", {
- class: Qa("weekdays")
- }, [a.map((e=>t.createVNode("span", {
- class: Qa("weekday")
- }, [e])))])
- }
- ;
- return ()=>t.createVNode("div", {
- class: Qa("header")
- }, [a(), l(), i()])
- }
- });
- const Vr = {
- show: Boolean,
- type: N("single"),
- title: String,
- color: String,
- round: b,
- readonly: Boolean,
- poppable: b,
- maxRange: x(null),
- position: N("bottom"),
- teleport: [String, Object],
- showMark: b,
- showTitle: b,
- formatter: Function,
- rowHeight: g,
- confirmText: String,
- rangePrompt: String,
- lazyRender: b,
- showConfirm: b,
- defaultDate: [Date, Array],
- allowSameDay: Boolean,
- showSubtitle: b,
- closeOnPopstate: b,
- showRangePrompt: b,
- confirmDisabledText: String,
- closeOnClickOverlay: b,
- safeAreaInsetTop: Boolean,
- safeAreaInsetBottom: b,
- minDate: {
- type: Date,
- validator: l,
- default: sr
- },
- maxDate: {
- type: Date,
- validator: l,
- default: ()=>{
- const e = sr();
- return new Date(e.getFullYear(),e.getMonth() + 6,e.getDate())
- }
- },
- firstDayOfWeek: {
- type: g,
- default: 0,
- validator: e=>e >= 0 && e <= 6
- }
- };
- const xr = je(t.defineComponent({
- name: Ja,
- props: Vr,
- emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
- setup(e, {emit: o, slots: n}) {
- const a = (t,o=e.minDate,n=e.maxDate)=>-1 === or(t, o) ? o : 1 === or(t, n) ? n : t
- , r = (t=e.defaultDate)=>{
- const {type: o, minDate: n, maxDate: r, allowSameDay: l} = e;
- if (null === t)
- return t;
- const i = sr();
- if ("range" === o) {
- Array.isArray(t) || (t = []);
- return [a(t[0] || i, n, l ? r : lr(r)), a(t[1] || i, l ? n : ir(n))]
- }
- return "multiple" === o ? Array.isArray(t) ? t.map((e=>a(e))) : [a(i)] : (t && !Array.isArray(t) || (t = i),
- a(t))
- }
- ;
- let i;
- const s = t.ref()
- , c = t.ref({
- text: "",
- date: void 0
- })
- , d = t.ref(r())
- , [u,p] = bo()
- , f = t.computed((()=>e.firstDayOfWeek ? +e.firstDayOfWeek % 7 : 0))
- , v = t.computed((()=>{
- const t = []
- , o = new Date(e.minDate);
- o.setDate(1);
- do {
- t.push(new Date(o)),
- o.setMonth(o.getMonth() + 1)
- } while (1 !== tr(o, e.maxDate));
- return t
- }
- ))
- , h = t.computed((()=>{
- if (d.value) {
- if ("range" === e.type)
- return !d.value[0] || !d.value[1];
- if ("multiple" === e.type)
- return !d.value.length
- }
- return !d.value
- }
- ))
- , g = ()=>{
- const e = _(s.value)
- , t = e + i
- , n = v.value.map(((e,t)=>u.value[t].getHeight()));
- if (t > n.reduce(((e,t)=>e + t), 0) && e > 0)
- return;
- let a, r = 0;
- const l = [-1, -1];
- for (let i = 0; i < v.value.length; i++) {
- const s = u.value[i];
- r <= t && r + n[i] >= e && (l[1] = i,
- a || (a = s,
- l[0] = i),
- u.value[i].showed || (u.value[i].showed = !0,
- o("monthShow", {
- date: s.date,
- title: s.getTitle()
- }))),
- r += n[i]
- }
- v.value.forEach(((e,t)=>{
- const o = t >= l[0] - 1 && t <= l[1] + 1;
- u.value[t].setVisible(o)
- }
- )),
- a && (c.value = {
- text: a.getTitle(),
- date: a.date
- })
- }
- , b = e=>{
- k((()=>{
- v.value.some(((t,o)=>0 === tr(t, e) && (s.value && u.value[o].scrollToDate(s.value, e),
- !0))),
- g()
- }
- ))
- }
- , y = ()=>{
- if (!e.poppable || e.show)
- if (d.value) {
- const t = "single" === e.type ? d.value : d.value[0];
- l(t) && b(t)
- } else
- k(g)
- }
- , w = ()=>{
- e.poppable && !e.show || (k((()=>{
- i = Math.floor(P(s).height)
- }
- )),
- y())
- }
- , V = (e=r())=>{
- d.value = e,
- y()
- }
- , x = ()=>{
- var e;
- return o("confirm", null != (e = d.value) ? e : ar(d.value))
- }
- , N = (t,n)=>{
- const a = e=>{
- d.value = e,
- o("select", ar(e))
- }
- ;
- if (n && "range" === e.type) {
- const n = (t=>{
- const {maxRange: n, rangePrompt: a, showRangePrompt: r} = e;
- return !(n && function(e) {
- const t = e[0].getTime();
- return (e[1].getTime() - t) / 864e5 + 1
- }(t) > n && (r && Gn(a || er("rangePrompt", n)),
- o("overRange"),
- 1))
- }
- )(t);
- if (!n)
- return void a([t[0], rr(t[0], +e.maxRange - 1)])
- }
- a(t),
- n && !e.showConfirm && x()
- }
- , C = t.computed((()=>u.value.reduce(((e,t)=>{
- var o, n;
- return e.push(...null != (n = null == (o = t.disabledDays) ? void 0 : o.value) ? n : []),
- e
- }
- ), [])))
- , S = t=>{
- if (e.readonly || !t.date)
- return;
- const {date: n} = t
- , {type: a} = e;
- if ("range" === a) {
- if (!d.value)
- return void N([n]);
- const [t,o] = d.value;
- if (t && !o) {
- const o = or(n, t);
- if (1 === o) {
- const e = ((e,t,o)=>{
- var n;
- return null == (n = e.find((e=>-1 === or(t, e.date) && -1 === or(e.date, o)))) ? void 0 : n.date
- }
- )(C.value, t, n);
- if (e) {
- const o = lr(e);
- -1 === or(t, o) ? N([t, o]) : N([n])
- } else
- N([t, n], !0)
- } else
- -1 === o ? N([n]) : e.allowSameDay && N([n, n], !0)
- } else
- N([n])
- } else if ("multiple" === a) {
- if (!d.value)
- return void N([n]);
- const t = d.value
- , a = t.findIndex((e=>0 === or(e, n)));
- if (-1 !== a) {
- const [e] = t.splice(a, 1);
- o("unselect", nr(e))
- } else
- e.maxRange && t.length >= e.maxRange ? Gn(e.rangePrompt || er("rangePrompt", e.maxRange)) : N([...t, n])
- } else
- N(n, !0)
- }
- , B = e=>o("update:show", e)
- , T = (o,a)=>{
- const r = 0 !== a || !e.showSubtitle;
- return t.createVNode(br, t.mergeProps({
- ref: p(a),
- date: o,
- currentDate: d.value,
- showMonthTitle: r,
- firstDayOfWeek: f.value
- }, m(e, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
- onClick: S
- }), m(n, ["top-info", "bottom-info"]))
- }
- , D = ()=>{
- if (n.footer)
- return n.footer();
- if (e.showConfirm) {
- const o = n["confirm-text"]
- , a = h.value
- , r = a ? e.confirmDisabledText : e.confirmText;
- return t.createVNode(kt, {
- round: !0,
- block: !0,
- type: "primary",
- color: e.color,
- class: Qa("confirm"),
- disabled: a,
- nativeType: "button",
- onClick: x
- }, {
- default: ()=>[o ? o({
- disabled: a
- }) : r || er("confirm")]
- })
- }
- }
- , O = ()=>t.createVNode("div", {
- class: Qa()
- }, [t.createVNode(wr, {
- date: c.value.date,
- title: e.title,
- subtitle: c.value.text,
- showTitle: e.showTitle,
- showSubtitle: e.showSubtitle,
- firstDayOfWeek: f.value,
- onClickSubtitle: e=>o("clickSubtitle", e)
- }, m(n, ["title", "subtitle"])), t.createVNode("div", {
- ref: s,
- class: Qa("body"),
- onScroll: g
- }, [v.value.map(T)]), t.createVNode("div", {
- class: [Qa("footer"), {
- "van-safe-area-bottom": e.safeAreaInsetBottom
- }]
- }, [D()])]);
- return t.watch((()=>e.show), w),
- t.watch((()=>[e.type, e.minDate, e.maxDate]), (()=>V(r(d.value)))),
- t.watch((()=>e.defaultDate), ((e=null)=>{
- d.value = e,
- y()
- }
- )),
- Je({
- reset: V,
- scrollToDate: b,
- getSelectedDate: ()=>d.value
- }),
- R(w),
- ()=>e.poppable ? t.createVNode(Gt, {
- show: e.show,
- class: Qa("popup"),
- round: e.round,
- position: e.position,
- closeable: e.showTitle || e.showSubtitle,
- teleport: e.teleport,
- closeOnPopstate: e.closeOnPopstate,
- safeAreaInsetTop: e.safeAreaInsetTop,
- closeOnClickOverlay: e.closeOnClickOverlay,
- "onUpdate:show": B
- }, {
- default: O
- }) : O()
- }
- }))
- , [Nr,Cr] = Oe("image")
- , kr = {
- src: String,
- alt: String,
- fit: String,
- position: String,
- round: Boolean,
- block: Boolean,
- width: g,
- height: g,
- radius: g,
- lazyLoad: Boolean,
- iconSize: g,
- showError: b,
- errorIcon: N("photo-fail"),
- iconPrefix: String,
- showLoading: b,
- loadingIcon: N("photo")
- };
- const Sr = je(t.defineComponent({
- name: Nr,
- props: kr,
- emits: ["load", "error"],
- setup(e, {emit: n, slots: a}) {
- const r = t.ref(!1)
- , l = t.ref(!0)
- , i = t.ref()
- , {$Lazyload: s} = t.getCurrentInstance().proxy
- , c = t.computed((()=>{
- const t = {
- width: ce(e.width),
- height: ce(e.height)
- };
- return o(e.radius) && (t.overflow = "hidden",
- t.borderRadius = ce(e.radius)),
- t
- }
- ));
- t.watch((()=>e.src), (()=>{
- r.value = !1,
- l.value = !0
- }
- ));
- const d = e=>{
- l.value && (l.value = !1,
- n("load", e))
- }
- , p = e=>{
- r.value = !0,
- l.value = !1,
- n("error", e)
- }
- , m = (o,n,a)=>a ? a() : t.createVNode(vt, {
- name: o,
- size: e.iconSize,
- class: n,
- classPrefix: e.iconPrefix
- }, null)
- , f = ()=>{
- if (r.value || !e.src)
- return;
- const o = {
- alt: e.alt,
- class: Cr("img"),
- style: {
- objectFit: e.fit,
- objectPosition: e.position
- }
- };
- return e.lazyLoad ? t.withDirectives(t.createVNode("img", t.mergeProps({
- ref: i
- }, o), null), [[t.resolveDirective("lazy"), e.src]]) : t.createVNode("img", t.mergeProps({
- ref: i,
- src: e.src,
- onLoad: d,
- onError: p
- }, o), null)
- }
- , v = ({el: e})=>{
- const o = ()=>{
- e === i.value && l.value && d()
- }
- ;
- i.value ? o() : t.nextTick(o)
- }
- , h = ({el: e})=>{
- e !== i.value || r.value || p()
- }
- ;
- return s && u && (s.$on("loaded", v),
- s.$on("error", h),
- t.onBeforeUnmount((()=>{
- s.$off("loaded", v),
- s.$off("error", h)
- }
- ))),
- t.onMounted((()=>{
- t.nextTick((()=>{
- var e;
- (null == (e = i.value) ? void 0 : e.complete) && d()
- }
- ))
- }
- )),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: Cr({
- round: e.round,
- block: e.block
- }),
- style: c.value
- }, [f(), l.value && e.showLoading ? t.createVNode("div", {
- class: Cr("loading")
- }, [m(e.loadingIcon, Cr("loading-icon"), a.loading)]) : r.value && e.showError ? t.createVNode("div", {
- class: Cr("error")
- }, [m(e.errorIcon, Cr("error-icon"), a.error)]) : void 0, null == (o = a.default) ? void 0 : o.call(a)])
- }
- }
- }))
- , [Br,Tr] = Oe("card")
- , Pr = {
- tag: String,
- num: g,
- desc: String,
- thumb: String,
- title: String,
- price: g,
- centered: Boolean,
- lazyLoad: Boolean,
- currency: N("¥"),
- thumbLink: String,
- originPrice: g
- };
- const Dr = je(t.defineComponent({
- name: Br,
- props: Pr,
- emits: ["clickThumb"],
- setup(e, {slots: n, emit: a}) {
- const r = ()=>{
- if (n.tag || e.tag)
- return t.createVNode("div", {
- class: Tr("tag")
- }, [n.tag ? n.tag() : t.createVNode(Va, {
- mark: !0,
- type: "primary"
- }, {
- default: ()=>[e.tag]
- })])
- }
- , l = ()=>{
- if (n.thumb || e.thumb)
- return t.createVNode("a", {
- href: e.thumbLink,
- class: Tr("thumb"),
- onClick: e=>a("clickThumb", e)
- }, [n.thumb ? n.thumb() : t.createVNode(Sr, {
- src: e.thumb,
- fit: "cover",
- width: "100%",
- height: "100%",
- lazyLoad: e.lazyLoad
- }, null), r()])
- }
- , i = ()=>{
- const o = e.price.toString().split(".");
- return t.createVNode("div", null, [t.createVNode("span", {
- class: Tr("price-currency")
- }, [e.currency]), t.createVNode("span", {
- class: Tr("price-integer")
- }, [o[0]]), t.createTextVNode("."), t.createVNode("span", {
- class: Tr("price-decimal")
- }, [o[1]])])
- }
- ;
- return ()=>{
- var a, r, s;
- const c = n.num || o(e.num)
- , d = n.price || o(e.price)
- , u = n["origin-price"] || o(e.originPrice)
- , p = c || d || u || n.bottom
- , m = d && t.createVNode("div", {
- class: Tr("price")
- }, [n.price ? n.price() : i()])
- , f = u && t.createVNode("div", {
- class: Tr("origin-price")
- }, [n["origin-price"] ? n["origin-price"]() : `${e.currency} ${e.originPrice}`])
- , v = c && t.createVNode("div", {
- class: Tr("num")
- }, [n.num ? n.num() : `x${e.num}`])
- , h = n.footer && t.createVNode("div", {
- class: Tr("footer")
- }, [n.footer()])
- , g = p && t.createVNode("div", {
- class: Tr("bottom")
- }, [null == (a = n["price-top"]) ? void 0 : a.call(n), m, f, v, null == (r = n.bottom) ? void 0 : r.call(n)]);
- return t.createVNode("div", {
- class: Tr()
- }, [t.createVNode("div", {
- class: Tr("header")
- }, [l(), t.createVNode("div", {
- class: Tr("content", {
- centered: e.centered
- })
- }, [t.createVNode("div", null, [n.title ? n.title() : e.title ? t.createVNode("div", {
- class: [Tr("title"), "van-multi-ellipsis--l2"]
- }, [e.title]) : void 0, n.desc ? n.desc() : e.desc ? t.createVNode("div", {
- class: [Tr("desc"), "van-ellipsis"]
- }, [e.desc]) : void 0, null == (s = n.tags) ? void 0 : s.call(n)]), g])]), h])
- }
- }
- }))
- , [Or,Ir,Ar] = Oe("cascader")
- , zr = {
- title: String,
- options: w(),
- closeable: b,
- swipeable: b,
- closeIcon: N("cross"),
- showHeader: b,
- modelValue: g,
- fieldNames: Object,
- placeholder: String,
- activeColor: String
- };
- const Er = je(t.defineComponent({
- name: Or,
- props: zr,
- emits: ["close", "change", "finish", "clickTab", "update:modelValue"],
- setup(e, {slots: o, emit: n}) {
- const a = t.ref([])
- , r = t.ref(0)
- , {text: l, value: i, children: s} = d({
- text: "text",
- value: "value",
- children: "children"
- }, e.fieldNames)
- , c = (e,t)=>{
- for (const o of e) {
- if (o[i] === t)
- return [o];
- if (o[s]) {
- const e = c(o[s], t);
- if (e)
- return [o, ...e]
- }
- }
- }
- , u = ()=>{
- const {options: o, modelValue: n} = e;
- if (void 0 !== n) {
- const e = c(o, n);
- if (e) {
- let n = o;
- return a.value = e.map((e=>{
- const t = {
- options: n,
- selected: e
- }
- , o = n.find((t=>t[i] === e[i]));
- return o && (n = o[s]),
- t
- }
- )),
- n && a.value.push({
- options: n,
- selected: null
- }),
- void t.nextTick((()=>{
- r.value = a.value.length - 1
- }
- ))
- }
- }
- a.value = [{
- options: o,
- selected: null
- }]
- }
- , p = ()=>n("close")
- , m = ({name: e, title: t})=>n("clickTab", e, t)
- , f = (c,d,u)=>{
- const {disabled: p} = c
- , m = !(!d || c[i] !== d[i])
- , f = c.color || (m ? e.activeColor : void 0)
- , v = o.option ? o.option({
- option: c,
- selected: m
- }) : t.createVNode("span", null, [c[l]]);
- return t.createVNode("li", {
- role: "menuitemradio",
- class: [Ir("option", {
- selected: m,
- disabled: p
- }), c.className],
- style: {
- color: f
- },
- tabindex: p ? void 0 : m ? 0 : -1,
- "aria-checked": m,
- "aria-disabled": p || void 0,
- onClick: ()=>((e,o)=>{
- if (e.disabled)
- return;
- if (a.value[o].selected = e,
- a.value.length > o + 1 && (a.value = a.value.slice(0, o + 1)),
- e[s]) {
- const n = {
- options: e[s],
- selected: null
- };
- a.value[o + 1] ? a.value[o + 1] = n : a.value.push(n),
- t.nextTick((()=>{
- r.value++
- }
- ))
- }
- const l = a.value.map((e=>e.selected)).filter(Boolean);
- n("update:modelValue", e[i]);
- const c = {
- value: e[i],
- tabIndex: o,
- selectedOptions: l
- };
- n("change", c),
- e[s] || n("finish", c)
- }
- )(c, u)
- }, [v, m ? t.createVNode(vt, {
- name: "success",
- class: Ir("selected-icon")
- }, null) : null])
- }
- , v = (e,o,n)=>t.createVNode("ul", {
- role: "menu",
- class: Ir("options")
- }, [e.map((e=>f(e, o, n)))])
- , h = (n,a)=>{
- const {options: r, selected: i} = n
- , s = e.placeholder || Ar("select")
- , c = i ? i[l] : s;
- return t.createVNode(Yo, {
- title: c,
- titleClass: Ir("tab", {
- unselected: !i
- })
- }, {
- default: ()=>{
- var e, t;
- return [null == (e = o["options-top"]) ? void 0 : e.call(o, {
- tabIndex: a
- }), v(r, i, a), null == (t = o["options-bottom"]) ? void 0 : t.call(o, {
- tabIndex: a
- })]
- }
- })
- }
- ;
- return u(),
- t.watch((()=>e.options), u, {
- deep: !0
- }),
- t.watch((()=>e.modelValue), (e=>{
- if (void 0 !== e) {
- if (a.value.map((e=>{
- var t;
- return null == (t = e.selected) ? void 0 : t[i]
- }
- )).includes(e))
- return
- }
- u()
- }
- )),
- ()=>t.createVNode("div", {
- class: Ir()
- }, [e.showHeader ? t.createVNode("div", {
- class: Ir("header")
- }, [t.createVNode("h2", {
- class: Ir("title")
- }, [o.title ? o.title() : e.title]), e.closeable ? t.createVNode(vt, {
- name: e.closeIcon,
- class: [Ir("close-icon"), Fe],
- onClick: p
- }, null) : null]) : null, t.createVNode(Go, {
- active: r.value,
- "onUpdate:active": e=>r.value = e,
- shrink: !0,
- animated: !0,
- class: Ir("tabs"),
- color: e.activeColor,
- swipeable: e.swipeable,
- onClickTab: m
- }, {
- default: ()=>[a.value.map(h)]
- })])
- }
- }))
- , [$r,Lr] = Oe("cell-group")
- , Mr = {
- title: String,
- inset: Boolean,
- border: b
- };
- const Fr = je(t.defineComponent({
- name: $r,
- inheritAttrs: !1,
- props: Mr,
- setup(e, {slots: o, attrs: n}) {
- const a = ()=>{
- var a;
- return t.createVNode("div", t.mergeProps({
- class: [Lr({
- inset: e.inset
- }), {
- [Le]: e.border && !e.inset
- }]
- }, n), [null == (a = o.default) ? void 0 : a.call(o)])
- }
- ;
- return ()=>e.title || o.title ? t.createVNode(t.Fragment, null, [t.createVNode("div", {
- class: Lr("title", {
- inset: e.inset
- })
- }, [o.title ? o.title() : e.title]), a()]) : a()
- }
- }))
- , [Rr,Hr] = Oe("checkbox-group")
- , jr = {
- max: g,
- disabled: Boolean,
- iconSize: g,
- direction: String,
- modelValue: w(),
- checkedColor: String
- }
- , Wr = Symbol(Rr);
- var Ur = t.defineComponent({
- name: Rr,
- props: jr,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {children: a, linkChildren: r} = I(Wr)
- , l = e=>o("update:modelValue", e);
- return t.watch((()=>e.modelValue), (e=>o("change", e))),
- Je({
- toggleAll: (e={})=>{
- "boolean" == typeof e && (e = {
- checked: e
- });
- const {checked: t, skipDisabled: o} = e
- , n = a.filter((e=>!!e.props.bindGroup && (e.props.disabled && o ? e.checked.value : null != t ? t : !e.checked.value))).map((e=>e.name));
- l(n)
- }
- }),
- K((()=>e.modelValue)),
- r({
- props: e,
- updateValue: l
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: Hr([e.direction])
- }, [null == (o = n.default) ? void 0 : o.call(n)])
- }
- }
- });
- const [qr,Yr] = Oe("checkbox")
- , Gr = d({}, xa, {
- bindGroup: b
- });
- const Xr = je(t.defineComponent({
- name: qr,
- props: Gr,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {parent: a} = D(Wr)
- , r = t.computed((()=>a && e.bindGroup ? -1 !== a.props.modelValue.indexOf(e.name) : !!e.modelValue))
- , l = (t=!r.value)=>{
- a && e.bindGroup ? (t=>{
- const {name: o} = e
- , {max: n, modelValue: r} = a.props
- , l = r.slice();
- if (t)
- n && l.length >= n || l.includes(o) || (l.push(o),
- e.bindGroup && a.updateValue(l));
- else {
- const t = l.indexOf(o);
- -1 !== t && (l.splice(t, 1),
- e.bindGroup && a.updateValue(l))
- }
- }
- )(t) : o("update:modelValue", t)
- }
- ;
- return t.watch((()=>e.modelValue), (e=>o("change", e))),
- Je({
- toggle: l,
- props: e,
- checked: r
- }),
- K((()=>e.modelValue)),
- ()=>t.createVNode(Na, t.mergeProps({
- bem: Yr,
- role: "checkbox",
- parent: a,
- checked: r.value,
- onToggle: l
- }, e), m(n, ["default", "icon"]))
- }
- }))
- , Zr = je(Ur)
- , [Kr,_r] = Oe("circle");
- let Jr = 0;
- const Qr = e=>Math.min(Math.max(+e, 0), 100);
- const el = {
- text: String,
- size: g,
- fill: N("none"),
- rate: x(100),
- speed: x(0),
- color: [String, Object],
- clockwise: b,
- layerColor: String,
- currentRate: V(0),
- strokeWidth: x(40),
- strokeLinecap: String,
- startPosition: N("top")
- };
- const tl = je(t.defineComponent({
- name: Kr,
- props: el,
- emits: ["update:currentRate"],
- setup(e, {emit: o, slots: n}) {
- const r = "van-circle-" + Jr++
- , l = t.computed((()=>+e.strokeWidth + 1e3))
- , i = t.computed((()=>function(e, t) {
- const o = e ? 1 : 0;
- return `M ${t / 2} ${t / 2} m 0, -500 a 500, 500 0 1, ${o} 0, 1000 a 500, 500 0 1, ${o} 0, -1000`
- }(e.clockwise, l.value)))
- , s = t.computed((()=>{
- const t = {
- top: 0,
- right: 90,
- bottom: 180,
- left: 270
- }[e.startPosition];
- if (t)
- return {
- transform: `rotate(${t}deg)`
- }
- }
- ));
- t.watch((()=>e.rate), (t=>{
- let n;
- const a = Date.now()
- , r = e.currentRate
- , l = Qr(t)
- , i = Math.abs(1e3 * (r - l) / +e.speed)
- , s = ()=>{
- const e = Date.now()
- , t = Math.min((e - a) / i, 1) * (l - r) + r;
- o("update:currentRate", Qr(parseFloat(t.toFixed(1)))),
- (l > r ? t < l : t > l) && (n = k(s))
- }
- ;
- e.speed ? (n && S(n),
- n = k(s)) : o("update:currentRate", l)
- }
- ), {
- immediate: !0
- });
- const c = ()=>{
- const {strokeWidth: o, currentRate: n, strokeLinecap: l} = e
- , s = 3140 * n / 100
- , c = a(e.color) ? `url(#${r})` : e.color
- , d = {
- stroke: c,
- strokeWidth: +o + 1 + "px",
- strokeLinecap: l,
- strokeDasharray: `${s}px 3140px`
- };
- return t.createVNode("path", {
- d: i.value,
- style: d,
- class: _r("hover"),
- stroke: c
- }, null)
- }
- , d = ()=>{
- const o = {
- fill: e.fill,
- stroke: e.layerColor,
- strokeWidth: `${e.strokeWidth}px`
- };
- return t.createVNode("path", {
- class: _r("layer"),
- style: o,
- d: i.value
- }, null)
- }
- , u = ()=>{
- const {color: o} = e;
- if (!a(o))
- return;
- const n = Object.keys(o).sort(((e,t)=>parseFloat(e) - parseFloat(t))).map(((e,n)=>t.createVNode("stop", {
- key: n,
- offset: e,
- "stop-color": o[e]
- }, null)));
- return t.createVNode("defs", null, [t.createVNode("linearGradient", {
- id: r,
- x1: "100%",
- y1: "0%",
- x2: "0%",
- y2: "0%"
- }, [n])])
- }
- ;
- return ()=>t.createVNode("div", {
- class: _r(),
- style: de(e.size)
- }, [t.createVNode("svg", {
- viewBox: `0 0 ${l.value} ${l.value}`,
- style: s.value
- }, [u(), d(), c()]), n.default ? n.default() : e.text ? t.createVNode("div", {
- class: _r("text")
- }, [e.text]) : void 0])
- }
- }))
- , [ol,nl] = Oe("row")
- , al = Symbol(ol)
- , rl = {
- tag: N("div"),
- wrap: b,
- align: String,
- gutter: x(0),
- justify: String
- };
- var ll = t.defineComponent({
- name: ol,
- props: rl,
- setup(e, {slots: o}) {
- const {children: n, linkChildren: a} = I(al)
- , r = t.computed((()=>{
- const e = [[]];
- let t = 0;
- return n.forEach(((o,n)=>{
- t += Number(o.span),
- t > 24 ? (e.push([n]),
- t -= 24) : e[e.length - 1].push(n)
- }
- )),
- e
- }
- ));
- return a({
- spaces: t.computed((()=>{
- const t = Number(e.gutter)
- , o = [];
- return t ? (r.value.forEach((e=>{
- const n = t * (e.length - 1) / e.length;
- e.forEach(((e,a)=>{
- if (0 === a)
- o.push({
- right: n
- });
- else {
- const a = t - o[e - 1].right
- , r = n - a;
- o.push({
- left: a,
- right: r
- })
- }
- }
- ))
- }
- )),
- o) : o
- }
- ))
- }),
- ()=>{
- const {tag: n, wrap: a, align: r, justify: l} = e;
- return t.createVNode(n, {
- class: nl({
- [`align-${r}`]: r,
- [`justify-${l}`]: l,
- nowrap: !a
- })
- }, {
- default: ()=>{
- var e;
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- })
- }
- }
- });
- const [il,sl] = Oe("col")
- , cl = {
- tag: N("div"),
- span: x(0),
- offset: g
- };
- const dl = je(t.defineComponent({
- name: il,
- props: cl,
- setup(e, {slots: o}) {
- const {parent: n, index: a} = D(al)
- , r = t.computed((()=>{
- if (!n)
- return;
- const {spaces: e} = n;
- if (e && e.value && e.value[a.value]) {
- const {left: t, right: o} = e.value[a.value];
- return {
- paddingLeft: t ? `${t}px` : null,
- paddingRight: o ? `${o}px` : null
- }
- }
- }
- ));
- return ()=>{
- const {tag: n, span: a, offset: l} = e;
- return t.createVNode(n, {
- style: r.value,
- class: sl({
- [a]: a,
- [`offset-${l}`]: l
- })
- }, {
- default: ()=>{
- var e;
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- })
- }
- }
- }))
- , [ul,pl] = Oe("collapse")
- , ml = Symbol(ul)
- , fl = {
- border: b,
- accordion: Boolean,
- modelValue: {
- type: [String, Number, Array],
- default: ""
- }
- };
- const vl = je(t.defineComponent({
- name: ul,
- props: fl,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {linkChildren: a, children: r} = I(ml)
- , l = e=>{
- o("change", e),
- o("update:modelValue", e)
- }
- ;
- return Je({
- toggleAll: (t={})=>{
- if (e.accordion)
- return;
- "boolean" == typeof t && (t = {
- expanded: t
- });
- const {expanded: o, skipDisabled: n} = t
- , a = r.filter((e=>e.disabled && n ? e.expanded.value : null != o ? o : !e.expanded.value)).map((e=>e.itemName.value));
- l(a)
- }
- }),
- a({
- toggle: (t,o)=>{
- const {accordion: n, modelValue: a} = e;
- l(n ? t === a ? "" : t : o ? a.concat(t) : a.filter((e=>e !== t)))
- }
- ,
- isExpanded: t=>{
- const {accordion: o, modelValue: n} = e;
- return o ? n === t : n.includes(t)
- }
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: [pl(), {
- [Le]: e.border
- }]
- }, [null == (o = n.default) ? void 0 : o.call(n)])
- }
- }
- }))
- , [hl,gl] = Oe("collapse-item")
- , bl = ["icon", "title", "value", "label", "right-icon"]
- , yl = d({}, vn, {
- name: g,
- isLink: b,
- disabled: Boolean,
- readonly: Boolean,
- lazyRender: b
- });
- const wl = je(t.defineComponent({
- name: hl,
- props: yl,
- setup(e, {slots: o}) {
- const n = t.ref()
- , a = t.ref()
- , {parent: r, index: l} = D(ml);
- if (!r)
- return;
- const i = t.computed((()=>{
- var t;
- return null != (t = e.name) ? t : l.value
- }
- ))
- , s = t.computed((()=>r.isExpanded(i.value)))
- , c = t.ref(s.value)
- , d = Ft((()=>c.value || !e.lazyRender))
- , u = ()=>{
- s.value ? n.value && (n.value.style.height = "") : c.value = !1
- }
- ;
- t.watch(s, ((e,o)=>{
- if (null === o)
- return;
- e && (c.value = !0);
- (e ? t.nextTick : k)((()=>{
- if (!a.value || !n.value)
- return;
- const {offsetHeight: t} = a.value;
- if (t) {
- const o = `${t}px`;
- n.value.style.height = e ? "0" : o,
- B((()=>{
- n.value && (n.value.style.height = e ? o : "0")
- }
- ))
- } else
- u()
- }
- ))
- }
- ));
- const p = (e=!s.value)=>{
- r.toggle(i.value, e)
- }
- , f = ()=>{
- e.disabled || e.readonly || p()
- }
- , v = ()=>{
- const {border: n, disabled: a, readonly: r} = e
- , l = m(e, Object.keys(vn));
- return r && (l.isLink = !1),
- (a || r) && (l.clickable = !1),
- t.createVNode(gn, t.mergeProps({
- role: "button",
- class: gl("title", {
- disabled: a,
- expanded: s.value,
- borderless: !n
- }),
- "aria-expanded": String(s.value),
- onClick: f
- }, l), m(o, bl))
- }
- , h = d((()=>{
- var e;
- return t.withDirectives(t.createVNode("div", {
- ref: n,
- class: gl("wrapper"),
- onTransitionend: u
- }, [t.createVNode("div", {
- ref: a,
- class: gl("content")
- }, [null == (e = o.default) ? void 0 : e.call(o)])]), [[t.vShow, c.value]])
- }
- ));
- return Je({
- toggle: p,
- expanded: s,
- itemName: i
- }),
- ()=>t.createVNode("div", {
- class: [gl({
- border: l.value && e.border
- })]
- }, [v(), h()])
- }
- }))
- , Vl = je(ut)
- , [xl,Nl,Cl] = Oe("contact-card")
- , kl = {
- tel: String,
- name: String,
- type: N("add"),
- addText: String,
- editable: b
- };
- const Sl = je(t.defineComponent({
- name: xl,
- props: kl,
- emits: ["click"],
- setup(e, {emit: o}) {
- const n = t=>{
- e.editable && o("click", t)
- }
- , a = ()=>"add" === e.type ? e.addText || Cl("addContact") : [t.createVNode("div", null, [`${Cl("name")}:${e.name}`]), t.createVNode("div", null, [`${Cl("tel")}:${e.tel}`])];
- return ()=>t.createVNode(gn, {
- center: !0,
- icon: "edit" === e.type ? "contact" : "add-square",
- class: Nl([e.type]),
- border: !1,
- isLink: e.editable,
- titleClass: Nl("title"),
- onClick: n
- }, {
- title: a
- })
- }
- }))
- , [Bl,Tl,Pl] = Oe("contact-edit")
- , Dl = {
- tel: "",
- name: ""
- }
- , Ol = {
- isEdit: Boolean,
- isSaving: Boolean,
- isDeleting: Boolean,
- showSetDefault: Boolean,
- setDefaultLabel: String,
- contactInfo: {
- type: Object,
- default: ()=>d({}, Dl)
- },
- telValidator: {
- type: Function,
- default: i
- }
- };
- const Il = je(t.defineComponent({
- name: Bl,
- props: Ol,
- emits: ["save", "delete", "changeDefault"],
- setup(e, {emit: o}) {
- const n = t.reactive(d({}, Dl, e.contactInfo))
- , a = ()=>{
- e.isSaving || o("save", n)
- }
- , r = ()=>o("delete", n)
- , l = ()=>t.createVNode(oa, {
- modelValue: n.isDefault,
- "onUpdate:modelValue": e=>n.isDefault = e,
- onChange: e=>o("changeDefault", e)
- }, null)
- , i = ()=>{
- if (e.showSetDefault)
- return t.createVNode(gn, {
- title: e.setDefaultLabel,
- class: Tl("switch-cell"),
- border: !1
- }, {
- "right-icon": l
- })
- }
- ;
- return t.watch((()=>e.contactInfo), (e=>d(n, Dl, e))),
- ()=>t.createVNode(Vn, {
- class: Tl(),
- onSubmit: a
- }, {
- default: ()=>[t.createVNode("div", {
- class: Tl("fields")
- }, [t.createVNode(On, {
- modelValue: n.name,
- "onUpdate:modelValue": e=>n.name = e,
- clearable: !0,
- label: Pl("name"),
- rules: [{
- required: !0,
- message: Pl("nameEmpty")
- }],
- maxlength: "30",
- placeholder: Pl("name")
- }, null), t.createVNode(On, {
- modelValue: n.tel,
- "onUpdate:modelValue": e=>n.tel = e,
- clearable: !0,
- type: "tel",
- label: Pl("tel"),
- rules: [{
- validator: e.telValidator,
- message: Pl("telInvalid")
- }],
- placeholder: Pl("tel")
- }, null)]), i(), t.createVNode("div", {
- class: Tl("buttons")
- }, [t.createVNode(kt, {
- block: !0,
- round: !0,
- type: "primary",
- text: Pl("save"),
- class: Tl("button"),
- loading: e.isSaving,
- nativeType: "submit"
- }, null), e.isEdit && t.createVNode(kt, {
- block: !0,
- round: !0,
- text: Pl("delete"),
- class: Tl("button"),
- loading: e.isDeleting,
- onClick: r
- }, null)])]
- })
- }
- }))
- , [Al,zl,El] = Oe("contact-list")
- , $l = {
- list: Array,
- addText: String,
- modelValue: h,
- defaultTagText: String
- };
- const Ll = je(t.defineComponent({
- name: Al,
- props: $l,
- emits: ["add", "edit", "select", "update:modelValue"],
- setup(e, {emit: o}) {
- const n = (n,a)=>t.createVNode(gn, {
- key: n.id,
- isLink: !0,
- center: !0,
- class: zl("item"),
- titleClass: zl("item-title"),
- onClick: ()=>{
- o("update:modelValue", n.id),
- o("select", n, a)
- }
- }, {
- icon: ()=>t.createVNode(vt, {
- name: "edit",
- class: zl("edit"),
- onClick: e=>{
- e.stopPropagation(),
- o("edit", n, a)
- }
- }, null),
- title: ()=>{
- const o = [`${n.name},${n.tel}`];
- return n.isDefault && e.defaultTagText && o.push(t.createVNode(Va, {
- type: "primary",
- round: !0,
- class: zl("item-tag")
- }, {
- default: ()=>[e.defaultTagText]
- })),
- o
- }
- ,
- "right-icon": ()=>t.createVNode(Ba, {
- class: zl("radio"),
- name: n.id,
- iconSize: 16
- }, null)
- });
- return ()=>t.createVNode("div", {
- class: zl()
- }, [t.createVNode(ga, {
- modelValue: e.modelValue,
- class: zl("group")
- }, {
- default: ()=>[e.list && e.list.map(n)]
- }), t.createVNode("div", {
- class: [zl("bottom"), "van-safe-area-bottom"]
- }, [t.createVNode(kt, {
- round: !0,
- block: !0,
- type: "primary",
- class: zl("add"),
- text: e.addText || El("addContact"),
- onClick: ()=>o("add")
- }, null)])])
- }
- }));
- const [Ml,Fl] = Oe("count-down")
- , Rl = {
- time: x(0),
- format: N("HH:mm:ss"),
- autoStart: b,
- millisecond: Boolean
- };
- const Hl = je(t.defineComponent({
- name: Ml,
- props: Rl,
- emits: ["change", "finish"],
- setup(e, {emit: o, slots: n}) {
- const {start: a, pause: r, reset: l, current: i} = F({
- time: +e.time,
- millisecond: e.millisecond,
- onChange: e=>o("change", e),
- onFinish: ()=>o("finish")
- })
- , s = t.computed((()=>function(e, t) {
- const {days: o} = t;
- let {hours: n, minutes: a, seconds: r, milliseconds: l} = t;
- if (e.includes("DD") ? e = e.replace("DD", ge(o)) : n += 24 * o,
- e.includes("HH") ? e = e.replace("HH", ge(n)) : a += 60 * n,
- e.includes("mm") ? e = e.replace("mm", ge(a)) : r += 60 * a,
- e.includes("ss") ? e = e.replace("ss", ge(r)) : l += 1e3 * r,
- e.includes("S")) {
- const t = ge(l, 3);
- e = e.includes("SSS") ? e.replace("SSS", t) : e.includes("SS") ? e.replace("SS", t.slice(0, 2)) : e.replace("S", t.charAt(0))
- }
- return e
- }(e.format, i.value)))
- , c = ()=>{
- l(+e.time),
- e.autoStart && a()
- }
- ;
- return t.watch((()=>e.time), c, {
- immediate: !0
- }),
- Je({
- start: a,
- pause: r,
- reset: c
- }),
- ()=>t.createVNode("div", {
- role: "timer",
- class: Fl()
- }, [n.default ? n.default(i.value) : s.value])
- }
- }));
- function jl(e) {
- const t = new Date(1e3 * e);
- return `${t.getFullYear()}.${ge(t.getMonth() + 1)}.${ge(t.getDate())}`
- }
- const Wl = e=>(e / 100).toFixed(e % 100 == 0 ? 0 : e % 10 == 0 ? 1 : 2)
- , [Ul,ql,Yl] = Oe("coupon");
- const Gl = je(t.defineComponent({
- name: Ul,
- props: {
- chosen: Boolean,
- coupon: y(Object),
- disabled: Boolean,
- currency: N("¥")
- },
- setup(e) {
- const o = t.computed((()=>{
- const {startAt: t, endAt: o} = e.coupon;
- return `${jl(t)} - ${jl(o)}`
- }
- ))
- , n = t.computed((()=>{
- const {coupon: o, currency: n} = e;
- if (o.valueDesc)
- return [o.valueDesc, t.createVNode("span", null, [o.unitDesc || ""])];
- if (o.denominations) {
- const e = Wl(o.denominations);
- return [t.createVNode("span", null, [n]), ` ${e}`]
- }
- return o.discount ? Yl("discount", ((a = o.discount) / 10).toFixed(a % 10 == 0 ? 0 : 1)) : "";
- var a
- }
- ))
- , a = t.computed((()=>{
- const t = Wl(e.coupon.originCondition || 0);
- return "0" === t ? Yl("unlimited") : Yl("condition", t)
- }
- ));
- return ()=>{
- const {chosen: r, coupon: l, disabled: i} = e
- , s = i && l.reason || l.description;
- return t.createVNode("div", {
- class: ql({
- disabled: i
- })
- }, [t.createVNode("div", {
- class: ql("content")
- }, [t.createVNode("div", {
- class: ql("head")
- }, [t.createVNode("h2", {
- class: ql("amount")
- }, [n.value]), t.createVNode("p", {
- class: ql("condition")
- }, [l.condition || a.value])]), t.createVNode("div", {
- class: ql("body")
- }, [t.createVNode("p", {
- class: ql("name")
- }, [l.name]), t.createVNode("p", {
- class: ql("valid")
- }, [o.value]), !i && t.createVNode(Xr, {
- class: ql("corner"),
- modelValue: r
- }, null)])]), s && t.createVNode("p", {
- class: ql("description")
- }, [s])])
- }
- }
- }))
- , [Xl,Zl,Kl] = Oe("coupon-cell")
- , _l = {
- title: String,
- border: b,
- editable: b,
- coupons: w(),
- currency: N("¥"),
- chosenCoupon: x(-1)
- };
- function Jl({coupons: e, chosenCoupon: t, currency: n}) {
- const a = e[+t];
- if (a) {
- let e = 0;
- return o(a.value) ? ({value: e} = a) : o(a.denominations) && (e = a.denominations),
- `-${n} ${(e / 100).toFixed(2)}`
- }
- return 0 === e.length ? Kl("noCoupon") : Kl("count", e.length)
- }
- const Ql = je(t.defineComponent({
- name: Xl,
- props: _l,
- setup: e=>()=>{
- const o = e.coupons[+e.chosenCoupon];
- return t.createVNode(gn, {
- class: Zl(),
- value: Jl(e),
- title: e.title || Kl("title"),
- border: e.border,
- isLink: e.editable,
- valueClass: Zl("value", {
- selected: o
- })
- }, null)
- }
- }))
- , [ei,ti] = Oe("empty")
- , oi = {
- image: N("default"),
- imageSize: [Number, String, Array],
- description: String
- };
- const ni = je(t.defineComponent({
- name: ei,
- props: oi,
- setup(e, {slots: o}) {
- const n = ()=>{
- const n = o.description ? o.description() : e.description;
- if (n)
- return t.createVNode("p", {
- class: ti("description")
- }, [n])
- }
- , a = ()=>{
- if (o.default)
- return t.createVNode("div", {
- class: ti("bottom")
- }, [o.default()])
- }
- , r = go()
- , l = e=>`${r}-${e}`
- , i = e=>`url(#${l(e)})`
- , s = (e,o,n)=>t.createVNode("stop", {
- "stop-color": e,
- offset: `${o}%`,
- "stop-opacity": n
- }, null)
- , c = (e,t)=>[s(e, 0), s(t, 100)]
- , d = e=>[t.createVNode("defs", null, [t.createVNode("radialGradient", {
- id: l(e),
- cx: "50%",
- cy: "54%",
- fx: "50%",
- fy: "54%",
- r: "297%",
- gradientTransform: "matrix(-.16 0 0 -.33 .58 .72)"
- }, [s("#EBEDF0", 0), s("#F2F3F5", 100, .3)])]), t.createVNode("ellipse", {
- fill: i(e),
- opacity: ".8",
- cx: "80",
- cy: "140",
- rx: "46",
- ry: "8"
- }, null)]
- , u = ()=>[t.createVNode("defs", null, [t.createVNode("linearGradient", {
- id: l("a"),
- x1: "64%",
- y1: "100%",
- x2: "64%"
- }, [s("#FFF", 0, .5), s("#F2F3F5", 100)])]), t.createVNode("g", {
- opacity: ".8"
- }, [t.createVNode("path", {
- d: "M36 131V53H16v20H2v58h34z",
- fill: i("a")
- }, null), t.createVNode("path", {
- d: "M123 15h22v14h9v77h-31V15z",
- fill: i("a")
- }, null)])]
- , p = ()=>[t.createVNode("defs", null, [t.createVNode("linearGradient", {
- id: l("b"),
- x1: "64%",
- y1: "97%",
- x2: "64%",
- y2: "0%"
- }, [s("#F2F3F5", 0, .3), s("#F2F3F5", 100)])]), t.createVNode("g", {
- opacity: ".8"
- }, [t.createVNode("path", {
- d: "M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",
- fill: i("b")
- }, null), t.createVNode("path", {
- d: "M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",
- fill: i("b")
- }, null)])]
- , m = ()=>t.createVNode("svg", {
- viewBox: "0 0 160 160"
- }, [t.createVNode("defs", null, [t.createVNode("linearGradient", {
- id: l(1),
- x1: "64%",
- y1: "100%",
- x2: "64%"
- }, [s("#FFF", 0, .5), s("#F2F3F5", 100)]), t.createVNode("linearGradient", {
- id: l(2),
- x1: "50%",
- x2: "50%",
- y2: "84%"
- }, [s("#EBEDF0", 0), s("#DCDEE0", 100, 0)]), t.createVNode("linearGradient", {
- id: l(3),
- x1: "100%",
- x2: "100%",
- y2: "100%"
- }, [c("#EAEDF0", "#DCDEE0")]), t.createVNode("radialGradient", {
- id: l(4),
- cx: "50%",
- cy: "0%",
- fx: "50%",
- fy: "0%",
- r: "100%",
- gradientTransform: "matrix(0 1 -.54 0 .5 -.5)"
- }, [s("#EBEDF0", 0), s("#FFF", 100, 0)])]), t.createVNode("g", {
- fill: "none"
- }, [u(), t.createVNode("path", {
- fill: i(4),
- d: "M0 139h160v21H0z"
- }, null), t.createVNode("path", {
- d: "M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",
- fill: i(2)
- }, null), t.createVNode("g", {
- opacity: ".6",
- "stroke-linecap": "round",
- "stroke-width": "7"
- }, [t.createVNode("path", {
- d: "M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",
- stroke: i(3)
- }, null), t.createVNode("path", {
- d: "M53 36a34 34 0 0 0 0 48",
- stroke: i(3)
- }, null), t.createVNode("path", {
- d: "M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",
- stroke: i(3)
- }, null), t.createVNode("path", {
- d: "M106 84a34 34 0 0 0 0-48",
- stroke: i(3)
- }, null)]), t.createVNode("g", {
- transform: "translate(31 105)"
- }, [t.createVNode("rect", {
- fill: "#EBEDF0",
- width: "98",
- height: "34",
- rx: "2"
- }, null), t.createVNode("rect", {
- fill: "#FFF",
- x: "9",
- y: "8",
- width: "80",
- height: "18",
- rx: "1.1"
- }, null), t.createVNode("rect", {
- fill: "#EBEDF0",
- x: "15",
- y: "12",
- width: "18",
- height: "6",
- rx: "1.1"
- }, null)])])])
- , f = ()=>t.createVNode("svg", {
- viewBox: "0 0 160 160"
- }, [t.createVNode("defs", null, [t.createVNode("linearGradient", {
- x1: "50%",
- x2: "50%",
- y2: "100%",
- id: l(5)
- }, [c("#F2F3F5", "#DCDEE0")]), t.createVNode("linearGradient", {
- x1: "95%",
- y1: "48%",
- x2: "5.5%",
- y2: "51%",
- id: l(6)
- }, [c("#EAEDF1", "#DCDEE0")]), t.createVNode("linearGradient", {
- y1: "45%",
- x2: "100%",
- y2: "54%",
- id: l(7)
- }, [c("#EAEDF1", "#DCDEE0")])]), u(), p(), t.createVNode("g", {
- transform: "translate(36 50)",
- fill: "none"
- }, [t.createVNode("g", {
- transform: "translate(8)"
- }, [t.createVNode("rect", {
- fill: "#EBEDF0",
- opacity: ".6",
- x: "38",
- y: "13",
- width: "36",
- height: "53",
- rx: "2"
- }, null), t.createVNode("rect", {
- fill: i(5),
- width: "64",
- height: "66",
- rx: "2"
- }, null), t.createVNode("rect", {
- fill: "#FFF",
- x: "6",
- y: "6",
- width: "52",
- height: "55",
- rx: "1"
- }, null), t.createVNode("g", {
- transform: "translate(15 17)",
- fill: i(6)
- }, [t.createVNode("rect", {
- width: "34",
- height: "6",
- rx: "1"
- }, null), t.createVNode("path", {
- d: "M0 14h34v6H0z"
- }, null), t.createVNode("rect", {
- y: "28",
- width: "34",
- height: "6",
- rx: "1"
- }, null)])]), t.createVNode("rect", {
- fill: i(7),
- y: "61",
- width: "88",
- height: "28",
- rx: "1"
- }, null), t.createVNode("rect", {
- fill: "#F7F8FA",
- x: "29",
- y: "72",
- width: "30",
- height: "6",
- rx: "1"
- }, null)])])
- , v = ()=>t.createVNode("svg", {
- viewBox: "0 0 160 160"
- }, [t.createVNode("defs", null, [t.createVNode("linearGradient", {
- x1: "50%",
- x2: "50%",
- y2: "100%",
- id: l(8)
- }, [c("#EAEDF1", "#DCDEE0")])]), u(), p(), d("c"), t.createVNode("path", {
- d: "m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",
- fill: i(8)
- }, null)])
- , h = ()=>t.createVNode("svg", {
- viewBox: "0 0 160 160"
- }, [t.createVNode("defs", null, [t.createVNode("linearGradient", {
- x1: "50%",
- y1: "100%",
- x2: "50%",
- id: l(9)
- }, [c("#EEE", "#D8D8D8")]), t.createVNode("linearGradient", {
- x1: "100%",
- y1: "50%",
- y2: "50%",
- id: l(10)
- }, [c("#F2F3F5", "#DCDEE0")]), t.createVNode("linearGradient", {
- x1: "50%",
- x2: "50%",
- y2: "100%",
- id: l(11)
- }, [c("#F2F3F5", "#DCDEE0")]), t.createVNode("linearGradient", {
- x1: "50%",
- x2: "50%",
- y2: "100%",
- id: l(12)
- }, [c("#FFF", "#F7F8FA")])]), u(), p(), d("d"), t.createVNode("g", {
- transform: "rotate(-45 113 -4)",
- fill: "none"
- }, [t.createVNode("rect", {
- fill: i(9),
- x: "24",
- y: "52.8",
- width: "5.8",
- height: "19",
- rx: "1"
- }, null), t.createVNode("rect", {
- fill: i(10),
- x: "22.1",
- y: "67.3",
- width: "9.9",
- height: "28",
- rx: "1"
- }, null), t.createVNode("circle", {
- stroke: i(11),
- "stroke-width": "8",
- cx: "27",
- cy: "27",
- r: "27"
- }, null), t.createVNode("circle", {
- fill: i(12),
- cx: "27",
- cy: "27",
- r: "16"
- }, null), t.createVNode("path", {
- d: "M37 7c-8 0-15 5-16 12",
- stroke: i(11),
- "stroke-width": "3",
- opacity: ".5",
- "stroke-linecap": "round",
- transform: "rotate(45 29 13)"
- }, null)])])
- , g = ()=>{
- var n;
- if (o.image)
- return o.image();
- const a = {
- error: v,
- search: h,
- network: m,
- default: f
- };
- return (null == (n = a[e.image]) ? void 0 : n.call(a)) || t.createVNode("img", {
- src: e.image
- }, null)
- }
- ;
- return ()=>t.createVNode("div", {
- class: ti()
- }, [t.createVNode("div", {
- class: ti("image"),
- style: de(e.imageSize)
- }, [g()]), n(), a()])
- }
- }))
- , [ai,ri,li] = Oe("coupon-list")
- , ii = {
- code: N(""),
- coupons: w(),
- currency: N("¥"),
- showCount: b,
- emptyImage: String,
- chosenCoupon: V(-1),
- enabledTitle: String,
- disabledTitle: String,
- disabledCoupons: w(),
- showExchangeBar: b,
- showCloseButton: b,
- closeButtonText: String,
- inputPlaceholder: String,
- exchangeMinLength: V(1),
- exchangeButtonText: String,
- displayedCouponIndex: V(-1),
- exchangeButtonLoading: Boolean,
- exchangeButtonDisabled: Boolean
- };
- const si = je(t.defineComponent({
- name: ai,
- props: ii,
- emits: ["change", "exchange", "update:code"],
- setup(e, {emit: o, slots: n}) {
- const [a,r] = bo()
- , l = t.ref()
- , i = t.ref()
- , s = t.ref(0)
- , c = t.ref(0)
- , d = t.ref(e.code)
- , u = t.computed((()=>!e.exchangeButtonLoading && (e.exchangeButtonDisabled || !d.value || d.value.length < e.exchangeMinLength)))
- , p = ()=>{
- const e = P(l).height
- , t = P(i).height + 44;
- c.value = (e > t ? e : se.value) - t
- }
- , m = ()=>{
- o("exchange", d.value),
- e.code || (d.value = "")
- }
- , f = e=>{
- t.nextTick((()=>{
- var t;
- return null == (t = a.value[e]) ? void 0 : t.scrollIntoView()
- }
- ))
- }
- , v = ()=>t.createVNode(ni, {
- image: e.emptyImage
- }, {
- default: ()=>[t.createVNode("p", {
- class: ri("empty-tip")
- }, [li("noCoupon")])]
- })
- , h = ()=>{
- if (e.showExchangeBar)
- return t.createVNode("div", {
- ref: i,
- class: ri("exchange-bar")
- }, [t.createVNode(On, {
- modelValue: d.value,
- "onUpdate:modelValue": e=>d.value = e,
- clearable: !0,
- border: !1,
- class: ri("field"),
- placeholder: e.inputPlaceholder || li("placeholder"),
- maxlength: "20"
- }, null), t.createVNode(kt, {
- plain: !0,
- type: "primary",
- class: ri("exchange"),
- text: e.exchangeButtonText || li("exchange"),
- loading: e.exchangeButtonLoading,
- disabled: u.value,
- onClick: m
- }, null)])
- }
- , g = ()=>{
- const {coupons: a} = e
- , l = e.showCount ? ` (${a.length})` : ""
- , i = (e.enabledTitle || li("enable")) + l;
- return t.createVNode(Yo, {
- title: i
- }, {
- default: ()=>{
- var l;
- return [t.createVNode("div", {
- class: ri("list", {
- "with-bottom": e.showCloseButton
- }),
- style: {
- height: `${c.value}px`
- }
- }, [a.map(((n,a)=>t.createVNode(Gl, {
- key: n.id,
- ref: r(a),
- coupon: n,
- chosen: a === e.chosenCoupon,
- currency: e.currency,
- onClick: ()=>o("change", a)
- }, null))), !a.length && v(), null == (l = n["list-footer"]) ? void 0 : l.call(n)])]
- }
- })
- }
- , b = ()=>{
- const {disabledCoupons: o} = e
- , a = e.showCount ? ` (${o.length})` : ""
- , r = (e.disabledTitle || li("disabled")) + a;
- return t.createVNode(Yo, {
- title: r
- }, {
- default: ()=>{
- var a;
- return [t.createVNode("div", {
- class: ri("list", {
- "with-bottom": e.showCloseButton
- }),
- style: {
- height: `${c.value}px`
- }
- }, [o.map((o=>t.createVNode(Gl, {
- disabled: !0,
- key: o.id,
- coupon: o,
- currency: e.currency
- }, null))), !o.length && v(), null == (a = n["disabled-list-footer"]) ? void 0 : a.call(n)])]
- }
- })
- }
- ;
- return t.watch((()=>e.code), (e=>{
- d.value = e
- }
- )),
- t.watch(se, p),
- t.watch(d, (e=>o("update:code", e))),
- t.watch((()=>e.displayedCouponIndex), f),
- t.onMounted((()=>{
- p(),
- f(e.displayedCouponIndex)
- }
- )),
- ()=>t.createVNode("div", {
- ref: l,
- class: ri()
- }, [h(), t.createVNode(Go, {
- active: s.value,
- "onUpdate:active": e=>s.value = e,
- class: ri("tab")
- }, {
- default: ()=>[g(), b()]
- }), t.createVNode("div", {
- class: ri("bottom")
- }, [t.withDirectives(t.createVNode(kt, {
- round: !0,
- block: !0,
- type: "primary",
- class: ri("close"),
- text: e.closeButtonText || li("close"),
- onClick: ()=>o("change", -1)
- }, null), [[t.vShow, e.showCloseButton]])])])
- }
- }))
- , ci = (new Date).getFullYear()
- , [di] = Oe("date-picker")
- , ui = d({}, cr, {
- columnsType: {
- type: Array,
- default: ()=>["year", "month", "day"]
- },
- minDate: {
- type: Date,
- default: ()=>new Date(ci - 10,0,1),
- validator: l
- },
- maxDate: {
- type: Date,
- default: ()=>new Date(ci + 10,11,31),
- validator: l
- }
- });
- const pi = je(t.defineComponent({
- name: di,
- props: ui,
- emits: ["confirm", "cancel", "change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref(e.modelValue)
- , r = t=>t === e.minDate.getFullYear()
- , l = t=>t === e.maxDate.getFullYear()
- , i = t=>{
- const {minDate: o, columnsType: n} = e
- , r = n.indexOf(t)
- , l = a.value[r];
- if (l)
- return +l;
- switch (t) {
- case "year":
- return o.getFullYear();
- case "month":
- return o.getMonth() + 1;
- case "day":
- return o.getDate()
- }
- }
- , s = ()=>{
- const t = i("year")
- , o = i("month")
- , n = r(t) && (t=>t === e.minDate.getMonth() + 1)(o) ? e.minDate.getDate() : 1
- , a = l(t) && (t=>t === e.maxDate.getMonth() + 1)(o) ? e.maxDate.getDate() : ur(t, o);
- return pr(n, a, "day", e.formatter, e.filter)
- }
- , c = t.computed((()=>e.columnsType.map((t=>{
- switch (t) {
- case "year":
- return (()=>{
- const t = e.minDate.getFullYear()
- , o = e.maxDate.getFullYear();
- return pr(t, o, "year", e.formatter, e.filter)
- }
- )();
- case "month":
- return (()=>{
- const t = i("year")
- , o = r(t) ? e.minDate.getMonth() + 1 : 1
- , n = l(t) ? e.maxDate.getMonth() + 1 : 12;
- return pr(o, n, "month", e.formatter, e.filter)
- }
- )();
- case "day":
- return s();
- default:
- return []
- }
- }
- ))));
- t.watch(a, (t=>{
- f(t, e.modelValue) || o("update:modelValue", t)
- }
- )),
- t.watch((()=>e.modelValue), (e=>{
- e = mr(e, c.value),
- f(e, a.value) || (a.value = e)
- }
- ), {
- immediate: !0
- });
- const d = (...e)=>o("change", ...e)
- , u = (...e)=>o("cancel", ...e)
- , p = (...e)=>o("confirm", ...e);
- return ()=>t.createVNode(sn, t.mergeProps({
- modelValue: a.value,
- "onUpdate:modelValue": e=>a.value = e,
- columns: c.value,
- onChange: d,
- onCancel: u,
- onConfirm: p
- }, m(e, dr)), n)
- }
- }))
- , [mi,fi,vi] = Oe("dialog")
- , hi = d({}, zt, {
- title: String,
- theme: String,
- width: g,
- message: [String, Function],
- callback: Function,
- allowHtml: Boolean,
- className: h,
- transition: N("van-dialog-bounce"),
- messageAlign: String,
- closeOnPopstate: b,
- showCancelButton: Boolean,
- cancelButtonText: String,
- cancelButtonColor: String,
- cancelButtonDisabled: Boolean,
- confirmButtonText: String,
- confirmButtonColor: String,
- confirmButtonDisabled: Boolean,
- showConfirmButton: b,
- closeOnClickOverlay: Boolean
- })
- , gi = [...Et, "transition", "closeOnPopstate"];
- var bi = t.defineComponent({
- name: mi,
- props: hi,
- emits: ["confirm", "cancel", "keydown", "update:show"],
- setup(e, {emit: o, slots: a}) {
- const r = t.ref()
- , l = t.reactive({
- confirm: !1,
- cancel: !1
- })
- , i = e=>o("update:show", e)
- , s = t=>{
- var o;
- i(!1),
- null == (o = e.callback) || o.call(e, t)
- }
- , d = t=>()=>{
- e.show && (o(t),
- e.beforeClose ? (l[t] = !0,
- He(e.beforeClose, {
- args: [t],
- done() {
- s(t),
- l[t] = !1
- },
- canceled() {
- l[t] = !1
- }
- })) : s(t))
- }
- , u = d("cancel")
- , p = d("confirm")
- , f = t.withKeys((t=>{
- var n, a;
- if (t.target !== (null == (a = null == (n = r.value) ? void 0 : n.popupRef) ? void 0 : a.value))
- return;
- ({
- Enter: e.showConfirmButton ? p : c,
- Escape: e.showCancelButton ? u : c
- })[t.key](),
- o("keydown", t)
- }
- ), ["enter", "esc"])
- , v = ()=>{
- const o = a.title ? a.title() : e.title;
- if (o)
- return t.createVNode("div", {
- class: fi("header", {
- isolated: !e.message && !a.default
- })
- }, [o])
- }
- , h = o=>{
- const {message: a, allowHtml: r, messageAlign: l} = e
- , i = fi("message", {
- "has-title": o,
- [l]: l
- })
- , s = n(a) ? a() : a;
- return r && "string" == typeof s ? t.createVNode("div", {
- class: i,
- innerHTML: s
- }, null) : t.createVNode("div", {
- class: i
- }, [s])
- }
- , g = ()=>{
- if (a.default)
- return t.createVNode("div", {
- class: fi("content")
- }, [a.default()]);
- const {title: o, message: n, allowHtml: r} = e;
- if (n) {
- const e = !(!o && !a.title);
- return t.createVNode("div", {
- key: r ? 1 : 0,
- class: fi("content", {
- isolated: !e
- })
- }, [h(e)])
- }
- }
- , b = ()=>a.footer ? a.footer() : "round-button" === e.theme ? t.createVNode(_e, {
- class: fi("footer")
- }, {
- default: ()=>[e.showCancelButton && t.createVNode(Pt, {
- type: "warning",
- text: e.cancelButtonText || vi("cancel"),
- class: fi("cancel"),
- color: e.cancelButtonColor,
- loading: l.cancel,
- disabled: e.cancelButtonDisabled,
- onClick: u
- }, null), e.showConfirmButton && t.createVNode(Pt, {
- type: "danger",
- text: e.confirmButtonText || vi("confirm"),
- class: fi("confirm"),
- color: e.confirmButtonColor,
- loading: l.confirm,
- disabled: e.confirmButtonDisabled,
- onClick: p
- }, null)]
- }) : t.createVNode("div", {
- class: [Ae, fi("footer")]
- }, [e.showCancelButton && t.createVNode(kt, {
- size: "large",
- text: e.cancelButtonText || vi("cancel"),
- class: fi("cancel"),
- style: {
- color: e.cancelButtonColor
- },
- loading: l.cancel,
- disabled: e.cancelButtonDisabled,
- onClick: u
- }, null), e.showConfirmButton && t.createVNode(kt, {
- size: "large",
- text: e.confirmButtonText || vi("confirm"),
- class: [fi("confirm"), {
- [ze]: e.showCancelButton
- }],
- style: {
- color: e.confirmButtonColor
- },
- loading: l.confirm,
- disabled: e.confirmButtonDisabled,
- onClick: p
- }, null)]);
- return ()=>{
- const {width: o, title: n, theme: a, message: l, className: s} = e;
- return t.createVNode(Gt, t.mergeProps({
- ref: r,
- role: "dialog",
- class: [fi([a]), s],
- style: {
- width: ce(o)
- },
- tabindex: 0,
- "aria-labelledby": n || l,
- onKeydown: f,
- "onUpdate:show": i
- }, m(e, gi)), {
- default: ()=>[v(), g(), b()]
- })
- }
- }
- });
- let yi;
- const wi = {
- title: "",
- width: "",
- theme: null,
- message: "",
- overlay: !0,
- callback: null,
- teleport: "body",
- className: "",
- allowHtml: !1,
- lockScroll: !0,
- transition: void 0,
- beforeClose: null,
- overlayClass: "",
- overlayStyle: void 0,
- messageAlign: "",
- cancelButtonText: "",
- cancelButtonColor: null,
- cancelButtonDisabled: !1,
- confirmButtonText: "",
- confirmButtonColor: null,
- confirmButtonDisabled: !1,
- showConfirmButton: !0,
- showCancelButton: !1,
- closeOnPopstate: !0,
- closeOnClickOverlay: !1
- };
- let Vi = d({}, wi);
- function xi(e) {
- return u ? new Promise(((o,n)=>{
- yi || function() {
- const e = {
- setup() {
- const {state: e, toggle: o} = Mn();
- return ()=>t.createVNode(bi, t.mergeProps(e, {
- "onUpdate:show": o
- }), null)
- }
- };
- ({instance: yi} = Fn(e))
- }(),
- yi.open(d({}, Vi, e, {
- callback: e=>{
- ("confirm" === e ? o : n)(e)
- }
- }))
- }
- )) : Promise.resolve()
- }
- const Ni = je(bi)
- , [Ci,ki] = Oe("divider")
- , Si = {
- dashed: Boolean,
- hairline: b,
- contentPosition: N("center")
- };
- const Bi = je(t.defineComponent({
- name: Ci,
- props: Si,
- setup: (e,{slots: o})=>()=>{
- var n;
- return t.createVNode("div", {
- role: "separator",
- class: ki({
- dashed: e.dashed,
- hairline: e.hairline,
- [`content-${e.contentPosition}`]: !!o.default
- })
- }, [null == (n = o.default) ? void 0 : n.call(o)])
- }
- }))
- , [Ti,Pi] = Oe("dropdown-menu")
- , Di = {
- overlay: b,
- zIndex: g,
- duration: x(.2),
- direction: N("down"),
- activeColor: String,
- closeOnClickOutside: b,
- closeOnClickOverlay: b
- }
- , Oi = Symbol(Ti);
- var Ii = t.defineComponent({
- name: Ti,
- props: Di,
- setup(e, {slots: n}) {
- const a = go()
- , r = t.ref()
- , l = t.ref()
- , i = t.ref(0)
- , {children: s, linkChildren: c} = I(Oi)
- , d = X(r)
- , u = t.computed((()=>s.some((e=>e.state.showWrapper))))
- , p = t.computed((()=>{
- if (u.value && o(e.zIndex))
- return {
- zIndex: +e.zIndex + 1
- }
- }
- ))
- , m = ()=>{
- if (l.value) {
- const t = P(l);
- "down" === e.direction ? i.value = t.bottom : i.value = se.value - t.top
- }
- }
- , f = (o,n)=>{
- const {showPopup: r} = o.state
- , {disabled: l, titleClass: i} = o;
- return t.createVNode("div", {
- id: `${a}-${n}`,
- role: "button",
- tabindex: l ? void 0 : 0,
- class: [Pi("item", {
- disabled: l
- }), {
- [Fe]: !l
- }],
- onClick: ()=>{
- var e;
- l || (e = n,
- s.forEach(((t,o)=>{
- o === e ? (m(),
- t.toggle()) : t.state.showPopup && t.toggle(!1, {
- immediate: !0
- })
- }
- )))
- }
- }, [t.createVNode("span", {
- class: [Pi("title", {
- down: r === ("down" === e.direction),
- active: r
- }), i],
- style: {
- color: r ? e.activeColor : ""
- }
- }, [t.createVNode("div", {
- class: "van-ellipsis"
- }, [o.renderTitle()])])])
- }
- ;
- return c({
- id: a,
- props: e,
- offset: i
- }),
- j(r, (()=>{
- e.closeOnClickOutside && s.forEach((e=>{
- e.toggle(!1)
- }
- ))
- }
- )),
- H("scroll", (()=>{
- u.value && m()
- }
- ), {
- target: d,
- passive: !0
- }),
- ()=>{
- var e;
- return t.createVNode("div", {
- ref: r,
- class: Pi()
- }, [t.createVNode("div", {
- ref: l,
- style: p.value,
- class: Pi("bar", {
- opened: u.value
- })
- }, [s.map(f)]), null == (e = n.default) ? void 0 : e.call(n)])
- }
- }
- });
- const [Ai,zi] = Oe("dropdown-item")
- , Ei = {
- title: String,
- options: w(),
- disabled: Boolean,
- teleport: [String, Object],
- lazyRender: b,
- modelValue: h,
- titleClass: h
- };
- const $i = je(t.defineComponent({
- name: Ai,
- inheritAttrs: !1,
- props: Ei,
- emits: ["open", "opened", "close", "closed", "change", "update:modelValue"],
- setup(e, {emit: o, slots: n, attrs: a}) {
- const r = t.reactive({
- showPopup: !1,
- transition: !0,
- showWrapper: !1
- })
- , {parent: l, index: i} = D(Oi);
- if (!l)
- return;
- const s = e=>()=>o(e)
- , c = s("open")
- , d = s("close")
- , u = s("opened")
- , p = ()=>{
- r.showWrapper = !1,
- o("closed")
- }
- , m = t=>{
- e.teleport && t.stopPropagation()
- }
- , f = n=>{
- const {activeColor: a} = l.props
- , i = n.value === e.modelValue;
- return t.createVNode(gn, {
- role: "menuitem",
- key: n.value,
- icon: n.icon,
- title: n.text,
- class: zi("option", {
- active: i
- }),
- style: {
- color: i ? a : ""
- },
- tabindex: i ? 0 : -1,
- clickable: !0,
- onClick: ()=>{
- r.showPopup = !1,
- n.value !== e.modelValue && (o("update:modelValue", n.value),
- o("change", n.value))
- }
- }, {
- value: ()=>{
- if (i)
- return t.createVNode(vt, {
- class: zi("icon"),
- color: a,
- name: "success"
- }, null)
- }
- })
- }
- , v = ()=>{
- const {offset: o} = l
- , {zIndex: s, overlay: v, duration: h, direction: g, closeOnClickOverlay: b} = l.props
- , y = ue(s);
- return "down" === g ? y.top = `${o.value}px` : y.bottom = `${o.value}px`,
- t.withDirectives(t.createVNode("div", t.mergeProps({
- style: y,
- class: zi([g]),
- onClick: m
- }, a), [t.createVNode(Gt, {
- show: r.showPopup,
- "onUpdate:show": e=>r.showPopup = e,
- role: "menu",
- class: zi("content"),
- overlay: v,
- position: "down" === g ? "top" : "bottom",
- duration: r.transition ? h : 0,
- lazyRender: e.lazyRender,
- overlayStyle: {
- position: "absolute"
- },
- "aria-labelledby": `${l.id}-${i.value}`,
- closeOnClickOverlay: b,
- onOpen: c,
- onClose: d,
- onOpened: u,
- onClosed: p
- }, {
- default: ()=>{
- var t;
- return [e.options.map(f), null == (t = n.default) ? void 0 : t.call(n)]
- }
- })]), [[t.vShow, r.showWrapper]])
- }
- ;
- return Je({
- state: r,
- toggle: (e=!r.showPopup,t={})=>{
- e !== r.showPopup && (r.showPopup = e,
- r.transition = !t.immediate,
- e && (r.showWrapper = !0))
- }
- ,
- renderTitle: ()=>{
- if (n.title)
- return n.title();
- if (e.title)
- return e.title;
- const t = e.options.find((t=>t.value === e.modelValue));
- return t ? t.text : ""
- }
- }),
- ()=>e.teleport ? t.createVNode(t.Teleport, {
- to: e.teleport
- }, {
- default: ()=>[v()]
- }) : v()
- }
- }))
- , Li = je(Ii)
- , [Mi,Fi] = Oe("grid")
- , Ri = {
- square: Boolean,
- center: b,
- border: b,
- gutter: g,
- reverse: Boolean,
- iconSize: g,
- direction: String,
- clickable: Boolean,
- columnNum: x(4)
- }
- , Hi = Symbol(Mi);
- const ji = je(t.defineComponent({
- name: Mi,
- props: Ri,
- setup(e, {slots: o}) {
- const {linkChildren: n} = I(Hi);
- return n({
- props: e
- }),
- ()=>{
- var n;
- return t.createVNode("div", {
- style: {
- paddingLeft: ce(e.gutter)
- },
- class: [Fi(), {
- [Ae]: e.border && !e.gutter
- }]
- }, [null == (n = o.default) ? void 0 : n.call(o)])
- }
- }
- }))
- , [Wi,Ui] = Oe("grid-item")
- , qi = d({}, Qe, {
- dot: Boolean,
- text: String,
- icon: String,
- badge: g,
- iconColor: String,
- iconPrefix: String,
- badgeProps: Object
- });
- const Yi = je(t.defineComponent({
- name: Wi,
- props: qi,
- setup(e, {slots: o}) {
- const {parent: n, index: a} = D(Hi)
- , r = tt();
- if (!n)
- return;
- const l = t.computed((()=>{
- const {square: e, gutter: t, columnNum: o} = n.props
- , r = 100 / +o + "%"
- , l = {
- flexBasis: r
- };
- if (e)
- l.paddingTop = r;
- else if (t) {
- const e = ce(t);
- l.paddingRight = e,
- a.value >= o && (l.marginTop = e)
- }
- return l
- }
- ))
- , i = t.computed((()=>{
- const {square: e, gutter: t} = n.props;
- if (e && t) {
- const e = ce(t);
- return {
- right: e,
- bottom: e,
- height: "auto"
- }
- }
- }
- ));
- return ()=>{
- const {center: a, border: s, square: c, gutter: d, reverse: u, direction: p, clickable: m} = n.props
- , f = [Ui("content", [p, {
- center: a,
- square: c,
- reverse: u,
- clickable: m,
- surround: s && d
- }]), {
- [Ie]: s
- }];
- return t.createVNode("div", {
- class: [Ui({
- square: c
- })],
- style: l.value
- }, [t.createVNode("div", {
- role: m ? "button" : void 0,
- class: f,
- style: i.value,
- tabindex: m ? 0 : void 0,
- onClick: r
- }, [o.default ? o.default() : [o.icon ? t.createVNode(rt, t.mergeProps({
- dot: e.dot,
- content: e.badge
- }, e.badgeProps), {
- default: o.icon
- }) : e.icon ? t.createVNode(vt, {
- dot: e.dot,
- name: e.icon,
- size: n.props.iconSize,
- badge: e.badge,
- class: Ui("icon"),
- color: e.iconColor,
- badgeProps: e.badgeProps,
- classPrefix: e.iconPrefix
- }, null) : void 0, o.text ? o.text() : e.text ? t.createVNode("span", {
- class: Ui("text")
- }, [e.text]) : void 0]])])
- }
- }
- }))
- , Gi = e=>Math.sqrt((e[0].clientX - e[1].clientX) ** 2 + (e[0].clientY - e[1].clientY) ** 2)
- , Xi = Oe("image-preview")[1];
- var Zi = t.defineComponent({
- props: {
- src: String,
- show: Boolean,
- active: Number,
- minZoom: y(g),
- maxZoom: y(g),
- rootWidth: y(Number),
- rootHeight: y(Number)
- },
- emits: ["scale", "close", "longPress"],
- setup(e, {emit: o, slots: n}) {
- const a = t.reactive({
- scale: 1,
- moveX: 0,
- moveY: 0,
- moving: !1,
- zooming: !1,
- imageRatio: 0,
- displayWidth: 0,
- displayHeight: 0
- })
- , r = $t()
- , l = t.ref()
- , i = t.computed((()=>{
- const {rootWidth: t, rootHeight: o} = e
- , n = o / t;
- return a.imageRatio > n
- }
- ))
- , s = t.computed((()=>{
- const {scale: e, moveX: t, moveY: o, moving: n, zooming: r} = a
- , l = {
- transitionDuration: r || n ? "0s" : ".3s"
- };
- if (1 !== e) {
- const n = t / e
- , a = o / e;
- l.transform = `scale(${e}, ${e}) translate(${n}px, ${a}px)`
- }
- return l
- }
- ))
- , c = t.computed((()=>{
- if (a.imageRatio) {
- const {rootWidth: t, rootHeight: o} = e
- , n = i.value ? o / a.imageRatio : t;
- return Math.max(0, (a.scale * n - t) / 2)
- }
- return 0
- }
- ))
- , d = t.computed((()=>{
- if (a.imageRatio) {
- const {rootWidth: t, rootHeight: o} = e
- , n = i.value ? o : t * a.imageRatio;
- return Math.max(0, (a.scale * n - o) / 2)
- }
- return 0
- }
- ))
- , u = t=>{
- (t = be(t, +e.minZoom, +e.maxZoom + 1)) !== a.scale && (a.scale = t,
- o("scale", {
- scale: t,
- index: e.active
- }))
- }
- , p = ()=>{
- u(1),
- a.moveX = 0,
- a.moveY = 0
- }
- ;
- let m, f, v, h, g, b, y;
- const w = e=>{
- const {touches: t} = e
- , {offsetX: o} = r;
- r.start(e),
- m = t.length,
- f = a.moveX,
- v = a.moveY,
- y = Date.now(),
- a.moving = 1 === m && 1 !== a.scale,
- a.zooming = 2 === m && !o.value,
- a.zooming && (h = a.scale,
- g = Gi(e.touches))
- }
- , V = ()=>{
- if (m > 1)
- return;
- const {offsetX: e, offsetY: t} = r
- , n = Date.now() - y;
- e.value < 5 && t.value < 5 && (n < 250 ? b ? (clearTimeout(b),
- b = null,
- (()=>{
- const e = a.scale > 1 ? 1 : 2;
- u(e),
- a.moveX = 0,
- a.moveY = 0
- }
- )()) : b = setTimeout((()=>{
- o("close"),
- b = null
- }
- ), 250) : n > 500 && o("longPress"))
- }
- , x = t=>{
- let o = !1;
- (a.moving || a.zooming) && (o = !0,
- a.moving && f === a.moveX && v === a.moveY && (o = !1),
- t.touches.length || (a.zooming && (a.moveX = be(a.moveX, -c.value, c.value),
- a.moveY = be(a.moveY, -d.value, d.value),
- a.zooming = !1),
- a.moving = !1,
- f = 0,
- v = 0,
- h = 1,
- a.scale < 1 && p(),
- a.scale > e.maxZoom && (a.scale = +e.maxZoom))),
- re(t, o),
- V(),
- r.reset()
- }
- , N = e=>{
- const {naturalWidth: t, naturalHeight: o} = e.target;
- a.imageRatio = o / t
- }
- ;
- return t.watch((()=>e.active), p),
- t.watch((()=>e.show), (e=>{
- e || p()
- }
- )),
- H("touchmove", (e=>{
- const {touches: t} = e;
- if (r.move(e),
- (a.moving || a.zooming) && re(e, !0),
- a.moving) {
- const {deltaX: e, deltaY: t} = r
- , o = e.value + f
- , n = t.value + v;
- a.moveX = be(o, -c.value, c.value),
- a.moveY = be(n, -d.value, d.value)
- }
- if (a.zooming && 2 === t.length) {
- const e = Gi(t);
- u(h * e / g)
- }
- }
- ), {
- target: t.computed((()=>{
- var e;
- return null == (e = l.value) ? void 0 : e.$el
- }
- ))
- }),
- ()=>{
- const o = {
- loading: ()=>t.createVNode(Vt, {
- type: "spinner"
- }, null)
- };
- return t.createVNode(jo, {
- ref: l,
- class: Xi("swipe-item"),
- onTouchstartPassive: w,
- onTouchend: x,
- onTouchcancel: x
- }, {
- default: ()=>[n.image ? t.createVNode("div", {
- class: Xi("image-wrap")
- }, [n.image({
- src: e.src
- })]) : t.createVNode(Sr, {
- src: e.src,
- fit: "contain",
- class: Xi("image", {
- vertical: i.value
- }),
- style: s.value,
- onLoad: N
- }, o)]
- })
- }
- }
- });
- const [Ki,_i] = Oe("image-preview")
- , Ji = ["show", "transition", "overlayStyle", "closeOnPopstate"]
- , Qi = {
- show: Boolean,
- loop: b,
- images: w(),
- minZoom: x(1 / 3),
- maxZoom: x(3),
- overlay: b,
- closeable: Boolean,
- showIndex: b,
- className: h,
- closeIcon: N("clear"),
- transition: String,
- beforeClose: Function,
- overlayClass: h,
- overlayStyle: Object,
- swipeDuration: x(300),
- startPosition: x(0),
- showIndicators: Boolean,
- closeOnPopstate: b,
- closeIconPosition: N("top-right")
- };
- var es = t.defineComponent({
- name: Ki,
- props: Qi,
- emits: ["scale", "close", "closed", "change", "longPress", "update:show"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = t.reactive({
- active: 0,
- rootWidth: 0,
- rootHeight: 0
- })
- , l = ()=>{
- if (a.value) {
- const e = P(a.value.$el);
- r.rootWidth = e.width,
- r.rootHeight = e.height,
- a.value.resize()
- }
- }
- , i = e=>o("scale", e)
- , s = e=>o("update:show", e)
- , c = ()=>{
- He(e.beforeClose, {
- args: [r.active],
- done: ()=>s(!1)
- })
- }
- , d = e=>{
- e !== r.active && (r.active = e,
- o("change", e))
- }
- , u = ()=>{
- if (e.showIndex)
- return t.createVNode("div", {
- class: _i("index")
- }, [n.index ? n.index({
- index: r.active
- }) : `${r.active + 1} / ${e.images.length}`])
- }
- , p = ()=>{
- if (n.cover)
- return t.createVNode("div", {
- class: _i("cover")
- }, [n.cover()])
- }
- , f = ()=>{
- if (e.closeable)
- return t.createVNode(vt, {
- role: "button",
- name: e.closeIcon,
- class: [_i("close-icon", e.closeIconPosition), Fe],
- onClick: c
- }, null)
- }
- , v = ()=>o("closed")
- , h = (e,t)=>{
- var o;
- return null == (o = a.value) ? void 0 : o.swipeTo(e, t)
- }
- ;
- return Je({
- swipeTo: h
- }),
- t.onMounted(l),
- t.watch([ie, se], l),
- t.watch((()=>e.startPosition), (e=>d(+e))),
- t.watch((()=>e.show), (n=>{
- const {images: a, startPosition: i} = e;
- n ? (d(+i),
- t.nextTick((()=>{
- l(),
- h(+i, {
- immediate: !0
- })
- }
- ))) : o("close", {
- index: r.active,
- url: a[r.active]
- })
- }
- )),
- ()=>t.createVNode(Gt, t.mergeProps({
- class: [_i(), e.className],
- overlayClass: [_i("overlay"), e.overlayClass],
- onClosed: v,
- "onUpdate:show": s
- }, m(e, Ji)), {
- default: ()=>[f(), t.createVNode(Do, {
- ref: a,
- lazyRender: !0,
- loop: e.loop,
- class: _i("swipe"),
- duration: e.swipeDuration,
- initialSwipe: e.startPosition,
- showIndicators: e.showIndicators,
- indicatorColor: "white",
- onChange: d
- }, {
- default: ()=>[e.images.map(((a,l)=>t.createVNode(Zi, {
- src: a,
- show: e.show,
- active: r.active,
- maxZoom: e.maxZoom,
- minZoom: e.minZoom,
- rootWidth: r.rootWidth,
- rootHeight: r.rootHeight,
- onScale: i,
- onClose: c,
- onLongPress: ()=>o("longPress", {
- index: l
- })
- }, {
- image: n.image
- })))]
- }), u(), p()]
- })
- }
- });
- let ts;
- const os = {
- loop: !0,
- images: [],
- maxZoom: 3,
- minZoom: 1 / 3,
- onScale: void 0,
- onClose: void 0,
- onChange: void 0,
- teleport: "body",
- className: "",
- showIndex: !0,
- closeable: !1,
- closeIcon: "clear",
- transition: void 0,
- beforeClose: void 0,
- overlayStyle: void 0,
- overlayClass: void 0,
- startPosition: 0,
- swipeDuration: 300,
- showIndicators: !1,
- closeOnPopstate: !0,
- closeIconPosition: "top-right"
- };
- const ns = (e,o=0)=>{
- if (u)
- return ts || ({instance: ts} = Fn({
- setup() {
- const {state: e, toggle: o} = Mn()
- , n = ()=>{
- e.images = []
- }
- ;
- return ()=>t.createVNode(es, t.mergeProps(e, {
- onClosed: n,
- "onUpdate:show": o
- }), null)
- }
- })),
- e = Array.isArray(e) ? {
- images: e,
- startPosition: o
- } : e,
- ts.open(d({}, os, e)),
- ts
- }
- , as = je(es);
- const [rs,ls] = Oe("index-bar")
- , is = {
- sticky: b,
- zIndex: g,
- teleport: [String, Object],
- highlightColor: String,
- stickyOffsetTop: V(0),
- indexList: {
- type: Array,
- default: function() {
- const e = "A".charCodeAt(0);
- return Array(26).fill("").map(((t,o)=>String.fromCharCode(e + o)))
- }
- }
- }
- , ss = Symbol(rs);
- var cs = t.defineComponent({
- name: rs,
- props: is,
- emits: ["select", "change"],
- setup(e, {emit: n, slots: a}) {
- const r = t.ref()
- , l = t.ref()
- , i = t.ref("")
- , s = $t()
- , c = X(r)
- , {children: d, linkChildren: u} = I(ss);
- let p;
- u({
- props: e
- });
- const m = t.computed((()=>{
- if (o(e.zIndex))
- return {
- zIndex: +e.zIndex + 1
- }
- }
- ))
- , f = t.computed((()=>{
- if (e.highlightColor)
- return {
- color: e.highlightColor
- }
- }
- ))
- , v = (t,o)=>{
- for (let n = d.length - 1; n >= 0; n--) {
- const a = n > 0 ? o[n - 1].height : 0;
- if (t + (e.sticky ? a + e.stickyOffsetTop : 0) >= o[n].top)
- return n
- }
- return -1
- }
- , h = e=>d.find((t=>String(t.index) === e))
- , g = ()=>{
- if (le(r))
- return;
- const {sticky: t, indexList: o} = e
- , n = _(c.value)
- , a = P(c)
- , l = d.map((e=>e.getRect(c.value, a)));
- let s = -1;
- if (p) {
- const e = h(p);
- if (e) {
- const t = e.getRect(c.value, a);
- s = v(t.top, l)
- }
- } else
- s = v(n, l);
- i.value = o[s],
- t && d.forEach(((t,o)=>{
- const {state: r, $el: i} = t;
- if (o === s || o === s - 1) {
- const e = i.getBoundingClientRect();
- r.left = e.left,
- r.width = e.width
- } else
- r.left = null,
- r.width = null;
- if (o === s)
- r.active = !0,
- r.top = Math.max(e.stickyOffsetTop, l[o].top - n) + a.top;
- else if (o === s - 1 && "" === p) {
- const e = l[s].top - n;
- r.active = e > 0,
- r.top = e + a.top - l[o].height
- } else
- r.active = !1
- }
- )),
- p = ""
- }
- , b = ()=>{
- t.nextTick(g)
- }
- ;
- H("scroll", g, {
- target: c,
- passive: !0
- }),
- t.onMounted(b),
- t.watch((()=>e.indexList), b),
- t.watch(i, (e=>{
- e && n("change", e)
- }
- ));
- const y = t=>{
- p = String(t);
- const o = h(p);
- if (o) {
- const t = _(c.value)
- , a = P(c)
- , {offsetHeight: r} = document.documentElement;
- if (o.$el.scrollIntoView(),
- t === r - a.height)
- return void g();
- e.sticky && e.stickyOffsetTop && ee(Q() - e.stickyOffsetTop),
- n("select", o.index)
- }
- }
- , w = e=>{
- const {index: t} = e.dataset;
- t && y(t)
- }
- , V = e=>{
- w(e.target)
- }
- ;
- let x;
- const N = ()=>t.createVNode("div", {
- ref: l,
- class: ls("sidebar"),
- style: m.value,
- onClick: V,
- onTouchstartPassive: s.start
- }, [e.indexList.map((e=>{
- const o = e === i.value;
- return t.createVNode("span", {
- class: ls("index", {
- active: o
- }),
- style: o ? f.value : void 0,
- "data-index": e
- }, [e])
- }
- ))]);
- return Je({
- scrollTo: y
- }),
- H("touchmove", (e=>{
- if (s.move(e),
- s.isVertical()) {
- re(e);
- const {clientX: t, clientY: o} = e.touches[0]
- , n = document.elementFromPoint(t, o);
- if (n) {
- const {index: e} = n.dataset;
- e && x !== e && (x = e,
- w(n))
- }
- }
- }
- ), {
- target: l
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- ref: r,
- class: ls()
- }, [e.teleport ? t.createVNode(t.Teleport, {
- to: e.teleport
- }, {
- default: ()=>[N()]
- }) : N(), null == (o = a.default) ? void 0 : o.call(a)])
- }
- }
- });
- const [ds,us] = Oe("index-anchor")
- , ps = {
- index: g
- };
- const ms = je(t.defineComponent({
- name: ds,
- props: ps,
- setup(e, {slots: o}) {
- const n = t.reactive({
- top: 0,
- left: null,
- rect: {
- top: 0,
- height: 0
- },
- width: null,
- active: !1
- })
- , a = t.ref()
- , {parent: r} = D(ss);
- if (!r)
- return;
- const l = ()=>n.active && r.props.sticky
- , i = t.computed((()=>{
- const {zIndex: e, highlightColor: t} = r.props;
- if (l())
- return d(ue(e), {
- left: n.left ? `${n.left}px` : void 0,
- width: n.width ? `${n.width}px` : void 0,
- transform: n.top ? `translate3d(0, ${n.top}px, 0)` : void 0,
- color: t
- })
- }
- ));
- return Je({
- state: n,
- getRect: (e,t)=>{
- const o = P(a);
- return n.rect.height = o.height,
- e === window || e === document.body ? n.rect.top = o.top + Q() : n.rect.top = o.top + _(e) - t.top,
- n.rect
- }
- }),
- ()=>{
- const r = l();
- return t.createVNode("div", {
- ref: a,
- style: {
- height: r ? `${n.rect.height}px` : void 0
- }
- }, [t.createVNode("div", {
- style: i.value,
- class: [us({
- sticky: r
- }), {
- [Ee]: r
- }]
- }, [o.default ? o.default() : e.index])])
- }
- }
- }))
- , fs = je(cs)
- , [vs,hs,gs] = Oe("list")
- , bs = {
- error: Boolean,
- offset: x(300),
- loading: Boolean,
- disabled: Boolean,
- finished: Boolean,
- errorText: String,
- direction: N("down"),
- loadingText: String,
- finishedText: String,
- immediateCheck: b
- };
- const ys = je(t.defineComponent({
- name: vs,
- props: bs,
- emits: ["load", "update:error", "update:loading"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref(e.loading)
- , r = t.ref()
- , l = t.ref()
- , i = t.inject(Fo, null)
- , s = X(r)
- , c = ()=>{
- t.nextTick((()=>{
- if (a.value || e.finished || e.disabled || e.error || !1 === (null == i ? void 0 : i.value))
- return;
- const {offset: t, direction: n} = e
- , c = P(s);
- if (!c.height || le(r))
- return;
- let d = !1;
- const u = P(l);
- d = "up" === n ? c.top - u.top <= t : u.bottom - c.bottom <= t,
- d && (a.value = !0,
- o("update:loading", !0),
- o("load"))
- }
- ))
- }
- , d = ()=>{
- if (e.finished) {
- const o = n.finished ? n.finished() : e.finishedText;
- if (o)
- return t.createVNode("div", {
- class: hs("finished-text")
- }, [o])
- }
- }
- , u = ()=>{
- o("update:error", !1),
- c()
- }
- , p = ()=>{
- if (e.error) {
- const o = n.error ? n.error() : e.errorText;
- if (o)
- return t.createVNode("div", {
- role: "button",
- class: hs("error-text"),
- tabindex: 0,
- onClick: u
- }, [o])
- }
- }
- , m = ()=>{
- if (a.value && !e.finished && !e.disabled)
- return t.createVNode("div", {
- class: hs("loading")
- }, [n.loading ? n.loading() : t.createVNode(Vt, {
- class: hs("loading-icon")
- }, {
- default: ()=>[e.loadingText || gs("loading")]
- })])
- }
- ;
- return t.watch((()=>[e.loading, e.finished, e.error]), c),
- i && t.watch(i, (e=>{
- e && c()
- }
- )),
- t.onUpdated((()=>{
- a.value = e.loading
- }
- )),
- t.onMounted((()=>{
- e.immediateCheck && c()
- }
- )),
- Je({
- check: c
- }),
- H("scroll", c, {
- target: s,
- passive: !0
- }),
- ()=>{
- var o;
- const i = null == (o = n.default) ? void 0 : o.call(n)
- , s = t.createVNode("div", {
- ref: l,
- class: hs("placeholder")
- }, null);
- return t.createVNode("div", {
- ref: r,
- role: "feed",
- class: hs(),
- "aria-busy": a.value
- }, ["down" === e.direction ? i : s, m(), d(), p(), "up" === e.direction ? i : s])
- }
- }
- }))
- , [ws,Vs] = Oe("nav-bar")
- , xs = {
- title: String,
- fixed: Boolean,
- zIndex: g,
- border: b,
- leftText: String,
- rightText: String,
- leftArrow: Boolean,
- placeholder: Boolean,
- safeAreaInsetTop: Boolean,
- clickable: b
- };
- const Ns = je(t.defineComponent({
- name: ws,
- props: xs,
- emits: ["clickLeft", "clickRight"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = Ye(a, Vs)
- , l = e=>o("clickLeft", e)
- , i = e=>o("clickRight", e)
- , s = ()=>{
- const {title: o, fixed: r, border: s, zIndex: c} = e
- , d = ue(c)
- , u = e.leftArrow || e.leftText || n.left
- , p = e.rightText || n.right;
- return t.createVNode("div", {
- ref: a,
- style: d,
- class: [Vs({
- fixed: r
- }), {
- [Ee]: s,
- "van-safe-area-top": e.safeAreaInsetTop
- }]
- }, [t.createVNode("div", {
- class: Vs("content")
- }, [u && t.createVNode("div", {
- class: [Vs("left"), e.clickable ? Fe : ""],
- onClick: l
- }, [n.left ? n.left() : [e.leftArrow && t.createVNode(vt, {
- class: Vs("arrow"),
- name: "arrow-left"
- }, null), e.leftText && t.createVNode("span", {
- class: Vs("text")
- }, [e.leftText])]]), t.createVNode("div", {
- class: [Vs("title"), "van-ellipsis"]
- }, [n.title ? n.title() : o]), p && t.createVNode("div", {
- class: [Vs("right"), e.clickable ? Fe : ""],
- onClick: i
- }, [n.right ? n.right() : t.createVNode("span", {
- class: Vs("text")
- }, [e.rightText])])])])
- }
- ;
- return ()=>e.fixed && e.placeholder ? r(s) : s()
- }
- }))
- , [Cs,ks] = Oe("notice-bar")
- , Ss = {
- text: String,
- mode: String,
- color: String,
- delay: x(1),
- speed: x(60),
- leftIcon: String,
- wrapable: Boolean,
- background: String,
- scrollable: {
- type: Boolean,
- default: null
- }
- };
- const Bs = je(t.defineComponent({
- name: Cs,
- props: Ss,
- emits: ["close", "replay"],
- setup(e, {emit: n, slots: a}) {
- let r, l = 0, i = 0;
- const s = t.ref()
- , c = t.ref()
- , d = t.reactive({
- show: !0,
- offset: 0,
- duration: 0
- })
- , u = t=>{
- "closeable" === e.mode && (d.show = !1,
- n("close", t))
- }
- , p = ()=>{
- if (a["right-icon"])
- return a["right-icon"]();
- const o = "closeable" === e.mode ? "cross" : "link" === e.mode ? "arrow" : void 0;
- return o ? t.createVNode(vt, {
- name: o,
- class: ks("right-icon"),
- onClick: u
- }, null) : void 0
- }
- , m = ()=>{
- d.offset = l,
- d.duration = 0,
- k((()=>{
- B((()=>{
- d.offset = -i,
- d.duration = (i + l) / +e.speed,
- n("replay")
- }
- ))
- }
- ))
- }
- , f = ()=>{
- const o = !1 === e.scrollable && !e.wrapable
- , n = {
- transform: d.offset ? `translateX(${d.offset}px)` : "",
- transitionDuration: `${d.duration}s`
- };
- return t.createVNode("div", {
- ref: s,
- role: "marquee",
- class: ks("wrap")
- }, [t.createVNode("div", {
- ref: c,
- style: n,
- class: [ks("content"), {
- "van-ellipsis": o
- }],
- onTransitionend: m
- }, [a.default ? a.default() : e.text])])
- }
- , v = ()=>{
- const {delay: t, speed: n, scrollable: a} = e
- , u = o(t) ? 1e3 * +t : 0;
- l = 0,
- i = 0,
- d.offset = 0,
- d.duration = 0,
- clearTimeout(r),
- r = setTimeout((()=>{
- if (!s.value || !c.value || !1 === a)
- return;
- const e = P(s).width
- , t = P(c).width;
- (a || t > e) && B((()=>{
- l = e,
- i = t,
- d.offset = -i,
- d.duration = i / +n
- }
- ))
- }
- ), u)
- }
- ;
- return Ue(v),
- R(v),
- H("pageshow", v),
- Je({
- reset: v
- }),
- t.watch((()=>[e.text, e.scrollable]), v),
- ()=>{
- const {color: o, wrapable: n, background: r} = e;
- return t.withDirectives(t.createVNode("div", {
- role: "alert",
- class: ks({
- wrapable: n
- }),
- style: {
- color: o,
- background: r
- }
- }, [a["left-icon"] ? a["left-icon"]() : e.leftIcon ? t.createVNode(vt, {
- class: ks("left-icon"),
- name: e.leftIcon
- }, null) : void 0, f(), p()]), [[t.vShow, d.show]])
- }
- }
- }))
- , [Ts,Ps] = Oe("notify")
- , Ds = d({}, zt, {
- type: N("danger"),
- color: String,
- message: g,
- position: N("top"),
- className: h,
- background: String,
- lockScroll: Boolean
- });
- var Os = t.defineComponent({
- name: Ts,
- props: Ds,
- emits: ["update:show"],
- setup(e, {emit: o, slots: n}) {
- const a = e=>o("update:show", e);
- return ()=>t.createVNode(Gt, {
- show: e.show,
- class: [Ps([e.type]), e.className],
- style: {
- color: e.color,
- background: e.background
- },
- overlay: !1,
- zIndex: e.zIndex,
- position: e.position,
- duration: .2,
- lockScroll: e.lockScroll,
- "onUpdate:show": a
- }, {
- default: ()=>[n.default ? n.default() : e.message]
- })
- }
- });
- let Is, As;
- let zs = {
- type: "danger",
- color: void 0,
- message: "",
- onClose: void 0,
- onClick: void 0,
- onOpened: void 0,
- duration: 3e3,
- position: void 0,
- className: "",
- lockScroll: !1,
- background: void 0
- };
- const Es = ()=>{
- As && As.toggle(!1)
- }
- ;
- const $s = je(Os)
- , [Ls,Ms] = Oe("key")
- , Fs = t.createVNode("svg", {
- class: Ms("collapse-icon"),
- viewBox: "0 0 30 24"
- }, [t.createVNode("path", {
- d: "M26 13h-2v2h2v-2zm-8-3h2V8h-2v2zm2-4h2V4h-2v2zm2 4h4V4h-2v4h-2v2zm-7 14 3-3h-6l3 3zM6 13H4v2h2v-2zm16 0H8v2h14v-2zm-12-3h2V8h-2v2zM28 0l1 1 1 1v15l-1 2H1l-1-2V2l1-1 1-1zm0 2H2v15h26V2zM6 4v2H4V4zm10 2h2V4h-2v2zM8 9v1H4V8zm8 0v1h-2V8zm-6-5v2H8V4zm4 0v2h-2V4z",
- fill: "currentColor"
- }, null)])
- , Rs = t.createVNode("svg", {
- class: Ms("delete-icon"),
- viewBox: "0 0 32 22"
- }, [t.createVNode("path", {
- d: "M28 0a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H10.4a2 2 0 0 1-1.4-.6L1 13.1c-.6-.5-.9-1.3-.9-2 0-1 .3-1.7.9-2.2L9 .6a2 2 0 0 1 1.4-.6zm0 2H10.4l-8.2 8.3a1 1 0 0 0-.3.7c0 .3.1.5.3.7l8.2 8.4H28a2 2 0 0 0 2-2V4c0-1.1-.9-2-2-2zm-5 4a1 1 0 0 1 .7.3 1 1 0 0 1 0 1.4L20.4 11l3.3 3.3c.2.2.3.5.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3L19 12.4l-3.4 3.3a1 1 0 0 1-.6.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.2.1-.5.3-.7l3.3-3.3-3.3-3.3A1 1 0 0 1 14 7c0-.3.1-.5.3-.7A1 1 0 0 1 15 6a1 1 0 0 1 .6.3L19 9.6l3.3-3.3A1 1 0 0 1 23 6z",
- fill: "currentColor"
- }, null)]);
- var Hs = t.defineComponent({
- name: Ls,
- props: {
- type: String,
- text: g,
- color: String,
- wider: Boolean,
- large: Boolean,
- loading: Boolean
- },
- emits: ["press"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref(!1)
- , r = $t()
- , l = e=>{
- r.start(e),
- a.value = !0
- }
- , i = e=>{
- r.move(e),
- r.direction.value && (a.value = !1)
- }
- , s = t=>{
- a.value && (n.default || re(t),
- a.value = !1,
- o("press", e.text, e.type))
- }
- , c = ()=>{
- if (e.loading)
- return t.createVNode(Vt, {
- class: Ms("loading-icon")
- }, null);
- const o = n.default ? n.default() : e.text;
- switch (e.type) {
- case "delete":
- return o || Rs;
- case "extra":
- return o || Fs;
- default:
- return o
- }
- }
- ;
- return ()=>t.createVNode("div", {
- class: Ms("wrapper", {
- wider: e.wider
- }),
- onTouchstartPassive: l,
- onTouchmovePassive: i,
- onTouchend: s,
- onTouchcancel: s
- }, [t.createVNode("div", {
- role: "button",
- tabindex: 0,
- class: Ms([e.color, {
- large: e.large,
- active: a.value,
- delete: "delete" === e.type
- }])
- }, [c()])])
- }
- });
- const [js,Ws] = Oe("number-keyboard")
- , Us = {
- show: Boolean,
- title: String,
- theme: N("default"),
- zIndex: g,
- teleport: [String, Object],
- maxlength: x(1 / 0),
- modelValue: N(""),
- transition: b,
- blurOnClose: b,
- showDeleteKey: b,
- randomKeyOrder: Boolean,
- closeButtonText: String,
- deleteButtonText: String,
- closeButtonLoading: Boolean,
- hideOnClickOutside: b,
- safeAreaInsetBottom: b,
- extraKey: {
- type: [String, Array],
- default: ""
- }
- };
- const qs = je(t.defineComponent({
- name: js,
- inheritAttrs: !1,
- props: Us,
- emits: ["show", "hide", "blur", "input", "close", "delete", "update:modelValue"],
- setup(e, {emit: o, slots: n, attrs: a}) {
- const r = t.ref()
- , l = ()=>{
- const t = Array(9).fill("").map(((e,t)=>({
- text: t + 1
- })));
- return e.randomKeyOrder && function(e) {
- for (let t = e.length - 1; t > 0; t--) {
- const o = Math.floor(Math.random() * (t + 1))
- , n = e[t];
- e[t] = e[o],
- e[o] = n
- }
- }(t),
- t
- }
- , i = t.computed((()=>"custom" === e.theme ? (()=>{
- const t = l()
- , {extraKey: o} = e
- , n = Array.isArray(o) ? o : [o];
- return 1 === n.length ? t.push({
- text: 0,
- wider: !0
- }, {
- text: n[0],
- type: "extra"
- }) : 2 === n.length && t.push({
- text: n[0],
- type: "extra"
- }, {
- text: 0
- }, {
- text: n[1],
- type: "extra"
- }),
- t
- }
- )() : [...l(), {
- text: e.extraKey,
- type: "extra"
- }, {
- text: 0
- }, {
- text: e.showDeleteKey ? e.deleteButtonText : "",
- type: e.showDeleteKey ? "delete" : ""
- }]))
- , s = ()=>{
- e.show && o("blur")
- }
- , c = ()=>{
- o("close"),
- e.blurOnClose && s()
- }
- , d = ()=>o(e.show ? "show" : "hide")
- , u = (t,n)=>{
- if ("" === t)
- return void ("extra" === n && s());
- const a = e.modelValue;
- "delete" === n ? (o("delete"),
- o("update:modelValue", a.slice(0, a.length - 1))) : "close" === n ? c() : a.length < e.maxlength && (o("input", t),
- o("update:modelValue", a + t))
- }
- , p = ()=>{
- if ("custom" === e.theme)
- return t.createVNode("div", {
- class: Ws("sidebar")
- }, [e.showDeleteKey && t.createVNode(Hs, {
- large: !0,
- text: e.deleteButtonText,
- type: "delete",
- onPress: u
- }, {
- delete: n.delete
- }), t.createVNode(Hs, {
- large: !0,
- text: e.closeButtonText,
- type: "close",
- color: "blue",
- loading: e.closeButtonLoading,
- onPress: u
- }, null)])
- }
- ;
- return t.watch((()=>e.show), (t=>{
- e.transition || o(t ? "show" : "hide")
- }
- )),
- e.hideOnClickOutside && j(r, s, {
- eventName: "touchstart"
- }),
- ()=>{
- const o = (()=>{
- const {title: o, theme: a, closeButtonText: r} = e
- , l = n["title-left"]
- , i = r && "default" === a;
- if (o || i || l)
- return t.createVNode("div", {
- class: Ws("header")
- }, [l && t.createVNode("span", {
- class: Ws("title-left")
- }, [l()]), o && t.createVNode("h2", {
- class: Ws("title")
- }, [o]), i && t.createVNode("button", {
- type: "button",
- class: [Ws("close"), Fe],
- onClick: c
- }, [r])])
- }
- )()
- , l = t.createVNode(t.Transition, {
- name: e.transition ? "van-slide-up" : ""
- }, {
- default: ()=>[t.withDirectives(t.createVNode("div", t.mergeProps({
- ref: r,
- style: ue(e.zIndex),
- class: Ws({
- unfit: !e.safeAreaInsetBottom,
- "with-title": !!o
- }),
- onAnimationend: d,
- onTouchstartPassive: ae
- }, a), [o, t.createVNode("div", {
- class: Ws("body")
- }, [t.createVNode("div", {
- class: Ws("keys")
- }, [i.value.map((e=>{
- const o = {};
- return "delete" === e.type && (o.default = n.delete),
- "extra" === e.type && (o.default = n["extra-key"]),
- t.createVNode(Hs, {
- key: e.text,
- text: e.text,
- type: e.type,
- wider: e.wider,
- color: e.color,
- onPress: u
- }, o)
- }
- ))]), p()])]), [[t.vShow, e.show]])]
- });
- return e.teleport ? t.createVNode(t.Teleport, {
- to: e.teleport
- }, {
- default: ()=>[l]
- }) : l
- }
- }
- }))
- , [Ys,Gs,Xs] = Oe("pagination")
- , Zs = (e,t,o)=>({
- number: e,
- text: t,
- active: o
- })
- , Ks = {
- mode: N("multi"),
- prevText: String,
- nextText: String,
- pageCount: x(0),
- modelValue: V(0),
- totalItems: x(0),
- showPageSize: x(5),
- itemsPerPage: x(10),
- forceEllipses: Boolean
- };
- const _s = je(t.defineComponent({
- name: Ys,
- props: Ks,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.computed((()=>{
- const {pageCount: t, totalItems: o, itemsPerPage: n} = e
- , a = +t || Math.ceil(+o / +n);
- return Math.max(1, a)
- }
- ))
- , r = t.computed((()=>{
- const t = []
- , o = a.value
- , n = +e.showPageSize
- , {modelValue: r, forceEllipses: l} = e;
- let i = 1
- , s = o;
- const c = n < o;
- c && (i = Math.max(r - Math.floor(n / 2), 1),
- s = i + n - 1,
- s > o && (s = o,
- i = s - n + 1));
- for (let e = i; e <= s; e++) {
- const o = Zs(e, e, e === r);
- t.push(o)
- }
- if (c && n > 0 && l) {
- if (i > 1) {
- const e = Zs(i - 1, "...");
- t.unshift(e)
- }
- if (s < o) {
- const e = Zs(s + 1, "...");
- t.push(e)
- }
- }
- return t
- }
- ))
- , l = (t,n)=>{
- t = be(t, 1, a.value),
- e.modelValue !== t && (o("update:modelValue", t),
- n && o("change", t))
- }
- ;
- t.watchEffect((()=>l(e.modelValue)));
- const i = ()=>{
- const {mode: o, modelValue: a} = e
- , r = n["prev-text"]
- , i = 1 === a;
- return t.createVNode("li", {
- class: [Gs("item", {
- disabled: i,
- border: "simple" === o,
- prev: !0
- }), $e]
- }, [t.createVNode("button", {
- type: "button",
- disabled: i,
- onClick: ()=>l(a - 1, !0)
- }, [r ? r() : e.prevText || Xs("prev")])])
- }
- , s = ()=>{
- const {mode: o, modelValue: r} = e
- , i = n["next-text"]
- , s = r === a.value;
- return t.createVNode("li", {
- class: [Gs("item", {
- disabled: s,
- border: "simple" === o,
- next: !0
- }), $e]
- }, [t.createVNode("button", {
- type: "button",
- disabled: s,
- onClick: ()=>l(r + 1, !0)
- }, [i ? i() : e.nextText || Xs("next")])])
- }
- ;
- return ()=>t.createVNode("nav", {
- role: "navigation",
- class: Gs()
- }, [t.createVNode("ul", {
- class: Gs("items")
- }, [i(), "simple" === e.mode ? t.createVNode("li", {
- class: Gs("page-desc")
- }, [n.pageDesc ? n.pageDesc() : `${e.modelValue}/${a.value}`]) : r.value.map((e=>t.createVNode("li", {
- class: [Gs("item", {
- active: e.active,
- page: !0
- }), $e]
- }, [t.createVNode("button", {
- type: "button",
- "aria-current": e.active || void 0,
- onClick: ()=>l(e.number, !0)
- }, [n.page ? n.page(e) : e.text])]))), s()])])
- }
- }))
- , [Js,Qs] = Oe("password-input")
- , ec = {
- info: String,
- mask: b,
- value: N(""),
- gutter: g,
- length: x(6),
- focused: Boolean,
- errorInfo: String
- };
- const tc = je(t.defineComponent({
- name: Js,
- props: ec,
- emits: ["focus"],
- setup(e, {emit: o}) {
- const n = e=>{
- e.stopPropagation(),
- o("focus", e)
- }
- , a = ()=>{
- const o = []
- , {mask: n, value: a, length: r, gutter: l, focused: i} = e;
- for (let e = 0; e < r; e++) {
- const r = a[e]
- , s = 0 !== e && !l
- , c = i && e === a.length;
- let d;
- 0 !== e && l && (d = {
- marginLeft: ce(l)
- }),
- o.push(t.createVNode("li", {
- class: [{
- [ze]: s
- }, Qs("item", {
- focus: c
- })],
- style: d
- }, [n ? t.createVNode("i", {
- style: {
- visibility: r ? "visible" : "hidden"
- }
- }, null) : r, c && t.createVNode("div", {
- class: Qs("cursor")
- }, null)]))
- }
- return o
- }
- ;
- return ()=>{
- const o = e.errorInfo || e.info;
- return t.createVNode("div", {
- class: Qs()
- }, [t.createVNode("ul", {
- class: [Qs("security"), {
- [$e]: !e.gutter
- }],
- onTouchstartPassive: n
- }, [a()]), o && t.createVNode("div", {
- class: Qs(e.errorInfo ? "error-info" : "info")
- }, [o])])
- }
- }
- }))
- , oc = je(Jo);
- function nc(e) {
- if (null == e)
- return window;
- if ("[object Window]" !== e.toString()) {
- var t = e.ownerDocument;
- return t && t.defaultView || window
- }
- return e
- }
- function ac(e) {
- return e instanceof nc(e).Element || e instanceof Element
- }
- function rc(e) {
- return e instanceof nc(e).HTMLElement || e instanceof HTMLElement
- }
- function lc(e) {
- return "undefined" != typeof ShadowRoot && (e instanceof nc(e).ShadowRoot || e instanceof ShadowRoot)
- }
- var ic = Math.round;
- function sc() {
- var e = navigator.userAgentData;
- return null != e && e.brands ? e.brands.map((function(e) {
- return e.brand + "/" + e.version
- }
- )).join(" ") : navigator.userAgent
- }
- function cc(e, t, o) {
- void 0 === t && (t = !1),
- void 0 === o && (o = !1);
- var n = e.getBoundingClientRect()
- , a = 1
- , r = 1;
- t && rc(e) && (a = e.offsetWidth > 0 && ic(n.width) / e.offsetWidth || 1,
- r = e.offsetHeight > 0 && ic(n.height) / e.offsetHeight || 1);
- var l = (ac(e) ? nc(e) : window).visualViewport
- , i = !!/^((?!chrome|android).)*safari/i.test(sc()) && o
- , s = (n.left + (i && l ? l.offsetLeft : 0)) / a
- , c = (n.top + (i && l ? l.offsetTop : 0)) / r
- , d = n.width / a
- , u = n.height / r;
- return {
- width: d,
- height: u,
- top: c,
- right: s + d,
- bottom: c + u,
- left: s,
- x: s,
- y: c
- }
- }
- function dc(e) {
- var t = nc(e);
- return {
- scrollLeft: t.pageXOffset,
- scrollTop: t.pageYOffset
- }
- }
- function uc(e) {
- return e ? (e.nodeName || "").toLowerCase() : null
- }
- function pc(e) {
- return ((ac(e) ? e.ownerDocument : e.document) || window.document).documentElement
- }
- function mc(e) {
- return nc(e).getComputedStyle(e)
- }
- function fc(e) {
- var t = mc(e)
- , o = t.overflow
- , n = t.overflowX
- , a = t.overflowY;
- return /auto|scroll|overlay|hidden/.test(o + a + n)
- }
- function vc(e, t, o) {
- void 0 === o && (o = !1);
- var n, a, r = rc(t), l = rc(t) && function(e) {
- var t = e.getBoundingClientRect()
- , o = ic(t.width) / e.offsetWidth || 1
- , n = ic(t.height) / e.offsetHeight || 1;
- return 1 !== o || 1 !== n
- }(t), i = pc(t), s = cc(e, l, o), c = {
- scrollLeft: 0,
- scrollTop: 0
- }, d = {
- x: 0,
- y: 0
- };
- return (r || !r && !o) && (("body" !== uc(t) || fc(i)) && (c = (n = t) !== nc(n) && rc(n) ? {
- scrollLeft: (a = n).scrollLeft,
- scrollTop: a.scrollTop
- } : dc(n)),
- rc(t) ? ((d = cc(t, !0)).x += t.clientLeft,
- d.y += t.clientTop) : i && (d.x = function(e) {
- return cc(pc(e)).left + dc(e).scrollLeft
- }(i))),
- {
- x: s.left + c.scrollLeft - d.x,
- y: s.top + c.scrollTop - d.y,
- width: s.width,
- height: s.height
- }
- }
- function hc(e) {
- return "html" === uc(e) ? e : e.assignedSlot || e.parentNode || (lc(e) ? e.host : null) || pc(e)
- }
- function gc(e) {
- return ["html", "body", "#document"].indexOf(uc(e)) >= 0 ? e.ownerDocument.body : rc(e) && fc(e) ? e : gc(hc(e))
- }
- function bc(e, t) {
- var o;
- void 0 === t && (t = []);
- var n = gc(e)
- , a = n === (null == (o = e.ownerDocument) ? void 0 : o.body)
- , r = nc(n)
- , l = a ? [r].concat(r.visualViewport || [], fc(n) ? n : []) : n
- , i = t.concat(l);
- return a ? i : i.concat(bc(hc(l)))
- }
- function yc(e) {
- return ["table", "td", "th"].indexOf(uc(e)) >= 0
- }
- function wc(e) {
- return rc(e) && "fixed" !== mc(e).position ? e.offsetParent : null
- }
- function Vc(e) {
- for (var t = nc(e), o = wc(e); o && yc(o) && "static" === mc(o).position; )
- o = wc(o);
- return o && ("html" === uc(o) || "body" === uc(o) && "static" === mc(o).position) ? t : o || function(e) {
- var t = /firefox/i.test(sc());
- if (/Trident/i.test(sc()) && rc(e) && "fixed" === mc(e).position)
- return null;
- var o = hc(e);
- for (lc(o) && (o = o.host); rc(o) && ["html", "body"].indexOf(uc(o)) < 0; ) {
- var n = mc(o);
- if ("none" !== n.transform || "none" !== n.perspective || "paint" === n.contain || -1 !== ["transform", "perspective"].indexOf(n.willChange) || t && "filter" === n.willChange || t && n.filter && "none" !== n.filter)
- return o;
- o = o.parentNode
- }
- return null
- }(e) || t
- }
- var xc = "top"
- , Nc = "bottom"
- , Cc = "right"
- , kc = "left"
- , Sc = "auto"
- , Bc = "start"
- , Tc = "end"
- , Pc = [].concat([xc, Nc, Cc, kc], [Sc]).reduce((function(e, t) {
- return e.concat([t, t + "-" + Bc, t + "-" + Tc])
- }
- ), [])
- , Dc = ["beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite"];
- function Oc(e) {
- var t = new Map
- , o = new Set
- , n = [];
- function a(e) {
- o.add(e.name),
- [].concat(e.requires || [], e.requiresIfExists || []).forEach((function(e) {
- if (!o.has(e)) {
- var n = t.get(e);
- n && a(n)
- }
- }
- )),
- n.push(e)
- }
- return e.forEach((function(e) {
- t.set(e.name, e)
- }
- )),
- e.forEach((function(e) {
- o.has(e.name) || a(e)
- }
- )),
- n
- }
- function Ic(e) {
- for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
- o[n - 1] = arguments[n];
- return [].concat(o).reduce((function(e, t) {
- return e.replace(/%s/, t)
- }
- ), e)
- }
- var Ac = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'
- , zc = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
- function Ec(e) {
- return e.split("-")[0]
- }
- function $c(e) {
- return e.split("-")[1]
- }
- var Lc = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element."
- , Mc = {
- placement: "bottom",
- modifiers: [],
- strategy: "absolute"
- };
- function Fc() {
- for (var e = arguments.length, t = new Array(e), o = 0; o < e; o++)
- t[o] = arguments[o];
- return !t.some((function(e) {
- return !(e && "function" == typeof e.getBoundingClientRect)
- }
- ))
- }
- function Rc(e) {
- void 0 === e && (e = {});
- var t = e
- , o = t.defaultModifiers
- , n = void 0 === o ? [] : o
- , a = t.defaultOptions
- , r = void 0 === a ? Mc : a;
- return function(e, t, o) {
- void 0 === o && (o = r);
- var a, l, i = {
- placement: "bottom",
- orderedModifiers: [],
- options: Object.assign({}, Mc, r),
- modifiersData: {},
- elements: {
- reference: e,
- popper: t
- },
- attributes: {},
- styles: {}
- }, s = [], c = !1, d = {
- state: i,
- setOptions: function(o) {
- var a = "function" == typeof o ? o(i.options) : o;
- u(),
- i.options = Object.assign({}, r, i.options, a),
- i.scrollParents = {
- reference: ac(e) ? bc(e) : e.contextElement ? bc(e.contextElement) : [],
- popper: bc(t)
- };
- var l = function(e) {
- var t = Oc(e);
- return Dc.reduce((function(e, o) {
- return e.concat(t.filter((function(e) {
- return e.phase === o
- }
- )))
- }
- ), [])
- }(function(e) {
- var t = e.reduce((function(e, t) {
- var o = e[t.name];
- return e[t.name] = o ? Object.assign({}, o, t, {
- options: Object.assign({}, o.options, t.options),
- data: Object.assign({}, o.data, t.data)
- }) : t,
- e
- }
- ), {});
- return Object.keys(t).map((function(e) {
- return t[e]
- }
- ))
- }([].concat(n, i.options.modifiers)));
- (i.orderedModifiers = l.filter((function(e) {
- return e.enabled
- }
- )),
- function(e) {
- e.forEach((function(t) {
- [].concat(Object.keys(t), zc).filter((function(e, t, o) {
- return o.indexOf(e) === t
- }
- )).forEach((function(o) {
- switch (o) {
- case "name":
- "string" != typeof t.name && console.error(Ic(Ac, String(t.name), '"name"', '"string"', '"' + String(t.name) + '"'));
- break;
- case "enabled":
- "boolean" != typeof t.enabled && console.error(Ic(Ac, t.name, '"enabled"', '"boolean"', '"' + String(t.enabled) + '"'));
- break;
- case "phase":
- Dc.indexOf(t.phase) < 0 && console.error(Ic(Ac, t.name, '"phase"', "either " + Dc.join(", "), '"' + String(t.phase) + '"'));
- break;
- case "fn":
- "function" != typeof t.fn && console.error(Ic(Ac, t.name, '"fn"', '"function"', '"' + String(t.fn) + '"'));
- break;
- case "effect":
- null != t.effect && "function" != typeof t.effect && console.error(Ic(Ac, t.name, '"effect"', '"function"', '"' + String(t.fn) + '"'));
- break;
- case "requires":
- null == t.requires || Array.isArray(t.requires) || console.error(Ic(Ac, t.name, '"requires"', '"array"', '"' + String(t.requires) + '"'));
- break;
- case "requiresIfExists":
- Array.isArray(t.requiresIfExists) || console.error(Ic(Ac, t.name, '"requiresIfExists"', '"array"', '"' + String(t.requiresIfExists) + '"'));
- break;
- case "options":
- case "data":
- break;
- default:
- console.error('PopperJS: an invalid property has been provided to the "' + t.name + '" modifier, valid properties are ' + zc.map((function(e) {
- return '"' + e + '"'
- }
- )).join(", ") + '; but "' + o + '" was provided.')
- }
- t.requires && t.requires.forEach((function(o) {
- null == e.find((function(e) {
- return e.name === o
- }
- )) && console.error(Ic('Popper: modifier "%s" requires "%s", but "%s" modifier is not available', String(t.name), o, o))
- }
- ))
- }
- ))
- }
- ))
- }((c = [].concat(l, i.options.modifiers),
- p = function(e) {
- return e.name
- }
- ,
- m = new Set,
- c.filter((function(e) {
- var t = p(e);
- if (!m.has(t))
- return m.add(t),
- !0
- }
- )))),
- Ec(i.options.placement) === Sc) && (i.orderedModifiers.find((function(e) {
- return "flip" === e.name
- }
- )) || console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" ")));
- var c, p, m, f = mc(t);
- return [f.marginTop, f.marginRight, f.marginBottom, f.marginLeft].some((function(e) {
- return parseFloat(e)
- }
- )) && console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" ")),
- i.orderedModifiers.forEach((function(e) {
- var t = e.name
- , o = e.options
- , n = void 0 === o ? {} : o
- , a = e.effect;
- if ("function" == typeof a) {
- var r = a({
- state: i,
- name: t,
- instance: d,
- options: n
- })
- , l = function() {};
- s.push(r || l)
- }
- }
- )),
- d.update()
- },
- forceUpdate: function() {
- if (!c) {
- var e = i.elements
- , t = e.reference
- , o = e.popper;
- if (Fc(t, o)) {
- var n, a, r, l;
- i.rects = {
- reference: vc(t, Vc(o), "fixed" === i.options.strategy),
- popper: (n = o,
- a = cc(n),
- r = n.offsetWidth,
- l = n.offsetHeight,
- Math.abs(a.width - r) <= 1 && (r = a.width),
- Math.abs(a.height - l) <= 1 && (l = a.height),
- {
- x: n.offsetLeft,
- y: n.offsetTop,
- width: r,
- height: l
- })
- },
- i.reset = !1,
- i.placement = i.options.placement,
- i.orderedModifiers.forEach((function(e) {
- return i.modifiersData[e.name] = Object.assign({}, e.data)
- }
- ));
- for (var s = 0, u = 0; u < i.orderedModifiers.length; u++) {
- if ((s += 1) > 100) {
- console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");
- break
- }
- if (!0 !== i.reset) {
- var p = i.orderedModifiers[u]
- , m = p.fn
- , f = p.options
- , v = void 0 === f ? {} : f
- , h = p.name;
- "function" == typeof m && (i = m({
- state: i,
- options: v,
- name: h,
- instance: d
- }) || i)
- } else
- i.reset = !1,
- u = -1
- }
- } else
- console.error(Lc)
- }
- },
- update: (a = function() {
- return new Promise((function(e) {
- d.forceUpdate(),
- e(i)
- }
- ))
- }
- ,
- function() {
- return l || (l = new Promise((function(e) {
- Promise.resolve().then((function() {
- l = void 0,
- e(a())
- }
- ))
- }
- ))),
- l
- }
- ),
- destroy: function() {
- u(),
- c = !0
- }
- };
- if (!Fc(e, t))
- return console.error(Lc),
- d;
- function u() {
- s.forEach((function(e) {
- return e()
- }
- )),
- s = []
- }
- return d.setOptions(o).then((function(e) {
- !c && o.onFirstUpdate && o.onFirstUpdate(e)
- }
- )),
- d
- }
- }
- var Hc = {
- passive: !0
- };
- var jc = {
- top: "auto",
- right: "auto",
- bottom: "auto",
- left: "auto"
- };
- function Wc(e) {
- var t, o = e.popper, n = e.popperRect, a = e.placement, r = e.variation, l = e.offsets, i = e.position, s = e.gpuAcceleration, c = e.adaptive, d = e.roundOffsets, u = e.isFixed, p = l.x, m = void 0 === p ? 0 : p, f = l.y, v = void 0 === f ? 0 : f, h = "function" == typeof d ? d({
- x: m,
- y: v
- }) : {
- x: m,
- y: v
- };
- m = h.x,
- v = h.y;
- var g = l.hasOwnProperty("x")
- , b = l.hasOwnProperty("y")
- , y = kc
- , w = xc
- , V = window;
- if (c) {
- var x = Vc(o)
- , N = "clientHeight"
- , C = "clientWidth";
- if (x === nc(o) && "static" !== mc(x = pc(o)).position && "absolute" === i && (N = "scrollHeight",
- C = "scrollWidth"),
- a === xc || (a === kc || a === Cc) && r === Tc)
- w = Nc,
- v -= (u && x === V && V.visualViewport ? V.visualViewport.height : x[N]) - n.height,
- v *= s ? 1 : -1;
- if (a === kc || (a === xc || a === Nc) && r === Tc)
- y = Cc,
- m -= (u && x === V && V.visualViewport ? V.visualViewport.width : x[C]) - n.width,
- m *= s ? 1 : -1
- }
- var k, S = Object.assign({
- position: i
- }, c && jc), B = !0 === d ? function(e) {
- var t = e.x
- , o = e.y
- , n = window.devicePixelRatio || 1;
- return {
- x: ic(t * n) / n || 0,
- y: ic(o * n) / n || 0
- }
- }({
- x: m,
- y: v
- }) : {
- x: m,
- y: v
- };
- return m = B.x,
- v = B.y,
- s ? Object.assign({}, S, ((k = {})[w] = b ? "0" : "",
- k[y] = g ? "0" : "",
- k.transform = (V.devicePixelRatio || 1) <= 1 ? "translate(" + m + "px, " + v + "px)" : "translate3d(" + m + "px, " + v + "px, 0)",
- k)) : Object.assign({}, S, ((t = {})[w] = b ? v + "px" : "",
- t[y] = g ? m + "px" : "",
- t.transform = "",
- t))
- }
- var Uc = Rc({
- defaultModifiers: [{
- name: "eventListeners",
- enabled: !0,
- phase: "write",
- fn: function() {},
- effect: function(e) {
- var t = e.state
- , o = e.instance
- , n = e.options
- , a = n.scroll
- , r = void 0 === a || a
- , l = n.resize
- , i = void 0 === l || l
- , s = nc(t.elements.popper)
- , c = [].concat(t.scrollParents.reference, t.scrollParents.popper);
- return r && c.forEach((function(e) {
- e.addEventListener("scroll", o.update, Hc)
- }
- )),
- i && s.addEventListener("resize", o.update, Hc),
- function() {
- r && c.forEach((function(e) {
- e.removeEventListener("scroll", o.update, Hc)
- }
- )),
- i && s.removeEventListener("resize", o.update, Hc)
- }
- },
- data: {}
- }, {
- name: "popperOffsets",
- enabled: !0,
- phase: "read",
- fn: function(e) {
- var t = e.state
- , o = e.name;
- t.modifiersData[o] = function(e) {
- var t, o = e.reference, n = e.element, a = e.placement, r = a ? Ec(a) : null, l = a ? $c(a) : null, i = o.x + o.width / 2 - n.width / 2, s = o.y + o.height / 2 - n.height / 2;
- switch (r) {
- case xc:
- t = {
- x: i,
- y: o.y - n.height
- };
- break;
- case Nc:
- t = {
- x: i,
- y: o.y + o.height
- };
- break;
- case Cc:
- t = {
- x: o.x + o.width,
- y: s
- };
- break;
- case kc:
- t = {
- x: o.x - n.width,
- y: s
- };
- break;
- default:
- t = {
- x: o.x,
- y: o.y
- }
- }
- var c = r ? function(e) {
- return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y"
- }(r) : null;
- if (null != c) {
- var d = "y" === c ? "height" : "width";
- switch (l) {
- case Bc:
- t[c] = t[c] - (o[d] / 2 - n[d] / 2);
- break;
- case Tc:
- t[c] = t[c] + (o[d] / 2 - n[d] / 2)
- }
- }
- return t
- }({
- reference: t.rects.reference,
- element: t.rects.popper,
- strategy: "absolute",
- placement: t.placement
- })
- },
- data: {}
- }, {
- name: "computeStyles",
- enabled: !0,
- phase: "beforeWrite",
- fn: function(e) {
- var t = e.state
- , o = e.options
- , n = o.gpuAcceleration
- , a = void 0 === n || n
- , r = o.adaptive
- , l = void 0 === r || r
- , i = o.roundOffsets
- , s = void 0 === i || i
- , c = mc(t.elements.popper).transitionProperty || "";
- l && ["transform", "top", "right", "bottom", "left"].some((function(e) {
- return c.indexOf(e) >= 0
- }
- )) && console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
- var d = {
- placement: Ec(t.placement),
- variation: $c(t.placement),
- popper: t.elements.popper,
- popperRect: t.rects.popper,
- gpuAcceleration: a,
- isFixed: "fixed" === t.options.strategy
- };
- null != t.modifiersData.popperOffsets && (t.styles.popper = Object.assign({}, t.styles.popper, Wc(Object.assign({}, d, {
- offsets: t.modifiersData.popperOffsets,
- position: t.options.strategy,
- adaptive: l,
- roundOffsets: s
- })))),
- null != t.modifiersData.arrow && (t.styles.arrow = Object.assign({}, t.styles.arrow, Wc(Object.assign({}, d, {
- offsets: t.modifiersData.arrow,
- position: "absolute",
- adaptive: !1,
- roundOffsets: s
- })))),
- t.attributes.popper = Object.assign({}, t.attributes.popper, {
- "data-popper-placement": t.placement
- })
- },
- data: {}
- }, {
- name: "applyStyles",
- enabled: !0,
- phase: "write",
- fn: function(e) {
- var t = e.state;
- Object.keys(t.elements).forEach((function(e) {
- var o = t.styles[e] || {}
- , n = t.attributes[e] || {}
- , a = t.elements[e];
- rc(a) && uc(a) && (Object.assign(a.style, o),
- Object.keys(n).forEach((function(e) {
- var t = n[e];
- !1 === t ? a.removeAttribute(e) : a.setAttribute(e, !0 === t ? "" : t)
- }
- )))
- }
- ))
- },
- effect: function(e) {
- var t = e.state
- , o = {
- popper: {
- position: t.options.strategy,
- left: "0",
- top: "0",
- margin: "0"
- },
- arrow: {
- position: "absolute"
- },
- reference: {}
- };
- return Object.assign(t.elements.popper.style, o.popper),
- t.styles = o,
- t.elements.arrow && Object.assign(t.elements.arrow.style, o.arrow),
- function() {
- Object.keys(t.elements).forEach((function(e) {
- var n = t.elements[e]
- , a = t.attributes[e] || {}
- , r = Object.keys(t.styles.hasOwnProperty(e) ? t.styles[e] : o[e]).reduce((function(e, t) {
- return e[t] = "",
- e
- }
- ), {});
- rc(n) && uc(n) && (Object.assign(n.style, r),
- Object.keys(a).forEach((function(e) {
- n.removeAttribute(e)
- }
- )))
- }
- ))
- }
- },
- requires: ["computeStyles"]
- }]
- });
- var qc = {
- name: "offset",
- enabled: !0,
- phase: "main",
- requires: ["popperOffsets"],
- fn: function(e) {
- var t = e.state
- , o = e.options
- , n = e.name
- , a = o.offset
- , r = void 0 === a ? [0, 0] : a
- , l = Pc.reduce((function(e, o) {
- return e[o] = function(e, t, o) {
- var n = Ec(e)
- , a = [kc, xc].indexOf(n) >= 0 ? -1 : 1
- , r = "function" == typeof o ? o(Object.assign({}, t, {
- placement: e
- })) : o
- , l = r[0]
- , i = r[1];
- return l = l || 0,
- i = (i || 0) * a,
- [kc, Cc].indexOf(n) >= 0 ? {
- x: i,
- y: l
- } : {
- x: l,
- y: i
- }
- }(o, t.rects, r),
- e
- }
- ), {})
- , i = l[t.placement]
- , s = i.x
- , c = i.y;
- null != t.modifiersData.popperOffsets && (t.modifiersData.popperOffsets.x += s,
- t.modifiersData.popperOffsets.y += c),
- t.modifiersData[n] = l
- }
- };
- const [Yc,Gc] = Oe("popover")
- , Xc = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"]
- , Zc = {
- show: Boolean,
- theme: N("light"),
- overlay: Boolean,
- actions: w(),
- trigger: N("click"),
- duration: g,
- showArrow: b,
- placement: N("bottom"),
- iconPrefix: String,
- overlayClass: h,
- overlayStyle: Object,
- closeOnClickAction: b,
- closeOnClickOverlay: b,
- closeOnClickOutside: b,
- offset: {
- type: Array,
- default: ()=>[0, 8]
- },
- teleport: {
- type: [String, Object],
- default: "body"
- }
- };
- const Kc = je(t.defineComponent({
- name: Yc,
- props: Zc,
- emits: ["select", "touchstart", "update:show"],
- setup(e, {emit: o, slots: n, attrs: a}) {
- let r;
- const l = t.ref()
- , i = t.ref()
- , s = t.ref()
- , c = ((e,o)=>{
- const n = t.ref(e());
- return t.watch(e, (e=>{
- e !== n.value && (n.value = e)
- }
- )),
- t.watch(n, (t=>{
- t !== e() && o(t)
- }
- )),
- n
- }
- )((()=>e.show), (e=>o("update:show", e)))
- , u = ()=>({
- placement: e.placement,
- modifiers: [{
- name: "computeStyles",
- options: {
- adaptive: !1,
- gpuAcceleration: !1
- }
- }, d({}, qc, {
- options: {
- offset: e.offset
- }
- })]
- })
- , p = ()=>{
- t.nextTick((()=>{
- c.value && (r ? r.setOptions(u()) : r = i.value && s.value ? Uc(i.value, s.value.popupRef.value, u()) : null)
- }
- ))
- }
- , f = e=>{
- c.value = e
- }
- , v = ()=>{
- "click" === e.trigger && (c.value = !c.value)
- }
- , h = (o,a)=>n.action ? n.action({
- action: o,
- index: a
- }) : [o.icon && t.createVNode(vt, {
- name: o.icon,
- classPrefix: e.iconPrefix,
- class: Gc("action-icon")
- }, null), t.createVNode("div", {
- class: [Gc("action-text"), Ee]
- }, [o.text])]
- , g = (n,a)=>{
- const {icon: r, color: l, disabled: i, className: s} = n;
- return t.createVNode("div", {
- role: "menuitem",
- class: [Gc("action", {
- disabled: i,
- "with-icon": r
- }), s],
- style: {
- color: l
- },
- tabindex: i ? void 0 : 0,
- "aria-disabled": i || void 0,
- onClick: ()=>((t,n)=>{
- t.disabled || (o("select", t, n),
- e.closeOnClickAction && (c.value = !1))
- }
- )(n, a)
- }, [h(n, a)])
- }
- ;
- return t.onMounted((()=>{
- p(),
- t.watchEffect((()=>{
- var e;
- l.value = null == (e = s.value) ? void 0 : e.popupRef.value
- }
- ))
- }
- )),
- t.onBeforeUnmount((()=>{
- r && (r.destroy(),
- r = null)
- }
- )),
- t.watch((()=>[c.value, e.offset, e.placement]), p),
- j([i, l], (()=>{
- c.value && e.closeOnClickOutside && (!e.overlay || e.closeOnClickOverlay) && (c.value = !1)
- }
- ), {
- eventName: "touchstart"
- }),
- ()=>{
- var o;
- return t.createVNode(t.Fragment, null, [t.createVNode("span", {
- ref: i,
- class: Gc("wrapper"),
- onClick: v
- }, [null == (o = n.reference) ? void 0 : o.call(n)]), t.createVNode(Gt, t.mergeProps({
- ref: s,
- show: c.value,
- class: Gc([e.theme]),
- position: "",
- transition: "van-popover-zoom",
- lockScroll: !1,
- "onUpdate:show": f
- }, a, m(e, Xc)), {
- default: ()=>[e.showArrow && t.createVNode("div", {
- class: Gc("arrow")
- }, null), t.createVNode("div", {
- role: "menu",
- class: Gc("content")
- }, [n.default ? n.default() : e.actions.map(g)])]
- })])
- }
- }
- }))
- , [_c,Jc] = Oe("progress")
- , Qc = {
- color: String,
- inactive: Boolean,
- pivotText: String,
- textColor: String,
- showPivot: b,
- pivotColor: String,
- trackColor: String,
- strokeWidth: g,
- percentage: {
- type: g,
- default: 0,
- validator: e=>e >= 0 && e <= 100
- }
- };
- const ed = je(t.defineComponent({
- name: _c,
- props: Qc,
- setup(e) {
- const o = t.computed((()=>e.inactive ? void 0 : e.color))
- , n = ()=>{
- const {textColor: n, pivotText: a, pivotColor: r, percentage: l} = e
- , i = null != a ? a : `${l}%`;
- if (e.showPivot && i) {
- const a = {
- color: n,
- left: +l + "%",
- transform: `translate(-${+l}%,-50%)`,
- background: r || o.value
- };
- return t.createVNode("span", {
- style: a,
- class: Jc("pivot", {
- inactive: e.inactive
- })
- }, [i])
- }
- }
- ;
- return ()=>{
- const {trackColor: a, percentage: r, strokeWidth: l} = e
- , i = {
- background: a,
- height: ce(l)
- }
- , s = {
- width: `${r}%`,
- background: o.value
- };
- return t.createVNode("div", {
- class: Jc(),
- style: i
- }, [t.createVNode("span", {
- class: Jc("portion", {
- inactive: e.inactive
- }),
- style: s
- }, null), n()])
- }
- }
- }))
- , [td,od,nd] = Oe("pull-refresh")
- , ad = ["pulling", "loosing", "success"]
- , rd = {
- disabled: Boolean,
- modelValue: Boolean,
- headHeight: x(50),
- successText: String,
- pullingText: String,
- loosingText: String,
- loadingText: String,
- pullDistance: g,
- successDuration: x(500),
- animationDuration: x(300)
- };
- const ld = je(t.defineComponent({
- name: td,
- props: rd,
- emits: ["change", "refresh", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- let a;
- const r = t.ref()
- , l = t.ref()
- , i = X(r)
- , s = t.reactive({
- status: "normal",
- distance: 0,
- duration: 0
- })
- , c = $t()
- , d = ()=>{
- if (50 !== e.headHeight)
- return {
- height: `${e.headHeight}px`
- }
- }
- , u = ()=>"loading" !== s.status && "success" !== s.status && !e.disabled
- , p = (t,n)=>{
- const a = +(e.pullDistance || e.headHeight);
- s.distance = t,
- s.status = n ? "loading" : 0 === t ? "normal" : t < a ? "pulling" : "loosing",
- o("change", {
- status: s.status,
- distance: t
- })
- }
- , m = ()=>{
- const {status: t} = s;
- return "normal" === t ? "" : e[`${t}Text`] || nd(t)
- }
- , f = ()=>{
- const {status: e, distance: o} = s;
- if (n[e])
- return n[e]({
- distance: o
- });
- const a = [];
- return ad.includes(e) && a.push(t.createVNode("div", {
- class: od("text")
- }, [m()])),
- "loading" === e && a.push(t.createVNode(Vt, {
- class: od("loading")
- }, {
- default: m
- })),
- a
- }
- , v = e=>{
- a = 0 === _(i.value),
- a && (s.duration = 0,
- c.start(e))
- }
- , h = e=>{
- u() && v(e)
- }
- , g = ()=>{
- a && c.deltaY.value && u() && (s.duration = +e.animationDuration,
- "loosing" === s.status ? (p(+e.headHeight, !0),
- o("update:modelValue", !0),
- t.nextTick((()=>o("refresh")))) : p(0))
- }
- ;
- return t.watch((()=>e.modelValue), (t=>{
- s.duration = +e.animationDuration,
- t ? p(+e.headHeight, !0) : n.success || e.successText ? (s.status = "success",
- setTimeout((()=>{
- p(0)
- }
- ), +e.successDuration)) : p(0, !1)
- }
- )),
- H("touchmove", (t=>{
- if (u()) {
- a || v(t);
- const {deltaY: o} = c;
- c.move(t),
- a && o.value >= 0 && c.isVertical() && (re(t),
- p((t=>{
- const o = +(e.pullDistance || e.headHeight);
- return t > o && (t = t < 2 * o ? o + (t - o) / 2 : 1.5 * o + (t - 2 * o) / 4),
- Math.round(t)
- }
- )(o.value)))
- }
- }
- ), {
- target: l
- }),
- ()=>{
- var e;
- const o = {
- transitionDuration: `${s.duration}ms`,
- transform: s.distance ? `translate3d(0,${s.distance}px, 0)` : ""
- };
- return t.createVNode("div", {
- ref: r,
- class: od()
- }, [t.createVNode("div", {
- ref: l,
- class: od("track"),
- style: o,
- onTouchstartPassive: h,
- onTouchend: g,
- onTouchcancel: g
- }, [t.createVNode("div", {
- class: od("head"),
- style: d()
- }, [f()]), null == (e = n.default) ? void 0 : e.call(n)])])
- }
- }
- }))
- , [id,sd] = Oe("rate");
- const cd = {
- size: g,
- icon: N("star"),
- color: String,
- count: x(5),
- gutter: g,
- readonly: Boolean,
- disabled: Boolean,
- voidIcon: N("star-o"),
- allowHalf: Boolean,
- voidColor: String,
- touchable: b,
- iconPrefix: String,
- modelValue: V(0),
- disabledColor: String
- };
- const dd = je(t.defineComponent({
- name: id,
- props: cd,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o}) {
- const n = $t()
- , [a,r] = bo()
- , l = t.ref()
- , i = ()=>e.readonly || e.disabled || !e.touchable
- , s = t.computed((()=>Array(+e.count).fill("").map(((t,o)=>function(e, t, o, n) {
- if (e >= t)
- return {
- status: "full",
- value: 1
- };
- if (e + .5 >= t && o && !n)
- return {
- status: "half",
- value: .5
- };
- if (e + 1 >= t && o && n) {
- const o = 10 ** 10;
- return {
- status: "half",
- value: Math.round((e - t + 1) * o) / o
- }
- }
- return {
- status: "void",
- value: 0
- }
- }(e.modelValue, o + 1, e.allowHalf, e.readonly)))));
- let c, d, u = Number.MAX_SAFE_INTEGER, p = Number.MIN_SAFE_INTEGER;
- const m = ()=>{
- d = P(l);
- const t = a.value.map(P);
- c = [],
- t.forEach(((t,o)=>{
- u = Math.min(t.top, u),
- p = Math.max(t.top, p),
- e.allowHalf ? c.push({
- score: o + .5,
- left: t.left,
- top: t.top,
- height: t.height
- }, {
- score: o + 1,
- left: t.left + t.width / 2,
- top: t.top,
- height: t.height
- }) : c.push({
- score: o + 1,
- left: t.left,
- top: t.top,
- height: t.height
- })
- }
- ))
- }
- , f = (t,o)=>{
- for (let e = c.length - 1; e > 0; e--)
- if (o >= d.top && o <= d.bottom) {
- if (t > c[e].left && o >= c[e].top && o <= c[e].top + c[e].height)
- return c[e].score
- } else {
- const n = o < d.top ? u : p;
- if (t > c[e].left && c[e].top === n)
- return c[e].score
- }
- return e.allowHalf ? .5 : 1
- }
- , v = t=>{
- e.disabled || e.readonly || t === e.modelValue || (o("update:modelValue", t),
- o("change", t))
- }
- , h = e=>{
- i() || (n.start(e),
- m())
- }
- , g = (o,n)=>{
- const {icon: a, size: l, color: i, count: s, gutter: c, voidIcon: d, disabled: u, voidColor: p, allowHalf: h, iconPrefix: g, disabledColor: b} = e
- , y = n + 1
- , w = "full" === o.status
- , V = "void" === o.status
- , x = h && o.value > 0 && o.value < 1;
- let N;
- c && y !== +s && (N = {
- paddingRight: ce(c)
- });
- return t.createVNode("div", {
- key: n,
- ref: r(n),
- role: "radio",
- style: N,
- class: sd("item"),
- tabindex: u ? void 0 : 0,
- "aria-setsize": s,
- "aria-posinset": y,
- "aria-checked": !V,
- onClick: e=>{
- m(),
- v(h ? f(e.clientX, e.clientY) : y)
- }
- }, [t.createVNode(vt, {
- size: l,
- name: w ? a : d,
- class: sd("icon", {
- disabled: u,
- full: w
- }),
- color: u ? b : w ? i : p,
- classPrefix: g
- }, null), x && t.createVNode(vt, {
- size: l,
- style: {
- width: o.value + "em"
- },
- name: V ? d : a,
- class: sd("icon", ["half", {
- disabled: u,
- full: !V
- }]),
- color: u ? b : V ? p : i,
- classPrefix: g
- }, null)])
- }
- ;
- return K((()=>e.modelValue)),
- H("touchmove", (e=>{
- if (!i() && (n.move(e),
- n.isHorizontal())) {
- const {clientX: t, clientY: o} = e.touches[0];
- re(e),
- v(f(t, o))
- }
- }
- ), {
- target: l
- }),
- ()=>t.createVNode("div", {
- ref: l,
- role: "radiogroup",
- class: sd({
- readonly: e.readonly,
- disabled: e.disabled
- }),
- tabindex: e.disabled ? void 0 : 0,
- "aria-disabled": e.disabled,
- "aria-readonly": e.readonly,
- onTouchstartPassive: h
- }, [s.value.map(g)])
- }
- }))
- , ud = je(ll)
- , [pd,md,fd] = Oe("search")
- , vd = d({}, Pn, {
- label: String,
- shape: N("square"),
- leftIcon: N("search"),
- clearable: b,
- actionText: String,
- background: String,
- showAction: Boolean
- });
- const hd = je(t.defineComponent({
- name: pd,
- props: vd,
- emits: ["blur", "focus", "clear", "search", "cancel", "clickInput", "clickLeftIcon", "clickRightIcon", "update:modelValue"],
- setup(e, {emit: o, slots: n, attrs: a}) {
- const r = go()
- , l = t.ref()
- , i = ()=>{
- n.action || (o("update:modelValue", ""),
- o("cancel"))
- }
- , s = t=>{
- 13 === t.keyCode && (re(t),
- o("search", e.modelValue))
- }
- , c = ()=>e.id || `${r}-input`
- , u = ()=>{
- if (n.label || e.label)
- return t.createVNode("label", {
- class: md("label"),
- for: c()
- }, [n.label ? n.label() : e.label])
- }
- , p = ()=>{
- if (e.showAction) {
- const o = e.actionText || fd("cancel");
- return t.createVNode("div", {
- class: md("action"),
- role: "button",
- tabindex: 0,
- onClick: i
- }, [n.action ? n.action() : o])
- }
- }
- , f = e=>o("blur", e)
- , v = e=>o("focus", e)
- , h = e=>o("clear", e)
- , g = e=>o("clickInput", e)
- , b = e=>o("clickLeftIcon", e)
- , y = e=>o("clickRightIcon", e)
- , w = Object.keys(Pn)
- , V = ()=>{
- const r = d({}, a, m(e, w), {
- id: c()
- });
- return t.createVNode(On, t.mergeProps({
- ref: l,
- type: "search",
- class: md("field"),
- border: !1,
- onBlur: f,
- onFocus: v,
- onClear: h,
- onKeypress: s,
- onClickInput: g,
- onClickLeftIcon: b,
- onClickRightIcon: y,
- "onUpdate:modelValue": e=>o("update:modelValue", e)
- }, r), m(n, ["left-icon", "right-icon"]))
- }
- ;
- return Je({
- focus: ()=>{
- var e;
- return null == (e = l.value) ? void 0 : e.focus()
- }
- ,
- blur: ()=>{
- var e;
- return null == (e = l.value) ? void 0 : e.blur()
- }
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: md({
- "show-action": e.showAction
- }),
- style: {
- background: e.background
- }
- }, [null == (o = n.left) ? void 0 : o.call(n), t.createVNode("div", {
- class: md("content", e.shape)
- }, [u(), V()]), p()])
- }
- }
- }))
- , gd = [...Et, "round", "closeOnPopstate", "safeAreaInsetBottom"]
- , bd = {
- qq: "qq",
- link: "link-o",
- weibo: "weibo",
- qrcode: "qr",
- poster: "photo-o",
- wechat: "wechat",
- "weapp-qrcode": "miniprogram-o",
- "wechat-moments": "wechat-moments"
- }
- , [yd,wd,Vd] = Oe("share-sheet")
- , xd = d({}, zt, {
- title: String,
- round: b,
- options: w(),
- cancelText: String,
- description: String,
- closeOnPopstate: b,
- safeAreaInsetBottom: b
- });
- const Nd = je(t.defineComponent({
- name: yd,
- props: xd,
- emits: ["cancel", "select", "update:show"],
- setup(e, {emit: o, slots: n}) {
- const a = e=>o("update:show", e)
- , r = ()=>{
- a(!1),
- o("cancel")
- }
- , l = ()=>{
- const o = n.title ? n.title() : e.title
- , a = n.description ? n.description() : e.description;
- if (o || a)
- return t.createVNode("div", {
- class: wd("header")
- }, [o && t.createVNode("h2", {
- class: wd("title")
- }, [o]), a && t.createVNode("span", {
- class: wd("description")
- }, [a])])
- }
- , i = e=>bd[e] ? t.createVNode("div", {
- class: wd("icon", [e])
- }, [t.createVNode(vt, {
- name: bd[e] || e
- }, null)]) : t.createVNode("img", {
- src: e,
- class: wd("image-icon")
- }, null)
- , s = (e,n)=>{
- const {name: a, icon: r, className: l, description: s} = e;
- return t.createVNode("div", {
- role: "button",
- tabindex: 0,
- class: [wd("option"), l, Fe],
- onClick: ()=>((e,t)=>o("select", e, t))(e, n)
- }, [i(r), a && t.createVNode("span", {
- class: wd("name")
- }, [a]), s && t.createVNode("span", {
- class: wd("option-description")
- }, [s])])
- }
- , c = (e,o)=>t.createVNode("div", {
- class: wd("options", {
- border: o
- })
- }, [e.map(s)])
- , d = ()=>{
- const {options: t} = e;
- return Array.isArray(t[0]) ? t.map(((e,t)=>c(e, 0 !== t))) : c(t)
- }
- , u = ()=>{
- var o;
- const a = null != (o = e.cancelText) ? o : Vd("cancel");
- if (n.cancel || a)
- return t.createVNode("button", {
- type: "button",
- class: wd("cancel"),
- onClick: r
- }, [n.cancel ? n.cancel() : a])
- }
- ;
- return ()=>t.createVNode(Gt, t.mergeProps({
- class: wd(),
- position: "bottom",
- "onUpdate:show": a
- }, m(e, gd)), {
- default: ()=>[l(), d(), u()]
- })
- }
- }))
- , [Cd,kd] = Oe("sidebar")
- , Sd = Symbol(Cd)
- , Bd = {
- modelValue: x(0)
- };
- const Td = je(t.defineComponent({
- name: Cd,
- props: Bd,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const {linkChildren: a} = I(Sd)
- , r = ()=>+e.modelValue;
- return a({
- getActive: r,
- setActive: e=>{
- e !== r() && (o("update:modelValue", e),
- o("change", e))
- }
- }),
- ()=>{
- var e;
- return t.createVNode("div", {
- role: "tablist",
- class: kd()
- }, [null == (e = n.default) ? void 0 : e.call(n)])
- }
- }
- }))
- , [Pd,Dd] = Oe("sidebar-item")
- , Od = d({}, Qe, {
- dot: Boolean,
- title: String,
- badge: g,
- disabled: Boolean,
- badgeProps: Object
- });
- const Id = je(t.defineComponent({
- name: Pd,
- props: Od,
- emits: ["click"],
- setup(e, {emit: o, slots: n}) {
- const a = tt()
- , {parent: r, index: l} = D(Sd);
- if (!r)
- return;
- const i = ()=>{
- e.disabled || (o("click", l.value),
- r.setActive(l.value),
- a())
- }
- ;
- return ()=>{
- const {dot: o, badge: a, title: s, disabled: c} = e
- , d = l.value === r.getActive();
- return t.createVNode("div", {
- role: "tab",
- class: Dd({
- select: d,
- disabled: c
- }),
- tabindex: c ? void 0 : 0,
- "aria-selected": d,
- onClick: i
- }, [t.createVNode(rt, t.mergeProps({
- dot: o,
- class: Dd("text"),
- content: a
- }, e.badgeProps), {
- default: ()=>[n.title ? n.title() : s]
- })])
- }
- }
- }))
- , [Ad,zd] = Oe("skeleton-title")
- , Ed = {
- round: Boolean,
- titleWidth: g
- };
- var $d = t.defineComponent({
- name: Ad,
- props: Ed,
- setup: e=>()=>t.createVNode("h3", {
- class: zd([{
- round: e.round
- }]),
- style: {
- width: ce(e.titleWidth)
- }
- }, null)
- });
- const [Ld,Md] = Oe("skeleton-avatar")
- , Fd = {
- avatarSize: g,
- avatarShape: N("round")
- };
- var Rd = t.defineComponent({
- name: Ld,
- props: Fd,
- setup: e=>()=>t.createVNode("div", {
- class: Md([e.avatarShape]),
- style: de(e.avatarSize)
- }, null)
- });
- const Hd = "100%"
- , jd = {
- round: Boolean,
- rowWidth: {
- type: g,
- default: Hd
- }
- }
- , [Wd,Ud] = Oe("skeleton-paragraph");
- var qd = t.defineComponent({
- name: Wd,
- props: jd,
- setup: e=>()=>t.createVNode("div", {
- class: Ud([{
- round: e.round
- }]),
- style: {
- width: e.rowWidth
- }
- }, null)
- });
- const [Yd,Gd] = Oe("skeleton")
- , Xd = {
- row: x(0),
- round: Boolean,
- title: Boolean,
- titleWidth: g,
- avatar: Boolean,
- avatarSize: g,
- avatarShape: N("round"),
- loading: b,
- animate: b,
- rowWidth: {
- type: [Number, String, Array],
- default: Hd
- }
- };
- var Zd = t.defineComponent({
- name: Yd,
- inheritAttrs: !1,
- props: Xd,
- setup(e, {slots: o, attrs: n}) {
- const a = ()=>{
- if (e.avatar)
- return t.createVNode(Rd, {
- avatarShape: e.avatarShape,
- avatarSize: e.avatarSize
- }, null)
- }
- , r = ()=>{
- if (e.title)
- return t.createVNode($d, {
- round: e.round,
- titleWidth: e.titleWidth
- }, null)
- }
- , l = t=>{
- const {rowWidth: o} = e;
- return o === Hd && t === +e.row - 1 ? "60%" : Array.isArray(o) ? o[t] : o
- }
- ;
- return ()=>{
- var i;
- return e.loading ? t.createVNode("div", t.mergeProps({
- class: Gd({
- animate: e.animate,
- round: e.round
- })
- }, n), [o.template ? o.template() : t.createVNode(t.Fragment, null, [a(), t.createVNode("div", {
- class: Gd("content")
- }, [r(), Array(+e.row).fill("").map(((o,n)=>t.createVNode(qd, {
- key: n,
- round: e.round,
- rowWidth: ce(l(n))
- }, null)))])])]) : null == (i = o.default) ? void 0 : i.call(o)
- }
- }
- });
- const [Kd,_d] = Oe("skeleton-image")
- , Jd = {
- imageSize: g,
- imageShape: N("square")
- };
- const Qd = je(t.defineComponent({
- name: Kd,
- props: Jd,
- setup: e=>()=>t.createVNode("div", {
- class: _d([e.imageShape]),
- style: de(e.imageSize)
- }, [t.createVNode(vt, {
- name: "photo",
- class: _d("icon")
- }, null)])
- }))
- , eu = je($d)
- , tu = je(Rd)
- , ou = je(qd)
- , nu = je(Zd)
- , [au,ru] = Oe("slider")
- , lu = {
- min: x(0),
- max: x(100),
- step: x(1),
- range: Boolean,
- reverse: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- vertical: Boolean,
- barHeight: g,
- buttonSize: g,
- activeColor: String,
- inactiveColor: String,
- modelValue: {
- type: [Number, Array],
- default: 0
- }
- };
- const iu = je(t.defineComponent({
- name: au,
- props: lu,
- emits: ["change", "dragEnd", "dragStart", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- let a, r, l;
- const i = t.ref()
- , s = t.ref()
- , c = t.ref()
- , d = $t()
- , u = t.computed((()=>Number(e.max) - Number(e.min)))
- , p = t.computed((()=>{
- const t = e.vertical ? "width" : "height";
- return {
- background: e.inactiveColor,
- [t]: ce(e.barHeight)
- }
- }
- ))
- , m = t=>e.range && Array.isArray(t)
- , v = ()=>{
- const {modelValue: t, min: o} = e;
- return m(t) ? 100 * (t[1] - t[0]) / u.value + "%" : 100 * (t - Number(o)) / u.value + "%"
- }
- , h = t.computed((()=>{
- const t = {
- [e.vertical ? "height" : "width"]: v(),
- background: e.activeColor
- };
- c.value && (t.transition = "none");
- return t[e.vertical ? e.reverse ? "bottom" : "top" : e.reverse ? "right" : "left"] = (()=>{
- const {modelValue: t, min: o} = e;
- return m(t) ? 100 * (t[0] - Number(o)) / u.value + "%" : "0%"
- }
- )(),
- t
- }
- ))
- , g = t=>{
- const o = +e.min
- , n = +e.max
- , a = +e.step;
- t = be(t, o, n);
- return Ve(o, Math.round((t - o) / a) * a)
- }
- , b = (t,n)=>{
- t = m(t) ? (t=>{
- var o, n;
- const a = null != (o = t[0]) ? o : Number(e.min)
- , r = null != (n = t[1]) ? n : Number(e.max);
- return a > r ? [r, a] : [a, r]
- }
- )(t).map(g) : g(t),
- f(t, e.modelValue) || o("update:modelValue", t),
- n && !f(t, l) && o("change", t)
- }
- , y = t=>{
- if (t.stopPropagation(),
- e.disabled || e.readonly)
- return;
- const {min: o, reverse: n, vertical: a, modelValue: r} = e
- , l = P(i)
- , s = a ? l.height : l.width
- , c = Number(o) + (a ? n ? l.bottom - t.clientY : t.clientY - l.top : n ? l.right - t.clientX : t.clientX - l.left) / s * u.value;
- if (m(r)) {
- const [e,t] = r;
- b(c <= (e + t) / 2 ? [c, t] : [e, c], !0)
- } else
- b(c, !0)
- }
- , w = t=>{
- e.disabled || e.readonly || ("dragging" === c.value && (b(r, !0),
- o("dragEnd", t)),
- c.value = "")
- }
- , V = t=>{
- if ("number" == typeof t) {
- return ru("button-wrapper", ["left", "right"][t])
- }
- return ru("button-wrapper", e.reverse ? "left" : "right")
- }
- , x = (o,a)=>{
- if ("number" == typeof a) {
- const e = n[0 === a ? "left-button" : "right-button"];
- if (e)
- return e({
- value: o
- })
- }
- return n.button ? n.button({
- value: o
- }) : t.createVNode("div", {
- class: ru("button"),
- style: de(e.buttonSize)
- }, null)
- }
- , N = o=>{
- const n = "number" == typeof o ? e.modelValue[o] : e.modelValue;
- return t.createVNode("div", {
- ref: s,
- role: "slider",
- class: V(o),
- tabindex: e.disabled ? void 0 : 0,
- "aria-valuemin": e.min,
- "aria-valuenow": n,
- "aria-valuemax": e.max,
- "aria-disabled": e.disabled || void 0,
- "aria-readonly": e.readonly || void 0,
- "aria-orientation": e.vertical ? "vertical" : "horizontal",
- onTouchstartPassive: t=>{
- "number" == typeof o && (a = o),
- (t=>{
- e.disabled || e.readonly || (d.start(t),
- r = e.modelValue,
- l = m(r) ? r.map(g) : g(r),
- c.value = "start")
- }
- )(t)
- }
- ,
- onTouchend: w,
- onTouchcancel: w,
- onClick: ae
- }, [x(n, o)])
- }
- ;
- return b(e.modelValue),
- K((()=>e.modelValue)),
- H("touchmove", (t=>{
- if (e.disabled || e.readonly)
- return;
- "start" === c.value && o("dragStart", t),
- re(t, !0),
- d.move(t),
- c.value = "dragging";
- const n = P(i);
- let s = (e.vertical ? d.deltaY.value : d.deltaX.value) / (e.vertical ? n.height : n.width) * u.value;
- if (e.reverse && (s = -s),
- m(l)) {
- const t = e.reverse ? 1 - a : a;
- r[t] = l[t] + s
- } else
- r = l + s;
- b(r)
- }
- ), {
- target: s
- }),
- ()=>t.createVNode("div", {
- ref: i,
- style: p.value,
- class: ru({
- vertical: e.vertical,
- disabled: e.disabled
- }),
- onClick: y
- }, [t.createVNode("div", {
- class: ru("bar"),
- style: h.value
- }, [e.range ? [N(0), N(1)] : N()])])
- }
- }))
- , [su,cu] = Oe("space")
- , du = {
- align: String,
- direction: {
- type: String,
- default: "horizontal"
- },
- size: {
- type: [Number, String, Array],
- default: 8
- },
- wrap: Boolean,
- fill: Boolean
- };
- function uu(e=[]) {
- const o = [];
- return e.forEach((e=>{
- Array.isArray(e) ? o.push(...e) : e.type === t.Fragment ? o.push(...uu(e.children)) : o.push(e)
- }
- )),
- o.filter((e=>{
- var o;
- return !(e && ("undefined" != typeof Comment && e.type === Comment || e.type === t.Fragment && 0 === (null == (o = e.children) ? void 0 : o.length) || e.type === Text && "" === e.children.trim()))
- }
- ))
- }
- const pu = je(t.defineComponent({
- name: su,
- props: du,
- setup(e, {slots: o}) {
- const n = t.computed((()=>{
- var t;
- return null != (t = e.align) ? t : "horizontal" === e.direction ? "center" : ""
- }
- ))
- , a = e=>"number" == typeof e ? e + "px" : e
- , r = t=>{
- const o = {}
- , n = `${a(Array.isArray(e.size) ? e.size[0] : e.size)}`
- , r = `${a(Array.isArray(e.size) ? e.size[1] : e.size)}`;
- return t ? e.wrap ? {
- marginBottom: r
- } : {} : ("horizontal" === e.direction && (o.marginRight = n),
- ("vertical" === e.direction || e.wrap) && (o.marginBottom = r),
- o)
- }
- ;
- return ()=>{
- var a;
- const l = uu(null == (a = o.default) ? void 0 : a.call(o));
- return t.createVNode("div", {
- class: [cu({
- [e.direction]: e.direction,
- [`align-${n.value}`]: n.value,
- wrap: e.wrap,
- fill: e.fill
- })]
- }, [l.map(((e,o)=>t.createVNode("div", {
- key: `item-${o}`,
- class: `${su}-item`,
- style: r(o === l.length - 1)
- }, [e])))])
- }
- }
- }))
- , [mu,fu] = Oe("steps")
- , vu = {
- active: x(0),
- direction: N("horizontal"),
- activeIcon: N("checked"),
- iconPrefix: String,
- finishIcon: String,
- activeColor: String,
- inactiveIcon: String,
- inactiveColor: String
- }
- , hu = Symbol(mu);
- var gu = t.defineComponent({
- name: mu,
- props: vu,
- emits: ["clickStep"],
- setup(e, {emit: o, slots: n}) {
- const {linkChildren: a} = I(hu);
- return a({
- props: e,
- onClickStep: e=>o("clickStep", e)
- }),
- ()=>{
- var o;
- return t.createVNode("div", {
- class: fu([e.direction])
- }, [t.createVNode("div", {
- class: fu("items")
- }, [null == (o = n.default) ? void 0 : o.call(n)])])
- }
- }
- });
- const [bu,yu] = Oe("step");
- const wu = je(t.defineComponent({
- name: bu,
- setup(e, {slots: o}) {
- const {parent: n, index: a} = D(hu);
- if (!n)
- return;
- const r = n.props
- , l = ()=>{
- const e = +r.active;
- return a.value < e ? "finish" : a.value === e ? "process" : "waiting"
- }
- , i = ()=>"process" === l()
- , s = t.computed((()=>({
- background: "finish" === l() ? r.activeColor : r.inactiveColor
- })))
- , c = t.computed((()=>i() ? {
- color: r.activeColor
- } : "waiting" === l() ? {
- color: r.inactiveColor
- } : void 0))
- , d = ()=>n.onClickStep(a.value)
- , u = ()=>{
- const {iconPrefix: e, finishIcon: n, activeIcon: a, activeColor: c, inactiveIcon: d} = r;
- return i() ? o["active-icon"] ? o["active-icon"]() : t.createVNode(vt, {
- class: yu("icon", "active"),
- name: a,
- color: c,
- classPrefix: e
- }, null) : "finish" === l() && (n || o["finish-icon"]) ? o["finish-icon"] ? o["finish-icon"]() : t.createVNode(vt, {
- class: yu("icon", "finish"),
- name: n,
- color: c,
- classPrefix: e
- }, null) : o["inactive-icon"] ? o["inactive-icon"]() : d ? t.createVNode(vt, {
- class: yu("icon"),
- name: d,
- classPrefix: e
- }, null) : t.createVNode("i", {
- class: yu("circle"),
- style: s.value
- }, null)
- }
- ;
- return ()=>{
- var e;
- const n = l();
- return t.createVNode("div", {
- class: [Ie, yu([r.direction, {
- [n]: n
- }])]
- }, [t.createVNode("div", {
- class: yu("title", {
- active: i()
- }),
- style: c.value,
- onClick: d
- }, [null == (e = o.default) ? void 0 : e.call(o)]), t.createVNode("div", {
- class: yu("circle-container"),
- onClick: d
- }, [u()]), t.createVNode("div", {
- class: yu("line"),
- style: s.value
- }, null)])
- }
- }
- }))
- , [Vu,xu] = Oe("stepper")
- , Nu = (e,t)=>String(e) === String(t)
- , Cu = {
- min: x(1),
- max: x(1 / 0),
- name: x(""),
- step: x(1),
- theme: String,
- integer: Boolean,
- disabled: Boolean,
- showPlus: b,
- showMinus: b,
- showInput: b,
- longPress: b,
- autoFixed: b,
- allowEmpty: Boolean,
- modelValue: g,
- inputWidth: g,
- buttonSize: g,
- placeholder: String,
- disablePlus: Boolean,
- disableMinus: Boolean,
- disableInput: Boolean,
- beforeChange: Function,
- defaultValue: x(1),
- decimalLength: g
- };
- const ku = je(t.defineComponent({
- name: Vu,
- props: Cu,
- emits: ["plus", "blur", "minus", "focus", "change", "overlimit", "update:modelValue"],
- setup(e, {emit: n}) {
- const a = (t,n=!0)=>{
- const {min: a, max: r, allowEmpty: l, decimalLength: i} = e;
- return l && "" === t || (t = "" === (t = we(String(t), !e.integer)) ? 0 : +t,
- t = Number.isNaN(t) ? +a : t,
- t = n ? Math.max(Math.min(+r, t), +a) : t,
- o(i) && (t = t.toFixed(+i))),
- t
- }
- ;
- let r;
- const l = t.ref()
- , i = t.ref((()=>{
- var t;
- const o = null != (t = e.modelValue) ? t : e.defaultValue
- , r = a(o);
- return Nu(r, e.modelValue) || n("update:modelValue", r),
- r
- }
- )())
- , s = t.computed((()=>e.disabled || e.disableMinus || i.value <= +e.min))
- , c = t.computed((()=>e.disabled || e.disablePlus || i.value >= +e.max))
- , d = t.computed((()=>({
- width: ce(e.inputWidth),
- height: ce(e.buttonSize)
- })))
- , u = t.computed((()=>de(e.buttonSize)))
- , p = t=>{
- e.beforeChange ? He(e.beforeChange, {
- args: [t],
- done() {
- i.value = t
- }
- }) : i.value = t
- }
- , m = ()=>{
- if ("plus" === r && c.value || "minus" === r && s.value)
- return void n("overlimit", r);
- const t = "minus" === r ? -e.step : +e.step
- , o = a(Ve(+i.value, t));
- p(o),
- n(r)
- }
- , f = t=>{
- const n = t.target
- , {value: a} = n
- , {decimalLength: r} = e;
- let l = we(String(a), !e.integer);
- if (o(r) && l.includes(".")) {
- const e = l.split(".");
- l = `${e[0]}.${e[1].slice(0, +r)}`
- }
- e.beforeChange ? n.value = String(i.value) : Nu(a, l) || (n.value = l);
- const s = l === String(+l);
- p(s ? +l : l)
- }
- , v = t=>{
- var o;
- e.disableInput ? null == (o = l.value) || o.blur() : n("focus", t)
- }
- , h = o=>{
- const r = o.target
- , l = a(r.value, e.autoFixed);
- r.value = String(l),
- i.value = l,
- t.nextTick((()=>{
- n("blur", o),
- ne()
- }
- ))
- }
- ;
- let g, b;
- const y = ()=>{
- b = setTimeout((()=>{
- m(),
- y()
- }
- ), 200)
- }
- , w = t=>{
- e.longPress && (clearTimeout(b),
- g && re(t))
- }
- , V = t=>{
- e.disableInput && re(t)
- }
- , x = t=>({
- onClick: e=>{
- re(e),
- r = t,
- m()
- }
- ,
- onTouchstartPassive: ()=>{
- r = t,
- e.longPress && (g = !1,
- clearTimeout(b),
- b = setTimeout((()=>{
- g = !0,
- m(),
- y()
- }
- ), 500))
- }
- ,
- onTouchend: w,
- onTouchcancel: w
- });
- return t.watch((()=>[e.max, e.min, e.integer, e.decimalLength]), (()=>{
- const e = a(i.value);
- Nu(e, i.value) || (i.value = e)
- }
- )),
- t.watch((()=>e.modelValue), (e=>{
- Nu(e, i.value) || (i.value = a(e))
- }
- )),
- t.watch(i, (t=>{
- n("update:modelValue", t),
- n("change", t, {
- name: e.name
- })
- }
- )),
- K((()=>e.modelValue)),
- ()=>t.createVNode("div", {
- role: "group",
- class: xu([e.theme])
- }, [t.withDirectives(t.createVNode("button", t.mergeProps({
- type: "button",
- style: u.value,
- class: [xu("minus", {
- disabled: s.value
- }), {
- [Fe]: !s.value
- }],
- "aria-disabled": s.value || void 0
- }, x("minus")), null), [[t.vShow, e.showMinus]]), t.withDirectives(t.createVNode("input", {
- ref: l,
- type: e.integer ? "tel" : "text",
- role: "spinbutton",
- class: xu("input"),
- value: i.value,
- style: d.value,
- disabled: e.disabled,
- readonly: e.disableInput,
- inputmode: e.integer ? "numeric" : "decimal",
- placeholder: e.placeholder,
- "aria-valuemax": e.max,
- "aria-valuemin": e.min,
- "aria-valuenow": i.value,
- onBlur: h,
- onInput: f,
- onFocus: v,
- onMousedown: V
- }, null), [[t.vShow, e.showInput]]), t.withDirectives(t.createVNode("button", t.mergeProps({
- type: "button",
- style: u.value,
- class: [xu("plus", {
- disabled: c.value
- }), {
- [Fe]: !c.value
- }],
- "aria-disabled": c.value || void 0
- }, x("plus")), null), [[t.vShow, e.showPlus]])])
- }
- }))
- , Su = je(gu)
- , [Bu,Tu,Pu] = Oe("submit-bar")
- , Du = {
- tip: String,
- label: String,
- price: Number,
- tipIcon: String,
- loading: Boolean,
- currency: N("¥"),
- disabled: Boolean,
- textAlign: String,
- buttonText: String,
- buttonType: N("danger"),
- buttonColor: String,
- suffixLabel: String,
- placeholder: Boolean,
- decimalLength: x(2),
- safeAreaInsetBottom: b
- };
- const Ou = je(t.defineComponent({
- name: Bu,
- props: Du,
- emits: ["submit"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , r = Ye(a, Tu)
- , l = ()=>{
- const {price: o, label: n, currency: a, textAlign: r, suffixLabel: l, decimalLength: i} = e;
- if ("number" == typeof o) {
- const e = (o / 100).toFixed(+i).split(".")
- , s = i ? `.${e[1]}` : "";
- return t.createVNode("div", {
- class: Tu("text"),
- style: {
- textAlign: r
- }
- }, [t.createVNode("span", null, [n || Pu("label")]), t.createVNode("span", {
- class: Tu("price")
- }, [a, t.createVNode("span", {
- class: Tu("price-integer")
- }, [e[0]]), s]), l && t.createVNode("span", {
- class: Tu("suffix-label")
- }, [l])])
- }
- }
- , i = ()=>{
- var o;
- const {tip: a, tipIcon: r} = e;
- if (n.tip || a)
- return t.createVNode("div", {
- class: Tu("tip")
- }, [r && t.createVNode(vt, {
- class: Tu("tip-icon"),
- name: r
- }, null), a && t.createVNode("span", {
- class: Tu("tip-text")
- }, [a]), null == (o = n.tip) ? void 0 : o.call(n)])
- }
- , s = ()=>o("submit")
- , c = ()=>{
- var o, r;
- return t.createVNode("div", {
- ref: a,
- class: [Tu(), {
- "van-safe-area-bottom": e.safeAreaInsetBottom
- }]
- }, [null == (o = n.top) ? void 0 : o.call(n), i(), t.createVNode("div", {
- class: Tu("bar")
- }, [null == (r = n.default) ? void 0 : r.call(n), l(), n.button ? n.button() : t.createVNode(kt, {
- round: !0,
- type: e.buttonType,
- text: e.buttonText,
- class: Tu("button", e.buttonType),
- color: e.buttonColor,
- loading: e.loading,
- disabled: e.disabled,
- onClick: s
- }, null)])])
- }
- ;
- return ()=>e.placeholder ? r(c) : c()
- }
- }))
- , [Iu,Au] = Oe("swipe-cell")
- , zu = {
- name: x(""),
- disabled: Boolean,
- leftWidth: g,
- rightWidth: g,
- beforeClose: Function,
- stopPropagation: Boolean
- };
- const Eu = je(t.defineComponent({
- name: Iu,
- props: zu,
- emits: ["open", "close", "click"],
- setup(e, {emit: n, slots: a}) {
- let r, l, i;
- const s = t.ref()
- , c = t.ref()
- , d = t.ref()
- , u = t.reactive({
- offset: 0,
- dragging: !1
- })
- , p = $t()
- , m = e=>e.value ? P(e).width : 0
- , f = t.computed((()=>o(e.leftWidth) ? +e.leftWidth : m(c)))
- , v = t.computed((()=>o(e.rightWidth) ? +e.rightWidth : m(d)))
- , h = t=>{
- u.offset = "left" === t ? f.value : -v.value,
- r || (r = !0,
- n("open", {
- name: e.name,
- position: t
- }))
- }
- , g = t=>{
- u.offset = 0,
- r && (r = !1,
- n("close", {
- name: e.name,
- position: t
- }))
- }
- , b = t=>{
- e.disabled || (i = u.offset,
- p.start(t))
- }
- , y = ()=>{
- u.dragging && (u.dragging = !1,
- (e=>{
- const t = Math.abs(u.offset)
- , o = r ? .85 : .15
- , n = "left" === e ? f.value : v.value;
- n && t > n * o ? h(e) : g(e)
- }
- )(u.offset > 0 ? "left" : "right"),
- setTimeout((()=>{
- l = !1
- }
- ), 0))
- }
- , w = (t="outside")=>{
- n("click", t),
- r && !l && He(e.beforeClose, {
- args: [{
- name: e.name,
- position: t
- }],
- done: ()=>g(t)
- })
- }
- , V = (e,t)=>o=>{
- t && o.stopPropagation(),
- w(e)
- }
- , x = (e,o)=>{
- const n = a[e];
- if (n)
- return t.createVNode("div", {
- ref: o,
- class: Au(e),
- onClick: V(e, !0)
- }, [n()])
- }
- ;
- return Je({
- open: h,
- close: g
- }),
- j(s, (()=>w("outside")), {
- eventName: "touchstart"
- }),
- H("touchmove", (t=>{
- if (e.disabled)
- return;
- const {deltaX: o} = p;
- if (p.move(t),
- p.isHorizontal()) {
- l = !0,
- u.dragging = !0;
- (!r || o.value * i < 0) && re(t, e.stopPropagation),
- u.offset = be(o.value + i, -v.value, f.value)
- }
- }
- ), {
- target: s
- }),
- ()=>{
- var e;
- const o = {
- transform: `translate3d(${u.offset}px, 0, 0)`,
- transitionDuration: u.dragging ? "0s" : ".6s"
- };
- return t.createVNode("div", {
- ref: s,
- class: Au(),
- onClick: V("cell", l),
- onTouchstartPassive: b,
- onTouchend: y,
- onTouchcancel: y
- }, [t.createVNode("div", {
- class: Au("wrapper"),
- style: o
- }, [x("left", c), null == (e = a.default) ? void 0 : e.call(a), x("right", d)])])
- }
- }
- }))
- , [$u,Lu] = Oe("tabbar")
- , Mu = {
- route: Boolean,
- fixed: b,
- border: b,
- zIndex: g,
- placeholder: Boolean,
- activeColor: String,
- beforeChange: Function,
- inactiveColor: String,
- modelValue: x(0),
- safeAreaInsetBottom: {
- type: Boolean,
- default: null
- }
- }
- , Fu = Symbol($u);
- const Ru = je(t.defineComponent({
- name: $u,
- props: Mu,
- emits: ["change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , {linkChildren: r} = I(Fu)
- , l = Ye(a, Lu)
- , i = ()=>{
- var t;
- return null != (t = e.safeAreaInsetBottom) ? t : e.fixed
- }
- , s = ()=>{
- var o;
- const {fixed: r, zIndex: l, border: s} = e;
- return t.createVNode("div", {
- ref: a,
- role: "tablist",
- style: ue(l),
- class: [Lu({
- fixed: r
- }), {
- [Le]: s,
- "van-safe-area-bottom": i()
- }]
- }, [null == (o = n.default) ? void 0 : o.call(n)])
- }
- ;
- return r({
- props: e,
- setActive: (t,n)=>{
- He(e.beforeChange, {
- args: [t],
- done() {
- o("update:modelValue", t),
- o("change", t),
- n()
- }
- })
- }
- }),
- ()=>e.fixed && e.placeholder ? l(s) : s()
- }
- }))
- , [Hu,ju] = Oe("tabbar-item")
- , Wu = d({}, Qe, {
- dot: Boolean,
- icon: String,
- name: g,
- badge: g,
- badgeProps: Object,
- iconPrefix: String
- });
- const Uu = je(t.defineComponent({
- name: Hu,
- props: Wu,
- emits: ["click"],
- setup(e, {emit: o, slots: n}) {
- const r = tt()
- , l = t.getCurrentInstance().proxy
- , {parent: i, index: s} = D(Fu);
- if (!i)
- return;
- const c = t.computed((()=>{
- var t;
- const {route: o, modelValue: n} = i.props;
- if (o && "$route"in l) {
- const {$route: t} = l
- , {to: o} = e
- , n = a(o) ? o : {
- path: o
- };
- return !!t.matched.find((e=>{
- const t = "path"in n && n.path === e.path
- , o = "name"in n && n.name === e.name;
- return t || o
- }
- ))
- }
- return (null != (t = e.name) ? t : s.value) === n
- }
- ))
- , d = t=>{
- var n;
- c.value || i.setActive(null != (n = e.name) ? n : s.value, r),
- o("click", t)
- }
- , u = ()=>n.icon ? n.icon({
- active: c.value
- }) : e.icon ? t.createVNode(vt, {
- name: e.icon,
- classPrefix: e.iconPrefix
- }, null) : void 0;
- return ()=>{
- var o;
- const {dot: a, badge: r} = e
- , {activeColor: l, inactiveColor: s} = i.props
- , p = c.value ? l : s;
- return t.createVNode("div", {
- role: "tab",
- class: ju({
- active: c.value
- }),
- style: {
- color: p
- },
- tabindex: 0,
- "aria-selected": c.value,
- onClick: d
- }, [t.createVNode(rt, t.mergeProps({
- dot: a,
- class: ju("icon"),
- content: r
- }, e.badgeProps), {
- default: u
- }), t.createVNode("div", {
- class: ju("text")
- }, [null == (o = n.default) ? void 0 : o.call(n, {
- active: c.value
- })])])
- }
- }
- }))
- , [qu] = Oe("time-picker")
- , Yu = d({}, cr, {
- minHour: x(0),
- maxHour: x(23),
- minMinute: x(0),
- maxMinute: x(59),
- minSecond: x(0),
- maxSecond: x(59),
- columnsType: {
- type: Array,
- default: ()=>["hour", "minute"]
- }
- });
- const Gu = je(t.defineComponent({
- name: qu,
- props: Yu,
- emits: ["confirm", "cancel", "change", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref(e.modelValue)
- , r = t.computed((()=>e.columnsType.map((t=>{
- const {filter: o, formatter: n} = e;
- switch (t) {
- case "hour":
- return pr(+e.minHour, +e.maxHour, t, n, o);
- case "minute":
- return pr(+e.minMinute, +e.maxMinute, t, n, o);
- case "second":
- return pr(+e.minSecond, +e.maxSecond, t, n, o);
- default:
- return []
- }
- }
- ))));
- t.watch(a, (t=>{
- f(t, e.modelValue) || o("update:modelValue", t)
- }
- )),
- t.watch((()=>e.modelValue), (e=>{
- e = mr(e, r.value),
- f(e, a.value) || (a.value = e)
- }
- ), {
- immediate: !0
- });
- const l = (...e)=>o("change", ...e)
- , i = (...e)=>o("cancel", ...e)
- , s = (...e)=>o("confirm", ...e);
- return ()=>t.createVNode(sn, t.mergeProps({
- modelValue: a.value,
- "onUpdate:modelValue": e=>a.value = e,
- columns: r.value,
- onChange: l,
- onCancel: i,
- onConfirm: s
- }, m(e, dr)), n)
- }
- }))
- , [Xu,Zu] = Oe("tree-select")
- , Ku = {
- max: x(1 / 0),
- items: w(),
- height: x(300),
- selectedIcon: N("success"),
- mainActiveIndex: x(0),
- activeId: {
- type: [Number, String, Array],
- default: 0
- }
- };
- const _u = je(t.defineComponent({
- name: Xu,
- props: Ku,
- emits: ["clickNav", "clickItem", "update:activeId", "update:mainActiveIndex"],
- setup(e, {emit: o, slots: n}) {
- const a = t=>Array.isArray(e.activeId) ? e.activeId.includes(t) : e.activeId === t
- , r = n=>t.createVNode("div", {
- key: n.id,
- class: ["van-ellipsis", Zu("item", {
- active: a(n.id),
- disabled: n.disabled
- })],
- onClick: ()=>{
- if (n.disabled)
- return;
- let t;
- if (Array.isArray(e.activeId)) {
- t = e.activeId.slice();
- const o = t.indexOf(n.id);
- -1 !== o ? t.splice(o, 1) : t.length < e.max && t.push(n.id)
- } else
- t = n.id;
- o("update:activeId", t),
- o("clickItem", n)
- }
- }, [n.text, a(n.id) && t.createVNode(vt, {
- name: e.selectedIcon,
- class: Zu("selected")
- }, null)])
- , l = e=>{
- o("update:mainActiveIndex", e)
- }
- , i = e=>o("clickNav", e)
- , s = ()=>{
- const o = e.items.map((e=>t.createVNode(Id, {
- dot: e.dot,
- title: e.text,
- badge: e.badge,
- class: [Zu("nav-item"), e.className],
- disabled: e.disabled,
- onClick: i
- }, null)));
- return t.createVNode(Td, {
- class: Zu("nav"),
- modelValue: e.mainActiveIndex,
- onChange: l
- }, {
- default: ()=>[o]
- })
- }
- , c = ()=>{
- if (n.content)
- return n.content();
- const t = e.items[+e.mainActiveIndex] || {};
- return t.children ? t.children.map(r) : void 0
- }
- ;
- return ()=>t.createVNode("div", {
- class: Zu(),
- style: {
- height: ce(e.height)
- }
- }, [s(), t.createVNode("div", {
- class: Zu("content")
- }, [c()])])
- }
- }))
- , [Ju,Qu,ep] = Oe("uploader");
- function tp(e, t) {
- return new Promise((o=>{
- if ("file" === t)
- return void o();
- const n = new FileReader;
- n.onload = e=>{
- o(e.target.result)
- }
- ,
- "dataUrl" === t ? n.readAsDataURL(e) : "text" === t && n.readAsText(e)
- }
- ))
- }
- function op(e, t) {
- return v(e).some((e=>!!e.file && (n(t) ? t(e.file) : e.file.size > t)))
- }
- const np = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
- function ap(e) {
- return !!e.isImage || (e.file && e.file.type ? 0 === e.file.type.indexOf("image") : e.url ? (t = e.url,
- np.test(t)) : "string" == typeof e.content && 0 === e.content.indexOf("data:image"));
- var t
- }
- var rp = t.defineComponent({
- props: {
- name: g,
- item: y(Object),
- index: Number,
- imageFit: String,
- lazyLoad: Boolean,
- deletable: Boolean,
- previewSize: [Number, String, Array],
- beforeDelete: Function
- },
- emits: ["delete", "preview"],
- setup(e, {emit: n, slots: a}) {
- const r = ()=>{
- const {status: n, message: a} = e.item;
- if ("uploading" === n || "failed" === n) {
- const e = "failed" === n ? t.createVNode(vt, {
- name: "close",
- class: Qu("mask-icon")
- }, null) : t.createVNode(Vt, {
- class: Qu("loading")
- }, null)
- , r = o(a) && "" !== a;
- return t.createVNode("div", {
- class: Qu("mask")
- }, [e, r && t.createVNode("div", {
- class: Qu("mask-message")
- }, [a])])
- }
- }
- , l = t=>{
- const {name: o, item: a, index: r, beforeDelete: l} = e;
- t.stopPropagation(),
- He(l, {
- args: [a, {
- name: o,
- index: r
- }],
- done: ()=>n("delete")
- })
- }
- , i = ()=>n("preview")
- , s = ()=>{
- if (e.deletable && "uploading" !== e.item.status) {
- const e = a["preview-delete"];
- return t.createVNode("div", {
- role: "button",
- class: Qu("preview-delete", {
- shadow: !e
- }),
- tabindex: 0,
- "aria-label": ep("delete"),
- onClick: l
- }, [e ? e() : t.createVNode(vt, {
- name: "cross",
- class: Qu("preview-delete-icon")
- }, null)])
- }
- }
- , c = ()=>{
- if (a["preview-cover"]) {
- const {index: o, item: n} = e;
- return t.createVNode("div", {
- class: Qu("preview-cover")
- }, [a["preview-cover"](d({
- index: o
- }, n))])
- }
- }
- , u = ()=>{
- const {item: o, lazyLoad: n, imageFit: a, previewSize: r} = e;
- return ap(o) ? t.createVNode(Sr, {
- fit: a,
- src: o.content || o.url,
- class: Qu("preview-image"),
- width: Array.isArray(r) ? r[0] : r,
- height: Array.isArray(r) ? r[1] : r,
- lazyLoad: n,
- onClick: i
- }, {
- default: c
- }) : t.createVNode("div", {
- class: Qu("file"),
- style: de(e.previewSize)
- }, [t.createVNode(vt, {
- class: Qu("file-icon"),
- name: "description"
- }, null), t.createVNode("div", {
- class: [Qu("file-name"), "van-ellipsis"]
- }, [o.file ? o.file.name : o.url]), c()])
- }
- ;
- return ()=>t.createVNode("div", {
- class: Qu("preview")
- }, [u(), r(), s()])
- }
- });
- const lp = {
- name: x(""),
- accept: N("image/*"),
- capture: String,
- multiple: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- lazyLoad: Boolean,
- maxCount: x(1 / 0),
- imageFit: N("cover"),
- resultType: N("dataUrl"),
- uploadIcon: N("photograph"),
- uploadText: String,
- deletable: b,
- afterRead: Function,
- showUpload: b,
- modelValue: w(),
- beforeRead: Function,
- beforeDelete: Function,
- previewSize: [Number, String, Array],
- previewImage: b,
- previewOptions: Object,
- previewFullImage: b,
- maxSize: {
- type: [Number, String, Function],
- default: 1 / 0
- }
- };
- const ip = je(t.defineComponent({
- name: Ju,
- props: lp,
- emits: ["delete", "oversize", "clickUpload", "closePreview", "clickPreview", "update:modelValue"],
- setup(e, {emit: o, slots: n}) {
- const a = t.ref()
- , l = []
- , i = (t=e.modelValue.length)=>({
- name: e.name,
- index: t
- })
- , s = ()=>{
- a.value && (a.value.value = "")
- }
- , c = n=>{
- if (s(),
- op(n, e.maxSize)) {
- if (!Array.isArray(n))
- return void o("oversize", n, i());
- {
- const t = function(e, t) {
- const o = []
- , n = [];
- return e.forEach((e=>{
- op(e, t) ? n.push(e) : o.push(e)
- }
- )),
- {
- valid: o,
- invalid: n
- }
- }(n, e.maxSize);
- if (n = t.valid,
- o("oversize", t.invalid, i()),
- !n.length)
- return
- }
- }
- n = t.reactive(n),
- o("update:modelValue", [...e.modelValue, ...v(n)]),
- e.afterRead && e.afterRead(n, i())
- }
- , u = t=>{
- const {maxCount: o, modelValue: n, resultType: a} = e;
- if (Array.isArray(t)) {
- const e = +o - n.length;
- t.length > e && (t = t.slice(0, e)),
- Promise.all(t.map((e=>tp(e, a)))).then((e=>{
- const o = t.map(((t,o)=>{
- const n = {
- file: t,
- status: "",
- message: ""
- };
- return e[o] && (n.content = e[o]),
- n
- }
- ));
- c(o)
- }
- ))
- } else
- tp(t, a).then((e=>{
- const o = {
- file: t,
- status: "",
- message: ""
- };
- e && (o.content = e),
- c(o)
- }
- ))
- }
- , p = t=>{
- const {files: o} = t.target;
- if (e.disabled || !o || !o.length)
- return;
- const n = 1 === o.length ? o[0] : [].slice.call(o);
- if (e.beforeRead) {
- const t = e.beforeRead(n, i());
- if (!t)
- return void s();
- if (r(t))
- return void t.then((e=>{
- u(e || n)
- }
- )).catch(s)
- }
- u(n)
- }
- ;
- let f;
- const h = ()=>o("closePreview")
- , g = (a,r)=>{
- const s = ["imageFit", "deletable", "previewSize", "beforeDelete"]
- , c = d(m(e, s), m(a, s, !0));
- return t.createVNode(rp, t.mergeProps({
- item: a,
- index: r,
- onClick: ()=>o("clickPreview", a, i(r)),
- onDelete: ()=>((t,n)=>{
- const a = e.modelValue.slice(0);
- a.splice(n, 1),
- o("update:modelValue", a),
- o("delete", t, i(n))
- }
- )(a, r),
- onPreview: ()=>(t=>{
- if (e.previewFullImage) {
- const o = e.modelValue.filter(ap)
- , n = o.map((e=>(e.file && !e.url && "failed" !== e.status && (e.url = URL.createObjectURL(e.file),
- l.push(e.url)),
- e.url))).filter(Boolean);
- f = ns(d({
- images: n,
- startPosition: o.indexOf(t),
- onClose: h
- }, e.previewOptions))
- }
- }
- )(a)
- }, m(e, ["name", "lazyLoad"]), c), m(n, ["preview-cover", "preview-delete"]))
- }
- , b = ()=>{
- if (e.previewImage)
- return e.modelValue.map(g)
- }
- , y = e=>o("clickUpload", e)
- , w = ()=>{
- if (e.modelValue.length >= e.maxCount)
- return;
- const o = e.readonly ? null : t.createVNode("input", {
- ref: a,
- type: "file",
- class: Qu("input"),
- accept: e.accept,
- capture: e.capture,
- multiple: e.multiple,
- disabled: e.disabled,
- onChange: p
- }, null);
- return n.default ? t.createVNode("div", {
- class: Qu("input-wrapper"),
- onClick: y
- }, [n.default(), o]) : t.withDirectives(t.createVNode("div", {
- class: Qu("upload", {
- readonly: e.readonly
- }),
- style: de(e.previewSize),
- onClick: y
- }, [t.createVNode(vt, {
- name: e.uploadIcon,
- class: Qu("upload-icon")
- }, null), e.uploadText && t.createVNode("span", {
- class: Qu("upload-text")
- }, [e.uploadText]), o]), [[t.vShow, e.showUpload]])
- }
- ;
- return t.onBeforeUnmount((()=>{
- l.forEach((e=>URL.revokeObjectURL(e)))
- }
- )),
- Je({
- chooseFile: ()=>{
- a.value && !e.disabled && a.value.click()
- }
- ,
- closeImagePreview: ()=>{
- f && f.close()
- }
- }),
- K((()=>e.modelValue)),
- ()=>t.createVNode("div", {
- class: Qu()
- }, [t.createVNode("div", {
- class: Qu("wrapper", {
- disabled: e.disabled
- })
- }, [b(), w()])])
- }
- }));
- class sp {
- constructor({el: e, src: t, error: o, loading: n, bindType: a, $parent: r, options: l, cors: i, elRenderer: s, imageCache: c}) {
- this.el = e,
- this.src = t,
- this.error = o,
- this.loading = n,
- this.bindType = a,
- this.attempt = 0,
- this.cors = i,
- this.naturalHeight = 0,
- this.naturalWidth = 0,
- this.options = l,
- this.$parent = r,
- this.elRenderer = s,
- this.imageCache = c,
- this.performanceData = {
- loadStart: 0,
- loadEnd: 0
- },
- this.filter(),
- this.initState(),
- this.render("loading", !1)
- }
- initState() {
- "dataset"in this.el ? this.el.dataset.src = this.src : this.el.setAttribute("data-src", this.src),
- this.state = {
- loading: !1,
- error: !1,
- loaded: !1,
- rendered: !1
- }
- }
- record(e) {
- this.performanceData[e] = Date.now()
- }
- update({src: e, loading: t, error: o}) {
- const n = this.src;
- this.src = e,
- this.loading = t,
- this.error = o,
- this.filter(),
- n !== this.src && (this.attempt = 0,
- this.initState())
- }
- checkInView() {
- const e = P(this.el);
- return e.top < window.innerHeight * this.options.preLoad && e.bottom > this.options.preLoadTop && e.left < window.innerWidth * this.options.preLoad && e.right > 0
- }
- filter() {
- Object.keys(this.options.filter).forEach((e=>{
- this.options.filter[e](this, this.options)
- }
- ))
- }
- renderLoading(e) {
- this.state.loading = !0,
- Ya({
- src: this.loading,
- cors: this.cors
- }, (()=>{
- this.render("loading", !1),
- this.state.loading = !1,
- e()
- }
- ), (()=>{
- e(),
- this.state.loading = !1
- }
- ))
- }
- load(e=c) {
- if (this.attempt > this.options.attempt - 1 && this.state.error)
- e();
- else if (!this.state.rendered || !this.state.loaded)
- return this.imageCache.has(this.src) ? (this.state.loaded = !0,
- this.render("loaded", !0),
- this.state.rendered = !0,
- e()) : void this.renderLoading((()=>{
- var t, o;
- this.attempt++,
- null == (o = (t = this.options.adapter).beforeLoad) || o.call(t, this, this.options),
- this.record("loadStart"),
- Ya({
- src: this.src,
- cors: this.cors
- }, (t=>{
- this.naturalHeight = t.naturalHeight,
- this.naturalWidth = t.naturalWidth,
- this.state.loaded = !0,
- this.state.error = !1,
- this.record("loadEnd"),
- this.render("loaded", !1),
- this.state.rendered = !0,
- this.imageCache.add(this.src),
- e()
- }
- ), (e=>{
- !this.options.silent && console.error(e),
- this.state.error = !0,
- this.state.loaded = !1,
- this.render("error", !1)
- }
- ))
- }
- ))
- }
- render(e, t) {
- this.elRenderer(this, e, t)
- }
- performance() {
- let e = "loading"
- , t = 0;
- return this.state.loaded && (e = "loaded",
- t = (this.performanceData.loadEnd - this.performanceData.loadStart) / 1e3),
- this.state.error && (e = "error"),
- {
- src: this.src,
- state: e,
- time: t
- }
- }
- $destroy() {
- this.el = null,
- this.src = null,
- this.error = null,
- this.loading = null,
- this.bindType = null,
- this.attempt = 0
- }
- }
- const cp = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
- , dp = ["scroll", "wheel", "mousewheel", "resize", "animationend", "transitionend", "touchmove"]
- , up = {
- rootMargin: "0px",
- threshold: 0
- };
- var pp = e=>({
- props: {
- tag: {
- type: String,
- default: "div"
- }
- },
- emits: ["show"],
- render() {
- return t.h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null)
- },
- data: ()=>({
- el: null,
- state: {
- loaded: !1
- },
- show: !1
- }),
- mounted() {
- this.el = this.$el,
- e.addLazyBox(this),
- e.lazyLoadHandler()
- },
- beforeUnmount() {
- e.removeComponent(this)
- },
- methods: {
- checkInView() {
- const t = P(this.$el);
- return C && t.top < window.innerHeight * e.options.preLoad && t.bottom > 0 && t.left < window.innerWidth * e.options.preLoad && t.right > 0
- },
- load() {
- this.show = !0,
- this.state.loaded = !0,
- this.$emit("show", this)
- },
- destroy() {
- return this.$destroy
- }
- }
- });
- const mp = {
- selector: "img"
- };
- class fp {
- constructor({el: e, binding: t, vnode: o, lazy: n}) {
- this.el = null,
- this.vnode = o,
- this.binding = t,
- this.options = {},
- this.lazy = n,
- this.queue = [],
- this.update({
- el: e,
- binding: t
- })
- }
- update({el: e, binding: t}) {
- this.el = e,
- this.options = Object.assign({}, mp, t.value);
- this.getImgs().forEach((e=>{
- this.lazy.add(e, Object.assign({}, this.binding, {
- value: {
- src: "dataset"in e ? e.dataset.src : e.getAttribute("data-src"),
- error: ("dataset"in e ? e.dataset.error : e.getAttribute("data-error")) || this.options.error,
- loading: ("dataset"in e ? e.dataset.loading : e.getAttribute("data-loading")) || this.options.loading
- }
- }), this.vnode)
- }
- ))
- }
- getImgs() {
- return Array.from(this.el.querySelectorAll(this.options.selector))
- }
- clear() {
- this.getImgs().forEach((e=>this.lazy.remove(e))),
- this.vnode = null,
- this.binding = null,
- this.lazy = null
- }
- }
- class vp {
- constructor({lazy: e}) {
- this.lazy = e,
- this.queue = []
- }
- bind(e, t, o) {
- const n = new fp({
- el: e,
- binding: t,
- vnode: o,
- lazy: this.lazy
- });
- this.queue.push(n)
- }
- update(e, t, o) {
- const n = this.queue.find((t=>t.el === e));
- n && n.update({
- el: e,
- binding: t,
- vnode: o
- })
- }
- unbind(e) {
- const t = this.queue.find((t=>t.el === e));
- t && (t.clear(),
- Fa(this.queue, t))
- }
- }
- var hp = e=>({
- props: {
- src: [String, Object],
- tag: {
- type: String,
- default: "img"
- }
- },
- render() {
- var e, o;
- return t.h(this.tag, {
- src: this.renderSrc
- }, null == (o = (e = this.$slots).default) ? void 0 : o.call(e))
- },
- data: ()=>({
- el: null,
- options: {
- src: "",
- error: "",
- loading: "",
- attempt: e.options.attempt
- },
- state: {
- loaded: !1,
- error: !1,
- attempt: 0
- },
- renderSrc: ""
- }),
- watch: {
- src() {
- this.init(),
- e.addLazyBox(this),
- e.lazyLoadHandler()
- }
- },
- created() {
- this.init(),
- this.renderSrc = this.options.loading
- },
- mounted() {
- this.el = this.$el,
- e.addLazyBox(this),
- e.lazyLoadHandler()
- },
- beforeUnmount() {
- e.removeComponent(this)
- },
- methods: {
- init() {
- const {src: t, loading: o, error: n} = e.valueFormatter(this.src);
- this.state.loaded = !1,
- this.options.src = t,
- this.options.error = n,
- this.options.loading = o,
- this.renderSrc = this.options.loading
- },
- checkInView() {
- const t = P(this.$el);
- return t.top < window.innerHeight * e.options.preLoad && t.bottom > 0 && t.left < window.innerWidth * e.options.preLoad && t.right > 0
- },
- load(e=c) {
- if (this.state.attempt > this.options.attempt - 1 && this.state.error)
- return void e();
- const {src: t} = this.options;
- Ya({
- src: t
- }, (({src: e})=>{
- this.renderSrc = e,
- this.state.loaded = !0
- }
- ), (()=>{
- this.state.attempt++,
- this.renderSrc = this.options.error,
- this.state.error = !0
- }
- ))
- }
- }
- });
- const gp = {
- install(e, o={}) {
- const n = class {
- constructor({preLoad: e, error: t, throttleWait: o, preLoadTop: n, dispatchEvent: a, loading: r, attempt: l, silent: i=!0, scale: s, listenEvents: c, filter: d, adapter: u, observer: p, observerOptions: m}) {
- this.mode = La,
- this.listeners = [],
- this.targetIndex = 0,
- this.targets = [],
- this.options = {
- silent: i,
- dispatchEvent: !!a,
- throttleWait: o || 200,
- preLoad: e || 1.3,
- preLoadTop: n || 0,
- error: t || cp,
- loading: r || cp,
- attempt: l || 3,
- scale: s || Ha(s),
- ListenEvents: c || dp,
- supportWebp: ja(),
- filter: d || {},
- adapter: u || {},
- observer: !!p,
- observerOptions: m || up
- },
- this.initEvent(),
- this.imageCache = new Ga({
- max: 200
- }),
- this.lazyLoadHandler = Wa(this.lazyLoadHandler.bind(this), this.options.throttleWait),
- this.setMode(this.options.observer ? Ma : La)
- }
- config(e={}) {
- Object.assign(this.options, e)
- }
- performance() {
- return this.listeners.map((e=>e.performance()))
- }
- addLazyBox(e) {
- this.listeners.push(e),
- C && (this.addListenerTarget(window),
- this.observer && this.observer.observe(e.el),
- e.$el && e.$el.parentNode && this.addListenerTarget(e.$el.parentNode))
- }
- add(e, o, n) {
- if (this.listeners.some((t=>t.el === e)))
- return this.update(e, o),
- t.nextTick(this.lazyLoadHandler);
- const a = this.valueFormatter(o.value);
- let {src: r} = a;
- t.nextTick((()=>{
- r = Ra(e, this.options.scale) || r,
- this.observer && this.observer.observe(e);
- const l = Object.keys(o.modifiers)[0];
- let i;
- l && (i = n.context.$refs[l],
- i = i ? i.$el || i : document.getElementById(l)),
- i || (i = G(e));
- const s = new sp({
- bindType: o.arg,
- $parent: i,
- el: e,
- src: r,
- loading: a.loading,
- error: a.error,
- cors: a.cors,
- elRenderer: this.elRenderer.bind(this),
- options: this.options,
- imageCache: this.imageCache
- });
- this.listeners.push(s),
- C && (this.addListenerTarget(window),
- this.addListenerTarget(i)),
- this.lazyLoadHandler(),
- t.nextTick((()=>this.lazyLoadHandler()))
- }
- ))
- }
- update(e, o, n) {
- const a = this.valueFormatter(o.value);
- let {src: r} = a;
- r = Ra(e, this.options.scale) || r;
- const l = this.listeners.find((t=>t.el === e));
- l ? l.update({
- src: r,
- error: a.error,
- loading: a.loading
- }) : this.add(e, o, n),
- this.observer && (this.observer.unobserve(e),
- this.observer.observe(e)),
- this.lazyLoadHandler(),
- t.nextTick((()=>this.lazyLoadHandler()))
- }
- remove(e) {
- if (!e)
- return;
- this.observer && this.observer.unobserve(e);
- const t = this.listeners.find((t=>t.el === e));
- t && (this.removeListenerTarget(t.$parent),
- this.removeListenerTarget(window),
- Fa(this.listeners, t),
- t.$destroy())
- }
- removeComponent(e) {
- e && (Fa(this.listeners, e),
- this.observer && this.observer.unobserve(e.el),
- e.$parent && e.$el.parentNode && this.removeListenerTarget(e.$el.parentNode),
- this.removeListenerTarget(window))
- }
- setMode(e) {
- $a || e !== Ma || (e = La),
- this.mode = e,
- e === La ? (this.observer && (this.listeners.forEach((e=>{
- this.observer.unobserve(e.el)
- }
- )),
- this.observer = null),
- this.targets.forEach((e=>{
- this.initListen(e.el, !0)
- }
- ))) : (this.targets.forEach((e=>{
- this.initListen(e.el, !1)
- }
- )),
- this.initIntersectionObserver())
- }
- addListenerTarget(e) {
- if (!e)
- return;
- let t = this.targets.find((t=>t.el === e));
- return t ? t.childrenCount++ : (t = {
- el: e,
- id: ++this.targetIndex,
- childrenCount: 1,
- listened: !0
- },
- this.mode === La && this.initListen(t.el, !0),
- this.targets.push(t)),
- this.targetIndex
- }
- removeListenerTarget(e) {
- this.targets.forEach(((t,o)=>{
- t.el === e && (t.childrenCount--,
- t.childrenCount || (this.initListen(t.el, !1),
- this.targets.splice(o, 1),
- t = null))
- }
- ))
- }
- initListen(e, t) {
- this.options.ListenEvents.forEach((o=>(t ? Ua : qa)(e, o, this.lazyLoadHandler)))
- }
- initEvent() {
- this.Event = {
- listeners: {
- loading: [],
- loaded: [],
- error: []
- }
- },
- this.$on = (e,t)=>{
- this.Event.listeners[e] || (this.Event.listeners[e] = []),
- this.Event.listeners[e].push(t)
- }
- ,
- this.$once = (e,t)=>{
- const o = (...n)=>{
- this.$off(e, o),
- t.apply(this, n)
- }
- ;
- this.$on(e, o)
- }
- ,
- this.$off = (e,t)=>{
- if (t)
- Fa(this.Event.listeners[e], t);
- else {
- if (!this.Event.listeners[e])
- return;
- this.Event.listeners[e].length = 0
- }
- }
- ,
- this.$emit = (e,t,o)=>{
- this.Event.listeners[e] && this.Event.listeners[e].forEach((e=>e(t, o)))
- }
- }
- lazyLoadHandler() {
- const e = [];
- this.listeners.forEach((t=>{
- t.el && t.el.parentNode || e.push(t),
- t.checkInView() && t.load()
- }
- )),
- e.forEach((e=>{
- Fa(this.listeners, e),
- e.$destroy()
- }
- ))
- }
- initIntersectionObserver() {
- $a && (this.observer = new IntersectionObserver(this.observerHandler.bind(this),this.options.observerOptions),
- this.listeners.length && this.listeners.forEach((e=>{
- this.observer.observe(e.el)
- }
- )))
- }
- observerHandler(e) {
- e.forEach((e=>{
- e.isIntersecting && this.listeners.forEach((t=>{
- if (t.el === e.target) {
- if (t.state.loaded)
- return this.observer.unobserve(t.el);
- t.load()
- }
- }
- ))
- }
- ))
- }
- elRenderer(e, t, o) {
- if (!e.el)
- return;
- const {el: n, bindType: a} = e;
- let r;
- switch (t) {
- case "loading":
- r = e.loading;
- break;
- case "error":
- r = e.error;
- break;
- default:
- ({src: r} = e)
- }
- if (a ? n.style[a] = 'url("' + r + '")' : n.getAttribute("src") !== r && n.setAttribute("src", r),
- n.setAttribute("lazy", t),
- this.$emit(t, e, o),
- this.options.adapter[t] && this.options.adapter[t](e, this.options),
- this.options.dispatchEvent) {
- const o = new CustomEvent(t,{
- detail: e
- });
- n.dispatchEvent(o)
- }
- }
- valueFormatter(e) {
- let t = e
- , {loading: o, error: n} = this.options;
- return a(e) && (({src: t} = e),
- o = e.loading || this.options.loading,
- n = e.error || this.options.error),
- {
- src: t,
- loading: o,
- error: n
- }
- }
- }
- , r = new n(o)
- , l = new vp({
- lazy: r
- });
- e.config.globalProperties.$Lazyload = r,
- o.lazyComponent && e.component("LazyComponent", pp(r)),
- o.lazyImage && e.component("LazyImage", hp(r)),
- e.directive("lazy", {
- beforeMount: r.add.bind(r),
- updated: r.update.bind(r),
- unmounted: r.remove.bind(r)
- }),
- e.directive("lazy-container", {
- beforeMount: l.bind.bind(l),
- updated: l.update.bind(l),
- unmounted: l.unbind.bind(l)
- })
- }
- }
- , bp = "4.0.3";
- function yp(e) {
- [_e, Pt, At, Jt, pa, Ea, pn, _a, rt, kt, xr, Dr, Er, gn, Fr, Xr, Zr, tl, dl, vl, wl, Vl, Sl, Il, Ll, Hl, Gl, Ql, si, pi, Ni, Bi, $i, Li, ni, On, Vn, ji, Yi, vt, Sr, as, ms, fs, ys, Vt, Se, Ns, Bs, $s, qs, Wt, _s, tc, sn, oc, Kc, Gt, ed, ld, Ba, ga, dd, ud, hd, Nd, Td, Id, nu, iu, pu, wu, ku, Su, xo, Ou, Do, Eu, jo, oa, Yo, Ru, Uu, Go, Va, Gu, Jn, _u, ip].forEach((t=>{
- t.install ? e.use(t) : t.name && e.component(t.name, t)
- }
- ))
- }
- var wp = {
- install: yp,
- version: bp
- };
- e.ActionBar = _e,
- e.ActionBarButton = Pt,
- e.ActionBarIcon = At,
- e.ActionSheet = Jt,
- e.AddressEdit = pa,
- e.AddressList = Ea,
- e.Area = pn,
- e.BackTop = _a,
- e.Badge = rt,
- e.Button = kt,
- e.Calendar = xr,
- e.Card = Dr,
- e.Cascader = Er,
- e.Cell = gn,
- e.CellGroup = Fr,
- e.Checkbox = Xr,
- e.CheckboxGroup = Zr,
- e.Circle = tl,
- e.Col = dl,
- e.Collapse = vl,
- e.CollapseItem = wl,
- e.ConfigProvider = Vl,
- e.ContactCard = Sl,
- e.ContactEdit = Il,
- e.ContactList = Ll,
- e.CountDown = Hl,
- e.Coupon = Gl,
- e.CouponCell = Ql,
- e.CouponList = si,
- e.DatePicker = pi,
- e.Dialog = Ni,
- e.Divider = Bi,
- e.DropdownItem = $i,
- e.DropdownMenu = Li,
- e.Empty = ni,
- e.Field = On,
- e.Form = Vn,
- e.Grid = ji,
- e.GridItem = Yi,
- e.Icon = vt,
- e.Image = Sr,
- e.ImagePreview = as,
- e.IndexAnchor = ms,
- e.IndexBar = fs,
- e.Lazyload = gp,
- e.List = ys,
- e.Loading = Vt,
- e.Locale = Se,
- e.NavBar = Ns,
- e.NoticeBar = Bs,
- e.Notify = $s,
- e.NumberKeyboard = qs,
- e.Overlay = Wt,
- e.Pagination = _s,
- e.PasswordInput = tc,
- e.Picker = sn,
- e.PickerGroup = oc,
- e.Popover = Kc,
- e.Popup = Gt,
- e.Progress = ed,
- e.PullRefresh = ld,
- e.Radio = Ba,
- e.RadioGroup = ga,
- e.Rate = dd,
- e.Row = ud,
- e.Search = hd,
- e.ShareSheet = Nd,
- e.Sidebar = Td,
- e.SidebarItem = Id,
- e.Skeleton = nu,
- e.SkeletonAvatar = tu,
- e.SkeletonImage = Qd,
- e.SkeletonParagraph = ou,
- e.SkeletonTitle = eu,
- e.Slider = iu,
- e.Space = pu,
- e.Step = wu,
- e.Stepper = ku,
- e.Steps = Su,
- e.Sticky = xo,
- e.SubmitBar = Ou,
- e.Swipe = Do,
- e.SwipeCell = Eu,
- e.SwipeItem = jo,
- e.Switch = oa,
- e.Tab = Yo,
- e.Tabbar = Ru,
- e.TabbarItem = Uu,
- e.Tabs = Go,
- e.Tag = Va,
- e.TimePicker = Gu,
- e.Toast = Jn,
- e.TreeSelect = _u,
- e.Uploader = ip,
- e.actionBarButtonProps = Tt,
- e.actionBarIconProps = It,
- e.actionBarProps = Ke,
- e.actionSheetProps = Kt,
- e.addressEditProps = ua,
- e.addressListProps = za,
- e.allowMultipleToast = (e=!0)=>{
- jn = e
- }
- ,
- e.areaProps = un,
- e.backTopProps = Ka,
- e.badgeProps = at,
- e.buttonProps = Ct,
- e.calendarProps = Vr,
- e.cardProps = Pr,
- e.cascaderProps = zr,
- e.cellGroupProps = Mr,
- e.cellProps = hn,
- e.checkboxGroupProps = jr,
- e.checkboxProps = Gr,
- e.circleProps = el,
- e.closeDialog = ()=>{
- yi && yi.toggle(!1)
- }
- ,
- e.closeNotify = Es,
- e.closeToast = e=>{
- var t;
- Hn.length && (e ? (Hn.forEach((e=>{
- e.close()
- }
- )),
- Hn = []) : jn ? null == (t = Hn.shift()) || t.close() : Hn[0].close())
- }
- ,
- e.colProps = cl,
- e.collapseItemProps = yl,
- e.collapseProps = fl,
- e.configProviderProps = dt,
- e.contactCardProps = kl,
- e.contactEditProps = Ol,
- e.contactListProps = $l,
- e.countDownProps = Rl,
- e.couponCellProps = _l,
- e.couponListProps = ii,
- e.datePickerProps = ui,
- e.default = wp,
- e.dialogProps = hi,
- e.dividerProps = Si,
- e.dropdownItemProps = Ei,
- e.dropdownMenuProps = Di,
- e.emptyProps = oi,
- e.fieldProps = Dn,
- e.formProps = wn,
- e.gridItemProps = qi,
- e.gridProps = Ri,
- e.iconProps = ft,
- e.imagePreviewProps = Qi,
- e.imageProps = kr,
- e.indexAnchorProps = ps,
- e.indexBarProps = is,
- e.install = yp,
- e.listProps = bs,
- e.loadingProps = wt,
- e.navBarProps = xs,
- e.noticeBarProps = Ss,
- e.notifyProps = Ds,
- e.numberKeyboardProps = Us,
- e.overlayProps = jt,
- e.paginationProps = Ks,
- e.passwordInputProps = ec,
- e.pickerGroupProps = _o,
- e.pickerProps = en,
- e.popoverProps = Zc,
- e.popupProps = Ut,
- e.progressProps = Qc,
- e.pullRefreshProps = rd,
- e.radioGroupProps = va,
- e.radioProps = Ca,
- e.rateProps = cd,
- e.resetDialogDefaultOptions = ()=>{
- Vi = d({}, wi)
- }
- ,
- e.resetNotifyDefaultOptions = ()=>{
- zs = {
- type: "danger",
- color: void 0,
- message: "",
- onClose: void 0,
- onClick: void 0,
- onOpened: void 0,
- duration: 3e3,
- position: void 0,
- className: "",
- lockScroll: !1,
- background: void 0
- }
- }
- ,
- e.resetToastDefaultOptions = e=>{
- "string" == typeof e ? Un.delete(e) : (Wn = d({}, Rn),
- Un.clear())
- }
- ,
- e.rowProps = rl,
- e.searchProps = vd,
- e.setDialogDefaultOptions = e=>{
- d(Vi, e)
- }
- ,
- e.setNotifyDefaultOptions = e=>d(zs, e),
- e.setToastDefaultOptions = function(e, t) {
- "string" == typeof e ? Un.set(e, t) : d(Wn, e)
- }
- ,
- e.shareSheetProps = xd,
- e.showConfirmDialog = e=>xi(d({
- showCancelButton: !0
- }, e)),
- e.showDialog = xi,
- e.showFailToast = _n,
- e.showImagePreview = ns,
- e.showLoadingToast = Zn,
- e.showNotify = function(e) {
- var o;
- if (u)
- return As || ({instance: As} = Fn({
- setup() {
- const {state: e, toggle: o} = Mn();
- return ()=>t.createVNode(Os, t.mergeProps(e, {
- "onUpdate:show": o
- }), null)
- }
- })),
- e = d({}, zs, a(o = e) ? o : {
- message: o
- }),
- As.open(e),
- clearTimeout(Is),
- e.duration > 0 && (Is = setTimeout(Es, e.duration)),
- As
- }
- ,
- e.showSuccessToast = Kn,
- e.showToast = Gn,
- e.sidebarItemProps = Od,
- e.sidebarProps = Bd,
- e.skeletonAvatarProps = Fd,
- e.skeletonImageProps = Jd,
- e.skeletonParagraphProps = jd,
- e.skeletonProps = Xd,
- e.skeletonTitleProps = Ed,
- e.sliderProps = lu,
- e.spaceProps = du,
- e.stepperProps = Cu,
- e.stepsProps = vu,
- e.stickyProps = Vo,
- e.submitBarProps = Du,
- e.swipeCellProps = zu,
- e.swipeProps = To,
- e.switchProps = ta,
- e.tabProps = qo,
- e.tabbarItemProps = Wu,
- e.tabbarProps = Mu,
- e.tabsProps = $o,
- e.tagProps = wa,
- e.timePickerProps = Yu,
- e.toastProps = $n,
- e.treeSelectProps = Ku,
- e.uploaderProps = lp,
- e.version = bp,
- Object.defineProperties(e, {
- __esModule: {
- value: !0
- },
- [Symbol.toStringTag]: {
- value: "Module"
- }
- })
- }
- ));
|